summaryrefslogtreecommitdiff
path: root/g
blob: 0d899b4a7fe280d4f10ba492fc366815e3d98cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
#!/usr/bin/env bash
#
# Wrapper for git to handle more subdirs at the same time
#

if [ -n "$g_debug" ] ; then
    set -x
fi

SUBMODULES_ALL="dictionaries helpcontent2 translations"

pushd $(dirname $0) > /dev/null
if [ -f config_host.mk ] ; then
    # we are in the BUILDDIR
    SRC_ROOT=$(cat config_host.mk | grep SRC_ROOT | sed -e "s/.*=//")
else
    SRC_ROOT=$(pwd)
fi
popd > /dev/null

COREDIR="$SRC_ROOT"

usage()
{
    git
    echo
    echo "Usage: g [options] [git (checkout|clone|fetch|grep|pull|push|reset) [git options/args..]]"
    echo ""
    echo " -z restore the git hooks and do other sanity checks"
}

refresh_submodule_hooks()
{
local repo=$1
local hook
local hook_name

    if [ -d ${repo?}/.git ] ; then
        # use core's hook by default
	for hook_name in $(ls -1 ${COREDIR?}/.git-hooks) ; do
            hook="${repo?}/.git/hooks/${hook_name?}"
            if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
		rm -f "${hook?}"
		ln -sf "${COREDIR?}/.git-hooks/${hook_name?}" "${hook?}"
            fi
	done
        # override if need be by the submodules' own hooks
	for hook_name in $(ls -1 ${COREDIR?}/${repo?}/.git-hooks 2>/dev/null) ; do
            hook="${repo?}/.git/hooks/${hook_name?}"
            if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
		rm -f "${hook?}"
		ln -sf "${COREDIR?}/${repo?}/.git-hooks/${hook_name?}" "${hook?}"
	    fi
	done
    elif [ -d .git/modules/${repo}/hooks ] ; then
	for hook_name in $(ls -1 ${COREDIR?}/.git-hooks) ; do
            hook=".git/modules/${repo?}/hooks/${hook_name?}"
            if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
		rm -f "${hook?}"
		ln -sf "${COREDIR?}/.git-hooks/${hook_name?}" "${hook?}"
            fi
	done
        # override if need be by the submodules' own hooks
	for hook_name in $(ls -1 ${COREDIR?}/${repo?}/.git-hooks 2>/dev/null) ; do
            hook=".git/modules/${repo?}/hooks/${hook_name?}"
            if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
		rm -f "${hook?}"
		ln -sf "${COREDIR?}/${repo?}/.git-hooks/${hook_name?}" "${hook?}"
	    fi
	done
    fi

}

refresh_all_hooks()
{
local repo
local hook_name
local hook

    pushd ${COREDIR?} > /dev/null
    for hook_name in $(ls -1 ${COREDIR?}/.git-hooks) ; do
        hook=".git/hooks/${hook_name?}"
        if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
            rm -f "${hook?}"
            ln -sf "${COREDIR?}/.git-hooks/${hook_name?}" "${hook?}"
        fi
    done

    for repo in ${SUBMODULES_ALL?} ; do
        refresh_submodule_hooks $repo
    done
    # In our workflow, it's always gerrit that does the submodule updates, so
    # better ignoring them to avoid accidentally including those changes in our
    # commits.
    # 'git submodule status' can be still used to see if a submodule has such
    # changes.
    for repo in ${SUBMODULES_CONFIGURED?} ; do
        git config submodule.$repo.ignore all
    done
    popd > /dev/null

}

set_push_url()
{
local repo

    repo="$1"
    if [ -n "$repo" ] ; then
	pushd "${COREDIR?}/${repo?}" > /dev/null
    else
	pushd "${COREDIR?}" > /dev/null
	repo="core"
    fi
    echo "setting up push url for ${repo?}"
    if [ "${repo?}" = "helpcontent2" ] ; then
	git config remote.origin.pushurl "ssh://${PUSH_USER}logerrit/help"
    else
	git config remote.origin.pushurl "ssh://${PUSH_USER}logerrit/${repo?}"
    fi
    popd > /dev/null
}

set_push_urls()
{
    PUSH_USER="$1"
    set_push_url
    for repo in ${SUBMODULES_ACTIVE?} ; do
	set_push_url "${repo?}"
    done
}

get_active_submodules()
{
SUBMODULES_ACTIVE=""
local repo

    for repo in ${SUBMODULES_ALL?} ; do
	if [ -d ${repo?}/.git -o -f ${repo?}/.git ] ; then
	    SUBMODULES_ACTIVE="${repo?} ${SUBMODULES_ACTIVE?}"
	fi
    done
}

get_configured_submodules()
{
    SUBMODULES_CONFIGURED=""
    if [ -f config_host.mk ] ; then
	SUBMODULES_CONFIGURED=$(cat config_host.mk | grep GIT_NEEDED_SUBMODULES | sed -e "s/.*=//")
    else
	# if we need the configured submoduel before the configuration is done. we assumed you want them all
	SUBMODULES_CONFIGURED=${SUBMODULES_ALL?}
    fi
}

get_git_reference()
{
    REFERENCED_GIT=""
    if [ -f config_host.mk ]; then
	REFERENCED_GIT=$(cat config_host.mk | grep GIT_REFERENCE_SRC | sed -e "s/.*=//")
    fi
    LINKED_GIT=""
    if [ -f config_host.mk ]; then
	LINKED_GIT=$(cat config_host.mk | grep GIT_LINK_SRC | sed -e "s/.*=//")
    fi
}

do_shortcut_update()
{
local module
local repo

    for module in $SUBMODULES_CONFIGURED ; do
	if [ ! -d ${module?}/.git ] ; then
	    case "${module?}" in
		helpcontent2)
		    if [ -d clone/help/.git ] ; then
			repo="clone/help/.git"
		    fi
		    ;;
		*)
		    if [ -d clone/${module?}/.git ] ; then
			repo="clone/${module?}/.git"
		    fi
		    ;;
	    esac
	    if [ -n "$repo" ] ; then
		cp -r "${repo?}" "${module?}/."
	    fi
	fi
    done
}

do_git_cmd()
{
    echo "cmd:$@"
    git "$@"
    git submodule foreach git "$@" $KEEP_GOING
}

do_checkout()
{
local cmd
local create_branch="0"
local branch
local module

    git checkout "$@" || return $?
    for cmd in "$@" ; do
	if [ "$cmd" = "-f" ]; then
	    return 0
	elif [ "$cmd" = "-b" ] ; then
	    create_branch=1
	elif [ "$create_branch" = "1" ] ; then
	    branch="$arg"
	    create_branch=0
	fi
    done
    if [ -f .gitmodules ] ; then
	git submodule update
	if [ -n "$branch" ] ; then
	    git submodules foreach git checkout -b ${branch} HEAD || return $?
	fi
    else
	# now that is the nasty case we moved prior to submodules
	# delete the submodules left over if any
	for module in $SUBMODULES_ALL ; do
	    echo "clean-up submodule $module"
	    rm -fr ${module}
	done
	# make sure we have the needed repo in clone
	./g clone && ./g -f checkout "$@" || return $?
    fi
    return $?
}

do_reset()
{
    git reset "$@" || return $?
    if [ -f .gitmodules ] ; then
	git submodule update || return $?
    else
	# now that is the nasty case we moved prior to submodules
	# delete the submodules left over if any
	for module in $SUBMODULES_ALL ; do
	    echo "clean-up submodule $module"
	    rm -fr ${module}
	done
	# make sure we have the needed repo in clone
	./g clone && ./g -f reset "$@"
    fi
    return $?;
}

do_init_modules()
{
local module
local configured

    do_shortcut_update

    for module in $SUBMODULES_CONFIGURED ; do
	if [ -n "$LINKED_GIT" ] ; then
	    if ! [ -d ".git/modules/${module}" ]; then
		./bin/git-new-module-workdir "${LINKED_GIT}/${module}" "${module}"
	    fi
	fi
	configured=$(git config --local --get submodule.${module}.url)
	if [ -z "$configured" ] ; then
	    git submodule init $module || return $?
	fi
    done
    for module in $SUBMODULES_CONFIGURED ; do
        if [ -n "$REFERENCED_GIT" ] ; then
            git submodule update --reference $REFERENCED_GIT/.git/modules/$module $module || return $?
        else
            git submodule update $module || return $?
        fi
    done
    return 0
}


# no params, no action
if [ "$#" -eq "0" ] ; then
    usage
fi

if [ ! "`type -p git`" ]; then
    echo "Cannot find the git binary! Is git installed and is in PATH?"
    exit 1
fi


get_active_submodules
get_configured_submodules
get_git_reference




# extra params for some commands, like log
EXTRA=
COMMAND="$1"
PAGER=
RELATIVIZE=1
PUSH_ALL=
PUSH_USER=
PUSH_NOTES=
LAST_WORKING=
SET_LAST_WORKING=
ALLOW_EMPTY=
KEEP_GOING=
REPORT_REPOS=1
REPORT_COMMANDS=0
REPORT_COMPACT=0
DO_HOOK_REFRESH=false

while [ "${COMMAND:0:1}" = "-" ] ; do
    case "$COMMAND" in
        -f )KEEP_GOING="||:"
            ;;
        -z)
	    refresh_all_hooks
	    exit 0;
            ;;
	--set-push-urls)
	    shift
	    PUSH_USER="$1"
	    if [ -n "${PUSH_USER}" ] ; then
		PUSH_USER="${PUSH_USER}@"
	    fi
	    set_push_urls "$PUSH_USER"
	    exit 0;
	    ;;
	-*)
	    echo "option: $COMMAND not supported" 1>&2
	    exit 1
    esac
    shift
    COMMAND="$1"
done

shift

case "$COMMAND" in
    branch)
	do_git_cmd ${COMMAND} "$@"
	;;
    checkout)
	do_checkout "$@"
	;;
    clone)
	do_init_modules && refresh_all_hooks
        ;;
    fetch)
	(git fetch "$@" && git submodule foreach git fetch "$@" ) && git submodule update

	;;
    grep)
        KEEP_GOING="||:"
	do_git_cmd ${COMMAND} "$@"
	;;
    pull)
	git pull "$@" && git submodule update && refresh_all_hooks
	;;
    push)
	git submodule foreach git push "$@"
	if [ "$?" = "0" ] ; then
	    git push "$@"
	fi
	;;
    reset)
	do_reset
	;;
    tag)
	do_git_cmd ${COMMAND} "$@"
	;;
	"")
	;;
    *)
	echo "./g does not support command: $COMMAND" 1>&2
	exit 1;
        ;;
esac

exit $?

# vi:set shiftwidth=4 expandtab:
ce6308e4fad2281241bf4ca78280eba29f744d43'>sc/inc/chgtrack.hxx248
-rw-r--r--sc/inc/chgviset.hxx18
-rw-r--r--sc/inc/clipparam.hxx5
-rw-r--r--sc/inc/collect.hxx12
-rw-r--r--sc/inc/column.hxx267
-rw-r--r--sc/inc/compiler.hxx61
-rw-r--r--sc/inc/compressedarray.hxx258
-rw-r--r--sc/inc/conditio.hxx63
-rw-r--r--sc/inc/confuno.hxx2
-rw-r--r--sc/inc/consoli.hxx27
-rw-r--r--sc/inc/convuno.hxx2
-rw-r--r--sc/inc/cursuno.hxx2
-rw-r--r--sc/inc/dapiuno.hxx2
-rw-r--r--sc/inc/datauno.hxx47
-rw-r--r--sc/inc/dbcolect.hxx32
-rw-r--r--sc/inc/dbdocutl.hxx14
-rw-r--r--sc/inc/dbtoken.hxx2
-rw-r--r--sc/inc/defltuno.hxx2
-rw-r--r--sc/inc/detdata.hxx5
-rw-r--r--sc/inc/detfunc.hxx10
-rw-r--r--sc/inc/dispuno.hxx2
-rw-r--r--sc/inc/dociter.hxx104
-rw-r--r--sc/inc/docoptio.hxx94
-rw-r--r--sc/inc/docparam.hxx (renamed from sc/inc/unoguard.hxx)23
-rw-r--r--sc/inc/docpool.hxx7
-rw-r--r--sc/inc/document.hxx353
-rw-r--r--sc/inc/docuno.hxx7
-rw-r--r--sc/inc/dpcachetable.hxx122
-rw-r--r--sc/inc/dpdimsave.hxx2
-rw-r--r--sc/inc/dpglobal.hxx69
-rw-r--r--sc/inc/dpgroup.hxx43
-rw-r--r--sc/inc/dpobject.hxx86
-rw-r--r--sc/inc/dpoutput.hxx4
-rw-r--r--sc/inc/dpoutputgeometry.hxx3
-rw-r--r--sc/inc/dpsave.hxx395
-rw-r--r--sc/inc/dpsdbtab.hxx41
-rw-r--r--sc/inc/dpshttab.hxx100
-rw-r--r--sc/inc/dptabdat.hxx43
-rw-r--r--sc/inc/dptablecache.hxx108
-rw-r--r--sc/inc/dptabres.hxx77
-rw-r--r--sc/inc/dptabsrc.hxx59
-rw-r--r--sc/inc/drawattr.hxx2
-rw-r--r--sc/inc/drawpage.hxx6
-rw-r--r--sc/inc/drdefuno.hxx2
-rw-r--r--sc/inc/drwlayer.hxx44
-rw-r--r--sc/inc/editsrc.hxx4
-rw-r--r--sc/inc/editutil.hxx32
-rw-r--r--[-rwxr-xr-x]sc/inc/eventuno.hxx5
-rw-r--r--sc/inc/externalrefmgr.hxx90
-rw-r--r--sc/inc/fielduno.hxx8
-rw-r--r--sc/inc/fillinfo.hxx2
-rw-r--r--sc/inc/filter.hxx52
-rw-r--r--sc/inc/filtopt.hxx2
-rw-r--r--sc/inc/filtuno.hxx2
-rw-r--r--sc/inc/fmtuno.hxx25
-rw-r--r--sc/inc/forbiuno.hxx2
-rw-r--r--sc/inc/formulaparserpool.hxx6
-rw-r--r--sc/inc/formularesult.hxx3
-rw-r--r--sc/inc/funcdesc.hxx418
-rw-r--r--sc/inc/funcuno.hxx2
-rw-r--r--sc/inc/global.hxx225
-rw-r--r--sc/inc/globstr.hrc36
-rw-r--r--sc/inc/hints.hxx6
-rw-r--r--sc/inc/inputopt.hxx2
-rw-r--r--sc/inc/linkuno.hxx4
-rw-r--r--sc/inc/listenercalls.hxx2
-rw-r--r--sc/inc/lookupcache.hxx9
-rw-r--r--sc/inc/macromgr.hxx70
-rw-r--r--sc/inc/markarr.hxx5
-rw-r--r--sc/inc/markdata.hxx28
-rw-r--r--sc/inc/miscuno.hxx121
-rw-r--r--sc/inc/mutexhlp.hxx2
-rw-r--r--sc/inc/nameuno.hxx60
-rw-r--r--sc/inc/navicfg.hxx2
-rw-r--r--sc/inc/notesuno.hxx2
-rw-r--r--sc/inc/olinetab.hxx8
-rw-r--r--sc/inc/optuno.hxx2
-rw-r--r--sc/inc/optutil.hxx10
-rw-r--r--sc/inc/pagepar.hxx2
-rw-r--r--sc/inc/pageuno.hxx2
-rw-r--r--sc/inc/paramisc.hxx2
-rw-r--r--sc/inc/patattr.hxx18
-rw-r--r--[-rwxr-xr-x]sc/inc/pch/precompiled_sc.cxx3
-rwxr-xr-xsc/inc/pch/precompiled_sc.hxx8
-rw-r--r--sc/inc/pivot.hxx74
-rw-r--r--sc/inc/postit.hxx3
-rw-r--r--sc/inc/printopt.hxx4
-rw-r--r--sc/inc/prnsave.hxx2
-rw-r--r--sc/inc/progress.hxx18
-rw-r--r--sc/inc/queryparam.hxx14
-rw-r--r--sc/inc/rangelst.hxx111
-rw-r--r--sc/inc/rangenam.hxx100
-rw-r--r--sc/inc/rangeseq.hxx4
-rw-r--r--sc/inc/rangeutl.hxx31
-rw-r--r--sc/inc/rechead.hxx62
-rw-r--r--sc/inc/recursionhelper.hxx3
-rw-r--r--sc/inc/refdata.hxx19
-rw-r--r--sc/inc/reffind.hxx4
-rw-r--r--sc/inc/refreshtimer.hxx178
-rw-r--r--sc/inc/reftokenhelper.hxx26
-rw-r--r--sc/inc/sc.hrc123
-rw-r--r--sc/inc/scabstdlg.hxx60
-rw-r--r--sc/inc/scdll.hxx21
-rw-r--r--sc/inc/scdllapi.h3
-rw-r--r--sc/inc/scerrors.hxx2
-rw-r--r--sc/inc/scextopt.hxx3
-rw-r--r--sc/inc/scitems.hxx164
-rw-r--r--sc/inc/scmatrix.hxx355
-rw-r--r--sc/inc/scmod.hxx37
-rw-r--r--sc/inc/scresid.hxx2
-rw-r--r--sc/inc/scwarngs.hxx2
-rw-r--r--sc/inc/segmenttree.hxx20
-rw-r--r--sc/inc/servuno.hxx9
-rw-r--r--sc/inc/shapeuno.hxx4
-rw-r--r--sc/inc/sheetdata.hxx6
-rw-r--r--sc/inc/sheetevents.hxx5
-rw-r--r--sc/inc/shellids.hxx2
-rw-r--r--sc/inc/simplerangelist.hxx82
-rw-r--r--sc/inc/sortparam.hxx4
-rw-r--r--sc/inc/srchuno.hxx2
-rw-r--r--sc/inc/stlpool.hxx4
-rw-r--r--sc/inc/stlsheet.hxx2
-rw-r--r--sc/inc/stringutil.hxx43
-rw-r--r--sc/inc/strload.hxx2
-rw-r--r--sc/inc/styleuno.hxx9
-rw-r--r--sc/inc/subtotal.hxx4
-rw-r--r--sc/inc/tabbgcolor.hxx9
-rw-r--r--sc/inc/table.hxx103
-rw-r--r--sc/inc/tablink.hxx9
-rw-r--r--sc/inc/tabopparams.hxx15
-rw-r--r--sc/inc/tabprotection.hxx47
-rw-r--r--sc/inc/targuno.hxx2
-rw-r--r--sc/inc/textuno.hxx2
-rw-r--r--sc/inc/token.hxx32
-rw-r--r--sc/inc/tokenarray.hxx5
-rw-r--r--sc/inc/tokenuno.hxx2
-rw-r--r--sc/inc/types.hxx41
-rw-r--r--sc/inc/unitconv.hxx2
-rw-r--r--sc/inc/unonames.hxx21
-rw-r--r--sc/inc/unoreflist.hxx2
-rw-r--r--sc/inc/unowids.hxx2
-rw-r--r--sc/inc/userdat.hxx11
-rw-r--r--sc/inc/userlist.hxx2
-rw-r--r--sc/inc/validat.hxx6
-rw-r--r--sc/inc/viewopti.hxx6
-rw-r--r--sc/inc/viewuno.hxx8
-rw-r--r--sc/inc/waitoff.hxx9
-rw-r--r--sc/inc/warnpassword.hxx2
-rw-r--r--sc/inc/xmlwrap.hxx4
-rw-r--r--sc/inc/zforauto.hxx2
-rw-r--r--sc/prj/build.lst17
-rw-r--r--sc/qa/complex/sc/CalcRTL.java2
-rw-r--r--sc/qa/unit/CVE/CVE-2007-5745-1.wb2bin0 -> 45006 bytes-rw-r--r--sc/qa/unit/CVE/CVE-2007-5745-2.wb2bin0 -> 45006 bytes-rw-r--r--sc/qa/unit/CVE/CVE-2007-5747-1.wb2bin0 -> 5409 bytes-rw-r--r--sc/qa/unit/makefile.mk119
-rw-r--r--sc/qa/unit/ucalc.cxx1361
-rw-r--r--sc/qa/unit/version.map (renamed from sc/addin/makefile.mk)25
-rw-r--r--sc/sdi/cellsh.sdi5
-rw-r--r--sc/sdi/docsh.sdi1
-rw-r--r--sc/sdi/drawsh.sdi6
-rw-r--r--sc/sdi/formatsh.sdi10
-rw-r--r--sc/sdi/makefile.mk1
-rw-r--r--sc/sdi/scalc.sdi246
-rw-r--r--sc/source/core/data/attarray.cxx586
-rw-r--r--sc/source/core/data/attrib.cxx161
-rw-r--r--sc/source/core/data/autonamecache.cxx4
-rw-r--r--sc/source/core/data/bcaslot.cxx30
-rw-r--r--sc/source/core/data/cell.cxx406
-rw-r--r--sc/source/core/data/cell2.cxx260
-rw-r--r--sc/source/core/data/clipparam.cxx38
-rw-r--r--sc/source/core/data/column.cxx355
-rw-r--r--sc/source/core/data/column2.cxx441
-rw-r--r--sc/source/core/data/column3.cxx497
-rw-r--r--sc/source/core/data/compressedarray.cxx415
-rw-r--r--sc/source/core/data/conditio.cxx299
-rw-r--r--sc/source/core/data/dbdocutl.cxx27
-rwxr-xr-xsc/source/core/data/dociter.cxx220
-rw-r--r--sc/source/core/data/docparam.cxx (renamed from sc/source/ui/unoobj/unoguard.cxx)22
-rw-r--r--sc/source/core/data/docpool.cxx84
-rw-r--r--sc/source/core/data/documen2.cxx257
-rw-r--r--sc/source/core/data/documen3.cxx362
-rw-r--r--sc/source/core/data/documen4.cxx56
-rw-r--r--sc/source/core/data/documen5.cxx66
-rw-r--r--sc/source/core/data/documen6.cxx7
-rw-r--r--sc/source/core/data/documen7.cxx25
-rw-r--r--sc/source/core/data/documen8.cxx108
-rw-r--r--sc/source/core/data/documen9.cxx127
-rw-r--r--sc/source/core/data/document.cxx902
-rw-r--r--sc/source/core/data/dpcachetable.cxx112
-rw-r--r--sc/source/core/data/dpdimsave.cxx8
-rw-r--r--sc/source/core/data/dpglobal.cxx61
-rw-r--r--sc/source/core/data/dpgroup.cxx123
-rw-r--r--sc/source/core/data/dpobject.cxx819
-rw-r--r--sc/source/core/data/dpoutput.cxx184
-rw-r--r--sc/source/core/data/dpoutputgeometry.cxx3
-rw-r--r--sc/source/core/data/dpsave.cxx564
-rw-r--r--sc/source/core/data/dpsdbtab.cxx107
-rw-r--r--sc/source/core/data/dpshttab.cxx189
-rw-r--r--sc/source/core/data/dptabdat.cxx67
-rw-r--r--sc/source/core/data/dptablecache.cxx981
-rw-r--r--sc/source/core/data/dptabres.cxx205
-rw-r--r--sc/source/core/data/dptabsrc.cxx242
-rw-r--r--sc/source/core/data/drawpage.cxx6
-rw-r--r--sc/source/core/data/drwlayer.cxx678
-rw-r--r--sc/source/core/data/fillinfo.cxx74
-rw-r--r--sc/source/core/data/funcdesc.cxx889
-rw-r--r--sc/source/core/data/global.cxx862
-rw-r--r--sc/source/core/data/global2.cxx181
-rw-r--r--sc/source/core/data/globalx.cxx7
-rw-r--r--sc/source/core/data/makefile.mk115
-rw-r--r--sc/source/core/data/markarr.cxx37
-rw-r--r--sc/source/core/data/markdata.cxx63
-rw-r--r--sc/source/core/data/olinetab.cxx96
-rw-r--r--sc/source/core/data/pagepar.cxx7
-rw-r--r--sc/source/core/data/patattr.cxx55
-rw-r--r--sc/source/core/data/pivot2.cxx7
-rw-r--r--sc/source/core/data/poolhelp.cxx2
-rw-r--r--sc/source/core/data/postit.cxx18
-rw-r--r--sc/source/core/data/scdpoutputimpl.cxx16
-rw-r--r--sc/source/core/data/scdpoutputimpl.hxx8
-rw-r--r--sc/source/core/data/segmenttree.cxx141
-rw-r--r--sc/source/core/data/sheetevents.cxx8
-rw-r--r--sc/source/core/data/sortparam.cxx42
-rw-r--r--sc/source/core/data/stlpool.cxx148
-rw-r--r--sc/source/core/data/stlsheet.cxx39
-rw-r--r--sc/source/core/data/tabbgcolor.cxx16
-rw-r--r--sc/source/core/data/table1.cxx461
-rw-r--r--sc/source/core/data/table2.cxx707
-rw-r--r--sc/source/core/data/table3.cxx334
-rw-r--r--sc/source/core/data/table4.cxx175
-rw-r--r--sc/source/core/data/table5.cxx114
-rw-r--r--sc/source/core/data/table6.cxx393
-rw-r--r--sc/source/core/data/tabprotection.cxx176
-rw-r--r--sc/source/core/data/userdat.cxx4
-rw-r--r--sc/source/core/data/validat.cxx93
-rw-r--r--sc/source/core/inc/addinhelpid.hxx2
-rw-r--r--sc/source/core/inc/addinlis.hxx71
-rw-r--r--sc/source/core/inc/adiasync.hxx3
-rw-r--r--sc/source/core/inc/bcaslot.hxx11
-rw-r--r--sc/source/core/inc/cellkeytranslator.hxx7
-rw-r--r--sc/source/core/inc/core_pch.hxx11
-rw-r--r--sc/source/core/inc/ddelink.hxx6
-rw-r--r--sc/source/core/inc/doubleref.hxx6
-rw-r--r--sc/source/core/inc/interpre.hxx118
-rw-r--r--sc/source/core/inc/jumpmatrix.hxx8
-rw-r--r--sc/source/core/inc/parclass.hxx2
-rw-r--r--sc/source/core/inc/poolhelp.hxx6
-rw-r--r--sc/source/core/inc/refupdat.hxx2
-rw-r--r--sc/source/core/inc/scrdata.hxx2
-rw-r--r--sc/source/core/src/compiler.src4
-rw-r--r--sc/source/core/src/makefile.mk2
-rw-r--r--sc/source/core/tool/addincfg.cxx6
-rw-r--r--sc/source/core/tool/addincol.cxx138
-rw-r--r--sc/source/core/tool/addinhelpid.cxx11
-rw-r--r--sc/source/core/tool/addinlis.cxx93
-rw-r--r--sc/source/core/tool/address.cxx100
-rw-r--r--sc/source/core/tool/adiasync.cxx6
-rw-r--r--sc/source/core/tool/appoptio.cxx23
-rw-r--r--sc/source/core/tool/autoform.cxx75
-rw-r--r--sc/source/core/tool/callform.cxx43
-rw-r--r--sc/source/core/tool/cellform.cxx16
-rw-r--r--sc/source/core/tool/cellkeytranslator.cxx5
-rw-r--r--sc/source/core/tool/cellkeywords.inl6
-rw-r--r--sc/source/core/tool/chartarr.cxx118
-rw-r--r--sc/source/core/tool/charthelper.cxx186
-rw-r--r--sc/source/core/tool/chartlis.cxx79
-rw-r--r--sc/source/core/tool/chartlock.cxx9
-rw-r--r--sc/source/core/tool/chartpos.cxx122
-rw-r--r--sc/source/core/tool/chgtrack.cxx408
-rw-r--r--sc/source/core/tool/chgviset.cxx15
-rw-r--r--sc/source/core/tool/collect.cxx40
-rw-r--r--sc/source/core/tool/compiler.cxx427
-rw-r--r--sc/source/core/tool/consoli.cxx54
-rw-r--r--sc/source/core/tool/dbcolect.cxx66
-rw-r--r--sc/source/core/tool/ddelink.cxx38
-rw-r--r--sc/source/core/tool/detdata.cxx6
-rw-r--r--sc/source/core/tool/detfunc.cxx166
-rw-r--r--sc/source/core/tool/docoptio.cxx321
-rw-r--r--sc/source/core/tool/doubleref.cxx46
-rw-r--r--sc/source/core/tool/editutil.cxx62
-rw-r--r--sc/source/core/tool/filtopt.cxx16
-rw-r--r--sc/source/core/tool/formulaparserpool.cxx8
-rw-r--r--sc/source/core/tool/hints.cxx6
-rw-r--r--sc/source/core/tool/inputopt.cxx24
-rw-r--r--sc/source/core/tool/interpr1.cxx1392
-rw-r--r--sc/source/core/tool/interpr2.cxx101
-rw-r--r--sc/source/core/tool/interpr3.cxx206
-rwxr-xr-xsc/source/core/tool/interpr4.cxx919
-rw-r--r--sc/source/core/tool/interpr5.cxx1958
-rw-r--r--sc/source/core/tool/interpr6.cxx5
-rw-r--r--sc/source/core/tool/interpr7.cxx38
-rw-r--r--sc/source/core/tool/lookupcache.cxx42
-rw-r--r--sc/source/core/tool/makefile.mk58
-rw-r--r--sc/source/core/tool/navicfg.cxx4
-rw-r--r--sc/source/core/tool/odffmap.cxx8
-rw-r--r--sc/source/core/tool/optutil.cxx4
-rw-r--r--sc/source/core/tool/parclass.cxx19
-rw-r--r--sc/source/core/tool/printopt.cxx15
-rw-r--r--sc/source/core/tool/prnsave.cxx6
-rw-r--r--sc/source/core/tool/progress.cxx18
-rw-r--r--sc/source/core/tool/queryparam.cxx44
-rw-r--r--sc/source/core/tool/rangelst.cxx772
-rw-r--r--sc/source/core/tool/rangenam.cxx339
-rw-r--r--sc/source/core/tool/rangeseq.cxx33
-rw-r--r--sc/source/core/tool/rangeutl.cxx162
-rw-r--r--sc/source/core/tool/rechead.cxx6
-rw-r--r--sc/source/core/tool/refdata.cxx111
-rw-r--r--sc/source/core/tool/reffind.cxx17
-rw-r--r--sc/source/core/tool/refreshtimer.cxx8
-rw-r--r--sc/source/core/tool/reftokenhelper.cxx89
-rw-r--r--sc/source/core/tool/refupdat.cxx42
-rw-r--r--sc/source/core/tool/scmatrix.cxx1526
-rw-r--r--sc/source/core/tool/simplerangelist.cxx243
-rw-r--r--sc/source/core/tool/stringutil.cxx46
-rw-r--r--sc/source/core/tool/subtotal.cxx9
-rw-r--r--sc/source/core/tool/token.cxx136
-rw-r--r--sc/source/core/tool/unitconv.cxx18
-rw-r--r--sc/source/core/tool/userlist.cxx8
-rw-r--r--sc/source/core/tool/viewopti.cxx35
-rw-r--r--sc/source/core/tool/zforauto.cxx7
-rw-r--r--sc/source/filter/dif/difexp.cxx6
-rw-r--r--sc/source/filter/dif/difimp.cxx125
-rw-r--r--sc/source/filter/dif/makefile.mk8
-rw-r--r--sc/source/filter/excel/colrowst.cxx214
-rw-r--r--sc/source/filter/excel/excdoc.cxx121
-rw-r--r--sc/source/filter/excel/excel.cxx31
-rw-r--r--sc/source/filter/excel/excform.cxx140
-rw-r--r--sc/source/filter/excel/excform8.cxx62
-rw-r--r--sc/source/filter/excel/excimp8.cxx214
-rw-r--r--sc/source/filter/excel/excrecds.cxx48
-rw-r--r--sc/source/filter/excel/exctools.cxx300
-rw-r--r--sc/source/filter/excel/expop2.cxx74
-rw-r--r--sc/source/filter/excel/fontbuff.cxx2
-rw-r--r--sc/source/filter/excel/frmbase.cxx107
-rw-r--r--sc/source/filter/excel/impop.cxx98
-rw-r--r--sc/source/filter/excel/makefile.mk123
-rw-r--r--sc/source/filter/excel/namebuff.cxx10
-rw-r--r--sc/source/filter/excel/read.cxx102
-rw-r--r--sc/source/filter/excel/tokstack.cxx49
-rw-r--r--sc/source/filter/excel/xechart.cxx123
-rw-r--r--sc/source/filter/excel/xecontent.cxx74
-rw-r--r--sc/source/filter/excel/xeescher.cxx432
-rw-r--r--sc/source/filter/excel/xeformula.cxx55
-rw-r--r--sc/source/filter/excel/xehelper.cxx57
-rw-r--r--sc/source/filter/excel/xelink.cxx36
-rw-r--r--sc/source/filter/excel/xename.cxx42
-rw-r--r--sc/source/filter/excel/xepage.cxx52
-rw-r--r--sc/source/filter/excel/xepivot.cxx233
-rw-r--r--sc/source/filter/excel/xerecord.cxx2
-rw-r--r--sc/source/filter/excel/xeroot.cxx38
-rw-r--r--sc/source/filter/excel/xestream.cxx460
-rw-r--r--sc/source/filter/excel/xestring.cxx62
-rw-r--r--sc/source/filter/excel/xestyle.cxx266
-rw-r--r--sc/source/filter/excel/xetable.cxx292
-rw-r--r--sc/source/filter/excel/xeview.cxx4
-rw-r--r--sc/source/filter/excel/xichart.cxx381
-rw-r--r--sc/source/filter/excel/xicontent.cxx331
-rw-r--r--sc/source/filter/excel/xiescher.cxx248
-rw-r--r--sc/source/filter/excel/xiformula.cxx2
-rw-r--r--sc/source/filter/excel/xihelper.cxx51
-rw-r--r--sc/source/filter/excel/xilink.cxx167
-rw-r--r--sc/source/filter/excel/xiname.cxx58
-rw-r--r--sc/source/filter/excel/xipage.cxx2
-rw-r--r--sc/source/filter/excel/xipivot.cxx111
-rw-r--r--sc/source/filter/excel/xiroot.cxx24
-rw-r--r--sc/source/filter/excel/xistream.cxx34
-rw-r--r--sc/source/filter/excel/xistring.cxx4
-rw-r--r--sc/source/filter/excel/xistyle.cxx378
-rw-r--r--sc/source/filter/excel/xiview.cxx8
-rw-r--r--sc/source/filter/excel/xladdress.cxx2
-rw-r--r--[-rwxr-xr-x]sc/source/filter/excel/xlchart.cxx26
-rw-r--r--sc/source/filter/excel/xlescher.cxx11
-rwxr-xr-xsc/source/filter/excel/xlformula.cxx6
-rw-r--r--sc/source/filter/excel/xlpage.cxx35
-rw-r--r--sc/source/filter/excel/xlpivot.cxx7
-rw-r--r--sc/source/filter/excel/xlroot.cxx32
-rw-r--r--sc/source/filter/excel/xlstyle.cxx41
-rw-r--r--sc/source/filter/excel/xltoolbar.cxx447
-rw-r--r--sc/source/filter/excel/xltoolbar.hxx127
-rw-r--r--sc/source/filter/excel/xltools.cxx23
-rw-r--r--sc/source/filter/excel/xltracer.cxx8
-rw-r--r--sc/source/filter/excel/xlview.cxx2
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx12
-rw-r--r--sc/source/filter/ftools/fprogressbar.cxx19
-rw-r--r--sc/source/filter/ftools/ftools.cxx2
-rw-r--r--sc/source/filter/ftools/makefile.mk8
-rw-r--r--sc/source/filter/html/htmlexp.cxx118
-rw-r--r--sc/source/filter/html/htmlexp2.cxx14
-rw-r--r--sc/source/filter/html/htmlimp.cxx23
-rw-r--r--sc/source/filter/html/htmlpars.cxx292
-rw-r--r--sc/source/filter/html/makefile.mk13
-rw-r--r--sc/source/filter/inc/XclExpChangeTrack.hxx48
-rw-r--r--sc/source/filter/inc/XclImpChangeTrack.hxx8
-rw-r--r--sc/source/filter/inc/biff.hxx2
-rw-r--r--sc/source/filter/inc/colrowst.hxx15
-rw-r--r--sc/source/filter/inc/decl.h2
-rw-r--r--sc/source/filter/inc/dif.hxx91
-rw-r--r--sc/source/filter/inc/eeimport.hxx5
-rw-r--r--sc/source/filter/inc/eeparser.hxx56
-rw-r--r--sc/source/filter/inc/excdefs.hxx2
-rw-r--r--sc/source/filter/inc/excdoc.hxx7
-rw-r--r--sc/source/filter/inc/excform.hxx11
-rw-r--r--sc/source/filter/inc/excimp8.hxx7
-rw-r--r--sc/source/filter/inc/excrecds.hxx13
-rw-r--r--sc/source/filter/inc/excscen.hxx106
-rw-r--r--sc/source/filter/inc/exp_op.hxx17
-rw-r--r--sc/source/filter/inc/expbase.hxx6
-rw-r--r--sc/source/filter/inc/fapihelper.hxx13
-rw-r--r--sc/source/filter/inc/filt_pch.hxx16
-rw-r--r--sc/source/filter/inc/fkttab.h2
-rw-r--r--sc/source/filter/inc/flttypes.hxx2
-rw-r--r--sc/source/filter/inc/formel.hxx137
-rw-r--r--sc/source/filter/inc/fprogressbar.hxx13
-rw-r--r--sc/source/filter/inc/ftools.hxx231
-rw-r--r--sc/source/filter/inc/funktion.h2
-rw-r--r--sc/source/filter/inc/htmlexp.hxx12
-rw-r--r--sc/source/filter/inc/htmlimp.hxx5
-rw-r--r--sc/source/filter/inc/htmlpars.hxx8
-rw-r--r--sc/source/filter/inc/imp_op.hxx10
-rw-r--r--sc/source/filter/inc/lotattr.hxx129
-rw-r--r--sc/source/filter/inc/lotfntbf.hxx3
-rw-r--r--sc/source/filter/inc/lotform.hxx2
-rw-r--r--sc/source/filter/inc/lotimpop.hxx3
-rw-r--r--sc/source/filter/inc/lotrange.hxx2
-rw-r--r--sc/source/filter/inc/namebuff.hxx28
-rw-r--r--sc/source/filter/inc/op.h4
-rw-r--r--sc/source/filter/inc/optab.h2
-rw-r--r--sc/source/filter/inc/otlnbuff.hxx60
-rw-r--r--sc/source/filter/inc/qpro.hxx2
-rw-r--r--sc/source/filter/inc/qproform.hxx3
-rw-r--r--sc/source/filter/inc/qprostyle.hxx3
-rw-r--r--sc/source/filter/inc/root.hxx2
-rw-r--r--sc/source/filter/inc/rtfexp.hxx2
-rw-r--r--sc/source/filter/inc/rtfimp.hxx3
-rw-r--r--sc/source/filter/inc/rtfparse.hxx9
-rw-r--r--sc/source/filter/inc/scflt.hxx2
-rw-r--r--sc/source/filter/inc/scfobj.hxx2
-rw-r--r--sc/source/filter/inc/scmem.h2
-rw-r--r--sc/source/filter/inc/tokstack.hxx5
-rw-r--r--sc/source/filter/inc/tool.h2
-rw-r--r--sc/source/filter/inc/xcl97dum.hxx3
-rw-r--r--sc/source/filter/inc/xcl97esc.hxx15
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx47
-rw-r--r--sc/source/filter/inc/xechart.hxx81
-rw-r--r--sc/source/filter/inc/xecontent.hxx4
-rw-r--r--sc/source/filter/inc/xeescher.hxx74
-rw-r--r--sc/source/filter/inc/xeformula.hxx5
-rw-r--r--sc/source/filter/inc/xehelper.hxx42
-rw-r--r--sc/source/filter/inc/xelink.hxx7
-rw-r--r--sc/source/filter/inc/xename.hxx7
-rw-r--r--sc/source/filter/inc/xepage.hxx2
-rw-r--r--sc/source/filter/inc/xepivot.hxx10
-rw-r--r--sc/source/filter/inc/xerecord.hxx5
-rw-r--r--sc/source/filter/inc/xeroot.hxx39
-rw-r--r--sc/source/filter/inc/xestream.hxx32
-rw-r--r--sc/source/filter/inc/xestring.hxx57
-rw-r--r--sc/source/filter/inc/xestyle.hxx49
-rw-r--r--sc/source/filter/inc/xetable.hxx55
-rw-r--r--sc/source/filter/inc/xeview.hxx2
-rw-r--r--sc/source/filter/inc/xichart.hxx130
-rw-r--r--sc/source/filter/inc/xicontent.hxx59
-rw-r--r--sc/source/filter/inc/xiescher.hxx80
-rw-r--r--sc/source/filter/inc/xiformula.hxx5
-rw-r--r--sc/source/filter/inc/xihelper.hxx58
-rw-r--r--sc/source/filter/inc/xilink.hxx2
-rw-r--r--sc/source/filter/inc/xiname.hxx6
-rw-r--r--sc/source/filter/inc/xipage.hxx2
-rw-r--r--sc/source/filter/inc/xipivot.hxx29
-rw-r--r--sc/source/filter/inc/xiroot.hxx55
-rw-r--r--sc/source/filter/inc/xistream.hxx11
-rw-r--r--sc/source/filter/inc/xistring.hxx2
-rw-r--r--sc/source/filter/inc/xistyle.hxx83
-rw-r--r--sc/source/filter/inc/xiview.hxx2
-rw-r--r--sc/source/filter/inc/xladdress.hxx2
-rw-r--r--[-rwxr-xr-x]sc/source/filter/inc/xlchart.hxx13
-rw-r--r--sc/source/filter/inc/xlconst.hxx21
-rw-r--r--sc/source/filter/inc/xlcontent.hxx2
-rw-r--r--sc/source/filter/inc/xlescher.hxx4
-rw-r--r--sc/source/filter/inc/xlformula.hxx5
-rw-r--r--sc/source/filter/inc/xllink.hxx2
-rw-r--r--sc/source/filter/inc/xlname.hxx2
-rw-r--r--sc/source/filter/inc/xlpage.hxx11
-rw-r--r--sc/source/filter/inc/xlpivot.hxx37
-rw-r--r--sc/source/filter/inc/xlroot.hxx24
-rw-r--r--sc/source/filter/inc/xlstream.hxx2
-rw-r--r--sc/source/filter/inc/xlstring.hxx2
-rw-r--r--sc/source/filter/inc/xlstyle.hxx14
-rw-r--r--sc/source/filter/inc/xltable.hxx26
-rw-r--r--sc/source/filter/inc/xltools.hxx10
-rw-r--r--sc/source/filter/inc/xltracer.hxx3
-rw-r--r--sc/source/filter/inc/xlview.hxx7
-rw-r--r--sc/source/filter/lotus/expop.cxx4
-rw-r--r--sc/source/filter/lotus/export.cxx2
-rw-r--r--sc/source/filter/lotus/filter.cxx4
-rw-r--r--sc/source/filter/lotus/lotattr.cxx181
-rw-r--r--sc/source/filter/lotus/lotform.cxx22
-rw-r--r--sc/source/filter/lotus/lotimpop.cxx12
-rw-r--r--sc/source/filter/lotus/lotread.cxx10
-rw-r--r--sc/source/filter/lotus/lotus.cxx2
-rw-r--r--sc/source/filter/lotus/makefile.mk26
-rw-r--r--sc/source/filter/lotus/memory.cxx3
-rw-r--r--sc/source/filter/lotus/op.cxx40
-rw-r--r--sc/source/filter/lotus/optab.cxx3
-rw-r--r--sc/source/filter/lotus/tool.cxx59
-rw-r--r--sc/source/filter/qpro/biff.cxx4
-rw-r--r--sc/source/filter/qpro/makefile.mk13
-rw-r--r--sc/source/filter/qpro/qpro.cxx9
-rw-r--r--sc/source/filter/qpro/qproform.cxx22
-rw-r--r--sc/source/filter/qpro/qprostyle.cxx8
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx115
-rw-r--r--sc/source/filter/rtf/expbase.cxx11
-rw-r--r--sc/source/filter/rtf/makefile.mk9
-rw-r--r--sc/source/filter/rtf/rtfexp.cxx42
-rw-r--r--sc/source/filter/rtf/rtfimp.cxx2
-rw-r--r--sc/source/filter/rtf/rtfparse.cxx88
-rw-r--r--sc/source/filter/starcalc/makefile.mk9
-rw-r--r--sc/source/filter/starcalc/scflt.cxx170
-rw-r--r--sc/source/filter/starcalc/scfobj.cxx2
-rw-r--r--sc/source/filter/xcl97/XclExpChangeTrack.cxx489
-rw-r--r--sc/source/filter/xcl97/XclImpChangeTrack.cxx20
-rw-r--r--sc/source/filter/xcl97/makefile.mk15
-rw-r--r--sc/source/filter/xcl97/xcl97dum.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx56
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx384
-rw-r--r--sc/source/filter/xml/XMLCalculationSettingsContext.cxx18
-rw-r--r--sc/source/filter/xml/XMLCalculationSettingsContext.hxx3
-rw-r--r--sc/source/filter/xml/XMLCellRangeSourceContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLCellRangeSourceContext.hxx2
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx86
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx3
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx35
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx3
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.cxx18
-rw-r--r--[-rwxr-xr-x]sc/source/filter/xml/XMLCodeNameProvider.hxx3
-rw-r--r--sc/source/filter/xml/XMLColumnRowGroupExport.cxx14
-rw-r--r--sc/source/filter/xml/XMLColumnRowGroupExport.hxx2
-rw-r--r--sc/source/filter/xml/XMLConsolidationContext.cxx13
-rw-r--r--sc/source/filter/xml/XMLConsolidationContext.hxx2
-rw-r--r--sc/source/filter/xml/XMLConverter.cxx17
-rw-r--r--sc/source/filter/xml/XMLConverter.hxx15
-rw-r--r--sc/source/filter/xml/XMLDDELinksContext.cxx15
-rw-r--r--sc/source/filter/xml/XMLDDELinksContext.hxx3
-rw-r--r--sc/source/filter/xml/XMLDetectiveContext.cxx15
-rw-r--r--sc/source/filter/xml/XMLDetectiveContext.hxx2
-rw-r--r--sc/source/filter/xml/XMLEmptyContext.cxx3
-rw-r--r--sc/source/filter/xml/XMLEmptyContext.hxx3
-rw-r--r--sc/source/filter/xml/XMLExportDDELinks.cxx131
-rw-r--r--sc/source/filter/xml/XMLExportDDELinks.hxx7
-rw-r--r--sc/source/filter/xml/XMLExportDataPilot.cxx327
-rw-r--r--sc/source/filter/xml/XMLExportDataPilot.hxx2
-rw-r--r--sc/source/filter/xml/XMLExportDatabaseRanges.cxx54
-rw-r--r--sc/source/filter/xml/XMLExportDatabaseRanges.hxx2
-rw-r--r--sc/source/filter/xml/XMLExportIterator.cxx83
-rw-r--r--sc/source/filter/xml/XMLExportIterator.hxx8
-rw-r--r--sc/source/filter/xml/XMLExportSharedData.cxx9
-rw-r--r--sc/source/filter/xml/XMLExportSharedData.hxx10
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx125
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.hxx45
-rw-r--r--sc/source/filter/xml/XMLStylesImportHelper.cxx298
-rw-r--r--sc/source/filter/xml/XMLStylesImportHelper.hxx36
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.cxx20
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.hxx3
-rw-r--r--sc/source/filter/xml/XMLTableMasterPageExport.cxx38
-rw-r--r--sc/source/filter/xml/XMLTableMasterPageExport.hxx2
-rw-r--r--sc/source/filter/xml/XMLTableShapeImportHelper.cxx63
-rw-r--r--sc/source/filter/xml/XMLTableShapeImportHelper.hxx3
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.cxx299
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.hxx40
-rw-r--r--sc/source/filter/xml/XMLTableShapesContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLTableShapesContext.hxx3
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.cxx9
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.hxx3
-rw-r--r--sc/source/filter/xml/XMLTextPContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLTextPContext.hxx3
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.cxx71
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.hxx2
-rw-r--r--sc/source/filter/xml/cachedattraccess.cxx72
-rw-r--r--sc/source/filter/xml/cachedattraccess.hxx66
-rw-r--r--sc/source/filter/xml/makefile.mk3
-rw-r--r--sc/source/filter/xml/sheetdata.cxx6
-rw-r--r--sc/source/filter/xml/xmlannoi.cxx17
-rw-r--r--sc/source/filter/xml/xmlannoi.hxx2
-rw-r--r--sc/source/filter/xml/xmlbodyi.cxx55
-rw-r--r--sc/source/filter/xml/xmlbodyi.hxx6
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx89
-rw-r--r--sc/source/filter/xml/xmlcelli.hxx2
-rw-r--r--sc/source/filter/xml/xmlcoli.cxx39
-rw-r--r--sc/source/filter/xml/xmlcoli.hxx3
-rw-r--r--sc/source/filter/xml/xmlconti.cxx3
-rw-r--r--sc/source/filter/xml/xmlconti.hxx3
-rw-r--r--sc/source/filter/xml/xmlcvali.cxx17
-rw-r--r--sc/source/filter/xml/xmlcvali.hxx3
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx216
-rw-r--r--sc/source/filter/xml/xmldpimp.hxx9
-rw-r--r--sc/source/filter/xml/xmldrani.cxx40
-rw-r--r--sc/source/filter/xml/xmldrani.hxx3
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx972
-rw-r--r--sc/source/filter/xml/xmlexprt.hxx29
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.cxx3
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.hxx3
-rw-r--r--sc/source/filter/xml/xmlfilti.cxx38
-rw-r--r--sc/source/filter/xml/xmlfilti.hxx3
-rw-r--r--sc/source/filter/xml/xmlfonte.cxx11
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx503
-rw-r--r--sc/source/filter/xml/xmlimprt.hxx70
-rw-r--r--sc/source/filter/xml/xmllabri.cxx6
-rw-r--r--sc/source/filter/xml/xmllabri.hxx3
-rw-r--r--sc/source/filter/xml/xmlnexpi.cxx29
-rw-r--r--sc/source/filter/xml/xmlnexpi.hxx3
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx39
-rw-r--r--sc/source/filter/xml/xmlrowi.hxx3
-rw-r--r--sc/source/filter/xml/xmlsceni.cxx12
-rw-r--r--sc/source/filter/xml/xmlsceni.hxx3
-rw-r--r--sc/source/filter/xml/xmlsorti.cxx24
-rw-r--r--sc/source/filter/xml/xmlsorti.hxx3
-rw-r--r--sc/source/filter/xml/xmlstyle.cxx310
-rw-r--r--sc/source/filter/xml/xmlstyle.hxx40
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx35
-rw-r--r--sc/source/filter/xml/xmlstyli.hxx6
-rw-r--r--sc/source/filter/xml/xmlsubti.cxx348
-rw-r--r--sc/source/filter/xml/xmlsubti.hxx53
-rw-r--r--sc/source/filter/xml/xmltabi.cxx217
-rw-r--r--sc/source/filter/xml/xmltabi.hxx27
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx141
-rw-r--r--sc/source/ui/Accessibility/AccessibilityHints.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx25
-rw-r--r--sc/source/ui/Accessibility/AccessibleCellBase.cxx31
-rw-r--r--sc/source/ui/Accessibility/AccessibleContextBase.cxx59
-rw-r--r--sc/source/ui/Accessibility/AccessibleCsvControl.cxx139
-rw-r--r--sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx69
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx148
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentBase.cxx5
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx296
-rw-r--r--sc/source/ui/Accessibility/AccessibleEditObject.cxx28
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenu.cxx6
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx6
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleGlobal.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx19
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx23
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx24
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx27
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx112
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx111
-rw-r--r--sc/source/ui/Accessibility/AccessibleTableBase.cxx72
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx230
-rw-r--r--sc/source/ui/Accessibility/DrawModelBroadcaster.cxx3
-rw-r--r--sc/source/ui/Accessibility/makefile.mk62
-rw-r--r--sc/source/ui/app/client.cxx19
-rw-r--r--sc/source/ui/app/drwtrans.cxx47
-rw-r--r--sc/source/ui/app/inputhdl.cxx678
-rwxr-xr-xsc/source/ui/app/inputwin.cxx225
-rw-r--r--sc/source/ui/app/lnktrans.cxx4
-rw-r--r--sc/source/ui/app/makefile.mk35
-rw-r--r--sc/source/ui/app/msgpool.cxx12
-rw-r--r--sc/source/ui/app/rfindlst.cxx6
-rw-r--r--sc/source/ui/app/scdll.cxx106
-rw-r--r--sc/source/ui/app/scmod.cxx125
-rw-r--r--sc/source/ui/app/scmod2.cxx13
-rw-r--r--sc/source/ui/app/seltrans.cxx13
-rw-r--r--sc/source/ui/app/template.cxx4
-rw-r--r--sc/source/ui/app/transobj.cxx81
-rw-r--r--sc/source/ui/app/typemap.cxx4
-rw-r--r--sc/source/ui/app/uiitems.cxx115
-rw-r--r--sc/source/ui/app/wtcdummy.cxx11
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx63
-rw-r--r--sc/source/ui/attrdlg/condfrmt.cxx76
-rw-r--r--sc/source/ui/attrdlg/makefile.mk14
-rw-r--r--sc/source/ui/attrdlg/scabstdlg.cxx5
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx504
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx80
-rw-r--r--sc/source/ui/attrdlg/scuiexp.cxx3
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx27
-rw-r--r--sc/source/ui/cctrl/cbuttonw.cxx6
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx17
-rw-r--r--sc/source/ui/cctrl/editfield.cxx2
-rw-r--r--sc/source/ui/cctrl/makefile.mk15
-rw-r--r--sc/source/ui/cctrl/popmenu.cxx4
-rw-r--r--sc/source/ui/cctrl/tbinsert.cxx111
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx22
-rw-r--r--sc/source/ui/dbgui/asciiopt.cxx94
-rw-r--r--sc/source/ui/dbgui/asciiopt.hrc11
-rw-r--r--sc/source/ui/dbgui/asciiopt.src45
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx18
-rw-r--r--sc/source/ui/dbgui/consdlg.hrc1
-rw-r--r--sc/source/ui/dbgui/consdlg.src1
-rw-r--r--sc/source/ui/dbgui/csvcontrol.cxx2
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx50
-rw-r--r--sc/source/ui/dbgui/csvruler.cxx15
-rw-r--r--sc/source/ui/dbgui/csvsplits.cxx2
-rw-r--r--sc/source/ui/dbgui/csvtablebox.cxx76
-rw-r--r--sc/source/ui/dbgui/dapidata.cxx12
-rw-r--r--sc/source/ui/dbgui/dapitype.cxx46
-rw-r--r--sc/source/ui/dbgui/dapitype.hrc41
-rw-r--r--sc/source/ui/dbgui/dapitype.src61
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx49
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.cxx8
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.hrc1
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.src1
-rw-r--r--sc/source/ui/dbgui/dpuiglobal.hxx43
-rw-r--r--sc/source/ui/dbgui/expftext.cxx6
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx1608
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx50
-rw-r--r--sc/source/ui/dbgui/foptmgr.cxx7
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx9
-rw-r--r--sc/source/ui/dbgui/imoptdlg.hrc4
-rw-r--r--sc/source/ui/dbgui/imoptdlg.src22
-rw-r--r--sc/source/ui/dbgui/makefile.mk60
-rw-r--r--sc/source/ui/dbgui/outline.src9
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx12
-rw-r--r--sc/source/ui/dbgui/pivot.hrc3
-rw-r--r--sc/source/ui/dbgui/pivot.src113
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx111
-rw-r--r--sc/source/ui/dbgui/pvfundlg.hrc4
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx1834
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx16
-rw-r--r--sc/source/ui/dbgui/scendlg.hrc2
-rw-r--r--sc/source/ui/dbgui/scendlg.src39
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx61
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx13
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx68
-rw-r--r--sc/source/ui/dbgui/sortdlg.cxx17
-rw-r--r--sc/source/ui/dbgui/subtdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/textimportoptions.cxx5
-rw-r--r--sc/source/ui/dbgui/textimportoptions.src4
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx77
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx71
-rw-r--r--sc/source/ui/dbgui/validate.cxx101
-rw-r--r--sc/source/ui/dbgui/validate.src94
-rw-r--r--sc/source/ui/docshell/arealink.cxx59
-rw-r--r--sc/source/ui/docshell/autostyl.cxx130
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx204
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx94
-rw-r--r--sc/source/ui/docshell/docfunc.cxx740
-rw-r--r--sc/source/ui/docshell/docsh.cxx548
-rw-r--r--sc/source/ui/docshell/docsh2.cxx52
-rw-r--r--sc/source/ui/docshell/docsh3.cxx85
-rw-r--r--sc/source/ui/docshell/docsh4.cxx513
-rw-r--r--sc/source/ui/docshell/docsh5.cxx166
-rw-r--r--sc/source/ui/docshell/docsh6.cxx126
-rw-r--r--sc/source/ui/docshell/docsh7.cxx2
-rw-r--r--sc/source/ui/docshell/docsh8.cxx175
-rw-r--r--sc/source/ui/docshell/docshimp.hxx2
-rw-r--r--sc/source/ui/docshell/editable.cxx14
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx543
-rw-r--r--sc/source/ui/docshell/hiranges.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx221
-rw-r--r--sc/source/ui/docshell/macromgr.cxx216
-rw-r--r--sc/source/ui/docshell/makefile.mk53
-rw-r--r--sc/source/ui/docshell/olinefun.cxx135
-rw-r--r--sc/source/ui/docshell/pagedata.cxx6
-rw-r--r--sc/source/ui/docshell/pntlock.cxx4
-rw-r--r--sc/source/ui/docshell/servobj.cxx33
-rw-r--r--sc/source/ui/docshell/sizedev.cxx4
-rw-r--r--sc/source/ui/docshell/tablink.cxx68
-rw-r--r--sc/source/ui/docshell/tpstat.cxx12
-rw-r--r--sc/source/ui/docshell/tpstat.src33
-rw-r--r--sc/source/ui/drawfunc/chartsh.cxx5
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx65
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx30
-rw-r--r--sc/source/ui/drawfunc/drawsh4.cxx6
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx59
-rw-r--r--sc/source/ui/drawfunc/drformsh.cxx4
-rw-r--r--sc/source/ui/drawfunc/drformsh.src39
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx69
-rw-r--r--sc/source/ui/drawfunc/drtxtob1.cxx22
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx14
-rw-r--r--sc/source/ui/drawfunc/fuconarc.cxx31
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx29
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx29
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx32
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx24
-rw-r--r--sc/source/ui/drawfunc/fuconuno.cxx22
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx125
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx97
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx63
-rw-r--r--sc/source/ui/drawfunc/fumark.cxx22
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx29
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx101
-rw-r--r--sc/source/ui/drawfunc/fusel2.cxx10
-rw-r--r--sc/source/ui/drawfunc/futext.cxx123
-rw-r--r--sc/source/ui/drawfunc/futext2.cxx134
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx55
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx4
-rw-r--r--sc/source/ui/drawfunc/makefile.mk51
-rw-r--r--sc/source/ui/drawfunc/mediash.cxx5
-rw-r--r--sc/source/ui/drawfunc/objdraw.src18
-rw-r--r--sc/source/ui/drawfunc/oleobjsh.cxx4
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx149
-rw-r--r--sc/source/ui/formdlg/dwfunctr.hrc4
-rw-r--r--sc/source/ui/formdlg/dwfunctr.src36
-rw-r--r--sc/source/ui/formdlg/formdata.cxx2
-rw-r--r--sc/source/ui/formdlg/formdlgs.src1
-rw-r--r--sc/source/ui/formdlg/formula.cxx65
-rw-r--r--sc/source/ui/formdlg/makefile.mk13
-rw-r--r--sc/source/ui/formdlg/privsplt.cxx26
-rw-r--r--sc/source/ui/inc/AccessibilityHints.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleCell.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleCellBase.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleContextBase.hxx7
-rw-r--r--sc/source/ui/inc/AccessibleCsvControl.hxx2
-rw-r--r--sc/source/ui/inc/AccessibleDataPilotControl.hxx9
-rw-r--r--sc/source/ui/inc/AccessibleDocument.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleDocumentBase.hxx4
-rw-r--r--sc/source/ui/inc/AccessibleDocumentPagePreview.hxx8
-rw-r--r--sc/source/ui/inc/AccessibleEditObject.hxx3
-rw-r--r--sc/source/ui/inc/AccessiblePageHeader.hxx3
-rw-r--r--sc/source/ui/inc/AccessiblePageHeaderArea.hxx4
-rw-r--r--sc/source/ui/inc/AccessiblePreviewCell.hxx2
-rw-r--r--sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx3
-rw-r--r--sc/source/ui/inc/AccessiblePreviewTable.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleSpreadsheet.hxx7
-rw-r--r--sc/source/ui/inc/AccessibleTableBase.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleText.hxx13
-rw-r--r--sc/source/ui/inc/ChartRangeSelectionListener.hxx3
-rw-r--r--sc/source/ui/inc/DrawModelBroadcaster.hxx3
-rw-r--r--sc/source/ui/inc/IAnyRefDialog.hxx11
-rw-r--r--sc/source/ui/inc/ScDevChart.hxx3
-rw-r--r--sc/source/ui/inc/acredlin.hrc8
-rw-r--r--sc/source/ui/inc/acredlin.hxx21
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx46
-rw-r--r--sc/source/ui/inc/areasave.hxx2
-rw-r--r--sc/source/ui/inc/areasdlg.hxx6
-rw-r--r--sc/source/ui/inc/asciiopt.hxx105
-rw-r--r--sc/source/ui/inc/attrdlg.hrc2
-rw-r--r--sc/source/ui/inc/attrdlg.hxx2
-rw-r--r--sc/source/ui/inc/auditsh.hxx2
-rw-r--r--sc/source/ui/inc/autofmt.hxx73
-rw-r--r--sc/source/ui/inc/autostyl.hxx15
-rw-r--r--sc/source/ui/inc/cbutton.hxx8
-rw-r--r--sc/source/ui/inc/cellmergeoption.hxx61
-rw-r--r--sc/source/ui/inc/cellsh.hxx6
-rw-r--r--sc/source/ui/inc/chartsh.hxx3
-rw-r--r--sc/source/ui/inc/client.hxx4
-rw-r--r--sc/source/ui/inc/colrowba.hxx2
-rw-r--r--sc/source/ui/inc/condfrmt.hrc1
-rw-r--r--sc/source/ui/inc/condfrmt.hxx2
-rw-r--r--sc/source/ui/inc/conflictsdlg.hxx7
-rw-r--r--sc/source/ui/inc/consdlg.hxx10
-rw-r--r--sc/source/ui/inc/content.hxx4
-rw-r--r--sc/source/ui/inc/corodlg.hxx12
-rw-r--r--sc/source/ui/inc/crdlg.hxx7
-rw-r--r--sc/source/ui/inc/crnrdlg.hrc5
-rw-r--r--sc/source/ui/inc/crnrdlg.hxx10
-rw-r--r--sc/source/ui/inc/csvcontrol.hxx2
-rw-r--r--sc/source/ui/inc/csvgrid.hxx7
-rw-r--r--sc/source/ui/inc/csvruler.hxx2
-rw-r--r--sc/source/ui/inc/csvsplits.hxx2
-rw-r--r--sc/source/ui/inc/csvtablebox.hxx12
-rw-r--r--sc/source/ui/inc/dapidata.hxx4
-rw-r--r--sc/source/ui/inc/dapitype.hxx16
-rw-r--r--sc/source/ui/inc/datafdlg.hrc42
-rw-r--r--sc/source/ui/inc/datafdlg.hxx112
-rw-r--r--sc/source/ui/inc/dbdocfun.hxx7
-rw-r--r--sc/source/ui/inc/dbfunc.hxx14
-rw-r--r--sc/source/ui/inc/dbnamdlg.hrc1
-rw-r--r--sc/source/ui/inc/dbnamdlg.hxx10
-rw-r--r--sc/source/ui/inc/delcldlg.hxx4
-rw-r--r--sc/source/ui/inc/delcodlg.hxx2
-rw-r--r--sc/source/ui/inc/docfunc.hxx35
-rw-r--r--sc/source/ui/inc/docsh.hxx37
-rw-r--r--sc/source/ui/inc/dpcontrol.hxx7
-rw-r--r--sc/source/ui/inc/dpgroupdlg.hxx8
-rw-r--r--sc/source/ui/inc/drawsh.hxx6
-rw-r--r--sc/source/ui/inc/drawutil.hxx2
-rw-r--r--sc/source/ui/inc/drawview.hxx22
-rw-r--r--sc/source/ui/inc/drformsh.hxx3
-rw-r--r--sc/source/ui/inc/drtxtob.hxx5
-rw-r--r--sc/source/ui/inc/drwtrans.hxx5
-rw-r--r--sc/source/ui/inc/dwfunctr.hxx15
-rw-r--r--sc/source/ui/inc/editable.hxx2
-rw-r--r--sc/source/ui/inc/editfield.hxx2
-rw-r--r--sc/source/ui/inc/editsh.hxx2
-rw-r--r--sc/source/ui/inc/expftext.hxx3
-rw-r--r--sc/source/ui/inc/fieldwnd.hxx490
-rw-r--r--sc/source/ui/inc/filldlg.hxx18
-rw-r--r--sc/source/ui/inc/filtdlg.hxx8
-rw-r--r--sc/source/ui/inc/filter.hrc8
-rw-r--r--sc/source/ui/inc/foptmgr.hxx11
-rw-r--r--sc/source/ui/inc/formatsh.hxx6
-rw-r--r--sc/source/ui/inc/formdata.hxx2
-rw-r--r--sc/source/ui/inc/formula.hxx6
-rw-r--r--sc/source/ui/inc/fuconarc.hxx4
-rw-r--r--sc/source/ui/inc/fuconcustomshape.hxx4
-rw-r--r--sc/source/ui/inc/fuconpol.hxx4
-rw-r--r--sc/source/ui/inc/fuconrec.hxx4
-rw-r--r--sc/source/ui/inc/fuconstr.hxx3
-rw-r--r--sc/source/ui/inc/fuconuno.hxx4
-rw-r--r--sc/source/ui/inc/fudraw.hxx5
-rw-r--r--sc/source/ui/inc/fuedipo.hxx2
-rw-r--r--sc/source/ui/inc/fuinsert.hxx2
-rw-r--r--sc/source/ui/inc/fumark.hxx2
-rw-r--r--sc/source/ui/inc/funcpage.hxx4
-rw-r--r--sc/source/ui/inc/funcutl.hxx7
-rw-r--r--sc/source/ui/inc/fupoor.hxx20
-rw-r--r--sc/source/ui/inc/fusel.hxx5
-rw-r--r--sc/source/ui/inc/futext.hxx8
-rw-r--r--sc/source/ui/inc/graphsh.hxx3
-rw-r--r--sc/source/ui/inc/gridmerg.hxx2
-rw-r--r--sc/source/ui/inc/gridwin.hxx25
-rw-r--r--sc/source/ui/inc/groupdlg.hxx4
-rw-r--r--sc/source/ui/inc/hdrcont.hxx4
-rw-r--r--sc/source/ui/inc/hfedtdlg.hxx3
-rw-r--r--sc/source/ui/inc/highred.hrc11
-rw-r--r--sc/source/ui/inc/highred.hxx14
-rw-r--r--sc/source/ui/inc/hintwin.hxx2
-rw-r--r--sc/source/ui/inc/hiranges.hxx2
-rw-r--r--sc/source/ui/inc/imoptdlg.hxx10
-rw-r--r--sc/source/ui/inc/impex.hxx14
-rw-r--r--sc/source/ui/inc/inputhdl.hxx26
-rw-r--r--sc/source/ui/inc/inputwin.hxx4
-rw-r--r--sc/source/ui/inc/inscldlg.hxx4
-rw-r--r--sc/source/ui/inc/inscodlg.hxx8
-rw-r--r--sc/source/ui/inc/instbdlg.hrc4
-rw-r--r--sc/source/ui/inc/instbdlg.hxx14
-rw-r--r--sc/source/ui/inc/invmerge.hxx2
-rw-r--r--sc/source/ui/inc/lbseldlg.hxx5
-rw-r--r--sc/source/ui/inc/linkarea.hrc1
-rw-r--r--sc/source/ui/inc/linkarea.hxx9
-rw-r--r--sc/source/ui/inc/lnktrans.hxx2
-rw-r--r--sc/source/ui/inc/mediash.hxx3
-rw-r--r--sc/source/ui/inc/miscdlgs.hrc25
-rw-r--r--sc/source/ui/inc/msgpool.hxx3
-rw-r--r--sc/source/ui/inc/mtrindlg.hxx2
-rw-r--r--sc/source/ui/inc/mvtabdlg.hxx42
-rw-r--r--sc/source/ui/inc/namecrea.hxx10
-rw-r--r--sc/source/ui/inc/namedlg.hrc7
-rw-r--r--sc/source/ui/inc/namedlg.hxx12
-rw-r--r--sc/source/ui/inc/namepast.hxx8
-rw-r--r--sc/source/ui/inc/navcitem.hxx2
-rw-r--r--sc/source/ui/inc/navipi.hxx3
-rw-r--r--sc/source/ui/inc/navsett.hxx2
-rw-r--r--sc/source/ui/inc/notemark.hxx4
-rw-r--r--sc/source/ui/inc/oleobjsh.hxx3
-rw-r--r--sc/source/ui/inc/olinefun.hxx2
-rw-r--r--sc/source/ui/inc/olinewin.hxx2
-rw-r--r--sc/source/ui/inc/opredlin.hxx12
-rw-r--r--sc/source/ui/inc/optdlg.hrc52
-rw-r--r--sc/source/ui/inc/optload.hrc2
-rw-r--r--sc/source/ui/inc/optload.hxx4
-rw-r--r--sc/source/ui/inc/optsolver.hrc3
-rw-r--r--sc/source/ui/inc/optsolver.hxx2
-rw-r--r--sc/source/ui/inc/output.hxx9
-rw-r--r--sc/source/ui/inc/overlayobject.hxx (renamed from sc/addin/inc/rot13.hrc)35
-rw-r--r--sc/source/ui/inc/pagedata.hxx2
-rw-r--r--sc/source/ui/inc/parawin.hxx4
-rw-r--r--sc/source/ui/inc/pfiltdlg.hxx17
-rw-r--r--sc/source/ui/inc/pfuncache.hxx2
-rw-r--r--sc/source/ui/inc/pgbrksh.hxx2
-rw-r--r--sc/source/ui/inc/pivotsh.hxx2
-rw-r--r--sc/source/ui/inc/pntlock.hxx2
-rw-r--r--sc/source/ui/inc/popmenu.hxx8
-rw-r--r--sc/source/ui/inc/preview.hxx7
-rw-r--r--sc/source/ui/inc/prevloc.hxx14
-rw-r--r--sc/source/ui/inc/prevwsh.hxx13
-rw-r--r--sc/source/ui/inc/printfun.hxx4
-rw-r--r--sc/source/ui/inc/privsplt.hxx3
-rw-r--r--sc/source/ui/inc/protectiondlg.hrc4
-rw-r--r--sc/source/ui/inc/protectiondlg.hxx3
-rw-r--r--sc/source/ui/inc/pvfundlg.hxx24
-rw-r--r--sc/source/ui/inc/pvlaydlg.hxx263
-rw-r--r--sc/source/ui/inc/redcom.hxx10
-rw-r--r--sc/source/ui/inc/reffact.hxx5
-rw-r--r--sc/source/ui/inc/refundo.hxx2
-rw-r--r--sc/source/ui/inc/retypepassdlg.hxx3
-rw-r--r--sc/source/ui/inc/rfindlst.hxx8
-rw-r--r--sc/source/ui/inc/scendlg.hxx4
-rw-r--r--sc/source/ui/inc/scui_def.hxx2
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx2
-rw-r--r--sc/source/ui/inc/scuiautofmt.hxx2
-rw-r--r--sc/source/ui/inc/scuiimoptdlg.hxx6
-rw-r--r--sc/source/ui/inc/scuitphfedit.hxx2
-rw-r--r--sc/source/ui/inc/select.hxx12
-rw-r--r--sc/source/ui/inc/selectionstate.hxx2
-rw-r--r--sc/source/ui/inc/seltrans.hxx2
-rw-r--r--sc/source/ui/inc/servobj.hxx5
-rw-r--r--sc/source/ui/inc/sharedocdlg.hxx3
-rw-r--r--sc/source/ui/inc/shtabdlg.hxx8
-rw-r--r--sc/source/ui/inc/simpref.hrc1
-rw-r--r--sc/source/ui/inc/simpref.hxx12
-rw-r--r--sc/source/ui/inc/sizedev.hxx2
-rw-r--r--sc/source/ui/inc/solveroptions.hrc1
-rw-r--r--sc/source/ui/inc/solveroptions.hxx4
-rw-r--r--sc/source/ui/inc/solverutil.hxx2
-rw-r--r--sc/source/ui/inc/solvrdlg.hrc1
-rw-r--r--sc/source/ui/inc/solvrdlg.hxx2
-rw-r--r--sc/source/ui/inc/sortdlg.hrc14
-rw-r--r--sc/source/ui/inc/sortdlg.hxx5
-rw-r--r--sc/source/ui/inc/spelldialog.hxx2
-rw-r--r--sc/source/ui/inc/spelleng.hxx2
-rw-r--r--sc/source/ui/inc/spellparam.hxx2
-rw-r--r--sc/source/ui/inc/strindlg.hxx2
-rw-r--r--sc/source/ui/inc/styledlg.hxx5
-rw-r--r--sc/source/ui/inc/subtdlg.hrc8
-rw-r--r--sc/source/ui/inc/subtdlg.hxx10
-rw-r--r--sc/source/ui/inc/tabbgcolordlg.hxx6
-rw-r--r--sc/source/ui/inc/tabcont.hxx4
-rw-r--r--sc/source/ui/inc/tabopdlg.hrc2
-rw-r--r--sc/source/ui/inc/tabopdlg.hxx2
-rw-r--r--sc/source/ui/inc/tabpages.hxx5
-rw-r--r--sc/source/ui/inc/tabpopsh.hxx2
-rw-r--r--sc/source/ui/inc/tabsplit.hxx2
-rw-r--r--sc/source/ui/inc/tabview.hxx78
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx39
-rw-r--r--sc/source/ui/inc/target.hxx2
-rw-r--r--sc/source/ui/inc/tbinsert.hrc2
-rw-r--r--sc/source/ui/inc/tbinsert.hxx38
-rw-r--r--sc/source/ui/inc/tbzoomsliderctrl.hxx13
-rw-r--r--sc/source/ui/inc/textdlgs.hxx2
-rw-r--r--sc/source/ui/inc/textimportoptions.hrc3
-rw-r--r--sc/source/ui/inc/textimportoptions.hxx6
-rw-r--r--sc/source/ui/inc/tpcalc.hxx3
-rw-r--r--sc/source/ui/inc/tpcompatibility.hxx64
-rw-r--r--sc/source/ui/inc/tpformula.hxx97
-rw-r--r--sc/source/ui/inc/tphf.hxx4
-rw-r--r--sc/source/ui/inc/tphfedit.hxx105
-rw-r--r--sc/source/ui/inc/tpprint.hxx2
-rw-r--r--sc/source/ui/inc/tpsort.hxx9
-rw-r--r--sc/source/ui/inc/tpstat.hxx3
-rw-r--r--sc/source/ui/inc/tpsubt.hxx2
-rw-r--r--sc/source/ui/inc/tptable.hxx5
-rw-r--r--sc/source/ui/inc/tpusrlst.hxx2
-rw-r--r--sc/source/ui/inc/tpview.hxx2
-rw-r--r--sc/source/ui/inc/transobj.hxx4
-rw-r--r--sc/source/ui/inc/ui_pch.hxx10
-rw-r--r--sc/source/ui/inc/uiitems.hxx13
-rw-r--r--sc/source/ui/inc/undobase.hxx2
-rw-r--r--sc/source/ui/inc/undoblk.hxx29
-rw-r--r--sc/source/ui/inc/undocell.hxx13
-rw-r--r--sc/source/ui/inc/undodat.hxx71
-rw-r--r--sc/source/ui/inc/undodraw.hxx2
-rw-r--r--sc/source/ui/inc/undoolk.hxx3
-rw-r--r--sc/source/ui/inc/undostyl.hxx2
-rw-r--r--sc/source/ui/inc/undotab.hxx66
-rw-r--r--sc/source/ui/inc/undoutil.hxx3
-rw-r--r--sc/source/ui/inc/validate.hrc3
-rw-r--r--sc/source/ui/inc/validate.hxx61
-rw-r--r--sc/source/ui/inc/viewdata.hxx37
-rw-r--r--sc/source/ui/inc/viewfunc.hxx77
-rw-r--r--sc/source/ui/inc/viewutil.hxx6
-rw-r--r--sc/source/ui/inc/warnbox.hxx2
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx396
-rw-r--r--sc/source/ui/miscdlgs/acredlin.src51
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx151
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx421
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx70
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.src1
-rw-r--r--sc/source/ui/miscdlgs/crdlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx104
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx416
-rw-r--r--sc/source/ui/miscdlgs/delcldlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/delcodlg.cxx12
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx32
-rw-r--r--sc/source/ui/miscdlgs/groupdlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/highred.cxx33
-rw-r--r--sc/source/ui/miscdlgs/highred.src31
-rw-r--r--sc/source/ui/miscdlgs/inscldlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/inscodlg.cxx16
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx8
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.src38
-rw-r--r--sc/source/ui/miscdlgs/lbseldlg.cxx11
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx13
-rw-r--r--sc/source/ui/miscdlgs/makefile.mk71
-rw-r--r--sc/source/ui/miscdlgs/mtrindlg.cxx6
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx210
-rw-r--r--sc/source/ui/miscdlgs/namecrea.cxx10
-rw-r--r--sc/source/ui/miscdlgs/namepast.cxx21
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx20
-rw-r--r--sc/source/ui/miscdlgs/protectiondlg.cxx10
-rw-r--r--sc/source/ui/miscdlgs/protectiondlg.src10
-rw-r--r--sc/source/ui/miscdlgs/redcom.cxx13
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx5
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.src3
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx19
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.cxx9
-rw-r--r--sc/source/ui/miscdlgs/shtabdlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/simpref.cxx22
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx6
-rw-r--r--sc/source/ui/miscdlgs/solverutil.cxx15
-rw-r--r--sc/source/ui/miscdlgs/solvrdlg.cxx16
-rw-r--r--sc/source/ui/miscdlgs/strindlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/tabbgcolordlg.cxx8
-rw-r--r--sc/source/ui/miscdlgs/tabopdlg.cxx16
-rw-r--r--sc/source/ui/miscdlgs/textdlgs.cxx44
-rw-r--r--sc/source/ui/miscdlgs/warnbox.cxx13
-rw-r--r--sc/source/ui/namedlg/makefile.mk5
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx126
-rw-r--r--sc/source/ui/navipi/content.cxx146
-rw-r--r--sc/source/ui/navipi/makefile.mk14
-rw-r--r--sc/source/ui/navipi/navcitem.cxx8
-rw-r--r--sc/source/ui/navipi/navipi.cxx168
-rw-r--r--sc/source/ui/navipi/navipi.hrc8
-rw-r--r--sc/source/ui/navipi/navipi.src101
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx4
-rw-r--r--sc/source/ui/optdlg/makefile.mk17
-rw-r--r--sc/source/ui/optdlg/opredlin.cxx84
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx19
-rw-r--r--sc/source/ui/optdlg/tpcompatibility.cxx108
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx290
-rw-r--r--sc/source/ui/optdlg/tpprint.cxx8
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx75
-rw-r--r--sc/source/ui/optdlg/tpview.cxx97
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx120
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.cxx9
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.hrc10
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.src111
-rw-r--r--sc/source/ui/pagedlg/makefile.mk22
-rw-r--r--sc/source/ui/pagedlg/pagedlg.hrc3
-rw-r--r--sc/source/ui/pagedlg/pagedlg.src41
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx47
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx25
-rw-r--r--sc/source/ui/pagedlg/tphf.src29
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx471
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx15
-rw-r--r--sc/source/ui/src/attrdlg.src39
-rw-r--r--sc/source/ui/src/autofmt.src53
-rw-r--r--sc/source/ui/src/condfrmt.src21
-rw-r--r--sc/source/ui/src/crnrdlg.src34
-rw-r--r--sc/source/ui/src/datafdlg.src99
-rw-r--r--sc/source/ui/src/dbnamdlg.src21
-rw-r--r--sc/source/ui/src/globstr.src89
-rw-r--r--sc/source/ui/src/hdrcont.src74
-rw-r--r--sc/source/ui/src/makefile.mk3
-rw-r--r--sc/source/ui/src/miscdlgs.src209
-rw-r--r--sc/source/ui/src/namedlg.src5
-rw-r--r--sc/source/ui/src/opredlin.src37
-rw-r--r--sc/source/ui/src/optdlg.src165
-rw-r--r--sc/source/ui/src/optsolver.src2
-rw-r--r--sc/source/ui/src/popup.src4
-rw-r--r--sc/source/ui/src/pseudo.src34
-rw-r--r--sc/source/ui/src/sc.src5
-rw-r--r--sc/source/ui/src/scerrors.src3
-rw-r--r--sc/source/ui/src/scstring.src86
-rw-r--r--sc/source/ui/src/scwarngs.src40
-rw-r--r--sc/source/ui/src/simpref.src30
-rw-r--r--sc/source/ui/src/solveroptions.src2
-rw-r--r--sc/source/ui/src/solvrdlg.src3
-rw-r--r--sc/source/ui/src/sortdlg.src47
-rw-r--r--sc/source/ui/src/subtdlg.src58
-rw-r--r--sc/source/ui/src/tabopdlg.src1
-rw-r--r--sc/source/ui/src/textdlgs.src42
-rw-r--r--sc/source/ui/src/toolbox.src152
-rw-r--r--sc/source/ui/styleui/makefile.mk5
-rw-r--r--sc/source/ui/styleui/scstyles.src14
-rw-r--r--sc/source/ui/styleui/styledlg.cxx117
-rw-r--r--sc/source/ui/styleui/styledlg.src39
-rw-r--r--sc/source/ui/undo/areasave.cxx9
-rw-r--r--sc/source/ui/undo/makefile.mk25
-rw-r--r--sc/source/ui/undo/refundo.cxx6
-rw-r--r--sc/source/ui/undo/target.cxx5
-rw-r--r--sc/source/ui/undo/undobase.cxx77
-rw-r--r--sc/source/ui/undo/undoblk.cxx417
-rw-r--r--sc/source/ui/undo/undoblk2.cxx27
-rw-r--r--sc/source/ui/undo/undoblk3.cxx416
-rw-r--r--sc/source/ui/undo/undocell.cxx172
-rw-r--r--sc/source/ui/undo/undodat.cxx715
-rw-r--r--sc/source/ui/undo/undodraw.cxx103
-rw-r--r--sc/source/ui/undo/undoolk.cxx6
-rw-r--r--sc/source/ui/undo/undostyl.cxx11
-rw-r--r--sc/source/ui/undo/undotab.cxx294
-rw-r--r--sc/source/ui/undo/undoutil.cxx8
-rw-r--r--sc/source/ui/unoobj/ChartRangeSelectionListener.cxx13
-rw-r--r--sc/source/ui/unoobj/addruno.cxx28
-rw-r--r--sc/source/ui/unoobj/afmtuno.cxx88
-rw-r--r--sc/source/ui/unoobj/appluno.cxx107
-rw-r--r--sc/source/ui/unoobj/celllistsource.cxx18
-rw-r--r--sc/source/ui/unoobj/celllistsource.hxx3
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx1338
-rw-r--r--sc/source/ui/unoobj/cellvaluebinding.cxx38
-rw-r--r--sc/source/ui/unoobj/cellvaluebinding.hxx3
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx534
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx87
-rw-r--r--sc/source/ui/unoobj/confuno.cxx31
-rw-r--r--sc/source/ui/unoobj/convuno.cxx2
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx108
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx403
-rw-r--r--sc/source/ui/unoobj/datauno.cxx243
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx18
-rw-r--r--sc/source/ui/unoobj/detreg.cxx2
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx36
-rw-r--r--sc/source/ui/unoobj/docuno.cxx439
-rw-r--r--sc/source/ui/unoobj/drdefuno.cxx2
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx12
-rw-r--r--[-rwxr-xr-x]sc/source/ui/unoobj/eventuno.cxx27
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx115
-rw-r--r--sc/source/ui/unoobj/filtuno.cxx33
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx289
-rw-r--r--sc/source/ui/unoobj/forbiuno.cxx8
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx50
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx212
-rw-r--r--sc/source/ui/unoobj/listenercalls.cxx2
-rw-r--r--sc/source/ui/unoobj/makefile.mk3
-rw-r--r--sc/source/ui/unoobj/miscuno.cxx120
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx390
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx122
-rw-r--r--sc/source/ui/unoobj/optuno.cxx12
-rw-r--r--sc/source/ui/unoobj/pageuno.cxx3
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx219
-rw-r--r--sc/source/ui/unoobj/scdetect.hxx3
-rw-r--r--sc/source/ui/unoobj/servuno.cxx64
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx232
-rw-r--r--sc/source/ui/unoobj/srchuno.cxx50
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx210
-rw-r--r--sc/source/ui/unoobj/targuno.cxx15
-rw-r--r--sc/source/ui/unoobj/textuno.cxx113
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx20
-rw-r--r--sc/source/ui/unoobj/unodoc.cxx6
-rw-r--r--sc/source/ui/unoobj/unoreflist.cxx2
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx414
-rw-r--r--sc/source/ui/unoobj/warnpassword.cxx2
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx194
-rw-r--r--sc/source/ui/vba/excelvbahelper.hxx53
-rw-r--r--sc/source/ui/vba/helperdecl.hxx2
-rw-r--r--sc/source/ui/vba/makefile.mk21
-rw-r--r--sc/source/ui/vba/service.cxx13
-rw-r--r--sc/source/ui/vba/testvba/makefile.mk4
-rw-r--r--sc/source/ui/vba/testvba/testvba.cxx49
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx716
-rw-r--r--sc/source/ui/vba/vbaapplication.hxx26
-rw-r--r--sc/source/ui/vba/vbaassistant.cxx11
-rw-r--r--sc/source/ui/vba/vbaassistant.hxx3
-rw-r--r--sc/source/ui/vba/vbaaxes.cxx8
-rw-r--r--sc/source/ui/vba/vbaaxes.hxx3
-rw-r--r--sc/source/ui/vba/vbaaxis.cxx39
-rw-r--r--sc/source/ui/vba/vbaaxis.hxx3
-rw-r--r--sc/source/ui/vba/vbaaxistitle.cxx2
-rw-r--r--sc/source/ui/vba/vbaaxistitle.hxx3
-rw-r--r--sc/source/ui/vba/vbaborders.cxx7
-rw-r--r--sc/source/ui/vba/vbaborders.hxx2
-rw-r--r--sc/source/ui/vba/vbacharacters.cxx6
-rw-r--r--sc/source/ui/vba/vbacharacters.hxx4
-rw-r--r--sc/source/ui/vba/vbachart.cxx164
-rw-r--r--sc/source/ui/vba/vbachart.hxx15
-rw-r--r--sc/source/ui/vba/vbachartobject.cxx55
-rw-r--r--sc/source/ui/vba/vbachartobject.hxx15
-rw-r--r--sc/source/ui/vba/vbachartobjects.cxx6
-rw-r--r--sc/source/ui/vba/vbachartobjects.hxx7
-rw-r--r--sc/source/ui/vba/vbacharts.cxx120
-rw-r--r--sc/source/ui/vba/vbacharts.hxx60
-rw-r--r--sc/source/ui/vba/vbacharttitle.cxx2
-rw-r--r--sc/source/ui/vba/vbacharttitle.hxx3
-rw-r--r--sc/source/ui/vba/vbacomment.cxx27
-rw-r--r--sc/source/ui/vba/vbacomment.hxx2
-rw-r--r--sc/source/ui/vba/vbacomments.cxx3
-rw-r--r--sc/source/ui/vba/vbacomments.hxx2
-rw-r--r--sc/source/ui/vba/vbacommentshape.cxx49
-rw-r--r--sc/source/ui/vba/vbacommentshape.hxx49
-rw-r--r--sc/source/ui/vba/vbacondition.cxx2
-rw-r--r--sc/source/ui/vba/vbacondition.hxx3
-rw-r--r--sc/source/ui/vba/vbadialog.cxx81
-rw-r--r--sc/source/ui/vba/vbadialog.hxx5
-rw-r--r--sc/source/ui/vba/vbadialogs.cxx9
-rw-r--r--sc/source/ui/vba/vbadialogs.hxx4
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbaeventshelper.cxx33
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbaeventshelper.hxx3
-rw-r--r--sc/source/ui/vba/vbafiledialog.cxx186
-rw-r--r--sc/source/ui/vba/vbafiledialog.hxx63
-rw-r--r--sc/source/ui/vba/vbafiledialogselecteditems.cxx157
-rw-r--r--sc/source/ui/vba/vbafiledialogselecteditems.hxx90
-rw-r--r--sc/source/ui/vba/vbafilesearch.cxx245
-rw-r--r--sc/source/ui/vba/vbafilesearch.hxx80
-rw-r--r--sc/source/ui/vba/vbafont.cxx13
-rw-r--r--sc/source/ui/vba/vbafont.hxx2
-rw-r--r--sc/source/ui/vba/vbaformat.cxx30
-rw-r--r--sc/source/ui/vba/vbaformat.hxx3
-rw-r--r--sc/source/ui/vba/vbaformatcondition.cxx5
-rw-r--r--sc/source/ui/vba/vbaformatcondition.hxx3
-rw-r--r--sc/source/ui/vba/vbaformatconditions.cxx14
-rw-r--r--sc/source/ui/vba/vbaformatconditions.hxx6
-rw-r--r--sc/source/ui/vba/vbafoundfiles.cxx146
-rw-r--r--sc/source/ui/vba/vbafoundfiles.hxx91
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx19
-rw-r--r--sc/source/ui/vba/vbaglobals.hxx4
-rw-r--r--sc/source/ui/vba/vbahelper.cxx23
-rw-r--r--sc/source/ui/vba/vbahyperlink.cxx5
-rw-r--r--sc/source/ui/vba/vbahyperlink.hxx2
-rw-r--r--sc/source/ui/vba/vbahyperlinks.cxx11
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbahyperlinks.hxx3
-rw-r--r--sc/source/ui/vba/vbainterior.cxx23
-rw-r--r--sc/source/ui/vba/vbainterior.hxx4
-rw-r--r--sc/source/ui/vba/vbamenu.cxx87
-rw-r--r--sc/source/ui/vba/vbamenu.hxx57
-rw-r--r--sc/source/ui/vba/vbamenubar.cxx69
-rw-r--r--sc/source/ui/vba/vbamenubar.hxx53
-rw-r--r--sc/source/ui/vba/vbamenubars.cxx140
-rw-r--r--sc/source/ui/vba/vbamenubars.hxx64
-rw-r--r--sc/source/ui/vba/vbamenuitem.cxx85
-rw-r--r--sc/source/ui/vba/vbamenuitem.hxx58
-rw-r--r--sc/source/ui/vba/vbamenuitems.cxx153
-rw-r--r--sc/source/ui/vba/vbamenuitems.hxx63
-rw-r--r--sc/source/ui/vba/vbamenus.cxx139
-rw-r--r--sc/source/ui/vba/vbamenus.hxx63
-rw-r--r--sc/source/ui/vba/vbaname.cxx91
-rw-r--r--sc/source/ui/vba/vbaname.hxx6
-rw-r--r--sc/source/ui/vba/vbanames.cxx93
-rw-r--r--sc/source/ui/vba/vbanames.hxx2
-rw-r--r--sc/source/ui/vba/vbaoleobject.cxx17
-rw-r--r--sc/source/ui/vba/vbaoleobject.hxx2
-rw-r--r--sc/source/ui/vba/vbaoleobjects.cxx3
-rw-r--r--sc/source/ui/vba/vbaoleobjects.hxx2
-rw-r--r--sc/source/ui/vba/vbaoutline.cxx5
-rw-r--r--sc/source/ui/vba/vbaoutline.hxx3
-rw-r--r--sc/source/ui/vba/vbapagebreak.cxx10
-rw-r--r--sc/source/ui/vba/vbapagebreak.hxx3
-rw-r--r--sc/source/ui/vba/vbapagebreaks.cxx30
-rw-r--r--sc/source/ui/vba/vbapagebreaks.hxx3
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx128
-rw-r--r--sc/source/ui/vba/vbapagesetup.hxx5
-rw-r--r--sc/source/ui/vba/vbapalette.cxx7
-rw-r--r--sc/source/ui/vba/vbapalette.hxx2
-rw-r--r--sc/source/ui/vba/vbapane.cxx23
-rw-r--r--sc/source/ui/vba/vbapane.hxx5
-rw-r--r--sc/source/ui/vba/vbapivotcache.cxx13
-rw-r--r--sc/source/ui/vba/vbapivotcache.hxx7
-rw-r--r--sc/source/ui/vba/vbapivottable.cxx3
-rw-r--r--sc/source/ui/vba/vbapivottable.hxx3
-rw-r--r--sc/source/ui/vba/vbapivottables.cxx3
-rw-r--r--sc/source/ui/vba/vbapivottables.hxx3
-rw-r--r--sc/source/ui/vba/vbapropvalue.cxx3
-rw-r--r--sc/source/ui/vba/vbapropvalue.hxx5
-rw-r--r--sc/source/ui/vba/vbaquerytable.cxx90
-rw-r--r--sc/source/ui/vba/vbaquerytable.hxx (renamed from sc/source/ui/vba/vbaseriescollection.hxx)48
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbarange.cxx1409
-rw-r--r--sc/source/ui/vba/vbarange.hxx28
-rw-r--r--sc/source/ui/vba/vbaseriescollection.cxx80
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx5
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbasheetobject.hxx3
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbasheetobjects.cxx3
-rw-r--r--[-rwxr-xr-x]sc/source/ui/vba/vbasheetobjects.hxx3
-rw-r--r--sc/source/ui/vba/vbastyle.cxx5
-rw-r--r--sc/source/ui/vba/vbastyle.hxx33
-rw-r--r--sc/source/ui/vba/vbastyles.cxx3
-rw-r--r--sc/source/ui/vba/vbastyles.hxx3
-rw-r--r--sc/source/ui/vba/vbatextboxshape.cxx3
-rw-r--r--sc/source/ui/vba/vbatextboxshape.hxx3
-rw-r--r--sc/source/ui/vba/vbatextframe.cxx3
-rw-r--r--sc/source/ui/vba/vbatextframe.hxx3
-rw-r--r--sc/source/ui/vba/vbatitle.hxx3
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx25
-rw-r--r--sc/source/ui/vba/vbavalidation.hxx3
-rw-r--r--sc/source/ui/vba/vbawindow.cxx24
-rw-r--r--sc/source/ui/vba/vbawindow.hxx3
-rw-r--r--sc/source/ui/vba/vbawindows.cxx15
-rw-r--r--sc/source/ui/vba/vbawindows.hxx4
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx105
-rw-r--r--sc/source/ui/vba/vbaworkbook.hxx12
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx9
-rw-r--r--sc/source/ui/vba/vbaworkbooks.hxx3
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx169
-rw-r--r--sc/source/ui/vba/vbaworksheet.hxx9
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx17
-rw-r--r--sc/source/ui/vba/vbaworksheets.hxx3
-rw-r--r--sc/source/ui/vba/vbawsfunction.cxx73
-rw-r--r--sc/source/ui/vba/vbawsfunction.hxx2
-rw-r--r--sc/source/ui/view/auditsh.cxx6
-rw-r--r--sc/source/ui/view/cellmergeoption.cxx90
-rw-r--r--sc/source/ui/view/cellsh.cxx65
-rw-r--r--sc/source/ui/view/cellsh1.cxx421
-rw-r--r--sc/source/ui/view/cellsh2.cxx339
-rw-r--r--sc/source/ui/view/cellsh3.cxx119
-rw-r--r--sc/source/ui/view/cellsh4.cxx162
-rw-r--r--sc/source/ui/view/colrowba.cxx21
-rw-r--r--sc/source/ui/view/dbfunc.cxx54
-rw-r--r--sc/source/ui/view/dbfunc2.cxx2
-rw-r--r--sc/source/ui/view/dbfunc3.cxx217
-rw-r--r--sc/source/ui/view/dbfunc4.cxx7
-rw-r--r--sc/source/ui/view/drawattr.cxx10
-rw-r--r--sc/source/ui/view/drawutil.cxx2
-rw-r--r--sc/source/ui/view/drawvie2.cxx2
-rw-r--r--sc/source/ui/view/drawvie3.cxx64
-rw-r--r--sc/source/ui/view/drawvie4.cxx51
-rw-r--r--sc/source/ui/view/drawview.cxx173
-rw-r--r--sc/source/ui/view/editsh.cxx76
-rw-r--r--sc/source/ui/view/formatsh.cxx256
-rw-r--r--sc/source/ui/view/galwrap.cxx4
-rw-r--r--sc/source/ui/view/gridmerg.cxx6
-rw-r--r--sc/source/ui/view/gridwin.cxx636
-rw-r--r--sc/source/ui/view/gridwin2.cxx113
-rw-r--r--sc/source/ui/view/gridwin3.cxx75
-rw-r--r--sc/source/ui/view/gridwin4.cxx462
-rw-r--r--sc/source/ui/view/gridwin5.cxx27
-rw-r--r--sc/source/ui/view/hdrcont.cxx71
-rw-r--r--sc/source/ui/view/hintwin.cxx5
-rw-r--r--sc/source/ui/view/imapwrap.cxx2
-rw-r--r--sc/source/ui/view/invmerge.cxx4
-rw-r--r--sc/source/ui/view/makefile.mk149
-rw-r--r--sc/source/ui/view/notemark.cxx8
-rw-r--r--sc/source/ui/view/olinewin.cxx8
-rw-r--r--sc/source/ui/view/olkact.cxx69
-rw-r--r--sc/source/ui/view/output.cxx251
-rw-r--r--sc/source/ui/view/output2.cxx832
-rw-r--r--sc/source/ui/view/output3.cxx10
-rw-r--r--sc/source/ui/view/overlayobject.cxx104
-rw-r--r--sc/source/ui/view/pfuncache.cxx4
-rw-r--r--sc/source/ui/view/pgbrksh.cxx2
-rw-r--r--sc/source/ui/view/pivotsh.cxx24
-rw-r--r--sc/source/ui/view/preview.cxx195
-rw-r--r--sc/source/ui/view/prevloc.cxx337
-rw-r--r--sc/source/ui/view/prevwsh.cxx177
-rw-r--r--sc/source/ui/view/prevwsh2.cxx139
-rw-r--r--sc/source/ui/view/printfun.cxx225
-rw-r--r--sc/source/ui/view/reffact.cxx50
-rw-r--r--sc/source/ui/view/scextopt.cxx5
-rw-r--r--sc/source/ui/view/select.cxx254
-rw-r--r--sc/source/ui/view/selectionstate.cxx6
-rw-r--r--sc/source/ui/view/spelldialog.cxx6
-rw-r--r--sc/source/ui/view/spelleng.cxx4
-rw-r--r--sc/source/ui/view/tabcont.cxx73
-rw-r--r--sc/source/ui/view/tabpopsh.cxx3
-rw-r--r--sc/source/ui/view/tabsplit.cxx14
-rw-r--r--sc/source/ui/view/tabview.cxx246
-rw-r--r--sc/source/ui/view/tabview2.cxx593
-rw-r--r--sc/source/ui/view/tabview3.cxx470
-rw-r--r--sc/source/ui/view/tabview4.cxx24
-rw-r--r--sc/source/ui/view/tabview5.cxx74
-rw-r--r--sc/source/ui/view/tabvwsh.cxx5
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx37
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx180
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx427
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx17
-rw-r--r--sc/source/ui/view/tabvwsh8.cxx6
-rw-r--r--sc/source/ui/view/tabvwsh9.cxx25
-rw-r--r--sc/source/ui/view/tabvwsha.cxx128
-rw-r--r--sc/source/ui/view/tabvwshb.cxx29
-rw-r--r--sc/source/ui/view/tabvwshc.cxx22
-rw-r--r--sc/source/ui/view/tabvwshd.cxx4
-rw-r--r--sc/source/ui/view/tabvwshe.cxx20
-rw-r--r--sc/source/ui/view/tabvwshf.cxx120
-rw-r--r--sc/source/ui/view/tabvwshg.cxx15
-rw-r--r--sc/source/ui/view/tabvwshh.cxx8
-rw-r--r--sc/source/ui/view/viewdata.cxx261
-rw-r--r--sc/source/ui/view/viewfun2.cxx782
-rw-r--r--sc/source/ui/view/viewfun3.cxx381
-rw-r--r--sc/source/ui/view/viewfun4.cxx63
-rw-r--r--sc/source/ui/view/viewfun5.cxx84
-rw-r--r--sc/source/ui/view/viewfun6.cxx178
-rw-r--r--sc/source/ui/view/viewfun7.cxx52
-rw-r--r--sc/source/ui/view/viewfunc.cxx285
-rw-r--r--sc/source/ui/view/viewutil.cxx209
-rw-r--r--sc/source/ui/view/waitoff.cxx2
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml15
-rw-r--r--sc/uiconfig/scalc/statusbar/statusbar.xml2
-rw-r--r--sc/uiconfig/scalc/toolbar/formatobjectbar.xml4
-rw-r--r--sc/util/hidother.src4
-rw-r--r--sc/util/makefile.mk14
-rw-r--r--sc/util/sc.flt136
-rw-r--r--sc/util/scfilt.map3
-rw-r--r--sc/workben/addin.cxx19
-rw-r--r--sc/workben/addin.hxx2
-rw-r--r--sc/workben/makefile.mk2
-rw-r--r--sc/workben/result.cxx10
-rw-r--r--sc/workben/result.hxx2
-rw-r--r--sc/workben/test.cxx290
-rw-r--r--sc/xml/AccessibleEditableTextPara_HeaderFooter.xml1
-rw-r--r--sc/xml/AccessibleEditableTextPara_PreviewCell.xml1
-rw-r--r--sc/xml/AccessibleEditableTextPara_PreviewNote.xml1
-rw-r--r--sc/xml/ScAccessibleCell.xml1
-rw-r--r--sc/xml/ScAccessibleCsvCell.xml1
-rw-r--r--sc/xml/ScAccessibleCsvGrid.xml1
-rw-r--r--sc/xml/ScAccessibleCsvRuler.xml1
-rw-r--r--sc/xml/ScAccessibleDocument.xml1
-rw-r--r--sc/xml/ScAccessibleDocumentPagePreview.xml1
-rw-r--r--sc/xml/ScAccessiblePageHeader.xml1
-rw-r--r--sc/xml/ScAccessiblePageHeaderArea.xml1
-rw-r--r--sc/xml/ScAccessiblePreviewCell.xml1
-rw-r--r--sc/xml/ScAccessiblePreviewHeaderCell.xml1
-rw-r--r--sc/xml/ScAccessiblePreviewTable.xml1
-rw-r--r--sc/xml/ScAccessibleSpreadsheet.xml1
-rw-r--r--sc/xml/ScAnnotationObj.xml1
-rw-r--r--sc/xml/ScAnnotationShapeObj.xml1
-rw-r--r--sc/xml/ScAnnotationsObj.xml1
-rw-r--r--sc/xml/ScAreaLinkObj.xml1
-rw-r--r--sc/xml/ScAreaLinksObj.xml1
-rw-r--r--sc/xml/ScAutoFormatFieldObj.xml1
-rw-r--r--sc/xml/ScAutoFormatObj.xml1
-rw-r--r--sc/xml/ScAutoFormatsObj.xml1
-rw-r--r--sc/xml/ScCellCursorObj.xml1
-rw-r--r--sc/xml/ScCellFieldObj.xml1
-rw-r--r--sc/xml/ScCellFieldsObj.xml1
-rw-r--r--sc/xml/ScCellFormatsEnumeration.xml1
-rw-r--r--sc/xml/ScCellFormatsObj.xml1
-rw-r--r--sc/xml/ScCellObj.xml1
-rw-r--r--sc/xml/ScCellRangeObj.xml1
-rw-r--r--sc/xml/ScCellRangesObj.xml1
-rw-r--r--sc/xml/ScCellSearchObj.xml1
-rw-r--r--sc/xml/ScCellTextCursor.xml1
-rw-r--r--sc/xml/ScCellsEnumeration.xml1
-rw-r--r--sc/xml/ScCellsObj.xml1
-rw-r--r--sc/xml/ScChartObj.xml1
-rw-r--r--sc/xml/ScChartsObj.xml1
-rw-r--r--sc/xml/ScConsolidationDescriptor.xml1
-rw-r--r--sc/xml/ScDDELinkObj.xml1
-rw-r--r--sc/xml/ScDDELinksObj.xml1
-rw-r--r--sc/xml/ScDataPilotFieldGroupItemObj.xml1
-rw-r--r--sc/xml/ScDataPilotFieldGroupObj.xml1
-rw-r--r--sc/xml/ScDataPilotFieldGroupsObj.xml1
-rw-r--r--sc/xml/ScDataPilotFieldObj.xml1
-rw-r--r--sc/xml/ScDataPilotFieldsObj.xml1
-rw-r--r--sc/xml/ScDataPilotItemObj.xml1
-rw-r--r--sc/xml/ScDataPilotItemsObj.xml1
-rw-r--r--sc/xml/ScDataPilotTableObj.xml1
-rw-r--r--sc/xml/ScDataPilotTablesObj.xml1
-rw-r--r--sc/xml/ScDatabaseRangeObj.xml1
-rw-r--r--sc/xml/ScDatabaseRangesObj.xml1
-rw-r--r--sc/xml/ScDocumentConfiguration.xml1
-rw-r--r--sc/xml/ScDrawPageObj.xml1
-rw-r--r--sc/xml/ScDrawPagesObj.xml1
-rw-r--r--sc/xml/ScFilterDescriptorBase.xml1
-rw-r--r--sc/xml/ScFunctionListObj.xml1
-rw-r--r--sc/xml/ScHeaderFieldObj.xml1
-rw-r--r--sc/xml/ScHeaderFieldsObj.xml1
-rw-r--r--sc/xml/ScHeaderFooterContentObj.xml1
-rw-r--r--sc/xml/ScHeaderFooterTextCursor.xml1
-rw-r--r--sc/xml/ScHeaderFooterTextObj.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_CellAnnotationsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_CellAreaLinksEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_DDELinksEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_DataPilotFieldsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_DataPilotItemsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_DataPilotTablesEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_DatabaseRangesEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_FunctionDescriptionEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_LabelRangesEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_NamedRangesEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_ScenariosEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_SheetCellRangesEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_SheetLinksEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_SpreadsheetsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_SubTotalFieldsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_TableAutoFormatEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_TableChartsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_TableColumnsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_TableConditionalEntryEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_TableRowsEnumeration.xml1
-rw-r--r--sc/xml/ScIndexEnumeration_TextFieldEnumeration.xml1
-rw-r--r--sc/xml/ScLabelRangeObj.xml1
-rw-r--r--sc/xml/ScLabelRangesObj.xml1
-rw-r--r--sc/xml/ScModelObj.xml1
-rw-r--r--sc/xml/ScNamedRangeObj.xml1
-rw-r--r--sc/xml/ScNamedRangesObj.xml1
-rw-r--r--sc/xml/ScPageObj.xml1
-rw-r--r--sc/xml/ScRecentFunctionsObj.xml1
-rw-r--r--sc/xml/ScScenariosObj.xml1
-rw-r--r--sc/xml/ScShapeObj.xml1
-rw-r--r--sc/xml/ScSheetLinkObj.xml1
-rw-r--r--sc/xml/ScSheetLinksObj.xml1
-rw-r--r--sc/xml/ScSpreadsheetSettings.xml1
-rw-r--r--sc/xml/ScSpreadsheetSettingsObj.xml1
-rw-r--r--sc/xml/ScStyleFamiliesObj.xml1
-rw-r--r--sc/xml/ScStyleFamilyObj.xml1
-rw-r--r--sc/xml/ScStyleObj.xml1
-rw-r--r--sc/xml/ScSubTotalDescriptorBase.xml1
-rw-r--r--sc/xml/ScSubTotalFieldObj.xml1
-rw-r--r--sc/xml/ScTabViewObj.xml1
-rw-r--r--sc/xml/ScTableColumnObj.xml1
-rw-r--r--sc/xml/ScTableColumnsObj.xml1
-rw-r--r--sc/xml/ScTableConditionalEntry.xml1
-rw-r--r--sc/xml/ScTableConditionalFormat.xml1
-rw-r--r--sc/xml/ScTableRowObj.xml1
-rw-r--r--sc/xml/ScTableRowsObj.xml1
-rw-r--r--sc/xml/ScTableSheetObj.xml1
-rw-r--r--sc/xml/ScTableSheetsObj.xml1
-rw-r--r--sc/xml/ScTableValidationObj.xml1
-rw-r--r--sc/xml/ScUniqueCellFormatsEnumeration.xml1
-rw-r--r--sc/xml/ScUniqueCellFormatsObj.xml1
-rw-r--r--sc/xml/ScViewPaneObj.xml1
-rw-r--r--sc/xml/ScXMLExport.xml1
-rw-r--r--sc/xml/ScXMLImport.xml1
1612 files changed, 55660 insertions, 49800 deletions
diff --git a/sc/addin/datefunc/dfa.cl b/sc/addin/datefunc/dfa.cl
deleted file mode 100644
index d45a1b548a0d..000000000000
--- a/sc/addin/datefunc/dfa.cl
+++ /dev/null
@@ -1,729 +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.
- *
- ************************************************************************/
-
-/* static char datefunc_Id[]="@(#) StarCalc Datefunc AddIn (c) 1998-2000 Sun Microsystems, Inc."; */
-
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include <xlang.h>
-#include <addin.h>
-#include <dfa.hrc>
-
-
-/**
- * the current language the Addin is using
- */
-static USHORT _nLanguage=LANGUAGE_ENGLISH;
-
-/**
- * StarCalc calls this function to set a new current Language for the Addin
- *
- * @param *nLanguage
- *
- */
-void CALLTYPE SetLanguage( USHORT* nLanguage )
-{
- _nLanguage = GetNeutralLanguage( *nLanguage );
-}
-
-
-/**
- * Null Date, initialized in GetFunctionCount
- *
- * StarCalc uses a BaseDate 12/30/1899
- * If not specified otherwise in the Settings for the Spreedsheet Document.
- *
- * There's no way to get the Spreadsheet settings from whithin a simple addin,
- * so this Addin can only be used by documents using the default BaseDate setting.
- *
- * The functions in this Addin use a BaseDate 01/01/0001
- * The nNullDate Variable is the StarCalc BaseDate converted to
- * this internal date representation.
- *
- * @see #GetFunctionCount
- *
- */
-
-static ULONG nNullDate=0;
-
-#define NULLDATE_Year 1899
-#define NULLDATE_Month 12
-#define NULLDATE_Day 30
-
-
-/**
- * Array holding values for month length, used in DaysInMonth() function
- *
- * @see #DaysInMonth
- *
- */
-static USHORT aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
- 31, 31, 30, 31, 30, 31 };
-
-/**
- * Check if a year is a leap year in the Gregorian calendar
- *
- * @param nYear the year which should be checked
- * @return true if the year is a leap year, false otherwise.
- *
- * @see #DaysInMonth, #IsLeapYear,
- * @see #ScDate_DaysInMonth, #ScDate_IsLeapYear, #ScDate_WeeksInYear
- *
- */
-static BOOL IsLeapYear( USHORT nYear )
-{
- return (BOOL)((((nYear % 4) == 0) && ((nYear % 100) != 0)) || ((nYear % 400) == 0));
-}
-
-
-/**
- * Get the number of days in a specified month
- *
- * @param nMonth the number of the Month
- * @param nYear the year
- * @return number of days
- *
- */
-static USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
-{
- if ( nMonth != 2 )
- return aDaysInMonth[nMonth-1];
- else
- {
- if ( IsLeapYear(nYear) )
- return aDaysInMonth[nMonth-1] + 1;
- else
- return aDaysInMonth[nMonth-1];
- }
-}
-
-
-/**
- * Convert a date to a count of days starting from 01/01/0001
- *
- * The internal representation of a Date used in this Addin
- * is the number of days between 01/01/0001 and the date
- * this function converts a Day , Month, Year representation
- * to this internal Date value.
- *
- * @param nDay the day of the Month
- * @param nMonth the number of the Month
- * @param nYear the Year
- * @return count of days from 01/01/0001 to the date specified
- *
- */
-static long DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear )
-{
- long nDays;
- USHORT i;
-
- nDays = ((ULONG)nYear-1) * 365;
- nDays += ((nYear-1) / 4) - ((nYear-1) / 100) + ((nYear-1) / 400);
-
- for( i = 1; i < nMonth; i++ )
- nDays += DaysInMonth(i,nYear);
- nDays += nDay;
-
- return nDays;
-}
-
-
-/**
- * Convert a count of days starting from 01/01/0001 to a date
- *
- * The internal representation of a Date used in this Addin
- * is the number of days between 01/01/0001 and the date
- * this function converts this internal Date value
- * to a Day , Month, Year representation of a Date.
- *
- * @param nDay count of days from 01/01/0001
- * @param *pDay pointer to a variable for the day of the month
- * @param *pMonth pointer to a variable for the month
- * @param *pYear pointer to a variable for the year
- *
- */
-static void DaysToDate( long nDays,
- USHORT *pDay, USHORT *pMonth, USHORT *pYear )
-{
- long nTempDays;
- long i = 0;
- BOOL bCalc;
-
- do
- {
- nTempDays = (long)nDays;
- *pYear = (USHORT)((nTempDays / 365) - i);
- nTempDays -= ((ULONG) *pYear -1) * 365;
- nTempDays -= (( *pYear -1) / 4) - (( *pYear -1) / 100) + ((*pYear -1) / 400);
- bCalc = FALSE;
- if ( nTempDays < 1 )
- {
- i++;
- bCalc = TRUE;
- }
- else
- {
- if ( nTempDays > 365 )
- {
- if ( (nTempDays != 366) || !IsLeapYear( *pYear ) )
- {
- i--;
- bCalc = TRUE;
- }
- }
- }
- }
- while ( bCalc );
-
- *pMonth = 1;
- while ( (ULONG)nTempDays > DaysInMonth( *pMonth, *pYear ) )
- {
- nTempDays -= DaysInMonth( *pMonth, *pYear );
- (*pMonth)++;
- }
- *pDay = (USHORT)nTempDays;
-}
-
-/**
- * Get week difference between 2 dates
- *
- * new Weeks(date1,date2,mode) function for StarCalc
- *
- * Two modes of operation are provided.
- * The first is just a simple division by 7 calculation.
- *
- * The second calculates the diffence by week of year.
- *
- * The International Standard IS-8601 has decreed that Monday
- * shall be the first day of the week.
- *
- * A week that lies partly in one year and partly in annother
- * is assigned a number in the the year in which most of its days lie.
- *
- * That means that week 1 of any year is the week that contains the 4. January
- *
- * The internal representation of a Date used in the Addin is the number of days based on 01/01/0001
- *
- * A WeekDay can be then calculated by substracting 1 and calculating the rest of
- * a division by 7, which gives a 0 - 6 value for Monday - Sunday
- *
- * Using the 4. January rule explained above the formula
- *
- * nWeek1= ( nDays1 - nJan4 + ( (nJan4-1) % 7 ) ) / 7 + 1;
- *
- * calculates a number between 0-53 for each day which is in the same year as nJan4
- * where 0 means that this week belonged to the year before.
- *
- * If a day in the same or annother year is used in this formula this calculates
- * an calendar week offset from a given 4. January
- *
- * nWeek2 = ( nDays2 - nJan4 + ( (nJan4-1) % 7 ) ) / 7 + 1;
- *
- * The 4.January of first Date Argument can thus be used to calculate
- * the week difference by calendar weeks which is then nWeek = nWeek2 - nWeek1
- *
- * which can be optimized to
- *
- * nWeek = ( (nDays2-nJan4+((nJan4-1)%7))/7 ) - ( (nDays1-nJan4+((nJan4-1)%7))/7 )
- *
- * Note: All calculations are operating on the long integer data type
- * % is the modulo operator in C which calculates the rest of an Integer division
- *
- *
- * @param *r - return value for the StarCalc function
- * @param d1 - date value (in StarCalc representation based 12/30/1899), usually the older date
- * @param d2 - date value (in StarCalc representation based 12/30/1899), usually the younger date
- * @param dMode - mode of operation
- *
- * mode 0 is the interval between the dates in month, that is days / 7
- *
- * mode 1 is the difference by week of year
- *
- */
-void CALLTYPE ScDate_GetDiffWeeks(double *r, double *d1, double *d2, double *dMode)
-{
- long nDays1=0;
- long nDays2=0;
- int nMode=0;
-
- if ( d1 ) nDays1=(long)floor(*d1)+nNullDate;
- if ( d2 ) nDays2=(long)floor(*d2)+nNullDate;
-
-
- if ( dMode) nMode=(int)*dMode;
-
- if ( nMode == 1 ) {
-
- USHORT nDay,nMonth,nYear;
- long nJan4;
-
- DaysToDate(nDays1,&nDay,&nMonth,&nYear);
- nJan4=DateToDays(4,1,nYear);
-
- *r=(double) ( ( (nDays2-nJan4+((nJan4-1)%7))/7 ) - ( (nDays1-nJan4+((nJan4-1)%7))/7 ) );
-
- } else {
-
- *r= (double) ( (nDays2 - nDays1) / 7 ) ;
- }
-
-}
-
-/**
- * Get month difference between 2 dates
- * =Month(start, end, mode) Function for StarCalc
- *
- * two modes are provided
- *
- * @param *r - return value for the StarCalc function
- * @param d1 - date value, start date
- * @param d2 - date value, end date
- * @param dMode - mode of operation
- *
- * mode 0 is the interval between the dates in month
- *
- * mode 1 is the difference in calendar month
- *
- */
-void CALLTYPE ScDate_GetDiffMonths(double *r, double *d1, double *d2, double *dMode)
-{
- USHORT nDay1,nMonth1,nYear1;
- USHORT nDay2,nMonth2,nYear2;
- long nDays1=0;
- long nDays2=0;
- int nMode=0;
-
- if ( dMode) nMode=(int)*dMode;
-
- if ( d1 ) nDays1=(long)floor(*d1)+nNullDate;
- if ( d2 ) nDays2=(long)floor(*d2)+nNullDate;
-
- DaysToDate(nDays1,&nDay1,&nMonth1,&nYear1);
- DaysToDate(nDays2,&nDay2,&nMonth2,&nYear2);
-
- *r=(double) ( nMonth2 - nMonth1 + (nYear2 - nYear1) * 12 );
- if ( nMode == 1 || nDays1 == nDays2 ) return;
-
- if ( nDays1 < nDays2 ) {
- if ( nDay1 > nDay2 ) {
- *r -= 1;
- }
- } else {
- if ( nDay1 < nDay2 ) {
- *r += 1;
- }
- }
-
-}
-
-
-/**
- * Get Year difference between 2 dates
- *
- * two modes are provided
- *
- * @param *r - return value for the StarCalc function
- * @param d1 - date value, start date
- * @param d2 - date value, end date
- * @param dMode - mode of operation
- *
- * mode 0 is the interval between the dates in years
- *
- * mode 1 is the difference in calendar years
- *
- */
-void CALLTYPE ScDate_GetDiffYears(double *r, double *d1, double *d2, double *dMode)
-{
- USHORT nDay1,nMonth1,nYear1;
- USHORT nDay2,nMonth2,nYear2;
- long nDays1=0;
- long nDays2=0;
- int nMode=0;
-
- if ( dMode) nMode=(int)*dMode;
-
- if ( d1 ) nDays1=(long)floor(*d1)+nNullDate;
- if ( d2 ) nDays2=(long)floor(*d2)+nNullDate;
-
- DaysToDate(nDays1,&nDay1,&nMonth1,&nYear1);
- DaysToDate(nDays2,&nDay2,&nMonth2,&nYear2);
- if ( nMode != 1 ) {
- ScDate_GetDiffMonths(r,d1,d2,dMode);
- *r= (double) ( ((int) *r) / 12 );
- } else {
- *r=(double) ( nYear2 - nYear1 );
- }
-}
-
-/**
- * Check if a Date is in a leap year in the Gregorian calendar
- *
- * @param *r - return value for the StarCalc function
- * @param d - date value (in StarCalc representation based 12/30/1899)
- *
- */
-void CALLTYPE ScDate_IsLeapYear(double *r, double *d)
-{
- ULONG nDays;
- USHORT nDay, nMonth, nYear;
- double v=0.0;
-
- if ( d ) v=*d;
- nDays=(int) v + nNullDate;
-
- DaysToDate(nDays,&nDay,&nMonth,&nYear);
-
- *r=(double) ( IsLeapYear(nYear) );
-
-}
-
-/**
- * Get the Number of Days in the month for a date
- *
- * @param *r - return value for the StarCalc function
- * @param d - date value (in StarCalc representation based 12/30/1899)
- *
- */
-void CALLTYPE ScDate_DaysInMonth(double *r, double *d)
-{
- ULONG nDays;
- USHORT nDay, nMonth, nYear;
- double v=0.0;
-
- if ( d ) v=*d;
- nDays=(int) v + nNullDate;
-
- DaysToDate(nDays,&nDay,&nMonth,&nYear);
- *r=(double) ( DaysInMonth( nMonth, nYear) );
-
-}
-
-
-/**
- * Get number of weeks in the year for a date
- *
- * Most years have 52 weeks, but years that start on a Thursday
- * and leep years that start on a Wednesday have 53 weeks
- *
- * The International Standard IS-8601 has decreed that Monday
- * shall be the first day of the week.
- *
- * A WeekDay can be calculated by substracting 1 and calculating the rest of
- * a division by 7 from the internal date represention
- * which gives a 0 - 6 value for Monday - Sunday
- *
- * @param *r - return value for the StarCalc function
- * @param d - date value (in StarCalc represantaion based 30.12.1899)
- *
- * @see #IsLeapYear #WeekNumber
- *
- */
-void CALLTYPE ScDate_WeeksInYear(double *r, double *d)
-{
- ULONG nDays;
- USHORT nDay, nMonth, nYear;
- double v=0.0;
- long nJan1WeekDay;
-
- if ( d ) v=*d;
- nDays=(int) v + nNullDate;
-
- DaysToDate(nDays,&nDay,&nMonth,&nYear);
-
- nJan1WeekDay= ( DateToDays(1,1,nYear) - 1) % 7;
-
- if ( nJan1WeekDay == 3 ) { /* Thursday */
- *r=(double) 53;
- return;
- } else if ( nJan1WeekDay == 2 ) { /* Wednesday */
- *r= (double) ( IsLeapYear(nYear) ? 53 : 52 );
- } else {
- *r= (double) 52;
- }
-}
-
-
-/**
- * Get number of days in the year of a date specified
- *
- * @param *r - return value for the StarCalc function
- * @param d - date value (in StarCalc represantaion based 30.12.1899)
- *
- */
-void CALLTYPE ScDate_DaysInYear(double *r, double *d)
-{
- ULONG nDays;
- USHORT nDay, nMonth, nYear;
- double v=0.0;
-
- if ( d ) v=*d;
- nDays=(int) v + nNullDate;
-
- DaysToDate(nDays,&nDay,&nMonth,&nYear);
- *r=(double) ( IsLeapYear(nYear) ? 366 : 365 );
-
-}
-
-
-/**
- * Tell StarCalc how many new functions this Addin provides.
- *
- * It's called before any of these new functions is actually
- * executed and is also used to initialize the NullDate here.
- *
- * StarCalc uses a Date Base 12/30/1899
- * If not specified otherwise in the Options for the Spreedsheet Document
- *
- *
- * @param *nCount - returns the number of functions which are exported to StarCalc
- *
- */
-void CALLTYPE GetFunctionCount( USHORT *nCount )
-{
-
- /* initialize nNullDate Value 0 is 12/30/1899 */
- nNullDate=DateToDays(NULLDATE_Day, NULLDATE_Month, NULLDATE_Year);
-
- *nCount = 7;
-}
-
-/**
- * Provides neccessary data for each new function to StarCalc
- *
- * @param *nNo Input: Function number between 0 and nCount - 1
- * @param *pFuncName Output: Functionname which should be called in the AddIn-DLL
- * @param *nParamCount Output: Number of Parameter. Must be greater than 0, because there's always a return-Value. Maximum is 16.
- * @param *peType Output: Pointer to arrray with exactly 16 variables of typ Paramtype. nParamCount Entries are set to the type of the corresponding Parameters.
- * @param *pInternalName Output: Functionname as seen by the Spreadsheet user
- *
- * @see #GetFunctionCount, #GetParameterDescription
- *
- */
-void CALLTYPE GetFunctionData( USHORT * nNo,
- char * pFuncName,
- USHORT * nParamCount,
- ParamType * peType,
- char * pInternalName )
-{
-
-
- switch( *nNo ) {
- case 0:
- SO_StringCopy( pInternalName, getText(DFA_WEEK_NAME) );
- SO_StringCopy( pFuncName, "ScDate_GetDiffWeeks" );
- peType[0] = PTR_DOUBLE;
- peType[1] = PTR_DOUBLE;
- peType[2] = PTR_DOUBLE;
- peType[3] = PTR_DOUBLE;
- *nParamCount=4;
- break;
-
- case 1:
- SO_StringCopy( pInternalName, getText(DFA_MONTHS_NAME) );
- SO_StringCopy( pFuncName, "ScDate_GetDiffMonths" );
- peType[0] = PTR_DOUBLE;
- peType[1] = PTR_DOUBLE;
- peType[2] = PTR_DOUBLE;
- peType[3] = PTR_DOUBLE;
- *nParamCount=4;
- break;
-
- case 2:
- SO_StringCopy( pInternalName, getText(DFA_YEARS_NAME) );
- SO_StringCopy( pFuncName, "ScDate_GetDiffYears" );
- peType[0] = PTR_DOUBLE;
- peType[1] = PTR_DOUBLE;
- peType[2] = PTR_DOUBLE;
- peType[3] = PTR_DOUBLE;
- *nParamCount=4;
- break;
-
- case 3:
- SO_StringCopy( pInternalName, getText(DFA_ISLEAPYEAR_NAME) );
- SO_StringCopy( pFuncName, "ScDate_IsLeapYear" );
- peType[0] = PTR_DOUBLE;
- peType[1] = PTR_DOUBLE;
- *nParamCount=2;
- break;
-
- case 4:
- SO_StringCopy( pInternalName, getText(DFA_DAYSINMONTH_NAME) );
- SO_StringCopy( pFuncName, "ScDate_DaysInMonth" );
- peType[0] = PTR_DOUBLE;
- peType[1] = PTR_DOUBLE;
- *nParamCount=2;
- break;
-
- case 5:
- SO_StringCopy( pInternalName, getText(DFA_DAYSINYEAR_NAME) );
- SO_StringCopy( pFuncName, "ScDate_DaysInYear" );
- peType[0] = PTR_DOUBLE;
- peType[1] = PTR_DOUBLE;
- *nParamCount=2;
- break;
-
- case 6:
- SO_StringCopy( pInternalName, getText(DFA_WEEKSINYEAR_NAME) );
- SO_StringCopy( pFuncName, "ScDate_WeeksInYear" );
- peType[0] = PTR_DOUBLE;
- peType[1] = PTR_DOUBLE;
- *nParamCount=2;
- break;
-
- default:
- *nParamCount = 0;
- *pFuncName = 0;
- *pInternalName = 0;
- break;
- }
-}
-
-/**
- * Provides descriptions for each new function to StarCalc
- * which are shown is the autopilot
- *
- * @param *nNo Input Parameter, Function number between 0 and nCount - 1
- * @param *nParam Parameter Number
- * @param *pName Output: Name of the parameter
- * @param *pDesc Output: Description of the parameter
- *
- * @see #GetFunctionCount, #GetParameterDescription
- */
-void CALLTYPE GetParameterDescription( USHORT* nNo, USHORT* nParam,
-char* pName, char* pDesc )
-{
- *pName = 0;
- *pDesc = 0;
-
- switch ( *nNo ) {
- case 0: /* Weeks */
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(DFA_WEEK_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(DFA_PAR_DATE1_NAME));
- SO_StringCopy(pDesc,getText(DFA_WEEK_PAR1_DESC));
- break;
- case 2:
- SO_StringCopy(pName,getText(DFA_PAR_DATE2_NAME));
- SO_StringCopy(pDesc,getText(DFA_WEEK_PAR2_DESC));
- break;
- case 3:
- SO_StringCopy(pName,getText(DFA_PAR_MODE_NAME));
- SO_StringCopy(pDesc,getText(DFA_WEEK_PAR3_DESC));
- break;
- }
- break;
- case 1: /* Months */
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(DFA_MONTHS_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(DFA_PAR_DATE1_NAME));
- SO_StringCopy(pDesc,getText(DFA_MONTHS_PAR1_DESC));
- break;
- case 2:
- SO_StringCopy(pName,getText(DFA_PAR_DATE2_NAME));
- SO_StringCopy(pDesc,getText(DFA_MONTHS_PAR2_DESC));
- break;
- case 3:
- SO_StringCopy(pName,getText(DFA_PAR_MODE_NAME));
- SO_StringCopy(pDesc,getText(DFA_MONTHS_PAR3_DESC));
- break;
- }
- break;
- case 2: /* Years */
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(DFA_YEARS_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(DFA_PAR_DATE1_NAME));
- SO_StringCopy(pDesc,getText(DFA_YEARS_PAR1_DESC));
- break;
- case 2:
- SO_StringCopy(pName,getText(DFA_PAR_DATE2_NAME));
- SO_StringCopy(pDesc,getText(DFA_YEARS_PAR2_DESC));
- break;
- case 3:
- SO_StringCopy(pName,getText(DFA_PAR_MODE_NAME));
- SO_StringCopy(pDesc,getText(DFA_YEARS_PAR3_DESC));
- break;
- }
- break;
- case 3: /* IsLeapYear */
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(DFA_ISLEAPYEAR_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(DFA_PAR_DATE_NAME));
- SO_StringCopy(pDesc,getText(DFA_PAR_DATE_DESC)); /* StarCalc Value */
- break;
- }
- break;
- case 4: /* DaysInMonth */
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(DFA_DAYSINMONTH_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(DFA_PAR_DATE_NAME));
- SO_StringCopy(pDesc,getText(DFA_PAR_DATE_DESC)); /* StarCalc Value */
- break;
- }
- break;
- case 5: /* DaysInYear */
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(DFA_DAYSINYEAR_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(DFA_PAR_DATE_NAME));
- SO_StringCopy(pDesc,getText(DFA_PAR_DATE_DESC)); /* StarCalc Value */
- break;
- }
- break;
-
- case 6: /* WeeksInYear */
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(DFA_WEEKSINYEAR_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(DFA_PAR_DATE_NAME));
- SO_StringCopy(pDesc,getText(DFA_PAR_DATE_DESC)); /* StarCalc Value */
- break;
- }
- break;
- }
-
-}
diff --git a/sc/addin/datefunc/dfa.src b/sc/addin/datefunc/dfa.src
deleted file mode 100644
index 6a38f3068cc5..000000000000
--- a/sc/addin/datefunc/dfa.src
+++ /dev/null
@@ -1,178 +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.
- *
- ************************************************************************/
-#include "sc.hrc" // Definition RID_XXX in StarCalc
-#include "dfa.hrc"
-
-/* #i54546# The code belonging to this resource file is sample code for the
- * legacy AddIn interface. The interface is still supported, but deprecated.
- * The strings here were displayed in the function wizard. To prevent
- * duplicated and useless translation effort (functions and strings are also
- * part of the new scaddin module), the strings here are now layed out as fixed
- * untranslatable strings. The entire mechanism with the ../util/cl2c.pl perl
- * script merging the raw .cl and the .src during build time didn't work
- * anymore anyway, since we switched from MS-LCIDs / telephone area codes to
- * ISO codes for resources, and introduced localize.sdf files. Returned was
- * always an empty string. Now at least the fixed English string is returned.
- * */
-
-Resource RID_SC_ADDIN_DFA
-{
- String DFA_PAR_DATE1_NAME // Name of Date1 Parameter
- {
- Text = "Date 1";
- };
- String DFA_PAR_DATE2_NAME // Name of Date2 Parameter
- {
- Text = "Date 2";
- };
- String DFA_PAR_MODE_NAME // Name of Mode Parameter
- {
- Text = "Mode";
- };
-
- String DFA_PAR_DATE_NAME // Name of Date Parameter
- {
- Text = "Date";
- };
-
- String DFA_PAR_DATE_DESC // Description of Date Parameter
- {
- Text = "Internal number of the date";
- };
-
-/*-=======================================================================*/
- String DFA_WEEK_NAME // Name
- {
- Text = "Weeks";
- };
- String DFA_WEEK_DESC // Description
- {
- Text = "Returns the difference in weeks between two dates";
- };
- String DFA_WEEK_PAR1_DESC // Description of Parameter 1
- {
- Text = "The end date for calculating the difference in weeks";
- };
- String DFA_WEEK_PAR2_DESC // Description of Parameter 2
- {
- Text = "The start date for calculating the difference weeks";
- };
- String DFA_WEEK_PAR3_DESC // Description of Parameter 3
- {
- Text = "Type of difference calculation: mode=0 means the interval, mode=1 means calendar weeks";
- };
-
-/*-=======================================================================*/
-
- String DFA_MONTHS_NAME // Name
- {
- Text = "Months";
- };
- String DFA_MONTHS_DESC // Description
- {
- Text = "Determines the number of months between two dates";
- };
- String DFA_MONTHS_PAR1_DESC // Description of Parameter 1
- {
- Text = "The end date for calculating the difference in months";
- };
- String DFA_MONTHS_PAR2_DESC // Description of Parameter 2
- {
- Text = "The start date for calculating the difference in months";
- };
- String DFA_MONTHS_PAR3_DESC // Description of Parameter 2
- {
- Text = "Type of difference calculation: Mode = 0 means interval, mode = 1 means in calendar months";
- };
-
-/*-=======================================================================*/
-
- String DFA_YEARS_NAME // Name
- {
- Text = "Years";
- };
- String DFA_YEARS_DESC // Description
- {
- Text = "Returns the difference in years between two dates";
- };
- String DFA_YEARS_PAR1_DESC // Description of Parameter 1
- {
- Text = "The end date for calculating the difference in years";
- };
- String DFA_YEARS_PAR2_DESC // Description of Parameter 2
- {
- Text = "The start date for calculating the difference in years";
- };
- String DFA_YEARS_PAR3_DESC // Description of Parameter 2
- {
- Text = "Type of difference calculation: Mode=0 means interval, mode=1 means in calendar years.";
- };
-
-/*-=======================================================================*/
-
- String DFA_ISLEAPYEAR_NAME // Name
- {
- Text = "IsLeapYear";
- };
- String DFA_ISLEAPYEAR_DESC // Description
- {
- Text = "Returns 1 (TRUE) if a leap year is used, otherwise 0 (FALSE) is returned";
- };
-
-/*-=======================================================================*/
-
- String DFA_DAYSINMONTH_NAME // Name
- {
- Text = "DaysInMonth";
- };
- String DFA_DAYSINMONTH_DESC // Description
- {
- Text = "Returns the number of days in the month in relation to the date entered";
- };
-
-/*-=======================================================================*/
-
- String DFA_DAYSINYEAR_NAME // Name
- {
- Text = "DaysInYear";
- };
- String DFA_DAYSINYEAR_DESC // Description
- {
- Text = "Returns the number of days in a year in relation to the date entered";
- };
-
-/*-=======================================================================*/
-
- String DFA_WEEKSINYEAR_NAME // Name
- {
- Text = "WeeksInYear";
- };
- String DFA_WEEKSINYEAR_DESC // Description
- {
- Text = "Returns the number of weeks in the year in relation to a date";
- };
-};
diff --git a/sc/addin/datefunc/makefile.mk b/sc/addin/datefunc/makefile.mk
deleted file mode 100644
index f781b3835833..000000000000
--- a/sc/addin/datefunc/makefile.mk
+++ /dev/null
@@ -1,145 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=sc
-TARGET=dfa
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-CL2C=+$(PERL) $(MISC)$/cl2c.pl
-CL2CRID=RID_SC_ADDIN_DFA
-CL2CSRC=$(TARGET).src
-
-# --- Files --------------------------------------------------------
-
-CFILES= $(MISC)$/x$(TARGET).c
-
-# no version OBJ
-#VERSIONOBJ=
-
-SLOFILES= \
- $(SLO)$/x$(TARGET).obj
-
-# ==========================================================================
-
-SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
-SHL1IMPLIB= i$(TARGET)
-SHL1OBJS= $(SLO)$/x$(TARGET).obj
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-.IF "$(GUI)" == "WNT"
-SHL1STDLIBS= $(GDI32LIB) $(ADVAPI32LIB) $(COMDLG32LIB) \
- $(UUIDLIB) $(OLE32LIB) $(SHELL32LIB) $(WINSPOOLLIB)
-.IF "$(GVER)" == "W40"
-SHL1STDLIBS= $(SHL1STDLIBS) $(COMCTL32LIB)
-.ENDIF
-.ENDIF
-
-# --- Targets -------------------------------------------------------
-
-ALLTAR: $(MISC)$/$(TARGET).lst
-
-
-.INCLUDE: target.mk
-
-$(MISC)$/x$(TARGET).c: $(TARGET).cl $(CL2CSRC)
- $(CL2C) $(TARGET).cl $(MISC)$/x$(TARGET).c $(CL2CSRC) $(CL2CRID)
-
-# copy file to include in package
-$(INCCOM)$/xlang.h : $(SOLARINCDIR)$/i18npool$/lang.h
- @$(COPY) $(SOLARINCDIR)$/i18npool$/lang.h $@
-
-
-$(SLOFILES) : $(INCCOM)$/xlang.h $(CFILES)
-
-$(MISC)$/$(TARGET).lst : \
- $(MISC)$/x$(TARGET).c \
- $(INCCOM)$/xlang.h \
- ..$/inc$/$(TARGET).hrc \
- ..$/inc$/addin.h
- echo $< > $@
-
-# --- Def-File ---
-
-# ------------------------------------------------------------------
-# Windows DEF File
-# ------------------------------------------------------------------
-
-.IF "$(GUI)"=="WNT"
-
-$(MISC)$/$(SHL1TARGET).def: makefile.mk
- @echo ------------------------------
- @echo Making: $@
- @echo LIBRARY $(SHL1TARGET)>$@
-.IF "$(COM)"!="GCC"
- @echo DESCRIPTION 'DateF StarCalc Addin DLL'>>$@
- @echo DATA READ WRITE NONSHARED>>$@
-.ENDIF
- @echo EXPORTS>>$@
- @echo GetFunctionCount>>$@
- @echo GetFunctionData>>$@
- @echo GetParameterDescription>>$@
- @echo SetLanguage >>$@
- @echo ScDate_GetDiffWeeks>>$@
- @echo ScDate_GetDiffMonths>>$@
- @echo ScDate_GetDiffYears>>$@
- @echo ScDate_IsLeapYear>>$@
- @echo ScDate_DaysInMonth>>$@
- @echo ScDate_DaysInYear>>$@
- @echo ScDate_WeeksInYear>>$@
-
-.ENDIF
-
-.IF "$(GUI)"=="OS2"
-
-$(MISC)$/$(SHL1TARGET).def: makefile.mk
- @echo ------------------------------
- @echo Making: $@
- @echo LIBRARY $(SHL1TARGET) INITINSTANCE TERMINSTANCE >$@
- @echo DESCRIPTION 'DateF StarCalc Addin DLL'>>$@
- @echo DATA MULTIPLE>>$@
- @echo EXPORTS>>$@
- @echo _GetFunctionCount>>$@
- @echo _GetFunctionData>>$@
- @echo _GetParameterDescription>>$@
- @echo _SetLanguage >>$@
- @echo _ScDate_GetDiffWeeks>>$@
- @echo _ScDate_GetDiffMonths>>$@
- @echo _ScDate_GetDiffYears>>$@
- @echo _ScDate_IsLeapYear>>$@
- @echo _ScDate_DaysInMonth>>$@
- @echo _ScDate_DaysInYear>>$@
- @echo _ScDate_WeeksInYear>>$@
-
-.ENDIF
-
-
diff --git a/sc/addin/inc/addin.h b/sc/addin/inc/addin.h
deleted file mode 100644
index 82b84b402294..000000000000
--- a/sc/addin/inc/addin.h
+++ /dev/null
@@ -1,140 +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 _ADDIN_H
-#define _ADDIN_H
-
-#ifndef _SOLAR_H
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#undef NULL
-#define NULL 0
-
-typedef unsigned char BOOL;
-typedef unsigned char BYTE;
-typedef unsigned short USHORT;
-typedef unsigned long ULONG;
-
-#endif
-
-#ifndef SUPD
-/* enable all new interface features */
-#define SUPD 9999
-#endif
-
-/* all character string returns are limited to 255+1 chars */
-#define SO_CHARSTRING_MAX 256
-#define SO_StringCopy( dst, src ) \
- (strncpy( dst, src, SO_CHARSTRING_MAX ), dst[SO_CHARSTRING_MAX-1] = '\0')
-
-typedef enum
-{
- PTR_DOUBLE,
- PTR_STRING,
- PTR_DOUBLE_ARR,
- PTR_STRING_ARR,
- PTR_CELL_ARR,
- NONE
-} ParamType;
-
-#ifdef WNT
-#define CALLTYPE __cdecl
-#else
-#define CALLTYPE
-#endif
-
-#ifdef __cplusplus
-
-extern "C" {
-
-typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
-
-extern void CALLTYPE GetFunctionCount( USHORT& nCount );
-
-extern void CALLTYPE GetFunctionData( USHORT& nNo,
- char* pFuncName,
- USHORT& nParamCount,
- ParamType* peType,
- char* pInternalName );
-
-extern void CALLTYPE IsAsync( USHORT& nNo, ParamType* peType );
-
-extern void CALLTYPE Advice( USHORT& nNo, AdvData& pfCallback );
-
-extern void CALLTYPE Unadvice( double& nHandle );
-
-
-/* new in StarOffice 5.0 */
-
-extern void CALLTYPE GetParameterDescription( USHORT& nNo, USHORT& nParam,
-char* pName, char* pDesc );
-
-/* new in StarOffice 5.1 */
-
-extern void CALLTYPE SetLanguage( USHORT& nLanguage );
-
-
-};
-
-#else
-
-typedef void (CALLTYPE* AdvData)( double* nHandle, void* pData );
-
-extern void CALLTYPE GetFunctionCount( USHORT * nCount );
-
-extern void CALLTYPE GetFunctionData( USHORT * nNo,
- char * pFuncName,
- USHORT * nParamCount,
- ParamType * peType,
- char * pInternalName );
-
-extern void CALLTYPE IsAsync( USHORT * nNo, ParamType * peType );
-
-extern void CALLTYPE Advice( USHORT * nNo, AdvData * pfCallback );
-
-extern void CALLTYPE Unadvice( double * nHandle );
-
-/* new in StarOffice 5.0 */
-
-extern void CALLTYPE GetParameterDescription( USHORT* nNo, USHORT* nParam,
- char* pName, char* pDesc );
-
-
-/* new in StarOffice 5.1 */
-
-extern void CALLTYPE SetLanguage( USHORT* nLanguage );
-
-
-#endif
-
-#endif
diff --git a/sc/addin/inc/dfa.hrc b/sc/addin/inc/dfa.hrc
deleted file mode 100644
index 0d2af4f4bffd..000000000000
--- a/sc/addin/inc/dfa.hrc
+++ /dev/null
@@ -1,61 +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 SC_ADDIN_DFA_HRC
-#define SC_ADDIN_DFA_HRC
-
-#define DFA_PAR_DATE1_NAME 1 /* Name of Date1 Parameter */
-#define DFA_PAR_DATE2_NAME 2 /* Name of Date2 Parameter */
-#define DFA_PAR_MODE_NAME 3 /* Name of Mode Parameter */
-#define DFA_PAR_DATE_NAME 4 /* Name of Date Parameter */
-#define DFA_PAR_DATE_DESC 5 /* Description of Date Parameter 1 */
-
-#define DFA_WEEK_NAME 6 /* Name */
-#define DFA_WEEK_DESC 7 /* Description */
-#define DFA_WEEK_PAR1_DESC 8 /* Description of Parameter 1 */
-#define DFA_WEEK_PAR2_DESC 9 /* Description of Parameter 2 */
-#define DFA_WEEK_PAR3_DESC 10 /* Description of Parameter 3 */
-#define DFA_MONTHS_NAME 11 /* Name */
-#define DFA_MONTHS_DESC 12 /* Description */
-#define DFA_MONTHS_PAR1_DESC 13 /* Description of Parameter 1 */
-#define DFA_MONTHS_PAR2_DESC 14 /* Description of Parameter 2 */
-#define DFA_MONTHS_PAR3_DESC 15 /* Description of Parameter 2 */
-#define DFA_YEARS_NAME 16 /* Name */
-#define DFA_YEARS_DESC 17 /* Description */
-#define DFA_YEARS_PAR1_DESC 18 /* Description of Parameter 1 */
-#define DFA_YEARS_PAR2_DESC 19 /* Description of Parameter 2 */
-#define DFA_YEARS_PAR3_DESC 20 /* Description of Parameter 2 */
-#define DFA_ISLEAPYEAR_NAME 21 /* Name */
-#define DFA_ISLEAPYEAR_DESC 22 /* Description */
-#define DFA_DAYSINMONTH_NAME 23 /* Name */
-#define DFA_DAYSINMONTH_DESC 24 /* Description */
-#define DFA_DAYSINYEAR_NAME 25 /* Name */
-#define DFA_DAYSINYEAR_DESC 26 /* Description */
-#define DFA_WEEKSINYEAR_NAME 27 /* Name */
-#define DFA_WEEKSINYEAR_DESC 28 /* Description */
-
-#endif
-
diff --git a/sc/addin/rot13/exports.map b/sc/addin/rot13/exports.map
deleted file mode 100644
index c662c9148aba..000000000000
--- a/sc/addin/rot13/exports.map
+++ /dev/null
@@ -1,11 +0,0 @@
-UDK_3_0_0 {
- global:
- GetFunctionCount;
- GetFunctionData;
- GetParameterDescription;
- SetLanguage;
- Rot13;
-
- local:
- *;
-};
diff --git a/sc/addin/rot13/makefile.mk b/sc/addin/rot13/makefile.mk
deleted file mode 100644
index a33c50d2a725..000000000000
--- a/sc/addin/rot13/makefile.mk
+++ /dev/null
@@ -1,88 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=sc
-TARGET=rot
-LIBTARGET=NO
-
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-CL2C=+$(PERL) $(MISC)$/cl2c.pl
-CL2CRID=RID_SC_ADDIN_ROT13
-CL2CSRC=$(TARGET)13.src
-
-# --- Files --------------------------------------------------------
-
-CFILES= $(MISC)$/x$(TARGET).c
-
-SLOFILES= \
- $(SLO)$/x$(TARGET).obj
-
-# ==========================================================================
-
-SHL1TARGET= rot$(DLLPOSTFIX)
-SHL1IMPLIB= irot
-SHL1OBJS= $(SLO)$/x$(TARGET).obj
-
-SHL1VERSIONMAP=exports.map
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-DEF1NAME=$(SHL1TARGET)
-
-.IF "$(GUI)" == "WNT"
-SHL1STDLIBS= $(GDI32LIB) $(ADVAPI32LIB) $(COMDLG32LIB) \
- $(UUIDLIB) $(OLE32LIB) $(SHELL32LIB) $(WINSPOOLLIB)
-.IF "$(GVER)" == "W40"
-SHL1STDLIBS= $(SHL1STDLIBS) $(COMCTL32LIB)
-.ENDIF # W40
-.ENDIF # WNT
-
-# --- Targets -------------------------------------------------------
-
-ALLTAR: $(MISC)$/rot.lst
-
-.INCLUDE: target.mk
-
-$(MISC)$/x$(TARGET).c: $(TARGET)13.cl $(CL2CSRC) $(MISC)$/cl2c.pl
- $(CL2C) $(TARGET)13.cl $(MISC)$/x$(TARGET).c $(CL2CSRC) $(CL2CRID)
-
-# copy file to include in package
-$(INCCOM)$/xlang.h : $(SOLARINCDIR)$/i18npool$/lang.h
- @$(COPY) $(SOLARINCDIR)$/i18npool$/lang.h $@
-
-$(SLOFILES) : $(INCCOM)$/xlang.h $(CFILES)
-
-$(MISC)$/rot.lst : \
- $(MISC)$/x$(TARGET).c \
- $(INCCOM)$/xlang.h \
- ..$/inc$/rot13.hrc \
- ..$/inc$/addin.h
- @echo $< > $@
diff --git a/sc/addin/rot13/rot13.cl b/sc/addin/rot13/rot13.cl
deleted file mode 100644
index 5c7e92ae3d3f..000000000000
--- a/sc/addin/rot13/rot13.cl
+++ /dev/null
@@ -1,158 +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.
- *
- ************************************************************************/
-
-/* static char rot13_Id[]="@(#) StarCalc Rot13 AddIn (c) 1998-2000 Sun Microsystems, Inc."; */
-
-#include <string.h>
-#include <stdio.h>
-
-#include <xlang.h>
-#include <addin.h>
-#include <rot13.hrc>
-
-/**
- * the current language the Addin is using
- */
-static USHORT _nLanguage=LANGUAGE_ENGLISH;
-
-/**
- * StarCalc calls this function to set a new current Language for the Addin
- *
- * @param *nLanguage
- *
- */
-void CALLTYPE SetLanguage( USHORT* nLanguage )
-{
- _nLanguage = GetNeutralLanguage( *nLanguage );
-}
-
-
-/**
- * Tell StarCalc how many new functions this Addin provides.
- *
- * @param *nCount - returns the number of functions which are exported to StarCalc
- *
- */
-void CALLTYPE GetFunctionCount( USHORT *nCount )
-{
- *nCount = 1;
-}
-
-/**
- * Provides neccessary data for each new function to StarCalc
- *
- * @param *nNo Input: Function number between 0 and nCount - 1
- * @param *pFuncName Output: Functionname which should be called in the AddIn-DLL
- * @param *nParamCount Output: Number of Parameter. Must be greater than 0, because there's always a return-Value. Maximum is 16.
- * @param *peType Output: Pointer to arrray with exactly 16 variables of typ Paramtype. nParamCount Entries are set to the type of the corresponding Parameters.
- * @param *pInternalName Output: Functionname as seen by the Spreadsheet user
- *
- * @see #GetFunctionCount, #GetParameterDescription
- *
- */
-void CALLTYPE GetFunctionData( USHORT * nNo,
- char * pFuncName,
- USHORT * nParamCount,
- ParamType * peType,
- char * pInternalName )
-{
-
- switch( *nNo ) {
- case 0:
- /* the function name is the same in all languages */
- SO_StringCopy( pInternalName, "Rot13" );
- SO_StringCopy( pFuncName, "Rot13" );
- peType[0] = PTR_STRING;
- peType[1] = PTR_STRING;
- *nParamCount=2;
- break;
- default:
- *nParamCount = 0;
- *pFuncName = 0;
- *pInternalName = 0;
- break;
- }
-}
-
-/**
- * Provides descriptions for each new function to StarCalc
- * which are shown is the autopilot
- *
- * @param *nNo Input Parameter, Function number between 0 and nCount - 1
- * @param *nParam Parameter Number
- * @param *pName Output: Name of the parameter
- * @param *pDesc Output: Description of the parameter
- *
- * @see #GetFunctionCount, #GetParameterDescription
- */
-void CALLTYPE GetParameterDescription( USHORT* nNo, USHORT* nParam,
-char* pName, char* pDesc )
-{
- *pName = 0;
- *pDesc = 0;
-
-
- switch ( *nNo ) {
- case 0:
- switch ( *nParam ) {
- case 0:
- SO_StringCopy(pDesc,getText(ROT13_DESC));
- break;
- case 1:
- SO_StringCopy(pName,getText(ROT13_PAR1_NAME));
- SO_StringCopy(pDesc,getText(ROT13_PAR1_DESC));
- }
- }
-}
-
-/**
- * ROT13 Algorithm, each alphabetical character of the text is rotated by 13 in the alphabet
- *
- * @param *ret
- * @param *src
- *
- * ER: well, my personal favorite algorithm is
- * main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
- * but for clarification we do it somehow different here ;-)
- */
-void CALLTYPE Rot13(char *ret, char *src)
-{
- if ( ! ret ) return;
- if ( ! src ) *ret='\0';
-
- for(;src && *src; src++ , ret++) {
- *ret=*src;
- if (*ret >= 'A' && *ret <= 'Z') {
- if ( (*ret +=13) > 'Z' ) *ret-=26;
- } else if (*ret >= 'a' && *ret < 'n') {
- *ret +=13;
- } else if (*ret >= 'n' && *ret <= 'z') {
- *ret -=13;
- }
- }
- *ret=*src;
-}
diff --git a/sc/addin/rot13/rot13.src b/sc/addin/rot13/rot13.src
deleted file mode 100644
index 5518ae0aa31f..000000000000
--- a/sc/addin/rot13/rot13.src
+++ /dev/null
@@ -1,58 +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.
- *
- ************************************************************************/
-#include "sc.hrc" // Definition RID_XXX in StarCalc
-#include "rot13.hrc"
-
-/* #i54546# The code belonging to this resource file is sample code for the
- * legacy AddIn interface. The interface is still supported, but deprecated.
- * The strings here were displayed in the function wizard. To prevent
- * duplicated and useless translation effort (functions and strings are also
- * part of the new scaddin module), the strings here are now layed out as fixed
- * untranslatable strings. The entire mechanism with the ../util/cl2c.pl perl
- * script merging the raw .cl and the .src during build time didn't work
- * anymore anyway, since we switched from MS-LCIDs / telephone area codes to
- * ISO codes for resources, and introduced localize.sdf files. Returned was
- * always an empty string. Now at least the fixed English string is returned.
- * */
-
-Resource RID_SC_ADDIN_ROT13
-{
- String ROT13_DESC // Description
- {
- Text = "ROT13 Algorithm, each alphabetical character of the text is rotated by 13 in the alphabet";
- };
-
- String ROT13_PAR1_NAME // Name of Parameter 1
- {
- Text = "Text";
- };
-
- String ROT13_PAR1_DESC // Description of Parameter 1
- {
- Text = "The text that is to be rotated";
- };
-};
diff --git a/sc/addin/util/cl2c.pl b/sc/addin/util/cl2c.pl
deleted file mode 100644
index 6f5d3ee7e0d8..000000000000
--- a/sc/addin/util/cl2c.pl
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/usr/solar/bin/perl
-
-##########################################################################
-#
-# 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.
-#
-##########################################################################
-
-if ( $#ARGV != 3 ) {
- print STDERR "usage: cl2c.pl <file.cl> <file.c> <file.src> <resname>\n";
- exit -1;
-}
-
-$CL=$ARGV[0];
-$C=$ARGV[1];
-$SRC=$ARGV[2];
-$RNAME=$ARGV[3];
-
-sub sconv
-{
- local($s)=@_[0];
- local($o,$c);
- $_="";
- foreach $o ( unpack("C*",$s) ) {
- $c=chr($o);
- if ( $o >= 32 && $o < 127 ) {
- $_ .= $c;
- } else {
- $_ .= sprintf("\\%o", $o);
- }
- }
- return $_;
-}
-
-
-sub makeneutral {
-
- print COUT "\n\n/**\n";
- print COUT " * Get neutral language for specific language.\n";
- print COUT " * This simplifies the getText switch cases and allows to handle\n";
- print COUT " * previously unknown language derivates due to foreign installations.\n";
- print COUT " * If you want to distinguish between some dialects change this function\n";
- print COUT " * to return the desired nLang before doing the bit masking stuff.\n";
- print COUT " * See xlang.h for defined LANGUAGE_*\n";
- print COUT " */\n";
-
- # taken from tools/source/intntl/intn.cxx International::GetNeutralLanguage
- print COUT "static USHORT GetNeutralLanguage( USHORT nLang )\n";
- print COUT "{\n";
- print COUT "\tUSHORT nPrimLang;\n";
- print COUT "\n";
- print COUT "\t/* ignore LANGUAGE_USER* */\n";
- print COUT "\tif ( (nLang & 0x03FF) >= 0x0200 )\n";
- print COUT "\t return nLang;\n";
- print COUT "\n";
- print COUT "\tnLang &= 0x03FF;\n";
- print COUT "\n";
- print COUT "\tnPrimLang = nLang | 0x0400;\n";
- print COUT "\n";
- print COUT "\tswitch ( nPrimLang )\n";
- print COUT "\t{\n";
- print COUT "\t\tcase LANGUAGE_CHINESE_TRADITIONAL:\n";
- print COUT "\t\t\tnLang = LANGUAGE_CHINESE;\n";
- print COUT "\t\t\tbreak;\n";
- print COUT "\t\tcase LANGUAGE_ENGLISH_US:\n";
- print COUT "\t\t\tnLang = LANGUAGE_ENGLISH;\n";
- print COUT "\t\t\tbreak;\n";
- print COUT "\t\tcase LANGUAGE_NORWEGIAN_BOKMAL:\n";
- print COUT "\t\t\tnLang = LANGUAGE_NORWEGIAN;\n";
- print COUT "\t\t\tbreak;\n";
- print COUT "\t\tcase LANGUAGE_PORTUGUESE_BRAZILIAN:\n";
- print COUT "\t\t\tnLang = LANGUAGE_PORTUGUESE;\n";
- print COUT "\t\t\tbreak;\n";
- print COUT "\n";
- print COUT "\t\tdefault:\n";
- print COUT "\t\t\tnLang = nPrimLang;\n";
- print COUT "\t\t\tbreak;\n";
- print COUT "\t}\n";
- print COUT "\n";
- print COUT "\treturn nLang;\n";
- print COUT "}\n";
- print COUT "\n";
-
-}
-
-
-sub maketext {
-
- print COUT "\n\n/**\n";
- print COUT " * Get text resource for current language.\n";
- print COUT " * Remember that 8-bit characters are shown in\n";
- print COUT " * system dependend code pages!\n";
- print COUT " * To get correct results you will have to distuinguish\n";
- print COUT " * for example between UNIX and WIN and OS2 target systems.\n";
- print COUT " */\n";
-
- print COUT "static char* getText( int nResource )\n{\n";
- print COUT "\tswitch( nResource ) {\n";
-
- $resflag=0;
- $strname="";
- $cnt=0;
- $text_english="";
-
- while (<SRCIN>) {
- $resflag=1 if ( /Resource\s$RNAME/ );
-
- if ( /\{/ ) {
- if ( ++$cnt == 2 ) {
- # start language
- $text_english="";
- print COUT "\t\t\tswitch( _nLanguage ) {\n";
- next;
- }
- }
-
- if ( /\}/ ) {
- if ( --$cnt == 1 ) {
- # end language
-
- if ( $text_english ne "" ) {
- print COUT "\t\t\t\tcase LANGUAGE_ENGLISH:\n\t\t\t\tdefault:\n";
- print COUT "\t\t\t\treturn(" . $text_english . ")\;\n";
- }
-
- print COUT "\t\t\t}\n\t\t\tbreak;\n";
- next;
- } elsif ( $cnt == 0 ) {
- # end of resource
- $resflag=0;
- print COUT "\t\tdefault:\n\t\t\tbreak;\n";
- print COUT "\t}\n\treturn(\"\");\n}\n";
- next;
- }
-
- }
-
- if ( $resflag && $cnt == 1) {
- if ( /\sString\s(([A-Z]|\_|[0-9]|[a-z])*)/ ) {
- $strname=$1;
- print COUT "\t\tcase " . $strname . ":\n";
- }
- }
-
- if ( $cnt == 2 && /^\s*Text/ ) {
- $langname="german";
- ($textdef,@textx)=split(/=/);
- $text=join("=",@textx);
- if ( $textdef =~ /\[\s+(.*)\s+\]/ ) {
- $langname=$1;
- }
- else {
- $langname="ENGLISH_US"; # no [...] => not to be translated
- }
-
- $langname="LANGUAGE_" . uc($langname);
-
- chop($text) while ( $text=~/(\r|\n|\;)$/ );
- $text=sconv($text);
- # english_us, not english because it's developer's pigeon
- if ( $langname eq "LANGUAGE_ENGLISH_US" ) {
- $text_english=$text;
- }
- # ISO coded, obtain at least the default
- elsif ( $langname =~ /^LANGUAGE_EN-US$/ ) {
- $text_english=$text;
- }
- # we don't know about USER languages, ENGLISH will be appended later
- elsif ( ! ( $langname =~ /LANGUAGE_USER/ || $langname =~ /^LANGUAGE_ENGLISH$/ ) ) {
- # ER 28.04.99: for the moment only German and English are
- # exported, because we have a problem with non-existing
- # character code tables for systems other than Windoze.
- # => Chinese would be definitely mixed up and we don't
- # want to insult anybody.. others like Spanish would look
- # very ugly, but we'll have to live with bad German Umlauts.
- if ( $langname =~ /LANGUAGE_(GERMAN|ENGLISH)/ ) {
- print COUT "\t\t\t\tcase " . $langname . ":\n";
- print COUT "\t\t\t\treturn(" . $text . ")\;\n";
- }
- }
-
- }
- }
-
- makeneutral();
-
-}
-
-open(CLIN,"<$CL") || die "can not open $CL\n";
-open(SRCIN,"<$SRC") || die "can not open $CL\n";
-open(COUT,">$C") || die "can not open $CL\n";
-
-$ccnt=0;
-$incomment=0;
-while(<CLIN>) {
- if ( /^\/\*--(-*)/ ) {
- $incomment=1;
- $ccnt++;
- }
-
- print COUT $_ if ( $incomment==0 || $ccnt==1 );
-
- &maketext() if ( /^static USHORT _nLanguage=/ );
-
- if ( /(-*)--\*\/$/ ) {
- $incomment=0;
- }
-
-}
-
-close(CLIN);
-close(SRCIN);
-close(COUT);
-
-exit 0;
-
-
diff --git a/sc/addin/util/makefile.mk b/sc/addin/util/makefile.mk
deleted file mode 100644
index 2bd75148f80a..000000000000
--- a/sc/addin/util/makefile.mk
+++ /dev/null
@@ -1,47 +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.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=sc
-TARGET=autil
-
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-$(BIN)$/addin.zip : \
- $(MISC)$/rot.lst \
- $(MISC)$/dfa.lst
- $(TYPE) $(MISC)$/rot.lst | tr -s " " "\n" | zip -@ -u -j -ll $(BIN)$/addin.zip $(CHECKZIPRESULT)
- $(TYPE) $(MISC)$/dfa.lst | tr -s " " "\n" | zip -@ -u -j -ll $(BIN)$/addin.zip $(CHECKZIPRESULT)
- chmod +rw $(BIN)$/addin.zip
-
-.INCLUDE: target.mk
-
-ALLTAR: $(BIN)$/addin.zip
-
diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx
index df72fec64f57..25405a58a369 100644
--- a/sc/inc/AccessibleFilterMenu.hxx
+++ b/sc/inc/AccessibleFilterMenu.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -189,3 +190,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx
index ecf5bdc5ad87..fbdcfbb6b36e 100644
--- a/sc/inc/AccessibleFilterMenuItem.hxx
+++ b/sc/inc/AccessibleFilterMenuItem.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/AccessibleFilterTopWindow.hxx b/sc/inc/AccessibleFilterTopWindow.hxx
index 55fcb503f51b..d45a90a2cd0c 100644
--- a/sc/inc/AccessibleFilterTopWindow.hxx
+++ b/sc/inc/AccessibleFilterTopWindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
#ifndef SC_ACCESSIBLEFILTERTOPWINDOW_HXX
#define SC_ACCESSIBLEFILTERTOPWINDOW_HXX
-//#include "AccessibleContextBase.hxx"
#include "AccessibleFilterMenu.hxx"
#include "cppuhelper/implbase1.hxx"
@@ -96,3 +96,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/AccessibleGlobal.hxx b/sc/inc/AccessibleGlobal.hxx
index a30ebf7ee18c..5c06ed29edaf 100644
--- a/sc/inc/AccessibleGlobal.hxx
+++ b/sc/inc/AccessibleGlobal.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/ViewSettingsSequenceDefines.hxx b/sc/inc/ViewSettingsSequenceDefines.hxx
index 07c3d2b375e0..a0167898607d 100644
--- a/sc/inc/ViewSettingsSequenceDefines.hxx
+++ b/sc/inc/ViewSettingsSequenceDefines.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@
// this are the defines for the position of the settings in the
// TableViewSettingsSequence
-#define SC_TABLE_VIEWSETTINGS_COUNT 15
+#define SC_TABLE_VIEWSETTINGS_COUNT 16
#define SC_CURSOR_X 0
#define SC_CURSOR_Y 1
@@ -78,6 +79,7 @@
#define SC_TABLE_ZOOM_VALUE 12
#define SC_TABLE_PAGE_VIEW_ZOOM_VALUE 13
#define SC_TABLE_TAB_BG_COLOR 14
+#define SC_TABLE_SHOWGRID 15
#define SC_CURSORPOSITIONX "CursorPositionX"
#define SC_CURSORPOSITIONY "CursorPositionY"
@@ -106,3 +108,5 @@
#define SC_VIEW "view"
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/addincfg.hxx b/sc/inc/addincfg.hxx
index 193da4095977..9aa47147c621 100644
--- a/sc/inc/addincfg.hxx
+++ b/sc/inc/addincfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,11 +46,9 @@ public:
{ return ConfigItem::GetProperties( rNames ); }
using ConfigItem::GetNodeNames;
-
-// com::sun::star::uno::Sequence< rtl::OUString > GetNodeNames(rtl::OUString& rNode)
-// { return ConfigItem::GetNodeNames( rNode ); }
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/addincol.hxx b/sc/inc/addincol.hxx
index 41afe64a1753..662b45dd4e14 100644
--- a/sc/inc/addincol.hxx
+++ b/sc/inc/addincol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,11 +43,9 @@
#include "scdllapi.h"
#include <rtl/ustring.hxx>
-#ifndef SC_SCMATRIX_HXX
#include "scmatrix.hxx"
-#endif
-#include <hash_map>
+#include <boost/unordered_map.hpp>
class String;
@@ -56,7 +55,7 @@ class ScMatrix;
class ScFuncDesc;
-typedef ::std::hash_map< String, const ScUnoAddInFuncData*, ScStringHashCode, ::std::equal_to< String > > ScAddInHashMap;
+typedef ::boost::unordered_map< String, const ScUnoAddInFuncData*, ScStringHashCode, ::std::equal_to< String > > ScAddInHashMap;
enum ScAddInArgumentType
@@ -233,7 +232,7 @@ public:
sal_uInt16 GetErrCode() const { return nErrCode; }
sal_Bool HasString() const { return bHasString; }
- sal_Bool HasMatrix() const { return ( xMatrix.Is() ); }
+ bool HasMatrix() const { return xMatrix.get(); }
sal_Bool HasVarRes() const { return ( xVarRes.is() ); }
double GetValue() const { return fValue; }
const String& GetString() const { return aString; }
@@ -245,3 +244,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index de29aa671fac..78db747f80a5 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,14 +85,13 @@ const SCSIZE SCSIZE_MAX = ::std::numeric_limits<SCSIZE>::max();
// The maximum values. Defines are needed for preprocessor checks, for example
// in bcaslot.cxx, otherwise type safe constants are preferred.
-//#define MAXROWCOUNT_DEFINE 65536
#define MAXROWCOUNT_DEFINE 1048576
#define MAXCOLCOUNT_DEFINE 1024
// Count values
const SCROW MAXROWCOUNT = MAXROWCOUNT_DEFINE;
const SCCOL MAXCOLCOUNT = MAXCOLCOUNT_DEFINE;
-const SCTAB MAXTABCOUNT = 256;
+const SCTAB MAXTABCOUNT = 1024;
const SCCOLROW MAXCOLROWCOUNT = MAXROWCOUNT;
// Maximum values
const SCROW MAXROW = MAXROWCOUNT - 1;
@@ -226,6 +226,9 @@ inline SCTAB SanitizeTab( SCTAB nTab, SCTAB nMaxTab )
#define SCA_VALID_ROW 0x0100
#define SCA_VALID_COL 0x0200
#define SCA_VALID_TAB 0x0400
+// SCA_BITS is a convience for
+// (SCA_VALID_TAB | SCA_VALID_COL | SCA_VALID_ROW | SCA_TAB_3D | SCA_TAB_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_COL_ABSOLUTE)
+#define SCA_BITS 0x070F
// somewhat cheesy kludge to force the display of the document name even for
// local references. Requires TAB_3D to be valid
#define SCA_FORCE_DOC 0x0800
@@ -272,7 +275,6 @@ public:
{}
/* Use the formula::FormulaGrammar::AddressConvention associated with rAddr::Tab() */
Details( const ScDocument* pDoc, const ScAddress & rAddr );
-//UNUSED2009-05 void SetPos( const ScDocument* pDoc, const ScAddress & rAddr );
};
SC_DLLPUBLIC static const Details detailsOOOa1;
@@ -336,7 +338,7 @@ public:
inline size_t hash() const;
/// "A1" or "$A$1" or R1C1 or R[1]C[1]
- String GetColRowString( bool bAbsolute = sal_False,
+ String GetColRowString( bool bAbsolute = false,
const Details& rDetails = detailsOOOa1) const;
};
@@ -519,6 +521,9 @@ public:
SC_DLLPUBLIC void Format( String&, sal_uInt16 = 0, ScDocument* = NULL,
const ScAddress::Details& rDetails = ScAddress::detailsOOOa1 ) const;
+ SC_DLLPUBLIC void Format( rtl::OUString&, sal_uInt16 = 0, ScDocument* = NULL,
+ const ScAddress::Details& rDetails = ScAddress::detailsOOOa1 ) const;
+
inline void GetVars( SCCOL& nCol1, SCROW& nRow1, SCTAB& nTab1,
SCCOL& nCol2, SCROW& nRow2, SCTAB& nTab2 ) const;
// The document for the maximum defined sheet number
@@ -818,3 +823,4 @@ bool AlphaToCol( SCCOL& rCol, const String& rStr);
#endif // SC_ADDRESS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/addruno.hxx b/sc/inc/addruno.hxx
index 6e71230b21d4..ee059463e807 100644
--- a/sc/inc/addruno.hxx
+++ b/sc/inc/addruno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,3 +109,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/afmtuno.hxx b/sc/inc/afmtuno.hxx
index e5fee96e5298..d78498f3a0fa 100644
--- a/sc/inc/afmtuno.hxx
+++ b/sc/inc/afmtuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -308,3 +309,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/appluno.hxx b/sc/inc/appluno.hxx
index 050611eeeb9e..9ffff7247021 100644
--- a/sc/inc/appluno.hxx
+++ b/sc/inc/appluno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase4.hxx>
+#include <rtl/ustring.hxx>
class ScFunctionDescriptionObj;
@@ -209,3 +211,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx
index 04ac629cde92..53cf1b968b1a 100644
--- a/sc/inc/appoptio.hxx
+++ b/sc/inc/appoptio.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,6 +45,10 @@ public:
void SetDefaults();
+ // Set or get the initial tab count for new spreadsheet, it is used by VBA API currently.
+ void SetTabCountInNewSpreadsheet( sal_Int16 nCount ) { nTabCountInNewSpreadsheet = nCount; }
+ sal_Int16 GetTabCountInNewSpreadsheet() const { return nTabCountInNewSpreadsheet; }
+
void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; }
FieldUnit GetAppMetric() const { return eMetric; }
void SetZoom( sal_uInt16 nNew ) { nZoom = nNew; }
@@ -87,6 +92,7 @@ public:
const ScAppOptions& operator= ( const ScAppOptions& rOpt );
private:
+ sal_Int16 nTabCountInNewSpreadsheet;
FieldUnit eMetric;
sal_uInt16 nLRUFuncCount;
sal_uInt16* pLRUList;
@@ -147,3 +153,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/arealink.hxx b/sc/inc/arealink.hxx
index 77053b48bde0..fb79891005c6 100644
--- a/sc/inc/arealink.hxx
+++ b/sc/inc/arealink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,8 +51,7 @@ private:
ScRange aDestArea;
sal_Bool bAddUndo;
sal_Bool bInCreate;
- sal_Bool bDoInsert; // wird fuer das erste Update auf sal_False gesetzt
-
+ sal_Bool bDoInsert; // is set to FALSE for first update
sal_Bool FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName );
public:
@@ -91,3 +91,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index 3e7b31258c38..f8c45446cc2c 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "attrib.hxx"
class ScDocument;
+class ScEditDataArray;
class ScMarkArray;
class ScPatternAttr;
class ScStyleSheet;
@@ -102,6 +104,9 @@ friend void lcl_IterGetNumberFormat( sal_uLong& nFormat,
SCROW nStartRow, SCROW nEndRow,
sal_Bool bLeft, SCCOL nDistRight, sal_Bool bTop, SCROW nDistBottom );
+ void RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow,
+ const ScPatternAttr* pPattern, ScEditDataArray* pDataArray );
+
public:
ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc );
~ScAttrArray();
@@ -123,10 +128,13 @@ public:
void ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInfoItem* pLineInner,
SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight );
- void SetPattern( SCROW nRow, const ScPatternAttr* pPattern, sal_Bool bPutToPool = sal_False );
- void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pPattern, sal_Bool bPutToPool = sal_False);
+ void SetPattern( SCROW nRow, const ScPatternAttr* pPattern, sal_Bool bPutToPool = false );
+ void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pPattern,
+ sal_Bool bPutToPool = false, ScEditDataArray* pDataArray = NULL );
void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* pStyle );
- void ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache );
+ void ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache,
+ ScEditDataArray* pDataArray = NULL );
+ bool SetAttrEntries(ScAttrEntry* pNewData, SCSIZE nSize);
void ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
const SvxBorderLine* pLine, sal_Bool bColorOnly );
@@ -165,9 +173,6 @@ public:
sal_Bool IsEmpty() const;
-//UNUSED2008-05 SCROW GetFirstEntryPos() const;
-//UNUSED2008-05 SCROW GetLastEntryPos( sal_Bool bIncludeBottom ) const;
-
sal_Bool GetFirstVisibleAttr( SCROW& rFirstRow ) const;
sal_Bool GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const;
sal_Bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const;
@@ -186,8 +191,6 @@ public:
sal_Int16 nStripFlags = 0 );
void DeleteHardAttr( SCROW nStartRow, SCROW nEndRow );
-
-//UNUSED2008-05 void ConvertFontsAfterLoad(); // old binary file format
};
@@ -240,3 +243,4 @@ inline const ScPatternAttr* ScAttrIterator::Next( SCROW& rTop, SCROW& rBottom )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx
index d72c41037ae2..09b7851e1f6c 100644
--- a/sc/inc/attrib.hxx
+++ b/sc/inc/attrib.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,8 +38,8 @@
//------------------------------------------------------------------------
- // Flags fuer durch Merge verdeckte Zellen
- // und Control fuer Auto-Filter
+ // flags for cells hidden by merge
+ // and control for auto filter
#define SC_MF_HOR 0x0001
#define SC_MF_VER 0x0002
#define SC_MF_AUTO 0x0004 /// autofilter arrow
@@ -119,9 +120,9 @@ public:
TYPEINFO();
ScProtectionAttr();
ScProtectionAttr( sal_Bool bProtect,
- sal_Bool bHFormula = sal_False,
- sal_Bool bHCell = sal_False,
- sal_Bool bHPrint = sal_False);
+ sal_Bool bHFormula = false,
+ sal_Bool bHCell = false,
+ sal_Bool bHPrint = false);
ScProtectionAttr( const ScProtectionAttr& );
~ScProtectionAttr();
@@ -137,8 +138,8 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
sal_Bool GetProtection() const { return bProtection; }
sal_Bool SetProtection( sal_Bool bProtect);
@@ -160,7 +161,7 @@ public:
//----------------------------------------------------------------------------
-// ScRangeItem: verwaltet einen Tabellenbereich
+// ScRangeItem: manages an area of a table
#define SCR_INVALID 0x01
#define SCR_ALLTABS 0x02
@@ -179,7 +180,7 @@ public:
inline ScRangeItem& operator=( const ScRangeItem &rCpy );
- // "pure virtual Methoden" vom SfxPoolItem
+ // "pure virtual methods" from SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
@@ -200,7 +201,7 @@ private:
};
inline ScRangeItem::ScRangeItem( const sal_uInt16 nWhichP )
- : SfxPoolItem( nWhichP ), nFlags( SCR_INVALID ) // == ungueltige Area
+ : SfxPoolItem( nWhichP ), nFlags( SCR_INVALID ) // == invalid area
{
}
@@ -222,7 +223,7 @@ inline ScRangeItem& ScRangeItem::operator=( const ScRangeItem &rCpy )
}
//----------------------------------------------------------------------------
-// ScTableListItem: verwaltet eine Liste von Tabellen
+// ScTableListItem: manages a list of tables
//----------------------------------------------------------------------------
class ScTableListItem : public SfxPoolItem
{
@@ -231,12 +232,11 @@ public:
inline ScTableListItem( const sal_uInt16 nWhich );
ScTableListItem( const ScTableListItem& rCpy );
-//UNUSED2008-05 ScTableListItem( const sal_uInt16 nWhich, const List& rList );
~ScTableListItem();
ScTableListItem& operator=( const ScTableListItem &rCpy );
- // "pure virtual Methoden" vom SfxPoolItem
+ // "pure virtual Methoden" from SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
@@ -245,9 +245,6 @@ public:
const IntlWrapper* pIntl = 0 ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
-//UNUSED2009-05 sal_Bool GetTableList( List& aList ) const;
-//UNUSED2009-05 void SetTableList( const List& aList );
-
public:
sal_uInt16 nCount;
SCTAB* pTabArr;
@@ -258,7 +255,7 @@ inline ScTableListItem::ScTableListItem( const sal_uInt16 nWhichP )
{}
//----------------------------------------------------------------------------
-// Seitenformat-Item: Kopf-/Fusszeileninhalte
+// page format item: contents of header and footer
#define SC_HF_LEFTAREA 1
#define SC_HF_CENTERAREA 2
@@ -282,8 +279,8 @@ public:
virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
const EditTextObject* GetLeftArea() const { return pLeftArea; }
const EditTextObject* GetCenterArea() const { return pCenterArea; }
@@ -293,13 +290,13 @@ public:
void SetCenterArea( const EditTextObject& rNew );
void SetRightArea( const EditTextObject& rNew );
- //Set mit Uebereignung der Pointer, nArea siehe defines oben
+ // Set method with pointer assignment, nArea see defines above
void SetArea( EditTextObject *pNew, int nArea );
};
//----------------------------------------------------------------------------
-// Seitenformat-Item: Kopf-/Fusszeileninhalte
+// page format item: contents of header and footer
class SC_DLLPUBLIC ScViewObjectModeItem: public SfxEnumItem
{
@@ -388,8 +385,8 @@ public:
XubString& rText,
const IntlWrapper* = 0 ) const;
- virtual sal_Bool QueryValue( ::com::sun::star::uno::Any& rAny, sal_uInt8 nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const ::com::sun::star::uno::Any& rAny, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( ::com::sun::star::uno::Any& rAny, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const ::com::sun::star::uno::Any& rAny, sal_uInt8 nMemberId = 0 );
private:
sal_uInt16 mnWidth;
@@ -400,3 +397,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx
index 384293e9b7d4..4095494372b4 100644
--- a/sc/inc/autoform.hxx
+++ b/sc/inc/autoform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,7 @@ JP 20.07.95:
#include <editeng/shdditem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/rotmodit.hxx>
#include <svl/intitem.hxx>
#include <editeng/bolnitem.hxx>
@@ -265,7 +267,7 @@ private:
sal_Bool bSaveLater;
public:
- ScAutoFormat( sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False );
+ ScAutoFormat( sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false );
ScAutoFormat( const ScAutoFormat& AutoFormat );
virtual ~ScAutoFormat();
virtual ScDataObject* Clone() const { return new ScAutoFormat( *this ); }
@@ -280,3 +282,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/autonamecache.hxx b/sc/inc/autonamecache.hxx
index 0eb1b51efe29..76804adc1361 100644
--- a/sc/inc/autonamecache.hxx
+++ b/sc/inc/autonamecache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,12 +30,12 @@
#define SC_AUTONAMECACHE_HXX
#include <vector>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include "address.hxx"
#include "global.hxx"
typedef ::std::vector< ScAddress > ScAutoNameAddresses;
-typedef ::std::hash_map< String, ScAutoNameAddresses, ScStringHashCode, ::std::equal_to< String > > ScAutoNameHashMap;
+typedef ::boost::unordered_map< String, ScAutoNameAddresses, ScStringHashCode, ::std::equal_to< String > > ScAutoNameHashMap;
//
// Cache for faster lookup of automatic names during CompileXML
@@ -51,8 +52,9 @@ public:
ScAutoNameCache( ScDocument* pD );
~ScAutoNameCache();
- const ScAutoNameAddresses& GetNameOccurences( const String& rName, SCTAB nTab );
+ const ScAutoNameAddresses& GetNameOccurrences( const String& rName, SCTAB nTab );
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/bigrange.hxx b/sc/inc/bigrange.hxx
index 7f0ee1934afb..6e4c6573edf3 100644
--- a/sc/inc/bigrange.hxx
+++ b/sc/inc/bigrange.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111,7 +112,7 @@ inline void ScBigAddress::PutInOrder( ScBigAddress& r )
inline sal_Bool ScBigAddress::IsValid( const ScDocument* pDoc ) const
-{ //! Min/Max sind ok, kennzeichnen ganze Col/Row/Tab
+{ // min/max interval bounds define whole col/row/tab
return
((0 <= nCol && nCol <= MAXCOL)
|| nCol == nInt32Min || nCol == nInt32Max) &&
@@ -271,3 +272,5 @@ inline SvStream& operator>> ( SvStream& rStream, ScBigRange& rRange )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx
index 186d1f918409..cf937f29fa67 100644
--- a/sc/inc/brdcst.hxx
+++ b/sc/inc/brdcst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/callform.hxx b/sc/inc/callform.hxx
index 770b3c1f5760..7845b8730e0c 100644
--- a/sc/inc/callform.hxx
+++ b/sc/inc/callform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,8 @@
#include "collect.hxx"
+#include <rtl/ustring.hxx>
+
//------------------------------------------------------------------------
#define MAXFUNCPARAM 16
#define MAXARRSIZE 0xfffe
@@ -91,10 +94,11 @@ public:
sal_Bool Call(void** ppParam);
sal_Bool Unadvice(double nHandle);
- // Name und Beschreibung des Parameters nParam.
- // nParam==0 => Desc := Funktions-Beschreibung,
+ // name and description of parameter nParam.
+ // nParam==0 => Desc := function description,
// Name := n/a
- sal_Bool GetParamDesc( String& aName, String& aDesc, sal_uInt16 nParam );
+ bool getParamDesc( ::rtl::OUString& aName, ::rtl::OUString& aDesc, sal_uInt16 nParam );
+
};
@@ -102,7 +106,7 @@ public:
class FuncCollection : public ScSortedCollection
{
public:
- FuncCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False) : ScSortedCollection ( nLim, nDel, bDup ) {}
+ FuncCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false) : ScSortedCollection ( nLim, nDel, bDup ) {}
FuncCollection(const FuncCollection& rFuncCollection) : ScSortedCollection ( rFuncCollection ) {}
virtual ScDataObject* Clone() const { return new FuncCollection(*this); }
@@ -116,3 +120,5 @@ sal_Bool InitExternalFunc(const rtl::OUString& rModuleName);
void ExitExternalFunc();
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 54e767cc0555..7408357d0f0f 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,9 @@
#include <stddef.h>
#include <set>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
#include <tools/mempool.hxx>
#include <svl/listener.hxx>
#include "global.hxx"
@@ -56,6 +60,7 @@ class SvtBroadcaster;
class ScCodeArray;
class ScProgress;
class ScPostIt;
+class ScPatternAttr;
// ============================================================================
@@ -79,7 +84,7 @@ const int SC_CLONECELL_NOCAPTION = 0x0004;
class SC_DLLPUBLIC ScBaseCell
{
protected:
- ~ScBaseCell(); // nicht virtuell -> darf nicht direkt aufgerufen werden
+ ~ScBaseCell(); // not virtual - not to be called directly.
public:
explicit ScBaseCell( CellType eNewType );
@@ -247,8 +252,8 @@ class SC_DLLPUBLIC ScEditCell : public ScBaseCell
{
private:
EditTextObject* pData;
- String* pString; // fuer schnelleren Zugriff von Formeln
- ScDocument* pDoc; // fuer EditEngine Zugriff mit Pool
+ String* pString; // for faster access to formulas
+ ScDocument* pDoc; // for EditEngine access with Pool
void SetTextObject( const EditTextObject* pObject,
const SfxItemPool* pFromPool );
@@ -262,12 +267,12 @@ public:
DECL_FIXEDMEMPOOL_NEWDEL( ScEditCell )
#endif
- ~ScEditCell(); // wegen pData immer!
+ ~ScEditCell(); // always because of pData!
ScEditCell( const EditTextObject* pObject, ScDocument*,
const SfxItemPool* pFromPool /* = NULL */ );
ScEditCell( const ScEditCell& rCell, ScDocument& rDoc );
- // fuer Zeilenumbrueche
+ // for line breaks
ScEditCell( const String& rString, ScDocument* );
void SetData( const EditTextObject* pObject,
@@ -276,6 +281,53 @@ public:
void GetString( String& rString ) const;
const EditTextObject* GetData() const { return pData; }
+
+ /** Removes character attribute based on new pattern attributes. */
+ void RemoveCharAttribs( const ScPatternAttr& rAttr );
+};
+
+// ============================================================================
+
+class ScEditDataArray
+{
+public:
+ class Item
+ {
+ public:
+ explicit Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData);
+ ~Item();
+
+ const EditTextObject* GetOldData() const;
+ const EditTextObject* GetNewData() const;
+ SCTAB GetTab() const;
+ SCCOL GetCol() const;
+ SCROW GetRow() const;
+
+ private:
+ Item(); // disabled
+
+ private:
+ ::boost::shared_ptr<EditTextObject> mpOldData;
+ ::boost::shared_ptr<EditTextObject> mpNewData;
+ SCTAB mnTab;
+ SCCOL mnCol;
+ SCROW mnRow;
+
+ };
+
+ ScEditDataArray();
+ ~ScEditDataArray();
+
+ void AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData);
+
+ const Item* First();
+ const Item* Next();
+
+private:
+ ::std::vector<Item>::const_iterator maIter;
+ ::std::vector<Item> maArray;
};
// ============================================================================
@@ -355,19 +407,19 @@ public:
const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
void SetDirty();
- inline void SetDirtyVar() { bDirty = sal_True; }
+ void SetDirtyVar();
// If setting entire document dirty after load, no broadcasts but still append to FormulaTree.
void SetDirtyAfterLoad();
- inline void ResetTableOpDirtyVar() { bTableOpDirty = sal_False; }
+ inline void ResetTableOpDirtyVar() { bTableOpDirty = false; }
void SetTableOpDirty();
sal_Bool IsDirtyOrInTableOpDirty() const;
sal_Bool GetDirty() const { return bDirty; }
sal_Bool NeedsListening() const { return bNeedListening; }
void SetNeedsListening( sal_Bool bVar ) { bNeedListening = bVar; }
void Compile(const String& rFormula,
- sal_Bool bNoListening = sal_False,
+ sal_Bool bNoListening = false,
const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
- void CompileTokenArray( sal_Bool bNoListening = sal_False );
+ void CompileTokenArray( sal_Bool bNoListening = false );
void CompileXML( ScProgress& rProgress ); // compile temporary string tokens
void CalcAfterLoad();
bool MarkUsedExternalReferences();
@@ -388,7 +440,7 @@ public:
sal_Bool HasRelNameReference() const;
sal_Bool HasColRowName() const;
- void UpdateReference(UpdateRefMode eUpdateRefMode,
+ bool UpdateReference(UpdateRefMode eUpdateRefMode,
const ScRange& r,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
ScDocument* pUndoDoc = NULL,
@@ -402,17 +454,17 @@ public:
void UpdateInsertTab(SCTAB nTable);
void UpdateInsertTabAbs(SCTAB nTable);
- sal_Bool UpdateDeleteTab(SCTAB nTable, sal_Bool bIsMove = sal_False);
+ sal_Bool UpdateDeleteTab(SCTAB nTable, sal_Bool bIsMove = false);
void UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo);
void UpdateRenameTab(SCTAB nTable, const String& rName);
sal_Bool TestTabRefAbs(SCTAB nTable);
- void UpdateCompile( sal_Bool bForceIfNameInUse = sal_False );
+ void UpdateCompile( sal_Bool bForceIfNameInUse = false );
sal_Bool IsRangeNameInUse(sal_uInt16 nIndex) const;
void FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes) const;
void ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap );
sal_Bool IsSubTotal() const { return bSubTotal; }
sal_Bool IsChanged() const { return bChanged; }
- void ResetChanged() { bChanged = sal_False; }
+ void ResetChanged() { bChanged = false; }
sal_Bool IsEmpty(); // formula::svEmptyCell result
// display as empty string if formula::svEmptyCell result
sal_Bool IsEmptyDisplayedAsString();
@@ -454,13 +506,12 @@ public:
void SetMatColsRows( SCCOL nCols, SCROW nRows );
void GetMatColsRows( SCCOL& nCols, SCROW& nRows ) const;
- // ob Zelle im ChangeTrack und nicht im echten Dokument ist
+ // cell belongs to ChangeTrack and not to the real document
void SetInChangeTrack( sal_Bool bVal ) { bInChangeTrack = bVal; }
sal_Bool IsInChangeTrack() const { return bInChangeTrack; }
- // Zu Typ und Format das entsprechende Standardformat.
- // Bei Format "Standard" evtl. das in die Formelzelle
- // uebernommene Format.
+ // standard format for type and format
+ // for format "Standard" possibly the format used in the formula cell
sal_uLong GetStandardFormat( SvNumberFormatter& rFormatter, sal_uLong nFormat ) const;
// For import filters!
@@ -487,9 +538,11 @@ public:
/** Determines whether or not the result string contains more than one paragraph */
bool IsMultilineResult();
+
+ void MaybeInterpret();
};
-// Iterator fuer Referenzen in einer Formelzelle
+// Iterator for references in a formula cell
class ScDetectiveRefIter
{
private:
@@ -498,9 +551,11 @@ private:
public:
ScDetectiveRefIter( ScFormulaCell* pCell );
sal_Bool GetNextRef( ScRange& rRange );
+ ScToken* GetNextRefToken();
};
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/cellform.hxx b/sc/inc/cellform.hxx
index 0a9ce4542b2c..8c59832d413e 100644
--- a/sc/inc/cellform.hxx
+++ b/sc/inc/cellform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@ public:
static void GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rString,
Color** ppColor, SvNumberFormatter& rFormatter,
sal_Bool bNullVals = sal_True,
- sal_Bool bFormula = sal_False,
+ sal_Bool bFormula = false,
ScForceTextFmt eForceTextFmt = ftDontForce );
static void GetInputString( ScBaseCell* pCell, sal_uLong nFormat, String& rString,
@@ -63,3 +64,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index a72a9f729983..01a2ff592d2e 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -130,10 +131,10 @@ typedef ScNamedEntry* ScNamedEntryPtr;
SV_DECL_PTRARR_DEL( ScNamedEntryArr_Impl, ScNamedEntryPtr, 4, 4 )
-// ScCellRangesBase - Basisklasse fuer ScCellRangesObj (mit Index-Access)
-// und ScCellRangeObj (ohne Index-Access)
+// ScCellRangesBase - base class for ScCellRangesObj (with access by index)
+// and ScCellRangeObj (without access by index)
-// XServiceInfo ist in den Ableitungen implementiert
+// XServiceInfo is implemented in derived classes
class ScHelperFunctions
{
@@ -173,9 +174,9 @@ class SC_DLLPUBLIC ScCellRangesBase : public com::sun::star::beans::XPropertySet
public cppu::OWeakObject,
public SfxListener
{
- friend class ScTabViewObj; // fuer select()
- friend class ScTableSheetObj; // fuer createCursorByRange()
- friend class ooo::vba::excel::ScVbaCellRangeAccess;
+ friend class ScTabViewObj; // for select()
+ friend class ScTableSheetObj; // for createCursorByRange()
+ friend class ooo::vba::excel::ScVbaCellRangeAccess;
private:
const SfxItemPropertySet* pPropSet;
@@ -232,7 +233,6 @@ protected:
::com::sun::star::uno::RuntimeException);
public:
- ScCellRangesBase(); // fuer SMART_REFLECTION Krempel
ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR);
ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR);
virtual ~ScCellRangesBase();
@@ -246,16 +246,16 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
virtual void RefChanged();
- // aus Ableitungen, aber auch per getImplementation
+ // from derived classes and by getImplementation
ScDocShell* GetDocShell() const { return pDocShell; }
ScDocument* GetDocument() const;
const ScRangeList& GetRangeList() const { return aRanges; }
void AddRange(const ScRange& rRange, const sal_Bool bMergeRanges);
- // per Service erzeugtes Objekt zum Leben erwecken:
+ // arouse object created via service:
void InitInsertRange(ScDocShell* pDocSh, const ScRange& rR);
- void SetNewRange(const ScRange& rNew); // fuer Cursor
+ void SetNewRange(const ScRange& rNew); // for cursor
void SetNewRanges(const ScRangeList& rNew);
void SetCursorOnly(sal_Bool bSet);
@@ -657,9 +657,6 @@ public:
const formula::FormulaGrammar::Grammar )
throw(::com::sun::star::uno::RuntimeException);
- // XCellRange ist Basisklasse von XSheetCellRange und XSheetOperation
-// operator XCellRangeRef() const { return (XSheetCellRange*)this; }
-
// XCellRangeAddressable
virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getRangeAddress()
throw(::com::sun::star::uno::RuntimeException);
@@ -793,7 +790,7 @@ public:
getCellRangeByName( const ::rtl::OUString& aRange, const ScAddress::Details& rDetails )
throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet ueberladen wegen Range-Properties
+ // XPropertySet overloaded due to Range-Properties
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo()
throw(::com::sun::star::uno::RuntimeException);
@@ -958,7 +955,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL
getTextFieldMasters() throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet ueberladen wegen Zell-Properties
+ // XPropertySet overloaded due to cell properties
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo()
throw(::com::sun::star::uno::RuntimeException);
@@ -1009,7 +1006,7 @@ class ScTableSheetObj : public ScCellRangeObj,
public com::sun::star::sheet::XExternalSheetName,
public com::sun::star::document::XEventsSupplier
{
- friend class ScTableSheetsObj; // fuer insertByName()
+ friend class ScTableSheetsObj; // for insertByName()
private:
const SfxItemPropertySet* pSheetPropSet;
@@ -1216,7 +1213,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents()
throw (::com::sun::star::uno::RuntimeException);
- // XPropertySet ueberladen wegen Sheet-Properties
+ // XPropertySet overloaded due to sheet properties
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo()
throw(::com::sun::star::uno::RuntimeException);
@@ -1277,7 +1274,7 @@ public:
virtual void SAL_CALL setName( const ::rtl::OUString& aName )
throw(::com::sun::star::uno::RuntimeException);
- // XPropertySet ueberladen wegen Spalten-Properties
+ // XPropertySet overloaded due to column properties
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo()
throw(::com::sun::star::uno::RuntimeException);
@@ -1317,7 +1314,7 @@ public:
ScTableRowObj(ScDocShell* pDocSh, SCROW nRow, SCTAB nTab);
virtual ~ScTableRowObj();
- // XPropertySet ueberladen wegen Zeilen-Properties
+ // XPropertySet overloaded due to row properties
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
SAL_CALL getPropertySetInfo()
throw(::com::sun::star::uno::RuntimeException);
@@ -1570,3 +1567,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/cfgids.hxx b/sc/inc/cfgids.hxx
index 4b07ddd0682f..d428f03f456e 100644
--- a/sc/inc/cfgids.hxx
+++ b/sc/inc/cfgids.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,4 @@
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index 44737e711090..83e7de7a8d1f 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,9 +49,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
-// #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
-// #include <com/sun/star/lang/XUnoTunnel.hpp>
-// #endif
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase6.hxx>
@@ -58,7 +56,7 @@
#include <rtl/ustring.hxx>
#include <svl/itemprop.hxx>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
#include <list>
#include <vector>
#include <memory>
@@ -112,9 +110,6 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XRangeSelection > SAL_CALL getRangeSelection()
throw (::com::sun::star::uno::RuntimeException);
-/* virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > SAL_CALL getNumberFormatsSupplier()
- throw (::com::sun::star::uno::RuntimeException);*/
-
// XRangeXMLConversion ---------------------------------------------------
virtual ::rtl::OUString SAL_CALL convertRangeToXML( const ::rtl::OUString& sRangeRepresentation )
@@ -322,7 +317,7 @@ class ScChart2DataSequence : public
public:
explicit ScChart2DataSequence( ScDocument* pDoc,
const com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider >& xDP,
- ::std::vector<ScSharedTokenRef>* pTokens, bool bIncludeHiddenCells );
+ ::std::vector<ScTokenRef>* pTokens, bool bIncludeHiddenCells );
virtual ~ScChart2DataSequence();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -429,16 +424,6 @@ public:
getSupportedServiceNames() throw(
::com::sun::star::uno::RuntimeException);
- // XUnoTunnel ------------------------------------------------------------
-
-// virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
-// sal_Int8 >& aIdentifier )
-// throw(::com::sun::star::uno::RuntimeException);
-
-// static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
-// static ScChart2DataSequence* getImplementation( const com::sun::star::uno::Reference<
-// com::sun::star::uno::XInterface> xObj );
-
private:
void setDataChangedHint(bool b);
@@ -459,14 +444,14 @@ private:
virtual void notify(sal_uInt16 nFileId, ScExternalRefManager::LinkUpdateType eType);
void addFileId(sal_uInt16 nFileId);
void removeFileId(sal_uInt16 nFileId);
- const ::std::hash_set<sal_uInt16>& getAllFileIds();
+ const ::boost::unordered_set<sal_uInt16>& getAllFileIds();
private:
ExternalRefListener();
ExternalRefListener(const ExternalRefListener& r);
ScChart2DataSequence& mrParent;
- ::std::hash_set<sal_uInt16> maFileIds;
+ ::boost::unordered_set<sal_uInt16> maFileIds;
ScDocument* mpDoc;
};
@@ -478,7 +463,7 @@ private:
void RebuildDataCache();
- sal_Int32 FillCacheFromExternalRef(const ScSharedTokenRef& pToken);
+ sal_Int32 FillCacheFromExternalRef(const ScTokenRef& pToken);
void UpdateTokensFromRanges(const ScRangeList& rRanges);
@@ -527,7 +512,7 @@ private:
sal_Bool m_bIncludeHiddenCells;
// internals
- typedef ::std::auto_ptr< ::std::vector<ScSharedTokenRef> > TokenListPtr;
+ typedef ::std::auto_ptr< ::std::vector<ScTokenRef> > TokenListPtr;
typedef ::std::auto_ptr< ::std::vector<sal_uInt32> > RangeIndexMapPtr;
typedef ::std::auto_ptr<ExternalRefListener> ExtRefListenerPtr;
@@ -666,16 +651,6 @@ public:
getSupportedServiceNames() throw(
::com::sun::star::uno::RuntimeException);
- // XUnoTunnel ------------------------------------------------------------
-
-// virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
-// sal_Int8 >& aIdentifier )
-// throw(::com::sun::star::uno::RuntimeException);
-
-// static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
-// static ScChart2DataSequence* getImplementation( const com::sun::star::uno::Reference<
-// com::sun::star::uno::XInterface> xObj );
-
// Implementation --------------------------------------------------------
ScRangeListRef GetRangeList() { return m_xRanges; }
@@ -696,3 +671,5 @@ private:
#endif
#endif // SC_CHART2UNO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chartarr.hxx b/sc/inc/chartarr.hxx
index 47558c5d53d9..d40434467188 100644
--- a/sc/inc/chartarr.hxx
+++ b/sc/inc/chartarr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,3 +126,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx
index 8ee894e6a55a..7c465945d37d 100644
--- a/sc/inc/charthelper.hxx
+++ b/sc/inc/charthelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,6 @@ class ScChartHelper
{
public:
static sal_uInt16 DoUpdateAllCharts( ScDocument* pDoc );
- static sal_uInt16 DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc ); //use this to replace ScDBFunc::DoUpdateCharts in future
static void AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc, ScDocument* pDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab );
static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartFromSdrObject( SdrObject* pObject );
static void GetChartRanges( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc,
@@ -63,3 +63,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index f97344c8ca1e..3fa59a485ab8 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
#include <memory>
#include <vector>
#include <list>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
class ScDocument;
class ScChartUnoData;
@@ -57,21 +58,21 @@ public:
virtual void notify(sal_uInt16 nFileId, ScExternalRefManager::LinkUpdateType eType);
void addFileId(sal_uInt16 nFileId);
void removeFileId(sal_uInt16 nFileId);
- ::std::hash_set<sal_uInt16>& getAllFileIds();
+ ::boost::unordered_set<sal_uInt16>& getAllFileIds();
private:
ExternalRefListener();
ExternalRefListener(const ExternalRefListener& r);
ScChartListener& mrParent;
- ::std::hash_set<sal_uInt16> maFileIds;
+ ::boost::unordered_set<sal_uInt16> maFileIds;
ScDocument* mpDoc;
};
private:
::std::auto_ptr<ExternalRefListener> mpExtRefListener;
- ::std::auto_ptr< ::std::vector<ScSharedTokenRef> > mpTokens;
+ ::std::auto_ptr< ::std::vector<ScTokenRef> > mpTokens;
ScChartUnoData* pUnoData;
ScDocument* pDoc;
@@ -88,7 +89,7 @@ public:
ScChartListener( const String& rName, ScDocument* pDoc,
const ScRangeListRef& rRangeListRef );
ScChartListener( const String& rName, ScDocument* pDoc,
- ::std::vector<ScSharedTokenRef>* pTokens );
+ ::std::vector<ScTokenRef>* pTokens );
ScChartListener( const ScChartListener& );
virtual ~ScChartListener();
virtual ScDataObject* Clone() const;
@@ -104,7 +105,7 @@ public:
void StartListeningTo();
void EndListeningTo();
void ChangeListening( const ScRangeListRef& rRangeListRef,
- sal_Bool bDirty = sal_False );
+ sal_Bool bDirty = false );
void Update();
ScRangeListRef GetRangeList() const;
void SetRangeList( const ScRangeListRef& rNew );
@@ -176,7 +177,7 @@ public:
void ChangeListening( const String& rName,
const ScRangeListRef& rRangeListRef,
- sal_Bool bDirty = sal_False );
+ sal_Bool bDirty = false );
// FreeUnused nur wie in ScDocument::UpdateChartListenerCollection verwenden!
void FreeUnused();
void FreeUno( const com::sun::star::uno::Reference< com::sun::star::chart::XChartDataChangeEventListener >& rListener,
@@ -185,7 +186,7 @@ public:
void UpdateDirtyCharts();
void SC_DLLPUBLIC SetDirty();
void SetDiffDirty( const ScChartListenerCollection&,
- sal_Bool bSetChartRangeLists = sal_False );
+ sal_Bool bSetChartRangeLists = false );
void SetRangeDirty( const ScRange& rRange ); // z.B. Zeilen/Spalten
@@ -216,3 +217,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chartlock.hxx b/sc/inc/chartlock.hxx
index 16f0fdd2cf4c..16afcc78ced0 100644
--- a/sc/inc/chartlock.hxx
+++ b/sc/inc/chartlock.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chartpos.hxx b/sc/inc/chartpos.hxx
index ecd9b89d1dea..b64804374f83 100644
--- a/sc/inc/chartpos.hxx
+++ b/sc/inc/chartpos.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,9 +50,9 @@ class ScChartPositionMap
SCROW nRowCount;
ScChartPositionMap( SCCOL nChartCols, SCROW nChartRows,
- SCCOL nColAdd, // Header-Spalten
- SCROW nRowAdd, // Header-Zeilen
- Table& rCols // Table mit Col-Tables mit Address*
+ SCCOL nColAdd, // header columns
+ SCROW nRowAdd, // header rows
+ Table& rCols // table with col tables with address*
);
~ScChartPositionMap(); //! deletes all ScAddress*
@@ -67,7 +68,7 @@ public:
sal_Bool IsValid( SCCOL nCol, SCROW nRow ) const
{ return nCol < nColCount && nRow < nRowCount; }
- // Daten spaltenweise
+ // data column by column
sal_uLong GetIndex( SCCOL nCol, SCROW nRow ) const
{ return (sal_uLong) nCol * nRowCount + nRow; }
@@ -78,7 +79,7 @@ public:
return NULL;
}
- //! kann NULL sein und damit "kein Wert"
+ //! might be NULL indicating "no value"
const ScAddress* GetPosition( SCCOL nChartCol, SCROW nChartRow ) const
{
if ( IsValid( nChartCol, nChartRow ) )
@@ -97,22 +98,20 @@ public:
return ppRowHeader[ nChartRow ];
return NULL;
}
-//UNUSED2009-05 ScRangeListRef GetColRanges( SCCOL nChartCol ) const;
-//UNUSED2009-05 ScRangeListRef GetRowRanges( SCROW nChartRow ) const;
};
enum ScChartGlue {
SC_CHARTGLUE_NA,
- SC_CHARTGLUE_NONE, // alte Mimik
- SC_CHARTGLUE_COLS, // alte Mimik
+ SC_CHARTGLUE_NONE, // old mimic
+ SC_CHARTGLUE_COLS, // old mimic
SC_CHARTGLUE_ROWS,
SC_CHARTGLUE_BOTH
};
class ScDocument;
-class ScChartPositioner // nur noch Parameter-Struct
+class ScChartPositioner // only parameter struct
{
ScRangeListRef aRangeListRef;
ScDocument* pDocument;
@@ -127,7 +126,7 @@ class ScChartPositioner // nur noch Parameter-Struct
private:
void CheckColRowHeaders();
- void GlueState(); // zusammengefasste Bereiche
+ void GlueState(); // summarised areas
void CreatePositionMap();
public:
@@ -168,3 +167,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chartuno.hxx b/sc/inc/chartuno.hxx
index fe261f26e517..ce778ad62423 100644
--- a/sc/inc/chartuno.hxx
+++ b/sc/inc/chartuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -202,3 +203,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index 3a0d9b82f41c..3e4f5550aafa 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,9 +48,6 @@
#include "refupdat.hxx"
#endif
-#define DEBUG_CHANGETRACK 0
-
-
class ScBaseCell;
class ScDocument;
@@ -89,9 +87,9 @@ class SvStream;
// --- ScChangeActionLinkEntry ---------------------------------------------
-// Fuegt sich selbst am Beginn einer Kette ein, bzw. vor einem anderen
-// LinkEntry, on delete selbstaendiges ausklinken auch des gelinkten.
-// ppPrev == &previous->pNext oder Adresse des Pointers auf Beginn der Kette,
+// Inserts itself as the head of a chain (better: linked list?), or before a LinkEntry
+// on delete: automatically remove of what is linked (German original was strange...)
+// ppPrev == &previous->pNext oder address of pointer to head of linked list,
// *ppPrev == this
class ScChangeAction;
@@ -182,9 +180,6 @@ public:
ScChangeActionLinkEntry* GetNext() { return pNext; }
const ScChangeAction* GetAction() const { return pAction; }
ScChangeAction* GetAction() { return pAction; }
-#if DEBUG_CHANGETRACK
- String ToString() const;
-#endif // DEBUG_CHANGETRACK
};
// --- ScChangeActionCellListEntry -----------------------------------------
@@ -238,18 +233,15 @@ protected:
ScBigRange aBigRange; // Ins/Del/MoveTo/ContentPos
DateTime aDateTime; //! UTC
- String aUser; // wer war's
- String aComment; // Benutzerkommentar
- ScChangeAction* pNext; // naechster in Kette
- ScChangeAction* pPrev; // vorheriger in Kette
- ScChangeActionLinkEntry* pLinkAny; // irgendwelche Links
- ScChangeActionLinkEntry* pLinkDeletedIn; // Zuordnung zu
- // geloeschten oder
- // druebergemoveten oder
- // rejecteten Insert
- // Bereichen
- ScChangeActionLinkEntry* pLinkDeleted; // Links zu geloeschten
- ScChangeActionLinkEntry* pLinkDependent; // Links zu abhaengigen
+ String aUser; // who?
+ String aComment; // user comment
+ ScChangeAction* pNext; // next in linked list
+ ScChangeAction* pPrev; // previous in linked list
+ ScChangeActionLinkEntry* pLinkAny; // arbitrary links
+ ScChangeActionLinkEntry* pLinkDeletedIn; // access to insert areas which were
+ // deleted or moved or rejected
+ ScChangeActionLinkEntry* pLinkDeleted; // links to deleted
+ ScChangeActionLinkEntry* pLinkDependent; // links to dependent
sal_uLong nAction;
sal_uLong nRejectAction;
ScChangeActionType eType;
@@ -276,7 +268,7 @@ protected:
virtual ~ScChangeAction();
String GetRefString( const ScBigRange&,
- ScDocument*, sal_Bool bFlag3D = sal_False ) const;
+ ScDocument*, sal_Bool bFlag3D = false ) const;
void SetActionNumber( sal_uLong n ) { nAction = n; }
void SetRejectAction( sal_uLong n ) { nRejectAction = n; }
@@ -370,27 +362,25 @@ public:
sal_Bool IsRejecting() const
{ return nRejectAction != 0; }
- // ob Action im Dokument sichtbar ist
+ // if action is visible in the document
sal_Bool IsVisible() const;
- // ob Action anfassbar ist
+ // if action if touchable
sal_Bool IsTouchable() const;
- // ob Action ein Eintrag in Dialog-Root ist
+ // if action is an entry in dialog root
sal_Bool IsDialogRoot() const;
- // ob ein Eintrag im Dialog aufklappbar sein soll
+ // if an entry in a dialog shall be a drop down entry
sal_Bool IsDialogParent() const;
- // ob Action ein Delete ist, unter dem
- // aufgeklappt mehrere einzelne Deletes sind
+ // if action is a delete with subdeletes (aufgeklappt = open ?)
sal_Bool IsMasterDelete() const;
- // ob Action akzeptiert/selektiert/abgelehnt
- // werden kann
+ // if action is acceptable/selectable/rejectable
sal_Bool IsClickable() const;
- // ob Action abgelehnt werden kann
+ // if action is rejectable
sal_Bool IsRejectable() const;
const ScBigRange& GetBigRange() const { return aBigRange; }
@@ -424,22 +414,21 @@ public:
sal_Bool HasDeleted() const
{ return pLinkDeleted != NULL; }
- // Description wird an String angehaengt.
- // Mit bSplitRange wird bei Delete nur
- // eine Spalte/Zeile beruecksichtigt (fuer
- // Auflistung der einzelnen Eintraege).
+ // description will be appended to string
+ // with bSplitRange only one column/row will be considered for delete
+ // (for a listing of entries)
virtual void GetDescription( String&, ScDocument*,
- sal_Bool bSplitRange = sal_False, bool bWarning = true ) const;
+ sal_Bool bSplitRange = false, bool bWarning = true ) const;
virtual void GetRefString( String&, ScDocument*,
- sal_Bool bFlag3D = sal_False ) const;
+ sal_Bool bFlag3D = false ) const;
- // fuer DocumentMerge altes Datum einer anderen
- // Action setzen, mit GetDateTimeUTC geholt
+ // for DocumentMerge set old date of the other
+ // action, fetched by GetDateTimeUTC
void SetDateTimeUTC( const DateTime& rDT )
{ aDateTime = rDT; }
- // Benutzerkommentar setzen
+ // set user comment
void SetComment( const String& rStr )
{ aComment = rStr; }
@@ -449,9 +438,6 @@ public:
// only to be used in the XML import
void AddDependent( sal_uLong nActionNumber,
const ScChangeTrack* pTrack );
-#if DEBUG_CHANGETRACK
- String ToString( ScDocument* pDoc ) const;
-#endif // DEBUG_CHANGETRACK
};
@@ -482,7 +468,7 @@ public:
const ScChangeActionType eType); // only to use in the XML import
virtual void GetDescription( String&, ScDocument*,
- sal_Bool bSplitRange = sal_False, bool bWarning = true ) const;
+ sal_Bool bSplitRange = false, bool bWarning = true ) const;
};
@@ -545,8 +531,8 @@ class ScChangeActionDel : public ScChangeAction
ScChangeTrack* pTrack;
ScChangeActionCellListEntry* pFirstCell;
- ScChangeActionIns* pCutOff; // abgeschnittener Insert
- short nCutOff; // +: Start -: End
+ ScChangeActionIns* pCutOff; // cut insert
+ short nCutOff; // +: start -: end
ScChangeActionDelMoveEntry* pLinkMove;
SCsCOL nDx;
SCsROW nDy;
@@ -582,20 +568,18 @@ public:
const ScChangeActionType eType,
const SCsCOLROW nD,
ScChangeTrack* pTrack); // only to use in the XML import
- // wich of nDx and nDy is set is depend on the type
+ // which of nDx and nDy is set is dependend on the type
- // ob dieses das unterste einer Reihe (oder
- // auch einzeln) ist
+ // is the last in a row (or single)
sal_Bool IsBaseDelete() const;
- // ob dieses das oberste einer Reihe (oder
- // auch einzeln) ist
+ // is the first in a row (or single)
sal_Bool IsTopDelete() const;
- // ob dieses ein Teil einer Reihe ist
+ // is part of a row
sal_Bool IsMultiDelete() const;
- // ob es eine Col ist, die zu einem TabDelete gehoert
+ // is col, belonging to a TabDelete
sal_Bool IsTabDeleteCol() const;
SCsCOL GetDx() const { return nDx; }
@@ -610,7 +594,7 @@ public:
short GetCutOffCount() const { return nCutOff; }
virtual void GetDescription( String&, ScDocument*,
- sal_Bool bSplitRange = sal_False, bool bWarning = true ) const;
+ sal_Bool bSplitRange = false, bool bWarning = true ) const;
void SetCutOffInsert( ScChangeActionIns* p, short n )
{ pCutOff = p; nCutOff = n; } // only to use in the XML import
// this should be protected, but for the XML import it is public
@@ -688,10 +672,10 @@ public:
SC_DLLPUBLIC void GetDelta( sal_Int32& nDx, sal_Int32& nDy, sal_Int32& nDz ) const;
virtual void GetDescription( String&, ScDocument*,
- sal_Bool bSplitRange = sal_False, bool bWarning = true ) const;
+ sal_Bool bSplitRange = false, bool bWarning = true ) const;
virtual void GetRefString( String&, ScDocument*,
- sal_Bool bFlag3D = sal_False ) const;
+ sal_Bool bFlag3D = false ) const;
};
@@ -715,9 +699,9 @@ class ScChangeActionContent : public ScChangeAction
String aNewValue;
ScBaseCell* pOldCell;
ScBaseCell* pNewCell;
- ScChangeActionContent* pNextContent; // an gleicher Position
+ ScChangeActionContent* pNextContent; // at the same position
ScChangeActionContent* pPrevContent;
- ScChangeActionContent* pNextInSlot; // in gleichem Slot
+ ScChangeActionContent* pNextInSlot; // in the same slot
ScChangeActionContent** ppPrevInSlot;
void InsertInSlot( ScChangeActionContent** pp )
@@ -873,8 +857,8 @@ public:
void SetPrevContent( ScChangeActionContent* p )
{ pPrevContent = p; }
- // moeglichst nicht verwenden,
- // setzt nur String bzw. generiert Formelzelle
+ // don't use:
+ // assigns String / creates forumula cell
void SetOldValue( const String& rOld, ScDocument* );
void SetNewValue( const String& rNew, ScDocument* );
@@ -883,9 +867,9 @@ public:
const ScBaseCell* GetOldCell() const { return pOldCell; }
const ScBaseCell* GetNewCell() const { return pNewCell; }
virtual void GetDescription( String&, ScDocument*,
- sal_Bool bSplitRange = sal_False, bool bWarning = true ) const;
+ sal_Bool bSplitRange = false, bool bWarning = true ) const;
virtual void GetRefString( String&, ScDocument*,
- sal_Bool bFlag3D = sal_False ) const;
+ sal_Bool bFlag3D = false ) const;
static ScChangeActionContentCellType GetContentCellType( const ScBaseCell* );
@@ -934,7 +918,7 @@ class ScChangeActionReject : public ScChangeAction
virtual void AddContent( ScChangeActionContent* ) {}
virtual void DeleteCellEntries() {}
- virtual sal_Bool Reject( ScDocument* ) { return sal_False; }
+ virtual sal_Bool Reject( ScDocument* ) { return false; }
virtual const ScChangeTrack* GetChangeTrack() const { return 0; }
@@ -954,10 +938,10 @@ public:
enum ScChangeTrackMsgType
{
SC_CTM_NONE,
- SC_CTM_APPEND, // Actions angehaengt
- SC_CTM_REMOVE, // Actions weggenommen
- SC_CTM_CHANGE, // Actions geaendert
- SC_CTM_PARENT // war kein Parent und ist jetzt einer
+ SC_CTM_APPEND, // Actions appended
+ SC_CTM_REMOVE, // Actions removed
+ SC_CTM_CHANGE, // Actions changed
+ SC_CTM_PARENT // became a parent (and wasn't before)
};
struct ScChangeTrackMsgInfo
@@ -969,7 +953,7 @@ struct ScChangeTrackMsgInfo
sal_uLong nEndAction;
};
-// MsgQueue fuer Benachrichtigung via ModifiedLink
+// MsgQueue for notification via ModifiedLink
DECLARE_QUEUE( ScChangeTrackMsgQueue, ScChangeTrackMsgInfo* )
DECLARE_STACK( ScChangeTrackMsgStack, ScChangeTrackMsgInfo* )
@@ -982,13 +966,11 @@ enum ScChangeTrackMergeState
SC_CTMS_OTHER
};
-// zusaetzlich zu pFirst/pNext/pLast/pPrev eine Table, um schnell sowohl
-// per ActionNumber als auch ueber Liste zugreifen zu koennen
+// Table, additionally to pFirst/pNext/pLast/pPrev, to enable fast access by ActionNumber and by list
DECLARE_TABLE( ScChangeActionTable, ScChangeAction* )
-// Intern generierte Actions beginnen bei diesem Wert (fast alle Bits gesetzt)
-// und werden runtergezaehlt, um sich in einer Table wertemaessig nicht mit den
-// "normalen" Actions in die Quere zu kommen.
+// Internally generated actions start at this value (nearly all bits set)
+// and are decremented, to keep values in a table seperated from "normal" actions.
#define SC_CHGTRACK_GENERATED_START ((sal_uInt32) 0xfffffff0)
class ScChangeTrack : public utl::ConfigurationListener
@@ -1075,7 +1057,7 @@ class ScChangeTrack : public utl::ConfigurationListener
void SetLastCutMoveRange( const ScRange&, ScDocument* );
- // ModifyMsg blockweise und nicht einzeln erzeugen
+ // create block of ModifyMsg
void StartBlockModify( ScChangeTrackMsgType,
sal_uLong nStartAction );
void EndBlockModify( sal_uLong nEndAction );
@@ -1113,11 +1095,11 @@ class ScChangeTrack : public utl::ConfigurationListener
ScChangeActionCellListEntry*&,
ScChangeAction* pDeletor );
- // Action und alle abhaengigen rejecten,
- // Table stammt aus vorherigem GetDependents,
- // ist nur bei Insert und Move (MasterType)
- // noetig, kann ansonsten NULL sein.
- // bRecursion == Aufruf aus Reject mit Table
+ // Reject action and all dependent actions,
+ // Table stems from previous GetDependents,
+ // only needed for Insert and Move (MasterType),
+ // is NULL otherwise.
+ // bRecursion == called from reject with table
sal_Bool Reject( ScChangeAction*,
ScChangeActionTable*, sal_Bool bRecursion );
@@ -1200,32 +1182,32 @@ public:
ScDocument* pRefDoc,
sal_uLong& nStartAction, sal_uLong& nEndAction,
SCsTAB nDz = 0 );
- // nDz: Multi-TabDel, LookUpContent ist
- // um -nDz verschoben zu suchen
+ // nDz: multi TabDel, LookUpContent must be searched
+ // with an offset of -nDz
- // nachdem neuer Wert im Dokument gesetzt wurde,
- // alter Wert aus RefDoc/UndoDoc
+ // after new value was set in the document,
+ // old value from RefDoc/UndoDoc
void AppendContent( const ScAddress& rPos,
ScDocument* pRefDoc );
- // nachdem neue Werte im Dokument gesetzt wurden,
- // alte Werte aus RefDoc/UndoDoc
+ // after new values were set in the document,
+ // old values from RefDoc/UndoDoc
void AppendContentRange( const ScRange& rRange,
ScDocument* pRefDoc,
sal_uLong& nStartAction, sal_uLong& nEndAction,
ScChangeActionClipMode eMode = SC_CACM_NONE );
- // nachdem neuer Wert im Dokument gesetzt wurde,
- // alter Wert aus pOldCell, nOldFormat,
+ // after new value was set in the document,
+ // old value from pOldCell, nOldFormat,
// RefDoc==NULL => Doc
void AppendContent( const ScAddress& rPos,
const ScBaseCell* pOldCell,
sal_uLong nOldFormat, ScDocument* pRefDoc = NULL );
- // nachdem neuer Wert im Dokument gesetzt wurde,
- // alter Wert aus pOldCell, Format aus Doc
+ // after new value was set in the document,
+ // old value from pOldCell, format from Doc
void AppendContent( const ScAddress& rPos,
const ScBaseCell* pOldCell );
- // nachdem neue Werte im Dokument gesetzt wurden,
- // alte Werte aus RefDoc/UndoDoc.
- // Alle Contents, wo im RefDoc eine Zelle steht.
+ // after new values were set in the document,
+ // old values from RefDoc/UndoDoc.
+ // All contents with a cell in RefDoc
void AppendContentsIfInRefDoc( ScDocument* pRefDoc,
sal_uLong& nStartAction, sal_uLong& nEndAction );
@@ -1243,14 +1225,8 @@ public:
sal_uLong nOldFormat = 0,
sal_uLong nNewFormat = 0 );
- // die folgenden beiden nur benutzen wenn's
- // nicht anders geht (setzen nur String fuer
- // NewValue bzw. Formelerzeugung)
-
- // bevor neuer Wert im Dokument gesetzt wird
- void AppendContent( const ScAddress& rPos,
- const String& rNewValue,
- ScBaseCell* pOldCell );
+ // Only use the following two if there is no different solution!
+ // (Assign String for NewValue or creation of a formula respectively)
SC_DLLPUBLIC void AppendInsert( const ScRange& );
@@ -1279,51 +1255,57 @@ public:
SC_DLLPUBLIC void Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMerge = false );
- // fuer MergeDocument, Referenzen anpassen,
- //! darf nur in einem temporaer geoeffneten
- //! Dokument verwendet werden, der Track
- //! ist danach verhunzt
+ // adjust references for MergeDocument
+ //! may only be used in a temporary opened document.
+ //! the Track (?) is unclean afterwards
void MergePrepare( ScChangeAction* pFirstMerge, bool bShared = false );
void MergeOwn( ScChangeAction* pAct, sal_uLong nFirstMerge, bool bShared = false );
static sal_Bool MergeIgnore( const ScChangeAction&, sal_uLong nFirstMerge );
- // Abhaengige in Table einfuegen.
- // Bei Insert sind es echte Abhaengige,
- // bei Move abhaengige Contents im FromRange
- // und geloeschte im ToRange bzw. Inserts in
- // FromRange oder ToRange,
- // bei Delete eine Liste der geloeschten,
- // bei Content andere Contents an gleicher
- // Position oder MatrixReferences zu MatrixOrigin.
- // Mit bListMasterDelete werden unter einem
- // MasterDelete alle zu diesem Delete gehoerenden
- // Deletes einer Reihe gelistet.
- // Mit bAllFlat werden auch alle Abhaengigen
- // der Abhaengigen flach eingefuegt.
+ // This comment was already really strange in German.
+ // Tried to structure it a little. Hope no information got lost...
+ //
+ // Insert dependents into table.
+ // ScChangeAction is
+ // - "Insert": really dependents
+ // - "Move": dependent contents in FromRange /
+ // deleted contents in ToRange
+ // OR inserts in FromRange or ToRange
+ // - "Delete": a list of deleted (what?)
+ // OR for content, different contents at the same position
+ // OR MatrixReferences belonging to MatrixOrigin
+ //
+ // With bListMasterDelete (==TRUE ?) all Deletes of a row belonging
+ // to a MasterDelete are listed (possibly it is
+ // "all Deletes belonging...are listed in a row?)
+ //
+ // With bAllFlat (==TRUE ?) all dependents of dependents
+ // will be inserted flatly.
+
SC_DLLPUBLIC void GetDependents( ScChangeAction*,
ScChangeActionTable&,
- sal_Bool bListMasterDelete = sal_False,
- sal_Bool bAllFlat = sal_False ) const;
+ sal_Bool bListMasterDelete = false,
+ sal_Bool bAllFlat = false ) const;
- // Reject visible Action (und abhaengige)
+ // Reject visible action (and dependents)
sal_Bool Reject( ScChangeAction*, bool bShared = false );
- // Accept visible Action (und abhaengige)
+ // Accept visible action (and dependents)
SC_DLLPUBLIC sal_Bool Accept( ScChangeAction* );
- void AcceptAll(); // alle Virgins
- sal_Bool RejectAll(); // alle Virgins
+ void AcceptAll(); // all Virgins
+ sal_Bool RejectAll(); // all Virgins
- // Selektiert einen Content von mehreren an
- // gleicher Position und akzeptiert diesen und
- // die aelteren, rejected die neueren.
- // Mit bOldest==sal_True wird der erste OldValue
- // einer Virgin-Content-Kette restauriert.
+ // Selects a content of several contents at the same
+ // position and accepts this one and
+ // the older ones, rejects the more recent ones.
+ // If bOldest==TRUE then the first OldValue
+ // of a Virgin-Content-List will be restored.
sal_Bool SelectContent( ScChangeAction*,
- sal_Bool bOldest = sal_False );
+ sal_Bool bOldest = false );
- // wenn ModifiedLink gesetzt, landen
- // Aenderungen in ScChangeTrackMsgQueue
+ // If ModifiedLink is set, changes go to
+ // ScChangeTrackMsgQueue
void SetModifiedLink( const Link& r )
{ aModifiedLink = r; ClearMsgQueue(); }
const Link& GetModifiedLink() const { return aModifiedLink; }
@@ -1359,12 +1341,10 @@ public:
void AppendCloned( ScChangeAction* pAppend );
SC_DLLPUBLIC ScChangeTrack* Clone( ScDocument* pDocument ) const;
void MergeActionState( ScChangeAction* pAct, const ScChangeAction* pOtherAct );
-#if DEBUG_CHANGETRACK
- String ToString() const;
-#endif // DEBUG_CHANGETRACK
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx
index 09794e885778..630128a8be94 100644
--- a/sc/inc/chgviset.hxx
+++ b/sc/inc/chgviset.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,15 +71,15 @@ public:
ScChangeViewSettings()
{
pCommentSearcher=NULL;
- bIsDate=sal_False;
- bIsAuthor=sal_False;
- bIsRange=sal_False;
- bIsComment=sal_False;
- bShowIt=sal_False;
+ bIsDate=false;
+ bIsAuthor=false;
+ bIsRange=false;
+ bIsComment=false;
+ bShowIt=false;
eDateMode=SCDM_DATE_BEFORE;
- bEveryoneButMe=sal_False;
- bShowAccepted=sal_False;
- bShowRejected=sal_False;
+ bEveryoneButMe=false;
+ bShowAccepted=false;
+ bShowRejected=false;
mbIsActionRange = false;
}
@@ -147,3 +148,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/clipparam.hxx b/sc/inc/clipparam.hxx
index ce2d4ef30f46..f8a4038eaca4 100644
--- a/sc/inc/clipparam.hxx
+++ b/sc/inc/clipparam.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,7 +84,7 @@ struct ScClipParam
struct ScClipRangeNameData
{
ScRangeData::IndexMap maRangeMap;
- ::std::vector<ScRangeData*> mpRangeNames;
+ ::std::vector<ScRangeData*> mpRangeNames; // Don't insert NULL pointers.
bool mbReplace;
ScClipRangeNameData();
@@ -92,3 +93,5 @@ struct ScClipRangeNameData
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/collect.hxx b/sc/inc/collect.hxx
index 546765054012..bedf65880df5 100644
--- a/sc/inc/collect.hxx
+++ b/sc/inc/collect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,7 +94,7 @@ protected:
void SetDups( sal_Bool bVal ) { bDuplicates = bVal; }
sal_Bool IsDups() const { return bDuplicates; }
public:
- ScSortedCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False);
+ ScSortedCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false);
ScSortedCollection(const ScSortedCollection& rScSortedCollection) :
ScCollection(rScSortedCollection),
bDuplicates(rScSortedCollection.bDuplicates) {}
@@ -132,7 +133,7 @@ class SvStream;
class SC_DLLPUBLIC ScStrCollection : public ScSortedCollection
{
public:
- ScStrCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False) :
+ ScStrCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false) :
ScSortedCollection ( nLim, nDel, bDup ) {}
ScStrCollection(const ScStrCollection& rScStrCollection) :
ScSortedCollection ( rScStrCollection ) {}
@@ -155,9 +156,6 @@ public:
nValue(nVal),
nStrType(nType) {}
-//UNUSED2008-05 TypedStrData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab,
-//UNUSED2008-05 sal_Bool bAllStrings );
-
TypedStrData( const TypedStrData& rCpy )
: ScDataObject(),
aStrValue(rCpy.aStrValue),
@@ -184,7 +182,7 @@ private:
sal_Bool bCaseSensitive;
public:
- TypedScStrCollection( sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False );
+ TypedScStrCollection( sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false );
TypedScStrCollection( const TypedScStrCollection& rCpy )
: ScSortedCollection( rCpy ) { bCaseSensitive = rCpy.bCaseSensitive; }
@@ -202,3 +200,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 36569d4efefb..5f5fda1bd64b 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include "global.hxx"
#include "address.hxx"
#include "rangenam.hxx"
-#include <tools/solar.h>
#include <set>
@@ -51,8 +51,10 @@ class SvxBoxItem;
class ScAttrIterator;
class ScAttrArray;
+struct ScAttrEntry;
class ScBaseCell;
class ScDocument;
+class ScEditDataArray;
class ScFormulaCell;
class ScMarkData;
class ScPatternAttr;
@@ -65,6 +67,8 @@ struct ScFunctionData;
struct ScLineFlags;
struct ScMergePatternState;
class ScFlatBoolRowSegments;
+struct ScSetStringParam;
+struct ScColWidthParam;
#define COLUMN_DELTA 4
@@ -72,18 +76,18 @@ class ScFlatBoolRowSegments;
struct ScNeededSizeOptions
{
const ScPatternAttr* pPattern;
- sal_Bool bFormula;
- sal_Bool bSkipMerged;
- sal_Bool bGetFont;
- sal_Bool bTotalSize;
+ bool bFormula;
+ bool bSkipMerged;
+ bool bGetFont;
+ bool bTotalSize;
ScNeededSizeOptions()
{
pPattern = NULL;
- bFormula = sal_False;
- bSkipMerged = sal_True;
- bGetFont = sal_True;
- bTotalSize = sal_False;
+ bFormula = false;
+ bSkipMerged = true;
+ bGetFont = true;
+ bTotalSize = false;
}
};
@@ -104,10 +108,10 @@ private:
SCSIZE nLimit;
ColEntry* pItems;
- ScAttrArray* pAttrArray;
- ScDocument* pDocument;
+ ScAttrArray* pAttrArray;
+ ScDocument* pDocument;
-friend class ScDocument; // fuer FillInfo
+friend class ScDocument; // for FillInfo
friend class ScDocumentIterator;
friend class ScValueIterator;
friend class ScDBQueryDataIterator;
@@ -119,18 +123,26 @@ friend class ScHorizontalCellIterator;
friend class ScHorizontalAttrIterator;
public:
-static sal_Bool bDoubleAlloc; // fuer Import: Groesse beim Allozieren verdoppeln
+ static bool bDoubleAlloc; // for Import: double size for alloc
+ class DoubleAllocSwitch
+ {
+ public:
+ DoubleAllocSwitch(bool bNewVal = true);
+ ~DoubleAllocSwitch();
+ private:
+ bool mbOldVal;
+ };
public:
ScColumn();
~ScColumn();
void Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc);
- sal_Bool Search( SCROW nRow, SCSIZE& nIndex ) const;
+ bool Search( SCROW nRow, SCSIZE& nIndex ) const;
ScBaseCell* GetCell( SCROW nRow ) const;
void Insert( SCROW nRow, ScBaseCell* pCell );
- void Insert( SCROW nRow, sal_uLong nFormatIndex, ScBaseCell* pCell );
+ void Insert( SCROW nRow, sal_uInt32 nFormatIndex, ScBaseCell* pCell );
void Append( SCROW nRow, ScBaseCell* pCell );
void Delete( SCROW nRow );
void DeleteAtIndex( SCSIZE nIndex );
@@ -139,63 +151,60 @@ public:
void SwapRow( SCROW nRow1, SCROW nRow2 );
void SwapCell( SCROW nRow, ScColumn& rCol);
-//UNUSED2009-05 sal_Bool HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
-//UNUSED2009-05 sal_Bool bLeft, sal_Bool bRight ) const;
bool HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const;
- sal_Bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
- sal_Bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
+ bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
+ bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
SCCOL& rPaintCol, SCROW& rPaintRow,
- sal_Bool bRefresh, sal_Bool bAttrs );
-
- sal_Bool IsEmptyVisData(sal_Bool bNotes) const; // ohne Broadcaster
- sal_Bool IsEmptyData() const;
- sal_Bool IsEmptyAttr() const;
- sal_Bool IsEmpty() const;
-
- // nur Daten:
- sal_Bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow, bool bIgnoreNotes = false) const;
- SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const;
- sal_Bool HasDataAt(SCROW nRow) const;
- sal_Bool HasVisibleDataAt(SCROW nRow) const;
- SCROW GetFirstDataPos() const;
- SCROW GetLastDataPos() const;
- SCROW GetLastVisDataPos(sal_Bool bNotes) const; // ohne Broadcaster
- SCROW GetFirstVisDataPos(sal_Bool bNotes) const;
- sal_Bool GetPrevDataPos(SCROW& rRow) const;
- sal_Bool GetNextDataPos(SCROW& rRow) const;
- void FindDataAreaPos(SCROW& rRow, long nMovY) const; // (ohne Broadcaster)
- void FindUsed( SCROW nStartRow, SCROW nEndRow, sal_Bool* pUsed ) const;
-
- SCSIZE VisibleCount( SCROW nStartRow, SCROW nEndRow ) const;
-
- sal_uInt16 GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const;
- sal_Bool HasSelectionMatrixFragment(const ScMarkData& rMark) const;
-
- sal_Bool GetFirstVisibleAttr( SCROW& rFirstRow ) const;
- sal_Bool GetLastVisibleAttr( SCROW& rLastRow ) const;
- sal_Bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const;
- sal_Bool IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow = 0,
+ bool bRefresh, bool bAttrs );
+
+ bool IsEmptyVisData(bool bNotes) const; // without Broadcaster
+ bool IsEmptyData() const;
+ bool IsEmptyAttr() const;
+ bool IsEmpty() const;
+
+ // data only:
+ bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow, bool bIgnoreNotes = false) const;
+ SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const;
+ bool HasDataAt(SCROW nRow) const;
+ bool HasVisibleDataAt(SCROW nRow) const;
+ SCROW GetFirstDataPos() const;
+ SCROW GetLastDataPos() const;
+ SCROW GetLastVisDataPos(bool bNotes) const; // without Broadcaster
+ SCROW GetFirstVisDataPos(bool bNotes) const;
+ bool GetPrevDataPos(SCROW& rRow) const;
+ bool GetNextDataPos(SCROW& rRow) const;
+ void FindDataAreaPos(SCROW& rRow, long nMovY) const; // (without Broadcaster)
+ void FindUsed( SCROW nStartRow, SCROW nEndRow, bool* pUsed ) const;
+
+ SCSIZE VisibleCount( SCROW nStartRow, SCROW nEndRow ) const;
+ sal_uInt16 GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const;
+ bool HasSelectionMatrixFragment(const ScMarkData& rMark) const;
+
+ bool GetFirstVisibleAttr( SCROW& rFirstRow ) const;
+ bool GetLastVisibleAttr( SCROW& rLastRow ) const;
+ bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const;
+ bool IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow = 0,
SCROW nEndRow = MAXROW ) const;
- sal_Bool IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const;
+ bool IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const;
- sal_Bool TestInsertCol( SCROW nStartRow, SCROW nEndRow) const;
- sal_Bool TestInsertRow( SCSIZE nSize ) const;
+ bool TestInsertCol( SCROW nStartRow, SCROW nEndRow) const;
+ bool TestInsertRow( SCSIZE nSize ) const;
void InsertRow( SCROW nStartRow, SCSIZE nSize );
void DeleteRow( SCROW nStartRow, SCSIZE nSize );
void DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDelFlag );
void DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag );
- void CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, sal_Bool bKeepScenarioFlags, sal_Bool bCloneNoteCaptions);
+ void CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, bool bKeepScenarioFlags, bool bCloneNoteCaptions);
void CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy,
- sal_uInt16 nInsFlag, sal_Bool bAsLink, sal_Bool bSkipAttrForEmpty, ScColumn& rColumn);
+ sal_uInt16 nInsFlag, bool bAsLink, bool bSkipAttrForEmpty, ScColumn& rColumn);
void StartListeningInArea( SCROW nRow1, SCROW nRow2 );
void BroadcastInArea( SCROW nRow1, SCROW nRow2 );
void RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow );
- // Markierung von diesem Dokument
+ // Selection (?) of this document
void MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction,
- sal_Bool bSkipEmpty, ScColumn& rSrcCol );
- void MixData( SCROW nRow1, SCROW nRow2, sal_uInt16 nFunction, sal_Bool bSkipEmpty,
+ bool bSkipEmpty, ScColumn& rSrcCol );
+ void MixData( SCROW nRow1, SCROW nRow2, sal_uInt16 nFunction, bool bSkipEmpty,
ScColumn& rSrcCol );
ScFormulaCell* CreateRefCell( ScDocument* pDestDoc, const ScAddress& rDestPos,
@@ -203,26 +212,27 @@ public:
ScAttrIterator* CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const;
- SCCOL GetCol() const { return nCol; }
- // UpdateSelectionFunction: Mehrfachselektion
- void UpdateSelectionFunction( const ScMarkData& rMark,
+ SCCOL GetCol() const { return nCol; }
+
+ // UpdateSelectionFunction: multi-select
+ void UpdateSelectionFunction( const ScMarkData& rMark,
ScFunctionData& rData,
ScFlatBoolRowSegments& rHiddenRows,
- sal_Bool bDoExclude, SCROW nExStartRow, SCROW nExEndRow );
+ bool bDoExclude, SCROW nExStartRow, SCROW nExEndRow );
void UpdateAreaFunction( ScFunctionData& rData,
ScFlatBoolRowSegments& rHiddenRows,
SCROW nStartRow, SCROW nEndRow );
- void CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Bool bMarked,
+ void CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, bool bMarked,
ScColumn& rColumn, const ScMarkData* pMarkData = NULL,
- sal_Bool bAsLink = sal_False );
- void UndoToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Bool bMarked,
+ bool bAsLink = false );
+ void UndoToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, bool bMarked,
ScColumn& rColumn, const ScMarkData* pMarkData = NULL );
void CopyScenarioFrom( const ScColumn& rSrcCol );
void CopyScenarioTo( ScColumn& rDestCol ) const;
- sal_Bool TestCopyScenarioTo( const ScColumn& rDestCol ) const;
+ bool TestCopyScenarioTo( const ScColumn& rDestCol ) const;
void MarkScenarioIn( ScMarkData& rDestMark ) const;
void CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const;
@@ -230,31 +240,29 @@ public:
void SwapCol(ScColumn& rCol);
void MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol);
- sal_Bool HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const;
- // sal_True = Zahlformat gesetzt
- sal_Bool SetString( SCROW nRow, SCTAB nTab, const String& rString,
+ bool HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const;
+
+ // TRUE = format for numbers is set
+ bool SetString( SCROW nRow, SCTAB nTab, const String& rString,
formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO,
- SvNumberFormatter* pFormatter = NULL,
- bool bDetectNumberFormat = true );
+ ScSetStringParam* pParam = NULL );
void SetValue( SCROW nRow, const double& rVal);
void SetError( SCROW nRow, const sal_uInt16 nError);
void GetString( SCROW nRow, String& rString ) const;
void GetInputString( SCROW nRow, String& rString ) const;
double GetValue( SCROW nRow ) const;
- void GetFormula( SCROW nRow, String& rFormula,
- sal_Bool bAsciiExport = sal_False ) const;
+ void GetFormula( SCROW nRow, String& rFormula ) const;
CellType GetCellType( SCROW nRow ) const;
SCSIZE GetCellCount() const { return nCount; }
- sal_uLong GetWeightedCount() const;
- sal_uLong GetCodeCount() const; // RPN-Code in Formeln
- sal_uInt16 GetErrCode( SCROW nRow ) const;
+ sal_uInt32 GetWeightedCount() const;
+ sal_uInt32 GetCodeCount() const; // RPN-Code in formulas
+ sal_uInt16 GetErrCode( SCROW nRow ) const;
- sal_Bool HasStringData( SCROW nRow ) const;
- sal_Bool HasValueData( SCROW nRow ) const;
-//UNUSED2009-05 sal_uInt16 GetErrorData( SCROW nRow) const;
- sal_Bool HasStringCells( SCROW nStartRow, SCROW nEndRow ) const;
+ bool HasStringData( SCROW nRow ) const;
+ bool HasValueData( SCROW nRow ) const;
+ bool HasStringCells( SCROW nStartRow, SCROW nEndRow ) const;
/** Returns the pointer to a cell note object at the passed row. */
ScPostIt* GetNote( SCROW nRow );
@@ -277,21 +285,21 @@ public:
void ResetChanged( SCROW nStartRow, SCROW nEndRow );
- void UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+ bool UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
ScDocument* pUndoDoc = NULL );
void UpdateInsertTab( SCTAB nTable);
void UpdateInsertTabOnlyCells( SCTAB nTable);
- void UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScColumn* pRefUndo = NULL );
+ void UpdateDeleteTab( SCTAB nTable, bool bIsMove, ScColumn* pRefUndo = NULL );
void UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo);
- void UpdateCompile( sal_Bool bForceIfNameInUse = sal_False );
+ void UpdateCompile( bool bForceIfNameInUse = false );
void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
ScDocument* pUndoDoc );
void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
void SetTabNo(SCTAB nNewTab);
- sal_Bool IsRangeNameInUse(SCROW nRow1, SCROW nRow2, sal_uInt16 nIndex) const;
+ bool IsRangeNameInUse(SCROW nRow1, SCROW nRow2, sal_uInt16 nIndex) const;
void FindRangeNamesInUse(SCROW nRow1, SCROW nRow2, std::set<sal_uInt16>& rIndexes) const;
void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScRangeData::IndexMap& rMap );
@@ -299,22 +307,25 @@ public:
const ScPatternAttr* GetPattern( SCROW nRow ) const;
const ScPatternAttr* GetMostUsedPattern( SCROW nStartRow, SCROW nEndRow ) const;
- sal_uLong GetNumberFormat( SCROW nRow ) const;
+ sal_uInt32 GetNumberFormat( SCROW nRow ) const;
+ sal_uInt32 GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const;
- void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, sal_Bool bDeep ) const;
- void MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, sal_Bool bDeep ) const;
+ void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, bool bDeep ) const;
+ void MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, bool bDeep ) const;
void MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
ScLineFlags& rFlags,
- SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight ) const;
+ SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight ) const;
void ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInfoItem* pLineInner,
- SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight );
+ SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight );
void ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr );
void ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr );
- void ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr );
- void SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr, sal_Bool bPutToPool = sal_False );
+ void ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr,
+ ScEditDataArray* pDataArray = NULL );
+ bool SetAttrEntries(ScAttrEntry* pData, SCSIZE nSize);
+ void SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr, bool bPutToPool = false );
void SetPatternArea( SCROW nStartRow, SCROW nEndRow,
- const ScPatternAttr& rPatAttr, sal_Bool bPutToPool = sal_False );
+ const ScPatternAttr& rPatAttr, bool bPutToPool = false );
void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
const ScPatternAttr& rPattern, short nNewType );
@@ -322,63 +333,61 @@ public:
void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle );
void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark);
void ApplySelectionLineStyle( const ScMarkData& rMark,
- const SvxBorderLine* pLine, sal_Bool bColorOnly );
+ const SvxBorderLine* pLine, bool bColorOnly );
const ScStyleSheet* GetStyle( SCROW nRow ) const;
- const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, sal_Bool& rFound ) const;
- const ScStyleSheet* GetAreaStyle( sal_Bool& rFound, SCROW nRow1, SCROW nRow2 ) const;
+ const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, bool& rFound ) const;
+ const ScStyleSheet* GetAreaStyle( bool& rFound, SCROW nRow1, SCROW nRow2 ) const;
void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
- sal_Bool IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const;
+ bool IsStyleSheetUsed( const ScStyleSheet& rStyle, bool bGatherAllStyles ) const;
/// May return -1 if not found
SCsROW SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle,
- sal_Bool bUp, sal_Bool bInSelection, const ScMarkData& rMark );
- sal_Bool SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyleSheet* pSearchStyle,
- sal_Bool bUp, sal_Bool bInSelection, const ScMarkData& rMark );
+ bool bUp, bool bInSelection, const ScMarkData& rMark );
+ bool SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyleSheet* pSearchStyle,
+ bool bUp, bool bInSelection, const ScMarkData& rMark );
- sal_Bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags );
- sal_Bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags );
+ bool ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags );
+ bool RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags );
void ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich );
void RemoveProtected( SCROW nStartRow, SCROW nEndRow );
- SCsROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark );
+ SCsROW ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray = NULL );
void DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark );
void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark );
- void ChangeSelectionIndent( sal_Bool bIncrement, const ScMarkData& rMark );
+ void ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark );
long GetNeededSize( SCROW nRow, OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bWidth, const ScNeededSizeOptions& rOptions );
- sal_uInt16 GetOptimalColWidth( OutputDevice* pDev, double nPPTX, double nPPTY,
+ bool bWidth, const ScNeededSizeOptions& rOptions );
+ sal_uInt16 GetOptimalColWidth( OutputDevice* pDev, double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bFormula, sal_uInt16 nOldWidth,
+ bool bFormula, sal_uInt16 nOldWidth,
const ScMarkData* pMarkData,
- sal_Bool bSimpleTextImport );
+ const ScColWidthParam* pParam );
void GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHeight,
OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bShrink, sal_uInt16 nMinHeight, SCROW nMinStart );
+ bool bShrink, sal_uInt16 nMinHeight, SCROW nMinStart );
private:
long GetSimpleTextNeededSize( SCSIZE nIndex, OutputDevice* pDev,
- sal_Bool bWidth );
+ bool bWidth );
public:
/// Including current, may return -1
- SCsROW GetNextUnprotected( SCROW nRow, sal_Bool bUp ) const;
+ SCsROW GetNextUnprotected( SCROW nRow, bool bUp ) const;
void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates);
- sal_Bool GetDataEntries(SCROW nRow, TypedScStrCollection& rStrings, sal_Bool bLimit);
-
-//UNUSED2008-05 SCROW NoteCount( SCROW nMaxRow = MAXROW ) const;
+ bool GetDataEntries(SCROW nRow, TypedScStrCollection& rStrings, bool bLimit);
void UpdateInsertTabAbs(SCTAB nNewPos);
- sal_Bool TestTabRefAbs(SCTAB nTable);
- sal_Bool GetNextSpellingCell(SCROW& nRow, sal_Bool bInSel, const ScMarkData& rData) const;
+ bool TestTabRefAbs(SCTAB nTable);
+ bool GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& rData) const;
void RemoveAutoSpellObj();
@@ -386,12 +395,12 @@ public:
void EndListening( SvtListener& rLst, SCROW nRow );
void MoveListeners( SvtBroadcaster& rSource, SCROW nDestRow );
void StartAllListeners();
- void StartNeededListeners(); // only for cells where NeedsListening()==TRUE
+ void StartNeededListeners(); // only for cells where NeedsListening()==true
void SetRelNameDirty();
void CompileDBFormula();
- void CompileDBFormula( sal_Bool bCreateFormulaString );
- void CompileNameFormula( sal_Bool bCreateFormulaString );
+ void CompileDBFormula( bool bCreateFormulaString );
+ void CompileNameFormula( bool bCreateFormulaString );
void CompileColRowNameFormula();
sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const;
@@ -400,44 +409,44 @@ public:
private:
ScBaseCell* CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rDestDoc, const ScAddress& rDestPos);
-//UNUSED2008-05 void CorrectSymbolCells( CharSet eStreamCharSet );
};
-class ScColumnIterator // alle Daten eines Bereichs durchgehen
+class ScColumnIterator // walk through all data of a area/range
{
- const ScColumn* pColumn;
- SCSIZE nPos;
+ const ScColumn* pColumn;
+ SCSIZE nPos;
SCROW nTop;
SCROW nBottom;
public:
ScColumnIterator( const ScColumn* pCol, SCROW nStart=0, SCROW nEnd=MAXROW );
~ScColumnIterator();
- sal_Bool Next( SCROW& rRow, ScBaseCell*& rpCell );
+ bool Next( SCROW& rRow, ScBaseCell*& rpCell );
SCSIZE GetIndex() const;
};
-class ScMarkedDataIter // Daten in selektierten Bereichen durchgehen
+class ScMarkedDataIter // walk through data in a selected area/range
{
- const ScColumn* pColumn;
- SCSIZE nPos;
+ const ScColumn* pColumn;
+ SCSIZE nPos;
ScMarkArrayIter* pMarkIter;
SCROW nTop;
SCROW nBottom;
- sal_Bool bNext;
- sal_Bool bAll;
+ bool bNext;
+ bool bAll;
public:
ScMarkedDataIter( const ScColumn* pCol, const ScMarkData* pMarkData,
- sal_Bool bAllIfNone = sal_False );
+ bool bAllIfNone = false );
~ScMarkedDataIter();
- sal_Bool Next( SCSIZE& rIndex );
+ bool Next( SCSIZE& rIndex );
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 27845bbc50cf..5e53f3fef8db 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,6 @@
#include "global.hxx"
#include "refdata.hxx"
#include "formula/token.hxx"
-#include "formula/intruref.hxx"
#include "formula/grammar.hxx"
#include <unotools/charclass.hxx>
#include <rtl/ustrbuf.hxx>
@@ -46,13 +46,10 @@
#include <formula/FormulaCompiler.hxx>
-
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
-#include <boost/shared_ptr.hpp>
-#endif
+#include <boost/intrusive_ptr.hpp>
#ifndef INCLUDED_HASH_MAP
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#define INCLUDED_HASH_MAP
#endif
@@ -102,19 +99,17 @@ class ScTokenArray;
// constants and data types internal to compiler
-#if 0
/*
OpCode eOp; // OpCode
formula::StackVar eType; // type of data
sal_uInt16 nRefCnt; // reference count
sal_Bool bRaw; // not cloned yet and trimmed to real size
*/
-#endif
#define SC_TOKEN_FIX_MEMBERS \
OpCode eOp; \
formula::StackVar eType; \
- sal_uInt16 nRefCnt; \
+ mutable sal_uInt16 nRefCnt; \
sal_Bool bRaw;
struct ScDoubleRawToken
@@ -186,12 +181,8 @@ public:
void SetSingleReference( const ScSingleRefData& rRef );
void SetDoubleReference( const ScComplexRefData& rRef );
void SetDouble( double fVal );
-//UNUSED2008-05 void SetInt( int nVal );
-//UNUSED2008-05 void SetMatrix( ScMatrix* p );
// These methods are ok to use, reference count not cleared.
-//UNUSED2008-05 ScComplexRefData& GetReference();
-//UNUSED2008-05 void SetReference( ScComplexRefData& rRef );
void SetName( sal_uInt16 n );
void SetExternalSingleRef( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef );
void SetExternalDoubleRef( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef );
@@ -210,8 +201,17 @@ public:
{ return GetStrLenBytes( GetStrLen( pStr ) ); }
};
+inline void intrusive_ptr_add_ref(ScRawToken* p)
+{
+ p->IncRef();
+}
+
+inline void intrusive_ptr_release(ScRawToken* p)
+{
+ p->DecRef();
+}
-typedef formula::SimpleIntrusiveReference< struct ScRawToken > ScRawTokenRef;
+typedef ::boost::intrusive_ptr<ScRawToken> ScRawTokenRef;
class SC_DLLPUBLIC ScCompiler : public formula::FormulaCompiler
{
@@ -227,8 +227,6 @@ public:
struct Convention
{
const formula::FormulaGrammar::AddressConvention meConv;
- const sal_uLong* mpCharTable;
-
Convention( formula::FormulaGrammar::AddressConvention eConvP );
virtual ~Convention();
@@ -278,6 +276,11 @@ public:
ABS_SHEET_PREFIX
};
virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const = 0;
+
+ virtual sal_uLong getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const = 0;
+
+ protected:
+ const sal_uLong* mpCharTable;
};
friend struct Convention;
@@ -381,7 +384,6 @@ public:
void SetGrammar( const formula::FormulaGrammar::Grammar eGrammar );
- void SetEncodeUrlMode( EncodeUrlMode eMode );
EncodeUrlMode GetEncodeUrlMode() const;
private:
/** Set grammar and reference convention from within SetFormulaLanguage()
@@ -426,12 +428,12 @@ public:
sal_Bool UpdateNameReference( UpdateRefMode eUpdateRefMode,
const ScRange&,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
- sal_Bool& rChanged, sal_Bool bSharedFormula = sal_False);
+ sal_Bool& rChanged, sal_Bool bSharedFormula = false);
ScRangeData* UpdateReference( UpdateRefMode eUpdateRefMode,
const ScAddress& rOldPos, const ScRange&,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
- sal_Bool& rChanged, sal_Bool& rRefSizeChanged );
+ bool& rChanged, bool& rRefSizeChanged );
/// Only once for converted shared formulas,
/// token array has to be compiled afterwards.
@@ -452,11 +454,12 @@ public:
const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
{
sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
if (c < 128)
{
return pConventions[eConv] ? static_cast<sal_Bool>(
- (pConventions[eConv]->mpCharTable[ sal_uInt8(c) ] & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) :
- sal_False; // no convention => assume invalid
+ (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) :
+ false; // no convention => assume invalid
}
else
return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
@@ -469,11 +472,12 @@ public:
const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
{
sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
if (c < 128)
{
return pConventions[eConv] ? static_cast<sal_Bool>(
- (pConventions[eConv]->mpCharTable[ sal_uInt8(c) ] & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) :
- sal_False; // convention not known => assume invalid
+ (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) :
+ false; // convention not known => assume invalid
}
else
return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
@@ -489,13 +493,14 @@ public:
bool bTestLetterNumeric = true )
{
sal_Unicode c = rStr.GetChar( nPos );
+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar( nPos-1 ) : 0;
if (c < 128)
{
for ( int nConv = formula::FormulaGrammar::CONV_UNSPECIFIED;
++nConv < formula::FormulaGrammar::CONV_LAST; )
{
if (pConventions[nConv] &&
- ((pConventions[nConv]->mpCharTable[ sal_uInt8(c) ] & nFlags) != nFlags))
+ ((pConventions[nConv]->getCharTableFlags(c, cLast) & nFlags) != nFlags))
return false;
// convention not known => assume valid
}
@@ -530,10 +535,10 @@ private:
virtual sal_Bool IsImportingXML() const;
/// Access the CharTable flags
- inline sal_uLong GetCharTableFlags( sal_Unicode c )
- { return c < 128 ? pConv->mpCharTable[ sal_uInt8(c) ] : 0; }
+ inline sal_uLong GetCharTableFlags( sal_Unicode c, sal_Unicode cLast )
+ { return c < 128 ? pConv->getCharTableFlags(c, cLast) : 0; }
};
-SC_DLLPUBLIC String GetScCompilerNativeSymbol( OpCode eOp ); //CHINA001
-
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/compressedarray.hxx b/sc/inc/compressedarray.hxx
index ba7a351a3c49..c07eb43c0658 100644
--- a/sc/inc/compressedarray.hxx
+++ b/sc/inc/compressedarray.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -88,23 +89,11 @@ public:
/** Get value for a row, and it's region end row */
const D& GetValue( A nPos, size_t& nIndex, A& nEnd ) const;
- /** Get value for a row, and it's region start row and end row */
- const D& GetValue( A nPos, size_t& nIndex, A& nStart, A& nEnd ) const;
-
/** Get next value and it's region end row. If nIndex<nCount, nIndex is
incremented first. If the resulting nIndex>=nCount, the value of the
last entry is returned again. */
const D& GetNextValue( size_t& nIndex, A& nEnd ) const;
- /** Get previous value and it's region start row. If nIndex==0, nIndex is
- not decremented and the value of the first entry is returned again. */
- const D& GetPrevValue( size_t& nIndex, A& nStart ) const;
-
- /** Return the last row where an entry meets the condition:
- (aValue != rCompare). If no entry meets this condition
- ::std::numeric_limits<A>::max() is returned. */
- A GetLastUnequalAccess( A nStart, const D& rCompare );
-
/** Insert rows before nStart and copy value for inserted rows from
nStart-1, return that value. */
const D& Insert( A nStart, size_t nCount );
@@ -121,8 +110,6 @@ public:
SC_DLLPUBLIC size_t Search( A nPos ) const;
/** Get number of entries */
size_t GetEntryCount() const;
- /** Get data entry for an index */
- const DataEntry& GetDataEntry( size_t nIndex ) const;
protected:
@@ -175,17 +162,6 @@ const D& ScCompressedArray<A,D>::GetValue( A nPos, size_t& nIndex, A& nEnd ) con
template< typename A, typename D >
-const D& ScCompressedArray<A,D>::GetValue( A nPos, size_t& nIndex, A& nStart,
- A& nEnd ) const
-{
- nIndex = Search( nPos);
- nStart = (nIndex > 0 ? pData[nIndex-1].nEnd + 1 : 0);
- nEnd = pData[nIndex].nEnd;
- return pData[nIndex].aValue;
-}
-
-
-template< typename A, typename D >
const D& ScCompressedArray<A,D>::GetNextValue( size_t& nIndex, A& nEnd ) const
{
if (nIndex < nCount)
@@ -197,30 +173,12 @@ const D& ScCompressedArray<A,D>::GetNextValue( size_t& nIndex, A& nEnd ) const
template< typename A, typename D >
-const D& ScCompressedArray<A,D>::GetPrevValue( size_t& nIndex, A& nStart ) const
-{
- if (nIndex > 0)
- --nIndex;
- nStart = (nIndex > 0 ? pData[nIndex-1].nEnd + 1 : 0);
- return pData[nIndex].aValue;
-}
-
-
-template< typename A, typename D >
size_t ScCompressedArray<A,D>::GetEntryCount() const
{
return nCount;
}
-template< typename A, typename D >
-const typename ScCompressedArray<A,D>::DataEntry&
-ScCompressedArray<A,D>::GetDataEntry( size_t nIndex ) const
-{
- return pData[nIndex];
-}
-
-
// === ScCompressedArrayIterator =============================================
/** Iterator for ScCompressedArray.
@@ -391,51 +349,6 @@ void ScCompressedArrayIterator<A,D>::Resync( A nPos )
}
-// === ScSummableCompressedArray =============================================
-
-/** Data type D must be of a type that is convertable to unsigned long. The
- advantage is that specialized methods exist to act on a region of values
- for performance reasons.
- */
-
-template< typename A, typename D > class ScSummableCompressedArray : public ScCompressedArray<A,D>
-{
-public:
- ScSummableCompressedArray( A nMaxAccessP,
- const D& rValue,
- size_t nDeltaP = nScCompressedArrayDelta )
- : ScCompressedArray<A,D>( nMaxAccessP,
- rValue, nDeltaP)
- {}
- ScSummableCompressedArray( A nMaxAccessP,
- const D* pDataArray, size_t nDataCount )
- : ScCompressedArray<A,D>( nMaxAccessP,
- pDataArray, nDataCount)
- {}
-
- /** Returns the sum of all values for a region. If an overflow would occur,
- ::std::numeric_limits<unsigned long>::max() is returned. */
- unsigned long SumValues( A nStart, A nEnd ) const;
-
- /** Returns the sum of all values for a region. If an overflow would occur,
- ::std::numeric_limits<unsigned long>::max() is returned.
- The caller has to assure that nIndex matches an entry belonging to
- nStart, for example, by calling Search(nStart) first! */
- unsigned long SumValuesContinuation( A nStart, A nEnd,
- size_t& nIndex ) const;
-
- /** Returns the sum of all scaled values for a region. If an overflow would
- occur, ::std::numeric_limits<unsigned long>::max() is returned.
- Summed values are treated as if for each row the expression
- (sum += (unsigned long) (scale * value)) had been applied.
- The caller has to assure that nIndex matches an entry belonging to
- nStart, for example, by calling Search(nStart) first! */
- unsigned long SumScaledValuesContinuation( A nStart, A nEnd,
- size_t& nIndex, double fScale ) const;
-
-};
-
-
// === ScBitMaskCompressedArray ==============================================
/** The data type represents bits, managable by bitwise operations.
@@ -465,24 +378,6 @@ public:
A nStart, A nEnd, const D& rValueToAnd,
long nSourceDy = 0 );
- /** Copy values from rArray and bitwise OR them with rValueToOr. */
- void CopyFromOred(
- const ScBitMaskCompressedArray& rArray,
- A nStart, A nEnd, const D& rValueToOr,
- long nSourceDy = 0 );
-
- /** Return the start row of a region where all entries meet the condition:
- ((aValue & rBitMask) == rMaskedCompare). If not even nEnd meets
- this condition, ::std::numeric_limits<A>::max() is returned. */
- A GetBitStateStart( A nEnd, const D& rBitMask,
- const D& rMaskedCompare ) const;
-
- /** Return the end row of a region where all entries meet the condition:
- ((aValue & rBitMask) == rMaskedCompare). If not even nStart meets
- this condition, ::std::numeric_limits<A>::max() is returned. */
- A GetBitStateEnd( A nStart, const D& rBitMask,
- const D& rMaskedCompare ) const;
-
/** Return the first row where an entry meets the condition:
((aValue & rBitMask) == rMaskedCompare), searching between nStart and
nEnd. If no entry meets this condition, ::std::numeric_limits<A>::max()
@@ -492,58 +387,10 @@ public:
const D& rMaskedCompare ) const;
/** Return the last row where an entry meets the condition:
- ((aValue & rBitMask) == rMaskedCompare), searching between nStart and
- nEnd. If no entry meets this condition, ::std::numeric_limits<A>::max()
- is returned. */
- SC_DLLPUBLIC A GetLastForCondition( A nStart, A nEnd,
- const D& rBitMask,
- const D& rMaskedCompare ) const;
-
- /** Count rows between nStart and nEnd where entries meet the condition:
- ((aValue & rBitMask) == rMaskedCompare) */
- A CountForCondition( A nStart, A nEnd,
- const D& rBitMask,
- const D& rMaskedCompare ) const;
-
- /** Whether there is any entry between nStart and nEnd where the condition
- is met: ((aValue & rBitMask) == rMaskedCompare) */
- SC_DLLPUBLIC bool HasCondition( A nStart, A nEnd,
- const D& rBitMask,
- const D& rMaskedCompare ) const;
-
- /** Fill an array with row numbers between nStart and nEnd where entries
- meet the condition: ((aValue & rBitMask) == rMaskedCompare).
- @return the count of used elements in array. */
- size_t FillArrayForCondition( A nStart, A nEnd,
- const D& rBitMask,
- const D& rMaskedCompare,
- A * pArray, size_t nArraySize ) const;
-
- /** Count rows between nStart and nEnd where entries meet the condition:
- ((aValue & rBitMask) != 0) */
- A CountForAnyBitCondition( A nStart, A nEnd,
- const D& rBitMask ) const;
-
- /** Return the last row where an entry meets the condition:
((aValue & rBitMask) != 0), start searching at nStart. If no entry
meets this condition, ::std::numeric_limits<A>::max() is returned. */
A GetLastAnyBitAccess( A nStart,
const D& rBitMask ) const;
-
- /** Sum values of a ScSummableCompressedArray for each row where in *this*
- array the condition is met: ((aValue & rBitMask) == rMaskedCompare). */
- template< typename S >
- SC_DLLPUBLIC unsigned long SumCoupledArrayForCondition( A nStart, A nEnd,
- const D& rBitMask, const D& rMaskedCompare,
- const ScSummableCompressedArray<A,S>& rArray ) const;
-
- /** Sum scaled values of a ScSummableCompressedArray for each row where in
- *this* array the condition is met: ((aValue & rBitMask) == rMaskedCompare). */
- template< typename S >
- SC_DLLPUBLIC unsigned long SumScaledCoupledArrayForCondition( A nStart, A nEnd,
- const D& rBitMask, const D& rMaskedCompare,
- const ScSummableCompressedArray<A,S>& rArray,
- double fScale ) const;
};
@@ -565,105 +412,6 @@ void ScBitMaskCompressedArray<A,D>::OrValue( A nPos, const D& rValueToOr )
}
-// === ScCoupledCompressedArrayIterator ======================================
-
-/** Iterate over a ScBitMaskCompressedArray and retrieve values from a coupled
- array for positions where in the bit mask array the condition ((*aIter1 &
- rBitMask) == rMaskedCompare) is met.
- */
-
-template< typename A, typename D, typename S > class ScCoupledCompressedArrayIterator
-{
-public:
- SC_DLLPUBLIC ScCoupledCompressedArrayIterator(
- const ScBitMaskCompressedArray<A,D> & rArray1,
- A nStart, A nEnd,
- const D& rBitMask,
- const D& rMaskedCompare,
- const ScCompressedArray<A,S> & rArray2 );
- void NewLimits( A nStart, A nEnd );
- A GetIterStart() const;
- A GetIterEnd() const;
- bool operator ++();
- A GetPos() const;
- operator bool() const;
- const S& operator *() const;
- SC_DLLPUBLIC bool NextRange();
- A GetRangeStart() const;
- A GetRangeEnd() const;
- void Resync( A nPos );
-
-private:
- ScCompressedArrayIterator<A,D> aIter1;
- ScCompressedArrayIterator<A,S> aIter2;
- const D& rBitMask;
- const D& rMaskedCompare;
-
- void InitLimits();
-};
-
-
-template< typename A, typename D, typename S >
-A ScCoupledCompressedArrayIterator<A,D,S>::GetIterStart() const
-{
- return aIter1.GetIterStart();
-}
-
-
-template< typename A, typename D, typename S >
-A ScCoupledCompressedArrayIterator<A,D,S>::GetIterEnd() const
-{
- return aIter1.GetIterEnd();
-}
-
-
-template< typename A, typename D, typename S >
-ScCoupledCompressedArrayIterator<A,D,S>::operator bool() const
-{
- return aIter1 && aIter2;
-}
-
-
-template< typename A, typename D, typename S >
-const S& ScCoupledCompressedArrayIterator<A,D,S>::operator*() const
-{
- return *aIter2;
-}
-
-
-template< typename A, typename D, typename S >
-bool ScCoupledCompressedArrayIterator<A,D,S>::operator ++()
-{
- if (aIter1.GetPos() < aIter1.GetRangeEnd())
- {
- ++aIter1;
- ++aIter2;
- return operator bool();
- }
- else
- return NextRange();
-}
-
-
-template< typename A, typename D, typename S >
-A ScCoupledCompressedArrayIterator<A,D,S>::GetPos() const
-{
- return aIter2.GetPos();
-}
-
-
-template< typename A, typename D, typename S >
-A ScCoupledCompressedArrayIterator<A,D,S>::GetRangeStart() const
-{
- return ::std::max( aIter1.GetRangeStart(), aIter2.GetRangeStart());
-}
-
-
-template< typename A, typename D, typename S >
-A ScCoupledCompressedArrayIterator<A,D,S>::GetRangeEnd() const
-{
- return ::std::min( aIter1.GetRangeEnd(), aIter2.GetRangeEnd());
-}
-
-
#endif // SC_COMPRESSEDARRAY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 672f1dca688b..f541e247e7d8 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,11 +34,11 @@
#include "formula/grammar.hxx"
#include <svl/svarray.hxx>
#include "scdllapi.h"
+#include "rangelst.hxx"
class ScBaseCell;
class ScFormulaCell;
class ScTokenArray;
-class ScRangeList;
#define SC_COND_GROW 16
@@ -46,8 +47,8 @@ class ScRangeList;
#define SC_COND_NOBLANKS 1
- // Reihenfolge von ScConditionMode wie ScQueryOp,
- // damit einmal zusammengefasst werden kann:
+// ordering of ScConditionMode and ScQueryOp is equal,
+// to facilitate the merging of both in the future
enum ScConditionMode
{
@@ -59,6 +60,8 @@ enum ScConditionMode
SC_COND_NOTEQUAL,
SC_COND_BETWEEN,
SC_COND_NOTBETWEEN,
+ SC_COND_DUPLICATE,
+ SC_COND_NOTDUPLICATE,
SC_COND_DIRECT,
SC_COND_NONE
};
@@ -70,22 +73,24 @@ enum ScConditionValType
SC_VAL_FORMULA
};
+class ScConditionalFormat;
+
class SC_DLLPUBLIC ScConditionEntry
{
- // gespeicherte Daten:
+ // stored data:
ScConditionMode eOp;
sal_uInt16 nOptions;
- double nVal1; // eingegeben oder berechnet
+ double nVal1; // input or calculated
double nVal2;
- String aStrVal1; // eingegeben oder berechnet
+ String aStrVal1; // input or calculated
String aStrVal2;
String aStrNmsp1; // namespace to be used on (re)compilation, e.g. in XML import
String aStrNmsp2; // namespace to be used on (re)compilation, e.g. in XML import
formula::FormulaGrammar::Grammar eTempGrammar1; // grammar to be used on (re)compilation, e.g. in XML import
formula::FormulaGrammar::Grammar eTempGrammar2; // grammar to be used on (re)compilation, e.g. in XML import
- sal_Bool bIsStr1; // um auch leere Strings zu erkennen
+ sal_Bool bIsStr1; // for recognition of empty strings
sal_Bool bIsStr2;
- ScTokenArray* pFormula1; // eingegebene Formel
+ ScTokenArray* pFormula1; // entered formula
ScTokenArray* pFormula2;
ScAddress aSrcPos; // source position for formulas
// temporary data:
@@ -105,8 +110,8 @@ class SC_DLLPUBLIC ScConditionEntry
sal_Bool bTextToReal );
void Interpret( const ScAddress& rPos );
- sal_Bool IsValid( double nArg ) const;
- sal_Bool IsValidStr( const String& rArg ) const;
+ sal_Bool IsValid( double nArg, const ScAddress& rAddr ) const;
+ sal_Bool IsValidStr( const String& rArg, const ScAddress& rAddr ) const;
public:
ScConditionEntry( ScConditionMode eOper,
@@ -118,13 +123,15 @@ public:
ScConditionEntry( ScConditionMode eOper,
const ScTokenArray* pArr1, const ScTokenArray* pArr2,
ScDocument* pDocument, const ScAddress& rPos );
- ScConditionEntry( const ScConditionEntry& r ); // flache Kopie der Formeln
- // echte Kopie der Formeln (fuer Ref-Undo):
+ ScConditionEntry( const ScConditionEntry& r ); // flat copy of formulas
+ // true copy of formulas (for Ref-Undo):
ScConditionEntry( ScDocument* pDocument, const ScConditionEntry& r );
virtual ~ScConditionEntry();
int operator== ( const ScConditionEntry& r ) const;
+ void SetParent( ScConditionalFormat* pNew ) { pCondFormat = pNew; }
+
sal_Bool IsCellValid( ScBaseCell* pCell, const ScAddress& rPos ) const;
ScConditionMode GetOperation() const { return eOp; }
@@ -157,18 +164,16 @@ public:
protected:
virtual void DataChanged( const ScRange* pModified ) const;
ScDocument* GetDocument() const { return pDoc; }
+ ScConditionalFormat* pCondFormat;
};
//
-// einzelner Eintrag fuer bedingte Formatierung
+// single entry for conditional formatting
//
-class ScConditionalFormat;
-
class SC_DLLPUBLIC ScCondFormatEntry : public ScConditionEntry
{
String aStyleName;
- ScConditionalFormat* pParent;
using ScConditionEntry::operator==;
@@ -189,8 +194,6 @@ public:
ScCondFormatEntry( ScDocument* pDocument, const ScCondFormatEntry& r );
virtual ~ScCondFormatEntry();
- void SetParent( ScConditionalFormat* pNew ) { pParent = pNew; }
-
int operator== ( const ScCondFormatEntry& r ) const;
const String& GetStyle() const { return aStyleName; }
@@ -201,27 +204,30 @@ protected:
};
//
-// komplette bedingte Formatierung
+// complete conditional formatting
//
class SC_DLLPUBLIC ScConditionalFormat
{
ScDocument* pDoc;
- ScRangeList* pAreas; // Bereiche fuer Paint
- sal_uInt32 nKey; // Index in Attributen
+ ScRangeList* pAreas; // area for Paint
+ sal_uInt32 nKey; // Index in attributes
ScCondFormatEntry** ppEntries;
sal_uInt16 nEntryCount;
- sal_Bool bIsUsed; // temporaer beim Speichern
+ sal_Bool bIsUsed; // temporary at Save
+ ScRangeListRef pRanges; // Ranges for conditional format
public:
ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument);
ScConditionalFormat(const ScConditionalFormat& r);
~ScConditionalFormat();
- // echte Kopie der Formeln (fuer Ref-Undo / zwischen Dokumenten)
+ // true copy of formulas (for Ref-Undo / between documents)
ScConditionalFormat* Clone(ScDocument* pNewDoc = NULL) const;
void AddEntry( const ScCondFormatEntry& rNew );
+ void AddRangeInfo( const ScRangeListRef& rRanges );
+ const ScRangeListRef& GetRangeInfo() const { return pRanges; }
sal_Bool IsEmpty() const { return (nEntryCount == 0); }
sal_uInt16 Count() const { return nEntryCount; }
@@ -245,21 +251,21 @@ public:
void InvalidateArea();
sal_uInt32 GetKey() const { return nKey; }
- void SetKey(sal_uInt32 nNew) { nKey = nNew; } // nur wenn nicht eingefuegt!
+ void SetKey(sal_uInt32 nNew) { nKey = nNew; } // only if not inserted!
void SetUsed(sal_Bool bSet) { bIsUsed = bSet; }
sal_Bool IsUsed() const { return bIsUsed; }
bool MarkUsedExternalReferences() const;
- // sortiert (per PTRARR) nach Index
- // operator== nur fuer die Sortierung
+ // sorted (via PTRARR) by Index
+ // operator== only for sorting
sal_Bool operator ==( const ScConditionalFormat& r ) const { return nKey == r.nKey; }
sal_Bool operator < ( const ScConditionalFormat& r ) const { return nKey < r.nKey; }
};
//
-// Liste der Bereiche und Formate:
+// List of areas and formats:
//
typedef ScConditionalFormat* ScConditionalFormatPtr;
@@ -293,9 +299,10 @@ public:
* references are marked now. */
bool MarkUsedExternalReferences() const;
- sal_Bool operator==( const ScConditionalFormatList& r ) const; // fuer Ref-Undo
+ sal_Bool operator==( const ScConditionalFormatList& r ) const; // for Ref-Undo
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/confuno.hxx b/sc/inc/confuno.hxx
index bd74406eb37a..2fa22ad4dcf2 100644
--- a/sc/inc/confuno.hxx
+++ b/sc/inc/confuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,3 +106,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/consoli.hxx b/sc/inc/consoli.hxx
index 866c2c1ec3d7..67e7e1346c7c 100644
--- a/sc/inc/consoli.hxx
+++ b/sc/inc/consoli.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@ class ScDocument;
// -----------------------------------------------------------------------
-struct ScReferenceEntry // ohne Constructor !
+struct ScReferenceEntry // without constructor !
{
SCCOL nCol;
SCROW nRow;
@@ -43,13 +44,13 @@ struct ScReferenceEntry // ohne Constructor !
};
-//! Delta-Wert fuer Daten benutzen?
+//! Use delta value for data?
-class ScReferenceList // ohne Constructor !
+class ScReferenceList // without constructor !
{
private:
SCSIZE nCount;
- SCSIZE nFullSize; // inkl. Fuell-Eintraege
+ SCSIZE nFullSize; // incl. fill entries
ScReferenceEntry* pData;
public:
@@ -67,18 +68,17 @@ public:
//
-// Reihenfolge:
-// 1) ScConsData anlegen
+// Sequence:
+// 1) create ScConsData
// 2) Parameter (Size/Flags)
-// 3) AddFields fuer alle Bereiche (nur noetig bei bColByName oder bRowByName)
-// 4) DoneFields ( " " )
-// 5) AddData fuer alle Bereiche
-// evtl. AddName nach jedem Bereich
+// 3) AddFields for all areas (only needed for bColByName or bRowByName)
+// 4) DoneFields ( " " )
+// 5) AddData for all areas
+// perhaps AddName after each area
// 6) OutputToDocument
//
-//! ab bestimmter Groesse ScDocument Struktur benutzen?
-
+//! Use structure ScDocument if a certain size is exceeded?
class ScConsData
{
@@ -102,7 +102,7 @@ private:
String** ppTitles;
SCSIZE** ppTitlePos;
sal_Bool bCornerUsed;
- String aCornerText; // nur bei bColByName && bRowByName
+ String aCornerText; // only for bColByName && bRowByName
public:
ScConsData();
@@ -132,3 +132,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/convuno.hxx b/sc/inc/convuno.hxx
index 0f93d6d6de0d..87c36aa95c82 100644
--- a/sc/inc/convuno.hxx
+++ b/sc/inc/convuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -216,3 +217,4 @@ inline sal_Bool operator!=(
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/cursuno.hxx b/sc/inc/cursuno.hxx
index 470f4e3c6f5c..e4602a1da4f9 100644
--- a/sc/inc/cursuno.hxx
+++ b/sc/inc/cursuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,3 +109,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index e11066a8d8b6..b2cc850ea37e 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -989,3 +990,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx
index 43c26b9fdb0d..b15397dbb0ce 100644
--- a/sc/inc/datauno.hxx
+++ b/sc/inc/datauno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,7 +78,7 @@ public:
};
-// ImportDescriptor gibt's nicht mehr als Uno-Objekt, nur noch Property-Sequence
+// ImportDescriptor is not available as Uno-Objekt any longer, only Property-Sequence
class ScImportDescriptor
{
@@ -91,7 +92,7 @@ public:
static long GetPropertyCount();
};
-// SortDescriptor gibt's nicht mehr als Uno-Objekt, nur noch Property-Sequence
+// SortDescriptor is not available as Uno-Objekt any longer, only Property-Sequence
class ScSortDescriptor
{
@@ -106,7 +107,7 @@ public:
};
-// ScSubTotalDescriptorBase - Basisklasse fuer SubTotalDescriptor alleine und im DB-Bereich
+// ScSubTotalDescriptorBase - base class for SubTotalDescriptor stand alone and in DB area (context?)
// to uno, both look the same
@@ -215,7 +216,7 @@ public:
};
-// ScSubTotalDescriptor - dummer Container zur Benutzung mit XImportTarget
+// ScSubTotalDescriptor - dummy container to use with XImportTarget
class ScSubTotalDescriptor : public ScSubTotalDescriptorBase
{
@@ -226,17 +227,16 @@ public:
ScSubTotalDescriptor();
virtual ~ScSubTotalDescriptor();
- // von ScSubTotalDescriptorBase:
+ // from ScSubTotalDescriptorBase:
virtual void GetData( ScSubTotalParam& rParam ) const;
virtual void PutData( const ScSubTotalParam& rParam );
- // Zugriff von aussen:
+ // external access:
void SetParam( const ScSubTotalParam& rNew );
-// const ScSubTotalParam& GetParam() const { return aStoredParam; }
};
-// ScRangeSubTotalDescriptor - SubTotalDescriptor eines Datenbank-Bereichs
+// ScRangeSubTotalDescriptor - SubTotalDescriptor of a data base area
class ScRangeSubTotalDescriptor : public ScSubTotalDescriptorBase
{
@@ -247,7 +247,7 @@ public:
ScRangeSubTotalDescriptor(ScDatabaseRangeObj* pPar);
virtual ~ScRangeSubTotalDescriptor();
- // von ScSubTotalDescriptorBase:
+ // from ScSubTotalDescriptorBase:
virtual void GetData( ScSubTotalParam& rParam ) const;
virtual void PutData( const ScSubTotalParam& rParam );
};
@@ -335,8 +335,8 @@ public:
};
-// ScFilterDescriptorBase - Basisklasse fuer FilterDescriptor
-// alleine, im DB-Bereich und im DataPilot
+// ScFilterDescriptorBase - base class for FilterDescriptor
+// stand alone, in a DB area (or context?) and in the DataPilot
// to uno, all three look the same
@@ -357,8 +357,8 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- // in den Ableitungen:
- // (nField[] hier innerhalb des Bereichs)
+ // in the derived classes(?):
+ // (nField[] here within the area)
virtual void GetData( ScQueryParam& rParam ) const = 0;
virtual void PutData( const ScQueryParam& rParam ) = 0;
@@ -427,28 +427,28 @@ public:
};
-// ScFilterDescriptor - dummer Container zur Benutzung mit XFilterable
+// ScFilterDescriptor - dummy container to use with XFilterable
class ScFilterDescriptor : public ScFilterDescriptorBase
{
private:
- ScQueryParam aStoredParam; // nField[] hier innerhalb des Bereichs
+ ScQueryParam aStoredParam; // nField[] here within the area
public:
ScFilterDescriptor(ScDocShell* pDocSh);
virtual ~ScFilterDescriptor();
- // von ScFilterDescriptorBase:
+ // from ScFilterDescriptorBase:
virtual void GetData( ScQueryParam& rParam ) const;
virtual void PutData( const ScQueryParam& rParam );
- // Zugriff von aussen:
+ // external access:
void SetParam( const ScQueryParam& rNew );
const ScQueryParam& GetParam() const { return aStoredParam; }
};
-// ScRangeFilterDescriptor - FilterDescriptor eines Datenbank-Bereichs
+// ScRangeFilterDescriptor - FilterDescriptor of a data base area
class ScRangeFilterDescriptor : public ScFilterDescriptorBase
{
@@ -459,13 +459,13 @@ public:
ScRangeFilterDescriptor(ScDocShell* pDocSh, ScDatabaseRangeObj* pPar);
virtual ~ScRangeFilterDescriptor();
- // von ScFilterDescriptorBase:
+ // from ScFilterDescriptorBase:
virtual void GetData( ScQueryParam& rParam ) const;
virtual void PutData( const ScQueryParam& rParam );
};
-// ScDataPilotFilterDescriptor - FilterDescriptor eines DataPilotDescriptors
+// ScDataPilotFilterDescriptor - FilterDescriptor of a DataPilotDescriptors
class ScDataPilotFilterDescriptor : public ScFilterDescriptorBase
{
@@ -476,7 +476,7 @@ public:
ScDataPilotFilterDescriptor(ScDocShell* pDocSh, ScDataPilotDescriptorBase* pPar);
virtual ~ScDataPilotFilterDescriptor();
- // von ScFilterDescriptorBase:
+ // from ScFilterDescriptorBase:
virtual void GetData( ScQueryParam& rParam ) const;
virtual void PutData( const ScQueryParam& rParam );
};
@@ -507,7 +507,7 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- // nField[] hier innerhalb des Bereichs:
+ // nField[] here within the area:
void GetQueryParam(ScQueryParam& rQueryParam) const;
void SetQueryParam(const ScQueryParam& rQueryParam);
void GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const;
@@ -531,8 +531,6 @@ public:
getSubTotalDescriptor() throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
getImportDescriptor() throw(::com::sun::star::uno::RuntimeException);
-// implemented for the XRefreshable Interface
-// virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException);
// XRefreshable
virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException);
@@ -663,3 +661,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx
index 2398a142ee4e..c3d4d21f8c0d 100644
--- a/sc/inc/dbcolect.hxx
+++ b/sc/inc/dbcolect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,7 @@ private:
sal_Bool bStripData;
// SortParam
sal_Bool bSortCaseSens;
+ sal_Bool bSortNaturalSort;
sal_Bool bIncludePattern;
sal_Bool bSortInplace;
sal_Bool bSortUserDef;
@@ -90,6 +92,7 @@ private:
ScQueryConnect eQueryConnect[MAXQUERY];
sal_Bool bIsAdvanced; // sal_True if created by advanced filter
ScRange aAdvSource; // source range
+ SCROW nDynamicEndRow;
// SubTotalParam
sal_Bool bSubRemoveOnly;
sal_Bool bSubReplace;
@@ -105,18 +108,18 @@ private:
SCCOL nSubTotals[MAXSUBTOTAL];
SCCOL* pSubTotals[MAXSUBTOTAL];
ScSubTotalFunc* pFunctions[MAXSUBTOTAL];
- // Datenbank-Import
+ // data base import
sal_Bool bDBImport;
String aDBName;
String aDBStatement;
sal_Bool bDBNative;
- sal_Bool bDBSelection; // nicht im Param: Wenn Selektion, Update sperren
- sal_Bool bDBSql; // aDBStatement ist SQL und kein Name
- sal_uInt8 nDBType; // enum DBObject (bisher nur dbTable, dbQuery)
+ sal_Bool bDBSelection; // not in Param: if selection, block update
+ sal_Bool bDBSql; // aDBStatement is SQL not a name
+ sal_uInt8 nDBType; // enum DBObject (up to now only dbTable, dbQuery)
- sal_uInt16 nIndex; // eindeutiger Index fuer Formeln
- sal_Bool bAutoFilter; // AutoFilter? (nicht gespeichert)
- sal_Bool bModified; // wird bei UpdateReference gesetzt/geloescht
+ sal_uInt16 nIndex; // unique index formulas
+ sal_Bool bAutoFilter; // AutoFilter? (not saved)
+ sal_Bool bModified; // is set/cleared for/by(?) UpdateReference
using ScRefreshTimer::operator==;
@@ -137,9 +140,10 @@ public:
const String& GetName() const { return aName; }
void GetName(String& rName) const { rName = aName; }
void SetName(const String& rName) { aName = rName; }
- void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const;
- SC_DLLPUBLIC void GetArea(ScRange& rRange) const;
+ void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, bool bUseDynamicRange = false) const;
+ SC_DLLPUBLIC void GetArea(ScRange& rRange, bool bUseDynamicRange = false) const;
void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+ void SetDynamicEndRow(SCROW nRow);
void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
sal_Bool IsByRow() const { return bByRow; }
void SetByRow(sal_Bool bByR) { bByRow = bByR; }
@@ -154,8 +158,6 @@ public:
sal_Bool IsStripData() const { return bStripData; }
void SetStripData(sal_Bool bSet) { bStripData = bSet; }
-//UNUSED2008-05 sal_Bool IsBeyond(SCROW nMaxRow) const;
-
String GetSourceString() const;
String GetOperations() const;
@@ -199,13 +201,13 @@ class SC_DLLPUBLIC ScDBCollection : public ScSortedCollection
private:
Link aRefreshHandler;
ScDocument* pDoc;
- sal_uInt16 nEntryIndex; // Zaehler fuer die eindeutigen Indizes
+ sal_uInt16 nEntryIndex; // counter for unique indices
public:
- ScDBCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False, ScDocument* pDocument = NULL) :
+ ScDBCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false, ScDocument* pDocument = NULL) :
ScSortedCollection ( nLim, nDel, bDup ),
pDoc ( pDocument ),
- nEntryIndex ( SC_START_INDEX_DB_COLL ) // oberhalb der Namen
+ nEntryIndex ( SC_START_INDEX_DB_COLL ) // see above for the names
{}
ScDBCollection(const ScDBCollection& rScDBCollection) :
ScSortedCollection ( rScDBCollection ),
@@ -240,3 +242,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dbdocutl.hxx b/sc/inc/dbdocutl.hxx
index 2a3f2500d170..26c0e5438f77 100644
--- a/sc/inc/dbdocutl.hxx
+++ b/sc/inc/dbdocutl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,11 +43,22 @@ namespace com { namespace sun { namespace star { namespace sdbc {
class ScDatabaseDocUtil
{
public:
+ /**
+ * Detailed information on single string value.
+ */
+ struct StrData
+ {
+ bool mbSimpleText;
+ sal_uInt32 mnStrLength;
+
+ StrData();
+ };
static void PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab,
const ::com::sun::star::uno::Reference<
::com::sun::star::sdbc::XRow>& xRow, long nRowPos,
- long nType, sal_Bool bCurrency, sal_Bool* pSimpleFlag = NULL );
+ long nType, sal_Bool bCurrency, StrData* pStrData = NULL );
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dbtoken.hxx b/sc/inc/dbtoken.hxx
index d19033e367e6..edca2e505016 100644
--- a/sc/inc/dbtoken.hxx
+++ b/sc/inc/dbtoken.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ formula::StackVar DbgInterpret( ScDocument* pDok, const ScTokenArray* pToken,
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/defltuno.hxx b/sc/inc/defltuno.hxx
index 5ef4f501061a..697180bbfaa1 100644
--- a/sc/inc/defltuno.hxx
+++ b/sc/inc/defltuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,3 +129,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/detdata.hxx b/sc/inc/detdata.hxx
index 42798af66bba..896ad021b395 100644
--- a/sc/inc/detdata.hxx
+++ b/sc/inc/detdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@ class ScDetOpList : public ScDetOpArr_Impl
sal_Bool bHasAddError; // updated in Append
public:
- ScDetOpList() : bHasAddError(sal_False) {}
+ ScDetOpList() : bHasAddError(false) {}
ScDetOpList(const ScDetOpList& rList);
~ScDetOpList() {}
@@ -104,3 +105,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx
index c13da22f7453..6509074dfc61 100644
--- a/sc/inc/detfunc.hxx
+++ b/sc/inc/detfunc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,9 @@
#include <tools/gen.hxx>
#include <tools/color.hxx>
#include "scdllapi.h"
+#include "token.hxx"
+
+#include <vector>
class SdrObject;
class SdrPage;
@@ -43,6 +47,7 @@ class ScDetectiveData;
class ScDocument;
class ScAddress;
class ScRange;
+class ScRangeList;
#define SC_DET_MAXCIRCLE 1000
@@ -144,6 +149,9 @@ public:
sal_Bool MarkInvalid(sal_Bool& rOverflow);
+ void GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector<ScTokenRef>& rRefTokens);
+ void GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector<ScTokenRef>& rRefTokens);
+
static void UpdateAllComments( ScDocument& rDoc ); // on all tables
void UpdateAllArrowColors(); // on all tables
@@ -164,3 +172,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dispuno.hxx b/sc/inc/dispuno.hxx
index 9526ed8ae3db..4b29605cfc3f 100644
--- a/sc/inc/dispuno.hxx
+++ b/sc/inc/dispuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -149,3 +150,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx
index e61d1f0281c8..1b3ef142e5b1 100644
--- a/sc/inc/dociter.hxx
+++ b/sc/inc/dociter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,8 @@
#include <memory>
#include <set>
+#include <vector>
+#include <boost/shared_ptr.hpp>
class ScDocument;
class ScBaseCell;
@@ -44,8 +47,9 @@ class ScPatternAttr;
class ScAttrArray;
class ScAttrIterator;
class ScRange;
+class ScFlatBoolRowSegments;
-class ScDocumentIterator // alle nichtleeren Zellen durchgehen
+class ScDocumentIterator // walk through all non-empty cells
{
private:
ScDocument* pDoc;
@@ -79,13 +83,13 @@ public:
void GetPos( SCCOL& rCol, SCROW& rRow, SCTAB& rTab );
};
-class ScValueIterator // alle Zahlenwerte in einem Bereich durchgehen
+class ScValueIterator // walk through all values in an area
{
private:
double fNextValue;
ScDocument* pDoc;
const ScAttrArray* pAttrArray;
- sal_uLong nNumFormat; // fuer CalcAsShown
+ sal_uLong nNumFormat; // for CalcAsShown
sal_uLong nNumFmtIndex;
SCCOL nStartCol;
SCROW nStartRow;
@@ -108,23 +112,19 @@ private:
sal_Bool GetThis(double& rValue, sal_uInt16& rErr);
public:
-//UNUSED2008-05 ScValueIterator(ScDocument* pDocument,
-//UNUSED2008-05 SCCOL nSCol, SCROW nSRow, SCTAB nSTab,
-//UNUSED2008-05 SCCOL nECol, SCROW nERow, SCTAB nETab,
-//UNUSED2008-05 sal_Bool bSTotal = sal_False, sal_Bool bTextAsZero = sal_False);
ScValueIterator(ScDocument* pDocument,
- const ScRange& rRange, sal_Bool bSTotal = sal_False,
- sal_Bool bTextAsZero = sal_False );
+ const ScRange& rRange, sal_Bool bSTotal = false,
+ sal_Bool bTextAsZero = false );
void GetCurNumFmtInfo( short& nType, sal_uLong& nIndex );
/// Does NOT reset rValue if no value found!
sal_Bool GetFirst(double& rValue, sal_uInt16& rErr);
/// Does NOT reset rValue if no value found!
sal_Bool GetNext(double& rValue, sal_uInt16& rErr)
{
- return bNextValid ? ( bNextValid = sal_False, rValue = fNextValue,
+ return bNextValid ? ( bNextValid = false, rValue = fNextValue,
rErr = 0, nRow = nNextRow,
- ++nColRow, bNumValid = sal_False, sal_True )
+ ++nColRow, bNumValid = false, sal_True )
: ( ++nRow, GetThis(rValue, rErr) );
}
};
@@ -218,9 +218,9 @@ public:
// ============================================================================
-class ScCellIterator // alle Zellen in einem Bereich durchgehen
-{ // bei SubTotal aber keine ausgeblendeten und
-private: // SubTotalZeilen
+class ScCellIterator // walk through all cells in an area
+{ // for SubTotal no hidden and no sub-total lines
+private:
ScDocument* pDoc;
SCCOL nStartCol;
SCROW nStartRow;
@@ -239,9 +239,9 @@ public:
ScCellIterator(ScDocument* pDocument,
SCCOL nSCol, SCROW nSRow, SCTAB nSTab,
SCCOL nECol, SCROW nERow, SCTAB nETab,
- sal_Bool bSTotal = sal_False);
+ sal_Bool bSTotal = false);
ScCellIterator(ScDocument* pDocument,
- const ScRange& rRange, sal_Bool bSTotal = sal_False);
+ const ScRange& rRange, sal_Bool bSTotal = false);
ScBaseCell* GetFirst();
ScBaseCell* GetNext();
SCCOL GetCol() const { return nCol; }
@@ -250,14 +250,14 @@ public:
ScAddress GetPos() const { return ScAddress( nCol, nRow, nTab ); }
};
-class ScQueryCellIterator // alle nichtleeren Zellen in einem Bereich
-{ // durchgehen
+class ScQueryCellIterator // walk through all non-empty cells in an area
+{
enum StopOnMismatchBits
{
nStopOnMismatchDisabled = 0x00,
nStopOnMismatchEnabled = 0x01,
- nStopOnMismatchOccured = 0x02,
- nStopOnMismatchExecuted = nStopOnMismatchEnabled | nStopOnMismatchOccured
+ nStopOnMismatchOccurred = 0x02,
+ nStopOnMismatchExecuted = nStopOnMismatchEnabled | nStopOnMismatchOccurred
};
enum TestEqualConditionBits
@@ -298,16 +298,16 @@ private:
public:
ScQueryCellIterator(ScDocument* pDocument, SCTAB nTable,
- const ScQueryParam& aParam, sal_Bool bMod = sal_True);
- // fuer bMod = sal_False muss der QueryParam
- // weiter aufgefuellt sein (bIsString)
+ const ScQueryParam& aParam, sal_Bool bMod = true);
+ // for bMod = FALSE the QueryParam has to be filled
+ // (bIsString)
ScBaseCell* GetFirst();
ScBaseCell* GetNext();
SCCOL GetCol() { return nCol; }
SCROW GetRow() { return nRow; }
- // setzt alle Entry.nField einen weiter, wenn Spalte
- // wechselt, fuer ScInterpreter ScHLookup()
+ // increments all Entry.nField, if column
+ // changes, for ScInterpreter ScHLookup()
void SetAdvanceQueryParamEntryField( sal_Bool bVal )
{ bAdvanceQuery = bVal; }
void AdvanceQueryParamEntryField();
@@ -372,11 +372,11 @@ public:
number format!
*/
sal_Bool FindEqualOrSortedLastInRange( SCCOL& nFoundCol,
- SCROW& nFoundRow, sal_Bool bSearchForEqualAfterMismatch = sal_False,
+ SCROW& nFoundRow, sal_Bool bSearchForEqualAfterMismatch = false,
sal_Bool bIgnoreMismatchOnLeadingStrings = sal_True );
};
-class ScDocAttrIterator // alle Attribut-Bereiche
+class ScDocAttrIterator // all attribute areas
{
private:
ScDocument* pDoc;
@@ -395,7 +395,8 @@ public:
const ScPatternAttr* GetNext( SCCOL& rCol, SCROW& rRow1, SCROW& rRow2 );
};
-class ScAttrRectIterator // alle Attribut-Bereiche, auch Bereiche ueber mehrere Spalten
+class ScAttrRectIterator // all attribute areas, including areas stretching
+ // across more then one column
{
private:
ScDocument* pDoc;
@@ -416,8 +417,8 @@ public:
const ScPatternAttr* GetNext( SCCOL& rCol1, SCCOL& rCol2, SCROW& rRow1, SCROW& rRow2 );
};
-class ScHorizontalCellIterator // alle nichtleeren Zellen in einem Bereich
-{ // zeilenweise durchgehen
+class ScHorizontalCellIterator // walk through all non empty cells in an area
+{ // row by row
private:
ScDocument* pDoc;
SCTAB nTab;
@@ -444,7 +445,7 @@ private:
//
-// gibt alle Bereiche mit nicht-Default-Formatierung zurueck (horizontal)
+// returns all areas with non-default formatting (horizontal)
//
class ScHorizontalAttrIterator
@@ -473,7 +474,7 @@ public:
};
//
-// gibt nichtleere Zellen und Bereiche mit Formatierung zurueck (horizontal)
+// returns non-empty cells and areas with formatting (horizontal)
//
class SC_DLLPUBLIC ScUsedAreaIterator
@@ -493,7 +494,7 @@ private:
SCROW nAttrRow;
const ScPatternAttr* pPattern;
- SCCOL nFoundStartCol; // Ergebnisse nach GetNext
+ SCCOL nFoundStartCol; // results after GetNext
SCCOL nFoundEndCol;
SCROW nFoundRow;
const ScPatternAttr* pFoundPattern;
@@ -530,6 +531,43 @@ private:
::std::set<SCROW>::const_iterator maEnd;
};
+// ============================================================================
+
+class ScDocRowHeightUpdater
+{
+public:
+ struct TabRanges
+ {
+ SCTAB mnTab;
+ ::boost::shared_ptr<ScFlatBoolRowSegments> mpRanges;
+
+ TabRanges();
+ TabRanges(SCTAB nTab);
+ };
+
+ /**
+ * Passing a NULL pointer to pTabRangesArray forces the heights of all
+ * rows in all tables to be updated.
+ */
+ explicit ScDocRowHeightUpdater(
+ ScDocument& rDoc, OutputDevice* pOutDev, double fPPTX, double fPPTY,
+ const ::std::vector<TabRanges>* pTabRangesArray = NULL);
+
+ void update();
+
+private:
+ void updateAll();
+
+private:
+ ScDocument& mrDoc;
+ OutputDevice* mpOutDev;
+ double mfPPTX;
+ double mfPPTY;
+ const ::std::vector<TabRanges>* mpTabRangesArray;
+};
+
+
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/docoptio.hxx b/sc/inc/docoptio.hxx
index 0c365fe06051..999b591f1881 100644
--- a/sc/inc/docoptio.hxx
+++ b/sc/inc/docoptio.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,23 +35,32 @@
#include "scdllapi.h"
#include "optutil.hxx"
+#include "formula/grammar.hxx"
+
class SC_DLLPUBLIC ScDocOptions
{
- double fIterEps; // Epsilon-Wert dazu
- sal_uInt16 nIterCount; // Anzahl
+ double fIterEps; // epsilon value dazu
+ sal_uInt16 nIterCount; // number
sal_uInt16 nPrecStandardFormat; // precision for standard format
- sal_uInt16 nDay; // Nulldatum:
+ ScOptionsUtil::KeyBindingType eKeyBindingType;
+ sal_uInt16 nDay; // Null date:
sal_uInt16 nMonth;
sal_uInt16 nYear;
- sal_uInt16 nYear2000; // bis zu welcher zweistelligen Jahreszahl 20xx angenommen wird
- sal_uInt16 nTabDistance; // Abstand Standardtabulatoren
- sal_Bool bIsIgnoreCase; // Gross-/Kleinschr. bei Vergleichen
- sal_Bool bIsIter; // Iteration bei cirk. Ref
- sal_Bool bCalcAsShown; // berechnen wie angezeigt (Precision)
- sal_Bool bMatchWholeCell; // Suchkriterien muessen ganze Zelle matchen
- sal_Bool bDoAutoSpell; // Auto-Spelling
- sal_Bool bLookUpColRowNames; // Spalten-/Zeilenbeschriftungen automagisch suchen
+ sal_uInt16 nYear2000; // earlier 19YY is assumed, 20YY otherwise (if only YY of year is given)
+ sal_uInt16 nTabDistance; // distance of standard tabs
+ sal_Bool bIsIgnoreCase; // ignore case for comparisons?
+ sal_Bool bIsIter; // iterations for circular refs
+ sal_Bool bCalcAsShown; // calculate as shown (wrt precision)
+ sal_Bool bMatchWholeCell; // search criteria must match the whole cell
+ sal_Bool bDoAutoSpell; // auto-spelling
+ sal_Bool bLookUpColRowNames; // determine column-/row titles automagically
sal_Bool bFormulaRegexEnabled; // regular expressions in formulas enabled
+ bool bUseEnglishFuncName; // use English function name even if the locale is not English.
+ ::formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax
+
+ ::rtl::OUString aFormulaSepArg;
+ ::rtl::OUString aFormulaSepArrayRow;
+ ::rtl::OUString aFormulaSepArrayCol;
public:
ScDocOptions();
@@ -80,7 +90,6 @@ public:
void SetTabDistance( sal_uInt16 nTabDist ) {nTabDistance = nTabDist;}
void ResetDocOptions();
- inline void CopyTo(ScDocOptions& rOpt);
inline const ScDocOptions& operator=( const ScDocOptions& rOpt );
inline int operator==( const ScDocOptions& rOpt ) const;
@@ -89,6 +98,9 @@ public:
sal_uInt16 GetStdPrecision() const { return nPrecStandardFormat; }
void SetStdPrecision( sal_uInt16 n ) { nPrecStandardFormat = n; }
+ ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return eKeyBindingType; }
+ void SetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { eKeyBindingType = e; }
+
sal_Bool IsCalcAsShown() const { return bCalcAsShown; }
void SetCalcAsShown( sal_Bool bVal ) { bCalcAsShown = bVal; }
@@ -97,27 +109,25 @@ public:
void SetFormulaRegexEnabled( sal_Bool bVal ) { bFormulaRegexEnabled = bVal; }
sal_Bool IsFormulaRegexEnabled() const { return bFormulaRegexEnabled; }
-};
+ void SetFormulaSyntax( ::formula::FormulaGrammar::Grammar eGram ) { eFormulaGrammar = eGram; }
+ ::formula::FormulaGrammar::Grammar GetFormulaSyntax() const { return eFormulaGrammar; }
-inline void ScDocOptions::CopyTo(ScDocOptions& rOpt)
-{
- rOpt.bIsIgnoreCase = bIsIgnoreCase;
- rOpt.bIsIter = bIsIter;
- rOpt.nIterCount = nIterCount;
- rOpt.fIterEps = fIterEps;
- rOpt.nPrecStandardFormat = nPrecStandardFormat;
- rOpt.nDay = nDay;
- rOpt.nMonth = nMonth;
- rOpt.nYear2000 = nYear2000;
- rOpt.nYear = nYear;
- rOpt.nTabDistance = nTabDistance;
- rOpt.bCalcAsShown = bCalcAsShown;
- rOpt.bMatchWholeCell = bMatchWholeCell;
- rOpt.bDoAutoSpell = bDoAutoSpell;
- rOpt.bLookUpColRowNames = bLookUpColRowNames;
- rOpt.bFormulaRegexEnabled = bFormulaRegexEnabled;
-}
+ void SetUseEnglishFuncName( bool bVal ) { bUseEnglishFuncName = bVal; }
+ bool GetUseEnglishFuncName() const { return bUseEnglishFuncName; }
+
+ void SetFormulaSepArg(const ::rtl::OUString& rSep) { aFormulaSepArg = rSep; }
+ ::rtl::OUString GetFormulaSepArg() const { return aFormulaSepArg; }
+
+ void SetFormulaSepArrayRow(const ::rtl::OUString& rSep) { aFormulaSepArrayRow = rSep; }
+ ::rtl::OUString GetFormulaSepArrayRow() const { return aFormulaSepArrayRow; }
+
+ void SetFormulaSepArrayCol(const ::rtl::OUString& rSep) { aFormulaSepArrayCol = rSep; }
+ ::rtl::OUString GetFormulaSepArrayCol() const { return aFormulaSepArrayCol; }
+
+ void ResetFormulaSeparators();
+ static const LocaleDataWrapper& GetLocaleDataWrapper();
+};
inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy )
{
@@ -126,6 +136,7 @@ inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy )
nIterCount = rCpy.nIterCount;
fIterEps = rCpy.fIterEps;
nPrecStandardFormat = rCpy.nPrecStandardFormat;
+ eKeyBindingType = rCpy.eKeyBindingType;
nDay = rCpy.nDay;
nMonth = rCpy.nMonth;
nYear = rCpy.nYear;
@@ -136,6 +147,11 @@ inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy )
bDoAutoSpell = rCpy.bDoAutoSpell;
bLookUpColRowNames = rCpy.bLookUpColRowNames;
bFormulaRegexEnabled= rCpy.bFormulaRegexEnabled;
+ bUseEnglishFuncName = rCpy.bUseEnglishFuncName;
+ eFormulaGrammar = rCpy.eFormulaGrammar;
+ aFormulaSepArg = rCpy.aFormulaSepArg;
+ aFormulaSepArrayRow = rCpy.aFormulaSepArrayRow;
+ aFormulaSepArrayCol = rCpy.aFormulaSepArrayCol;
return *this;
}
@@ -148,6 +164,7 @@ inline int ScDocOptions::operator==( const ScDocOptions& rOpt ) const
&& rOpt.nIterCount == nIterCount
&& rOpt.fIterEps == fIterEps
&& rOpt.nPrecStandardFormat == nPrecStandardFormat
+ && rOpt.eKeyBindingType == eKeyBindingType
&& rOpt.nDay == nDay
&& rOpt.nMonth == nMonth
&& rOpt.nYear == nYear
@@ -158,6 +175,11 @@ inline int ScDocOptions::operator==( const ScDocOptions& rOpt ) const
&& rOpt.bDoAutoSpell == bDoAutoSpell
&& rOpt.bLookUpColRowNames == bLookUpColRowNames
&& rOpt.bFormulaRegexEnabled == bFormulaRegexEnabled
+ && rOpt.bUseEnglishFuncName == bUseEnglishFuncName
+ && rOpt.eFormulaGrammar == eFormulaGrammar
+ && rOpt.aFormulaSepArg == aFormulaSepArg
+ && rOpt.aFormulaSepArrayRow == aFormulaSepArrayRow
+ && rOpt.aFormulaSepArrayCol == aFormulaSepArrayCol
);
}
@@ -167,14 +189,13 @@ inline int ScDocOptions::operator!=( const ScDocOptions& rOpt ) const
}
//==================================================================
-// Item fuer Einstellungsdialog - Berechnen
+// Item for preferences dialog - calculation
//==================================================================
class SC_DLLPUBLIC ScTpCalcItem : public SfxPoolItem
{
public:
TYPEINFO();
-//UNUSED2008-05 ScTpCalcItem( sal_uInt16 nWhich );
ScTpCalcItem( sal_uInt16 nWhich,
const ScDocOptions& rOpt );
ScTpCalcItem( const ScTpCalcItem& rItem );
@@ -197,13 +218,19 @@ private:
class ScDocCfg : public ScDocOptions
{
ScLinkConfigItem aCalcItem;
+ ScLinkConfigItem aFormulaItem;
ScLinkConfigItem aLayoutItem;
+ ScLinkConfigItem aCompatItem;
DECL_LINK( CalcCommitHdl, void* );
+ DECL_LINK( FormulaCommitHdl, void* );
DECL_LINK( LayoutCommitHdl, void* );
+ DECL_LINK( CompatCommitHdl, void* );
com::sun::star::uno::Sequence<rtl::OUString> GetCalcPropertyNames();
+ com::sun::star::uno::Sequence<rtl::OUString> GetFormulaPropertyNames();
com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames();
+ com::sun::star::uno::Sequence<rtl::OUString> GetCompatPropertyNames();
public:
ScDocCfg();
@@ -214,3 +241,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/unoguard.hxx b/sc/inc/docparam.hxx
index e5e57e959e7b..c5d0ec31085f 100644
--- a/sc/inc/unoguard.hxx
+++ b/sc/inc/docparam.hxx
@@ -1,8 +1,9 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
@@ -25,18 +26,22 @@
*
************************************************************************/
-#ifndef SC_UNOGUARD_HXX
-#define SC_UNOGUARD_HXX
+#ifndef SC_DOCPARAM_HXX
+#define SC_DOCPARAM_HXX
-#include <vos/mutex.hxx>
+#include "address.hxx"
-class ScUnoGuard : public vos::OGuard
+// Let's put here misc structures that get passed to ScDocument's methods.
+
+struct ScColWidthParam
{
-public:
- ScUnoGuard();
- ~ScUnoGuard() {}
-};
+ SCROW mnMaxTextRow;
+ sal_uInt32 mnMaxTextLen;
+ bool mbSimpleText;
+ ScColWidthParam();
+};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx
index 7eebb5a834c5..bbd81b59d305 100644
--- a/sc/inc/docpool.hxx
+++ b/sc/inc/docpool.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@ class SC_DLLPUBLIC ScDocumentPool: public SfxItemPool
static sal_uInt16* pVersionMap11;
public:
- ScDocumentPool( SfxItemPool* pSecPool = NULL, sal_Bool bLoadRefCounts = sal_False );
+ ScDocumentPool( SfxItemPool* pSecPool = NULL, sal_Bool bLoadRefCounts = false );
protected:
virtual ~ScDocumentPool();
public:
@@ -64,7 +65,7 @@ public:
virtual void Remove( const SfxPoolItem& );
static void CheckRef( const SfxPoolItem& );
- void StyleDeleted( ScStyleSheet* pStyle ); // Loeschen von Vorlagen im Organizer
+ void StyleDeleted( ScStyleSheet* pStyle ); // delete templates(?) in organizer
void CellStyleCreated( const String& rName );
virtual SfxItemPresentation GetPresentation(
const SfxPoolItem& rItem,
@@ -81,3 +82,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 9a83a49b8c5e..984fb70bec8e 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,12 +33,13 @@
#include <vcl/prntypes.hxx>
#include <vcl/timer.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include "scdllapi.h"
-#include "table.hxx" // FastGetRowHeight (inline)
#include "rangelst.hxx"
+#include "table.hxx"
#include "brdcst.hxx"
#include "tabopparams.hxx"
+#include "types.hxx"
#include "formula/grammar.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
#include "scdllapi.h"
@@ -45,13 +47,8 @@
#include <memory>
#include <map>
#include <set>
-
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include <list>
-#include "dpobject.hxx"
-#include "dptabdat.hxx"
-// End Comments
+#include <boost/ptr_container/ptr_vector.hpp>
class KeyEvent;
class OutputDevice;
@@ -83,6 +80,7 @@ class Window;
class XColorTable;
class List;
+struct ScAttrEntry;
class ScAutoFormatData;
class ScBaseCell;
class ScStringCell;
@@ -103,6 +101,7 @@ class ScDrawLayer;
class ScExtDocOptions;
class ScExternalRefManager;
class ScFormulaCell;
+class ScMacroManager;
class ScMarkData;
class ScOutlineTable;
class ScPatternAttr;
@@ -146,6 +145,10 @@ class ScFormulaParserPool;
struct ScClipParam;
struct ScClipRangeNameData;
class ScRowBreakIterator;
+struct ScSetStringParam;
+class ScDocRowHeightUpdater;
+struct ScColWidthParam;
+struct ScCopyBlockFromClipParams;
namespace com { namespace sun { namespace star {
namespace lang {
@@ -170,14 +173,6 @@ namespace com { namespace sun { namespace star {
} } }
#include <svl/zforlist.hxx>
-/*
-#ifdef _ZFORLIST_DECLARE_TABLE
-class SvNumberFormatterIndexTable;
-#else
-class Table;
-typedef Table SvNumberFormatterIndexTable;
-#endif
-*/
#define SC_DOC_NEW 0xFFFF
@@ -205,27 +200,6 @@ struct ScDocStat
sal_uInt16 nPageCount;
};
-// The constant parameters to CopyBlockFromClip
-struct ScCopyBlockFromClipParams
-{
- ScDocument* pRefUndoDoc;
- ScDocument* pClipDoc;
- sal_uInt16 nInsFlag;
- SCTAB nTabStart;
- SCTAB nTabEnd;
- sal_Bool bAsLink;
- sal_Bool bSkipAttrForEmpty;
-};
-
-
-// for loading of binary file format symbol string cells which need font conversion
-struct ScSymbolStringCellEntry
-{
- ScStringCell* pCell;
- SCROW nRow;
-};
-
-
// -----------------------------------------------------------------------
// DDE link modes
@@ -234,7 +208,6 @@ const sal_uInt8 SC_DDE_ENGLISH = 1;
const sal_uInt8 SC_DDE_TEXT = 2;
const sal_uInt8 SC_DDE_IGNOREMODE = 255; /// For usage in FindDdeLink() only!
-
// -----------------------------------------------------------------------
class ScDocument
@@ -249,11 +222,12 @@ friend class ScHorizontalAttrIterator;
friend class ScDocAttrIterator;
friend class ScAttrRectIterator;
friend class ScDocShell;
+friend class ScDocRowHeightUpdater;
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager;
- vos::ORef<ScPoolHelper> xPoolHelper;
+ rtl::Reference<ScPoolHelper> xPoolHelper;
SfxUndoManager* mpUndoManager;
ScFieldEditEngine* pEditEngine; // uses pEditPool from xPoolHelper
@@ -264,26 +238,21 @@ private:
VirtualDevice* pVirtualDevice_100th_mm;
ScDrawLayer* pDrawLayer; // SdrModel
XColorTable* pColorTable;
- ScConditionalFormatList* pCondFormList; // bedingte Formate
- ScValidationDataList* pValidationList; // Gueltigkeit
- SvNumberFormatterIndexTable* pFormatExchangeList; // zum Umsetzen von Zahlenformaten
+ ScConditionalFormatList* pCondFormList; // conditional formats
+ ScValidationDataList* pValidationList; // validity
+ SvNumberFormatterIndexTable* pFormatExchangeList; // for application of number formats
ScTable* pTab[MAXTABCOUNT];
ScRangeName* pRangeName;
ScDBCollection* pDBCollection;
ScDPCollection* pDPCollection;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- std::list<ScDPObject> m_listDPObjectsInClip;
- std::list<ScDPTableDataCache*> m_listDPObjectsCaches;
- // End Comments
ScChartCollection* pChartCollection;
std::auto_ptr< ScTemporaryChartLock > apTemporaryChartLock;
- ScPatternAttr* pSelectionAttr; // Attribute eines Blocks
+ ScPatternAttr* pSelectionAttr; // Attributes of a block
mutable sfx2::LinkManager* pLinkManager;
- ScFormulaCell* pFormulaTree; // Berechnungsbaum Start
- ScFormulaCell* pEOFormulaTree; // Berechnungsbaum Ende, letzte Zelle
- ScFormulaCell* pFormulaTrack; // BroadcastTrack Start
- ScFormulaCell* pEOFormulaTrack; // BrodcastTrack Ende, letzte Zelle
+ ScFormulaCell* pFormulaTree; // formula tree (start)
+ ScFormulaCell* pEOFormulaTree; // formula tree (end), last cell
+ ScFormulaCell* pFormulaTrack; // BroadcastTrack (start)
+ ScFormulaCell* pEOFormulaTrack; // BrodcastTrack (end), last cell
ScBroadcastAreaSlotMachine* pBASM; // BroadcastAreas
ScChartListenerCollection* pChartListenerCollection;
ScStrCollection* pOtherObjects; // non-chart OLE objects
@@ -296,7 +265,7 @@ private:
ScChangeViewSettings* pChangeViewSettings;
ScScriptTypeData* pScriptTypeData;
ScRefreshTimerControl* pRefreshTimerControl;
- vos::ORef<SvxForbiddenCharactersTable> xForbiddenCharacters;
+ rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharacters;
ScFieldEditEngine* pCacheFieldEditEngine;
@@ -304,19 +273,21 @@ private:
::std::auto_ptr<ScClipParam> mpClipParam;
::std::auto_ptr<ScExternalRefManager> pExternalRefMgr;
+ ::std::auto_ptr<ScMacroManager> mpMacroMgr;
+
// mutable for lazy construction
mutable ::std::auto_ptr< ScFormulaParserPool >
mxFormulaParserPool; /// Pool for all external formula parsers used by this document.
- String aDocName; // opt: Dokumentname
- String aDocCodeName; // opt: Dokumentname
+ String aDocName; // optional: name of document
+ String aDocCodeName; // optional: name of document (twice?)
ScRangePairListRef xColNameRanges;
ScRangePairListRef xRowNameRanges;
- ScViewOptions* pViewOptions; // View-Optionen
- ScDocOptions* pDocOptions; // Dokument-Optionen
- ScExtDocOptions* pExtDocOptions; // fuer Import etc.
+ ScViewOptions* pViewOptions; // view options
+ ScDocOptions* pDocOptions; // document options
+ ScExtDocOptions* pExtDocOptions; // for import etc.
ScConsolidateParam* pConsolidateDlgData;
ScRecursionHelper* pRecursionHelper; // information for recursive and iterative cell formulas
@@ -341,14 +312,14 @@ private:
mxVbaEvents;
public:
- ScTabOpList aTableOpList; // list of ScInterpreterTableOpParams currently in use
+ boost::ptr_vector< ScInterpreterTableOpParams > aTableOpList; // list of ScInterpreterTableOpParams currently in use
ScInterpreterTableOpParams aLastTableOpParams; // remember last params
private:
LanguageType eLanguage; // default language
LanguageType eCjkLanguage; // default language for asian text
LanguageType eCtlLanguage; // default language for complex text
- CharSet eSrcSet; // Einlesen: Quell-Zeichensatz
+ CharSet eSrcSet; // during reading: source character set
/** The compiler grammar used in document storage. GRAM_PODF for ODF 1.1
documents, GRAM_ODFF for ODF 1.2 documents. */
@@ -361,58 +332,59 @@ private:
sal_uLong nFormulaCodeInTree; // FormelRPN im Formelbaum
sal_uLong nXMLImportedFormulaCount; // progress count during XML import
- sal_uInt16 nInterpretLevel; // >0 wenn im Interpreter
- sal_uInt16 nMacroInterpretLevel; // >0 wenn Macro im Interpreter
- sal_uInt16 nInterpreterTableOpLevel; // >0 if in Interpreter TableOp
+ sal_uInt16 nInterpretLevel; // >0 if in interpreter
+ sal_uInt16 nMacroInterpretLevel; // >0 if macro in interpreter
+ sal_uInt16 nInterpreterTableOpLevel; // >0 if in interpreter TableOp
SCTAB nMaxTableNumber;
- sal_uInt16 nSrcVer; // Dateiversion (Laden/Speichern)
- SCROW nSrcMaxRow; // Zeilenzahl zum Laden/Speichern
+ sal_uInt16 nSrcVer; // file version (load/save)
+ SCROW nSrcMaxRow; // number of lines to load/save
sal_uInt16 nFormulaTrackCount;
sal_uInt16 nHardRecalcState; // 0: soft, 1: hard-warn, 2: hard
- SCTAB nVisibleTab; // fuer OLE etc.
+ SCTAB nVisibleTab; // for OLE etc.
ScLkUpdMode eLinkMode;
- sal_Bool bAutoCalc; // Automatisch Berechnen
- sal_Bool bAutoCalcShellDisabled; // in/von/fuer ScDocShell disabled
- // ob noch ForcedFormulas berechnet werden muessen,
- // im Zusammenspiel mit ScDocShell SetDocumentModified,
- // AutoCalcShellDisabled und TrackFormulas
+ sal_Bool bAutoCalc; // calculate automatically
+ sal_Bool bAutoCalcShellDisabled; // in/from/for ScDocShell disabled
+ // are there ForcedFormulas which have to be calculated
+ // in interaction with ScDocShell SetDocumentModified,
+ // AutoCalcShellDisabled and TrackFormulas
sal_Bool bForcedFormulaPending;
sal_Bool bCalculatingFormulaTree;
sal_Bool bIsClip;
sal_Bool bIsUndo;
sal_Bool bIsVisible; // set from view ctor
- sal_Bool bIsEmbedded; // Embedded-Bereich anzeigen/anpassen ?
+ sal_Bool bIsEmbedded; // display/adjust Embedded area?
- // kein SetDirty bei ScFormulaCell::CompileTokenArray sondern am Ende
- // von ScDocument::CompileAll[WithFormats], CopyScenario, CopyBlockFromClip
+ // no SetDirty for ScFormulaCell::CompileTokenArray but at the end of
+ // ScDocument::CompileAll[WithFormats], CopyScenario, CopyBlockFromClip
sal_Bool bNoSetDirty;
- // kein Broadcast, keine Listener aufbauen waehrend aus einem anderen
- // Doc (per Filter o.ae.) inserted wird, erst bei CompileAll / CalcAfterLoad
+ // no broadcast, construct no listener during insert from a different
+ // Doc (per filter or the like ), not until CompileAll / CalcAfterLoad
sal_Bool bInsertingFromOtherDoc;
bool bLoadingMedium;
bool bImportingXML; // special handling of formula text
sal_Bool bXMLFromWrapper; // distinguish ScXMLImportWrapper from external component
sal_Bool bCalcingAfterLoad; // in CalcAfterLoad TRUE
- // wenn temporaer keine Listener auf/abgebaut werden sollen
+ // don't construct/destruct listeners temporarily
sal_Bool bNoListening;
sal_Bool bIdleDisabled;
sal_Bool bInLinkUpdate; // TableLink or AreaLink
sal_Bool bChartListenerCollectionNeedsUpdate;
- // ob RC_FORCED Formelzellen im Dokument sind/waren (einmal an immer an)
+ // are/were there RC_FORCED formula cells in the document (if set once to TRUE then set forever)
sal_Bool bHasForcedFormulas;
- // ob das Doc gerade zerstoert wird (kein Notify-Tracking etc. mehr)
+ // is the Doc being destroyed? (no Notify-Tracking etc. needed anymore)
sal_Bool bInDtorClear;
- // ob bei Spalte/Zeile einfuegen am Rand einer Referenz die Referenz
- // erweitert wird, wird in jedem UpdateReference aus InputOptions geholt,
- // gesetzt und am Ende von UpdateReference zurueckgesetzt
+ // expand reference if insert column/row takes place at the border
+ // of a reference
+ // is fetched in each UpdateReference from InputOptions,
+ // assigned, and restored at the end of UpdateReference
sal_Bool bExpandRefs;
- // fuer Detektiv-Update, wird bei jeder Aenderung an Formeln gesetzt
+ // for detective update, is set for each change of a formula
sal_Bool bDetectiveDirty;
- sal_uInt8 nMacroCallMode; // Makros per Warnung-Dialog disabled?
+ sal_uInt8 nMacroCallMode; // Macros per warning dialog disabled?
sal_Bool bHasMacroFunc; // valid only after loading
sal_uInt8 nVisSpellState;
@@ -439,11 +411,12 @@ private:
sal_Int16 mnNamedRangesLockCount;
+ ::std::set<ScFormulaCell*> maSubTotalCells;
+
public:
- SC_DLLPUBLIC sal_uLong GetCellCount() const; // alle Zellen
+ SC_DLLPUBLIC sal_uLong GetCellCount() const; // all cells
SCSIZE GetCellCount(SCTAB nTab, SCCOL nCol) const;
- sal_uLong GetWeightedCount() const; // Formeln und Edit staerker gewichtet
- sal_uLong GetCodeCount() const; // RPN-Code in Formeln
+ sal_uLong GetCodeCount() const; // RPN-Code in formulas
DECL_LINK( GetUserDefinedColor, sal_uInt16 * );
// Numberformatter
@@ -458,7 +431,9 @@ public:
SC_DLLPUBLIC const String& GetName() const { return aDocName; }
void SetName( const String& r ) { aDocName = r; }
const String& GetCodeName() const { return aDocCodeName; }
- void SetCodeName( const String& r ) { aDocCodeName = r; }
+ void SetCodeName( const String& r ) { aDocCodeName = r; }
+
+ SC_DLLPUBLIC NameToNameMap* GetLocalNameMap( SCTAB& rTab );
void GetDocStat( ScDocStat& rDocStat );
@@ -484,12 +459,12 @@ public:
void SetConsolidateDlgData( const ScConsolidateParam* pData );
const ScConsolidateParam* GetConsolidateDlgData() const { return pConsolidateDlgData; }
- void Clear( sal_Bool bFromDestructor = sal_False );
+ void Clear( sal_Bool bFromDestructor = false );
ScFieldEditEngine* CreateFieldEditEngine();
void DisposeFieldEditEngine(ScFieldEditEngine*& rpEditEngine);
- SC_DLLPUBLIC ScRangeName* GetRangeName();
+ SC_DLLPUBLIC ScRangeName* GetRangeName() const;
void SetRangeName( ScRangeName* pNewRangeName );
SCTAB GetMaxTableNumber() { return nMaxTableNumber; }
void SetMaxTableNumber(SCTAB nNumber) { nMaxTableNumber = nNumber; }
@@ -501,28 +476,16 @@ public:
SC_DLLPUBLIC ScDBCollection* GetDBCollection() const;
void SetDBCollection( ScDBCollection* pNewDBCollection,
- sal_Bool bRemoveAutoFilter = sal_False );
+ sal_Bool bRemoveAutoFilter = false );
ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
- sal_Bool bStartOnly = sal_False) const;
+ sal_Bool bStartOnly = false) const;
ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
-//UNUSED2008-05 ScRangeData* GetRangeAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
-//UNUSED2008-05 sal_Bool bStartOnly = sal_False) const;
- SC_DLLPUBLIC ScRangeData* GetRangeAtBlock( const ScRange& rBlock, String* pName=NULL ) const;
+ SC_DLLPUBLIC const ScRangeData* GetRangeAtBlock( const ScRange& rBlock, String* pName=NULL ) const;
SC_DLLPUBLIC ScDPCollection* GetDPCollection();
ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
ScDPObject* GetDPAtBlock( const ScRange& rBlock ) const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- SC_DLLPUBLIC ScDPTableDataCache* GetDPObjectCache( long nID );
- SC_DLLPUBLIC ScDPTableDataCache* GetUsedDPObjectCache ( ScRange rRange );
- SC_DLLPUBLIC long AddDPObjectCache( ScDPTableDataCache* pData );
- SC_DLLPUBLIC void RemoveDPObjectCache( long nID );
- SC_DLLPUBLIC void RemoveUnusedDPObjectCaches();
- SC_DLLPUBLIC void GetUsedDPObjectCache( std::list<ScDPTableDataCache*>& usedlist );
- SC_DLLPUBLIC long GetNewDPObjectCacheId ();
- // End Comments
SC_DLLPUBLIC ScChartCollection* GetChartCollection() const;
@@ -556,7 +519,7 @@ public:
SC_DLLPUBLIC sal_Bool HasTable( SCTAB nTab ) const;
SC_DLLPUBLIC sal_Bool GetName( SCTAB nTab, String& rName ) const;
SC_DLLPUBLIC sal_Bool GetCodeName( SCTAB nTab, String& rName ) const;
- SC_DLLPUBLIC sal_Bool SetCodeName( SCTAB nTab, const String& rName );
+ SC_DLLPUBLIC sal_Bool SetCodeName( SCTAB nTab, const String& rName );
SC_DLLPUBLIC sal_Bool GetTable( const String& rName, SCTAB& rTab ) const;
SC_DLLPUBLIC inline SCTAB GetTableCount() const { return nMaxTableNumber; }
SvNumberFormatterIndexTable* GetFormatExchangeList() const { return pFormatExchangeList; }
@@ -581,6 +544,7 @@ public:
sal_Bool HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow,
const ScMarkData& rMark ) const;
+ sal_Bool HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTAB ) const;
sal_Bool GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix );
@@ -589,29 +553,30 @@ public:
void SetEmbedded( const ScRange& rRange );
void ResetEmbedded();
Rectangle GetEmbeddedRect() const; // 1/100 mm
- void SetEmbedded( const Rectangle& rRect ); // aus VisArea (1/100 mm)
+ void SetEmbedded( const Rectangle& rRect ); // from VisArea (1/100 mm)
void SnapVisArea( Rectangle& rRect ) const; // 1/100 mm
- SC_DLLPUBLIC sal_Bool ValidTabName( const String& rName ) const;
+ static SC_DLLPUBLIC bool ValidTabName( const String& rName );
+
SC_DLLPUBLIC sal_Bool ValidNewTabName( const String& rName ) const;
SC_DLLPUBLIC void CreateValidTabName(String& rName) const;
SC_DLLPUBLIC sal_Bool InsertTab( SCTAB nPos, const String& rName,
- sal_Bool bExternalDocument = sal_False );
+ sal_Bool bExternalDocument = false );
SC_DLLPUBLIC sal_Bool DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc = NULL );
SC_DLLPUBLIC sal_Bool RenameTab( SCTAB nTab, const String& rName,
sal_Bool bUpdateRef = sal_True,
- sal_Bool bExternalDocument = sal_False );
+ sal_Bool bExternalDocument = false );
sal_Bool MoveTab( SCTAB nOldPos, SCTAB nNewPos );
sal_Bool CopyTab( SCTAB nOldPos, SCTAB nNewPos,
const ScMarkData* pOnlyMarked = NULL );
SC_DLLPUBLIC sal_uLong TransferTab(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos,
sal_Bool bInsertNew = sal_True,
- sal_Bool bResultsOnly = sal_False );
+ sal_Bool bResultsOnly = false );
SC_DLLPUBLIC void TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos);
SC_DLLPUBLIC void SetVisible( SCTAB nTab, sal_Bool bVisible );
SC_DLLPUBLIC sal_Bool IsVisible( SCTAB nTab ) const;
sal_Bool IsStreamValid( SCTAB nTab ) const;
- void SetStreamValid( SCTAB nTab, sal_Bool bSet, sal_Bool bIgnoreLock = sal_False );
+ void SetStreamValid( SCTAB nTab, sal_Bool bSet, sal_Bool bIgnoreLock = false );
void LockStreamValid( bool bLock );
bool IsStreamValidLocked() const { return mbStreamValidLocked; }
sal_Bool IsPendingRowHeights( SCTAB nTab ) const;
@@ -630,7 +595,7 @@ public:
SC_DLLPUBLIC bool IsDefaultTabBgColor( SCTAB nTab ) const;
void GetScenarioFlags( SCTAB nTab, sal_uInt16& rFlags ) const;
SC_DLLPUBLIC sal_Bool IsActiveScenario( SCTAB nTab ) const;
- SC_DLLPUBLIC void SetActiveScenario( SCTAB nTab, sal_Bool bActive ); // nur fuer Undo etc.
+ SC_DLLPUBLIC void SetActiveScenario( SCTAB nTab, sal_Bool bActive ); // only for Undo etc.
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const;
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const;
void SetGrammar( formula::FormulaGrammar::Grammar eGram );
@@ -674,7 +639,7 @@ public:
SC_DLLPUBLIC void CopyDdeLinks( ScDocument* pDestDoc ) const;
void DisconnectDdeLinks();
- // Fuer StarOne Api:
+ // for StarOne Api:
sal_uInt16 GetDdeLinkCount() const;
sal_Bool UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem );
@@ -702,19 +667,19 @@ public:
/** Tries to find a DDE link or creates a new, if not extant.
@param pResults If not 0, sets the matrix as as DDE link result matrix (also for existing links).
- @return true = DDE link found; false = Unpredictable error occured, no DDE link created. */
- SC_DLLPUBLIC bool CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrix* pResults = NULL );
+ @return true = DDE link found; false = Unpredictable error occurred, no DDE link created. */
+ SC_DLLPUBLIC bool CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrixRef pResults );
/** Sets a result matrix for the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@param pResults The array containing all results of the DDE link (intrusive-ref-counted, do not delete).
@return true = DDE link found and matrix set. */
- bool SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrix* pResults );
+ bool SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults );
SfxBindings* GetViewBindings();
SfxObjectShell* GetDocumentShell() const { return pShell; }
ScDrawLayer* GetDrawLayer() { return pDrawLayer; }
- SfxBroadcaster* GetDrawBroadcaster(); // zwecks Header-Vermeidung
+ SfxBroadcaster* GetDrawBroadcaster(); // to avoid header
void BeginDrawUndo();
void BeginUnoRefUndo();
@@ -723,7 +688,6 @@ public:
sal_Int64 GetNewUnoId();
void AddUnoRefChange( sal_Int64 nId, const ScRangeList& rOldRanges );
- // #109985#
sal_Bool IsChart( const SdrObject* pObject );
SC_DLLPUBLIC void UpdateAllCharts();
@@ -731,7 +695,7 @@ public:
SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
- //! setzt nur die neue RangeList, keine ChartListener o.ae.
+ //! only assigns the new RangeList, no ChartListener or the like
void SetChartRangeList( const String& rChartName,
const ScRangeListRef& rNewRangeListRef );
@@ -753,7 +717,7 @@ public:
void SetCalcNotification( SCTAB nTab );
void ResetCalcNotifications();
- SC_DLLPUBLIC ScOutlineTable* GetOutlineTable( SCTAB nTab, sal_Bool bCreate = sal_False );
+ SC_DLLPUBLIC ScOutlineTable* GetOutlineTable( SCTAB nTab, sal_Bool bCreate = false );
sal_Bool SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline );
void DoAutoOutline( SCCOL nStartCol, SCROW nStartRow,
@@ -764,17 +728,15 @@ public:
sal_Bool TestRemoveSubTotals( SCTAB nTab, const ScSubTotalParam& rParam );
sal_Bool HasSubTotalCells( const ScRange& rRange );
- SC_DLLPUBLIC void PutCell( const ScAddress&, ScBaseCell* pCell, sal_Bool bForceTab = sal_False );
-//UNUSED2009-05 SC_DLLPUBLIC void PutCell( const ScAddress&, ScBaseCell* pCell,
-//UNUSED2009-05 sal_uLong nFormatIndex, sal_Bool bForceTab = sal_False);
+ SC_DLLPUBLIC void PutCell( const ScAddress&, ScBaseCell* pCell, sal_Bool bForceTab = false );
SC_DLLPUBLIC void PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
- sal_Bool bForceTab = sal_False );
+ sal_Bool bForceTab = false );
SC_DLLPUBLIC void PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
- sal_uLong nFormatIndex, sal_Bool bForceTab = sal_False);
- // return sal_True = Zahlformat gesetzt
+ sal_uLong nFormatIndex, sal_Bool bForceTab = false);
+ // return TRUE = number format is set
SC_DLLPUBLIC sal_Bool SetString(
SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
+ ScSetStringParam* pParam = NULL );
SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 nError);
@@ -784,17 +746,19 @@ public:
const String& rFormula,
const ScTokenArray* p = NULL,
const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
- SC_DLLPUBLIC void InsertTableOp(const ScTabOpParam& rParam, // Mehrfachoperation
+ SC_DLLPUBLIC void InsertTableOp(const ScTabOpParam& rParam, // multi-operation
SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark);
SC_DLLPUBLIC void GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString );
+ SC_DLLPUBLIC void GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString );
SC_DLLPUBLIC void GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString );
SC_DLLPUBLIC double GetValue( const ScAddress& );
SC_DLLPUBLIC void GetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, double& rValue );
SC_DLLPUBLIC double RoundValueAsShown( double fVal, sal_uLong nFormat );
SC_DLLPUBLIC void GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
- sal_uInt32& rFormat );
+ sal_uInt32& rFormat ) const;
+ sal_uInt32 GetNumberFormat( const ScRange& rRange ) const;
SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScAddress& ) const;
/** If no number format attribute is set and the cell
pointer passed is of type formula cell, the calculated
@@ -802,15 +766,12 @@ public:
may be NULL. */
SC_DLLPUBLIC void GetNumberFormatInfo( short& nType, sal_uLong& nIndex,
const ScAddress& rPos, const ScBaseCell* pCell ) const;
- void GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula,
- sal_Bool bAsciiExport = sal_False ) const;
+ void GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula ) const;
SC_DLLPUBLIC void GetCellType( SCCOL nCol, SCROW nRow, SCTAB nTab, CellType& rCellType ) const;
SC_DLLPUBLIC CellType GetCellType( const ScAddress& rPos ) const;
SC_DLLPUBLIC void GetCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell*& rpCell ) const;
SC_DLLPUBLIC ScBaseCell* GetCell( const ScAddress& rPos ) const;
-//UNUSED2008-05 void RefreshNoteFlags();
-
SC_DLLPUBLIC sal_Bool HasData( SCCOL nCol, SCROW nRow, SCTAB nTab );
SC_DLLPUBLIC sal_Bool HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
SC_DLLPUBLIC sal_Bool HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
@@ -836,13 +797,15 @@ public:
@param bForced True = always create all captions, false = skip when Undo is disabled. */
void InitializeAllNoteCaptions( bool bForced = false );
+ void SetDrawPageSize(SCTAB nTab);
+
sal_Bool ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
SCCOL& rEndCol, SCROW& rEndRow, const ScMarkData& rMark,
- sal_Bool bRefresh = sal_False, sal_Bool bAttrs = sal_False );
+ sal_Bool bRefresh = false, sal_Bool bAttrs = false );
sal_Bool ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
SCCOL& rEndCol, SCROW& rEndRow, SCTAB nTab,
- sal_Bool bRefresh = sal_False, sal_Bool bAttrs = sal_False );
- sal_Bool ExtendMerge( ScRange& rRange, sal_Bool bRefresh = sal_False, sal_Bool bAttrs = sal_False );
+ sal_Bool bRefresh = false, sal_Bool bAttrs = false );
+ sal_Bool ExtendMerge( ScRange& rRange, sal_Bool bRefresh = false, sal_Bool bAttrs = false );
sal_Bool ExtendTotalMerge( ScRange& rRange );
SC_DLLPUBLIC sal_Bool ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow,
SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
@@ -853,7 +816,7 @@ public:
SC_DLLPUBLIC void DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow );
- // ohne Ueberpruefung:
+ // without checking:
SC_DLLPUBLIC void DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow, bool bDeleteCaptions = true );
void RemoveMerge( SCCOL nCol, SCROW nRow, SCTAB nTab );
@@ -862,10 +825,11 @@ public:
SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes = false ) const;
sal_Bool IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow,
- sal_Bool bLeftIsEmpty = sal_False,
+ sal_Bool bLeftIsEmpty = false,
ScRange* pLastRange = NULL,
Rectangle* pLastMM = NULL ) const;
+ void SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const;
sal_Bool IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
sal_Bool IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
@@ -904,13 +868,13 @@ public:
/** Zap all caches. */
void ClearLookupCaches();
- // Automatisch Berechnen
+ // calculate automatically
void SetAutoCalc( sal_Bool bNewAutoCalc );
sal_Bool GetAutoCalc() const { return bAutoCalc; }
- // Automatisch Berechnen in/von/fuer ScDocShell disabled
+ // calculate automatically in/from/for ScDocShell disabled
void SetAutoCalcShellDisabled( sal_Bool bNew ) { bAutoCalcShellDisabled = bNew; }
sal_Bool IsAutoCalcShellDisabled() const { return bAutoCalcShellDisabled; }
- // ForcedFormulas zu berechnen
+ // ForcedFormulas are to be calculated
void SetForcedFormulaPending( sal_Bool bNew ) { bForcedFormulaPending = bNew; }
sal_Bool IsForcedFormulaPending() const { return bForcedFormulaPending; }
// if CalcFormulaTree() is currently running
@@ -924,10 +888,10 @@ public:
selection, but the bounds of the sheet's data area
instead.
- @returns sal_True if the area passed intersected the data
- area, sal_False if not, in which case the values
+ @returns TRUE if the area passed intersected the data
+ area, FALSE if not, in which case the values
obtained may be out of bounds, not in order or
- unmodified. sal_True does not mean that there
+ unmodified. TRUE does not mean that there
actually is any data within the selection.
*/
bool ShrinkToDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const;
@@ -970,7 +934,7 @@ public:
SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab,
ScDirection eDir );
- void FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY );
+ SC_DLLPUBLIC void FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY );
SC_DLLPUBLIC void GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY,
sal_Bool bMarked, sal_Bool bUnprotected, const ScMarkData& rMark );
@@ -991,7 +955,7 @@ public:
SCROW nStartRow, SCSIZE nSize,
ScDocument* pRefUndoDoc = NULL, sal_Bool* pUndoOutline = NULL,
const ScMarkData* pTabMark = NULL );
- void DeleteRow( const ScRange& rRange,
+ SC_DLLPUBLIC void DeleteRow( const ScRange& rRange,
ScDocument* pRefUndoDoc = NULL, sal_Bool* pUndoOutline = NULL );
sal_Bool InsertCol( SCROW nStartRow, SCTAB nStartTab,
SCROW nEndRow, SCTAB nEndTab,
@@ -1029,8 +993,8 @@ public:
SC_DLLPUBLIC void ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks );
SC_DLLPUBLIC void ResetClip( ScDocument* pSourceDoc, SCTAB nTab );
void SetCutMode( sal_Bool bCut );
- sal_Bool IsCutMode();
- void SetClipArea( const ScRange& rArea, sal_Bool bCut = sal_False );
+ SC_DLLPUBLIC sal_Bool IsCutMode();
+ void SetClipArea( const ScRange& rArea, sal_Bool bCut = false );
SC_DLLPUBLIC sal_Bool IsDocVisible() const { return bIsVisible; }
void SetDocVisible( sal_Bool bSet );
@@ -1051,6 +1015,9 @@ public:
const ScMarkData* pMarks = NULL, bool bAllTabs = false, bool bKeepScenarioFlags = false,
bool bIncludeObjects = false, bool bCloneNoteCaptions = true);
+ void CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClipDoc, bool bKeepScenarioFlags = false,
+ bool bIncludeObjects = false, bool bCloneNoteCaptions = true);
+
void CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
SCTAB nTab, ScDocument* pClipDoc = NULL);
void CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
@@ -1073,9 +1040,9 @@ public:
ScDocument* pRefUndoDoc = NULL,
ScDocument* pClipDoc = NULL,
sal_Bool bResetCut = sal_True,
- sal_Bool bAsLink = sal_False,
+ sal_Bool bAsLink = false,
sal_Bool bIncludeFiltered = sal_True,
- sal_Bool bSkipAttrForEmpty = sal_False,
+ sal_Bool bSkipAttrForEmpty = false,
const ScRangeList * pDestRanges = NULL );
void CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark,
@@ -1109,13 +1076,13 @@ public:
void TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType );
SC_DLLPUBLIC void InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
- sal_Bool bColInfo = sal_False, sal_Bool bRowInfo = sal_False );
+ sal_Bool bColInfo = false, sal_Bool bRowInfo = false );
void AddUndoTab( SCTAB nTab1, SCTAB nTab2,
- sal_Bool bColInfo = sal_False, sal_Bool bRowInfo = sal_False );
+ sal_Bool bColInfo = false, sal_Bool bRowInfo = false );
SC_DLLPUBLIC void InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSelection,
- sal_Bool bColInfo = sal_False, sal_Bool bRowInfo = sal_False );
+ sal_Bool bColInfo = false, sal_Bool bRowInfo = false );
- // nicht mehr benutzen:
+ // don't use anymore:
void CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
sal_uInt16 nFlags, sal_Bool bMarked, ScDocument* pDestDoc,
@@ -1132,7 +1099,7 @@ public:
sal_uInt16 nFlags, sal_Bool bMarked, ScDocument* pDestDoc,
const ScMarkData* pMarks = NULL);
- void CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bNewScenario = sal_False );
+ void CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bNewScenario = false );
sal_Bool TestCopyScenario( SCTAB nSrcTab, SCTAB nDestTab ) const;
void MarkScenario( SCTAB nSrcTab, SCTAB nDestTab,
ScMarkData& rDestMark, sal_Bool bResetMark = sal_True,
@@ -1223,10 +1190,14 @@ public:
const ScPatternAttr& rAttr );
SC_DLLPUBLIC void ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow,
- const ScMarkData& rMark, const ScPatternAttr& rAttr );
+ const ScMarkData& rMark, const ScPatternAttr& rAttr,
+ ScEditDataArray* pDataArray = NULL );
SC_DLLPUBLIC void ApplyPatternAreaTab( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow, SCTAB nTab,
const ScPatternAttr& rAttr );
+
+ SC_DLLPUBLIC bool SetAttrEntries(SCCOL nCol, SCTAB nTab, ScAttrEntry* pData, SCSIZE nSize);
+
SC_DLLPUBLIC void ApplyPatternIfNumberformatIncompatible(
const ScRange& rRange, const ScMarkData& rMark,
const ScPatternAttr& rPattern, short nNewType );
@@ -1262,9 +1233,9 @@ public:
SCTAB nTab, sal_Int16 nFlags );
SC_DLLPUBLIC void SetPattern( const ScAddress&, const ScPatternAttr& rAttr,
- sal_Bool bPutToPool = sal_False );
+ sal_Bool bPutToPool = false );
SC_DLLPUBLIC void SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr& rAttr,
- sal_Bool bPutToPool = sal_False );
+ sal_Bool bPutToPool = false );
void DeleteNumberFormat( const sal_uInt32* pDelKeys, sal_uInt32 nCount );
void AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
@@ -1276,8 +1247,9 @@ public:
ScMarkData& rMark,
String& rUndoStr, ScDocument* pUndoDoc = NULL );
- // Col/Row von Folgeaufrufen bestimmen
- // (z.B. nicht gefunden von Anfang, oder folgende Tabellen)
+ // determine Col/Row of subsequent calls
+ // (e.g. not found from the beginning, or subsequent tables)
+ // meaning of explanation in "()" was already unclear in German
static void GetSearchAndReplaceStart( const SvxSearchItem& rSearchItem,
SCCOL& rCol, SCROW& rRow );
@@ -1285,18 +1257,20 @@ public:
SCCOL nVCol, SCROW nVRow, SCTAB nVTab,
const String& sValStr, double& nX);
- void ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark );
+ void ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark,
+ ScEditDataArray* pDataArray = NULL );
void DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark );
void DeleteSelectionTab( SCTAB nTab, sal_uInt16 nDelFlag, const ScMarkData& rMark );
SC_DLLPUBLIC void SetColWidth( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth );
+ SC_DLLPUBLIC void SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth );
SC_DLLPUBLIC void SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight );
SC_DLLPUBLIC void SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, SCTAB nTab,
sal_uInt16 nNewHeight );
SC_DLLPUBLIC void SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, SCTAB nTab,
sal_uInt16 nNewHeight );
- void SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_Bool bManual );
+ SC_DLLPUBLIC void SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_Bool bManual );
SC_DLLPUBLIC sal_uInt16 GetColWidth( SCCOL nCol, SCTAB nTab ) const;
SC_DLLPUBLIC sal_uInt16 GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero = true ) const;
@@ -1319,7 +1293,7 @@ public:
const Fraction& rZoomX, const Fraction& rZoomY,
sal_Bool bFormula,
const ScMarkData* pMarkData = NULL,
- sal_Bool bSimpleTextImport = sal_False );
+ const ScColWidthParam* pParam = NULL );
SC_DLLPUBLIC sal_Bool SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nExtra,
OutputDevice* pDev,
double nPPTX, double nPPTY,
@@ -1333,12 +1307,11 @@ public:
OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bWidth, sal_Bool bTotalSize = sal_False );
+ sal_Bool bWidth, sal_Bool bTotalSize = false );
SC_DLLPUBLIC void ShowCol(SCCOL nCol, SCTAB nTab, sal_Bool bShow);
SC_DLLPUBLIC void ShowRow(SCROW nRow, SCTAB nTab, sal_Bool bShow);
SC_DLLPUBLIC void ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, sal_Bool bShow);
- SC_DLLPUBLIC void SetColFlags( SCCOL nCol, SCTAB nTab, sal_uInt8 nNewFlags );
SC_DLLPUBLIC void SetRowFlags( SCROW nRow, SCTAB nTab, sal_uInt8 nNewFlags );
SC_DLLPUBLIC void SetRowFlags( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt8 nNewFlags );
@@ -1360,9 +1333,7 @@ public:
::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const;
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL);
- SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow);
SC_DLLPUBLIC bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
- SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol);
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL);
SC_DLLPUBLIC void SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden);
SC_DLLPUBLIC void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden);
@@ -1374,7 +1345,6 @@ public:
bool HasFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
bool ColFiltered(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL);
SC_DLLPUBLIC void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bFiltered);
- SC_DLLPUBLIC void SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bFiltered);
SCROW FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
@@ -1396,7 +1366,7 @@ public:
SCCOL GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) const;
- // #108550#; if bCareManualSize is set then the row
+ // if bCareManualSize is set then the row
// heights are compared only if the manual size flag for
// the row is set. If the bCareManualSize is not set then
// the row heights are always compared.
@@ -1438,7 +1408,7 @@ public:
SC_DLLPUBLIC sal_Bool NeedPageResetAfterTab( SCTAB nTab ) const;
- // war vorher im PageStyle untergracht. Jetzt an jeder Tabelle:
+ // Was stored in PageStyle previously. Now it exists for every table:
SC_DLLPUBLIC sal_Bool HasPrintRange();
SC_DLLPUBLIC sal_uInt16 GetPrintRangeCount( SCTAB nTab );
SC_DLLPUBLIC const ScRange* GetPrintRange( SCTAB nTab, sal_uInt16 nPos );
@@ -1451,8 +1421,6 @@ public:
SC_DLLPUBLIC void ClearPrintRanges( SCTAB nTab );
/** Adds a new print ranges. */
SC_DLLPUBLIC void AddPrintRange( SCTAB nTab, const ScRange& rNew );
-//UNUSED2009-05 /** Removes all old print ranges and sets the passed print ranges. */
-//UNUSED2009-05 void SetPrintRange( SCTAB nTab, const ScRange& rNew );
/** Marks the specified sheet to be printed completely. Deletes old print ranges on the sheet! */
SC_DLLPUBLIC void SetPrintEntireSheet( SCTAB nTab );
SC_DLLPUBLIC void SetRepeatColRange( SCTAB nTab, const ScRange* pNew );
@@ -1461,8 +1429,8 @@ public:
void RestorePrintRanges( const ScPrintRangeSaver& rSaver );
SC_DLLPUBLIC Rectangle GetMMRect( SCCOL nStartCol, SCROW nStartRow,
- SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
- SC_DLLPUBLIC ScRange GetRange( SCTAB nTab, const Rectangle& rMMRect );
+ SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const;
+ SC_DLLPUBLIC ScRange GetRange( SCTAB nTab, const Rectangle& rMMRect ) const;
void UpdStlShtPtrsFrmNms();
void StylesToNames();
@@ -1485,17 +1453,19 @@ public:
void Sort( SCTAB nTab, const ScSortParam& rSortParam, sal_Bool bKeepQuery );
SCSIZE Query( SCTAB nTab, const ScQueryParam& rQueryParam, sal_Bool bKeepSub );
- sal_Bool ValidQuery( SCROW nRow, SCTAB nTab, const ScQueryParam& rQueryParam, sal_Bool* pSpecial = NULL );
SC_DLLPUBLIC sal_Bool CreateQueryParam( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
SCTAB nTab, ScQueryParam& rQueryParam );
void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr);
+ /** Update the dynamic end row position of a current data area. */
+ void UpdateDynamicEndRow(ScDBData& rDBData) const;
+
sal_Bool GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates);
SC_DLLPUBLIC sal_Bool GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates );
sal_Bool GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
- TypedScStrCollection& rStrings, sal_Bool bLimit = sal_False );
+ TypedScStrCollection& rStrings, sal_Bool bLimit = false );
sal_Bool GetFormulaEntries( TypedScStrCollection& rStrings );
sal_Bool HasAutoFilter( SCCOL nCol, SCROW nRow, SCTAB nTab );
@@ -1527,7 +1497,7 @@ public:
sal_Bool IdleCalcTextWidth();
sal_Bool IdleCheckLinks();
- sal_Bool ContinueOnlineSpelling(); // sal_True = etwas gefunden
+ sal_Bool ContinueOnlineSpelling(); // TRUE = found s.th.
void RepaintRange( const ScRange& rRange );
@@ -1553,11 +1523,12 @@ public:
sal_Bool HasRangeOverflow() const { return nRangeOverflowType != 0; }
SC_DLLPUBLIC sal_uInt32 GetRangeOverflowType() const { return nRangeOverflowType; }
- // fuer Broadcasting/Listening
+ // for broadcasting/listening
void SetNoSetDirty( sal_Bool bVal ) { bNoSetDirty = bVal; }
sal_Bool GetNoSetDirty() const { return bNoSetDirty; }
void SetInsertingFromOtherDoc( sal_Bool bVal ) { bInsertingFromOtherDoc = bVal; }
sal_Bool IsInsertingFromOtherDoc() const { return bInsertingFromOtherDoc; }
+ bool IsLoadingMedium() const;
void SetLoadingMedium( bool bVal );
void SetImportingXML( bool bVal );
bool IsImportingXML() const { return bImportingXML; }
@@ -1572,7 +1543,7 @@ public:
ScChartListenerCollection* GetChartListenerCollection() const
{ return pChartListenerCollection; }
void SetChartListenerCollection( ScChartListenerCollection*,
- sal_Bool bSetChartRangeLists = sal_False );
+ sal_Bool bSetChartRangeLists = false );
void UpdateChart( const String& rName );
void RestoreChartListener( const String& rName );
SC_DLLPUBLIC void UpdateChartListenerCollection();
@@ -1585,8 +1556,8 @@ public:
ScChangeViewSettings* GetChangeViewSettings() const { return pChangeViewSettings; }
SC_DLLPUBLIC void SetChangeViewSettings(const ScChangeViewSettings& rNew);
- vos::ORef<SvxForbiddenCharactersTable> GetForbiddenCharacters();
- void SetForbiddenCharacters( const vos::ORef<SvxForbiddenCharactersTable> xNew );
+ rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharacters();
+ void SetForbiddenCharacters( const rtl::Reference<SvxForbiddenCharactersTable> xNew );
sal_uInt8 GetAsianCompression() const; // CharacterCompressionType values
sal_Bool IsValidAsianCompression() const;
@@ -1601,6 +1572,7 @@ public:
SC_DLLPUBLIC ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
+ SC_DLLPUBLIC ScMacroManager* GetMacroManager();
private:
ScDocument(const ScDocument& r); // disabled with no definition
@@ -1660,8 +1632,8 @@ public:
SvtListener* pListener );
void PutInFormulaTree( ScFormulaCell* pCell );
void RemoveFromFormulaTree( ScFormulaCell* pCell );
- void CalcFormulaTree( sal_Bool bOnlyForced = sal_False,
- sal_Bool bNoProgressBar = sal_False );
+ void CalcFormulaTree( sal_Bool bOnlyForced = false,
+ sal_Bool bNoProgressBar = false );
void ClearFormulaTree();
void AppendToFormulaTrack( ScFormulaCell* pCell );
void RemoveFromFormulaTrack( ScFormulaCell* pCell );
@@ -1714,7 +1686,7 @@ public:
}
// add a formula to be remembered for TableOp broadcasts
void AddTableOpFormulaCell( ScFormulaCell* );
- void InvalidateLastTableOpParams() { aLastTableOpParams.bValid = sal_False; }
+ void InvalidateLastTableOpParams() { aLastTableOpParams.bValid = false; }
ScRecursionHelper& GetRecursionHelper()
{
if (!pRecursionHelper)
@@ -1790,7 +1762,6 @@ public:
SC_DLLPUBLIC SfxItemPool* GetEnginePool() const;
SC_DLLPUBLIC ScFieldEditEngine& GetEditEngine();
SC_DLLPUBLIC ScNoteEditEngine& GetNoteEngine();
-//UNUSED2009-05 SfxItemPool& GetNoteItemPool();
ScRefreshTimerControl* GetRefreshTimerControl() const
{ return pRefreshTimerControl; }
@@ -1824,7 +1795,11 @@ public:
bool IsInVBAMode() const;
ScRowBreakIterator* GetRowBreakIterator(SCTAB nTab) const;
-private: // CLOOK-Impl-Methoden
+ void AddSubTotalCell(ScFormulaCell* pCell);
+ void RemoveSubTotalCell(ScFormulaCell* pCell);
+ void SetSubTotalCellsDirty(const ScRange& rDirtyRange);
+
+private: // CLOOK-Impl-methods
/**
* Use this class as a locale variable to merge number formatter from
@@ -1843,7 +1818,7 @@ private: // CLOOK-Impl-Methoden
void MergeNumberFormatter(ScDocument* pSrcDoc);
- void ImplCreateOptions(); // bei Gelegenheit auf on-demand umstellen?
+ void ImplCreateOptions(); // Suggestion: switch to on-demand?
void ImplDeleteOptions();
void DeleteDrawLayer();
@@ -1865,6 +1840,7 @@ private: // CLOOK-Impl-Methoden
const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
void CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs);
+ void CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, SCTAB nTab);
void CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames);
void UpdateRangeNamesInFormulas(
ScClipRangeNameData& rRangeNames, const ScRangeList& rDestRanges, const ScMarkData& rMark,
@@ -1888,3 +1864,4 @@ inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index e152b4a88f97..573d66231dfb 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -149,8 +150,6 @@ public:
virtual void SAL_CALL acquire() throw();
virtual void SAL_CALL release() throw();
-//? virtual UString getClassName(void);
-
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
// XSpreadsheetDocument
@@ -214,8 +213,6 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > SAL_CALL
getDrawPages() throw(::com::sun::star::uno::RuntimeException);
- //! XPrintable??
-
// XGoalSeek
virtual ::com::sun::star::sheet::GoalResult SAL_CALL seekGoal(
const ::com::sun::star::table::CellAddress& aFormulaPosition,
@@ -683,7 +680,6 @@ private:
ScDocShell* pDocShell;
public:
-//UNUSED2008-05 ScSpreadsheetSettingsObj(ScDocShell* pDocSh);
virtual ~ScSpreadsheetSettingsObj();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -861,3 +857,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpcachetable.hxx b/sc/inc/dpcachetable.hxx
index dd02e0256a83..73b3d5e12727 100644
--- a/sc/inc/dpcachetable.hxx
+++ b/sc/inc/dpcachetable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,8 +35,7 @@
#include "collect.hxx"
#include <vector>
-#include <hash_map>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/uno/Reference.hxx>
@@ -49,25 +49,12 @@ namespace com { namespace sun { namespace star {
}}}
class Date;
-
+class ScDPItemData;
+class ScDPCache;
class ScDocument;
class ScRange;
-class ScDPDimension;
-class ScDPCollection;
-struct ScDPCacheCell;
-struct ScQueryParam;
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
-class ScDPItemData;
-// End Comments
-class Date;
-
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
-class ScDPTableDataCache;
struct ScDPValueData;
-// End Comments
-// ----------------------------------------------------------------------------
+struct ScQueryParam;
class SC_DLLPUBLIC ScDPCacheTable
{
@@ -75,18 +62,12 @@ public:
/** individual filter item used in SingleFilter and GroupFilter. */
struct FilterItem
{
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- String maString;
- // End Comments
+ String maString;
double mfValue;
bool mbHasValue;
FilterItem();
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
- bool match( const ScDPItemData& rCellData ) const;
-// End Comments
+ bool match( const ScDPItemData& rCellData ) const;
};
/** interface class used for filtering of rows. */
@@ -95,27 +76,19 @@ public:
public:
/** returns true if the matching condition is met for a single cell
value, or false otherwise. */
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
virtual bool match( const ScDPItemData& rCellData ) const = 0;
-// End Comments
};
/** ordinary single-item filter. */
class SingleFilter : public FilterBase
{
public:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
explicit SingleFilter(String aString, double fValue, bool bHasValue);
- // End Comments
- virtual ~SingleFilter(){}
-
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- virtual bool match(const ScDPItemData& rCellData) const;
- // End Comments
- const String getMatchString();
+ virtual ~SingleFilter() {}
+
+ virtual bool match(const ScDPItemData& rCellData) const;
+
+ const String& getMatchString();
double getMatchValue() const;
bool hasValue() const;
@@ -129,20 +102,13 @@ public:
class GroupFilter : public FilterBase
{
public:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
GroupFilter();
- // End Comments
- virtual ~GroupFilter(){}
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
+ virtual ~GroupFilter() {}
virtual bool match( const ScDPItemData& rCellData ) const;
- // End Comments
void addMatchItem(const String& rStr, double fVal, bool bHasValue);
size_t getMatchItemCount() const;
private:
-
::std::vector<FilterItem> maItems;
};
@@ -154,26 +120,23 @@ public:
Criterion();
};
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- ScDPCacheTable( ScDocument* pDoc,long nId );
- // End Comments
+
+ ScDPCacheTable(ScDPCache* pCache);
~ScDPCacheTable();
sal_Int32 getRowSize() const;
sal_Int32 getColSize() const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- ScDPTableDataCache* GetCache() const;
+ const ScDPCache* getCache() const;
+
/** Fill the internal table from the cell range provided. This function
- assumes that the first row is the column header. */
- void fillTable( const ScQueryParam& rQuery, sal_Bool* pSpecial,
+ assumes that the first row is the column header. */
+ void fillTable( const ScQueryParam& rQuery, bool* pSpecial,
bool bIgnoreEmptyRows, bool bRepeatIfEmpty );
+
/** Fill the internal table from database connection object. This function
assumes that the first row is the column header. */
void fillTable();
- // End Comments
/** Check whether a specified row is active or not. When a row is active,
it is used in calculation of the results data. A row becomes inactive
@@ -182,7 +145,7 @@ public:
/** Set filter on/off flag to each row to control visibility. The caller
must ensure that the table is filled before calling this function. */
- void filterByPageDimension(const ::std::vector<Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rRepeatIfEmptyDims);
+ void filterByPageDimension(const ::std::vector<Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims);
/** Get the cell instance at specified location within the data grid. Note
that the data grid doesn't include the header row. Don't delete the
@@ -190,60 +153,49 @@ public:
const ScDPItemData* getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const;
void getValue( ScDPValueData& rVal, SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const;
String getFieldName( SCCOL nIndex) const;
- //End Comments
- /** Get the field index (i.e. column ID in the original data source) based
- on the string value that corresponds with the column title. It returns
- -1 if no field matching the string value exists. */
- sal_Int32 getFieldIndex(const String& rStr) const;
-
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
/** Get the unique entries for a field specified by index. The caller must
- make sure that the table is filled before calling function, or it will
- get an empty collection. */
+ make sure that the table is filled before calling function, or it will
+ get an empty collection. */
const ::std::vector<SCROW>& getFieldEntries( sal_Int32 nColumn ) const;
- // End Comments
+
/** Filter the table based on the specified criteria, and copy the
result to rTabData. This method is used, for example, to generate
a drill-down data table. */
void filterTable(const ::std::vector<Criterion>& rCriteria,
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rTabData,
- const ::std::hash_set<sal_Int32>& rRepeatIfEmptyDims);
+ const ::boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims);
+ SCROW getOrder(long nDim, SCROW nIndex) const;
void clear();
- void swap(ScDPCacheTable& rOther);
bool empty() const;
+ void setCache(ScDPCache* p);
+ bool hasCache() const;
private:
ScDPCacheTable();
ScDPCacheTable(const ScDPCacheTable&);
+ ScDPCache* getCache();
+
/**
* Check if a given row meets all specified criteria.
*
* @param nRow index of row to be tested.
* @param rCriteria a list of criteria
*/
- bool isRowQualified(sal_Int32 nRow, const ::std::vector<Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rRepeatIfEmptyDims) const;
- void getValueData(ScDocument* pDoc, const ScAddress& rPos, ScDPCacheCell& rCell);
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- void InitNoneCache( ScDocument* pDoc );
- // End Comments
+ bool isRowQualified(sal_Int32 nRow, const ::std::vector<Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims) const;
+
private:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
/** unique field entires for each field (column). */
::std::vector< ::std::vector<SCROW> > maFieldEntries;
- // End Comments
+
/** used to track visibility of rows. The first row below the header row
has the index of 0. */
::std::vector<bool> maRowsVisible;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- ScDPTableDataCache* mpCache;
- ScDPTableDataCache* mpNoneCache;
- // End Comments
+
+ ScDPCache* mpCache;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpdimsave.hxx b/sc/inc/dpdimsave.hxx
index f887ed91ea32..382c72b7a189 100644
--- a/sc/inc/dpdimsave.hxx
+++ b/sc/inc/dpdimsave.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -200,3 +201,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx
index ed66751364a5..79a2743e1620 100644
--- a/sc/inc/dpglobal.hxx
+++ b/sc/inc/dpglobal.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -7,9 +8,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dpglobal.hxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,14 +26,13 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-// Wang Xu Ming - DataPilot migration
-// Buffer&&Performance
-//
+
#ifndef _SC_DPGLOBAL_HXX
#define _SC_DPGLOBAL_HXX
#include <algorithm>
#include <list>
+#include <vector>
#include <tools/gen.hxx>
#include <tools/debug.hxx>
#include <global.hxx>
@@ -104,11 +101,20 @@
class TypedStrData;
class ScDPObject;
+class ScDPInfoWnd;
+class ScDocShell;
+class ScTabViewShell;
class SC_DLLPUBLIC ScDPItemData
{
public:
- enum { MK_VAL = 0x01, MK_DATA = MK_VAL<<1, MK_ERR = MK_DATA<<1, MK_DATE = MK_ERR<<1, MK_DATEPART = MK_DATE<<1 };
+ enum {
+ MK_VAL = 0x01,
+ MK_DATA = 0x02,
+ MK_ERR = 0x04,
+ MK_DATE = 0x08,
+ MK_DATEPART = 0x10
+ };
private:
union
{
@@ -119,43 +125,39 @@ private:
String aString;
double fValue;
sal_uInt8 mbFlag;
- //sal_Bool bHasValue: 1 ;
- //sal_Bool bHasData: 1;
- //sal_Bool bErr: 1;
- friend class ScDPTableDataCache;
+ friend class ScDPCache;
public:
ScDPItemData() : nNumFormat( 0 ), fValue(0.0), mbFlag( 0 ){}
ScDPItemData( sal_uLong nNF, const String & rS, double fV, sal_uInt8 bF ):nNumFormat(nNF), aString(rS), fValue(fV), mbFlag( bF ){}
- ScDPItemData( const String& rS, double fV = 0.0, sal_Bool bHV = sal_False, const sal_uLong nNumFormat = 0 , sal_Bool bData = sal_True) ;
+ ScDPItemData( const String& rS, double fV = 0.0, bool bHV = false, const sal_uLong nNumFormat = 0 , bool bData = true) ;
ScDPItemData( ScDocument* pDoc, SCROW nRow, sal_uInt16 nCol, sal_uInt16 nDocTab );
void SetString( const String& rS ) { aString = rS; mbFlag &= ~(MK_VAL|MK_DATE); nNumFormat = 0; mbFlag |= MK_DATA; }
-// void SetValue ( double value , sal_uLong nNumFormat = 0 ) { bHasValue = sal_True; nNumFormat = 0;bHasData = sal_True; bDate = sal_False; fValue = value ;}
- sal_Bool IsCaseInsEqual( const ScDPItemData& r ) const;
+ bool IsCaseInsEqual( const ScDPItemData& r ) const;
size_t Hash() const;
// exact equality
- sal_Bool operator==( const ScDPItemData& r ) const;
+ bool operator==( const ScDPItemData& r ) const;
// case insensitive equality
static sal_Int32 Compare( const ScDPItemData& rA, const ScDPItemData& rB );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
void dump() const;
#endif
public:
- sal_Bool IsHasData() const ;
- sal_Bool IsHasErr() const ;
- sal_Bool IsValue() const;
+ bool IsHasData() const ;
+ bool IsHasErr() const ;
+ bool IsValue() const;
String GetString() const ;
double GetValue() const ;
sal_uLong GetNumFormat() const ;
- sal_Bool HasStringData() const ;
- sal_Bool IsDate() const;
- sal_Bool HasDatePart() const;
- void SetDate( sal_Bool b ) ;
+ bool HasStringData() const ;
+ bool IsDate() const;
+ bool HasDatePart() const;
+ void SetDate( bool b ) ;
TypedStrData* CreateTypeString( );
sal_uInt8 GetType() const;
@@ -166,11 +168,10 @@ public:
class SC_DLLPUBLIC ScDPItemDataPool
{
public:
- // construct
- ScDPItemDataPool(void);
+ ScDPItemDataPool();
ScDPItemDataPool(const ScDPItemDataPool& r);
- virtual ~ScDPItemDataPool(void);
+ virtual ~ScDPItemDataPool();
virtual const ScDPItemData* getData( sal_Int32 nId );
virtual sal_Int32 getDataId( const ScDPItemData& aData );
virtual sal_Int32 insertData( const ScDPItemData& aData );
@@ -180,28 +181,18 @@ protected:
size_t operator() (const ScDPItemData &rData) const { return rData.Hash(); }
};
- typedef ::std::hash_multimap< ScDPItemData, sal_Int32, DataHashFunc > DataHash;
+ typedef ::boost::unordered_multimap< ScDPItemData, sal_Int32, DataHashFunc > DataHash;
::std::vector< ScDPItemData > maItems;
DataHash maItemIds;
};
-class ScDPInfoWnd;
-class ScDocShell;
-class ScTabViewShell;
namespace ScDPGlobal
{
-// used for core data
- String GetFieldFuncString( const String& rSourceName, sal_uInt16 &rFuncMask, sal_Bool bIsValue );
- String GetFuncString( const String &rString, const sal_uInt16 nIndex );
- com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> DP_GetMembers( const com::sun::star::uno::Reference<
- com::sun::star::sheet::XDimensionsSupplier>&rSrc, long nField );
// common operation
String operator + ( const String & rL, const String &rR );
Rectangle operator *( const Rectangle &rLeft, const std::pair<double,double> & rRight );
-// used for DataPilot Panel
- ScDPInfoWnd* GetDPInfoWnd( ScTabViewShell *pViewShell );
- bool ChkDPTableOverlap( ScDocument *pDestDoc, std::list<ScDPObject> & rClipboard, SCCOL nClipStartCol, SCROW nClipStartRow, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, sal_uInt16 nEndTab, sal_Bool bExcludeClip = sal_False );
-
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index b8fde6ecf4b7..01ec98504549 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,15 +30,12 @@
#define SC_DPGROUP_HXX
#include <vector>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
#include <boost/shared_ptr.hpp>
#include "dptabdat.hxx"
#include "scdllapi.h"
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "dpglobal.hxx"
-// End Comments
class ScDocument;
class SvNumberFormatter;
@@ -54,7 +52,7 @@ struct ScDPNumGroupInfo
double End;
double Step;
- ScDPNumGroupInfo() : Enable(sal_False), DateValues(sal_False), AutoStart(sal_False), AutoEnd(sal_False),
+ ScDPNumGroupInfo() : Enable(false), DateValues(false), AutoStart(false), AutoEnd(false),
Start(0.0), End(0.0), Step(0.0) {}
};
@@ -76,11 +74,9 @@ public:
sal_Int32 GetDatePart() const { return nDatePart; }
const ScDPNumGroupInfo& GetNumInfo() const { return aNumInfo; }
- // Wang Xu Ming -- 2009-9-8
- // DataPilot Migration - Cache&&Performance
- void FillColumnEntries( SCCOL nSourceDim, ScDPTableDataCache* pCahe , std::vector< SCROW >& rEntries,
- const std::vector< SCROW >& rOriginal ) const;
- // End Comments
+ void FillColumnEntries(
+ SCCOL nSourceDim, const ScDPCache* pCahe , std::vector<SCROW>& rEntries,
+ const std::vector<SCROW>& rOriginal) const;
};
// --------------------------------------------------------------------
@@ -114,10 +110,7 @@ class ScDPGroupDimension
String aGroupName;
ScDPDateGroupHelper* pDateHelper;
ScDPGroupItemVec aItems;
- // Wang Xu Ming -- 2009-9-4
- // DataPilot Migration - Cache&&Performance
mutable ::std::vector< SCROW > maMemberEntries;
- // End Comments
public:
ScDPGroupDimension( long nSource, const String& rNewName );
ScDPGroupDimension( const ScDPGroupDimension& rOther );
@@ -132,10 +125,7 @@ public:
long GetGroupDim() const { return nGroupDim; }
const String& GetName() const { return aGroupName; }
-// Wang Xu Ming -- 2009-9-2
-// DataPilot Migration - Cache&&Performance
const std::vector< SCROW >& GetColumnEntries( const ScDPCacheTable& rCacheTable, const std::vector< SCROW >& rOriginal ) const;
-// End Comments
const ScDPGroupItem* GetGroupForData( const ScDPItemData& rData ) const; // rData = entry in original dim.
const ScDPGroupItem* GetGroupForName( const ScDPItemData& rName ) const; // rName = entry in group dim.
const ScDPGroupItem* GetGroupByIndex( size_t nIndex ) const;
@@ -157,10 +147,7 @@ class SC_DLLPUBLIC ScDPNumGroupDimension
{
ScDPNumGroupInfo aGroupInfo; // settings
ScDPDateGroupHelper* pDateHelper;
-// Wang Xu Ming -- 2009-9-4
-// DataPilot Migration - Cache&&Performance
mutable ::std::vector< SCROW > maMemberEntries;
-// End Comments
mutable bool bHasNonInteger; // initialized in GetNumEntries
mutable sal_Unicode cDecSeparator; // initialized in GetNumEntries
@@ -178,8 +165,9 @@ public:
const ScDPDateGroupHelper* GetDateHelper() const { return pDateHelper; }
- const std::vector< SCROW >& GetNumEntries( SCCOL nSourceDim, ScDPTableDataCache* pCache,
- const std::vector< SCROW >& rOriginal ) const;
+ const std::vector<SCROW>& GetNumEntries(
+ SCCOL nSourceDim, const ScDPCache* pCache,
+ const std::vector< SCROW >& rOriginal) const;
void MakeDateHelper( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart );
@@ -193,7 +181,7 @@ public:
class ScDPGroupTableData : public ScDPTableData
{
- typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > StringHashSet;
+ typedef ::boost::unordered_set< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > StringHashSet;
::boost::shared_ptr<ScDPTableData> pSourceData;
long nSourceCount;
@@ -202,11 +190,8 @@ class ScDPGroupTableData : public ScDPTableData
ScDocument* pDoc;
StringHashSet aGroupNames;
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
void FillGroupValues( SCROW* pItemDataIndex, long nCount, const long* pDims );
virtual long GetSourceDim( long nDim );
-// End Comments
bool IsNumGroupDimension( long nDimension ) const;
void GetNumGroupInfo( long nDimension, ScDPNumGroupInfo& rInfo,
@@ -226,14 +211,11 @@ public:
ScDocument* GetDocument() { return pDoc; }
virtual long GetColumnCount();
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
virtual long GetMembersCount( long nDim );
virtual const std::vector< SCROW >& GetColumnEntries( long nColumn ) ;
virtual const ScDPItemData* GetMemberById( long nDim, long nId);
virtual long Compare( long nDim, long nDataId1, long nDataId2);
-// End Comments
virtual String getDimensionName(long nColumn);
virtual sal_Bool getIsDataLayoutDimension(long nColumn);
virtual sal_Bool IsDateDimension(long nDim);
@@ -244,9 +226,9 @@ public:
virtual bool IsRepeatIfEmpty();
virtual void CreateCacheTable();
- virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rDataDims);
+ virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rDataDims);
virtual void GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
- const ::std::hash_set<sal_Int32>& rCatDims,
+ const ::boost::unordered_set<sal_Int32>& rCatDims,
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
virtual const ScDPCacheTable& GetCacheTable() const;
@@ -263,3 +245,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index e69f8e8c3a3f..c65e46661b9e 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,8 @@
#include "pivot.hxx"
#include <com/sun/star/sheet/XDimensionsSupplier.hpp>
+#include <boost/ptr_container/ptr_list.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/shared_ptr.hpp>
//------------------------------------------------------------------
@@ -88,7 +91,7 @@ struct ScDPServiceDesc
};
-class SC_DLLPUBLIC ScDPObject : public ScDataObject
+class SC_DLLPUBLIC ScDPObject
{
private:
ScDocument* pDoc;
@@ -119,29 +122,24 @@ private:
long mnCacheId;
public:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- inline void SetRefresh() { bRefresh = sal_True; }
- const ScDPTableDataCache* GetCache() const;
- long GetCacheId() const;
- void SetCacheId( long nCacheId );
- sal_uLong RefreshCache();
- // End Comments
- ScDPObject( ScDocument* pD );
- ScDPObject(const ScDPObject& r);
- virtual ~ScDPObject();
-
- virtual ScDataObject* Clone() const;
+ ScDPObject(ScDocument* pD);
+ ScDPObject(const ScDPObject& r);
+ ~ScDPObject();
+ /**
+ * When a DP object is "alive", it has table output on a sheet. This flag
+ * doesn't really change the behavior of the object, but is used only for
+ * testing purposes.
+ */
void SetAlive(sal_Bool bSet);
void SetAllowMove(sal_Bool bSet);
void InvalidateData();
- void InvalidateSource();
+ void ClearSource();
void Output( const ScAddress& rPos );
- ScRange GetNewOutputRange( sal_Bool& rOverflow );
+ ScRange GetNewOutputRange( bool& rOverflow );
const ScRange GetOutputRangeByType( sal_Int32 nType );
void SetSaveData(const ScDPSaveData& rData);
@@ -150,9 +148,6 @@ public:
void SetOutRange(const ScRange& rRange);
const ScRange& GetOutRange() const { return aOutRange; }
- void SetAutoFormatIndex (const sal_uInt16 nIndex);
- sal_uInt16 GetAutoFormatIndex() const;
-
void SetHeaderLayout(bool bUseGrid);
bool GetHeaderLayout() const;
@@ -251,14 +246,12 @@ public:
CreateSource( const ScDPServiceDesc& rDesc );
static void ConvertOrientation( ScDPSaveData& rSaveData,
- const ScPivotFieldVector& rFields, sal_uInt16 nOrient,
- ScDocument* pDoc, SCROW nRow, SCTAB nTab,
+ const ::std::vector<PivotField>& rFields, sal_uInt16 nOrient,
const com::sun::star::uno::Reference<
com::sun::star::sheet::XDimensionsSupplier>& xSource,
- bool bOldDefaults,
- const ScPivotFieldVector* pRefColFields = 0,
- const ScPivotFieldVector* pRefRowFields = 0,
- const ScPivotFieldVector* pRefPageFields = 0 );
+ ::std::vector<PivotField>* pRefColFields = NULL,
+ ::std::vector<PivotField>* pRefRowFields = NULL,
+ ::std::vector<PivotField>* pRefPageFields = NULL );
static bool IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags );
};
@@ -266,35 +259,50 @@ public:
// ============================================================================
-class ScDPCollection : public ScCollection
+class ScDPCollection
{
private:
+ typedef ::boost::ptr_vector<ScDPObject> TablesType;
+
ScDocument* pDoc;
+ TablesType maTables;
+
public:
- ScDPCollection(ScDocument* pDocument);
- ScDPCollection(const ScDPCollection& r);
- virtual ~ScDPCollection();
+ ScDPCollection(ScDocument* pDocument);
+ ScDPCollection(const ScDPCollection& r);
+ ~ScDPCollection();
- virtual ScDataObject* Clone() const;
+ SC_DLLPUBLIC size_t GetCount() const;
+ SC_DLLPUBLIC ScDPObject* operator[](size_t nIndex);
+ SC_DLLPUBLIC const ScDPObject* operator[](size_t nIndex) const;
- ScDPObject* operator[](sal_uInt16 nIndex) const {return (ScDPObject*)At(nIndex);}
- ScDPObject* GetByName(const String& rName) const;
+ const ScDPObject* GetByName(const String& rName) const;
- void DeleteOnTab( SCTAB nTab );
- void UpdateReference( UpdateRefMode eUpdateRefMode,
- const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
+ void DeleteOnTab( SCTAB nTab );
+ void UpdateReference( UpdateRefMode eUpdateRefMode,
+ const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
- sal_Bool RefsEqual( const ScDPCollection& r ) const;
- void WriteRefsTo( ScDPCollection& r ) const;
+ bool RefsEqual( const ScDPCollection& r ) const;
+ void WriteRefsTo( ScDPCollection& r ) const;
- String CreateNewName( sal_uInt16 nMin = 1 ) const;
+ /**
+ * Create a new name that's not yet used by any existing data pilot
+ * objects. All data pilot names are 'DataPilot' + <num>, and the nMin
+ * specifies the minimum number allowed.
+ *
+ * @param nMin minimum number allowed.
+ *
+ * @return new name for data pilot object.
+ */
+ String CreateNewName( sal_uInt16 nMin = 1 ) const;
void FreeTable(ScDPObject* pDPObj);
SC_DLLPUBLIC bool InsertNewTable(ScDPObject* pDPObj);
- bool HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
+ bool HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx
index c4bb203ecbb8..99ca1ed82754 100644
--- a/sc/inc/dpoutput.hxx
+++ b/sc/inc/dpoutput.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -143,7 +144,7 @@ public:
void Output(); //! Refresh?
ScRange GetOutputRange( sal_Int32 nRegionType = ::com::sun::star::sheet::DataPilotOutputRangeType::WHOLE );
long GetHeaderRows();
- sal_Bool HasError(); // range overflow or exception from source
+ bool HasError(); // range overflow or exception from source
void GetPositionData(const ScAddress& rPos, ::com::sun::star::sheet::DataPilotTablePositionData& rPosData);
@@ -172,3 +173,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpoutputgeometry.hxx b/sc/inc/dpoutputgeometry.hxx
index 7069787e803d..c5c65195eff0 100644
--- a/sc/inc/dpoutputgeometry.hxx
+++ b/sc/inc/dpoutputgeometry.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index 8c4babc77da3..2d9ba1be7dcc 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,14 +29,19 @@
#ifndef SC_DPSAVE_HXX
#define SC_DPSAVE_HXX
-#include <tools/string.hxx>
-#include <tools/list.hxx>
+#include <list>
+#include <memory>
+
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/unordered_map.hpp>
+
#include <com/sun/star/sheet/XDimensionsSupplier.hpp>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
+#include <rtl/ustring.hxx>
+#include <sal/types.h>
+#include <tools/string.hxx>
+
#include "scdllapi.h"
-#include <hash_map>
-#include <list>
-#include <memory>
namespace com { namespace sun { namespace star { namespace sheet {
struct DataPilotFieldReference;
@@ -49,238 +55,293 @@ class ScDPTableData;
// --------------------------------------------------------------------
//
-// classes to save Data Pilot settings
+// classes to save Data Pilot settings
//
class ScDPSaveMember
{
private:
- String aName;
+ ::rtl::OUString aName;
::std::auto_ptr<rtl::OUString> mpLayoutName; // custom name to be displayed in the table.
- sal_uInt16 nVisibleMode;
- sal_uInt16 nShowDetailsMode;
+ sal_uInt16 nVisibleMode;
+ sal_uInt16 nShowDetailsMode;
public:
- ScDPSaveMember(const String& rName);
- ScDPSaveMember(const ScDPSaveMember& r);
- ~ScDPSaveMember();
+ ScDPSaveMember(const ::rtl::OUString& rName);
+ ScDPSaveMember(const ScDPSaveMember& r);
+ ~ScDPSaveMember();
+
+ bool operator== ( const ScDPSaveMember& r ) const;
+
+ const ::rtl::OUString& GetName() const
+ { return aName; }
- sal_Bool operator== ( const ScDPSaveMember& r ) const;
+ bool HasIsVisible() const;
+ SC_DLLPUBLIC void SetIsVisible(bool bSet);
+ bool GetIsVisible() const
+ { return bool(nVisibleMode); }
- const String& GetName() const { return aName; }
- sal_Bool HasIsVisible() const;
- SC_DLLPUBLIC void SetIsVisible(sal_Bool bSet);
- sal_Bool GetIsVisible() const { return sal_Bool(nVisibleMode); }
- sal_Bool HasShowDetails() const;
- SC_DLLPUBLIC void SetShowDetails(sal_Bool bSet);
- sal_Bool GetShowDetails() const { return sal_Bool(nShowDetailsMode); }
+ bool HasShowDetails() const;
+ SC_DLLPUBLIC void SetShowDetails(bool bSet);
+ bool GetShowDetails() const
+ { return bool(nShowDetailsMode); }
- void SetName( const String& rNew ); // used if the source member was renamed (groups)
+ void SetName( const ::rtl::OUString& rNew ); // used if the source member was renamed (groups)
- SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName );
+ SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName );
SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const;
- void RemoveLayoutName();
+ void RemoveLayoutName();
- void WriteToSource( const com::sun::star::uno::Reference<
- com::sun::star::uno::XInterface>& xMember,
- sal_Int32 nPosition );
+ void WriteToSource( const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& xMember,
+ sal_Int32 nPosition );
};
bool operator == (const ::com::sun::star::sheet::DataPilotFieldSortInfo &l, const ::com::sun::star::sheet::DataPilotFieldSortInfo &r );
bool operator == (const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &l, const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &r );
bool operator == (const ::com::sun::star::sheet::DataPilotFieldReference &l, const ::com::sun::star::sheet::DataPilotFieldReference &r );
+
class SC_DLLPUBLIC ScDPSaveDimension
{
private:
- String aName;
- String* pSelectedPage;
+ ::rtl::OUString aName;
+ ::rtl::OUString* pSelectedPage;
::std::auto_ptr<rtl::OUString> mpLayoutName;
::std::auto_ptr<rtl::OUString> mpSubtotalName;
- sal_Bool bIsDataLayout;
- sal_Bool bDupFlag;
- sal_uInt16 nOrientation;
- sal_uInt16 nFunction; // enum GeneralFunction, for data dimensions
- long nUsedHierarchy;
- sal_uInt16 nShowEmptyMode; //! at level
- sal_Bool bSubTotalDefault; //! at level
- long nSubTotalCount;
- sal_uInt16* pSubTotalFuncs; // enum GeneralFunction
+ bool bIsDataLayout;
+ bool bDupFlag;
+ sal_uInt16 nOrientation;
+ sal_uInt16 nFunction; // enum GeneralFunction, for data dimensions
+ long nUsedHierarchy;
+ sal_uInt16 nShowEmptyMode; //! at level
+ bool bSubTotalDefault; //! at level
+ long nSubTotalCount;
+ sal_uInt16* pSubTotalFuncs; // enum GeneralFunction
::com::sun::star::sheet::DataPilotFieldReference* pReferenceValue;
- ::com::sun::star::sheet::DataPilotFieldSortInfo* pSortInfo; // (level)
- ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pAutoShowInfo; // (level)
- ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pLayoutInfo; // (level)
+ ::com::sun::star::sheet::DataPilotFieldSortInfo* pSortInfo; // (level)
+ ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pAutoShowInfo; // (level)
+ ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pLayoutInfo; // (level)
public:
- typedef std::hash_map <String, ScDPSaveMember*, rtl::OUStringHash> MemberHash;
- typedef std::list <ScDPSaveMember*> MemberList;
+ typedef boost::unordered_map <rtl::OUString, ScDPSaveMember*, rtl::OUStringHash> MemberHash;
+ typedef std::list <ScDPSaveMember*> MemberList;
+
private:
MemberHash maMemberHash;
MemberList maMemberList;
+
public:
- ScDPSaveDimension(const String& rName, sal_Bool bDataLayout);
- ScDPSaveDimension(const ScDPSaveDimension& r);
- ~ScDPSaveDimension();
+ ScDPSaveDimension(const ::rtl::OUString& rName, bool bDataLayout);
+ ScDPSaveDimension(const ScDPSaveDimension& r);
+ ~ScDPSaveDimension();
- sal_Bool operator== ( const ScDPSaveDimension& r ) const;
+ bool operator== ( const ScDPSaveDimension& r ) const;
- const MemberList& GetMembers() const { return maMemberList; }
- void AddMember(ScDPSaveMember* pMember);
+ const MemberList& GetMembers() const
+ { return maMemberList; }
- void SetDupFlag(sal_Bool bSet) { bDupFlag = bSet; }
- sal_Bool GetDupFlag() const { return bDupFlag; }
+ void AddMember(ScDPSaveMember* pMember);
- const String& GetName() const { return aName; }
- sal_Bool IsDataLayout() const { return bIsDataLayout; }
+ void SetDupFlag(bool bSet)
+ { bDupFlag = bSet; }
- void SetName( const String& rNew ); // used if the source dim was renamed (groups)
+ bool GetDupFlag() const
+ { return bDupFlag; }
- void SetOrientation(sal_uInt16 nNew);
- void SetSubTotals(long nCount, const sal_uInt16* pFuncs);
- long GetSubTotalsCount() const { return nSubTotalCount; }
- sal_uInt16 GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; }
- bool HasShowEmpty() const;
- void SetShowEmpty(sal_Bool bSet);
- sal_Bool GetShowEmpty() const { return sal_Bool(nShowEmptyMode); }
- void SetFunction(sal_uInt16 nNew); // enum GeneralFunction
- sal_uInt16 GetFunction() const { return nFunction; }
- void SetUsedHierarchy(long nNew);
- long GetUsedHierarchy() const { return nUsedHierarchy; }
+ const ::rtl::OUString& GetName() const
+ { return aName; }
- void SetLayoutName(const ::rtl::OUString& rName);
- const ::rtl::OUString* GetLayoutName() const;
- void RemoveLayoutName();
- void SetSubtotalName(const ::rtl::OUString& rName);
- const ::rtl::OUString* GetSubtotalName() const;
+ bool IsDataLayout() const
+ { return bIsDataLayout; }
- bool IsMemberNameInUse(const ::rtl::OUString& rName) const;
+ void SetName( const ::rtl::OUString& rNew ); // used if the source dim was renamed (groups)
- const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const { return pReferenceValue; }
- void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew);
+ void SetOrientation(sal_uInt16 nNew);
+ void SetSubTotals(long nCount, const sal_uInt16* pFuncs);
+ long GetSubTotalsCount() const
+ { return nSubTotalCount; }
- const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const { return pSortInfo; }
- void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew);
- const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const { return pAutoShowInfo; }
- void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew);
- const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const { return pLayoutInfo; }
- void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew);
+ sal_uInt16 GetSubTotalFunc(long nIndex) const
+ { return pSubTotalFuncs[nIndex]; }
- void SetCurrentPage( const String* pPage ); // NULL = no selection (all)
- sal_Bool HasCurrentPage() const;
- const String& GetCurrentPage() const;
+ bool HasShowEmpty() const;
+ void SetShowEmpty(bool bSet);
+ bool GetShowEmpty() const
+ { return bool(nShowEmptyMode); }
- sal_uInt16 GetOrientation() const { return nOrientation; }
+ void SetFunction(sal_uInt16 nNew); // enum GeneralFunction
+ sal_uInt16 GetFunction() const
+ { return nFunction; }
- ScDPSaveMember* GetExistingMemberByName(const String& rName);
- ScDPSaveMember* GetMemberByName(const String& rName);
+ void SetUsedHierarchy(long nNew);
+ long GetUsedHierarchy() const
+ { return nUsedHierarchy; }
+
+ void SetLayoutName(const ::rtl::OUString& rName);
+ const ::rtl::OUString* GetLayoutName() const;
+ void RemoveLayoutName();
+ void SetSubtotalName(const ::rtl::OUString& rName);
+ const ::rtl::OUString* GetSubtotalName() const;
+
+ bool IsMemberNameInUse(const ::rtl::OUString& rName) const;
+
+ const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const
+ { return pReferenceValue; }
+
+ void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew);
+
+ const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const
+ { return pSortInfo; }
+
+ void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew);
+ const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const
+ { return pAutoShowInfo; }
+
+ void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew);
+ const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const
+ { return pLayoutInfo; }
+
+ void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew);
+
+ void SetCurrentPage( const ::rtl::OUString* pPage ); // NULL = no selection (all)
+ bool HasCurrentPage() const;
+ const ::rtl::OUString& GetCurrentPage() const;
+
+ sal_uInt16 GetOrientation() const
+ { return nOrientation; }
+
+ ScDPSaveMember* GetExistingMemberByName(const ::rtl::OUString& rName);
+
+ /**
+ * Get a member object by its name. If one doesn't exist, creat a new
+ * object and return it. This class manages the life cycle of all member
+ * objects belonging to it, so <i>don't delete the returned instance.</i>
+ *
+ * @param rName member name
+ *
+ * @return pointer to the member object.
+ */
+ ScDPSaveMember* GetMemberByName(const ::rtl::OUString& rName);
- void SetMemberPosition( const String& rName, sal_Int32 nNewPos );
+ void SetMemberPosition( const ::rtl::OUString& rName, sal_Int32 nNewPos );
- void WriteToSource( const com::sun::star::uno::Reference<
- com::sun::star::uno::XInterface>& xDim );
- void Refresh( const com::sun::star::uno::Reference<
- com::sun::star::sheet::XDimensionsSupplier>& xSource ,
- const std::list<String> & deletedDims);
+ void WriteToSource( const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& xDim );
+ void Refresh( const com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>& xSource ,
+ const std::list<rtl::OUString> & deletedDims);
- void UpdateMemberVisibility(const ::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData);
+ void UpdateMemberVisibility(const ::boost::unordered_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData);
- bool HasInvisibleMember() const;
+ bool HasInvisibleMember() const;
};
class ScDPSaveData
{
private:
- List aDimList;
- ScDPDimensionSaveData* pDimensionData; // settings that create new dimensions
- sal_uInt16 nColumnGrandMode;
- sal_uInt16 nRowGrandMode;
- sal_uInt16 nIgnoreEmptyMode;
- sal_uInt16 nRepeatEmptyMode;
- sal_Bool bFilterButton; // not passed to DataPilotSource
- sal_Bool bDrillDown; // not passed to DataPilotSource
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- long mnCacheId;
- // End Comments
+ boost::ptr_vector<ScDPSaveDimension> aDimList;
+ ScDPDimensionSaveData* pDimensionData; // settings that create new dimensions
+ sal_uInt16 nColumnGrandMode;
+ sal_uInt16 nRowGrandMode;
+ sal_uInt16 nIgnoreEmptyMode;
+ sal_uInt16 nRepeatEmptyMode;
+ bool bFilterButton; // not passed to DataPilotSource
+ bool bDrillDown; // not passed to DataPilotSource
/** if true, all dimensions already have all of their member instances
* created. */
- bool mbDimensionMembersBuilt;
+ bool mbDimensionMembersBuilt;
::std::auto_ptr<rtl::OUString> mpGrandTotalName;
public:
- SC_DLLPUBLIC ScDPSaveData();
- ScDPSaveData(const ScDPSaveData& r);
- SC_DLLPUBLIC ~ScDPSaveData();
-
- ScDPSaveData& operator= ( const ScDPSaveData& r );
-
- sal_Bool operator== ( const ScDPSaveData& r ) const;
-
- SC_DLLPUBLIC void SetGrandTotalName(const ::rtl::OUString& rName);
- SC_DLLPUBLIC const ::rtl::OUString* GetGrandTotalName() const;
-
- const List& GetDimensions() const { return aDimList; }
- void AddDimension(ScDPSaveDimension* pDim) { aDimList.Insert(pDim, LIST_APPEND); }
-
- ScDPSaveDimension* GetDimensionByName(const String& rName);
- SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension();
- SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const;
-
- ScDPSaveDimension* DuplicateDimension(const String& rName);
- SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim);
-
- SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName) const;
- SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const String& rName);
-
- void RemoveDimensionByName(const String& rName);
-
- ScDPSaveDimension* GetInnermostDimension(sal_uInt16 nOrientation);
- ScDPSaveDimension* GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation);
- long GetDataDimensionCount() const;
-
-
- void SetPosition( ScDPSaveDimension* pDim, long nNew );
- SC_DLLPUBLIC void SetColumnGrand( sal_Bool bSet );
- sal_Bool GetColumnGrand() const { return sal_Bool(nColumnGrandMode); }
- SC_DLLPUBLIC void SetRowGrand( sal_Bool bSet );
- sal_Bool GetRowGrand() const { return sal_Bool(nRowGrandMode); }
- void SetIgnoreEmptyRows( sal_Bool bSet );
- sal_Bool GetIgnoreEmptyRows() const { return sal_Bool(nIgnoreEmptyMode); }
- void SetRepeatIfEmpty( sal_Bool bSet );
- sal_Bool GetRepeatIfEmpty() const { return sal_Bool(nRepeatEmptyMode); }
-
- SC_DLLPUBLIC void SetFilterButton( sal_Bool bSet );
- sal_Bool GetFilterButton() const { return bFilterButton; }
- SC_DLLPUBLIC void SetDrillDown( sal_Bool bSet );
- sal_Bool GetDrillDown() const { return bDrillDown; }
-
- void WriteToSource( const com::sun::star::uno::Reference<
- com::sun::star::sheet::XDimensionsSupplier>& xSource );
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- void Refresh( const com::sun::star::uno::Reference<
- com::sun::star::sheet::XDimensionsSupplier>& xSource );
- sal_Bool IsEmpty() const;
- inline long GetCacheId() const{ return mnCacheId; }
- inline void SetCacheId( long nCacheId ){ mnCacheId = nCacheId; }
- // End Comments
- const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; }
- SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there
- void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied
- void BuildAllDimensionMembers(ScDPTableData* pData);
+ SC_DLLPUBLIC ScDPSaveData();
+ ScDPSaveData(const ScDPSaveData& r);
+ SC_DLLPUBLIC ~ScDPSaveData();
+
+ ScDPSaveData& operator= ( const ScDPSaveData& r );
+
+ bool operator== ( const ScDPSaveData& r ) const;
+
+ SC_DLLPUBLIC void SetGrandTotalName(const ::rtl::OUString& rName);
+ SC_DLLPUBLIC const ::rtl::OUString* GetGrandTotalName() const;
+
+ const boost::ptr_vector<ScDPSaveDimension>& GetDimensions() const
+ { return aDimList; }
+
+ void AddDimension(ScDPSaveDimension* pDim)
+ { aDimList.push_back(pDim); }
+
+ /**
+ * Get a dimension object by its name. <i>If one doesn't exist for the
+ * given name, it creats a new one.</i>
+ *
+ * @param rName dimension name
+ *
+ * @return pointer to the dimension object. The ScDPSaveData instance
+ * manages its life cycle; hence the caller must
+ * <i>not</i> delete this object.
+ */
+ ScDPSaveDimension* GetDimensionByName(const ::rtl::OUString& rName);
+ SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension();
+ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const;
+
+ ScDPSaveDimension* DuplicateDimension(const ::rtl::OUString& rName);
+ SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim);
+
+ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const ::rtl::OUString& rName) const;
+ SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const ::rtl::OUString& rName);
+
+ void RemoveDimensionByName(const ::rtl::OUString& rName);
+
+ ScDPSaveDimension* GetInnermostDimension(sal_uInt16 nOrientation);
+ ScDPSaveDimension* GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation);
+ long GetDataDimensionCount() const;
+
+ void SetPosition( ScDPSaveDimension* pDim, long nNew );
+ SC_DLLPUBLIC void SetColumnGrand( bool bSet );
+ bool GetColumnGrand() const
+ { return bool(nColumnGrandMode); }
+
+ SC_DLLPUBLIC void SetRowGrand( bool bSet );
+ bool GetRowGrand() const
+ { return bool(nRowGrandMode); }
+
+ void SetIgnoreEmptyRows( bool bSet );
+ bool GetIgnoreEmptyRows() const
+ { return bool(nIgnoreEmptyMode); }
+
+ void SetRepeatIfEmpty( bool bSet );
+ bool GetRepeatIfEmpty() const
+ { return bool(nRepeatEmptyMode); }
+
+ SC_DLLPUBLIC void SetFilterButton( bool bSet );
+ bool GetFilterButton() const
+ { return bFilterButton; }
+
+ SC_DLLPUBLIC void SetDrillDown( bool bSet );
+ bool GetDrillDown() const
+ { return bDrillDown; }
+
+ void WriteToSource( const com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>& xSource );
+ void Refresh( const com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>& xSource );
+ bool IsEmpty() const;
+
+ const ScDPDimensionSaveData* GetExistingDimensionData() const
+ { return pDimensionData; }
+
+ SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there
+ void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied
+ void BuildAllDimensionMembers(ScDPTableData* pData);
/**
* Check whether a dimension has one or more invisible members.
*
* @param rDimName dimension name
*/
- SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const;
+ SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const;
};
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpsdbtab.hxx b/sc/inc/dpsdbtab.hxx
index 0e41af8f17bb..b86d0869e404 100644
--- a/sc/inc/dpsdbtab.hxx
+++ b/sc/inc/dpsdbtab.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,46 +34,41 @@
#include "dptabdat.hxx"
#include <vector>
-#include <set>
+#include <boost/unordered_set.hpp>
class ScDPCacheTable;
class ScDocument;
-// --------------------------------------------------------------------
-//
-// implementation of ScDPTableData with database data
-//
-
struct ScImportSourceDesc
{
String aDBName;
String aObject;
sal_uInt16 nType; // enum DataImportMode
- sal_Bool bNative;
+ bool bNative;
+ ScDocument* mpDoc;
- ScImportSourceDesc() : nType(0), bNative(sal_False) {}
+ ScImportSourceDesc(ScDocument* pDoc) : nType(0), bNative(false), mpDoc(pDoc) {}
- sal_Bool operator== ( const ScImportSourceDesc& rOther ) const
+ bool operator== ( const ScImportSourceDesc& rOther ) const
{ return aDBName == rOther.aDBName &&
aObject == rOther.aObject &&
nType == rOther.nType &&
- bNative == rOther.bNative; }
-
- // Wang Xu Ming -- 2009-9-15
- // DataPilot Migration - Cache&&Performance
- ScDPTableDataCache* GetExistDPObjectCache( ScDocument* pDoc ) const;
- ScDPTableDataCache* CreateCache( ScDocument* pDoc , long nID ) const;
- ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const;
- long GetCacheId( ScDocument* pDoc, long nID ) const;
- // End Comments
+ bNative == rOther.bNative &&
+ mpDoc == rOther.mpDoc; }
+
+ ScDPCache* CreateCache() const;
};
+/**
+ * This class represents source data from database source.
+ */
class ScDatabaseDPData : public ScDPTableData
{
private:
- ScDPCacheTable aCacheTable;
+ const ScImportSourceDesc& mrImport;
+ ScDPCacheTable aCacheTable;
public:
- ScDatabaseDPData(ScDocument* pDoc, const ScImportSourceDesc& rImport, long nCacheId = -1);
+ ScDatabaseDPData(ScDocument* pDoc, const ScImportSourceDesc& rImport);
virtual ~ScDatabaseDPData();
virtual long GetColumnCount();
@@ -83,9 +79,9 @@ public:
virtual void SetEmptyFlags( sal_Bool bIgnoreEmptyRows, sal_Bool bRepeatIfEmpty );
virtual void CreateCacheTable();
- virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rDataDims);
+ virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rDataDims);
virtual void GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
- const ::std::hash_set<sal_Int32>& rCatDims,
+ const ::boost::unordered_set<sal_Int32>& rCatDims,
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
virtual const ScDPCacheTable& GetCacheTable() const;
@@ -95,3 +91,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx
index 198ee240c92c..ca025e95e1a7 100644
--- a/sc/inc/dpshttab.hxx
+++ b/sc/inc/dpshttab.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include "scdllapi.h"
#include "queryparam.hxx"
+#include <boost/unordered_set.hpp>
#include <vector>
namespace com { namespace sun { namespace star { namespace sheet {
@@ -41,50 +43,79 @@ namespace com { namespace sun { namespace star { namespace sheet {
}}}}
class ScDPDimension;
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
class ScDPItemData;
-// End Comments
-// --------------------------------------------------------------------
-//
-// implementation of ScDPTableData with sheet data
-//
-struct ScSheetSourceDesc
+/**
+ * This class contains authoritative information on the internal reference
+ * used as the data source for datapilot table. <i>The range name takes
+ * precedence over the source range when it's non-empty.</i> When the range
+ * name is empty, the source range gets used.
+ */
+class ScSheetSourceDesc
{
- ScRange aSourceRange;
- ScQueryParam aQueryParam;
-
- sal_Bool operator== ( const ScSheetSourceDesc& rOther ) const
- { return aSourceRange == rOther.aSourceRange &&
- aQueryParam == rOther.aQueryParam; }
-// Wang Xu Ming - DataPilot migration
-// Buffer&&Performance
- ScDPTableDataCache* CreateCache( ScDocument* pDoc, long nID = -1) const;
- sal_uLong CheckValidate( ScDocument* pDoc ) const;
- ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const;
- ScDPTableDataCache* GetExistDPObjectCache ( ScDocument* pDoc ) const;
- long GetCacheId( ScDocument* pDoc, long nID ) const;
-
-// End Comments
+ ScSheetSourceDesc(); // disabled
+
+public:
+ SC_DLLPUBLIC ScSheetSourceDesc(ScDocument* pDoc);
+
+ SC_DLLPUBLIC void SetSourceRange(const ScRange& rRange);
+
+ /**
+ * Get the range that contains the source data. In case the source data
+ * is referred to via a range name, it returns the range that the range
+ * name points to.
+ *
+ * <i>Note that currently only a single range is supported; if the
+ * range name contains multiple ranges, only the first range is used.</i>
+ *
+ * @return source range.
+ */
+ SC_DLLPUBLIC const ScRange& GetSourceRange() const;
+ SC_DLLPUBLIC void SetRangeName(const ::rtl::OUString& rName);
+ SC_DLLPUBLIC const ::rtl::OUString& GetRangeName() const;
+ bool HasRangeName() const;
+ void SetQueryParam(const ScQueryParam& rParam);
+ const ScQueryParam& GetQueryParam() const;
+
+ bool operator== ( const ScSheetSourceDesc& rOther ) const;
+ ScDPCache* CreateCache() const;
+
+ /**
+ * Check the sanity of the data source range.
+ *
+ * @param pDoc document instance.
+ *
+ * @return 0 if the source range is sane, otherwise an error message ID is
+ * returned.
+ */
+ sal_uLong CheckSourceRange() const;
+ long GetCacheId() const;
+
+private:
+ mutable ScRange maSourceRange;
+ ::rtl::OUString maRangeName;
+ ScQueryParam maQueryParam;
+ ScDocument* mpDoc;
};
+/**
+ * Implementation of ScDPTableData with sheet data.
+ */
class SC_DLLPUBLIC ScSheetDPData : public ScDPTableData
{
private:
ScQueryParam aQuery;
- sal_Bool* pSpecial;
- sal_Bool bIgnoreEmptyRows;
- sal_Bool bRepeatIfEmpty;
+ bool* pSpecial;
+ bool bIgnoreEmptyRows;
+ bool bRepeatIfEmpty;
- ScDPCacheTable aCacheTable;
+ const ScSheetSourceDesc& mrDesc;
+ ScDPCacheTable aCacheTable;
public:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc, long nCacheId = -1 );
- virtual ~ScSheetDPData();
- // End Comments
+ ScSheetDPData(ScDocument* pD, const ScSheetSourceDesc& rDesc);
+ virtual ~ScSheetDPData();
+
virtual long GetColumnCount();
virtual String getDimensionName(long nColumn);
virtual sal_Bool getIsDataLayoutDimension(long nColumn);
@@ -96,9 +127,9 @@ public:
virtual bool IsRepeatIfEmpty();
virtual void CreateCacheTable();
- virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rCatDims);
+ virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rCatDims);
virtual void GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
- const ::std::hash_set<sal_Int32>& rCatDims,
+ const ::boost::unordered_set<sal_Int32>& rCatDims,
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
virtual const ScDPCacheTable& GetCacheTable() const;
@@ -108,3 +139,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dptabdat.hxx b/sc/inc/dptabdat.hxx
index 0496c8e94b79..a2521ac869a0 100644
--- a/sc/inc/dptabdat.hxx
+++ b/sc/inc/dptabdat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,16 +32,13 @@
#include "address.hxx"
#include "dpoutput.hxx"
#include "dpcachetable.hxx"
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "dptablecache.hxx"
-// End Comments
#include <tools/string.hxx>
#include <vector>
#include <set>
-#include <hash_map>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
+#include <boost/unordered_map.hpp>
namespace com { namespace sun { namespace star { namespace sheet {
struct DataPilotFieldFilter;
@@ -92,18 +90,18 @@ class ScDPInitState;
class ScDPResultMember;
class ScDocument;
- class SC_DLLPUBLIC ScDPTableData
+/**
+ * Base class that abstracts different data source types of a datapilot
+ * table.
+ */
+class SC_DLLPUBLIC ScDPTableData
{
// cached data for GetDatePart
long nLastDateVal;
long nLastHier;
long nLastLevel;
long nLastRet;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- long mnCacheId;
- const ScDocument* mpDoc;
- // End Comments
+ const ScDocument* mpDoc;
public:
/** This structure stores dimension information used when calculating
@@ -129,10 +127,7 @@ public:
CalcInfo();
};
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- ScDPTableData(ScDocument* pDoc, long nCacheId );
- // End Comments
+ ScDPTableData(ScDocument* pDoc);
virtual ~ScDPTableData();
long GetDatePart( long nDateVal, long nHierarchy, long nLevel );
@@ -141,11 +136,7 @@ public:
//! or separate Str and ValueCollection
virtual long GetColumnCount() = 0;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
virtual const std::vector< SCROW >& GetColumnEntries( long nColumn ) ;
- long GetCacheId() const;
- // End Comments
virtual String getDimensionName(long nColumn) = 0;
virtual sal_Bool getIsDataLayoutDimension(long nColumn) = 0;
virtual sal_Bool IsDateDimension(long nDim) = 0;
@@ -157,9 +148,9 @@ public:
virtual bool IsRepeatIfEmpty();
virtual void CreateCacheTable() = 0;
- virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::std::hash_set<sal_Int32>& rDataDims) = 0;
+ virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rDataDims) = 0;
virtual void GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
- const ::std::hash_set<sal_Int32>& rCatDims,
+ const ::boost::unordered_set<sal_Int32>& rCatDims,
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData) = 0;
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow) = 0;
virtual const ScDPCacheTable& GetCacheTable() const = 0;
@@ -173,26 +164,20 @@ public:
virtual sal_Bool HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex,
const ScDPItemData& rSecondData, long nSecondIndex ) const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
virtual long GetMembersCount( long nDim );
virtual const ScDPItemData* GetMemberByIndex( long nDim, long nIndex );
virtual const ScDPItemData* GetMemberById( long nDim, long nId);
virtual SCROW GetIdOfItemData( long nDim, const ScDPItemData& rData );
virtual long GetSourceDim( long nDim );
virtual long Compare( long nDim, long nDataId1, long nDataId2);
- // End Comments
protected:
/** This structure stores vector arrays that hold intermediate data for
each row during cache table iteration. */
struct CalcRowData
{
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
::std::vector< SCROW > aColData;
::std::vector< SCROW > aRowData;
::std::vector< SCROW > aPageData;
- // End Comments
::std::vector<ScDPValueData> aValues;
};
@@ -201,11 +186,9 @@ protected:
void CalcResultsFromCacheTable(const ScDPCacheTable& rCacheTable, CalcInfo& rInfo, bool bAutoShow);
private:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
void GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRow,
const ::std::vector<long>& rDims, ::std::vector< SCROW >& rItemData);
- // End Comments
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx
index be9c0659996d..c1ee4238193c 100644
--- a/sc/inc/dptablecache.hxx
+++ b/sc/inc/dptablecache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -7,9 +8,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dptablecache.hxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,95 +26,91 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef DPTABLECACHE_HXX
-#define DPTABLECACHE_HXX
-// Wang Xu Ming -- 12/21/2008
-// Add Data Cache Support.
-#ifndef SC_SCGLOB_HXX
+#ifndef SC_DPTABLECACHE_HXX
+#define SC_DPTABLECACHE_HXX
+
#include "global.hxx"
-#endif
-//Added by PengYunQuan for SODC_16015
#include <svl/zforlist.hxx>
-//end
-#include <vector>
#include "dpglobal.hxx"
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
-class ScDPTableDataCache;
-class TypedStrData;
-struct ScQueryParam;
+#include <vector>
+#include <boost/ptr_container/ptr_vector.hpp>
-// --------------------------------------------------------------------
-//
-// base class ScDPTableData to allow implementation with tabular data
-// by deriving only of this
-//
+struct ScQueryParam;
-class SC_DLLPUBLIC ScDPTableDataCache
+/**
+ * This class represents the cached data part of the datapilot cache table
+ * implementation.
+ */
+class SC_DLLPUBLIC ScDPCache
{
- long mnID;
+ friend class ScDPCacheTable;
+public:
+ typedef ::boost::ptr_vector<ScDPItemData> DataListType;
+private:
+ typedef ::boost::ptr_vector<DataListType> DataGridType;
+ typedef ::boost::ptr_vector< ::std::vector<SCROW> > RowGridType;
+
ScDocument* mpDoc;
+ long mnColumnCount;
- long mnColumnCount; // Column count
+ DataGridType maTableDataValues; // Data Pilot Table's index - value map
+ RowGridType maSourceData; // Data Pilot Table's source data
+ RowGridType maGlobalOrder; // Sorted members index
+ mutable RowGridType maIndexOrder; // Index the sorted numbers
+ DataListType maLabelNames; // Source label data
+ std::vector<bool> mbEmptyRow; //If empty row?
+
+ mutable ScDPItemDataPool maAdditionalData;
- std::vector<ScDPItemData*>* mpTableDataValues; //Data Pilot Table's index - value map
- std::vector<SCROW>* mpSourceData; //Data Pilot Table's Source data
- std::vector<SCROW>* mpGlobalOrder; //Sorted members index
- std::vector<SCROW>* mpIndexOrder; //Index the sorted number
- std::vector<ScDPItemData*> mrLabelNames; //Source Label data
- std::vector<sal_Bool> mbEmptyRow; //If empty row?
- mutable ScDPItemDataPool maAdditionalDatas;
public:
- SCROW GetOrder( long nDim, SCROW nIndex ) const;
SCROW GetIdByItemData( long nDim, String sItemData ) const;
SCROW GetIdByItemData( long nDim, const ScDPItemData& rData ) const;
- SCROW GetAdditionalItemID ( String sItemData );
- SCROW GetAdditionalItemID( const ScDPItemData& rData );
+ SCROW GetAdditionalItemID ( String sItemData ) const;
+ SCROW GetAdditionalItemID( const ScDPItemData& rData ) const;
SCCOL GetDimensionIndex( String sName) const;
const ScDPItemData* GetSortedItemData( SCCOL nDim, SCROW nOrder ) const;
sal_uLong GetNumType ( sal_uLong nFormat ) const;
sal_uLong GetNumberFormat( long nDim ) const;
- sal_Bool IsDateDimension( long nDim ) const ;
+ bool IsDateDimension( long nDim ) const ;
sal_uLong GetDimNumType( SCCOL nDim) const;
SCROW GetDimMemberCount( SCCOL nDim ) const;
SCROW GetSortedItemDataId( SCCOL nDim, SCROW nOrder ) const;
- const std::vector<ScDPItemData*>& GetDimMemberValues( SCCOL nDim )const;
- void SetId( long nId ){ mnID = nId;}
- void AddRow( ScDPItemData* pRow, sal_uInt16 nCount );
- bool InitFromDoc( ScDocument* pDoc, const ScRange& rRange );
- bool InitFromDataBase (const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& xRowSet, const Date& rNullDate);
-
- SCROW GetRowCount() const;
- SCROW GetItemDataId( sal_uInt16 nDim, SCROW nRow, sal_Bool bRepeatIfEmpty ) const;
- String GetDimensionName( sal_uInt16 nColumn ) const;
- bool IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const;
- bool IsRowEmpty( SCROW nRow ) const;
- bool IsValid() const;
- bool ValidQuery( SCROW nRow, const ScQueryParam& rQueryParam, sal_Bool* pSpecial );
+ const DataListType& GetDimMemberValues( SCCOL nDim ) const;
+ bool InitFromDoc(ScDocument* pDoc, const ScRange& rRange);
+ bool InitFromDataBase(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& xRowSet, const Date& rNullDate);
+
+ SCROW GetRowCount() const;
+ SCROW GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) const;
+ String GetDimensionName( sal_uInt16 nColumn ) const;
+ bool IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const;
+ bool IsRowEmpty( SCROW nRow ) const;
+ bool IsValid() const;
+ bool ValidQuery( SCROW nRow, const ScQueryParam& rQueryParam, bool* pSpecial );
ScDocument* GetDoc() const;//ms-cache-core
long GetColumnCount() const;
- long GetId() const;
const ScDPItemData* GetItemDataById( long nDim, SCROW nId ) const;
- sal_Bool operator== ( const ScDPTableDataCache& r ) const;
+ bool operator== ( const ScDPCache& r ) const;
-//construction
- ScDPTableDataCache( ScDocument* pDoc );
-//deconstruction
- virtual ~ScDPTableDataCache();
+ ScDPCache(ScDocument* pDoc);
+ virtual ~ScDPCache();
-protected:
private:
- void AddLabel( ScDPItemData* pData);
- sal_Bool AddData( long nDim, ScDPItemData* itemData );
+ SCROW GetOrder( long nDim, SCROW nIndex ) const;
+ void AddLabel( ScDPItemData* pData);
+ bool AddData( long nDim, ScDPItemData* itemData );
};
-#endif //DPTABLECACHE_HXX
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index 33673cbc135e..4e6c6eddd060 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,8 +36,8 @@
#include <com/sun/star/uno/Sequence.hxx>
#include "global.hxx" // enum ScSubTotalFunc
#include "dpcachetable.hxx"
-#include <hash_map>
-#include <hash_set>
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
#include <vector>
#include <memory>
@@ -57,10 +58,7 @@ class ScDPResultMember;
class ScDPResultVisibilityData;
struct ScDPValueData;
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
class ScDPItemData;
-// End Comments
//
// Member names that are being processed for InitFrom/LateInitFrom
// (needed for initialization of grouped items)
@@ -69,10 +67,7 @@ class ScDPItemData;
class ScDPInitState
{
long* pIndex; // array
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
SCROW* pData; // array
- // End Comments
long nCount;
public:
@@ -84,11 +79,8 @@ public:
long GetCount() const { return nCount; }
const long* GetSource() const { return pIndex; }
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
const SCROW* GetNameIds() const { return pData; }
SCROW GetNameIdForIndex( long nIndexValue ) const;
-// End Comments
};
typedef ::std::vector<sal_Int32> ScMemberSortOrder;
@@ -237,8 +229,6 @@ class ScDPDataMember;
#define SC_DPMEASURE_ALL -1
#define SC_DPMEASURE_ANY -2
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
struct MemberHashIndexFunc : public std::unary_function< const SCROW &, size_t >
{
@@ -258,7 +248,7 @@ public:
};
typedef std::vector <ScDPParentDimData *> DimMemberArray;
-typedef std::hash_map < SCROW, ScDPParentDimData *, MemberHashIndexFunc> DimMemberHash;
+typedef boost::unordered_map < SCROW, ScDPParentDimData *, MemberHashIndexFunc> DimMemberHash;
class ResultMembers
{
@@ -284,7 +274,7 @@ private:
sal_Bool mbAllChildren;
public:
LateInitParams( const ::std::vector<ScDPDimension*>& ppDim, const ::std::vector<ScDPLevel*>& ppLev,
- sal_Bool bRow, sal_Bool bInitChild = sal_True , sal_Bool bAllChildren = sal_False);
+ sal_Bool bRow, sal_Bool bInitChild = sal_True , sal_Bool bAllChildren = false);
~LateInitParams();
void SetInitChild( sal_Bool b ) { mbInitChild = b; }
@@ -298,7 +288,6 @@ public:
inline sal_Bool IsRow() const { return mbRow; }
sal_Bool IsEnd( size_t nPos ) const ;
};
-// End Comments
class ScDPResultData
{
@@ -347,8 +336,6 @@ public:
sal_Bool IsBaseForGroup( long nDim ) const; // any group
long GetGroupBase( long nGroupDim ) const;
sal_Bool IsNumOrDateGroup( long nDim ) const;
- // Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
sal_Bool IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex,
long nBaseDataId, long nBaseIndex ) const;
sal_Bool IsInGroup( SCROW nGroupDataId, long nGroupIndex,
@@ -358,7 +345,6 @@ public:
ResultMembers* GetDimResultMembers( long nDim , ScDPDimension* pDim , ScDPLevel* pLevel) const ;
-// End Comments
const ScDPSource* GetSource() const;
};
@@ -367,10 +353,7 @@ class ScDPResultMember
{
private:
const ScDPResultData* pResultData;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
ScDPParentDimData aParentDimData;
- // End Comments
ScDPResultDimension* pChildDimension;
ScDPDataMember* pDataRoot;
sal_Bool bHasElements;
@@ -382,16 +365,11 @@ private:
sal_uInt16 nMemberStep; // step to show details
public:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
ScDPResultMember( const ScDPResultData* pData, const ScDPParentDimData& rParentDimData,
sal_Bool bForceSub ); //! Ref
ScDPResultMember( const ScDPResultData* pData, sal_Bool bForceSub );
- // End Comments
~ScDPResultMember();
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
void InitFrom( const ::std::vector<ScDPDimension*>& ppDim,
const ::std::vector<ScDPLevel*>& ppLev,
size_t nPos,
@@ -402,8 +380,7 @@ public:
const ::std::vector< SCROW >& pItemData,
size_t nPos,
ScDPInitState& rInitState);
- void CheckShowEmpty( sal_Bool bShow = sal_False );
- // End Comments
+ void CheckShowEmpty( sal_Bool bShow = false );
String GetName() const;
void FillItemData( ScDPItemData& rData ) const;
sal_Bool IsValid() const;
@@ -412,25 +389,18 @@ public:
sal_Bool HasHiddenDetails() const;
sal_Bool IsSubTotalInTitle(long nMeasure) const;
-// sal_Bool SubTotalEnabled() const;
long GetSubTotalCount( long* pUserSubStart = NULL ) const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
sal_Bool IsNamedItem( SCROW nIndex ) const;
bool IsValidEntry( const ::std::vector< SCROW >& aMembers ) const;
- // End Comments
void SetHasElements() { bHasElements = sal_True; }
void SetAutoHidden() { bAutoHidden = sal_True; }
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
void ProcessData( const ::std::vector<SCROW>& aChildMembers,
const ScDPResultDimension* pDataDim,
const ::std::vector<SCROW>& aDataMembers,
const ::std::vector<ScDPValueData>& aValues );
- // End Comments
void FillMemberResults( com::sun::star::uno::Sequence<
com::sun::star::sheet::MemberResult>* pSequences,
long& rPos, long nMeasure, sal_Bool bRoot,
@@ -460,15 +430,12 @@ public:
ScDPDataMember* GetDataRoot() const { return pDataRoot; }
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
const ScDPDimension* GetParentDim() const { return aParentDimData.mpParentDim; } //! Ref
const ScDPLevel* GetParentLevel() const { return aParentDimData.mpParentLevel; } //! Ref
const ScDPMember* GetDPMember()const { return aParentDimData.mpMemberDesc; } //! Ref
inline SCROW GetOrder() const { return aParentDimData.mnOrder; } //! Ref
inline sal_Bool IsRoot() const { return GetParentLevel() == NULL; }
SCROW GetDataId( ) const ;
- // End Comments
ScDPAggData* GetColTotal( long nMeasure ) const;
void FillVisibilityData(ScDPResultVisibilityData& rData) const;
@@ -494,17 +461,11 @@ public:
sal_Bool IsVisible() const;
sal_Bool HasData( long nMeasure, const ScDPSubTotalState& rSubState ) const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
sal_Bool IsNamedItem( SCROW r ) const;
- // End Comments
sal_Bool HasHiddenDetails() const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
void ProcessData( const ::std::vector< SCROW >& aChildMembers, const ::std::vector<ScDPValueData>& aValues,
const ScDPSubTotalState& rSubState );
- // End Comments
sal_Bool HasError( long nMeasure, const ScDPSubTotalState& rSubState ) const;
double GetAggregate( long nMeasure, const ScDPSubTotalState& rSubState ) const;
const ScDPAggData* GetConstAggData( long nMeasure, const ScDPSubTotalState& rSubState ) const;
@@ -544,11 +505,8 @@ SV_DECL_PTRARR_DEL(ScDPDataMembers, ScDPDataMemberPtr, SC_DP_RES_GROW, SC_DP_RES
class ScDPResultDimension
{
public :
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
typedef std::vector <ScDPResultMember *> MemberArray;
typedef std::map < SCROW , ScDPResultMember *> MemberHash;
- // End Comments
private:
const ScDPResultData* pResultData;
MemberArray maMemberArray;
@@ -565,24 +523,18 @@ private:
long nAutoMeasure;
long nAutoCount;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
ScDPResultMember* FindMember( SCROW iData ) const;
ScDPResultMember* AddMember( const ScDPParentDimData& aData );
ScDPResultMember* InsertMember( ScDPParentDimData* pMemberData );
- ResultMembers* GetResultMember( ScDPDimension* pDim, ScDPLevel* pLevel );
void InitWithMembers( LateInitParams& rParams,
const ::std::vector< SCROW >& pItemData,
size_t nPos,
ScDPInitState& rInitState );
- // End Comments
public:
ScDPResultDimension( const ScDPResultData* pData );
~ScDPResultDimension();
// allocates new members
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
void InitFrom( const ::std::vector<ScDPDimension*>& ppDim,
const ::std::vector<ScDPLevel*>& ppLev,
size_t nPos,
@@ -591,13 +543,10 @@ public:
const ::std::vector< SCROW >& pItemData,
size_t nPos,
ScDPInitState& rInitState );
- void CheckShowEmpty( sal_Bool bShow = sal_False );
+ void CheckShowEmpty( sal_Bool bShow = false );
- // End Comments
long GetSize(long nMeasure) const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
bool IsValidEntry( const ::std::vector<SCROW>& aMembers ) const;
// modifies existing members, allocates data dimensions
@@ -605,7 +554,6 @@ public:
const ScDPResultDimension* pDataDim,
const ::std::vector<SCROW>& aDataMembers,
const ::std::vector<ScDPValueData>& aValues ) const; //! Test
- // End Comments
void FillMemberResults( com::sun::star::uno::Sequence<
com::sun::star::sheet::MemberResult>* pSequences,
long nStart, long nMeasure );
@@ -675,11 +623,8 @@ public:
~ScDPDataDimension();
void InitFrom( const ScDPResultDimension* pDim ); // recursive
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
void ProcessData( const ::std::vector< SCROW >& aDataMembers, const ::std::vector<ScDPValueData>& aValues,
const ScDPSubTotalState& rSubState );
- // End Comments
void FillDataRow( const ScDPResultDimension* pRefDim,
com::sun::star::uno::Sequence<com::sun::star::sheet::DataResult>& rSequence,
long nCol, long nMeasure, sal_Bool bIsSubTotalRow,
@@ -713,10 +658,7 @@ public:
class ScDPResultVisibilityData
{
public:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
ScDPResultVisibilityData( ScDPSource* pSource);
- // End Comments
~ScDPResultVisibilityData();
void addVisibleMember(const String& rDimName, const ScDPItemData& rMemberItem);
@@ -727,8 +669,8 @@ private:
{
size_t operator()(const ScDPItemData& r) const;
};
- typedef ::std::hash_set<ScDPItemData, MemberHash> VisibleMemberType;
- typedef ::std::hash_map<String, VisibleMemberType, ScStringHashCode> DimMemberType;
+ typedef ::boost::unordered_set<ScDPItemData, MemberHash> VisibleMemberType;
+ typedef ::boost::unordered_map<String, VisibleMemberType, ScStringHashCode> DimMemberType;
DimMemberType maDimensions;
ScDPSource* mpSource;
@@ -736,3 +678,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx
index cf0685636178..df4c4d8923e7 100644
--- a/sc/inc/dptabsrc.hxx
+++ b/sc/inc/dptabsrc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,14 +30,12 @@
#define SC_DPTABSRC_HXX
#include <vector>
-#include <hash_map>
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
#include <list>
-// End Comments
#include <memory>
+
#include <tools/string.hxx>
-#include <tools/list.hxx>
#include "global.hxx" // enum ScSubTotalFunc
#include <com/sun/star/sheet/XDimensionsSupplier.hpp>
#include <com/sun/star/sheet/XHierarchiesSupplier.hpp>
@@ -61,10 +60,7 @@
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/implbase6.hxx>
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "dpglobal.hxx"
-// End Comments
#include "dptabdat.hxx"
namespace com { namespace sun { namespace star {
@@ -78,10 +74,7 @@ namespace com { namespace sun { namespace star {
class ScDPResultMember;
class ScDPResultData;
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
class ScDPItemData;
-// End Comments
class ScDPTableData;
// ------------------------------------------------------------------------
@@ -140,22 +133,22 @@ private:
ScDPResultMember* pRowResRoot;
com::sun::star::uno::Sequence<com::sun::star::sheet::MemberResult>* pColResults;
com::sun::star::uno::Sequence<com::sun::star::sheet::MemberResult>* pRowResults;
- List aColLevelList;
- List aRowLevelList;
+ std::vector<ScDPLevel*> aColLevelList;
+ std::vector<ScDPLevel*> aRowLevelList;
sal_Bool bResultOverflow;
::std::auto_ptr<rtl::OUString> mpGrandTotalName;
void CreateRes_Impl();
void FillMemberResults();
- void FillLevelList( sal_uInt16 nOrientation, List& rList );
+ void FillLevelList( sal_uInt16 nOrientation, std::vector<ScDPLevel*> &rList );
void FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool &bHasAutoShow);
/**
* Compile a list of dimension indices that are either, column, row or
* page dimensions (i.e. all but data dimensions).
*/
- void GetCategoryDimensionIndices(::std::hash_set<sal_Int32>& rCatDims);
+ void GetCategoryDimensionIndices(::boost::unordered_set<sal_Int32>& rCatDims);
/**
* Set visibilities of individual rows in the cache table based on the
@@ -166,13 +159,12 @@ private:
void SetDupCount( long nNew );
public:
- ScDPSource( ScDPTableData* pD ); // TableData is deleted by Source
+ ScDPSource( ScDPTableData* pD );
virtual ~ScDPSource();
ScDPTableData* GetData() { return pData; }
const ScDPTableData* GetData() const { return pData; }
- void SetGrandTotalName(const ::rtl::OUString& rName);
const ::rtl::OUString* GetGrandTotalName() const;
sal_uInt16 GetOrientation(long nColumn);
@@ -182,18 +174,14 @@ public:
long GetDataDimensionCount();
ScDPDimension* GetDataDimension(long nIndex);
String GetDataDimName(long nIndex);
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- ScDPTableDataCache* GetCache();
+ const ScDPCache* GetCache();
const ScDPItemData* GetItemDataById( long nDim, long nId );
long GetDataLayoutDim(){ return pData->GetColumnCount(); }
SCROW GetMemberId( long nDim, const ScDPItemData& rData );
- // End Comments
sal_Bool IsDataLayoutDimension(long nDim);
sal_uInt16 GetDataLayoutOrientation();
sal_Bool IsDateDimension(long nDim);
- sal_uInt32 GetNumberFormat(long nDim);
sal_Bool SubTotalAllowed(long nColumn); //! move to ScDPResultData
@@ -207,8 +195,6 @@ public:
ScDPDimensions* GetDimensionsObject();
-//UNUSED2009-05 void DumpState( ScDocument* pDoc, const ScAddress& rPos );
-
// XDimensionsSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
SAL_CALL getDimensions( )
@@ -455,12 +441,6 @@ public:
const ScDPItemData& GetSelectedData();
const ::com::sun::star::sheet::DataPilotFieldReference& GetReferenceValue() const;
-
-//UNUSED2009-05 sal_Bool IsValidPage( const ScDPItemData& rData );
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
- sal_Bool IsVisible( const ScDPItemData& rData );
-// End Comments
};
class ScDPHierarchies : public cppu::WeakImplHelper2<
@@ -706,7 +686,7 @@ public:
};
// hash map from name to index in the member array, for fast name access
-typedef ::std::hash_map< ::rtl::OUString, sal_Int32, ::rtl::OUStringHash > ScDPMembersHashMap;
+typedef ::boost::unordered_map< ::rtl::OUString, sal_Int32, ::rtl::OUStringHash > ScDPMembersHashMap;
class ScDPMembers : public cppu::WeakImplHelper2<
com::sun::star::container::XNameAccess,
@@ -754,12 +734,9 @@ public:
long getMinMembers() const;
sal_Int32 GetIndexFromName( const ::rtl::OUString& rName ) const; // <0 if not found
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
const std::vector<sal_Int32>& GetGlobalOrder();
const ScDPItemData* GetSrcItemDataByIndex( SCROW nIndex);
SCROW GetSrcItemsCount();
- // End Comments
};
class ScDPMember : public cppu::WeakImplHelper3<
@@ -773,10 +750,7 @@ private:
long nHier;
long nLev;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
SCROW mnDataId;
- // End Comments
// String aCaption; // visible name (changeable by user)
::std::auto_ptr<rtl::OUString> mpLayoutName;
@@ -785,23 +759,15 @@ private:
sal_Bool bShowDet;
public:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL,
- SCROW nIndex /*const String& rN, double fV, sal_Bool bHV */);
- // End Comments
+ SCROW nIndex /*const String& rN, double fV, BOOL bHV */);
virtual ~ScDPMember();
- sal_Bool IsNamedItem( const ScDPItemData& r ) const;
String GetNameStr() const;
void FillItemData( ScDPItemData& rData ) const;
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- // const ScDPItemData& GetItemData() const{ return maData; }
const ScDPItemData& GetItemData() const;
inline SCROW GetItemDataId() const { return mnDataId; }
sal_Bool IsNamedItem( SCROW nIndex ) const;
- // End Comments
SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const;
@@ -873,3 +839,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/drawattr.hxx b/sc/inc/drawattr.hxx
index b2111c1a33ca..34e08c975f02 100644
--- a/sc/inc/drawattr.hxx
+++ b/sc/inc/drawattr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/drawpage.hxx b/sc/inc/drawpage.hxx
index 30a5f1c55c90..e27b7cce797d 100644
--- a/sc/inc/drawpage.hxx
+++ b/sc/inc/drawpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_DRAWPAGE_HXX
#define SC_DRAWPAGE_HXX
-#ifndef _FM_FMPAGE_HXX
#include <svx/fmpage.hxx>
-#endif
class ScDrawLayer;
@@ -40,7 +39,7 @@ class ScDrawLayer;
class ScDrawPage: public FmFormPage
{
public:
- ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, sal_Bool bMasterPage=sal_False);
+ ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, bool bMasterPage = false);
~ScDrawPage();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
@@ -50,3 +49,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/drdefuno.hxx b/sc/inc/drdefuno.hxx
index 09fd3368271e..dd79fbbf2b1b 100644
--- a/sc/inc/drdefuno.hxx
+++ b/sc/inc/drdefuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx
index d4e48f6c24a7..e3069b721dbe 100644
--- a/sc/inc/drwlayer.hxx
+++ b/sc/inc/drwlayer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,8 +74,8 @@ public:
// -----------------------------------------------------------------------
//
-// Das Anpassen der Detektiv-UserData muss zusammen mit den Draw-Undo's
-// in der SdrUndoGroup liegen, darum von SdrUndoAction abgeleitet:
+// Adjusting of detective UserData and draw undo's both have to be in SdrUndoGroup;
+// therefore derived from SdrUndoAction
class ScUndoObjData : public SdrUndoObj
{
@@ -98,7 +99,6 @@ public:
class SC_DLLPUBLIC ScDrawLayer : public FmFormModel
{
private:
-//REMOVE SotStorageRef xPictureStorage;
String aName;
ScDocument* pDoc;
SdrUndoGroup* pUndoGroup;
@@ -107,18 +107,16 @@ private:
sal_Bool bHyphenatorSet;
private:
- void MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, const Point& rMove,
- const Point& rTopLeft );
void MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
SCsCOL nDx,SCsROW nDy, bool bUpdateNoteCaptionPos );
- void RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos );
+ void RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos );
public:
ScDrawLayer( ScDocument* pDocument, const String& rName );
virtual ~ScDrawLayer();
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual SdrPage* AllocPage(bool bMasterPage);
virtual SdrModel* AllocModel() const;
virtual void SetChanged( sal_Bool bFlg = sal_True );
@@ -127,25 +125,23 @@ public:
virtual SdrLayerID GetControlExportLayerId( const SdrObject & ) const;
-//REMOVE void ReleasePictureStorage();
-
sal_Bool HasObjects() const;
sal_Bool ScAddPage( SCTAB nTab );
void ScRemovePage( SCTAB nTab );
void ScRenamePage( SCTAB nTab, const String& rNewName );
void ScMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
- // inkl. Inhalt, bAlloc=sal_False -> nur Inhalt
+ // incl. content, bAlloc=FALSE -> only content
void ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool bAlloc );
ScDocument* GetDocument() const { return pDoc; }
- void UpdateBasic(); // DocShell-Basic in DrawPages setzen
+ void UpdateBasic(); // set DocShell Basic in DrawPages
void UseHyphenator();
sal_Bool GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const;
- // automatische Anpassungen
+ // automatic adjustments
void EnableAdjust( sal_Bool bSet = sal_True ) { bAdjustEnabled = bSet; }
@@ -156,17 +152,12 @@ public:
void MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
SCsCOL nDx,SCsROW nDy, sal_Bool bInsDel, bool bUpdateNoteCaptionPos = true );
- void WidthChanged( SCTAB nTab, SCCOL nCol, long nDifTwips );
- void HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips );
- sal_Bool HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, bool bIncludeNotes = true );
+ sal_Bool HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow );
void DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
SCCOL nCol2,SCROW nRow2 );
void DeleteObjectsInSelection( const ScMarkData& rMark );
-#if 0
- void DeleteObjects( SCTAB nTab );
-#endif
void CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& rRange );
void CopyFromClip( ScDrawLayer* pClipModel,
@@ -193,12 +184,14 @@ public:
String GetNewGraphicName( long* pnCounter = NULL ) const;
void EnsureGraphicNames();
- // Verankerung setzen und ermitteln
- static void SetAnchor( SdrObject*, ScAnchorType );
- static ScAnchorType GetAnchor( const SdrObject* );
+ static void SetPageAnchored( SdrObject& );
+ static void SetCellAnchored( SdrObject&, const ScDrawObjData &rAnchor );
+ static void SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab );
+ static void UpdateCellAnchorFromPositionEnd( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab );
+ static ScAnchorType GetAnchorType( const SdrObject& );
- // Positionen fuer Detektivlinien
- static ScDrawObjData* GetObjData( SdrObject* pObj, sal_Bool bCreate=sal_False );
+ // positions for detektive lines
+ static ScDrawObjData* GetObjData( SdrObject* pObj, sal_Bool bCreate=false );
// The sheet information in ScDrawObjData isn't updated when sheets are inserted/deleted.
// Use this method to get an object with positions on the specified sheet (should be the
@@ -217,10 +210,10 @@ public:
static IMapObject* GetHitIMapObject( SdrObject* pObject,
const Point& rWinPoint, const Window& rCmpWnd );
- static ScMacroInfo* GetMacroInfo( SdrObject* pObj, sal_Bool bCreate = sal_False );
+ static ScMacroInfo* GetMacroInfo( SdrObject* pObj, sal_Bool bCreate = false );
private:
- static SfxObjectShell* pGlobalDrawPersist; // fuer AllocModel
+ static SfxObjectShell* pGlobalDrawPersist; // for AllocModel
public:
static void SetGlobalDrawPersist(SfxObjectShell* pPersist);
protected:
@@ -231,3 +224,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx
index fe9e6e0abf10..15ed5ba554dc 100644
--- a/sc/inc/editsrc.hxx
+++ b/sc/inc/editsrc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -184,10 +185,11 @@ public:
virtual SvxEditSource* Clone() const;
virtual SvxTextForwarder* GetTextForwarder();
virtual SvxViewForwarder* GetViewForwarder();
- virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = sal_False );
+ virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate = false );
virtual void UpdateData();
virtual SfxBroadcaster& GetBroadcaster() const;
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx
index 7c1273aad3d6..35bb41b36e2d 100644
--- a/sc/inc/editutil.hxx
+++ b/sc/inc/editutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,13 +51,13 @@ class ScEditUtil
SCROW nRow;
SCTAB nTab;
Point aScrPos;
- OutputDevice* pDev; // MapMode muss eingestellt sein
+ OutputDevice* pDev; // MapMode has to be set
double nPPTX;
double nPPTY;
Fraction aZoomX;
Fraction aZoomY;
- static const char __FAR_DATA pCalcDelimiters[];
+ static const char pCalcDelimiters[];
public:
static String ModifyDelimiters( const String& rOld );
@@ -107,7 +108,7 @@ protected:
sal_Bool bDeleteDefaults;
ScEnginePoolHelper( SfxItemPool* pEnginePool,
- sal_Bool bDeleteEnginePool = sal_False );
+ sal_Bool bDeleteEnginePool = false );
ScEnginePoolHelper( const ScEnginePoolHelper& rOrg );
virtual ~ScEnginePoolHelper();
};
@@ -122,7 +123,7 @@ public:
/// bDeleteEnginePool: Engine becomes the owner of the pool
/// and deletes it on destruction
ScEditEngineDefaulter( SfxItemPool* pEnginePool,
- sal_Bool bDeleteEnginePool = sal_False );
+ sal_Bool bDeleteEnginePool = false );
/// If rOrg.bDeleteEnginePool: pool gets cloned and will be
/// deleted on destruction. Defaults are not set.
ScEditEngineDefaulter( const ScEditEngineDefaulter& rOrg );
@@ -177,8 +178,6 @@ private:
void Init(const ScPatternAttr& rPattern);
public:
ScTabEditEngine( ScDocument* pDoc ); // Default
- // pEnginePool = ScDocument.GetEnginePool()
- // pTextObjectPool = ScDocument.GetEditPool()
ScTabEditEngine( const ScPatternAttr& rPattern,
SfxItemPool* pEnginePool,
SfxItemPool* pTextObjectPool = NULL );
@@ -187,9 +186,9 @@ public:
struct ScHeaderFieldData
{
- String aTitle; // Titel oder Dateiname wenn kein Titel
- String aLongDocName; // Pfad und Dateiname
- String aShortDocName; // nur Dateiname
+ String aTitle; // title or file name (if no title)
+ String aLongDocName; // path and file name
+ String aShortDocName; // pure file name
String aTabName;
Date aDate;
Time aTime;
@@ -201,18 +200,16 @@ struct ScHeaderFieldData
};
-// fuer Feldbefehle in der Tabelle
+// for field commands (or just fields?) in a table
class SC_DLLPUBLIC ScFieldEditEngine : public ScEditEngineDefaulter
{
private:
sal_Bool bExecuteURL;
public:
- // pEnginePool = ScDocument.GetEnginePool()
- // pTextObjectPool = ScDocument.GetEditPool()
ScFieldEditEngine( SfxItemPool* pEnginePool,
SfxItemPool* pTextObjectPool = NULL,
- sal_Bool bDeleteEnginePool = sal_False );
+ sal_Bool bDeleteEnginePool = false );
void SetExecuteURL(sal_Bool bSet) { bExecuteURL = bSet; }
@@ -228,7 +225,7 @@ private:
ScHeaderFieldData aData;
public:
- ScHeaderEditEngine( SfxItemPool* pEnginePool, sal_Bool bDeleteEnginePool = sal_False );
+ ScHeaderEditEngine( SfxItemPool* pEnginePool, sal_Bool bDeleteEnginePool = false );
virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor );
void SetTitle(const String& rNew) { aData.aTitle = rNew; }
@@ -248,17 +245,16 @@ class ScNoteEditEngine : public ScEditEngineDefaulter
{
public:
- // pEnginePool = ScDocument.GetEnginePool()
- // pTextObjectPool = ScDocument.GetEditPool()
ScNoteEditEngine( SfxItemPool* pEnginePool,
SfxItemPool* pTextObjectPool = NULL,
- sal_Bool bDeleteEnginePool = sal_False );
+ sal_Bool bDeleteEnginePool = false );
};
-// SvxFieldData-Ableitungen sind nach Svx verschoben
+// SvxFieldData derivations were moved to Svx (comment can be deleted?)
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/eventuno.hxx b/sc/inc/eventuno.hxx
index f3ae72f0f1bf..3bf21a1c78e3 100755..100644
--- a/sc/inc/eventuno.hxx
+++ b/sc/inc/eventuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sheetdata.hxx,v $
- * $Revision: 1.16.32.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -89,3 +87,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index 818920885493..2dee2083e780 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,10 @@
#include "svl/zforlist.hxx"
#include "scmatrix.hxx"
#include "rangelst.hxx"
+#include "formula/token.hxx"
-#include <hash_map>
-#include <hash_set>
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>
#include <list>
@@ -93,8 +95,8 @@ private:
class ScExternalRefCache
{
public:
- typedef ::boost::shared_ptr< formula::FormulaToken> TokenRef;
- typedef ::boost::shared_ptr<ScTokenArray> TokenArrayRef;
+ typedef ::formula::FormulaTokenRef TokenRef;
+ typedef ::boost::shared_ptr<ScTokenArray> TokenArrayRef;
struct TableName
{
@@ -120,8 +122,8 @@ private:
TokenRef mxToken;
sal_uInt32 mnFmtIndex;
};
- typedef ::std::hash_map<SCCOL, Cell> RowDataType;
- typedef ::std::hash_map<SCROW, RowDataType> RowsDataType;
+ typedef ::boost::unordered_map<SCCOL, Cell> RowDataType;
+ typedef ::boost::unordered_map<SCROW, RowDataType> RowsDataType;
public:
// SUNWS needs a forward declared friend, otherwise types and members
@@ -178,7 +180,6 @@ public:
/// Returns the half-open range of used columns in the specified row. Returns [0,0) if row is empty.
SC_DLLPUBLIC ::std::pair< SCCOL, SCCOL > getColRange( SCROW nRow ) const;
void getAllNumberFormats(::std::vector<sal_uInt32>& rNumFmts) const;
- const ScRangeList& getCachedRanges() const;
bool isRangeCached(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
void setCachedCell(SCCOL nCol, SCROW nRow);
@@ -206,7 +207,7 @@ public:
};
typedef ::boost::shared_ptr<Table> TableTypeRef;
- typedef ::std::hash_map<String, size_t, ScStringHashCode> TableNameIndexMap;
+ typedef ::boost::unordered_map<String, size_t, ScStringHashCode> TableNameIndexMap;
ScExternalRefCache();
~ScExternalRefCache();
@@ -249,12 +250,12 @@ public:
ScMatrixRef mpRangeData;
};
void setCellRangeData(sal_uInt16 nFileId, const ScRange& rRange, const ::std::vector<SingleRangeData>& rData,
- TokenArrayRef pArray);
+ const TokenArrayRef& pArray);
bool isDocInitialized(sal_uInt16 nFileId);
void initializeDoc(sal_uInt16 nFileId, const ::std::vector<String>& rTabNames);
String getTableName(sal_uInt16 nFileId, size_t nCacheId) const;
- void getAllTableNames(sal_uInt16 nFileId, ::std::vector<String>& rTabNames) const;
+ void getAllTableNames(sal_uInt16 nFileId, ::std::vector<rtl::OUString>& rTabNames) const;
SCsTAB getTabSpan( sal_uInt16 nFileId, const String& rStartTabName, const String& rEndTabName ) const;
void getAllNumberFormats(::std::vector<sal_uInt32>& rNumFmts) const;
bool hasCacheTable(sal_uInt16 nFileId, const String& rTabName) const;
@@ -297,7 +298,6 @@ private:
bool mbAllReferenced;
ReferencedStatus();
- explicit ReferencedStatus( size_t nDocs );
void reset( size_t nDocs );
void checkAllDocs();
@@ -322,9 +322,9 @@ private:
}
};
- typedef ::std::hash_map<String, TokenArrayRef, ScStringHashCode> RangeNameMap;
- typedef ::std::hash_map<ScRange, TokenArrayRef, RangeHash> RangeArrayMap;
- typedef ::std::hash_map<String, String, ScStringHashCode> NamePairMap;
+ typedef ::boost::unordered_map<String, TokenArrayRef, ScStringHashCode> RangeNameMap;
+ typedef ::boost::unordered_map<ScRange, TokenArrayRef, RangeHash> RangeArrayMap;
+ typedef ::boost::unordered_map<String, String, ScStringHashCode> NamePairMap;
// SUNWS needs a forward declared friend, otherwise types and members
// of the outer class are not accessible.
@@ -351,7 +351,7 @@ private:
DocItem() : mbInitFromSource(false) {}
};
- typedef ::std::hash_map<sal_uInt16, DocItem> DocDataType;
+ typedef ::boost::unordered_map<sal_uInt16, DocItem> DocDataType;
DocItem* getDocItem(sal_uInt16 nFileId) const;
private:
@@ -365,7 +365,7 @@ class SC_DLLPUBLIC ScExternalRefManager : public formula::ExternalReferenceHelpe
public:
typedef ::std::set<ScFormulaCell*> RefCellSet;
- typedef ::std::hash_map<sal_uInt16, RefCellSet> RefCellMap;
+ typedef ::boost::unordered_map<sal_uInt16, RefCellSet> RefCellMap;
enum LinkUpdateType { LINK_MODIFIED, LINK_BROKEN };
@@ -413,14 +413,14 @@ private:
Time maLastAccess;
};
- typedef ::std::hash_map<sal_uInt16, SrcShell> DocShellMap;
- typedef ::std::hash_map<sal_uInt16, bool> LinkedDocMap;
+ typedef ::boost::unordered_map<sal_uInt16, SrcShell> DocShellMap;
+ typedef ::boost::unordered_map<sal_uInt16, bool> LinkedDocMap;
- typedef ::std::hash_map<sal_uInt16, SvNumberFormatterMergeMap> NumFmtMap;
+ typedef ::boost::unordered_map<sal_uInt16, SvNumberFormatterMergeMap> NumFmtMap;
- typedef ::std::hash_set<LinkListener*, LinkListener::Hash> LinkListeners;
- typedef ::std::hash_map<sal_uInt16, LinkListeners> LinkListenerMap;
+ typedef ::boost::unordered_set<LinkListener*, LinkListener::Hash> LinkListeners;
+ typedef ::boost::unordered_map<sal_uInt16, LinkListeners> LinkListenerMap;
public:
/** Source document meta-data container. */
@@ -481,7 +481,7 @@ public:
The index in the returned vector corresponds to the table index used to
access the cache table, e.g. in getCacheTable().
*/
- void getAllCachedTableNames(sal_uInt16 nFileId, ::std::vector<String>& rTabNames) const;
+ void getAllCachedTableNames(sal_uInt16 nFileId, ::std::vector<rtl::OUString>& rTabNames) const;
/**
* Get the span (distance+sign(distance)) of two sheets of a specified
@@ -684,7 +684,47 @@ private:
void insertRefCell(sal_uInt16 nFileId, const ScAddress& rCell);
- ScDocument* getSrcDocument(sal_uInt16 nFileId);
+ void fillCellFormat(sal_uInt32 nFmtIndex, ScExternalRefCache::CellFormat* pFmt) const;
+
+ ScExternalRefCache::TokenRef getSingleRefTokenFromSrcDoc(
+ sal_uInt16 nFileId, const ScDocument* pSrcDoc, const ScAddress& rCell,
+ ScExternalRefCache::CellFormat* pFmt);
+
+ /**
+ * Retrieve a range token array from a source document instance.
+ *
+ * @param pSrcDoc pointer to the source document instance.
+ * @param rTabName name of the first table.
+ * @param rRange range specified. Upon successful retrieval, this range
+ * gets modified to contain the correct table IDs, and in
+ * case the range is larger than the data area of the source
+ * document, it gets reduced to the data area.
+ * @param rCacheData an array of structs, with each struct containing the
+ * table name and the data in the specified range.
+ *
+ * @return range token array
+ */
+ ScExternalRefCache::TokenArrayRef getDoubleRefTokensFromSrcDoc(
+ const ScDocument* pSrcDoc, const String& rTabName, ScRange& rRange,
+ ::std::vector<ScExternalRefCache::SingleRangeData>& rCacheData);
+
+ /**
+ * Retrieve range name token array from a source document instance.
+ *
+ * @param nFileId file ID of the source document.
+ * @param pSrcDoc pointer to the source document instance
+ * @param rName range name to retrieve. Note that the range name lookup
+ * is case <i>in</i>-sensitive, and upon successful retrieval
+ * of the range name array, this name gets updated to the
+ * actual range name with the correct casing.
+ *
+ * @return range name token array
+ */
+ ScExternalRefCache::TokenArrayRef getRangeNameTokensFromSrcDoc(
+ sal_uInt16 nFileId, const ScDocument* pSrcDoc, String& rName);
+
+ const ScDocument* getInMemorySrcDocument(sal_uInt16 nFileId);
+ const ScDocument* getSrcDocument(sal_uInt16 nFileId);
SfxObjectShellRef loadSrcDocument(sal_uInt16 nFileId, String& rFilter);
bool isFileLoadable(const String& rFile) const;
@@ -711,7 +751,7 @@ private:
*/
void purgeStaleSrcDocument(sal_Int32 nTimeOut);
- sal_uInt32 getMappedNumberFormat(sal_uInt16 nFileId, sal_uInt32 nNumFmt, ScDocument* pSrcDoc);
+ sal_uInt32 getMappedNumberFormat(sal_uInt16 nFileId, sal_uInt32 nNumFmt, const ScDocument* pSrcDoc);
private:
/** cache of referenced ranges and names from source documents. */
@@ -756,3 +796,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx
index d7630b468f34..0873c846db69 100644
--- a/sc/inc/fielduno.hxx
+++ b/sc/inc/fielduno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -141,7 +142,7 @@ private:
SvxEditSource* pEditSource;
ESelection aSelection;
- String aUrl; // Inhalt, wenn noch nicht eingefuegt (nur dann!)
+ String aUrl; // content, only iff not already inserted
String aRepresentation;
String aTarget;
@@ -153,7 +154,7 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- // per getImplementation gerufen:
+ // called by getImplementation:
void DeleteField();
sal_Bool IsInserted() const { return pEditSource != NULL; }
SvxFieldItem CreateFieldItem();
@@ -348,7 +349,7 @@ public:
sal_uInt16 nT, const ESelection& rSel);
virtual ~ScHeaderFieldObj();
- // per getImplementation gerufen:
+ // called by getImplementation:
void DeleteField();
sal_Bool IsInserted() const { return pEditSource != NULL; }
SvxFieldItem CreateFieldItem();
@@ -452,3 +453,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx
index fbd1b8c20ec3..46a5b1b0dd46 100644
--- a/sc/inc/fillinfo.hxx
+++ b/sc/inc/fillinfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -151,3 +152,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/filter.hxx b/sc/inc/filter.hxx
index c678e71535f6..6a119a8570c0 100644
--- a/sc/inc/filter.hxx
+++ b/sc/inc/filter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,38 +42,34 @@ class ScDocument;
class ScRange;
class SvNumberFormatter;
-// Return-Werte Im-/Exportfilter (sal_uLong)
+// return values im-/export filter (sal_uLong)
typedef sal_uLong FltError;
-//enum FltError {
-#define eERR_OK ERRCODE_NONE // kein Fehler, alles OK
+#define eERR_OK ERRCODE_NONE // no error
#define eERR_OPEN SCERR_IMPORT_OPEN // ...
-#define eERR_UNBEK SCERR_IMPORT_UNKNOWN // unbekannter Fehler, auch historische Bedeutung
-#define eERR_NOMEM SCERR_IMPORT_OUTOFMEM // nicht mehr genuegend Speicher zur Verfuegung
-#define eERR_UNKN_WK SCERR_IMPORT_UNKNOWN_WK // unbekanntes WK?-Format (Lotus 1-2-3)
-#define eERR_FORMAT SCERR_IMPORT_FORMAT // Formatfehler beim Lesen (kein Formel-Fehler!)
-#define eERR_NI SCERR_IMPORT_NI // Nicht implementierter Filter
-#define eERR_UNKN_BIFF SCERR_IMPORT_UNKNOWN_BIFF // unbekanntes BIFF-Format (Excel)
-#define eERR_NI_BIFF SCERR_IMPORT_NI_BIFF // nicht implementiertes BIFF-Format
-#define eERR_FILEPASSWD SCERR_IMPORT_FILEPASSWD // File Passwordgeschuetzt
-#define eERR_INTERN SCERR_IMPORT_INTERNAL // interner Fehler
-#define eERR_RNGOVRFLW SCWARN_IMPORT_RANGE_OVERFLOW// ueberlauf der Zellkoordinaten:
- // Tabelle abgschnitten auf erlaubtem Bereich
-// mehr Fehlercodes siehe scerrors.hxx
-
-// };
-
-
-// fuer Import
+#define eERR_UNBEK SCERR_IMPORT_UNKNOWN // unknown error, historical meaning
+#define eERR_NOMEM SCERR_IMPORT_OUTOFMEM // out of memory
+#define eERR_UNKN_WK SCERR_IMPORT_UNKNOWN_WK // unknown WK? format (Lotus 1-2-3)
+#define eERR_FORMAT SCERR_IMPORT_FORMAT // format error during reading (no formula error!)
+#define eERR_NI SCERR_IMPORT_NI // filter not implemented
+#define eERR_UNKN_BIFF SCERR_IMPORT_UNKNOWN_BIFF // unknown BIFF format (Excel)
+#define eERR_NI_BIFF SCERR_IMPORT_NI_BIFF // not implemented BIFF format
+#define eERR_FILEPASSWD SCERR_IMPORT_FILEPASSWD // file password protected
+#define eERR_INTERN SCERR_IMPORT_INTERNAL // internal error
+#define eERR_RNGOVRFLW SCWARN_IMPORT_RANGE_OVERFLOW// overflow of cell coordinates
+ // table restricted to valid area (?)
+// more error codes: s. scerrors.hxx
+
+// for import
enum EXCIMPFORMAT { EIF_AUTO, EIF_BIFF5, EIF_BIFF8, EIF_BIFF_LE4 };
-// fuer Export
+// for export
enum ExportFormatLotus { ExpWK1, ExpWK3, ExpWK4 };
enum ExportFormatExcel { ExpBiff2, ExpBiff3, ExpBiff4, ExpBiff4W, ExpBiff5, ExpBiff8, Exp2007Xml };
-// Optionen fuer DIF-Im-/Export (Kombination ueber '|')
+// options for DIF im-/export (combine with '|')
#define SC_DIFOPT_PLAIN 0x00000000
#define SC_DIFOPT_DATE 0x00000001
#define SC_DIFOPT_TIME 0x00000002
@@ -91,7 +88,7 @@ class ScEEAbsImport {
virtual sal_uLong Read( SvStream& rStream, const String& rBaseURL ) = 0;
virtual ScRange GetRange() = 0;
virtual void WriteToDocument(
- sal_Bool bSizeColsRows = sal_False, double nOutputFactor = 1.0,
+ sal_Bool bSizeColsRows = false, double nOutputFactor = 1.0,
SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0;
};
@@ -101,10 +98,10 @@ class ScFormatFilterPlugin {
virtual FltError ScImportLotus123( SfxMedium&, ScDocument*, CharSet eSrc = RTL_TEXTENCODING_DONTKNOW ) = 0;
virtual FltError ScImportQuattroPro( SfxMedium &rMedium, ScDocument *pDoc ) = 0;
virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) = 0;
- // eFormat == EIF_AUTO -> passender Filter wird automatisch verwendet
- // eFormat == EIF_BIFF5 -> nur Biff5-Stream fuehrt zum Erfolg (auch wenn in einem Excel97-Doc)
- // eFormat == EIF_BIFF8 -> nur Biff8-Stream fuehrt zum Erfolg (nur in Excel97-Docs)
- // eFormat == EIF_BIFF_LE4 -> nur Nicht-Storage-Dateien _koennen_ zum Erfolg fuehren
+ // eFormat == EIF_AUTO -> matching filter is used automatically
+ // eFormat == EIF_BIFF5 -> only Biff5 stream is read sucessfully (in an Excel97 doc, too)
+ // eFormat == EIF_BIFF8 -> only Biff8 stream is read sucessfully (only in Excel97 docs)
+ // eFormat == EIF_BIFF_LE4 -> only non storage files _might_ be read sucessfully
virtual FltError ScImportStarCalc10( SvStream&, ScDocument* ) = 0;
virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, sal_uInt32 nDifOption = SC_DIFOPT_EXCEL ) = 0;
@@ -143,3 +140,4 @@ class ScFormatFilter {
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/filtopt.hxx b/sc/inc/filtopt.hxx
index b30ad8dba9f8..1b6de8909431 100644
--- a/sc/inc/filtopt.hxx
+++ b/sc/inc/filtopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/filtuno.hxx b/sc/inc/filtuno.hxx
index 2bddb7fdd02c..e42bfc19b386 100644
--- a/sc/inc/filtuno.hxx
+++ b/sc/inc/filtuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/fmtuno.hxx b/sc/inc/fmtuno.hxx
index f57b05350d67..6632ce25e7df 100644
--- a/sc/inc/fmtuno.hxx
+++ b/sc/inc/fmtuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,13 @@
#ifndef SC_FMTUNO_HXX
#define SC_FMTUNO_HXX
-#include "address.hxx"
-#include "conditio.hxx"
+#include <vector>
+
#include <formula/grammar.hxx>
-#include <tools/list.hxx>
#include <svl/itemprop.hxx>
#include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
#include <com/sun/star/sheet/XSheetCondition.hpp>
+#include <com/sun/star/sheet/XSheetCondition2.hpp>
#include <com/sun/star/sheet/XSheetConditionalEntry.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -47,7 +48,10 @@
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase5.hxx>
+#include <com/sun/star/sheet/ConditionOperator2.hpp>
+#include "address.hxx"
+#include "conditio.hxx"
class ScDocument;
class ScTableConditionalEntry;
@@ -82,7 +86,7 @@ class ScTableConditionalFormat : public cppu::WeakImplHelper5<
com::sun::star::lang::XServiceInfo >
{
private:
- List aEntries;
+ std::vector<ScTableConditionalEntry*> aEntries;
ScTableConditionalEntry* GetObjectByIndex_Impl(sal_uInt16 nIndex) const;
void AddEntry_Impl(const ScCondFormatEntryItem& aEntry);
@@ -151,7 +155,7 @@ public:
class ScTableConditionalEntry : public cppu::WeakImplHelper3<
- com::sun::star::sheet::XSheetCondition,
+ com::sun::star::sheet::XSheetCondition2,
com::sun::star::sheet::XSheetConditionalEntry,
com::sun::star::lang::XServiceInfo >
{
@@ -168,8 +172,12 @@ public:
// XSheetCondition
virtual ::com::sun::star::sheet::ConditionOperator SAL_CALL getOperator()
throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getConditionOperator()
+ throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setOperator( ::com::sun::star::sheet::ConditionOperator nOperator )
throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setConditionOperator( sal_Int32 nOperator )
+ throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getFormula1() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setFormula1( const ::rtl::OUString& aFormula1 )
throw(::com::sun::star::uno::RuntimeException);
@@ -198,7 +206,7 @@ public:
class ScTableValidationObj : public cppu::WeakImplHelper5<
- com::sun::star::sheet::XSheetCondition,
+ com::sun::star::sheet::XSheetCondition2,
com::sun::star::sheet::XMultiFormulaTokens,
com::sun::star::beans::XPropertySet,
com::sun::star::lang::XUnoTunnel,
@@ -242,8 +250,12 @@ public:
// XSheetCondition
virtual ::com::sun::star::sheet::ConditionOperator SAL_CALL getOperator()
throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getConditionOperator()
+ throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setOperator( ::com::sun::star::sheet::ConditionOperator nOperator )
throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setConditionOperator( sal_Int32 nOperator )
+ throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getFormula1() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setFormula1( const ::rtl::OUString& aFormula1 )
throw(::com::sun::star::uno::RuntimeException);
@@ -326,3 +338,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/forbiuno.hxx b/sc/inc/forbiuno.hxx
index 05e23cf96506..f092401801e9 100644
--- a/sc/inc/forbiuno.hxx
+++ b/sc/inc/forbiuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/formulaparserpool.hxx b/sc/inc/formulaparserpool.hxx
index c65f7f9428ce..56d1ac0c9a7b 100644
--- a/sc/inc/formulaparserpool.hxx
+++ b/sc/inc/formulaparserpool.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
#ifndef SC_FORMULAPARSERPOOL_HXX
#define SC_FORMULAPARSERPOOL_HXX
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/sheet/XFormulaParser.hpp>
class ScDocument;
@@ -51,7 +52,7 @@ public:
getFormulaParser( const ::rtl::OUString& rNamespace );
private:
- typedef ::std::hash_map<
+ typedef ::boost::unordered_map<
::rtl::OUString,
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser >,
::rtl::OUStringHash,
@@ -65,3 +66,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index b89f3da543ca..640573559606 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -613,3 +614,5 @@ inline ScMatrixFormulaCellToken* ScFormulaResult::GetMatrixFormulaCellTokenNonCo
#endif // SC_FORMULARESULT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index b386b6522683..fd4e1bc691f4 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,153 +29,392 @@
#ifndef SC_FUNCDESC_HXX
#define SC_FUNCDESC_HXX
-/* Function descriptions for function wizard / autopilot / most recent used
- * list et al. Separated from the global.hxx lump, implementation still in
- * global.cxx
- */
+/* Function descriptions for function wizard / autopilot */
+
+#include "scfuncs.hrc"
-#include <tools/list.hxx>
-#include <tools/string.hxx>
#include <formula/IFunctionDescription.hxx>
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
#define MAX_FUNCCAT 12 /* maximum number of categories for functions */
+#define LRU_MAX 10 /* maximal number of last recently used functions */
+
+class ScFuncDesc;
+class ScFunctionList;
+class ScFunctionCategory;
+class ScFunctionMgr;
+/**
+ Stores and generates human readable descriptions for spreadsheet-functions,
+ e.g.\ functions used in formulas in calc
+*/
class ScFuncDesc : public formula::IFunctionDescription
{
public:
+ ScFuncDesc();
+ virtual ~ScFuncDesc();
- virtual ::rtl::OUString getFunctionName() const ;
+ /**
+ Clears the object
+
+ Deletes all objets referenced by the pointers in the class,
+ sets pointers to NULL, and all numerical variables to 0
+ */
+ void Clear();
+
+ /**
+ Fills a mapping with indexes for non-suppressed arguments
+
+ Fills mapping from visible arguments to real arguments, e.g. if of 4
+ parameters the second one is suppressed {0,2,3}. For VAR_ARGS
+ parameters only one element is added to the end of the sequence.
+
+ @param _rArgumens
+ Vector, which the indices are written to
+ */
+ virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const ;
+
+ /**
+ Returns the category of the function
+
+ @return the category of the function
+ */
virtual const formula::IFunctionCategory* getCategory() const ;
+
+ /**
+ Returns the description of the function
+
+ @return the description of the function, or an empty OUString if there is no description
+ */
virtual ::rtl::OUString getDescription() const ;
- // GetSuppressedArgCount
- virtual xub_StrLen getSuppressedArgumentCount() const ;
- /** Returns the function signature with parameters from the passed string array. */
+
+ /**
+ Returns the function signature with parameters from the passed string array.
+
+ @return function signature with parameters
+ */
virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& _aArguments) const ;
- // GetVisibleArgMapping
- /** Returns mapping from visible arguments to real arguments, e.g. if of 4
- parameters the second one is suppressed {0,2,3}. For VAR_ARGS
- parameters only one element is added to the end of the sequence. */
- virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const ;
- virtual void initArgumentInfo() const;
- virtual ::rtl::OUString getSignature() const ;
- virtual rtl::OString getHelpId() const ;
- // parameter
+ /**
+ Returns the name of the function
+
+ @return the name of the function, or an empty OUString if there is no name
+ */
+ virtual ::rtl::OUString getFunctionName() const ;
+
+ /**
+ Returns the help id of the function
+
+ @return help id of the function
+ */
+ virtual long getHelpId() const ;
+
+ /**
+ Returns number of arguments
+
+ @return help id of the function
+ */
virtual sal_uInt32 getParameterCount() const ;
- virtual ::rtl::OUString getParameterName(sal_uInt32 _nPos) const ;
+
+ /**
+ Returns description of parameter at given position
+
+ @param _nPos
+ Position of the parameter
+
+ @return OUString description of the parameter
+ */
virtual ::rtl::OUString getParameterDescription(sal_uInt32 _nPos) const ;
- virtual bool isParameterOptional(sal_uInt32 _nPos) const ;
- struct ParameterFlags
- {
- bool bOptional :1; // Parameter is optional
- bool bSuppress :1; // Suppress parameter in UI because not implemented yet
+ /**
+ Returns name of parameter at given position
- ParameterFlags() : bOptional(false), bSuppress(false) {}
- };
+ @param _nPos
+ Position of the parameter
+ @return OUString name of the parameter
+ */
+ virtual ::rtl::OUString getParameterName(sal_uInt32 _nPos) const ;
- ScFuncDesc();
- virtual ~ScFuncDesc();
+ /**
+ Returns list of all parameter names
- void Clear();
+ @return OUString containing separated list of all parameter names
+ */
+ ::rtl::OUString GetParamList() const;
- /** Returns a semicolon separated list of all parameter names. */
- String GetParamList () const;
- /** Returns the full function signature: "FUNCTIONNAME( parameter list )". */
- String GetSignature () const;
+ /**
+ Returns the full function signature
+ @return OUString of the form "FUNCTIONNAME( parameter list )"
+ */
+ virtual ::rtl::OUString getSignature() const ;
+
+ /**
+ Returns the number of non-suppressed arguments
+ In case there are variable arguments the number of fixed non-suppressed
+ arguments plus VAR_ARGS, same as for nArgCount (variable arguments can't
+ be suppressed). The two functions are equal apart from return type and
+ name.
- /** Returns the number of non-suppressed arguments. In case there are
- variable arguments the number of fixed non-suppressed arguments plus
- VAR_ARGS, same as for nArgCount (variable arguments can't be
- suppressed). */
+ @return number of non-suppressed arguments
+ */
sal_uInt16 GetSuppressedArgCount() const;
+ virtual xub_StrLen getSuppressedArgumentCount() const ;
+
+ /**
+ Requests function data from AddInCollection
+
+ Logs error message on failure for debugging purposes
+ */
+ virtual void initArgumentInfo() const;
+
+ /**
+ Returns true if parameter at given position is optional
+
+ @param _nPos
+ Position of the parameter
+
+ @return true if optional, false if not optional
+ */
+ virtual bool isParameterOptional(sal_uInt32 _nPos) const ;
+
+ /**
+ Compares functions by name, respecting special characters
+
+ @param a
+ pointer to first function descriptor
- String *pFuncName; // Function name
- String *pFuncDesc; // Description of function
- String **ppDefArgNames; // Parameter name(s)
- String **ppDefArgDescs; // Description(s) of parameter(s)
- ParameterFlags *pDefArgFlags; // Flags for each parameter
- sal_uInt16 nFIndex; // Unique function index
- sal_uInt16 nCategory; // Function category
- sal_uInt16 nArgCount; // All parameter count, suppressed and unsuppressed
- rtl::OString sHelpId; // HelpID of function
- bool bIncomplete :1; // Incomplete argument info (set for add-in info from configuration)
- bool bHasSuppressedArgs :1; // Whether there is any suppressed parameter.
+ @param b
+ pointer to second function descriptor
+
+ @return "(a < b)"
+ */
+ static bool compareByName(const ScFuncDesc* a, const ScFuncDesc* b);
+
+ /**
+ Stores whether a parameter is optional or suppressed
+ */
+ struct ParameterFlags
+ {
+ bool bOptional :1; /**< Parameter is optional */
+ bool bSuppress :1; /**< Suppress parameter in UI because not implemented yet */
+
+ ParameterFlags() : bOptional(false), bSuppress(false) {}
+ };
+
+
+
+ ::rtl::OUString *pFuncName; /**< Function name */
+ ::rtl::OUString *pFuncDesc; /**< Description of function */
+ ::rtl::OUString **ppDefArgNames; /**< Parameter name(s) */
+ ::rtl::OUString **ppDefArgDescs; /**< Description(s) of parameter(s) */
+ ParameterFlags *pDefArgFlags; /**< Flags for each parameter */
+ sal_uInt16 nFIndex; /**< Unique function index */
+ sal_uInt16 nCategory; /**< Function category */
+ sal_uInt16 nArgCount; /**< All parameter count, suppressed and unsuppressed */
+ sal_uInt16 nHelpId; /**< HelpId of function */
+ bool bIncomplete :1; /**< Incomplete argument info (set for add-in info from configuration) */
+ bool bHasSuppressedArgs :1; /**< Whether there is any suppressed parameter. */
};
-//============================================================================
+/**
+ List of spreadsheet functions.
+ Generated by retrieving functions from resources, AddIns and StarOne AddIns,
+ and storing these in one linked list. Functions can be retrieved by index and
+ by iterating through the list, starting at the First element, and retrieving
+ the Next elements one by one.
+ The length of the longest function name can be retrieved for easier
+ processing (i.e printing a function list).
+*/
class ScFunctionList
{
public:
ScFunctionList();
~ScFunctionList();
- sal_uLong GetCount() const
- { return aFunctionList.Count(); }
+ sal_uInt32 GetCount() const
+ { return aFunctionList.size(); }
- const ScFuncDesc* First()
- { return (const ScFuncDesc*) aFunctionList.First(); }
+ const ScFuncDesc* First();
- const ScFuncDesc* Next()
- { return (const ScFuncDesc*) aFunctionList.Next(); }
+ const ScFuncDesc* Next();
- const ScFuncDesc* GetFunction( sal_uLong nIndex ) const
- { return (const ScFuncDesc*) aFunctionList.GetObject( nIndex ); }
+ const ScFuncDesc* GetFunction( sal_uInt32 nIndex ) const;
- xub_StrLen GetMaxFuncNameLen() const
- { return nMaxFuncNameLen; }
+ xub_StrLen GetMaxFuncNameLen() const
+ { return nMaxFuncNameLen; }
private:
- List aFunctionList;
- xub_StrLen nMaxFuncNameLen;
+ ::std::vector<const ScFuncDesc*> aFunctionList; /**< List of functions */
+ ::std::vector<const ScFuncDesc*>::iterator aFunctionListIter; /**< position in function list */
+ xub_StrLen nMaxFuncNameLen; /**< Length of longest function name */
};
-//============================================================================
+/**
+ Category of spreadsheet functions.
+
+ Contains the name, index and function manager of a category,
+ as well as a list of functions in the category
+*/
class ScFunctionCategory : public formula::IFunctionCategory
{
- ScFunctionMgr* m_pMgr;
- List* m_pCategory;
- mutable ::rtl::OUString m_sName;
- sal_uInt32 m_nCategory;
public:
- ScFunctionCategory(ScFunctionMgr* _pMgr,List* _pCategory,sal_uInt32 _nCategory) : m_pMgr(_pMgr),m_pCategory(_pCategory),m_nCategory(_nCategory){}
+ ScFunctionCategory(ScFunctionMgr* _pMgr,::std::vector<const ScFuncDesc*>* _pCategory,sal_uInt32 _nCategory)
+ : m_pMgr(_pMgr),m_pCategory(_pCategory),m_nCategory(_nCategory){}
virtual ~ScFunctionCategory(){}
- virtual sal_uInt32 getCount() const;
- virtual const formula::IFunctionManager* getFunctionManager() const;
- virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const;
- virtual sal_uInt32 getNumber() const;
- virtual ::rtl::OUString getName() const;
+
+ /**
+ @return count of functions in this category
+ */
+ virtual sal_uInt32 getCount() const;
+ virtual const formula::IFunctionManager* getFunctionManager() const;
+
+ /**
+ Gives the _nPos'th function in this category.
+
+ @param _nPos
+ position of function in this category.
+
+ @return function at the _nPos postion in this category, null if _nPos out of bounds.
+ */
+ virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const;
+
+ /**
+ @return index number of this category.
+ */
+ virtual sal_uInt32 getNumber() const;
+ virtual ::rtl::OUString getName() const;
+
+private:
+ ScFunctionMgr* m_pMgr; /**< function manager for this category */
+ ::std::vector<const ScFuncDesc*>* m_pCategory; /**< list of functions in this category */
+ mutable ::rtl::OUString m_sName; /**< name of this category */
+ sal_uInt32 m_nCategory; /**< index number of this category */
};
-//============================================================================
+
#define SC_FUNCGROUP_COUNT ID_FUNCTION_GRP_ADDINS
+/**
+ Stores spreadsheet functions in categories, including a cumulative ('All') category and makes them accessible.
+*/
class ScFunctionMgr : public formula::IFunctionManager
{
public:
+ /**
+ Retrieves all calc functions, generates cumulative ('All') category, and the categories.
+
+ The function lists of the categories are sorted by (case insensitive) function name
+ */
ScFunctionMgr();
virtual ~ScFunctionMgr();
- static String GetCategoryName(sal_uInt32 _nCategoryNumber );
+ /**
+ Returns name of category.
+
+ @param _nCategoryNumber
+ index of category
+
+ @return name of the category specified by _nCategoryNumber, empty string if _nCategoryNumber out of bounds
+ */
+ static ::rtl::OUString GetCategoryName(sal_uInt32 _nCategoryNumber );
+
+ /**
+ Returns function by name.
+
+ Searches for a function with the function name rFName, while ignoring case.
+
+ @param rFName
+ name of the function
- const ScFuncDesc* Get( const String& rFName ) const;
- const ScFuncDesc* Get( sal_uInt16 nFIndex ) const;
- const ScFuncDesc* First( sal_uInt16 nCategory = 0 ) const;
- const ScFuncDesc* Next() const;
+ @return pointer to function with the name rFName, null if no such function was found.
+ */
+ const ScFuncDesc* Get( const ::rtl::OUString& rFName ) const;
+
+ /**
+ Returns function by index.
+
+ Searches for a function with the function index nFIndex.
+
+ @param nFIndex
+ index of the function
+
+ @return pointer to function with the index nFIndex, null if no such function was found.
+ */
+ const ScFuncDesc* Get( sal_uInt16 nFIndex ) const;
+
+ /**
+ Returns the first function in category nCategory.
+
+ Selects nCategory as current category and returns first element of this.
+
+ @param nCategory
+ index of requested category
+
+ @return pointer to first element in current category, null if nCategory out of bounds
+ */
+ const ScFuncDesc* First( sal_uInt16 nCategory = 0 ) const;
+
+ /**
+ Returns the next function of the current category.
+
+ @return pointer to the next function in current category, null if current category not set.
+ */
+ const ScFuncDesc* Next() const;
+
+ /**
+ @return number of categories, not counting the cumulative category ('All')
+ */
+ virtual sal_uInt32 getCount() const;
+
+ /**
+ Returns a category.
+
+ Creates an IFunctionCategory object from a category specified by nPos.
+
+ @param nPos
+ the index of the category, note that 0 maps to the first category not the cumulative ('All') category.
+
+ @return pointer to an IFunctionCategory object, null if nPos out of bounds.
+ */
+ virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const;
+
+ /**
+ Appends the last recently used functions.
+
+ Takes the last recently used functions, but maximal LRU_MAX, and appends them to the given vector _rLastRUFunctions.
+
+ @param _rLastRUFunctions
+ a vector of pointer to IFunctionDescription, by reference.
+ */
+ virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const;
+
+ /**
+ Implemented because of inheritance \see ScFunctionMgr::Get(const ::rtl::OUString&) const
+ */
+ virtual const formula::IFunctionDescription* getFunctionByName(const ::rtl::OUString& _sFunctionName) const;
+
+ /**
+ Maps Etoken to character
+
+ Used for retrieving characters for parantheses and separators.
+
+ @param _eToken
+ token for which, the corresponding character is retrieved
+
+ @return character
+ */
+ virtual sal_Unicode getSingleToken(const formula::IFunctionManager::EToken _eToken) const;
- // formula::IFunctionManager
- virtual sal_uInt32 getCount() const;
- virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const;
- virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const;
- virtual const formula::IFunctionDescription* getFunctionByName(const ::rtl::OUString& _sFunctionName) const;
- virtual sal_Unicode getSingleToken(const formula::IFunctionManager::EToken _eToken) const;
private:
- ScFunctionList* pFuncList;
- List* aCatLists[MAX_FUNCCAT];
- mutable List* pCurCatList;
+ ScFunctionList* pFuncList; /**< list of all calc functions */
+ ::std::vector<const ScFuncDesc*>* aCatLists[MAX_FUNCCAT]; /**< array of all categories, 0 is the cumulative ('All') category */
+ mutable ::std::vector<const ScFuncDesc*>::iterator pCurCatListIter; /**< position in current category */
+ mutable ::std::vector<const ScFuncDesc*>::iterator pCurCatListEnd; /**< end of current category */
};
-//============================================================================
#endif // SC_FUNCDESC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/funcuno.hxx b/sc/inc/funcuno.hxx
index deb337d27f06..45758a23d3da 100644
--- a/sc/inc/funcuno.hxx
+++ b/sc/inc/funcuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -146,3 +147,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 766c8c551d5d..2543e7e6296f 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,15 +36,15 @@
#include <com/sun/star/uno/Reference.hxx>
#include "scdllapi.h"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
class ImageList;
class Bitmap;
class SfxItemSet;
class Color;
-// Macro fuer den Call-Profiler unter WinNT
-// mit S_CAP kann eine Messung gestarted, mit E_CAP wieder gestoppt werden
+// Macro for call profiler (WinNT)
+// S_CAP starts a measurement, E_CAP stops it
#if defined( WNT ) && defined( PROFILE )
extern "C" {
@@ -57,37 +58,18 @@ extern "C" {
#endif
-#if 0
-// I18N doesn't get this right, can't specify more than one to ignore
-#define SC_COLLATOR_IGNORES ( \
- ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE | \
- ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_KANA | \
- ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_WIDTH )
-#else
#define SC_COLLATOR_IGNORES ( \
::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE )
-#endif
-#if 0
-// #107998# Don't ignore Width and Kana. The issue was mainly with AutoInput,
-// but affects also comparison of names in general.
-#define SC_TRANSLITERATION_IGNORECASE ( \
- ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE | \
- ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
- ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
-#define SC_TRANSLITERATION_CASESENSE ( \
- ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
- ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
-#else
+
#define SC_TRANSLITERATION_IGNORECASE ( \
::com::sun::star::i18n::TransliterationModules_IGNORE_CASE )
#define SC_TRANSLITERATION_CASESENSE 0
-#endif
//------------------------------------------------------------------------
-// die 1000 Namen des Calc...
-// Clipboard-Namen sind jetzt in so3/soapp.hxx
-// STRING_SCAPP war "scalc3", "scalc4", jetzt nur noch "scalc"
+// Calc has lots of names...
+// Clipboard names are in so3/soapp.hxx now
+// STRING_SCAPP was "scalc3", "scalc4", now just "scalc"
#define STRING_SCAPP "scalc"
#define STRING_SCSTREAM "StarCalcDocument"
@@ -96,7 +78,7 @@ extern "C" {
// characters -----------------------------------------------------------------
-// '\r' geht auf'm Mac nicht...
+// '\r' does not work on a Mac...
#define CHAR_CR char(13)
const sal_Unicode CHAR_NBSP = 0x00A0;
@@ -115,25 +97,14 @@ const sal_Unicode CHAR_ZWNBSP = 0x2060;
#define MINZOOM 20
#define MAXZOOM 400
-#ifdef SC_ROWLIMIT_TYPECONVERSION_NOCONVPASS
-const size_t MAXSUBTOTAL = 3;
-const size_t MAXQUERY = 8;
-#else
const SCSIZE MAXSUBTOTAL = 3;
const SCSIZE MAXQUERY = 8;
-#endif
+const SCSIZE PIVOT_MAXFIELD = 8;
+const SCSIZE PIVOT_MAXPAGEFIELD = 10;
#define SC_START_INDEX_DB_COLL 50000
- // Oberhalb dieser Grenze liegen
- // die Indizes fuer DBBereiche
-
-/*
-#ifdef OS2
-#define PIXEL_PER_INCH 72.0
-#else
-#define PIXEL_PER_INCH 96.0
-#endif
-*/
+ // Above this threshold are indices
+ // for data base areas
#define PIXEL_PER_INCH 96.0
@@ -152,8 +123,8 @@ const SCSIZE MAXQUERY = 8;
#define HMM_PER_TWIPS (CM_PER_TWIPS * 1000.0)
#define STD_COL_WIDTH 1285
-#define STD_EXTRA_WIDTH 113 // 2mm Extra fuer optimale Breite
- // Standard Zeilenhoehe: Text + Rand - STD_ROWHEIGHT_DIFF
+#define STD_EXTRA_WIDTH 113 // 2mm extra for optimal width
+ // standard row height: text + margin - STD_ROWHEIGHT_DIFF
#define MAX_EXTRA_WIDTH 23811 // 42cm in TWIPS
@@ -162,19 +133,19 @@ const SCSIZE MAXQUERY = 8;
#define MAX_COL_HEIGHT 56693
#define STD_ROWHEIGHT_DIFF 23
-#define STD_FONT_HEIGHT 200 // entspricht 10 Punkt
+#define STD_FONT_HEIGHT 200 // equates 10 points
-//! statt STD_ROW_HEIGHT ScGlobal::nStdRowHeight benutzen !
+//! use ScGlobal::nStdRowHeight instead of STD_ROW_HEIGHT !
#define STD_ROW_HEIGHT (12.8 * TWIPS_PER_POINT) // 256 Twips, 0.45 cm
- // Standardgroesse als Ole-Server (Zellen)
+ // standard size as OLE server (cells)
#define OLE_STD_CELLS_X 4
#define OLE_STD_CELLS_Y 5
#define SC_SIZE_OPTIMUM 0xFFFF
- // Update-Flags
+ // update flags
#define UF_SCROLL_LEFT 1
#define UF_SCROLL_RIGHT 2
#define UF_SCROLL_UP 4
@@ -182,24 +153,21 @@ const SCSIZE MAXQUERY = 8;
#define UF_ROW 16
#define UF_VIEW 32
- // Repaint-Flags (fuer Messages)
+ // repaint flags (for messages)
#define PAINT_GRID 1
#define PAINT_TOP 2
#define PAINT_LEFT 4
#define PAINT_EXTRAS 8
-#define PAINT_INVERT 16
-#define PAINT_MARKS 32
-#define PAINT_OBJECTS 64
-#define PAINT_SIZE 128
+#define PAINT_MARKS 16
+#define PAINT_OBJECTS 32
+#define PAINT_SIZE 64
#define PAINT_ALL ( PAINT_GRID | PAINT_TOP | PAINT_LEFT | PAINT_EXTRAS | PAINT_OBJECTS | PAINT_SIZE )
- // Flags fuer Spalten / Zeilen
- // FILTERED immer zusammen mit HIDDEN
- // FILTERED und MANUALSIZE nur fuer Zeilen moeglich
+ // flags for columns / rows
+ // FILTERED always together with HIDDEN
+ // FILTERED and MANUALSIZE only valid for rows
const sal_uInt8 CR_HIDDEN = 1;
-//const sal_uInt8 CR_MARKED = 2;
-//const sal_uInt8 CR_PAGEBREAK = 4;
const sal_uInt8 CR_MANUALBREAK = 8;
const sal_uInt8 CR_FILTERED = 16;
const sal_uInt8 CR_MANUALSIZE = 32;
@@ -210,7 +178,7 @@ const ScBreakType BREAK_NONE = 0;
const ScBreakType BREAK_PAGE = 1;
const ScBreakType BREAK_MANUAL = 2;
-// Insert-/Delete-Flags
+// insert/delete flags
const sal_uInt16 IDF_NONE = 0x0000;
const sal_uInt16 IDF_VALUE = 0x0001; /// Numeric values (and numeric results if IDF_FORMULA is not set).
const sal_uInt16 IDF_DATETIME = 0x0002; /// Dates, times, datetime values.
@@ -221,6 +189,7 @@ const sal_uInt16 IDF_HARDATTR = 0x0020; /// Hard cell attributes.
const sal_uInt16 IDF_STYLES = 0x0040; /// Cell styles.
const sal_uInt16 IDF_OBJECTS = 0x0080; /// Drawing objects.
const sal_uInt16 IDF_EDITATTR = 0x0100; /// Rich-text attributes.
+const sal_uInt16 IDF_SPECIAL_BOOLEAN = 0x1000;
const sal_uInt16 IDF_ATTRIB = IDF_HARDATTR | IDF_STYLES;
const sal_uInt16 IDF_CONTENTS = IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_NOTE | IDF_FORMULA;
const sal_uInt16 IDF_ALL = IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS;
@@ -238,7 +207,7 @@ const sal_uInt16 IDF_AUTOFILL = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
#define PASTE_NONEMPTY 5
- // Bits fuer HasAttr
+ // bits for HasAttr
#define HASATTR_LINES 1
#define HASATTR_MERGED 2
#define HASATTR_OVERLAPPED 4
@@ -259,28 +228,28 @@ const sal_uInt16 IDF_AUTOFILL = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
#define EMPTY_STRING ScGlobal::GetEmptyString()
- // Layer-ID's fuer Drawing
+ // layer id's for drawing
#define SC_LAYER_FRONT 0
#define SC_LAYER_BACK 1
#define SC_LAYER_INTERN 2
#define SC_LAYER_CONTROLS 3
#define SC_LAYER_HIDDEN 4
- // Tabellen linken
+ // link tables
#define SC_LINK_NONE 0
#define SC_LINK_NORMAL 1
#define SC_LINK_VALUE 2
- // Eingabe
+ // input
#define SC_ENTER_NORMAL 0
#define SC_ENTER_BLOCK 1
#define SC_ENTER_MATRIX 2
- // Step = 10pt, max. Einzug = 100 Schritte
+ // step = 10pt, max. indention = 100 steps
#define SC_INDENT_STEP 200
#define SC_MAX_INDENT 20000
- // Szenario-Flags
+ // scenario flags
#define SC_SCENARIO_COPYALL 1
#define SC_SCENARIO_SHOWFRAME 2
#define SC_SCENARIO_PRINTFRAME 4
@@ -294,11 +263,11 @@ const sal_uInt16 IDF_AUTOFILL = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
#define DELETEZ(pPtr) { delete pPtr; pPtr = 0; }
#endif
- // Ist Bit in Set gesetzt?
+ // is bit set in set?
#define IS_SET(bit,set)(((set)&(bit))==(bit))
-#define SEL_ALL -1 // Eingabezeile: alles Selektieren
-#define RES_CANCEL 0 // Resultate der Funk.AutoPilot-Seiten
+#define SEL_ALL -1 // input line: select all
+#define RES_CANCEL 0 // results of function AutoPilot pages
#define RES_BACKWARD 1
#define RES_END 2
@@ -310,7 +279,7 @@ enum CellType
CELLTYPE_FORMULA,
CELLTYPE_NOTE,
CELLTYPE_EDIT,
- CELLTYPE_SYMBOLS // fuer Laden/Speichern
+ CELLTYPE_SYMBOLS // for load/save
#if DBG_UTIL
,CELLTYPE_DESTROYED
#endif
@@ -387,30 +356,29 @@ enum ScSizeMode
enum ScInputMode
{
SC_INPUT_NONE,
- SC_INPUT_TYPE, // Eingabe, ohne im Inplace-Modus zu sein
- SC_INPUT_TABLE, // Textcursor in der Tabelle
- SC_INPUT_TOP // Textcursor in der Eingabezeile
+ SC_INPUT_TYPE, // input, while not in inplace mode
+ SC_INPUT_TABLE, // text cursor in the table
+ SC_INPUT_TOP // text cursor in the input line
};
-enum ScVObjMode // Ausgabemodi von Objekten auf einer Seite
+enum ScVObjMode // output modes of objects on a page
{
VOBJ_MODE_SHOW,
VOBJ_MODE_HIDE
- // #i80528# VOBJ_MODE_DUMMY removed, no longer supported
};
-enum ScAnchorType // Verankerung eines Zeichenobjekts
+enum ScAnchorType // anchor of a character object
{
SCA_CELL,
SCA_PAGE,
- SCA_DONTKNOW // bei Mehrfachselektion
+ SCA_DONTKNOW // for multi selection
};
enum ScGetDBMode
{
- SC_DB_MAKE, // wenn noetig, "unbenannt" anlegen
- SC_DB_IMPORT, // wenn noetig, "Importx" anlegen
- SC_DB_OLD // nicht neu anlegen
+ SC_DB_MAKE, // create "untitled" (if necessary)
+ SC_DB_IMPORT, // create "Importx" (if necessary)
+ SC_DB_OLD // don't create
};
/// For ScDBFunc::GetDBData()
@@ -436,12 +404,12 @@ enum ScGetDBSelection
SC_DBSEL_FORCE_MARK
};
-enum ScLkUpdMode
-{ //Verknuepfungen
- LM_ALWAYS, //immer aktualisieren
- LM_NEVER, //niemals
- LM_ON_DEMAND, //auf nachfrage
- LM_UNKNOWN //Shit happens
+enum ScLkUpdMode // modes for updating links
+{
+ LM_ALWAYS,
+ LM_NEVER,
+ LM_ON_DEMAND,
+ LM_UNKNOWN
};
@@ -465,10 +433,10 @@ struct ScImportParam
SCCOL nCol2;
SCROW nRow2;
sal_Bool bImport;
- String aDBName; // Alias der Datenbank
+ String aDBName; // alias of data base
String aStatement;
sal_Bool bNative;
- sal_Bool bSql; // Statement oder Name?
+ sal_Bool bSql; // statement or name?
sal_uInt8 nType; // enum DBObject
ScImportParam();
@@ -477,7 +445,6 @@ struct ScImportParam
ScImportParam& operator= ( const ScImportParam& r );
sal_Bool operator== ( const ScImportParam& r ) const;
-//UNUSED2009-05 void Clear ();
};
struct ScStringHashCode
@@ -545,10 +512,6 @@ class ScGlobal
static SvxBrushItem* pProtectedBrushItem;
static ImageList* pOutlineBitmaps;
- static ImageList* pOutlineBitmapsHC;
-
-// static Bitmap* pAnchorBitmap;
-// static Bitmap* pGrayAnchorBitmap;
static ScFunctionList* pStarCalcFunctionList;
static ScFunctionMgr* pStarCalcFunctionMgr;
@@ -580,7 +543,7 @@ public:
static IntlWrapper* GetScIntlWrapper();
static ::com::sun::star::lang::Locale* GetLocale();
- SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration(); //CHINA001
+ SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration();
static ::utl::TransliterationWrapper* GetCaseTransliteration();
SC_DLLPUBLIC static LanguageType eLnge;
@@ -618,9 +581,9 @@ public:
SC_DLLPUBLIC static long nLastRowHeightExtra;
static long nLastColWidthExtra;
- static void Init(); // am Anfang
+ static void Init(); // during start up
static void InitAddIns();
- static void Clear(); // bei Programmende
+ static void Clear(); // at the end of the program
static void UpdatePPT(OutputDevice* pDev);
@@ -632,12 +595,8 @@ public:
SC_DLLPUBLIC static const String& GetEmptyString();
static const String& GetScDocString();
- /** Returns the specified image list with outline symbols.
- @param bHC false = standard symbols; true = high contrast symbols. */
- static ImageList* GetOutlineSymbols( bool bHC );
-
-// static const Bitmap& GetAnchorBitmap();
-// static const Bitmap& GetGrayAnchorBitmap();
+ /** Returns the specified image list with outline symbols. */
+ static ImageList* GetOutlineSymbols();
static bool HasStarCalcFunctionList();
static ScFunctionList* GetStarCalcFunctionList();
@@ -731,7 +690,7 @@ SC_DLLPUBLIC static const sal_Unicode* FindUnquoted( const sal_Unicode* pStri
#endif
//==================================================================
-// evtl. in dbdata.hxx auslagern (?):
+// maybe move to dbdata.hxx (?):
enum ScQueryOp
{
@@ -783,9 +742,9 @@ enum ScSubTotalFunc
// -----------------------------------------------------------------------
/*
- * Dialog liefert die ausgezeichneten Feldwerte "leer"/"nicht leer"
- * als Konstanten SC_EMPTYFIELDS bzw. SC_NONEMPTYFIELDS in nVal in
- * Verbindung mit dem Schalter bQueryByString auf FALSE.
+ * dialog returns the special field values "empty"/"not empty"
+ * as constants SC_EMPTYFIELDS and SC_NONEMPTYFIELDS respectively in nVal in
+ * conjuctions with the flag bQueryByString = FALSE.
*/
#define SC_EMPTYFIELDS ((double)0x0042)
@@ -807,14 +766,14 @@ struct ScQueryEntry
ScQueryConnect eConnect;
String* pStr;
double nVal;
- utl::SearchParam* pSearchParam; // falls RegExp, nicht gespeichert
- utl::TextSearch* pSearchText; // falls RegExp, nicht gespeichert
+ utl::SearchParam* pSearchParam; // if RegExp, not saved
+ utl::TextSearch* pSearchText; // if RegExp, not saved
ScQueryEntry();
ScQueryEntry(const ScQueryEntry& r);
~ScQueryEntry();
- // legt ggbf. pSearchParam und pSearchText an, immer RegExp!
+ // creates pSearchParam and pSearchText if necessary, always RegExp!
utl::TextSearch* GetSearchTextPtr( sal_Bool bCaseSens );
void Clear();
@@ -826,24 +785,24 @@ struct ScQueryEntry
struct SC_DLLPUBLIC ScSubTotalParam
{
- SCCOL nCol1; // Selektierter Bereich
+ SCCOL nCol1; // selected area
SCROW nRow1;
SCCOL nCol2;
SCROW nRow2;
sal_Bool bRemoveOnly;
- sal_Bool bReplace; // vorhandene Ergebnisse ersetzen
- sal_Bool bPagebreak; // Seitenumbruch bei Gruppenwechsel
- sal_Bool bCaseSens; // Gross-/Kleinschreibung
- sal_Bool bDoSort; // vorher sortieren
- sal_Bool bAscending; // aufsteigend sortieren
- sal_Bool bUserDef; // Benutzer-def. Sort.Reihenfolge
- sal_uInt16 nUserIndex; // Index auf Liste
- sal_Bool bIncludePattern; // Formate mit sortieren
- sal_Bool bGroupActive[MAXSUBTOTAL]; // aktive Gruppen
- SCCOL nField[MAXSUBTOTAL]; // zugehoeriges Feld
- SCCOL nSubTotals[MAXSUBTOTAL]; // Anzahl der SubTotals
- SCCOL* pSubTotals[MAXSUBTOTAL]; // Array der zu berechnenden Spalten
- ScSubTotalFunc* pFunctions[MAXSUBTOTAL]; // Array der zugehoerige Funktionen
+ sal_Bool bReplace; // replace existing results
+ sal_Bool bPagebreak; // page break at change of group
+ sal_Bool bCaseSens; //
+ sal_Bool bDoSort; // presort
+ sal_Bool bAscending; // sort ascending
+ sal_Bool bUserDef; // sort user defined
+ sal_uInt16 nUserIndex; // index into list
+ sal_Bool bIncludePattern; // sort formats
+ sal_Bool bGroupActive[MAXSUBTOTAL]; // active groups
+ SCCOL nField[MAXSUBTOTAL]; // associated field
+ SCCOL nSubTotals[MAXSUBTOTAL]; // number of SubTotals
+ SCCOL* pSubTotals[MAXSUBTOTAL]; // array of columns to be calculated
+ ScSubTotalFunc* pFunctions[MAXSUBTOTAL]; // array of associated functions
ScSubTotalParam();
ScSubTotalParam( const ScSubTotalParam& r );
@@ -862,15 +821,15 @@ class ScArea;
struct ScConsolidateParam
{
- SCCOL nCol; // Cursor Position /
- SCROW nRow; // bzw. Anfang des Zielbereiches
+ SCCOL nCol; // cursor position /
+ SCROW nRow; // or start of destination area respectively
SCTAB nTab;
- ScSubTotalFunc eFunction; // Berechnungsvorschrift
- sal_uInt16 nDataAreaCount; // Anzahl der Datenbereiche
- ScArea** ppDataAreas; // Zeiger-Array auf Datenbereiche
- sal_Bool bByCol; // nach Spalten
- sal_Bool bByRow; // nach Zeilen
- sal_Bool bReferenceData; // Quelldaten referenzieren
+ ScSubTotalFunc eFunction;
+ sal_uInt16 nDataAreaCount; // number of data areas
+ ScArea** ppDataAreas; // array of pointers into data areas
+ sal_Bool bByCol;
+ sal_Bool bByRow;
+ sal_Bool bReferenceData; // reference source data
ScConsolidateParam();
ScConsolidateParam( const ScConsolidateParam& r );
@@ -883,8 +842,6 @@ struct ScConsolidateParam
void SetAreas ( ScArea* const* ppAreas, sal_uInt16 nCount );
};
-// -----------------------------------------------------------------------
-extern ::utl::TransliterationWrapper* GetScGlobalpTransliteration();//CHINA001
-extern const LocaleDataWrapper* GetScGlobalpLocaleData();
-
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 31934067988a..d69b34c73dc0 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -28,7 +28,6 @@
#ifndef __GLOBSTR_HRC_
#define __GLOBSTR_HRC_
-
#define STR_UNDO_DELETECELLS 1
#define STR_UNDO_CUT 2
#define STR_UNDO_PASTE 3
@@ -92,7 +91,6 @@
#define STR_MSSG_SOLVE_4 60
#define STR_MSSG_SOLVE_5 61
#define STR_MSSG_SOLVE_6 62
-// unused: 63
#define STR_TABLE_GESAMTERGEBNIS 64
#define STR_TABLE_ERGEBNIS 65
@@ -101,7 +99,6 @@
#define STR_TABLE_ODER 68
#define STR_UNDO_INSERTCELLS 69
#define STR_TABLE_DEF 70
-//#define STR_STYLENAME_STANDARD 71 s.u.
#define STR_MOVE_TO_END 72
#define STR_BOX_YNI 73
#define STR_NO_REF_TABLE 74
@@ -166,8 +163,6 @@
#define STR_FUN_TEXT_VAR 131
#define STR_DOC_STAT 132
-//#define STR_STYLENAME_RESULT 133 s.u.
-
#define STR_DBNAME_IMPORT 134
#define STR_NOCHARTATCURSOR 135
@@ -338,7 +333,6 @@
#define STR_VOBJ_DRAWINGS 263
#define STR_VOBJ_MODE_SHOW 264
#define STR_VOBJ_MODE_HIDE 265
-//#i80528##define STR_VOBJ_MODE_DUMMY 266
#define STR_SCATTR_PAGE_TOPDOWN 267
#define STR_SCATTR_PAGE_LEFTRIGHT 268
@@ -353,7 +347,6 @@
#define STR_SCATTR_PAGE_SCALETOPAGES 277
#define STR_NOREF_STR 278 /* moved to compiler.src, keep define! */
-// unused: 279
#define STR_UNDO_CHARTDATA 280
#define STR_UNDO_ORIGINALSIZE 281
@@ -409,7 +402,6 @@
#define STR_DETINVALID_OVERFLOW 315
#define STR_GRAPHICNAME 316
#define STR_INVALIDNAME 317
-// 318 ist oben
#define STR_ERR_LINKOVERLAP 319
#define STR_VALID_MACRONOTFOUND 320
@@ -571,13 +563,33 @@
#define STR_STYLE_FAMILY_PAGE 434
#define STR_ERR_DATAPILOTSOURCE 435
-#define STR_PIVOT_FIRSTROWEMPTYERR 436
+#define STR_PIVOT_FIRSTROWEMPTYERR 436
#define STR_PIVOT_ONLYONEROWERR 437
#define STR_UNDO_SET_TAB_BG_COLOR 438
#define STR_UNDO_SET_MULTI_TAB_BG_COLOR 439
-
-#define STR_COUNT 440
+#define STR_UNDO_INSERT_CURRENT_DATE 440
+#define STR_UNDO_INSERT_CURRENT_TIME 441
+
+#define STR_OPTIONS_WARN_SEPARATORS 442
+#define STR_SHAPE_AUTOSHAPE 443
+#define STR_SHAPE_RECTANGLE 444
+#define STR_SHAPE_LINE 445
+#define STR_SHAPE_OVAL 446
+#define STR_SHAPE_TEXTBOX 447
+
+#define STR_FORM_BUTTON 448
+#define STR_FORM_CHECKBOX 449
+#define STR_FORM_OPTIONBUTTON 450
+#define STR_FORM_LABEL 451
+#define STR_FORM_LISTBOX 452
+#define STR_FORM_GROUPBOX 453
+#define STR_FORM_DROPDOWN 454
+#define STR_FORM_SPINNER 455
+#define STR_FORM_SCROLLBAR 456
+
+#define STR_PGNUM 457
+
+#define STR_COUNT 458
#endif
-
diff --git a/sc/inc/hints.hxx b/sc/inc/hints.hxx
index dbae6a3a5944..4ce3249bda05 100644
--- a/sc/inc/hints.hxx
+++ b/sc/inc/hints.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@ class ScPaintHint : public SfxHint
{
ScRange aRange;
sal_uInt16 nParts;
- sal_Bool bPrint; // Flag, ob auch Druck/Vorschau betroffen ist
+ sal_Bool bPrint; // flag indicating whether print/preview if affected
ScPaintHint(); // disabled
@@ -93,7 +94,6 @@ class ScPointerChangedHint : public SfxHint
public:
TYPEINFO();
-//UNUSED2008-05 ScPointerChangedHint( sal_uInt16 nF );
~ScPointerChangedHint();
sal_uInt16 GetFlags() const { return nFlags; }
@@ -183,3 +183,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/inputopt.hxx b/sc/inc/inputopt.hxx
index b461900f7811..182449b3be70 100644
--- a/sc/inc/inputopt.hxx
+++ b/sc/inc/inputopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,3 +104,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/linkuno.hxx b/sc/inc/linkuno.hxx
index fd74625dcd73..cc81dd33698c 100644
--- a/sc/inc/linkuno.hxx
+++ b/sc/inc/linkuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@
#include "externalrefmgr.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
class ScAreaLink;
@@ -632,3 +633,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/listenercalls.hxx b/sc/inc/listenercalls.hxx
index 988cd2a24dd7..d5167c96e174 100644
--- a/sc/inc/listenercalls.hxx
+++ b/sc/inc/listenercalls.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx
index 9f212f5b74be..9901ba5a5479 100644
--- a/sc/inc/lookupcache.hxx
+++ b/sc/inc/lookupcache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <svl/listener.hxx>
#include <tools/string.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
class ScDocument;
@@ -240,7 +241,7 @@ private:
}
};
- typedef ::std::hash_map< QueryKey, QueryCriteriaAndResult, QueryKey::Hash, ::std::equal_to< QueryKey > > QueryMap;
+ typedef ::boost::unordered_map< QueryKey, QueryCriteriaAndResult, QueryKey::Hash, ::std::equal_to< QueryKey > > QueryMap;
QueryMap maQueryMap;
ScRange maRange;
ScDocument * mpDoc;
@@ -252,6 +253,8 @@ private:
};
-typedef ::std::hash_map< ScRange, ScLookupCache*, ScLookupCache::Hash, ::std::equal_to< ScRange > > ScLookupCacheMap;
+typedef ::boost::unordered_map< ScRange, ScLookupCache*, ScLookupCache::Hash, ::std::equal_to< ScRange > > ScLookupCacheMap;
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/macromgr.hxx b/sc/inc/macromgr.hxx
new file mode 100644
index 000000000000..4c8bad9e3ff8
--- /dev/null
+++ b/sc/inc/macromgr.hxx
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * 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 SC_MACROMGR_HXX
+#define SC_MACROMGR_HXX
+
+#include <com/sun/star/container/XContainerListener.hpp>
+
+#include "rtl/ustring.hxx"
+#include "scdllapi.h"
+
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
+#include <memory>
+
+class ScDocument;
+class ScFormulaCell;
+class ScUserMacroDepTracker;
+
+class ScMacroManager
+{
+public:
+ explicit ScMacroManager(ScDocument* pDoc);
+ ~ScMacroManager();
+
+ SC_DLLPUBLIC void InitUserFuncData();
+ SC_DLLPUBLIC void SetUserFuncVolatile( const rtl::OUString& sName, bool isVolatile );
+ SC_DLLPUBLIC bool GetUserFuncVolatile( const rtl::OUString& sName );
+
+ void AddDependentCell(const ::rtl::OUString& aModuleName, ScFormulaCell* pCell);
+ void RemoveDependentCell(ScFormulaCell* pCell);
+ void BroadcastModuleUpdate(const ::rtl::OUString& aModuleName);
+
+private:
+ typedef boost::unordered_map< ::rtl::OUString, bool, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameBoolMap;
+ NameBoolMap mhFuncToVolatile;
+ com::sun::star::uno::Reference< com::sun::star::container::XContainerListener > mxContainerListener;
+
+ ::std::auto_ptr<ScUserMacroDepTracker> mpDepTracker;
+ ScDocument* mpDoc;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/markarr.hxx b/sc/inc/markarr.hxx
index 46352e5b6ee0..f77dea372b48 100644
--- a/sc/inc/markarr.hxx
+++ b/sc/inc/markarr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@ friend class ScDocument; // fuer FillInfo
public:
ScMarkArray();
~ScMarkArray();
- void Reset( sal_Bool bMarked = sal_False );
+ void Reset( sal_Bool bMarked = false );
sal_Bool GetMark( SCROW nRow ) const;
void SetMarkArea( SCROW nStartRow, SCROW nEndRow, sal_Bool bMarked );
sal_Bool IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const;
@@ -62,7 +63,6 @@ public:
void CopyMarksTo( ScMarkArray& rDestMarkArray ) const;
sal_Bool Search( SCROW nRow, SCSIZE& nIndex ) const;
-//UNUSED2009-05 void DeleteArea(SCROW nStartRow, SCROW nEndRow);
/// Including current row, may return -1 if bUp and not found
SCsROW GetNextMarked( SCsROW nRow, sal_Bool bUp ) const;
@@ -85,3 +85,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/markdata.hxx b/sc/inc/markdata.hxx
index 3887a5da70eb..51b67d7cb560 100644
--- a/sc/inc/markdata.hxx
+++ b/sc/inc/markdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,22 +37,22 @@ class ScMarkArray;
class ScRangeList;
//! todo:
-//! Es muss auch die Moeglichkeit geben, MarkArrays pro Tabelle zu halten,
-//! damit "alle suchen" ueber mehrere Tabellen wieder funktioniert!
+//! It should be possible to have MarkArrays for each table, in order to
+//! enable "search all" across more than one table again!
class SC_DLLPUBLIC ScMarkData
{
private:
- ScRange aMarkRange; // Bereich
- ScRange aMultiRange; // maximaler Bereich insgesamt
- ScMarkArray* pMultiSel; // Mehrfachselektion
- sal_Bool bTabMarked[MAXTABCOUNT];// Tabelle selektiert
- sal_Bool bMarked; // Rechteck markiert
- sal_Bool bMultiMarked; // mehrfach markiert
+ ScRange aMarkRange; // area
+ ScRange aMultiRange; // maximum area altogether
+ ScMarkArray* pMultiSel; // multi selection
+ sal_Bool bTabMarked[MAXTABCOUNT];// table marked
+ sal_Bool bMarked; // rectangle marked
+ sal_Bool bMultiMarked;
- sal_Bool bMarking; // Bereich wird aufgezogen -> kein MarkToMulti
- sal_Bool bMarkIsNeg; // Aufheben bei Mehrfachselektion
+ sal_Bool bMarking; // area is being marked -> no MarkToMulti
+ sal_Bool bMarkIsNeg; // cancel if multi selection
public:
ScMarkData();
@@ -88,10 +89,10 @@ public:
void SetMarking( sal_Bool bFlag ) { bMarking = bFlag; }
sal_Bool GetMarkingFlag() const { return bMarking; }
- // fuer FillInfo / Document etc.
+ // for FillInfo / Document etc.
const ScMarkArray* GetArray() const { return pMultiSel; }
- sal_Bool IsCellMarked( SCCOL nCol, SCROW nRow, sal_Bool bNoSimple = sal_False ) const;
+ sal_Bool IsCellMarked( SCCOL nCol, SCROW nRow, sal_Bool bNoSimple = false ) const;
void FillRangeListWithMarks( ScRangeList* pList, sal_Bool bClear ) const;
void ExtendRangeListTables( ScRangeList* pList ) const;
@@ -109,7 +110,7 @@ public:
sal_Bool HasMultiMarks( SCCOL nCol ) const;
sal_Bool HasAnyMultiMarks() const;
- // Tabellen-Markierungen anpassen:
+ // adjust table marking:
void InsertTab( SCTAB nTab );
void DeleteTab( SCTAB nTab );
};
@@ -119,3 +120,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx
index d1958eccceac..9246abc08a2d 100644
--- a/sc/inc/miscuno.hxx
+++ b/sc/inc/miscuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,22 +64,22 @@ sal_Bool SAL_CALL ClassName::supportsService( const ::rtl::OUString& ServiceName
const uno::Reference<beans::XPropertyChangeListener>&) \
throw(beans::UnknownPropertyException, \
lang::WrappedTargetException, uno::RuntimeException) \
- { DBG_ERROR("not implemented"); } \
+ { OSL_FAIL("not implemented"); } \
void SAL_CALL ClassName::removePropertyChangeListener( const rtl::OUString&, \
const uno::Reference<beans::XPropertyChangeListener>&) \
throw(beans::UnknownPropertyException, \
lang::WrappedTargetException, uno::RuntimeException) \
- { DBG_ERROR("not implemented"); } \
+ { OSL_FAIL("not implemented"); } \
void SAL_CALL ClassName::addVetoableChangeListener( const rtl::OUString&, \
const uno::Reference<beans::XVetoableChangeListener>&) \
throw(beans::UnknownPropertyException, \
lang::WrappedTargetException, uno::RuntimeException) \
- { DBG_ERROR("not implemented"); } \
+ { OSL_FAIL("not implemented"); } \
void SAL_CALL ClassName::removeVetoableChangeListener( const rtl::OUString&, \
const uno::Reference<beans::XVetoableChangeListener>&) \
throw(beans::UnknownPropertyException, \
lang::WrappedTargetException, uno::RuntimeException) \
- { DBG_ERROR("not implemented"); }
+ { OSL_FAIL("not implemented"); }
#define SC_QUERYINTERFACE(x) \
@@ -123,56 +124,6 @@ public:
throw(::com::sun::star::uno::RuntimeException);
};
-//UNUSED2008-05 class ScEmptyEnumerationAccess : public cppu::WeakImplHelper2<
-//UNUSED2008-05 com::sun::star::container::XEnumerationAccess,
-//UNUSED2008-05 com::sun::star::lang::XServiceInfo >
-//UNUSED2008-05 {
-//UNUSED2008-05 public:
-//UNUSED2008-05 ScEmptyEnumerationAccess();
-//UNUSED2008-05 virtual ~ScEmptyEnumerationAccess();
-//UNUSED2008-05
-//UNUSED2008-05 // XEnumerationAccess
-//UNUSED2008-05 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
-//UNUSED2008-05 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05
-//UNUSED2008-05 // XElementAccess
-//UNUSED2008-05 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05
-//UNUSED2008-05 // XServiceInfo
-//UNUSED2008-05 virtual ::rtl::OUString SAL_CALL getImplementationName( )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 };
-
-//UNUSED2008-05 class ScEmptyEnumeration : public cppu::WeakImplHelper2<
-//UNUSED2008-05 com::sun::star::container::XEnumeration,
-//UNUSED2008-05 com::sun::star::lang::XServiceInfo >
-//UNUSED2008-05 {
-//UNUSED2008-05 public:
-//UNUSED2008-05 ScEmptyEnumeration();
-//UNUSED2008-05 virtual ~ScEmptyEnumeration();
-//UNUSED2008-05
-//UNUSED2008-05 // XEnumeration
-//UNUSED2008-05 virtual sal_Bool SAL_CALL hasMoreElements() throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
-//UNUSED2008-05 throw(::com::sun::star::container::NoSuchElementException,
-//UNUSED2008-05 ::com::sun::star::lang::WrappedTargetException,
-//UNUSED2008-05 ::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05
-//UNUSED2008-05 // XServiceInfo
-//UNUSED2008-05 virtual ::rtl::OUString SAL_CALL getImplementationName( )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 };
-
// new (uno 3) variant
class ScNameToIndexAccess : public cppu::WeakImplHelper2<
com::sun::star::container::XIndexAccess,
@@ -209,65 +160,6 @@ public:
throw(::com::sun::star::uno::RuntimeException);
};
-//UNUSED2008-05 class ScPrintSettingsObj : public cppu::WeakImplHelper2<
-//UNUSED2008-05 com::sun::star::beans::XPropertySet,
-//UNUSED2008-05 com::sun::star::lang::XServiceInfo >
-//UNUSED2008-05 {
-//UNUSED2008-05 public:
-//UNUSED2008-05 ScPrintSettingsObj();
-//UNUSED2008-05 virtual ~ScPrintSettingsObj();
-//UNUSED2008-05
-//UNUSED2008-05 // XPropertySet
-//UNUSED2008-05 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
-//UNUSED2008-05 SAL_CALL getPropertySetInfo()
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
-//UNUSED2008-05 const ::com::sun::star::uno::Any& aValue )
-//UNUSED2008-05 throw(::com::sun::star::beans::UnknownPropertyException,
-//UNUSED2008-05 ::com::sun::star::beans::PropertyVetoException,
-//UNUSED2008-05 ::com::sun::star::lang::IllegalArgumentException,
-//UNUSED2008-05 ::com::sun::star::lang::WrappedTargetException,
-//UNUSED2008-05 ::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
-//UNUSED2008-05 const ::rtl::OUString& PropertyName )
-//UNUSED2008-05 throw(::com::sun::star::beans::UnknownPropertyException,
-//UNUSED2008-05 ::com::sun::star::lang::WrappedTargetException,
-//UNUSED2008-05 ::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
-//UNUSED2008-05 const ::com::sun::star::uno::Reference<
-//UNUSED2008-05 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
-//UNUSED2008-05 throw(::com::sun::star::beans::UnknownPropertyException,
-//UNUSED2008-05 ::com::sun::star::lang::WrappedTargetException,
-//UNUSED2008-05 ::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
-//UNUSED2008-05 const ::com::sun::star::uno::Reference<
-//UNUSED2008-05 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
-//UNUSED2008-05 throw(::com::sun::star::beans::UnknownPropertyException,
-//UNUSED2008-05 ::com::sun::star::lang::WrappedTargetException,
-//UNUSED2008-05 ::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
-//UNUSED2008-05 const ::com::sun::star::uno::Reference<
-//UNUSED2008-05 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
-//UNUSED2008-05 throw(::com::sun::star::beans::UnknownPropertyException,
-//UNUSED2008-05 ::com::sun::star::lang::WrappedTargetException,
-//UNUSED2008-05 ::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
-//UNUSED2008-05 const ::com::sun::star::uno::Reference<
-//UNUSED2008-05 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
-//UNUSED2008-05 throw(::com::sun::star::beans::UnknownPropertyException,
-//UNUSED2008-05 ::com::sun::star::lang::WrappedTargetException,
-//UNUSED2008-05 ::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05
-//UNUSED2008-05 // XServiceInfo
-//UNUSED2008-05 virtual ::rtl::OUString SAL_CALL getImplementationName( )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
-//UNUSED2008-05 throw(::com::sun::star::uno::RuntimeException);
-//UNUSED2008-05 };
-
-
class SC_DLLPUBLIC ScUnoHelpFunctions
{
public:
@@ -275,7 +167,7 @@ public:
AnyToInterface( const com::sun::star::uno::Any& rAny );
static sal_Bool GetBoolProperty( const com::sun::star::uno::Reference<
com::sun::star::beans::XPropertySet>& xProp,
- const ::rtl::OUString& rName, sal_Bool bDefault = sal_False );
+ const ::rtl::OUString& rName, sal_Bool bDefault = false );
static sal_Int32 GetLongProperty( const com::sun::star::uno::Reference<
com::sun::star::beans::XPropertySet>& xProp,
const ::rtl::OUString& rName, long nDefault = 0 );
@@ -311,3 +203,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/mutexhlp.hxx b/sc/inc/mutexhlp.hxx
index bd45332b9817..ebe9176799c4 100644
--- a/sc/inc/mutexhlp.hxx
+++ b/sc/inc/mutexhlp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,3 +45,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/nameuno.hxx b/sc/inc/nameuno.hxx
index b8cb1ad91754..d3338ba22743 100644
--- a/sc/inc/nameuno.hxx
+++ b/sc/inc/nameuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@
class ScDocShell;
class ScRangeData;
class ScTokenArray;
-
+class ScNamedRangesObj;
class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
::com::sun::star::sheet::XNamedRange,
@@ -63,6 +64,7 @@ class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
public SfxListener
{
private:
+ ScNamedRangesObj* mpParent;
ScDocShell* pDocShell;
String aName;
@@ -74,7 +76,7 @@ private:
const formula::FormulaGrammar::Grammar eGrammar );
public:
- ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm);
+ ScNamedRangeObj(ScNamedRangesObj* pParent, ScDocShell* pDocSh, const String& rNm);
virtual ~ScNamedRangeObj();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -172,10 +174,11 @@ public:
};
-class ScNamedRangesObj : public ::cppu::WeakImplHelper5<
+class ScNamedRangesObj : public ::cppu::WeakImplHelper6<
::com::sun::star::sheet::XNamedRanges,
::com::sun::star::container::XEnumerationAccess,
::com::sun::star::container::XIndexAccess,
+ ::com::sun::star::beans::XPropertySet,
::com::sun::star::document::XActionLockable,
::com::sun::star::lang::XServiceInfo >,
public SfxListener
@@ -183,6 +186,11 @@ class ScNamedRangesObj : public ::cppu::WeakImplHelper5<
private:
ScDocShell* pDocShell;
+ // if true, adding new name or modifying existing one will set the
+ // document 'modified' and broadcast the change. We turn this off during
+ // import.
+ sal_Bool mbModifyAndBroadcast;
+
ScNamedRangeObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
ScNamedRangeObj* GetObjectByName_Impl(const ::rtl::OUString& aName);
@@ -199,6 +207,8 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ bool IsModifyAndBroadcast() const;
+
// XNamedRanges
virtual void SAL_CALL addNewByName( const ::rtl::OUString& aName, const ::rtl::OUString& aContent,
const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType )
@@ -237,6 +247,47 @@ public:
throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::beans::PropertyVetoException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
+ const ::rtl::OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
// XActionLockable
virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addActionLock() throw(::com::sun::star::uno::RuntimeException);
@@ -304,7 +355,7 @@ private:
ScDocShell* pDocShell;
sal_Bool bColumn;
- ScLabelRangeObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
+ ScLabelRangeObj* GetObjectByIndex_Impl(size_t nIndex);
public:
ScLabelRangesObj(ScDocShell* pDocSh, sal_Bool bCol);
@@ -349,3 +400,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/navicfg.hxx b/sc/inc/navicfg.hxx
index 3eb9aa10b18a..3ddea14409f0 100644
--- a/sc/inc/navicfg.hxx
+++ b/sc/inc/navicfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/notesuno.hxx b/sc/inc/notesuno.hxx
index a1648132f8e1..42e79d5bcee7 100644
--- a/sc/inc/notesuno.hxx
+++ b/sc/inc/notesuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -319,3 +320,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/olinetab.hxx b/sc/inc/olinetab.hxx
index 35ef69eea05e..456d33eccf6c 100644
--- a/sc/inc/olinetab.hxx
+++ b/sc/inc/olinetab.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,7 @@ class ScOutlineEntry : public ScDataObject
public:
ScOutlineEntry( SCCOLROW nNewStart, SCCOLROW nNewSize,
- bool bNewHidden = sal_False );
+ bool bNewHidden = false );
ScOutlineEntry( const ScOutlineEntry& rEntry );
virtual ScDataObject* Clone() const;
@@ -101,7 +102,7 @@ public:
sal_uInt16& rFindLevel ) const;
sal_Bool Insert( SCCOLROW nStartPos, SCCOLROW nEndPos, sal_Bool& rSizeChanged,
- sal_Bool bHidden = sal_False, sal_Bool bVisible = sal_True );
+ sal_Bool bHidden = false, sal_Bool bVisible = sal_True );
sal_Bool Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, sal_Bool& rSizeChanged );
ScOutlineEntry* GetEntry( sal_uInt16 nLevel, sal_uInt16 nIndex ) const;
@@ -114,7 +115,7 @@ public:
sal_uInt16& rnIndex ) const;
void SetVisibleBelow( sal_uInt16 nLevel, sal_uInt16 nEntry, sal_Bool bValue,
- sal_Bool bSkipHidden = sal_False );
+ sal_Bool bSkipHidden = false );
void GetRange( SCCOLROW& rStart, SCCOLROW& rEnd ) const;
void ExtendBlock( sal_uInt16 nLevel, SCCOLROW& rBlkStart, SCCOLROW& rBlkEnd );
@@ -177,3 +178,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/optuno.hxx b/sc/inc/optuno.hxx
index 094ff1cfea32..53dae3500fe8 100644
--- a/sc/inc/optuno.hxx
+++ b/sc/inc/optuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,3 +92,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/optutil.hxx b/sc/inc/optutil.hxx
index 1cb39f8c48c8..68a187a97bc6 100644
--- a/sc/inc/optutil.hxx
+++ b/sc/inc/optutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,9 @@
class ScOptionsUtil
{
public:
+ // values must correspond with integer values stored in the configuration
+ enum KeyBindingType { KEY_DEFAULT = 0, KEY_OOO_LEGACY = 1 };
+
static sal_Bool IsMetricSystem();
};
@@ -65,13 +69,9 @@ public:
using ConfigItem::EnableNotification;
using ConfigItem::GetNodeNames;
-// sal_Bool EnableNotification(com::sun::star::uno::Sequence< rtl::OUString >& rNames)
-// { return ConfigItem::EnableNotification( rNames ); }
-
-// com::sun::star::uno::Sequence< rtl::OUString > GetNodeNames(rtl::OUString& rNode)
-// { return ConfigItem::GetNodeNames( rNode ); }
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/pagepar.hxx b/sc/inc/pagepar.hxx
index e449ad24c3c6..f1ac7b2a01f5 100644
--- a/sc/inc/pagepar.hxx
+++ b/sc/inc/pagepar.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,4 @@ struct ScPageAreaParam
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/pageuno.hxx b/sc/inc/pageuno.hxx
index 4b897748db1e..778986101d27 100644
--- a/sc/inc/pageuno.hxx
+++ b/sc/inc/pageuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/paramisc.hxx b/sc/inc/paramisc.hxx
index 63aa5eda8d31..d5532dbe95f4 100644
--- a/sc/inc/paramisc.hxx
+++ b/sc/inc/paramisc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,4 @@ struct ScTabOpParam
#endif // SC_PARAMISC_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 43844119804e..dc58a8a6473a 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,7 +82,7 @@ public:
static const SfxPoolItem& GetItem( sal_uInt16 nWhich, const SfxItemSet& rItemSet, const SfxItemSet* pCondSet );
const SfxPoolItem& GetItem( sal_uInt16 nWhich, const SfxItemSet* pCondSet ) const;
- // pWhich sind keine Ranges, sondern einzelne IDs, 0-terminiert
+ // pWhich are no ranges, but single IDs, 0-terminated
sal_Bool HasItemsSet( const sal_uInt16* pWhich ) const;
void ClearItems( const sal_uInt16* pWhich );
@@ -133,19 +134,6 @@ public:
with text encoding RTL_TEXTENC_SYMBOL */
sal_Bool IsSymbolFont() const;
-//UNUSED2008-05 /** Create a FontToSubsFontConverter if needed for
-//UNUSED2008-05 this pattern, else return 0.
-//UNUSED2008-05
-//UNUSED2008-05 @param nFlags is the bit mask which shall be
-//UNUSED2008-05 used for CreateFontToSubsFontConverter().
-//UNUSED2008-05
-//UNUSED2008-05 The converter must be destroyed by the caller
-//UNUSED2008-05 using DestroyFontToSubsFontConverter() which
-//UNUSED2008-05 should be accomplished using the
-//UNUSED2008-05 ScFontToSubsFontConverter_AutoPtr
-//UNUSED2008-05 */
-//UNUSED2008-05 FontToSubsFontConverter GetSubsFontConverter( sal_uLong nFlags ) const;
-
sal_uLong GetNumberFormat( SvNumberFormatter* ) const;
sal_uLong GetNumberFormat( SvNumberFormatter* pFormatter,
const SfxItemSet* pCondSet ) const;
@@ -191,3 +179,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/pch/precompiled_sc.cxx b/sc/inc/pch/precompiled_sc.cxx
index 6d7b708ffd69..705088caeddb 100755..100644
--- a/sc/inc/pch/precompiled_sc.cxx
+++ b/sc/inc/pch/precompiled_sc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,3 +27,5 @@
************************************************************************/
#include "precompiled_sc.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx
index e90a8c46b6a3..a3f9a790357d 100755
--- a/sc/inc/pch/precompiled_sc.hxx
+++ b/sc/inc/pch/precompiled_sc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -194,7 +195,6 @@
#include <tools/errinf.hxx>
#include <tools/gen.hxx>
#include <tools/globname.hxx>
-#include <tools/list.hxx>
#include <tools/rc.hxx>
#include <tools/rtti.hxx>
#include <tools/solar.h>
@@ -235,11 +235,9 @@
#include <vcl/svapp.hxx>
#include <vcl/vclevent.hxx>
#include <vcl/window.hxx>
-#include <tools/wintypes.hxx>
-#include <vos/macros.hxx>
-#include <vos/object.hxx>
-#include <vos/types.hxx>
+#include <vcl/wintypes.hxx>
#include <wchar.h>
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx
index b2fca0460b8a..4b9f51e078ab 100644
--- a/sc/inc/pivot.hxx
+++ b/sc/inc/pivot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,8 +26,8 @@
*
************************************************************************/
/*
- WICHTIG:
- Folgende Reihenfolge beim Aufbau der Pivot-Tabelle unbedingt einzuhalten:
+ IMPORTANT:
+ Strictly adhere to the following sequence when creating a pivot table:
pPivot->SetColFields(aColArr, aColCount)
pPivot->SetRowFields(aRowArr, aRowCount)
@@ -37,9 +38,7 @@
pPivotReleaseData();
}
- ausserdem ist sicherzustellen, dass entweder das ColArr oder das RowArr
- einen PivotDataField Eintrag enthalten
-
+ Make sure that either ColArr or RowArr contains a PivotDataField entry.
*/
@@ -69,6 +68,66 @@ class ScDocument;
class ScUserListData;
class ScProgress;
+typedef ::boost::shared_ptr<ScDPLabelData> ScDPLabelDataRef;
+
+// -----------------------------------------------------------------------
+
+struct PivotField
+{
+ SCsCOL nCol;
+ sal_uInt16 nFuncMask;
+ sal_uInt16 nFuncCount;
+ ::com::sun::star::sheet::DataPilotFieldReference maFieldRef;
+
+ explicit PivotField( SCsCOL nNewCol = 0, sal_uInt16 nNewFuncMask = PIVOT_FUNC_NONE );
+ PivotField( const PivotField& r );
+
+ bool operator==( const PivotField& r ) const;
+};
+
+// -----------------------------------------------------------------------
+
+// implementation still in global2.cxx
+struct ScPivotParam
+{
+ SCCOL nCol; // cursor position /
+ SCROW nRow; // or start of destination area
+ SCTAB nTab;
+ ::std::vector<ScDPLabelDataRef> maLabelArray;
+ ::std::vector<PivotField> maPageFields;
+ ::std::vector<PivotField> maColFields;
+ ::std::vector<PivotField> maRowFields;
+ ::std::vector<PivotField> maDataFields;
+ sal_Bool bIgnoreEmptyRows;
+ sal_Bool bDetectCategories;
+ sal_Bool bMakeTotalCol;
+ sal_Bool bMakeTotalRow;
+
+ ScPivotParam();
+ ScPivotParam( const ScPivotParam& r );
+ ~ScPivotParam();
+
+ ScPivotParam& operator= ( const ScPivotParam& r );
+ sal_Bool operator== ( const ScPivotParam& r ) const;
+ void ClearPivotArrays();
+ void SetLabelData (const ::std::vector<ScDPLabelDataRef>& r);
+};
+
+// -----------------------------------------------------------------------
+
+typedef PivotField PivotFieldArr[PIVOT_MAXFIELD];
+typedef PivotField PivotPageFieldArr[PIVOT_MAXPAGEFIELD];
+
+//------------------------------------------------------------------------
+
+struct ScDPName
+{
+ ::rtl::OUString maName; /// Original name of the dimension.
+ ::rtl::OUString maLayoutName; /// Layout name (display name)
+
+ explicit ScDPName(const ::rtl::OUString& rName, const ::rtl::OUString& rLayoutName);
+};
+
// ============================================================================
struct ScDPLabelData
@@ -170,8 +229,11 @@ typedef ::std::vector< ScPivotFuncData > ScPivotFuncDataVector;
// ============================================================================
-typedef std::vector< String > ScDPNameVec;
+typedef std::vector< ScDPLabelData > ScDPLabelDataVec;
+typedef std::vector<ScDPName> ScDPNameVec;
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 9141e477c4b7..5d63b373db21 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -261,3 +262,5 @@ public:
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/printopt.hxx b/sc/inc/printopt.hxx
index 1f8ad784f5a4..5883e7ccb18c 100644
--- a/sc/inc/printopt.hxx
+++ b/sc/inc/printopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,6 @@ class SC_DLLPUBLIC ScTpPrintItem : public SfxPoolItem
{
public:
TYPEINFO();
-//UNUSED2008-05 ScTpPrintItem( sal_uInt16 nWhich );
ScTpPrintItem( sal_uInt16 nWhich,
const ScPrintOptions& rOpt );
ScTpPrintItem( const ScTpPrintItem& rItem );
@@ -97,3 +97,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/prnsave.hxx b/sc/inc/prnsave.hxx
index acca6b6a8c4c..f61533356540 100644
--- a/sc/inc/prnsave.hxx
+++ b/sc/inc/prnsave.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/progress.hxx b/sc/inc/progress.hxx
index 3db5c9cd726d..8e6b4c76cc8d 100644
--- a/sc/inc/progress.hxx
+++ b/sc/inc/progress.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,15 +84,15 @@ public:
ScProgress( SfxObjectShell* pObjSh,
const String& rText,
- sal_uLong nRange, sal_Bool bAllDocs = sal_False,
+ sal_uLong nRange, sal_Bool bAllDocs = false,
sal_Bool bWait = sal_True );
~ScProgress();
#ifdef SC_PROGRESS_CXX
- // nur fuer DummyInterpret, sonst nie benutzen!!!
+ // for DummyInterpret only, never use otherwise!!!
ScProgress();
#endif
- // kann NULL sein!
+ // might be NULL!
SfxProgress* GetSfxProgress() const { return pProgress; }
sal_Bool SetStateText( sal_uLong nVal, const String &rVal, sal_uLong nNewRange = 0 )
@@ -102,7 +103,7 @@ public:
nGlobalRange = nNewRange;
CalcGlobalPercent( nVal );
if ( !pProgress->SetStateText( nVal, rVal, nNewRange ) )
- bGlobalNoUserBreak = sal_False;
+ bGlobalNoUserBreak = false;
return bGlobalNoUserBreak;
}
return sal_True;
@@ -115,7 +116,7 @@ public:
nGlobalRange = nNewRange;
CalcGlobalPercent( nVal );
if ( !pProgress->SetState( nVal, nNewRange ) )
- bGlobalNoUserBreak = sal_False;
+ bGlobalNoUserBreak = false;
return bGlobalNoUserBreak;
}
return sal_True;
@@ -126,20 +127,20 @@ public:
{
CalcGlobalPercent( nGlobalRange - nVal );
if ( !pProgress->SetState( nGlobalRange - nVal ) )
- bGlobalNoUserBreak = sal_False;
+ bGlobalNoUserBreak = false;
return bGlobalNoUserBreak;
}
return sal_True;
}
sal_Bool SetStateOnPercent( sal_uLong nVal )
- { // nur wenn Prozent mehr als vorher
+ { // only if percentage increased
if ( nGlobalRange && (nVal * 100 /
nGlobalRange) > nGlobalPercent )
return SetState( nVal );
return sal_True;
}
sal_Bool SetStateCountDownOnPercent( sal_uLong nVal )
- { // nur wenn Prozent mehr als vorher
+ { // only if percentage increased
if ( nGlobalRange &&
((nGlobalRange - nVal) * 100 /
nGlobalRange) > nGlobalPercent )
@@ -157,3 +158,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index 9ffe038b7255..aa9d4b1bf525 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: interpre.hxx,v $
- * $Revision: 1.35.44.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -50,6 +48,8 @@ struct ScQueryParamBase
virtual ~ScQueryParamBase();
+ virtual bool IsValidFieldIndex() const;
+
SC_DLLPUBLIC SCSIZE GetEntryCount() const;
SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n) const;
void Resize(SCSIZE nNew);
@@ -86,6 +86,8 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT
SCTAB nDestTab;
SCCOL nDestCol;
SCROW nDestRow;
+ SCROW nDynamicEndRow;
+ bool bUseDynamicRange;
ScQueryParam();
ScQueryParam( const ScQueryParam& r );
@@ -127,6 +129,8 @@ struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTa
{
ScDBQueryParamInternal();
virtual ~ScDBQueryParamInternal();
+
+ virtual bool IsValidFieldIndex() const;
};
// ============================================================================
@@ -137,6 +141,10 @@ struct ScDBQueryParamMatrix : public ScDBQueryParamBase
ScDBQueryParamMatrix();
virtual ~ScDBQueryParamMatrix();
+
+ virtual bool IsValidFieldIndex() const;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 70c8658de5da..95c9f0e701cb 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,74 +32,100 @@
#include "global.hxx"
#include "address.hxx"
#include <tools/solar.h>
+#include <vector>
class ScDocument;
-typedef ScRange* ScRangePtr;
-DECLARE_LIST( ScRangeListBase, ScRangePtr )
-class SC_DLLPUBLIC ScRangeList : public ScRangeListBase, public SvRefBase
+class SC_DLLPUBLIC ScRangeList : public SvRefBase
{
-private:
- using ScRangeListBase::operator==;
- using ScRangeListBase::operator!=;
-
public:
ScRangeList() {}
ScRangeList( const ScRangeList& rList );
- virtual ~ScRangeList();
+ virtual ~ScRangeList();
ScRangeList& operator=(const ScRangeList& rList);
- void RemoveAll();
void Append( const ScRange& rRange )
{
- ScRangePtr pR = new ScRange( rRange );
- Insert( pR, LIST_APPEND );
+ ScRange* pR = new ScRange( rRange );
+ maRanges.push_back( pR );
}
+
sal_uInt16 Parse( const String&, ScDocument* = NULL,
sal_uInt16 nMask = SCA_VALID,
formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO,
sal_Unicode cDelimiter = 0 );
+
void Format( String&, sal_uInt16 nFlags = 0, ScDocument* = NULL,
formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO,
sal_Unicode cDelimiter = 0 ) const;
- void Join( const ScRange&, sal_Bool bIsInList = sal_False );
- sal_Bool UpdateReference( UpdateRefMode, ScDocument*,
- const ScRange& rWhere,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
- ScRange* Find( const ScAddress& ) const;
- sal_Bool operator==( const ScRangeList& ) const;
- sal_Bool operator!=( const ScRangeList& r ) const;
- sal_Bool Intersects( const ScRange& ) const;
- sal_Bool In( const ScRange& ) const;
- sal_uLong GetCellCount() const;
+
+ void Join( const ScRange&, bool bIsInList = false );
+
+ bool UpdateReference( UpdateRefMode, ScDocument*,
+ const ScRange& rWhere,
+ SCsCOL nDx,
+ SCsROW nDy,
+ SCsTAB nDz
+ );
+
+ const ScRange* Find( const ScAddress& ) const;
+ ScRange* Find( const ScAddress& );
+ bool operator==( const ScRangeList& ) const;
+ bool operator!=( const ScRangeList& r ) const;
+ bool Intersects( const ScRange& ) const;
+ bool In( const ScRange& ) const;
+ size_t GetCellCount() const;
+
+ ScRange* Remove(size_t nPos);
+ void RemoveAll();
+
+ bool empty() const;
+ size_t size() const;
+ ScRange* operator[](size_t idx);
+ const ScRange* operator[](size_t idx) const;
+ ScRange* front();
+ const ScRange* front() const;
+ ScRange* back();
+ const ScRange* back() const;
+ void push_back(ScRange* p);
+
+private:
+ ::std::vector<ScRange*> maRanges;
};
SV_DECL_IMPL_REF( ScRangeList );
-// RangePairList: erster Range (aRange[0]) eigentlicher Range, zweiter
-// Range (aRange[1]) Daten zu diesem Range, z.B. Rows eines ColName
-DECLARE_LIST( ScRangePairListBase, ScRangePair* )
-class ScRangePairList : public ScRangePairListBase, public SvRefBase
+// RangePairList:
+// aRange[0]: actual range,
+// aRange[1]: data for that range, e.g. Rows belonging to a ColName
+class SC_DLLPUBLIC ScRangePairList : public SvRefBase
{
-private:
- using ScRangePairListBase::operator==;
-
public:
- virtual ~ScRangePairList();
+ virtual ~ScRangePairList();
ScRangePairList* Clone() const;
- void Append( const ScRangePair& rRangePair )
- {
- ScRangePair* pR = new ScRangePair( rRangePair );
- Insert( pR, LIST_APPEND );
- }
- void Join( const ScRangePair&, sal_Bool bIsInList = sal_False );
- sal_Bool UpdateReference( UpdateRefMode, ScDocument*,
+ void Append( const ScRangePair& rRangePair )
+ {
+ ScRangePair* pR = new ScRangePair( rRangePair );
+ maPairs.push_back( pR );
+ }
+ void Join( const ScRangePair&, bool bIsInList = false );
+ bool UpdateReference( UpdateRefMode, ScDocument*,
const ScRange& rWhere,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
- void DeleteOnTab( SCTAB nTab );
- ScRangePair* Find( const ScAddress& ) const;
- ScRangePair* Find( const ScRange& ) const;
- ScRangePair** CreateNameSortedArray( sal_uLong& nCount, ScDocument* ) const;
- sal_Bool operator==( const ScRangePairList& ) const;
+ void DeleteOnTab( SCTAB nTab );
+ ScRangePair* Find( const ScAddress& ) const;
+ ScRangePair* Find( const ScRange& ) const;
+ ScRangePair** CreateNameSortedArray( size_t& nCount, ScDocument* ) const;
+ bool operator==( const ScRangePairList& ) const;
+
+ ScRangePair* Remove(size_t nPos);
+ ScRangePair* Remove(ScRangePair* pAdr);
+
+ size_t size() const;
+ ScRangePair* operator[](size_t idx);
+ const ScRangePair* operator[](size_t idx) const;
+
+private:
+ ::std::vector< ScRangePair* > maPairs;
};
SV_DECL_IMPL_REF( ScRangePairList );
@@ -115,3 +142,5 @@ ScRangePairList_QsortNameCompare( const void*, const void* );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx
index 453530c0e1f6..06901b3dc721 100644
--- a/sc/inc/rangenam.hxx
+++ b/sc/inc/rangenam.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include "scdllapi.h"
#include <map>
+#include <boost/ptr_container/ptr_set.hpp>
//------------------------------------------------------------------------
@@ -65,7 +67,7 @@ typedef sal_uInt16 RangeType;
class ScTokenArray;
-class ScRangeData : public ScDataObject
+class ScRangeData
{
private:
String aName;
@@ -75,14 +77,13 @@ private:
RangeType eType;
ScDocument* pDoc;
sal_uInt16 nIndex;
- sal_Bool bModified; // wird bei UpdateReference gesetzt/geloescht
+ sal_Bool bModified; // is set/cleared by UpdateReference
// max row and column to use for wrapping of references. If -1 use the
// application's default.
SCROW mnMaxRow;
SCCOL mnMaxCol;
- friend class ScRangeName;
ScRangeData( sal_uInt16 nIndex );
public:
typedef ::std::map<sal_uInt16, sal_uInt16> IndexMap;
@@ -101,13 +102,10 @@ public:
SC_DLLPUBLIC ScRangeData( ScDocument* pDoc,
const String& rName,
const ScAddress& rTarget );
- // rTarget ist ABSPOS Sprungmarke
+ // rTarget is ABSPOS jump label
ScRangeData(const ScRangeData& rScRangeData);
- SC_DLLPUBLIC virtual ~ScRangeData();
-
-
- virtual ScDataObject* Clone() const;
+ SC_DLLPUBLIC ~ScRangeData();
sal_Bool operator== (const ScRangeData& rData) const;
@@ -115,10 +113,11 @@ public:
const String& GetName( void ) const { return aName; }
const String& GetUpperName( void ) const { return aUpperName; }
ScAddress GetPos() const { return aPos; }
- // Der Index muss eindeutig sein. Ist er 0, wird ein neuer Index vergeben
+ // The index has to be unique. If index=0 a new index value is assigned.
void SetIndex( sal_uInt16 nInd ) { nIndex = nInd; }
sal_uInt16 GetIndex() const { return nIndex; }
ScTokenArray* GetCode() { return pCode; }
+ const ScTokenArray* GetCode() const { return pCode; }
sal_uInt16 GetErrCode();
sal_Bool HasReferences() const;
void SetDocument( ScDocument* pDocument){ pDoc = pDocument; }
@@ -127,7 +126,8 @@ public:
void AddType( RangeType nType ) { eType = eType|nType; }
RangeType GetType() const { return eType; }
sal_Bool HasType( RangeType nType ) const;
- SC_DLLPUBLIC void GetSymbol( String& rSymbol, const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
+ SC_DLLPUBLIC void GetSymbol( String& rSymbol, const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
+ SC_DLLPUBLIC void GetSymbol( rtl::OUString& rSymbol, const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
void UpdateSymbol( rtl::OUStringBuffer& rBuffer, const ScAddress&,
const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT );
void UpdateReference( UpdateRefMode eUpdateRefMode,
@@ -142,9 +142,7 @@ public:
SC_DLLPUBLIC sal_Bool IsReference( ScRange& rRef ) const;
sal_Bool IsReference( ScRange& rRef, const ScAddress& rPos ) const;
- sal_Bool IsValidReference( ScRange& rRef ) const;
-
-//UNUSED2009-05 sal_Bool IsRangeAtCursor( const ScAddress&, sal_Bool bStartOnly ) const;
+ SC_DLLPUBLIC sal_Bool IsValidReference( ScRange& rRef ) const;
sal_Bool IsRangeAtBlock( const ScRange& ) const;
void UpdateTabRef(SCTAB nOldTable, sal_uInt16 nFlag, SCTAB nNewTable);
@@ -175,50 +173,50 @@ extern "C" int SAL_CALL ScRangeData_QsortNameCompare( const void*, const void* )
{ return ScRangeData_QsortNameCompare(a,b); }
#endif
-//------------------------------------------------------------------------
+bool operator< (const ScRangeData& left, const ScRangeData& right);
-class ScRangeName : public ScSortedCollection
+class ScRangeName
{
private:
- ScDocument* pDoc;
- sal_uInt16 nSharedMaxIndex;
-
- using ScSortedCollection::Clone; // calcwarnings: shouldn't be used
+ typedef ::boost::ptr_set<ScRangeData> DataType;
+ DataType maData;
+ ScDocument* mpDoc;
+ sal_uInt16 mnSharedMaxIndex;
public:
- ScRangeName(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False,
- ScDocument* pDocument = NULL) :
- ScSortedCollection ( nLim, nDel, bDup ),
- pDoc ( pDocument ),
- nSharedMaxIndex ( 1 ) {} // darf nicht 0 sein!!
-
- ScRangeName(const ScRangeName& rScRangeName, ScDocument* pDocument);
-
- virtual ScDataObject* Clone(ScDocument* pDocP) const
- { return new ScRangeName(*this, pDocP); }
- ScRangeData* operator[]( const sal_uInt16 nIndex) const
- { return (ScRangeData*)At(nIndex); }
- virtual short Compare(ScDataObject* pKey1, ScDataObject* pKey2) const;
- virtual sal_Bool IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const;
-
-//UNUSED2009-05 ScRangeData* GetRangeAtCursor( const ScAddress&, sal_Bool bStartOnly ) const;
- SC_DLLPUBLIC ScRangeData* GetRangeAtBlock( const ScRange& ) const;
-
- SC_DLLPUBLIC sal_Bool SearchName( const String& rName, sal_uInt16& rPos ) const;
- // SearchNameUpper must be called with an upper-case search string
- sal_Bool SearchNameUpper( const String& rUpperName, sal_uInt16& rPos ) const;
- void UpdateReference(UpdateRefMode eUpdateRefMode,
- const ScRange& rRange,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
- void UpdateTabRef(SCTAB nTable, sal_uInt16 nFlag, SCTAB nNewTable = 0);
- void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest );
- void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
- virtual sal_Bool Insert(ScDataObject* pScDataObject);
- SC_DLLPUBLIC ScRangeData* FindIndex(sal_uInt16 nIndex);
- sal_uInt16 GetSharedMaxIndex() { return nSharedMaxIndex; }
- void SetSharedMaxIndex(sal_uInt16 nInd) { nSharedMaxIndex = nInd; }
- sal_uInt16 GetEntryIndex();
+ typedef DataType::const_iterator const_iterator;
+ typedef DataType::iterator iterator;
+
+ ScRangeName(ScDocument* pDoc = NULL);
+ ScRangeName(const ScRangeName& r);
+
+ SC_DLLPUBLIC const ScRangeData* findByRange(const ScRange& rRange) const;
+ SC_DLLPUBLIC ScRangeData* findByName(const rtl::OUString& rName);
+ SC_DLLPUBLIC const ScRangeData* findByName(const rtl::OUString& rName) const;
+ ScRangeData* findByUpperName(const rtl::OUString& rName);
+ const ScRangeData* findByUpperName(const rtl::OUString& rName) const;
+ SC_DLLPUBLIC ScRangeData* findByIndex(sal_uInt16 i);
+ void UpdateReference(UpdateRefMode eUpdateRefMode, const ScRange& rRange,
+ SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
+ void UpdateTabRef(SCTAB nTable, sal_uInt16 nFlag, SCTAB nNewTable = 0);
+ void UpdateTranspose(const ScRange& rSource, const ScAddress& rDest);
+ void UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY);
+ sal_uInt16 GetSharedMaxIndex();
+ void SetSharedMaxIndex(sal_uInt16 nInd);
+
+ SC_DLLPUBLIC const_iterator begin() const;
+ SC_DLLPUBLIC const_iterator end() const;
+ SC_DLLPUBLIC iterator begin();
+ SC_DLLPUBLIC iterator end();
+ SC_DLLPUBLIC size_t size() const;
+ bool empty() const;
+ SC_DLLPUBLIC bool insert(ScRangeData* p);
+ void erase(const ScRangeData& r);
+ void erase(const iterator& itr);
+ void clear();
+ bool operator== (const ScRangeName& r) const;
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/rangeseq.hxx b/sc/inc/rangeseq.hxx
index 735985df1779..abb7c56e0403 100644
--- a/sc/inc/rangeseq.hxx
+++ b/sc/inc/rangeseq.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,7 +54,7 @@ public:
const ScMatrix* pMatrix, SvNumberFormatter* pFormatter );
static sal_Bool FillMixedArray( com::sun::star::uno::Any& rAny,
ScDocument* pDoc, const ScRange& rRange,
- sal_Bool bAllowNV = sal_False );
+ sal_Bool bAllowNV = false );
/** @param bDataTypes
Additionally to the differentiation between string and double allow
@@ -112,3 +113,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx
index d461315c2c34..c269fc8dd8df 100644
--- a/sc/inc/rangeutl.hxx
+++ b/sc/inc/rangeutl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,12 @@
#ifndef SC_RANGEUTL_HXX
#define SC_RANGEUTL_HXX
-#include "address.hxx"
#include <tools/string.hxx>
+
+#include "address.hxx"
+#include "rangenam.hxx"
#include "scdllapi.h"
+
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/uno/Sequence.hxx>
@@ -69,7 +73,7 @@ public:
ScDocument* pDoc,
ScArea*** pppAreas = 0,
sal_uInt16* pAreaCount = 0,
- sal_Bool bAcceptCellRef = sal_False,
+ sal_Bool bAcceptCellRef = false,
ScAddress::Details const & rDetails = ScAddress::detailsOOOa1 ) const;
sal_Bool IsAbsArea ( const String& rAreaStr,
@@ -85,7 +89,7 @@ public:
SCTAB,
String* = 0,
ScRefAddress* = 0 ) const
- { return sal_False; }
+ { return false; }
sal_Bool IsAbsPos ( const String& rPosStr,
ScDocument* pDoc,
@@ -209,7 +213,7 @@ public:
const ScDocument* pDocument,
formula::FormulaGrammar::AddressConvention eConv,
sal_Unicode cSeperator = ' ',
- sal_Bool bAppendStr = sal_False,
+ sal_Bool bAppendStr = false,
sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
static void GetStringFromRange(
::rtl::OUString& rString,
@@ -217,7 +221,7 @@ public:
const ScDocument* pDocument,
formula::FormulaGrammar::AddressConvention eConv,
sal_Unicode cSeperator = ' ',
- sal_Bool bAppendStr = sal_False,
+ sal_Bool bAppendStr = false,
sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
static void GetStringFromRangeList(
::rtl::OUString& rString,
@@ -233,7 +237,7 @@ public:
const ScDocument* pDocument,
formula::FormulaGrammar::AddressConvention eConv,
sal_Unicode cSeperator = ' ',
- sal_Bool bAppendStr = sal_False,
+ sal_Bool bAppendStr = false,
sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
// Range to String API
@@ -243,7 +247,7 @@ public:
const ScDocument* pDocument,
formula::FormulaGrammar::AddressConvention eConv,
sal_Unicode cSeperator = ' ',
- sal_Bool bAppendStr = sal_False,
+ sal_Bool bAppendStr = false,
sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
static void GetStringFromRange(
::rtl::OUString& rString,
@@ -251,7 +255,7 @@ public:
const ScDocument* pDocument,
formula::FormulaGrammar::AddressConvention eConv,
sal_Unicode cSeperator = ' ',
- sal_Bool bAppendStr = sal_False,
+ sal_Bool bAppendStr = false,
sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
static void GetStringFromRangeList(
::rtl::OUString& rString,
@@ -296,17 +300,19 @@ public:
//------------------------------------------------------------------------
//
-// gibt Bereiche mit Referenz und alle DB-Bereiche zurueck
+// returns areas with reference and all db-areas
//
class SC_DLLPUBLIC ScAreaNameIterator
{
private:
+ String aStrNoName;
ScRangeName* pRangeName;
+ ScRangeName::const_iterator maRNPos;
+ ScRangeName::const_iterator maRNEnd;
ScDBCollection* pDBCollection;
- sal_Bool bFirstPass;
- sal_uInt16 nPos;
- String aStrNoName;
+ bool bFirstPass;
+ size_t nPos;
public:
ScAreaNameIterator( ScDocument* pDoc );
@@ -319,3 +325,4 @@ public:
#endif // SC_RANGEUTL_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/rechead.hxx b/sc/inc/rechead.hxx
index 0f56ef5b5ab4..245254f5a6bb 100644
--- a/sc/inc/rechead.hxx
+++ b/sc/inc/rechead.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,14 +31,14 @@
#include <tools/stream.hxx>
-// ID's fuer Dateien:
+// ID's for files:
#define SCID_SIZES 0x4200
#define SCID_POOLS 0x4210
#define SCID_DOCPOOL 0x4211
#define SCID_STYLEPOOL 0x4212
-#define SCID_NEWPOOLS 0x4213 // ID fuer SC 3.0a
+#define SCID_NEWPOOLS 0x4213 // ID for SC 3.0a
#define SCID_EDITPOOL 0x4214
#define SCID_DOCUMENT 0x4220
@@ -53,7 +54,7 @@
#define SCID_VIEWOPTIONS 0x422a
#define SCID_PRINTSETUP 0x422b
#define SCID_CHARSET 0x422c
-#define SCID_NEWDOCUMENT 0x422d // ID fuer SC 3.0a
+#define SCID_NEWDOCUMENT 0x422d // ID for SC 3.0a
#define SCID_DDELINKS 0x422e
#define SCID_AREALINKS 0x422f
#define SCID_CONDFORMATS 0x4230
@@ -81,53 +82,51 @@
-// Dateiversion
-// Falls das obere Byte inkrementiert wird, wird das Doc von
-// aelteren SCs nicht mehr geladen!
-
+// file version
+// if the high-byte is incremented, the document won't be opened by older SCs
#define SC_INITIAL_VERSION 0x0001
-#define SC_FORMULA_LCLVER 0x0002 // Formalen mit lokaler VerNr
+#define SC_FORMULA_LCLVER 0x0002 // formula with local version no.
//--------------------------------
-#define SC_NEW_TOKEN_ARRAYS 0x0003 // neues TokenArray-Format
-#define SC_FORMULA_VALUES 0x0004 // Werte in Formelzellen
-#define SC_FORMULA_VALUES2 0x0005 // Werte in Formelzellen
-#define SC_DATABYTES 0x0006 // Datenbytes, kleine Tables
-#define SC_DATABYTES2 0x0007 // Datenbytes, kleine Tables
-#define SC_NUMFMT 0x0008 // Zahlenformat an Formelzelle
-#define SC_NEWIF 0x0009 // neue Codierung von ocIf (komp.)
+#define SC_NEW_TOKEN_ARRAYS 0x0003 // new TokenArray format
+#define SC_FORMULA_VALUES 0x0004 // values in formula cells
+#define SC_FORMULA_VALUES2 0x0005 // values in formula cells
+#define SC_DATABYTES 0x0006 // data bytes, small tables
+#define SC_DATABYTES2 0x0007 // data bytes, small tables
+#define SC_NUMFMT 0x0008 // number format of formula cell
+#define SC_NEWIF 0x0009 // new coding of ocIf (komp.)
//--------------------------------
-#define SC_RELATIVE_REFS 0x0010 // relative Referenzen
-#define SC_SUBTOTAL_FLAG 0x0011 // bSubTotal der Formelzelle
-#define SC_COLROWNAME_RANGEPAIR 0x0012 // ColRowNameRanges als ScRangePair
+#define SC_RELATIVE_REFS 0x0010 // relative references
+#define SC_SUBTOTAL_FLAG 0x0011 // bSubTotal of formula cell
+#define SC_COLROWNAME_RANGEPAIR 0x0012 // ColRowNameRanges as ScRangePair
//--------------------------------
-#define SC_31_EXPORT_VER 0x0012 // Version bei 3.1-Export
+#define SC_31_EXPORT_VER 0x0012 // version for 3.1-export
//-------------------------------- ab 4.0
-#define SC_32K_ROWS 0x0100 // 32000 Zeilen - inkompatibel
-#define SC_FONTCHARSET 0x0101 // Font-CharSets muessen stimmen
+#define SC_32K_ROWS 0x0100 // 32000 rows - incompatibel
+#define SC_FONTCHARSET 0x0101 // Font-CharSets have to be right
//--------------------------------
-#define SC_40_EXPORT_VER 0x0101 // Version bei 4.0-Export
+#define SC_40_EXPORT_VER 0x0101 // version for 4.0-Export
//-------------------------------- ab 5.0
#define SC_RECALC_MODE_BITS 0x0201 // TokenArray RecalcMode
-#define SC_MATRIX_DOUBLEREF 0x0202 // DoubleRef implizite Schnittmenge
-#define SC_VERSION_EDITPOOL 0x0203 // EditCells mit EditPool
-#define SC_SUBTOTAL_BUGFIX 0x0204 // bSubTotal der Formelzelle wirklich
+#define SC_MATRIX_DOUBLEREF 0x0202 // DoubleRef implicit intersection
+#define SC_VERSION_EDITPOOL 0x0203 // EditCells with EditPool
+#define SC_SUBTOTAL_BUGFIX 0x0204 // bSubTotal of formula cell (true)
//-------------------------------- ab 5.2
-#define SC_CONVERT_RECALC_ON_LOAD 0x0205 // #73616# CONVERT function recalculated on each load
+#define SC_CONVERT_RECALC_ON_LOAD 0x0205 // CONVERT function recalculated on each load
//--------------------------------
#define SC_CURRENT_VERSION 0x0205
-// alles ueber SC_31_EXPORT_VER muss auch beim Speichern abgefragt werden,
-// weil 3.1-Export diese Versionsnummer schreibt.
+// all above SC_31_EXPORT_VER has to be queried during saving,
+// because 3.1-export writes this version number.
-// btw: 10 nach 09 ist kein Zaehlfehler sondern eine absichtliche Luecke,
-// weil nicht klar war, wie lange die RelRefs Entwicklung dauern wuerde.. :)
+// btw: 10 following 09 is not a counting error but an intentional gap,
+// because it was not clear, how long the RelRefs development would take. :)
class SvStream;
// -----------------------------------------------------------------------
- // Header mit Groessenangaben fuer mehrere Objekte
+ // Header with size specification for multiple objects
class ScMultipleReadHeader
{
@@ -168,3 +167,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/recursionhelper.hxx b/sc/inc/recursionhelper.hxx
index c15b31fd197b..dc44921d8840 100644
--- a/sc/inc/recursionhelper.hxx
+++ b/sc/inc/recursionhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -157,3 +158,5 @@ class ScRecursionHelper
};
#endif // INCLUDED_RECURSIONHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/refdata.hxx b/sc/inc/refdata.hxx
index a386263efaf8..edaee012d7e3 100644
--- a/sc/inc/refdata.hxx
+++ b/sc/inc/refdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,24 +86,24 @@ struct SC_DLLPUBLIC ScSingleRefData // Single reference (one address) int
inline void InitAddress( SCCOL nCol, SCROW nRow, SCTAB nTab );
// InitAddressRel: InitFlags and set address, everything relative to rPos
inline void InitAddressRel( const ScAddress& rAdr, const ScAddress& rPos );
- inline void SetColRel( sal_Bool bVal ) { Flags.bColRel = (bVal ? sal_True : sal_False ); }
+ inline void SetColRel( sal_Bool bVal ) { Flags.bColRel = (bVal ? sal_True : false ); }
inline sal_Bool IsColRel() const { return Flags.bColRel; }
- inline void SetRowRel( sal_Bool bVal ) { Flags.bRowRel = (bVal ? sal_True : sal_False ); }
+ inline void SetRowRel( sal_Bool bVal ) { Flags.bRowRel = (bVal ? sal_True : false ); }
inline sal_Bool IsRowRel() const { return Flags.bRowRel; }
- inline void SetTabRel( sal_Bool bVal ) { Flags.bTabRel = (bVal ? sal_True : sal_False ); }
+ inline void SetTabRel( sal_Bool bVal ) { Flags.bTabRel = (bVal ? sal_True : false ); }
inline sal_Bool IsTabRel() const { return Flags.bTabRel; }
- inline void SetColDeleted( sal_Bool bVal ) { Flags.bColDeleted = (bVal ? sal_True : sal_False ); }
+ inline void SetColDeleted( sal_Bool bVal ) { Flags.bColDeleted = (bVal ? sal_True : false ); }
inline sal_Bool IsColDeleted() const { return Flags.bColDeleted; }
- inline void SetRowDeleted( sal_Bool bVal ) { Flags.bRowDeleted = (bVal ? sal_True : sal_False ); }
+ inline void SetRowDeleted( sal_Bool bVal ) { Flags.bRowDeleted = (bVal ? sal_True : false ); }
inline sal_Bool IsRowDeleted() const { return Flags.bRowDeleted; }
- inline void SetTabDeleted( sal_Bool bVal ) { Flags.bTabDeleted = (bVal ? sal_True : sal_False ); }
+ inline void SetTabDeleted( sal_Bool bVal ) { Flags.bTabDeleted = (bVal ? sal_True : false ); }
inline sal_Bool IsTabDeleted() const { return Flags.bTabDeleted; }
inline sal_Bool IsDeleted() const { return IsColDeleted() || IsRowDeleted() || IsTabDeleted(); }
- inline void SetFlag3D( sal_Bool bVal ) { Flags.bFlag3D = (bVal ? sal_True : sal_False ); }
+ inline void SetFlag3D( sal_Bool bVal ) { Flags.bFlag3D = (bVal ? sal_True : false ); }
inline sal_Bool IsFlag3D() const { return Flags.bFlag3D; }
- inline void SetRelName( sal_Bool bVal ) { Flags.bRelName = (bVal ? sal_True : sal_False ); }
+ inline void SetRelName( sal_Bool bVal ) { Flags.bRelName = (bVal ? sal_True : false ); }
inline sal_Bool IsRelName() const { return Flags.bRelName; }
inline sal_Bool Valid() const;
@@ -211,3 +212,5 @@ inline bool ScComplexRefData::ValidExternal() const
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/reffind.hxx b/sc/inc/reffind.hxx
index 775571adeab7..cc2f330194e9 100644
--- a/sc/inc/reffind.hxx
+++ b/sc/inc/reffind.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ private:
xub_StrLen nSelEnd;
public:
- static const sal_Unicode __FAR_DATA pDelimiters[];
+ static const sal_Unicode pDelimiters[];
ScRefFinder( const String& rFormula,
ScDocument* pDocument = NULL,
@@ -66,3 +67,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/refreshtimer.hxx b/sc/inc/refreshtimer.hxx
index 4ad28d354568..9ded9478731f 100644
--- a/sc/inc/refreshtimer.hxx
+++ b/sc/inc/refreshtimer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,131 +29,108 @@
#ifndef SC_REFRESHTIMER_HXX
#define SC_REFRESHTIMER_HXX
-#include <tools/list.hxx>
#include <vcl/timer.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <scdllapi.h>
-#define SC_REFRESHTIMER_CONTROL_LIST 0
-#if SC_REFRESHTIMER_CONTROL_LIST
-class ScRefreshTimer;
-DECLARE_LIST( ScRefreshTimerList, ScRefreshTimer* )
-#endif
-
class ScRefreshTimerControl
{
private:
- ::vos::OMutex aMutex;
- sal_uInt16 nBlockRefresh;
+ ::osl::Mutex aMutex;
+ sal_uInt16 nBlockRefresh;
public:
-#if SC_REFRESHTIMER_CONTROL_LIST
- ScRefreshTimerList aList;
-#endif
-
- ScRefreshTimerControl() : nBlockRefresh(0) {}
-
- void SetAllowRefresh( sal_Bool b )
- {
- if ( b && nBlockRefresh )
- --nBlockRefresh;
- else if ( !b && nBlockRefresh < (sal_uInt16)(~0) )
- ++nBlockRefresh;
- }
- sal_Bool IsRefreshAllowed() const { return !nBlockRefresh; }
- ::vos::OMutex& GetMutex() { return aMutex; }
-};
+ ScRefreshTimerControl() : nBlockRefresh(0) {}
+
+ void SetAllowRefresh( sal_Bool b )
+ {
+ if ( b && nBlockRefresh )
+ --nBlockRefresh;
+ else if ( !b && nBlockRefresh < (sal_uInt16)(~0) )
+ ++nBlockRefresh;
+ }
+ sal_Bool IsRefreshAllowed() const { return !nBlockRefresh; }
+
+ ::osl::Mutex& GetMutex() { return aMutex; }
+};
class ScRefreshTimerProtector
{
private:
ScRefreshTimerControl * const * ppControl;
+
public:
- ScRefreshTimerProtector( ScRefreshTimerControl * const * pp );
- ~ScRefreshTimerProtector()
- {
- if ( ppControl && *ppControl )
- (*ppControl)->SetAllowRefresh( sal_True );
- }
-};
+ ScRefreshTimerProtector( ScRefreshTimerControl * const * pp );
+ ~ScRefreshTimerProtector()
+ {
+ if ( ppControl && *ppControl )
+ (*ppControl)->SetAllowRefresh( true );
+ }
+};
class ScRefreshTimer : public AutoTimer
{
private:
ScRefreshTimerControl * const * ppControl;
- void AppendToControl()
- {
-#if SC_REFRESHTIMER_CONTROL_LIST
- if ( ppControl && *ppControl )
- (*ppControl)->aList.Insert( this, LIST_APPEND );
-#endif
- }
- void RemoveFromControl()
- {
-#if SC_REFRESHTIMER_CONTROL_LIST
- if ( ppControl && *ppControl )
- (*ppControl)->aList.Remove( this );
-#endif
- }
-
- void Start()
- {
- if ( GetTimeout() )
- AutoTimer::Start();
- }
+ void AppendToControl() {}
+
+ void RemoveFromControl() {}
+
+ void Start()
+ {
+ if ( GetTimeout() )
+ AutoTimer::Start();
+ }
public:
- ScRefreshTimer() : ppControl(0)
- { SetTimeout( 0 ); }
- ScRefreshTimer( sal_uLong nSeconds ) : ppControl(0)
- {
- SetTimeout( nSeconds * 1000 );
- Start();
- }
- ScRefreshTimer( const ScRefreshTimer& r )
- : AutoTimer( r ), ppControl(0)
- {}
- virtual ~ScRefreshTimer();
-
- ScRefreshTimer& operator=( const ScRefreshTimer& r )
- {
- SetRefreshControl(0);
- AutoTimer::operator=( r );
- return *this;
- }
-
- sal_Bool operator==( const ScRefreshTimer& r ) const
- { return GetTimeout() == r.GetTimeout(); }
-
- sal_Bool operator!=( const ScRefreshTimer& r ) const
- { return !ScRefreshTimer::operator==( r ); }
-
- void StartRefreshTimer()
- { Start(); }
-
- void SetRefreshControl( ScRefreshTimerControl * const * pp )
- {
- RemoveFromControl();
- ppControl = pp;
- AppendToControl();
- }
-
- void SetRefreshHandler( const Link& rLink )
- { SetTimeoutHdl( rLink ); }
-
- sal_uLong GetRefreshDelay() const
- { return GetTimeout() / 1000; }
-
- void StopRefreshTimer()
- { Stop(); }
-
- SC_DLLPUBLIC virtual void SetRefreshDelay( sal_uLong nSeconds );
- SC_DLLPUBLIC virtual void Timeout();
-};
+ ScRefreshTimer() : ppControl(0) { SetTimeout( 0 ); }
+
+ ScRefreshTimer( sal_uLong nSeconds ) : ppControl(0)
+ {
+ SetTimeout( nSeconds * 1000 );
+ Start();
+ }
+ ScRefreshTimer( const ScRefreshTimer& r ) : AutoTimer( r ), ppControl(0) {}
+
+ virtual ~ScRefreshTimer();
+
+ ScRefreshTimer& operator=( const ScRefreshTimer& r )
+ {
+ SetRefreshControl(0);
+ AutoTimer::operator=( r );
+ return *this;
+ }
+
+ sal_Bool operator==( const ScRefreshTimer& r ) const
+ { return GetTimeout() == r.GetTimeout(); }
+
+ sal_Bool operator!=( const ScRefreshTimer& r ) const
+ { return !ScRefreshTimer::operator==( r ); }
+
+ void StartRefreshTimer() { Start(); }
+
+ void SetRefreshControl( ScRefreshTimerControl * const * pp )
+ {
+ RemoveFromControl();
+ ppControl = pp;
+ AppendToControl();
+ }
+
+ void SetRefreshHandler( const Link& rLink ) { SetTimeoutHdl( rLink ); }
+
+ sal_uLong GetRefreshDelay() const { return GetTimeout() / 1000; }
+
+ void StopRefreshTimer() { Stop(); }
+
+ SC_DLLPUBLIC virtual void SetRefreshDelay( sal_uLong nSeconds );
+
+ SC_DLLPUBLIC virtual void Timeout();
+};
#endif // SC_REFRESHTIMER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/reftokenhelper.hxx b/sc/inc/reftokenhelper.hxx
index 86fd36f691fa..36d28f156780 100644
--- a/sc/inc/reftokenhelper.hxx
+++ b/sc/inc/reftokenhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,28 +54,33 @@ public:
* The source range may consist of multiple ranges separated by ';'s.
*/
static void compileRangeRepresentation(
- ::std::vector<ScSharedTokenRef>& rRefTokens, const ::rtl::OUString& rRangeStr, ScDocument* pDoc,
+ ::std::vector<ScTokenRef>& rRefTokens, const ::rtl::OUString& rRangeStr, ScDocument* pDoc,
::formula::FormulaGrammar::Grammar eGrammar = ::formula::FormulaGrammar::GRAM_ENGLISH);
- static bool getRangeFromToken(ScRange& rRange, const ScSharedTokenRef& pToken, bool bExternal = false);
+ static bool getRangeFromToken(ScRange& rRange, const ScTokenRef& pToken, bool bExternal = false);
- static void getRangeListFromTokens(ScRangeList& rRangeList, const ::std::vector<ScSharedTokenRef>& pTokens);
+ static void getRangeListFromTokens(ScRangeList& rRangeList, const ::std::vector<ScTokenRef>& pTokens);
/**
* Create a double reference token from a range object.
*/
- static void getTokenFromRange(ScSharedTokenRef& pToken, const ScRange& rRange);
+ static void getTokenFromRange(ScTokenRef& pToken, const ScRange& rRange);
- static void getTokensFromRangeList(::std::vector<ScSharedTokenRef>& pTokens, const ScRangeList& rRanges);
+ static void getTokensFromRangeList(::std::vector<ScTokenRef>& pTokens, const ScRangeList& rRanges);
- static bool SC_DLLPUBLIC isRef(const ScSharedTokenRef& pToken);
- static bool SC_DLLPUBLIC isExternalRef(const ScSharedTokenRef& pToken);
+ static bool SC_DLLPUBLIC isRef(const ScTokenRef& pToken);
+ static bool SC_DLLPUBLIC isExternalRef(const ScTokenRef& pToken);
- static bool SC_DLLPUBLIC intersects(const ::std::vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken);
+ static bool SC_DLLPUBLIC intersects(const ::std::vector<ScTokenRef>& rTokens, const ScTokenRef& pToken);
- static void SC_DLLPUBLIC join(::std::vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken);
+ static void SC_DLLPUBLIC join(::std::vector<ScTokenRef>& rTokens, const ScTokenRef& pToken);
- static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScSharedTokenRef& pToken);
+ static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScTokenRef& pToken);
+
+ static ScTokenRef createRefToken(const ScAddress& rAddr);
+ static ScTokenRef createRefToken(const ScRange& rRange);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 9e5d40cd7108..8ed8aeabe29b 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -112,7 +112,6 @@
#define FID_TESTFUNC9 (SC_VIEW_START + 9)
#define FID_SCALESTATUS (SC_VIEW_START + 10)
#define FID_COLOR (SC_VIEW_START + 11)
-//aus sfx: #define SID_REPAINT (SC_VIEW_START + 12)
#define SID_UPDATECHART (SC_VIEW_START + 13)
#define FID_MARKLEFT (SC_VIEW_START + 14)
#define FID_MARKRIGHT (SC_VIEW_START + 15)
@@ -196,7 +195,6 @@
#define SID_CHOOSE_DESIGN (SC_VIEW_START + 82)
#define SID_EURO_CONVERTER (SC_VIEW_START + 83)
-//#define SID_CHG_PROTECT (SC_VIEW_START + 84) -> moved to SVX
#define SID_EXTERNAL_SOURCE (SC_VIEW_START + 85)
#define SID_SC_INPUT_TEXTWYSIWYG (SC_VIEW_START + 86)
@@ -207,10 +205,10 @@
#define SID_FOCUS_INPUTLINE (SC_VIEW_START + 89)
#define SID_SELECT_TABLES (SC_VIEW_START + 90)
-// #97776# new entry "Filter..." in DP popup menu
+// new entry "Filter..." in DP popup menu
#define SID_DP_FILTER (SC_VIEW_START + 91)
-// #101160# Replace cell contents warning
+// Replace cell contents warning
#define SID_SC_INPUT_REPLCELLSWARN (SC_VIEW_START + 92)
// additional IDs for list/range validity
@@ -222,11 +220,9 @@
// #i59082# assign macro to shape
#define SID_ASSIGNMACRO (SC_VIEW_START + 95)
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
// #i66550# hyperlinks in shapes
#define SID_DRAW_HLINK_EDIT (SC_VIEW_START + 96)
#define SID_DRAW_HLINK_DELETE (SC_VIEW_START + 97)
-#endif
// "Zoom / Synchronize sheets" in options dialog
#define SID_SC_OPT_SYNCZOOM (SC_VIEW_START + 98)
@@ -285,21 +281,16 @@
#define SID_OPENDLG_FUNCTION (SC_MESSAGE_START + 52)
#define SID_OPENDLG_SOLVE (SC_MESSAGE_START + 53)
#define SID_OPENDLG_TABOP (SC_MESSAGE_START + 54)
-//#define SID_OPENDLG_CHART (SC_MESSAGE_START + 55)
#define SID_OPENDLG_EDITFUNCTION (SC_MESSAGE_START + 56)
#define SID_OPENDLG_ARGUMENT (SC_MESSAGE_START + 57)
-//#define SID_OPENDLG_MODCHART (SC_MESSAGE_START + 58)
#define SID_OPENDLG_CONDFRMT (SC_MESSAGE_START + 59)
#define SID_OPENDLG_OPTSOLVER (SC_MESSAGE_START + 60)
-//<!--Added by PengYunQuan for Validity Cell Range Picker
#define SID_VALIDITY_REFERENCE (SC_MESSAGE_START + 61)
-//-->Added by PengYunQuan for Validity Cell Range Picker
#define SC_HINT_NAVIGATOR_UPDATEALL (SC_MESSAGE_START + 65)
// Funktionen ------------------------------------------------------------
-//#define FID_PRINT_PREVIEW (SC_FUNCTION_START)
#define FID_DOC_MANAGER (SC_FUNCTION_START + 1)
#define FID_CURSOR_ENTER (SC_FUNCTION_START + 2)
#define SID_MAIL (SC_FUNCTION_START + 3)
@@ -325,7 +316,6 @@
#define SID_DEL_ROWS (EDIT_MENU_START + 16)//JN
#define SID_DEL_COLS (EDIT_MENU_START + 17)//JN
-//#define FID_CHG_RECORD (EDIT_MENU_START + 18) -> moved to SVX
#define FID_CHG_SHOW (EDIT_MENU_START + 19)
#define EDIT_MENU_END (EDIT_MENU_START + 20)
@@ -341,9 +331,7 @@
#define FID_FUNCTION_BOX (VIEW_MENU_START + 8)
#define FID_NORMALVIEWMODE (VIEW_MENU_START + 9)
#define FID_TOGGLEFORMULA (VIEW_MENU_START + 10)
-// Compare/Merge jetzt aus Sfx
-//#define FID_CHG_COMPARE (VIEW_MENU_START + 16)// DANGER DIRTY ID
-//#define FID_CHG_MERGE (VIEW_MENU_START + 17)// DANGER DIRTY ID
+
#define FID_CHG_ACCEPT (VIEW_MENU_START + 18)// DANGER DIRTY ID
#define FID_CHG_COMMENT (VIEW_MENU_START + 19)// DANGER DIRTY ID
#define VIEW_MENU_END (VIEW_MENU_START + 20)
@@ -365,8 +353,6 @@
#define FID_USE_NAME (INSERT_MENU_START + 13)
#define FID_APPLY_NAME (INSERT_MENU_START + 14)
#define FID_INS_TABLE_EXT (INSERT_MENU_START + 15)
-//#define SID_CHARMAP (INSERT_MENU_START + 15)//!!! kommt von sfx
-//aus sfx: #define SID_INSERT_POSTIT (INSERT_MENU_START + 16)
#define SID_INSERT_CLIPART (INSERT_MENU_START + 17) //!!! sollte vom Svx kommen
#define FID_INS_CELLSDOWN (INSERT_MENU_START + 18)
#define FID_INS_CELLSRIGHT (INSERT_MENU_START + 19)
@@ -431,12 +417,7 @@
#define SID_UNFILTER (DATA_MENU_START + 6)
#define SID_QUERY (DATA_MENU_START + 7)
#define SID_SUBTOTALS (DATA_MENU_START + 8)
-//aus sfx: #define SID_OUTLINE_HIDE (DATA_MENU_START + 9)
-//aus sfx: #define SID_OUTLINE_SHOW (DATA_MENU_START + 10)
-//aus sfx: #define SID_OUTLINE_MAKE (DATA_MENU_START + 11)
-//aus sfx: #define SID_OUTLINE_REMOVE (DATA_MENU_START + 12)
#define SID_AUTO_OUTLINE (DATA_MENU_START + 13)
-//aus sfx: #define SID_OUTLINE_DELETEALL (DATA_MENU_START + 14)
#define SID_IMPORT_DATA (DATA_MENU_START + 15)
#define SID_REIMPORT_DATA (DATA_MENU_START + 16)
#define SID_PIVOT_TABLE (DATA_MENU_START + 17)
@@ -449,8 +430,7 @@
#define SID_SORT_DESCENDING (DATA_MENU_START + 23)
#define SID_SORT_ASCENDING (DATA_MENU_START + 24)
-//
-//
+
#define DATA_MENU_END (DATA_MENU_START + 25)
#define TAB_POPUP_START (DATA_MENU_END)
@@ -491,12 +471,8 @@
#define DRAW_BAR_START (RID_INPUTBAR_END)
#define SID_DRAWTOABOVE (DRAW_BAR_START+15)
#define SID_DRAWTOBELOW (DRAW_BAR_START+16)
-//#define SID_GROUP (DRAW_BAR_START+17)
-//#define SID_UNGROUP (DRAW_BAR_START+18)
#define SID_FRAMETOTOP (DRAW_BAR_START+19)
#define SID_FRAMETOBOTTOM (DRAW_BAR_START+20)
-//aus sfx: #define SID_FRAME_UP (DRAW_BAR_START+21)
-//aus sfx: #define SID_FRAME_DOWN (DRAW_BAR_START+22)
#define SID_TOOL_TEXT (DRAW_BAR_START+23)
#define SID_ANCHOR_PAGE (DRAW_BAR_START+24)
#define SID_ANCHOR_CELL (DRAW_BAR_START+25)
@@ -532,10 +508,12 @@
#define SID_DETECTIVE_REFRESH (DETECTIVE_START+14)
#define SID_DETECTIVE_AUTO (DETECTIVE_START+15)
+#define SID_DETECTIVE_MARK_PRED (DETECTIVE_START+16)
+#define SID_DETECTIVE_MARK_SUCC (DETECTIVE_START+17)
+
#define DETECTIVE_END (DETECTIVE_START+20)
#define SID_API_SLOTS (DETECTIVE_END)
-//aus sfx: #define SID_ENTER_STRING (SID_API_SLOTS)
#define SID_INSERT_MATRIX (SID_API_SLOTS+1)
#define SID_DELETE_NOTE (SID_API_SLOTS+2)
@@ -623,7 +601,6 @@
#define SID_FILL_COUNT (SID_NEW_SLOTS+8)
#define SID_WITH_UNDO (SID_NEW_SLOTS+9)
#define FID_MERGE_TOGGLE (SID_NEW_SLOTS+10)
-//aus sfx: #define SID_ATTR_SECIALCHAR (SID_NEW_SLOTS+10)
#define SID_ATTR_ROWHEADERS (SID_NEW_SLOTS+11)
#define SID_ATTR_COLHEADERS (SID_NEW_SLOTS+12)
@@ -739,21 +716,12 @@
// idl Parameter ---------------------------------------------------------
-//aus sfx: #define FN_PARAM_1 (SC_PARAM_START)
-//aus sfx: #define FN_PARAM_2 (SC_PARAM_START+1)
-//aus sfx: #define FN_PARAM_3 (SC_PARAM_START+2)
-//aus sfx: #define FN_PARAM_4 (SC_PARAM_START+3)
-//aus sfx: #define FN_PARAM_5 (SC_PARAM_START+4)
-//aus sfx: #define FN_PARAM_6 (SC_PARAM_START+5)
-//aus sfx: #define FN_PARAM_7 (SC_PARAM_START+6)
-//aus sfx: #define FN_PARAM_8 (SC_PARAM_START+7)
-#define FN_PARAM_9 (FN_PARAM_8+1)
-
#define SID_SORT_BYROW (SC_PARAM_START)
#define SID_SORT_HASHEADER (SC_PARAM_START+1)
#define SID_SORT_CASESENS (SC_PARAM_START+2)
#define SID_SORT_ATTRIBS (SC_PARAM_START+3)
#define SID_SORT_USERDEF (SC_PARAM_START+4)
+#define SID_SORT_NATURALSORT (SC_PARAM_START+5)
// Resourcen -------------------------------------------------------------
@@ -767,8 +735,6 @@
#define RID_POPUP_PREVIEW (SC_RESOURCE_START+7)
#define RID_POPUP_OLE (SC_RESOURCE_START+8)
#define RID_POPUP_CHART (SC_RESOURCE_START+9)
-//#define RID_ANCHORBITMAP (SC_RESOURCE_START+10)
-//#define RID_GRAYANCHORBITMAP (SC_RESOURCE_START+11)
#define RID_OUTLINEBITMAPS (SC_RESOURCE_START+12)
#define RID_DRAW_WIN (SC_RESOURCE_START+13)
#define RID_CNTRLR_WIN (SC_RESOURCE_START+14)
@@ -786,28 +752,19 @@
#define RID_POPUP_EDIT (SC_RESOURCE_START+33)
#define RID_POPUP_AUDIT (SC_RESOURCE_START+34)
#define RID_OBJECTBAR_TOOLS (SC_RESOURCE_START+35)
-// free
-// free
#define RID_TBXCTL_INSERT (SC_RESOURCE_START+38)
#define RID_TBXCTL_INSCELLS (SC_RESOURCE_START+39)
#define RID_TBXCTL_INSOBJ (SC_RESOURCE_START+40)
-// free
-// free
#define RID_SC_FUNCTION_DESCRIPTIONS1 (SC_RESOURCE_START+43)
#define RID_SC_FUNCTION_DESCRIPTIONS2 (SC_RESOURCE_START+44)
#define RID_POPUP_CONTROL (SC_RESOURCE_START+45)
#define RID_POPUP_PAGEBREAK (SC_RESOURCE_START+46)
-// free
#define RID_POPUP_DRAWFORM (SC_RESOURCE_START+48)
#define RID_SC_ADDIN_ROT13 (SC_RESOURCE_START+50)
#define RID_SC_ADDIN_DFA (SC_RESOURCE_START+51)
#define RID_IMAGELIST_NAVCONT (SC_RESOURCE_START+52)
#define RID_DRAW_OBJECTBAR (SC_RESOURCE_START+53)
#define RID_GRAPHIC_OBJECTBAR (SC_RESOURCE_START+54)
-// free
-// free
-#define RID_IMAGELIST_H_NAVCONT (SC_RESOURCE_START+57)
-#define RID_OUTLINEBITMAPS_H (SC_RESOURCE_START+58)
#define RID_MEDIA_OBJECTBAR (SC_RESOURCE_START+60)
#define RID_POPUP_MEDIA (SC_RESOURCE_START+61)
#define RID_FUNCTION_CATEGORIES (SC_RESOURCE_START+62)
@@ -843,7 +800,6 @@
#define SCSTR_APDTABLE (STR_START + 27)
#define SCSTR_RENAMETAB (STR_START + 28)
#define STR_INSERTGRAPHIC (STR_START + 29)
-//#define STR_BASIC_IDE (STR_START + 30)
#define SCSTR_APPLICATION (STR_START + 31)
#define SCSTR_DOCSHELL (STR_START + 32)
#define SCSTR_TABVIEWSHELL (STR_START + 33)
@@ -917,20 +873,19 @@
#define SCSTR_CHG_PROTECT (STR_START + 86)
#define SCSTR_CHG_UNPROTECT (STR_START + 87)
-// #98185#
#define STR_CAPTION_DEFAULT_TEXT (STR_START + 88)
// dialog: Select Sheets
#define STR_DLG_SELECTTABLES_TITLE (STR_START + 89)
#define STR_DLG_SELECTTABLES_LBNAME (STR_START + 90)
-// #101160# Replace cell contents warning
+// Replace cell contents warning
#define STR_REPLCELLSWARN (STR_START + 91)
#define SCSTR_DPFUNCLISTBOX (STR_START + 92)
#define SCSTR_ALLFILTER (STR_START + 94)
#define SCSTR_MOREBTN_MOREOPTIONS (STR_START + 95)
-#define SCSTR_MOREBTN_FEWEROPTIONS (STR_START + 96)
+#define SCSTR_MOREBTN_FEWEROPTIONS (STR_START + 96)
// Items
@@ -963,6 +918,7 @@
#define STR_ACC_TABLE_DESCR (STR_START + 157)
#define STR_ACC_CELL_NAME (STR_START + 158)
#define STR_ACC_CELL_DESCR (STR_START + 159)
+
// Preview
#define STR_ACC_PREVIEWDOC_NAME (STR_START + 160)
#define STR_ACC_PREVIEWDOC_DESCR (STR_START + 161)
@@ -992,6 +948,7 @@
#define STR_ACC_DATAPILOT_COL_DESCR (STR_START + 179)
#define STR_ACC_DATAPILOT_DATA_DESCR (STR_START + 180)
#define STR_ACC_DATAPILOT_SEL_DESCR (STR_START + 181)
+#define STR_ACC_DATAPILOT_PAGE_DESCR (STR_START + 182)
//IAccessibility2 Implementation 2009-----
#define STR_ACC_TOOLBAR_FORMULA (STR_START + 182)
@@ -1003,17 +960,17 @@
// --------------------------------------------------
-#define SCSTR_HUMAN_SCDOC_NAME (STR_START + 210)
-#define SCSTR_SHORT_SCDOC_NAME (STR_START + 211)
-#define SCSTR_LONG_SCDOC_NAME (STR_START + 212)
+#define SCSTR_HUMAN_SCDOC_NAME (STR_START + 210)
+#define SCSTR_SHORT_SCDOC_NAME (STR_START + 211)
+#define SCSTR_LONG_SCDOC_NAME (STR_START + 212)
-#define SCSTR_CLPBRD_CLEAR (STR_START + 213)
+#define SCSTR_CLPBRD_CLEAR (STR_START + 213)
#define SCSTR_FORMULA_AUTOCORRECTION (STR_START + 214)
-#define SCSTR_RENAMEOBJECT (STR_START + 215)
-
-#define SCSTR_PRINT_OPTIONS (STR_START+216)
+#define SCSTR_RENAMEOBJECT (STR_START + 215)
+#define SCSTR_PRINT_OPTIONS (STR_START + 216)
+#define SCSTR_WARN_ME_IN_FUTURE_CHECK (STR_START + 217)
// Navigator - in der Reihenfolge wie SC_CONTENT_...
#define SCSTR_CONTENT_ROOT (STR_START + 250)
@@ -1053,7 +1010,7 @@
#define SCSTR_FUSTAT (STR_START + 395)
#define SCSTR_FUTAB (STR_START + 396)
#define SCSTR_FUTEXT (STR_START + 397)
-//
+
#define SCSTR_COMPILER_STRINGS (STR_START + 398)
#define SCSTR_FILTER_STRINGS (STR_START + 399)
#define SCSTR_COMPILER_INTL_STR (STR_START + 400)
@@ -1071,15 +1028,9 @@
#define BMP_START (STR_END)
// Navigator
-// not used anymore: RID_BMP_EXPAND, RID_BMP_COLLAPSE
-//#define RID_BMP_EXPAND (BMP_START)
-//#define RID_BMP_COLLAPSE (BMP_START + 1)
#define RID_IMG_DROP_URL (BMP_START + 2)
#define RID_IMG_DROP_LINK (BMP_START + 3)
#define RID_IMG_DROP_COPY (BMP_START + 4)
-#define RID_IMG_H_DROP_URL (BMP_START + 5)
-#define RID_IMG_H_DROP_LINK (BMP_START + 6)
-#define RID_IMG_H_DROP_COPY (BMP_START + 7)
#define RID_IMG_SELECT_CURRENT (BMP_START + 8)
#define RID_IMG_UNSELECT_CURRENT (BMP_START + 9)
@@ -1173,7 +1124,6 @@
#define RID_SCDLG_CHAR (SC_DIALOGS_START + 76)
#define RID_SCDLG_PARAGRAPH (SC_DIALOGS_START + 77)
-//#define RID_SCDLG_CHARTRANGE (SC_DIALOGS_START + 78)
#define RID_SCPAGE_STAT (SC_DIALOGS_START + 79)
#define RID_SCDLG_CHARTCOLROW (SC_DIALOGS_START + 80)
@@ -1181,7 +1131,7 @@
#define RID_SCDLG_EDITCHAR (SC_DIALOGS_START + 82)
- // Popup fuer Statusbar-Controller
+// Popup fuer Statusbar-Controller
#define RID_POPUP_SUMCTL (SC_DIALOGS_START + 83)
#define RID_SUMCTL_SUM (SC_DIALOGS_START + 84)
#define RID_SUMCTL_MIN (SC_DIALOGS_START + 85)
@@ -1193,7 +1143,7 @@
#define RID_SCDLG_ASCII (SC_DIALOGS_START + 91)
- // Popup fuer Drop-Modus im Navigator
+// Popup fuer Drop-Modus im Navigator
#define RID_POPUP_DROPMODE (SC_DIALOGS_START + 92)
#define RID_DROPMODE_URL (SC_DIALOGS_START + 93)
#define RID_DROPMODE_LINK (SC_DIALOGS_START + 94)
@@ -1282,14 +1232,35 @@
#define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }
#endif
-// mask color for high contrast
-#define SC_HC_MASKCOLOR STD_MASKCOLOR
-
#define MID_1 1
#define MID_2 2
#define MID_3 3
#define MID_4 4
-#endif
+// ----------------------------------------------------------------------------
+// ooo-build specific resources
+
+#define SC_OOO_BUILD_START (SC_DIALOGS_END)
+
+// Toggle sheet grid
+#define FID_TAB_TOGGLE_GRID (SC_OOO_BUILD_START + 1)
+
+// Formula options page
+#define RID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 2)
+#define HID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 3)
+// Insert current date and time to cell via command
+#define SID_INSERT_CURRENT_DATE (SC_OOO_BUILD_START + 4)
+#define SID_INSERT_CURRENT_TIME (SC_OOO_BUILD_START + 5)
+
+// Data Form
+#define SID_DATAFORM_NEW (SC_OOO_BUILD_START + 6) // message
+#define SID_DATA_FORM (SC_OOO_BUILD_START + 7) // menu (in Data menu)
+#define RID_SCDLG_DATAFORM (SC_OOO_BUILD_START + 8) // dialog
+
+// Compatibility options page
+#define RID_SCPAGE_COMPATIBILITY (SC_OOO_BUILD_START + 9)
+#define HID_SCPAGE_COMPATIBILITY (SC_OOO_BUILD_START + 10)
+
+#endif
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 36bf1ff7e76a..6eea3204ab53 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,8 @@
#include "pivot.hxx"
#include "i18npool/lang.h"
+#include <tabvwsh.hxx>
+
class ScAsciiOptions;
class ScAutoFormat;
class ScAutoFormatData;
@@ -53,9 +56,7 @@ class SfxStyleSheetBase;
class ScDPObject;
struct ScPivotFuncData;
struct ScDPNumGroupInfo;
-//<!--Added by PengYunQuan for Validity Cell Range Picker
class ScTabViewShell;
-//-->Added by PengYunQuan for Validity Cell Range Picker
namespace com { namespace sun { namespace star { namespace sheet {
struct DataPilotFieldReference;
@@ -93,8 +94,11 @@ public:
class AbstractScDataPilotSourceTypeDlg : public VclAbstractDialog //add for ScDataPilotSourceTypeDlg
{
public:
- virtual sal_Bool IsDatabase() const = 0;
- virtual sal_Bool IsExternal() const = 0;
+ virtual bool IsDatabase() const = 0;
+ virtual bool IsExternal() const = 0;
+ virtual bool IsNamedRange() const = 0;
+ virtual rtl::OUString GetSelectedNamedRange() const = 0;
+ virtual void AppendNamedRange(const ::rtl::OUString& rName) = 0;
};
class AbstractScDataPilotServiceDlg : public VclAbstractDialog //add for ScDataPilotServiceDlg
@@ -113,6 +117,12 @@ public:
virtual DelCellCmd GetDelCellCmd() const = 0;
};
+//for dataform
+class AbstractScDataFormDlg : public VclAbstractDialog //add for ScDeleteCellDlg
+{
+
+};
+
class AbstractScDeleteContentsDlg: public VclAbstractDialog //add for ScDeleteContentsDlg
{
public:
@@ -130,7 +140,7 @@ public:
virtual double GetStep() const = 0;
virtual double GetMax() const = 0;
virtual String GetStartStr() const = 0;
- virtual void SetEdStartValEnabled(sal_Bool bFlag=sal_False) = 0;
+ virtual void SetEdStartValEnabled(sal_Bool bFlag=false) = 0;
};
class AbstractScGroupDlg : public VclAbstractDialog //add for ScGroupDlg
@@ -203,9 +213,12 @@ class AbstractScMoveTableDlg : public VclAbstractDialog //add for ScMoveTableDl
public:
virtual sal_uInt16 GetSelectedDocument () const = 0;
virtual sal_uInt16 GetSelectedTable () const = 0;
- virtual sal_Bool GetCopyTable () const = 0;
- virtual void SetCopyTable (sal_Bool bFlag=sal_True) = 0;
- virtual void EnableCopyTable (sal_Bool bFlag=sal_True) = 0;
+ virtual bool GetCopyTable () const = 0;
+ virtual bool GetRenameTable () const = 0;
+ virtual void GetTabNameString( String& rString ) const = 0;
+ virtual void SetForceCopyTable () = 0;
+ virtual void EnableCopyTable (sal_Bool bFlag=true) = 0;
+ virtual void EnableRenameTable (sal_Bool bFlag=true) = 0;
};
class AbstractScNameCreateDlg : public VclAbstractDialog //add for ScNameCreateDlg
@@ -309,7 +322,7 @@ public:
class ScAbstractDialogFactory
{
public:
- static ScAbstractDialogFactory* Create();
+ SC_DLLPUBLIC static ScAbstractDialogFactory* Create();
virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, String aDatName, //add for ScImportAsciiDlg
SvStream* pInStream, int nId,
@@ -324,8 +337,8 @@ public:
int nId) = 0;
virtual AbstractScColRowLabelDlg * CreateScColRowLabelDlg (Window* pParent, //add for ScColRowLabelDlg
int nId,
- sal_Bool bCol = sal_False,
- sal_Bool bRow = sal_False) = 0;
+ sal_Bool bCol = false,
+ sal_Bool bRow = false) = 0;
virtual VclAbstractDialog * CreateScColOrRowDlg( Window* pParent, //add for ScColOrRowDlg
const String& rStrTitle,
@@ -341,7 +354,10 @@ public:
const com::sun::star::uno::Sequence<rtl::OUString>& rServices,
int nId ) = 0;
- virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, sal_Bool bDisallowCellMove = sal_False ) = 0 ; //add for ScDeleteCellDlg
+ virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, sal_Bool bDisallowCellMove = false ) = 0 ; //add for ScDeleteCellDlg
+
+ //for dataform
+ virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell ) = 0 ; //add for ScDataFormDlg
virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg
sal_uInt16 nCheckDefaults = 0 ) = 0;
@@ -359,12 +375,12 @@ public:
virtual AbstractScGroupDlg * CreateAbstractScGroupDlg( Window* pParent, //add for ScGroupDlg
sal_uInt16 nResId,
int nId,
- sal_Bool bUnGroup = sal_False,
+ sal_Bool bUnGroup = false,
sal_Bool bRows = sal_True ) = 0;
virtual AbstractScInsertCellDlg * CreateScInsertCellDlg( Window* pParent, //add for ScInsertCellDlg
int nId,
- sal_Bool bDisallowCellMove = sal_False ) = 0;
+ sal_Bool bDisallowCellMove = false ) = 0;
virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( Window* pParent, //add for ScInsertContentsDlg
int nId,
@@ -394,7 +410,9 @@ public:
long nFirst = 1,
long nLast = 100 ) = 0;
- virtual AbstractScMoveTableDlg * CreateScMoveTableDlg( Window* pParent, int nId ) = 0; //add for ScMoveTableDlg
+ virtual AbstractScMoveTableDlg * CreateScMoveTableDlg( Window* pParent, //add for ScMoveTableDlg
+ const String& rDefault,
+ int nId ) = 0;
virtual AbstractScNameCreateDlg * CreateScNameCreateDlg ( Window * pParent, sal_uInt16 nFlags, int nId ) = 0; //add for ScNameCreateDlg
@@ -432,7 +450,7 @@ public:
virtual AbstractScNewScenarioDlg * CreateScNewScenarioDlg ( Window* pParent, const String& rName, //add for ScNewScenarioDlg
int nId,
- sal_Bool bEdit = sal_False, sal_Bool bSheetProtected = sal_False ) = 0;
+ sal_Bool bEdit = false, sal_Bool bSheetProtected = false ) = 0;
virtual AbstractScShowTabDlg * CreateScShowTabDlg ( Window* pParent, int nId ) = 0; //add for ScShowTabDlg
virtual AbstractScStringInputDlg * CreateScStringInputDlg ( Window* pParent, //add for ScStringInputDlg
@@ -454,8 +472,8 @@ public:
sal_Bool bAscii = sal_True,
const ScImportOptions* pOptions = NULL,
const String* pStrTitle = NULL,
- sal_Bool bMultiByte = sal_False,
- sal_Bool bOnlyDbtoolsEncodings = sal_False,
+ sal_Bool bMultiByte = false,
+ sal_Bool bOnlyDbtoolsEncodings = false,
sal_Bool bImport = sal_True ) = 0;
virtual SfxAbstractTabDialog * CreateScAttrDlg( SfxViewFrame* pFrame, //add for ScAttrDlg
@@ -485,13 +503,8 @@ public:
virtual SfxAbstractTabDialog * CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ,//add for ScParagraphDlg
int nId ) = 0;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent, //add for ScValidationDlg
- // const SfxItemSet* pArgSet,int nId ) = 0;
-
virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent, //add for ScValidationDlg
const SfxItemSet* pArgSet,int nId, ScTabViewShell *pTabVwSh ) = 0;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent, //add for ScSortDlg
const SfxItemSet* pArgSet,int nId ) = 0;
// for tabpage
@@ -500,3 +513,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scdll.hxx b/sc/inc/scdll.hxx
index fde9c31ed326..93cff7e5bad0 100644
--- a/sc/inc/scdll.hxx
+++ b/sc/inc/scdll.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,19 +40,14 @@ class SfxFilter;
#include <sfx2/module.hxx>
#include <sfx2/docfac.hxx>
-//-------------------------------------------------------------------------
-
+/**
+ * This class is a wrapper for a Load-On-Demand-DLL. One instance per
+ * SfxApplication will be created for the runtime of
+ * SfxApplication-subclass::Main().
+ *
+ * Remember: Do export this class! It is used by the application.
+ */
class ScDLL
-
-/* [Description]
-
- This class is a wrapper for a Load-On-Demand-DLL. One instance
- per SfxApplication will be created for the runtime of
- SfxApplication-subclass::Main().
-
- Remember: Do export this class! It is used by the application.
-*/
-
{
public:
// Ctor/Dtor must be linked to the application
@@ -76,3 +72,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scdllapi.h b/sc/inc/scdllapi.h
index c2d1b16ea588..d38db27f78ec 100644
--- a/sc/inc/scdllapi.h
+++ b/sc/inc/scdllapi.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef INCLUDED_SCDLLAPI_H
#define INCLUDED_SCDLLAPI_H
@@ -11,3 +12,5 @@
#define SC_DLLPRIVATE SAL_DLLPRIVATE
#endif /* INCLUDED_SCDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scerrors.hxx b/sc/inc/scerrors.hxx
index 4f128ed57604..735f7ba12970 100644
--- a/sc/inc/scerrors.hxx
+++ b/sc/inc/scerrors.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scextopt.hxx b/sc/inc/scextopt.hxx
index ad3fd4b1b51e..9319b7da71fc 100644
--- a/sc/inc/scextopt.hxx
+++ b/sc/inc/scextopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,6 +77,7 @@ struct ScExtTabSettings
bool mbSelected; /// true = Sheet is selected.
bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits.
bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode.
+ bool mbShowGrid; /// Whether or not to display gridlines.
explicit ScExtTabSettings();
};
@@ -129,3 +131,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx
index 6788c906cb8d..e644854373f0 100644
--- a/sc/inc/scitems.hxx
+++ b/sc/inc/scitems.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,16 @@
#ifndef SC_ITEMS_HXX
#define SC_ITEMS_HXX
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
-// EditEngine darf nicht ihre eigenen ITEMID's definieren
+// EditEngine is not allowed to define it's own ITEMID's
#define _EEITEMID_HXX
//--------------------------
-// Item-IDs fuer UI-MsgPool:
+// Item-IDs for UI-MsgPool:
//--------------------------
-//! sollten auch nach unter 1000 verschoben werden!
+//! shall be moved to the below-1000 range!
#define MSGPOOL_START 1100
//--------------------------------------
@@ -57,13 +56,13 @@
#define MSGPOOL_END 1109
//-------------------------
-// Item-IDs fuer Attribute:
+// Item-IDs for attributes:
//-------------------------
-#define ATTR_STARTINDEX 100 // Anfang Attribute
+#define ATTR_STARTINDEX 100 // begin of attributes
-#define ATTR_PATTERN_START 100 // Anfang Zellattribut-Pattern
+#define ATTR_PATTERN_START 100 // begin of cell-attribute-pattern
-#define ATTR_FONT 100 // Anfang Zellattribute
+#define ATTR_FONT 100 // begin of cell-attributes
#define ATTR_FONT_HEIGHT 101
#define ATTR_FONT_WEIGHT 102
#define ATTR_FONT_POSTURE 103
@@ -93,80 +92,82 @@
#define ATTR_HANGPUNCTUATION 127
#define ATTR_FORBIDDEN_RULES 128
#define ATTR_HOR_JUSTIFY 129
-#define ATTR_INDENT 130
-#define ATTR_VER_JUSTIFY 131
-#define ATTR_STACKED 132
-#define ATTR_ROTATE_VALUE 133
-#define ATTR_ROTATE_MODE 134
-#define ATTR_VERTICAL_ASIAN 135
-#define ATTR_WRITINGDIR 136
-#define ATTR_LINEBREAK 137
-#define ATTR_SHRINKTOFIT 138
-#define ATTR_BORDER_TLBR 139
-#define ATTR_BORDER_BLTR 140
-#define ATTR_MARGIN 141
-#define ATTR_MERGE 142
-#define ATTR_MERGE_FLAG 143
-#define ATTR_VALUE_FORMAT 144
-#define ATTR_LANGUAGE_FORMAT 145
-#define ATTR_BACKGROUND 146
-#define ATTR_PROTECTION 147
-#define ATTR_BORDER 148
-#define ATTR_BORDER_INNER 149 // innen, wg. Vorlagen-EditDialog
-#define ATTR_SHADOW 150
-#define ATTR_VALIDDATA 151
-#define ATTR_CONDITIONAL 152
-
-#define ATTR_PATTERN_END 152 // Ende Zellattribut-Pattern
-
-#define ATTR_PATTERN 153
- // Seitenattribute
-#define ATTR_LRSPACE 154 // Editor: PageDesc-TabPage
-#define ATTR_ULSPACE 155
-#define ATTR_PAGE 156
-#define ATTR_PAGE_PAPERTRAY 157
-#define ATTR_PAGE_PAPERBIN 158
-#define ATTR_PAGE_SIZE 159
-#define ATTR_PAGE_MAXSIZE 160
-#define ATTR_PAGE_HORCENTER 161
-#define ATTR_PAGE_VERCENTER 162
-
-#define ATTR_PAGE_ON 163 // Editor: Header/Footer-Page
-#define ATTR_PAGE_DYNAMIC 164
-#define ATTR_PAGE_SHARED 165
-
-#define ATTR_PAGE_NOTES 166 // Editor: Tabelle
-#define ATTR_PAGE_GRID 167
-#define ATTR_PAGE_HEADERS 168
-#define ATTR_PAGE_CHARTS 169
-#define ATTR_PAGE_OBJECTS 170
-#define ATTR_PAGE_DRAWINGS 171
-#define ATTR_PAGE_TOPDOWN 172
-#define ATTR_PAGE_SCALE 173
-#define ATTR_PAGE_SCALETOPAGES 174
-#define ATTR_PAGE_FIRSTPAGENO 175
-
-#define ATTR_PAGE_PRINTAREA 176 // Editor: Druckbereiche
-#define ATTR_PAGE_REPEATROW 177
-#define ATTR_PAGE_REPEATCOL 178
-#define ATTR_PAGE_PRINTTABLES 179
-
-#define ATTR_PAGE_HEADERLEFT 180 // Inhalte der Kopf-/
-#define ATTR_PAGE_FOOTERLEFT 181 // Fusszeilen (links)
-#define ATTR_PAGE_HEADERRIGHT 182 // Inhalte der Kopf-/
-#define ATTR_PAGE_FOOTERRIGHT 183 // Fusszeilen (rechts)
-#define ATTR_PAGE_HEADERSET 184 // die Sets dazu...
-#define ATTR_PAGE_FOOTERSET 185
-
-#define ATTR_PAGE_FORMULAS 186
-#define ATTR_PAGE_NULLVALS 187
-
-#define ATTR_PAGE_SCALETO 188 // #i8868# scale printout to with/height
-
-#define ATTR_ENDINDEX ATTR_PAGE_SCALETO // Ende Pool-Range
+#define ATTR_HOR_JUSTIFY_METHOD 130
+#define ATTR_INDENT 131
+#define ATTR_VER_JUSTIFY 132
+#define ATTR_VER_JUSTIFY_METHOD 133
+#define ATTR_STACKED 134
+#define ATTR_ROTATE_VALUE 135
+#define ATTR_ROTATE_MODE 136
+#define ATTR_VERTICAL_ASIAN 137
+#define ATTR_WRITINGDIR 138
+#define ATTR_LINEBREAK 139
+#define ATTR_SHRINKTOFIT 140
+#define ATTR_BORDER_TLBR 141
+#define ATTR_BORDER_BLTR 142
+#define ATTR_MARGIN 143
+#define ATTR_MERGE 144
+#define ATTR_MERGE_FLAG 145
+#define ATTR_VALUE_FORMAT 146
+#define ATTR_LANGUAGE_FORMAT 147
+#define ATTR_BACKGROUND 148
+#define ATTR_PROTECTION 149
+#define ATTR_BORDER 150
+#define ATTR_BORDER_INNER 151 // inside, because of template-EditDialog
+#define ATTR_SHADOW 152
+#define ATTR_VALIDDATA 153
+#define ATTR_CONDITIONAL 154
+
+#define ATTR_PATTERN_END 154 // end cell-attribute-pattern
+
+#define ATTR_PATTERN 155
+ // page attributes
+#define ATTR_LRSPACE 156 // editor: PageDesc-TabPage
+#define ATTR_ULSPACE 157
+#define ATTR_PAGE 158
+#define ATTR_PAGE_PAPERTRAY 159
+#define ATTR_PAGE_PAPERBIN 160
+#define ATTR_PAGE_SIZE 161
+#define ATTR_PAGE_MAXSIZE 162
+#define ATTR_PAGE_HORCENTER 163
+#define ATTR_PAGE_VERCENTER 164
+
+#define ATTR_PAGE_ON 165 // editor: header/footer-page
+#define ATTR_PAGE_DYNAMIC 166
+#define ATTR_PAGE_SHARED 167
+
+#define ATTR_PAGE_NOTES 168 // editor: table
+#define ATTR_PAGE_GRID 169
+#define ATTR_PAGE_HEADERS 170
+#define ATTR_PAGE_CHARTS 171
+#define ATTR_PAGE_OBJECTS 172
+#define ATTR_PAGE_DRAWINGS 173
+#define ATTR_PAGE_TOPDOWN 174
+#define ATTR_PAGE_SCALE 175
+#define ATTR_PAGE_SCALETOPAGES 176
+#define ATTR_PAGE_FIRSTPAGENO 177
+
+#define ATTR_PAGE_PRINTAREA 178 // editor: print areas
+#define ATTR_PAGE_REPEATROW 179
+#define ATTR_PAGE_REPEATCOL 180
+#define ATTR_PAGE_PRINTTABLES 181
+
+#define ATTR_PAGE_HEADERLEFT 182 // contents of header/
+#define ATTR_PAGE_FOOTERLEFT 183 // footer (left)
+#define ATTR_PAGE_HEADERRIGHT 184 // contents of header/
+#define ATTR_PAGE_FOOTERRIGHT 185 // footer (right)
+#define ATTR_PAGE_HEADERSET 186 // the corresponding sets
+#define ATTR_PAGE_FOOTERSET 187
+
+#define ATTR_PAGE_FORMULAS 188
+#define ATTR_PAGE_NULLVALS 189
+
+#define ATTR_PAGE_SCALETO 190 // #i8868# scale printout to width/height
+
+#define ATTR_ENDINDEX ATTR_PAGE_SCALETO // end of pool-range
//--------------------------------
-// Dummy Slot-IDs fuer Dialoge
+// Dummy Slot-IDs for dialogs
//--------------------------------
#define SID_SCATTR_PAGE_NOTES ATTR_PAGE_NOTES
#define SID_SCATTR_PAGE_GRID ATTR_PAGE_GRID
@@ -193,3 +194,4 @@
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index 971b32336e6c..3979ce3729d6 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,14 +30,17 @@
#define SC_MATRIX_HXX
#include "global.hxx"
-#include "formula/intruref.hxx"
+#include "types.hxx"
#include "formula/errorcodes.hxx"
#include <tools/string.hxx>
#include "scdllapi.h"
+#include <boost/intrusive_ptr.hpp>
+
class SvStream;
class ScInterpreter;
class SvNumberFormatter;
+class ScMatrixImpl;
typedef sal_uInt8 ScMatValType;
const ScMatValType SC_MATVAL_VALUE = 0x00;
@@ -46,68 +50,93 @@ const ScMatValType SC_MATVAL_EMPTY = SC_MATVAL_STRING | 0x04; // STRING plus
const ScMatValType SC_MATVAL_EMPTYPATH = SC_MATVAL_EMPTY | 0x08; // EMPTY plus flag
const ScMatValType SC_MATVAL_NONVALUE = SC_MATVAL_EMPTYPATH; // mask of all non-value bits
-union ScMatrixValue
+struct ScMatrixValue
{
- double fVal;
- String* pS;
+ union {
+ double fVal;
+ const String* pS;
+ };
+ ScMatValType nType;
/// Only valid if ScMatrix methods indicate so!
- const String& GetString() const { return pS ? *pS : EMPTY_STRING; }
+ const String& GetString() const { return pS ? *pS : EMPTY_STRING; }
/// Only valid if ScMatrix methods indicate that this is no string!
sal_uInt16 GetError() const { return GetDoubleErrorValue( fVal); }
/// Only valid if ScMatrix methods indicate that this is a boolean
- bool GetBoolean() const { return fVal != 0.; }
-};
+ bool GetBoolean() const { return fVal != 0.0; }
-/** Matrix representation of double values and strings.
+ ScMatrixValue() : pS(NULL), nType(SC_MATVAL_EMPTY) {}
- @ATTENTION: optimized for speed and double values.
+ ScMatrixValue(const ScMatrixValue& r) : nType(r.nType)
+ {
+ switch (nType)
+ {
+ case SC_MATVAL_VALUE:
+ case SC_MATVAL_BOOLEAN:
+ fVal = r.fVal;
+ break;
+ default:
+ pS = r.pS;
+ }
+ }
- <p> Matrix elements are NOT initialized after construction!
+ bool operator== (const ScMatrixValue& r) const
+ {
+ if (nType != r.nType)
+ return false;
- <p> All methods using an SCSIZE nIndex parameter and all Is...() methods do
- NOT check the range for validity! However, the Put...() and Get...()
- methods using nCol/nRow parameters do check the range.
+ switch (nType)
+ {
+ case SC_MATVAL_VALUE:
+ case SC_MATVAL_BOOLEAN:
+ return fVal == r.fVal;
+ break;
+ default:
+ ;
+ }
+ if (!pS)
+ return r.pS == NULL;
- <p> Methods using nCol/nRow parameters do replicate a single row vector if
- nRow &gt; 0 and nCol &lt; nColCount, respectively a column vector if nCol
- &gt; 0 and nRow &lt; nRowCount.
+ return GetString().Equals(r.GetString());
+ }
- <p> GetString( SCSIZE nIndex ) does not check if there really is a string,
- do this with IsString() first. GetString( SCSIZE nC, SCSIZE nR ) does check
- it and returns and empty string if there is no string. Both GetDouble()
- methods don't check for a string, do this with IsNumeric() or IsString() or
- IsValue() first.
+ bool operator!= (const ScMatrixValue& r) const
+ {
+ return !operator==(r);
+ }
- <p> The GetString( SvNumberFormatter&, ...) methods return the matrix
- element's string if one is present, otherwise the numerical value is
- formatted as a string, or in case of an error the error string is returned.
+ ScMatrixValue& operator= (const ScMatrixValue& r)
+ {
+ nType = r.nType;
+ switch (nType)
+ {
+ case SC_MATVAL_VALUE:
+ case SC_MATVAL_BOOLEAN:
+ fVal = r.fVal;
+ break;
+ default:
+ pS = r.pS;
+ }
+ return *this;
+ }
+};
- <p> PutDouble() does not reset an eventual string! Use
- PutDoubleAndResetString() if that is wanted. Also the FillDouble...()
- methods don't reset strings. As a consequence memory leaks may occur if
- used wrong.
+/**
+ * Matrix data type that can store values of mixed types. Each element can
+ * be one of the following types: numeric, string, boolean, empty, and empty
+ * path.
+ *
+ * This class also supports four different density types: filled zero,
+ * filled empty, sparse zero, and sparse empty. The filled density type
+ * allocates memory for every single element at all times, whereas the
+ * sparse density types allocates memory only for non-default elements.
*/
class SC_DLLPUBLIC ScMatrix
{
- ScMatrixValue* pMat;
- ScMatValType* mnValType;
- sal_uLong mnNonValue; // how many strings and empties
- ScInterpreter* pErrorInterpreter;
- mutable sal_uLong nRefCnt; // reference count
- SCSIZE nColCount;
- SCSIZE nRowCount;
- bool mbCloneIfConst; // Whether the matrix is cloned with a CloneIfConst() call.
-
- void ResetIsString();
- void DeleteIsString();
- void CreateMatrix( SCSIZE nC, SCSIZE nR);
- void Clear();
-
- // pStr may be NULL, bFlag MUST NOT be 0
- void PutStringEntry( const String* pStr, sal_uInt8 bFlag, SCSIZE nIndex );
+ ScMatrixImpl* pImpl;
+ mutable size_t nRefCnt; // reference count
// only delete via Delete()
~ScMatrix();
@@ -116,9 +145,36 @@ class SC_DLLPUBLIC ScMatrix
ScMatrix( const ScMatrix& );
ScMatrix& operator=( const ScMatrix&);
- void SetErrorAtInterpreter( sal_uInt16 nError) const;
-
public:
+ enum DensityType
+ {
+ FILLED_ZERO,
+ FILLED_EMPTY,
+ SPARSE_ZERO,
+ SPARSE_EMPTY
+ };
+
+ /**
+ * When adding all numerical matrix elements for a scalar result such as
+ * summation, the interpreter wants to separate the first non-zero value
+ * with the rest of the summed values.
+ *
+ * TODO: Find out if we still need to do this. If not, we can re-write
+ * ScInterpreter::IterateParameters() to make it simpler and remove this
+ * struct.
+ */
+ struct IterateResult
+ {
+ double mfFirst;
+ double mfRest;
+ size_t mnCount;
+
+ IterateResult(double fFirst, double fRest, size_t nCount) :
+ mfFirst(fFirst), mfRest(fRest), mnCount(nCount) {}
+
+ IterateResult(const IterateResult& r) :
+ mfFirst(r.mfFirst), mfRest(r.mfRest), mnCount(r.mnCount) {}
+ };
/// The maximum number of elements a matrix may have at runtime.
inline static size_t GetElementsMax()
@@ -169,13 +225,11 @@ public:
return (nType & SC_MATVAL_NONVALUE) == SC_MATVAL_EMPTYPATH;
}
- /** If nC*nR results in more than GetElementsMax() entries, a 1x1 matrix is
- created instead and a double error value (errStackOverflow) is set.
- Compare nC and nR with a GetDimensions() call to check. */
- ScMatrix( SCSIZE nC, SCSIZE nR) : nRefCnt(0), mbCloneIfConst(true) { CreateMatrix( nC, nR); }
+ ScMatrix( SCSIZE nC, SCSIZE nR, DensityType eType = FILLED_ZERO);
/** Clone the matrix. */
ScMatrix* Clone() const;
+ ScMatrix* Clone( DensityType eType) const;
/** Clone the matrix if mbCloneIfConst (immutable) is set, otherwise
return _this_ matrix, to be assigned to a ScMatrixRef. */
@@ -183,54 +237,34 @@ public:
/** Set the matrix to (im)mutable for CloneIfConst(), only the interpreter
should do this and know the consequences. */
- inline void SetImmutable( bool bVal ) { mbCloneIfConst = bVal; }
+ void SetImmutable( bool bVal );
/**
- * Resize the matrix to specified new dimension. Note that this operation
- * clears all stored values.
+ * Resize the matrix to specified new dimension.
*/
void Resize( SCSIZE nC, SCSIZE nR);
/** Clone the matrix and extend it to the new size. nNewCols and nNewRows
MUST be at least of the size of the original matrix. */
- ScMatrix* CloneAndExtend( SCSIZE nNewCols, SCSIZE nNewRows ) const;
+ ScMatrix* CloneAndExtend( SCSIZE nNewCols, SCSIZE nNewRows, DensityType eType) const;
- /// Disable refcounting forever, may only be deleted via Delete() afterwards.
- inline void SetEternalRef() { nRefCnt = ULONG_MAX; }
- inline bool IsEternalRef() const { return nRefCnt == ULONG_MAX; }
- inline void IncRef() const
- {
- if ( !IsEternalRef() )
- ++nRefCnt;
- }
- inline void DecRef() const
+ inline void IncRef() const
{
- if ( nRefCnt > 0 && !IsEternalRef() )
- if ( --nRefCnt == 0 )
- delete this;
+ ++nRefCnt;
}
- inline void Delete()
+ inline void DecRef() const
{
- if ( nRefCnt == 0 || IsEternalRef() )
+ --nRefCnt;
+ if (nRefCnt == 0)
delete this;
- else
- --nRefCnt;
}
- void SetErrorInterpreter( ScInterpreter* p)
- { pErrorInterpreter = p; }
-
- ScMatrix( SvStream& rStream);
- void Store( SvStream& rStream) const;
-
- void GetDimensions( SCSIZE& rC, SCSIZE& rR) const
- { rC = nColCount; rR = nRowCount; };
- SCSIZE GetElementCount() const
- { return nColCount * nRowCount; }
- inline bool ValidColRow( SCSIZE nC, SCSIZE nR) const
- { return nC < nColCount && nR < nRowCount; }
- inline SCSIZE CalcOffset( SCSIZE nC, SCSIZE nR) const
- { return nC * nRowCount + nR; }
+ DensityType GetDensityType() const;
+ void SetErrorInterpreter( ScInterpreter* p);
+ void GetDimensions( SCSIZE& rC, SCSIZE& rR) const;
+ SCSIZE GetElementCount() const;
+ bool ValidColRow( SCSIZE nC, SCSIZE nR) const;
+ SCSIZE CalcOffset( SCSIZE nC, SCSIZE nR) const;
/** For a row vector or column vector, if the position does not point into
the vector but is a valid column or row offset it is adapted such that
@@ -238,26 +272,7 @@ public:
vector, same row column 0 for a column vector. Else, for a 2D matrix,
returns false.
*/
- inline bool ValidColRowReplicated( SCSIZE & rC, SCSIZE & rR ) const
- {
- if (nColCount == 1 && nRowCount == 1)
- {
- rC = 0;
- rR = 0;
- return true;
- }
- else if (nColCount == 1 && rR < nRowCount)
- {
- rC = 0;
- return true;
- }
- else if (nRowCount == 1 && rC < nColCount)
- {
- rR = 0;
- return true;
- }
- return false;
- }
+ bool ValidColRowReplicated( SCSIZE & rC, SCSIZE & rR ) const;
/** Checks if the matrix position is within the matrix. If it is not, for a
row vector or column vector the position is adapted such that it points
@@ -265,28 +280,17 @@ public:
same row column 0 for a column vector. Else, for a 2D matrix and
position not within matrix, returns false.
*/
- inline bool ValidColRowOrReplicated( SCSIZE & rC, SCSIZE & rR ) const
- {
- return ValidColRow( rC, rR) || ValidColRowReplicated( rC, rR);
- }
-
+ bool ValidColRowOrReplicated( SCSIZE & rC, SCSIZE & rR ) const;
void PutDouble( double fVal, SCSIZE nC, SCSIZE nR);
- void PutDouble( double fVal, SCSIZE nIndex)
- { pMat[nIndex].fVal = fVal; }
+ void PutDouble( double fVal, SCSIZE nIndex);
void PutString( const String& rStr, SCSIZE nC, SCSIZE nR);
void PutString( const String& rStr, SCSIZE nIndex);
void PutEmpty( SCSIZE nC, SCSIZE nR);
- void PutEmpty( SCSIZE nIndex);
- /// Jump sal_False without path
+ /// Jump FALSE without path
void PutEmptyPath( SCSIZE nC, SCSIZE nR);
- void PutEmptyPath( SCSIZE nIndex);
- void PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR )
- { PutDouble( CreateDoubleError( nErrorCode ), nC, nR ); }
- void PutError( sal_uInt16 nErrorCode, SCSIZE nIndex )
- { PutDouble( CreateDoubleError( nErrorCode ), nIndex ); }
+ void PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR );
void PutBoolean( bool bVal, SCSIZE nC, SCSIZE nR);
- void PutBoolean( bool bVal, SCSIZE nIndex);
void FillDouble( double fVal,
SCSIZE nC1, SCSIZE nR1, SCSIZE nC2, SCSIZE nR2 );
@@ -297,129 +301,62 @@ public:
Use GetErrorIfNotString() instead if not sure.
@returns 0 if no error, else one of err... constants */
sal_uInt16 GetError( SCSIZE nC, SCSIZE nR) const;
- sal_uInt16 GetError( SCSIZE nIndex) const
- { return pMat[nIndex].GetError(); }
/** Use in ScInterpreter to obtain the error code, if any.
@returns 0 if no error or string element, else one of err... constants */
sal_uInt16 GetErrorIfNotString( SCSIZE nC, SCSIZE nR) const
{ return IsValue( nC, nR) ? GetError( nC, nR) : 0; }
- sal_uInt16 GetErrorIfNotString( SCSIZE nIndex) const
- { return IsValue( nIndex) ? GetError( nIndex) : 0; }
/// @return 0.0 if empty or empty path, else value or DoubleError.
double GetDouble( SCSIZE nC, SCSIZE nR) const;
/// @return 0.0 if empty or empty path, else value or DoubleError.
- double GetDouble( SCSIZE nIndex) const
- {
- if ( pErrorInterpreter )
- {
- sal_uInt16 nError = GetDoubleErrorValue( pMat[nIndex].fVal);
- if ( nError )
- SetErrorAtInterpreter( nError);
- }
- return pMat[nIndex].fVal;
- }
+ double GetDouble( SCSIZE nIndex) const;
/// @return empty string if empty or empty path, else string content.
const String& GetString( SCSIZE nC, SCSIZE nR) const;
/// @return empty string if empty or empty path, else string content.
- const String& GetString( SCSIZE nIndex) const
- { return pMat[nIndex].GetString(); }
+ const String& GetString( SCSIZE nIndex) const;
/** @returns the matrix element's string if one is present, otherwise the
numerical value formatted as string, or in case of an error the error
string is returned; an empty string for empty, a "FALSE" string for
empty path. */
String GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const;
- String GetString( SvNumberFormatter& rFormatter, SCSIZE nIndex) const;
/// @ATTENTION: If bString the ScMatrixValue->pS may still be NULL to indicate
/// an empty string!
- const ScMatrixValue* Get( SCSIZE nC, SCSIZE nR, ScMatValType& nType) const;
+ ScMatrixValue Get( SCSIZE nC, SCSIZE nR) const;
/// @return <TRUE/> if string or empty or empty path, in fact non-value.
- sal_Bool IsString( SCSIZE nIndex ) const
- { return mnValType && IsNonValueType( mnValType[nIndex]); }
+ sal_Bool IsString( SCSIZE nIndex ) const;
/// @return <TRUE/> if string or empty or empty path, in fact non-value.
- sal_Bool IsString( SCSIZE nC, SCSIZE nR ) const
- {
- ValidColRowReplicated( nC, nR );
- return mnValType && IsNonValueType( mnValType[ nC * nRowCount + nR ]);
- }
+ sal_Bool IsString( SCSIZE nC, SCSIZE nR ) const;
/// @return <TRUE/> if empty or empty path.
- sal_Bool IsEmpty( SCSIZE nIndex ) const
- { return mnValType && ((mnValType[nIndex] & SC_MATVAL_EMPTY) == SC_MATVAL_EMPTY); }
-
- /// @return <TRUE/> if empty or empty path.
- sal_Bool IsEmpty( SCSIZE nC, SCSIZE nR ) const
- {
- ValidColRowReplicated( nC, nR );
- return mnValType && ((mnValType[ nC * nRowCount + nR ] & SC_MATVAL_EMPTY) == SC_MATVAL_EMPTY);
- }
+ sal_Bool IsEmpty( SCSIZE nC, SCSIZE nR ) const;
/// @return <TRUE/> if empty path.
- sal_Bool IsEmptyPath( SCSIZE nC, SCSIZE nR ) const
- {
- ValidColRowReplicated( nC, nR );
- return mnValType && ((mnValType[ nC * nRowCount + nR ] & SC_MATVAL_EMPTYPATH) == SC_MATVAL_EMPTYPATH);
- }
-
- /// @return <TRUE/> if empty path.
- sal_Bool IsEmptyPath( SCSIZE nIndex ) const
- { return mnValType && ((mnValType[nIndex] & SC_MATVAL_EMPTYPATH) == SC_MATVAL_EMPTYPATH); }
+ sal_Bool IsEmptyPath( SCSIZE nC, SCSIZE nR ) const;
/// @return <TRUE/> if value or boolean.
- sal_Bool IsValue( SCSIZE nIndex ) const
- { return !mnValType || IsValueType( mnValType[nIndex]); }
+ sal_Bool IsValue( SCSIZE nIndex ) const;
/// @return <TRUE/> if value or boolean.
- sal_Bool IsValue( SCSIZE nC, SCSIZE nR ) const
- {
- ValidColRowReplicated( nC, nR );
- return !mnValType || IsValueType( mnValType[ nC * nRowCount + nR ]);
- }
+ sal_Bool IsValue( SCSIZE nC, SCSIZE nR ) const;
/// @return <TRUE/> if value or boolean or empty or empty path.
- sal_Bool IsValueOrEmpty( SCSIZE nIndex ) const
- { return !mnValType || IsValueType( mnValType[nIndex] ) ||
- ((mnValType[nIndex] & SC_MATVAL_EMPTY) == SC_MATVAL_EMPTY); }
-
- /// @return <TRUE/> if value or boolean or empty or empty path.
- sal_Bool IsValueOrEmpty( SCSIZE nC, SCSIZE nR ) const
- {
- ValidColRowReplicated( nC, nR );
- return !mnValType || IsValueType( mnValType[ nC * nRowCount + nR ]) ||
- ((mnValType[ nC * nRowCount + nR ] & SC_MATVAL_EMPTY) ==
- SC_MATVAL_EMPTY);
- }
+ sal_Bool IsValueOrEmpty( SCSIZE nC, SCSIZE nR ) const;
/// @return <TRUE/> if boolean.
- sal_Bool IsBoolean( SCSIZE nIndex ) const
- { return mnValType && IsBooleanType( mnValType[nIndex]); }
-
- /// @return <TRUE/> if boolean.
- sal_Bool IsBoolean( SCSIZE nC, SCSIZE nR ) const
- {
- ValidColRowReplicated( nC, nR );
- return mnValType && IsBooleanType( mnValType[ nC * nRowCount + nR ]);
- }
+ sal_Bool IsBoolean( SCSIZE nC, SCSIZE nR ) const;
/// @return <TRUE/> if entire matrix is numeric, including booleans, with no strings or empties
- sal_Bool IsNumeric() const
- { return 0 == mnNonValue; }
+ sal_Bool IsNumeric() const;
void MatTrans( ScMatrix& mRes) const;
void MatCopy ( ScMatrix& mRes) const;
-//UNUSED2009-05 /** Copy upper left of this matrix to mRes matrix.
-//UNUSED2009-05 This matrix's dimensions must be greater or equal to the mRes matrix
-//UNUSED2009-05 dimensions.
-//UNUSED2009-05 */
-//UNUSED2009-05 void MatCopyUpperLeft( ScMatrix& mRes) const;
-
// Convert ScInterpreter::CompareMat values (-1,0,1) to boolean values
void CompareEqual();
void CompareNotEqual();
@@ -428,16 +365,28 @@ public:
void CompareLessEqual();
void CompareGreaterEqual();
- double And(); // logical AND of all matrix values, or NAN
- double Or(); // logical OR of all matrix values, or NAN
+ double And() const; // logical AND of all matrix values, or NAN
+ double Or() const; // logical OR of all matrix values, or NAN
+
+ IterateResult Sum(bool bTextAsZero) const;
+ IterateResult SumSquare(bool bTextAsZero) const;
+ IterateResult Product(bool bTextAsZero) const;
+ size_t Count(bool bCountStrings) const;
// All other matrix functions MatMult, MInv, ... are in ScInterpreter
// to be numerically safe.
};
+inline void intrusive_ptr_add_ref(const ScMatrix* p)
+{
+ p->IncRef();
+}
-typedef formula::SimpleIntrusiveReference< class ScMatrix > ScMatrixRef;
-typedef formula::SimpleIntrusiveReference< const class ScMatrix > ScConstMatrixRef;
-
+inline void intrusive_ptr_release(const ScMatrix* p)
+{
+ p->DecRef();
+}
#endif // SC_MATRIX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index b4ec23838225..1915f5d2c4ba 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,16 +34,14 @@
#include <vcl/timer.hxx>
#include <svl/lstner.hxx>
#include "global.hxx" // ScInputMode
-#include "markdata.hxx" //ScMarkData
+#include "markdata.hxx" // ScMarkData
#include "shellids.hxx"
#include <unotools/options.hxx>
#include <tools/shl.hxx>
-//<!--Added by PengYunQuan for Validity Cell Range Picker
#include <map>
#include <list>
#include <algorithm>
-//-->Added by PengYunQuan for Validity Cell Range Picker
class KeyEvent;
@@ -123,7 +122,7 @@ class ScModule: public SfxModule, public SfxListener, utl::ConfigurationListener
ScClipData aClipData;
ScSelectionTransferObj* pSelTransfer;
ScMessagePool* pMessagePool;
- // globalen InputHandler gibt's nicht mehr, jede View hat einen
+ // there is no global InputHandler anymore, each View has it's own
ScInputHandler* pRefInputHandler;
ScViewCfg* pViewCfg;
ScDocCfg* pDocCfg;
@@ -146,9 +145,7 @@ class ScModule: public SfxModule, public SfxListener, utl::ConfigurationListener
bool mbIsInSharedDocLoading;
bool mbIsInSharedDocSaving;
- //<!--Added by PengYunQuan for Validity Cell Range Picker
std::map<sal_uInt16, std::list<Window*> > m_mapRefWindow;
- //-->Added by PengYunQuan for Validity Cell Range Picker
public:
SFX_DECL_INTERFACE(SCID_APP)
@@ -159,9 +156,9 @@ public:
virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
void DeleteCfg();
- // von der Applikation verschoben:
+ // moved by the application
- DECL_LINK( IdleHandler, Timer* ); // Timer statt idle
+ DECL_LINK( IdleHandler, Timer* ); // Timer instead of idle
DECL_LINK( SpellTimerHdl, Timer* );
DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
@@ -200,12 +197,12 @@ public:
// Options:
const ScViewOptions& GetViewOptions ();
- const ScDocOptions& GetDocOptions ();
+SC_DLLPUBLIC const ScDocOptions& GetDocOptions ();
SC_DLLPUBLIC const ScAppOptions& GetAppOptions ();
const ScInputOptions& GetInputOptions ();
SC_DLLPUBLIC const ScPrintOptions& GetPrintOptions ();
void SetViewOptions ( const ScViewOptions& rOpt );
- void SetDocOptions ( const ScDocOptions& rOpt );
+SC_DLLPUBLIC void SetDocOptions ( const ScDocOptions& rOpt );
SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rOpt );
void SetInputOptions ( const ScInputOptions& rOpt );
void SetPrintOptions ( const ScPrintOptions& rOpt );
@@ -228,11 +225,11 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO
void ModifyOptions( const SfxItemSet& rOptSet );
- // InputHandler:
- sal_Bool IsEditMode(); // nicht bei SC_INPUT_TYPE
- sal_Bool IsInputMode(); // auch bei SC_INPUT_TYPE
+ // InputHandler:
+ sal_Bool IsEditMode(); // not for SC_INPUT_TYPE
+ sal_Bool IsInputMode(); // also for SC_INPUT_TYPE
void SetInputMode( ScInputMode eMode );
- sal_Bool InputKeyEvent( const KeyEvent& rKEvt, sal_Bool bStartEdit = sal_False );
+ sal_Bool InputKeyEvent( const KeyEvent& rKEvt, sal_Bool bStartEdit = false );
SC_DLLPUBLIC void InputEnterHandler( sal_uInt8 nBlockMode = 0 );
void InputCancelHandler();
void InputSelection( EditView* pView );
@@ -244,23 +241,20 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO
void ViewShellGone(ScTabViewShell* pViewSh);
void ViewShellChanged();
- // Kommunikation mit Funktionsautopilot
+ // communication with function-autopilot
void InputGetSelection( xub_StrLen& rStart, xub_StrLen& rEnd );
void InputSetSelection( xub_StrLen nStart, xub_StrLen nEnd );
void InputReplaceSelection( const String& rStr );
String InputGetFormulaStr();
void ActivateInputWindow( const String* pStr = NULL,
- sal_Bool bMatrix = sal_False );
+ sal_Bool bMatrix = false );
void InitFormEditData();
void ClearFormEditData();
ScFormEditData* GetFormEditData() { return pFormEditData; }
- // Referenzeingabe:
- //<!--Added by PengYunQuan for Validity Cell Range Picker
- //void SetRefDialog( sal_uInt16 nId, sal_Bool bVis, SfxViewFrame* pViewFrm = NULL );
+ // input of reference:
SC_DLLPUBLIC void SetRefDialog( sal_uInt16 nId, sal_Bool bVis, SfxViewFrame* pViewFrm = NULL );
- //-->Added by PengYunQuan for Validity Cell Range Picker
sal_Bool IsModalMode(SfxObjectShell* pDocSh = NULL);
sal_Bool IsFormulaMode();
sal_Bool IsRefDialogOpen();
@@ -271,7 +265,7 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO
void EndReference();
sal_uInt16 GetCurRefDlgId() const { return nCurRefDlgId; }
- //virtuelle Methoden fuer den Optionendialog
+ // virtual methods for the options dialog
virtual SfxItemSet* CreateItemSet( sal_uInt16 nId );
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet );
virtual SfxTabPage* CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet );
@@ -293,3 +287,4 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scresid.hxx b/sc/inc/scresid.hxx
index 660404bda5a9..7cb8136f2081 100644
--- a/sc/inc/scresid.hxx
+++ b/sc/inc/scresid.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,4 @@ class SC_DLLPUBLIC ScResId : public ResId
#endif // SC_SCRESMGR_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/scwarngs.hxx b/sc/inc/scwarngs.hxx
index e823a66f7a80..e8c6ff568830 100644
--- a/sc/inc/scwarngs.hxx
+++ b/sc/inc/scwarngs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,3 +35,4 @@
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx
index 195331c750ad..d987616bd997 100644
--- a/sc/inc/segmenttree.hxx
+++ b/sc/inc/segmenttree.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,18 +75,16 @@ public:
ScFlatBoolRowSegments(const ScFlatBoolRowSegments& r);
~ScFlatBoolRowSegments();
- void setTrue(SCROW nRow1, SCROW nRow2);
- void setFalse(SCROW nRow1, SCROW nRow2);
+ bool setTrue(SCROW nRow1, SCROW nRow2);
+ bool setFalse(SCROW nRow1, SCROW nRow2);
bool getValue(SCROW nRow);
bool getRangeData(SCROW nRow, RangeData& rData);
+ bool getRangeDataLeaf(SCROW nRow, RangeData& rData);
void removeSegment(SCROW nRow1, SCROW nRow2);
void insertSegment(SCROW nRow, SCROW nSize, bool bSkipStartBoundary);
SCROW findLastNotOf(bool bValue) const;
- void enableTreeSearch(bool bEnable);
- void setInsertFromBack(bool bInsertFromBack);
-
private:
::std::auto_ptr<ScFlatBoolSegmentsImpl> mpImpl;
};
@@ -105,16 +104,12 @@ public:
ScFlatBoolColSegments(const ScFlatBoolColSegments& r);
~ScFlatBoolColSegments();
- void setTrue(SCCOL nCol1, SCCOL nCol2);
- void setFalse(SCCOL nCol1, SCCOL nCol2);
- bool getValue(SCCOL nCol);
+ bool setTrue(SCCOL nCol1, SCCOL nCol2);
+ bool setFalse(SCCOL nCol1, SCCOL nCol2);
bool getRangeData(SCCOL nCol, RangeData& rData);
void removeSegment(SCCOL nCol1, SCCOL nCol2);
void insertSegment(SCCOL nCol, SCCOL nSize, bool bSkipStartBoundary);
- void enableTreeSearch(bool bEnable);
- void setInsertFromBack(bool bInsertFromBack);
-
private:
::std::auto_ptr<ScFlatBoolSegmentsImpl> mpImpl;
};
@@ -163,10 +158,11 @@ public:
SCROW findLastNotOf(sal_uInt16 nValue) const;
void enableTreeSearch(bool bEnable);
- void setInsertFromBack(bool bInsertFromBack);
private:
::std::auto_ptr<ScFlatUInt16SegmentsImpl> mpImpl;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/servuno.hxx b/sc/inc/servuno.hxx
index 4f2f1ec40de2..9adca2a1dc93 100644
--- a/sc/inc/servuno.hxx
+++ b/sc/inc/servuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@ class String;
class ScDocShell;
-//! AutoFormat wirklich hier oder besser global??????
+//! AutoFormat here or global??????
#define SC_SERVICE_SHEET 0
#define SC_SERVICE_URLFIELD 1
@@ -70,7 +71,7 @@ class ScDocShell;
#define SC_SERVICE_IMAP_CIRC 25
#define SC_SERVICE_IMAP_POLY 26
-// #100263# Support creation of GraphicObjectResolver and EmbeddedObjectResolver
+// Support creation of GraphicObjectResolver and EmbeddedObjectResolver
#define SC_SERVICE_EXPORT_GOR 27
#define SC_SERVICE_IMPORT_GOR 28
#define SC_SERVICE_EXPORT_EOR 29
@@ -104,11 +105,10 @@ class ScDocShell;
class ScServiceProvider
{
public:
- // pDocShell wird nicht fuer alle Services benoetigt
+ // pDocShell is not needed for all Services
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
MakeInstance( sal_uInt16 nType, ScDocShell* pDocShell );
static ::com::sun::star::uno::Sequence<rtl::OUString> GetAllServiceNames();
-//UNUSED2008-05 static String GetProviderName(sal_uInt16 nObjectType);
static sal_uInt16 GetProviderType(const String& rServiceName);
};
@@ -116,3 +116,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/shapeuno.hxx b/sc/inc/shapeuno.hxx
index 74ae321bd409..3c1c0e76b6ed 100644
--- a/sc/inc/shapeuno.hxx
+++ b/sc/inc/shapeuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,6 +53,7 @@ namespace com { namespace sun { namespace star {
class SdrObject;
struct SvEventDescription;
class ShapeUnoEventAccessImpl;
+class ScMacroInfo;
//------------------------------------------------------------------------
@@ -70,6 +72,7 @@ class ScShapeObj :public ScShapeObj_Base
,public ScShapeObj_TextBase
{
private:
+friend ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, sal_Bool bCreate );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg;
// cached pointers to avoid repeated queryAggregation calls:
::com::sun::star::beans::XPropertySet* pShapePropertySet;
@@ -240,3 +243,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/sheetdata.hxx b/sc/inc/sheetdata.hxx
index de67786ff9fe..b4790684ba05 100644
--- a/sc/inc/sheetdata.hxx
+++ b/sc/inc/sheetdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include <xmloff/maptype.hxx>
#include <editeng/editdata.hxx>
#include <vector>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
#include "address.hxx"
@@ -113,7 +114,7 @@ struct ScLoadedNamespaceEntry
class ScSheetSaveData
{
- std::hash_set<rtl::OUString, rtl::OUStringHash> maInitialPrefixes;
+ boost::unordered_set<rtl::OUString, rtl::OUStringHash> maInitialPrefixes;
std::vector<ScLoadedNamespaceEntry> maLoadedNamespaces;
std::vector<ScCellStyleEntry> maCellStyles;
@@ -183,3 +184,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/sheetevents.hxx b/sc/inc/sheetevents.hxx
index bb27f5cf2068..715b1ab0402a 100644
--- a/sc/inc/sheetevents.hxx
+++ b/sc/inc/sheetevents.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sheetdata.hxx,v $
- * $Revision: 1.16.32.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -65,3 +63,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/shellids.hxx b/sc/inc/shellids.hxx
index 7f4ccb60259f..b479d4960e9d 100644
--- a/sc/inc/shellids.hxx
+++ b/sc/inc/shellids.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,4 @@
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/simplerangelist.hxx b/sc/inc/simplerangelist.hxx
new file mode 100644
index 000000000000..efba4dd97cc8
--- /dev/null
+++ b/sc/inc/simplerangelist.hxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * 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 __SC_SIMPLERANGELIST_HXX__
+#define __SC_SIMPLERANGELIST_HXX__
+
+#include <boost/shared_ptr.hpp>
+
+#include "address.hxx"
+
+#include <map>
+#include <list>
+
+class ScAddress;
+class ScRange;
+class ScRangeList;
+
+/**
+ * This container is optimized for use in the ods import filter, to store
+ * ranges for cell styles. We may change the name of this class once we
+ * have a better name for what it does. Using this is way more efficient
+ * than ScRangeList.
+ */
+class ScSimpleRangeList
+{
+public:
+ struct Range
+ {
+ SCCOL mnCol1;
+ SCROW mnRow1;
+ SCCOL mnCol2;
+ SCROW mnRow2;
+ explicit Range(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+
+ bool contains(const Range& r) const;
+ };
+ typedef ::boost::shared_ptr< ::std::list<Range> > RangeListRef;
+ typedef ::std::map<SCTAB, RangeListRef> TabType;
+
+ ScSimpleRangeList();
+
+ void addRange(const ScRange& rRange);
+ void insertCol(SCCOL nCol, SCTAB nTab);
+ void insertRow(SCROW nRow, SCTAB nTab);
+ void getRangeList(::std::list<ScRange>& rList) const;
+ void clear();
+
+private:
+ RangeListRef findTab(SCTAB nTab);
+
+private:
+ TabType maTabs;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/sortparam.hxx b/sc/inc/sortparam.hxx
index 862d0271e617..e722ab3e428f 100644
--- a/sc/inc/sortparam.hxx
+++ b/sc/inc/sortparam.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,7 @@ struct SC_DLLPUBLIC ScSortParam
sal_Bool bHasHeader;
sal_Bool bByRow;
sal_Bool bCaseSens;
+ sal_Bool bNaturalSort;
sal_Bool bUserDef;
sal_uInt16 nUserIndex;
sal_Bool bIncludePattern;
@@ -79,3 +81,5 @@ struct SC_DLLPUBLIC ScSortParam
#endif // SC_SORTPARAM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/srchuno.hxx b/sc/inc/srchuno.hxx
index f8f82ed25aff..9c306f29a0cc 100644
--- a/sc/inc/srchuno.hxx
+++ b/sc/inc/srchuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -127,3 +128,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx
index 81352c0a989e..8cf4b134c641 100644
--- a/sc/inc/stlpool.hxx
+++ b/sc/inc/stlpool.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,14 +54,12 @@ public:
void CreateStandardStyles();
void CopyStdStylesFrom( ScStyleSheetPool* pSrcPool );
-//UNUSED2008-05 void UpdateStdNames();
void CopyStyleFrom( ScStyleSheetPool* pSrcPool,
const String& rName, SfxStyleFamily eFamily );
ScStyleSheet* FindCaseIns( const String& rName, SfxStyleFamily eFam );
-//UNUSED2009-05 void SetForceStdName( const String* pSet );
const String* GetForceStdName() const { return pForceStdName; }
virtual SfxStyleSheetBase& Make( const String&, SfxStyleFamily eFam,
@@ -84,3 +83,4 @@ private:
#endif // SC_STLPOOL_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx
index 087bf44d3b51..cdbe11267d5c 100644
--- a/sc/inc/stlsheet.hxx
+++ b/sc/inc/stlsheet.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,3 +90,4 @@ protected:
#endif // SC_STLSHEET_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index c50c0d8cf156..7874175767aa 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: table.hxx,v $
- * $Revision: 1.35 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -32,6 +30,41 @@
#define SC_STRINGUTIL_HXX
#include "rtl/ustring.hxx"
+#include "scdllapi.h"
+
+class SvNumberFormatter;
+
+/**
+ * Store parameters used in the ScDocument::SetString() method. Various
+ * options for string-setting operation are specified herein.
+ */
+struct SC_DLLPUBLIC ScSetStringParam
+{
+ /**
+ * Stores the pointer to the number formatter instance to be used during
+ * number format detection. The caller must manage the life cycle of the
+ * instance.
+ */
+ SvNumberFormatter* mpNumFormatter;
+
+ /**
+ * When true, we try to detect special number format (dates etc) from the
+ * input string, when false, we only try to detect a basic decimal number
+ * format.
+ */
+ bool mbDetectNumberFormat;
+
+ /**
+ * When true, set the format of the cell to Text when a string cell is
+ * requested for a number input. We may want to do this during text file
+ * import (csv, html etc).
+ */
+ bool mbSetTextCellFormat;
+
+ ScSetStringParam();
+};
+
+// ============================================================================
class ScStringUtil
{
@@ -41,6 +74,8 @@ public:
* don't do any elaborate parsing here; we only check for the simplest
* case of decimal number format.
*
+ * Note that preceding and trailing spaces are ignored during parsing.
+ *
* @param rStr string to parse
* @param dsep decimal separator
* @param gsep group separator (aka thousands separator)
@@ -54,3 +89,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/strload.hxx b/sc/inc/strload.hxx
index 311d8fe05b05..60d507441209 100644
--- a/sc/inc/strload.hxx
+++ b/sc/inc/strload.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,4 @@ private:
#endif // SC_STRLOAD_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx
index 8f9aa2ff0ab1..166405299bd4 100644
--- a/sc/inc/styleuno.hxx
+++ b/sc/inc/styleuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,6 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-//#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase7.hxx>
@@ -131,7 +131,7 @@ class ScStyleFamilyObj : public ::cppu::WeakImplHelper4<
{
private:
ScDocShell* pDocShell;
- SfxStyleFamily eFamily; // Familie
+ SfxStyleFamily eFamily; // Family
ScStyleObj* GetObjectByIndex_Impl(sal_uInt32 nIndex);
ScStyleObj* GetObjectByName_Impl(const rtl::OUString& Name);
@@ -223,7 +223,7 @@ class ScStyleObj : public ::cppu::WeakImplHelper7<
private:
const SfxItemPropertySet* pPropSet;
ScDocShell* pDocShell;
- SfxStyleFamily eFamily; // Familie
+ SfxStyleFamily eFamily; // Family
String aStyleName;
SfxStyleSheetBase* GetStyle_Impl();
@@ -239,7 +239,7 @@ public:
ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const String& rName);
virtual ~ScStyleObj();
- // per getImplementation gerufen:
+ // created by getImplementation:
sal_Bool IsInserted() const { return pDocShell != NULL; }
SfxStyleFamily GetFamily() const { return eFamily; }
void InitDoc( ScDocShell* pNewDocSh, const String& rNewName );
@@ -376,3 +376,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/subtotal.hxx b/sc/inc/subtotal.hxx
index 5a413c95e5ee..e3823c55c81e 100644
--- a/sc/inc/subtotal.hxx
+++ b/sc/inc/subtotal.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,10 +49,11 @@ struct ScFunctionData // zum Berechnen von einzelnen Funktione
sal_Bool bError;
ScFunctionData( ScSubTotalFunc eFn ) :
- eFunc(eFn), nVal(0.0), nCount(0), bError(sal_False) {}
+ eFunc(eFn), nVal(0.0), nCount(0), bError(false) {}
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/tabbgcolor.hxx b/sc/inc/tabbgcolor.hxx
index c2b2a63baf65..063c20596938 100644
--- a/sc/inc/tabbgcolor.hxx
+++ b/sc/inc/tabbgcolor.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: tabbgcolor.hxx,v $
- * $Revision: 1.00 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -42,9 +40,6 @@ struct ScUndoTabColorInfo
Color maOldTabBgColor;
Color maNewTabBgColor;
- bool IsDefaultOldTabBgColor() const;
- bool IsDefaultNewTabBgColor() const;
-
explicit ScUndoTabColorInfo(SCTAB nTab);
ScUndoTabColorInfo(const ScUndoTabColorInfo& r);
@@ -52,3 +47,5 @@ struct ScUndoTabColorInfo
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 524919da5e39..faacdb368368 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,6 +65,7 @@ class ScAutoFormatData;
class ScBaseCell;
class ScDocument;
class ScDrawLayer;
+class ScEditDataArray;
class ScFormulaCell;
class ScOutlineTable;
class ScPostIt;
@@ -84,18 +86,11 @@ class CollatorWrapper;
class ScFlatUInt16RowSegments;
class ScFlatBoolRowSegments;
class ScFlatBoolColSegments;
+struct ScSetStringParam;
+struct ScColWidthParam;
+struct ScColWidthParam;
-
-struct ScShowRowsEntry
-{
- SCROW mnRow1;
- SCROW mnRow2;
- bool mbShow;
-
- ScShowRowsEntry( SCROW nR1, SCROW nR2, bool bS ) :
- mnRow1(nR1), mnRow2(nR2), mbShow(bS) {}
-};
-
+typedef boost::unordered_map< ::rtl::OUString, rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameToNameMap;
class ScTable
{
@@ -179,7 +174,7 @@ private:
sal_Bool bSharedNameInserted;
ScRangeVec aPrintRanges;
- sal_Bool bPrintEntireSheet;
+ bool bPrintEntireSheet;
ScRange* pRepeatColRange;
ScRange* pRepeatRowRange;
@@ -191,6 +186,7 @@ private:
Color aTabBgColor;
sal_uInt16 nScenarioFlags;
sal_Bool bActiveScenario;
+ NameToNameMap localNameToGlobalName;
bool mbPageBreaksValid;
friend class ScDocument; // fuer FillInfo
@@ -233,7 +229,7 @@ public:
void SetVisible( sal_Bool bVis );
sal_Bool IsStreamValid() const { return bStreamValid; }
- void SetStreamValid( sal_Bool bSet, sal_Bool bIgnoreLock = sal_False );
+ void SetStreamValid( sal_Bool bSet, sal_Bool bIgnoreLock = false );
sal_Bool IsPendingRowHeights() const { return bPendingRowHeights; }
void SetPendingRowHeights( sal_Bool bSet );
@@ -301,17 +297,16 @@ public:
sal_Bool* pOnlyNotBecauseOfMatrix = NULL ) const;
sal_Bool HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const;
- sal_Bool HasSelectionMatrixFragment( const ScMarkData& rMark ) const;
+ bool HasSelectionMatrixFragment( const ScMarkData& rMark ) const;
sal_Bool IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bIgnoreNotes = false ) const;
void PutCell( const ScAddress&, ScBaseCell* pCell );
-//UNUSED2009-05 void PutCell( const ScAddress&, sal_uLong nFormatIndex, ScBaseCell* pCell);
void PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell );
void PutCell(SCCOL nCol, SCROW nRow, sal_uLong nFormatIndex, ScBaseCell* pCell);
- // sal_True = Zahlformat gesetzt
+ // TRUE = Zahlformat gesetzt
sal_Bool SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
+ ScSetStringParam* pParam = NULL );
void SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, sal_uInt16 nError);
@@ -324,8 +319,7 @@ public:
0.0;
}
double GetValue( SCCOL nCol, SCROW nRow );
- void GetFormula( SCCOL nCol, SCROW nRow, String& rFormula,
- sal_Bool bAsciiExport = sal_False );
+ void GetFormula( SCCOL nCol, SCROW nRow, String& rFormula );
CellType GetCellType( const ScAddress& rPos ) const
{
@@ -382,7 +376,7 @@ public:
void CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
sal_uInt16 nFlags, sal_Bool bMarked, ScTable* pDestTab,
const ScMarkData* pMarkData = NULL,
- sal_Bool bAsLink = sal_False, sal_Bool bColRowFlags = sal_True);
+ sal_Bool bAsLink = false, sal_Bool bColRowFlags = sal_True);
void UndoToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
sal_uInt16 nFlags, sal_Bool bMarked, ScTable* pDestTab,
const ScMarkData* pMarkData = NULL);
@@ -443,7 +437,6 @@ public:
sal_Bool HasData( SCCOL nCol, SCROW nRow );
sal_Bool HasStringData( SCCOL nCol, SCROW nRow );
sal_Bool HasValueData( SCCOL nCol, SCROW nRow );
-//UNUSED2008-05 sal_uInt16 GetErrorData(SCCOL nCol, SCROW nRow) const;
sal_Bool HasStringCells( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow ) const;
@@ -453,7 +446,6 @@ public:
aCol[rPos.Col()].GetErrCode( rPos.Row() ) :
0;
}
-//UNUSED2008-05 sal_uInt16 GetErrCode( SCCOL nCol, SCROW nRow ) const;
void ResetChanged( const ScRange& rRange );
@@ -482,10 +474,9 @@ public:
void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
void UpdateInsertTab(SCTAB nTable);
-//UNUSED2008-05 void UpdateInsertTabOnlyCells(SCTAB nTable);
void UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo = NULL );
void UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo, ScProgress& );
- void UpdateCompile( sal_Bool bForceIfNameInUse = sal_False );
+ void UpdateCompile( sal_Bool bForceIfNameInUse = false );
void SetTabNo(SCTAB nNewTab);
sal_Bool IsRangeNameInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
sal_uInt16 nIndex) const;
@@ -516,10 +507,9 @@ public:
const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop,
const SvxBorderLine** ppRight, const SvxBorderLine** ppBottom ) const;
-//UNUSED2009-05 sal_Bool HasLines( const ScRange& rRange, Rectangle& rSizes ) const;
bool HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nMask ) const;
- sal_Bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
- sal_Bool ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
+ bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
+ bool ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
SCCOL& rEndCol, SCROW& rEndRow,
sal_Bool bRefresh, sal_Bool bAttrs );
const SfxPoolItem* GetAttr( SCCOL nCol, SCROW nRow, sal_uInt16 nWhich ) const;
@@ -533,6 +523,7 @@ public:
0;
}
sal_uLong GetNumberFormat( SCCOL nCol, SCROW nRow ) const;
+ sal_uInt32 GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
void MergeSelectionPattern( ScMergePatternState& rState,
const ScMarkData& rMark, sal_Bool bDeep ) const;
void MergePatternArea( ScMergePatternState& rState, SCCOL nCol1, SCROW nRow1,
@@ -548,13 +539,16 @@ public:
void ApplyAttr( SCCOL nCol, SCROW nRow, const SfxPoolItem& rAttr );
void ApplyPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr );
- void ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScPatternAttr& rAttr );
- void SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr, sal_Bool bPutToPool = sal_False )
+ void ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
+ const ScPatternAttr& rAttr, ScEditDataArray* pDataArray = NULL );
+ bool SetAttrEntries(SCCOL nCol, ScAttrEntry* pData, SCSIZE nSize);
+
+ void SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr, sal_Bool bPutToPool = false )
{
if (ValidColRow(rPos.Col(),rPos.Row()))
aCol[rPos.Col()].SetPattern( rPos.Row(), rAttr, bPutToPool );
}
- void SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr, sal_Bool bPutToPool = sal_False );
+ void SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr, sal_Bool bPutToPool = false );
void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
const ScPatternAttr& rPattern, short nNewType );
@@ -576,10 +570,10 @@ public:
sal_Bool IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const;
- sal_Bool ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Int16 nFlags );
- sal_Bool RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Int16 nFlags );
+ bool ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, INT16 nFlags );
+ bool RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, INT16 nFlags );
- void ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark );
+ void ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray = NULL );
void DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark );
void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark );
@@ -593,14 +587,12 @@ public:
sal_uInt16 GetPrintRangeCount() const { return static_cast< sal_uInt16 >( aPrintRanges.size() ); }
const ScRange* GetPrintRange(sal_uInt16 nPos) const;
/** Returns true, if the sheet is always printed. */
- sal_Bool IsPrintEntireSheet() const { return bPrintEntireSheet; }
+ bool IsPrintEntireSheet() const { return bPrintEntireSheet; }
/** Removes all print ranges. */
void ClearPrintRanges();
/** Adds a new print ranges. */
void AddPrintRange( const ScRange& rNew );
-//UNUSED2009-05 /** Removes all old print ranges and sets the passed print ranges. */
-//UNUSED2009-05 void SetPrintRange( const ScRange& rNew );
/** Marks the specified sheet to be printed completely. Deletes old print ranges! */
void SetPrintEntireSheet();
@@ -611,19 +603,28 @@ public:
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
sal_Bool bFormula, const ScMarkData* pMarkData,
- sal_Bool bSimpleTextImport );
+ const ScColWidthParam* pParam );
sal_Bool SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra,
OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
sal_Bool bForce,
ScProgress* pOuterProgress = NULL, sal_uLong nProgressStart = 0 );
+
+ void SetOptimalHeightOnly(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra,
+ OutputDevice* pDev,
+ double nPPTX, double nPPTY,
+ const Fraction& rZoomX, const Fraction& rZoomY,
+ sal_Bool bForce,
+ ScProgress* pOuterProgress = NULL, sal_uLong nProgressStart = 0 );
+
long GetNeededSize( SCCOL nCol, SCROW nRow,
OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
sal_Bool bWidth, sal_Bool bTotalSize );
void SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth );
+ void SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth );
void SetRowHeight( SCROW nRow, sal_uInt16 nNewHeight );
sal_Bool SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight,
double nPPTX, double nPPTY );
@@ -669,7 +670,7 @@ public:
void DBShowRow(SCROW nRow, bool bShow);
void ShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
- void DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow, bool bSetFlags); // if bSetFlags=false, no SetRowHidden/SetRowFiltered
+ void DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
void SetColFlags( SCCOL nCol, sal_uInt8 nNewFlags );
void SetRowFlags( SCROW nRow, sal_uInt8 nNewFlags );
@@ -726,12 +727,11 @@ public:
::com::sun::star::sheet::TablePageBreakData> GetRowBreakData() const;
bool RowHidden(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
- bool RowHidden(SCROW nRow, SCROW& rLastRow) const;
+ bool RowHiddenLeaf(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const;
- bool ColHidden(SCCOL nCol, SCCOL& rLastCol) const;
bool ColHidden(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
- void SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden);
- void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden);
+ bool SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden);
+ bool SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden);
void CopyColHidden(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol);
void CopyRowHidden(ScTable& rTable, SCROW nStartRow, SCROW nEndRow);
void CopyRowHeight(ScTable& rSrcTable, SCROW nStartRow, SCROW nEndRow, SCROW nSrcOffset);
@@ -784,12 +784,13 @@ public:
void FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges );
- void IncRecalcLevel() { ++nRecalcLvl; }
- void DecRecalcLevel( bool bUpdateNoteCaptionPos = true ) { if (!--nRecalcLvl) SetDrawPageSize(true, bUpdateNoteCaptionPos); }
+ void IncRecalcLevel();
+ void DecRecalcLevel( bool bUpdateNoteCaptionPos = true );
sal_Bool IsSortCollatorGlobal() const;
void InitSortCollator( const ScSortParam& rPar );
void DestroySortCollator();
+ void SetDrawPageSize( bool bResetStreamValid = true, bool bUpdateNoteCaptionPos = true );
private:
void FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
@@ -829,6 +830,16 @@ private:
sal_Bool SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark);
sal_Bool ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark,
ScDocument* pUndoDoc);
+ bool SearchAndReplaceEmptyCells(
+ const SvxSearchItem& rSearchItem,
+ SCCOL& rCol, SCROW& rRow, ScMarkData& rMark,
+ String& rUndoStr, ScDocument* pUndoDoc);
+ bool SearchRangeForEmptyCell(const ScRange& rRange,
+ const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
+ String& rUndoStr, ScDocument* pUndoDoc);
+ bool SearchRangeForAllEmptyCells(const ScRange& rRange,
+ const SvxSearchItem& rSearchItem, ScMarkData& rMark,
+ String& rUndoStr, ScDocument* pUndoDoc);
// benutzen globalen SortParam:
sal_Bool IsSorted(SCCOLROW nStart, SCCOLROW nEnd);
@@ -859,7 +870,6 @@ private:
sal_Bool GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, sal_Bool bInSel,
const ScMarkData& rMark) const;
sal_Bool GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark );
- void SetDrawPageSize( bool bResetStreamValid = true, bool bUpdateNoteCaptionPos = true );
sal_Bool TestTabRefAbs(SCTAB nTable);
void CompileDBFormula();
void CompileDBFormula( sal_Bool bCreateFormulaString );
@@ -883,6 +893,8 @@ private:
void InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
sal_Bool bNumFormatChanged, sal_Bool bBroadcast );
+ void SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bForward);
+
/**
* In case the cell text goes beyond the column width, move the max column
* position to the right. This is called from ExtendPrintArea.
@@ -937,3 +949,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx
index 3f70a9cbed98..f21d70ec1a7d 100644
--- a/sc/inc/tablink.hxx
+++ b/sc/inc/tablink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,10 +34,6 @@
#include <sfx2/lnkbase.hxx>
#include <sfx2/objsh.hxx>
-//REMOVE #ifndef SO2_DECL_SVEMBEDDEDOBJECT_DEFINED
-//REMOVE #define SO2_DECL_SVEMBEDDEDOBJECT_DEFINED
-//REMOVE SO2_DECL_REF(SvEmbeddedObject)
-//REMOVE #endif
class ScDocShell;
struct TableLink_Impl;
@@ -95,7 +92,7 @@ private:
public:
ScDocumentLoader( const String& rFileName,
String& rFilterName, String& rOptions,
- sal_uInt32 nRekCnt = 0, sal_Bool bWithInteraction = sal_False );
+ sal_uInt32 nRekCnt = 0, sal_Bool bWithInteraction = false );
~ScDocumentLoader();
ScDocument* GetDocument();
ScDocShell* GetDocShell() { return pDocShell; }
@@ -119,3 +116,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/tabopparams.hxx b/sc/inc/tabopparams.hxx
index 6589e51ee3bc..7a505c79c2be 100644
--- a/sc/inc/tabopparams.hxx
+++ b/sc/inc/tabopparams.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,8 +50,8 @@ struct ScInterpreterTableOpParams
sal_Bool bCollectNotifications;
ScInterpreterTableOpParams()
- : bValid( sal_False )
- , bRefresh( sal_False )
+ : bValid( false )
+ , bRefresh( false )
, bCollectNotifications( sal_True )
{
}
@@ -61,7 +62,6 @@ struct ScInterpreterTableOpParams
, aOld2( r.aOld2 )
, aNew2( r.aNew2 )
, aFormulaPos( r.aFormulaPos )
- //! never copied! , aNotifiedFormulaCells( r.aNotifiedFormulaCells )
, aNotifiedFormulaPos( r.aNotifiedFormulaPos )
, bValid( r.bValid )
, bRefresh( r.bRefresh )
@@ -76,8 +76,6 @@ struct ScInterpreterTableOpParams
aOld2 = r.aOld2;
aNew2 = r.aNew2;
aFormulaPos = r.aFormulaPos;
- //! never copied! aNotifiedFormulaCells = r.aNotifiedFormulaCells;
- //! instead, empty anything eventually present
::std::vector< ScFormulaCell* >().swap( aNotifiedFormulaCells );
aNotifiedFormulaPos = r.aNotifiedFormulaPos;
bValid = r.bValid;
@@ -93,12 +91,9 @@ struct ScInterpreterTableOpParams
aOld1 == r.aOld1 &&
aOld2 == r.aOld2 &&
aFormulaPos == r.aFormulaPos ;
- // aNotifiedFormula(Cells|Pos), aNew1, aNew2, bRefresh,
- // bCollectNotifications are not compared
}
};
-DECLARE_LIST( ScTabOpList, ScInterpreterTableOpParams* )
-
-#endif // SC_TABOPPARAMS_HXX
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx
index d8dbd45d27fa..5feab594719f 100644
--- a/sc/inc/tabprotection.hxx
+++ b/sc/inc/tabprotection.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,18 +33,16 @@
#include <com/sun/star/uno/Sequence.hxx>
#include "global.hxx"
-#include <vector>
#include <boost/shared_ptr.hpp>
-#define ENABLE_SHEET_PROTECTION 0
-
class ScDocument;
class ScTableProtectionImpl;
enum ScPasswordHash
{
- PASSHASH_OOO = 0,
- PASSHASH_XL
+ PASSHASH_SHA1 = 0,
+ PASSHASH_XL,
+ PASSHASH_UNSPECIFIED
};
class ScPassHashHelper
@@ -53,7 +52,11 @@ public:
least one hash that needs to be regenerated, it returns true. If all
hash values are compatible with the specified hash type, then it
returns false. */
- static bool needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash);
+ static bool needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED);
+
+ static ::rtl::OUString getHashURI(ScPasswordHash eHash);
+
+ static ScPasswordHash getHashTypeFromURI(const ::rtl::OUString& rURI);
private:
ScPassHashHelper();
@@ -72,11 +75,13 @@ public:
virtual void setProtected(bool bProtected) = 0;
virtual bool isPasswordEmpty() const = 0;
- virtual bool hasPasswordHash(ScPasswordHash eHash) const = 0;
+ virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const = 0;
virtual void setPassword(const String& aPassText) = 0;
- virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(ScPasswordHash eHash) const = 0;
- virtual void setPasswordHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword,
- ScPasswordHash eHash = PASSHASH_OOO) = 0;
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(
+ ScPasswordHash eHash, ScPasswordHash eHas2 = PASSHASH_UNSPECIFIED) const = 0;
+ virtual void setPasswordHash(
+ const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword,
+ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) = 0;
virtual bool verifyPassword(const String& aPassText) const = 0;
};
@@ -102,11 +107,13 @@ public:
virtual void setProtected(bool bProtected);
virtual bool isPasswordEmpty() const;
- virtual bool hasPasswordHash(ScPasswordHash eHash) const;
+ virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const;
virtual void setPassword(const String& aPassText);
- virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(ScPasswordHash eHash) const;
- virtual void setPasswordHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword,
- ScPasswordHash eHash = PASSHASH_OOO);
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(
+ ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const;
+ virtual void setPasswordHash(
+ const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword,
+ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED);
virtual bool verifyPassword(const String& aPassText) const;
bool isOptionEnabled(Option eOption) const;
@@ -159,11 +166,13 @@ public:
virtual void setProtected(bool bProtected);
virtual bool isPasswordEmpty() const;
- virtual bool hasPasswordHash(ScPasswordHash eHash) const;
+ virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const;
virtual void setPassword(const String& aPassText);
- virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(ScPasswordHash eHash) const;
- virtual void setPasswordHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword,
- ScPasswordHash eHash = PASSHASH_OOO);
+ virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(
+ ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const;
+ virtual void setPasswordHash(
+ const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword,
+ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED);
virtual bool verifyPassword(const String& aPassText) const;
bool isOptionEnabled(Option eOption) const;
@@ -175,3 +184,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/targuno.hxx b/sc/inc/targuno.hxx
index 857f4c0c25e2..15cbb57e0a40 100644
--- a/sc/inc/targuno.hxx
+++ b/sc/inc/targuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -204,3 +205,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx
index 17889de08ad3..a2e9b2240e52 100644
--- a/sc/inc/textuno.hxx
+++ b/sc/inc/textuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -416,3 +417,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index 13a8038a4109..9c25d346becf 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,12 +31,11 @@
#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
+#include <boost/intrusive_ptr.hpp>
#include "formula/opcode.hxx"
#include "refdata.hxx"
#include "scmatrix.hxx"
-#include "formula/intruref.hxx"
#include <tools/mempool.hxx>
#include "scdllapi.h"
#include "formula/IFunctionDescription.hxx"
@@ -46,17 +46,7 @@ class ScJumpMatrix;
class ScToken;
typedef ::std::vector< ScComplexRefData > ScRefList;
-typedef formula::SimpleIntrusiveReference< class ScToken > ScTokenRef;
-
-/**
- * Another ref-counted token type using shared_ptr. <b>Be extra careful
- * not to mix use of this smart pointer type with ScTokenRef</b>, since
- * mixing them might cause a premature object deletion because the same
- * object may be ref-counted by two different smart pointer wrappers.
- *
- * You have been warned.
- */
-typedef ::boost::shared_ptr< ScToken > ScSharedTokenRef;
+typedef ::boost::intrusive_ptr<ScToken> ScTokenRef;
class SC_DLLPUBLIC ScToken : public formula::FormulaToken
{
@@ -121,6 +111,16 @@ public:
static formula::FormulaTokenRef ExtendRangeReference( formula::FormulaToken & rTok1, formula::FormulaToken & rTok2, const ScAddress & rPos, bool bReuseDoubleRef );
};
+inline void intrusive_ptr_add_ref(const ScToken* p)
+{
+ p->IncRef();
+}
+
+inline void intrusive_ptr_release(const ScToken* p)
+{
+ p->DecRef();
+}
+
class ScSingleRefToken : public ScToken
{
private:
@@ -174,7 +174,7 @@ class ScMatrixToken : public ScToken
private:
ScMatrixRef pMatrix;
public:
- ScMatrixToken( ScMatrix* p ) :
+ ScMatrixToken( ScMatrixRef p ) :
ScToken( formula::svMatrix ), pMatrix( p ) {}
ScMatrixToken( const ScMatrixToken& r ) :
ScToken( r ), pMatrix( r.pMatrix ) {}
@@ -326,7 +326,7 @@ protected:
ScConstMatrixRef xMatrix;
formula::FormulaConstTokenRef xUpperLeft;
public:
- ScMatrixCellResultToken( ScMatrix* pMat, formula::FormulaToken* pUL ) :
+ ScMatrixCellResultToken( const ScConstMatrixRef& pMat, formula::FormulaToken* pUL ) :
ScToken( formula::svMatrixCell ),
xMatrix( pMat), xUpperLeft( pUL) {}
ScMatrixCellResultToken( const ScMatrixCellResultToken& r ) :
@@ -505,3 +505,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index eb9318b86854..eb4a4ef99acb 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#define SC_TOKENARRAY_HXX
#include "formula/token.hxx"
+#include "scmatrix.hxx"
#include <tools/solar.h>
#include "scdllapi.h"
#include <formula/tokenarray.hxx>
@@ -73,7 +75,7 @@ public:
formula::FormulaToken* AddExternalName( sal_uInt16 nFileId, const String& rName );
formula::FormulaToken* AddExternalSingleReference( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef );
formula::FormulaToken* AddExternalDoubleReference( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef );
- formula::FormulaToken* AddMatrix( ScMatrix* p );
+ formula::FormulaToken* AddMatrix( const ScMatrixRef& p );
/** ScSingleRefOpToken with ocColRowName. */
formula::FormulaToken* AddColRowName( const ScSingleRefData& rRef );
virtual formula::FormulaToken* MergeArray( );
@@ -95,3 +97,4 @@ public:
#endif // SC_TOKENARRAY_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/tokenuno.hxx b/sc/inc/tokenuno.hxx
index c727063281e6..e213e797a76f 100644
--- a/sc/inc/tokenuno.hxx
+++ b/sc/inc/tokenuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -156,3 +157,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx
new file mode 100644
index 000000000000..bb454a9e0854
--- /dev/null
+++ b/sc/inc/types.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell, Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SC_TYPES_HXX__
+#define __SC_TYPES_HXX__
+
+#include <boost/intrusive_ptr.hpp>
+
+class ScMatrix;
+
+typedef ::boost::intrusive_ptr<ScMatrix> ScMatrixRef;
+typedef ::boost::intrusive_ptr<const ScMatrix> ScConstMatrixRef;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/unitconv.hxx b/sc/inc/unitconv.hxx
index 478d4b97e712..be51d3cf3de6 100644
--- a/sc/inc/unitconv.hxx
+++ b/sc/inc/unitconv.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index a9c08c2884fd..d417f026b38f 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,6 +107,8 @@
#define SC_UNONAME_CELLPRO "CellProtection"
#define SC_UNONAME_CELLHJUS "HoriJustify"
#define SC_UNONAME_CELLVJUS "VertJustify"
+#define SC_UNONAME_CELLHJUS_METHOD "HoriJustifyMethod"
+#define SC_UNONAME_CELLVJUS_METHOD "VertJustifyMethod"
#define SC_UNONAME_CELLORI "Orientation"
#define SC_UNONAME_NUMFMT "NumberFormat"
#define SC_UNONAME_SHADOW "ShadowFormat"
@@ -184,6 +187,10 @@
#define SC_UNONAME_ANCHOR "Anchor"
#define SC_UNONAME_HORIPOS "HoriOrientPosition"
#define SC_UNONAME_VERTPOS "VertOrientPosition"
+// #i66550 HLINK_FOR_SHAPES
+#define SC_UNONAME_HYPERLINK "Hyperlink"
+#define SC_UNONAME_MOVEPROTECT "MoveProtect"
+#define SC_UNONAME_SIZEPROTECT "SizeProtect"
// other cell properties
#define SC_UNONAME_CHCOLHDR "ChartColumnAsLabel"
@@ -354,6 +361,7 @@
#define SC_UNO_SRCHSTYLES "SearchStyles"
#define SC_UNO_SRCHTYPE "SearchType"
#define SC_UNO_SRCHWORDS "SearchWords"
+#define SC_UNO_SRCHFILTERED "SearchFiltered"
// old (5.2) property names for page styles - for compatibility only!
#define OLD_UNO_PAGE_BACKCOLOR "BackgroundColor"
@@ -528,7 +536,7 @@
#define SC_UNO_ZOOMTYPE "ZoomType"
#define SC_UNO_ZOOMVALUE "ZoomValue"
#define SC_UNO_UPDTEMPL "UpdateFromTemplate"
-#define SC_UNO_VISAREASCREEN "VisibleAreaOnScreen"
+#define SC_UNO_FILTERED_RANGE_SELECTION "FilteredRangeSelection"
/*Stampit enable/disable print cancel */
#define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel"
@@ -611,12 +619,11 @@
#define SC_UNONAME_ADDRESS "Address"
#define SC_UNONAME_UIREPR "UserInterfaceRepresentation"
#define SC_UNONAME_PERSREPR "PersistentRepresentation"
-#define SC_UNONAME_XLA1REPR "XLA1Representation"
+#define SC_UNONAME_XLA1REPR "XLA1Representation"
#define SC_UNONAME_REFSHEET "ReferenceSheet"
-// --> PB 2004-08-23 #i33095# Security Options
+// Security options
#define SC_UNO_LOADREADONLY "LoadReadonly"
-// <--
#define SC_UNO_MODIFYPASSWORDINFO "ModifyPasswordInfo"
// FormulaParser
@@ -635,13 +642,15 @@
// Solver
#define SC_UNONAME_TIMEOUT "Timeout"
-
#define SC_UNO_SHAREDOC "IsDocumentShared"
// EventDescriptor
-
#define SC_UNO_EVENTTYPE "EventType"
#define SC_UNO_SCRIPT "Script"
+// Named ranges
+#define SC_UNO_MODIFY_BROADCAST "ModifyAndBroadcast"
+
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/unoreflist.hxx b/sc/inc/unoreflist.hxx
index 3947f28cfb12..ad64f943c47d 100644
--- a/sc/inc/unoreflist.hxx
+++ b/sc/inc/unoreflist.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/unowids.hxx b/sc/inc/unowids.hxx
index 2a1ffdbbbfc7..af860fd17a9d 100644
--- a/sc/inc/unowids.hxx
+++ b/sc/inc/unowids.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,3 +95,4 @@ inline sal_Bool IsScItemWid( sal_uInt16 nWid )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx
index 88dea98ec22a..259e99d53090 100644
--- a/sc/inc/userdat.hxx
+++ b/sc/inc/userdat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,12 +61,15 @@ class ScDrawObjData : public SdrObjUserData
public:
ScAddress maStart;
ScAddress maEnd;
+ Point maStartOffset;
+ Point maEndOffset;
bool mbNote;
+ Rectangle maLastRect;
explicit ScDrawObjData();
private:
- virtual ScDrawObjData* Clone( SdrObject* pObj ) const;
+ virtual ScDrawObjData* Clone( SdrObject* pObj ) const;
};
//-------------------------------------------------------------------------
@@ -99,16 +103,12 @@ public:
void SetMacro( const rtl::OUString& rMacro ) { maMacro = rMacro; }
const rtl::OUString& GetMacro() const { return maMacro; }
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
void SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; }
const rtl::OUString& GetHlink() const { return maHlink; }
-#endif
private:
rtl::OUString maMacro;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
rtl::OUString maHlink;
-#endif
};
//-------------------------------------------------------------------------
@@ -116,3 +116,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx
index 98caa8146c41..e88335921eff 100644
--- a/sc/inc/userlist.hxx
+++ b/sc/inc/userlist.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,3 +90,4 @@ inline sal_Bool ScUserList::operator!=( const ScUserList& r ) const
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx
index 285f18a0c4d3..be56343795c1 100644
--- a/sc/inc/validat.hxx
+++ b/sc/inc/validat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -202,12 +203,9 @@ public:
const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
void UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
- /** Temporarily during save, returns RefManager's decision whether ALL
- * references are marked now. */
- bool MarkUsedExternalReferences() const;
-
sal_Bool operator==( const ScValidationDataList& r ) const; // fuer Ref-Undo
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/viewopti.hxx b/sc/inc/viewopti.hxx
index 6277aeee21d9..998f1f693b28 100644
--- a/sc/inc/viewopti.hxx
+++ b/sc/inc/viewopti.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <svx/optgrid.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include "scdllapi.h"
#include "optutil.hxx"
#include "global.hxx"
@@ -135,7 +134,6 @@ class SC_DLLPUBLIC ScTpViewItem : public SfxPoolItem
{
public:
TYPEINFO();
-//UNUSED2008-05 ScTpViewItem( sal_uInt16 nWhich );
ScTpViewItem( sal_uInt16 nWhich, const ScViewOptions& rOpt );
ScTpViewItem( const ScTpViewItem& rItem );
~ScTpViewItem();
@@ -177,3 +175,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx
index 2895574dc609..9b4e276465cd 100644
--- a/sc/inc/viewuno.hxx
+++ b/sc/inc/viewuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -199,6 +200,7 @@ private:
XActivationEventListenerArr_Impl aActivationListeners;
SCTAB nPreviousTab;
sal_Bool bDrawSelModeSet;
+ sal_Bool bFilteredRangeSelection;
ScViewPaneObj* GetObjectByIndex_Impl(sal_uInt16 nIndex) const;
sal_Int16 GetZoom(void) const;
@@ -314,6 +316,11 @@ public:
::com::sun::star::sheet::XSpreadsheet >& xActiveSheet )
throw(::com::sun::star::uno::RuntimeException);
+ // support expand (but not replace) the active sheet
+ virtual void SAL_CALL selectSheet( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::sheet::XSpreadsheet >& xActiveSheet,
+ sal_Bool bExpand)
+ throw(::com::sun::star::uno::RuntimeException);
//XEnhancedMouseClickBroadcaster
virtual void SAL_CALL addEnhancedMouseClickHandler( const ::com::sun::star::uno::Reference<
@@ -395,3 +402,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/waitoff.hxx b/sc/inc/waitoff.hxx
index e181dcf70306..0863b6d1b1be 100644
--- a/sc/inc/waitoff.hxx
+++ b/sc/inc/waitoff.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,15 @@
#ifndef SC_WAITOFF_HXX
#define SC_WAITOFF_HXX
-#include <tools/solar.h>
+#include <sal/types.h>
class Window;
class ScWaitCursorOff
{
private:
- Window* pWin;
- sal_uLong nWaiters;
+ Window* pWin;
+ sal_uInt32 nWaiters;
public:
ScWaitCursorOff( Window* pWin );
~ScWaitCursorOff();
@@ -44,3 +45,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/warnpassword.hxx b/sc/inc/warnpassword.hxx
index 15d35a70d8a2..4e3f2d53f499 100644
--- a/sc/inc/warnpassword.hxx
+++ b/sc/inc/warnpassword.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,3 +47,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/xmlwrap.hxx b/sc/inc/xmlwrap.hxx
index 5b5061aac038..b045c753e4c0 100644
--- a/sc/inc/xmlwrap.hxx
+++ b/sc/inc/xmlwrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,8 +56,6 @@ class ScXMLImportWrapper
SfxMedium* pMedium;
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xStorage;
-//UNUSED2008-05 com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator> GetStatusIndicator(
-//UNUSED2008-05 com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rModel);
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator> GetStatusIndicator();
sal_uInt32 ImportFromComponent(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& xServiceFactory,
@@ -83,3 +82,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/zforauto.hxx b/sc/inc/zforauto.hxx
index 84d5070e2b8c..878971e40b35 100644
--- a/sc/inc/zforauto.hxx
+++ b/sc/inc/zforauto.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/prj/build.lst b/sc/prj/build.lst
index f124dafb90a2..fa3195fb6d6d 100644
--- a/sc/prj/build.lst
+++ b/sc/prj/build.lst
@@ -1,4 +1,4 @@
-sc sc : filter L10N:l10n vbahelper oovbaapi svx uui stoc BOOST:boost formula MDDS:mdds oox LIBXSLT:libxslt NULL
+sc sc : filter L10N:l10n vbahelper oovbaapi svx uui stoc BOOST:boost formula MDDS:mdds oox LIBXSLT:libxslt unoxml NULL
sc sc usr1 - all sc_mkout NULL
sc sc\inc nmake - all sc_inc NULL
sc sc\prj get - all sc_prj NULL
@@ -9,7 +9,6 @@ sc sc\res\imglst\apptbx get - all sc_resap NULL
sc sc\source\core\inc get - all sc_coinc NULL
sc sc\source\ui\inc get - all sc_uiinc NULL
sc sc\source\filter\inc get - all sc_fiinc NULL
-sc sc\addin\inc get - all sc_adinc NULL
sc sc\sdi nmake - all sc_sdi sc_inc NULL
sc sc\source\core\data nmake - all sc_data sc_sdi sc_inc NULL
sc sc\source\core\src nmake - all sc_cosrc sc_sdi sc_inc NULL
@@ -43,15 +42,5 @@ sc sc\source\filter\rtf nmake - all sc_rtf sc_sdi sc_inc NULL
sc sc\source\filter\html nmake - all sc_html sc_sdi sc_inc NULL
sc sc\source\filter\xml nmake - all sc_xml sc_sdi sc_inc NULL
sc sc\source\filter\xcl97 nmake - all sc_xcl97 sc_sdi sc_inc NULL
-sc sc\addin nmake - all sc_add sc_sdi sc_inc NULL
-sc sc\addin\datefunc nmake - all sc_addfu sc_add sc_sdi sc_inc NULL
-sc sc\addin\rot13 nmake - all sc_adrot sc_add sc_sdi sc_inc NULL
-sc sc\addin\util nmake - all sc_adutil sc_addfu sc_adrot sc_sdi sc_inc NULL
-sc sc\util nmake - all sc_util sc_addfu sc_adrot sc_adutil sc_app sc_attr sc_cctrl sc_cosrc sc_data sc_dbgui sc_dif sc_docsh sc_drfnc sc_excel sc_form sc_html sc_lotus sc_qpro sc_misc sc_name sc_nvipi sc_opt sc_page sc_rtf sc_scalc sc_style sc_tool sc_uisrc sc_undo sc_unobj sc_view sc_xcl97 sc_xml sc_acc sc_ftools sc_inc sc_vba NULL
-
-# remarked due to the fact, key press is need in this test.
-# sc sc\qa\complex\calcPreview nmake - all qa_calcpreview NULL
-
-sc sc\qa\complex\cellRanges nmake - all qa_cellranges sc_util NULL
-#sc sc\qa\complex\dataPilot nmake - all qa_datapilot qa_datapilot_ifacetst_beans qa_datapilot_ifacetst_container qa_datapilot_ifacetst_sheet sc_util NULL
-sc sc\qa\complex\sc nmake - all qa_sc sc_util NULL
+sc sc\util nmake - all sc_util sc_app sc_attr sc_cctrl sc_cosrc sc_data sc_dbgui sc_dif sc_docsh sc_drfnc sc_excel sc_form sc_html sc_lotus sc_qpro sc_misc sc_name sc_nvipi sc_opt sc_page sc_rtf sc_scalc sc_style sc_tool sc_uisrc sc_undo sc_unobj sc_view sc_xcl97 sc_xml sc_acc sc_ftools sc_inc sc_vba NULL
+sc sc\qa\unit nmake - all sc_qa_cppunit sc_util NULL
diff --git a/sc/qa/complex/sc/CalcRTL.java b/sc/qa/complex/sc/CalcRTL.java
index c9fad2fec9c5..0abeb8abfca0 100644
--- a/sc/qa/complex/sc/CalcRTL.java
+++ b/sc/qa/complex/sc/CalcRTL.java
@@ -340,7 +340,7 @@ public class CalcRTL /* extends ComplexTestCase */
worked = checkResult(set, pName, oldValue, pValue, resValue,
exception);
} catch (Exception e) {
- System.out.println("Exception occured while testing property '" +
+ System.out.println("Exception occurred while testing property '" +
pName + "'");
e.printStackTrace();
worked = false;
diff --git a/sc/qa/unit/CVE/CVE-2007-5745-1.wb2 b/sc/qa/unit/CVE/CVE-2007-5745-1.wb2
new file mode 100644
index 000000000000..0ba60b26cda7
--- /dev/null
+++ b/sc/qa/unit/CVE/CVE-2007-5745-1.wb2
Binary files differ
diff --git a/sc/qa/unit/CVE/CVE-2007-5745-2.wb2 b/sc/qa/unit/CVE/CVE-2007-5745-2.wb2
new file mode 100644
index 000000000000..8a9eca970532
--- /dev/null
+++ b/sc/qa/unit/CVE/CVE-2007-5745-2.wb2
Binary files differ
diff --git a/sc/qa/unit/CVE/CVE-2007-5747-1.wb2 b/sc/qa/unit/CVE/CVE-2007-5747-1.wb2
new file mode 100644
index 000000000000..ca91826b9be9
--- /dev/null
+++ b/sc/qa/unit/CVE/CVE-2007-5747-1.wb2
Binary files differ
diff --git a/sc/qa/unit/makefile.mk b/sc/qa/unit/makefile.mk
new file mode 100644
index 000000000000..335a8b7bc70b
--- /dev/null
+++ b/sc/qa/unit/makefile.mk
@@ -0,0 +1,119 @@
+# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# Novell, Inc.
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Contributor(s): Michael Meeks <michael.meeks@novell.com>
+# Caolan McNamara <caolanm@redhat.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#
+
+PRJ=..$/..
+PRJNAME=sc
+TARGET=qa_unit
+
+ENABLE_EXCEPTIONS=TRUE
+
+.INCLUDE : settings.mk
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS) -I../../source/ui/inc
+
+SHL1TARGET = $(TARGET)
+SHL1OBJS = $(SLO)$/ucalc.obj
+SHL1STDLIBS= \
+ $(BASICLIB) \
+ $(SFXLIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(SVXCORELIB) \
+ $(EDITENGLIB) \
+ $(SVXLIB) \
+ $(BASEGFXLIB) \
+ $(DRAWINGLAYERLIB) \
+ $(VCLLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(COMPHELPERLIB) \
+ $(UCBHELPERLIB) \
+ $(TKLIB) \
+ $(VOSLIB) \
+ $(SALLIB) \
+ $(SALHELPERLIB) \
+ $(TOOLSLIB) \
+ $(I18NISOLANGLIB) \
+ $(UNOTOOLSLIB) \
+ $(SOTLIB) \
+ $(XMLOFFLIB) \
+ $(AVMEDIALIB) \
+ $(FORLIB) \
+ $(FORUILIB) \
+ $(CPPUNITLIB)
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1LIBS=$(SLB)$/scalc3.lib $(SLB)$/scalc3c.lib
+DEF1NAME = $(SHL1TARGET)
+SHL1VERSIONMAP=version.map
+
+.INCLUDE: target.mk
+
+.IF "$(OS)" == "WNT"
+my_file = file:///
+.ELSE
+my_file = file://
+.END
+
+ALLTAR: test
+
+$(MISC)$/$(TARGET)$/types.rdb .ERRREMOVE : $(SOLARBINDIR)$/types.rdb
+ $(MKDIRHIER) $(@:d)
+ $(GNUCOPY) $? $@
+
+$(MISC)/$(TARGET)/udkapi.rdb .ERRREMOVE : $(SOLARBINDIR)$/udkapi.rdb
+ $(MKDIRHIER) $(@:d)
+ $(GNUCOPY) $? $@
+
+#Make a services.rdb with the services we know we need to get up and running
+$(MISC)/$(TARGET)/services.rdb .ERRREMOVE : $(MISC)/$(TARGET)/udkapi.rdb makefile.mk
+ $(MKDIRHIER) $(@:d)
+ $(REGCOMP) -register -br $(MISC)/$(TARGET)/udkapi.rdb -r $@ -wop \
+ -c $(DLLPRE)fwk$(DLLPOSTFIX)$(DLLPOST) \
+ -c $(DLLPRE)sfx$(DLLPOSTFIX)$(DLLPOST) \
+ -c $(DLLPRE)ucb1$(DLLPOST) \
+ -c $(DLLPRE)ucpfile1$(DLLPOST) \
+ -c $(DLLPRE)unoxml$(DLLPOSTFIX)$(DLLPOST) \
+ -c stocservices.uno$(DLLPOST) \
+ -c i18npool.uno$(DLLPOST)
+
+#Tweak things so that we use the .res files in the solver
+STAR_RESOURCEPATH:=$(PWD)/$(BIN)$(PATH_SEPERATOR)$(SOLARBINDIR)
+.EXPORT : STAR_RESOURCEPATH
+
+test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb $(MISC)$/$(TARGET)$/types.rdb $(MISC)/$(TARGET)/udkapi.rdb
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#1 on library $(SHL1TARGETN)
+ @echo In the environment: STAR_RESOURCEPATH=$$STAR_RESOURCEPATH
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL1TARGETN) -headless -invisible \
+ -env:UNO_SERVICES=$(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb \
+ -env:UNO_TYPES="$(my_file)$(PWD)/$(MISC)/$(TARGET)/types.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/udkapi.rdb" \
+ -env:OOO_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \
+ -env:BRAND_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \
+ -env:UNO_USER_PACKAGES_CACHE="$(my_file)$(PWD)/$(MISC)/$(TARGET)"
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
new file mode 100644
index 000000000000..9aaf2e3321ae
--- /dev/null
+++ b/sc/qa/unit/ucalc.cxx
@@ -0,0 +1,1361 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell, Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Michael Meeks <michael.meeks@novell.com>
+ * Kohei Yoshida <kyoshida@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// TODO ...
+// officecfg: can we move this into our skeleton ?
+// Solve the Setup.xcu problem pleasantly [ custom version ? ]
+// deliver.pl
+// don't call regcomp if we don't have it.
+// In an ideal world
+// a) scp2 goes away and logic moved into the deliver d.lst
+// b) install set gets built incrementally as the build progresses
+// c) the new .xml component registration stuff then removes
+// the need for manually calling regcomp and knowing what
+// services we need, and in what .so they are implemented
+
+#include "precompiled_sc.hxx"
+
+#ifdef WNT
+# include <prewin.h>
+# include <postwin.h>
+# undef ERROR
+#endif
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+
+#include <sal/config.h>
+#include <osl/file.hxx>
+#include <osl/process.h>
+
+#include <cppuhelper/bootstrap.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/oslfile2streamwrap.hxx>
+
+#include <vcl/svapp.hxx>
+#include "scdll.hxx"
+#include "document.hxx"
+#include "stringutil.hxx"
+#include "scmatrix.hxx"
+#include "drwlayer.hxx"
+
+#include "docsh.hxx"
+#include "funcdesc.hxx"
+
+#include "dpshttab.hxx"
+#include "dpobject.hxx"
+#include "dpsave.hxx"
+
+#include "formula/IFunctionDescription.hxx"
+
+#include <svx/svdograf.hxx>
+#include <svx/svdpage.hxx>
+
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
+
+#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
+#include <com/sun/star/sheet/GeneralFunction.hpp>
+
+#include <ucbhelper/contentbroker.hxx>
+
+#include <iostream>
+#include <vector>
+
+#define MDDS_HASH_CONTAINER_BOOST 1
+#include <mdds/mixed_type_matrix.hpp>
+
+#define UCALC_DEBUG_OUTPUT 0
+
+using namespace ::com::sun::star;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+using ::std::cout;
+using ::std::cerr;
+using ::std::endl;
+using ::std::vector;
+
+namespace {
+
+::std::ostream& operator<< (::std::ostream& os, const OUString& str)
+{
+ return os << ::rtl::OUStringToOString(str, RTL_TEXTENCODING_UTF8).getStr();
+}
+
+/**
+ * Print nicely formatted sheet content to stdout. Indispensable when
+ * debugging the unit test code involving testing of sheet contents.
+ */
+class SheetPrinter
+{
+ typedef ::mdds::mixed_type_matrix<OUString, bool> MatrixType;
+public:
+ SheetPrinter(size_t rows, size_t cols) :
+ maMatrix(rows, cols, ::mdds::matrix_density_sparse_empty) {}
+
+ void set(size_t row, size_t col, const OUString& aStr)
+ {
+ maMatrix.set_string(row, col, new OUString(aStr));
+ }
+
+#if UCALC_DEBUG_OUTPUT
+ void print(const char* header) const
+ {
+ if (header)
+ cout << header << endl;
+
+ MatrixType::size_pair_type ns = maMatrix.size();
+ vector<sal_Int32> aColWidths(ns.second, 0);
+
+ // Calculate column widths first.
+ for (size_t row = 0; row < ns.first; ++row)
+ {
+ for (size_t col = 0; col < ns.second; ++col)
+ {
+ const OUString* p = maMatrix.get_string(row, col);
+ if (aColWidths[col] < p->getLength())
+ aColWidths[col] = p->getLength();
+ }
+ }
+
+ // Make the row separator string.
+ OUStringBuffer aBuf;
+ aBuf.appendAscii("+");
+ for (size_t col = 0; col < ns.second; ++col)
+ {
+ aBuf.appendAscii("-");
+ for (sal_Int32 i = 0; i < aColWidths[col]; ++i)
+ aBuf.append(sal_Unicode('-'));
+ aBuf.appendAscii("-+");
+ }
+
+ OUString aSep = aBuf.makeStringAndClear();
+
+ // Now print to stdout.
+ cout << aSep << endl;
+ for (size_t row = 0; row < ns.first; ++row)
+ {
+ cout << "| ";
+ for (size_t col = 0; col < ns.second; ++col)
+ {
+ const OUString* p = maMatrix.get_string(row, col);
+ size_t nPadding = aColWidths[col] - p->getLength();
+ aBuf.append(*p);
+ for (size_t i = 0; i < nPadding; ++i)
+ aBuf.append(sal_Unicode(' '));
+ cout << aBuf.makeStringAndClear() << " | ";
+ }
+ cout << endl;
+ cout << aSep << endl;
+ }
+ }
+#else
+ void print(const char*) const {}
+#endif
+
+ /**
+ * Print nested string array which can be copy-n-pasted into the test code
+ * for content verification.
+ */
+ void printArray() const
+ {
+#if UCALC_DEBUG_OUTPUT
+ MatrixType::size_pair_type ns = maMatrix.size();
+ for (size_t row = 0; row < ns.first; ++row)
+ {
+ cout << " { ";
+ for (size_t col = 0; col < ns.second; ++col)
+ {
+ const OUString* p = maMatrix.get_string(row, col);
+ if (p->getLength())
+ cout << "\"" << *p << "\"";
+ else
+ cout << "0";
+ if (col < ns.second - 1)
+ cout << ", ";
+ }
+ cout << " }";
+ if (row < ns.first - 1)
+ cout << ",";
+ cout << endl;
+ }
+#endif
+ }
+
+ void clear() { maMatrix.clear(); }
+ void resize(size_t rows, size_t cols) { maMatrix.resize(rows, cols); }
+
+private:
+ MatrixType maMatrix;
+};
+
+class Test : public CppUnit::TestFixture {
+public:
+ Test();
+ ~Test();
+
+ virtual void setUp();
+ virtual void tearDown();
+
+ bool testLoad(const rtl::OUString &rFilter, const rtl::OUString &rURL);
+
+ void testCollator();
+ void testInput();
+ void testSUM();
+ void testVolatileFunc();
+ void testNamedRange();
+ void testCSV();
+ void testMatrix();
+ void testDataPilot();
+ void testSheetCopy();
+
+ /**
+ * Make sure the sheet streams are invalidated properly.
+ */
+ void testStreamValid();
+
+ /**
+ * Test built-in cell functions to make sure their categories and order
+ * are correct.
+ */
+ void testFunctionLists();
+
+ void testGraphicsInGroup();
+
+ /**
+ * Ensure CVEs remain unbroken
+ */
+ void testCVEs();
+
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(testCollator);
+ CPPUNIT_TEST(testInput);
+ CPPUNIT_TEST(testSUM);
+ CPPUNIT_TEST(testVolatileFunc);
+ CPPUNIT_TEST(testNamedRange);
+ CPPUNIT_TEST(testCSV);
+ CPPUNIT_TEST(testMatrix);
+ CPPUNIT_TEST(testDataPilot);
+ CPPUNIT_TEST(testSheetCopy);
+ CPPUNIT_TEST(testGraphicsInGroup);
+ CPPUNIT_TEST(testStreamValid);
+ CPPUNIT_TEST(testFunctionLists);
+ CPPUNIT_TEST(testCVEs);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ uno::Reference< uno::XComponentContext > m_xContext;
+ ScDocument *m_pDoc;
+ ScDocShellRef m_xDocShRef;
+ ::rtl::OUString m_aPWDURL;
+};
+
+Test::Test()
+ : m_pDoc(0)
+{
+ m_xContext = cppu::defaultBootstrap_InitialComponentContext();
+
+ uno::Reference<lang::XMultiComponentFactory> xFactory(m_xContext->getServiceManager());
+ uno::Reference<lang::XMultiServiceFactory> xSM(xFactory, uno::UNO_QUERY_THROW);
+
+ //Without this we're crashing because callees are using
+ //getProcessServiceFactory. In general those should be removed in favour
+ //of retaining references to the root ServiceFactory as its passed around
+ comphelper::setProcessServiceFactory(xSM);
+
+ // initialise UCB-Broker
+ uno::Sequence<uno::Any> aUcbInitSequence(2);
+ aUcbInitSequence[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local"));
+ aUcbInitSequence[1] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office"));
+ bool bInitUcb = ucbhelper::ContentBroker::initialize(xSM, aUcbInitSequence);
+ CPPUNIT_ASSERT_MESSAGE("Should be able to initialize UCB", bInitUcb);
+
+ uno::Reference<ucb::XContentProviderManager> xUcb =
+ ucbhelper::ContentBroker::get()->getContentProviderManagerInterface();
+ uno::Reference<ucb::XContentProvider> xFileProvider(xSM->createInstance(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider"))), uno::UNO_QUERY);
+ xUcb->registerContentProvider(xFileProvider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True);
+
+ InitVCL(xSM);
+
+ ScDLL::Init();
+
+ oslProcessError err = osl_getProcessWorkingDir(&m_aPWDURL.pData);
+ CPPUNIT_ASSERT_MESSAGE("no PWD!", err == osl_Process_E_None);
+}
+
+void Test::setUp()
+{
+ m_xDocShRef = new ScDocShell(
+ SFXMODEL_STANDARD |
+ SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
+ SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+
+ m_pDoc = m_xDocShRef->GetDocument();
+}
+
+void Test::tearDown()
+{
+ m_xDocShRef.Clear();
+}
+
+Test::~Test()
+{
+ uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose();
+}
+
+void Test::testCollator()
+{
+ OUString s1(RTL_CONSTASCII_USTRINGPARAM("A"));
+ OUString s2(RTL_CONSTASCII_USTRINGPARAM("B"));
+ CollatorWrapper* p = ScGlobal::GetCollator();
+ sal_Int32 nRes = p->compareString(s1, s2);
+ CPPUNIT_ASSERT_MESSAGE("these strings are supposed to be different!", nRes != 0);
+}
+
+void Test::testInput()
+{
+ rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("foo"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
+ m_pDoc->InsertTab (0, aTabName));
+
+ OUString numstr(RTL_CONSTASCII_USTRINGPARAM("'10.5"));
+ OUString str(RTL_CONSTASCII_USTRINGPARAM("'apple'"));
+ OUString test;
+
+ m_pDoc->SetString(0, 0, 0, numstr);
+ m_pDoc->GetString(0, 0, 0, test);
+ bool bTest = test.equalsAscii("10.5");
+ CPPUNIT_ASSERT_MESSAGE("String number should have the first apostrophe stripped.", bTest);
+ m_pDoc->SetString(0, 0, 0, str);
+ m_pDoc->GetString(0, 0, 0, test);
+ bTest = test.equalsAscii("'apple'");
+ CPPUNIT_ASSERT_MESSAGE("Text content should have retained the first apostrophe.", bTest);
+
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testSUM()
+{
+ rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("foo"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
+ m_pDoc->InsertTab (0, aTabName));
+ double val = 1;
+ m_pDoc->SetValue (0, 0, 0, val);
+ m_pDoc->SetValue (0, 1, 0, val);
+ m_pDoc->SetString (0, 2, 0, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=SUM(A1:A2)")));
+ m_pDoc->CalcAll();
+ double result;
+ m_pDoc->GetValue (0, 2, 0, result);
+ CPPUNIT_ASSERT_MESSAGE ("calculation failed", result == 2.0);
+
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testVolatileFunc()
+{
+ rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("foo"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
+ m_pDoc->InsertTab (0, aTabName));
+
+ double val = 1;
+ m_pDoc->SetValue(0, 0, 0, val);
+ m_pDoc->SetString(0, 1, 0, OUString(RTL_CONSTASCII_USTRINGPARAM("=IF(A1>0;NOW();0")));
+ double now1;
+ m_pDoc->GetValue(0, 1, 0, now1);
+ CPPUNIT_ASSERT_MESSAGE("Value of NOW() should be positive.", now1 > 0.0);
+
+ val = 0;
+ m_pDoc->SetValue(0, 0, 0, val);
+ m_xDocShRef->DoRecalc(true);
+ double zero;
+ m_pDoc->GetValue(0, 1, 0, zero);
+ CPPUNIT_ASSERT_MESSAGE("Result should equal the 3rd parameter of IF, which is zero.", zero == 0.0);
+
+ val = 1;
+ m_pDoc->SetValue(0, 0, 0, val);
+ m_xDocShRef->DoRecalc(true);
+ double now2;
+ m_pDoc->GetValue(0, 1, 0, now2);
+ CPPUNIT_ASSERT_MESSAGE("Result should be the value of NOW() again.", (now2 - now1) >= 0.0);
+
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testNamedRange()
+{
+ rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("Sheet1"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
+ m_pDoc->InsertTab (0, aTabName));
+
+ m_pDoc->SetValue (0, 0, 0, 101);
+
+ ScAddress aA1(0, 0, 0);
+ ScRangeName* pNewRanges = new ScRangeName();
+ ScRangeData* pNew = new ScRangeData(m_pDoc,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Divisor")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$Sheet1.$A$1:$A$1048576")), aA1, 0, formula::FormulaGrammar::GRAM_PODF_A1);
+ bool bSuccess = pNewRanges->insert(pNew);
+ CPPUNIT_ASSERT_MESSAGE ("insertion failed", bSuccess);
+
+ m_pDoc->SetRangeName(pNewRanges);
+
+ m_pDoc->SetString (1, 0, 0, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=A1/Divisor")));
+
+ m_pDoc->CalcAll();
+ double result;
+ m_pDoc->GetValue (1, 0, 0, result);
+ CPPUNIT_ASSERT_MESSAGE ("calculation failed", result == 1.0);
+
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testCSV()
+{
+ const int English = 0, European = 1;
+ struct {
+ const char *pStr; int eSep; bool bResult; double nValue;
+ } aTests[] = {
+ { "foo", English, false, 0.0 },
+ { "1.0", English, true, 1.0 },
+ { "1,0", English, false, 0.0 },
+ { "1.0", European, false, 0.0 },
+ { "1.000", European, true, 1000.0 },
+ { "1,000", European, true, 1.0 },
+ { "1.000", English, true, 1.0 },
+ { "1,000", English, true, 1000.0 },
+ { " 1.0", English, true, 1.0 },
+ { " 1.0 ", English, true, 1.0 },
+ { "1.0 ", European, false, 0.0 },
+ { "1.000", European, true, 1000.0 },
+ { "1137.999", English, true, 1137.999 },
+ { "1.000.00", European, false, 0.0 }
+ };
+ for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(aTests); i++) {
+ rtl::OUString aStr(aTests[i].pStr, strlen (aTests[i].pStr), RTL_TEXTENCODING_UTF8);
+ double nValue = 0.0;
+ bool bResult = ScStringUtil::parseSimpleNumber
+ (aStr, aTests[i].eSep == English ? '.' : ',',
+ aTests[i].eSep == English ? ',' : '.',
+ nValue);
+ CPPUNIT_ASSERT_MESSAGE ("CSV numeric detection failure", bResult == aTests[i].bResult);
+ CPPUNIT_ASSERT_MESSAGE ("CSV numeric value failure", nValue == aTests[i].nValue);
+ }
+}
+
+bool Test::testLoad(const rtl::OUString &rFilter, const rtl::OUString &rURL)
+{
+ SfxFilter aFilter(
+ rFilter,
+ rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(),
+ rtl::OUString(), rtl::OUString() );
+
+ ScDocShellRef xDocShRef = new ScDocShell;
+ SfxMedium aSrcMed(rURL, STREAM_STD_READ, true);
+ aSrcMed.SetFilter(&aFilter);
+ return xDocShRef->DoLoad(&aSrcMed);
+}
+
+void Test::testCVEs()
+{
+ bool bResult;
+
+ bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Quattro Pro 6.0")),
+ m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2007-5745-1.wb2")));
+ CPPUNIT_ASSERT_MESSAGE("CVE-2007-5745 regression", bResult == true);
+
+ bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Quattro Pro 6.0")),
+ m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2007-5745-2.wb2")));
+ CPPUNIT_ASSERT_MESSAGE("CVE-2007-5745 regression", bResult == true);
+
+ bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Quattro Pro 6.0")),
+ m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2007-5747-1.wb2")));
+ CPPUNIT_ASSERT_MESSAGE("CVE-2007-5747 regression", bResult == false);
+}
+
+template<typename Evaluator>
+void checkMatrixElements(const ScMatrix& rMat)
+{
+ SCSIZE nC, nR;
+ rMat.GetDimensions(nC, nR);
+ Evaluator aEval;
+ for (SCSIZE i = 0; i < nC; ++i)
+ {
+ for (SCSIZE j = 0; j < nR; ++j)
+ {
+ aEval(i, j, rMat.Get(i, j));
+ }
+ }
+}
+
+struct AllZeroMatrix
+{
+ void operator() (SCSIZE /*nCol*/, SCSIZE /*nRow*/, const ScMatrixValue& rVal) const
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of numeric type", rVal.nType == SC_MATVAL_VALUE);
+ CPPUNIT_ASSERT_MESSAGE("element value must be zero", rVal.fVal == 0.0);
+ }
+};
+
+struct PartiallyFilledZeroMatrix
+{
+ void operator() (SCSIZE nCol, SCSIZE nRow, const ScMatrixValue& rVal) const
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of numeric type", rVal.nType == SC_MATVAL_VALUE);
+ if (1 <= nCol && nCol <= 2 && 2 <= nRow && nRow <= 8)
+ {
+ CPPUNIT_ASSERT_MESSAGE("element value must be 3.0", rVal.fVal == 3.0);
+ }
+ else
+ {
+ CPPUNIT_ASSERT_MESSAGE("element value must be zero", rVal.fVal == 0.0);
+ }
+ }
+};
+
+struct AllEmptyMatrix
+{
+ void operator() (SCSIZE /*nCol*/, SCSIZE /*nRow*/, const ScMatrixValue& rVal) const
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of empty type", rVal.nType == SC_MATVAL_EMPTY);
+ CPPUNIT_ASSERT_MESSAGE("value of \"empty\" element is expected to be zero", rVal.fVal == 0.0);
+ }
+};
+
+struct PartiallyFilledEmptyMatrix
+{
+ void operator() (SCSIZE nCol, SCSIZE nRow, const ScMatrixValue& rVal) const
+ {
+ if (nCol == 1 && nRow == 1)
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of boolean type", rVal.nType == SC_MATVAL_BOOLEAN);
+ CPPUNIT_ASSERT_MESSAGE("element value is not what is expected", rVal.fVal == 1.0);
+ }
+ else if (nCol == 4 && nRow == 5)
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of value type", rVal.nType == SC_MATVAL_VALUE);
+ CPPUNIT_ASSERT_MESSAGE("element value is not what is expected", rVal.fVal == -12.5);
+ }
+ else if (nCol == 8 && nRow == 2)
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of value type", rVal.nType == SC_MATVAL_STRING);
+ CPPUNIT_ASSERT_MESSAGE("element value is not what is expected", rVal.pS->EqualsAscii("Test"));
+ }
+ else if (nCol == 8 && nRow == 11)
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of empty path type", rVal.nType == SC_MATVAL_EMPTYPATH);
+ CPPUNIT_ASSERT_MESSAGE("value of \"empty\" element is expected to be zero", rVal.fVal == 0.0);
+ }
+ else
+ {
+ CPPUNIT_ASSERT_MESSAGE("element is not of empty type", rVal.nType == SC_MATVAL_EMPTY);
+ CPPUNIT_ASSERT_MESSAGE("value of \"empty\" element is expected to be zero", rVal.fVal == 0.0);
+ }
+ }
+};
+
+void Test::testMatrix()
+{
+ ScMatrixRef pMat;
+ ScMatrix::DensityType eDT[2];
+
+ // First, test the zero matrix types.
+ eDT[0] = ScMatrix::FILLED_ZERO;
+ eDT[1] = ScMatrix::SPARSE_ZERO;
+ for (int i = 0; i < 2; ++i)
+ {
+ pMat = new ScMatrix(0, 0, eDT[i]);
+ SCSIZE nC, nR;
+ pMat->GetDimensions(nC, nR);
+ CPPUNIT_ASSERT_MESSAGE("matrix is not empty", nC == 0 && nR == 0);
+ pMat->Resize(4, 10);
+ pMat->GetDimensions(nC, nR);
+ CPPUNIT_ASSERT_MESSAGE("matrix size is not as expected", nC == 4 && nR == 10);
+ CPPUNIT_ASSERT_MESSAGE("both 'and' and 'or' should evaluate to false",
+ !pMat->And() && !pMat->Or());
+
+ // Resizing into a larger matrix should fill the void space with zeros.
+ checkMatrixElements<AllZeroMatrix>(*pMat);
+
+ pMat->FillDouble(3.0, 1, 2, 2, 8);
+ checkMatrixElements<PartiallyFilledZeroMatrix>(*pMat);
+ CPPUNIT_ASSERT_MESSAGE("matrix is expected to be numeric", pMat->IsNumeric());
+ CPPUNIT_ASSERT_MESSAGE("partially non-zero matrix should evaluate false on 'and' and true on 'or",
+ !pMat->And() && pMat->Or());
+ pMat->FillDouble(5.0, 0, 0, nC-1, nR-1);
+ CPPUNIT_ASSERT_MESSAGE("fully non-zero matrix should evaluate true both on 'and' and 'or",
+ pMat->And() && pMat->Or());
+ }
+
+ // Now test the emtpy matrix types.
+ eDT[0] = ScMatrix::FILLED_EMPTY;
+ eDT[1] = ScMatrix::SPARSE_EMPTY;
+ for (int i = 0; i < 2; ++i)
+ {
+ pMat = new ScMatrix(10, 20, eDT[i]);
+ SCSIZE nC, nR;
+ pMat->GetDimensions(nC, nR);
+ CPPUNIT_ASSERT_MESSAGE("matrix size is not as expected", nC == 10 && nR == 20);
+ checkMatrixElements<AllEmptyMatrix>(*pMat);
+
+ pMat->PutBoolean(true, 1, 1);
+ pMat->PutDouble(-12.5, 4, 5);
+ rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("Test"));
+ pMat->PutString(aStr, 8, 2);
+ pMat->PutEmptyPath(8, 11);
+ checkMatrixElements<PartiallyFilledEmptyMatrix>(*pMat);
+ }
+}
+
+void Test::testDataPilot()
+{
+ m_pDoc->InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM("Data")));
+ m_pDoc->InsertTab(1, OUString(RTL_CONSTASCII_USTRINGPARAM("Table")));
+
+ // Dimension definition
+ struct {
+ const char* pName; sheet::DataPilotFieldOrientation eOrient;
+ } aFields[] = {
+ { "Name", sheet::DataPilotFieldOrientation_ROW },
+ { "Group", sheet::DataPilotFieldOrientation_COLUMN },
+ { "Score", sheet::DataPilotFieldOrientation_DATA }
+ };
+
+ // Raw data
+ struct {
+ const char* pName; const char* pGroup; int nScore;
+ } aData[] = {
+ { "Andy", "A", 30 },
+ { "Bruce", "A", 20 },
+ { "Charlie", "B", 45 },
+ { "David", "B", 12 },
+ { "Edward", "C", 8 },
+ { "Frank", "C", 15 },
+ };
+
+ // Expected output table content. 0 = empty cell
+ const char* aOutputCheck[][5] = {
+ { "Sum - Score", "Group", 0, 0, 0 },
+ { "Name", "A", "B", "C", "Total Result" },
+ { "Andy", "30", 0, 0, "30" },
+ { "Bruce", "20", 0, 0, "20" },
+ { "Charlie", 0, "45", 0, "45" },
+ { "David", 0, "12", 0, "12" },
+ { "Edward", 0, 0, "8", "8" },
+ { "Frank", 0, 0, "15", "15" },
+ { "Total Result", "50", "57", "23", "130" }
+ };
+
+ sal_uInt32 nFieldCount = SAL_N_ELEMENTS(aFields);
+ sal_uInt32 nDataCount = SAL_N_ELEMENTS(aData);
+
+ // Insert field names in row 0.
+ for (sal_uInt32 i = 0; i < nFieldCount; ++i)
+ m_pDoc->SetString(static_cast<SCCOL>(i), 0, 0, OUString(aFields[i].pName, strlen(aFields[i].pName), RTL_TEXTENCODING_UTF8));
+
+ // Insert data into row 1 and downward.
+ for (sal_uInt32 i = 0; i < nDataCount; ++i)
+ {
+ SCROW nRow = static_cast<SCROW>(i) + 1;
+ m_pDoc->SetString(0, nRow, 0, OUString(aData[i].pName, strlen(aData[i].pName), RTL_TEXTENCODING_UTF8));
+ m_pDoc->SetString(1, nRow, 0, OUString(aData[i].pGroup, strlen(aData[i].pGroup), RTL_TEXTENCODING_UTF8));
+ m_pDoc->SetValue(2, nRow, 0, aData[i].nScore);
+ }
+
+ SCROW nRow1 = 0, nRow2 = 0;
+ SCCOL nCol1 = 0, nCol2 = 0;
+ m_pDoc->GetDataArea(0, nCol1, nRow1, nCol2, nRow2, true, false);
+ CPPUNIT_ASSERT_MESSAGE("Data is expected to start from (col=0,row=0).", nCol1 == 0 && nRow1 == 0);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected data range.",
+ nCol2 == static_cast<SCCOL>(nFieldCount - 1) && nRow2 == static_cast<SCROW>(nDataCount));
+
+ SheetPrinter printer(nRow2 - nRow1 + 1, nCol2 - nCol1 + 1);
+ for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+ {
+ for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
+ {
+ String aVal;
+ m_pDoc->GetString(nCol, nRow, 0, aVal);
+ printer.set(nRow, nCol, aVal);
+ }
+ }
+ printer.print("Data sheet content");
+ printer.clear();
+
+ ScSheetSourceDesc aSheetDesc(m_pDoc);
+ aSheetDesc.SetSourceRange(ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0));
+ ScDPObject* pDPObj = new ScDPObject(m_pDoc);
+ pDPObj->SetSheetDesc(aSheetDesc);
+ pDPObj->SetOutRange(ScAddress(0, 0, 1));
+ ScPivotParam aParam;
+ pDPObj->FillOldParam(aParam, false);
+ for (sal_uInt32 i = 0; i < nFieldCount; ++i)
+ {
+ vector<ScDPLabelData::Member> aMembers;
+ pDPObj->GetMembers(i, 0, aMembers);
+ }
+
+ ScDPSaveData aSaveData;
+ // Set data pilot table output options.
+ aSaveData.SetIgnoreEmptyRows(false);
+ aSaveData.SetRepeatIfEmpty(false);
+ aSaveData.SetColumnGrand(true);
+ aSaveData.SetRowGrand(true);
+ aSaveData.SetFilterButton(false);
+ aSaveData.SetDrillDown(true);
+
+ // Check the sanity of the source range.
+ const ScRange& rSrcRange = aSheetDesc.GetSourceRange();
+ nCol1 = rSrcRange.aStart.Col();
+ nRow1 = rSrcRange.aStart.Row();
+ nRow2 = rSrcRange.aEnd.Row();
+ CPPUNIT_ASSERT_MESSAGE("source range contains no data!", nRow2 - nRow1 > 1);
+
+ // Set the dimension information.
+ for (sal_uInt32 i = 0; i < nFieldCount; ++i)
+ {
+ OUString aDimName(aFields[i].pName, strlen(aFields[i].pName), RTL_TEXTENCODING_UTF8);
+ ScDPSaveDimension* pDim = aSaveData.GetDimensionByName(aDimName);
+ pDim->SetOrientation(aFields[i].eOrient);
+ pDim->SetUsedHierarchy(0);
+ pDim->SetShowEmpty(true);
+
+ if (aFields[i].eOrient == sheet::DataPilotFieldOrientation_DATA)
+ {
+ pDim->SetFunction(sheet::GeneralFunction_SUM);
+ pDim->SetReferenceValue(NULL);
+ }
+ else
+ {
+ sheet::DataPilotFieldSortInfo aSortInfo;
+ aSortInfo.IsAscending = true;
+ aSortInfo.Mode = 2;
+ pDim->SetSortInfo(&aSortInfo);
+
+ sheet::DataPilotFieldLayoutInfo aLayInfo;
+ aLayInfo.LayoutMode = 0;
+ aLayInfo.AddEmptyLines = false;
+ pDim->SetLayoutInfo(&aLayInfo);
+ sheet::DataPilotFieldAutoShowInfo aShowInfo;
+ aShowInfo.IsEnabled = false;
+ aShowInfo.ShowItemsMode = 0;
+ aShowInfo.ItemCount = 0;
+ pDim->SetAutoShowInfo(&aShowInfo);
+
+// USHORT nFuncs[] = { sheet::GeneralFunction_AUTO };
+// pDim->SetSubTotals(1, nFuncs);
+ }
+
+ for (SCROW nRow = nRow1 + 1; nRow <= nRow2; ++nRow)
+ {
+ SCCOL nCol = nCol1 + static_cast<SCCOL>(i);
+ String aVal;
+ m_pDoc->GetString(nCol, nRow, 0, aVal);
+ // This call is just to populate the member list for each dimension.
+ ScDPSaveMember* pMem = pDim->GetMemberByName(aVal);
+ pMem->SetShowDetails(true);
+ pMem->SetIsVisible(true);
+ }
+ }
+
+ // Don't forget the data layout dimension.
+ ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension();
+ pDim->SetOrientation(sheet::DataPilotFieldOrientation_ROW);
+ pDim->SetShowEmpty(true);
+
+ pDPObj->SetSaveData(aSaveData);
+ pDPObj->SetAlive(true);
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+ bool bSuccess = pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_MESSAGE("failed to insert a new datapilot object into document", bSuccess);
+ CPPUNIT_ASSERT_MESSAGE("there should be only one data pilot table.",
+ pDPs->GetCount() == 1);
+ pDPObj->InvalidateData();
+ pDPObj->SetName(pDPs->CreateNewName());
+
+ bool bOverFlow = false;
+ ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
+ CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
+
+ pDPObj->Output(aOutRange.aStart);
+ aOutRange = pDPObj->GetOutRange();
+ const ScAddress& s = aOutRange.aStart;
+ const ScAddress& e = aOutRange.aEnd;
+ printer.resize(e.Row() - s.Row() + 1, e.Col() - s.Col() + 1);
+ SCROW nOutRowSize = SAL_N_ELEMENTS(aOutputCheck);
+ SCCOL nOutColSize = SAL_N_ELEMENTS(aOutputCheck[0]);
+ CPPUNIT_ASSERT_MESSAGE("Row size of the table output is not as expected.",
+ nOutRowSize == (e.Row()-s.Row()+1));
+ CPPUNIT_ASSERT_MESSAGE("Column size of the table output is not as expected.",
+ nOutColSize == (e.Col()-s.Col()+1));
+ for (SCROW nRow = 0; nRow < nOutRowSize; ++nRow)
+ {
+ for (SCCOL nCol = 0; nCol < nOutColSize; ++nCol)
+ {
+ String aVal;
+ m_pDoc->GetString(nCol + s.Col(), nRow + s.Row(), s.Tab(), aVal);
+ printer.set(nRow, nCol, aVal);
+ const char* p = aOutputCheck[nRow][nCol];
+ if (p)
+ {
+ OUString aCheckVal = OUString::createFromAscii(p);
+ bool bEqual = aCheckVal.equals(aVal);
+ if (!bEqual)
+ {
+ cerr << "Expected: " << aCheckVal << " Actual: " << aVal << endl;
+ CPPUNIT_ASSERT_MESSAGE("Unexpected cell content.", false);
+ }
+ }
+ else
+ CPPUNIT_ASSERT_MESSAGE("Empty cell expected.", aVal.Len() == 0);
+ }
+ }
+ printer.print("DataPilot table output");
+ printer.clear();
+
+ // Now, delete the datapilot object.
+ pDPs->FreeTable(pDPObj);
+ CPPUNIT_ASSERT_MESSAGE("There shouldn't be any data pilot table stored with the document.",
+ pDPs->GetCount() == 0);
+
+ m_pDoc->DeleteTab(1);
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testSheetCopy()
+{
+ OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("TestTab"));
+ m_pDoc->InsertTab(0, aTabName);
+ CPPUNIT_ASSERT_MESSAGE("document should have one sheet to begin with.", m_pDoc->GetTableCount() == 1);
+ SCROW nRow1, nRow2;
+ bool bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("new sheet should have all rows visible", !bHidden && nRow1 == 0 && nRow2 == MAXROW);
+
+ // Copy and test the result.
+ m_pDoc->CopyTab(0, 1);
+ CPPUNIT_ASSERT_MESSAGE("document now should have two sheets.", m_pDoc->GetTableCount() == 2);
+ bHidden = m_pDoc->RowHidden(0, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("copied sheet should also have all rows visible as the original.", !bHidden && nRow1 == 0 && nRow2 == MAXROW);
+ m_pDoc->DeleteTab(1);
+
+ m_pDoc->SetRowHidden(5, 10, 0, true);
+ bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 0 - 4 should be visible", !bHidden && nRow1 == 0 && nRow2 == 4);
+ bHidden = m_pDoc->RowHidden(5, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 5 - 10 should be hidden", bHidden && nRow1 == 5 && nRow2 == 10);
+ bHidden = m_pDoc->RowHidden(11, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 11 - maxrow should be visible", !bHidden && nRow1 == 11 && nRow2 == MAXROW);
+
+ // Copy the sheet once again.
+ m_pDoc->CopyTab(0, 1);
+ CPPUNIT_ASSERT_MESSAGE("document now should have two sheets.", m_pDoc->GetTableCount() == 2);
+ bHidden = m_pDoc->RowHidden(0, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 0 - 4 should be visible", !bHidden && nRow1 == 0 && nRow2 == 4);
+ bHidden = m_pDoc->RowHidden(5, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 5 - 10 should be hidden", bHidden && nRow1 == 5 && nRow2 == 10);
+ bHidden = m_pDoc->RowHidden(11, 1, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("rows 11 - maxrow should be visible", !bHidden && nRow1 == 11 && nRow2 == MAXROW);
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testStreamValid()
+{
+ m_pDoc->InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM("Sheet1")));
+ m_pDoc->InsertTab(1, OUString(RTL_CONSTASCII_USTRINGPARAM("Sheet2")));
+ m_pDoc->InsertTab(2, OUString(RTL_CONSTASCII_USTRINGPARAM("Sheet3")));
+ m_pDoc->InsertTab(3, OUString(RTL_CONSTASCII_USTRINGPARAM("Sheet4")));
+ CPPUNIT_ASSERT_MESSAGE("We should have 4 sheet instances.", m_pDoc->GetTableCount() == 4);
+
+ OUString a1(RTL_CONSTASCII_USTRINGPARAM("A1"));
+ OUString a2(RTL_CONSTASCII_USTRINGPARAM("A2"));
+ OUString test;
+
+ // Put values into Sheet1.
+ m_pDoc->SetString(0, 0, 0, a1);
+ m_pDoc->SetString(0, 1, 0, a2);
+ m_pDoc->GetString(0, 0, 0, test);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet1.A1", test.equals(a1));
+ m_pDoc->GetString(0, 1, 0, test);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet1.A2", test.equals(a2));
+
+ // Put formulas into Sheet2 to Sheet4 to reference values from Sheet1.
+ m_pDoc->SetString(0, 0, 1, OUString(RTL_CONSTASCII_USTRINGPARAM("=Sheet1.A1")));
+ m_pDoc->SetString(0, 1, 1, OUString(RTL_CONSTASCII_USTRINGPARAM("=Sheet1.A2")));
+ m_pDoc->SetString(0, 0, 2, OUString(RTL_CONSTASCII_USTRINGPARAM("=Sheet1.A1")));
+ m_pDoc->SetString(0, 0, 3, OUString(RTL_CONSTASCII_USTRINGPARAM("=Sheet1.A2")));
+
+ m_pDoc->GetString(0, 0, 1, test);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet2.A1", test.equals(a1));
+ m_pDoc->GetString(0, 1, 1, test);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet2.A2", test.equals(a2));
+ m_pDoc->GetString(0, 0, 2, test);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet3.A1", test.equals(a1));
+ m_pDoc->GetString(0, 0, 3, test);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet3.A1", test.equals(a2));
+
+ // Set all sheet streams valid after all the initial cell values are in
+ // place. In reality we need to have real XML streams stored in order to
+ // claim they are valid, but we are just testing the flag values here.
+ m_pDoc->SetStreamValid(0, true);
+ m_pDoc->SetStreamValid(1, true);
+ m_pDoc->SetStreamValid(2, true);
+ m_pDoc->SetStreamValid(3, true);
+ CPPUNIT_ASSERT_MESSAGE("Stream is expected to be valid.", m_pDoc->IsStreamValid(0));
+ CPPUNIT_ASSERT_MESSAGE("Stream is expected to be valid.", m_pDoc->IsStreamValid(1));
+ CPPUNIT_ASSERT_MESSAGE("Stream is expected to be valid.", m_pDoc->IsStreamValid(2));
+ CPPUNIT_ASSERT_MESSAGE("Stream is expected to be valid.", m_pDoc->IsStreamValid(3));
+
+ // Now, insert a new row at row 2 position on Sheet1. This will move cell
+ // A2 downward but cell A1 remains unmoved.
+ m_pDoc->InsertRow(0, 0, MAXCOL, 0, 1, 2);
+ m_pDoc->GetString(0, 0, 0, test);
+ CPPUNIT_ASSERT_MESSAGE("Cell A1 should not have moved.", test.equals(a1));
+ m_pDoc->GetString(0, 3, 0, test);
+ CPPUNIT_ASSERT_MESSAGE("the old cell A2 should now be at A4.", test.equals(a2));
+ const ScBaseCell* pCell = m_pDoc->GetCell(ScAddress(0, 1, 0));
+ CPPUNIT_ASSERT_MESSAGE("Cell A2 should be empty.", pCell == NULL);
+ pCell = m_pDoc->GetCell(ScAddress(0, 2, 0));
+ CPPUNIT_ASSERT_MESSAGE("Cell A3 should be empty.", pCell == NULL);
+
+ // After the move, Sheet1, Sheet2, and Sheet4 should have their stream
+ // invalidated, whereas Sheet3's stream should still be valid.
+ CPPUNIT_ASSERT_MESSAGE("Stream should have been invalidated.", !m_pDoc->IsStreamValid(0));
+ CPPUNIT_ASSERT_MESSAGE("Stream should have been invalidated.", !m_pDoc->IsStreamValid(1));
+ CPPUNIT_ASSERT_MESSAGE("Stream should have been invalidated.", !m_pDoc->IsStreamValid(3));
+ CPPUNIT_ASSERT_MESSAGE("Stream should still be valid.", m_pDoc->IsStreamValid(2));
+
+ m_pDoc->DeleteTab(3);
+ m_pDoc->DeleteTab(2);
+ m_pDoc->DeleteTab(1);
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testFunctionLists()
+{
+ const char* aDataBase[] = {
+ "DAVERAGE",
+ "DCOUNT",
+ "DCOUNTA",
+ "DGET",
+ "DMAX",
+ "DMIN",
+ "DPRODUCT",
+ "DSTDEV",
+ "DSTDEVP",
+ "DSUM",
+ "DVAR",
+ "DVARP",
+ 0
+ };
+
+ const char* aDateTime[] = {
+ "DATE",
+ "DATEVALUE",
+ "DAY",
+ "DAYS",
+ "DAYS360",
+ "EASTERSUNDAY",
+ "HOUR",
+ "MINUTE",
+ "MONTH",
+ "NOW",
+ "SECOND",
+ "TIME",
+ "TIMEVALUE",
+ "TODAY",
+ "WEEKDAY",
+ "WEEKNUM",
+ "YEAR",
+ 0
+ };
+
+ const char* aFinancial[] = {
+ "CUMIPMT",
+ "CUMPRINC",
+ "DB",
+ "DDB",
+ "DURATION",
+ "EFFECTIVE",
+ "FV",
+ "IPMT",
+ "IRR",
+ "ISPMT",
+ "MIRR",
+ "NOMINAL",
+ "NPER",
+ "NPV",
+ "PMT",
+ "PPMT",
+ "PV",
+ "RATE",
+ "RRI",
+ "SLN",
+ "SYD",
+ "VDB",
+ 0
+ };
+
+ const char* aInformation[] = {
+ "CELL",
+ "CURRENT",
+ "FORMULA",
+ "INFO",
+ "ISBLANK",
+ "ISERR",
+ "ISERROR",
+ "ISFORMULA",
+ "ISLOGICAL",
+ "ISNA",
+ "ISNONTEXT",
+ "ISNUMBER",
+ "ISREF",
+ "ISTEXT",
+ "N",
+ "NA",
+ "TYPE",
+ 0
+ };
+
+ const char* aLogical[] = {
+ "AND",
+ "FALSE",
+ "IF",
+ "NOT",
+ "OR",
+ "TRUE",
+ 0
+ };
+
+ const char* aMathematical[] = {
+ "ABS",
+ "ACOS",
+ "ACOSH",
+ "ACOT",
+ "ACOTH",
+ "ASIN",
+ "ASINH",
+ "ATAN",
+ "ATAN2",
+ "ATANH",
+ "CEILING",
+ "COMBIN",
+ "COMBINA",
+ "CONVERT",
+ "COS",
+ "COSH",
+ "COT",
+ "COTH",
+ "COUNTBLANK",
+ "COUNTIF",
+ "DEGREES",
+ "EUROCONVERT",
+ "EVEN",
+ "EXP",
+ "FACT",
+ "FLOOR",
+ "GCD",
+ "INT",
+ "ISEVEN",
+ "ISODD",
+ "LCM",
+ "LN",
+ "LOG",
+ "LOG10",
+ "MOD",
+ "ODD",
+ "PI",
+ "POWER",
+ "PRODUCT",
+ "RADIANS",
+ "RAND",
+ "ROUND",
+ "ROUNDDOWN",
+ "ROUNDUP",
+ "SIGN",
+ "SIN",
+ "SINH",
+ "SQRT",
+ "SUBTOTAL",
+ "SUM",
+ "SUMIF",
+ "SUMSQ",
+ "TAN",
+ "TANH",
+ "TRUNC",
+ 0
+ };
+
+ const char* aArray[] = {
+ "FREQUENCY",
+ "GROWTH",
+ "LINEST",
+ "LOGEST",
+ "MDETERM",
+ "MINVERSE",
+ "MMULT",
+ "MUNIT",
+ "SUMPRODUCT",
+ "SUMX2MY2",
+ "SUMX2PY2",
+ "SUMXMY2",
+ "TRANSPOSE",
+ "TREND",
+ 0
+ };
+
+ const char* aStatistical[] = {
+ "AVEDEV",
+ "AVERAGE",
+ "AVERAGEA",
+ "B",
+ "BETADIST",
+ "BETAINV",
+ "BINOMDIST",
+ "CHIDIST",
+ "CHIINV",
+ "CHISQDIST",
+ "CHISQINV",
+ "CHITEST",
+ "CONFIDENCE",
+ "CORREL",
+ "COUNT",
+ "COUNTA",
+ "COVAR",
+ "CRITBINOM",
+ "DEVSQ",
+ "EXPONDIST",
+ "FDIST",
+ "FINV",
+ "FISHER",
+ "FISHERINV",
+ "FORECAST",
+ "FTEST",
+ "GAMMA",
+ "GAMMADIST",
+ "GAMMAINV",
+ "GAMMALN",
+ "GAUSS",
+ "GEOMEAN",
+ "HARMEAN",
+ "HYPGEOMDIST",
+ "INTERCEPT",
+ "KURT",
+ "LARGE",
+ "LOGINV",
+ "LOGNORMDIST",
+ "MAX",
+ "MAXA",
+ "MEDIAN",
+ "MIN",
+ "MINA",
+ "MODE",
+ "NEGBINOMDIST",
+ "NORMDIST",
+ "NORMINV",
+ "NORMSDIST",
+ "NORMSINV",
+ "PEARSON",
+ "PERCENTILE",
+ "PERCENTRANK",
+ "PERMUT",
+ "PERMUTATIONA",
+ "PHI",
+ "POISSON",
+ "PROB",
+ "QUARTILE",
+ "RANK",
+ "RSQ",
+ "SKEW",
+ "SLOPE",
+ "SMALL",
+ "STANDARDIZE",
+ "STDEV",
+ "STDEVA",
+ "STDEVP",
+ "STDEVPA",
+ "STEYX",
+ "TDIST",
+ "TINV",
+ "TRIMMEAN",
+ "TTEST",
+ "VAR",
+ "VARA",
+ "VARP",
+ "VARPA",
+ "WEIBULL",
+ "ZTEST",
+ 0
+ };
+
+ const char* aSpreadsheet[] = {
+ "ADDRESS",
+ "AREAS",
+ "CHOOSE",
+ "COLUMN",
+ "COLUMNS",
+ "DDE",
+ "ERRORTYPE",
+ "GETPIVOTDATA",
+ "HLOOKUP",
+ "HYPERLINK",
+ "INDEX",
+ "INDIRECT",
+ "LOOKUP",
+ "MATCH",
+ "OFFSET",
+ "ROW",
+ "ROWS",
+ "SHEET",
+ "SHEETS",
+ "STYLE",
+ "VLOOKUP",
+ 0
+ };
+
+ const char* aText[] = {
+ "ARABIC",
+ "ASC",
+ "BAHTTEXT",
+ "BASE",
+ "CHAR",
+ "CLEAN",
+ "CODE",
+ "CONCATENATE",
+ "DECIMAL",
+ "DOLLAR",
+ "EXACT",
+ "FIND",
+ "FIXED",
+ "JIS",
+ "LEFT",
+ "LEN",
+ "LOWER",
+ "MID",
+ "PROPER",
+ "REPLACE",
+ "REPT",
+ "RIGHT",
+ "ROMAN",
+ "SEARCH",
+ "SUBSTITUTE",
+ "T",
+ "TEXT",
+ "TRIM",
+ "UNICHAR",
+ "UNICODE",
+ "UPPER",
+ "VALUE",
+ 0
+ };
+
+ struct {
+ const char* Category; const char** Functions;
+ } aTests[] = {
+ { "Database", aDataBase },
+ { "Date&Time", aDateTime },
+ { "Financial", aFinancial },
+ { "Information", aInformation },
+ { "Logical", aLogical },
+ { "Mathematical", aMathematical },
+ { "Array", aArray },
+ { "Statistical", aStatistical },
+ { "Spreadsheet", aSpreadsheet },
+ { "Text", aText },
+ { "Add-in", 0 },
+ { 0, 0 }
+ };
+
+ ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
+ sal_uInt32 n = pFuncMgr->getCount();
+ for (sal_uInt32 i = 0; i < n; ++i)
+ {
+ const formula::IFunctionCategory* pCat = pFuncMgr->getCategory(i);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected category name", pCat->getName().equalsAscii(aTests[i].Category));
+ sal_uInt32 nFuncCount = pCat->getCount();
+ for (sal_uInt32 j = 0; j < nFuncCount; ++j)
+ {
+ const formula::IFunctionDescription* pFunc = pCat->getFunction(j);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected function name", pFunc->getFunctionName().equalsAscii(aTests[i].Functions[j]));
+ }
+ }
+}
+
+void Test::testGraphicsInGroup()
+{
+ OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("TestTab"));
+ m_pDoc->InsertTab(0, aTabName);
+ CPPUNIT_ASSERT_MESSAGE("document should have one sheet to begin with.", m_pDoc->GetTableCount() == 1);
+ SCROW nRow1, nRow2;
+ bool bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
+ CPPUNIT_ASSERT_MESSAGE("new sheet should have all rows visible", !bHidden && nRow1 == 0 && nRow2 == MAXROW);
+
+ m_pDoc->InitDrawLayer();
+ ScDrawLayer *pDrawLayer = m_pDoc->GetDrawLayer();
+ CPPUNIT_ASSERT_MESSAGE("must have a draw layer", pDrawLayer != NULL);
+ SdrPage* pPage = pDrawLayer->GetPage(0);
+ CPPUNIT_ASSERT_MESSAGE("must have a draw page", pPage != NULL);
+
+ //Add a square
+ Rectangle aOrigRect(2,2,100,100);
+ SdrRectObj *pObj = new SdrRectObj(aOrigRect);
+ pPage->InsertObject(pObj);
+ const Rectangle &rNewRect = pObj->GetLogicRect();
+ CPPUNIT_ASSERT_MESSAGE("must have equal position and size", aOrigRect == rNewRect);
+
+ ScDrawLayer::SetPageAnchored(*pObj);
+
+ //Use a range of rows guaranteed to include all of the square
+ m_pDoc->ShowRows(0, 100, 0, false);
+ CPPUNIT_ASSERT_MESSAGE("Should not change when page anchored", aOrigRect == rNewRect);
+ m_pDoc->ShowRows(0, 100, 0, true);
+ CPPUNIT_ASSERT_MESSAGE("Should not change when page anchored", aOrigRect == rNewRect);
+
+ ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0);
+ CPPUNIT_ASSERT_MESSAGE("That shouldn't change size or positioning", aOrigRect == rNewRect);
+
+ m_pDoc->ShowRows(0, 100, 0, false);
+ CPPUNIT_ASSERT_MESSAGE("Left and Right should be unchanged",
+ aOrigRect.nLeft == rNewRect.nLeft && aOrigRect.nRight == rNewRect.nRight);
+ CPPUNIT_ASSERT_MESSAGE("Height should be minimum allowed height",
+ (rNewRect.nBottom - rNewRect.nTop) <= 1);
+ m_pDoc->ShowRows(0, 100, 0, true);
+ CPPUNIT_ASSERT_MESSAGE("Should not change when page anchored", aOrigRect == rNewRect);
+
+ m_pDoc->DeleteTab(0);
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/addin/makefile.mk b/sc/qa/unit/version.map
index e716a8d8477a..3308588ef6f8 100644
--- a/sc/addin/makefile.mk
+++ b/sc/qa/unit/version.map
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -25,21 +25,10 @@
#
#*************************************************************************
-PRJ=..
-
-PRJNAME=sc
-TARGET=addin
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE: target.mk
+UDK_3_0_0 {
+ global:
+ cppunitTestPlugIn;
-ALLTAR: $(MISC)$/cl2c.pl
-
-$(MISC)$/cl2c.pl: util/cl2c.pl
- tr -d "\015" < util$/cl2c.pl > $@
- chmod +rw $@
+ local:
+ *;
+};
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 4c27c656d15c..a50f2e963713 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -60,6 +60,7 @@ interface CellSelection
SID_SBA_BRW_INSERT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_SELECT_DB [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
+ SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
FID_FILTER_OK [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_AUTO_FILTER [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_AUTOFILTER_HIDE [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
@@ -112,6 +113,10 @@ interface CellSelection
SID_DETECTIVE_ADD_ERR [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_DETECTIVE_INVALID [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_DETECTIVE_REFRESH [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_DETECTIVE_MARK_PRED [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_DETECTIVE_MARK_SUCC [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_INSERT_CURRENT_DATE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_INSERT_CURRENT_TIME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
FID_INS_ROW [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
FID_INS_COLUMN [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
FID_INS_CELLSDOWN [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi
index 94cd06d9f699..edf00e877e1f 100644
--- a/sc/sdi/docsh.sdi
+++ b/sc/sdi/docsh.sdi
@@ -61,6 +61,7 @@ interface TableSelection
FID_TAB_RENAME [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
FID_TAB_RTL [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
FID_TAB_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
+ FID_TAB_TOGGLE_GRID [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
SID_TABLE_ACTIVATE [ ExecMethod = Execute; ]
}
diff --git a/sc/sdi/drawsh.sdi b/sc/sdi/drawsh.sdi
index 98c7bf3a009d..8ba2a6759b15 100644
--- a/sc/sdi/drawsh.sdi
+++ b/sc/sdi/drawsh.sdi
@@ -226,9 +226,9 @@ interface TableDraw
SID_FONTWORK_CHARACTER_SPACING_DIALOG [ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
// ISSUE66550_HLINK_FOR_SHAPES
-// SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
-// SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
-// SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
+ SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
+ SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
+ SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
}
diff --git a/sc/sdi/formatsh.sdi b/sc/sdi/formatsh.sdi
index 31ccf5c8af84..8b84a7b730c6 100644
--- a/sc/sdi/formatsh.sdi
+++ b/sc/sdi/formatsh.sdi
@@ -117,11 +117,11 @@ interface FormatForSelection
SID_ATTR_NUMBERFORMAT_VALUE [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;]
SID_NUMBER_FORMAT [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState;]
SID_NUMBER_TWODEC [ ExecMethod = ExecuteNumFormat;]
- SID_NUMBER_SCIENTIFIC [ ExecMethod = ExecuteNumFormat;]
- SID_NUMBER_DATE [ ExecMethod = ExecuteNumFormat;]
- SID_NUMBER_CURRENCY [ ExecMethod = ExecuteNumFormat;]
- SID_NUMBER_PERCENT [ ExecMethod = ExecuteNumFormat;]
- SID_NUMBER_TIME [ ExecMethod = ExecuteNumFormat;]
+ SID_NUMBER_SCIENTIFIC [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
+ SID_NUMBER_DATE [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
+ SID_NUMBER_CURRENCY [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
+ SID_NUMBER_PERCENT [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
+ SID_NUMBER_TIME [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
SID_NUMBER_STANDARD [ ExecMethod = ExecuteNumFormat;]
SID_NUMBER_INCDEC [ ExecMethod = ExecuteNumFormat;]
SID_NUMBER_DECDEC [ ExecMethod = ExecuteNumFormat;]
diff --git a/sc/sdi/makefile.mk b/sc/sdi/makefile.mk
index dc91cab89397..658c81c4f728 100644
--- a/sc/sdi/makefile.mk
+++ b/sc/sdi/makefile.mk
@@ -39,7 +39,6 @@ SVSDIINC=$(PRJ)$/source$/ui$/inc
.IF "$(L10N_framework)"==""
SDI1NAME=$(TARGET)
-#SIDHRCNAME=SCSLOTS.HRC
SDI1EXPORT=scalc
SVSDI1DEPEND= \
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 1e42ce5fb1dc..fb22dd27ed0e 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -1574,7 +1574,32 @@ SfxVoidItem DataSelect SID_DATA_SELECT
//--------------------------------------------------------------------------
SfxVoidItem DataSort SID_SORT
-(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6)
+(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem NaturalSort SID_SORT_NATURALSORT,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DATA;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem DataForm SID_DATA_FORM
+()
[
/* flags: */
AutoUpdate = FALSE,
@@ -2777,7 +2802,6 @@ SfxVoidItem SolverDialog SID_OPENDLG_OPTSOLVER
]
//--------------------------------------------------------------------------
-//<!--Added by PengYunQuan for Validity Cell Range Picker
SfxVoidItem ValidityReference SID_VALIDITY_REFERENCE
()
[
@@ -2801,7 +2825,6 @@ SfxVoidItem ValidityReference SID_VALIDITY_REFERENCE
ToolBoxConfig = TRUE,
GroupId = GID_OPTIONS;
]
-//-->Added by PengYunQuan for Validity Cell Range Picker
//--------------------------------------------------------------------------
SfxVoidItem GoDownToEndOfData SID_CURSORBLKDOWN
@@ -6271,55 +6294,55 @@ SfxVoidItem StandardFonts SID_STANDARD_FONTS
//--------------------------------------------------------------------------
// ISSUE66550_HLINK_FOR_SHAPES
-//SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT
-//()
-//[
-// /* flags: */
-// AutoUpdate = FALSE,
-// Cachable = Cachable,
-// FastCall = TRUE,
-// HasCoreId = FALSE,
-// HasDialog = TRUE,
-// ReadOnlyDoc = TRUE,
-// Toggle = FALSE,
-// Container = FALSE,
-// RecordAbsolute = FALSE,
-// RecordPerSet;
-// Synchron;
-//
+SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
// /* config: */
-// AccelConfig = TRUE,
-// MenuConfig = FALSE,
-// StatusBarConfig = FALSE,
-// ToolBoxConfig = FALSE,
-// GroupId = GID_DRAWING;
-//]
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DRAWING;
+]
//--------------------------------------------------------------------------
// ISSUE66550_HLINK_FOR_SHAPES
-//SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE
-//()
-//[
-// /* flags: */
-// AutoUpdate = TRUE,
-// Cachable = Cachable,
-// FastCall = TRUE,
-// HasCoreId = FALSE,
-// HasDialog = FALSE,
-// ReadOnlyDoc = TRUE,
-// Toggle = FALSE,
-// Container = FALSE,
-// RecordAbsolute = FALSE,
-// RecordPerSet;
-// Synchron;
-//
-// /* config: */
-// AccelConfig = TRUE,
-// MenuConfig = FALSE,
-// StatusBarConfig = FALSE,
-// ToolBoxConfig = FALSE,
-// GroupId = GID_DRAWING;
-//]
+SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DRAWING;
+]
//--------------------------------------------------------------------------
SfxVoidItem StandardTextAttributes SID_TEXT_STANDARD
@@ -7775,6 +7798,33 @@ SfxVoidItem ShareDocument SID_SHARE_DOC
]
//--------------------------------------------------------------------------
+SfxBoolItem ToggleSheetGrid FID_TAB_TOGGLE_GRID
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_FORMAT;
+]
+
+
+
+//--------------------------------------------------------------------------
SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR
[
@@ -7802,6 +7852,106 @@ SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR
]
//--------------------------------------------------------------------------
+SfxVoidItem MarkPrecedents SID_DETECTIVE_MARK_PRED
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem MarkDependents SID_DETECTIVE_MARK_SUCC
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem InsertCurrentDate SID_INSERT_CURRENT_DATE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem InsertCurrentTime SID_INSERT_CURRENT_TIME
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
SfxVoidItem SetTabBgColor FID_TAB_MENU_SET_TAB_BG_COLOR
(SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR)
[
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 3c2569cc143f..5327df0afd10 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
//------------------------------------------------------------------------
#include "scitems.hxx"
@@ -38,6 +37,8 @@
#include <editeng/bolnitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/shaditem.hxx>
+#include <editeng/editobj.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/poolcach.hxx>
#include <editeng/fontitem.hxx>
#include <unotools/fontcvt.hxx>
@@ -53,18 +54,10 @@
#include "rechead.hxx"
#include "globstr.hrc"
#include "segmenttree.hxx"
-
-#undef DBG_INVALIDATE
-#define DBGOUTPUT(s) \
- DBG_ERROR( String("Invalidate ") + String(s) + String(": ") \
- + String(nCol) + String('/') + String(aAdrStart.Row()) + String('/') + String(nTab) \
- + String(" bis ") \
- + String(nCol) + String('/') + String(aAdrEnd.Row()) + String('/') + String(nTab) \
- );
+#include "cell.hxx"
// STATIC DATA -----------------------------------------------------------
-
//------------------------------------------------------------------------
ScAttrArray::ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc ) :
@@ -77,7 +70,7 @@ ScAttrArray::ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc ) :
if (pData)
{
pData[0].nRow = MAXROW;
- pData[0].pPattern = pDocument->GetDefPattern(); // ohne Put !!!
+ pData[0].pPattern = pDocument->GetDefPattern(); // no put
}
}
@@ -142,7 +135,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, sal_Bool bAlloc )
for (SCSIZE i=0; i<nCount; i++)
{
- // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
+ // ensure that attributing changes text width of cell
pOldPattern = pData[i].pPattern;
sal_Bool bNumFormatChanged;
if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
@@ -151,11 +144,8 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, sal_Bool bAlloc )
aAdrStart.SetRow( i ? pData[i-1].nRow+1 : 0 );
aAdrEnd .SetRow( pData[i].nRow );
pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
-#ifdef DBG_INVALIDATE
- DBGOUTPUT("Reset");
-#endif
}
- // bedingtes Format gesetzt oder geloescht?
+ // conditional format or deleted?
if ( &pPattern->GetItem(ATTR_CONDITIONAL) != &pOldPattern->GetItem(ATTR_CONDITIONAL) )
{
pDocument->ConditionalChanged( ((const SfxUInt32Item&)
@@ -168,7 +158,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, sal_Bool bAlloc )
delete[] pData;
if (pDocument->IsStreamValid(nTab))
- pDocument->SetStreamValid(nTab, sal_False);
+ pDocument->SetStreamValid(nTab, false);
if (bAlloc)
{
@@ -184,7 +174,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, sal_Bool bAlloc )
else
{
nCount = nLimit = 0;
- pData = NULL; // muss sofort wieder belegt werden !
+ pData = NULL; // should be immediately occupied again
}
}
}
@@ -192,7 +182,7 @@ void ScAttrArray::Reset( const ScPatternAttr* pPattern, sal_Bool bAlloc )
sal_Bool ScAttrArray::Concat(SCSIZE nPos)
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
if (pData && (nPos < nCount))
{
if (nPos > 0)
@@ -230,14 +220,14 @@ sal_Bool ScAttrArray::Concat(SCSIZE nPos)
sal_Bool ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const
{
- long nLo = 0;
long nHi = static_cast<long>(nCount) - 1;
- long nStartRow = 0;
- long nEndRow = 0;
long i = 0;
sal_Bool bFound = (nCount == 1);
if (pData)
{
+ long nLo = 0;
+ long nStartRow = 0;
+ long nEndRow = 0;
while ( !bFound && nLo <= nHi )
{
i = (nLo + nHi) / 2;
@@ -256,7 +246,7 @@ sal_Bool ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const
}
}
else
- bFound = sal_False;
+ bFound = false;
if (bFound)
nIndex=(SCSIZE)i;
@@ -299,8 +289,31 @@ void ScAttrArray::SetPattern( SCROW nRow, const ScPatternAttr* pPattern, sal_Boo
SetPatternArea( nRow, nRow, pPattern, bPutToPool );
}
+void ScAttrArray::RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow,
+ const ScPatternAttr* pPattern, ScEditDataArray* pDataArray )
+{
+ for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
+ {
+ ScBaseCell* pCell;
+ pDocument->GetCell(nCol, nRow, nTab, pCell);
+ if (pCell && pCell->GetCellType() == CELLTYPE_EDIT)
+ {
+ EditTextObject* pOldData = NULL;
+ ScEditCell* pEditCell = static_cast<ScEditCell*>(pCell);
+ if (pDataArray)
+ pOldData = pEditCell->GetData()->Clone();
+ pEditCell->RemoveCharAttribs(*pPattern);
+ if (pDataArray)
+ {
+ EditTextObject* pNewData = pEditCell->GetData()->Clone();
+ pDataArray->AddItem(nTab, nCol, nRow, pOldData, pNewData);
+ }
+ }
+ }
+}
-void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr *pPattern, sal_Bool bPutToPool )
+void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr *pPattern,
+ sal_Bool bPutToPool, ScEditDataArray* pDataArray )
{
if (ValidRow(nStartRow) && ValidRow(nEndRow))
{
@@ -343,8 +356,8 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
}
}
- // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
- // oder bedingte Formate neu gesetzt oder geloescht werden
+ // ensure that attributing changes text width of cell
+ // otherwise, conditional formats need to be reset or deleted
while ( ns <= nEndRow )
{
const SfxItemSet& rNewSet = pPattern->GetItemSet();
@@ -357,9 +370,6 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
aAdrStart.SetRow( Max(nStartRow,ns) );
aAdrEnd .SetRow( Min(nEndRow,pData[nx].nRow) );
pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
-#ifdef DBG_INVALIDATE
- DBGOUTPUT("SetPatternArea");
-#endif
}
if ( &rNewSet.Get(ATTR_CONDITIONAL) != &rOldSet.Get(ATTR_CONDITIONAL) )
{
@@ -375,8 +385,8 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
// continue modifying data array
SCSIZE nInsert; // insert position (MAXROWCOUNT := no insert)
- sal_Bool bCombined = sal_False;
- sal_Bool bSplit = sal_False;
+ sal_Bool bCombined = false;
+ sal_Bool bSplit = false;
if ( nStartRow > 0 )
{
nInsert = MAXROWCOUNT;
@@ -470,14 +480,19 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern
pData[nInsert-1].nRow = nStartRow - 1;
pData[nInsert].nRow = nEndRow;
pData[nInsert].pPattern = pPattern;
+
+ // Remove character attributes from these cells if the pattern
+ // is applied during normal session.
+ if (pDataArray)
+ RemoveCellCharAttribs(nStartRow, nEndRow, pPattern, pDataArray);
+
nCount++;
}
if (pDocument->IsStreamValid(nTab))
- pDocument->SetStreamValid(nTab, sal_False);
+ pDocument->SetStreamValid(nTab, false);
}
}
-// InfoBox(0, String(nCount) + String(" Eintraege") ).Execute();
#ifdef DBG_UTIL
TestData();
@@ -493,7 +508,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
SCROW nStart=0;
if (!Search( nStartRow, nPos ))
{
- DBG_ERROR("Search-Fehler");
+ OSL_FAIL("Search Failure");
return;
}
@@ -524,9 +539,8 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
}
else
{
- // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
- // bedingte Formate in Vorlagen gibt es (noch) nicht
-
+ // ensure attributing changes text width of cell; otherwise
+ // there aren't (yet) template format changes
const SfxItemSet& rNewSet = pNewPattern->GetItemSet();
const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
@@ -537,9 +551,6 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
aAdrStart.SetRow( nPos ? pData[nPos-1].nRow+1 : 0 );
aAdrEnd .SetRow( pData[nPos].nRow );
pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
-#ifdef DBG_INVALIDATE
- DBGOUTPUT("ApplyStyleArea");
-#endif
}
pDocument->GetPool()->Remove(*pData[nPos].pPattern);
@@ -555,7 +566,7 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
while ((nStart <= nEndRow) && (nPos < nCount));
if (pDocument->IsStreamValid(nTab))
- pDocument->SetStreamValid(nTab, sal_False);
+ pDocument->SetStreamValid(nTab, false);
}
#ifdef DBG_UTIL
@@ -564,21 +575,20 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet*
}
- // const wird weggecastet, weil es sonst
- // zu ineffizient/kompliziert wird!
-#define SET_LINECOLOR(dest,c) \
- if ((dest)) \
- { \
- ((SvxBorderLine*)(dest))->SetColor((c)); \
+ // const cast, otherwise it will be too inefficient/complicated
+#define SET_LINECOLOR(dest,c) \
+ if ((dest)) \
+ { \
+ ((SvxBorderLine*)(dest))->SetColor((c)); \
}
-#define SET_LINE(dest,src) \
- if ((dest)) \
- { \
- SvxBorderLine* pCast = (SvxBorderLine*)(dest); \
- pCast->SetOutWidth((src)->GetOutWidth()); \
- pCast->SetInWidth ((src)->GetInWidth()); \
- pCast->SetDistance((src)->GetDistance()); \
+#define SET_LINE(dest,src) \
+ if ((dest)) \
+ { \
+ SvxBorderLine* pCast = (SvxBorderLine*)(dest); \
+ pCast->SetOutWidth((src)->GetOutWidth()); \
+ pCast->SetInWidth( (src)->GetInWidth() ); \
+ pCast->SetDistance((src)->GetDistance()); \
}
void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
@@ -593,7 +603,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
SCROW nStart=0;
if (!Search( nStartRow, nPos ))
{
- DBG_ERROR("Search-Fehler");
+ OSL_FAIL("Search failure");
return;
}
@@ -619,7 +629,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
SvxLineItem* pNewTLBRItem = pTLBRItem ? (SvxLineItem*)pTLBRItem->Clone() : 0;
SvxLineItem* pNewBLTRItem = pBLTRItem ? (SvxLineItem*)pBLTRItem->Clone() : 0;
- // Linienattribute holen und mit Parametern aktualisieren
+ // fetch line and update attributes with parameters
if ( !pLine )
{
@@ -682,7 +692,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
}
else
{
- //! aus Pool loeschen?
+ // remove from pool ?
pDocument->GetPool()->Remove(*pData[nPos].pPattern);
pData[nPos].pPattern = (const ScPatternAttr*)
&pDocument->GetPool()->Put(*pNewPattern);
@@ -711,7 +721,7 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
#undef SET_LINE
-void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache )
+void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache, ScEditDataArray* pDataArray )
{
#ifdef DBG_UTIL
TestData();
@@ -723,7 +733,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
SCROW nStart=0;
if (!Search( nStartRow, nPos ))
{
- DBG_ERROR("Search-Fehler");
+ OSL_FAIL("Search Failure");
return;
}
@@ -746,12 +756,12 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
{
if (nY1 < nStartRow) nY1=nStartRow;
if (nY2 > nEndRow) nY2=nEndRow;
- SetPatternArea( nY1, nY2, pNewPattern );
+ SetPatternArea( nY1, nY2, pNewPattern, false, pDataArray );
Search( nStart, nPos );
}
else
{
- // ueberpruefen, ob Attributierung die Textbreite der Zelle aendert
+ // ensure attributing changes text-width of cell
const SfxItemSet& rNewSet = pNewPattern->GetItemSet();
const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
@@ -763,12 +773,9 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
aAdrStart.SetRow( nPos ? pData[nPos-1].nRow+1 : 0 );
aAdrEnd .SetRow( pData[nPos].nRow );
pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
-#ifdef DBG_INVALIDATE
- DBGOUTPUT("ApplyCacheArea");
-#endif
}
- // bedingte Formate neu gesetzt oder geloescht ?
+ // Reset conditional formats or delete ?
if ( &rNewSet.Get(ATTR_CONDITIONAL) != &rOldSet.Get(ATTR_CONDITIONAL) )
{
@@ -788,8 +795,6 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
}
else
{
-//!!!!!!!!!!!!!!!!!! mit diesem Remove gibt es Abstuerze (Calc1 Import)
-//! pDocument->GetPool()->Remove(*pNewPattern);
nStart = pData[nPos].nRow + 1;
++nPos;
}
@@ -797,7 +802,7 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
while (nStart <= nEndRow);
if (pDocument->IsStreamValid(nTab))
- pDocument->SetStreamValid(nTab, sal_False);
+ pDocument->SetStreamValid(nTab, false);
}
#ifdef DBG_UTIL
@@ -805,6 +810,21 @@ void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCac
#endif
}
+bool ScAttrArray::SetAttrEntries(ScAttrEntry* pNewData, SCSIZE nSize)
+{
+ if (pData)
+ {
+ ScDocumentPool* pDocPool = pDocument->GetPool();
+ for (SCSIZE i=0; i<nCount; i++)
+ pDocPool->Remove(*pData[i].pPattern);
+
+ delete[] pData;
+ }
+
+ pData = pNewData;
+ nCount = nLimit = nSize;
+ return true;
+}
void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource )
{
@@ -812,10 +832,10 @@ void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource )
const SfxPoolItem* pOldItem;
for (sal_uInt16 nId=ATTR_PATTERN_START; nId<=ATTR_PATTERN_END; nId++)
{
- // pMergeSet hat keinen Parent
- SfxItemState eOldState = rMergeSet.GetItemState( nId, sal_False, &pOldItem );
+ // pMergeSet has no parent
+ SfxItemState eOldState = rMergeSet.GetItemState( nId, false, &pOldItem );
- if ( eOldState == SFX_ITEM_DEFAULT ) // Default
+ if ( eOldState == SFX_ITEM_DEFAULT )
{
SfxItemState eNewState = rSource.GetItemState( nId, sal_True, &pNewItem );
if ( eNewState == SFX_ITEM_SET )
@@ -838,7 +858,7 @@ void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource )
rMergeSet.InvalidateItem( nId );
}
}
- // Dontcare bleibt Dontcare
+ // Dontcare remains Dontcare
}
}
@@ -852,13 +872,13 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
SCROW nStart=0;
if (!Search( nStartRow, nPos ))
{
- DBG_ERROR("Search-Fehler");
+ OSL_FAIL("Search failure");
return;
}
do
{
- // gleiche Patterns muessen nicht mehrfach angesehen werden
+ // similar patterns must not be repeated
const ScPatternAttr* pPattern = pData[nPos].pPattern;
if ( pPattern != rState.pOld1 && pPattern != rState.pOld2 )
@@ -866,17 +886,14 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
const SfxItemSet& rThisSet = pPattern->GetItemSet();
if (rState.pItemSet)
{
- // (*ppSet)->MergeValues( rThisSet, sal_False );
- // geht nicht, weil die Vorlagen nicht beruecksichtigt werden
-
if (bDeep)
lcl_MergeDeep( *rState.pItemSet, rThisSet );
else
- rState.pItemSet->MergeValues( rThisSet, sal_False );
+ rState.pItemSet->MergeValues( rThisSet, false );
}
else
{
- // erstes Pattern - in Set ohne Parent kopieren
+ // first pattern - copied from parent
rState.pItemSet = new SfxItemSet( *rThisSet.GetPool(), rThisSet.GetRanges() );
rState.pItemSet->Set( rThisSet, bDeep );
}
@@ -894,37 +911,37 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
-// Umrandung zusammenbauen
+// assemble border
sal_Bool lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine,
sal_uInt8& rModified, const SvxBorderLine*& rpNew )
{
if (rModified == SC_LINE_DONTCARE)
- return sal_False; // weiter geht's nicht
+ return false; // don't go again
if (rModified == SC_LINE_EMPTY)
{
rModified = SC_LINE_SET;
rpNew = pNewLine;
- return sal_True; // zum ersten mal gesetzt
+ return true; // initial value
}
if (pOldLine == pNewLine)
{
rpNew = pOldLine;
- return sal_False;
+ return false;
}
if (pOldLine && pNewLine)
if (*pOldLine == *pNewLine)
{
rpNew = pOldLine;
- return sal_False;
+ return false;
}
rModified = SC_LINE_DONTCARE;
rpNew = NULL;
- return sal_True; // andere Linie -> dontcare
+ return true; // another line -> don't care
}
@@ -932,7 +949,7 @@ void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
ScLineFlags& rFlags, const ScPatternAttr* pPattern,
sal_Bool bLeft, SCCOL nDistRight, sal_Bool bTop, SCROW nDistBottom )
{
- // rechten/unteren Rahmen setzen, wenn Zelle bis zum Ende zusammengefasst:
+ // right/bottom border set when connected together
const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE);
if ( rMerge.GetColMerge() == nDistRight + 1 )
nDistRight = 0;
@@ -1016,22 +1033,21 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLine
for (SCSIZE i=nStartIndex; i<=nEndIndex; i++)
{
pPattern = (ScPatternAttr*) pData[i].pPattern;
- lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, sal_False,
+ lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, false,
nEndRow - Min( pData[i].nRow, (SCROW)(nEndRow-1) ) );
- // nDistBottom hier immer > 0
+ // nDistBottom here always > 0
}
pPattern = GetPattern( nEndRow );
- lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, sal_False, 0 );
+ lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, false, 0 );
}
}
//
-// Rahmen anwenden
+// apply border
//
-// ApplyFrame - auf einen Eintrag im Array
-
+// ApplyFrame - on an entry into the array
sal_Bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem,
const SvxBoxInfoItem* pBoxInfoItem,
@@ -1044,7 +1060,7 @@ sal_Bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem,
const SvxBoxItem* pOldFrame = (const SvxBoxItem*)
&pPattern->GetItemSet().Get( ATTR_BORDER );
- // rechten/unteren Rahmen setzen, wenn Zelle bis zum Ende zusammengefasst:
+ // right/bottom border set when connected together
const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE);
if ( rMerge.GetColMerge() == nDistRight + 1 )
nDistRight = 0;
@@ -1069,18 +1085,14 @@ sal_Bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem,
if (aNewFrame == *pOldFrame)
{
// nothing to do
- return sal_False;
+ return false;
}
else
{
SfxItemPoolCache aCache( pDocument->GetPool(), &aNewFrame );
ApplyCacheArea( nStartRow, nEndRow, &aCache );
-/* ScPatternAttr* pNewPattern = (ScPatternAttr*) pPattern->Clone();
- pNewPattern->GetItemSet().Put( aNewFrame );
- SetPatternArea( nStartRow, nEndRow, pNewPattern, sal_True );
-*/
- return sal_True;
+ return true;
}
}
@@ -1095,7 +1107,7 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf
ApplyFrame( pLineOuter, pLineInner, nStartRow, nStartRow, bLeft, nDistRight,
sal_True, nEndRow-nStartRow );
- if ( nEndRow > nStartRow+1 ) // innerer Teil vorhanden?
+ if ( nEndRow > nStartRow+1 ) // inner part available?
{
SCSIZE nStartIndex;
SCSIZE nEndIndex;
@@ -1107,7 +1119,7 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf
{
nTmpEnd = Min( (SCROW)(nEndRow-1), (SCROW)(pData[i].nRow) );
sal_Bool bChanged = ApplyFrame( pLineOuter, pLineInner, nTmpStart, nTmpEnd,
- bLeft, nDistRight, sal_False, nEndRow-nTmpEnd );
+ bLeft, nDistRight, false, nEndRow-nTmpEnd );
nTmpStart = nTmpEnd+1;
if (bChanged)
{
@@ -1119,15 +1131,15 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf
}
}
- ApplyFrame( pLineOuter, pLineInner, nEndRow, nEndRow, bLeft, nDistRight, sal_False, 0 );
+ ApplyFrame( pLineOuter, pLineInner, nEndRow, nEndRow, bLeft, nDistRight, false, 0 );
}
}
long lcl_LineSize( const SvxBorderLine& rLine )
{
- // nur eine Linie -> halbe Breite, min. 20
- // doppelte Linie -> halber Abstand + eine Linie (je min. 20)
+ // only one line -> half width, min. 20
+ // double line -> half line spacing + (per min. 20)
long nTotal = 0;
sal_uInt16 nWidth = Max( rLine.GetOutWidth(), rLine.GetInWidth() );
@@ -1135,22 +1147,19 @@ long lcl_LineSize( const SvxBorderLine& rLine )
if (nDist)
{
DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(),
- "Linie hat Abstand, aber nur eine Breite ???" );
+ "Line has a distance, but only a width?" );
-// nTotal += ( nDist > 40 ) ? ( nDist / 2 ) : 20;
nTotal += ( nDist > 20 ) ? nDist : 20;
nTotal += ( nWidth > 20 ) ? nWidth : 20;
}
else if (nWidth)
-// nTotal += ( nWidth > 40 ) ? ( nWidth / 2 ) : 20;
nTotal += ( nWidth > 20 ) ? nWidth : 20;
- //! auch halbieren ???
+ // also halved ?
return nTotal;
}
-
sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
sal_Bool bLeft, sal_Bool bRight ) const
{
@@ -1158,13 +1167,13 @@ sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
SCSIZE nEndIndex;
Search( nRow1, nStartIndex );
Search( nRow2, nEndIndex );
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
const SvxBoxItem* pItem = 0;
const SvxBorderLine* pLine = 0;
long nCmp;
- // oben
+ // top
pItem = (const SvxBoxItem*) &pData[nStartIndex].pPattern->GetItem(ATTR_BORDER);
pLine = pItem->GetTop();
@@ -1176,7 +1185,7 @@ sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
bFound = sal_True;
}
- // unten
+ // down
if ( nEndIndex != nStartIndex )
pItem = (const SvxBoxItem*) &pData[nEndIndex].pPattern->GetItem(ATTR_BORDER);
@@ -1194,8 +1203,6 @@ sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
{
pItem = (const SvxBoxItem*) &pData[i].pPattern->GetItem(ATTR_BORDER);
- // links
-
if (bLeft)
{
pLine = pItem->GetLeft();
@@ -1208,8 +1215,6 @@ sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
}
}
- // rechts
-
if (bRight)
{
pLine = pItem->GetRight();
@@ -1226,7 +1231,7 @@ sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
return bFound;
}
-// Testen, ob Bereich bestimmtes Attribut enthaelt
+// Test if field contains specific attribute
bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const
{
@@ -1341,9 +1346,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const
return bFound;
}
-// Bereich um evtl. enthaltene Zusammenfassungen erweitern
-// und evtl. MergeFlag anpassen (bRefresh)
-
+// Area around any given summaries expand and adapt any MergeFlag (bRefresh)
sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
SCCOL& rPaintCol, SCROW& rPaintRow,
sal_Bool bRefresh, sal_Bool bAttrs )
@@ -1354,7 +1357,7 @@ sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRo
SCSIZE nEndIndex;
Search( nStartRow, nStartIndex );
Search( nEndRow, nEndIndex );
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (SCSIZE i=nStartIndex; i<=nEndIndex; i++)
{
@@ -1398,7 +1401,7 @@ sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRo
pDocument->ApplyFlagsTab( nThisCol+1, nThisRow+1, nMergeEndCol, nMergeEndRow,
nTab, SC_MF_HOR | SC_MF_VER );
- Search( nThisRow, i ); // Daten wurden veraendert
+ Search( nThisRow, i ); // Data changed
Search( nStartRow, nStartIndex );
Search( nEndRow, nEndIndex );
}
@@ -1411,7 +1414,7 @@ sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRo
sal_Bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
const ScPatternAttr* pPattern;
const ScMergeAttr* pItem;
SCSIZE nIndex;
@@ -1438,13 +1441,13 @@ sal_Bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
const ScMergeFlagAttr* pFlagAttr = (const ScMergeFlagAttr*)
&pDocument->GetPool()->GetDefaultItem( ATTR_MERGE_FLAG );
- DBG_ASSERT( nCountY==1 || nThisStart==nThisEnd, "was'n hier los?" );
+ DBG_ASSERT( nCountY==1 || nThisStart==nThisEnd, "What's up?" );
SCCOL nThisCol = nCol;
SCCOL nMergeEndCol = nThisCol + nCountX - 1;
SCROW nMergeEndRow = nThisEnd + nCountY - 1;
- //! ApplyAttr fuer Bereiche !!!
+ // ApplyAttr for areas
for (SCROW nThisRow = nThisStart; nThisRow <= nThisEnd; nThisRow++)
pDocument->ApplyAttr( nThisCol, nThisRow, nTab, *pAttr );
@@ -1456,20 +1459,20 @@ sal_Bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
nTab, *pNewPattern );
delete pNewPattern;
- Search( nThisEnd, nIndex ); // Daten wurden veraendert !!!
+ Search( nThisEnd, nIndex ); // data changed
}
++nIndex;
if ( nIndex < nCount )
nThisStart = pData[nIndex-1].nRow+1;
else
- nThisStart = MAXROW+1; // Ende
+ nThisStart = MAXROW+1; // End
}
return bFound;
}
- // Bereich loeschen, aber Merge-Flags stehenlassen
+// Remove field, but leave MergeFlags
void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow)
{
@@ -1502,7 +1505,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
if (pItem->IsOverlapped() || pItem->HasAutoFilter())
{
- // #108045# default-constructing a ScPatternAttr for DeleteArea doesn't work
+ // default-constructing a ScPatternAttr for DeleteArea doesn't work
// because it would have no cell style information.
// Instead, the document's GetDefPattern is copied. Since it is passed as
// pWantedPattern, no special treatment of default is needed here anymore.
@@ -1517,14 +1520,15 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
if ( !bDefault )
{
if (bFirstUse)
- bFirstUse = sal_False;
+ bFirstUse = false;
else
- pDocument->GetPool()->Put( *pWantedPattern ); // im Pool ist es schon!
+ // it's in the pool
+ pDocument->GetPool()->Put( *pWantedPattern );
}
SetPatternArea( nThisRow, nAttrRow, pWantedPattern );
}
- Search( nThisRow, nIndex ); // Daten wurden veraendert !!!
+ Search( nThisRow, nIndex ); // data changed
}
++nIndex;
@@ -1541,7 +1545,7 @@ sal_Bool ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFla
SCSIZE nIndex;
SCROW nRow;
SCROW nThisRow;
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
Search( nStartRow, nIndex );
nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
@@ -1557,9 +1561,9 @@ sal_Bool ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFla
SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
ScPatternAttr aNewPattern(*pOldPattern);
aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue | nFlags ) );
- SetPatternArea( nThisRow, nAttrRow, &aNewPattern, sal_True );
- Search( nThisRow, nIndex ); // Daten wurden veraendert !!!
- bChanged = sal_True;
+ SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
+ Search( nThisRow, nIndex ); // data changed
+ bChanged = true;
}
++nIndex;
@@ -1578,7 +1582,7 @@ sal_Bool ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFl
SCSIZE nIndex;
SCROW nRow;
SCROW nThisRow;
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
Search( nStartRow, nIndex );
nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
@@ -1594,9 +1598,9 @@ sal_Bool ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFl
SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
ScPatternAttr aNewPattern(*pOldPattern);
aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue & ~nFlags ) );
- SetPatternArea( nThisRow, nAttrRow, &aNewPattern, sal_True );
- Search( nThisRow, nIndex ); // Daten wurden veraendert !!!
- bChanged = sal_True;
+ SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
+ Search( nThisRow, nIndex ); // data changed
+ bChanged = true;
}
++nIndex;
@@ -1629,8 +1633,8 @@ void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16*
nRow = pData[nIndex].nRow;
SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
- SetPatternArea( nThisRow, nAttrRow, &aNewPattern, sal_True );
- Search( nThisRow, nIndex ); // Daten wurden veraendert !!!
+ SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
+ Search( nThisRow, nIndex ); // data changed
}
++nIndex;
@@ -1652,7 +1656,7 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, sal_Bool bIncrem
const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
const SfxPoolItem* pItem;
- sal_Bool bNeedJust = ( rOldSet.GetItemState( ATTR_HOR_JUSTIFY, sal_False, &pItem ) != SFX_ITEM_SET
+ sal_Bool bNeedJust = ( rOldSet.GetItemState( ATTR_HOR_JUSTIFY, false, &pItem ) != SFX_ITEM_SET
|| ((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_LEFT );
sal_uInt16 nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue();
sal_uInt16 nNewValue = nOldValue;
@@ -1687,11 +1691,11 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, sal_Bool bIncrem
SetPatternArea( nThisStart, nAttrRow, &aNewPattern, sal_True );
nThisStart = nThisEnd + 1;
- Search( nThisStart, nIndex ); // Daten wurden veraendert !!!
+ Search( nThisStart, nIndex ); // data changed
}
else
{
- nThisStart = pData[nIndex].nRow + 1; // weiterzaehlen...
+ nThisStart = pData[nIndex].nRow + 1;
++nIndex;
}
}
@@ -1711,7 +1715,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, sal_Bool bUp ) const
if (bUp)
{
if (nIndex==0)
- return -1; // nichts gefunden
+ return -1; // not found
--nIndex;
nRet = pData[nIndex].nRow;
}
@@ -1720,7 +1724,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, sal_Bool bUp ) const
nRet = pData[nIndex].nRow+1;
++nIndex;
if (nIndex>=nCount)
- return MAXROW+1; // nichts gefunden
+ return MAXROW+1; // not found
}
}
}
@@ -1736,9 +1740,6 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo
SCROW nEnd = pData[nPos].nRow;
if (pData[nPos].pPattern->GetStyleSheet() == pStyleSheet)
{
-// for (SCROW nRow = nStart; nRow <= nEnd; nRow++)
-// pUsed[nRow] = sal_True;
-
rUsedRows.setTrue(nStart, nEnd);
if (bReset)
@@ -1757,7 +1758,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo
if (Concat(nPos))
{
Search(nStart, nPos);
- --nPos; // wegen ++ am Ende
+ --nPos; // because ++ at end
}
}
}
@@ -1770,7 +1771,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo
sal_Bool ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle,
sal_Bool bGatherAllStyles ) const
{
- sal_Bool bIsUsed = sal_False;
+ sal_Bool bIsUsed = false;
SCSIZE nPos = 0;
while ( nPos < nCount )
@@ -1798,55 +1799,20 @@ sal_Bool ScAttrArray::IsEmpty() const
if (nCount == 1)
{
if ( pData[0].pPattern != pDocument->GetDefPattern() )
- return sal_False;
+ return false;
else
return sal_True;
}
else
- return sal_False;
+ return false;
}
-//UNUSED2008-05 SCROW ScAttrArray::GetFirstEntryPos() const
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ASSERT( nCount, "nCount = 0" );
-//UNUSED2008-05
-//UNUSED2008-05 if ( pData[0].pPattern != pDocument->GetDefPattern() )
-//UNUSED2008-05 return 0;
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 if (nCount==1)
-//UNUSED2008-05 return 0; // leer
-//UNUSED2008-05 else
-//UNUSED2008-05 return pData[0].nRow + 1;
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05
-//UNUSED2008-05 SCROW ScAttrArray::GetLastEntryPos( sal_Bool bIncludeBottom ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ASSERT( nCount, "nCount == 0" );
-//UNUSED2008-05
-//UNUSED2008-05 if (bIncludeBottom)
-//UNUSED2008-05 bIncludeBottom = ( pData[nCount-1].pPattern != pDocument->GetDefPattern() );
-//UNUSED2008-05
-//UNUSED2008-05 if (bIncludeBottom)
-//UNUSED2008-05 return MAXROW;
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 if (nCount<=1)
-//UNUSED2008-05 return 0; // leer
-//UNUSED2008-05 else
-//UNUSED2008-05 return pData[nCount-2].nRow;
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-
-
sal_Bool ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const
{
DBG_ASSERT( nCount, "nCount == 0" );
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCSIZE nStart = 0;
// Skip first entry if more than 1 row.
@@ -1889,7 +1855,7 @@ sal_Bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) con
return sal_True;
}
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
// loop backwards from the end instead of using Search, assuming that
// there usually aren't many attributes below the last cell
@@ -1910,7 +1876,7 @@ sal_Bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) con
SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow;
if ( nAttrSize >= SC_VISATTR_STOP )
{
- bFound = sal_False; // ignore this range and below
+ bFound = false; // ignore this range and below
}
else if ( !bFound && pData[nEndPos].pPattern->IsVisible() )
{
@@ -1930,7 +1896,7 @@ sal_Bool ScAttrArray::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
SCSIZE nIndex;
Search( nStartRow, nIndex );
SCROW nThisStart = nStartRow;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
while ( nIndex < nCount && nThisStart <= nEndRow && !bFound )
{
if ( pData[nIndex].pPattern->IsVisible() )
@@ -1983,7 +1949,7 @@ sal_Bool ScAttrArray::IsVisibleEqual( const ScAttrArray& rOther,
sal_Bool ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const
{
- //! mit IsVisibleEqual zusammenfassen?
+ // summarised with IsVisibleEqual
sal_Bool bEqual = sal_True;
SCSIZE nThisPos = 0;
@@ -2020,8 +1986,8 @@ sal_Bool ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SC
sal_Bool ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
{
- // horizontal zusammengefasste duerfen nicht herausgeschoben werden
- // (ob die ganze Zusammenfassung betroffen ist, ist hier nicht zu erkennen)
+ // Horizontal aggregate are not allowed to be moved out; if whole summary,
+ // here is not recognized
sal_Bool bTest = sal_True;
if (!IsEmpty())
@@ -2035,10 +2001,10 @@ sal_Bool ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
if ( ((const ScMergeFlagAttr&)pData[nIndex].pPattern->
GetItem(ATTR_MERGE_FLAG)).IsHorOverlapped() )
{
- bTest = sal_False; // darf nicht herausgeschoben werden
+ bTest = false; // may not be pushed out
break;
}
- if ( pData[nIndex].nRow >= nEndRow ) // Ende des Bereichs
+ if ( pData[nIndex].nRow >= nEndRow ) // end of range
break;
}
}
@@ -2048,12 +2014,11 @@ sal_Bool ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
sal_Bool ScAttrArray::TestInsertRow( SCSIZE nSize ) const
{
- // wenn die erste herausgeschobene Zeile vertikal ueberlappt ist,
- // wuerde eine kaputte Zusammenfassung uebrigbleiben
+ // if 1st row pushed out is vertically overlapped, summary would be broken
if (pData)
{
- // MAXROW + 1 - nSize = erste herausgeschobene Zeile
+ // MAXROW + 1 - nSize = 1st row pushed out
SCSIZE nFirstLost = nCount-1;
while ( nFirstLost && pData[nFirstLost-1].nRow >= sal::static_int_cast<SCROW>(MAXROW + 1 - nSize) )
@@ -2061,7 +2026,7 @@ sal_Bool ScAttrArray::TestInsertRow( SCSIZE nSize ) const
if ( ((const ScMergeFlagAttr&)pData[nFirstLost].pPattern->
GetItem(ATTR_MERGE_FLAG)).IsVerOverlapped() )
- return sal_False;
+ return false;
}
return sal_True;
@@ -2073,12 +2038,11 @@ void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize )
if (!pData)
return;
- SCROW nSearch = nStartRow > 0 ? nStartRow - 1 : 0; // Vorgaenger erweitern
+ SCROW nSearch = nStartRow > 0 ? nStartRow - 1 : 0; // expand predecessor
SCSIZE nIndex;
Search( nSearch, nIndex );
- // ein gesetztes ScMergeAttr darf nicht ausgedehnt werden
- // (darum hinterher wieder loeschen)
+ // set ScMergeAttr may not be extended (so behind delete again)
sal_Bool bDoMerge = ((const ScMergeAttr&) pData[nIndex].pPattern->GetItem(ATTR_MERGE)).IsMerged();
@@ -2087,29 +2051,29 @@ void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize )
for (i = nIndex; i < nCount-1; i++)
{
SCROW nNew = pData[i].nRow + nSize;
- if ( nNew >= MAXROW ) // Ende erreicht ?
+ if ( nNew >= MAXROW ) // at end?
{
nNew = MAXROW;
if (!nRemove)
- nRemove = i+1; // folgende loeschen
+ nRemove = i+1; // remove the following?
}
pData[i].nRow = nNew;
}
- // muessen Eintraege am Ende geloescht werden?
+ // Remove entries at end ?
if (nRemove && nRemove < nCount)
DeleteRange( nRemove, nCount-1 );
- if (bDoMerge) // ausgedehntes ScMergeAttr wieder reparieren
+ if (bDoMerge) // extensively repair (again) ScMergeAttr
{
- //! ApplyAttr fuer Bereiche !!!
+ // ApplyAttr for areas
const SfxPoolItem& rDef = pDocument->GetPool()->GetDefaultItem( ATTR_MERGE );
for (SCSIZE nAdd=0; nAdd<nSize; nAdd++)
pDocument->ApplyAttr( nCol, nStartRow+nAdd, nTab, rDef );
- // im eingefuegten Bereich ist nichts zusammengefasst
+ // reply inserts in this area not summarized
}
// Don't duplicate the merge flags in the inserted row.
@@ -2133,7 +2097,7 @@ void ScAttrArray::DeleteRow( SCROW nStartRow, SCSIZE nSize )
if (bFirst)
{
nStartIndex = i;
- bFirst = sal_False;
+ bFirst = false;
}
nEndIndex = i;
}
@@ -2162,9 +2126,8 @@ void ScAttrArray::DeleteRow( SCROW nStartRow, SCSIZE nSize )
if (pData[i].nRow >= nStartRow)
pData[i].nRow -= nSize;
-// unten nicht Default-Pattern nachschieben, um Druckbereiche erkennen zu koennen
-// stattdessen nur Merge-Flags loeschen
-
+ // Below does not follow the pattern to detect pressure ranges;
+ // instead, only remove merge flags.
RemoveFlags( MAXROW-nSize+1, MAXROW, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO );
}
}
@@ -2183,12 +2146,12 @@ void ScAttrArray::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex )
void ScAttrArray::DeleteArea(SCROW nStartRow, SCROW nEndRow)
{
- RemoveAreaMerge( nStartRow, nEndRow ); // von zusammengefassten auch die Flags loeschen
+ RemoveAreaMerge( nStartRow, nEndRow ); // remove from combined flags
if ( !HasAttrib( nStartRow, nEndRow, HASATTR_OVERLAPPED | HASATTR_AUTOFILTER) )
SetPatternArea( nStartRow, nEndRow, pDocument->GetDefPattern() );
else
- DeleteAreaSafe( nStartRow, nEndRow ); // Merge-Flags stehenlassen
+ DeleteAreaSafe( nStartRow, nEndRow ); // leave merge flags
}
@@ -2209,7 +2172,7 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
{
pOldPattern = pData[nIndex].pPattern;
- if ( pOldPattern->GetItemSet().Count() ) // harte Attribute ?
+ if ( pOldPattern->GetItemSet().Count() ) // hard attributes ?
{
nRow = pData[nIndex].nRow;
SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
@@ -2221,11 +2184,11 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
rSet.ClearItem(nId);
if ( aNewPattern == *pDefPattern )
- SetPatternArea( nThisRow, nAttrRow, pDefPattern, sal_False );
+ SetPatternArea( nThisRow, nAttrRow, pDefPattern, false );
else
SetPatternArea( nThisRow, nAttrRow, &aNewPattern, sal_True );
- Search( nThisRow, nIndex ); // Daten wurden veraendert !!!
+ Search( nThisRow, nIndex ); // data changed
}
++nIndex;
@@ -2233,7 +2196,8 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
}
}
- // Verschieben innerhalb eines Dokuments
+
+// move within a document
void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray)
{
@@ -2242,7 +2206,7 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray
{
if ((pData[i].nRow >= nStartRow) && ((i==0) ? sal_True : pData[i-1].nRow < nEndRow))
{
- // Kopieren (bPutToPool=sal_True)
+ // copy (bPutToPool=TRUE)
rAttrArray.SetPatternArea( nStart, Min( (SCROW)pData[i].nRow, (SCROW)nEndRow ),
pData[i].pPattern, sal_True );
}
@@ -2252,12 +2216,12 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray
}
- // Kopieren zwischen Dokumenten (Clipboard)
+// copy between documents (Clipboard)
void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray,
sal_Int16 nStripFlags )
{
- nStartRow -= nDy; // Source
+ nStartRow -= nDy; // Source
nEndRow -= nDy;
SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0);
@@ -2276,7 +2240,7 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArra
if (IsDefaultItem( pOldPattern ))
{
- // am Default muss nichts veraendert werden
+ // default: nothing changed
pNewPattern = (const ScPatternAttr*)
&pDestDocPool->GetDefaultItem( ATTR_PATTERN );
@@ -2312,18 +2276,19 @@ void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArra
Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern);
}
- // when pasting from clipboard and skipping filtered rows, the adjusted end position
- // can be negative
+ // when pasting from clipboard and skipping filtered rows, the adjusted
+ // end position can be negative
nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1));
}
}
- // Flags stehenlassen
- //! mit CopyArea zusammenfassen !!!
+
+// leave flags
+// summarized with CopyArea
void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray )
{
- nStartRow -= nDy; // Source
+ nStartRow -= nDy; // Source
nEndRow -= nDy;
SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0);
@@ -2352,11 +2317,11 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr
pNewPattern = pOldPattern->PutInPool( rAttrArray.pDocument, pDocument );
rAttrArray.SetPatternAreaSafe(nDestStart,
- Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, sal_False);
+ Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, false);
}
- // when pasting from clipboard and skipping filtered rows, the adjusted end position
- // can be negative
+ // when pasting from clipboard and skipping filtered rows, the adjusted
+ // end position can be negative
nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1));
}
}
@@ -2365,7 +2330,7 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr
SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle,
sal_Bool bUp, ScMarkArray* pMarkArray )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if (pMarkArray)
{
@@ -2419,7 +2384,7 @@ SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle,
}
}
- DBG_ASSERT( bFound || !ValidRow(nRow), "interner Fehler in ScAttrArray::SearchStyle" );
+ DBG_ASSERT( bFound || !ValidRow(nRow), "Internal failure in in ScAttrArray::SearchStyle" );
return nRow;
}
@@ -2453,7 +2418,7 @@ sal_Bool ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow,
rEndRow = pData[nIndex].nRow;
if (pMarkArray)
{
- SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, sal_False );
+ SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, false );
if (nMarkEnd<rEndRow)
rEndRow = nMarkEnd;
}
@@ -2462,150 +2427,7 @@ sal_Bool ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow,
return sal_True;
}
else
- return sal_False;
-}
-
-//------------------------------------------------------------------------
-//
-// Laden / Speichern
-//
-
-
-#if 0
-void ScAttrArray::Save( SvStream& /* rStream */ ) const
-{
-#if SC_ROWLIMIT_STREAM_ACCESS
-#error address types changed!
- ScWriteHeader aHdr( rStream, 8 );
-
- ScDocumentPool* pDocPool = pDocument->GetPool();
-
- sal_uInt16 nSaveCount = nCount;
- SCROW nSaveMaxRow = pDocument->GetSrcMaxRow();
- if ( nSaveMaxRow != MAXROW )
- {
- if ( nSaveCount > 1 && pData[nSaveCount-2].nRow >= nSaveMaxRow )
- {
- pDocument->SetLostData(); // Warnung ausgeben
- do
- --nSaveCount;
- while ( nSaveCount > 1 && pData[nSaveCount-2].nRow >= nSaveMaxRow );
- }
- }
-
- rStream << nSaveCount;
-
- const SfxPoolItem* pItem;
- for (SCSIZE i=0; i<nSaveCount; i++)
- {
- rStream << Min( pData[i].nRow, nSaveMaxRow );
-
- const ScPatternAttr* pPattern = pData[i].pPattern;
- pDocPool->StoreSurrogate( rStream, pPattern );
-
- // sal_False, weil ATTR_CONDITIONAL (noch) nicht in Vorlagen:
- if (pPattern->GetItemSet().GetItemState(ATTR_CONDITIONAL,sal_False,&pItem) == SFX_ITEM_SET)
- pDocument->SetConditionalUsed( ((const SfxUInt32Item*)pItem)->GetValue() );
-
- if (pPattern->GetItemSet().GetItemState(ATTR_VALIDDATA,sal_False,&pItem) == SFX_ITEM_SET)
- pDocument->SetValidationUsed( ((const SfxUInt32Item*)pItem)->GetValue() );
- }
-#endif // SC_ROWLIMIT_STREAM_ACCESS
-}
-
-
-void ScAttrArray::Load( SvStream& /* rStream */ )
-{
-#if SC_ROWLIMIT_STREAM_ACCESS
-#error address types changed!
- ScDocumentPool* pDocPool = pDocument->GetPool();
-
- ScReadHeader aHdr( rStream );
-
- sal_uInt16 nNewCount;
- rStream >> nNewCount;
- if ( nNewCount > MAXROW+1 ) // wuerde das Array zu gross?
- {
- pDocument->SetLostData();
- rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
- return;
- }
-
- Reset( pDocument->GetDefPattern(), sal_False ); // loeschen
- pData = new ScAttrEntry[nNewCount]; // neu anlegen
- for (SCSIZE i=0; i<nNewCount; i++)
- {
- rStream >> pData[i].nRow;
-
- sal_uInt16 nWhich = ATTR_PATTERN;
- const ScPatternAttr* pNewPattern = (const ScPatternAttr*)
- pDocPool->LoadSurrogate( rStream, nWhich, ATTR_PATTERN );
- if (!pNewPattern)
- {
- // da is was schiefgelaufen
- DBG_ERROR("ScAttrArray::Load: Surrogat nicht im Pool");
- pNewPattern = pDocument->GetDefPattern();
- }
- ScDocumentPool::CheckRef( *pNewPattern );
- pData[i].pPattern = pNewPattern;
-
- // LoadSurrogate erhoeht auch die Ref
- }
- nCount = nLimit = nNewCount;
-
- if ( nCount > 1 && pData[nCount-2].nRow >= MAXROW ) // faengt ein Attribut hinter MAXROW an?
- {
- pDocument->SetLostData();
- rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
- return;
- }
-
- if ( pDocument->GetSrcMaxRow() != MAXROW ) // Ende anpassen?
- {
- // Ende immer auf MAXROW umsetzen (nur auf 32 Bit)
-
- DBG_ASSERT( pData[nCount-1].nRow == pDocument->GetSrcMaxRow(), "Attribut-Ende ?!?" );
- pData[nCount-1].nRow = MAXROW;
- }
-#endif // SC_ROWLIMIT_STREAM_ACCESS
+ return false;
}
-#endif
-
-
-//UNUSED2008-05 void ScAttrArray::ConvertFontsAfterLoad()
-//UNUSED2008-05 {
-//UNUSED2008-05 ScFontToSubsFontConverter_AutoPtr xFontConverter;
-//UNUSED2008-05 const sal_uLong nFlags = FONTTOSUBSFONT_IMPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS;
-//UNUSED2008-05 SCSIZE nIndex = 0;
-//UNUSED2008-05 SCROW nThisRow = 0;
-//UNUSED2008-05
-//UNUSED2008-05 while ( nThisRow <= MAXROW )
-//UNUSED2008-05 {
-//UNUSED2008-05 const ScPatternAttr* pOldPattern = pData[nIndex].pPattern;
-//UNUSED2008-05 const SfxPoolItem* pItem;
-//UNUSED2008-05 if( pOldPattern->GetItemSet().GetItemState( ATTR_FONT, sal_False, &pItem ) == SFX_ITEM_SET )
-//UNUSED2008-05 {
-//UNUSED2008-05 const SvxFontItem* pFontItem = (const SvxFontItem*) pItem;
-//UNUSED2008-05 const String& rOldName = pFontItem->GetFamilyName();
-//UNUSED2008-05 xFontConverter = CreateFontToSubsFontConverter( rOldName, nFlags );
-//UNUSED2008-05 if ( xFontConverter )
-//UNUSED2008-05 {
-//UNUSED2008-05 String aNewName( GetFontToSubsFontName( xFontConverter ) );
-//UNUSED2008-05 if ( aNewName != rOldName )
-//UNUSED2008-05 {
-//UNUSED2008-05 SCROW nAttrRow = pData[nIndex].nRow;
-//UNUSED2008-05 SvxFontItem aNewItem( pFontItem->GetFamily(), aNewName,
-//UNUSED2008-05 pFontItem->GetStyleName(), pFontItem->GetPitch(),
-//UNUSED2008-05 RTL_TEXTENCODING_DONTKNOW, ATTR_FONT );
-//UNUSED2008-05 ScPatternAttr aNewPattern( *pOldPattern );
-//UNUSED2008-05 aNewPattern.GetItemSet().Put( aNewItem );
-//UNUSED2008-05 SetPatternArea( nThisRow, nAttrRow, &aNewPattern, sal_True );
-//UNUSED2008-05 Search( nThisRow, nIndex ); //! data changed
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 ++nIndex;
-//UNUSED2008-05 nThisRow = pData[nIndex-1].nRow+1;
-//UNUSED2008-05 }
-//UNUSED2008-05 }
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 0573e4fda76f..7474fb580d72 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,10 +77,9 @@ TYPEINIT1(ScPageScaleToItem, SfxPoolItem);
sal_Bool ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther )
{
-// DBG_ASSERT( pThis || pOther, "LineAttr == 0" );
if (!pThis)
- return sal_False;
+ return false;
if (!pOther)
return sal_True;
@@ -89,13 +89,13 @@ sal_Bool ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther
if (nThisSize > nOtherSize)
return sal_True;
else if (nThisSize < nOtherSize)
- return sal_False;
+ return false;
else
{
if ( pOther->GetInWidth() && !pThis->GetInWidth() )
return sal_True;
else if ( pThis->GetInWidth() && !pOther->GetInWidth() )
- return sal_False;
+ return false;
else
{
return sal_True; //! ???
@@ -206,9 +206,9 @@ ScMergeFlagAttr::~ScMergeFlagAttr()
ScProtectionAttr::ScProtectionAttr():
SfxPoolItem(ATTR_PROTECTION),
bProtection(sal_True),
- bHideFormula(sal_False),
- bHideCell(sal_False),
- bHidePrint(sal_False)
+ bHideFormula(false),
+ bHideCell(false),
+ bHidePrint(false)
{
}
@@ -241,7 +241,7 @@ ScProtectionAttr::~ScProtectionAttr()
//------------------------------------------------------------------------
-sal_Bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId )
@@ -265,16 +265,16 @@ sal_Bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) con
case MID_4 :
rVal <<= (sal_Bool ) bHidePrint; break;
default:
- DBG_ERROR("Wrong MemberID!");
- return sal_False;
+ OSL_FAIL("Wrong MemberID!");
+ return false;
}
- return sal_True;
+ return true;
}
-sal_Bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
sal_Bool bVal = sal_Bool();
nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId )
@@ -288,11 +288,11 @@ sal_Bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
bHideFormula = aProtection.IsFormulaHidden;
bHideCell = aProtection.IsHidden;
bHidePrint = aProtection.IsPrintHidden;
- bRet = sal_True;
+ bRet = true;
}
else
{
- DBG_ERROR("exception - wrong argument");
+ OSL_FAIL("exception - wrong argument");
}
break;
}
@@ -305,7 +305,7 @@ sal_Bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case MID_4 :
bRet = (rVal >>= bVal); if (bRet) bHidePrint=bVal; break;
default:
- DBG_ERROR("Wrong MemberID!");
+ OSL_FAIL("Wrong MemberID!");
}
return bRet;
@@ -478,7 +478,7 @@ SfxItemPresentation ScRangeItem::GetPresentation
case SFX_ITEM_PRESENTATION_COMPLETE:
rText = ScGlobal::GetRscString(STR_AREA);
rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
-// break;// Durchfallen !!!
+ /* !!! fall-through !!! */
case SFX_ITEM_PRESENTATION_NAMELESS:
{
@@ -519,15 +519,6 @@ ScTableListItem::ScTableListItem( const ScTableListItem& rCpy )
// -----------------------------------------------------------------------
-//UNUSED2008-05 ScTableListItem::ScTableListItem( const sal_uInt16 nWhichP, const List& rList )
-//UNUSED2008-05 : SfxPoolItem ( nWhichP ),
-//UNUSED2008-05 nCount ( 0 ),
-//UNUSED2008-05 pTabArr ( NULL )
-//UNUSED2008-05 {
-//UNUSED2008-05 SetTableList( rList );
-//UNUSED2008-05 }
-
-// -----------------------------------------------------------------------
ScTableListItem::~ScTableListItem()
{
@@ -631,35 +622,6 @@ SfxItemPresentation ScTableListItem::GetPresentation
return SFX_ITEM_PRESENTATION_NONE;
}
-// -----------------------------------------------------------------------
-
-//UNUSED2009-05 sal_Bool ScTableListItem::GetTableList( List& aList ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 for ( sal_uInt16 i=0; i<nCount; i++ )
-//UNUSED2009-05 aList.Insert( new SCTAB( pTabArr[i] ) );
-//UNUSED2009-05
-//UNUSED2009-05 return ( nCount > 0 );
-//UNUSED2009-05 }
-
-// -----------------------------------------------------------------------
-
-//UNUSED2009-05 void ScTableListItem::SetTableList( const List& rList )
-//UNUSED2009-05 {
-//UNUSED2009-05 nCount = (sal_uInt16)rList.Count();
-//UNUSED2009-05
-//UNUSED2009-05 delete [] pTabArr;
-//UNUSED2009-05
-//UNUSED2009-05 if ( nCount > 0 )
-//UNUSED2009-05 {
-//UNUSED2009-05 pTabArr = new SCTAB [nCount];
-//UNUSED2009-05
-//UNUSED2009-05 for ( sal_uInt16 i=0; i<nCount; i++ )
-//UNUSED2009-05 pTabArr[i] = *( (SCTAB*)rList.GetObject( i ) );
-//UNUSED2009-05 }
-//UNUSED2009-05 else
-//UNUSED2009-05 pTabArr = NULL;
-//UNUSED2009-05 }
-
// -----------------------------------------------------------------------
// ScPageHFItem - Daten der Kopf-/Fusszeilen
@@ -700,18 +662,18 @@ ScPageHFItem::~ScPageHFItem()
//------------------------------------------------------------------------
-sal_Bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const
+bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const
{
uno::Reference<sheet::XHeaderFooterContent> xContent =
new ScHeaderFooterContentObj( pLeftArea, pCenterArea, pRightArea );
rVal <<= xContent;
- return sal_True;
+ return true;
}
-sal_Bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ )
+bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
uno::Reference<sheet::XHeaderFooterContent> xContent;
if ( rVal >>= xContent )
{
@@ -745,17 +707,17 @@ sal_Bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */
pRightArea = aEngine.CreateTextObject();
}
- bRet = sal_True;
+ bRet = true;
}
}
}
if (!bRet)
{
- DBG_ERROR("exception - wrong argument");
+ OSL_FAIL("exception - wrong argument");
}
- return bRet;
+ return true;
}
//------------------------------------------------------------------------
@@ -798,7 +760,7 @@ void lcl_SetSpace( String& rStr, const ESelection& rSel )
sal_Bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands)
{
- sal_Bool bChange = sal_False;
+ sal_Bool bChange = false;
sal_uInt16 nParCnt = rEng.GetParagraphCount();
for (sal_uInt16 nPar = 0; nPar<nParCnt; nPar++)
{
@@ -931,63 +893,6 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
//------------------------------------------------------------------------
-//UNUSED2009-05 class ScFieldChangerEditEngine : public ScEditEngineDefaulter
-//UNUSED2009-05 {
-//UNUSED2009-05 TypeId aExtFileId;
-//UNUSED2009-05 sal_uInt16 nConvPara;
-//UNUSED2009-05 xub_StrLen nConvPos;
-//UNUSED2009-05 sal_Bool bConvert;
-//UNUSED2009-05
-//UNUSED2009-05 public:
-//UNUSED2009-05 ScFieldChangerEditEngine( SfxItemPool* pEnginePool, sal_Bool bDeleteEnginePool );
-//UNUSED2009-05 virtual ~ScFieldChangerEditEngine() {}
-//UNUSED2009-05
-//UNUSED2009-05 virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara,
-//UNUSED2009-05 sal_uInt16 nPos, Color*& rTxtColor,
-//UNUSED2009-05 Color*& rFldColor );
-//UNUSED2009-05
-//UNUSED2009-05 sal_Bool ConvertFields();
-//UNUSED2009-05 };
-//UNUSED2009-05
-//UNUSED2009-05 ScFieldChangerEditEngine::ScFieldChangerEditEngine( SfxItemPool* pEnginePoolP,
-//UNUSED2009-05 sal_Bool bDeleteEnginePoolP ) :
-//UNUSED2009-05 ScEditEngineDefaulter( pEnginePoolP, bDeleteEnginePoolP ),
-//UNUSED2009-05 aExtFileId( TYPE( SvxExtFileField ) ),
-//UNUSED2009-05 nConvPara( 0 ),
-//UNUSED2009-05 nConvPos( 0 ),
-//UNUSED2009-05 bConvert( sal_False )
-//UNUSED2009-05 {
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 String ScFieldChangerEditEngine::CalcFieldValue( const SvxFieldItem& rField,
-//UNUSED2009-05 sal_uInt16 nPara, sal_uInt16 nPos, Color*& /* rTxtColor */, Color*& /* rFldColor */ )
-//UNUSED2009-05 {
-//UNUSED2009-05 const SvxFieldData* pFieldData = rField.GetField();
-//UNUSED2009-05 if ( pFieldData && pFieldData->Type() == aExtFileId )
-//UNUSED2009-05 {
-//UNUSED2009-05 bConvert = sal_True;
-//UNUSED2009-05 nConvPara = nPara;
-//UNUSED2009-05 nConvPos = nPos;
-//UNUSED2009-05 }
-//UNUSED2009-05 return EMPTY_STRING;
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 sal_Bool ScFieldChangerEditEngine::ConvertFields()
-//UNUSED2009-05 {
-//UNUSED2009-05 sal_Bool bConverted = sal_False;
-//UNUSED2009-05 do
-//UNUSED2009-05 {
-//UNUSED2009-05 bConvert = sal_False;
-//UNUSED2009-05 UpdateFields();
-//UNUSED2009-05 if ( bConvert )
-//UNUSED2009-05 {
-//UNUSED2009-05 ESelection aSel( nConvPara, nConvPos, nConvPara, nConvPos+1 );
-//UNUSED2009-05 QuickInsertField( SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD), aSel );
-//UNUSED2009-05 bConverted = sal_True;
-//UNUSED2009-05 }
-//UNUSED2009-05 } while ( bConvert );
-//UNUSED2009-05 return bConverted;
-//UNUSED2009-05 }
void ScPageHFItem::SetLeftArea( const EditTextObject& rNew )
{
@@ -1019,7 +924,7 @@ void ScPageHFItem::SetArea( EditTextObject *pNew, int nArea )
case SC_HF_CENTERAREA: delete pCenterArea; pCenterArea = pNew; break;
case SC_HF_RIGHTAREA: delete pRightArea; pRightArea = pNew; break;
default:
- DBG_ERROR( "New Area?" );
+ OSL_FAIL( "New Area?" );
}
}
@@ -1083,7 +988,7 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation
ePres = SFX_ITEM_PRESENTATION_NAMELESS;//das geht immer!
break;
}
-// break; // DURCHFALLEN!!!
+ /* !!! fall-through !!! */
case SFX_ITEM_PRESENTATION_NAMELESS:
rText += ScGlobal::GetRscString(STR_VOBJ_MODE_SHOW+GetValue());
@@ -1183,7 +1088,6 @@ int ScDoubleItem::operator==( const SfxPoolItem& rItem ) const
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
const ScDoubleItem& _rItem = (const ScDoubleItem&)rItem;
return int(nValue == _rItem.nValue);
- //int(nValue == ((const ScDoubleItem&)rItem).nValue);
}
//------------------------------------------------------------------------
@@ -1296,23 +1200,23 @@ SfxItemPresentation ScPageScaleToItem::GetPresentation(
return ePres;
}
-sal_Bool ScPageScaleToItem::QueryValue( uno::Any& rAny, sal_uInt8 nMemberId ) const
+bool ScPageScaleToItem::QueryValue( uno::Any& rAny, sal_uInt8 nMemberId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nMemberId )
{
case SC_MID_PAGE_SCALETO_WIDTH: rAny <<= mnWidth; break;
case SC_MID_PAGE_SCALETO_HEIGHT: rAny <<= mnHeight; break;
default:
DBG_ERRORFILE( "ScPageScaleToItem::QueryValue - unknown member ID" );
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
-sal_Bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId )
+bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
switch( nMemberId )
{
case SC_MID_PAGE_SCALETO_WIDTH: bRet = rAny >>= mnWidth; break;
@@ -1326,3 +1230,4 @@ sal_Bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx
index c9abd4aa90b8..039aedf2735c 100644
--- a/sc/source/core/data/autonamecache.cxx
+++ b/sc/source/core/data/autonamecache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@ ScAutoNameCache::~ScAutoNameCache()
{
}
-const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurences( const String& rName, SCTAB nTab )
+const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurrences( const String& rName, SCTAB nTab )
{
if ( nTab != nCurrentTab )
{
@@ -107,3 +108,4 @@ const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurences( const String& rNa
return rAddresses;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 90bce11563a0..f31bd26958e2 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,15 +106,12 @@ static SCSIZE initSlotDistribution( ScSlotDistribution & rSD, SCSIZE & rBSR )
// Must be sorted by row1,row2!
while (nRow2 <= MAXROWCOUNT)
{
- //fprintf( stderr, "r1,r2,slice,cum: %7zu, %7zu, %7zu, %7zu\n", (size_t)nRow1, (size_t)nRow2, (size_t)nSlice, (size_t)nSlots);
- // {0,32k,128,0;32k,64k,256,0+256;64k,128k,512,0+256+128;128k,256k,1024,0+256+128+128;256k,512k,2048,...;512k,1M,4096,...}
rSD.push_back( ScSlotData( nRow1, nRow2, nSlice, nSlots));
nSlots += (nRow2 - nRow1) / nSlice;
nRow1 = nRow2;
nRow2 *= 2;
nSlice *= 2;
}
- //fprintf( stderr, "Slices: %zu, slots per sheet: %zu, memory per referenced sheet: %zu\n", (size_t) nSlots, (size_t) nSlots * BCA_SLOTS_COL, (size_t) nSlots * BCA_SLOTS_COL * sizeof(void*));
rBSR = nSlots;
return nSlots;
}
@@ -142,7 +140,7 @@ ScBroadcastAreaSlot::~ScBroadcastAreaSlot()
// deleted.
ScBroadcastArea* pArea = *aIter;
// Erase all so no hash will be accessed upon destruction of the
- // hash_set.
+ // boost::unordered_map.
aBroadcastAreaTbl.erase( aIter++);
if (!pArea->DecRef())
delete pArea;
@@ -166,7 +164,7 @@ bool ScBroadcastAreaSlot::CheckHardRecalcStateCondition() const
if ( pShell )
pShell->SetError( SCWARN_CORE_HARD_RECALC, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
- pDoc->SetAutoCalc( sal_False );
+ pDoc->SetAutoCalc( false );
pDoc->SetHardRecalcState( 2 );
}
return true;
@@ -281,8 +279,8 @@ ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea(
sal_Bool ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const
{
if (aBroadcastAreaTbl.empty())
- return sal_False;
- sal_Bool bIsBroadcasted = sal_False;
+ return false;
+ sal_Bool bIsBroadcasted = false;
const ScAddress& rAddress = rHint.GetAddress();
for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin());
aIter != aBroadcastAreaTbl.end(); /* increment in body */ )
@@ -310,8 +308,8 @@ sal_Bool ScBroadcastAreaSlot::AreaBroadcastInRange( const ScRange& rRange,
const ScHint& rHint) const
{
if (aBroadcastAreaTbl.empty())
- return sal_False;
- sal_Bool bIsBroadcasted = sal_False;
+ return false;
+ sal_Bool bIsBroadcasted = false;
for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin());
aIter != aBroadcastAreaTbl.end(); /* increment in body */ )
{
@@ -542,7 +540,6 @@ inline void ComputeNextSlot( SCSIZE & nOff, SCSIZE & nBreak, ScBroadcastAreaSlot
void ScBroadcastAreaSlotMachine::StartListeningArea( const ScRange& rRange,
SvtListener* pListener )
{
- //fprintf( stderr, "StartListeningArea (c,r,t): %d, %d, %d, %d, %d, %d\n", (int)rRange.aStart.Col(), (int)rRange.aStart.Row(), (int)rRange.aStart.Tab(), (int)rRange.aEnd.Col(), (int)rRange.aEnd.Row(), (int)rRange.aEnd.Tab());
if ( rRange == BCA_LISTEN_ALWAYS )
{
if ( !pBCAlways )
@@ -591,7 +588,6 @@ void ScBroadcastAreaSlotMachine::StartListeningArea( const ScRange& rRange,
void ScBroadcastAreaSlotMachine::EndListeningArea( const ScRange& rRange,
SvtListener* pListener )
{
- //fprintf( stderr, "EndListeningArea (c,r,t): %d, %d, %d, %d, %d, %d\n", (int)rRange.aStart.Col(), (int)rRange.aStart.Row(), (int)rRange.aStart.Tab(), (int)rRange.aEnd.Col(), (int)rRange.aEnd.Row(), (int)rRange.aEnd.Tab());
if ( rRange == BCA_LISTEN_ALWAYS )
{
DBG_ASSERT( pBCAlways, "ScBroadcastAreaSlotMachine::EndListeningArea: BCA_LISTEN_ALWAYS but none established");
@@ -654,19 +650,19 @@ sal_Bool ScBroadcastAreaSlotMachine::AreaBroadcast( const ScHint& rHint ) const
return sal_True;
}
else
- return sal_False;
+ return false;
}
else
{
TableSlotsMap::const_iterator iTab( aTableSlotsMap.find( rAddress.Tab()));
if (iTab == aTableSlotsMap.end())
- return sal_False;
+ return false;
ScBroadcastAreaSlot* pSlot = (*iTab).second->getAreaSlot(
ComputeSlotOffset( rAddress));
if ( pSlot )
return pSlot->AreaBroadcast( rHint );
else
- return sal_False;
+ return false;
}
}
@@ -674,7 +670,7 @@ sal_Bool ScBroadcastAreaSlotMachine::AreaBroadcast( const ScHint& rHint ) const
sal_Bool ScBroadcastAreaSlotMachine::AreaBroadcastInRange( const ScRange& rRange,
const ScHint& rHint ) const
{
- sal_Bool bBroadcasted = sal_False;
+ sal_Bool bBroadcasted = false;
SCTAB nEndTab = rRange.aEnd.Tab();
for (TableSlotsMap::const_iterator iTab( aTableSlotsMap.lower_bound( rRange.aStart.Tab()));
iTab != aTableSlotsMap.end() && (*iTab).first <= nEndTab; ++iTab)
@@ -898,7 +894,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas(
// unchain
pArea->SetUpdateChainNext( NULL );
- pArea->SetInUpdateChain( sal_False );
+ pArea->SetInUpdateChain( false );
// Delete if not inserted to any slot. RemoveBulkArea(pArea) was
// already executed in UpdateRemove().
@@ -935,3 +931,5 @@ size_t ScBroadcastAreaSlotMachine::RemoveBulkArea( const ScBroadcastArea* pArea
{
return aBulkBroadcastAreas.erase( pArea );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 3f7cc4cbfdc9..d3e9cb8db5a5 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,6 +52,7 @@
#include "recursionhelper.hxx"
#include "postit.hxx"
#include "externalrefmgr.hxx"
+#include "macromgr.hxx"
#include <editeng/editobj.hxx>
#include <svl/intitem.hxx>
#include <editeng/flditem.hxx>
@@ -125,7 +127,7 @@ ScBaseCell* lclCloneCell( const ScBaseCell& rSrcCell, ScDocument& rDestDoc, cons
return new ScNoteCell;
default:;
}
- DBG_ERROR( "lclCloneCell - unknown cell type" );
+ OSL_FAIL( "lclCloneCell - unknown cell type" );
return 0;
}
@@ -179,7 +181,7 @@ void ScBaseCell::Delete()
delete (ScNoteCell*) this;
break;
default:
- DBG_ERROR("Unbekannter Zellentyp");
+ OSL_FAIL("Unbekannter Zellentyp");
break;
}
}
@@ -312,7 +314,7 @@ void ScBaseCell::StartListeningTo( ScDocument* pDoc )
}
}
}
- pFormCell->SetNeedsListening( sal_False);
+ pFormCell->SetNeedsListening( false);
}
}
@@ -427,7 +429,7 @@ sal_Bool ScBaseCell::HasEmptyData() const
case CELLTYPE_FORMULA :
return ((ScFormulaCell*)this)->IsEmpty();
default:
- return sal_False;
+ return false;
}
}
@@ -441,7 +443,7 @@ sal_Bool ScBaseCell::HasValueData() const
case CELLTYPE_FORMULA :
return ((ScFormulaCell*)this)->IsValue();
default:
- return sal_False;
+ return false;
}
}
@@ -456,7 +458,7 @@ sal_Bool ScBaseCell::HasStringData() const
case CELLTYPE_FORMULA :
return !((ScFormulaCell*)this)->IsValue();
default:
- return sal_False;
+ return false;
}
}
@@ -478,7 +480,6 @@ String ScBaseCell::GetStringData() const
return aStr;
}
-// static
sal_Bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 )
{
CellType eType1 = CELLTYPE_NONE;
@@ -500,7 +501,7 @@ sal_Bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCel
eType2 = CELLTYPE_NONE;
}
if ( eType1 != eType2 )
- return sal_False;
+ return false;
switch ( eType1 ) // beide Typen gleich
{
@@ -541,7 +542,7 @@ sal_Bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCel
for (sal_uInt16 i=0; i<nLen; i++)
if ( !ppToken1[i]->TextEqual(*(ppToken2[i])) )
{
- bEqual = sal_False;
+ bEqual = false;
break;
}
@@ -549,12 +550,12 @@ sal_Bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCel
return sal_True;
}
- return sal_False; // unterschiedlich lang oder unterschiedliche Tokens
+ return false; // unterschiedlich lang oder unterschiedliche Tokens
}
default:
- DBG_ERROR("huch, was fuer Zellen???");
+ OSL_FAIL("huch, was fuer Zellen???");
}
- return sal_False;
+ return false;
}
// ============================================================================
@@ -639,15 +640,15 @@ ScFormulaCell::ScFormulaCell() :
nFormatType( NUMBERFORMAT_NUMBER ),
nSeenInIteration(0),
cMatrixFlag ( MM_NONE ),
- bDirty( sal_False ),
- bChanged( sal_False ),
- bRunning( sal_False ),
- bCompile( sal_False ),
- bSubTotal( sal_False ),
- bIsIterCell( sal_False ),
- bInChangeTrack( sal_False ),
- bTableOpDirty( sal_False ),
- bNeedListening( sal_False ),
+ bDirty( false ),
+ bChanged( false ),
+ bRunning( false ),
+ bCompile( false ),
+ bSubTotal( false ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
aPos(0,0,0)
{
}
@@ -669,14 +670,14 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
nSeenInIteration(0),
cMatrixFlag ( cMatInd ),
bDirty( sal_True ), // -> wg. Benutzung im Fkt.AutoPiloten, war: cMatInd != 0
- bChanged( sal_False ),
- bRunning( sal_False ),
- bCompile( sal_False ),
- bSubTotal( sal_False ),
- bIsIterCell( sal_False ),
- bInChangeTrack( sal_False ),
- bTableOpDirty( sal_False ),
- bNeedListening( sal_False ),
+ bChanged( false ),
+ bRunning( false ),
+ bCompile( false ),
+ bSubTotal( false ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
aPos( rPos )
{
Compile( rFormula, sal_True, eGrammar ); // bNoListening, Insert does that
@@ -700,14 +701,14 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
nSeenInIteration(0),
cMatrixFlag ( cInd ),
bDirty( NULL != pArr ), // -> wg. Benutzung im Fkt.AutoPiloten, war: cInd != 0
- bChanged( sal_False ),
- bRunning( sal_False ),
- bCompile( sal_False ),
- bSubTotal( sal_False ),
- bIsIterCell( sal_False ),
- bInChangeTrack( sal_False ),
- bTableOpDirty( sal_False ),
- bNeedListening( sal_False ),
+ bChanged( false ),
+ bRunning( false ),
+ bCompile( false ),
+ bSubTotal( false ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
aPos( rPos )
{
// UPN-Array erzeugen
@@ -724,6 +725,9 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
if ( pCode->GetNextOpCodeRPN( ocSubTotal ) )
bSubTotal = sal_True;
}
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
}
ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, const ScAddress& rPos, int nCloneFlags ) :
@@ -742,13 +746,13 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
cMatrixFlag ( rCell.cMatrixFlag ),
bDirty( rCell.bDirty ),
bChanged( rCell.bChanged ),
- bRunning( sal_False ),
+ bRunning( false ),
bCompile( rCell.bCompile ),
bSubTotal( rCell.bSubTotal ),
- bIsIterCell( sal_False ),
- bInChangeTrack( sal_False ),
- bTableOpDirty( sal_False ),
- bNeedListening( sal_False ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
aPos( rPos )
{
pCode = rCell.pCode->Clone();
@@ -765,7 +769,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
bCompile = sal_True;
}
//! Compile ColRowNames on URM_MOVE/URM_COPY _after_ UpdateReference
- sal_Bool bCompileLater = sal_False;
+ sal_Bool bCompileLater = false;
sal_Bool bClipMode = rCell.pDocument->IsClipboard();
if( !bCompile )
{ // Name references with references and ColRowNames
@@ -773,14 +777,14 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
ScToken* t;
while ( ( t = static_cast<ScToken*>(pCode->GetNextReferenceOrName()) ) != NULL && !bCompile )
{
- if ( t->GetOpCode() == ocExternalRef )
+ if ( t->IsExternalRef() )
{
// External name, cell, and area references.
bCompile = true;
}
else if ( t->GetType() == svIndex )
{
- ScRangeData* pRangeData = rDoc.GetRangeName()->FindIndex( t->GetIndex() );
+ ScRangeData* pRangeData = rDoc.GetRangeName()->findByIndex( t->GetIndex() );
if( pRangeData )
{
if( pRangeData->HasReferences() )
@@ -814,11 +818,17 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
if( nCloneFlags & SC_CLONECELL_STARTLISTENING )
StartListeningTo( &rDoc );
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
}
ScFormulaCell::~ScFormulaCell()
{
pDocument->RemoveFromFormulaTree( this );
+ pDocument->RemoveSubTotalCell(this);
+ if (pCode->HasOpCode(ocMacro))
+ pDocument->GetMacroManager()->RemoveDependentCell(this);
if (pDocument->HasExternalRefManager())
pDocument->GetExternalRefManager()->removeRefCell(this);
@@ -870,7 +880,7 @@ void ScFormulaCell::GetFormula( rtl::OUStringBuffer& rBuffer,
}
else
{
- DBG_ERROR("ScFormulaCell::GetFormula: not a matrix");
+ OSL_FAIL("ScFormulaCell::GetFormula: not a matrix");
}
}
else
@@ -899,8 +909,7 @@ void ScFormulaCell::GetFormula( String& rFormula, const FormulaGrammar::Grammar
void ScFormulaCell::GetResultDimensions( SCSIZE& rCols, SCSIZE& rRows )
{
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
const ScMatrix* pMat = NULL;
if (!pCode->GetCodeError() && aResult.GetType() == svMatrixCell &&
@@ -932,7 +941,7 @@ void ScFormulaCell::Compile( const String& rFormula, sal_Bool bNoListening,
if( !pCode->GetCodeError() )
{
if ( !pCode->GetLen() && aResult.GetHybridFormula().Len() && rFormula == aResult.GetHybridFormula() )
- { // #65994# nicht rekursiv CompileTokenArray/Compile/CompileTokenArray
+ { // nicht rekursiv CompileTokenArray/Compile/CompileTokenArray
if ( rFormula.GetChar(0) == '=' )
pCode->AddBad( rFormula.GetBuffer() + 1 );
else
@@ -979,12 +988,15 @@ void ScFormulaCell::CompileTokenArray( sal_Bool bNoListening )
nFormatIndex = 0;
bChanged = sal_True;
aResult.SetToken( NULL);
- bCompile = sal_False;
+ bCompile = false;
if ( !bNoListening )
StartListeningTo( pDocument );
}
if ( bWasInFormulaTree )
pDocument->PutInFormulaTree( this );
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
}
}
@@ -1025,9 +1037,12 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress )
nFormatType = aComp.GetNumFormatType();
nFormatIndex = 0;
bChanged = sal_True;
- bCompile = sal_False;
+ bCompile = false;
StartListeningTo( pDocument );
}
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
}
else
{
@@ -1045,7 +1060,7 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress )
void ScFormulaCell::CalcAfterLoad()
{
- sal_Bool bNewCompiled = sal_False;
+ sal_Bool bNewCompiled = false;
// Falls ein Calc 1.0-Doc eingelesen wird, haben wir ein Ergebnis,
// aber kein TokenArray
if( !pCode->GetLen() && aResult.GetHybridFormula().Len() )
@@ -1064,9 +1079,12 @@ void ScFormulaCell::CalcAfterLoad()
bSubTotal = aComp.CompileTokenArray();
nFormatType = aComp.GetNumFormatType();
nFormatIndex = 0;
- bDirty = sal_True;
- bCompile = sal_False;
- bNewCompiled = sal_True;
+ bDirty = true;
+ bCompile = false;
+ bNewCompiled = true;
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
}
// irgendwie koennen unter os/2 mit rotter FPU-Exception /0 ohne Err503
// gespeichert werden, woraufhin spaeter im NumberFormatter die BLC Lib
@@ -1111,101 +1129,8 @@ bool ScFormulaCell::MarkUsedExternalReferences()
}
-// FIXME: set to 0
-#define erDEBUGDOT 0
-// If set to 1, write output that's suitable for graphviz tools like dot.
-// Only node1 -> node2 entries are written, you'll have to manually surround
-// the file content with [strict] digraph name { ... }
-// The ``strict'' keyword might be necessary in case of multiple identical
-// paths like they occur in iterations, otherwise dot may consume too much
-// memory when generating the layout, or you'll get unreadable output. On the
-// other hand, information about recurring calculation is lost then.
-// Generates output only if variable nDebug is set in debugger, see below.
-// FIXME: currently doesn't cope with iterations and recursions. Code fragments
-// are a leftover from a previous debug session, meant as a pointer.
-#if erDEBUGDOT
-#include <cstdio>
-using ::std::fopen;
-using ::std::fprintf;
-#include <vector>
-static const char aDebugDotFile[] = "ttt_debug.dot";
-#endif
-
void ScFormulaCell::Interpret()
{
-
-#if erDEBUGDOT
- static int nDebug = 0;
- static const int erDEBUGDOTRUN = 3;
- static FILE* pDebugFile = 0;
- static sal_Int32 nDebugRootCount = 0;
- static unsigned int nDebugPathCount = 0;
- static ScAddress aDebugLastPos( ScAddress::INITIALIZE_INVALID);
- static ScAddress aDebugThisPos( ScAddress::INITIALIZE_INVALID);
- typedef ::std::vector< ByteString > DebugVector;
- static DebugVector aDebugVec;
- class DebugElement
- {
- public:
- static void push( ScFormulaCell* pCell )
- {
- aDebugThisPos = pCell->aPos;
- if (aDebugVec.empty())
- {
- ByteString aR( "root_");
- aR += ByteString::CreateFromInt32( ++nDebugRootCount);
- aDebugVec.push_back( aR);
- }
- String aStr;
- pCell->aPos.Format( aStr, SCA_VALID | SCA_TAB_3D, pCell->GetDocument(),
- pCell->GetDocument()->GetAddressConvention() );
- ByteString aB( aStr, RTL_TEXTENCODING_UTF8);
- aDebugVec.push_back( aB);
- }
- static void pop()
- {
- aDebugLastPos = aDebugThisPos;
- if (!aDebugVec.empty())
- {
- aDebugVec.pop_back();
- if (aDebugVec.size() == 1)
- {
- aDebugVec.pop_back();
- aDebugLastPos = ScAddress( ScAddress::INITIALIZE_INVALID);
- }
- }
- }
- DebugElement( ScFormulaCell* p ) { push(p); }
- ~DebugElement() { pop(); }
- };
- class DebugDot
- {
- public:
- static void out( const char* pColor )
- {
- if (nDebug != erDEBUGDOTRUN)
- return;
- char pColorString[256];
- sprintf( pColorString, (*pColor ?
- ",color=\"%s\",fontcolor=\"%s\"" : "%s%s"), pColor,
- pColor);
- size_t n = aDebugVec.size();
- fprintf( pDebugFile,
- "\"%s\" -> \"%s\" [label=\"%u\"%s]; // v:%d\n",
- aDebugVec[n-2].GetBuffer(), aDebugVec[n-1].GetBuffer(),
- ++nDebugPathCount, pColorString, n-1);
- fflush( pDebugFile);
- }
- };
- #define erDEBUGDOT_OUT( p ) (DebugDot::out(p))
- #define erDEBUGDOT_ELEMENT_PUSH( p ) (DebugElement::push(p))
- #define erDEBUGDOT_ELEMENT_POP() (DebugElement::pop())
-#else
- #define erDEBUGDOT_OUT( p )
- #define erDEBUGDOT_ELEMENT_PUSH( p )
- #define erDEBUGDOT_ELEMENT_POP()
-#endif
-
if (!IsDirtyOrInTableOpDirty() || pDocument->GetRecursionHelper().IsInReturn())
return; // no double/triple processing
@@ -1216,39 +1141,8 @@ void ScFormulaCell::Interpret()
if ( pDocument->IsInDdeLinkUpdate() )
return;
-#if erDEBUGDOT
- // set nDebug=1 in debugger to init things
- if (nDebug == 1)
- {
- ++nDebug;
- pDebugFile = fopen( aDebugDotFile, "a");
- if (!pDebugFile)
- nDebug = 0;
- else
- nDebug = erDEBUGDOTRUN;
- }
- // set nDebug=3 (erDEBUGDOTRUN) in debugger to get any output
- DebugElement aDebugElem( this);
- // set nDebug=5 in debugger to close output
- if (nDebug == 5)
- {
- nDebug = 0;
- fclose( pDebugFile);
- pDebugFile = 0;
- }
-#endif
-
if (bRunning)
{
-
-#if erDEBUGDOT
- if (!pDocument->GetRecursionHelper().IsDoingIteration() ||
- aDebugThisPos != aDebugLastPos)
- erDEBUGDOT_OUT(aDebugThisPos == aDebugLastPos ? "orange" :
- (pDocument->GetRecursionHelper().GetIteration() ? "blue" :
- "red"));
-#endif
-
if (!pDocument->GetDocOptions().IsIter())
{
aResult.SetResultError( errCircularReference );
@@ -1265,15 +1159,13 @@ void ScFormulaCell::Interpret()
return;
}
- // #63038# no multiple interprets for GetErrCode, IsValue, GetValue and
+ // no multiple interprets for GetErrCode, IsValue, GetValue and
// different entry point recursions. Would also lead to premature
// convergence in iterations.
if (pDocument->GetRecursionHelper().GetIteration() && nSeenInIteration ==
pDocument->GetRecursionHelper().GetIteration())
return ;
- erDEBUGDOT_OUT( pDocument->GetRecursionHelper().GetIteration() ? "magenta" : "");
-
ScRecursionHelper& rRecursionHelper = pDocument->GetRecursionHelper();
sal_Bool bOldRunning = bRunning;
if (rRecursionHelper.GetRecursionCount() > MAXRECURSION)
@@ -1396,7 +1288,7 @@ void ScFormulaCell::Interpret()
++aIter)
{
pIterCell = (*aIter).pCell;
- pIterCell->bIsIterCell = sal_False;
+ pIterCell->bIsIterCell = false;
pIterCell->nSeenInIteration = 0;
pIterCell->bRunning = (*aIter).bOldRunning;
}
@@ -1409,14 +1301,14 @@ void ScFormulaCell::Interpret()
++aIter)
{
pIterCell = (*aIter).pCell;
- pIterCell->bIsIterCell = sal_False;
+ pIterCell->bIsIterCell = false;
pIterCell->nSeenInIteration = 0;
pIterCell->bRunning = (*aIter).bOldRunning;
// If one cell didn't converge, all cells of this
// circular dependency don't, no matter whether
// single cells did.
- pIterCell->bDirty = sal_False;
- pIterCell->bTableOpDirty = sal_False;
+ pIterCell->bDirty = false;
+ pIterCell->bTableOpDirty = false;
pIterCell->aResult.SetResultError( errNoConvergence);
pIterCell->bChanged = sal_True;
pIterCell->SetTextWidth( TEXTWIDTH_DIRTY);
@@ -1562,16 +1454,16 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
// #i102616# For single-sheet saving consider only content changes, not format type,
// because format type isn't set on loading (might be changed later)
- sal_Bool bContentChanged = sal_False;
+ sal_Bool bContentChanged = false;
// Do not create a HyperLink() cell if the formula results in an error.
if( p->GetError() && pCode->IsHyperLink())
- pCode->SetHyperLink(sal_False);
+ pCode->SetHyperLink(false);
if( p->GetError() && p->GetError() != errCircularReference)
{
- bDirty = sal_False;
- bTableOpDirty = sal_False;
+ bDirty = false;
+ bTableOpDirty = false;
bChanged = sal_True;
}
if (eTailParam == SCITP_FROM_ITERATION && IsDirtyOrInTableOpDirty())
@@ -1594,8 +1486,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
if (nSeenInIteration > 1 ||
pDocument->GetDocOptions().GetIterCount() == 1)
{
- bDirty = sal_False;
- bTableOpDirty = sal_False;
+ bDirty = false;
+ bTableOpDirty = false;
}
}
}
@@ -1629,7 +1521,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
if ( !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) )
{
- ScFormulaResult aNewResult( p->GetResultToken());
+ ScFormulaResult aNewResult( p->GetResultToken().get());
StackVar eOld = aResult.GetCellResultType();
StackVar eNew = aNewResult.GetCellResultType();
if ( eOld == svUnknown && ( eNew == svError || ( eNew == svDouble && aNewResult.GetDouble() == 0.0 ) ) )
@@ -1649,11 +1541,11 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
}
}
- aResult.SetToken( p->GetResultToken() );
+ aResult.SetToken( p->GetResultToken().get() );
}
else
{
- ScFormulaResult aNewResult( p->GetResultToken());
+ ScFormulaResult aNewResult( p->GetResultToken().get());
StackVar eOld = aResult.GetCellResultType();
StackVar eNew = aNewResult.GetCellResultType();
bChanged = (eOld != eNew ||
@@ -1694,15 +1586,15 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
}
if (eTailParam == SCITP_NORMAL)
{
- bDirty = sal_False;
- bTableOpDirty = sal_False;
+ bDirty = false;
+ bTableOpDirty = false;
}
- if( aResult.GetMatrix().Is() )
+ if( aResult.GetMatrix() )
{
// If the formula wasn't entered as a matrix formula, live on with
// the upper left corner and let reference counting delete the matrix.
if( cMatrixFlag != MM_FORMULA && !pCode->IsHyperLink() )
- aResult.SetToken( aResult.GetCellResultToken());
+ aResult.SetToken( aResult.GetCellResultToken().get());
}
if ( aResult.IsValue() && !::rtl::math::isFinite( aResult.GetDouble() ) )
{
@@ -1720,7 +1612,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
{
// pass bIgnoreLock=sal_True, because even if called from pending row height update,
// a changed result must still reset the stream flag
- pDocument->SetStreamValid(aPos.Tab(), sal_False, sal_True);
+ pDocument->SetStreamValid(aPos.Tab(), false, sal_True);
}
if ( !pCode->IsRecalcModeAlways() )
pDocument->RemoveFromFormulaTree( this );
@@ -1742,13 +1634,43 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
// Reschedule verlangsamt das ganze erheblich, nur bei Prozentaenderung ausfuehren
ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent(
pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE );
+
+ switch (p->GetVolatileType())
+ {
+ case ScInterpreter::VOLATILE:
+ // Volatile via built-in volatile functions. No actions needed.
+ break;
+ case ScInterpreter::VOLATILE_MACRO:
+ // The formula contains a volatile macro.
+ pCode->SetRecalcModeAlways();
+ pDocument->PutInFormulaTree(this);
+ StartListeningTo(pDocument);
+ break;
+ case ScInterpreter::NOT_VOLATILE:
+ if (pCode->IsRecalcModeAlways())
+ {
+ // The formula was previously volatile, but no more.
+ EndListeningTo(pDocument);
+ pCode->SetRecalcModeNormal();
+ }
+ else
+ {
+ // non-volatile formula. End listening to the area in case
+ // it's listening due to macro module change.
+ pDocument->EndListeningArea(BCA_LISTEN_ALWAYS, this);
+ }
+ pDocument->RemoveFromFormulaTree(this);
+ break;
+ default:
+ ;
+ }
}
else
{
// Zelle bei Compiler-Fehlern nicht ewig auf dirty stehenlassen
DBG_ASSERT( pCode->GetCodeError(), "kein UPN-Code und kein Fehler ?!?!" );
- bDirty = sal_False;
- bTableOpDirty = sal_False;
+ bDirty = false;
+ bTableOpDirty = false;
}
}
@@ -1788,7 +1710,7 @@ sal_uLong ScFormulaCell::GetStandardFormat( SvNumberFormatter& rFormatter, sal_u
}
-void __EXPORT ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint)
+void ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint)
{
if ( !pDocument->IsInDtorClear() && !pDocument->GetHardRecalcState() )
{
@@ -1796,7 +1718,7 @@ void __EXPORT ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint)
sal_uLong nHint = (p ? p->GetId() : 0);
if (nHint & (SC_HINT_DATACHANGED | SC_HINT_DYING | SC_HINT_TABLEOPDIRTY))
{
- sal_Bool bForceTrack = sal_False;
+ sal_Bool bForceTrack = false;
if ( nHint & SC_HINT_TABLEOPDIRTY )
{
bForceTrack = !bTableOpDirty;
@@ -1809,14 +1731,14 @@ void __EXPORT ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint)
else
{
bForceTrack = !bDirty;
- bDirty = sal_True;
+ SetDirtyVar();
}
- // #35962# Don't remove from FormulaTree to put in FormulaTrack to
+ // Don't remove from FormulaTree to put in FormulaTrack to
// put in FormulaTree again and again, only if necessary.
// Any other means except RECALCMODE_ALWAYS by which a cell could
// be in FormulaTree if it would notify other cells through
// FormulaTrack which weren't in FormulaTrack/FormulaTree before?!?
- // #87866# Yes. The new TableOpDirty made it necessary to have a
+ // Yes. The new TableOpDirty made it necessary to have a
// forced mode where formulas may still be in FormulaTree from
// TableOpDirty but have to notify dependents for normal dirty.
if ( (bForceTrack || !pDocument->IsInFormulaTree( this )
@@ -1832,7 +1754,7 @@ void ScFormulaCell::SetDirty()
if ( !IsInChangeTrack() )
{
if ( pDocument->GetHardRecalcState() )
- bDirty = sal_True;
+ SetDirtyVar();
else
{
// Mehrfach-FormulaTracking in Load und in CompileAll
@@ -1841,17 +1763,24 @@ void ScFormulaCell::SetDirty()
// setzen, z.B. in CompileTokenArray
if ( !bDirty || !pDocument->IsInFormulaTree( this ) )
{
- bDirty = sal_True;
+ SetDirtyVar();
pDocument->AppendToFormulaTrack( this );
pDocument->TrackFormulas();
}
}
if (pDocument->IsStreamValid(aPos.Tab()))
- pDocument->SetStreamValid(aPos.Tab(), sal_False);
+ pDocument->SetStreamValid(aPos.Tab(), false);
}
}
+void ScFormulaCell::SetDirtyVar()
+{
+ bDirty = true;
+ // mark the sheet of this cell to be calculated
+ //#FIXME do we need to revert this remnant of old fake vba events? pDocument->AddCalculateTable( aPos.Tab() );
+}
+
void ScFormulaCell::SetDirtyAfterLoad()
{
bDirty = sal_True;
@@ -1941,16 +1870,12 @@ void ScFormulaCell::GetURLResult( String& rURL, String& rCellText )
ScConstMatrixRef xMat( aResult.GetMatrix());
if (xMat)
{
- ScMatValType nMatValType;
// determine if the matrix result is a string or value.
- const ScMatrixValue* pMatVal = xMat->Get(0, 1, nMatValType);
- if (pMatVal)
- {
- if (!ScMatrix::IsValueType( nMatValType))
- rURL = pMatVal->GetString();
- else
- pFormatter->GetOutputString( pMatVal->fVal, nURLFormat, rURL, &pColor );
- }
+ ScMatrixValue nMatVal = xMat->Get(0, 1);
+ if (!ScMatrix::IsValueType( nMatVal.nType))
+ rURL = nMatVal.GetString();
+ else
+ pFormatter->GetOutputString( nMatVal.fVal, nURLFormat, rURL, &pColor );
}
if(!rURL.Len())
@@ -1969,6 +1894,15 @@ bool ScFormulaCell::IsMultilineResult()
return false;
}
+void ScFormulaCell::MaybeInterpret()
+{
+ if (!IsDirtyOrInTableOpDirty())
+ return;
+
+ if (pDocument->GetAutoCalc() || (cMatrixFlag != MM_NONE))
+ Interpret();
+}
+
EditTextObject* ScFormulaCell::CreateURLObject()
{
String aCellText;
@@ -1997,21 +1931,34 @@ sal_Bool lcl_ScDetectiveRefIter_SkipRef( ScToken* p )
ScSingleRefData& rRef1 = p->GetSingleRef();
if ( rRef1.IsColDeleted() || rRef1.IsRowDeleted() || rRef1.IsTabDeleted()
|| !rRef1.Valid() )
- return sal_True;
- if ( p->GetType() == svDoubleRef )
+ return true;
+ if ( p->GetType() == svDoubleRef || p->GetType() == svExternalDoubleRef )
{
ScSingleRefData& rRef2 = p->GetDoubleRef().Ref2;
if ( rRef2.IsColDeleted() || rRef2.IsRowDeleted() || rRef2.IsTabDeleted()
|| !rRef2.Valid() )
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScDetectiveRefIter::GetNextRef( ScRange& rRange )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
+ ScToken* p = GetNextRefToken();
+ if( p )
+ {
+ SingleDoubleRefProvider aProv( *p );
+ rRange.aStart.Set( aProv.Ref1.nCol, aProv.Ref1.nRow, aProv.Ref1.nTab );
+ rRange.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab );
+ bRet = true;
+ }
+
+ return bRet;
+}
+ScToken* ScDetectiveRefIter::GetNextRefToken()
+{
ScToken* p = static_cast<ScToken*>(pCode->GetNextReferenceRPN());
if (p)
p->CalcAbsIfRel( aPos );
@@ -2022,16 +1969,9 @@ sal_Bool ScDetectiveRefIter::GetNextRef( ScRange& rRange )
if (p)
p->CalcAbsIfRel( aPos );
}
-
- if( p )
- {
- SingleDoubleRefProvider aProv( *p );
- rRange.aStart.Set( aProv.Ref1.nCol, aProv.Ref1.nRow, aProv.Ref1.nTab );
- rRange.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab );
- bRet = sal_True;
- }
-
- return bRet;
+ return p;
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index e4631dde2d9a..8969bed4b68f 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@
#include <deque>
#include <boost/bind.hpp>
-
+#include <sal/macros.h>
#include <vcl/mapmod.hxx>
#include <editeng/editobj.hxx>
#include <editeng/editstat.hxx>
@@ -51,6 +52,8 @@
#include "editutil.hxx"
#include "chgtrack.hxx"
#include "externalrefmgr.hxx"
+#include "scitems.hxx"
+#include "patattr.hxx"
using namespace formula;
@@ -139,6 +142,28 @@ void ScEditCell::GetString( String& rString ) const
rString.Erase();
}
+void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr )
+{
+ const struct {
+ sal_uInt16 nAttrType;
+ sal_uInt16 nCharType;
+ } AttrTypeMap[] = {
+ { ATTR_FONT, EE_CHAR_FONTINFO },
+ { ATTR_FONT_HEIGHT, EE_CHAR_FONTHEIGHT },
+ { ATTR_FONT_WEIGHT, EE_CHAR_WEIGHT },
+ { ATTR_FONT_COLOR, EE_CHAR_COLOR }
+ };
+ sal_uInt16 nMapCount = SAL_N_ELEMENTS(AttrTypeMap);
+
+ const SfxItemSet& rSet = rAttr.GetItemSet();
+ const SfxPoolItem* pItem;
+ for (sal_uInt16 i = 0; i < nMapCount; ++i)
+ {
+ if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SFX_ITEM_SET )
+ pData->RemoveCharAttribs(AttrTypeMap[i].nCharType);
+ }
+}
+
void ScEditCell::SetTextObject( const EditTextObject* pObject,
const SfxItemPool* pFromPool )
{
@@ -174,6 +199,76 @@ void ScEditCell::SetTextObject( const EditTextObject* pObject,
pData = NULL;
}
+ScEditDataArray::ScEditDataArray()
+{
+}
+
+ScEditDataArray::~ScEditDataArray()
+{
+}
+
+void ScEditDataArray::AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData)
+{
+ maArray.push_back(Item(nTab, nCol, nRow, pOldData, pNewData));
+}
+
+const ScEditDataArray::Item* ScEditDataArray::First()
+{
+ maIter = maArray.begin();
+ if (maIter == maArray.end())
+ return NULL;
+ return &(*maIter++);
+}
+
+const ScEditDataArray::Item* ScEditDataArray::Next()
+{
+ if (maIter == maArray.end())
+ return NULL;
+ return &(*maIter++);
+}
+
+// ============================================================================
+
+ScEditDataArray::Item::Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData) :
+ mnTab(nTab),
+ mnCol(nCol),
+ mnRow(nRow)
+{
+ mpOldData.reset(pOldData);
+ mpNewData.reset(pNewData);
+}
+
+ScEditDataArray::Item::~Item()
+{
+}
+
+const EditTextObject* ScEditDataArray::Item::GetOldData() const
+{
+ return mpOldData.get();
+}
+
+const EditTextObject* ScEditDataArray::Item::GetNewData() const
+{
+ return mpNewData.get();
+}
+
+SCTAB ScEditDataArray::Item::GetTab() const
+{
+ return mnTab;
+}
+
+SCCOL ScEditDataArray::Item::GetCol() const
+{
+ return mnCol;
+}
+
+SCROW ScEditDataArray::Item::GetRow() const
+{
+ return mnRow;
+}
+
// ============================================================================
namespace
@@ -269,9 +364,6 @@ lcl_checkRangeDimensions(
if (bOk && aCur == aEnd)
{
- bCol = bCol;
- bRow = bRow;
- bTab = bTab;
return true;
}
return false;
@@ -395,29 +487,25 @@ bool lcl_isReference(const FormulaToken& rToken)
sal_Bool ScFormulaCell::IsEmpty()
{
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
return aResult.GetCellResultType() == formula::svEmptyCell;
}
sal_Bool ScFormulaCell::IsEmptyDisplayedAsString()
{
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
return aResult.IsEmptyDisplayedAsString();
}
sal_Bool ScFormulaCell::IsValue()
{
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
return aResult.IsValue();
}
double ScFormulaCell::GetValue()
{
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
if ((!pCode->GetCodeError() || pCode->GetCodeError() == errDoubleRef) &&
!aResult.GetResultError())
return aResult.GetDouble();
@@ -427,16 +515,13 @@ double ScFormulaCell::GetValue()
double ScFormulaCell::GetValueAlways()
{
// for goal seek: return result value even if error code is set
-
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
return aResult.GetDouble();
}
void ScFormulaCell::GetString( String& rString )
{
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
if ((!pCode->GetCodeError() || pCode->GetCodeError() == errDoubleRef) &&
!aResult.GetResultError())
rString = aResult.GetString();
@@ -450,12 +535,12 @@ const ScMatrix* ScFormulaCell::GetMatrix()
{
// Was stored !bDirty but an accompanying matrix cell was bDirty?
// => we need to get the matrix.
- if (!bDirty && cMatrixFlag == MM_FORMULA && !aResult.GetMatrix().Is())
- bDirty = sal_True;
+ if (!bDirty && cMatrixFlag == MM_FORMULA && !aResult.GetMatrix())
+ bDirty = true;
if ( IsDirtyOrInTableOpDirty() )
Interpret();
}
- return aResult.GetMatrix();
+ return aResult.GetMatrix().get();
}
sal_Bool ScFormulaCell::GetMatrixOrigin( ScAddress& rPos ) const
@@ -464,8 +549,7 @@ sal_Bool ScFormulaCell::GetMatrixOrigin( ScAddress& rPos ) const
{
case MM_FORMULA :
rPos = aPos;
- return sal_True;
-// break;
+ return true;
case MM_REFERENCE :
{
pCode->Reset();
@@ -483,7 +567,7 @@ sal_Bool ScFormulaCell::GetMatrixOrigin( ScAddress& rPos ) const
}
break;
}
- return sal_False;
+ return false;
}
@@ -544,7 +628,7 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos )
aAdr.IncCol();
}
else
- bCont = sal_False;
+ bCont = false;
} while ( bCont );
aAdr = aOrg;
aAdr.IncRow();
@@ -560,7 +644,7 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos )
aAdr.IncRow();
}
else
- bCont = sal_False;
+ bCont = false;
} while ( bCont );
pFCell->SetMatColsRows( nC, nR );
}
@@ -628,8 +712,8 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos )
sal_uInt16 ScFormulaCell::GetErrCode()
{
- if (IsDirtyOrInTableOpDirty() && pDocument->GetAutoCalc())
- Interpret();
+ MaybeInterpret();
+
/* FIXME: If ScTokenArray::SetCodeError() was really only for code errors
* and not also abused for signaling other error conditions we could bail
* out even before attempting to interpret broken code. */
@@ -664,7 +748,7 @@ sal_Bool ScFormulaCell::HasOneReference( ScRange& r ) const
return sal_True;
}
else
- return sal_False;
+ return false;
}
bool
@@ -732,7 +816,7 @@ sal_Bool ScFormulaCell::HasRelNameReference() const
t->GetDoubleRef().Ref2.IsRelName()) )
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScFormulaCell::HasColRowName() const
@@ -741,11 +825,13 @@ sal_Bool ScFormulaCell::HasColRowName() const
return (pCode->GetNextColRowName() != NULL);
}
-void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
+bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
const ScRange& r,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
ScDocument* pUndoDoc, const ScAddress* pUndoCellPos )
{
+ bool bCellStateChanged = false;
+
SCCOL nCol1 = r.aStart.Col();
SCROW nRow1 = r.aStart.Row();
SCTAB nTab1 = r.aStart.Tab();
@@ -760,7 +846,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
aUndoPos = *pUndoCellPos;
ScAddress aOldPos( aPos );
// sal_Bool bPosChanged = sal_False; // ob diese Zelle bewegt wurde
- sal_Bool bIsInsert = sal_False;
+ sal_Bool bIsInsert = false;
if (eUpdateRefMode == URM_INSDEL)
{
bIsInsert = (nDx >= 0 && nDy >= 0 && nDz >= 0);
@@ -774,8 +860,8 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
nCol = 0;
else if ( nCol > MAXCOL )
nCol = MAXCOL;
+ bCellStateChanged = aPos.Col() != nCol;
aPos.SetCol( nCol );
-// bPosChanged = sal_True;
}
}
if ( nDy && nCol >= nCol1 && nCol <= nCol2 &&
@@ -788,8 +874,8 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
nRow = 0;
else if ( nRow > MAXROW )
nRow = MAXROW;
+ bCellStateChanged = aPos.Row() != nRow;
aPos.SetRow( nRow );
-// bPosChanged = sal_True;
}
}
if ( nDz && nCol >= nCol1 && nCol <= nCol2 &&
@@ -803,20 +889,19 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
nTab = 0;
else if ( nTab > nMaxTab )
nTab = nMaxTab;
+ bCellStateChanged = aPos.Tab() != nTab;
aPos.SetTab( nTab );
-// bPosChanged = sal_True;
}
}
}
else if ( r.In( aPos ) )
{
aOldPos.Set( nCol - nDx, nRow - nDy, nTab - nDz );
-// bPosChanged = sal_True;
}
- sal_Bool bHasRefs = sal_False;
- sal_Bool bHasColRowNames = sal_False;
- sal_Bool bOnRefMove = sal_False;
+ sal_Bool bHasRefs = false;
+ sal_Bool bHasColRowNames = false;
+ sal_Bool bOnRefMove = false;
if ( !pDocument->IsClipOrUndo() )
{
pCode->Reset();
@@ -832,10 +917,10 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
if( bHasRefs || bOnRefMove )
{
ScTokenArray* pOld = pUndoDoc ? pCode->Clone() : NULL;
- sal_Bool bValChanged;
ScRangeData* pRangeData;
- sal_Bool bRangeModified; // any range, not only shared formula
- sal_Bool bRefSizeChanged;
+ bool bValChanged = false;
+ bool bRangeModified = false; // any range, not only shared formula
+ bool bRefSizeChanged = false;
if ( bHasRefs )
{
ScCompiler aComp(pDocument, aPos, *pCode);
@@ -847,11 +932,14 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
}
else
{
- bValChanged = sal_False;
+ bValChanged = false;
pRangeData = NULL;
- bRangeModified = sal_False;
- bRefSizeChanged = sal_False;
+ bRangeModified = false;
+ bRefSizeChanged = false;
}
+
+ bCellStateChanged |= bValChanged;
+
if ( bOnRefMove )
bOnRefMove = (bValChanged || (aPos != aOldPos));
// Cell may reference itself, e.g. ocColumn, ocRow without parameter
@@ -865,7 +953,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
(eUpdateRefMode == URM_INSDEL && (nDx > 0 || nDy > 0));
if ( bColRowNameCompile )
{
- bColRowNameCompile = sal_False;
+ bColRowNameCompile = false;
ScToken* t;
ScRangePairList* pColList = pDocument->GetColNameRanges();
ScRangePairList* pRowList = pDocument->GetRowNameRanges();
@@ -940,7 +1028,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
if ( pChangeTrack && pChangeTrack->IsInDeleteUndo() )
bInDeleteUndo = sal_True;
else
- bInDeleteUndo = sal_False;
+ bInDeleteUndo = false;
// RelNameRefs are always moved
bHasRelName = HasRelNameReference();
// Reference changed and new listening needed?
@@ -960,19 +1048,19 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
else
{
bColRowNameCompile = bHasRelName = bNewListening = bInDeleteUndo =
- sal_False;
+ false;
}
- sal_Bool bNeedDirty;
+ bool bNeedDirty = false;
// NeedDirty bei Aenderungen ausser Copy und Move/Insert ohne RelNames
if ( bRangeModified || pRangeData || bColRowNameCompile ||
(bValChanged && eUpdateRefMode != URM_COPY &&
(eUpdateRefMode != URM_MOVE || bHasRelName) &&
(!bIsInsert || bHasRelName || bInDeleteUndo ||
bRefSizeChanged)) || bOnRefMove)
- bNeedDirty = sal_True;
+ bNeedDirty = true;
else
- bNeedDirty = sal_False;
+ bNeedDirty = false;
if (pUndoDoc && (bValChanged || pRangeData || bOnRefMove))
{
// Copy the cell to aUndoPos, which is its current position in the document,
@@ -990,7 +1078,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
pUndoDoc->PutCell( aUndoPos, pFCell );
}
}
- bValChanged = sal_False;
+ bValChanged = false;
if ( pRangeData )
{ // Replace shared formula with own formula
pDocument->RemoveFromFormulaTree( this ); // update formula count
@@ -1002,13 +1090,13 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
aComp2.SetGrammar(pDocument->GetGrammar());
aComp2.UpdateSharedFormulaReference( eUpdateRefMode, aOldPos, r,
nDx, nDy, nDz );
- bValChanged = sal_True;
- bNeedDirty = sal_True;
+ bValChanged = true;
+ bNeedDirty = true;
}
if ( ( bCompile = (bCompile || bValChanged || bRangeModified || bColRowNameCompile) ) != 0 )
{
CompileTokenArray( bNewListening ); // kein Listening
- bNeedDirty = sal_True;
+ bNeedDirty = true;
}
if ( !bInDeleteUndo )
{ // In ChangeTrack Delete-Reject listeners are established in
@@ -1031,18 +1119,19 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
{ // Referenzen abgeschnitten, ungueltig o.ae.?
sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
// kein Interpret in SubMinimalRecalc wegen evtl. falscher Referenzen
- pDocument->SetAutoCalc( sal_False );
+ pDocument->SetAutoCalc( false );
SetDirty();
pDocument->SetAutoCalc( bOldAutoCalc );
}
delete pOld;
}
+ return bCellStateChanged;
}
void ScFormulaCell::UpdateInsertTab(SCTAB nTable)
{
- sal_Bool bPosChanged = ( aPos.Tab() >= nTable ? sal_True : sal_False );
+ sal_Bool bPosChanged = ( aPos.Tab() >= nTable ? sal_True : false );
pCode->Reset();
if( pCode->GetNextReferenceRPN() && !pDocument->IsClipOrUndo() )
{
@@ -1053,7 +1142,7 @@ void ScFormulaCell::UpdateInsertTab(SCTAB nTable)
ScRangeData* pRangeData;
ScCompiler aComp(pDocument, aPos, *pCode);
aComp.SetGrammar(pDocument->GetGrammar());
- pRangeData = aComp.UpdateInsertTab( nTable, sal_False );
+ pRangeData = aComp.UpdateInsertTab( nTable, false );
if (pRangeData) // Shared Formula gegen echte Formel
{ // austauschen
sal_Bool bRefChanged;
@@ -1063,10 +1152,10 @@ void ScFormulaCell::UpdateInsertTab(SCTAB nTable)
ScCompiler aComp2(pDocument, aPos, *pCode);
aComp2.SetGrammar(pDocument->GetGrammar());
aComp2.MoveRelWrap(pRangeData->GetMaxCol(), pRangeData->GetMaxRow());
- aComp2.UpdateInsertTab( nTable, sal_False );
+ aComp2.UpdateInsertTab( nTable, false );
// If the shared formula contained a named range/formula containing
// an absolute reference to a sheet, those have to be readjusted.
- aComp2.UpdateDeleteTab( nTable, sal_False, sal_True, bRefChanged );
+ aComp2.UpdateDeleteTab( nTable, false, sal_True, bRefChanged );
bCompile = sal_True;
}
// kein StartListeningTo weil pTab[nTab] noch nicht existiert!
@@ -1077,8 +1166,8 @@ void ScFormulaCell::UpdateInsertTab(SCTAB nTable)
sal_Bool ScFormulaCell::UpdateDeleteTab(SCTAB nTable, sal_Bool bIsMove)
{
- sal_Bool bRefChanged = sal_False;
- sal_Bool bPosChanged = ( aPos.Tab() > nTable ? sal_True : sal_False );
+ sal_Bool bRefChanged = false;
+ sal_Bool bPosChanged = ( aPos.Tab() > nTable ? sal_True : false );
pCode->Reset();
if( pCode->GetNextReferenceRPN() && !pDocument->IsClipOrUndo() )
{
@@ -1089,7 +1178,7 @@ sal_Bool ScFormulaCell::UpdateDeleteTab(SCTAB nTable, sal_Bool bIsMove)
ScRangeData* pRangeData;
ScCompiler aComp(pDocument, aPos, *pCode);
aComp.SetGrammar(pDocument->GetGrammar());
- pRangeData = aComp.UpdateDeleteTab(nTable, bIsMove, sal_False, bRefChanged);
+ pRangeData = aComp.UpdateDeleteTab(nTable, bIsMove, false, bRefChanged);
if (pRangeData) // Shared Formula gegen echte Formel
{ // austauschen
pDocument->RemoveFromFormulaTree( this ); // update formula count
@@ -1099,7 +1188,7 @@ sal_Bool ScFormulaCell::UpdateDeleteTab(SCTAB nTable, sal_Bool bIsMove)
aComp2.SetGrammar(pDocument->GetGrammar());
aComp2.CompileTokenArray();
aComp2.MoveRelWrap(pRangeData->GetMaxCol(), pRangeData->GetMaxRow());
- aComp2.UpdateDeleteTab( nTable, sal_False, sal_False, bRefChanged );
+ aComp2.UpdateDeleteTab( nTable, false, false, bRefChanged );
// If the shared formula contained a named range/formula containing
// an absolute reference to a sheet, those have to be readjusted.
aComp2.UpdateInsertTab( nTable,sal_True );
@@ -1126,7 +1215,7 @@ void ScFormulaCell::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo )
ScRangeData* pRangeData;
ScCompiler aComp(pDocument, aPos, *pCode);
aComp.SetGrammar(pDocument->GetGrammar());
- pRangeData = aComp.UpdateMoveTab( nOldPos, nNewPos, sal_False );
+ pRangeData = aComp.UpdateMoveTab( nOldPos, nNewPos, false );
if (pRangeData) // Shared Formula gegen echte Formel
{ // austauschen
pDocument->RemoveFromFormulaTree( this ); // update formula count
@@ -1169,7 +1258,7 @@ void ScFormulaCell::UpdateInsertTabAbs(SCTAB nTable)
sal_Bool ScFormulaCell::TestTabRefAbs(SCTAB nTable)
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
if( !pDocument->IsClipOrUndo() )
{
pCode->Reset();
@@ -1214,7 +1303,7 @@ void ScFormulaCell::UpdateCompile( sal_Bool bForceIfNameInUse )
void ScFormulaCell::TransposeReference()
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
pCode->Reset();
ScToken* t;
while ( ( t = static_cast<ScToken*>(pCode->GetNextReference()) ) != NULL )
@@ -1254,7 +1343,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
EndListeningTo( pDocument );
ScAddress aOldPos = aPos;
- sal_Bool bPosChanged = sal_False; // ob diese Zelle bewegt wurde
+ sal_Bool bPosChanged = false; // ob diese Zelle bewegt wurde
ScRange aDestRange( rDest, ScAddress(
static_cast<SCCOL>(rDest.Col() + rSource.aEnd.Row() - rSource.aStart.Row()),
@@ -1272,7 +1361,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
}
ScTokenArray* pOld = pUndoDoc ? pCode->Clone() : NULL;
- sal_Bool bRefChanged = sal_False;
+ sal_Bool bRefChanged = false;
ScToken* t;
ScRangeData* pShared = NULL;
@@ -1281,7 +1370,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
{
if( t->GetOpCode() == ocName )
{
- ScRangeData* pName = pDocument->GetRangeName()->FindIndex( t->GetIndex() );
+ ScRangeData* pName = pDocument->GetRangeName()->findByIndex( t->GetIndex() );
if (pName)
{
if (pName->IsModified())
@@ -1357,7 +1446,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
{
EndListeningTo( pDocument );
- sal_Bool bRefChanged = sal_False;
+ sal_Bool bRefChanged = false;
ScToken* t;
ScRangeData* pShared = NULL;
@@ -1366,7 +1455,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
{
if( t->GetOpCode() == ocName )
{
- ScRangeData* pName = pDocument->GetRangeName()->FindIndex( t->GetIndex() );
+ ScRangeData* pName = pDocument->GetRangeName()->findByIndex( t->GetIndex() );
if (pName)
{
if (pName->IsModified())
@@ -1428,25 +1517,25 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
StartListeningTo( pDocument ); // Listener wie vorher
}
-sal_Bool lcl_IsRangeNameInUse(sal_uInt16 nIndex, ScTokenArray* pCode, ScRangeName* pNames)
+sal_Bool lcl_IsRangeNameInUse(size_t nIndex, ScTokenArray* pCode, ScRangeName* pNames)
{
for (FormulaToken* p = pCode->First(); p; p = pCode->Next())
{
if (p->GetOpCode() == ocName)
{
- if (p->GetIndex() == nIndex)
- return sal_True;
+ if (p->GetIndex() == static_cast<sal_uInt16>(nIndex))
+ return true;
else
{
- // RangeData kann Null sein in bestimmten Excel-Dateien (#31168#)
- ScRangeData* pSubName = pNames->FindIndex(p->GetIndex());
+ // RangeData kann Null sein in bestimmten Excel-Dateien
+ ScRangeData* pSubName = pNames->findByIndex(p->GetIndex());
if (pSubName && lcl_IsRangeNameInUse(nIndex,
pSubName->GetCode(), pNames))
return sal_True;
}
}
}
- return sal_False;
+ return false;
}
sal_Bool ScFormulaCell::IsRangeNameInUse(sal_uInt16 nIndex) const
@@ -1463,7 +1552,7 @@ void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray* pCode
sal_uInt16 nTokenIndex = p->GetIndex();
rIndexes.insert( nTokenIndex );
- ScRangeData* pSubName = pNames->FindIndex(p->GetIndex());
+ ScRangeData* pSubName = pNames->findByIndex(p->GetIndex());
if (pSubName)
lcl_FindRangeNamesInUse(rIndexes, pSubName->GetCode(), pNames);
}
@@ -1517,14 +1606,14 @@ void ScFormulaCell::CompileDBFormula( sal_Bool bCreateFormulaString )
// 2. FormelString mit neuen Namen kompilieren
if ( bCreateFormulaString )
{
- sal_Bool bRecompile = sal_False;
+ sal_Bool bRecompile = false;
pCode->Reset();
for ( FormulaToken* p = pCode->First(); p && !bRecompile; p = pCode->Next() )
{
switch ( p->GetOpCode() )
{
case ocBad: // DB-Bereich evtl. zugefuegt
- case ocColRowName: // #36762# falls Namensgleichheit
+ case ocColRowName: // falls Namensgleichheit
case ocDBArea: // DB-Bereich
bRecompile = sal_True;
break;
@@ -1555,7 +1644,7 @@ void ScFormulaCell::CompileDBFormula( sal_Bool bCreateFormulaString )
}
else if ( !pCode->GetLen() && aResult.GetHybridFormula().Len() )
{
- Compile( aResult.GetHybridFormula(), sal_False, eTempGrammar );
+ Compile( aResult.GetHybridFormula(), false, eTempGrammar );
aResult.SetToken( NULL);
SetDirty();
}
@@ -1568,15 +1657,15 @@ void ScFormulaCell::CompileNameFormula( sal_Bool bCreateFormulaString )
// 2. FormelString mit neuen RangeNames kompilieren
if ( bCreateFormulaString )
{
- sal_Bool bRecompile = sal_False;
+ sal_Bool bRecompile = false;
pCode->Reset();
for ( FormulaToken* p = pCode->First(); p && !bRecompile; p = pCode->Next() )
{
switch ( p->GetOpCode() )
{
case ocBad: // RangeName evtl. zugefuegt
- case ocColRowName: // #36762# falls Namensgleichheit
- bRecompile = sal_True;
+ case ocColRowName: // falls Namensgleichheit
+ bRecompile = true;
break;
default:
if ( p->GetType() == svIndex )
@@ -1602,7 +1691,7 @@ void ScFormulaCell::CompileNameFormula( sal_Bool bCreateFormulaString )
}
else if ( !pCode->GetLen() && aResult.GetHybridFormula().Len() )
{
- Compile( aResult.GetHybridFormula(), sal_False, eTempGrammar );
+ Compile( aResult.GetHybridFormula(), false, eTempGrammar );
aResult.SetToken( NULL);
SetDirty();
}
@@ -1625,3 +1714,4 @@ void ScFormulaCell::CompileColRowNameFormula()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/clipparam.cxx b/sc/source/core/data/clipparam.cxx
index 352c599e54bb..c39b69c3385a 100644
--- a/sc/source/core/data/clipparam.cxx
+++ b/sc/source/core/data/clipparam.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,12 +61,12 @@ ScClipParam::ScClipParam(const ScClipParam& r) :
bool ScClipParam::isMultiRange() const
{
- return maRanges.Count() > 1;
+ return maRanges.size() > 1;
}
SCCOL ScClipParam::getPasteColSize()
{
- if (!maRanges.Count())
+ if (maRanges.empty())
return 0;
switch (meDirection)
@@ -73,14 +74,17 @@ SCCOL ScClipParam::getPasteColSize()
case ScClipParam::Column:
{
SCCOL nColSize = 0;
- for (ScRangePtr p = maRanges.First(); p; p = maRanges.Next())
+ for ( size_t i = 0, nListSize = maRanges.size(); i < nListSize; ++i )
+ {
+ ScRange* p = maRanges[ i ];
nColSize += p->aEnd.Col() - p->aStart.Col() + 1;
+ }
return nColSize;
}
case ScClipParam::Row:
{
// We assume that all ranges have identical column size.
- const ScRange& rRange = *maRanges.First();
+ const ScRange& rRange = *maRanges.front();
return rRange.aEnd.Col() - rRange.aStart.Col() + 1;
}
case ScClipParam::Unspecified:
@@ -92,7 +96,7 @@ SCCOL ScClipParam::getPasteColSize()
SCROW ScClipParam::getPasteRowSize()
{
- if (!maRanges.Count())
+ if (maRanges.empty())
return 0;
switch (meDirection)
@@ -100,14 +104,17 @@ SCROW ScClipParam::getPasteRowSize()
case ScClipParam::Column:
{
// We assume that all ranges have identical row size.
- const ScRange& rRange = *maRanges.First();
+ const ScRange& rRange = *maRanges.front();
return rRange.aEnd.Row() - rRange.aStart.Row() + 1;
}
case ScClipParam::Row:
{
SCROW nRowSize = 0;
- for (ScRangePtr p = maRanges.First(); p; p = maRanges.Next())
+ for ( size_t i = 0, nListSize = maRanges.size(); i < nListSize; ++i )
+ {
+ ScRange* p = maRanges[ i ];
nRowSize += p->aEnd.Row() - p->aStart.Row() + 1;
+ }
return nRowSize;
}
case ScClipParam::Unspecified:
@@ -121,9 +128,9 @@ ScRange ScClipParam::getWholeRange() const
{
ScRange aWhole;
bool bFirst = true;
- ScRangeList aRanges = maRanges;
- for (ScRange* p = aRanges.First(); p; p = aRanges.Next())
+ for ( size_t i = 0, n = maRanges.size(); i < n; ++i )
{
+ const ScRange* p = maRanges[i];
if (bFirst)
{
aWhole = *p;
@@ -162,13 +169,15 @@ void ScClipParam::transpose()
}
ScRangeList aNewRanges;
- if (maRanges.Count())
+ if (!maRanges.empty())
{
- ScRange* p = maRanges.First();
+ ScRange* p = maRanges.front();
SCCOL nColOrigin = p->aStart.Col();
SCROW nRowOrigin = p->aStart.Row();
- for (; p; p = maRanges.Next())
+
+ for ( size_t i = 1, n = maRanges.size(); i < n; ++i )
{
+ p = maRanges[ i ];
SCCOL nColDelta = p->aStart.Col() - nColOrigin;
SCROW nRowDelta = p->aStart.Row() - nRowOrigin;
SCCOL nCol1 = 0;
@@ -179,8 +188,7 @@ void ScClipParam::transpose()
nCol2 += static_cast<SCCOL>(nRowDelta);
nRow1 += static_cast<SCROW>(nColDelta);
nRow2 += static_cast<SCROW>(nColDelta);
- ScRange aNew(nCol1, nRow1, p->aStart.Tab(), nCol2, nRow2, p->aStart.Tab());
- aNewRanges.Append(aNew);
+ aNewRanges.push_back( new ScRange(nCol1, nRow1, p->aStart.Tab(), nCol2, nRow2, p->aStart.Tab() ) );
}
}
maRanges = aNewRanges;
@@ -202,3 +210,5 @@ void ScClipRangeNameData::insert(sal_uInt16 nOldIndex, sal_uInt16 nNewIndex)
maRangeMap.insert(
ScRangeData::IndexMap::value_type(nOldIndex, nNewIndex));
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 092e93752124..22d8678ed2ad 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,7 +59,7 @@
// STATIC DATA -----------------------------------------------------------
using namespace formula;
-inline sal_Bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
+inline bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
{
//! move to a header file
return ( nScript != SCRIPTTYPE_LATIN &&
@@ -67,8 +68,20 @@ inline sal_Bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
nScript != 0 );
}
-// -----------------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+ScColumn::DoubleAllocSwitch::DoubleAllocSwitch(bool bNewVal) :
+ mbOldVal(ScColumn::bDoubleAlloc)
+{
+ ScColumn::bDoubleAlloc = bNewVal;
+}
+
+ScColumn::DoubleAllocSwitch::~DoubleAllocSwitch()
+{
+ ScColumn::bDoubleAlloc = mbOldVal;
+}
+
+// ----------------------------------------------------------------------------
ScColumn::ScColumn() :
nCol( 0 ),
@@ -97,7 +110,7 @@ void ScColumn::Init(SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc)
}
-SCsROW ScColumn::GetNextUnprotected( SCROW nRow, sal_Bool bUp ) const
+SCsROW ScColumn::GetNextUnprotected( SCROW nRow, bool bUp ) const
{
return pAttrArray->GetNextUnprotected(nRow, bUp);
}
@@ -126,7 +139,7 @@ sal_uInt16 ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 n
else
{
ScAddress aOrg( ScAddress::INITIALIZE_INVALID );
- sal_Bool bOpen = sal_False;
+ bool bOpen = false;
sal_uInt16 nEdges = 0;
SCSIZE nIndex;
Search( nRow1, nIndex );
@@ -140,7 +153,7 @@ sal_uInt16 ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 n
if ( nEdges )
{
if ( nEdges & 8 )
- bOpen = sal_True; // obere Kante oeffnet, weitersehen
+ bOpen = true; // obere Kante oeffnet, weitersehen
else if ( !bOpen )
return nEdges | 32; // es gibt was, was nicht geoeffnet wurde
else if ( nEdges & 1 )
@@ -151,7 +164,7 @@ sal_uInt16 ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 n
|| ((nMask & 4) && (nEdges & 16) && !(nEdges & 4)) )
return nEdges; // nur linke/rechte Kante
if ( nEdges & 2 )
- bOpen = sal_False; // untere Kante schliesst
+ bOpen = false; // untere Kante schliesst
}
}
nIndex++;
@@ -163,11 +176,11 @@ sal_uInt16 ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 n
}
-sal_Bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const
+bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const
{
if ( rMark.IsMultiMarked() )
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
ScAddress aOrg( ScAddress::INITIALIZE_INVALID );
ScAddress aCurOrg( ScAddress::INITIALIZE_INVALID );
@@ -175,7 +188,7 @@ sal_Bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const
ScMarkArrayIter aMarkIter( rMark.GetArray()+nCol );
while ( !bFound && aMarkIter.Next( nTop, nBottom ) )
{
- sal_Bool bOpen = sal_False;
+ bool bOpen = false;
sal_uInt16 nEdges;
SCSIZE nIndex;
Search( nTop, nIndex );
@@ -189,16 +202,16 @@ sal_Bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const
if ( nEdges )
{
if ( nEdges & 8 )
- bOpen = sal_True; // obere Kante oeffnet, weitersehen
+ bOpen = true; // obere Kante oeffnet, weitersehen
else if ( !bOpen )
- return sal_True; // es gibt was, was nicht geoeffnet wurde
+ return true; // es gibt was, was nicht geoeffnet wurde
else if ( nEdges & 1 )
- bFound = sal_True; // mittendrin, alles selektiert?
+ bFound = true; // mittendrin, alles selektiert?
// (4 und nicht 16) oder (16 und nicht 4)
if ( (((nEdges & 4) | 16) ^ ((nEdges & 16) | 4)) )
- bFound = sal_True; // nur linke/rechte Kante, alles selektiert?
+ bFound = true; // nur linke/rechte Kante, alles selektiert?
if ( nEdges & 2 )
- bOpen = sal_False; // untere Kante schliesst
+ bOpen = false; // untere Kante schliesst
if ( bFound )
{ // alles selektiert?
@@ -218,41 +231,34 @@ sal_Bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const
aOrg.Col() + nC - 1, aOrg.Row() + nR - 1,
aOrg.Tab() ) );
if ( rMark.IsAllMarked( aRange ) )
- bFound = sal_False;
+ bFound = false;
}
else
- bFound = sal_False; // war schon
+ bFound = false; // war schon
}
}
}
nIndex++;
}
if ( bOpen )
- return sal_True;
+ return true;
}
return bFound;
}
else
- return sal_False;
+ return false;
}
-//UNUSED2009-05 sal_Bool ScColumn::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
-//UNUSED2009-05 sal_Bool bLeft, sal_Bool bRight ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 return pAttrArray->HasLines( nRow1, nRow2, rSizes, bLeft, bRight );
-//UNUSED2009-05 }
-
-
bool ScColumn::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const
{
return pAttrArray->HasAttrib( nRow1, nRow2, nMask );
}
-sal_Bool ScColumn::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const
+bool ScColumn::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
SCROW nTop;
SCROW nBottom;
@@ -263,7 +269,7 @@ sal_Bool ScColumn::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask
while (aMarkIter.Next( nTop, nBottom ) && !bFound)
{
if (pAttrArray->HasAttrib( nTop, nBottom, nMask ))
- bFound = sal_True;
+ bFound = true;
}
}
@@ -271,15 +277,15 @@ sal_Bool ScColumn::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask
}
-sal_Bool ScColumn::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
+bool ScColumn::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
SCCOL& rPaintCol, SCROW& rPaintRow,
- sal_Bool bRefresh, sal_Bool bAttrs )
+ bool bRefresh, bool bAttrs )
{
return pAttrArray->ExtendMerge( nThisCol, nStartRow, nEndRow, rPaintCol, rPaintRow, bRefresh, bAttrs );
}
-void ScColumn::MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, sal_Bool bDeep ) const
+void ScColumn::MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, bool bDeep ) const
{
SCROW nTop;
SCROW nBottom;
@@ -297,7 +303,7 @@ void ScColumn::MergeSelectionPattern( ScMergePatternState& rState, const ScMarkD
}
-void ScColumn::MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, sal_Bool bDeep ) const
+void ScColumn::MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW nRow2, bool bDeep ) const
{
pAttrArray->MergePatternArea( nRow1, nRow2, rState, bDeep );
}
@@ -305,14 +311,14 @@ void ScColumn::MergePatternArea( ScMergePatternState& rState, SCROW nRow1, SCROW
void ScColumn::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
ScLineFlags& rFlags,
- SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight ) const
+ SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight ) const
{
pAttrArray->MergeBlockFrame( pLineOuter, pLineInner, rFlags, nStartRow, nEndRow, bLeft, nDistRight );
}
void ScColumn::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInfoItem* pLineInner,
- SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight )
+ SCROW nStartRow, SCROW nEndRow, bool bLeft, SCCOL nDistRight )
{
pAttrArray->ApplyBlockFrame( pLineOuter, pLineInner, nStartRow, nEndRow, bLeft, nDistRight );
}
@@ -354,26 +360,42 @@ const ScPatternAttr* ScColumn::GetMostUsedPattern( SCROW nStartRow, SCROW nEndRo
return pMaxPattern;
}
+sal_uInt32 ScColumn::GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const
+{
+ SCROW nPatStartRow, nPatEndRow;
+ const ScPatternAttr* pPattern = pAttrArray->GetPatternRange(nPatStartRow, nPatEndRow, nStartRow);
+ sal_uInt32 nFormat = pPattern->GetNumberFormat(pDocument->GetFormatTable());
+ while (nEndRow > nPatEndRow)
+ {
+ nStartRow = nPatEndRow + 1;
+ pPattern = pAttrArray->GetPatternRange(nPatStartRow, nPatEndRow, nStartRow);
+ sal_uInt32 nTmpFormat = pPattern->GetNumberFormat(pDocument->GetFormatTable());
+ if (nFormat != nTmpFormat)
+ return 0;
+ }
+ return nFormat;
+}
+
-sal_uLong ScColumn::GetNumberFormat( SCROW nRow ) const
+sal_uInt32 ScColumn::GetNumberFormat( SCROW nRow ) const
{
return pAttrArray->GetPattern( nRow )->GetNumberFormat( pDocument->GetFormatTable() );
}
-SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark )
+SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray )
{
SCROW nTop = 0;
SCROW nBottom = 0;
- sal_Bool bFound = sal_False;
+ bool bFound = false;
if ( rMark.IsMultiMarked() )
{
ScMarkArrayIter aMarkIter( rMark.GetArray() + nCol );
while (aMarkIter.Next( nTop, nBottom ))
{
- pAttrArray->ApplyCacheArea( nTop, nBottom, pCache );
- bFound = sal_True;
+ pAttrArray->ApplyCacheArea( nTop, nBottom, pCache, pDataArray );
+ bFound = true;
}
}
@@ -386,7 +408,7 @@ SCsROW ScColumn::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData
}
-void ScColumn::ChangeSelectionIndent( sal_Bool bIncrement, const ScMarkData& rMark )
+void ScColumn::ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark )
{
SCROW nTop;
SCROW nBottom;
@@ -435,9 +457,9 @@ void ScColumn::ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr )
const ScPatternAttr* pPattern = pAttrArray->GetPattern( nRow );
- // sal_True = alten Eintrag behalten
+ // true = alten Eintrag behalten
- ScPatternAttr* pNewPattern = (ScPatternAttr*) &aCache.ApplyTo( *pPattern, sal_True );
+ ScPatternAttr* pNewPattern = (ScPatternAttr*) &aCache.ApplyTo( *pPattern, true );
ScDocumentPool::CheckRef( *pPattern );
ScDocumentPool::CheckRef( *pNewPattern );
@@ -446,13 +468,18 @@ void ScColumn::ApplyPattern( SCROW nRow, const ScPatternAttr& rPatAttr )
}
-void ScColumn::ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr )
+void ScColumn::ApplyPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr,
+ ScEditDataArray* pDataArray )
{
const SfxItemSet* pSet = &rPatAttr.GetItemSet();
SfxItemPoolCache aCache( pDocument->GetPool(), pSet );
- pAttrArray->ApplyCacheArea( nStartRow, nEndRow, &aCache );
+ pAttrArray->ApplyCacheArea( nStartRow, nEndRow, &aCache, pDataArray );
}
+bool ScColumn::SetAttrEntries(ScAttrEntry* pData, SCSIZE nSize)
+{
+ return pAttrArray->SetAttrEntries(pData, nSize);
+}
void ScColumn::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
const ScPatternAttr& rPattern, short nNewType )
@@ -466,7 +493,7 @@ void ScColumn::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
SCROW nRow1, nRow2;
const ScPatternAttr* pPattern = pAttrArray->GetPatternRange(
nRow1, nRow2, nRow );
- sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter );
+ sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
short nOldType = pFormatter->GetType( nFormat );
if ( nOldType == nNewType || pFormatter->IsCompatible( nOldType, nNewType ) )
nRow = nRow2;
@@ -488,7 +515,7 @@ void ScColumn::ApplyStyle( SCROW nRow, const ScStyleSheet& rStyle )
if (pNewPattern)
{
pNewPattern->SetStyleSheet((ScStyleSheet*)&rStyle);
- pAttrArray->SetPattern(nRow, pNewPattern, sal_True);
+ pAttrArray->SetPattern(nRow, pNewPattern, true);
delete pNewPattern;
}
}
@@ -515,7 +542,7 @@ void ScColumn::ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData&
void ScColumn::ApplySelectionLineStyle( const ScMarkData& rMark,
- const SvxBorderLine* pLine, sal_Bool bColorOnly )
+ const SvxBorderLine* pLine, bool bColorOnly )
{
if ( bColorOnly && !pLine )
return;
@@ -538,16 +565,16 @@ const ScStyleSheet* ScColumn::GetStyle( SCROW nRow ) const
}
-const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, sal_Bool& rFound ) const
+const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, bool& rFound ) const
{
- rFound = sal_False;
+ rFound = false;
if (!rMark.IsMultiMarked())
{
- DBG_ERROR("ScColumn::GetSelectionStyle ohne Selektion");
+ OSL_FAIL("ScColumn::GetSelectionStyle ohne Selektion");
return NULL;
}
- sal_Bool bEqual = sal_True;
+ bool bEqual = true;
const ScStyleSheet* pStyle = NULL;
const ScStyleSheet* pNewStyle;
@@ -564,9 +591,9 @@ const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, sal_Bo
while (bEqual && ( pPattern = aAttrIter.Next( nRow, nDummy ) ) != NULL)
{
pNewStyle = pPattern->GetStyleSheet();
- rFound = sal_True;
+ rFound = true;
if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
- bEqual = sal_False; // unterschiedliche
+ bEqual = false; // unterschiedliche
pStyle = pNewStyle;
}
}
@@ -575,11 +602,11 @@ const ScStyleSheet* ScColumn::GetSelectionStyle( const ScMarkData& rMark, sal_Bo
}
-const ScStyleSheet* ScColumn::GetAreaStyle( sal_Bool& rFound, SCROW nRow1, SCROW nRow2 ) const
+const ScStyleSheet* ScColumn::GetAreaStyle( bool& rFound, SCROW nRow1, SCROW nRow2 ) const
{
- rFound = sal_False;
+ rFound = false;
- sal_Bool bEqual = sal_True;
+ bool bEqual = true;
const ScStyleSheet* pStyle = NULL;
const ScStyleSheet* pNewStyle;
@@ -591,9 +618,9 @@ const ScStyleSheet* ScColumn::GetAreaStyle( sal_Bool& rFound, SCROW nRow1, SCROW
while (bEqual && ( pPattern = aAttrIter.Next( nRow, nDummy ) ) != NULL)
{
pNewStyle = pPattern->GetStyleSheet();
- rFound = sal_True;
+ rFound = true;
if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
- bEqual = sal_False; // unterschiedliche
+ bEqual = false; // unterschiedliche
pStyle = pNewStyle;
}
@@ -605,19 +632,19 @@ void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolR
pAttrArray->FindStyleSheet( pStyleSheet, rUsedRows, bReset );
}
-sal_Bool ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const
+bool ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle, bool bGatherAllStyles ) const
{
return pAttrArray->IsStyleSheetUsed( rStyle, bGatherAllStyles );
}
-sal_Bool ScColumn::ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags )
+bool ScColumn::ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags )
{
return pAttrArray->ApplyFlags( nStartRow, nEndRow, nFlags );
}
-sal_Bool ScColumn::RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags )
+bool ScColumn::RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags )
{
return pAttrArray->RemoveFlags( nStartRow, nEndRow, nFlags );
}
@@ -629,14 +656,14 @@ void ScColumn::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWh
}
-void ScColumn::SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr, sal_Bool bPutToPool )
+void ScColumn::SetPattern( SCROW nRow, const ScPatternAttr& rPatAttr, bool bPutToPool )
{
pAttrArray->SetPattern( nRow, &rPatAttr, bPutToPool );
}
void ScColumn::SetPatternArea( SCROW nStartRow, SCROW nEndRow,
- const ScPatternAttr& rPatAttr, sal_Bool bPutToPool )
+ const ScPatternAttr& rPatAttr, bool bPutToPool )
{
pAttrArray->SetPatternArea( nStartRow, nEndRow, &rPatAttr, bPutToPool );
}
@@ -662,20 +689,6 @@ void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr )
delete pTemp;
// alte Version mit SfxItemPoolCache:
-#if 0
- SfxItemPoolCache aCache( pDocument->GetPool(), &rAttr );
-
- const ScPatternAttr* pPattern = pAttrArray->GetPattern( nRow );
-
- // sal_True = alten Eintrag behalten
-
- ScPatternAttr* pNewPattern = (ScPatternAttr*) &aCache.ApplyTo( *pPattern, sal_True );
- ScDocumentPool::CheckRef( *pPattern );
- ScDocumentPool::CheckRef( *pNewPattern );
-
- if (pNewPattern != pPattern)
- pAttrArray->SetPattern( nRow, pNewPattern );
-#endif
}
#ifdef _MSC_VER
@@ -683,12 +696,12 @@ void ScColumn::ApplyAttr( SCROW nRow, const SfxPoolItem& rAttr )
#endif
-sal_Bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const
+bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const
{
if ( !pItems || !nCount )
{
nIndex = 0;
- return sal_False;
+ return false;
}
SCROW nMinRow = pItems[0].nRow;
if ( nRow <= nMinRow )
@@ -702,12 +715,12 @@ sal_Bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const
if ( nRow == nMaxRow )
{
nIndex = nCount - 1;
- return sal_True;
+ return true;
}
else
{
nIndex = nCount;
- return sal_False;
+ return false;
}
}
@@ -715,9 +728,9 @@ sal_Bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const
long nLo = nOldLo = 0;
long nHi = nOldHi = Min(static_cast<long>(nCount)-1, static_cast<long>(nRow) );
long i = 0;
- sal_Bool bFound = sal_False;
+ bool bFound = false;
// quite continuous distribution? => interpolating search
- sal_Bool bInterpol = (static_cast<SCSIZE>(nMaxRow - nMinRow) < nCount * 2);
+ bool bInterpol = (static_cast<SCSIZE>(nMaxRow - nMinRow) < nCount * 2);
SCROW nR;
while ( !bFound && nLo <= nHi )
@@ -732,7 +745,7 @@ sal_Bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const
if ( i < 0 || static_cast<SCSIZE>(i) >= nCount )
{ // oops ...
i = (nLo+nHi) / 2;
- bInterpol = sal_False;
+ bInterpol = false;
}
}
nR = pItems[i].nRow;
@@ -742,7 +755,7 @@ sal_Bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const
if ( bInterpol )
{
if ( nLo <= nOldLo )
- bInterpol = sal_False;
+ bInterpol = false;
else
nOldLo = nLo;
}
@@ -755,13 +768,13 @@ sal_Bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const
if ( bInterpol )
{
if ( nHi >= nOldHi )
- bInterpol = sal_False;
+ bInterpol = false;
else
nOldHi = nHi;
}
}
else
- bFound = sal_True;
+ bFound = true;
}
}
if (bFound)
@@ -931,7 +944,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN
{
- sal_Bool bEqual = sal_True;
+ bool bEqual = true;
sal_uInt16 nLen = pCode1->GetLen();
FormulaToken** ppToken1 = pCode1->GetArray();
FormulaToken** ppToken2 = pCode2->GetArray();
@@ -940,7 +953,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
if ( !ppToken1[i]->TextEqual(*(ppToken2[i])) ||
ppToken1[i]->Is3DRef() || ppToken2[i]->Is3DRef() )
{
- bEqual = sal_False;
+ bEqual = false;
break;
}
}
@@ -956,9 +969,6 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
}
}
- // hier kein UpdateReference wegen #30529# - mitsortiert werden nur noch relative Referenzen
-// long dy = (long)nRow2 - (long)nRow1;
-
/* Create clone of pCell1 at position of pCell2 (pCell1 exists always, see
variable swapping above). Do not clone the note, but move pointer of
old note to new cell. */
@@ -1063,11 +1073,11 @@ void ScColumn::SwapCell( SCROW nRow, ScColumn& rCol)
}
-sal_Bool ScColumn::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
+bool ScColumn::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
{
if (!IsEmpty())
{
- sal_Bool bTest = sal_True;
+ bool bTest = true;
if (pItems)
for (SCSIZE i=0; (i<nCount) && bTest; i++)
bTest = (pItems[i].nRow < nStartRow) || (pItems[i].nRow > nEndRow)
@@ -1083,11 +1093,11 @@ sal_Bool ScColumn::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
return bTest;
}
else
- return sal_True;
+ return true;
}
-sal_Bool ScColumn::TestInsertRow( SCSIZE nSize ) const
+bool ScColumn::TestInsertRow( SCSIZE nSize ) const
{
// AttrArray only looks for merged cells
@@ -1096,22 +1106,6 @@ sal_Bool ScColumn::TestInsertRow( SCSIZE nSize ) const
pItems[nCount-1].nRow <= MAXROW-(SCROW)nSize && pAttrArray->TestInsertRow( nSize ) );
else
return pAttrArray->TestInsertRow( nSize );
-
-#if 0
- //! rausgeschobene Attribute bei Undo beruecksichtigen
-
- if ( nSize > static_cast<SCSIZE>(MAXROW) )
- return sal_False;
-
- SCSIZE nVis = nCount;
- while ( nVis && pItems[nVis-1].pCell->IsBlank() )
- --nVis;
-
- if ( nVis )
- return ( pItems[nVis-1].nRow <= MAXROW-nSize );
- else
- return sal_True;
-#endif
}
@@ -1129,16 +1123,16 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
if ( i >= nCount )
return ;
- sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ bool bOldAutoCalc = pDocument->GetAutoCalc();
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
SCSIZE nNewCount = nCount;
- sal_Bool bCountChanged = sal_False;
+ bool bCountChanged = false;
ScAddress aAdr( nCol, 0, nTab );
ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL)
ScAddress& rAddress = aHint.GetAddress();
// for sparse occupation use single broadcasts, not ranges
- sal_Bool bSingleBroadcasts = (((pItems[nCount-1].nRow - pItems[i].nRow) /
+ bool bSingleBroadcasts = (((pItems[nCount-1].nRow - pItems[i].nRow) /
(nCount - i)) > 1);
if ( bSingleBroadcasts )
{
@@ -1146,14 +1140,14 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
for ( ; i < nCount; i++)
{
SCROW nOldRow = pItems[i].nRow;
- // #43940# Aenderung Quelle broadcasten
+ // Aenderung Quelle broadcasten
if ( nLastBroadcast != nOldRow )
{ // direkt aufeinanderfolgende nicht doppelt broadcasten
rAddress.SetRow( nOldRow );
pDocument->AreaBroadcast( aHint );
}
SCROW nNewRow = (pItems[i].nRow += nSize);
- // #43940# Aenderung Ziel broadcasten
+ // Aenderung Ziel broadcasten
rAddress.SetRow( nNewRow );
pDocument->AreaBroadcast( aHint );
nLastBroadcast = nNewRow;
@@ -1163,7 +1157,7 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
if ( nNewRow > MAXROW && !bCountChanged )
{
nNewCount = i;
- bCountChanged = sal_True;
+ bCountChanged = true;
}
}
}
@@ -1180,7 +1174,7 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
if ( nNewRow > MAXROW && !bCountChanged )
{
nNewCount = i;
- bCountChanged = sal_True;
+ bCountChanged = true;
aRange.aEnd.SetRow( MAXROW );
}
}
@@ -1222,7 +1216,7 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
}
-void ScColumn::CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, sal_Bool bKeepScenarioFlags, sal_Bool bCloneNoteCaptions)
+void ScColumn::CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, bool bKeepScenarioFlags, bool bCloneNoteCaptions)
{
pAttrArray->CopyArea( nRow1, nRow2, 0, *rColumn.pAttrArray,
bKeepScenarioFlags ? (SC_MF_ALL & ~SC_MF_SCENARIO) : SC_MF_ALL );
@@ -1266,8 +1260,8 @@ void ScColumn::CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, sal_Bool
}
-void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Bool bMarked,
- ScColumn& rColumn, const ScMarkData* pMarkData, sal_Bool bAsLink )
+void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, bool bMarked,
+ ScColumn& rColumn, const ScMarkData* pMarkData, bool bAsLink )
{
if (bMarked)
{
@@ -1280,12 +1274,12 @@ void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Boo
{
if ( nEnd >= nRow1 )
CopyToColumn( Max(nRow1,nStart), Min(nRow2,nEnd),
- nFlags, sal_False, rColumn, pMarkData, bAsLink );
+ nFlags, false, rColumn, pMarkData, bAsLink );
}
}
else
{
- DBG_ERROR("CopyToColumn: bMarked, aber keine Markierung");
+ OSL_FAIL("CopyToColumn: bMarked, aber keine Markierung");
}
return;
}
@@ -1302,7 +1296,7 @@ void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Boo
const ScPatternAttr* pPattern = pAttrArray->GetPattern( nRow );
ScPatternAttr* pNewPattern = new ScPatternAttr( *pPattern );
pNewPattern->SetStyleSheet( (ScStyleSheet*)pStyle );
- rColumn.pAttrArray->SetPattern( nRow, pNewPattern, sal_True );
+ rColumn.pAttrArray->SetPattern( nRow, pNewPattern, true );
delete pNewPattern;
}
}
@@ -1337,23 +1331,40 @@ void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Boo
CloneCell( i, nFlags, *rColumn.pDocument, aDestPos );
if (pNew)
- rColumn.Insert(pItems[i].nRow, pNew);
+ {
+ // Special case to allow removing of cell instances. A
+ // string cell with empty content is used to indicate an
+ // empty cell.
+ if (pNew->GetCellType() == CELLTYPE_STRING)
+ {
+ String aStr;
+ static_cast<ScStringCell*>(pNew)->GetString(aStr);
+ if (aStr.Len() == 0)
+ // A string cell with empty string. Delete the cell itself.
+ rColumn.Delete(pItems[i].nRow);
+ else
+ // non-empty string cell
+ rColumn.Insert(pItems[i].nRow, pNew);
+ }
+ else
+ rColumn.Insert(pItems[i].nRow, pNew);
+ }
}
}
}
}
-void ScColumn::UndoToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, sal_Bool bMarked,
+void ScColumn::UndoToColumn(SCROW nRow1, SCROW nRow2, sal_uInt16 nFlags, bool bMarked,
ScColumn& rColumn, const ScMarkData* pMarkData )
{
if (nRow1 > 0)
- CopyToColumn( 0, nRow1-1, IDF_FORMULA, sal_False, rColumn );
+ CopyToColumn( 0, nRow1-1, IDF_FORMULA, false, rColumn );
CopyToColumn( nRow1, nRow2, nFlags, bMarked, rColumn, pMarkData ); //! bMarked ????
if (nRow2 < MAXROW)
- CopyToColumn( nRow2+1, MAXROW, IDF_FORMULA, sal_False, rColumn );
+ CopyToColumn( nRow2+1, MAXROW, IDF_FORMULA, false, rColumn );
}
@@ -1376,8 +1387,6 @@ void ScColumn::CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const
}
}
- // Dummy:
- // CopyToColumn( 0,MAXROW, IDF_FORMULA, sal_False, rDestCol, NULL, sal_False );
}
@@ -1394,7 +1403,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol )
{
DeleteArea( nStart, nEnd, IDF_CONTENTS );
((ScColumn&)rSrcCol).
- CopyToColumn( nStart, nEnd, IDF_CONTENTS, sal_False, *this );
+ CopyToColumn( nStart, nEnd, IDF_CONTENTS, false, *this );
// UpdateUsed nicht noetig, schon in TestCopyScenario passiert
@@ -1425,7 +1434,7 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
{
rDestCol.DeleteArea( nStart, nEnd, IDF_CONTENTS );
((ScColumn*)this)->
- CopyToColumn( nStart, nEnd, IDF_CONTENTS, sal_False, rDestCol );
+ CopyToColumn( nStart, nEnd, IDF_CONTENTS, false, rDestCol );
// UpdateUsed nicht noetig, schon in TestCopyScenario passiert
@@ -1443,9 +1452,9 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
}
-sal_Bool ScColumn::TestCopyScenarioTo( const ScColumn& rDestCol ) const
+bool ScColumn::TestCopyScenarioTo( const ScColumn& rDestCol ) const
{
- sal_Bool bOk = sal_True;
+ bool bOk = true;
ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW );
SCROW nStart = 0, nEnd = 0;
const ScPatternAttr* pPattern = aAttrIter.Next( nStart, nEnd );
@@ -1453,7 +1462,7 @@ sal_Bool ScColumn::TestCopyScenarioTo( const ScColumn& rDestCol ) const
{
if ( ((ScMergeFlagAttr&)pPattern->GetItem( ATTR_MERGE_FLAG )).IsScenario() )
if ( rDestCol.pAttrArray->HasAttrib( nStart, nEnd, HASATTR_PROTECTED ) )
- bOk = sal_False;
+ bOk = false;
pPattern = aAttrIter.Next( nStart, nEnd );
}
@@ -1474,7 +1483,7 @@ void ScColumn::MarkScenarioIn( ScMarkData& rDestMark ) const
{
aRange.aStart.SetRow( nStart );
aRange.aEnd.SetRow( nEnd );
- rDestMark.SetMultiMarkArea( aRange, sal_True );
+ rDestMark.SetMultiMarkArea( aRange, true );
}
pPattern = aAttrIter.Next( nStart, nEnd );
@@ -1502,7 +1511,7 @@ void ScColumn::SwapCol(ScColumn& rCol)
rCol.pAttrArray = pAttrArray;
pAttrArray = pTempAttr;
- // #38415# AttrArray muss richtige Spaltennummer haben
+ // AttrArray muss richtige Spaltennummer haben
pAttrArray->SetCol(nCol);
rCol.pAttrArray->SetCol(rCol.nCol);
@@ -1583,7 +1592,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
ScAddress& rAddress = aHint.GetAddress();
ScNoteCell* pNoteCell = new ScNoteCell; // Dummy like in DeleteRange
- // #121990# must iterate backwards, because indexes of following cells become invalid
+ // must iterate backwards, because indexes of following cells become invalid
for (EntryPosPairs::reverse_iterator it( aEntries.rbegin());
it != aEntries.rend(); ++it)
{
@@ -1608,10 +1617,11 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
}
-void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+bool ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
ScDocument* pUndoDoc )
{
+ bool bUpdated = false;
if (pItems)
{
ScRange aRange( ScAddress( nCol1, nRow1, nTab1 ),
@@ -1623,12 +1633,13 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
{
ScFormulaCell* pCell = (ScFormulaCell*) pItems[nIndex].pCell;
if( pCell->GetCellType() == CELLTYPE_FORMULA)
- pCell->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
+ bUpdated |= pCell->UpdateReference(
+ eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
}
}
else
{
- // #90279# For performance reasons two loop bodies instead of
+ // For performance reasons two loop bodies instead of
// testing for update mode in each iteration.
// Anyways, this is still a bottleneck on large arrays with few
// formulas cells.
@@ -1644,7 +1655,8 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
ScBaseCell* pCell = pItems[i].pCell;
if( pCell->GetCellType() == CELLTYPE_FORMULA)
{
- ((ScFormulaCell*)pCell)->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
+ bUpdated |= ((ScFormulaCell*)pCell)->UpdateReference(
+ eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
if ( nRow != pItems[i].nRow )
Search( nRow, i ); // Listener removed/inserted?
}
@@ -1662,7 +1674,8 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
// When deleting rows on several sheets, the formula's position may be updated with the first call,
// so the undo position must be passed from here.
ScAddress aUndoPos( nCol, nRow, nTab );
- ((ScFormulaCell*)pCell)->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc, &aUndoPos );
+ bUpdated |= ((ScFormulaCell*)pCell)->UpdateReference(
+ eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc, &aUndoPos );
if ( nRow != pItems[i].nRow )
Search( nRow, i ); // Listener removed/inserted?
}
@@ -1670,6 +1683,7 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
}
}
}
+ return bUpdated;
}
@@ -1751,7 +1765,7 @@ void ScColumn::UpdateInsertTabAbs(SCTAB nTable)
}
-void ScColumn::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScColumn* pRefUndo )
+void ScColumn::UpdateDeleteTab( SCTAB nTable, bool bIsMove, ScColumn* pRefUndo )
{
if (nTab > nTable)
pAttrArray->SetTab(--nTab);
@@ -1767,7 +1781,7 @@ void ScColumn::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScColumn* pRefUn
back the formula cell while keeping the original note. */
ScBaseCell* pSave = pRefUndo ? pOld->CloneWithoutNote( *pDocument ) : 0;
- sal_Bool bChanged = pOld->UpdateDeleteTab(nTable, bIsMove);
+ bool bChanged = pOld->UpdateDeleteTab(nTable, bIsMove);
if ( nRow != pItems[i].nRow )
Search( nRow, i ); // Listener geloescht/eingefuegt?
@@ -1801,7 +1815,7 @@ void ScColumn::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo )
}
-void ScColumn::UpdateCompile( sal_Bool bForceIfNameInUse )
+void ScColumn::UpdateCompile( bool bForceIfNameInUse )
{
if (pItems)
for (SCSIZE i = 0; i < nCount; i++)
@@ -1832,9 +1846,9 @@ void ScColumn::SetTabNo(SCTAB nNewTab)
}
-sal_Bool ScColumn::IsRangeNameInUse(SCROW nRow1, SCROW nRow2, sal_uInt16 nIndex) const
+bool ScColumn::IsRangeNameInUse(SCROW nRow1, SCROW nRow2, sal_uInt16 nIndex) const
{
- sal_Bool bInUse = sal_False;
+ bool bInUse = false;
if (pItems)
for (SCSIZE i = 0; !bInUse && (i < nCount); i++)
if ((pItems[i].nRow >= nRow1) &&
@@ -1886,8 +1900,8 @@ void ScColumn::SetDirtyVar()
void ScColumn::SetDirty()
{
// wird nur dokumentweit verwendet, kein FormulaTrack
- sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ bool bOldAutoCalc = pDocument->GetAutoCalc();
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
for (SCSIZE i=0; i<nCount; i++)
{
ScFormulaCell* p = (ScFormulaCell*) pItems[i].pCell;
@@ -1906,8 +1920,8 @@ void ScColumn::SetDirty( const ScRange& rRange )
{ // broadcastet alles innerhalb eines Range, mit FormulaTrack
if ( !pItems || !nCount )
return ;
- sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ bool bOldAutoCalc = pDocument->GetAutoCalc();
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
SCROW nRow2 = rRange.aEnd.Row();
ScAddress aPos( nCol, 0, nTab );
ScHint aHint( SC_HINT_DATACHANGED, aPos, NULL );
@@ -1935,8 +1949,8 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange )
{
if ( !pItems || !nCount )
return ;
- sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // no multiple recalculation
+ bool bOldAutoCalc = pDocument->GetAutoCalc();
+ pDocument->SetAutoCalc( false ); // no multiple recalculation
SCROW nRow2 = rRange.aEnd.Row();
ScAddress aPos( nCol, 0, nTab );
ScHint aHint( SC_HINT_TABLEOPDIRTY, aPos, NULL );
@@ -1962,8 +1976,8 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange )
void ScColumn::SetDirtyAfterLoad()
{
- sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ bool bOldAutoCalc = pDocument->GetAutoCalc();
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
for (SCSIZE i=0; i<nCount; i++)
{
ScFormulaCell* p = (ScFormulaCell*) pItems[i].pCell;
@@ -1995,8 +2009,8 @@ void ScColumn::SetDirtyAfterLoad()
void ScColumn::SetRelNameDirty()
{
- sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ bool bOldAutoCalc = pDocument->GetAutoCalc();
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
for (SCSIZE i=0; i<nCount; i++)
{
ScFormulaCell* p = (ScFormulaCell*) pItems[i].pCell;
@@ -2044,9 +2058,9 @@ void ScColumn::CompileAll()
{
SCROW nRow = pItems[i].nRow;
// fuer unbedingtes kompilieren
- // bCompile=sal_True und pCode->nError=0
+ // bCompile=true und pCode->nError=0
((ScFormulaCell*)pCell)->GetCode()->SetCodeError( 0 );
- ((ScFormulaCell*)pCell)->SetCompile( sal_True );
+ ((ScFormulaCell*)pCell)->SetCompile( true );
((ScFormulaCell*)pCell)->CompileTokenArray();
if ( nRow != pItems[i].nRow )
Search( nRow, i ); // Listener geloescht/eingefuegt?
@@ -2101,14 +2115,14 @@ void ScColumn::ResetChanged( SCROW nStartRow, SCROW nEndRow )
}
-sal_Bool ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const
+bool ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const
{
// used in GetOptimalHeight - ambiguous script type counts as edit cell
SCROW nRow = 0;
SCSIZE nIndex;
Search(nStartRow,nIndex);
- while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : sal_False )
+ while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : false )
{
ScBaseCell* pCell = pItems[nIndex].pCell;
CellType eCellType = pCell->GetCellType();
@@ -2117,17 +2131,17 @@ sal_Bool ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) c
((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) )
{
rFirst = nRow;
- return sal_True;
+ return true;
}
++nIndex;
}
- return sal_False;
+ return false;
}
SCsROW ScColumn::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle,
- sal_Bool bUp, sal_Bool bInSelection, const ScMarkData& rMark )
+ bool bUp, bool bInSelection, const ScMarkData& rMark )
{
if (bInSelection)
{
@@ -2142,8 +2156,8 @@ SCsROW ScColumn::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle,
}
-sal_Bool ScColumn::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyleSheet* pSearchStyle,
- sal_Bool bUp, sal_Bool bInSelection, const ScMarkData& rMark )
+bool ScColumn::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyleSheet* pSearchStyle,
+ bool bUp, bool bInSelection, const ScMarkData& rMark )
{
if (bInSelection)
{
@@ -2151,10 +2165,11 @@ sal_Bool ScColumn::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyl
return pAttrArray->SearchStyleRange( rRow, rEndRow, pSearchStyle, bUp,
(ScMarkArray*) rMark.GetArray()+nCol ); //! const
else
- return sal_False;
+ return false;
}
else
return pAttrArray->SearchStyleRange( rRow, rEndRow, pSearchStyle, bUp, NULL );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 0cffd3bef163..74b0be43ef61 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,6 +45,7 @@
#include <svx/rotmodit.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/unolingu.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/zforlist.hxx>
#include <svl/broadcast.hxx>
#include <svl/listeneriter.hxx>
@@ -67,6 +69,7 @@
#include "dbcolect.hxx"
#include "fillinfo.hxx"
#include "segmenttree.hxx"
+#include "docparam.hxx"
#include <math.h>
@@ -77,7 +80,7 @@
// -----------------------------------------------------------------------
-inline sal_Bool IsAmbiguousScript( sal_uInt8 nScript )
+inline bool IsAmbiguousScript( sal_uInt8 nScript )
{
//! move to a header file
return ( nScript != SCRIPTTYPE_LATIN &&
@@ -93,101 +96,11 @@ inline sal_Bool IsAmbiguousScript( sal_uInt8 nScript )
// -----------------------------------------------------------------------------------------
-//UNUSED2008-05 SCROW ScColumn::NoteCount( SCROW nMaxRow ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 SCROW nNoteCount = 0;
-//UNUSED2008-05 SCSIZE i;
-//UNUSED2008-05
-//UNUSED2008-05 for (i=0; i<nCount; i++)
-//UNUSED2008-05 if ( pItems[i].pCell->GetNotePtr() && pItems[i].nRow<=nMaxRow )
-//UNUSED2008-05 ++nNoteCount;
-//UNUSED2008-05
-//UNUSED2008-05 return nNoteCount;
-//UNUSED2008-05 }
-
-// -----------------------------------------------------------------------------------------
-
-//UNUSED2008-05 void ScColumn::CorrectSymbolCells( CharSet eStreamCharSet )
-//UNUSED2008-05 {
-//UNUSED2008-05 // #99139# find and correct string cells that are formatted with a symbol font,
-//UNUSED2008-05 // but are not in the LoadedSymbolStringCellsList
-//UNUSED2008-05 // (because CELLTYPE_SYMBOLS wasn't written in the file)
-//UNUSED2008-05
-//UNUSED2008-05 ScFontToSubsFontConverter_AutoPtr xFontConverter;
-//UNUSED2008-05 const sal_uLong nFontConverterFlags = FONTTOSUBSFONT_EXPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS;
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool bListInitialized = sal_False;
-//UNUSED2008-05 ScSymbolStringCellEntry* pCurrentEntry = NULL;
-//UNUSED2008-05
-//UNUSED2008-05 ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW );
-//UNUSED2008-05 SCROW nStt, nEnd;
-//UNUSED2008-05 const ScPatternAttr* pAttr = aAttrIter.Next( nStt, nEnd );
-//UNUSED2008-05 while ( pAttr )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( (xFontConverter = pAttr->GetSubsFontConverter( nFontConverterFlags )) ||
-//UNUSED2008-05 pAttr->IsSymbolFont() )
-//UNUSED2008-05 {
-//UNUSED2008-05 ScColumnIterator aCellIter( this, nStt, nEnd );
-//UNUSED2008-05 SCROW nRow;
-//UNUSED2008-05 ScBaseCell* pCell;
-//UNUSED2008-05 while ( aCellIter.Next( nRow, pCell ) )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( pCell->GetCellType() == CELLTYPE_STRING )
-//UNUSED2008-05 {
-//UNUSED2008-05 List& rList = pDocument->GetLoadedSymbolStringCellsList();
-//UNUSED2008-05 if (!bListInitialized)
-//UNUSED2008-05 {
-//UNUSED2008-05 pCurrentEntry = (ScSymbolStringCellEntry*)rList.First();
-//UNUSED2008-05 bListInitialized = sal_True;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 while ( pCurrentEntry && pCurrentEntry->nRow < nRow )
-//UNUSED2008-05 pCurrentEntry = (ScSymbolStringCellEntry*)rList.Next();
-//UNUSED2008-05
-//UNUSED2008-05 if ( pCurrentEntry && pCurrentEntry->nRow == nRow )
-//UNUSED2008-05 {
-//UNUSED2008-05 // found
-//UNUSED2008-05 }
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 // not in list -> convert and put into list
-//UNUSED2008-05
-//UNUSED2008-05 ScStringCell* pStrCell = (ScStringCell*)pCell;
-//UNUSED2008-05 String aOldStr;
-//UNUSED2008-05 pStrCell->GetString( aOldStr );
-//UNUSED2008-05
-//UNUSED2008-05 // convert back to stream character set (get original data)
-//UNUSED2008-05 ByteString aByteStr( aOldStr, eStreamCharSet );
-//UNUSED2008-05
-//UNUSED2008-05 // convert using symbol encoding, as for CELLTYPE_SYMBOLS cells
-//UNUSED2008-05 String aNewStr( aByteStr, RTL_TEXTENCODING_SYMBOL );
-//UNUSED2008-05 pStrCell->SetString( aNewStr );
-//UNUSED2008-05
-//UNUSED2008-05 ScSymbolStringCellEntry * pEntry = new ScSymbolStringCellEntry;
-//UNUSED2008-05 pEntry->pCell = pStrCell;
-//UNUSED2008-05 pEntry->nRow = nRow;
-//UNUSED2008-05
-//UNUSED2008-05 if ( pCurrentEntry )
-//UNUSED2008-05 rList.Insert( pEntry ); // before current entry - pCurrentEntry stays valid
-//UNUSED2008-05 else
-//UNUSED2008-05 rList.Insert( pEntry, LIST_APPEND ); // append if already behind last entry
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 pAttr = aAttrIter.Next( nStt, nEnd );
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-
-// -----------------------------------------------------------------------------------------
-
- // GetNeededSize: optimale Hoehe / Breite in Pixeln
long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bWidth, const ScNeededSizeOptions& rOptions )
+ bool bWidth, const ScNeededSizeOptions& rOptions )
{
long nValue=0;
SCSIZE nIndex;
@@ -230,7 +143,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
const SfxPoolItem* pCondItem;
SvxCellHorJustify eHorJust;
if (pCondSet &&
- pCondSet->GetItemState(ATTR_HOR_JUSTIFY, sal_True, &pCondItem) == SFX_ITEM_SET)
+ pCondSet->GetItemState(ATTR_HOR_JUSTIFY, true, &pCondItem) == SFX_ITEM_SET)
eHorJust = (SvxCellHorJustify)((const SvxHorJustifyItem*)pCondItem)->GetValue();
else
eHorJust = (SvxCellHorJustify)((const SvxHorJustifyItem&)
@@ -239,7 +152,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
if ( eHorJust == SVX_HOR_JUSTIFY_BLOCK )
bBreak = true;
else if ( pCondSet &&
- pCondSet->GetItemState(ATTR_LINEBREAK, sal_True, &pCondItem) == SFX_ITEM_SET)
+ pCondSet->GetItemState(ATTR_LINEBREAK, true, &pCondItem) == SFX_ITEM_SET)
bBreak = ((const SfxBoolItem*)pCondItem)->GetValue();
else
bBreak = ((const SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK)).GetValue();
@@ -251,7 +164,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
// get other attributes from pattern and conditional formatting
SvxCellOrientation eOrient = pPattern->GetCellOrientation( pCondSet );
- sal_Bool bAsianVertical = ( eOrient == SVX_ORIENTATION_STACKED &&
+ bool bAsianVertical = ( eOrient == SVX_ORIENTATION_STACKED &&
((const SfxBoolItem&)pPattern->GetItem( ATTR_VERTICAL_ASIAN, pCondSet )).GetValue() );
if ( bAsianVertical )
bBreak = false;
@@ -264,14 +177,14 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
if ( eOrient == SVX_ORIENTATION_STANDARD )
{
if (pCondSet &&
- pCondSet->GetItemState(ATTR_ROTATE_VALUE, sal_True, &pCondItem) == SFX_ITEM_SET)
+ pCondSet->GetItemState(ATTR_ROTATE_VALUE, true, &pCondItem) == SFX_ITEM_SET)
nRotate = ((const SfxInt32Item*)pCondItem)->GetValue();
else
nRotate = ((const SfxInt32Item&)pPattern->GetItem(ATTR_ROTATE_VALUE)).GetValue();
if ( nRotate )
{
if (pCondSet &&
- pCondSet->GetItemState(ATTR_ROTATE_MODE, sal_True, &pCondItem) == SFX_ITEM_SET)
+ pCondSet->GetItemState(ATTR_ROTATE_MODE, true, &pCondItem) == SFX_ITEM_SET)
eRotMode = (SvxRotateMode)((const SvxRotateModeItem*)pCondItem)->GetValue();
else
eRotMode = (SvxRotateMode)((const SvxRotateModeItem&)
@@ -287,12 +200,12 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
// ignore orientation/rotation if "repeat" is active
eOrient = SVX_ORIENTATION_STANDARD;
nRotate = 0;
- bAsianVertical = sal_False;
+ bAsianVertical = false;
}
const SvxMarginItem* pMargin;
if (pCondSet &&
- pCondSet->GetItemState(ATTR_MARGIN, sal_True, &pCondItem) == SFX_ITEM_SET)
+ pCondSet->GetItemState(ATTR_MARGIN, true, &pCondItem) == SFX_ITEM_SET)
pMargin = (const SvxMarginItem*) pCondItem;
else
pMargin = (const SvxMarginItem*) &pPattern->GetItem(ATTR_MARGIN);
@@ -300,7 +213,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
if ( eHorJust == SVX_HOR_JUSTIFY_LEFT )
{
if (pCondSet &&
- pCondSet->GetItemState(ATTR_INDENT, sal_True, &pCondItem) == SFX_ITEM_SET)
+ pCondSet->GetItemState(ATTR_INDENT, true, &pCondItem) == SFX_ITEM_SET)
nIndent = ((const SfxUInt16Item*)pCondItem)->GetValue();
else
nIndent = ((const SfxUInt16Item&)pPattern->GetItem(ATTR_INDENT)).GetValue();
@@ -320,10 +233,10 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
pDev->SetFont(aFont);
}
- sal_Bool bAddMargin = sal_True;
+ bool bAddMargin = true;
CellType eCellType = pCell->GetCellType();
- sal_Bool bEditEngine = ( eCellType == CELLTYPE_EDIT ||
+ bool bEditEngine = ( eCellType == CELLTYPE_EDIT ||
eOrient == SVX_ORIENTATION_STACKED ||
IsAmbiguousScript( nScript ) ||
((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) );
@@ -333,10 +246,10 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
String aValStr;
Color* pColor;
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
+ sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
ScCellFormat::GetString( pCell, nFormat, aValStr, &pColor,
*pFormatter,
- sal_True, rOptions.bFormula, ftCheck );
+ true, rOptions.bFormula, ftCheck );
if (aValStr.Len())
{
// SetFont ist nach oben verschoben
@@ -362,7 +275,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
else if ( rOptions.bTotalSize )
{
nWidth = (long) ( pDocument->GetColWidth( nCol,nTab ) * nPPT );
- bAddMargin = sal_False;
+ bAddMargin = false;
// nur nach rechts:
//! unterscheiden nach Ausrichtung oben/unten (nur Text/ganze Hoehe)
if ( pPattern->GetRotateDir( pCondSet ) == SC_ROTDIR_RIGHT )
@@ -374,7 +287,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
if ( bBreak && !rOptions.bTotalSize )
{
- // #47744# limit size for line break
+ // limit size for line break
long nCmp = pDev->GetFont().GetSize().Height() * SC_ROT_BREAK_FACTOR;
if ( nHeight > nCmp )
nHeight = nCmp;
@@ -411,7 +324,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
* nPPT );
nDocPixel = (nDocPixel * 9) / 10; // zur Sicherheit
if ( aSize.Width() > nDocPixel )
- bEditEngine = sal_True;
+ bEditEngine = true;
}
}
}
@@ -426,7 +339,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
// am Dokument speichern ?
ScFieldEditEngine* pEngine = pDocument->CreateFieldEditEngine();
- pEngine->SetUpdateMode( sal_False );
+ pEngine->SetUpdateMode( false );
MapMode aOld = pDev->GetMapMode();
pDev->SetMapMode( aHMMMode );
pEngine->SetRefDevice( pDev );
@@ -451,10 +364,10 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
else if (bBreak)
{
double fWidthFactor = nPPTX;
- sal_Bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER );
+ bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER );
if ( bTextWysiwyg )
{
- // #95593# if text is formatted for printer, don't use PixelToLogic,
+ // if text is formatted for printer, don't use PixelToLogic,
// to ensure the exact same paper width (and same line breaks) as in
// ScEditUtil::GetEditArea, used for output.
@@ -494,22 +407,22 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
{
Color* pColor;
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
+ sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
String aString;
ScCellFormat::GetString( pCell, nFormat, aString, &pColor,
*pFormatter,
- sal_True, rOptions.bFormula, ftCheck );
+ true, rOptions.bFormula, ftCheck );
if (aString.Len())
pEngine->SetTextNewDefaults(aString, pSet);
else
pEngine->SetDefaults(pSet);
}
- sal_Bool bEngineVertical = pEngine->IsVertical();
+ bool bEngineVertical = pEngine->IsVertical();
pEngine->SetVertical( bAsianVertical );
- pEngine->SetUpdateMode( sal_True );
+ pEngine->SetUpdateMode( true );
- sal_Bool bEdWidth = bWidth;
+ bool bEdWidth = bWidth;
if ( eOrient != SVX_ORIENTATION_STANDARD && eOrient != SVX_ORIENTATION_STACKED )
bEdWidth = !bEdWidth;
if ( nRotate )
@@ -527,7 +440,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
else if ( rOptions.bTotalSize )
{
nWidth = (long) ( pDocument->GetColWidth( nCol,nTab ) * nPPT );
- bAddMargin = sal_False;
+ bAddMargin = false;
if ( pPattern->GetRotateDir( pCondSet ) == SC_ROTDIR_RIGHT )
nWidth += (long)( pDocument->GetRowHeight( nRow,nTab ) *
nPPT * nCosAbs / nSinAbs );
@@ -545,7 +458,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
if ( bBreak && !rOptions.bTotalSize )
{
- // #47744# limit size for line break
+ // limit size for line break
long nCmp = aOldFont.GetSize().Height() * SC_ROT_BREAK_FACTOR;
if ( nValue > nCmp )
nValue = nCmp;
@@ -612,7 +525,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
}
long ScColumn::GetSimpleTextNeededSize( SCSIZE nIndex, OutputDevice* pDev,
- sal_Bool bWidth )
+ bool bWidth )
{
long nValue=0;
if ( nIndex < nCount )
@@ -623,9 +536,9 @@ long ScColumn::GetSimpleTextNeededSize( SCSIZE nIndex, OutputDevice* pDev,
String aValStr;
Color* pColor;
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter );
+ sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
ScCellFormat::GetString( pCell, nFormat, aValStr, &pColor,
- *pFormatter, sal_True, sal_False, ftCheck );
+ *pFormatter, true, false, ftCheck );
if ( aValStr.Len() )
{
if ( bWidth )
@@ -638,20 +551,20 @@ long ScColumn::GetSimpleTextNeededSize( SCSIZE nIndex, OutputDevice* pDev,
}
sal_uInt16 ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, double nPPTY,
- const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bFormula, sal_uInt16 nOldWidth,
- const ScMarkData* pMarkData,
- sal_Bool bSimpleTextImport )
+ const Fraction& rZoomX, const Fraction& rZoomY,
+ bool bFormula, sal_uInt16 nOldWidth,
+ const ScMarkData* pMarkData,
+ const ScColWidthParam* pParam )
{
if (nCount == 0)
return nOldWidth;
sal_uInt16 nWidth = (sal_uInt16) (nOldWidth * nPPTX);
- sal_Bool bFound = sal_False;
+ bool bFound = false;
SCSIZE nIndex;
- ScMarkedDataIter aDataIter(this, pMarkData, sal_True);
- if ( bSimpleTextImport )
+ ScMarkedDataIter aDataIter(this, pMarkData, true);
+ if ( pParam && pParam->mbSimpleText )
{ // alles eins bis auf NumberFormate
const ScPatternAttr* pPattern = GetPattern( 0 );
Font aFont;
@@ -662,19 +575,44 @@ sal_uInt16 ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, doubl
long nMargin = (long) ( pMargin->GetLeftMargin() * nPPTX ) +
(long) ( pMargin->GetRightMargin() * nPPTX );
- while (aDataIter.Next( nIndex ))
+ // Try to find the row that has the longest string, and measure the width of that string.
+ SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
+ sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
+ String aLongStr;
+ Color* pColor;
+ if (pParam->mnMaxTextRow >= 0)
{
- sal_uInt16 nThis = (sal_uInt16) (GetSimpleTextNeededSize( nIndex, pDev,
- sal_True ) + nMargin);
- if (nThis)
+ ScBaseCell* pCell = GetCell(pParam->mnMaxTextRow);
+ ScCellFormat::GetString(
+ pCell, nFormat, aLongStr, &pColor, *pFormatter, true, false, ftCheck );
+ }
+ else
+ {
+ xub_StrLen nLongLen = 0;
+ while (aDataIter.Next(nIndex))
{
- if (nThis>nWidth || !bFound)
+ if (nIndex >= nCount)
+ // Out-of-bound reached. No need to keep going.
+ break;
+
+ ScBaseCell* pCell = pItems[nIndex].pCell;
+ String aValStr;
+ ScCellFormat::GetString(
+ pCell, nFormat, aValStr, &pColor, *pFormatter, true, false, ftCheck );
+
+ if (aValStr.Len() > nLongLen)
{
- nWidth = nThis;
- bFound = sal_True;
+ nLongLen = aValStr.Len();
+ aLongStr = aValStr;
}
}
}
+
+ if (aLongStr.Len())
+ {
+ nWidth = pDev->GetTextWidth(aLongStr) + static_cast<sal_uInt16>(nMargin);
+ bFound = true;
+ }
}
else
{
@@ -694,14 +632,14 @@ sal_uInt16 ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, doubl
aOptions.pPattern = pPattern;
aOptions.bGetFont = (pPattern != pOldPattern || nScript != nOldScript);
sal_uInt16 nThis = (sal_uInt16) GetNeededSize( nRow, pDev, nPPTX, nPPTY,
- rZoomX, rZoomY, sal_True, aOptions );
+ rZoomX, rZoomY, true, aOptions );
pOldPattern = pPattern;
if (nThis)
{
if (nThis>nWidth || !bFound)
{
nWidth = nThis;
- bFound = sal_True;
+ bFound = true;
}
}
}
@@ -757,7 +695,7 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe
OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bShrink, sal_uInt16 nMinHeight, SCROW nMinStart )
+ bool bShrink, sal_uInt16 nMinHeight, SCROW nMinStart )
{
ScAttrIterator aIter( pAttrArray, nStartRow, nEndRow );
@@ -782,11 +720,11 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe
else
{
SCROW nRow = 0;
- sal_Bool bStdAllowed = (pPattern->GetCellOrientation() == SVX_ORIENTATION_STANDARD);
- sal_Bool bStdOnly = sal_False;
+ bool bStdAllowed = (pPattern->GetCellOrientation() == SVX_ORIENTATION_STANDARD);
+ bool bStdOnly = false;
if (bStdAllowed)
{
- sal_Bool bBreak = ((SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK)).GetValue() ||
+ bool bBreak = ((SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK)).GetValue() ||
((SvxCellHorJustify)((const SvxHorJustifyItem&)pPattern->
GetItem( ATTR_HOR_JUSTIFY )).GetValue() ==
SVX_HOR_JUSTIFY_BLOCK);
@@ -795,12 +733,12 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe
// bedingte Formatierung: Zellen durchgehen
if ( bStdOnly && ((const SfxUInt32Item&)pPattern->
GetItem(ATTR_CONDITIONAL)).GetValue() )
- bStdOnly = sal_False;
+ bStdOnly = false;
// gedrehter Text: Zellen durchgehen
if ( bStdOnly && ((const SfxInt32Item&)pPattern->
GetItem(ATTR_ROTATE_VALUE)).GetValue() )
- bStdOnly = sal_False;
+ bStdOnly = false;
}
if (bStdOnly)
@@ -808,11 +746,11 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe
{
if (nEditPos == nStart)
{
- bStdOnly = sal_False;
+ bStdOnly = false;
if (nEnd > nEditPos)
nNextEnd = nEnd;
nEnd = nEditPos; // einzeln ausrechnen
- bStdAllowed = sal_False; // wird auf jeden Fall per Zelle berechnet
+ bStdAllowed = false; // wird auf jeden Fall per Zelle berechnet
}
else
{
@@ -890,7 +828,7 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe
SCSIZE nIndex;
Search(nStart,nIndex);
- while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEnd) : sal_False )
+ while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEnd) : false )
{
// Zellhoehe nur berechnen, wenn sie spaeter auch gebraucht wird (#37928#)
@@ -899,7 +837,7 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe
aOptions.pPattern = pPattern;
sal_uInt16 nHeight = (sal_uInt16)
( GetNeededSize( nRow, pDev, nPPTX, nPPTY,
- rZoomX, rZoomY, sal_False, aOptions ) / nPPTY );
+ rZoomX, rZoomY, false, aOptions ) / nPPTY );
if (nHeight > pHeight[nRow-nStartRow])
pHeight[nRow-nStartRow] = nHeight;
}
@@ -919,9 +857,9 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe
}
}
-sal_Bool ScColumn::GetNextSpellingCell(SCROW& nRow, sal_Bool bInSel, const ScMarkData& rData) const
+bool ScColumn::GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& rData) const
{
- sal_Bool bStop = sal_False;
+ bool bStop = false;
CellType eCellType;
SCSIZE nIndex;
if (!bInSel && Search(nRow, nIndex))
@@ -930,17 +868,17 @@ sal_Bool ScColumn::GetNextSpellingCell(SCROW& nRow, sal_Bool bInSel, const ScMar
if ( (eCellType == CELLTYPE_STRING || eCellType == CELLTYPE_EDIT) &&
!(HasAttrib( nRow, nRow, HASATTR_PROTECTED) &&
pDocument->IsTabProtected(nTab)) )
- return sal_True;
+ return true;
}
while (!bStop)
{
if (bInSel)
{
- nRow = rData.GetNextMarked(nCol, nRow, sal_False);
+ nRow = rData.GetNextMarked(nCol, nRow, false);
if (!ValidRow(nRow))
{
nRow = MAXROW+1;
- bStop = sal_True;
+ bStop = true;
}
else
{
@@ -948,7 +886,7 @@ sal_Bool ScColumn::GetNextSpellingCell(SCROW& nRow, sal_Bool bInSel, const ScMar
if ( (eCellType == CELLTYPE_STRING || eCellType == CELLTYPE_EDIT) &&
!(HasAttrib( nRow, nRow, HASATTR_PROTECTED) &&
pDocument->IsTabProtected(nTab)) )
- return sal_True;
+ return true;
else
nRow++;
}
@@ -959,17 +897,17 @@ sal_Bool ScColumn::GetNextSpellingCell(SCROW& nRow, sal_Bool bInSel, const ScMar
if ( (eCellType == CELLTYPE_STRING || eCellType == CELLTYPE_EDIT) &&
!(HasAttrib( nRow, nRow, HASATTR_PROTECTED) &&
pDocument->IsTabProtected(nTab)) )
- return sal_True;
+ return true;
else
nRow++;
}
else
{
nRow = MAXROW+1;
- bStop = sal_True;
+ bStop = true;
}
}
- return sal_False;
+ return false;
}
// =========================================================================================
@@ -1059,16 +997,16 @@ void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow )
}
}
// URL-Felder in Text wandeln (andere gibt's nicht, darum pType=0)
- pEngine->RemoveFields( sal_True );
+ pEngine->RemoveFields( true );
- sal_Bool bSpellErrors = pEngine->HasOnlineSpellErrors();
- sal_Bool bNeedObject = bSpellErrors || nParCount>1; // Errors/Absaetze behalten
+ bool bSpellErrors = pEngine->HasOnlineSpellErrors();
+ bool bNeedObject = bSpellErrors || nParCount>1; // Errors/Absaetze behalten
// ScEditAttrTester nicht mehr noetig, Felder sind raus
if ( bNeedObject ) // bleibt Edit-Zelle
{
- sal_uLong nCtrl = pEngine->GetControlWord();
- sal_uLong nWantBig = bSpellErrors ? EE_CNTRL_ALLOWBIGOBJS : 0;
+ sal_uInt32 nCtrl = pEngine->GetControlWord();
+ sal_uInt32 nWantBig = bSpellErrors ? EE_CNTRL_ALLOWBIGOBJS : 0;
if ( ( nCtrl & EE_CNTRL_ALLOWBIGOBJS ) != nWantBig )
pEngine->SetControlWord( (nCtrl & ~EE_CNTRL_ALLOWBIGOBJS) | nWantBig );
EditTextObject* pNewData = pEngine->CreateTextObject();
@@ -1091,14 +1029,14 @@ void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow )
// =========================================================================================
-sal_Bool ScColumn::TestTabRefAbs(SCTAB nTable)
+bool ScColumn::TestTabRefAbs(SCTAB nTable)
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if (pItems)
for (SCSIZE i = 0; i < nCount; i++)
if ( pItems[i].pCell->GetCellType() == CELLTYPE_FORMULA )
if (((ScFormulaCell*)pItems[i].pCell)->TestTabRefAbs(nTable))
- bRet = sal_True;
+ bRet = true;
return bRet;
}
@@ -1116,7 +1054,7 @@ ScColumnIterator::~ScColumnIterator()
{
}
-sal_Bool ScColumnIterator::Next( SCROW& rRow, ScBaseCell*& rpCell )
+bool ScColumnIterator::Next( SCROW& rRow, ScBaseCell*& rpCell )
{
if ( nPos < pColumn->nCount )
{
@@ -1125,13 +1063,13 @@ sal_Bool ScColumnIterator::Next( SCROW& rRow, ScBaseCell*& rpCell )
{
rpCell = pColumn->pItems[nPos].pCell;
++nPos;
- return sal_True;
+ return true;
}
}
rRow = 0;
rpCell = NULL;
- return sal_False;
+ return false;
}
SCSIZE ScColumnIterator::GetIndex() const // Index zur letzen abgefragten Zelle
@@ -1142,10 +1080,10 @@ SCSIZE ScColumnIterator::GetIndex() const // Index zur letzen abgefrag
// -----------------------------------------------------------------------------------------
ScMarkedDataIter::ScMarkedDataIter( const ScColumn* pCol, const ScMarkData* pMarkData,
- sal_Bool bAllIfNone ) :
+ bool bAllIfNone ) :
pColumn( pCol ),
pMarkIter( NULL ),
- bNext( sal_True ),
+ bNext( true ),
bAll( bAllIfNone )
{
if (pMarkData && pMarkData->IsMultiMarked())
@@ -1157,9 +1095,9 @@ ScMarkedDataIter::~ScMarkedDataIter()
delete pMarkIter;
}
-sal_Bool ScMarkedDataIter::Next( SCSIZE& rIndex )
+bool ScMarkedDataIter::Next( SCSIZE& rIndex )
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
do
{
if (bNext)
@@ -1172,65 +1110,48 @@ sal_Bool ScMarkedDataIter::Next( SCSIZE& rIndex )
nBottom = MAXROW;
}
else
- return sal_False;
+ return false;
}
pColumn->Search( nTop, nPos );
- bNext = sal_False;
- bAll = sal_False; // nur beim ersten Versuch
+ bNext = false;
+ bAll = false; // nur beim ersten Versuch
}
if ( nPos >= pColumn->nCount )
- return sal_False;
+ return false;
if ( pColumn->pItems[nPos].nRow <= nBottom )
- bFound = sal_True;
+ bFound = true;
else
- bNext = sal_True;
+ bNext = true;
}
while (!bFound);
rIndex = nPos++;
- return sal_True;
+ return true;
}
-//UNUSED2009-05 sal_uInt16 ScColumn::GetErrorData( SCROW nRow ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 SCSIZE nIndex;
-//UNUSED2009-05 if (Search(nRow, nIndex))
-//UNUSED2009-05 {
-//UNUSED2009-05 ScBaseCell* pCell = pItems[nIndex].pCell;
-//UNUSED2009-05 switch (pCell->GetCellType())
-//UNUSED2009-05 {
-//UNUSED2009-05 case CELLTYPE_FORMULA :
-//UNUSED2009-05 return ((ScFormulaCell*)pCell)->GetErrCode();
-//UNUSED2009-05 // break;
-//UNUSED2009-05 default:
-//UNUSED2009-05 return 0;
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 return 0;
-//UNUSED2009-05 }
//------------
-sal_Bool ScColumn::IsEmptyData() const
+bool ScColumn::IsEmptyData() const
{
return (nCount == 0);
}
-sal_Bool ScColumn::IsEmptyVisData(sal_Bool bNotes) const
+bool ScColumn::IsEmptyVisData(bool bNotes) const
{
if (!pItems || nCount == 0)
- return sal_True;
+ return true;
else
{
- sal_Bool bVisData = sal_False;
+ bool bVisData = false;
SCSIZE i;
for (i=0; i<nCount && !bVisData; i++)
{
ScBaseCell* pCell = pItems[i].pCell;
if ( pCell->GetCellType() != CELLTYPE_NOTE || (bNotes && pCell->HasNote()) )
- bVisData = sal_True;
+ bVisData = true;
}
return !bVisData;
}
@@ -1255,20 +1176,20 @@ SCSIZE ScColumn::VisibleCount( SCROW nStartRow, SCROW nEndRow ) const
return nVisCount;
}
-SCROW ScColumn::GetLastVisDataPos(sal_Bool bNotes) const
+SCROW ScColumn::GetLastVisDataPos(bool bNotes) const
{
SCROW nRet = 0;
if (pItems)
{
SCSIZE i;
- sal_Bool bFound = sal_False;
+ bool bFound = false;
for (i=nCount; i>0 && !bFound; )
{
--i;
ScBaseCell* pCell = pItems[i].pCell;
if ( pCell->GetCellType() != CELLTYPE_NOTE || (bNotes && pCell->HasNote()) )
{
- bFound = sal_True;
+ bFound = true;
nRet = pItems[i].nRow;
}
}
@@ -1276,19 +1197,19 @@ SCROW ScColumn::GetLastVisDataPos(sal_Bool bNotes) const
return nRet;
}
-SCROW ScColumn::GetFirstVisDataPos(sal_Bool bNotes) const
+SCROW ScColumn::GetFirstVisDataPos(bool bNotes) const
{
SCROW nRet = 0;
if (pItems)
{
SCSIZE i;
- sal_Bool bFound = sal_False;
+ bool bFound = false;
for (i=0; i<nCount && !bFound; i++)
{
ScBaseCell* pCell = pItems[i].pCell;
if ( pCell->GetCellType() != CELLTYPE_NOTE || (bNotes && pCell->HasNote()) )
{
- bFound = sal_True;
+ bFound = true;
nRet = pItems[i].nRow;
}
}
@@ -1296,49 +1217,53 @@ SCROW ScColumn::GetFirstVisDataPos(sal_Bool bNotes) const
return nRet;
}
-sal_Bool ScColumn::HasVisibleDataAt(SCROW nRow) const
+bool ScColumn::HasVisibleDataAt(SCROW nRow) const
{
SCSIZE nIndex;
if (Search(nRow, nIndex))
if (!pItems[nIndex].pCell->IsBlank())
- return sal_True;
+ return true;
- return sal_False;
+ return false;
}
-sal_Bool ScColumn::IsEmptyAttr() const
+bool ScColumn::IsEmptyAttr() const
{
if (pAttrArray)
return pAttrArray->IsEmpty();
else
- return sal_True;
+ return true;
}
-sal_Bool ScColumn::IsEmpty() const
+bool ScColumn::IsEmpty() const
{
return (IsEmptyData() && IsEmptyAttr());
}
-sal_Bool ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow, bool bIgnoreNotes) const
+bool ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow, bool bIgnoreNotes) const
{
+ Rectangle aRect;
+ if (pAttrArray->HasLines(nStartRow, nEndRow, aRect, true, true))
+ return false;
+
if ( nCount == 0 || !pItems )
- return sal_True;
+ return true;
SCSIZE nIndex;
Search( nStartRow, nIndex );
while ( nIndex < nCount && pItems[nIndex].nRow <= nEndRow )
{
if ( !pItems[nIndex].pCell->IsBlank( bIgnoreNotes ) ) // found a cell
- return sal_False; // not empty
+ return false; // not empty
++nIndex;
}
- return sal_True; // no cell found
+ return true; // no cell found
}
SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const
{
SCSIZE nLines = 0;
- sal_Bool bFound = sal_False;
+ bool bFound = false;
SCSIZE i;
if (pItems && (nCount > 0))
{
@@ -1394,9 +1319,9 @@ SCROW ScColumn::GetLastDataPos() const
return 0;
}
-sal_Bool ScColumn::GetPrevDataPos(SCROW& rRow) const
+bool ScColumn::GetPrevDataPos(SCROW& rRow) const
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
SCSIZE i = nCount;
while (!bFound && (i > 0))
{
@@ -1408,13 +1333,13 @@ sal_Bool ScColumn::GetPrevDataPos(SCROW& rRow) const
return bFound;
}
-sal_Bool ScColumn::GetNextDataPos(SCROW& rRow) const // greater than rRow
+bool ScColumn::GetNextDataPos(SCROW& rRow) const // greater than rRow
{
SCSIZE nIndex;
if (Search( rRow, nIndex ))
++nIndex; // next cell
- sal_Bool bMore = ( nIndex < nCount );
+ bool bMore = ( nIndex < nCount );
if ( bMore )
rRow = pItems[nIndex].nRow;
return bMore;
@@ -1423,12 +1348,12 @@ sal_Bool ScColumn::GetNextDataPos(SCROW& rRow) const // greater than rRow
void ScColumn::FindDataAreaPos(SCROW& rRow, long nMovY) const
{
if (!nMovY) return;
- sal_Bool bForward = (nMovY>0);
+ bool bForward = (nMovY>0);
SCSIZE nIndex;
- sal_Bool bThere = Search(rRow, nIndex);
+ bool bThere = Search(rRow, nIndex);
if (bThere && pItems[nIndex].pCell->IsBlank())
- bThere = sal_False;
+ bThere = false;
if (bThere)
{
@@ -1468,7 +1393,7 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, long nMovY) const
}
if (nLast==rRow)
{
- bThere = sal_False;
+ bThere = false;
nIndex = bForward ? nOldIndex+1 : nOldIndex;
}
else
@@ -1498,24 +1423,21 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, long nMovY) const
}
}
-sal_Bool ScColumn::HasDataAt(SCROW nRow) const
+bool ScColumn::HasDataAt(SCROW nRow) const
{
-/* SCSIZE nIndex;
- return Search( nRow, nIndex );
-*/
// immer nur sichtbare interessant ?
//! dann HasVisibleDataAt raus
SCSIZE nIndex;
if (Search(nRow, nIndex))
if (!pItems[nIndex].pCell->IsBlank())
- return sal_True;
+ return true;
- return sal_False;
+ return false;
}
-sal_Bool ScColumn::IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const
+bool ScColumn::IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const
{
if (pAttrArray && rCol.pAttrArray)
return pAttrArray->IsAllEqual( *rCol.pAttrArray, nStartRow, nEndRow );
@@ -1523,7 +1445,7 @@ sal_Bool ScColumn::IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW
return !pAttrArray && !rCol.pAttrArray;
}
-sal_Bool ScColumn::IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const
+bool ScColumn::IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const
{
if (pAttrArray && rCol.pAttrArray)
return pAttrArray->IsVisibleEqual( *rCol.pAttrArray, nStartRow, nEndRow );
@@ -1531,43 +1453,43 @@ sal_Bool ScColumn::IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SC
return !pAttrArray && !rCol.pAttrArray;
}
-sal_Bool ScColumn::GetFirstVisibleAttr( SCROW& rFirstRow ) const
+bool ScColumn::GetFirstVisibleAttr( SCROW& rFirstRow ) const
{
if (pAttrArray)
return pAttrArray->GetFirstVisibleAttr( rFirstRow );
else
- return sal_False;
+ return false;
}
-sal_Bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow ) const
+bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow ) const
{
if (pAttrArray)
{
// row of last cell is needed
- SCROW nLastData = GetLastVisDataPos( sal_True ); // always including notes, 0 if none
+ SCROW nLastData = GetLastVisDataPos( true ); // always including notes, 0 if none
return pAttrArray->GetLastVisibleAttr( rLastRow, nLastData );
}
else
- return sal_False;
+ return false;
}
-sal_Bool ScColumn::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
+bool ScColumn::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
{
if (pAttrArray)
return pAttrArray->HasVisibleAttrIn( nStartRow, nEndRow );
else
- return sal_False;
+ return false;
}
-void ScColumn::FindUsed( SCROW nStartRow, SCROW nEndRow, sal_Bool* pUsed ) const
+void ScColumn::FindUsed( SCROW nStartRow, SCROW nEndRow, bool* pUsed ) const
{
SCROW nRow = 0;
SCSIZE nIndex;
Search( nStartRow, nIndex );
- while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : sal_False )
+ while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : false )
{
- pUsed[nRow-nStartRow] = sal_True;
+ pUsed[nRow-nStartRow] = true;
++nIndex;
}
}
@@ -1650,11 +1572,7 @@ void ScColumn::EndListening( SvtListener& rLst, SCROW nRow )
pCell->DeleteBroadcaster();
}
}
-// else
-// DBG_ERROR("ScColumn::EndListening - kein Broadcaster");
}
-// else
-// DBG_ERROR("ScColumn::EndListening - keine Zelle");
}
void ScColumn::CompileDBFormula()
@@ -1668,7 +1586,7 @@ void ScColumn::CompileDBFormula()
}
}
-void ScColumn::CompileDBFormula( sal_Bool bCreateFormulaString )
+void ScColumn::CompileDBFormula( bool bCreateFormulaString )
{
if (pItems)
for (SCSIZE i = 0; i < nCount; i++)
@@ -1679,7 +1597,7 @@ void ScColumn::CompileDBFormula( sal_Bool bCreateFormulaString )
}
}
-void ScColumn::CompileNameFormula( sal_Bool bCreateFormulaString )
+void ScColumn::CompileNameFormula( bool bCreateFormulaString )
{
if (pItems)
for (SCSIZE i = 0; i < nCount; i++)
@@ -1704,13 +1622,13 @@ void ScColumn::CompileColRowNameFormula()
void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell )
{
double nValue = 0.0;
- sal_Bool bVal = sal_False;
- sal_Bool bCell = sal_True;
+ bool bVal = false;
+ bool bCell = true;
switch (pCell->GetCellType())
{
case CELLTYPE_VALUE:
nValue = ((ScValueCell*)pCell)->GetValue();
- bVal = sal_True;
+ bVal = true;
break;
case CELLTYPE_FORMULA:
{
@@ -1720,19 +1638,19 @@ void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell )
if ( pFC->GetErrCode() )
{
if ( rData.eFunc != SUBTOTAL_FUNC_CNT ) // fuer Anzahl einfach weglassen
- rData.bError = sal_True;
+ rData.bError = true;
}
else if (pFC->IsValue())
{
nValue = pFC->GetValue();
- bVal = sal_True;
+ bVal = true;
}
// sonst Text
}
}
break;
case CELLTYPE_NOTE:
- bCell = sal_False;
+ bCell = false;
break;
// bei Strings nichts
default:
@@ -1751,7 +1669,7 @@ void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell )
{
++rData.nCount;
if (!SubTotal::SafePlus( rData.nVal, nValue ))
- rData.bError = sal_True;
+ rData.bError = true;
}
break;
case SUBTOTAL_FUNC_CNT: // nur Werte
@@ -1784,10 +1702,10 @@ void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell )
void ScColumn::UpdateSelectionFunction( const ScMarkData& rMark,
ScFunctionData& rData,
ScFlatBoolRowSegments& rHiddenRows,
- sal_Bool bDoExclude, SCROW nExStartRow, SCROW nExEndRow )
+ bool bDoExclude, SCROW nExStartRow, SCROW nExEndRow )
{
SCSIZE nIndex;
- ScMarkedDataIter aDataIter(this, &rMark, sal_False);
+ ScMarkedDataIter aDataIter(this, &rMark, false);
while (aDataIter.Next( nIndex ))
{
SCROW nRow = pItems[nIndex].nRow;
@@ -1815,9 +1733,9 @@ void ScColumn::UpdateAreaFunction( ScFunctionData& rData,
}
}
-sal_uLong ScColumn::GetWeightedCount() const
+sal_uInt32 ScColumn::GetWeightedCount() const
{
- sal_uLong nTotal = 0;
+ sal_uInt32 nTotal = 0;
// Notizen werden nicht gezaehlt
@@ -1846,9 +1764,9 @@ sal_uLong ScColumn::GetWeightedCount() const
return nTotal;
}
-sal_uLong ScColumn::GetCodeCount() const
+sal_uInt32 ScColumn::GetCodeCount() const
{
- sal_uLong nCodeCount = 0;
+ sal_uInt32 nCodeCount = 0;
for (SCSIZE i=0; i<nCount; i++)
{
@@ -1864,3 +1782,4 @@ sal_uLong ScColumn::GetCodeCount() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index b6884e4f04b9..b85caa2a06ef 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,6 +53,7 @@
#include "detfunc.hxx" // fuer Notizen bei DeleteRange
#include "postit.hxx"
#include "stringutil.hxx"
+#include "docpool.hxx"
#include <com/sun/star/i18n/LocaleDataItem.hpp>
@@ -64,12 +66,12 @@ extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx
using namespace formula;
// STATIC DATA -----------------------------------------------------------
-sal_Bool ScColumn::bDoubleAlloc = sal_False; // fuer Import: Groesse beim Allozieren verdoppeln
+bool ScColumn::bDoubleAlloc = false; // fuer Import: Groesse beim Allozieren verdoppeln
void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell )
{
- sal_Bool bIsAppended = sal_False;
+ sal_Bool bIsAppended = false;
if (pItems && nCount>0)
{
if (pItems[nCount-1].nRow < nRow)
@@ -156,7 +158,7 @@ void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell )
}
-void ScColumn::Insert( SCROW nRow, sal_uLong nNumberFormat, ScBaseCell* pCell )
+void ScColumn::Insert( SCROW nRow, sal_uInt32 nNumberFormat, ScBaseCell* pCell )
{
Insert(nRow, pCell);
short eOldType = pDocument->GetFormatTable()->
@@ -275,9 +277,9 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
return ;
sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
- sal_Bool bFound=sal_False;
+ sal_Bool bFound=false;
SCROW nEndRow = nStartRow + nSize - 1;
SCSIZE nStartIndex = 0;
SCSIZE nEndIndex = 0;
@@ -327,11 +329,11 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
for ( ; i < nCount; i++ )
{
SCROW nOldRow = pItems[i].nRow;
- // #43940# Aenderung Quelle broadcasten
+ // Aenderung Quelle broadcasten
rAddress.SetRow( nOldRow );
pDocument->AreaBroadcast( aHint );
SCROW nNewRow = (pItems[i].nRow -= nSize);
- // #43940# Aenderung Ziel broadcasten
+ // Aenderung Ziel broadcasten
if ( nLastBroadcast != nNewRow )
{ // direkt aufeinanderfolgende nicht doppelt broadcasten
rAddress.SetRow( nNewRow );
@@ -566,7 +568,7 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag)
DeleteRange( 0, nCount-1, nContFlag );
else
{
- sal_Bool bFound=sal_False;
+ sal_Bool bFound=false;
SCSIZE nStartIndex = 0;
SCSIZE nEndIndex = 0;
for (SCSIZE i = 0; i < nCount; i++)
@@ -606,7 +608,7 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r
// Testen, ob Zelle kopiert werden soll
// auch bei IDF_CONTENTS komplett, wegen Notes / Broadcastern
- sal_Bool bMatch = sal_False;
+ sal_Bool bMatch = false;
ScBaseCell* pCell = pItems[nIndex].pCell;
CellType eCellType = pCell->GetCellType();
switch ( eCellType )
@@ -647,9 +649,9 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r
aRef.nRow = pItems[nIndex].nRow;
aRef.nTab = nTab;
aRef.InitFlags(); // -> alles absolut
- aRef.SetFlag3D(sal_True);
+ aRef.SetFlag3D(true);
- //! 3D(sal_False) und TabRel(sal_True), wenn die endgueltige Position auf der selben Tabelle ist?
+ //! 3D(FALSE) und TabRel(TRUE), wenn die endgueltige Position auf der selben Tabelle ist?
//! (bei TransposeClip ist die Zielposition noch nicht bekannt)
aRef.CalcRelFromAbs( rDestPos );
@@ -665,7 +667,7 @@ ScFormulaCell* ScColumn::CreateRefCell( ScDocument* pDestDoc, const ScAddress& r
// nRow1, nRow2 = Zielposition
void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy,
- sal_uInt16 nInsFlag, sal_Bool bAsLink, sal_Bool bSkipAttrForEmpty,
+ sal_uInt16 nInsFlag, bool bAsLink, bool bSkipAttrForEmpty,
ScColumn& rColumn)
{
if ((nInsFlag & IDF_ATTRIB) != 0)
@@ -723,7 +725,7 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy,
// nRow wird angepasst
aRef.nTab = rColumn.nTab;
aRef.InitFlags(); // -> alles absolut
- aRef.SetFlag3D(sal_True);
+ aRef.SetFlag3D(true);
for (SCROW nDestRow = nRow1; nDestRow <= nRow2; nDestRow++)
{
@@ -755,7 +757,7 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy,
// IDF_ADDNOTES must be passed without other content flags than IDF_NOTE
bool bAddNotes = (nInsFlag & (IDF_CONTENTS | IDF_ADDNOTES)) == (IDF_NOTE | IDF_ADDNOTES);
- sal_Bool bAtEnd = sal_False;
+ sal_Bool bAtEnd = false;
for (SCSIZE i = 0; i < nColCount && !bAtEnd; i++)
{
SCsROW nDestRow = rColumn.pItems[i].nRow + nDy;
@@ -828,8 +830,10 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rD
bool bCloneValue = (nFlags & IDF_VALUE) != 0;
bool bCloneDateTime = (nFlags & IDF_DATETIME) != 0;
bool bCloneString = (nFlags & IDF_STRING) != 0;
+ bool bCloneSpecialBoolean = (nFlags & IDF_SPECIAL_BOOLEAN) != 0;
bool bCloneFormula = (nFlags & IDF_FORMULA) != 0;
bool bCloneNote = (nFlags & IDF_NOTE) != 0;
+ bool bForceFormula = false;
ScBaseCell* pNew = 0;
ScBaseCell& rSource = *pItems[nIndex].pCell;
@@ -853,14 +857,25 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rD
break;
case CELLTYPE_FORMULA:
- if (bCloneFormula)
+ if ( bCloneSpecialBoolean )
+ {
+ ScFormulaCell& rForm = (ScFormulaCell&)rSource;
+ rtl::OUStringBuffer aBuf;
+ // #TODO #FIXME do we have a localisation issue here?
+ rForm.GetFormula( aBuf );
+ rtl::OUString aVal( aBuf.makeStringAndClear() );
+ if ( aVal.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "=TRUE()" ) )
+ || aVal.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "=FALSE()" ) ) )
+ bForceFormula = true;
+ }
+ if (bForceFormula || bCloneFormula)
{
// note will be cloned below
pNew = rSource.CloneWithoutNote( rDestDoc, rDestPos );
}
else if ( (bCloneValue || bCloneDateTime || bCloneString) && !rDestDoc.IsUndo() )
{
- // #48491# ins Undo-Dokument immer nur die Original-Zelle kopieren,
+ // ins Undo-Dokument immer nur die Original-Zelle kopieren,
// aus Formeln keine Value/String-Zellen erzeugen
ScFormulaCell& rForm = (ScFormulaCell&)rSource;
sal_uInt16 nErr = rForm.GetErrCode();
@@ -886,7 +901,7 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rD
{
String aString;
rForm.GetString( aString );
- // #33224# do not clone empty string
+ // do not clone empty string
if (aString.Len() > 0)
{
if ( rForm.IsMultilineResult() )
@@ -926,7 +941,7 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rD
void ScColumn::MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction,
- sal_Bool bSkipEmpty, ScColumn& rSrcCol )
+ bool bSkipEmpty, ScColumn& rSrcCol )
{
SCROW nRow1, nRow2;
@@ -943,7 +958,7 @@ void ScColumn::MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction,
sal_Bool lcl_DoFunction( double& rVal1, double nVal2, sal_uInt16 nFunction )
{
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
switch (nFunction)
{
case PASTE_ADD:
@@ -984,7 +999,7 @@ void lcl_AddCode( ScTokenArray& rArr, ScFormulaCell* pCell )
void ScColumn::MixData( SCROW nRow1, SCROW nRow2,
- sal_uInt16 nFunction, sal_Bool bSkipEmpty,
+ sal_uInt16 nFunction, bool bSkipEmpty,
ScColumn& rSrcCol )
{
SCSIZE nSrcCount = rSrcCol.nCount;
@@ -1010,7 +1025,7 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2,
ScBaseCell* pSrc = NULL;
ScBaseCell* pDest = NULL;
ScBaseCell* pNew = NULL;
- sal_Bool bDelete = sal_False;
+ sal_Bool bDelete = false;
if ( nSrcIndex < nSrcCount && nNextSrc == nRow )
pSrc = rSrcCol.pItems[nSrcIndex].pCell;
@@ -1246,241 +1261,258 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 )
}
-// sal_True = Zahlformat gesetzt
-sal_Bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
+// TRUE = Zahlformat gesetzt
+bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
formula::FormulaGrammar::AddressConvention eConv,
- SvNumberFormatter* pLangFormatter, bool bDetectNumberFormat )
+ ScSetStringParam* pParam )
{
- sal_Bool bNumFmtSet = sal_False;
- if (VALIDROW(nRow))
+ bool bNumFmtSet = false;
+ if (!ValidRow(nRow))
+ return false;
+
+ ScBaseCell* pNewCell = NULL;
+ sal_Bool bIsLoading = false;
+ if (rString.Len() > 0)
{
- ScBaseCell* pNewCell = NULL;
- sal_Bool bIsLoading = sal_False;
- if (rString.Len() > 0)
+ ScSetStringParam aParam;
+ if (pParam)
+ aParam = *pParam;
+
+ sal_uInt32 nIndex, nOldIndex = 0;
+ sal_Unicode cFirstChar;
+ if (!aParam.mpNumFormatter)
+ aParam.mpNumFormatter = pDocument->GetFormatTable();
+ SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
+ if ( pDocSh )
+ bIsLoading = pDocSh->IsLoading();
+ // IsLoading bei ConvertFrom Import
+ if ( !bIsLoading )
{
- double nVal;
- sal_uInt32 nIndex, nOldIndex = 0;
- sal_Unicode cFirstChar;
- // #i110979# If a different NumberFormatter is passed in (pLangFormatter),
- // its formats aren't valid in the document.
- // Only use the language / LocaleDataWrapper from pLangFormatter,
- // always the document's number formatter for IsNumberFormat.
- SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
- if ( pDocSh )
- bIsLoading = pDocSh->IsLoading();
- // IsLoading bei ConvertFrom Import
- if ( !bIsLoading )
- {
- nIndex = nOldIndex = GetNumberFormat( nRow );
- if ( rString.Len() > 1
- && pFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT )
- cFirstChar = rString.GetChar(0);
- else
- cFirstChar = 0; // Text
- }
- else
- { // waehrend ConvertFrom Import gibt es keine gesetzten Formate
+ nIndex = nOldIndex = GetNumberFormat( nRow );
+ if ( rString.Len() > 1
+ && aParam.mpNumFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT )
cFirstChar = rString.GetChar(0);
- }
+ else
+ cFirstChar = 0; // Text
+ }
+ else
+ { // waehrend ConvertFrom Import gibt es keine gesetzten Formate
+ cFirstChar = rString.GetChar(0);
+ }
- if ( cFirstChar == '=' )
- {
- if ( rString.Len() == 1 ) // = Text
- pNewCell = new ScStringCell( rString );
- else // =Formel
- pNewCell = new ScFormulaCell( pDocument,
- ScAddress( nCol, nRow, nTabP ), rString,
- formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_DEFAULT,
- eConv), MM_NONE );
- }
- else if ( cFirstChar == '\'') // 'Text
- pNewCell = new ScStringCell( rString.Copy(1) );
+ if ( cFirstChar == '=' )
+ {
+ if ( rString.Len() == 1 ) // = Text
+ pNewCell = new ScStringCell( rString );
+ else // =Formel
+ pNewCell = new ScFormulaCell( pDocument,
+ ScAddress( nCol, nRow, nTabP ), rString,
+ formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_DEFAULT,
+ eConv), MM_NONE );
+ }
+ else if ( cFirstChar == '\'') // 'Text
+ {
+ // Cell format is not 'Text', and the first char
+ // is an apostrophe. Check if the input is considered a number.
+ String aTest = rString.Copy(1);
+ double fTest;
+ if (aParam.mpNumFormatter->IsNumberFormat(aTest, nIndex, fTest))
+ // This is a number. Strip out the first char.
+ pNewCell = new ScStringCell(aTest);
else
+ // This is a normal text. Take it as-is.
+ pNewCell = new ScStringCell(rString);
+ }
+ else
+ {
+ double nVal;
+ sal_Bool bIsText = false;
+ if ( bIsLoading )
{
- sal_Bool bIsText = sal_False;
- if ( bIsLoading )
+ if ( pItems && nCount )
{
- if ( pItems && nCount )
+ String aStr;
+ SCSIZE i = nCount;
+ SCSIZE nStop = (i >= 3 ? i - 3 : 0);
+ // die letzten Zellen vergleichen, ob gleicher String
+ // und IsNumberFormat eingespart werden kann
+ do
{
- String aStr;
- SCSIZE i = nCount;
- SCSIZE nStop = (i >= 3 ? i - 3 : 0);
- // die letzten Zellen vergleichen, ob gleicher String
- // und IsNumberFormat eingespart werden kann
- do
+ i--;
+ ScBaseCell* pCell = pItems[i].pCell;
+ switch ( pCell->GetCellType() )
{
- i--;
- ScBaseCell* pCell = pItems[i].pCell;
- switch ( pCell->GetCellType() )
- {
- case CELLTYPE_STRING :
- ((ScStringCell*)pCell)->GetString( aStr );
- if ( rString == aStr )
- bIsText = sal_True;
- break;
- case CELLTYPE_NOTE : // durch =Formel referenziert
- break;
- default:
- if ( i == nCount - 1 )
- i = 0;
- // wahrscheinlich ganze Spalte kein String
- }
- } while ( i && i > nStop && !bIsText );
- }
- // nIndex fuer IsNumberFormat vorbelegen
- if ( !bIsText )
- nIndex = nOldIndex = pFormatter->GetStandardIndex();
+ case CELLTYPE_STRING :
+ ((ScStringCell*)pCell)->GetString( aStr );
+ if ( rString == aStr )
+ bIsText = true;
+ break;
+ case CELLTYPE_NOTE : // durch =Formel referenziert
+ break;
+ default:
+ if ( i == nCount - 1 )
+ i = 0;
+ // wahrscheinlich ganze Spalte kein String
+ }
+ } while ( i && i > nStop && !bIsText );
}
+ // nIndex fuer IsNumberFormat vorbelegen
+ if ( !bIsText )
+ nIndex = nOldIndex = aParam.mpNumFormatter->GetStandardIndex();
+ }
- do
+ do
+ {
+ if (bIsText)
+ break;
+
+ if (aParam.mbDetectNumberFormat)
{
- if (bIsText)
+ if (!aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal))
break;
- if (bDetectNumberFormat)
+ if ( aParam.mpNumFormatter )
{
- if ( pLangFormatter )
- {
- // for number detection: valid format index for selected language
- nIndex = pFormatter->GetStandardIndex( pLangFormatter->GetLanguage() );
- }
-
- if (!pFormatter->IsNumberFormat(rString, nIndex, nVal))
- break;
+ // convert back to the original language if a built-in format was detected
+ const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex );
+ if ( pOldFormat )
+ nIndex = aParam.mpNumFormatter->GetFormatForLanguageIfBuiltIn( nIndex, pOldFormat->GetLanguage() );
+ }
- if ( pLangFormatter )
- {
- // convert back to the original language if a built-in format was detected
- const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
- if ( pOldFormat )
- nIndex = pFormatter->GetFormatForLanguageIfBuiltIn( nIndex, pOldFormat->GetLanguage() );
- }
+ pNewCell = new ScValueCell( nVal );
+ if ( nIndex != nOldIndex)
+ {
+ // #i22345# New behavior: Apply the detected number format only if
+ // the old one was the default number, date, time or boolean format.
+ // Exception: If the new format is boolean, always apply it.
- pNewCell = new ScValueCell( nVal );
- if ( nIndex != nOldIndex)
+ sal_Bool bOverwrite = false;
+ const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex );
+ if ( pOldFormat )
{
- // #i22345# New behavior: Apply the detected number format only if
- // the old one was the default number, date, time or boolean format.
- // Exception: If the new format is boolean, always apply it.
-
- sal_Bool bOverwrite = sal_False;
- const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
- if ( pOldFormat )
+ short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
+ if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
+ nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
{
- short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
- if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
- nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
+ if ( nOldIndex == aParam.mpNumFormatter->GetStandardFormat(
+ nOldType, pOldFormat->GetLanguage() ) )
{
- if ( nOldIndex == pFormatter->GetStandardFormat(
- nOldType, pOldFormat->GetLanguage() ) )
- {
- bOverwrite = sal_True; // default of these types can be overwritten
- }
+ bOverwrite = true; // default of these types can be overwritten
}
}
- if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
- {
- bOverwrite = sal_True; // overwrite anything if boolean was detected
- }
+ }
+ if ( !bOverwrite && aParam.mpNumFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
+ {
+ bOverwrite = true; // overwrite anything if boolean was detected
+ }
- if ( bOverwrite )
- {
- ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
- (sal_uInt32) nIndex) );
- bNumFmtSet = sal_True;
- }
+ if ( bOverwrite )
+ {
+ ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
+ (sal_uInt32) nIndex) );
+ bNumFmtSet = true;
}
}
- else
- {
- // Only check if the string is a regular number.
- SvNumberFormatter* pLocaleSource = pLangFormatter ? pLangFormatter : pFormatter;
- const LocaleDataWrapper* pLocale = pLocaleSource->GetLocaleData();
- if (!pLocale)
- break;
+ }
+ else
+ {
+ // Only check if the string is a regular number.
+ const LocaleDataWrapper* pLocale = aParam.mpNumFormatter->GetLocaleData();
+ if (!pLocale)
+ break;
- LocaleDataItem aLocaleItem = pLocale->getLocaleItem();
- const OUString& rDecSep = aLocaleItem.decimalSeparator;
- const OUString& rGroupSep = aLocaleItem.thousandSeparator;
- if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1)
- break;
+ LocaleDataItem aLocaleItem = pLocale->getLocaleItem();
+ const OUString& rDecSep = aLocaleItem.decimalSeparator;
+ const OUString& rGroupSep = aLocaleItem.thousandSeparator;
+ if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1)
+ break;
- sal_Unicode dsep = rDecSep.getStr()[0];
- sal_Unicode gsep = rGroupSep.getStr()[0];
+ sal_Unicode dsep = rDecSep.getStr()[0];
+ sal_Unicode gsep = rGroupSep.getStr()[0];
- if (!ScStringUtil::parseSimpleNumber(rString, dsep, gsep, nVal))
- break;
+ if (!ScStringUtil::parseSimpleNumber(rString, dsep, gsep, nVal))
+ break;
- pNewCell = new ScValueCell(nVal);
- }
+ pNewCell = new ScValueCell(nVal);
+ }
+ }
+ while (false);
+
+ if (!pNewCell)
+ {
+ if (aParam.mbSetTextCellFormat && aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal))
+ {
+ // Set the cell format type to Text.
+ sal_uInt32 nFormat = aParam.mpNumFormatter->GetStandardFormat(NUMBERFORMAT_TEXT);
+ ScPatternAttr aNewAttrs(pDocument->GetPool());
+ SfxItemSet& rSet = aNewAttrs.GetItemSet();
+ rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) );
+ ApplyPattern(nRow, aNewAttrs);
}
- while (false);
- if (!pNewCell)
- pNewCell = new ScStringCell(rString);
+ pNewCell = new ScStringCell(rString);
}
}
+ }
- if ( bIsLoading && (!nCount || nRow > pItems[nCount-1].nRow) )
- { // Search einsparen und ohne Umweg ueber Insert, Listener aufbauen
- // und Broadcast kommt eh erst nach dem Laden
- if ( pNewCell )
- Append( nRow, pNewCell );
- }
- else
+ if ( bIsLoading && (!nCount || nRow > pItems[nCount-1].nRow) )
+ { // Search einsparen und ohne Umweg ueber Insert, Listener aufbauen
+ // und Broadcast kommt eh erst nach dem Laden
+ if ( pNewCell )
+ Append( nRow, pNewCell );
+ }
+ else
+ {
+ SCSIZE i;
+ if (Search(nRow, i))
{
- SCSIZE i;
- if (Search(nRow, i))
+ ScBaseCell* pOldCell = pItems[i].pCell;
+ ScPostIt* pNote = pOldCell->ReleaseNote();
+ SvtBroadcaster* pBC = pOldCell->ReleaseBroadcaster();
+ if (pNewCell || pNote || pBC)
{
- ScBaseCell* pOldCell = pItems[i].pCell;
- ScPostIt* pNote = pOldCell->ReleaseNote();
- SvtBroadcaster* pBC = pOldCell->ReleaseBroadcaster();
- if (pNewCell || pNote || pBC)
+ if (pNewCell)
+ pNewCell->TakeNote( pNote );
+ else
+ pNewCell = new ScNoteCell( pNote );
+ if (pBC)
{
- if (pNewCell)
- pNewCell->TakeNote( pNote );
- else
- pNewCell = new ScNoteCell( pNote );
- if (pBC)
- {
- pNewCell->TakeBroadcaster(pBC);
- pLastFormulaTreeTop = 0; // Err527 Workaround
- }
+ pNewCell->TakeBroadcaster(pBC);
+ pLastFormulaTreeTop = 0; // Err527 Workaround
+ }
- if ( pOldCell->GetCellType() == CELLTYPE_FORMULA )
- {
- pOldCell->EndListeningTo( pDocument );
- // falls in EndListening NoteCell in gleicher Col zerstoert
- if ( i >= nCount || pItems[i].nRow != nRow )
- Search(nRow, i);
- }
- pOldCell->Delete();
- pItems[i].pCell = pNewCell; // ersetzen
- if ( pNewCell->GetCellType() == CELLTYPE_FORMULA )
- {
- pNewCell->StartListeningTo( pDocument );
- ((ScFormulaCell*)pNewCell)->SetDirty();
- }
- else
- pDocument->Broadcast( ScHint( SC_HINT_DATACHANGED,
- ScAddress( nCol, nRow, nTabP ), pNewCell ) );
+ if ( pOldCell->GetCellType() == CELLTYPE_FORMULA )
+ {
+ pOldCell->EndListeningTo( pDocument );
+ // falls in EndListening NoteCell in gleicher Col zerstoert
+ if ( i >= nCount || pItems[i].nRow != nRow )
+ Search(nRow, i);
}
- else
+ pOldCell->Delete();
+ pItems[i].pCell = pNewCell; // ersetzen
+ if ( pNewCell->GetCellType() == CELLTYPE_FORMULA )
{
- DeleteAtIndex(i); // loeschen und Broadcast
+ pNewCell->StartListeningTo( pDocument );
+ ((ScFormulaCell*)pNewCell)->SetDirty();
}
+ else
+ pDocument->Broadcast( ScHint( SC_HINT_DATACHANGED,
+ ScAddress( nCol, nRow, nTabP ), pNewCell ) );
}
- else if (pNewCell)
+ else
{
- Insert(nRow, pNewCell); // neu eintragen und Broadcast
+ DeleteAtIndex(i); // loeschen und Broadcast
}
}
+ else if (pNewCell)
+ {
+ Insert(nRow, pNewCell); // neu eintragen und Broadcast
+ }
+ }
- // hier keine Formate mehr fuer Formeln setzen!
- // (werden bei der Ausgabe abgefragt)
+ // hier keine Formate mehr fuer Formeln setzen!
+ // (werden bei der Ausgabe abgefragt)
- }
return bNumFmtSet;
}
@@ -1495,7 +1527,7 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
Search( nStartRow, nIndex );
- while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : sal_False )
+ while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : false )
{
ScBaseCell* pCell = pItems[nIndex].pCell;
TypedStrData* pData;
@@ -1537,16 +1569,6 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
}
-#if 0 // DR
- ScPostIt aCellNote( ScPostIt::UNINITIALIZED );
- // Hide visible notes during Filtering.
- if(pCell->GetNote(aCellNote) && aCellNote.IsCaptionShown())
- {
- ScDetectiveFunc( pDocument, nTab ).HideComment( nCol, nRow );
- aCellNote.SetShown( false );
- pCell->SetNote(aCellNote);
- }
-#endif
if ( !rStrings.Insert( pData ) )
delete pData; // doppelt
@@ -1567,9 +1589,9 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
#define DATENT_SEARCH 2000
-sal_Bool ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, sal_Bool bLimit)
+bool ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rStrings, bool bLimit)
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCSIZE nThisIndex;
sal_Bool bThisUsed = Search( nStartRow, nThisIndex );
String aString;
@@ -1603,7 +1625,7 @@ sal_Bool ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rString
delete pData; // doppelt
else if ( bLimit && rStrings.GetCount() >= DATENT_MAX )
break; // Maximum erreicht
- bFound = sal_True;
+ bFound = true;
if ( bLimit )
if (++nCells >= DATENT_SEARCH)
@@ -1628,7 +1650,7 @@ sal_Bool ScColumn::GetDataEntries(SCROW nStartRow, TypedScStrCollection& rString
delete pData; // doppelt
else if ( bLimit && rStrings.GetCount() >= DATENT_MAX )
break; // Maximum erreicht
- bFound = sal_True;
+ bFound = true;
if ( bLimit )
if (++nCells >= DATENT_SEARCH)
@@ -1776,7 +1798,7 @@ double ScColumn::GetValue( SCROW nRow ) const
}
-void ScColumn::GetFormula( SCROW nRow, String& rFormula, sal_Bool ) const
+void ScColumn::GetFormula( SCROW nRow, String& rFormula ) const
{
SCSIZE nIndex;
if (Search(nRow, nIndex))
@@ -1814,26 +1836,26 @@ sal_uInt16 ScColumn::GetErrCode( SCROW nRow ) const
}
-sal_Bool ScColumn::HasStringData( SCROW nRow ) const
+bool ScColumn::HasStringData( SCROW nRow ) const
{
SCSIZE nIndex;
if (Search(nRow, nIndex))
return (pItems[nIndex].pCell)->HasStringData();
- return sal_False;
+ return false;
}
-sal_Bool ScColumn::HasValueData( SCROW nRow ) const
+bool ScColumn::HasValueData( SCROW nRow ) const
{
SCSIZE nIndex;
if (Search(nRow, nIndex))
return (pItems[nIndex].pCell)->HasValueData();
- return sal_False;
+ return false;
}
-sal_Bool ScColumn::HasStringCells( SCROW nStartRow, SCROW nEndRow ) const
+bool ScColumn::HasStringCells( SCROW nStartRow, SCROW nEndRow ) const
{
- // sal_True, wenn String- oder Editzellen im Bereich
+ // TRUE, wenn String- oder Editzellen im Bereich
if ( pItems )
{
@@ -1847,7 +1869,7 @@ sal_Bool ScColumn::HasStringCells( SCROW nStartRow, SCROW nEndRow ) const
++nIndex;
}
}
- return sal_False;
+ return false;
}
@@ -1968,8 +1990,18 @@ xub_StrLen ScColumn::GetMaxNumberStringLen(
if ( nLen )
{
if ( nFormat )
- { // more decimals than standard?
- sal_uInt16 nPrec = pNumFmt->GetFormatPrecision( nFormat );
+ {
+ const SvNumberformat* pEntry = pNumFmt->GetEntry( nFormat );
+ sal_uInt16 nPrec;
+ if (pEntry)
+ {
+ sal_Bool bThousand, bNegRed;
+ sal_uInt16 nLeading;
+ pEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrec, nLeading);
+ }
+ else
+ nPrec = pNumFmt->GetFormatPrecision( nFormat );
+
if ( nPrec != SvNumberFormatter::UNLIMITED_PRECISION && nPrec > nPrecision )
nPrecision = nPrec;
}
@@ -1999,3 +2031,4 @@ xub_StrLen ScColumn::GetMaxNumberStringLen(
return nStringLen;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx
index fda3ca585621..89abf3beabaa 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -334,92 +335,6 @@ void ScCompressedArray<A,D>::Remove( A nStart, size_t nAccessCount )
}
-template< typename A, typename D >
-A ScCompressedArray<A,D>::GetLastUnequalAccess( A nStart, const D& rCompare )
-{
- A nEnd = ::std::numeric_limits<A>::max();
- size_t nIndex = nCount-1;
- while (1)
- {
- if (pData[nIndex].aValue != rCompare)
- {
- nEnd = pData[nIndex].nEnd;
- break; // while
- }
- else
- {
- if (nIndex > 0)
- {
- --nIndex;
- if (pData[nIndex].nEnd < nStart)
- break; // while
- }
- else
- break; // while
- }
- }
- return nEnd;
-}
-
-
-// === ScSummableCompressedArray =============================================
-
-template< typename A, typename D >
-unsigned long ScSummableCompressedArray<A,D>::SumValues( A nStart, A nEnd ) const
-{
- size_t nIndex = Search( nStart);
- unsigned long nSum = SumValuesContinuation( nStart, nEnd, nIndex);
- if (nEnd > this->nMaxAccess)
- nSum += this->pData[this->nCount-1].aValue * (nEnd - this->nMaxAccess);
- return nSum;
-}
-
-
-template< typename A, typename D >
-unsigned long ScSummableCompressedArray<A,D>::SumValuesContinuation(
- A nStart, A nEnd, size_t& nIndex ) const
-{
- unsigned long nSum = 0;
- A nS = nStart;
- while (nIndex < this->nCount && nS <= nEnd)
- {
- A nE = ::std::min( this->pData[nIndex].nEnd, nEnd);
- // FIXME: test for overflow in a single region?
- unsigned long nNew = (unsigned long) this->pData[nIndex].aValue * (nE - nS + 1);
- nSum += nNew;
- if (nSum < nNew)
- return ::std::numeric_limits<unsigned long>::max();
- nS = nE + 1;
- if (nS <= nEnd)
- ++nIndex;
- }
- return nSum;
-}
-
-
-template< typename A, typename D >
-unsigned long ScSummableCompressedArray<A,D>::SumScaledValuesContinuation(
- A nStart, A nEnd, size_t& nIndex, double fScale ) const
-{
- unsigned long nSum = 0;
- A nS = nStart;
- while (nIndex < this->nCount && nS <= nEnd)
- {
- A nE = ::std::min( this->pData[nIndex].nEnd, nEnd);
- unsigned long nScaledVal = (unsigned long) (this->pData[nIndex].aValue * fScale);
- // FIXME: test for overflow in a single region?
- unsigned long nNew = nScaledVal * (nE - nS + 1);
- nSum += nNew;
- if (nSum < nNew)
- return ::std::numeric_limits<unsigned long>::max();
- nS = nE + 1;
- if (nS <= nEnd)
- ++nIndex;
- }
- return nSum;
-}
-
-
// === ScBitMaskCompressedArray ==============================================
template< typename A, typename D >
@@ -496,67 +411,6 @@ void ScBitMaskCompressedArray<A,D>::CopyFromAnded(
}
}
-
-template< typename A, typename D >
-void ScBitMaskCompressedArray<A,D>::CopyFromOred(
- const ScBitMaskCompressedArray<A,D>& rArray, A nStart, A nEnd,
- const D& rValueToOr, long nSourceDy )
-{
- size_t nIndex;
- A nRegionEnd;
- for (A j=nStart; j<=nEnd; ++j)
- {
- const D& rValue = (j==nStart ?
- rArray.GetValue( j+nSourceDy, nIndex, nRegionEnd) :
- rArray.GetNextValue( nIndex, nRegionEnd));
- nRegionEnd -= nSourceDy;
- if (nRegionEnd > nEnd)
- nRegionEnd = nEnd;
- SetValue( j, nRegionEnd, rValue | rValueToOr);
- j = nRegionEnd;
- }
-}
-
-
-template< typename A, typename D >
-A ScBitMaskCompressedArray<A,D>::GetBitStateStart( A nEnd,
- const D& rBitMask, const D& rMaskedCompare ) const
-{
- A nStart = ::std::numeric_limits<A>::max();
- size_t nIndex = Search( nEnd);
- while ((this->pData[nIndex].aValue & rBitMask) == rMaskedCompare)
- {
- if (nIndex > 0)
- {
- --nIndex;
- nStart = this->pData[nIndex].nEnd + 1;
- }
- else
- {
- nStart = 0;
- break; // while
- }
- }
- return nStart;
-}
-
-
-template< typename A, typename D >
-A ScBitMaskCompressedArray<A,D>::GetBitStateEnd( A nStart,
- const D& rBitMask, const D& rMaskedCompare ) const
-{
- A nEnd = ::std::numeric_limits<A>::max();
- size_t nIndex = Search( nStart);
- while (nIndex < this->nCount && (this->pData[nIndex].aValue & rBitMask) ==
- rMaskedCompare)
- {
- nEnd = this->pData[nIndex].nEnd;
- ++nIndex;
- }
- return nEnd;
-}
-
-
template< typename A, typename D >
A ScBitMaskCompressedArray<A,D>::GetFirstForCondition( A nStart, A nEnd,
const D& rBitMask, const D& rMaskedCompare ) const
@@ -576,115 +430,6 @@ A ScBitMaskCompressedArray<A,D>::GetFirstForCondition( A nStart, A nEnd,
return ::std::numeric_limits<A>::max();
}
-
-template< typename A, typename D >
-A ScBitMaskCompressedArray<A,D>::GetLastForCondition( A nStart, A nEnd,
- const D& rBitMask, const D& rMaskedCompare ) const
-{
- size_t nIndex = Search( nEnd);
- while (1)
- {
- if ((this->pData[nIndex].aValue & rBitMask) == rMaskedCompare)
- return ::std::min( this->pData[nIndex].nEnd, nEnd);
-
- if (nIndex > 0)
- {
- --nIndex;
- if (this->pData[nIndex].nEnd < nStart)
- break; // while
- }
- else
- break; // while
- }
- return ::std::numeric_limits<A>::max();
-}
-
-
-template< typename A, typename D >
-A ScBitMaskCompressedArray<A,D>::CountForCondition( A nStart, A nEnd,
- const D& rBitMask, const D& rMaskedCompare ) const
-{
- A nRet = 0;
- size_t nIndex = Search( nStart);
- do
- {
- if ((this->pData[nIndex].aValue & rBitMask) == rMaskedCompare)
- {
- A nS = ::std::max( (nIndex>0 ? this->pData[nIndex-1].nEnd+1 : 0), nStart);
- A nE = ::std::min( this->pData[nIndex].nEnd, nEnd);
- nRet += nE - nS + 1;
- }
- if (this->pData[nIndex].nEnd >= nEnd)
- break; // while
- ++nIndex;
- } while (nIndex < this->nCount);
- return nRet;
-}
-
-
-template< typename A, typename D >
-size_t ScBitMaskCompressedArray<A,D>::FillArrayForCondition( A nStart, A nEnd,
- const D& rBitMask, const D& rMaskedCompare,
- A * pArray, size_t nArraySize ) const
-{
- size_t nUsed = 0;
- size_t nIndex = Search( nStart);
- while (nIndex < this->nCount && nUsed < nArraySize)
- {
- if ((this->pData[nIndex].aValue & rBitMask) == rMaskedCompare)
- {
- A nS = ::std::max( (nIndex>0 ? this->pData[nIndex-1].nEnd+1 : 0), nStart);
- A nE = ::std::min( this->pData[nIndex].nEnd, nEnd);
- while (nS <= nE && nUsed < nArraySize)
- pArray[nUsed++] = nS++;
- }
- if (this->pData[nIndex].nEnd >= nEnd)
- break; // while
- ++nIndex;
- }
- return nUsed;
-}
-
-
-template< typename A, typename D >
-bool ScBitMaskCompressedArray<A,D>::HasCondition( A nStart, A nEnd,
- const D& rBitMask, const D& rMaskedCompare ) const
-{
- size_t nIndex = Search( nStart);
- do
- {
- if ((this->pData[nIndex].aValue & rBitMask) == rMaskedCompare)
- return true;
- if (this->pData[nIndex].nEnd >= nEnd)
- break; // while
- ++nIndex;
- } while (nIndex < this->nCount);
- return false;
-}
-
-
-template< typename A, typename D >
-A ScBitMaskCompressedArray<A,D>::CountForAnyBitCondition( A nStart, A nEnd,
- const D& rBitMask ) const
-{
- A nRet = 0;
- size_t nIndex = Search( nStart);
- do
- {
- if ((this->pData[nIndex].aValue & rBitMask) != 0)
- {
- A nS = ::std::max( (nIndex>0 ? this->pData[nIndex-1].nEnd+1 : 0), nStart);
- A nE = ::std::min( this->pData[nIndex].nEnd, nEnd);
- nRet += nE - nS + 1;
- }
- if (this->pData[nIndex].nEnd >= nEnd)
- break; // while
- ++nIndex;
- } while (nIndex < this->nCount);
- return nRet;
-}
-
-
template< typename A, typename D >
A ScBitMaskCompressedArray<A,D>::GetLastAnyBitAccess( A nStart,
const D& rBitMask ) const
@@ -714,75 +459,6 @@ A ScBitMaskCompressedArray<A,D>::GetLastAnyBitAccess( A nStart,
}
-template< typename A, typename D >
-template< typename S >
-unsigned long ScBitMaskCompressedArray<A,D>::SumCoupledArrayForCondition(
- A nStart, A nEnd, const D& rBitMask, const D& rMaskedCompare,
- const ScSummableCompressedArray<A,S>& rArray ) const
-{
- unsigned long nSum = 0;
- A nS = nStart;
- size_t nIndex1 = Search( nStart);
- size_t nIndex2 = rArray.Search( nStart);
- do
- {
- if ((this->pData[nIndex1].aValue & rBitMask) == rMaskedCompare)
- {
- while (nIndex2 < rArray.GetEntryCount() &&
- rArray.GetDataEntry(nIndex2).nEnd < nS)
- ++nIndex2;
- unsigned long nNew = rArray.SumValuesContinuation( nS,
- ::std::min( this->pData[nIndex1].nEnd, nEnd), nIndex2);
- nSum += nNew;
- if (nSum < nNew)
- return ::std::numeric_limits<unsigned long>::max();
- }
- nS = this->pData[nIndex1].nEnd + 1;
- ++nIndex1;
- } while (nIndex1 < this->nCount && nS <= nEnd);
- if (nEnd > this->nMaxAccess &&
- (this->pData[this->GetEntryCount()-1].aValue & rBitMask) == rMaskedCompare)
- nSum += rArray.GetDataEntry(rArray.GetEntryCount()-1).aValue * (nEnd -
- this->nMaxAccess);
- return nSum;
-}
-
-
-template< typename A, typename D >
-template< typename S >
-unsigned long ScBitMaskCompressedArray<A,D>::SumScaledCoupledArrayForCondition(
- A nStart, A nEnd, const D& rBitMask, const D& rMaskedCompare,
- const ScSummableCompressedArray<A,S>& rArray, double fScale ) const
-{
- unsigned long nSum = 0;
- A nS = nStart;
- size_t nIndex1 = Search( nStart);
- size_t nIndex2 = rArray.Search( nStart);
- do
- {
- if ((this->pData[nIndex1].aValue & rBitMask) == rMaskedCompare)
- {
- while (nIndex2 < rArray.GetEntryCount() &&
- rArray.GetDataEntry(nIndex2).nEnd < nS)
- ++nIndex2;
- unsigned long nNew = rArray.SumScaledValuesContinuation( nS,
- ::std::min( this->pData[nIndex1].nEnd, nEnd), nIndex2, fScale);
- nSum += nNew;
- if (nSum < nNew)
- return ::std::numeric_limits<unsigned long>::max();
- }
- nS = this->pData[nIndex1].nEnd + 1;
- ++nIndex1;
- } while (nIndex1 < this->nCount && nS <= nEnd);
- if (nEnd > this->nMaxAccess &&
- (this->pData[this->GetEntryCount()-1].aValue & rBitMask) == rMaskedCompare)
- nSum += (unsigned long)
- (rArray.GetDataEntry(rArray.GetEntryCount()-1).aValue * fScale) *
- (nEnd - this->nMaxAccess);
- return nSum;
-}
-
-
// === ScCompressedArrayIterator =============================================
template< typename A, typename D >
@@ -808,99 +484,14 @@ void ScCompressedArrayIterator<A,D>::Follow(
}
-// === ScCoupledCompressedArrayIterator ======================================
-
-template< typename A, typename D, typename S >
-ScCoupledCompressedArrayIterator<A,D,S>::ScCoupledCompressedArrayIterator(
- const ScBitMaskCompressedArray<A,D> & rArray1, A nStart, A nEnd,
- const D& rBitMaskP, const D& rMaskedCompareP,
- const ScCompressedArray<A,S> & rArray2 )
- : aIter1( rArray1, nStart, nEnd )
- , aIter2( rArray2, nStart, nEnd )
- , rBitMask( rBitMaskP )
- , rMaskedCompare( rMaskedCompareP )
-{
- InitLimits();
-}
-
-
-template< typename A, typename D, typename S >
-void ScCoupledCompressedArrayIterator<A,D,S>::InitLimits()
-{
- bool bFound = true;
- bool bMoved = false;
- while (bFound && ((*aIter1 & rBitMask) != rMaskedCompare))
- {
- bFound = aIter1.NextRange();
- bMoved = true;
- }
- if (bMoved && bFound)
- aIter2.Follow( aIter1);
-}
-
-
-template< typename A, typename D, typename S >
-void ScCoupledCompressedArrayIterator<A,D,S>::NewLimits( A nStart, A nEnd )
-{
- aIter1.NewLimits( nStart, nEnd);
- aIter2.NewLimits( nStart, nEnd);
- InitLimits();
-}
-
-
-template< typename A, typename D, typename S >
-bool ScCoupledCompressedArrayIterator<A,D,S>::NextRange()
-{
- bool bAdv;
- if (aIter1.GetRangeEnd() <= aIter2.GetRangeEnd())
- {
- // Advance bit mask array until condition is met, coupled array
- // follows.
- do
- {
- bAdv = aIter1.NextRange();
- } while (bAdv && ((*aIter1 & rBitMask) != rMaskedCompare));
- if (bAdv)
- aIter2.Follow( aIter1);
- }
- else
- {
- // Make coupled array catch up with bit mask array.
- do
- {
- bAdv = aIter2.NextRange();
- } while (bAdv && aIter2.GetRangeEnd() < aIter1.GetRangeStart());
- if (bAdv)
- aIter1.Follow( aIter2); // synchronize aIter1.nCurrent
- }
- return operator bool();
-}
-
-
-template< typename A, typename D, typename S >
-void ScCoupledCompressedArrayIterator<A,D,S>::Resync( A nPos )
-{
- aIter1.Resync( nPos);
- aIter2.Resync( nPos);
- InitLimits();
-}
-
-
// === Force instantiation of specializations ================================
template class ScCompressedArray< SCROW, sal_uInt16>; // heights, base class
-template class ScSummableCompressedArray< SCROW, sal_uInt16>; // heights
template class ScCompressedArray< SCROW, sal_uInt8>; // flags, base class
template class ScBitMaskCompressedArray< SCROW, sal_uInt8>; // flags
-template unsigned long ScBitMaskCompressedArray< SCROW,
- sal_uInt8>::SumCoupledArrayForCondition( SCROW, SCROW, const sal_uInt8&, const sal_uInt8&,
- const ScSummableCompressedArray< SCROW, sal_uInt16>&) const;
-template unsigned long ScBitMaskCompressedArray< SCROW,
- sal_uInt8>::SumScaledCoupledArrayForCondition( SCROW, SCROW, const sal_uInt8&,
- const sal_uInt8&, const ScSummableCompressedArray< SCROW, sal_uInt16>&,
- double) const;
template void ScCompressedArrayIterator< SCROW, sal_uInt16>::Follow(
const ScCompressedArrayIterator< SCROW, sal_uInt8>&);
-template class ScCoupledCompressedArrayIterator< SCROW, sal_uInt8, sal_uInt16>;
// === EOF ===================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 3e1b56387604..40390816128b 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
//------------------------------------------------------------------
#include "scitems.hxx"
@@ -85,7 +84,7 @@ sal_Bool lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, sal_uInt16 nRe
case svIndex:
{
if( t->GetOpCode() == ocName ) // DB areas always absolute
- if( ScRangeData* pRangeData = pDoc->GetRangeName()->FindIndex( t->GetIndex() ) )
+ if( ScRangeData* pRangeData = pDoc->GetRangeName()->findByIndex( t->GetIndex() ) )
if( (nRecursion < 42) && lcl_HasRelRef( pDoc, pRangeData->GetCode(), nRecursion + 1 ) )
return sal_True;
}
@@ -117,7 +116,7 @@ sal_Bool lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, sal_uInt16 nRe
}
}
}
- return sal_False;
+ return false;
}
ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) :
@@ -142,7 +141,8 @@ ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) :
pDoc(r.pDoc),
bRelRef1(r.bRelRef1),
bRelRef2(r.bRelRef2),
- bFirstRun(sal_True)
+ bFirstRun(true),
+ pCondFormat(r.pCondFormat)
{
// ScTokenArray copy ctor erzeugt flache Kopie
@@ -176,7 +176,8 @@ ScConditionEntry::ScConditionEntry( ScDocument* pDocument, const ScConditionEntr
pDoc(pDocument),
bRelRef1(r.bRelRef1),
bRelRef2(r.bRelRef2),
- bFirstRun(sal_True)
+ bFirstRun(true),
+ pCondFormat(r.pCondFormat)
{
// echte Kopie der Formeln (fuer Ref-Undo)
@@ -201,19 +202,20 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
aStrNmsp2(rExprNmsp2),
eTempGrammar1(eGrammar1),
eTempGrammar2(eGrammar2),
- bIsStr1(sal_False),
- bIsStr2(sal_False),
+ bIsStr1(false),
+ bIsStr2(false),
pFormula1(NULL),
pFormula2(NULL),
aSrcPos(rPos),
pFCell1(NULL),
pFCell2(NULL),
pDoc(pDocument),
- bRelRef1(sal_False),
- bRelRef2(sal_False),
- bFirstRun(sal_True)
+ bRelRef1(false),
+ bRelRef2(false),
+ bFirstRun(true),
+ pCondFormat(NULL)
{
- Compile( rExpr1, rExpr2, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2, sal_False );
+ Compile( rExpr1, rExpr2, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2, false );
// Formelzellen werden erst bei IsValid angelegt
}
@@ -227,17 +229,18 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
nVal2(0.0),
eTempGrammar1(FormulaGrammar::GRAM_DEFAULT),
eTempGrammar2(FormulaGrammar::GRAM_DEFAULT),
- bIsStr1(sal_False),
- bIsStr2(sal_False),
+ bIsStr1(false),
+ bIsStr2(false),
pFormula1(NULL),
pFormula2(NULL),
aSrcPos(rPos),
pFCell1(NULL),
pFCell2(NULL),
pDoc(pDocument),
- bRelRef1(sal_False),
- bRelRef2(sal_False),
- bFirstRun(sal_True)
+ bRelRef1(false),
+ bRelRef2(false),
+ bFirstRun(true),
+ pCondFormat(NULL)
{
if ( pArr1 )
{
@@ -423,7 +426,7 @@ void ScConditionEntry::CompileAll()
void ScConditionEntry::CompileXML()
{
- // #b4974740# First parse the formula source position if it was stored as text
+ // First parse the formula source position if it was stored as text
if ( aSrcString.Len() )
{
@@ -508,8 +511,8 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode,
sal_Bool bInsertTab = ( eUpdateRefMode == URM_INSDEL && nDz == 1 );
sal_Bool bDeleteTab = ( eUpdateRefMode == URM_INSDEL && nDz == -1 );
- sal_Bool bChanged1 = sal_False;
- sal_Bool bChanged2 = sal_False;
+ sal_Bool bChanged1 = false;
+ sal_Bool bChanged2 = false;
if (pFormula1)
{
@@ -520,7 +523,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode,
ScCompiler aComp( pDoc, aSrcPos, *pFormula1 );
aComp.SetGrammar(pDoc->GetGrammar());
if ( bDeleteTab )
- aComp.UpdateDeleteTab( rRange.aStart.Tab(), sal_False, sal_True, bChanged1 );
+ aComp.UpdateDeleteTab( rRange.aStart.Tab(), false, sal_True, bChanged1 );
else
aComp.UpdateNameReference( eUpdateRefMode, rRange, nDx, nDy, nDz, bChanged1 );
}
@@ -537,7 +540,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode,
ScCompiler aComp( pDoc, aSrcPos, *pFormula2);
aComp.SetGrammar(pDoc->GetGrammar());
if ( bDeleteTab )
- aComp.UpdateDeleteTab( rRange.aStart.Tab(), sal_False, sal_True, bChanged2 );
+ aComp.UpdateDeleteTab( rRange.aStart.Tab(), false, sal_True, bChanged2 );
else
aComp.UpdateNameReference( eUpdateRefMode, rRange, nDx, nDy, nDz, bChanged2 );
}
@@ -575,7 +578,7 @@ sal_Bool lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 )
{
sal_uInt16 nLen = pArr1->GetLen();
if ( pArr2->GetLen() != nLen )
- return sal_False;
+ return false;
FormulaToken** ppToken1 = pArr1->GetArray();
FormulaToken** ppToken2 = pArr2->GetArray();
@@ -583,7 +586,7 @@ sal_Bool lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 )
{
if ( ppToken1[i] != ppToken2[i] &&
!(*ppToken1[i] == *ppToken2[i]) )
- return sal_False; // Unterschied
+ return false; // Unterschied
}
return sal_True; // alle Eintraege gleich
}
@@ -601,13 +604,13 @@ int ScConditionEntry::operator== ( const ScConditionEntry& r ) const
// for formulas, the reference positions must be compared, too
// (including aSrcString, for inserting the entries during XML import)
if ( ( pFormula1 || pFormula2 ) && ( aSrcPos != r.aSrcPos || aSrcString != r.aSrcString ) )
- bEq = sal_False;
+ bEq = false;
// wenn keine Formeln, Werte vergleichen
if ( !pFormula1 && ( nVal1 != r.nVal1 || aStrVal1 != r.aStrVal1 || bIsStr1 != r.bIsStr1 ) )
- bEq = sal_False;
+ bEq = false;
if ( !pFormula2 && ( nVal2 != r.nVal2 || aStrVal2 != r.aStrVal2 || bIsStr2 != r.bIsStr2 ) )
- bEq = sal_False;
+ bEq = false;
}
return bEq;
@@ -623,7 +626,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
// Formeln auswerten
- sal_Bool bDirty = sal_False; //! 1 und 2 getrennt ???
+ sal_Bool bDirty = false; //! 1 und 2 getrennt ???
ScFormulaCell* pTemp1 = NULL;
ScFormulaCell* pEff1 = pFCell1;
@@ -641,7 +644,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
bDirty = sal_True;
if (pEff1->IsValue())
{
- bIsStr1 = sal_False;
+ bIsStr1 = false;
nVal1 = pEff1->GetValue();
aStrVal1.Erase();
}
@@ -670,7 +673,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
bDirty = sal_True;
if (pEff2->IsValue())
{
- bIsStr2 = sal_False;
+ bIsStr2 = false;
nVal2 = pEff2->GetValue();
aStrVal2.Erase();
}
@@ -693,10 +696,91 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
DataChanged( NULL ); // alles
}
- bFirstRun = sal_False;
+ bFirstRun = false;
+}
+
+static sal_Bool lcl_GetCellContent( ScBaseCell* pCell, sal_Bool bIsStr1, double& rArg, String& rArgStr )
+{
+ sal_Bool bVal = true;
+
+ if ( pCell )
+ {
+ CellType eType = pCell->GetCellType();
+ switch( eType )
+ {
+ case CELLTYPE_VALUE:
+ rArg = ((ScValueCell*)pCell)->GetValue();
+ break;
+ case CELLTYPE_FORMULA:
+ {
+ ScFormulaCell* pFCell = (ScFormulaCell*)pCell;
+ bVal = pFCell->IsValue();
+ if (bVal)
+ rArg = pFCell->GetValue();
+ else
+ pFCell->GetString(rArgStr);
+ }
+ break;
+ case CELLTYPE_STRING:
+ case CELLTYPE_EDIT:
+ bVal = false;
+ if ( eType == CELLTYPE_STRING )
+ ((ScStringCell*)pCell)->GetString(rArgStr);
+ else
+ ((ScEditCell*)pCell)->GetString(rArgStr);
+ break;
+
+ default:
+ pCell = NULL; // Note-Zellen wie leere
+ break;
+ }
+ }
+
+ if( !pCell )
+ if( bIsStr1 )
+ bVal = false; // leere Zellen je nach Bedingung
+
+ return bVal;
+}
+
+static sal_Bool lcl_IsDuplicate( ScDocument *pDoc, double nArg, const String& rStr, const ScAddress& rAddr, const ScRangeListRef& rRanges )
+{
+ size_t nListCount = rRanges->size();
+ for( size_t i = 0; i < nListCount; i++ )
+ {
+ const ScRange *aRange = (*rRanges)[i];
+ SCROW nRow = aRange->aEnd.Row();
+ SCCOL nCol = aRange->aEnd.Col();
+ for( SCROW r = aRange->aStart.Row(); r <= nRow; r++ )
+ for( SCCOL c = aRange->aStart.Col(); c <= nCol; c++ )
+ {
+ double nVal = 0.0;
+ ScBaseCell *pCell = NULL;
+ String aStr;
+
+ if( c == rAddr.Col() && r == rAddr.Row() )
+ continue;
+ pDoc->GetCell( c, r, rAddr.Tab(), pCell );
+ if( !pCell )
+ continue;
+
+ if( !lcl_GetCellContent( pCell, false, nVal, aStr ) )
+ {
+ if( rStr.Len() &&
+ ( ScGlobal::GetCollator()->compareString( rStr, aStr ) == COMPARE_EQUAL ) )
+ return true;
+ }
+ else
+ {
+ if( !rStr.Len() && ::rtl::math::approxEqual( nArg, nVal ) )
+ return true;
+ }
+ }
+ }
+ return false;
}
-sal_Bool ScConditionEntry::IsValid( double nArg ) const
+sal_Bool ScConditionEntry::IsValid( double nArg, const ScAddress& rAddr ) const
{
// Interpret muss schon gerufen sein
@@ -709,7 +793,7 @@ sal_Bool ScConditionEntry::IsValid( double nArg ) const
if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
if ( bIsStr2 )
- return sal_False;
+ return false;
double nComp1 = nVal1; // Kopie, damit vertauscht werden kann
double nComp2 = nVal2;
@@ -723,7 +807,7 @@ sal_Bool ScConditionEntry::IsValid( double nArg ) const
// Alle Grenzfaelle muessen per ::rtl::math::approxEqual getestet werden!
- sal_Bool bValid = sal_False;
+ sal_Bool bValid = false;
switch (eOp)
{
case SC_COND_NONE:
@@ -754,30 +838,53 @@ sal_Bool ScConditionEntry::IsValid( double nArg ) const
bValid = ( nArg < nComp1 || nArg > nComp2 ) &&
!::rtl::math::approxEqual( nArg, nComp1 ) && !::rtl::math::approxEqual( nArg, nComp2 );
break;
+ case SC_COND_DUPLICATE:
+ case SC_COND_NOTDUPLICATE:
+ if( pCondFormat )
+ {
+ ScRangeListRef pRanges = pCondFormat->GetRangeInfo();
+ bValid = lcl_IsDuplicate( pDoc, nArg, String(), rAddr, pRanges );
+ if( eOp == SC_COND_NOTDUPLICATE )
+ bValid = !bValid;
+ }
+ break;
case SC_COND_DIRECT:
bValid = !::rtl::math::approxEqual( nComp1, 0.0 );
break;
default:
- DBG_ERROR("unbekannte Operation bei ScConditionEntry");
+ OSL_FAIL("unbekannte Operation bei ScConditionEntry");
break;
}
return bValid;
}
-sal_Bool ScConditionEntry::IsValidStr( const String& rArg ) const
+sal_Bool ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rAddr ) const
{
+ sal_Bool bValid = false;
// Interpret muss schon gerufen sein
if ( eOp == SC_COND_DIRECT ) // Formel ist unabhaengig vom Inhalt
return !::rtl::math::approxEqual( nVal1, 0.0 );
- // Wenn Bedingung Zahl enthaelt, immer sal_False, ausser bei "ungleich"
+ if ( eOp == SC_COND_DUPLICATE || eOp == SC_COND_NOTDUPLICATE )
+ {
+ if( pCondFormat && rArg.Len() )
+ {
+ ScRangeListRef pRanges = pCondFormat->GetRangeInfo();
+ bValid = lcl_IsDuplicate( pDoc, 0.0, rArg, rAddr, pRanges );
+ if( eOp == SC_COND_NOTDUPLICATE )
+ bValid = !bValid;
+ return bValid;
+ }
+ }
+
+ // Wenn Bedingung Zahl enthaelt, immer FALSE, ausser bei "ungleich"
if ( !bIsStr1 )
return ( eOp == SC_COND_NOTEQUAL );
if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
if ( !bIsStr2 )
- return sal_False;
+ return false;
String aUpVal1( aStrVal1 ); //! als Member? (dann auch in Interpret setzen)
String aUpVal2( aStrVal2 );
@@ -790,7 +897,6 @@ sal_Bool ScConditionEntry::IsValidStr( const String& rArg ) const
String aTemp( aUpVal1 ); aUpVal1 = aUpVal2; aUpVal2 = aTemp;
}
- sal_Bool bValid;
switch ( eOp )
{
case SC_COND_EQUAL:
@@ -830,8 +936,8 @@ sal_Bool ScConditionEntry::IsValidStr( const String& rArg ) const
break;
// SC_COND_DIRECT schon oben abgefragt
default:
- DBG_ERROR("unbekannte Operation bei ScConditionEntry");
- bValid = sal_False;
+ OSL_FAIL("unbekannte Operation bei ScConditionEntry");
+ bValid = false;
break;
}
}
@@ -845,49 +951,11 @@ sal_Bool ScConditionEntry::IsCellValid( ScBaseCell* pCell, const ScAddress& rPos
double nArg = 0.0;
String aArgStr;
- sal_Bool bVal = sal_True;
-
- if ( pCell )
- {
- CellType eType = pCell->GetCellType();
- switch (eType)
- {
- case CELLTYPE_VALUE:
- nArg = ((ScValueCell*)pCell)->GetValue();
- break;
- case CELLTYPE_FORMULA:
- {
- ScFormulaCell* pFCell = (ScFormulaCell*)pCell;
- bVal = pFCell->IsValue();
- if (bVal)
- nArg = pFCell->GetValue();
- else
- pFCell->GetString(aArgStr);
- }
- break;
- case CELLTYPE_STRING:
- case CELLTYPE_EDIT:
- bVal = sal_False;
- if ( eType == CELLTYPE_STRING )
- ((ScStringCell*)pCell)->GetString(aArgStr);
- else
- ((ScEditCell*)pCell)->GetString(aArgStr);
- break;
-
- default:
- pCell = NULL; // Note-Zellen wie leere
- break;
- }
- }
-
- if (!pCell)
- if (bIsStr1)
- bVal = sal_False; // leere Zellen je nach Bedingung
-
+ sal_Bool bVal = lcl_GetCellContent( pCell, bIsStr1, nArg, aArgStr );
if (bVal)
- return IsValid( nArg );
+ return IsValid( nArg, rPos );
else
- return IsValidStr( aArgStr );
+ return IsValidStr( aArgStr, rPos );
}
String ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 nIndex,
@@ -935,7 +1003,7 @@ String ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 nIn
}
else
{
- DBG_ERROR("GetExpression: falscher Index");
+ OSL_FAIL("GetExpression: falscher Index");
}
return aRet;
@@ -974,7 +1042,7 @@ ScTokenArray* ScConditionEntry::CreateTokenArry( sal_uInt16 nIndex ) const
}
else
{
- DBG_ERROR("GetExpression: falscher Index");
+ OSL_FAIL("GetExpression: falscher Index");
}
return pRet;
@@ -1142,8 +1210,7 @@ ScCondFormatEntry::ScCondFormatEntry( ScConditionMode eOper,
FormulaGrammar::Grammar eGrammar1,
FormulaGrammar::Grammar eGrammar2 ) :
ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2 ),
- aStyleName( rStyle ),
- pParent( NULL )
+ aStyleName( rStyle )
{
}
@@ -1152,22 +1219,19 @@ ScCondFormatEntry::ScCondFormatEntry( ScConditionMode eOper,
ScDocument* pDocument, const ScAddress& rPos,
const String& rStyle ) :
ScConditionEntry( eOper, pArr1, pArr2, pDocument, rPos ),
- aStyleName( rStyle ),
- pParent( NULL )
+ aStyleName( rStyle )
{
}
ScCondFormatEntry::ScCondFormatEntry( const ScCondFormatEntry& r ) :
ScConditionEntry( r ),
- aStyleName( r.aStyleName ),
- pParent( NULL )
+ aStyleName( r.aStyleName )
{
}
ScCondFormatEntry::ScCondFormatEntry( ScDocument* pDocument, const ScCondFormatEntry& r ) :
ScConditionEntry( pDocument, r ),
- aStyleName( r.aStyleName ),
- pParent( NULL )
+ aStyleName( r.aStyleName )
{
}
@@ -1185,8 +1249,8 @@ ScCondFormatEntry::~ScCondFormatEntry()
void ScCondFormatEntry::DataChanged( const ScRange* pModified ) const
{
- if ( pParent )
- pParent->DoRepaint( pModified );
+ if ( pCondFormat )
+ pCondFormat->DoRepaint( pModified );
}
//------------------------------------------------------------------------
@@ -1196,7 +1260,8 @@ ScConditionalFormat::ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocume
pAreas( NULL ),
nKey( nNewKey ),
ppEntries( NULL ),
- nEntryCount( 0 )
+ nEntryCount( 0 ),
+ pRanges( NULL )
{
}
@@ -1216,6 +1281,7 @@ ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) :
ppEntries[i]->SetParent(this);
}
}
+ pRanges = new ScRangeList( *r.pRanges );
}
ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const
@@ -1238,6 +1304,7 @@ ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const
}
pNew->nEntryCount = nEntryCount;
}
+ pNew->AddRangeInfo( pRanges );
return pNew;
}
@@ -1245,15 +1312,25 @@ ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const
sal_Bool ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const
{
if ( nEntryCount != r.nEntryCount )
- return sal_False;
+ return false;
//! auf gleiche Eintraege in anderer Reihenfolge testen ???
for (sal_uInt16 i=0; i<nEntryCount; i++)
if ( ! (*ppEntries[i] == *r.ppEntries[i]) )
- return sal_False;
+ return false;
- return sal_True;
+ if( *pRanges != *r.pRanges )
+ return false;
+
+ return true;
+}
+
+void ScConditionalFormat::AddRangeInfo( const ScRangeListRef& rRanges )
+{
+ if( !rRanges.Is() )
+ return;
+ pRanges = new ScRangeList( *rRanges );
}
void ScConditionalFormat::AddEntry( const ScCondFormatEntry& rNew )
@@ -1350,41 +1427,39 @@ sal_Bool lcl_CutRange( ScRange& rRange, const ScRange& rOther )
return sal_True;
}
- return sal_False; // ausserhalb
+ return false; // ausserhalb
}
void ScConditionalFormat::DoRepaint( const ScRange* pModified )
{
- sal_uInt16 i;
SfxObjectShell* pSh = pDoc->GetDocumentShell();
if (pSh)
{
// Rahmen/Schatten enthalten?
// (alle Bedingungen testen)
- sal_Bool bExtend = sal_False;
- sal_Bool bRotate = sal_False;
- sal_Bool bAttrTested = sal_False;
+ sal_Bool bExtend = false;
+ sal_Bool bRotate = false;
+ sal_Bool bAttrTested = false;
if (!pAreas) // RangeList ggf. holen
{
pAreas = new ScRangeList;
pDoc->FindConditionalFormat( nKey, *pAreas );
}
- sal_uInt16 nCount = (sal_uInt16) pAreas->Count();
- for (i=0; i<nCount; i++)
+ for (size_t i = 0, nCount = pAreas->size(); i < nCount; i++ )
{
- ScRange aRange = *pAreas->GetObject(i);
- sal_Bool bDo = sal_True;
+ ScRange aRange = *(*pAreas)[i];
+ sal_Bool bDo = true;
if ( pModified )
{
if ( !lcl_CutRange( aRange, *pModified ) )
- bDo = sal_False;
+ bDo = false;
}
if (bDo)
{
if ( !bAttrTested )
{
- // #116562# Look at the style's content only if the repaint is necessary
+ // Look at the style's content only if the repaint is necessary
// for any condition, to avoid the time-consuming Find() if there are many
// conditional formats and styles.
for (sal_uInt16 nEntry=0; nEntry<nEntryCount; nEntry++)
@@ -1532,7 +1607,7 @@ sal_Bool ScConditionalFormatList::operator==( const ScConditionalFormatList& r )
sal_Bool bEqual = ( nCount == r.Count() );
for (sal_uInt16 i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert
if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ?
- bEqual = sal_False;
+ bEqual = false;
return bEqual;
}
@@ -1546,7 +1621,7 @@ ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey )
if ((*this)[i]->GetKey() == nKey)
return (*this)[i];
- DBG_ERROR("ScConditionalFormatList: Eintrag nicht gefunden");
+ OSL_FAIL("ScConditionalFormatList: Eintrag nicht gefunden");
return NULL;
}
@@ -1601,3 +1676,5 @@ bool ScConditionalFormatList::MarkUsedExternalReferences() const
bAllMarked = (*this)[i]->MarkUsedExternalReferences();
return bAllMarked;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx
index 68ddcc0bd9af..15f08ec01112 100644
--- a/sc/source/core/data/dbdocutl.cxx
+++ b/sc/source/core/data/dbdocutl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,18 +47,24 @@ using namespace ::com::sun::star;
#define D_TIMEFACTOR 86400.0
-// -----------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+
+ScDatabaseDocUtil::StrData::StrData() :
+ mbSimpleText(true), mnStrLength(0)
+{
+}
+
+// ----------------------------------------------------------------------------
-// static
void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab,
const uno::Reference<sdbc::XRow>& xRow, long nRowPos,
- long nType, sal_Bool bCurrency, sal_Bool* pSimpleFlag )
+ long nType, sal_Bool bCurrency, StrData* pStrData )
{
String aString;
double nVal = 0.0;
- sal_Bool bValue = sal_False;
- sal_Bool bEmptyFlag = sal_False;
- sal_Bool bError = sal_False;
+ sal_Bool bValue = false;
+ sal_Bool bEmptyFlag = false;
+ sal_Bool bError = false;
sal_uLong nFormatIndex = 0;
//! wasNull calls only if null value was found?
@@ -185,8 +192,11 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB
if (aString.Len())
{
pCell = ScBaseCell::CreateTextCell( aString, pDoc );
- if ( pSimpleFlag && pCell->GetCellType() == CELLTYPE_EDIT )
- *pSimpleFlag = sal_False;
+ if (pStrData)
+ {
+ pStrData->mbSimpleText = pCell->GetCellType() != CELLTYPE_EDIT;
+ pStrData->mnStrLength = aString.Len();
+ }
}
else
pCell = NULL;
@@ -195,3 +205,4 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 0e30a2750dbb..c8602214f506 100755
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,6 +44,10 @@
#include "patattr.hxx"
#include "docoptio.hxx"
#include "cellform.hxx"
+#include "segmenttree.hxx"
+#include "progress.hxx"
+#include "globstr.hrc"
+#include "tools/fract.hxx"
#include <vector>
@@ -95,14 +100,14 @@ sal_Bool ScDocumentIterator::GetThisCol()
{
nCol = MAXCOL;
nRow = MAXROW;
- return sal_False;
+ return false;
}
++nTab;
}
ScColumn* pCol = &pTab->aCol[nCol];
ScAttrArray* pAtt = pCol->pAttrArray;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
do
{
SCROW nColRow;
@@ -148,13 +153,13 @@ sal_Bool ScDocumentIterator::GetThisCol()
sal_Bool ScDocumentIterator::GetThis()
{
- sal_Bool bEnd = sal_False;
- sal_Bool bSuccess = sal_False;
+ sal_Bool bEnd = false;
+ sal_Bool bSuccess = false;
while ( !bSuccess && !bEnd )
{
if ( nRow > MAXROW )
- bSuccess = sal_False;
+ bSuccess = false;
else
bSuccess = GetThisCol();
@@ -233,47 +238,6 @@ void lcl_IterGetNumberFormat( sal_uLong& nFormat, const ScAttrArray*& rpArr,
}
}
-//UNUSED2008-05 ScValueIterator::ScValueIterator( ScDocument* pDocument,
-//UNUSED2008-05 SCCOL nSCol, SCROW nSRow, SCTAB nSTab,
-//UNUSED2008-05 SCCOL nECol, SCROW nERow, SCTAB nETab,
-//UNUSED2008-05 sal_Bool bSTotal, sal_Bool bTextZero ) :
-//UNUSED2008-05 pDoc( pDocument ),
-//UNUSED2008-05 nNumFmtIndex(0),
-//UNUSED2008-05 nStartCol( nSCol),
-//UNUSED2008-05 nStartRow( nSRow),
-//UNUSED2008-05 nStartTab( nSTab ),
-//UNUSED2008-05 nEndCol( nECol ),
-//UNUSED2008-05 nEndRow( nERow),
-//UNUSED2008-05 nEndTab( nETab ),
-//UNUSED2008-05 nNumFmtType( NUMBERFORMAT_UNDEFINED ),
-//UNUSED2008-05 bNumValid( sal_False ),
-//UNUSED2008-05 bSubTotal(bSTotal),
-//UNUSED2008-05 bNextValid( sal_False ),
-//UNUSED2008-05 bCalcAsShown( pDocument->GetDocOptions().IsCalcAsShown() ),
-//UNUSED2008-05 bTextAsZero( bTextZero )
-//UNUSED2008-05 {
-//UNUSED2008-05 PutInOrder( nStartCol, nEndCol);
-//UNUSED2008-05 PutInOrder( nStartRow, nEndRow);
-//UNUSED2008-05 PutInOrder( nStartTab, nEndTab );
-//UNUSED2008-05
-//UNUSED2008-05 if (!ValidCol(nStartCol)) nStartCol = MAXCOL;
-//UNUSED2008-05 if (!ValidCol(nEndCol)) nEndCol = MAXCOL;
-//UNUSED2008-05 if (!ValidRow(nStartRow)) nStartRow = MAXROW;
-//UNUSED2008-05 if (!ValidRow(nEndRow)) nEndRow = MAXROW;
-//UNUSED2008-05 if (!ValidTab(nStartTab)) nStartTab = MAXTAB;
-//UNUSED2008-05 if (!ValidTab(nEndTab)) nEndTab = MAXTAB;
-//UNUSED2008-05
-//UNUSED2008-05 nCol = nStartCol;
-//UNUSED2008-05 nRow = nStartRow;
-//UNUSED2008-05 nTab = nStartTab;
-//UNUSED2008-05
-//UNUSED2008-05 nColRow = 0; // wird bei GetFirst initialisiert
-//UNUSED2008-05
-//UNUSED2008-05 nNumFormat = 0; // werden bei GetNumberFormat initialisiert
-//UNUSED2008-05 pAttrArray = 0;
-//UNUSED2008-05 nAttrEndRow = 0;
-//UNUSED2008-05 }
-
ScValueIterator::ScValueIterator( ScDocument* pDocument, const ScRange& rRange,
sal_Bool bSTotal, sal_Bool bTextZero ) :
pDoc( pDocument ),
@@ -285,9 +249,9 @@ ScValueIterator::ScValueIterator( ScDocument* pDocument, const ScRange& rRange,
nEndRow( rRange.aEnd.Row() ),
nEndTab( rRange.aEnd.Tab() ),
nNumFmtType( NUMBERFORMAT_UNDEFINED ),
- bNumValid( sal_False ),
+ bNumValid( false ),
bSubTotal(bSTotal),
- bNextValid( sal_False ),
+ bNextValid( false ),
bCalcAsShown( pDocument->GetDocOptions().IsCalcAsShown() ),
bTextAsZero( bTextZero )
{
@@ -332,7 +296,7 @@ sal_Bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr)
{
// rValue = 0.0; //! do not change caller's value!
rErr = 0;
- return sal_False; // Ende und Aus
+ return false; // Ende und Aus
}
}
pCol = &(pDoc->pTab[nTab])->aCol[nCol];
@@ -354,7 +318,7 @@ sal_Bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr)
{
case CELLTYPE_VALUE:
{
- bNumValid = sal_False;
+ bNumValid = false;
rValue = ((ScValueCell*)pCell)->GetValue();
rErr = 0;
--nRow;
@@ -396,14 +360,14 @@ sal_Bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr)
{
rValue = ((ScFormulaCell*)pCell)->GetValue();
nRow--;
- bNumValid = sal_False;
+ bNumValid = false;
return sal_True; // gefunden
}
else if ( bTextAsZero )
{
rValue = 0.0;
nRow--;
- bNumValid = sal_False;
+ bNumValid = false;
return sal_True;
}
}
@@ -475,7 +439,6 @@ sal_Bool ScValueIterator::GetFirst(double& rValue, sal_uInt16& rErr)
nRow = nStartRow;
nTab = nStartTab;
-// nColRow = 0;
ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol];
pCol->Search( nRow, nColRow );
@@ -486,14 +449,6 @@ sal_Bool ScValueIterator::GetFirst(double& rValue, sal_uInt16& rErr)
return GetThis(rValue, rErr);
}
-/* ist inline:
-sal_Bool ScValueIterator::GetNext(double& rValue, sal_uInt16& rErr)
-{
- ++nRow;
- return GetThis(rValue, rErr);
-}
-*/
-
// ============================================================================
ScDBQueryDataIterator::DataAccess::DataAccess(const ScDBQueryDataIterator* pParent) :
@@ -579,6 +534,10 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue)
}
SCSIZE nCellCount = mpDoc->GetCellCount(nTab, nCol);
+ if (!nCellCount)
+ // No cells found in this column. Bail out.
+ return false;
+
SCROW nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, nColRow);
while ( (nColRow < nCellCount) && (nThisRow < nRow) )
nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, ++nColRow);
@@ -657,7 +616,6 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue)
nRow = mpParam->nRow2 + 1; // Naechste Spalte
}
// statement unreachable
-// return false;
}
bool ScDBQueryDataIterator::DataAccessInternal::getFirst(Value& rValue)
@@ -989,7 +947,7 @@ ScCellIterator::ScCellIterator( ScDocument* pDocument,
if (!pDoc->pTab[nTab])
{
- DBG_ERROR("Tabelle nicht gefunden");
+ OSL_FAIL("Tabelle nicht gefunden");
nStartCol = nCol = MAXCOL+1;
nStartRow = nRow = MAXROW+1;
nStartTab = nTab = MAXTAB+1; // -> Abbruch bei GetFirst
@@ -1031,7 +989,7 @@ ScCellIterator::ScCellIterator
if (!pDoc->pTab[nTab])
{
- DBG_ERROR("Tabelle nicht gefunden");
+ OSL_FAIL("Tabelle nicht gefunden");
nStartCol = nCol = MAXCOL+1;
nStartRow = nRow = MAXROW+1;
nStartTab = nTab = MAXTAB+1; // -> Abbruch bei GetFirst
@@ -1092,7 +1050,6 @@ ScBaseCell* ScCellIterator::GetFirst()
nCol = nStartCol;
nRow = nStartRow;
nTab = nStartTab;
-// nColRow = 0;
ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol];
pCol->Search( nRow, nColRow );
return GetThis();
@@ -1113,8 +1070,8 @@ ScQueryCellIterator::ScQueryCellIterator(ScDocument* pDocument, SCTAB nTable,
nTab( nTable),
nStopOnMismatch( nStopOnMismatchDisabled ),
nTestEqualCondition( nTestEqualConditionDisabled ),
- bAdvanceQuery( sal_False ),
- bIgnoreMismatchOnLeadingStrings( sal_False )
+ bAdvanceQuery( false ),
+ bIgnoreMismatchOnLeadingStrings( false )
{
nCol = aParam.nCol1;
nRow = aParam.nRow1;
@@ -1201,7 +1158,7 @@ ScBaseCell* ScQueryCellIterator::GetThis()
if ( nTestEqualCondition && bTestEqualCondition )
{
nTestEqualCondition |= nTestEqualConditionMatched;
- nStopOnMismatch |= nStopOnMismatchOccured;
+ nStopOnMismatch |= nStopOnMismatchOccurred;
return NULL;
}
bool bStop;
@@ -1219,7 +1176,7 @@ ScBaseCell* ScQueryCellIterator::GetThis()
bStop = true;
if (bStop)
{
- nStopOnMismatch |= nStopOnMismatchOccured;
+ nStopOnMismatch |= nStopOnMismatchOccurred;
return NULL;
}
}
@@ -1239,7 +1196,6 @@ ScBaseCell* ScQueryCellIterator::GetFirst()
nRow = aParam.nRow1;
if (aParam.bHasHeader)
nRow++;
-// nColRow = 0;
ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol];
pCol->Search( nRow, nColRow );
return GetThis();
@@ -1335,8 +1291,8 @@ sal_Bool ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol,
break; // for
}
SCSIZE nColRowSave;
- bIgnoreMismatchOnLeadingStrings = sal_False;
- SetTestEqualCondition( sal_False );
+ bIgnoreMismatchOnLeadingStrings = false;
+ SetTestEqualCondition( false );
do
{
nFoundCol = GetCol();
@@ -1375,8 +1331,8 @@ sal_Bool ScQueryCellIterator::FindEqualOrSortedLastInRange( SCCOL& nFoundCol,
else
break; // for
}
- SetStopOnMismatch( sal_False );
- SetTestEqualCondition( sal_False );
+ SetStopOnMismatch( false );
+ SetTestEqualCondition( false );
if (GetNext())
{
// Last of a consecutive area, avoid searching the entire parameter
@@ -1749,7 +1705,7 @@ sal_Bool ScHorizontalCellIterator::ReturnNext( SCCOL& rCol, SCROW& rRow )
void ScHorizontalCellIterator::Advance()
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL i;
for (i=nCol+1; i<=nEndCol && !bFound; i++)
@@ -1777,7 +1733,7 @@ void ScHorizontalCellIterator::Advance()
}
if ( !bFound )
- bMore = sal_False;
+ bMore = false;
}
//-------------------------------------------------------------------------------
@@ -1797,7 +1753,7 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB
nRow = nStartRow;
nCol = nStartCol;
- bRowEmpty = sal_False;
+ bRowEmpty = false;
pIndices = new SCSIZE[nEndCol-nStartCol+1];
pNextEnd = new SCROW[nEndCol-nStartCol+1];
@@ -1823,7 +1779,7 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB
nSkipTo = nThisEnd; // nSkipTo kann gleich hier gesetzt werden
}
else
- bEmpty = sal_False; // Attribute gefunden
+ bEmpty = false; // Attribute gefunden
pIndices[nPos] = nIndex;
pNextEnd[nPos] = nThisEnd;
@@ -1890,7 +1846,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo
if ( IsDefaultItem( pPattern ) )
pPattern = NULL;
else
- bEmpty = sal_False; // Attribute gefunden
+ bEmpty = false; // Attribute gefunden
pNextEnd[nPos] = nThisEnd;
ppPatterns[nPos] = pPattern;
@@ -1899,13 +1855,13 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo
}
else
{
- DBG_ERROR("AttrArray reicht nicht bis MAXROW");
+ OSL_FAIL("AttrArray reicht nicht bis MAXROW");
pNextEnd[nPos] = MAXROW;
ppPatterns[nPos] = NULL;
}
}
else if ( ppPatterns[nPos] )
- bEmpty = sal_False; // Bereich noch nicht zuende
+ bEmpty = false; // Bereich noch nicht zuende
}
if (bEmpty)
@@ -1920,8 +1876,6 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo
bRowEmpty = bEmpty;
nCol = nStartCol; // wieder links anfangen
}
-
-// return NULL;
}
//-------------------------------------------------------------------------------
@@ -1965,7 +1919,7 @@ sal_Bool ScUsedAreaIterator::GetNext()
// naechsten Abschnitt heraussuchen
sal_Bool bFound = sal_True;
- sal_Bool bUseCell = sal_False;
+ sal_Bool bUseCell = false;
if ( pCell && pPattern )
{
@@ -2003,7 +1957,7 @@ sal_Bool ScUsedAreaIterator::GetNext()
nFoundEndCol = nAttrCol2;
}
else // gar nichts
- bFound = sal_False;
+ bFound = false;
if ( bUseCell ) // Position von Zelle
{
@@ -2065,6 +2019,100 @@ const ScPatternAttr* ScDocAttrIterator::GetNext( SCCOL& rCol, SCROW& rRow1, SCRO
return NULL; // is nix mehr
}
+// ============================================================================
+
+ScDocRowHeightUpdater::TabRanges::TabRanges() :
+ mnTab(0), mpRanges(new ScFlatBoolRowSegments)
+{
+}
+
+ScDocRowHeightUpdater::TabRanges::TabRanges(SCTAB nTab) :
+ mnTab(nTab), mpRanges(new ScFlatBoolRowSegments)
+{
+}
+
+ScDocRowHeightUpdater::ScDocRowHeightUpdater(ScDocument& rDoc, OutputDevice* pOutDev, double fPPTX, double fPPTY, const vector<TabRanges>* pTabRangesArray) :
+ mrDoc(rDoc), mpOutDev(pOutDev), mfPPTX(fPPTX), mfPPTY(fPPTY), mpTabRangesArray(pTabRangesArray)
+{
+}
+
+void ScDocRowHeightUpdater::update()
+{
+ if (!mpTabRangesArray || mpTabRangesArray->empty())
+ {
+ // No ranges defined. Update all rows in all tables.
+ updateAll();
+ return;
+ }
+
+ sal_uInt32 nCellCount = 0;
+ vector<TabRanges>::const_iterator itr = mpTabRangesArray->begin(), itrEnd = mpTabRangesArray->end();
+ for (; itr != itrEnd; ++itr)
+ {
+ ScFlatBoolRowSegments::RangeData aData;
+ ScFlatBoolRowSegments::RangeIterator aRangeItr(*itr->mpRanges);
+ for (bool bFound = aRangeItr.getFirst(aData); bFound; bFound = aRangeItr.getNext(aData))
+ {
+ if (!aData.mbValue)
+ continue;
+
+ nCellCount += aData.mnRow2 - aData.mnRow1 + 1;
+ }
+ }
+
+ ScProgress aProgress(mrDoc.GetDocumentShell(), ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nCellCount);
+
+ Fraction aZoom(1, 1);
+ itr = mpTabRangesArray->begin();
+ sal_uInt32 nProgressStart = 0;
+ for (; itr != itrEnd; ++itr)
+ {
+ SCTAB nTab = itr->mnTab;
+ if (!ValidTab(nTab) || !mrDoc.pTab[nTab])
+ continue;
+
+ ScFlatBoolRowSegments::RangeData aData;
+ ScFlatBoolRowSegments::RangeIterator aRangeItr(*itr->mpRanges);
+ for (bool bFound = aRangeItr.getFirst(aData); bFound; bFound = aRangeItr.getNext(aData))
+ {
+ if (!aData.mbValue)
+ continue;
+
+ mrDoc.pTab[nTab]->SetOptimalHeight(
+ aData.mnRow1, aData.mnRow2, 0, mpOutDev, mfPPTX, mfPPTY, aZoom, aZoom, false, &aProgress, nProgressStart);
+
+ nProgressStart += aData.mnRow2 - aData.mnRow1 + 1;
+ }
+ }
+}
+
+void ScDocRowHeightUpdater::updateAll()
+{
+ sal_uInt32 nCellCount = 0;
+ for (SCTAB nTab = 0; nTab <= MAXTAB; ++nTab)
+ {
+ if (!ValidTab(nTab) || !mrDoc.pTab[nTab])
+ continue;
+
+ nCellCount += mrDoc.pTab[nTab]->GetWeightedCount();
+ }
+
+ ScProgress aProgress(mrDoc.GetDocumentShell(), ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nCellCount);
+
+ Fraction aZoom(1, 1);
+ sal_uLong nProgressStart = 0;
+ for (SCTAB nTab = 0; nTab <= MAXTAB; ++nTab)
+ {
+ if (!ValidTab(nTab) || !mrDoc.pTab[nTab])
+ continue;
+
+ mrDoc.pTab[nTab]->SetOptimalHeight(
+ 0, MAXROW, 0, mpOutDev, mfPPTX, mfPPTY, aZoom, aZoom, false, &aProgress, nProgressStart);
+
+ nProgressStart += mrDoc.pTab[nTab]->GetWeightedCount();
+ }
+}
+
//-------------------------------------------------------------------------------
ScAttrRectIterator::ScAttrRectIterator(ScDocument* pDocument, SCTAB nTable,
@@ -2156,3 +2204,5 @@ SCROW ScRowBreakIterator::next()
++maItr;
return maItr == maEnd ? NOT_FOUND : *maItr;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/unoguard.cxx b/sc/source/core/data/docparam.cxx
index ff1c94338b72..3153d24ccbdd 100644
--- a/sc/source/ui/unoobj/unoguard.cxx
+++ b/sc/source/core/data/docparam.cxx
@@ -1,8 +1,9 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
@@ -28,20 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+// INCLUDE ---------------------------------------------------------------
+#include "docparam.hxx"
-#include <vcl/svapp.hxx>
-#include <tools/debug.hxx>
-
-#include "unoguard.hxx"
-
-//------------------------------------------------------------------------
-
-ScUnoGuard::ScUnoGuard() :
- OGuard( Application::GetSolarMutex() )
-{
-}
-
-
-
+ScColWidthParam::ScColWidthParam() :
+ mnMaxTextRow(-1), mnMaxTextLen(0), mbSimpleText(true) {}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 7cf5e6de6ce7..cb9b8044efc3 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
#include "scitems.hxx"
#include <tools/shl.hxx>
#include <vcl/outdev.hxx>
@@ -67,6 +66,7 @@
#include <editeng/wghtitem.hxx>
#include <editeng/wrlmitem.hxx>
#include <editeng/xmlcnitm.hxx>
+#include <editeng/justifyitem.hxx>
#include "docpool.hxx"
#include "global.hxx"
@@ -75,7 +75,6 @@
#include "globstr.hrc"
#include "sc.hrc" // Slot-IDs
-
#define SC_MAX_POOLREF (SFX_ITEMS_OLD_MAXREF - 39)
#define SC_SAFE_POOLREF (SC_MAX_POOLREF + 20)
@@ -95,7 +94,7 @@ sal_uInt16* ScDocumentPool::pVersionMap11 = 0;
// ATTR_FONT_TWOLINES (not used) was changed to ATTR_USERDEF (not saved in binary format) in 641c
-static SfxItemInfo __READONLY_DATA aItemInfos[] =
+static SfxItemInfo const aItemInfos[] =
{
{ SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE }, // ATTR_FONT
{ SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE }, // ATTR_FONT_HEIGHT
@@ -127,8 +126,10 @@ static SfxItemInfo __READONLY_DATA aItemInfos[] =
{ 0, SFX_ITEM_POOLABLE }, // ATTR_HANGPUNCTUATION from 614d
{ SID_ATTR_PARA_FORBIDDEN_RULES,SFX_ITEM_POOLABLE }, // ATTR_FORBIDDEN_RULES from 614d
{ SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_HOR_JUSTIFY
+ { SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // ATTR_HOR_JUSTIFY_METHOD
{ SID_ATTR_ALIGN_INDENT, SFX_ITEM_POOLABLE }, // ATTR_INDENT ab 350
{ SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY
+ { SID_ATTR_ALIGN_VER_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // ATTR_VER_JUSTIFY_METHOD
{ SID_ATTR_ALIGN_STACKED, SFX_ITEM_POOLABLE }, // ATTR_STACKED from 680/dr14 (replaces ATTR_ORIENTATION)
{ SID_ATTR_ALIGN_DEGREES, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_VALUE ab 367
{ SID_ATTR_ALIGN_LOCKPOS, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_MODE ab 367
@@ -224,7 +225,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_VERT);
pGlobalBorderInnerAttr->SetTable(sal_True);
pGlobalBorderInnerAttr->SetDist(sal_True);
- pGlobalBorderInnerAttr->SetMinDist(sal_False);
+ pGlobalBorderInnerAttr->SetMinDist(false);
ppPoolDefaults = new SfxPoolItem*[ATTR_ENDINDEX-ATTR_STARTINDEX+1];
@@ -235,8 +236,8 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
ppPoolDefaults[ ATTR_FONT_UNDERLINE - ATTR_STARTINDEX ] = new SvxUnderlineItem( UNDERLINE_NONE, ATTR_FONT_UNDERLINE );
ppPoolDefaults[ ATTR_FONT_OVERLINE - ATTR_STARTINDEX ] = new SvxOverlineItem( UNDERLINE_NONE, ATTR_FONT_OVERLINE );
ppPoolDefaults[ ATTR_FONT_CROSSEDOUT - ATTR_STARTINDEX ] = new SvxCrossedOutItem( STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT );
- ppPoolDefaults[ ATTR_FONT_CONTOUR - ATTR_STARTINDEX ] = new SvxContourItem( sal_False, ATTR_FONT_CONTOUR );
- ppPoolDefaults[ ATTR_FONT_SHADOWED - ATTR_STARTINDEX ] = new SvxShadowedItem( sal_False, ATTR_FONT_SHADOWED );
+ ppPoolDefaults[ ATTR_FONT_CONTOUR - ATTR_STARTINDEX ] = new SvxContourItem( false, ATTR_FONT_CONTOUR );
+ ppPoolDefaults[ ATTR_FONT_SHADOWED - ATTR_STARTINDEX ] = new SvxShadowedItem( false, ATTR_FONT_SHADOWED );
ppPoolDefaults[ ATTR_FONT_COLOR - ATTR_STARTINDEX ] = new SvxColorItem( Color(COL_AUTO), ATTR_FONT_COLOR );
ppPoolDefaults[ ATTR_FONT_LANGUAGE - ATTR_STARTINDEX ] = new SvxLanguageItem( LanguageType(LANGUAGE_DONTKNOW), ATTR_FONT_LANGUAGE );
ppPoolDefaults[ ATTR_CJK_FONT - ATTR_STARTINDEX ] = pCjkFont;
@@ -253,16 +254,18 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
ATTR_CTL_FONT_LANGUAGE );
ppPoolDefaults[ ATTR_FONT_EMPHASISMARK-ATTR_STARTINDEX ] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, ATTR_FONT_EMPHASISMARK );
ppPoolDefaults[ ATTR_USERDEF - ATTR_STARTINDEX ] = new SvXMLAttrContainerItem( ATTR_USERDEF );
- ppPoolDefaults[ ATTR_FONT_WORDLINE - ATTR_STARTINDEX ] = new SvxWordLineModeItem(sal_False, ATTR_FONT_WORDLINE );
+ ppPoolDefaults[ ATTR_FONT_WORDLINE - ATTR_STARTINDEX ] = new SvxWordLineModeItem(false, ATTR_FONT_WORDLINE );
ppPoolDefaults[ ATTR_FONT_RELIEF - ATTR_STARTINDEX ] = new SvxCharReliefItem( RELIEF_NONE, ATTR_FONT_RELIEF );
ppPoolDefaults[ ATTR_HYPHENATE - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HYPHENATE );
- ppPoolDefaults[ ATTR_SCRIPTSPACE - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( sal_False, ATTR_SCRIPTSPACE);
- ppPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( sal_False, ATTR_HANGPUNCTUATION);
- ppPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( sal_False, ATTR_FORBIDDEN_RULES);
+ ppPoolDefaults[ ATTR_SCRIPTSPACE - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( false, ATTR_SCRIPTSPACE);
+ ppPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( false, ATTR_HANGPUNCTUATION);
+ ppPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( false, ATTR_FORBIDDEN_RULES);
ppPoolDefaults[ ATTR_HOR_JUSTIFY - ATTR_STARTINDEX ] = new SvxHorJustifyItem( SVX_HOR_JUSTIFY_STANDARD, ATTR_HOR_JUSTIFY);
+ ppPoolDefaults[ ATTR_HOR_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, ATTR_HOR_JUSTIFY_METHOD);
ppPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 );
ppPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY);
- ppPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, sal_False );
+ ppPoolDefaults[ ATTR_VER_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, ATTR_VER_JUSTIFY_METHOD);
+ ppPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, false );
ppPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 );
ppPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE );
ppPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN );
@@ -274,7 +277,10 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
ppPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_SHRINKTOFIT );
ppPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR );
ppPoolDefaults[ ATTR_BORDER_BLTR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_BLTR );
- ppPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = new SvxMarginItem( ATTR_MARGIN );
+ SvxMarginItem* pItem = new SvxMarginItem( ATTR_MARGIN );
+ pItem->SetTopMargin( 27 );
+ pItem->SetBottomMargin( 27 );
+ ppPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = pItem;
ppPoolDefaults[ ATTR_MERGE - ATTR_STARTINDEX ] = new ScMergeAttr;
ppPoolDefaults[ ATTR_MERGE_FLAG - ATTR_STARTINDEX ] = new ScMergeFlagAttr;
ppPoolDefaults[ ATTR_VALUE_FORMAT - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALUE_FORMAT, 0 );
@@ -308,9 +314,9 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
ppPoolDefaults[ ATTR_PAGE_ON - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_ON, sal_True );
ppPoolDefaults[ ATTR_PAGE_DYNAMIC - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_DYNAMIC, sal_True );
ppPoolDefaults[ ATTR_PAGE_SHARED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_SHARED, sal_True );
- ppPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, sal_False );
- ppPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, sal_False );
- ppPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, sal_False );
+ ppPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, false );
+ ppPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, false );
+ ppPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, false );
ppPoolDefaults[ ATTR_PAGE_CHARTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_CHARTS );
ppPoolDefaults[ ATTR_PAGE_OBJECTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_OBJECTS );
ppPoolDefaults[ ATTR_PAGE_DRAWINGS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_DRAWINGS );
@@ -328,10 +334,9 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
ppPoolDefaults[ ATTR_PAGE_FOOTERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT );
ppPoolDefaults[ ATTR_PAGE_HEADERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_HEADERSET, aSetItemItemSet );
ppPoolDefaults[ ATTR_PAGE_FOOTERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_FOOTERSET, aSetItemItemSet );
- ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, sal_False );
+ ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, false );
ppPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, sal_True );
ppPoolDefaults[ ATTR_PAGE_SCALETO - ATTR_STARTINDEX ] = new ScPageScaleToItem( 1, 1 );
-// ppPoolDefaults[ ATTR_ITEM_DOUBLE - ATTR_STARTINDEX ] = new ScDoubleItem( ATTR_ITEM_DOUBLE, 0 );
SetDefaults( ppPoolDefaults );
@@ -375,7 +380,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
SetVersionMap( 11, 100, 187, pVersionMap11 );
}
-__EXPORT ScDocumentPool::~ScDocumentPool()
+ScDocumentPool::~ScDocumentPool()
{
Delete();
@@ -592,7 +597,7 @@ void ScDocumentPool::DeleteVersionMaps()
// wird (Assertions).
//
-const SfxPoolItem& __EXPORT ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
+const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
{
if ( rItem.Which() != ATTR_PATTERN ) // nur Pattern ist special
return SfxItemPool::Put( rItem, nWhich );
@@ -607,7 +612,7 @@ const SfxPoolItem& __EXPORT ScDocumentPool::Put( const SfxPoolItem& rItem, sal_u
return rNew;
}
-void __EXPORT ScDocumentPool::Remove( const SfxPoolItem& rItem )
+void ScDocumentPool::Remove( const SfxPoolItem& rItem )
{
if ( rItem.Which() == ATTR_PATTERN ) // nur Pattern ist special
{
@@ -616,7 +621,7 @@ void __EXPORT ScDocumentPool::Remove( const SfxPoolItem& rItem )
{
if ( nRef != (sal_uLong) SC_SAFE_POOLREF )
{
- DBG_ERROR("Wer fummelt da an meinen Ref-Counts herum");
+ OSL_FAIL("Wer fummelt da an meinen Ref-Counts herum");
SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF );
}
return; // nicht herunterzaehlen
@@ -625,7 +630,7 @@ void __EXPORT ScDocumentPool::Remove( const SfxPoolItem& rItem )
SfxItemPool::Remove( rItem );
}
-void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) // static
+void ScDocumentPool::CheckRef( const SfxPoolItem& rItem )
{
sal_uLong nRef = rItem.GetRefCount();
if ( nRef >= (sal_uLong) SC_MAX_POOLREF && nRef <= (sal_uLong) SFX_ITEMS_OLD_MAXREF )
@@ -673,7 +678,7 @@ void ScDocumentPool::CellStyleCreated( const String& rName )
}
}
-SfxItemPool* __EXPORT ScDocumentPool::Clone() const
+SfxItemPool* ScDocumentPool::Clone() const
{
return new SfxItemPool (*this, sal_True);
}
@@ -691,9 +696,9 @@ SfxItemPresentation lcl_HFPresentation
const SfxItemSet& rSet = ((const SfxSetItem&)rItem).GetItemSet();
const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == rSet.GetItemState(ATTR_PAGE_ON,sal_False,&pItem) )
+ if ( SFX_ITEM_SET == rSet.GetItemState(ATTR_PAGE_ON,false,&pItem) )
{
- if( sal_False == ((const SfxBoolItem*)pItem)->GetValue() )
+ if( false == ((const SfxBoolItem*)pItem)->GetValue() )
return SFX_ITEM_PRESENTATION_NONE;
}
@@ -781,7 +786,7 @@ SfxItemPresentation lcl_HFPresentation
return ePresentation;
}
-SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation(
+SfxItemPresentation ScDocumentPool::GetPresentation(
const SfxPoolItem& rItem,
SfxItemPresentation ePresentation,
SfxMapUnit ePresentationMetric,
@@ -1017,24 +1022,6 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation(
}
break;
-/*
- case ATTR_PAGE_HEADERLEFT:
- rText = "SID_SCATTR_PAGE_HEADERLEFT";
- break;
-
- case ATTR_PAGE_FOOTERLEFT:
- rText = "SID_SCATTR_PAGE_FOOTERLEFT";
- break;
-
- case ATTR_PAGE_HEADERRIGHT:
- rText = "SID_SCATTR_PAGE_HEADERRIGHT";
- break;
-
- case ATTR_PAGE_FOOTERRIGHT:
- rText = "SID_SCATTR_PAGE_FOOTERRIGHT";
- break;
-*/
-
default:
if ( !pIntl )
pIntl = ScGlobal::GetScIntlWrapper();
@@ -1045,7 +1032,7 @@ SfxItemPresentation __EXPORT ScDocumentPool::GetPresentation(
return ePresentation;
}
-SfxMapUnit __EXPORT ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
+SfxMapUnit ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
{
// eigene Attribute: Twips, alles andere 1/100 mm
@@ -1055,7 +1042,4 @@ SfxMapUnit __EXPORT ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
return SFX_MAPUNIT_100TH_MM;
}
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 22155543ee81..f1faef8cb736 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,6 @@
#include <comphelper/processfactory.hxx>
#include <svl/PasswordHelper.hxx>
#include <tools/tenccvt.hxx>
-#include <tools/list.hxx>
#include <rtl/crc.h>
#include <basic/basmgr.hxx>
@@ -94,6 +94,7 @@
#include "tabprotection.hxx"
#include "formulaparserpool.hxx"
#include "clipparam.hxx"
+#include "macromgr.hxx"
using namespace com::sun::star;
@@ -157,6 +158,7 @@ ScDocument::ScDocument( ScDocumentMode eMode,
pDocProtection( NULL ),
mpClipParam( NULL),
pExternalRefMgr( NULL ),
+ mpMacroMgr( NULL ),
pViewOptions( NULL ),
pDocOptions( NULL ),
pExtDocOptions( NULL ),
@@ -167,6 +169,7 @@ ScDocument::ScDocument( ScDocumentMode eMode,
nUnoObjectId( 0 ),
nRangeOverflowType( 0 ),
aCurTextWidthCalcPos(MAXCOL,0,0),
+ aTableOpList( 0 ),
nFormulaCodeInTree(0),
nXMLImportedFormulaCount( 0 ),
nInterpretLevel(0),
@@ -180,38 +183,37 @@ ScDocument::ScDocument( ScDocumentMode eMode,
nVisibleTab( 0 ),
eLinkMode(LM_UNKNOWN),
bAutoCalc( eMode == SCDOCMODE_DOCUMENT ),
- bAutoCalcShellDisabled( sal_False ),
- bForcedFormulaPending( sal_False ),
- bCalculatingFormulaTree( sal_False ),
+ bAutoCalcShellDisabled( false ),
+ bForcedFormulaPending( false ),
+ bCalculatingFormulaTree( false ),
bIsClip( eMode == SCDOCMODE_CLIP ),
bIsUndo( eMode == SCDOCMODE_UNDO ),
- bIsVisible( sal_False ),
- bIsEmbedded( sal_False ),
-// bNoSetDirty( sal_True ),
- bNoSetDirty( sal_False ),
- bInsertingFromOtherDoc( sal_False ),
+ bIsVisible( false ),
+ bIsEmbedded( false ),
+ bNoSetDirty( false ),
+ bInsertingFromOtherDoc( false ),
bLoadingMedium( false ),
bImportingXML( false ),
- bXMLFromWrapper( sal_False ),
- bCalcingAfterLoad( sal_False ),
- bNoListening( sal_False ),
- bIdleDisabled( sal_False ),
- bInLinkUpdate( sal_False ),
- bChartListenerCollectionNeedsUpdate( sal_False ),
- bHasForcedFormulas( sal_False ),
- bInDtorClear( sal_False ),
- bExpandRefs( sal_False ),
- bDetectiveDirty( sal_False ),
+ bXMLFromWrapper( false ),
+ bCalcingAfterLoad( false ),
+ bNoListening( false ),
+ bIdleDisabled( false ),
+ bInLinkUpdate( false ),
+ bChartListenerCollectionNeedsUpdate( false ),
+ bHasForcedFormulas( false ),
+ bInDtorClear( false ),
+ bExpandRefs( false ),
+ bDetectiveDirty( false ),
nMacroCallMode( SC_MACROCALL_ALLOWED ),
- bHasMacroFunc( sal_False ),
+ bHasMacroFunc( false ),
nVisSpellState( 0 ),
nAsianCompression(SC_ASIANCOMPRESSION_INVALID),
nAsianKerning(SC_ASIANKERNING_INVALID),
- bSetDrawDefaults( sal_False ),
- bPastingDrawFromOtherDoc( sal_False ),
+ bSetDrawDefaults( false ),
+ bPastingDrawFromOtherDoc( false ),
nInDdeLinkUpdate( 0 ),
- bInUnoBroadcast( sal_False ),
- bInUnoListenerCall( sal_False ),
+ bInUnoBroadcast( false ),
+ bInUnoListenerCall( false ),
eGrammar( formula::FormulaGrammar::GRAM_NATIVE ),
bStyleSheetUsageInvalid( sal_True ),
mbUndoEnabled( true ),
@@ -248,8 +250,8 @@ ScDocument::ScDocument( ScDocumentMode eMode,
for (SCTAB i=1; i<=MAXTAB; i++)
pTab[i] = NULL;
- pRangeName = new ScRangeName( 4, 4, sal_False, this );
- pDBCollection = new ScDBCollection( 4, 4, sal_False, this );
+ pRangeName = new ScRangeName(this);
+ pDBCollection = new ScDBCollection( 4, 4, false, this );
pSelectionAttr = NULL;
pChartCollection = new ScChartCollection;
apTemporaryChartLock = std::auto_ptr< ScTemporaryChartLock >( new ScTemporaryChartLock(this) );
@@ -452,9 +454,9 @@ ScDocument::~ScDocument()
// delete the EditEngine before destroying the xPoolHelper
delete pCacheFieldEditEngine;
- if ( xPoolHelper.isValid() && !bIsClip )
+ if ( xPoolHelper.is() && !bIsClip )
xPoolHelper->SourceDocumentGone();
- xPoolHelper.unbind();
+ xPoolHelper.clear();
DeleteColorTable();
delete pScriptTypeData;
@@ -528,8 +530,8 @@ ScFieldEditEngine& ScDocument::GetEditEngine()
if ( !pEditEngine )
{
pEditEngine = new ScFieldEditEngine( GetEnginePool(), GetEditPool() );
- pEditEngine->SetUpdateMode( sal_False );
- pEditEngine->EnableUndo( sal_False );
+ pEditEngine->SetUpdateMode( false );
+ pEditEngine->EnableUndo( false );
pEditEngine->SetRefMapMode( MAP_100TH_MM );
pEditEngine->SetForbiddenCharsTable( xForbiddenCharacters );
}
@@ -541,8 +543,8 @@ ScNoteEditEngine& ScDocument::GetNoteEngine()
if ( !pNoteEngine )
{
pNoteEngine = new ScNoteEditEngine( GetEnginePool(), GetEditPool() );
- pNoteEngine->SetUpdateMode( sal_False );
- pNoteEngine->EnableUndo( sal_False );
+ pNoteEngine->SetUpdateMode( false );
+ pNoteEngine->EnableUndo( false );
pNoteEngine->SetRefMapMode( MAP_100TH_MM );
pNoteEngine->SetForbiddenCharsTable( xForbiddenCharacters );
const SfxItemSet& rItemSet = GetDefPattern()->GetItemSet();
@@ -553,12 +555,6 @@ ScNoteEditEngine& ScDocument::GetNoteEngine()
return *pNoteEngine;
}
-//UNUSED2009-05 SfxItemPool& ScDocument::GetNoteItemPool()
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( !pNoteItemPool )
-//UNUSED2009-05 pNoteItemPool = new SfxItemPool(SdrObject::GetGlobalDrawObjectItemPool());
-//UNUSED2009-05 return *pNoteItemPool;
-//UNUSED2009-05 }
void ScDocument::ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks )
{
@@ -579,7 +575,7 @@ void ScDocument::ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks )
}
else
{
- DBG_ERROR("ResetClip");
+ OSL_FAIL("ResetClip");
}
}
@@ -597,7 +593,7 @@ void ScDocument::ResetClip( ScDocument* pSourceDoc, SCTAB nTab )
}
else
{
- DBG_ERROR("ResetClip");
+ OSL_FAIL("ResetClip");
}
}
@@ -628,22 +624,6 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
}
}
-//UNUSED2009-05 void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell,
-//UNUSED2009-05 sal_uLong nFormatIndex, sal_Bool bForceTab )
-//UNUSED2009-05 {
-//UNUSED2009-05 SCTAB nTab = rPos.Tab();
-//UNUSED2009-05 if ( bForceTab && !pTab[nTab] )
-//UNUSED2009-05 {
-//UNUSED2009-05 sal_Bool bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags
-//UNUSED2009-05
-//UNUSED2009-05 pTab[nTab] = new ScTable(this, nTab,
-//UNUSED2009-05 String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")),
-//UNUSED2009-05 bExtras, bExtras);
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 if (pTab[nTab])
-//UNUSED2009-05 pTab[nTab]->PutCell( rPos, nFormatIndex, pCell );
-//UNUSED2009-05 }
sal_Bool ScDocument::GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
sal_Bool bNotes ) const
@@ -666,7 +646,7 @@ sal_Bool ScDocument::GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
rEndCol = 0;
rEndRow = 0;
- return sal_False;
+ return false;
}
sal_Bool ScDocument::GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow,
@@ -678,7 +658,7 @@ sal_Bool ScDocument::GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow
if (pDrawLayer)
{
ScRange aDrawRange(0,nStartRow,nTab, MAXCOL,nEndRow,nTab);
- if (DrawGetPrintArea( aDrawRange, sal_True, sal_False ))
+ if (DrawGetPrintArea( aDrawRange, sal_True, false ))
{
if (aDrawRange.aEnd.Col()>rEndCol) rEndCol=aDrawRange.aEnd.Col();
bAny = sal_True;
@@ -688,7 +668,7 @@ sal_Bool ScDocument::GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow
}
rEndCol = 0;
- return sal_False;
+ return false;
}
sal_Bool ScDocument::GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol,
@@ -700,7 +680,7 @@ sal_Bool ScDocument::GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol
if (pDrawLayer)
{
ScRange aDrawRange(nStartCol,0,nTab, nEndCol,MAXROW,nTab);
- if (DrawGetPrintArea( aDrawRange, sal_False, sal_True ))
+ if (DrawGetPrintArea( aDrawRange, false, sal_True ))
{
if (aDrawRange.aEnd.Row()>rEndRow) rEndRow=aDrawRange.aEnd.Row();
bAny = sal_True;
@@ -710,7 +690,7 @@ sal_Bool ScDocument::GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol
}
rEndRow = 0;
- return sal_False;
+ return false;
}
sal_Bool ScDocument::GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const
@@ -733,13 +713,13 @@ sal_Bool ScDocument::GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRo
rStartCol = 0;
rStartRow = 0;
- return sal_False;
+ return false;
}
sal_Bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos )
{
- if (nOldPos == nNewPos) return sal_False;
- sal_Bool bValid = sal_False;
+ if (nOldPos == nNewPos) return false;
+ sal_Bool bValid = false;
if (VALIDTAB(nOldPos))
{
if (pTab[nOldPos])
@@ -748,7 +728,7 @@ sal_Bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos )
if (nTabCount > 1)
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
SetNoListening( sal_True );
ScProgress* pProgress = new ScProgress( GetDocumentShell(),
ScGlobal::GetRscString(STR_UNDO_MOVE_TAB), GetCodeCount() );
@@ -794,11 +774,11 @@ sal_Bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos )
for (i = 0; i <= MAXTAB; i++)
if (pTab[i])
pTab[i]->UpdateCompile();
- SetNoListening( sal_False );
+ SetNoListening( false );
for (i = 0; i <= MAXTAB; i++)
if (pTab[i])
pTab[i]->StartAllListeners();
- // #81844# sheet names of references may not be valid until sheet is moved
+ // sheet names of references may not be valid until sheet is moved
pChartListenerCollection->UpdateScheduledSeriesRanges();
SetDirty();
SetAutoCalc( bOldAutoCalc );
@@ -834,7 +814,7 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
bValid = ( !GetTable( aName, nDummy ) && (nMaxTableNumber <= MAXTAB) );
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
if (bValid)
{
if (nNewPos == nMaxTableNumber)
@@ -877,7 +857,7 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
for (i = 0; i <= MAXTAB; i++)
if (pTab[i] && i != nOldPos && i != nNewPos)
pTab[i]->UpdateCompile();
- SetNoListening( sal_False );
+ SetNoListening( false );
for (i = 0; i <= MAXTAB; i++)
if (pTab[i] && i != nOldPos && i != nNewPos)
pTab[i]->StartAllListeners();
@@ -887,11 +867,11 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
if ( pValidationList )
pValidationList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
- // #81844# sheet names of references may not be valid until sheet is copied
+ // sheet names of references may not be valid until sheet is copied
pChartListenerCollection->UpdateScheduledSeriesRanges();
}
else
- bValid = sal_False;
+ bValid = false;
}
}
if (bValid)
@@ -902,10 +882,7 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
pTab[nNewPos]->SetTabBgColor(pTab[nOldPos]->GetTabBgColor());
SCsTAB nDz;
-/* if (nNewPos < nOldPos)
- nDz = ((short)nNewPos) - (short)nOldPos + 1;
- else
-*/ nDz = ((short)nNewPos) - (short)nOldPos;
+ nDz = ((short)nNewPos) - (short)nOldPos;
pTab[nNewPos]->UpdateReference(URM_COPY, 0, 0, nNewPos , MAXCOL, MAXROW,
nNewPos, 0, 0, nDz, NULL);
@@ -913,8 +890,8 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO
pTab[nOldPos]->UpdateInsertTab(nNewPos);
pTab[nOldPos]->UpdateCompile();
- pTab[nNewPos]->UpdateCompile( sal_True ); // #67996# maybe already compiled in Clone, but used names need recompilation
- SetNoListening( sal_False );
+ pTab[nNewPos]->UpdateCompile( true ); // maybe already compiled in Clone, but used names need recompilation
+ SetNoListening( false );
pTab[nOldPos]->StartAllListeners();
pTab[nNewPos]->StartAllListeners();
SetDirty();
@@ -955,14 +932,14 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
pTab[nDestPos]->DeleteArea( 0,0, MAXCOL,MAXROW, IDF_ALL );
}
else
- bValid = sal_False;
+ bValid = false;
}
if (bValid)
{
- sal_Bool bOldAutoCalcSrc = sal_False;
+ sal_Bool bOldAutoCalcSrc = false;
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
SetNoListening( sal_True );
if ( bResultsOnly )
{
@@ -978,43 +955,45 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
ScBulkBroadcast aBulkBroadcast( pBASM);
pSrcDoc->pTab[nSrcPos]->CopyToTable(0, 0, MAXCOL, MAXROW,
( bResultsOnly ? IDF_ALL & ~IDF_FORMULA : IDF_ALL),
- sal_False, pTab[nDestPos] );
+ false, pTab[nDestPos] );
}
}
pTab[nDestPos]->SetTabNo(nDestPos);
if ( !bResultsOnly )
{
- sal_Bool bNamesLost = sal_False;
- sal_uInt16 nSrcRangeNames = pSrcDoc->pRangeName->GetCount();
- // array containing range names which might need update of indices
- ScRangeData** pSrcRangeNames = nSrcRangeNames ? new ScRangeData* [nSrcRangeNames] : NULL;
+ BOOL bNamesLost = false;
+ // array containing range names which might need update of indices.
+ // The instances inserted into this vector are managed by the
+ // range name container of this document, so no need to delete
+ // them afterward.
+ ::std::vector<ScRangeData*> aSrcRangeNames;
+
// the index mapping thereof
ScRangeData::IndexMap aSrcRangeMap;
- sal_Bool bRangeNameReplace = sal_False;
+ sal_Bool bRangeNameReplace = false;
// find named ranges that are used in the source sheet
std::set<sal_uInt16> aUsedNames;
pSrcDoc->pTab[nSrcPos]->FindRangeNamesInUse( 0, 0, MAXCOL, MAXROW, aUsedNames );
- for (sal_uInt16 i = 0; i < nSrcRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch !!!
+ ScRangeName::const_iterator itr = pSrcDoc->pRangeName->begin(), itrEnd = pSrcDoc->pRangeName->end();
+ for (; itr != itrEnd; ++itr) //! DB-Bereiche Pivot-Bereiche auch !!!
{
- ScRangeData* pSrcData = (*pSrcDoc->pRangeName)[i];
- sal_uInt16 nOldIndex = pSrcData->GetIndex();
+ USHORT nOldIndex = itr->GetIndex();
bool bInUse = ( aUsedNames.find(nOldIndex) != aUsedNames.end() );
if (bInUse)
{
- sal_uInt16 nExisting = 0;
- if ( pRangeName->SearchName( pSrcData->GetName(), nExisting ) )
+ const ScRangeData* pExistingData = pRangeName->findByName(itr->GetName());
+ if (pExistingData)
{
// the name exists already in the destination document
// -> use the existing name, but show a warning
// (when refreshing links, the existing name is used and the warning not shown)
- ScRangeData* pExistingData = (*pRangeName)[nExisting];
- sal_uInt16 nExistingIndex = pExistingData->GetIndex();
+ USHORT nExistingIndex = pExistingData->GetIndex();
- pSrcRangeNames[i] = NULL; // don't modify the named range
+ // don't modify the named range
aSrcRangeMap.insert(
ScRangeData::IndexMap::value_type(nOldIndex, nExistingIndex));
bRangeNameReplace = sal_True;
@@ -1022,20 +1001,20 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
}
else
{
- ScRangeData* pData = new ScRangeData( *pSrcData );
+ ScRangeData* pData = new ScRangeData( *itr );
pData->SetDocument(this);
- if ( pRangeName->FindIndex( pData->GetIndex() ) )
+ if ( pRangeName->findByIndex( pData->GetIndex() ) )
pData->SetIndex(0); // need new index, done in Insert
- if (!pRangeName->Insert(pData))
+ if (!pRangeName->insert(pData))
{
- DBG_ERROR("can't insert name"); // shouldn't happen
+ OSL_FAIL("can't insert name"); // shouldn't happen
delete pData;
}
else
{
pData->TransferTabRef( nSrcPos, nDestPos );
- pSrcRangeNames[i] = pData;
- sal_uInt16 nNewIndex = pData->GetIndex();
+ aSrcRangeNames.push_back(pData);
+ USHORT nNewIndex = pData->GetIndex();
aSrcRangeMap.insert(
ScRangeData::IndexMap::value_type(nOldIndex, nNewIndex));
if ( !bRangeNameReplace )
@@ -1043,26 +1022,17 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
}
}
}
- else
- {
- pSrcRangeNames[i] = NULL;
- //aSrcRangeMap.SetPair( i, 0, 0 ); // not needed, defaulted
- }
}
if ( bRangeNameReplace )
{
// first update all inserted named formulas if they contain other
// range names and used indices changed
- for (sal_uInt16 i = 0; i < nSrcRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch
- {
- if ( pSrcRangeNames[i] )
- pSrcRangeNames[i]->ReplaceRangeNamesInUse( aSrcRangeMap );
- }
+ for (size_t i = 0, n = aSrcRangeNames.size(); i < n; ++i) //! DB-Bereiche Pivot-Bereiche auch
+ aSrcRangeNames[i]->ReplaceRangeNamesInUse( aSrcRangeMap );
+
// then update the formulas, they might need the just updated range names
pTab[nDestPos]->ReplaceRangeNamesInUse( 0, 0, MAXCOL, MAXROW, aSrcRangeMap );
}
- if ( pSrcRangeNames )
- delete [] pSrcRangeNames;
SCsTAB nDz = ((SCsTAB)nDestPos) - (SCsTAB)nSrcPos;
pTab[nDestPos]->UpdateReference(URM_COPY, 0, 0, nDestPos,
@@ -1085,7 +1055,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
pTab[nDestPos]->CompileAll();
}
- SetNoListening( sal_False );
+ SetNoListening( false );
if ( !bResultsOnly )
pTab[nDestPos]->StartAllListeners();
SetDirty( ScRange( 0, 0, nDestPos, MAXCOL, MAXROW, nDestPos));
@@ -1152,32 +1122,46 @@ void ScDocument::SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16
pTab[nTab]->SetError( nCol, nRow, nError );
}
-void ScDocument::EraseNonUsedSharedNames(sal_uInt16 nLevel)
+namespace {
+
+bool eraseUnusedSharedName(ScRangeName* pRangeName, ScTable* pTab[], USHORT nLevel)
{
- for (sal_uInt16 i = 0; i < pRangeName->GetCount(); i++)
+ ScRangeName::iterator itr = pRangeName->begin(), itrEnd = pRangeName->end();
+ for (; itr != itrEnd; ++itr)
{
- ScRangeData* pRangeData = (*pRangeName)[i];
- if (pRangeData && pRangeData->HasType(RT_SHARED))
+ if (!itr->HasType(RT_SHARED))
+ continue;
+
+ String aName;
+ itr->GetName(aName);
+ aName.Erase(0, 6); // !!! vgl. Table4, FillFormula !!
+ USHORT nInd = static_cast<USHORT>(aName.ToInt32());
+ if (nInd > nLevel)
+ continue;
+
+ USHORT nIndex = itr->GetIndex();
+
+ bool bInUse = false;
+ for (SCTAB j = 0; !bInUse && (j <= MAXTAB); ++j)
{
- String aName;
- pRangeData->GetName(aName);
- aName.Erase(0, 6); // !!! vgl. Table4, FillFormula !!
- sal_uInt16 nInd = (sal_uInt16) aName.ToInt32();
- if (nInd <= nLevel)
- {
- sal_uInt16 nIndex = pRangeData->GetIndex();
- sal_Bool bInUse = sal_False;
- for (SCTAB j = 0; !bInUse && (j <= MAXTAB); j++)
- {
- if (pTab[j])
- bInUse = pTab[j]->IsRangeNameInUse(0, 0, MAXCOL-1, MAXROW-1,
- nIndex);
- }
- if (!bInUse)
- pRangeName->AtFree(i);
- }
+ if (pTab[j])
+ bInUse = pTab[j]->IsRangeNameInUse(0, 0, MAXCOL-1, MAXROW-1, nIndex);
+ }
+ if (!bInUse)
+ {
+ pRangeName->erase(itr);
+ return true;
}
}
+ return false;
+}
+
+}
+
+void ScDocument::EraseNonUsedSharedNames(USHORT nLevel)
+{
+ while (eraseUnusedSharedName(pRangeName, pTab, nLevel))
+ ;
}
// ----------------------------------------------------------------------------
@@ -1210,7 +1194,7 @@ ScFieldEditEngine* ScDocument::CreateFieldEditEngine()
if (!pCacheFieldEditEngine)
{
pNewEditEngine = new ScFieldEditEngine( GetEnginePool(),
- GetEditPool(), sal_False );
+ GetEditPool(), false );
}
else
{
@@ -1242,7 +1226,6 @@ void ScDocument::DisposeFieldEditEngine(ScFieldEditEngine*& rpEditEngine)
// ----------------------------------------------------------------------------
-// static
ScRecursionHelper* ScDocument::CreateRecursionHelperInstance()
{
return new ScRecursionHelper;
@@ -1298,3 +1281,5 @@ void ScDocument::ClearLookupCaches()
if( pLookupCacheMapImpl )
pLookupCacheMapImpl->clear();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index e249d7f3bf47..a2d828d41fd8 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,6 +54,7 @@
#include "rangelst.hxx"
#include "chartarr.hxx"
#include "chartlock.hxx"
+#include "compiler.hxx"
#include "refupdat.hxx"
#include "docoptio.hxx"
#include "viewopti.hxx"
@@ -72,15 +74,11 @@
#include "sc.hrc" // SID_LINK
#include "hints.hxx"
#include "dpobject.hxx"
-#include "unoguard.hxx"
#include "drwlayer.hxx"
#include "unoreflist.hxx"
#include "listenercalls.hxx"
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "dpshttab.hxx"
#include "dptablecache.hxx"
-// End Comments
#include "tabprotection.hxx"
#include "formulaparserpool.hxx"
#include "clipparam.hxx"
@@ -92,7 +90,7 @@ using namespace com::sun::star;
//------------------------------------------------------------------------
-ScRangeName* ScDocument::GetRangeName()
+ScRangeName* ScDocument::GetRangeName() const
{
return pRangeName;
}
@@ -104,21 +102,13 @@ void ScDocument::SetRangeName( ScRangeName* pNewRangeName )
pRangeName = pNewRangeName;
}
-//UNUSED2008-05 ScRangeData* ScDocument::GetRangeAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
-//UNUSED2008-05 sal_Bool bStartOnly) const
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( pRangeName )
-//UNUSED2008-05 return pRangeName->GetRangeAtCursor( ScAddress( nCol, nRow, nTab ), bStartOnly );
-//UNUSED2008-05 else
-//UNUSED2008-05 return NULL;
-//UNUSED2008-05 }
-ScRangeData* ScDocument::GetRangeAtBlock( const ScRange& rBlock, String* pName ) const
+const ScRangeData* ScDocument::GetRangeAtBlock( const ScRange& rBlock, String* pName ) const
{
- ScRangeData* pData = NULL;
+ const ScRangeData* pData = NULL;
if ( pRangeName )
{
- pData = pRangeName->GetRangeAtBlock( rBlock );
+ pData = pRangeName->findByRange( rBlock );
if (pData && pName)
*pName = pData->GetName();
}
@@ -148,7 +138,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, sal_Bool bRe
ScRange aOldRange;
pOldData->GetArea( aOldRange );
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 nNewIndex = 0;
if ( pNewDBCollection &&
pNewDBCollection->SearchName( pOldData->GetName(), nNewIndex ) )
@@ -268,10 +258,6 @@ void ScDocument::SetScenario( SCTAB nTab, sal_Bool bFlag )
sal_Bool ScDocument::IsScenario( SCTAB nTab ) const
{
return ValidTab(nTab) && pTab[nTab] &&pTab[nTab]->IsScenario();
- //if (ValidTab(nTab) && pTab[nTab])
- // return pTab[nTab]->IsScenario();
-
- //return sal_False;
}
void ScDocument::SetScenarioData( SCTAB nTab, const String& rComment,
@@ -407,7 +393,7 @@ sal_Bool ScDocument::HasLink( const String& rDoc,
&& pTab[i]->GetLinkOpt() == rOptions)
return sal_True;
- return sal_False;
+ return false;
}
sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
@@ -416,7 +402,7 @@ sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
if ( IsClipboard() )
{
DBG_ERRORFILE( "LinkExternalTab in Clipboard" );
- return sal_False;
+ return false;
}
rTab = 0;
String aFilterName; // wird vom Loader gefuellt
@@ -424,7 +410,7 @@ sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
sal_uInt32 nLinkCnt = pExtDocOptions ? pExtDocOptions->GetDocSettings().mnLinkCnt : 0;
ScDocumentLoader aLoader( aFileName, aFilterName, aOptions, nLinkCnt + 1 );
if ( aLoader.IsError() )
- return sal_False;
+ return false;
ScDocument* pSrcDoc = aLoader.GetDocument();
// Tabelle kopieren
@@ -434,14 +420,14 @@ sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
if ( !InsertTab( SC_TAB_APPEND, aDocTab, sal_True ) )
{
DBG_ERRORFILE("can't insert external document table");
- return sal_False;
+ return false;
}
rTab = GetTableCount() - 1;
// nicht neu einfuegen, nur Ergebnisse
- TransferTab( pSrcDoc, nSrcTab, rTab, sal_False, sal_True );
+ TransferTab( pSrcDoc, nSrcTab, rTab, false, sal_True );
}
else
- return sal_False;
+ return false;
sal_uLong nRefreshDelay = 0;
@@ -454,7 +440,7 @@ sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
GetLinkManager()->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName,
&aFilterName );
pLink->Update();
- pLink->SetInCreate( sal_False );
+ pLink->SetInCreate( false );
SfxBindings* pBindings = GetViewBindings();
if (pBindings)
pBindings->Invalidate( SID_LINKS );
@@ -483,9 +469,9 @@ void ScDocument::MarkUsedExternalReferences()
if (!pExternalRefMgr->hasExternalData())
return;
// Charts.
- bool bAllMarked = pExternalRefMgr->markUsedByLinkListeners();
+ pExternalRefMgr->markUsedByLinkListeners();
// Formula cells.
- bAllMarked = pExternalRefMgr->markUsedExternalRefCells();
+ pExternalRefMgr->markUsedExternalRefCells();
/* NOTE: Conditional formats and validation objects are marked when
* collecting them during export. */
@@ -555,7 +541,7 @@ sal_Bool ScDocument::HasCalcNotification( SCTAB nTab ) const
{
if (VALIDTAB(nTab) && pTab[nTab])
return pTab[nTab]->GetCalcNotification();
- return sal_False;
+ return false;
}
void ScDocument::SetCalcNotification( SCTAB nTab )
@@ -569,7 +555,7 @@ void ScDocument::ResetCalcNotifications()
{
for (SCTAB nTab = 0; nTab <= MAXTAB; nTab++)
if (pTab[nTab] && pTab[nTab]->GetCalcNotification())
- pTab[nTab]->SetCalcNotification(sal_False);
+ pTab[nTab]->SetCalcNotification(false);
}
ScOutlineTable* ScDocument::GetOutlineTable( SCTAB nTab, sal_Bool bCreate )
@@ -594,11 +580,6 @@ ScOutlineTable* ScDocument::GetOutlineTable( SCTAB nTab, sal_Bool bCreate )
sal_Bool ScDocument::SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline )
{
return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->SetOutlineTable(pNewOutline);
- //if (VALIDTAB(nTab))
- // if (pTab[nTab])
- // return pTab[nTab]->SetOutlineTable(pNewOutline);
-
- //return sal_False;
}
void ScDocument::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow,
@@ -611,10 +592,6 @@ void ScDocument::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow,
sal_Bool ScDocument::TestRemoveSubTotals( SCTAB nTab, const ScSubTotalParam& rParam )
{
return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->TestRemoveSubTotals( rParam );
- //if (VALIDTAB(nTab) && pTab[nTab] )
- // return pTab[nTab]->TestRemoveSubTotals( rParam );
-
- //return sal_False;
}
void ScDocument::RemoveSubTotals( SCTAB nTab, ScSubTotalParam& rParam )
@@ -626,11 +603,6 @@ void ScDocument::RemoveSubTotals( SCTAB nTab, ScSubTotalParam& rParam )
sal_Bool ScDocument::DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam )
{
return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->DoSubTotals( rParam );
- //if (VALIDTAB(nTab))
- // if (pTab[nTab])
- // return pTab[nTab]->DoSubTotals( rParam );
-
- //return sal_False;
}
sal_Bool ScDocument::HasSubTotalCells( const ScRange& rRange )
@@ -644,7 +616,7 @@ sal_Bool ScDocument::HasSubTotalCells( const ScRange& rRange )
pCell = aIter.GetNext();
}
- return sal_False; // none found
+ return false; // none found
}
// kopiert aus diesem Dokument die Zellen von Positionen, an denen in pPosDoc
@@ -666,7 +638,6 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bNewScena
// und aktuelle Werte in bisher aktive Szenarios zurueckschreiben
ScRangeList aRanges = *pTab[nSrcTab]->GetScenarioRanges();
- const sal_uLong nRangeCount = aRanges.Count();
// nDestTab ist die Zieltabelle
for ( SCTAB nTab = nDestTab+1;
@@ -675,16 +646,16 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bNewScena
{
if ( pTab[nTab]->IsActiveScenario() ) // auch wenn's dasselbe Szenario ist
{
- sal_Bool bTouched = sal_False;
- for ( sal_uLong nR=0; nR<nRangeCount && !bTouched; nR++)
+ sal_Bool bTouched = false;
+ for ( size_t nR=0, nRangeCount = aRanges.size(); nR < nRangeCount && !bTouched; nR++ )
{
- const ScRange* pRange = aRanges.GetObject(nR);
+ const ScRange* pRange = aRanges[ nR ];
if ( pTab[nTab]->HasScenarioRange( *pRange ) )
bTouched = sal_True;
}
if (bTouched)
{
- pTab[nTab]->SetActiveScenario(sal_False);
+ pTab[nTab]->SetActiveScenario(false);
if ( pTab[nTab]->GetScenarioFlags() & SC_SCENARIO_TWOWAY )
pTab[nTab]->CopyScenarioFrom( pTab[nDestTab] );
}
@@ -695,7 +666,7 @@ void ScDocument::CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bNewScena
if (!bNewScenario) // Daten aus dem ausgewaehlten Szenario kopieren
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
pTab[nSrcTab]->CopyScenarioTo( pTab[nDestTab] );
SetDirty();
SetAutoCalc( bOldAutoCalc );
@@ -718,10 +689,6 @@ void ScDocument::MarkScenario( SCTAB nSrcTab, SCTAB nDestTab, ScMarkData& rDestM
sal_Bool ScDocument::HasScenarioRange( SCTAB nTab, const ScRange& rRange ) const
{
return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->HasScenarioRange( rRange );
- //if (ValidTab(nTab) && pTab[nTab])
- // return pTab[nTab]->HasScenarioRange( rRange );
-
- //return sal_False;
}
const ScRangeList* ScDocument::GetScenarioRanges( SCTAB nTab ) const
@@ -735,10 +702,6 @@ const ScRangeList* ScDocument::GetScenarioRanges( SCTAB nTab ) const
sal_Bool ScDocument::IsActiveScenario( SCTAB nTab ) const
{
return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->IsActiveScenario( );
- //if (ValidTab(nTab) && pTab[nTab])
- // return pTab[nTab]->IsActiveScenario();
-
- //return sal_False;
}
void ScDocument::SetActiveScenario( SCTAB nTab, sal_Bool bActive )
@@ -752,8 +715,8 @@ sal_Bool ScDocument::TestCopyScenario( SCTAB nSrcTab, SCTAB nDestTab ) const
if (ValidTab(nSrcTab) && ValidTab(nDestTab))
return pTab[nSrcTab]->TestCopyScenarioTo( pTab[nDestTab] );
- DBG_ERROR("falsche Tabelle bei TestCopyScenario");
- return sal_False;
+ OSL_FAIL("falsche Tabelle bei TestCopyScenario");
+ return false;
}
void ScDocument::AddUnoObject( SfxListener& rObject )
@@ -772,7 +735,7 @@ void ScDocument::RemoveUnoObject( SfxListener& rObject )
if ( bInUnoBroadcast )
{
- // #107294# Broadcasts from ScDocument::BroadcastUno are the only way that
+ // Broadcasts from ScDocument::BroadcastUno are the only way that
// uno object methods are called without holding a reference.
//
// If RemoveUnoObject is called from an object dtor in the finalizer thread
@@ -784,7 +747,7 @@ void ScDocument::RemoveUnoObject( SfxListener& rObject )
// This check is done after calling EndListening, so a later BroadcastUno call
// won't touch this object.
- vos::IMutex& rSolarMutex = Application::GetSolarMutex();
+ osl::SolarMutex& rSolarMutex = Application::GetSolarMutex();
if ( rSolarMutex.tryToAcquire() )
{
// BroadcastUno is always called with the SolarMutex locked, so if it
@@ -797,14 +760,14 @@ void ScDocument::RemoveUnoObject( SfxListener& rObject )
// let the thread that called BroadcastUno continue
while ( bInUnoBroadcast )
{
- vos::OThread::yield();
+ osl::Thread::yield();
}
}
}
}
else
{
- DBG_ERROR("No Uno broadcaster");
+ OSL_FAIL("No Uno broadcaster");
}
}
@@ -814,7 +777,7 @@ void ScDocument::BroadcastUno( const SfxHint &rHint )
{
bInUnoBroadcast = sal_True;
pUnoBroadcaster->Broadcast( rHint );
- bInUnoBroadcast = sal_False;
+ bInUnoBroadcast = false;
// During Broadcast notification, Uno objects can add to pUnoListenerCalls.
// The listener calls must be processed after completing the broadcast,
@@ -831,7 +794,7 @@ void ScDocument::BroadcastUno( const SfxHint &rHint )
ScChartLockGuard aChartLockGuard(this);
bInUnoListenerCall = sal_True;
pUnoListenerCalls->ExecuteAndClear();
- bInUnoListenerCall = sal_False;
+ bInUnoListenerCall = false;
}
}
}
@@ -945,7 +908,7 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode,
}
SetExpandRefs( bExpandRefsOld );
- // #30428# after moving, no clipboard move ref-updates are possible
+ // after moving, no clipboard move ref-updates are possible
if ( eUpdateRefMode != URM_COPY && IsClipboardSource() )
{
ScDocument* pClipDoc = SC_MOD()->GetClipDoc();
@@ -962,8 +925,8 @@ void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDo
ScRange aSource;
ScClipParam& rClipParam = GetClipParam();
- if (rClipParam.maRanges.Count())
- aSource = *rClipParam.maRanges.First();
+ if (!rClipParam.maRanges.empty())
+ aSource = *rClipParam.maRanges.front();
ScAddress aDest = rDestPos;
SCTAB nClipTab = 0;
@@ -1046,7 +1009,6 @@ void ScDocument::GetAutoFormatData(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
}
}
-// static
void ScDocument::GetSearchAndReplaceStart( const SvxSearchItem& rSearchItem,
SCCOL& rCol, SCROW& rRow )
{
@@ -1142,7 +1104,7 @@ sal_Bool ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem,
rMark.MarkToMulti();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if (VALIDTAB(rTab))
{
SCCOL nCol;
@@ -1224,8 +1186,8 @@ sal_Bool ScDocument::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTa
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->UpdateOutlineCol( nStartCol, nEndCol, bShow );
- DBG_ERROR("missing tab");
- return sal_False;
+ OSL_FAIL("missing tab");
+ return false;
}
sal_Bool ScDocument::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_Bool bShow )
@@ -1233,8 +1195,8 @@ sal_Bool ScDocument::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTa
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->UpdateOutlineRow( nStartRow, nEndRow, bShow );
- DBG_ERROR("missing tab");
- return sal_False;
+ OSL_FAIL("missing tab");
+ return false;
}
void ScDocument::Sort(SCTAB nTab, const ScSortParam& rSortParam, sal_Bool bKeepQuery)
@@ -1253,21 +1215,11 @@ SCSIZE ScDocument::Query(SCTAB nTab, const ScQueryParam& rQueryParam, sal_Bool b
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->Query((ScQueryParam&)rQueryParam, bKeepSub);
- DBG_ERROR("missing tab");
+ OSL_FAIL("missing tab");
return 0;
}
-sal_Bool ScDocument::ValidQuery( SCROW nRow, SCTAB nTab, const ScQueryParam& rQueryParam, sal_Bool* pSpecial )
-{
- if ( ValidTab(nTab) && pTab[nTab] )
- return pTab[nTab]->ValidQuery( nRow, rQueryParam, pSpecial );
-
- DBG_ERROR("missing tab");
- return sal_False;
-}
-
-
void ScDocument::GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr)
{
if ( ValidTab(nTab) && pTab[nTab] )
@@ -1281,8 +1233,8 @@ sal_Bool ScDocument::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->CreateQueryParam(nCol1, nRow1, nCol2, nRow2, rQueryParam);
- DBG_ERROR("missing tab");
- return sal_False;
+ OSL_FAIL("missing tab");
+ return false;
}
sal_Bool ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab )
@@ -1309,11 +1261,11 @@ sal_Bool ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab
GetValue();
if ( (nFlag & SC_MF_AUTO) == 0 )
- bHasAutoFilter = sal_False;
+ bHasAutoFilter = false;
}
}
else
- bHasAutoFilter = sal_False;
+ bHasAutoFilter = false;
}
return bHasAutoFilter;
@@ -1323,22 +1275,24 @@ sal_Bool ScDocument::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndC
SCTAB nTab )
{
return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->HasColHeader( nStartCol, nStartRow, nEndCol, nEndRow );
- //if (VALIDTAB(nTab))
- // if (pTab[nTab])
- // return pTab[nTab]->HasColHeader( nStartCol, nStartRow, nEndCol, nEndRow );
-
- //return sal_False;
}
sal_Bool ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
SCTAB nTab )
{
return VALIDTAB(nTab) && pTab[nTab] && pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow );
- //if (VALIDTAB(nTab))
- // if (pTab[nTab])
- // return pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow );
+}
- //return sal_False;
+void ScDocument::UpdateDynamicEndRow(ScDBData& rDBData) const
+{
+ SCCOL nCol1, nCol2;
+ SCROW nRow1, nRow2;
+ SCTAB nTab;
+ rDBData.GetArea(nTab, nCol1, nRow1, nCol2, nRow2);
+ SCCOL nCol1a = nCol1, nCol2a = nCol2;
+ SCROW nRow1a = nRow1, nRow2a = nRow2;
+ GetDataArea(nTab, nCol1a, nRow1a, nCol2a, nRow2a, false, false);
+ rDBData.SetDynamicEndRow(nRow2a);
}
//
@@ -1350,9 +1304,10 @@ sal_Bool ScDocument::GetFilterEntries(
{
if ( ValidTab(nTab) && pTab[nTab] && pDBCollection )
{
- ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, sal_False); //!??
+ ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, false); //!??
if (pDBData)
{
+ UpdateDynamicEndRow(*pDBData);
SCTAB nAreaTab;
SCCOL nStartCol;
SCROW nStartRow;
@@ -1364,6 +1319,7 @@ sal_Bool ScDocument::GetFilterEntries(
ScQueryParam aParam;
pDBData->GetQueryParam( aParam );
+ nEndRow = aParam.nDynamicEndRow;
rStrings.SetCaseSensitive( aParam.bCaseSens );
// return all filter entries, if a filter condition is connected with a boolean OR
@@ -1394,7 +1350,7 @@ sal_Bool ScDocument::GetFilterEntries(
}
}
- return sal_False;
+ return false;
}
//
@@ -1410,7 +1366,7 @@ sal_Bool ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nE
return sal_True;
}
- return sal_False;
+ return false;
}
//
@@ -1435,10 +1391,6 @@ sal_Bool ScDocument::GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
}
return ValidTab(nTab) && pTab[nTab] && pTab[nTab]->GetDataEntries( nCol, nRow, rStrings, bLimit );
- //if (ValidTab(nTab) && pTab[nTab])
- // return pTab[nTab]->GetDataEntries( nCol, nRow, rStrings, bLimit );
-
- //return sal_False;
}
//
@@ -1452,24 +1404,18 @@ sal_Bool ScDocument::GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
sal_Bool ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings )
{
- sal_uInt16 i;
-
//
// Bereichsnamen
//
if ( pRangeName )
{
- sal_uInt16 nRangeCount = pRangeName->GetCount();
- for ( i=0; i<nRangeCount; i++ )
+ ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end();
+ for (; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pRangeName)[i];
- if (pData)
- {
- TypedStrData* pNew = new TypedStrData( pData->GetName(), 0.0, SC_STRTYPE_NAMES );
- if ( !rStrings.Insert(pNew) )
- delete pNew;
- }
+ TypedStrData* pNew = new TypedStrData(itr->GetName(), 0.0, SC_STRTYPE_NAMES);
+ if (!rStrings.Insert(pNew))
+ delete pNew;
}
}
@@ -1480,7 +1426,7 @@ sal_Bool ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings )
if ( pDBCollection )
{
sal_uInt16 nDBCount = pDBCollection->GetCount();
- for ( i=0; i<nDBCount; i++ )
+ for ( sal_uInt16 i=0; i<nDBCount; i++ )
{
ScDBData* pData = (*pDBCollection)[i];
if (pData)
@@ -1501,10 +1447,11 @@ sal_Bool ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings )
pLists[1] = GetRowNameRanges();
for (sal_uInt16 nListNo=0; nListNo<2; nListNo++)
{
- ScRangePairList* pList = pLists[nListNo];
+ ScRangePairList* pList = pLists[ nListNo ];
if (pList)
- for ( ScRangePair* pPair = pList->First(); pPair; pPair = pList->Next() )
+ for ( size_t i = 0, nPairs = pList->size(); i < nPairs; ++i )
{
+ ScRangePair* pPair = (*pList)[i];
ScRange aRange = pPair->GetRange(0);
ScCellIterator aIter( this, aRange );
for ( ScBaseCell* pCell = aIter.GetFirst(); pCell; pCell = aIter.GetNext() )
@@ -1538,7 +1485,7 @@ Rectangle ScDocument::GetEmbeddedRect() const // 1/100 mm
ScTable* pTable = pTab[aEmbedRange.aStart.Tab()];
if (!pTable)
{
- DBG_ERROR("GetEmbeddedRect ohne Tabelle");
+ OSL_FAIL("GetEmbeddedRect ohne Tabelle");
}
else
{
@@ -1569,7 +1516,7 @@ void ScDocument::SetEmbedded( const ScRange& rRange )
void ScDocument::ResetEmbedded()
{
- bIsEmbedded = sal_False;
+ bIsEmbedded = false;
aEmbedRange = ScRange();
}
@@ -1621,12 +1568,12 @@ bool lcl_AddTwipsWhile( long & rTwips, long nStopTwips, SCROW & rPosY, SCROW nEn
return bAdded;
}
-ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect )
+ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) const
{
ScTable* pTable = pTab[nTab];
if (!pTable)
{
- DBG_ERROR("GetRange ohne Tabelle");
+ OSL_FAIL("GetRange ohne Tabelle");
return ScRange();
}
@@ -1643,7 +1590,7 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect )
nTwips = (long) (aPosRect.Left() / HMM_PER_TWIPS);
SCCOL nX1 = 0;
- bEnd = sal_False;
+ bEnd = false;
while (!bEnd)
{
nAdd = (long) pTable->GetColWidth(nX1);
@@ -1659,7 +1606,7 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect )
nTwips = (long) (aPosRect.Right() / HMM_PER_TWIPS);
SCCOL nX2 = nX1;
- bEnd = sal_False;
+ bEnd = false;
while (!bEnd)
{
nAdd = (long) pTable->GetColWidth(nX2);
@@ -1760,7 +1707,7 @@ void ScDocument::SnapVisArea( Rectangle& rRect ) const
ScTable* pTable = pTab[nVisibleTab];
if (!pTable)
{
- DBG_ERROR("SetEmbedded ohne Tabelle");
+ OSL_FAIL("SetEmbedded ohne Tabelle");
return;
}
@@ -1811,8 +1758,8 @@ sal_Bool ScDocument::IsTabProtected( SCTAB nTab ) const
if (VALIDTAB(nTab) && pTab[nTab])
return pTab[nTab]->IsProtected();
- DBG_ERROR("Falsche Tabellennummer");
- return sal_False;
+ OSL_FAIL("Falsche Tabellennummer");
+ return false;
}
ScTableProtection* ScDocument::GetTabProtection( SCTAB nTab ) const
@@ -1848,9 +1795,36 @@ const ScDocOptions& ScDocument::GetDocOptions() const
void ScDocument::SetDocOptions( const ScDocOptions& rOpt )
{
DBG_ASSERT( pDocOptions, "No DocOptions! :-(" );
+ bool bUpdateFuncNames = pDocOptions->GetUseEnglishFuncName() != rOpt.GetUseEnglishFuncName();
+
*pDocOptions = rOpt;
xPoolHelper->SetFormTableOpt(rOpt);
+
+ SetGrammar( rOpt.GetFormulaSyntax() );
+
+ if (bUpdateFuncNames)
+ {
+ // This needs to be called first since it may re-initialize the entire
+ // opcode map.
+ if (rOpt.GetUseEnglishFuncName())
+ {
+ // switch native symbols to English.
+ ScCompiler aComp(NULL, ScAddress());
+ ScCompiler::OpCodeMapPtr xMap = aComp.GetOpCodeMap(::com::sun::star::sheet::FormulaLanguage::ENGLISH);
+ ScCompiler::SetNativeSymbols(xMap);
+ }
+ else
+ // re-initialize native symbols with localized function names.
+ ScCompiler::ResetNativeSymbols();
+
+ // Force re-population of function names for the function wizard, function tip etc.
+ ScGlobal::ResetFunctionList();
+ }
+
+ // Update the separators.
+ ScCompiler::UpdateSeparatorsNative(
+ rOpt.GetFormulaSepArg(), rOpt.GetFormulaSepArrayCol(), rOpt.GetFormulaSepArrayRow());
}
const ScViewOptions& ScDocument::GetViewOptions() const
@@ -1877,7 +1851,7 @@ void ScDocument::SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageTy
eLanguage = eLatin;
eCjkLanguage = eCjk;
eCtlLanguage = eCtl;
- if ( xPoolHelper.isValid() )
+ if ( xPoolHelper.is() )
{
ScDocumentPool* pPool = xPoolHelper->GetDocPool();
pPool->SetPoolDefaultItem( SvxLanguageItem( eLanguage, ATTR_FONT_LANGUAGE ) );
@@ -1894,12 +1868,11 @@ void ScDocument::SetDrawDefaults()
UpdateDrawDefaults();
}
-Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow,
- SCCOL nEndCol, SCROW nEndRow, SCTAB nTab )
+Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const
{
if (!ValidTab(nTab) || !pTab[nTab])
{
- DBG_ERROR("GetMMRect: falsche Tabelle");
+ OSL_FAIL("GetMMRect: falsche Tabelle");
return Rectangle(0,0,0,0);
}
@@ -2017,119 +1990,4 @@ void ScDocument::DecSizeRecalcLevel( SCTAB nTab, bool bUpdateNoteCaptionPos )
pTab[nTab]->DecRecalcLevel( bUpdateNoteCaptionPos );
}
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
-ScDPTableDataCache* ScDocument::GetDPObjectCache( long nID )
-{
- for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ )
- { //
- if ( nID == (*iter)->GetId() )
- return *iter;
- }
- return NULL;
-}
-
-ScDPTableDataCache* ScDocument::GetUsedDPObjectCache ( ScRange rRange )
-{
- ScDPTableDataCache* pCache = NULL;
- sal_uInt16 nCount = GetDPCollection()->GetCount();
- for ( short i=nCount-1; i>=0 ; i--)
- {
- if ( const ScSheetSourceDesc* pUsedSheetDesc = (*pDPCollection)[i]->GetSheetDesc() )
- if ( rRange == pUsedSheetDesc->aSourceRange )
- {
- long nID = (*pDPCollection)[i]->GetCacheId();
- if ( nID >= 0 )
- pCache= GetDPObjectCache( nID );
- if ( pCache )
- return pCache;
- }
- }
- return pCache;
-}
-
-long ScDocument::AddDPObjectCache( ScDPTableDataCache* pData )
-{
- if ( pData->GetId() < 0 )
- { //create a id for it
- pData->SetId( GetNewDPObjectCacheId() );
- }
- m_listDPObjectsCaches.push_back( pData );
- return pData->GetId();
-}
-
-long ScDocument::GetNewDPObjectCacheId()
-{
- long nID = 0;
-
- bool bFound = false;
- std::list<ScDPTableDataCache*>::iterator iter;
- do {
- for ( iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ )
- { //Get a new Id
- if ( nID == (*iter)->GetId() )
- {
- nID++;
- bFound = true;
- break;
- }
- }
- if ( iter == m_listDPObjectsCaches.end() )
- bFound = false;
- } while ( bFound );
-
- return nID;
-}
-
-void ScDocument::RemoveDPObjectCache( long nID )
-{
- for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ )
- {
- if ( nID == (*iter)->GetId() )
- {
- ScDPTableDataCache* pCache = *iter;
- m_listDPObjectsCaches.erase( iter );
- delete pCache;
- break;
- }
- }
-
-}
-
-void ScDocument::RemoveUnusedDPObjectCaches()
-{
- for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ )
- {
- long nID = (*iter)->GetId();
- sal_uInt16 nCount = GetDPCollection()->GetCount();
- sal_uInt16 i ;
- for ( i=0; i<nCount; i++)
- {
- if ( nID == (*pDPCollection)[i]->GetCacheId() )
- break;
- }
- if ( i == nCount )
- {
- ScDPTableDataCache* pCache = *iter;
- m_listDPObjectsCaches.erase( iter );
- delete pCache;
- continue;
- }
- }
-}
-
-void ScDocument::GetUsedDPObjectCache( std::list<ScDPTableDataCache*>& usedlist )
-{
- for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); iter++ )
- {
- long nID = (*iter)->GetId();
- sal_uInt16 nCount = GetDPCollection()->GetCount();
- sal_uInt16 i=0;
- for ( i=0; i<nCount; i++)
- if ( nID == (*pDPCollection)[i]->GetCacheId() )
- break;
- if ( i != nCount )
- usedlist.push_back( *iter );
- }
-}
-// End Comments
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index c9e19a63f81d..1958bf721a4c 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,7 +66,7 @@ sal_Bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
SCCOL nVCol, SCROW nVRow, SCTAB nVTab,
const String& sValStr, double& nX)
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
nX = 0.0;
if (ValidColRow(nFCol, nFRow) && ValidColRow(nVCol, nVRow) &&
VALIDTAB(nFTab) && VALIDTAB(nVTab) && pTab[nFTab] && pTab[nVTab])
@@ -134,7 +135,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
SCCOL j;
SCROW k;
i = 0;
- sal_Bool bStop = sal_False;
+ sal_Bool bStop = false;
while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden
{
if (pTab[i] && rMark.GetTableSelect(i))
@@ -146,7 +147,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
if (i == MAXTAB + 1)
{
Sound::Beep();
- DBG_ERROR("ScDocument::InsertMatrixFormula Keine Tabelle markiert");
+ OSL_FAIL("ScDocument::InsertMatrixFormula Keine Tabelle markiert");
return;
}
@@ -221,7 +222,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
SCCOL j;
SCROW k;
i = 0;
- sal_Bool bStop = sal_False;
+ sal_Bool bStop = false;
while (i <= MAXTAB && !bStop) // erste markierte Tabelle finden
{
if (pTab[i] && rMark.GetTableSelect(i))
@@ -233,7 +234,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
if (i == MAXTAB + 1)
{
Sound::Beep();
- DBG_ERROR("ScDocument::InsertTableOp: Keine Tabelle markiert");
+ OSL_FAIL("ScDocument::InsertTableOp: Keine Tabelle markiert");
return;
}
@@ -245,12 +246,12 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
const String& sSep = ScCompiler::GetNativeSymbol( ocSep);
if (rParam.nMode == 0) // nur Spalte
{
- aRef.Set( rParam.aRefFormulaCell.GetAddress(), sal_True, sal_False, sal_False );
+ aRef.Set( rParam.aRefFormulaCell.GetAddress(), sal_True, false, false );
aForString += aRef.GetRefString(this, nTab1);
aForString += sSep;
aForString += rParam.aRefColCell.GetRefString(this, nTab1);
aForString += sSep;
- aRef.Set( nCol1, nRow1, nTab1, sal_False, sal_True, sal_True );
+ aRef.Set( nCol1, nRow1, nTab1, false, sal_True, sal_True );
aForString += aRef.GetRefString(this, nTab1);
nCol1++;
nCol2 = Min( nCol2, (SCCOL)(rParam.aRefFormulaEnd.Col() -
@@ -258,12 +259,12 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
}
else if (rParam.nMode == 1) // nur zeilenweise
{
- aRef.Set( rParam.aRefFormulaCell.GetAddress(), sal_False, sal_True, sal_False );
+ aRef.Set( rParam.aRefFormulaCell.GetAddress(), false, sal_True, false );
aForString += aRef.GetRefString(this, nTab1);
aForString += sSep;
aForString += rParam.aRefRowCell.GetRefString(this, nTab1);
aForString += sSep;
- aRef.Set( nCol1, nRow1, nTab1, sal_True, sal_False, sal_True );
+ aRef.Set( nCol1, nRow1, nTab1, sal_True, false, sal_True );
aForString += aRef.GetRefString(this, nTab1);
nRow1++;
nRow2 = Min( nRow2, (SCROW)(rParam.aRefFormulaEnd.Row() -
@@ -275,12 +276,12 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
aForString += sSep;
aForString += rParam.aRefColCell.GetRefString(this, nTab1);
aForString += sSep;
- aRef.Set( nCol1, nRow1 + 1, nTab1, sal_False, sal_True, sal_True );
+ aRef.Set( nCol1, nRow1 + 1, nTab1, false, sal_True, sal_True );
aForString += aRef.GetRefString(this, nTab1);
aForString += sSep;
aForString += rParam.aRefRowCell.GetRefString(this, nTab1);
aForString += sSep;
- aRef.Set( nCol1 + 1, nRow1, nTab1, sal_True, sal_False, sal_True );
+ aRef.Set( nCol1 + 1, nRow1, nTab1, sal_True, false, sal_True );
aForString += aRef.GetRefString(this, nTab1);
nCol1++; nRow1++;
}
@@ -305,7 +306,7 @@ bool ScDocument::MarkUsedExternalReferences( ScTokenArray & rArr )
ScToken* t;
while (!bAllMarked && (t = static_cast<ScToken*>(rArr.GetNextReferenceOrName())) != NULL)
{
- if (t->GetOpCode() == ocExternalRef)
+ if (t->IsExternalRef())
{
if (!pRefMgr)
pRefMgr = GetExternalRefManager();
@@ -343,7 +344,7 @@ sal_Bool ScDocument::GetNextSpellingCell(SCCOL& nCol, SCROW& nRow, SCTAB nTab,
if (ValidTab(nTab) && pTab[nTab])
return pTab[nTab]->GetNextSpellingCell( nCol, nRow, bInSel, rMark );
else
- return sal_False;
+ return false;
}
sal_Bool ScDocument::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, SCTAB nTab,
@@ -352,7 +353,7 @@ sal_Bool ScDocument::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, SCTAB nTab,
if (ValidTab(nTab) && pTab[nTab])
return pTab[nTab]->GetNextMarkedCell( rCol, rRow, rMark );
else
- return sal_False;
+ return false;
}
sal_Bool ScDocument::ReplaceStyle(const SvxSearchItem& rSearchItem,
@@ -363,7 +364,7 @@ sal_Bool ScDocument::ReplaceStyle(const SvxSearchItem& rSearchItem,
if (pTab[nTab])
return pTab[nTab]->ReplaceStyle(rSearchItem, nCol, nRow, rMark, bIsUndoP);
else
- return sal_False;
+ return false;
}
void ScDocument::CompileDBFormula()
@@ -407,7 +408,7 @@ void ScDocument::DoColResize( SCTAB nTab, SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd
pTab[nTab]->DoColResize( nCol1, nCol2, nAdd );
else
{
- DBG_ERROR("DoColResize: falsche Tabelle");
+ OSL_FAIL("DoColResize: falsche Tabelle");
}
}
@@ -633,7 +634,7 @@ const SfxPoolItem* ScDocument::GetEffItem(
}
return &rSet.Get( nWhich );
}
- DBG_ERROR("kein Pattern");
+ OSL_FAIL("kein Pattern");
return NULL;
}
@@ -665,7 +666,7 @@ const ScConditionalFormat* ScDocument::GetCondFormat(
return pCondFormList->GetFormat( nIndex );
else
{
- DBG_ERROR("pCondFormList ist 0");
+ OSL_FAIL("pCondFormList ist 0");
}
}
@@ -858,12 +859,12 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW
SCCOLROW nOtherRow = 0;
sal_uInt16 nComp;
SCCOLROW nThisRow;
- sal_Bool bTotal = sal_False; // ueber verschiedene nThisRow beibehalten
+ sal_Bool bTotal = false; // ueber verschiedene nThisRow beibehalten
SCCOLROW nUnknown = 0;
for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++)
{
SCCOLROW nTempOther = nOtherRow;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 nBest = SC_DOCCOMP_MAXDIFF;
SCCOLROW nMax = Min( nOtherEndRow, static_cast<SCCOLROW>(( nTempOther + nMaxCont + nUnknown )) );
for (SCCOLROW i=nTempOther; i<=nMax && nBest>0; i++) // bei 0 abbrechen
@@ -879,7 +880,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW
bFound = sal_True;
}
if ( nComp < SC_DOCCOMP_MAXDIFF || bFound )
- bTotal = sal_False;
+ bTotal = false;
else if ( i == nTempOther && bUseTotal )
bTotal = sal_True; // nur ganz oben
}
@@ -903,7 +904,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW
SCROW nFillStart = 0;
SCROW nFillPos = 0;
- sal_Bool bInFill = sal_False;
+ sal_Bool bInFill = false;
for (nThisRow = 0; nThisRow <= nThisEndRow+1; nThisRow++)
{
SCROW nThisOther = ( nThisRow <= nThisEndRow ) ? pOtherRows[nThisRow] : (nOtherEndRow+1);
@@ -920,7 +921,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW
pOtherRows[nFillPos+i] = nFillStart+i;
}
- bInFill = sal_False;
+ bInFill = false;
}
nFillStart = nThisOther + 1;
nFillPos = nThisRow + 1;
@@ -962,7 +963,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
// auffuellen, damit einzeln umbenannte Tabellen nicht wegfallen
SCTAB nFillStart = 0;
SCTAB nFillPos = 0;
- sal_Bool bInFill = sal_False;
+ sal_Bool bInFill = false;
for (nThisTab = 0; nThisTab <= nThisCount; nThisTab++)
{
SCTAB nThisOther = ( nThisTab < nThisCount ) ? pOtherTabs[nThisTab] : nOtherCount;
@@ -980,7 +981,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
pOtherTabs[nFillPos+i] = nFillStart+i;
}
- bInFill = sal_False;
+ bInFill = false;
}
nFillStart = nThisOther + 1;
nFillPos = nThisTab + 1;
@@ -1034,12 +1035,12 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
//! Spalten vergleichen zweimal mit unterschiedlichem nMinGood ???
// 1
- FindOrder( pTempRows, nThisEndRow, nOtherEndRow, sal_False,
+ FindOrder( pTempRows, nThisEndRow, nOtherEndRow, false,
rOtherDoc, nThisTab, nOtherTab, nEndCol, NULL, &aProgress, 0 );
// 2
FindOrder( pOtherCols, nThisEndCol, nOtherEndCol, sal_True,
rOtherDoc, nThisTab, nOtherTab, nEndRow, NULL, NULL, 0 );
- FindOrder( pOtherRows, nThisEndRow, nOtherEndRow, sal_False,
+ FindOrder( pOtherRows, nThisEndRow, nOtherEndRow, false,
rOtherDoc, nThisTab, nOtherTab, nThisEndCol,
pOtherCols, &aProgress, nThisEndRow );
@@ -1201,3 +1202,4 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index fd8d9936683f..a737a5966764 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,11 +49,6 @@
#include <svx/svdoole2.hxx>
#include <svx/svdpage.hxx>
-//REMOVE #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED
-//REMOVE #define SO2_DECL_SVINPLACEOBJECT_DEFINED
-//REMOVE SO2_DECL_REF(SvInPlaceObject)
-//REMOVE #endif
-
#include "document.hxx"
#include "drwlayer.hxx"
#include "chartarr.hxx"
@@ -112,16 +108,16 @@ void lcl_SetChartParameters( const uno::Reference< chart2::data::XDataReceiver >
{
uno::Sequence< beans::PropertyValue > aArgs( 4 );
aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellRangeRepresentation")), -1,
uno::makeAny( rRanges ), beans::PropertyState_DIRECT_VALUE );
aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1,
uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE );
aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstCellAsLabel")), -1,
uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE );
aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataRowSource")), -1,
uno::makeAny( eDataRowSource ), beans::PropertyState_DIRECT_VALUE );
xReceiver->setArguments( aArgs );
}
@@ -237,7 +233,7 @@ sal_Bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pNa
if (pName)
pName->Erase();
- return sal_False; // nix gefunden
+ return false; // nothing found
}
void ScDocument::UpdateChartArea( const String& rChartName,
@@ -400,9 +396,8 @@ void ScDocument::UpdateChartArea( const String& rChartName,
aNewRanges = new ScRangeList;
aNewRanges->Parse( aRangesStr, this );
- sal_uLong nAddCount = rNewList->Count();
- for ( sal_uLong nAdd=0; nAdd<nAddCount; nAdd++ )
- aNewRanges->Append( *rNewList->GetObject(nAdd) );
+ for ( size_t nAdd = 0, nAddCount = rNewList->size(); nAdd < nAddCount; ++nAdd )
+ aNewRanges->Append( *(*rNewList)[nAdd] );
}
else
{
@@ -438,10 +433,7 @@ void ScDocument::UpdateChartArea( const String& rChartName,
pChartListenerCollection->ChangeListening( rChartName, aNewRanges );
- // ((SdrOle2Obj*)pObject)->GetNewReplacement();
- // pObject->ActionChanged();
-
- return; // nicht weitersuchen
+ return; // do not search anymore
}
}
pObject = aIter.Next();
@@ -521,10 +513,11 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode,
(ScChartListener*) (pChartListenerCollection->At(nIndex));
ScRangeListRef aRLR( pChartListener->GetRangeList() );
ScRangeListRef aNewRLR( new ScRangeList );
- sal_Bool bChanged = sal_False;
- sal_Bool bDataChanged = sal_False;
- for ( ScRangePtr pR = aRLR->First(); pR; pR = aRLR->Next() )
+ sal_Bool bChanged = false;
+ sal_Bool bDataChanged = false;
+ for ( size_t i = 0, nListSize = aRLR->size(); i < nListSize; ++i )
{
+ ScRange* pR = (*aRLR)[i];
SCCOL theCol1 = pR->aStart.Col();
SCROW theRow1 = pR->aStart.Row();
SCTAB theTab1 = pR->aStart.Tab();
@@ -561,19 +554,7 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode,
}
if ( bChanged )
{
-#if 0
- if ( nDz != 0 )
- { // #81844# sheet to be deleted or inserted or moved
- // => no valid sheet names for references right now
- pChartListener->ChangeListening( aNewRLR, bDataChanged );
- pChartListener->ScheduleSeriesRanges();
- }
- else
-#endif
{
-// SetChartRangeList( pChartListener->GetString(), aNewRLR );
-// pChartListener->ChangeListening( aNewRLR, bDataChanged );
-
// Force the chart to be loaded now, so it registers itself for UNO events.
// UNO broadcasts are done after UpdateChartRef, so the chart will get this
// reference change.
@@ -661,7 +642,7 @@ sal_Bool ScDocument::HasData( SCCOL nCol, SCROW nRow, SCTAB nTab )
if (pTab[nTab])
return pTab[nTab]->HasData( nCol, nRow );
else
- return sal_False;
+ return false;
}
uno::Reference< embed::XEmbeddedObject >
@@ -703,7 +684,7 @@ uno::Reference< embed::XEmbeddedObject >
sal_Bool lcl_StringInCollection( const ScStrCollection* pColl, const String& rStr )
{
if ( !pColl )
- return sal_False;
+ return false;
StrData aData( rStr );
sal_uInt16 nDummy;
@@ -712,13 +693,13 @@ sal_Bool lcl_StringInCollection( const ScStrCollection* pColl, const String& rSt
void ScDocument::UpdateChartListenerCollection()
{
- bChartListenerCollectionNeedsUpdate = sal_False;
+ bChartListenerCollectionNeedsUpdate = false;
if (!pDrawLayer)
return;
else
{
ScRange aRange;
- // Range fuer Suche unwichtig
+ // Range for searching is not important
ScChartListener aCLSearcher( EMPTY_STRING, this, aRange );
for (SCTAB nTab=0; nTab<=MAXTAB; nTab++)
{
@@ -767,20 +748,13 @@ void ScDocument::UpdateChartListenerCollection()
// unable to set the data. So a chart from the
// same document is treated like a chart with
// own data for the time being.
-#if 0
+
// data provider
- uno::Reference< chart2::data::XDataProvider > xDataProvider = new
- ScChart2DataProvider( this );
- xReceiver->attachDataProvider( xDataProvider );
// number formats supplier
- uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( pShell->GetModel(), uno::UNO_QUERY );
- xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
+
// data ?
// how to set?? Defined in XML-file, which is already loaded!!!
// => we have to do this stuff here, BEFORE the chart is actually loaded
-
- bIsChart = true;
-#endif
}
if (!bIsChart)
@@ -813,4 +787,4 @@ void ScDocument::AddOLEObjectToCollection(const String& rName)
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx
index 6b0c8d3bee41..f747788977cf 100644
--- a/sc/source/core/data/documen6.cxx
+++ b/sc/source/core/data/documen6.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ const uno::Reference< i18n::XBreakIterator >& ScDocument::GetBreakIterator()
if ( !pScriptTypeData->xBreakIter.is() )
{
uno::Reference< uno::XInterface > xInterface = xServiceManager->createInstance(
- ::rtl::OUString::createFromAscii( SC_BREAKITER_SERVICE ) );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_BREAKITER_SERVICE )) );
pScriptTypeData->xBreakIter = uno::Reference< i18n::XBreakIterator >( xInterface, uno::UNO_QUERY );
DBG_ASSERT( pScriptTypeData->xBreakIter.is(), "can't get BreakIterator" );
}
@@ -92,7 +93,7 @@ sal_Bool ScDocument::HasStringWeakCharacters( const String& rString )
}
}
- return sal_False; // none found
+ return false; // none found
}
sal_uInt8 ScDocument::GetStringScriptType( const String& rString )
@@ -181,4 +182,4 @@ sal_uInt8 ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseC
return GetCellScriptType( pCell, nFormat );
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index b1084ddeecfd..3bbfde5b31a1 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,13 +33,6 @@
#include <vcl/svapp.hxx>
-#if defined( WNT ) && defined( erBEEP )
-#include <svwin.h>
-#define erBEEPER() Beep( 666, 66 )
-#else
-#define erBEEPER()
-#endif
-
#include "document.hxx"
#include "brdcst.hxx"
#include "bcaslot.hxx"
@@ -62,11 +56,6 @@ extern const ScFormulaCell* pLastFormulaTreeTop; // cellform.cxx Err527 WorkA
// STATIC DATA -----------------------------------------------------------
-#ifdef erDEBUG
-sal_uLong erCountBCAInserts = 0;
-sal_uLong erCountBCAFinds = 0;
-#endif
-
// -----------------------------------------------------------------------
void ScDocument::StartListeningArea( const ScRange& rRange,
@@ -105,7 +94,7 @@ void ScDocument::Broadcast( const ScHint& rHint )
if ( !nHardRecalcState )
{
ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast
- sal_Bool bIsBroadcasted = sal_False;
+ sal_Bool bIsBroadcasted = false;
ScBaseCell* pCell = rHint.GetCell();
if ( pCell )
{
@@ -128,7 +117,7 @@ void ScDocument::Broadcast( const ScHint& rHint )
{
SCTAB nTab = rHint.GetAddress().Tab();
if (pTab[nTab] && pTab[nTab]->IsStreamValid())
- pTab[nTab]->SetStreamValid(sal_False);
+ pTab[nTab]->SetStreamValid(false);
}
}
@@ -283,7 +272,7 @@ void ScDocument::CalcFormulaTree( sal_Bool bOnlyForced, sal_Bool bNoProgress )
return ;
bCalculatingFormulaTree = sal_True;
- SetForcedFormulaPending( sal_False );
+ SetForcedFormulaPending( false );
sal_Bool bOldIdleDisabled = IsIdleDisabled();
DisableIdle( sal_True );
sal_Bool bOldAutoCalc = GetAutoCalc();
@@ -377,7 +366,7 @@ void ScDocument::CalcFormulaTree( sal_Bool bOnlyForced, sal_Bool bNoProgress )
}
bAutoCalc = bOldAutoCalc;
DisableIdle( bOldIdleDisabled );
- bCalculatingFormulaTree = sal_False;
+ bCalculatingFormulaTree = false;
}
@@ -452,7 +441,6 @@ void ScDocument::TrackFormulas( sal_uLong nHintId )
if ( pFormulaTrack )
{
- erBEEPER();
// outside the loop, check if any sheet has a "calculate" event script
bool bCalcEvent = HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE, true );
SvtBroadcaster* pBC;
@@ -474,7 +462,7 @@ void ScDocument::TrackFormulas( sal_uLong nHintId )
pTrack = pTrack->GetNextTrack();
} while ( pTrack );
pTrack = pFormulaTrack;
- sal_Bool bHaveForced = sal_False;
+ sal_Bool bHaveForced = false;
do
{
pNext = pTrack->GetNextTrack();
@@ -532,3 +520,4 @@ void ScDocument::SetAutoCalc( sal_Bool bNewAutoCalc )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 385939738d81..cec0c0c45ca0 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,6 +94,7 @@
#include "globstr.hrc"
#include "sc.hrc"
#include "charthelper.hxx"
+#include "macromgr.hxx"
#include "dpobject.hxx"
#include "docuno.hxx"
@@ -173,7 +175,7 @@ void ScDocument::SetPrinter( SfxPrinter* pNewPrinter )
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
delete pOld;
}
- InvalidateTextWidth(NULL, NULL, sal_False); // in both cases
+ InvalidateTextWidth(NULL, NULL, false); // in both cases
}
//------------------------------------------------------------------------
@@ -206,9 +208,6 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
{
if (!pVirtualDevice_100th_mm)
{
-// pVirtualDevice_100th_mm = new VirtualDevice;
-// pVirtualDevice_100th_mm->SetMapMode( MAP_100TH_MM );
-
pVirtualDevice_100th_mm = new VirtualDevice( 1 );
pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1);
MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
@@ -267,7 +266,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
for (SCTAB nTab=0; nTab<=MAXTAB; ++nTab)
if (pTab[nTab] && pTab[nTab]->IsStreamValid())
- pTab[nTab]->SetStreamValid( sal_False );
+ pTab[nTab]->SetStreamValid( false );
sal_uLong nOldFormat =
((const SfxUInt32Item*)&rSet.Get(
@@ -292,7 +291,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
for (sal_uInt16 nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++)
{
const SfxPoolItem* pItem;
- SfxItemState eState = rChanges.GetItemState( nWhich, sal_False, &pItem );
+ SfxItemState eState = rChanges.GetItemState( nWhich, false, &pItem );
if ( eState == SFX_ITEM_SET )
rSet.Put( *pItem );
else if ( eState == SFX_ITEM_DONTCARE )
@@ -316,7 +315,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
void ScDocument::CopyStdStylesFrom( ScDocument* pSrcDoc )
{
- // #b5017505# number format exchange list has to be handled here, too
+ // number format exchange list has to be handled here, too
NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc);
xPoolHelper->GetStylePool()->CopyStdStylesFrom( pSrcDoc->xPoolHelper->GetStylePool() );
}
@@ -337,14 +336,14 @@ void ScDocument::InvalidateTextWidth( SCTAB nTab )
{
ScAddress aAdrFrom( 0, 0, nTab );
ScAddress aAdrTo ( MAXCOL, MAXROW, nTab );
- InvalidateTextWidth( &aAdrFrom, &aAdrTo, sal_False );
+ InvalidateTextWidth( &aAdrFrom, &aAdrTo, false );
}
//------------------------------------------------------------------------
sal_Bool ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab )
{
- sal_Bool bInUse = sal_False;
+ sal_Bool bInUse = false;
const SCTAB nCount = GetTableCount();
SCTAB i;
@@ -361,7 +360,7 @@ sal_Bool ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTa
sal_Bool ScDocument::RemovePageStyleInUse( const String& rStyle )
{
- sal_Bool bWasInUse = sal_False;
+ sal_Bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
for ( SCTAB i=0; i<nCount && pTab[i]; i++ )
@@ -376,7 +375,7 @@ sal_Bool ScDocument::RemovePageStyleInUse( const String& rStyle )
sal_Bool ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew )
{
- sal_Bool bWasInUse = sal_False;
+ sal_Bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
for ( SCTAB i=0; i<nCount && pTab[i]; i++ )
@@ -413,6 +412,13 @@ sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const
return sal::static_int_cast<sal_uInt8>(eRet);
}
+ScMacroManager* ScDocument::GetMacroManager()
+{
+ if (!mpMacroMgr.get())
+ mpMacroMgr.reset(new ScMacroManager(this));
+ return mpMacroMgr.get();
+}
+
//------------------------------------------------------------------------
void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
@@ -445,16 +451,11 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress
sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wieder versuchen
{
// #i75610# if a printer hasn't been set or created yet, don't create one for this
- if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(sal_False) == NULL )
- return sal_False;
+ if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(false) == NULL )
+ return false;
bIdleDisabled = sal_True;
-// sal_uLong nMs = 0;
-// sal_uInt16 nIter = 0;
-
const sal_uLong nStart = Time::GetSystemTicks();
- double nPPTX = 0.0;
- double nPPTY = 0.0;
OutputDevice* pDev = NULL;
MapMode aOldMap;
ScStyleSheet* pStyle = NULL;
@@ -465,9 +466,7 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
SCTAB nTab = aCurTextWidthCalcPos.Tab();
SCROW nRow = aCurTextWidthCalcPos.Row();
SCsCOL nCol = aCurTextWidthCalcPos.Col();
- sal_uInt16 nRestart = 0;
- sal_uInt16 nZoom = 0;
- sal_Bool bNeedMore= sal_False;
+ sal_Bool bNeedMore= false;
if ( !ValidRow(nRow) )
nRow = 0, nCol--;
@@ -476,8 +475,6 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
if ( !ValidTab(nTab) || !pTab[nTab] )
nTab = 0;
-// DBG_ERROR( String("Start = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) );
-
// SearchMask/Family muss gemerkt werden,
// damit z.B. der Organizer nicht durcheinanderkommt, wenn zwischendurch eine
// Query-Box aufgemacht wird !!!
@@ -493,9 +490,11 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
DBG_ASSERT( pStyle, "Missing StyleSheet :-/" );
- sal_Bool bProgress = sal_False;
+ sal_Bool bProgress = false;
if ( pStyle && 0 == GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALETOPAGES) )
{
+ sal_uInt16 nRestart = 0;
+ sal_uInt16 nZoom = 0;
sal_uInt16 nCount = 0;
nZoom = GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE);
@@ -509,6 +508,8 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
{
if ( TEXTWIDTH_DIRTY == pCell->GetTextWidth() )
{
+ double nPPTX = 0.0;
+ double nPPTY = 0.0;
if ( !pDev )
{
pDev = GetPrinter();
@@ -522,20 +523,15 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
if ( !bProgress && pCell->GetCellType() == CELLTYPE_FORMULA
&& ((ScFormulaCell*)pCell)->GetDirty() )
{
- ScProgress::CreateInterpretProgress( this, sal_False );
+ ScProgress::CreateInterpretProgress( this, false );
bProgress = sal_True;
}
-// DBG_ERROR( String("t,c,r = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) );
-// DBG_ERROR( String("nOldWidth = ") + String(pCell->GetTextWidth()) );
-
sal_uInt16 nNewWidth = (sal_uInt16)GetNeededSize( nCol, nRow, nTab,
pDev, nPPTX, nPPTY,
aZoomFract,aZoomFract, sal_True,
sal_True ); // bTotalSize
-// DBG_ERROR( String("nNewWidth = ") + String(nNewWidth) );
-
pCell->SetTextWidth( nNewWidth );
bNeedMore = sal_True;
@@ -543,7 +539,7 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
}
else
{
- sal_Bool bNewTab = sal_False;
+ sal_Bool bNewTab = false;
nRow = 0;
nCol--;
@@ -580,7 +576,7 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
}
else
{
- DBG_ERROR( "Missing StyleSheet :-/" );
+ OSL_FAIL( "Missing StyleSheet :-/" );
}
}
@@ -596,15 +592,12 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
}
}
-// nIter = nCount;
-
nCount++;
// Idle Berechnung abbrechen, wenn Berechnungen laenger als
// 50ms dauern, oder nach 32 Berechnungen mal nachschauen, ob
// bestimmte Events anstehen, die Beachtung wuenschen:
-// nMs = SysTicksToMs( GetSysTicks() - nStart );
if ( ( 50L < Time::GetSystemTicks() - nStart )
|| ( !(nCount&31) && Application::AnyInput( ABORT_EVENTS ) ) )
@@ -619,8 +612,6 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
delete pColIter;
-// DBG_ERROR( String(nCount) + String(" End = ") + String(nTab) + String(',') + String(nCol) + String(',') + String(nRow) );
-
if (pDev)
pDev->SetMapMode(aOldMap);
@@ -628,10 +619,8 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie
aCurTextWidthCalcPos.SetRow( nRow );
aCurTextWidthCalcPos.SetCol( (SCCOL)nCol );
-// DBG_ERROR( String(nMs) + String(" ms (") + String(nIter) + String(')') );
-
pStylePool->SetSearchMask( eOldFam, nOldMask );
- bIdleDisabled = sal_False;
+ bIdleDisabled = false;
return bNeedMore;
}
@@ -643,7 +632,7 @@ class ScSpellStatus
public:
sal_Bool bModified;
- ScSpellStatus() : bModified(sal_False) {};
+ ScSpellStatus() : bModified(false) {};
DECL_LINK (EventHdl, EditStatus*);
};
@@ -677,7 +666,7 @@ sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress&
sal_uInt16 nCellCount = 0; // Zellen insgesamt
sal_uInt16 nTestCount = 0; // Aufrufe Spelling
- sal_Bool bChanged = sal_False; // Aenderungen?
+ sal_Bool bChanged = false; // Aenderungen?
SCCOL nCol = rSpellRange.aStart.Col(); // iterator always starts on the left edge
SCROW nRow = rSpellPos.Row();
@@ -689,7 +678,7 @@ sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress&
if ( !pTab[nTab] )
{
// may happen for visible range
- return sal_False;
+ return false;
}
}
ScHorizontalCellIterator aIter( this, nTab,
@@ -711,7 +700,7 @@ sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress&
{
if (!pEngine)
{
- // #71154# ScTabEditEngine is needed
+ // ScTabEditEngine is needed
// because MapMode must be set for some old documents
pEngine = new ScTabEditEngine( this );
pEngine->SetControlWord( pEngine->GetControlWord() |
@@ -729,7 +718,7 @@ sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress&
const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
pPattern->FillEditItemSet( pDefaults );
- pEngine->SetDefaults( pDefaults, sal_False ); //! noetig ?
+ pEngine->SetDefaults( pDefaults, false ); //! noetig ?
sal_uInt16 nCellLang = ((const SvxLanguageItem&)
pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue();
@@ -746,7 +735,7 @@ sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress&
else
pEngine->SetText( *((ScEditCell*)pCell)->GetData() );
- aStatus.bModified = sal_False;
+ aStatus.bModified = false;
pEngine->CompleteOnlineSpelling();
if ( aStatus.bModified ) // Fehler dazu oder weggekommen?
{
@@ -774,10 +763,10 @@ sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress&
// Paint
if (pShell)
{
- // #47751# Seitenvorschau ist davon nicht betroffen
+ // Seitenvorschau ist davon nicht betroffen
// (sollte jedenfalls nicht)
ScPaintHint aHint( ScRange( nCol, nRow, nTab ), PAINT_GRID );
- aHint.SetPrintFlag( sal_False );
+ aHint.SetPrintFlag( false );
pShell->Broadcast( aHint );
}
@@ -826,7 +815,7 @@ sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress&
sal_Bool ScDocument::ContinueOnlineSpelling()
{
if ( bIdleDisabled || !pDocOptions->IsAutoSpell() || (pShell && pShell->IsReadOnly()) )
- return sal_False;
+ return false;
// #i48433# set bInsertingFromOtherDoc flag so there are no broadcasts when PutCell is called
// (same behavior as in RemoveAutoSpellObj: just transfer the broadcaster)
@@ -835,7 +824,7 @@ sal_Bool ScDocument::ContinueOnlineSpelling()
//! use one EditEngine for both calls
- // #41504# first check visible range
+ // first check visible range
sal_Bool bResult = OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_VIS );
// during first pass through visible range, always continue
@@ -917,7 +906,7 @@ void ScDocument::RepaintRange( const ScRange& rRange )
sal_Bool ScDocument::IdleCheckLinks() // sal_True = demnaechst wieder versuchen
{
- sal_Bool bAnyLeft = sal_False;
+ sal_Bool bAnyLeft = false;
if (GetLinkManager())
{
@@ -1007,7 +996,7 @@ sal_Bool ScDocument::HasDdeLinks() const
return sal_True;
}
- return sal_False;
+ return false;
}
void ScDocument::SetInLinkUpdate(sal_Bool bSet)
@@ -1070,9 +1059,9 @@ void ScDocument::UpdateDdeLinks()
sal_uInt16 nCount = rLinks.Count();
sal_uInt16 i;
- // #49226# falls das Updaten laenger dauert, erstmal alle Werte
+ // falls das Updaten laenger dauert, erstmal alle Werte
// zuruecksetzen, damit nichts altes (falsches) stehen bleibt
- sal_Bool bAny = sal_False;
+ sal_Bool bAny = false;
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
@@ -1100,6 +1089,7 @@ void ScDocument::UpdateDdeLinks()
if (pBase->ISA(ScDdeLink))
((ScDdeLink*)pBase)->TryUpdate(); // bei DDE-Links TryUpdate statt Update
}
+ pLinkManager->CloseCachedComps();
}
}
@@ -1109,7 +1099,7 @@ sal_Bool ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, c
// ResetValue() fuer einzelnen Link nicht noetig
//! wenn's mal alles asynchron wird, aber auch hier
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
@@ -1129,6 +1119,7 @@ sal_Bool ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, c
}
}
}
+ pLinkManager->CloseCachedComps();
}
return bFound;
}
@@ -1286,7 +1277,7 @@ const ScMatrix* ScDocument::GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const
return pDdeLink ? pDdeLink->GetResult() : NULL;
}
-bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrix* pResults )
+bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrixRef pResults )
{
/* Create a DDE link without updating it (i.e. for Excel import), to prevent
unwanted connections. First try to find existing link. Set result array
@@ -1312,7 +1303,7 @@ bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const
return false;
}
-bool ScDocument::SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrix* pResults )
+bool ScDocument::SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults )
{
if( ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
@@ -1335,7 +1326,7 @@ sal_Bool ScDocument::HasAreaLinks() const
return sal_True;
}
- return sal_False;
+ return false;
}
void ScDocument::UpdateAreaLinks()
@@ -1634,3 +1625,4 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
delete pEngine;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 534c2333bd9b..ece0deb81347 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,7 +129,7 @@ void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDes
}
}
- // #71726# make sure the data references of charts are adapted
+ // make sure the data references of charts are adapted
// (this must be after InsertObject!)
ScChartHelper::AdjustRangesOfChartsOnDestinationPage( pSrcDoc, this, nSrcPos, nDestPos );
}
@@ -138,12 +139,10 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
if (pDocShell && !pShell)
pShell = pDocShell;
-// DBG_ASSERT(pShell,"InitDrawLayer ohne Shell");
-
if (!pDrawLayer)
{
String aName;
- if ( pShell && !pShell->IsLoading() ) // #88438# don't call GetTitle while loading
+ if ( pShell && !pShell->IsLoading() ) // don't call GetTitle while loading
aName = pShell->GetTitle();
pDrawLayer = new ScDrawLayer( this, aName );
if (GetLinkManager())
@@ -168,12 +167,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
pTab[nTab]->GetName(aTabName);
pDrawLayer->ScRenamePage( nTab, aTabName );
- pTab[nTab]->SetDrawPageSize(false,false); // #54782# set the right size immediately
-#if 0
- sal_uLong nx = (sal_uLong) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS );
- sal_uLong ny = (sal_uLong) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS );
- pDrawLayer->SetPageSize( nTab, Size( nx, ny ) );
-#endif
+ pTab[nTab]->SetDrawPageSize(false,false); // set the right size immediately
}
}
@@ -183,7 +177,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
UpdateDrawDefaults();
UpdateDrawLanguages();
if (bImportingXML)
- pDrawLayer->EnableAdjust(sal_False);
+ pDrawLayer->EnableAdjust(false);
pDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters );
pDrawLayer->SetCharCompressType( GetAsianCompression() );
@@ -219,13 +213,18 @@ void ScDocument::UpdateDrawPrinter()
{
// use the printer even if IsValid is false
// Application::GetDefaultDevice causes trouble with changing MapModes
-
-// OutputDevice* pRefDev = GetPrinter();
-// pRefDev->SetMapMode( MAP_100TH_MM );
pDrawLayer->SetRefDevice(GetRefDevice());
}
}
+void ScDocument::SetDrawPageSize(SCTAB nTab)
+{
+ if (!ValidTab(nTab) || !pTab[nTab])
+ return;
+
+ pTab[nTab]->SetDrawPageSize();
+}
+
sal_Bool ScDocument::IsChart( const SdrObject* pObject )
{
// #109985#
@@ -235,7 +234,7 @@ sal_Bool ScDocument::IsChart( const SdrObject* pObject )
return ((SdrOle2Obj*)pObject)->IsChart();
}
- return sal_False;
+ return false;
}
IMPL_LINK_INLINE_START( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex )
@@ -267,7 +266,7 @@ void ScDocument::DrawMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos )
void ScDocument::DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos )
{
// angelegt wird die Page schon im ScTable ctor
- pDrawLayer->ScCopyPage( nOldPos, nNewPos, sal_False );
+ pDrawLayer->ScCopyPage( nOldPos, nNewPos, false );
}
void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
@@ -295,7 +294,7 @@ sal_Bool ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkDat
// pTabMark is used only for selected tables. If pTabMark is 0, all tables of rRange are used.
if (!pDrawLayer)
- return sal_False;
+ return false;
SCTAB nStartTab = 0;
SCTAB nEndTab = MAXTAB;
@@ -330,7 +329,7 @@ sal_Bool ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkDat
}
}
- return sal_False;
+ return false;
}
@@ -360,57 +359,6 @@ void ScDocument::StartAnimations( SCTAB nTab, Window* pWin )
}
}
-//UNUSED2008-05 void ScDocument::RefreshNoteFlags()
-//UNUSED2008-05 {
-//UNUSED2008-05 if (!pDrawLayer)
-//UNUSED2008-05 return;
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool bAnyIntObj = sal_False;
-//UNUSED2008-05 SCTAB nTab;
-//UNUSED2008-05 ScPostIt aNote(this);
-//UNUSED2008-05 for (nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++)
-//UNUSED2008-05 {
-//UNUSED2008-05 SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
-//UNUSED2008-05 DBG_ASSERT(pPage,"Page ?");
-//UNUSED2008-05 if (pPage)
-//UNUSED2008-05 {
-//UNUSED2008-05 SdrObjListIter aIter( *pPage, IM_FLAT );
-//UNUSED2008-05 SdrObject* pObject = aIter.Next();
-//UNUSED2008-05 while (pObject)
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( pObject->GetLayer() == SC_LAYER_INTERN )
-//UNUSED2008-05 {
-//UNUSED2008-05 bAnyIntObj = sal_True; // for all internal objects, including detective
-//UNUSED2008-05
-//UNUSED2008-05 if ( pObject->ISA( SdrCaptionObj ) )
-//UNUSED2008-05 {
-//UNUSED2008-05 ScDrawObjData* pData = ScDrawLayer::GetObjData( pObject );
-//UNUSED2008-05 if ( pData )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( GetNote( pData->aStt.Col(), pData->aStt.Row(), nTab, aNote))
-//UNUSED2008-05 if ( !aNote.IsShown() )
-//UNUSED2008-05 {
-//UNUSED2008-05 aNote.SetShown(sal_True);
-//UNUSED2008-05 SetNote( pData->aStt.Col(), pData->aStt.Row(), nTab, aNote);
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 pObject = aIter.Next();
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 if (bAnyIntObj)
-//UNUSED2008-05 {
-//UNUSED2008-05 // update attributes for all note objects and the colors of detective objects
-//UNUSED2008-05 // (we don't know with which settings the file was created)
-//UNUSED2008-05
-//UNUSED2008-05 ScDetectiveFunc aFunc( this, 0 );
-//UNUSED2008-05 aFunc.UpdateAllComments();
-//UNUSED2008-05 aFunc.UpdateAllArrowColors();
-//UNUSED2008-05 }
-//UNUSED2008-05 }
sal_Bool ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect )
{
@@ -420,13 +368,13 @@ sal_Bool ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect )
// zu werden)
if (!pDrawLayer)
- return sal_False;
+ return false;
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
if (!pPage)
- return sal_False;
+ return false;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SdrObjListIter aIter( *pPage, IM_FLAT );
SdrObject* pObject = aIter.Next();
@@ -447,13 +395,13 @@ sal_Bool ScDocument::HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect )
// (um leere Seiten beim Drucken zu erkennen)
if (!pDrawLayer)
- return sal_False;
+ return false;
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
if (!pPage)
- return sal_False;
+ return false;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SdrObjListIter aIter( *pPage, IM_FLAT );
SdrObject* pObject = aIter.Next();
@@ -517,7 +465,7 @@ sal_Bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
ScRange* pLastRange, Rectangle* pLastMM ) const
{
if (!IsBlockEmpty( nTab, nStartCol, nStartRow, nEndCol, nEndRow ))
- return sal_False;
+ return false;
ScDocument* pThis = (ScDocument*)this; //! GetMMRect / HasAnyDraw etc. const !!!
@@ -549,7 +497,7 @@ sal_Bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
}
if ( pThis->HasAnyDraw( nTab, aMMRect ))
- return sal_False;
+ return false;
if ( nStartCol > 0 && !bLeftIsEmpty )
{
@@ -560,13 +508,13 @@ sal_Bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
SCROW nTmpRow = nEndRow;
pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab,
- sal_False, sal_True ); // kein Refresh, incl. Attrs
+ false, sal_True ); // kein Refresh, incl. Attrs
OutputDevice* pDev = pThis->GetPrinter();
pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize
pThis->ExtendPrintArea( pDev, nTab, 0, nStartRow, nExtendCol, nEndRow );
if ( nExtendCol >= nStartCol )
- return sal_False;
+ return false;
}
return sal_True;
@@ -585,15 +533,13 @@ void ScDocument::Clear( sal_Bool bFromDestructor )
if (pDrawLayer)
{
- // #116168#
- //pDrawLayer->Clear();
pDrawLayer->ClearModel( bFromDestructor );
}
}
sal_Bool ScDocument::HasControl( SCTAB nTab, const Rectangle& rMMRect )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if (pDrawLayer)
{
@@ -641,7 +587,6 @@ void ScDocument::InvalidateControls( Window* pWin, SCTAB nTab, const Rectangle&
// auf ClippingRegions. Darum muss das ganze Objekt neu gepainted
// werden, damit die Selektion auf der Tabelle nicht uebermalt wird.
- //pWin->Invalidate( aObjRect.GetIntersection( rMMRect ) );
pWin->Invalidate( aObjRect );
}
}
@@ -657,7 +602,7 @@ sal_Bool ScDocument::HasDetectiveObjects(SCTAB nTab) const
// looks for detective objects, annotations don't count
// (used to adjust scale so detective objects hit their cells better)
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if (pDrawLayer)
{
@@ -722,6 +667,11 @@ void ScDocument::UpdateFontCharSet()
}
}
+bool ScDocument::IsLoadingMedium() const
+{
+ return bLoadingMedium;
+}
+
void ScDocument::SetLoadingMedium( bool bVal )
{
bLoadingMedium = bVal;
@@ -747,7 +697,7 @@ void ScDocument::SetImportingXML( bool bVal )
for ( SCTAB nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++ )
if ( pTab[nTab]->IsLoadingRTL() )
{
- pTab[nTab]->SetLoadingRTL( sal_False );
+ pTab[nTab]->SetLoadingRTL( false );
SetLayoutRTL( nTab, sal_True ); // includes mirroring; bImportingXML must be cleared first
}
}
@@ -760,12 +710,12 @@ void ScDocument::SetXMLFromWrapper( sal_Bool bVal )
bXMLFromWrapper = bVal;
}
-vos::ORef<SvxForbiddenCharactersTable> ScDocument::GetForbiddenCharacters()
+rtl::Reference<SvxForbiddenCharactersTable> ScDocument::GetForbiddenCharacters()
{
return xForbiddenCharacters;
}
-void ScDocument::SetForbiddenCharacters( const vos::ORef<SvxForbiddenCharactersTable> xNew )
+void ScDocument::SetForbiddenCharacters( const rtl::Reference<SvxForbiddenCharactersTable> xNew )
{
xForbiddenCharacters = xNew;
if ( pEditEngine )
@@ -804,7 +754,7 @@ sal_Bool ScDocument::IsValidAsianKerning() const
sal_Bool ScDocument::GetAsianKerning() const
{
if ( nAsianKerning == SC_ASIANKERNING_INVALID )
- return sal_False;
+ return false;
else
return (sal_Bool)nAsianKerning;
}
@@ -818,3 +768,4 @@ void ScDocument::SetAsianKerning(sal_Bool bNew)
pDrawLayer->SetKernAsianPunctuation( (sal_Bool)nAsianKerning );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 714467d8e5eb..790a32699872 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97,11 +98,25 @@
#include <map>
#include <limits>
+using namespace ::com::sun::star;
+
namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::sheet::TablePageBreakData;
using ::std::set;
+// The constant parameters to CopyBlockFromClip
+struct ScCopyBlockFromClipParams
+{
+ ScDocument* pRefUndoDoc;
+ ScDocument* pClipDoc;
+ sal_uInt16 nInsFlag;
+ SCTAB nTabStart;
+ SCTAB nTabEnd;
+ sal_Bool bAsLink;
+ sal_Bool bSkipAttrForEmpty;
+};
+
struct ScDefaultAttr
{
const ScPatternAttr* pAttr;
@@ -124,10 +139,10 @@ void ScDocument::MakeTable( SCTAB nTab,bool _bNeedsNameCheck )
{
if ( ValidTab(nTab) && !pTab[nTab] )
{
- String aString = ScGlobal::GetRscString(STR_TABLE_DEF); //"Tabelle"
+ String aString = ScGlobal::GetRscString(STR_TABLE_DEF); //"Table"
aString += String::CreateFromInt32(nTab+1);
if ( _bNeedsNameCheck )
- CreateValidTabName( aString ); // keine doppelten
+ CreateValidTabName( aString ); // no doubles
pTab[nTab] = new ScTable(this, nTab, aString);
pTab[nTab]->SetLoadingMedium(bLoadingMedium);
@@ -142,7 +157,7 @@ sal_Bool ScDocument::HasTable( SCTAB nTab ) const
if (pTab[nTab])
return sal_True;
- return sal_False;
+ return false;
}
@@ -155,7 +170,7 @@ sal_Bool ScDocument::GetName( SCTAB nTab, String& rName ) const
return sal_True;
}
rName.Erase();
- return sal_False;
+ return false;
}
sal_Bool ScDocument::SetCodeName( SCTAB nTab, const String& rName )
@@ -169,7 +184,7 @@ sal_Bool ScDocument::SetCodeName( SCTAB nTab, const String& rName )
}
}
OSL_TRACE( "**** can't set code name %s", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr() );
- return sal_False;
+ return false;
}
sal_Bool ScDocument::GetCodeName( SCTAB nTab, String& rName ) const
@@ -181,9 +196,16 @@ sal_Bool ScDocument::GetCodeName( SCTAB nTab, String& rName ) const
return sal_True;
}
rName.Erase();
- return sal_False;
+ return false;
}
+NameToNameMap*
+ScDocument::GetLocalNameMap( SCTAB& rTab )
+{
+ if ( !HasTable( rTab ) )
+ return NULL;
+ return &pTab[rTab]->localNameToGlobalName;
+}
sal_Bool ScDocument::GetTable( const String& rName, SCTAB& rTab ) const
{
@@ -200,11 +222,11 @@ sal_Bool ScDocument::GetTable( const String& rName, SCTAB& rTab ) const
}
}
rTab = 0;
- return sal_False;
+ return false;
}
-sal_Bool ScDocument::ValidTabName( const String& rName ) const
+bool ScDocument::ValidTabName( const String& rName )
{
xub_StrLen nLen = rName.Len();
if (!nLen)
@@ -262,18 +284,17 @@ void ScDocument::CreateValidTabName(String& rName) const
{
if ( !ValidTabName(rName) )
{
- // neu erzeugen
+ // Find new one
const String aStrTable( ScResId(SCSTR_TABLE) );
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
- // vorneweg testen, ob der Prefix als gueltig erkannt wird
- // wenn nicht, nur doppelte vermeiden
+ // First test if the prefix is valid, if so only avoid doubles
sal_Bool bPrefix = ValidTabName( aStrTable );
- DBG_ASSERT(bPrefix, "ungueltiger Tabellenname");
+ OSL_ENSURE(bPrefix, "Invalid Table Name");
SCTAB nDummy;
- SCTAB nLoops = 0; // "zur Sicherheit"
+ SCTAB nLoops = 0; // "for safety messures"
for ( SCTAB i = nMaxTableNumber+1; !bOk && nLoops <= MAXTAB; i++ )
{
rName = aStrTable;
@@ -285,13 +306,13 @@ void ScDocument::CreateValidTabName(String& rName) const
++nLoops;
}
- DBG_ASSERT(bOk, "kein gueltiger Tabellenname gefunden");
+ OSL_ENSURE(bOk, "No Valid Table name found.");
if ( !bOk )
rName = aStrTable;
}
else
{
- // uebergebenen Namen ueberpruefen
+ // testing the supplied Name
if ( !ValidNewTabName(rName) )
{
@@ -316,7 +337,7 @@ sal_Bool ScDocument::InsertTab( SCTAB nPos, const String& rName,
{
SCTAB nTabCount = GetTableCount();
sal_Bool bValid = ValidTab(nTabCount);
- if ( !bExternalDocument ) // sonst rName == "'Doc'!Tab", vorher pruefen
+ if ( !bExternalDocument ) // else test rName == "'Doc'!Tab" first
bValid = (bValid && ValidNewTabName(rName));
if (bValid)
{
@@ -326,7 +347,7 @@ sal_Bool ScDocument::InsertTab( SCTAB nPos, const String& rName,
pTab[nTabCount]->SetCodeName( rName );
++nMaxTableNumber;
if ( bExternalDocument )
- pTab[nTabCount]->SetVisible( sal_False );
+ pTab[nTabCount]->SetVisible( false );
}
else
{
@@ -377,7 +398,7 @@ sal_Bool ScDocument::InsertTab( SCTAB nPos, const String& rName,
pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
if ( pValidationList )
pValidationList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
- // #81844# sheet names of references are not valid until sheet is inserted
+ // sheet names of references are not valid until sheet is inserted
if ( pChartListenerCollection )
pChartListenerCollection->UpdateScheduledSeriesRanges();
@@ -385,7 +406,7 @@ sal_Bool ScDocument::InsertTab( SCTAB nPos, const String& rName,
bValid = sal_True;
}
else
- bValid = sal_False;
+ bValid = false;
}
}
return bValid;
@@ -394,7 +415,7 @@ sal_Bool ScDocument::InsertTab( SCTAB nPos, const String& rName,
sal_Bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
{
- sal_Bool bValid = sal_False;
+ sal_Bool bValid = false;
if (VALIDTAB(nTab))
{
if (pTab[nTab])
@@ -403,7 +424,7 @@ sal_Bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
if (nTabCount > 1)
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
ScRange aRange( 0, 0, nTab, MAXCOL, MAXROW, nTab );
DelBroadcastAreasInRange( aRange );
@@ -443,11 +464,12 @@ sal_Bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
SCTAB i;
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
- pTab[i]->UpdateDeleteTab(nTab,sal_False,
+ pTab[i]->UpdateDeleteTab(nTab,false,
pRefUndoDoc ? pRefUndoDoc->pTab[i] : 0);
delete pTab[nTab];
for (i=nTab + 1; i < nTabCount; i++)
pTab[i - 1] = pTab[i];
+
pTab[nTabCount - 1] = NULL;
--nMaxTableNumber;
// UpdateBroadcastAreas must be called between UpdateDeleteTab,
@@ -457,8 +479,8 @@ sal_Bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
for (i = 0; i <= MAXTAB; i++)
if (pTab[i])
pTab[i]->UpdateCompile();
- // Excel-Filter loescht einige Tables waehrend des Ladens,
- // Listener werden erst nach dem Laden aufgesetzt
+ // Excel-Filter deletes some Tables while loading, Listeners will
+ // only be triggered after the loading is done.
if ( !bInsertingFromOtherDoc )
{
for (i = 0; i <= MAXTAB; i++)
@@ -466,7 +488,7 @@ sal_Bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
pTab[i]->StartAllListeners();
SetDirty();
}
- // #81844# sheet names of references are not valid until sheet is deleted
+ // sheet names of references are not valid until sheet is deleted
pChartListenerCollection->UpdateScheduledSeriesRanges();
SetAutoCalc( bOldAutoCalc );
@@ -481,13 +503,13 @@ sal_Bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
sal_Bool ScDocument::RenameTab( SCTAB nTab, const String& rName, sal_Bool /* bUpdateRef */,
sal_Bool bExternalDocument )
{
- sal_Bool bValid = sal_False;
+ sal_Bool bValid = false;
SCTAB i;
if VALIDTAB(nTab)
if (pTab[nTab])
{
if ( bExternalDocument )
- bValid = sal_True; // zusammengesetzter Name
+ bValid = true; // composed name
else
bValid = ValidTabName(rName);
for (i=0; (i<=MAXTAB) && bValid; i++)
@@ -509,7 +531,7 @@ sal_Bool ScDocument::RenameTab( SCTAB nTab, const String& rName, sal_Bool /* bUp
// but the XML stream must be re-generated.
for (i=0; i<=MAXTAB; ++i)
if (pTab[i] && pTab[i]->IsStreamValid())
- pTab[i]->SetStreamValid( sal_False );
+ pTab[i]->SetStreamValid( false );
}
}
return bValid;
@@ -530,7 +552,7 @@ sal_Bool ScDocument::IsVisible( SCTAB nTab ) const
if (pTab[nTab])
return pTab[nTab]->IsVisible();
- return sal_False;
+ return false;
}
@@ -539,7 +561,7 @@ sal_Bool ScDocument::IsStreamValid( SCTAB nTab ) const
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->IsStreamValid();
- return sal_False;
+ return false;
}
@@ -561,7 +583,7 @@ sal_Bool ScDocument::IsPendingRowHeights( SCTAB nTab ) const
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->IsPendingRowHeights();
- return sal_False;
+ return false;
}
@@ -594,7 +616,7 @@ void ScDocument::SetLayoutRTL( SCTAB nTab, sal_Bool bRTL )
if (pDrawLayer)
{
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
- DBG_ASSERT(pPage,"Page ?");
+ OSL_ENSURE(pPage,"Page ?");
if (pPage)
{
SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
@@ -622,7 +644,7 @@ sal_Bool ScDocument::IsLayoutRTL( SCTAB nTab ) const
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->IsLayoutRTL();
- return sal_False;
+ return false;
}
@@ -635,12 +657,12 @@ sal_Bool ScDocument::IsNegativePage( SCTAB nTab ) const
/* ----------------------------------------------------------------------------
- benutzten Bereich suchen:
+ used search area:
- GetCellArea - nur Daten
- GetTableArea - Daten / Attribute
- GetPrintArea - beruecksichtigt auch Zeichenobjekte,
- streicht Attribute bis ganz rechts / unten
+ GetCellArea - Only Data
+ GetTableArea - Data / Attributes
+ GetPrintArea - intended for character objects,
+ sweeps attributes all the way to bottom / right
---------------------------------------------------------------------------- */
@@ -652,7 +674,7 @@ sal_Bool ScDocument::GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) c
rEndCol = 0;
rEndRow = 0;
- return sal_False;
+ return false;
}
@@ -664,7 +686,7 @@ sal_Bool ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow )
rEndCol = 0;
rEndRow = 0;
- return sal_False;
+ return false;
}
bool ScDocument::ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const
@@ -709,7 +731,7 @@ bool ScDocument::ShrinkToUsedDataArea( bool& o_bShrunk, SCTAB nTab, SCCOL& rStar
return pTab[nTab]->ShrinkToUsedDataArea( o_bShrunk, rStartCol, rStartRow, rEndCol, rEndRow, bColumnsOnly);
}
-// zusammenhaengender Bereich
+// connected area
void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
SCCOL& rEndCol, SCROW& rEndRow, sal_Bool bIncludeOld, bool bOnlyDown ) const
@@ -733,10 +755,9 @@ void ScDocument::LimitChartIfAll( ScRangeListRef& rRangeList )
ScRangeListRef aNew = new ScRangeList;
if (rRangeList.Is())
{
- sal_uLong nCount = rRangeList->Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = rRangeList->size(); i < nCount; i++ )
{
- ScRange aRange(*rRangeList->GetObject( i ));
+ ScRange aRange( *(*rRangeList)[i] );
if ( ( aRange.aStart.Col() == 0 && aRange.aEnd.Col() == MAXCOL ) ||
( aRange.aStart.Row() == 0 && aRange.aEnd.Row() == MAXROW ) )
{
@@ -757,7 +778,7 @@ void ScDocument::LimitChartIfAll( ScRangeListRef& rRangeList )
}
else
{
- DBG_ERROR("LimitChartIfAll: Ref==0");
+ OSL_FAIL("LimitChartIfAll: Ref==0");
}
rRangeList = aNew;
}
@@ -837,17 +858,17 @@ sal_Bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab,
nEndTab = MAXTAB;
}
- sal_Bool bTest = sal_True;
- sal_Bool bRet = sal_False;
+ sal_Bool bTest = true;
+ sal_Bool bRet = false;
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid mulitple calculations
for ( i = nStartTab; i <= nEndTab && bTest; i++)
if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
bTest &= pTab[i]->TestInsertRow( nStartCol, nEndCol, nSize );
if (bTest)
{
- // UpdateBroadcastAreas muss vor UpdateReference gerufen werden, damit nicht
- // Eintraege verschoben werden, die erst bei UpdateReference neu erzeugt werden
+ // UpdateBroadcastAreas have to be called before UpdateReference, so that entries
+ // aren't shifted that would be rebuild at UpdateReference
// handle chunks of consecutive selected sheets together
SCTAB nTabRangeStart = nStartTab;
@@ -866,7 +887,7 @@ sal_Bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab,
{
UpdateReference( URM_INSDEL, nStartCol, nStartRow, nTabRangeStart,
nEndCol, MAXROW, nTabRangeEnd,
- 0, static_cast<SCsROW>(nSize), 0, pRefUndoDoc, sal_False ); // without drawing objects
+ 0, static_cast<SCsROW>(nSize), 0, pRefUndoDoc, false ); // without drawing objects
}
while ( lcl_GetNextTabRange( nTabRangeStart, nTabRangeEnd, pTabMark ) );
@@ -874,7 +895,7 @@ sal_Bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab,
if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
pTab[i]->InsertRow( nStartCol, nEndCol, nStartRow, nSize );
- // #82991# UpdateRef for drawing layer must be after inserting,
+ // UpdateRef for drawing layer must be after inserting,
// when the new row heights are known.
for (i=nStartTab; i<=nEndTab; i++)
if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
@@ -893,7 +914,7 @@ sal_Bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab,
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
pTab[i]->StartNeededListeners();
- // #69592# at least all cells using range names pointing relative
+ // at least all cells using range names pointing relative
// to the moved range must recalculate
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
@@ -934,7 +955,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab,
}
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
// handle chunks of consecutive selected sheets together
SCTAB nTabRangeStart = nStartTab;
@@ -971,7 +992,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab,
}
if (pUndoOutline)
- *pUndoOutline = sal_False;
+ *pUndoOutline = false;
for ( i = nStartTab; i <= nEndTab; i++)
if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
@@ -982,7 +1003,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab,
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
pTab[i]->StartNeededListeners();
- // #69592# at least all cells using range names pointing relative to
+ // at least all cells using range names pointing relative to
// the moved range must recalculate
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
@@ -1040,10 +1061,10 @@ sal_Bool ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab,
nEndTab = MAXTAB;
}
- sal_Bool bTest = sal_True;
- sal_Bool bRet = sal_False;
+ sal_Bool bTest = true;
+ sal_Bool bRet = false;
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
for ( i = nStartTab; i <= nEndTab && bTest; i++)
if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
bTest &= pTab[i]->TestInsertCol( nStartRow, nEndRow, nSize );
@@ -1085,7 +1106,7 @@ sal_Bool ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab,
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
pTab[i]->StartNeededListeners();
- // #69592# at least all cells using range names pointing relative
+ // at least all cells using range names pointing relative
// to the moved range must recalculate
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
@@ -1124,7 +1145,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA
}
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
// handle chunks of consecutive selected sheets together
SCTAB nTabRangeStart = nStartTab;
@@ -1161,7 +1182,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA
}
if (pUndoOutline)
- *pUndoOutline = sal_False;
+ *pUndoOutline = false;
for ( i = nStartTab; i <= nEndTab; i++)
if (pTab[i] && (!pTabMark || pTabMark->GetTableSelect(i)))
@@ -1172,7 +1193,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
pTab[i]->StartNeededListeners();
- // #69592# at least all cells using range names pointing relative to
+ // at least all cells using range names pointing relative to
// the moved range must recalculate
for (i=0; i<=MAXTAB; i++)
if (pTab[i])
@@ -1201,9 +1222,9 @@ void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew,
ScRange& rColRange, sal_Bool& rInsCol, sal_Bool& rDelCol,
ScRange& rRowRange, sal_Bool& rInsRow, sal_Bool& rDelRow )
{
- DBG_ASSERT( rOld.aStart == rNew.aStart, "FitBlock: Anfang unterschiedlich" );
+ OSL_ENSURE( rOld.aStart == rNew.aStart, "FitBlock: Beginning is different" );
- rInsCol = rDelCol = rInsRow = rDelRow = sal_False;
+ rInsCol = rDelCol = rInsRow = rDelRow = false;
SCCOL nStartX = rOld.aStart.Col();
SCROW nStartY = rOld.aStart.Row();
@@ -1248,7 +1269,7 @@ void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew,
sal_Bool ScDocument::HasPartOfMerged( const ScRange& rRange )
{
- sal_Bool bPart = sal_False;
+ sal_Bool bPart = false;
SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartX = rRange.aStart.Col();
@@ -1280,21 +1301,21 @@ sal_Bool ScDocument::CanFitBlock( const ScRange& rOld, const ScRange& rNew )
lcl_GetInsDelRanges( rOld, rNew, aColRange,bInsCol,bDelCol, aRowRange,bInsRow,bDelRow );
if ( bInsCol && !CanInsertCol( aColRange ) ) // Zellen am Rand ?
- bOk = sal_False;
+ bOk = false;
if ( bInsRow && !CanInsertRow( aRowRange ) ) // Zellen am Rand ?
- bOk = sal_False;
+ bOk = false;
if ( bInsCol || bDelCol )
{
aColRange.aEnd.SetCol(MAXCOL);
if ( HasPartOfMerged(aColRange) )
- bOk = sal_False;
+ bOk = false;
}
if ( bInsRow || bDelRow )
{
aRowRange.aEnd.SetRow(MAXROW);
if ( HasPartOfMerged(aRowRange) )
- bOk = sal_False;
+ bOk = false;
}
return bOk;
@@ -1341,7 +1362,7 @@ void ScDocument::DeleteArea(SCCOL nCol1, SCROW nRow1,
PutInOrder( nCol1, nCol2 );
PutInOrder( nRow1, nRow2 );
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
for (SCTAB i = 0; i <= MAXTAB; i++)
if (pTab[i])
if ( rMark.GetTableSelect(i) || bIsUndo )
@@ -1359,7 +1380,7 @@ void ScDocument::DeleteAreaTab(SCCOL nCol1, SCROW nRow1,
if ( VALIDTAB(nTab) && pTab[nTab] )
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
pTab[nTab]->DeleteArea(nCol1, nRow1, nCol2, nRow2, nDelFlag);
SetAutoCalc( bOldAutoCalc );
}
@@ -1394,7 +1415,7 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe
}
else
{
- DBG_ERROR("InitUndo");
+ OSL_FAIL("InitUndo");
}
}
@@ -1416,7 +1437,7 @@ void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
}
else
{
- DBG_ERROR("InitUndo");
+ OSL_FAIL("InitUndo");
}
}
@@ -1435,7 +1456,7 @@ void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, sal_Bool bColInfo, sal_Bo
}
else
{
- DBG_ERROR("InitUndo");
+ OSL_FAIL("InitUndo");
}
}
@@ -1446,7 +1467,7 @@ void ScDocument::SetCutMode( sal_Bool bVal )
GetClipParam().mbCutMode = bVal;
else
{
- DBG_ERROR("SetCutMode without bIsClip");
+ OSL_FAIL("SetCutMode without bIsClip");
}
}
@@ -1457,8 +1478,8 @@ sal_Bool ScDocument::IsCutMode()
return GetClipParam().mbCutMode;
else
{
- DBG_ERROR("IsCutMode ohne bIsClip");
- return sal_False;
+ OSL_FAIL("IsCutMode ohne bIsClip");
+ return false;
}
}
@@ -1476,13 +1497,13 @@ void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
if (VALIDTAB(nTab1) && VALIDTAB(nTab2))
{
sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc();
- pDestDoc->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDestDoc->SetAutoCalc( false ); // avoid multiple calculations
for (SCTAB i = nTab1; i <= nTab2; i++)
{
if (pTab[i] && pDestDoc->pTab[i])
pTab[i]->CopyToTable( nCol1, nRow1, nCol2, nRow2, nFlags,
bOnlyMarked, pDestDoc->pTab[i], pMarks,
- sal_False, bColRowFlags );
+ false, bColRowFlags );
}
pDestDoc->SetAutoCalc( bOldAutoCalc );
}
@@ -1500,9 +1521,9 @@ void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
if (VALIDTAB(nTab1) && VALIDTAB(nTab2))
{
sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc();
- pDestDoc->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDestDoc->SetAutoCalc( false ); // avoid multiple calculations
if (nTab1 > 0)
- CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, sal_False, pDestDoc, pMarks );
+ CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, false, pDestDoc, pMarks );
for (SCTAB i = nTab1; i <= nTab2; i++)
{
@@ -1512,7 +1533,7 @@ void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
}
if (nTab2 < MAXTAB)
- CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, sal_False, pDestDoc, pMarks );
+ CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, false, pDestDoc, pMarks );
pDestDoc->SetAutoCalc( bOldAutoCalc );
}
}
@@ -1528,13 +1549,13 @@ void ScDocument::CopyToDocument(const ScRange& rRange,
if( !pDestDoc->aDocName.Len() )
pDestDoc->aDocName = aDocName;
sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc();
- pDestDoc->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDestDoc->SetAutoCalc( false ); // avoid multiple calculations
for (SCTAB i = aNewRange.aStart.Tab(); i <= aNewRange.aEnd.Tab(); i++)
if (pTab[i] && pDestDoc->pTab[i])
pTab[i]->CopyToTable(aNewRange.aStart.Col(), aNewRange.aStart.Row(),
aNewRange.aEnd.Col(), aNewRange.aEnd.Row(),
nFlags, bOnlyMarked, pDestDoc->pTab[i],
- pMarks, sal_False, bColRowFlags);
+ pMarks, false, bColRowFlags);
pDestDoc->SetAutoCalc( bOldAutoCalc );
}
@@ -1549,9 +1570,9 @@ void ScDocument::UndoToDocument(const ScRange& rRange,
SCTAB nTab2 = aNewRange.aEnd.Tab();
sal_Bool bOldAutoCalc = pDestDoc->GetAutoCalc();
- pDestDoc->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDestDoc->SetAutoCalc( false ); // avoid multiple calculations
if (nTab1 > 0)
- CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, sal_False, pDestDoc, pMarks );
+ CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, IDF_FORMULA, false, pDestDoc, pMarks );
for (SCTAB i = nTab1; i <= nTab2; i++)
{
@@ -1562,7 +1583,7 @@ void ScDocument::UndoToDocument(const ScRange& rRange,
}
if (nTab2 < MAXTAB)
- CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, sal_False, pDestDoc, pMarks );
+ CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA, false, pDestDoc, pMarks );
pDestDoc->SetAutoCalc( bOldAutoCalc );
}
@@ -1570,14 +1591,14 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam,
ScDocument* pClipDoc, const ScMarkData* pMarks,
bool bAllTabs, bool bKeepScenarioFlags, bool bIncludeObjects, bool bCloneNoteCaptions)
{
- DBG_ASSERT( bAllTabs || pMarks, "CopyToClip: ScMarkData fehlt" );
+ OSL_ENSURE( bAllTabs || pMarks, "CopyToClip: ScMarkData fails" );
if (bIsClip)
return;
if (!pClipDoc)
{
- DBG_ERROR("CopyToClip: no ClipDoc");
+ OSL_TRACE("CopyToClip: no ClipDoc");
pClipDoc = SC_MOD()->GetClipDoc();
}
@@ -1611,6 +1632,40 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam,
pClipDoc->ExtendMerge(aClipRange, true);
}
+// Copy the content of the Range into clipboard. Adding this method for VBA API: Range.Copy().
+void ScDocument::CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClipDoc, bool bKeepScenarioFlags, bool bIncludeObjects, bool bCloneNoteCaptions)
+{
+ if ( !bIsClip )
+ {
+ pClipDoc = pClipDoc ? pClipDoc : SC_MOD()->GetClipDoc();
+ if ( !pClipDoc )
+ {
+ return;
+ }
+ ScRange aClipRange = rClipParam.getWholeRange();
+ SCTAB nTab = aClipRange.aStart.Tab();
+ pClipDoc->aDocName = aDocName;
+ pClipDoc->SetClipParam( rClipParam );
+ pClipDoc->ResetClip( this, nTab );
+
+ CopyRangeNamesToClip( pClipDoc, aClipRange, nTab );
+
+ if ( pTab[nTab] && pClipDoc->pTab[nTab] )
+ {
+ pTab[nTab]->CopyToClip( rClipParam.maRanges, pClipDoc->pTab[nTab], bKeepScenarioFlags, bCloneNoteCaptions );
+ if ( pDrawLayer && bIncludeObjects )
+ {
+ // Also copy drawing objects.
+ Rectangle aObjRect = GetMMRect( aClipRange.aStart.Col(), aClipRange.aStart.Row(), aClipRange.aEnd.Col(), aClipRange.aEnd.Row(), nTab );
+ pDrawLayer->CopyToClip( pClipDoc, nTab, aObjRect );
+ }
+ }
+
+ // Make sure to mark overlapped cells.
+ pClipDoc->ExtendMerge( aClipRange, true );
+ }
+}
+
void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2,
SCTAB nTab, ScDocument* pClipDoc)
@@ -1621,7 +1676,7 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
PutInOrder( nRow1, nRow2 );
if (!pClipDoc)
{
- DBG_ERROR("CopyTabToClip: no ClipDoc");
+ OSL_TRACE("CopyTabToClip: no ClipDoc");
pClipDoc = SC_MOD()->GetClipDoc();
}
@@ -1632,7 +1687,7 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
pClipDoc->ResetClip( this, nTab );
if (pTab[nTab] && pClipDoc->pTab[nTab])
- pTab[nTab]->CopyToClip(nCol1, nRow1, nCol2, nRow2, pClipDoc->pTab[nTab], sal_False, sal_True);
+ pTab[nTab]->CopyToClip(nCol1, nRow1, nCol2, nRow2, pClipDoc->pTab[nTab], false, sal_True);
pClipDoc->GetClipParam().mbCutMode = false;
}
@@ -1641,8 +1696,8 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
void ScDocument::TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, sal_Bool bAsLink )
{
- DBG_ASSERT( bIsClip && pTransClip && pTransClip->bIsClip,
- "TransposeClip mit falschem Dokument" );
+ OSL_ENSURE( bIsClip && pTransClip && pTransClip->bIsClip,
+ "TransposeClip with wrong Document" );
// initialisieren
// -> pTransClip muss vor dem Original-Dokument geloescht werden!
@@ -1651,18 +1706,19 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, sal_B
// Bereiche uebernehmen
- pTransClip->pRangeName->FreeAll();
- for (sal_uInt16 i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!!
+ pTransClip->pRangeName->clear();
+ ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end();
+ for (; itr != itrEnd; ++itr)
{
- sal_uInt16 nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex();
- ScRangeData* pData = new ScRangeData(*((*pRangeName)[i]));
- if (!pTransClip->pRangeName->Insert(pData))
+ sal_uInt16 nIndex = itr->GetIndex();
+ ScRangeData* pData = new ScRangeData(*itr);
+ if (!pTransClip->pRangeName->insert(pData))
delete pData;
else
pData->SetIndex(nIndex);
}
- // Daten
+ // The data
ScRange aClipRange = GetClipParam().getWholeRange();
if ( ValidRow(aClipRange.aEnd.Row()-aClipRange.aStart.Row()) )
@@ -1670,7 +1726,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, sal_B
for (SCTAB i=0; i<=MAXTAB; i++)
if (pTab[i])
{
- DBG_ASSERT( pTransClip->pTab[i], "TransposeClip: Tabelle nicht da" );
+ OSL_ENSURE( pTransClip->pTab[i], "TransposeClip: Table not there" );
pTab[i]->TransposeClip( aClipRange.aStart.Col(), aClipRange.aStart.Row(),
aClipRange.aEnd.Col(), aClipRange.aEnd.Row(),
pTransClip->pTab[i], nFlags, bAsLink );
@@ -1698,7 +1754,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, sal_B
}
else
{
- DBG_ERROR("TransposeClip: zu gross");
+ OSL_TRACE("TransposeClip: Too big");
}
// Dies passiert erst beim Einfuegen...
@@ -1706,6 +1762,29 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, sal_B
GetClipParam().mbCutMode = false;
}
+namespace {
+
+void copyUsedNamesToClip(ScRangeName* pClipRangeName, ScRangeName* pRangeName, const std::set<sal_uInt16>& rUsedNames)
+{
+ pClipRangeName->clear();
+ ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end();
+ for (; itr != itrEnd; ++itr) //! DB-Bereiche Pivot-Bereiche auch !!!
+ {
+ sal_uInt16 nIndex = itr->GetIndex();
+ bool bInUse = (rUsedNames.count(nIndex) > 0);
+ if (!bInUse)
+ continue;
+
+ ScRangeData* pData = new ScRangeData(*itr);
+ if (!pClipRangeName->insert(pData))
+ delete pData;
+ else
+ pData->SetIndex(nIndex);
+ }
+}
+
+}
+
void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs)
{
std::set<sal_uInt16> aUsedNames; // indexes of named ranges that are used in the copied cells
@@ -1716,20 +1795,21 @@ void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClip
rClipRange.aStart.Col(), rClipRange.aStart.Row(),
rClipRange.aEnd.Col(), rClipRange.aEnd.Row(), aUsedNames);
- pClipDoc->pRangeName->FreeAll();
- for (sal_uInt16 i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!!
+ copyUsedNamesToClip(pClipDoc->pRangeName, pRangeName, aUsedNames);
+}
+
+void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, SCTAB nTab)
+{
+ // Indexes of named ranges that are used in the copied cells
+ std::set<sal_uInt16> aUsedNames;
+ if ( pTab[nTab] && pClipDoc->pTab[nTab] )
{
- sal_uInt16 nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex();
- bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() );
- if (bInUse)
- {
- ScRangeData* pData = new ScRangeData(*((*pRangeName)[i]));
- if (!pClipDoc->pRangeName->Insert(pData))
- delete pData;
- else
- pData->SetIndex(nIndex);
- }
+ pTab[nTab]->FindRangeNamesInUse(
+ rClipRange.aStart.Col(), rClipRange.aStart.Row(),
+ rClipRange.aEnd.Col(), rClipRange.aEnd.Row(), aUsedNames );
}
+
+ copyUsedNamesToClip(pClipDoc->pRangeName, pRangeName, aUsedNames);
}
ScDocument::NumFmtMergeHandler::NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc) :
@@ -1758,13 +1838,11 @@ void ScDocument::MergeNumberFormatter(ScDocument* pSrcDoc)
void ScDocument::CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames)
{
- sal_uInt16 nClipRangeNameCount = pClipDoc->pRangeName->GetCount();
ScClipRangeNameData aClipRangeNames;
- // array containing range names which might need update of indices
- aClipRangeNames.mpRangeNames.resize(nClipRangeNameCount, NULL);
-
- for (sal_uInt16 i = 0; i < nClipRangeNameCount; ++i) //! DB-Bereiche Pivot-Bereiche auch
+ ScRangeName::const_iterator itr = pClipDoc->pRangeName->begin();
+ ScRangeName::const_iterator itrEnd = pClipDoc->pRangeName->end();
+ for (; itr != itrEnd; ++itr) //! DB-Bereiche Pivot-Bereiche auch
{
/* Copy only if the name doesn't exist in this document.
If it exists we use the already existing name instead,
@@ -1773,27 +1851,25 @@ void ScDocument::CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameDat
A proper solution would ask the user how to proceed.
The adjustment of the indices in the formulas is done later.
*/
- ScRangeData* pClipRangeData = (*pClipDoc->pRangeName)[i];
- sal_uInt16 k;
- if ( pRangeName->SearchName( pClipRangeData->GetName(), k ) )
+ const ScRangeData* pExistingData = pRangeName->findByName(itr->GetName());
+ if (pExistingData)
{
- aClipRangeNames.mpRangeNames[i] = NULL; // range name not inserted
- sal_uInt16 nOldIndex = pClipRangeData->GetIndex();
- sal_uInt16 nNewIndex = ((*pRangeName)[k])->GetIndex();
+ sal_uInt16 nOldIndex = itr->GetIndex();
+ sal_uInt16 nNewIndex = pExistingData->GetIndex();
aClipRangeNames.insert(nOldIndex, nNewIndex);
if ( !aClipRangeNames.mbReplace )
aClipRangeNames.mbReplace = ( nOldIndex != nNewIndex );
}
else
{
- ScRangeData* pData = new ScRangeData( *pClipRangeData );
+ ScRangeData* pData = new ScRangeData( *itr );
pData->SetDocument(this);
- if ( pRangeName->FindIndex( pData->GetIndex() ) )
+ if ( pRangeName->findByIndex( pData->GetIndex() ) )
pData->SetIndex(0); // need new index, done in Insert
- if ( pRangeName->Insert( pData ) )
+ if ( pRangeName->insert(pData) )
{
- aClipRangeNames.mpRangeNames[i] = pData;
- sal_uInt16 nOldIndex = pClipRangeData->GetIndex();
+ aClipRangeNames.mpRangeNames.push_back(pData);
+ sal_uInt16 nOldIndex = itr->GetIndex();
sal_uInt16 nNewIndex = pData->GetIndex();
aClipRangeNames.insert(nOldIndex, nNewIndex);
if ( !aClipRangeNames.mbReplace )
@@ -1802,8 +1878,7 @@ void ScDocument::CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameDat
else
{ // must be an overflow
delete pData;
- aClipRangeNames.mpRangeNames[i] = NULL;
- aClipRangeNames.insert(pClipRangeData->GetIndex(), 0);
+ aClipRangeNames.insert(itr->GetIndex(), 0);
aClipRangeNames.mbReplace = true;
}
}
@@ -1823,16 +1898,14 @@ void ScDocument::UpdateRangeNamesInFormulas(
// first update all inserted named formulas if they contain other
// range names and used indices changed
- size_t nRangeNameCount = rRangeNames.mpRangeNames.size();
- for (size_t i = 0; i < nRangeNameCount; ++i) //! DB-Bereiche Pivot-Bereiche auch
+ for (size_t i = 0, n = rRangeNames.mpRangeNames.size(); i < n; ++i) //! DB-Bereiche Pivot-Bereiche auch
{
- if ( rRangeNames.mpRangeNames[i] )
- rRangeNames.mpRangeNames[i]->ReplaceRangeNamesInUse(rRangeNames.maRangeMap);
+ rRangeNames.mpRangeNames[i]->ReplaceRangeNamesInUse(rRangeNames.maRangeMap);
}
// then update the formulas, they might need just the updated range names
- for (sal_uLong nRange = 0; nRange < rDestRanges.Count(); ++nRange)
+ for ( size_t nRange = 0, n = rDestRanges.size(); nRange < n; ++nRange )
{
- const ScRange* pRange = rDestRanges.GetObject( nRange);
+ const ScRange* pRange = rDestRanges[nRange];
SCCOL nCol1 = pRange->aStart.Col();
SCROW nRow1 = pRange->aStart.Row();
SCCOL nCol2 = pRange->aEnd.Col();
@@ -1885,7 +1958,7 @@ void ScDocument::SetClipParam(const ScClipParam& rParam)
sal_Bool ScDocument::IsClipboardSource() const
{
ScDocument* pClipDoc = SC_MOD()->GetClipDoc();
- return pClipDoc && pClipDoc->xPoolHelper.isValid() &&
+ return pClipDoc && pClipDoc->xPoolHelper.is() &&
xPoolHelper->GetDocPool() == pClipDoc->xPoolHelper->GetDocPool();
}
@@ -1918,7 +1991,6 @@ void ScDocument::BroadcastFromClip( SCCOL nCol1, SCROW nRow1,
}
}
-
void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2,
const ScMarkData& rMark,
@@ -1943,7 +2015,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
// drawing layer must be created before calling CopyFromClip
// (ScDocShell::MakeDrawLayer also does InitItems etc.)
- DBG_ASSERT( pDrawLayer, "CopyBlockFromClip: No drawing layer" );
+ OSL_ENSURE( pDrawLayer, "CopyBlockFromClip: No drawing layer" );
if ( pDrawLayer )
{
// For GetMMRect, the row heights in the target document must already be valid
@@ -1971,7 +2043,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
while (!ppClipTab[nClipTab]) nClipTab = (nClipTab+1) % (MAXTAB+1);
SCsTAB nDz = ((SCsTAB)i) - nClipTab;
- // #89081# ranges of consecutive selected tables (in clipboard and dest. doc)
+ // ranges of consecutive selected tables (in clipboard and dest. doc)
// must be handled in one UpdateReference call
SCTAB nFollow = 0;
while ( i + nFollow < nTabEnd
@@ -1986,13 +2058,13 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
SetInsertingFromOtherDoc( sal_True);
UpdateReference( URM_MOVE,
nCol1, nRow1, i, nCol2, nRow2, i+nFollow,
- nDx, nDy, nDz, pCBFCP->pRefUndoDoc, sal_False );
+ nDx, nDy, nDz, pCBFCP->pRefUndoDoc, false );
SetInsertingFromOtherDoc( bOldInserting);
}
else
UpdateReference( URM_COPY,
nCol1, nRow1, i, nCol2, nRow2, i+nFollow,
- nDx, nDy, nDz, pCBFCP->pRefUndoDoc, sal_False );
+ nDx, nDy, nDz, pCBFCP->pRefUndoDoc, false );
nClipTab = (nClipTab+nFollow+1) % (MAXTAB+1);
i = sal::static_int_cast<SCTAB>( i + nFollow );
@@ -2020,8 +2092,8 @@ void ScDocument::CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1,
SCROW nSourceRow = rClipStartRow;
SCROW nSourceEnd = 0;
- if (pCBFCP->pClipDoc->GetClipParam().maRanges.Count())
- nSourceEnd = pCBFCP->pClipDoc->GetClipParam().maRanges.First()->aEnd.Row();
+ if ( !pCBFCP->pClipDoc->GetClipParam().maRanges.empty() )
+ nSourceEnd = pCBFCP->pClipDoc->GetClipParam().maRanges.front()->aEnd.Row();
SCROW nDestRow = nRow1;
while ( nSourceRow <= nSourceEnd && nDestRow <= nRow2 )
@@ -2062,13 +2134,13 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
{
if (!pClipDoc)
{
- DBG_ERROR("CopyFromClip: no ClipDoc");
+ OSL_FAIL("CopyFromClip: no ClipDoc");
pClipDoc = SC_MOD()->GetClipDoc();
}
if (pClipDoc->bIsClip && pClipDoc->GetTableCount())
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // avoid multiple recalculations
+ SetAutoCalc( false ); // avoid multiple recalculations
NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc);
@@ -2162,11 +2234,10 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
SCCOL nClipStartCol = aClipRange.aStart.Col();
SCROW nClipStartRow = aClipRange.aStart.Row();
- // WaE: commented because unused: SCCOL nClipEndCol = pClipDoc->aClipRange.aEnd.Col();
SCROW nClipEndRow = aClipRange.aEnd.Row();
- for (sal_uLong nRange = 0; nRange < pDestRanges->Count(); ++nRange)
+ for ( size_t nRange = 0; nRange < pDestRanges->size(); ++nRange )
{
- const ScRange* pRange = pDestRanges->GetObject( nRange);
+ const ScRange* pRange = (*pDestRanges)[nRange];
SCCOL nCol1 = pRange->aStart.Col();
SCROW nRow1 = pRange->aStart.Row();
SCCOL nCol2 = pRange->aEnd.Col();
@@ -2207,9 +2278,6 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
CopyNonFilteredFromClip( nC1, nR1, nC2, nR2, rMark,
nDx, nDy, &aCBFCP, nClipStartRow );
}
- // Not needed for columns, but if it was this would be how to.
- //if (nClipStartCol > nClipEndCol)
- // nClipStartCol = pClipDoc->aClipRange.aStart.Col();
nC1 = nC2 + 1;
nC2 = Min((SCCOL)(nC1 + nXw), nCol2);
} while (nC1 <= nCol2);
@@ -2230,7 +2298,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
if (pTab[k] && rMark.GetTableSelect(k))
pTab[k]->DecRecalcLevel();
- bInsertingFromOtherDoc = sal_False;
+ bInsertingFromOtherDoc = false;
UpdateRangeNamesInFormulas(aClipRangeNames, *pDestRanges, rMark, nXw, nYw);
@@ -2272,7 +2340,7 @@ void ScDocument::CopyMultiRangeFromClip(
return;
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // avoid multiple recalculations
+ SetAutoCalc( false ); // avoid multiple recalculations
NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc);
@@ -2313,8 +2381,9 @@ void ScDocument::CopyMultiRangeFromClip(
sal_uInt16 nDelFlag = IDF_CONTENTS;
const ScBitMaskCompressedArray<SCROW, sal_uInt8>& rFlags = GetRowFlagsArray(aCBFCP.nTabStart);
- for (ScRange* p = rClipParam.maRanges.First(); p; p = rClipParam.maRanges.Next())
+ for ( size_t i = 0, n = rClipParam.maRanges.size(); i < n; ++i )
{
+ ScRange* p = rClipParam.maRanges[ i ];
// The begin row must not be filtered.
SCROW nRowCount = p->aEnd.Row() - p->aStart.Row() + 1;
@@ -2365,7 +2434,7 @@ void ScDocument::CopyMultiRangeFromClip(
if (pTab[i] && rMark.GetTableSelect(i))
pTab[i]->DecRecalcLevel();
- bInsertingFromOtherDoc = sal_False;
+ bInsertingFromOtherDoc = false;
ScRangeList aRanges;
aRanges.Append(aDestRange);
@@ -2396,7 +2465,7 @@ void ScDocument::SetClipArea( const ScRange& rArea, sal_Bool bCut )
}
else
{
- DBG_ERROR("SetClipArea: kein Clip");
+ OSL_FAIL("SetClipArea: kein Clip");
}
}
@@ -2405,22 +2474,23 @@ void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, sal_Bool bIncludeFilt
{
if (!bIsClip)
{
- DBG_ERROR("GetClipArea: kein Clip");
+ OSL_FAIL("GetClipArea: kein Clip");
return;
}
ScRangeList& rClipRanges = GetClipParam().maRanges;
- if (!rClipRanges.Count())
+ if (rClipRanges.empty())
// No clip range. Bail out.
return;
- ScRangePtr p = rClipRanges.First();
+ ScRange* p = rClipRanges.front();
SCCOL nStartCol = p->aStart.Col();
SCCOL nEndCol = p->aEnd.Col();
SCROW nStartRow = p->aStart.Row();
SCROW nEndRow = p->aEnd.Row();
- for (p = rClipRanges.Next(); p; p = rClipRanges.Next())
+ for ( size_t i = 1, n = rClipRanges.size(); i < n; ++i )
{
+ p = rClipRanges[ i ];
if (p->aStart.Col() < nStartCol)
nStartCol = p->aStart.Col();
if (p->aStart.Row() < nStartRow)
@@ -2458,15 +2528,15 @@ void ScDocument::GetClipStart(SCCOL& nClipX, SCROW& nClipY)
if (bIsClip)
{
ScRangeList& rClipRanges = GetClipParam().maRanges;
- if (rClipRanges.Count())
+ if ( !rClipRanges.empty() )
{
- nClipX = rClipRanges.First()->aStart.Col();
- nClipY = rClipRanges.First()->aStart.Row();
+ nClipX = rClipRanges.front()->aStart.Col();
+ nClipY = rClipRanges.front()->aStart.Row();
}
}
else
{
- DBG_ERROR("GetClipStart: kein Clip");
+ OSL_FAIL("GetClipStart: kein Clip");
}
}
@@ -2479,11 +2549,12 @@ sal_Bool ScDocument::HasClipFilteredRows()
++nCountTab;
ScRangeList& rClipRanges = GetClipParam().maRanges;
- if (!rClipRanges.Count())
+ if ( rClipRanges.empty() )
return false;
- for (ScRange* p = rClipRanges.First(); p; p = rClipRanges.Next())
+ for ( size_t i = 0, n = rClipRanges.size(); i < n; ++i )
{
+ ScRange* p = rClipRanges[ i ];
bool bAnswer = pTab[nCountTab]->HasFilteredRows(p->aStart.Row(), p->aEnd.Row());
if (bAnswer)
return true;
@@ -2525,7 +2596,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
sal_Bool bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS );
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
SCTAB nCount = GetTableCount();
for (SCTAB i=0; i<nCount; i++)
@@ -2541,11 +2612,11 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
else
pMixDoc->AddUndoTab( i, i );
pTab[i]->CopyToTable( nStartCol,nStartRow, nEndCol,nEndRow,
- IDF_CONTENTS, sal_False, pMixDoc->pTab[i] );
+ IDF_CONTENTS, false, pMixDoc->pTab[i] );
}
pTab[i]->DeleteArea( nStartCol,nStartRow, nEndCol,nEndRow, nDelFlags);
pTab[nSrcTab]->CopyToTable( nStartCol,nStartRow, nEndCol,nEndRow,
- nFlags, sal_False, pTab[i], NULL, bAsLink );
+ nFlags, false, pTab[i], NULL, bAsLink );
if (bDoMix)
pTab[i]->MixData( nStartCol,nStartRow, nEndCol,nEndRow,
@@ -2558,7 +2629,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
}
else
{
- DBG_ERROR("falsche Tabelle");
+ OSL_FAIL("falsche Tabelle");
}
}
@@ -2577,7 +2648,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
sal_Bool bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS );
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ SetAutoCalc( false ); // avoid multiple calculations
ScRange aArea;
rMark.GetMultiMarkArea( aArea );
@@ -2617,7 +2688,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
}
else
{
- DBG_ERROR("falsche Tabelle");
+ OSL_FAIL("falsche Tabelle");
}
}
@@ -2661,12 +2732,12 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, sal_Bool bFo
sal_Bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
+ ScSetStringParam* pParam )
{
if ( ValidTab(nTab) && pTab[nTab] )
- return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter, bDetectNumberFormat );
+ return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pParam );
else
- return sal_False;
+ return false;
}
@@ -2686,6 +2757,12 @@ void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString
rString.Erase();
}
+void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
+{
+ String aStr;
+ GetString(nCol, nRow, nTab, aStr);
+ rString = aStr;
+}
void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
{
@@ -2715,7 +2792,7 @@ double ScDocument::GetValue( const ScAddress& rPos )
void ScDocument::GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
- sal_uInt32& rFormat )
+ sal_uInt32& rFormat ) const
{
if (VALIDTAB(nTab))
if (pTab[nTab])
@@ -2726,6 +2803,32 @@ void ScDocument::GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
rFormat = 0;
}
+sal_uInt32 ScDocument::GetNumberFormat( const ScRange& rRange ) const
+{
+ SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab();
+ SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col();
+ SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
+
+ if (!ValidTab(nTab1) || !ValidTab(nTab2) || !pTab[nTab1] || !pTab[nTab2])
+ return 0;
+
+ sal_uInt32 nFormat = 0;
+ bool bFirstItem = true;
+ for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab)
+ for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
+ {
+ sal_uInt32 nThisFormat = pTab[nTab]->GetNumberFormat(nCol, nRow1, nRow2);
+ if (bFirstItem)
+ {
+ nFormat = nThisFormat;
+ bFirstItem = false;
+ }
+ else if (nThisFormat != nFormat)
+ return 0;
+ }
+
+ return nFormat;
+}
sal_uInt32 ScDocument::GetNumberFormat( const ScAddress& rPos ) const
{
@@ -2757,11 +2860,10 @@ void ScDocument::GetNumberFormatInfo( short& nType, sal_uLong& nIndex,
}
-void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula,
- sal_Bool bAsciiExport ) const
+void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula ) const
{
if ( VALIDTAB(nTab) && pTab[nTab] )
- pTab[nTab]->GetFormula( nCol, nRow, rFormula, bAsciiExport );
+ pTab[nTab]->GetFormula( nCol, nRow, rFormula );
else
rFormula.Erase();
}
@@ -2793,7 +2895,7 @@ void ScDocument::GetCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
rpCell = pTab[nTab]->GetCell( nCol, nRow );
else
{
- DBG_ERROR("GetCell ohne Tabelle");
+ OSL_FAIL("GetCell ohne Tabelle");
rpCell = NULL;
}
}
@@ -2805,7 +2907,7 @@ ScBaseCell* ScDocument::GetCell( const ScAddress& rPos ) const
if (ValidTab(nTab) && pTab[nTab])
return pTab[nTab]->GetCell( rPos );
- DBG_ERROR("GetCell ohne Tabelle");
+ OSL_FAIL("GetCell ohne Tabelle");
return NULL;
}
@@ -2815,7 +2917,7 @@ sal_Bool ScDocument::HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
if ( VALIDTAB(nTab) && pTab[nTab] )
return pTab[nTab]->HasStringData( nCol, nRow );
else
- return sal_False;
+ return false;
}
@@ -2824,7 +2926,7 @@ sal_Bool ScDocument::HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
if ( VALIDTAB(nTab) && pTab[nTab] )
return pTab[nTab]->HasValueData( nCol, nRow );
else
- return sal_False;
+ return false;
}
@@ -2843,7 +2945,7 @@ sal_Bool ScDocument::HasStringCells( const ScRange& rRange ) const
if ( pTab[nTab] && pTab[nTab]->HasStringCells( nStartCol, nStartRow, nEndCol, nEndRow ) )
return sal_True;
- return sal_False;
+ return false;
}
@@ -2917,7 +3019,7 @@ void ScDocument::InitializeAllNoteCaptions( bool bForced )
void ScDocument::SetDirty()
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- bAutoCalc = sal_False; // keine Mehrfachberechnung
+ bAutoCalc = false; // keine Mehrfachberechnung
{ // scope for bulk broadcast
ScBulkBroadcast aBulkBroadcast( GetBASM());
for (SCTAB i=0; i<=MAXTAB; i++)
@@ -2937,7 +3039,7 @@ void ScDocument::SetDirty()
void ScDocument::SetDirty( const ScRange& rRange )
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- bAutoCalc = sal_False; // keine Mehrfachberechnung
+ bAutoCalc = false; // keine Mehrfachberechnung
{ // scope for bulk broadcast
ScBulkBroadcast aBulkBroadcast( GetBASM());
SCTAB nTab2 = rRange.aEnd.Tab();
@@ -2951,7 +3053,7 @@ void ScDocument::SetDirty( const ScRange& rRange )
void ScDocument::SetTableOpDirty( const ScRange& rRange )
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- bAutoCalc = sal_False; // no multiple recalculation
+ bAutoCalc = false; // no multiple recalculation
SCTAB nTab2 = rRange.aEnd.Tab();
for (SCTAB i=rRange.aStart.Tab(); i<=nTab2; i++)
if (pTab[i]) pTab[i]->SetTableOpDirty( rRange );
@@ -2961,10 +3063,9 @@ void ScDocument::SetTableOpDirty( const ScRange& rRange )
void ScDocument::InterpretDirtyCells( const ScRangeList& rRanges )
{
- sal_uLong nRangeCount = rRanges.Count();
- for (sal_uLong nPos=0; nPos<nRangeCount; nPos++)
+ for (size_t nPos=0, nRangeCount = rRanges.size(); nPos < nRangeCount; nPos++)
{
- ScCellIterator aIter( this, *rRanges.GetObject(nPos) );
+ ScCellIterator aIter( this, *rRanges[ nPos ] );
ScBaseCell* pCell = aIter.GetFirst();
while (pCell)
{
@@ -2981,17 +3082,20 @@ void ScDocument::InterpretDirtyCells( const ScRangeList& rRanges )
void ScDocument::AddTableOpFormulaCell( ScFormulaCell* pCell )
{
- ScInterpreterTableOpParams* p = aTableOpList.Last();
- if ( p && p->bCollectNotifications )
+ if ( !aTableOpList.empty() )
{
- if ( p->bRefresh )
- { // refresh pointers only
- p->aNotifiedFormulaCells.push_back( pCell );
- }
- else
- { // init both, address and pointer
- p->aNotifiedFormulaCells.push_back( pCell );
- p->aNotifiedFormulaPos.push_back( pCell->aPos );
+ ScInterpreterTableOpParams* p = &aTableOpList.back();
+ if ( p->bCollectNotifications )
+ {
+ if ( p->bRefresh )
+ { // refresh pointers only
+ p->aNotifiedFormulaCells.push_back( pCell );
+ }
+ else
+ { // init both, address and pointer
+ p->aNotifiedFormulaCells.push_back( pCell );
+ p->aNotifiedFormulaPos.push_back( pCell->aPos );
+ }
}
}
}
@@ -3026,11 +3130,11 @@ void ScDocument::CompileAll()
void ScDocument::CompileXML()
{
sal_Bool bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( sal_False );
+ SetAutoCalc( false );
ScProgress aProgress( GetDocumentShell(), ScGlobal::GetRscString(
STR_PROGRESS_CALCULATING ), GetXMLImportedFormulaCount() );
- // #b6355215# set AutoNameCache to speed up automatic name lookup
+ // set AutoNameCache to speed up automatic name lookup
DBG_ASSERT( !pAutoNameCache, "AutoNameCache already set" );
pAutoNameCache = new ScAutoNameCache( this );
@@ -3061,9 +3165,9 @@ void ScDocument::CalcAfterLoad()
if (pTab[i]) pTab[i]->CalcAfterLoad();
for (i=0; i<=MAXTAB; i++)
if (pTab[i]) pTab[i]->SetDirtyAfterLoad();
- bCalcingAfterLoad = sal_False;
+ bCalcingAfterLoad = false;
- SetDetectiveDirty(sal_False); // noch keine wirklichen Aenderungen
+ SetDetectiveDirty(false); // noch keine wirklichen Aenderungen
// #i112436# If formula cells are already dirty, they don't broadcast further changes.
// So the source ranges of charts must be interpreted even if they are not visible,
@@ -3109,6 +3213,11 @@ void ScDocument::SetColWidth( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth )
pTab[nTab]->SetColWidth( nCol, nNewWidth );
}
+void ScDocument::SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth )
+{
+ if ( ValidTab(nTab) && pTab[nTab] )
+ pTab[nTab]->SetColWidthOnly( nCol, nNewWidth );
+}
void ScDocument::SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight )
{
@@ -3141,7 +3250,7 @@ sal_uInt16 ScDocument::GetColWidth( SCCOL nCol, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetColWidth( nCol );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3150,7 +3259,7 @@ sal_uInt16 ScDocument::GetOriginalWidth( SCCOL nCol, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetOriginalWidth( nCol );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3159,7 +3268,7 @@ sal_uInt16 ScDocument::GetCommonWidth( SCCOL nEndCol, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetCommonWidth( nEndCol );
- DBG_ERROR("Wrong table number");
+ OSL_FAIL("Wrong table number");
return 0;
}
@@ -3168,7 +3277,7 @@ sal_uInt16 ScDocument::GetOriginalHeight( SCROW nRow, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetOriginalHeight( nRow );
- DBG_ERROR("Wrong table number");
+ OSL_FAIL("Wrong table number");
return 0;
}
@@ -3177,7 +3286,7 @@ sal_uInt16 ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetRowHeight( nRow, NULL, NULL, bHiddenAsZero );
- DBG_ERROR("Wrong sheet number");
+ OSL_FAIL("Wrong sheet number");
return 0;
}
@@ -3186,7 +3295,7 @@ sal_uInt16 ScDocument::GetRowHeight( SCROW nRow, SCTAB nTab, SCROW* pStartRow, S
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetRowHeight( nRow, pStartRow, pEndRow, bHiddenAsZero );
- DBG_ERROR("Wrong sheet number");
+ OSL_FAIL("Wrong sheet number");
return 0;
}
@@ -3203,7 +3312,7 @@ sal_uLong ScDocument::GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab )
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetRowHeight( nStartRow, nEndRow);
- DBG_ERROR("wrong sheet number");
+ OSL_FAIL("wrong sheet number");
return 0;
}
@@ -3226,7 +3335,7 @@ sal_uLong ScDocument::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow,
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetScaledRowHeight( nStartRow, nEndRow, fScale);
- DBG_ERROR("wrong sheet number");
+ OSL_FAIL("wrong sheet number");
return 0;
}
@@ -3234,7 +3343,7 @@ SCROW ScDocument::GetHiddenRowCount( SCROW nRow, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetHiddenRowCount( nRow );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3243,7 +3352,7 @@ sal_uLong ScDocument::GetColOffset( SCCOL nCol, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetColOffset( nCol );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3252,21 +3361,21 @@ sal_uLong ScDocument::GetRowOffset( SCROW nRow, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetRowOffset( nRow );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
sal_uInt16 ScDocument::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev,
- double nPPTX, double nPPTY,
- const Fraction& rZoomX, const Fraction& rZoomY,
- sal_Bool bFormula, const ScMarkData* pMarkData,
- sal_Bool bSimpleTextImport )
+ double nPPTX, double nPPTY,
+ const Fraction& rZoomX, const Fraction& rZoomY,
+ sal_Bool bFormula, const ScMarkData* pMarkData,
+ const ScColWidthParam* pParam )
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetOptimalColWidth( nCol, pDev, nPPTX, nPPTY,
- rZoomX, rZoomY, bFormula, pMarkData, bSimpleTextImport );
- DBG_ERROR("Falsche Tabellennummer");
+ rZoomX, rZoomY, bFormula, pMarkData, pParam );
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3280,7 +3389,7 @@ long ScDocument::GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab,
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetNeededSize
( nCol, nRow, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bWidth, bTotalSize );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3295,8 +3404,8 @@ sal_Bool ScDocument::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTa
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->SetOptimalHeight( nStartRow, nEndRow, nExtra,
pDev, nPPTX, nPPTY, rZoomX, rZoomY, bShrink );
- DBG_ERROR("Falsche Tabellennummer");
- return sal_False;
+ OSL_FAIL("Falsche Tabellennummer");
+ return false;
}
@@ -3316,8 +3425,9 @@ void ScDocument::UpdateAllRowHeights( OutputDevice* pDev, double nPPTX, double n
for ( SCTAB nTab=0; nTab<=MAXTAB; nTab++ )
if ( pTab[nTab] && ( !pTabMark || pTabMark->GetTableSelect(nTab) ) )
{
- pTab[nTab]->SetOptimalHeight( 0, MAXROW, 0,
- pDev, nPPTX, nPPTY, rZoomX, rZoomY, sal_False, &aProgress, nProgressStart );
+ pTab[nTab]->SetOptimalHeightOnly( 0, MAXROW, 0,
+ pDev, nPPTX, nPPTY, rZoomX, rZoomY, false, &aProgress, nProgressStart );
+ pTab[nTab]->SetDrawPageSize(true, true);
nProgressStart += pTab[nTab]->GetWeightedCount();
}
}
@@ -3348,13 +3458,6 @@ void ScDocument::ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, sal_Bool bShow)
}
-void ScDocument::SetColFlags( SCCOL nCol, SCTAB nTab, sal_uInt8 nNewFlags )
-{
- if ( ValidTab(nTab) && pTab[nTab] )
- pTab[nTab]->SetColFlags( nCol, nNewFlags );
-}
-
-
void ScDocument::SetRowFlags( SCROW nRow, SCTAB nTab, sal_uInt8 nNewFlags )
{
if ( ValidTab(nTab) && pTab[nTab] )
@@ -3373,7 +3476,7 @@ sal_uInt8 ScDocument::GetColFlags( SCCOL nCol, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetColFlags( nCol );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3381,7 +3484,7 @@ sal_uInt8 ScDocument::GetRowFlags( SCROW nRow, SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetRowFlags( nRow );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
return 0;
}
@@ -3400,12 +3503,12 @@ const ScBitMaskCompressedArray< SCROW, sal_uInt8> & ScDocument::GetRowFlagsArray
pFlags = pTab[nTab]->GetRowFlagsArray();
else
{
- DBG_ERROR("wrong sheet number");
+ OSL_FAIL("wrong sheet number");
pFlags = 0;
}
if (!pFlags)
{
- DBG_ERROR("no row flags at sheet");
+ OSL_FAIL("no row flags at sheet");
static ScBitMaskCompressedArray< SCROW, sal_uInt8> aDummy( MAXROW, 0);
pFlags = &aDummy;
}
@@ -3506,18 +3609,6 @@ bool ScDocument::RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow, SCROW* pLas
return pTab[nTab]->RowHidden(nRow, pFirstRow, pLastRow);
}
-bool ScDocument::RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow)
-{
- if (!ValidTab(nTab) || !pTab[nTab])
- {
- rLastRow = nRow;
- return false;
- }
-
- return pTab[nTab]->RowHidden(nRow, rLastRow);
-}
-
-
bool ScDocument::HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
{
if (!ValidTab(nTab) || !pTab[nTab])
@@ -3526,17 +3617,6 @@ bool ScDocument::HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
return pTab[nTab]->HasHiddenRows(nStartRow, nEndRow);
}
-bool ScDocument::ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol)
-{
- if (!ValidTab(nTab) || !pTab[nTab])
- {
- rLastCol = nCol;
- return false;
- }
-
- return pTab[nTab]->ColHidden(nCol, rLastCol);
-}
-
bool ScDocument::ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol, SCCOL* pLastCol)
{
if (!ValidTab(nTab) || !pTab[nTab])
@@ -3623,13 +3703,6 @@ void ScDocument::SetRowFiltered(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool
pTab[nTab]->SetRowFiltered(nStartRow, nEndRow, bFiltered);
}
-void ScDocument::SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bFiltered)
-{
- if (!ValidTab(nTab) || !pTab[nTab])
- return;
-
- pTab[nTab]->SetColFiltered(nStartCol, nEndCol, bFiltered);
-}
SCROW ScDocument::FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
{
@@ -3709,44 +3782,50 @@ SCCOL ScDocument::GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) const
SCROW ScDocument::GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCareManualSize) const
{
- const ScBitMaskCompressedArray< SCROW, sal_uInt8> * pRowFlagsArray;
- if ( ValidTab(nTab) && pTab[nTab] && ((pRowFlagsArray = pTab[nTab]->GetRowFlagsArray()) != NULL) &&
- pTab[nTab]->mpRowHeights && pTab[nTab]->mpHiddenRows )
- {
- size_t nIndex; // ignored
- SCROW nFlagsEndRow;
- SCROW nHiddenEndRow;
- SCROW nHeightEndRow;
- sal_uInt8 nFlags;
- bool bHidden;
- sal_uInt16 nHeight;
- sal_uInt8 nStartFlags = nFlags = pRowFlagsArray->GetValue( nStart, nIndex, nFlagsEndRow);
- bool bStartHidden = bHidden = pTab[nTab]->RowHidden( nStart, NULL, &nHiddenEndRow);
- sal_uInt16 nStartHeight = nHeight = pTab[nTab]->GetRowHeight( nStart, NULL, &nHeightEndRow, false);
- SCROW nRow;
- while ((nRow = std::min( nHiddenEndRow, std::min( nFlagsEndRow, nHeightEndRow)) + 1) <= MAXROW)
- {
- if (nFlagsEndRow < nRow)
- nFlags = pRowFlagsArray->GetValue( nRow, nIndex, nFlagsEndRow);
- if (nHiddenEndRow < nRow)
- bHidden = pTab[nTab]->RowHidden( nRow, NULL, &nHiddenEndRow);
- if (nHeightEndRow < nRow)
- nHeight = pTab[nTab]->GetRowHeight( nRow, NULL, &nHeightEndRow, false);
- if ( ((nStartFlags & CR_MANUALBREAK) != (nFlags & CR_MANUALBREAK)) ||
- ((nStartFlags & CR_MANUALSIZE) != (nFlags & CR_MANUALSIZE)) ||
- (bStartHidden != bHidden) ||
- (bCareManualSize && (nStartFlags & CR_MANUALSIZE) && (nStartHeight != nHeight)) ||
- (!bCareManualSize && ((nStartHeight != nHeight))))
- return nRow;
- }
- return MAXROW+1;
- }
- return 0;
+ if (!ValidTab(nTab) || !pTab[nTab])
+ return 0;
+
+ const ScBitMaskCompressedArray<SCROW, sal_uInt8>* pRowFlagsArray = pTab[nTab]->GetRowFlagsArray();
+ if (!pRowFlagsArray)
+ return 0;
+
+ if (!pTab[nTab]->mpRowHeights || !pTab[nTab]->mpHiddenRows)
+ return 0;
+
+ size_t nIndex; // ignored
+ SCROW nFlagsEndRow;
+ SCROW nHiddenEndRow;
+ SCROW nHeightEndRow;
+ sal_uInt8 nFlags;
+ bool bHidden;
+ sal_uInt16 nHeight;
+ sal_uInt8 nStartFlags = nFlags = pRowFlagsArray->GetValue( nStart, nIndex, nFlagsEndRow);
+ bool bStartHidden = bHidden = pTab[nTab]->RowHidden( nStart, NULL, &nHiddenEndRow);
+ sal_uInt16 nStartHeight = nHeight = pTab[nTab]->GetRowHeight( nStart, NULL, &nHeightEndRow, false);
+ SCROW nRow;
+ while ((nRow = std::min( nHiddenEndRow, std::min( nFlagsEndRow, nHeightEndRow)) + 1) <= MAXROW)
+ {
+ if (nFlagsEndRow < nRow)
+ nFlags = pRowFlagsArray->GetValue( nRow, nIndex, nFlagsEndRow);
+ if (nHiddenEndRow < nRow)
+ bHidden = pTab[nTab]->RowHidden( nRow, NULL, &nHiddenEndRow);
+ if (nHeightEndRow < nRow)
+ nHeight = pTab[nTab]->GetRowHeight( nRow, NULL, &nHeightEndRow, false);
+
+ if (((nStartFlags & CR_MANUALBREAK) != (nFlags & CR_MANUALBREAK)) ||
+ ((nStartFlags & CR_MANUALSIZE) != (nFlags & CR_MANUALSIZE)) ||
+ (bStartHidden != bHidden) ||
+ (bCareManualSize && (nStartFlags & CR_MANUALSIZE) && (nStartHeight != nHeight)) ||
+ (!bCareManualSize && ((nStartHeight != nHeight))))
+ return nRow;
+ }
+
+ return MAXROW+1;
}
sal_Bool ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault)
{
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
nDefault = 0;
ScDocAttrIterator aDocAttrItr(this, nTab, nCol, 0, nCol, nLastRow);
SCCOL nColumn;
@@ -3778,7 +3857,7 @@ sal_Bool ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCRO
}
ScDefaultAttrSet::iterator aDefaultItr = aSet.begin();
aItr = aDefaultItr;
- aItr++;
+ ++aItr;
while (aItr != aSet.end())
{
// for entries with equal count, use the one with the lowest start row,
@@ -3786,7 +3865,7 @@ sal_Bool ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCRO
if ( aItr->nCount > aDefaultItr->nCount ||
( aItr->nCount == aDefaultItr->nCount && aItr->nFirst < aDefaultItr->nFirst ) )
aDefaultItr = aItr;
- aItr++;
+ ++aItr;
}
nDefault = aDefaultItr->nFirst;
bRet = sal_True;
@@ -3798,7 +3877,7 @@ sal_Bool ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCRO
sal_Bool ScDocument::GetRowDefault( SCTAB /* nTab */, SCROW /* nRow */, SCCOL /* nLastCol */, SCCOL& /* nDefault */ )
{
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
return bRet;
}
@@ -3828,7 +3907,7 @@ const SfxPoolItem* ScDocument::GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_
return pTemp;
else
{
- DBG_ERROR( "Attribut Null" );
+ OSL_FAIL( "Attribut Null" );
}
}
return &xPoolHelper->GetDocPool()->GetDefaultItem( nWhich );
@@ -3868,12 +3947,13 @@ void ScDocument::ApplyPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatte
void ScDocument::ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow,
const ScMarkData& rMark,
- const ScPatternAttr& rAttr )
+ const ScPatternAttr& rAttr,
+ ScEditDataArray* pDataArray )
{
for (SCTAB i=0; i <= MAXTAB; i++)
if (pTab[i])
if (rMark.GetTableSelect(i))
- pTab[i]->ApplyPatternArea( nStartCol, nStartRow, nEndCol, nEndRow, rAttr );
+ pTab[i]->ApplyPatternArea( nStartCol, nStartRow, nEndCol, nEndRow, rAttr, pDataArray );
}
@@ -3885,6 +3965,14 @@ void ScDocument::ApplyPatternAreaTab( SCCOL nStartCol, SCROW nStartRow,
pTab[nTab]->ApplyPatternArea( nStartCol, nStartRow, nEndCol, nEndRow, rAttr );
}
+bool ScDocument::SetAttrEntries(SCCOL nCol, SCTAB nTab, ScAttrEntry* pData, SCSIZE nSize)
+{
+ if (!ValidTab(nTab) || !pTab[nTab])
+ return false;
+
+ return pTab[nTab]->SetAttrEntries(nCol, pData, nSize);
+}
+
void ScDocument::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
const ScMarkData& rMark, const ScPatternAttr& rPattern, short nNewType )
{
@@ -3981,7 +4069,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con
if (bFound)
{
if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
- bEqual = sal_False; // unterschiedliche
+ bEqual = false; // unterschiedliche
pStyle = pNewStyle;
}
}
@@ -3998,7 +4086,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con
if (bFound)
{
if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
- bEqual = sal_False; // unterschiedliche
+ bEqual = false; // unterschiedliche
pStyle = pNewStyle;
}
}
@@ -4043,7 +4131,7 @@ sal_Bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGat
}
}
- sal_Bool bIsUsed = sal_False;
+ sal_Bool bIsUsed = false;
for ( SCTAB i=0; i<=MAXTAB; i++ )
{
@@ -4059,7 +4147,7 @@ sal_Bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGat
}
if ( bGatherAllStyles )
- bStyleSheetUsageInvalid = sal_False;
+ bStyleSheetUsageInvalid = false;
return bIsUsed;
}
@@ -4075,8 +4163,8 @@ sal_Bool ScDocument::ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow,
if (pTab[nTab])
return pTab[nTab]->ApplyFlags( nStartCol, nStartRow, nEndCol, nEndRow, nFlags );
- DBG_ERROR("ApplyFlags: falsche Tabelle");
- return sal_False;
+ OSL_FAIL("ApplyFlags: falsche Tabelle");
+ return false;
}
@@ -4087,8 +4175,8 @@ sal_Bool ScDocument::RemoveFlagsTab( SCCOL nStartCol, SCROW nStartRow,
if (pTab[nTab])
return pTab[nTab]->RemoveFlags( nStartCol, nStartRow, nEndCol, nEndRow, nFlags );
- DBG_ERROR("RemoveFlags: falsche Tabelle");
- return sal_False;
+ OSL_FAIL("RemoveFlags: falsche Tabelle");
+ return false;
}
@@ -4161,7 +4249,7 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark,
rLineInner.SetLine(NULL, BOXINFO_LINE_VERT);
rLineInner.SetTable(sal_True);
rLineInner.SetDist(sal_True);
- rLineInner.SetMinDist(sal_False);
+ rLineInner.SetMinDist(false);
ScLineFlags aFlags;
@@ -4199,7 +4287,7 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
ScDocumentPool* pPool = xPoolHelper->GetDocPool();
- sal_Bool bAnyItem = sal_False;
+ sal_Bool bAnyItem = false;
sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE );
for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++)
{
@@ -4227,7 +4315,7 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
ScDocumentPool* pPool = xPoolHelper->GetDocPool();
- sal_Bool bHasRtl = sal_False;
+ sal_Bool bHasRtl = false;
sal_uInt32 nDirCount = pPool->GetItemCount2( ATTR_WRITINGDIR );
for (sal_uInt32 nItem=0; nItem<nDirCount; nItem++)
{
@@ -4349,8 +4437,8 @@ sal_Bool ScDocument::IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
if (pTab[nTab])
return pTab[nTab]->IsBlockEmpty( nStartCol, nStartRow, nEndCol, nEndRow, bIgnoreNotes );
- DBG_ERROR("Falsche Tabellennummer");
- return sal_False;
+ OSL_FAIL("Falsche Tabellennummer");
+ return false;
}
@@ -4360,7 +4448,7 @@ void ScDocument::LockTable(SCTAB nTab)
pTab[nTab]->LockTable();
else
{
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
}
}
@@ -4371,7 +4459,7 @@ void ScDocument::UnlockTable(SCTAB nTab)
pTab[nTab]->UnlockTable();
else
{
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
}
}
@@ -4384,8 +4472,8 @@ sal_Bool ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartR
if ( !bImportingXML && !mbChangeReadOnlyEnabled && pShell && pShell->IsReadOnly() )
{
if ( pOnlyNotBecauseOfMatrix )
- *pOnlyNotBecauseOfMatrix = sal_False;
- return sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
+ return false;
}
if (VALIDTAB(nTab))
@@ -4393,10 +4481,10 @@ sal_Bool ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartR
return pTab[nTab]->IsBlockEditable( nStartCol, nStartRow, nEndCol,
nEndRow, pOnlyNotBecauseOfMatrix );
- DBG_ERROR("Falsche Tabellennummer");
+ OSL_FAIL("Falsche Tabellennummer");
if ( pOnlyNotBecauseOfMatrix )
- *pOnlyNotBecauseOfMatrix = sal_False;
- return sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
+ return false;
}
@@ -4407,8 +4495,8 @@ sal_Bool ScDocument::IsSelectionEditable( const ScMarkData& rMark,
if ( !bImportingXML && !mbChangeReadOnlyEnabled && pShell && pShell->IsReadOnly() )
{
if ( pOnlyNotBecauseOfMatrix )
- *pOnlyNotBecauseOfMatrix = sal_False;
- return sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
+ return false;
}
ScRange aRange;
@@ -4426,7 +4514,7 @@ sal_Bool ScDocument::IsSelectionEditable( const ScMarkData& rMark,
aRange.aStart.Row(), aRange.aEnd.Col(),
aRange.aEnd.Row(), pOnlyNotBecauseOfMatrix ) )
{
- bOk = sal_False;
+ bOk = false;
if ( pOnlyNotBecauseOfMatrix )
bMatrix = *pOnlyNotBecauseOfMatrix;
}
@@ -4435,7 +4523,7 @@ sal_Bool ScDocument::IsSelectionEditable( const ScMarkData& rMark,
{
if ( !pTab[i]->IsSelectionEditable( rMark, pOnlyNotBecauseOfMatrix ) )
{
- bOk = sal_False;
+ bOk = false;
if ( pOnlyNotBecauseOfMatrix )
bMatrix = *pOnlyNotBecauseOfMatrix;
}
@@ -4459,17 +4547,26 @@ sal_Bool ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nSta
if (pTab[i])
if (rMark.GetTableSelect(i))
if (pTab[i]->HasBlockMatrixFragment( nStartCol, nStartRow, nEndCol, nEndRow ))
- bOk = sal_False;
+ bOk = false;
return !bOk;
}
+sal_Bool ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const
+{
+ sal_Bool bOk = true;
+ if ( pTab[nTab] && pTab[nTab]->HasBlockMatrixFragment( nStartCol, nStartRow, nEndCol, nEndRow ) )
+ {
+ bOk = false;
+ }
+ return !bOk;
+}
sal_Bool ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix )
{
// if rCell is part of a matrix formula, return its complete range
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScBaseCell* pCell = GetCell( rCellPos );
if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
{
@@ -4513,7 +4610,7 @@ sal_Bool ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange&
sal_Bool ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow,
SCCOL nEndCol, SCROW nEndRow, SCTAB nTab )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if ( ValidColRow(rStartCol,rStartRow) && ValidColRow(nEndCol,nEndRow) && ValidTab(nTab) )
{
if (pTab[nTab])
@@ -4558,7 +4655,7 @@ sal_Bool ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow,
}
else
{
- DBG_ERROR("ExtendOverlapped: falscher Bereich");
+ OSL_FAIL("ExtendOverlapped: falscher Bereich");
}
return bFound;
@@ -4571,7 +4668,7 @@ sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
{
// use all selected sheets from rMark
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nOldEndCol = rEndCol;
SCROW nOldEndRow = rEndRow;
@@ -4596,7 +4693,7 @@ sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
SCCOL& rEndCol, SCROW& rEndRow,
SCTAB nTab, sal_Bool bRefresh, sal_Bool bAttrs )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if ( ValidColRow(nStartCol,nStartRow) && ValidColRow(rEndCol,rEndRow) && ValidTab(nTab) )
{
if (pTab[nTab])
@@ -4607,7 +4704,7 @@ sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
}
else
{
- DBG_ERROR("ExtendMerge: falscher Bereich");
+ OSL_FAIL("ExtendMerge: falscher Bereich");
}
return bFound;
@@ -4616,7 +4713,7 @@ sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh, sal_Bool bAttrs )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCTAB nStartTab = rRange.aStart.Tab();
SCTAB nEndTab = rRange.aEnd.Tab();
SCCOL nEndCol = rRange.aEnd.Col();
@@ -4648,7 +4745,7 @@ sal_Bool ScDocument::ExtendTotalMerge( ScRange& rRange )
// Bereich genau dann auf zusammengefasste Zellen erweitern, wenn
// dadurch keine neuen nicht-ueberdeckten Zellen getroffen werden
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScRange aExt = rRange;
if (ExtendMerge(aExt))
{
@@ -4675,7 +4772,7 @@ sal_Bool ScDocument::ExtendTotalMerge( ScRange& rRange )
sal_Bool ScDocument::ExtendOverlapped( ScRange& rRange )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCTAB nStartTab = rRange.aStart.Tab();
SCTAB nEndTab = rRange.aEnd.Tab();
SCCOL nStartCol = rRange.aStart.Col();
@@ -4742,6 +4839,13 @@ sal_Bool ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow,
return bChange;
}
+void ScDocument::SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const
+{
+ while (IsHorOverlapped(rCol, rRow, nTab))
+ --rCol;
+ while (IsVerOverlapped(rCol, rRow, nTab))
+ --rRow;
+}
sal_Bool ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
{
@@ -4751,8 +4855,8 @@ sal_Bool ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
return pAttr->IsHorOverlapped();
else
{
- DBG_ERROR("Overlapped: Attr==0");
- return sal_False;
+ OSL_FAIL("Overlapped: Attr==0");
+ return false;
}
}
@@ -4765,8 +4869,8 @@ sal_Bool ScDocument::IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
return pAttr->IsVerOverlapped();
else
{
- DBG_ERROR("Overlapped: Attr==0");
- return sal_False;
+ OSL_FAIL("Overlapped: Attr==0");
+ return false;
}
}
@@ -4776,15 +4880,15 @@ void ScDocument::ApplySelectionFrame( const ScMarkData& rMark,
const SvxBoxInfoItem* pLineInner )
{
ScRangeList aRangeList;
- rMark.FillRangeListWithMarks( &aRangeList, sal_False );
- sal_uLong nRangeCount = aRangeList.Count();
+ rMark.FillRangeListWithMarks( &aRangeList, false );
+ size_t nRangeCount = aRangeList.size();
for (SCTAB i=0; i<=MAXTAB; i++)
{
if (pTab[i] && rMark.GetTableSelect(i))
{
- for (sal_uLong j=0; j<nRangeCount; j++)
+ for ( size_t j=0; j < nRangeCount; j++ )
{
- ScRange aRange = *aRangeList.GetObject(j);
+ ScRange aRange = *aRangeList[ j ];
pTab[i]->ApplyBlockFrame( pLineOuter, pLineInner,
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row() );
@@ -4808,10 +4912,10 @@ void ScDocument::ApplyFrameAreaTab( const ScRange& rRange,
}
-void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark )
+void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark, ScEditDataArray* pDataArray )
{
const SfxItemSet* pSet = &rAttr.GetItemSet();
- sal_Bool bSet = sal_False;
+ sal_Bool bSet = false;
sal_uInt16 i;
for (i=ATTR_PATTERN_START; i<=ATTR_PATTERN_END && !bSet; i++)
if (pSet->GetItemState(i) == SFX_ITEM_SET)
@@ -4825,7 +4929,7 @@ void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMark
ScRange aRange;
rMark.GetMarkArea( aRange );
ApplyPatternArea( aRange.aStart.Col(), aRange.aStart.Row(),
- aRange.aEnd.Col(), aRange.aEnd.Row(), rMark, rAttr );
+ aRange.aEnd.Col(), aRange.aEnd.Row(), rMark, rAttr, pDataArray );
}
else
{
@@ -4833,7 +4937,7 @@ void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMark
for (SCTAB nTab=0; nTab<=MAXTAB; nTab++)
if (pTab[nTab])
if (rMark.GetTableSelect(nTab))
- pTab[nTab]->ApplySelectionCache( &aCache, rMark );
+ pTab[nTab]->ApplySelectionCache( &aCache, rMark, pDataArray );
}
}
}
@@ -4869,7 +4973,7 @@ void ScDocument::DeleteSelectionTab( SCTAB nTab, sal_uInt16 nDelFlag, const ScMa
pTab[nTab]->DeleteSelection( nDelFlag, rMark );
else
{
- DBG_ERROR("Falsche Tabelle");
+ OSL_FAIL("Falsche Tabelle");
}
}
@@ -4924,7 +5028,7 @@ void ScDocument::GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX,
DBG_ASSERT( !nMovX || !nMovY, "GetNextPos: nur X oder Y" );
ScMarkData aCopyMark = rMark;
- aCopyMark.SetMarking(sal_False);
+ aCopyMark.SetMarking(false);
aCopyMark.MarkToMulti();
if (ValidTab(nTab) && pTab[nTab])
@@ -5003,18 +5107,6 @@ sal_uLong ScDocument::GetCodeCount() const
}
-sal_uLong ScDocument::GetWeightedCount() const
-{
- sal_uLong nCellCount = 0L;
-
- for ( SCTAB nTab=0; nTab<=MAXTAB; nTab++ )
- if ( pTab[nTab] )
- nCellCount += pTab[nTab]->GetWeightedCount();
-
- return nCellCount;
-}
-
-
void ScDocument::PageStyleModified( SCTAB nTab, const String& rNewName )
{
if ( ValidTab(nTab) && pTab[nTab] )
@@ -5049,7 +5141,7 @@ Size ScDocument::GetPageSize( SCTAB nTab ) const
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->GetPageSize();
- DBG_ERROR("falsche Tab");
+ OSL_FAIL("falsche Tab");
return Size();
}
@@ -5083,8 +5175,8 @@ sal_Bool ScDocument::HasManualBreaks( SCTAB nTab ) const
if ( ValidTab(nTab) && pTab[nTab] )
return pTab[nTab]->HasManualBreaks();
- DBG_ERROR("falsche Tab");
- return sal_False;
+ OSL_FAIL("falsche Tab");
+ return false;
}
@@ -5098,7 +5190,7 @@ void ScDocument::GetDocStat( ScDocStat& rDocStat )
sal_Bool ScDocument::HasPrintRange()
{
- sal_Bool bResult = sal_False;
+ sal_Bool bResult = false;
for ( SCTAB i=0; !bResult && i<nMaxTableNumber; i++ )
if ( pTab[i] )
@@ -5164,13 +5256,6 @@ void ScDocument::AddPrintRange( SCTAB nTab, const ScRange& rNew )
}
-//UNUSED2009-05 void ScDocument::SetPrintRange( SCTAB nTab, const ScRange& rNew )
-//UNUSED2009-05 {
-//UNUSED2009-05 if (ValidTab(nTab) && pTab[nTab])
-//UNUSED2009-05 pTab[nTab]->SetPrintRange( rNew );
-//UNUSED2009-05 }
-
-
void ScDocument::SetPrintEntireSheet( SCTAB nTab )
{
if (ValidTab(nTab) && pTab[nTab])
@@ -5234,7 +5319,7 @@ sal_Bool ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const
}
}
- return sal_False; // sonst nicht
+ return false; // sonst nicht
}
SfxUndoManager* ScDocument::GetUndoManager()
@@ -5251,6 +5336,55 @@ ScRowBreakIterator* ScDocument::GetRowBreakIterator(SCTAB nTab) const
return NULL;
}
+void ScDocument::AddSubTotalCell(ScFormulaCell* pCell)
+{
+ maSubTotalCells.insert(pCell);
+}
+
+void ScDocument::RemoveSubTotalCell(ScFormulaCell* pCell)
+{
+ maSubTotalCells.erase(pCell);
+}
+
+namespace {
+
+bool lcl_hasDirtyRange(ScFormulaCell* pCell, const ScRange& rDirtyRange)
+{
+ ScDetectiveRefIter aRefIter(pCell);
+ ScRange aRange;
+ while (aRefIter.GetNextRef(aRange))
+ {
+ if (aRange.Intersects(rDirtyRange))
+ return true;
+ }
+ return false;
+}
+
+}
+
+void ScDocument::SetSubTotalCellsDirty(const ScRange& rDirtyRange)
+{
+ // to update the list by skipping cells that no longer contain subtotal function.
+ set<ScFormulaCell*> aNewSet;
+
+ bool bOldRecalc = GetAutoCalc();
+ SetAutoCalc(false);
+ set<ScFormulaCell*>::iterator itr = maSubTotalCells.begin(), itrEnd = maSubTotalCells.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ ScFormulaCell* pCell = *itr;
+ if (pCell->IsSubTotal())
+ {
+ aNewSet.insert(pCell);
+ if (lcl_hasDirtyRange(pCell, rDirtyRange))
+ pCell->SetDirty();
+ }
+ }
+
+ SetAutoCalc(bOldRecalc);
+ maSubTotalCells.swap(aNewSet); // update the list.
+}
+
void ScDocument::EnableUndo( bool bVal )
{
GetUndoManager()->EnableUndo(bVal);
@@ -5267,3 +5401,5 @@ bool ScDocument::IsInVBAMode() const
}
return bResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpcachetable.cxx b/sc/source/core/data/dpcachetable.cxx
index 0876e814167c..67b55e7f0155 100644
--- a/sc/source/core/data/dpcachetable.cxx
+++ b/sc/source/core/data/dpcachetable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,8 +54,6 @@ using namespace ::com::sun::star;
using ::rtl::OUString;
using ::std::vector;
using ::std::pair;
-using ::std::hash_map;
-using ::std::hash_set;
using ::std::auto_ptr;
using ::com::sun::star::i18n::LocaleDataItem;
using ::com::sun::star::uno::Exception;
@@ -79,6 +78,7 @@ ScDPCacheTable::FilterItem::FilterItem() :
mbHasValue(false)
{
}
+
bool ScDPCacheTable::FilterItem::match( const ScDPItemData& rCellData ) const
{
if (rCellData.GetString()!= maString &&
@@ -86,6 +86,7 @@ bool ScDPCacheTable::FilterItem::match( const ScDPItemData& rCellData ) const
return false;
return true;
}
+
// ----------------------------------------------------------------------------
ScDPCacheTable::SingleFilter::SingleFilter(String aString, double fValue, bool bHasValue)
@@ -100,7 +101,7 @@ bool ScDPCacheTable::SingleFilter::match( const ScDPItemData& rCellData ) const
return maItem.match(rCellData);
}
-const String ScDPCacheTable::SingleFilter::getMatchString()
+const String& ScDPCacheTable::SingleFilter::getMatchString()
{
return maItem.maString;
}
@@ -157,38 +158,29 @@ ScDPCacheTable::Criterion::Criterion() :
// ----------------------------------------------------------------------------
-ScDPCacheTable::ScDPCacheTable( ScDocument* pDoc,long nId ) :
- mpCache( NULL ),
- mpNoneCache( NULL )
+ScDPCacheTable::ScDPCacheTable(ScDPCache* pCache) :
+ mpCache(pCache)
{
- if ( nId >= 0 )
- mpCache = pDoc->GetDPObjectCache( nId );
- else
- { //create a temp cache object
- InitNoneCache( NULL );
- }
}
ScDPCacheTable::~ScDPCacheTable()
{
+ delete mpCache;
}
sal_Int32 ScDPCacheTable::getRowSize() const
{
- return GetCache()->GetRowCount();
+ return getCache()->GetRowCount();
}
sal_Int32 ScDPCacheTable::getColSize() const
{
- return GetCache()->GetColumnCount();
+ return getCache()->GetColumnCount();
}
-void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, sal_Bool* pSpecial,
- bool bIgnoreEmptyRows, bool bRepeatIfEmpty )
+void ScDPCacheTable::fillTable(
+ const ScQueryParam& rQuery, bool* pSpecial, bool bIgnoreEmptyRows, bool bRepeatIfEmpty)
{
- if ( mpCache == NULL )
- InitNoneCache( NULL );
-//check cache
const SCROW nRowCount = getRowSize();
const SCCOL nColCount = (SCCOL) getColSize();
if ( nRowCount <= 0 || nColCount <= 0)
@@ -197,7 +189,6 @@ void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, sal_Bool* pSpecial,
maRowsVisible.clear();
maRowsVisible.reserve(nRowCount);
-
// Initialize field entries container.
maFieldEntries.clear();
maFieldEntries.reserve(nColCount);
@@ -205,23 +196,23 @@ void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, sal_Bool* pSpecial,
// Data rows
for (SCCOL nCol = 0; nCol < nColCount; ++nCol)
{
- SCROW nMemCount = GetCache()->GetDimMemberCount( nCol );
+ SCROW nMemCount = getCache()->GetDimMemberCount( nCol );
if ( nMemCount )
{
std::vector< SCROW > pAdded( nMemCount, -1 );
for (SCROW nRow = 0; nRow < nRowCount; ++nRow )
{
- SCROW nIndex = GetCache()->GetItemDataId( nCol, nRow, bRepeatIfEmpty );
- SCROW nOrder = GetCache()->GetOrder( nCol, nIndex );
+ SCROW nIndex = getCache()->GetItemDataId( nCol, nRow, bRepeatIfEmpty );
+ SCROW nOrder = getOrder( nCol, nIndex );
if ( nCol == 0 )
maRowsVisible.push_back(false);
if ( lcl_HasQueryEntry(rQuery) &&
- !GetCache()->ValidQuery( nRow , rQuery, pSpecial ) )
+ !getCache()->ValidQuery( nRow , rQuery, pSpecial ) )
continue;
- if ( bIgnoreEmptyRows && GetCache()->IsRowEmpty( nRow ) )
+ if ( bIgnoreEmptyRows && getCache()->IsRowEmpty( nRow ) )
continue;
// Insert a new row into cache table.
if ( nCol == 0 )
@@ -241,9 +232,6 @@ void ScDPCacheTable::fillTable( const ScQueryParam& rQuery, sal_Bool* pSpecial,
void ScDPCacheTable::fillTable()
{
- if ( mpCache == NULL )
- InitNoneCache( NULL );
-//check cache
const SCROW nRowCount = getRowSize();
const SCCOL nColCount = (SCCOL) getColSize();
if ( nRowCount <= 0 || nColCount <= 0)
@@ -260,15 +248,15 @@ void ScDPCacheTable::fillTable()
// Data rows
for (SCCOL nCol = 0; nCol < nColCount; ++nCol)
{
- SCROW nMemCount = GetCache()->GetDimMemberCount( nCol );
+ SCROW nMemCount = getCache()->GetDimMemberCount( nCol );
if ( nMemCount )
{
std::vector< SCROW > pAdded( nMemCount, -1 );
for (SCROW nRow = 0; nRow < nRowCount; ++nRow )
{
- SCROW nIndex = GetCache()->GetItemDataId( nCol, nRow, false );
- SCROW nOrder = GetCache()->GetOrder( nCol, nIndex );
+ SCROW nIndex = getCache()->GetItemDataId( nCol, nRow, false );
+ SCROW nOrder = getOrder( nCol, nIndex );
if ( nCol == 0 )
maRowsVisible.push_back(true);
@@ -284,7 +272,6 @@ void ScDPCacheTable::fillTable()
}
}
}
- return;
}
bool ScDPCacheTable::isRowActive(sal_Int32 nRow) const
@@ -296,7 +283,7 @@ bool ScDPCacheTable::isRowActive(sal_Int32 nRow) const
return maRowsVisible[nRow];
}
-void ScDPCacheTable::filterByPageDimension(const vector<Criterion>& rCriteria, const hash_set<sal_Int32>& rRepeatIfEmptyDims)
+void ScDPCacheTable::filterByPageDimension(const vector<Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims)
{
sal_Int32 nRowSize = getRowSize();
if (nRowSize != static_cast<sal_Int32>(maRowsVisible.size()))
@@ -311,8 +298,8 @@ void ScDPCacheTable::filterByPageDimension(const vector<Criterion>& rCriteria, c
const ScDPItemData* ScDPCacheTable::getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const
{
- SCROW nId= GetCache()->GetItemDataId(nCol, nRow, bRepeatIfEmpty);
- return GetCache()->GetItemDataById( nCol, nId );
+ SCROW nId= getCache()->GetItemDataId(nCol, nRow, bRepeatIfEmpty);
+ return getCache()->GetItemDataById( nCol, nId );
}
void ScDPCacheTable::getValue( ScDPValueData& rVal, SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const
@@ -329,27 +316,22 @@ void ScDPCacheTable::getValue( ScDPValueData& rVal, SCCOL nCol, SCROW nRow, boo
}
String ScDPCacheTable::getFieldName(SCCOL nIndex) const
{
- return (GetCache()->GetDimensionName( nIndex ));
-}
-
-sal_Int32 ScDPCacheTable::getFieldIndex(const String& rStr) const
-{
- return GetCache()->GetDimensionIndex( rStr );
+ return getCache()->GetDimensionName( nIndex );
}
const ::std::vector<SCROW>& ScDPCacheTable::getFieldEntries( sal_Int32 nColumn ) const
{
- if (nColumn < 0 || static_cast<size_t>(nColumn) >= maFieldEntries.size())
+ if (nColumn < 0 || static_cast<size_t>(nColumn) >= maFieldEntries.size())
{
// index out of bound. Hopefully this code will never be reached.
static const ::std::vector<SCROW> emptyEntries;
return emptyEntries;
}
- return maFieldEntries[nColumn];
+ return maFieldEntries[nColumn];
}
void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< Sequence<Any> >& rTabData,
- const hash_set<sal_Int32>& rRepeatIfEmptyDims)
+ const boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims)
{
sal_Int32 nRowSize = getRowSize();
sal_Int32 nColSize = getColSize();
@@ -391,7 +373,6 @@ void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< S
{
Any any;
bool bRepeatIfEmpty = rRepeatIfEmptyDims.count(nCol) > 0;
- // Wang Xu Ming - DataPilot migration
const ScDPItemData* pData= getCell(nCol, nRow, bRepeatIfEmpty);
if ( pData->IsValue() )
any <<= pData->GetValue();
@@ -412,25 +393,37 @@ void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< S
rTabData[i] = tableData[i];
}
+SCROW ScDPCacheTable::getOrder(long nDim, SCROW nIndex) const
+{
+ return getCache()->GetOrder(nDim, nIndex);
+}
+
void ScDPCacheTable::clear()
{
maFieldEntries.clear();
maRowsVisible.clear();
+ delete mpCache;
+ mpCache = NULL;
}
-void ScDPCacheTable::swap(ScDPCacheTable& rOther)
+bool ScDPCacheTable::empty() const
{
- maFieldEntries.swap(rOther.maFieldEntries);
- maRowsVisible.swap(rOther.maRowsVisible);
+ return mpCache == NULL || maFieldEntries.empty();
}
-bool ScDPCacheTable::empty() const
+void ScDPCacheTable::setCache(ScDPCache* p)
+{
+ delete mpCache;
+ mpCache = p;
+}
+
+bool ScDPCacheTable::hasCache() const
{
- return ( mpCache == NULL&& mpNoneCache == NULL ) || maFieldEntries.size()==0;
+ return mpCache != NULL;
}
bool ScDPCacheTable::isRowQualified(sal_Int32 nRow, const vector<Criterion>& rCriteria,
- const hash_set<sal_Int32>& rRepeatIfEmptyDims) const
+ const boost::unordered_set<sal_Int32>& rRepeatIfEmptyDims) const
{
sal_Int32 nColSize = getColSize();
vector<Criterion>::const_iterator itrEnd = rCriteria.end();
@@ -450,19 +443,14 @@ bool ScDPCacheTable::isRowQualified(sal_Int32 nRow, const vector<Criterion>& rCr
return true;
}
-
-void ScDPCacheTable::InitNoneCache( ScDocument* pDoc )
+const ScDPCache* ScDPCacheTable::getCache() const
{
- mpCache = NULL;
- if ( mpNoneCache )
- delete mpNoneCache;
- mpNoneCache = new ScDPTableDataCache( pDoc );
+ return mpCache;
}
-ScDPTableDataCache* ScDPCacheTable::GetCache() const
+ScDPCache* ScDPCacheTable::getCache()
{
- if ( mpCache )
- return mpCache;
- return mpNoneCache;
+ return mpCache;
}
-// End Comments
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx
index 9e418bf3c300..03a176c65f2f 100644
--- a/sc/source/core/data/dpdimsave.cxx
+++ b/sc/source/core/data/dpdimsave.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@ void ScDPSaveGroupItem::AddElementsFromGroup( const ScDPSaveGroupItem& rGroup )
// add all elements of the other group (used for nested grouping)
for ( std::vector<String>::const_iterator aIter(rGroup.aElements.begin());
- aIter != rGroup.aElements.end(); aIter++ )
+ aIter != rGroup.aElements.end(); ++aIter )
aElements.push_back( *aIter );
}
@@ -186,7 +187,7 @@ String ScDPSaveGroupDimension::CreateGroupName( const String& rPrefix )
++nAdd; // continue with higher number
}
- DBG_ERROR("CreateGroupName: no valid name found");
+ OSL_FAIL("CreateGroupName: no valid name found");
return EMPTY_STRING;
}
@@ -557,7 +558,7 @@ String ScDPDimensionSaveData::CreateGroupDimName( const String& rSourceName,
else
++nAdd; // continue with higher number
}
- DBG_ERROR("CreateGroupDimName: no valid name found");
+ OSL_FAIL("CreateGroupDimName: no valid name found");
return EMPTY_STRING;
}
@@ -582,3 +583,4 @@ String ScDPDimensionSaveData::CreateDateGroupDimName( sal_Int32 nDatePart, const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpglobal.cxx b/sc/source/core/data/dpglobal.cxx
index 61161f333cd3..637bc730a266 100644
--- a/sc/source/core/data/dpglobal.cxx
+++ b/sc/source/core/data/dpglobal.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -7,9 +8,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dpglobal.cxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -34,6 +32,7 @@
#include "dpglobal.hxx"
#include "document.hxx"
+#include "dpobject.hxx"
#include <stdio.h>
@@ -47,68 +46,19 @@ namespace ScDPGlobal
return rcResult;
}
- String GetFuncString( const String &rString, const sal_uInt16 nIndex )
- {
- if ( nIndex <= 1 ) return rString;
- sal_uLong uch = rString.Len() ? rString.GetChar( rString.Len()-1 ) : (L'9'+1);
- bool bEndWithDigital = ( L'0'<=uch && uch<=L'9');
- char szTemp[__MAX_NUM_LEN+1];
- int nLen = sprintf( szTemp, bEndWithDigital ? DATA_RENAME_SEPARATOR"%hu" : "%hu", nIndex );
- String strRet = rString;
- strRet.Append( String::CreateFromAscii( szTemp, static_cast<sal_uInt16>(nLen) ));
- return strRet;
- }
-
- bool ChkDPTableOverlap( ScDocument *pDestDoc, std::list<ScDPObject> & rClipboard, SCCOL nClipStartCol, SCROW nClipStartRow, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, sal_uInt16 nEndTab, sal_Bool bExcludeClip /*= sal_False*/ )
- {
- if ( ScDPCollection* pDPCollection = pDestDoc->GetDPCollection() )
- {
- sal_uInt16 nCount = pDPCollection->GetCount();
- SCsCOL nOffsetX = nStartCol - nClipStartCol;
- SCsROW nOffsetY = nStartRow - nClipStartRow;
-
- for( std::list<ScDPObject>::iterator iter = rClipboard.begin(); iter!=rClipboard.end(); iter++ )
- {
- ScRange aRange = iter->GetOutRange();
-
- for( sal_uInt16 nCurrTab = nStartTab; nCurrTab<=nEndTab; nCurrTab++ )
- {
- SCsTAB nOffsetZ = nCurrTab - aRange.aStart.Tab();
- aRange.Move( nOffsetX, nOffsetY, nOffsetZ );
-
- for ( sal_uInt16 i = 0; i<nCount; i++)
- {
- if ( (*pDPCollection)[i] && aRange.Intersects( (*pDPCollection)[i]->GetOutRange()))
- {
- if ( bExcludeClip && iter->GetOutRange() == (*pDPCollection)[i]->GetOutRange() )
- {
- continue;
- }
- return false;
- }
- }
- }
- }
- }
- return true;
}
-//end
-}
-// --------------------------------------------------------------------
-// ScDPItemDataPool
-// Construct
-ScDPItemDataPool::ScDPItemDataPool(void)
+ScDPItemDataPool::ScDPItemDataPool()
{
}
-//
+
ScDPItemDataPool::ScDPItemDataPool(const ScDPItemDataPool& r):
maItems(r.maItems),
maItemIds(r.maItemIds)
{
}
-ScDPItemDataPool::~ScDPItemDataPool(void)
+ScDPItemDataPool::~ScDPItemDataPool()
{
}
@@ -148,3 +98,4 @@ sal_Int32 ScDPItemDataPool::insertData( const ScDPItemData& aData )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 4d91544e42c8..ab2094707a86 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,8 +54,8 @@
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
#include <vector>
-#include <hash_set>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -66,8 +67,6 @@ using ::rtl::OUString;
using ::rtl::OUStringHash;
using ::std::vector;
-using ::std::hash_set;
-using ::std::hash_map;
using ::boost::shared_ptr;
#define D_TIMEFACTOR 86400.0
@@ -81,10 +80,10 @@ const sal_Int32 SC_DP_DATE_LAST = 10000;
// ============================================================================
namespace
{
- sal_Bool lcl_Search( SCCOL nSourceDim, ScDPTableDataCache* pCache , const std::vector< SCROW >& vIdx, SCROW nNew , SCROW& rIndex)
+ sal_Bool lcl_Search( SCCOL nSourceDim, const ScDPCache* pCache , const std::vector< SCROW >& vIdx, SCROW nNew , SCROW& rIndex)
{
rIndex = vIdx.size();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCROW nLo = 0;
SCROW nHi = vIdx.size() - 1;
SCROW nIndex;
@@ -113,7 +112,7 @@ namespace
return bFound;
}
- void lcl_Insert( SCCOL nSourceDim, ScDPTableDataCache* pCache , std::vector< SCROW >& vIdx, SCROW nNew )
+ void lcl_Insert( SCCOL nSourceDim, const ScDPCache* pCache , std::vector< SCROW >& vIdx, SCROW nNew )
{
SCROW nIndex = 0;
if ( !lcl_Search( nSourceDim, pCache, vIdx, nNew ,nIndex ) )
@@ -121,18 +120,18 @@ namespace
}
template<bool bUpdateData>
- SCROW lcl_InsertValue( SCCOL nSourceDim, ScDPTableDataCache* pCache , std::vector< SCROW >& vIdx, const ScDPItemData & rData );
+ SCROW lcl_InsertValue(SCCOL nSourceDim, const ScDPCache* pCache, std::vector<SCROW>& vIdx, const ScDPItemData & rData);
template<>
- SCROW lcl_InsertValue<false>( SCCOL nSourceDim, ScDPTableDataCache* pCache , std::vector< SCROW >& vIdx, const ScDPItemData & rData )
+ SCROW lcl_InsertValue<false>(SCCOL nSourceDim, const ScDPCache* pCache, std::vector<SCROW>& vIdx, const ScDPItemData & rData)
{
- SCROW nNewID = pCache->GetAdditionalItemID( rData );
- lcl_Insert( nSourceDim, pCache, vIdx, nNewID );
+ SCROW nNewID = pCache->GetAdditionalItemID(rData);
+ lcl_Insert(nSourceDim, pCache, vIdx, nNewID);
return nNewID;
}
template<>
- SCROW lcl_InsertValue<true>( SCCOL nSourceDim, ScDPTableDataCache* pCache , std::vector< SCROW >& vIdx, const ScDPItemData & rData )
+ SCROW lcl_InsertValue<true>(SCCOL nSourceDim, const ScDPCache* pCache, std::vector<SCROW>& vIdx, const ScDPItemData & rData)
{
SCROW nItemId = lcl_InsertValue<false>( nSourceDim, pCache, vIdx, rData );
@@ -143,13 +142,13 @@ namespace
}
template<bool bUpdateData>
- void lcl_InsertValue ( SCCOL nSourceDim, ScDPTableDataCache* pCache , std::vector< SCROW >& vIdx, const String& rString, const double& fValue )
+ void lcl_InsertValue ( SCCOL nSourceDim, const ScDPCache* pCache, std::vector< SCROW >& vIdx, const String& rString, const double& fValue )
{
lcl_InsertValue<bUpdateData>( nSourceDim, pCache, vIdx, ScDPItemData( rString, fValue, sal_True ) );
}
template<bool bUpdateData>
- void lcl_InsertValue ( SCCOL nSourceDim, ScDPTableDataCache* pCache , std::vector< SCROW >& vIdx, const String& rString, const double& fValue, sal_Int32 nDatePart )
+ void lcl_InsertValue ( SCCOL nSourceDim, const ScDPCache* pCache, std::vector< SCROW >& vIdx, const String& rString, const double& fValue, sal_Int32 nDatePart )
{
lcl_InsertValue<bUpdateData>( nSourceDim, pCache, vIdx, ScDPItemData( nDatePart, rString, fValue, ScDPItemData::MK_DATA|ScDPItemData::MK_VAL|ScDPItemData::MK_DATEPART ) );
}
@@ -282,10 +281,7 @@ public:
ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart,
const Date* pNullDate, const ScDPNumGroupInfo* pNumInfo);
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
virtual bool match(const ScDPItemData & rCellData) const;
- // End Comments
private:
ScDPGroupDateFilter(); // disabled
@@ -305,8 +301,7 @@ ScDPGroupDateFilter::ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart
mfMatchValue(fMatchValue),
mnDatePart(nDatePart)
{
-// fprintf(stdout, "ScDPCacheTable:DateGroupFilter::DateGroupFilter: match value = %g; date part = %ld\n",
-// mfMatchValue, mnDatePart);
+
}
bool ScDPGroupDateFilter::match( const ScDPItemData & rCellData ) const
{
@@ -316,7 +311,7 @@ bool ScDPGroupDateFilter::match( const ScDPItemData & rCellData ) const
if ( !rCellData.IsValue() )
return false;
-// ScDPCacheCell rCell( rCellData.fValue );
+
if (!mpNumInfo)
return false;
@@ -359,7 +354,7 @@ bool ScDPGroupDateFilter::match( const ScDPItemData & rCellData ) const
return sec == matchSec;
}
default:
- DBG_ERROR("invalid time part");
+ OSL_FAIL("invalid time part");
}
return false;
}
@@ -398,7 +393,7 @@ bool ScDPGroupDateFilter::match( const ScDPItemData & rCellData ) const
return days == matchDays;
}
default:
- DBG_ERROR("invalid date part");
+ OSL_FAIL("invalid date part");
}
return false;
@@ -462,7 +457,7 @@ String lcl_GetDateGroupName( sal_Int32 nDatePart, sal_Int32 nValue, SvNumberForm
aRet.Append( lcl_GetTwoDigitString( nValue ) );
break;
default:
- DBG_ERROR("invalid date part");
+ OSL_FAIL("invalid date part");
}
return aRet;
}
@@ -532,7 +527,7 @@ sal_Int32 lcl_GetDatePartValue( double fValue, sal_Int32 nDatePart, SvNumberForm
}
break;
default:
- DBG_ERROR("invalid date part");
+ OSL_FAIL("invalid date part");
}
}
@@ -549,11 +544,8 @@ sal_Bool lcl_DateContained( sal_Int32 nGroupPart, const ScDPItemData& rGroupData
}
// no approxFloor needed, values were created from integers
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
sal_Int32 nGroupValue = (sal_Int32) rGroupData.GetValue();
sal_Int32 nBaseValue = (sal_Int32) rBaseData.GetValue();
-// End Comments
if ( nBasePart > nGroupPart )
{
// switch, so the base part is the smaller (inner) part
@@ -608,7 +600,8 @@ String lcl_GetSpecialDateName( double fValue, bool bFirst, SvNumberFormatter* pF
return aBuffer.makeStringAndClear();
}
-void ScDPDateGroupHelper::FillColumnEntries( SCCOL nSourceDim, ScDPTableDataCache* pCache, std::vector< SCROW >& rEntries, const std::vector< SCROW >& rOriginal ) const
+void ScDPDateGroupHelper::FillColumnEntries(
+ SCCOL nSourceDim, const ScDPCache* pCache, std::vector<SCROW>& rEntries, const std::vector<SCROW>& rOriginal) const
{
// auto min/max is only used for "Years" part, but the loop is always needed
double fSourceMin = 0.0;
@@ -668,7 +661,7 @@ void ScDPDateGroupHelper::FillColumnEntries( SCCOL nSourceDim, ScDPTableDataCach
case com::sun::star::sheet::DataPilotFieldGroupBy::MINUTES: nStart = 0; nEnd = 59; break;
case com::sun::star::sheet::DataPilotFieldGroupBy::SECONDS: nStart = 0; nEnd = 59; break;
default:
- DBG_ERROR("invalid date part");
+ OSL_FAIL("invalid date part");
}
for ( sal_Int32 nValue = nStart; nValue <= nEnd; nValue++ )
@@ -723,10 +716,7 @@ void ScDPGroupItem::FillGroupFilter( ScDPCacheTable::GroupFilter& rFilter ) cons
{
ScDPItemDataVec::const_iterator itrEnd = aElements.end();
for (ScDPItemDataVec::const_iterator itr = aElements.begin(); itr != itrEnd; ++itr)
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
rFilter.addMatchItem(itr->GetString(), itr->GetValue(), itr->IsValue());
-// End Comments
}
// -----------------------------------------------------------------------
@@ -735,8 +725,7 @@ ScDPGroupDimension::ScDPGroupDimension( long nSource, const String& rNewName ) :
nSourceDim( nSource ),
nGroupDim( -1 ),
aGroupName( rNewName ),
- pDateHelper( NULL )/*,
- pCollection( NULL )*/
+ pDateHelper( NULL )
{
}
@@ -788,21 +777,19 @@ void ScDPGroupDimension::SetGroupDim( long nDim )
{
nGroupDim = nDim;
}
-// Wang Xu Ming -- 2009-9-2
-// DataPilot Migration - Cache&&Performance
const std::vector< SCROW >& ScDPGroupDimension::GetColumnEntries( const ScDPCacheTable& rCacheTable, const std::vector< SCROW >& rOriginal ) const
{
if ( maMemberEntries.empty() )
{
if ( pDateHelper )
{
- pDateHelper->FillColumnEntries( (SCCOL)GetSourceDim(), rCacheTable.GetCache(), maMemberEntries, rOriginal );
+ pDateHelper->FillColumnEntries( (SCCOL)GetSourceDim(), rCacheTable.getCache(), maMemberEntries, rOriginal );
}
else
{
for (size_t i =0; i < rOriginal.size( ); i ++)
{
- const ScDPItemData* pItemData = rCacheTable.GetCache()->GetItemDataById( (SCCOL)GetSourceDim(), rOriginal[i] );
+ const ScDPItemData* pItemData = rCacheTable.getCache()->GetItemDataById( (SCCOL)GetSourceDim(), rOriginal[i] );
if ( !pItemData || !GetGroupForData( *pItemData ) )
{
// not in any group -> add as its own group
@@ -813,15 +800,14 @@ const std::vector< SCROW >& ScDPGroupDimension::GetColumnEntries( const ScDPCac
long nCount = aItems.size();
for (long i=0; i<nCount; i++)
{
- SCROW nNew = rCacheTable.GetCache()->GetAdditionalItemID( aItems[i].GetName() );
- lcl_Insert ( (SCCOL)GetSourceDim(), rCacheTable.GetCache(), maMemberEntries, nNew );
+ SCROW nNew = rCacheTable.getCache()->GetAdditionalItemID( aItems[i].GetName() );
+ lcl_Insert ( (SCCOL)GetSourceDim(), rCacheTable.getCache(), maMemberEntries, nNew );
}
}
}
return maMemberEntries;
}
-// End Comments
const ScDPGroupItem* ScDPGroupDimension::GetGroupForData( const ScDPItemData& rData ) const
@@ -915,8 +901,8 @@ void ScDPNumGroupDimension::MakeDateHelper( const ScDPNumGroupInfo& rInfo, sal_I
aGroupInfo.Enable = sal_True; //! or query both?
}
-const std::vector< SCROW >& ScDPNumGroupDimension::GetNumEntries( SCCOL nSourceDim, ScDPTableDataCache* pCache,
- const std::vector< SCROW >& rOriginal ) const
+const std::vector<SCROW>& ScDPNumGroupDimension::GetNumEntries(
+ SCCOL nSourceDim, const ScDPCache* pCache, const std::vector<SCROW>& rOriginal) const
{
if ( maMemberEntries.empty() )
{
@@ -1023,7 +1009,7 @@ const std::vector< SCROW >& ScDPNumGroupDimension::GetNumEntries( SCCOL nSourceD
}
ScDPGroupTableData::ScDPGroupTableData( const shared_ptr<ScDPTableData>& pSource, ScDocument* pDocument ) :
- ScDPTableData(pDocument, pSource->GetCacheId() ),
+ ScDPTableData(pDocument),
pSourceData( pSource ),
pDoc( pDocument )
{
@@ -1085,7 +1071,6 @@ void ScDPGroupTableData::GetNumGroupInfo( long nDimension, ScDPNumGroupInfo& rIn
rDecimal = pNumGroups[nDimension].GetDecSeparator();
}
}
-// Wang Xu Ming - DataPilot migration
long ScDPGroupTableData::GetMembersCount( long nDim )
{
const std::vector< SCROW >& members = GetColumnEntries( nDim );
@@ -1111,7 +1096,7 @@ const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( long nColumn
{
// dimension number is unchanged for numerical groups
const std::vector< SCROW >& rOriginal = pSourceData->GetColumnEntries( nColumn );
- return pNumGroups[nColumn].GetNumEntries( (SCCOL)nColumn, GetCacheTable().GetCache(), rOriginal );
+ return pNumGroups[nColumn].GetNumEntries( (SCCOL)nColumn, GetCacheTable().getCache(), rOriginal );
}
return pSourceData->GetColumnEntries( nColumn );
@@ -1205,12 +1190,12 @@ void ScDPGroupTableData::CreateCacheTable()
void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>& rCriteria)
{
- typedef hash_map<long, const ScDPGroupDimension*> GroupFieldMapType;
+ typedef boost::unordered_map<long, const ScDPGroupDimension*> GroupFieldMapType;
GroupFieldMapType aGroupFieldIds;
{
ScDPGroupDimensionVec::const_iterator itr = aGroups.begin(), itrEnd = aGroups.end();
for (; itr != itrEnd; ++itr)
- aGroupFieldIds.insert( hash_map<long, const ScDPGroupDimension*>::value_type(itr->GetGroupDim(), &(*itr)) );
+ aGroupFieldIds.insert( boost::unordered_map<long, const ScDPGroupDimension*>::value_type(itr->GetGroupDim(), &(*itr)) );
}
vector<ScDPCacheTable::Criterion> aNewCriteria;
@@ -1283,13 +1268,8 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>&
for (size_t i = 0; i < nGroupItemCount; ++i)
{
const ScDPGroupItem* pGrpItem = pGrpDim->GetGroupByIndex(i);
- // Wang Xu Ming -- 2009-6-9
- // DataPilot Migration
ScDPItemData aName( pFilter->getMatchString(),pFilter->getMatchValue(),pFilter->hasValue()) ;
- /*aName.aString = pFilter->getMatchString();
- aName.fValue = pFilter->getMatchValue();
- aName.bHasValue = pFilter->hasValue();*/
- // End Comments
+
if (!pGrpItem || !pGrpItem->GetName().IsCaseInsEqual(aName))
continue;
@@ -1308,14 +1288,14 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>&
rCriteria.swap(aNewCriteria);
}
-void ScDPGroupTableData::FilterCacheTable(const vector<ScDPCacheTable::Criterion>& rCriteria, const hash_set<sal_Int32>& rCatDims)
+void ScDPGroupTableData::FilterCacheTable(const vector<ScDPCacheTable::Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rCatDims)
{
vector<ScDPCacheTable::Criterion> aNewCriteria(rCriteria);
ModifyFilterCriteria(aNewCriteria);
pSourceData->FilterCacheTable(aNewCriteria, rCatDims);
}
-void ScDPGroupTableData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>& rCriteria, const hash_set<sal_Int32>& rCatDims, Sequence< Sequence<Any> >& rData)
+void ScDPGroupTableData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rCatDims, Sequence< Sequence<Any> >& rData)
{
vector<ScDPCacheTable::Criterion> aNewCriteria(rCriteria);
ModifyFilterCriteria(aNewCriteria);
@@ -1358,7 +1338,7 @@ void ScDPGroupTableData::FillGroupValues( /*ScDPItemData* pItemData*/ SCROW* pIt
{
long nGroupedColumns = aGroups.size();
- ScDPTableDataCache* pCache = GetCacheTable().GetCache();
+ const ScDPCache* pCache = GetCacheTable().getCache();
for (long nDim=0; nDim<nCount; nDim++)
{
const ScDPDateGroupHelper* pDateHelper = NULL;
@@ -1401,18 +1381,14 @@ void ScDPGroupTableData::FillGroupValues( /*ScDPItemData* pItemData*/ SCROW* pIt
if ( pDateHelper )
{
- const ScDPItemData* pData = GetCacheTable().GetCache()->GetItemDataById( (SCCOL)nSourceDim, pItemDataIndex[nDim]);
+ const ScDPItemData* pData = GetCacheTable().getCache()->GetItemDataById( (SCCOL)nSourceDim, pItemDataIndex[nDim]);
if ( pData ->IsValue() )
{
sal_Int32 nPartValue = lcl_GetDatePartValue(
pData->GetValue(), pDateHelper->GetDatePart(), pDoc->GetFormatTable(),
&pDateHelper->GetNumInfo() );
-// Wang Xu Ming -- 2009-9-7
-// DataPilot Migration - Cache&&Performance
- //String aName = lcl_GetDateGroupName( pDateHelper, nPartValue, pDoc->GetFormatTable() );
ScDPItemData aItemData( pDateHelper->GetDatePart(), String(), nPartValue, ScDPItemData::MK_DATA|ScDPItemData::MK_VAL|ScDPItemData::MK_DATEPART );
- pItemDataIndex[nDim] = GetCacheTable().GetCache()->GetAdditionalItemID( aItemData );
-// End Comments
+ pItemDataIndex[nDim] = GetCacheTable().getCache()->GetAdditionalItemID( aItemData );
}
}
}
@@ -1427,7 +1403,7 @@ sal_Bool ScDPGroupTableData::IsBaseForGroup(long nDim) const
return sal_True;
}
- return sal_False;
+ return false;
}
long ScDPGroupTableData::GetGroupBase(long nGroupDim) const
@@ -1459,7 +1435,7 @@ sal_Bool ScDPGroupTableData::IsNumOrDateGroup(long nDimension) const
return ( rDim.GetDateHelper() != NULL );
}
- return sal_False;
+ return false;
}
sal_Bool ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, long nGroupIndex,
@@ -1485,8 +1461,8 @@ sal_Bool ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, long nGr
// date group information, too.
if ( !pBaseDateHelper )
{
- DBG_ERROR( "mix of date and non-date groups" );
- return sal_True;
+ OSL_FAIL( "mix of date and non-date groups" );
+ return true;
}
sal_Int32 nGroupPart = pGroupDateHelper->GetDatePart();
@@ -1505,8 +1481,8 @@ sal_Bool ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, long nGr
}
}
- DBG_ERROR("IsInGroup: no group dimension found");
- return sal_True;
+ OSL_FAIL("IsInGroup: no group dimension found");
+ return true;
}
sal_Bool ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex,
@@ -1531,8 +1507,8 @@ sal_Bool ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, l
// If one is a date group dimension, the other one must be, too.
if ( !pFirstDateHelper || !pSecondDateHelper )
{
- DBG_ERROR( "mix of date and non-date groups" );
- return sal_True;
+ OSL_FAIL( "mix of date and non-date groups" );
+ return true;
}
sal_Int32 nFirstPart = pFirstDateHelper->GetDatePart();
@@ -1564,8 +1540,8 @@ sal_Bool ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, l
}
}
- DBG_ERROR("HasCommonElement: no group dimension found");
- return sal_True;
+ OSL_FAIL("HasCommonElement: no group dimension found");
+ return true;
}
long ScDPGroupTableData::GetSourceDim( long nDim )
@@ -1587,3 +1563,4 @@ long ScDPGroupTableData::GetSourceDim( long nDim )
}
// -----------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index ad1932303da0..7de3d9884e4e 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include "dpobject.hxx"
@@ -52,11 +51,8 @@
#include "attrib.hxx"
#include "scitems.hxx"
#include "unonames.hxx"
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "dpglobal.hxx"
#include "globstr.hrc"
-// End Comments
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sheet/GeneralFunction.hpp>
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
@@ -74,6 +70,7 @@
#include <com/sun/star/sheet/XDrillDownDataSupplier.hpp>
#include <comphelper/processfactory.hxx>
+#include <sal/macros.h>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <svl/zforlist.hxx> // IsNumberFormat
@@ -83,6 +80,8 @@
using namespace com::sun::star;
using ::std::vector;
+using ::std::unary_function;
+using ::std::remove_if;
using ::boost::shared_ptr;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
@@ -92,10 +91,10 @@ using ::com::sun::star::uno::Exception;
using ::com::sun::star::lang::XComponent;
using ::com::sun::star::sheet::DataPilotTableHeaderData;
using ::com::sun::star::sheet::DataPilotTablePositionData;
+using ::com::sun::star::sheet::XDimensionsSupplier;
using ::com::sun::star::beans::XPropertySet;
using ::rtl::OUString;
-
// -----------------------------------------------------------------------
#define SCDPSOURCE_SERVICE "com.sun.star.sheet.DataPilotSource"
@@ -117,7 +116,6 @@ using ::rtl::OUString;
#define DP_PROP_FUNCTION "Function"
#define DP_PROP_IGNOREEMPTY "IgnoreEmptyRows"
#define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension"
-//#define DP_PROP_ISVISIBLE "IsVisible"
#define DP_PROP_ORIENTATION "Orientation"
#define DP_PROP_ORIGINAL "Original"
#define DP_PROP_POSITION "Position"
@@ -138,7 +136,7 @@ sal_uInt16 lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSup
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
long nIntCount = xIntDims->getCount();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
{
uno::Reference<uno::XInterface> xIntDim =
@@ -147,11 +145,11 @@ sal_uInt16 lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSup
if ( xDimProp.is() )
{
bFound = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
//! error checking -- is "IsDataLayoutDimension" property required??
if (bFound)
nRet = ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)),
sheet::DataPilotFieldOrientation_HIDDEN );
}
}
@@ -169,19 +167,16 @@ ScDPObject::ScDPObject( ScDocument* pD ) :
pServDesc( NULL ),
mpTableData(static_cast<ScDPTableData*>(NULL)),
pOutput( NULL ),
- bSettingsChanged( sal_False ),
- bAlive( sal_False ),
+ bSettingsChanged( false ),
+ bAlive( false ),
mnAutoFormatIndex( 65535 ),
- bAllowMove( sal_False ),
+ bAllowMove( false ),
nHeaderRows( 0 ),
- mbHeaderLayout(false),
- bRefresh( sal_False ), // Wang Xu Ming - DataPilot migration
- mnCacheId( -1) // Wang Xu Ming - DataPilot migration
+ mbHeaderLayout(false)
{
}
ScDPObject::ScDPObject(const ScDPObject& r) :
- ScDataObject(),
pDoc( r.pDoc ),
pSaveData( NULL ),
aTableName( r.aTableName ),
@@ -192,14 +187,12 @@ ScDPObject::ScDPObject(const ScDPObject& r) :
pServDesc( NULL ),
mpTableData(static_cast<ScDPTableData*>(NULL)),
pOutput( NULL ),
- bSettingsChanged( sal_False ),
- bAlive( sal_False ),
+ bSettingsChanged( false ),
+ bAlive( false ),
mnAutoFormatIndex( r.mnAutoFormatIndex ),
- bAllowMove( sal_False ),
+ bAllowMove( false ),
nHeaderRows( r.nHeaderRows ),
- mbHeaderLayout( r.mbHeaderLayout ),
- bRefresh( r.bRefresh ), // Wang Xu Ming - DataPilot migration
- mnCacheId ( r.mnCacheId ) // Wang Xu Ming - DataPilot migration
+ mbHeaderLayout( r.mbHeaderLayout )
{
if (r.pSaveData)
pSaveData = new ScDPSaveData(*r.pSaveData);
@@ -219,13 +212,7 @@ ScDPObject::~ScDPObject()
delete pSheetDesc;
delete pImpDesc;
delete pServDesc;
- mnCacheId = -1; // Wang Xu Ming - DataPilot migration
- InvalidateSource();
-}
-
-ScDataObject* ScDPObject::Clone() const
-{
- return new ScDPObject(*this);
+ ClearSource();
}
void ScDPObject::SetAlive(sal_Bool bSet)
@@ -244,28 +231,11 @@ void ScDPObject::SetSaveData(const ScDPSaveData& rData)
{
delete pSaveData;
pSaveData = new ScDPSaveData( rData );
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- if ( rData.GetCacheId() >= 0 )
- mnCacheId = rData.GetCacheId();
- else if ( mnCacheId >= 0 )
- pSaveData->SetCacheId( mnCacheId );
- // End Comments
}
InvalidateData(); // re-init source from SaveData
}
-void ScDPObject::SetAutoFormatIndex(const sal_uInt16 nIndex)
-{
- mnAutoFormatIndex = nIndex;
-}
-
-sal_uInt16 ScDPObject::GetAutoFormatIndex() const
-{
- return mnAutoFormatIndex;
-}
-
void ScDPObject::SetHeaderLayout (bool bUseGrid)
{
mbHeaderLayout = bUseGrid;
@@ -292,18 +262,21 @@ void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc)
DELETEZ( pImpDesc );
DELETEZ( pServDesc );
- delete pImpDesc;
+ delete pSheetDesc;
pSheetDesc = new ScSheetSourceDesc(rDesc);
// make valid QueryParam
- pSheetDesc->aQueryParam.nCol1 = pSheetDesc->aSourceRange.aStart.Col();
- pSheetDesc->aQueryParam.nRow1 = pSheetDesc->aSourceRange.aStart.Row();
- pSheetDesc->aQueryParam.nCol2 = pSheetDesc->aSourceRange.aEnd.Col();
- pSheetDesc->aQueryParam.nRow2 = pSheetDesc->aSourceRange.aEnd.Row();;
- pSheetDesc->aQueryParam.bHasHeader = sal_True;
+ const ScRange& rSrcRange = pSheetDesc->GetSourceRange();
+ ScQueryParam aParam = pSheetDesc->GetQueryParam();
+ aParam.nCol1 = rSrcRange.aStart.Col();
+ aParam.nRow1 = rSrcRange.aStart.Row();
+ aParam.nCol2 = rSrcRange.aEnd.Col();
+ aParam.nRow2 = rSrcRange.aEnd.Row();
+ aParam.bHasHeader = true;
+ pSheetDesc->SetQueryParam(aParam);
- InvalidateSource(); // new source must be created
+ ClearSource(); // new source must be created
}
void ScDPObject::SetImportDesc(const ScImportSourceDesc& rDesc)
@@ -317,7 +290,7 @@ void ScDPObject::SetImportDesc(const ScImportSourceDesc& rDesc)
delete pImpDesc;
pImpDesc = new ScImportSourceDesc(rDesc);
- InvalidateSource(); // new source must be created
+ ClearSource(); // new source must be created
}
void ScDPObject::SetServiceData(const ScDPServiceDesc& rDesc)
@@ -331,7 +304,7 @@ void ScDPObject::SetServiceData(const ScDPServiceDesc& rDesc)
delete pServDesc;
pServDesc = new ScDPServiceDesc(rDesc);
- InvalidateSource(); // new source must be created
+ ClearSource(); // new source must be created
}
void ScDPObject::WriteSourceDataTo( ScDPObject& rDest ) const
@@ -421,7 +394,7 @@ void ScDPObject::CreateOutput()
//! modify aOutRange?
- bAllowMove = sal_False; // use only once
+ bAllowMove = false; // use only once
}
}
}
@@ -434,20 +407,17 @@ ScDPTableData* ScDPObject::GetTableData()
if ( pImpDesc )
{
// database data
- pData.reset(new ScDatabaseDPData(pDoc, *pImpDesc, GetCacheId()));
+ pData.reset(new ScDatabaseDPData(pDoc, *pImpDesc));
}
else
{
// cell data
if (!pSheetDesc)
{
- DBG_ERROR("no source descriptor");
- pSheetDesc = new ScSheetSourceDesc; // dummy defaults
+ OSL_FAIL("no source descriptor");
+ pSheetDesc = new ScSheetSourceDesc(pDoc); // dummy defaults
}
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- pData.reset(new ScSheetDPData(pDoc, *pSheetDesc, GetCacheId()));
- // End Comments
+ pData.reset(new ScSheetDPData(pDoc, *pSheetDesc));
}
// grouping (for cell or database data)
@@ -458,12 +428,6 @@ ScDPTableData* ScDPObject::GetTableData()
pData = pGroupData;
}
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- if ( pData )
- SetCacheId( pData->GetCacheId()); // resets mpTableData
- // End Comments
-
mpTableData = pData; // after SetCacheId
}
@@ -474,7 +438,7 @@ void ScDPObject::CreateObjects()
{
// if groups are involved, create a new source with the ScDPGroupTableData
if ( bSettingsChanged && pSaveData && pSaveData->GetExistingDimensionData() )
- InvalidateSource();
+ ClearSource();
if (!xSource.is())
{
@@ -493,17 +457,11 @@ void ScDPObject::CreateObjects()
{
DBG_ASSERT( !pServDesc, "DPSource could not be created" );
ScDPTableData* pData = GetTableData();
-
ScDPSource* pSource = new ScDPSource( pData );
xSource = pSource;
-
- if ( pSaveData && bRefresh )
- {
- pSaveData->Refresh( xSource );
- bRefresh = sal_False;
- }
}
- if (pSaveData )
+
+ if (pSaveData)
pSaveData->WriteToSource( xSource );
}
else if (bSettingsChanged)
@@ -519,14 +477,14 @@ void ScDPObject::CreateObjects()
}
catch(uno::Exception&)
{
- DBG_ERROR("exception in refresh");
+ OSL_FAIL("exception in refresh");
}
}
if (pSaveData)
pSaveData->WriteToSource( xSource );
}
- bSettingsChanged = sal_False;
+ bSettingsChanged = false;
}
void ScDPObject::InvalidateData()
@@ -534,7 +492,7 @@ void ScDPObject::InvalidateData()
bSettingsChanged = sal_True;
}
-void ScDPObject::InvalidateSource()
+void ScDPObject::ClearSource()
{
Reference< XComponent > xObjectComp( xSource, UNO_QUERY );
if ( xObjectComp.is() )
@@ -552,7 +510,7 @@ void ScDPObject::InvalidateSource()
mpTableData.reset();
}
-ScRange ScDPObject::GetNewOutputRange( sal_Bool& rOverflow )
+ScRange ScDPObject::GetNewOutputRange( bool& rOverflow )
{
CreateOutput(); // create xSource and pOutput if not already done
@@ -685,11 +643,11 @@ bool ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, vector<ScDPLabelDa
Reference<beans::XPropertySet> xMemProp(xMember, UNO_QUERY);
if (xMemProp.is())
{
- aMem.mbVisible = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString::createFromAscii(SC_UNO_ISVISIBL));
- aMem.mbShowDetails = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString::createFromAscii(SC_UNO_SHOWDETA));
+ aMem.mbVisible = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_ISVISIBL)));
+ aMem.mbShowDetails = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_SHOWDETA)));
aMem.maLayoutName = ScUnoHelpFunctions::GetStringProperty(
- xMemProp, OUString::createFromAscii(SC_UNO_LAYOUTNAME), OUString());
+ xMemProp, OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_LAYOUTNAME)), OUString());
}
aMembers.push_back(aMem);
@@ -722,12 +680,13 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode,
if ( pSheetDesc )
{
- nCol1 = pSheetDesc->aSourceRange.aStart.Col();
- nRow1 = pSheetDesc->aSourceRange.aStart.Row();
- nTab1 = pSheetDesc->aSourceRange.aStart.Tab();
- nCol2 = pSheetDesc->aSourceRange.aEnd.Col();
- nRow2 = pSheetDesc->aSourceRange.aEnd.Row();
- nTab2 = pSheetDesc->aSourceRange.aEnd.Tab();
+ const ScRange& rSrcRange = pSheetDesc->GetSourceRange();
+ nCol1 = rSrcRange.aStart.Col();
+ nRow1 = rSrcRange.aStart.Row();
+ nTab1 = rSrcRange.aStart.Tab();
+ nCol2 = rSrcRange.aEnd.Col();
+ nRow2 = rSrcRange.aEnd.Row();
+ nTab2 = rSrcRange.aEnd.Tab();
eRes = ScRefUpdate::Update( pDoc, eUpdateRefMode,
rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(),
@@ -735,22 +694,23 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode,
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
if ( eRes != UR_NOTHING )
{
- ScSheetSourceDesc aNewDesc;
- aNewDesc.aSourceRange = ScRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
-
- SCsCOL nDiffX = nCol1 - (SCsCOL) pSheetDesc->aSourceRange.aStart.Col();
- SCsROW nDiffY = nRow1 - (SCsROW) pSheetDesc->aSourceRange.aStart.Row();
-
- aNewDesc.aQueryParam = pSheetDesc->aQueryParam;
- aNewDesc.aQueryParam.nCol1 = sal::static_int_cast<SCCOL>( aNewDesc.aQueryParam.nCol1 + nDiffX );
- aNewDesc.aQueryParam.nCol2 = sal::static_int_cast<SCCOL>( aNewDesc.aQueryParam.nCol2 + nDiffX );
- aNewDesc.aQueryParam.nRow1 += nDiffY; //! used?
- aNewDesc.aQueryParam.nRow2 += nDiffY; //! used?
- SCSIZE nEC = aNewDesc.aQueryParam.GetEntryCount();
+ ScSheetSourceDesc aNewDesc(pDoc);
+ aNewDesc.SetSourceRange(ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2));
+
+ SCsCOL nDiffX = nCol1 - (SCsCOL) pSheetDesc->GetSourceRange().aStart.Col();
+ SCsROW nDiffY = nRow1 - (SCsROW) pSheetDesc->GetSourceRange().aStart.Row();
+
+ ScQueryParam aParam = pSheetDesc->GetQueryParam();
+ aParam.nCol1 = sal::static_int_cast<SCCOL>( aParam.nCol1 + nDiffX );
+ aParam.nCol2 = sal::static_int_cast<SCCOL>( aParam.nCol2 + nDiffX );
+ aParam.nRow1 += nDiffY; //! used?
+ aParam.nRow2 += nDiffY; //! used?
+ SCSIZE nEC = aParam.GetEntryCount();
for (SCSIZE i=0; i<nEC; i++)
- if (aNewDesc.aQueryParam.GetEntry(i).bDoQuery)
- aNewDesc.aQueryParam.GetEntry(i).nField += nDiffX;
+ if (aParam.GetEntry(i).bDoQuery)
+ aParam.GetEntry(i).nField += nDiffX;
+ aNewDesc.SetQueryParam(aParam);
SetSheetDesc( aNewDesc ); // allocates new pSheetDesc
}
}
@@ -759,17 +719,17 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode,
sal_Bool ScDPObject::RefsEqual( const ScDPObject& r ) const
{
if ( aOutRange != r.aOutRange )
- return sal_False;
+ return false;
if ( pSheetDesc && r.pSheetDesc )
{
- if ( pSheetDesc->aSourceRange != r.pSheetDesc->aSourceRange )
- return sal_False;
+ if ( pSheetDesc->GetSourceRange() != r.pSheetDesc->GetSourceRange() )
+ return false;
}
else if ( pSheetDesc || r.pSheetDesc )
{
- DBG_ERROR("RefsEqual: SheetDesc set at only one object");
- return sal_False;
+ OSL_FAIL("RefsEqual: SheetDesc set at only one object");
+ return false;
}
return sal_True;
@@ -839,7 +799,7 @@ bool ScDPObject::IsDimNameInUse(const OUString& rName) const
continue;
OUString aLayoutName = ScUnoHelpFunctions::GetStringProperty(
- xPropSet, OUString::createFromAscii(SC_UNO_LAYOUTNAME), OUString());
+ xPropSet, OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_LAYOUTNAME)), OUString());
if (aLayoutName.equalsIgnoreAsciiCase(rName))
return true;
}
@@ -848,7 +808,7 @@ bool ScDPObject::IsDimNameInUse(const OUString& rName) const
String ScDPObject::GetDimName( long nDim, sal_Bool& rIsDataLayout, sal_Int32* pFlags )
{
- rIsDataLayout = sal_False;
+ rIsDataLayout = false;
String aRet;
if ( xSource.is() )
@@ -865,7 +825,7 @@ String ScDPObject::GetDimName( long nDim, sal_Bool& rIsDataLayout, sal_Int32* pF
if ( xDimName.is() && xDimProp.is() )
{
sal_Bool bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
//! error checking -- is "IsDataLayoutDimension" property required??
rtl::OUString aName;
@@ -883,7 +843,7 @@ String ScDPObject::GetDimName( long nDim, sal_Bool& rIsDataLayout, sal_Int32* pF
if (pFlags)
*pFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_FLAGS)), 0 );
}
}
}
@@ -893,7 +853,7 @@ String ScDPObject::GetDimName( long nDim, sal_Bool& rIsDataLayout, sal_Int32* pF
sal_Bool ScDPObject::IsDuplicated( long nDim )
{
- sal_Bool bDuplicated = sal_False;
+ sal_Bool bDuplicated = false;
if ( xSource.is() )
{
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
@@ -909,7 +869,7 @@ sal_Bool ScDPObject::IsDuplicated( long nDim )
try
{
uno::Any aOrigAny = xDimProp->getPropertyValue(
- rtl::OUString::createFromAscii(DP_PROP_ORIGINAL) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIGINAL)) );
uno::Reference<uno::XInterface> xIntOrig;
if ( (aOrigAny >>= xIntOrig) && xIntOrig.is() )
bDuplicated = sal_True;
@@ -965,7 +925,7 @@ void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField )
uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY );
long nHierarchy = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_USEDHIERARCHY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_USEDHIERARCHY)) );
long nLevel = 0;
long nHierCount = 0;
@@ -1015,7 +975,7 @@ void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField )
sal_Bool bVisible = false;
if (xPropSet.is())
{
- Any any = xPropSet->getPropertyValue(OUString::createFromAscii(SC_UNO_ISVISIBL));
+ Any any = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_ISVISIBL)));
any >>= bVisible;
}
@@ -1184,7 +1144,7 @@ bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_StrLen& r
{
aFuncStr.EraseLeadingAndTrailingChars( ' ' );
- const sal_Int32 nFuncCount = sizeof(aFunctions) / sizeof(aFunctions[0]);
+ const sal_Int32 nFuncCount = SAL_N_ELEMENTS(aFunctions);
for ( sal_Int32 nFunc=0; nFunc<nFuncCount && !bFound; nFunc++ )
{
if ( aFuncStr.EqualsIgnoreCaseAscii( aFunctions[nFunc].pName ) )
@@ -1338,9 +1298,9 @@ sal_Bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget,
uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY );
uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDim, uno::UNO_QUERY );
sal_Bool bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
sal_Int32 nOrient = ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)),
sheet::DataPilotFieldOrientation_HIDDEN );
if ( !bDataLayout )
{
@@ -1358,7 +1318,7 @@ sal_Bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget,
uno::Reference<container::XIndexAccess> xHiers = new ScNameToIndexAccess( xDimSupp->getHierarchies() );
sal_Int32 nHierarchy = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_USEDHIERARCHY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_USEDHIERARCHY)) );
if ( nHierarchy >= xHiers->getCount() )
nHierarchy = 0;
@@ -1548,7 +1508,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb
uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY );
sal_Bool bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
if (bDataLayout)
{
// the elements of the data layout dimension can't be found by their names
@@ -1593,7 +1553,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb
if ( xMbrSupp.is() )
xMembers = xMbrSupp->getMembers();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_Bool bShowDetails = sal_True;
if ( xMembers.is() )
@@ -1606,7 +1566,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb
if ( xMbrProp.is() )
{
bShowDetails = ScUnoHelpFunctions::GetBoolProperty( xMbrProp,
- rtl::OUString::createFromAscii(DP_PROP_SHOWDETAILS) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWDETAILS)) );
//! don't set bFound if property is unknown?
bFound = sal_True;
}
@@ -1614,6 +1574,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb
}
DBG_ASSERT( bFound, "member not found" );
+ (void)bFound;
//! use Hierarchy and Level in SaveData !!!!
@@ -1654,7 +1615,7 @@ sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimPro
{
uno::Reference<container::XIndexAccess> xHiers = new ScNameToIndexAccess( xDimSupp->getHierarchies() );
long nHierarchy = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_USEDHIERARCHY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_USEDHIERARCHY)) );
if ( nHierarchy >= xHiers->getCount() )
nHierarchy = 0;
@@ -1673,7 +1634,7 @@ sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimPro
try
{
aSubAny = xLevProp->getPropertyValue(
- rtl::OUString::createFromAscii(DP_PROP_SUBTOTALS) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SUBTOTALS)) );
}
catch(uno::Exception&)
{
@@ -1692,7 +1653,7 @@ sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimPro
}
}
- DBG_ERROR("FirstSubTotal: NULL");
+ OSL_FAIL("FirstSubTotal: NULL");
return 0;
}
@@ -1711,36 +1672,47 @@ sal_uInt16 lcl_CountBits( sal_uInt16 nBits )
return nCount;
}
-void lcl_FillOldFields( ScPivotFieldVector& rFields,
- const uno::Reference<sheet::XDimensionsSupplier>& xSource,
- sal_uInt16 nOrient, SCCOL nColAdd, bool bAddData )
+void lcl_FillOldFields(
+ vector<PivotField>& rFields,
+ const uno::Reference<sheet::XDimensionsSupplier>& xSource,
+ sal_uInt16 nOrient, SCCOL nColAdd, bool bAddData )
{
+ vector<PivotField> aFields;
+
bool bDataFound = false;
- rFields.clear();
- //! merge multiple occurences (data field with different functions)
+ //! merge multiple occurrences (data field with different functions)
//! force data field in one dimension
- std::vector< long > aPos;
+ vector<long> aPos;
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName );
long nDimCount = xDims->getCount();
- for (long nDim=0; nDim < nDimCount; nDim++)
+ for (long nDim = 0; nDim < nDimCount; ++nDim)
{
+ // Get dimension object.
uno::Reference<uno::XInterface> xIntDim =
ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) );
+
+ // dimension properties
uno::Reference<beans::XPropertySet> xDimProp( xIntDim, uno::UNO_QUERY );
+
+ // dimension orientation, hidden by default.
long nDimOrient = ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)),
sheet::DataPilotFieldOrientation_HIDDEN );
+
if ( xDimProp.is() && nDimOrient == nOrient )
{
+ // Let's take this dimension.
+
+ // function mask.
sal_uInt16 nMask = 0;
if ( nOrient == sheet::DataPilotFieldOrientation_DATA )
{
sheet::GeneralFunction eFunc = (sheet::GeneralFunction)ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_FUNCTION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_FUNCTION)),
sheet::GeneralFunction_NONE );
if ( eFunc == sheet::GeneralFunction_AUTO )
{
@@ -1752,13 +1724,16 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields,
else
nMask = lcl_FirstSubTotal( xDimProp ); // from first hierarchy
- sal_Bool bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ // is this data layout dimension?
+ bool bDataLayout = ScUnoHelpFunctions::GetBoolProperty(
+ xDimProp, OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)));
+
+ // is this dimension cloned?
uno::Any aOrigAny;
try
{
aOrigAny = xDimProp->getPropertyValue(
- rtl::OUString::createFromAscii(DP_PROP_ORIGINAL) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIGINAL)));
}
catch(uno::Exception&)
{
@@ -1776,55 +1751,57 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields,
bool bDupUsed = false;
if ( nDupSource >= 0 )
{
+ // this dimension is cloned.
+
// add function bit to previous entry
- SCsCOL nCompCol;
+ SCsCOL nCompCol; // column ID of the original dimension.
if ( bDataLayout )
nCompCol = PIVOT_DATA_FIELD;
else
nCompCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek source column from name
- for (ScPivotFieldVector::iterator aIt = rFields.begin(), aEnd = rFields.end(); (aIt != aEnd) && !bDupUsed; ++aIt)
- if ( aIt->nCol == nCompCol )
+ vector<PivotField>::iterator itr = aFields.begin(), itrEnd = aFields.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ // add to previous column only if new bits aren't already set there
+ if (itr->nCol == nCompCol && (itr->nFuncMask & nMask) == 0)
{
- // add to previous column only if new bits aren't already set there
- if ( ( aIt->nFuncMask & nMask ) == 0 )
- {
- aIt->nFuncMask |= nMask;
- aIt->nFuncCount = lcl_CountBits( aIt->nFuncMask );
- bDupUsed = true;
- }
+ itr->nFuncMask |= nMask;
+ itr->nFuncCount = lcl_CountBits(itr->nFuncMask);
+ bDupUsed = true;
+ break;
}
+ }
}
if ( !bDupUsed ) // also for duplicated dim if original has different orientation
{
- rFields.resize( rFields.size() + 1 );
- ScPivotField& rField = rFields.back();
-
- if ( bDataLayout )
+ aFields.push_back(PivotField());
+ PivotField& rField = aFields.back();
+ if (bDataLayout)
{
rField.nCol = PIVOT_DATA_FIELD;
bDataFound = true;
}
- else if ( nDupSource >= 0 ) // if source was not found (different orientation)
+ else if (nDupSource >= 0)
rField.nCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek from name
else
rField.nCol = static_cast<SCsCOL>(nDim)+nColAdd; //! seek source column from name
rField.nFuncMask = nMask;
- rField.nFuncCount = lcl_CountBits( nMask );
-
- aPos.push_back( ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_POSITION) ) );
+ rField.nFuncCount = lcl_CountBits(nMask);
+ long nPos = ScUnoHelpFunctions::GetLongProperty(
+ xDimProp, OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_POSITION)));
+ aPos.push_back(nPos);
try
{
- if( nOrient == sheet::DataPilotFieldOrientation_DATA )
- xDimProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_REFVALUE ) ) )
- >>= rFields.back().maFieldRef;
+ if (nOrient == sheet::DataPilotFieldOrientation_DATA)
+ xDimProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_REFVALUE)))
+ >>= rField.maFieldRef;
}
- catch( uno::Exception& )
+ catch (uno::Exception&)
{
}
}
@@ -1832,25 +1809,27 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields,
}
// sort by getPosition() value
- size_t nSize = aPos.size();
- for (size_t i=0; i+1<nSize; i++)
+
+ size_t nOutCount = aFields.size();
+ if (nOutCount >= 1)
{
- for (size_t j=0; j+i+1<nSize; j++)
- if ( aPos[j+1] < aPos[j] )
+ for (size_t i = 0; i < nOutCount - 1; ++i)
+ {
+ for (size_t j = 0; j + i < nOutCount - 1; ++j)
{
- std::swap( aPos[j], aPos[j+1] );
- std::swap( rFields[j], rFields[j+1] );
+ if ( aPos[j+1] < aPos[j] )
+ {
+ std::swap( aPos[j], aPos[j+1] );
+ std::swap( aFields[j], aFields[j+1] );
+ }
}
+ }
}
- if ( bAddData && !bDataFound )
- {
- rFields.resize( rFields.size() + 1 );
- ScPivotField& rField = rFields.back();
- rField.nCol = PIVOT_DATA_FIELD;
- rField.nFuncMask = 0;
- rField.nFuncCount = 0;
- }
+ if (bAddData && !bDataFound)
+ aFields.push_back(PivotField(PIVOT_DATA_FIELD, 0));
+
+ rFields.swap(aFields);
}
sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const
@@ -1863,11 +1842,23 @@ sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const
// ppLabelArr / nLabels is not changed
SCCOL nColAdd = 0;
+ if ( bForFile )
+ {
+ // in old file format, columns are within document, not within source range
+
+ DBG_ASSERT( pSheetDesc, "FillOldParam: bForFile, !pSheetDesc" );
+ nColAdd = pSheetDesc->GetSourceRange().aStart.Col();
+ }
+
bool bAddData = ( lcl_GetDataGetOrientation( xSource ) == sheet::DataPilotFieldOrientation_HIDDEN );
- lcl_FillOldFields( rParam.maPageArr, xSource, sheet::DataPilotFieldOrientation_PAGE, nColAdd, false );
- lcl_FillOldFields( rParam.maColArr, xSource, sheet::DataPilotFieldOrientation_COLUMN, nColAdd, bAddData );
- lcl_FillOldFields( rParam.maRowArr, xSource, sheet::DataPilotFieldOrientation_ROW, nColAdd, false );
- lcl_FillOldFields( rParam.maDataArr, xSource, sheet::DataPilotFieldOrientation_DATA, nColAdd, false );
+ lcl_FillOldFields(
+ rParam.maPageFields, xSource, sheet::DataPilotFieldOrientation_PAGE, nColAdd, false);
+ lcl_FillOldFields(
+ rParam.maColFields, xSource, sheet::DataPilotFieldOrientation_COLUMN, nColAdd, bAddData);
+ lcl_FillOldFields(
+ rParam.maRowFields, xSource, sheet::DataPilotFieldOrientation_ROW, nColAdd, false);
+ lcl_FillOldFields(
+ rParam.maDataFields, xSource, sheet::DataPilotFieldOrientation_DATA, nColAdd, false);
uno::Reference<beans::XPropertySet> xProp( xSource, uno::UNO_QUERY );
if (xProp.is())
@@ -1875,15 +1866,15 @@ sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const
try
{
rParam.bMakeTotalCol = ScUnoHelpFunctions::GetBoolProperty( xProp,
- rtl::OUString::createFromAscii(DP_PROP_COLUMNGRAND), sal_True );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)), true );
rParam.bMakeTotalRow = ScUnoHelpFunctions::GetBoolProperty( xProp,
- rtl::OUString::createFromAscii(DP_PROP_ROWGRAND), sal_True );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)), true );
// following properties may be missing for external sources
rParam.bIgnoreEmptyRows = ScUnoHelpFunctions::GetBoolProperty( xProp,
- rtl::OUString::createFromAscii(DP_PROP_IGNOREEMPTY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_IGNOREEMPTY)) );
rParam.bDetectCategories = ScUnoHelpFunctions::GetBoolProperty( xProp,
- rtl::OUString::createFromAscii(DP_PROP_REPEATIFEMPTY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_REPEATIFEMPTY)) );
}
catch(uno::Exception&)
{
@@ -1900,7 +1891,7 @@ void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XProp
{
uno::Reference<container::XIndexAccess> xHiers = new ScNameToIndexAccess( xDimSupp->getHierarchies() );
long nHierarchy = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_USEDHIERARCHY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_USEDHIERARCHY)) );
if ( nHierarchy >= xHiers->getCount() )
nHierarchy = 0;
rData.mnUsedHier = nHierarchy;
@@ -1918,7 +1909,7 @@ void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XProp
if ( xLevProp.is() )
{
rData.mbShowAll = ScUnoHelpFunctions::GetBoolProperty( xLevProp,
- rtl::OUString::createFromAscii(DP_PROP_SHOWEMPTY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWEMPTY)) );
try
{
@@ -1949,7 +1940,7 @@ sal_Bool ScDPObject::FillLabelData(ScPivotParam& rParam)
if ( nDimCount > MAX_LABELS )
nDimCount = MAX_LABELS;
if (!nDimCount)
- return sal_False;
+ return false;
for (long nDim=0; nDim < nDimCount; nDim++)
{
@@ -1961,9 +1952,9 @@ sal_Bool ScDPObject::FillLabelData(ScPivotParam& rParam)
if ( xDimName.is() && xDimProp.is() )
{
- sal_Bool bDuplicated = sal_False;
+ sal_Bool bDuplicated = false;
sal_Bool bData = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
//! error checking -- is "IsDataLayoutDimension" property required??
try
@@ -1971,7 +1962,7 @@ sal_Bool ScDPObject::FillLabelData(ScPivotParam& rParam)
aFieldName = String( xDimName->getName() );
uno::Any aOrigAny = xDimProp->getPropertyValue(
- rtl::OUString::createFromAscii(DP_PROP_ORIGINAL) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIGINAL)) );
uno::Reference<uno::XInterface> xIntOrig;
if ( (aOrigAny >>= xIntOrig) && xIntOrig.is() )
bDuplicated = sal_True;
@@ -1981,21 +1972,21 @@ sal_Bool ScDPObject::FillLabelData(ScPivotParam& rParam)
}
OUString aLayoutName = ScUnoHelpFunctions::GetStringProperty(
- xDimProp, OUString::createFromAscii(SC_UNO_LAYOUTNAME), OUString());
+ xDimProp, OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_LAYOUTNAME)), OUString());
if ( aFieldName.Len() && !bData && !bDuplicated )
{
SCsCOL nCol = static_cast< SCsCOL >( nDim ); //! ???
bool bIsValue = true; //! check
- ScDPLabelData aNewLabel(aFieldName, nCol, bIsValue);
- aNewLabel.maLayoutName = aLayoutName;
- GetHierarchies(nDim, aNewLabel.maHiers);
- GetMembers(nDim, GetUsedHierarchy(nDim), aNewLabel.maMembers);
- lcl_FillLabelData(aNewLabel, xDimProp);
- aNewLabel.mnFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 );
- rParam.maLabelArray.push_back(aNewLabel);
+ ScDPLabelDataRef pNewLabel(new ScDPLabelData(aFieldName, nCol, bIsValue));
+ pNewLabel->maLayoutName = aLayoutName;
+ GetHierarchies(nDim, pNewLabel->maHiers);
+ GetMembers(nDim, GetUsedHierarchy(nDim), pNewLabel->maMembers);
+ lcl_FillLabelData(*pNewLabel, xDimProp);
+ pNewLabel->mnFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_FLAGS)), 0 );
+ rParam.maLabelArray.push_back(pNewLabel);
}
}
}
@@ -2005,7 +1996,7 @@ sal_Bool ScDPObject::FillLabelData(ScPivotParam& rParam)
sal_Bool ScDPObject::GetHierarchiesNA( sal_Int32 nDim, uno::Reference< container::XNameAccess >& xHiers )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
uno::Reference<container::XNameAccess> xDimsName( GetSource()->getDimensions() );
uno::Reference<container::XIndexAccess> xIntDims(new ScNameToIndexAccess( xDimsName ));
if( xIntDims.is() )
@@ -2022,7 +2013,7 @@ sal_Bool ScDPObject::GetHierarchiesNA( sal_Int32 nDim, uno::Reference< container
sal_Bool ScDPObject::GetHierarchies( sal_Int32 nDim, uno::Sequence< rtl::OUString >& rHiers )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
uno::Reference< container::XNameAccess > xHiersNA;
if( GetHierarchiesNA( nDim, xHiersNA ) )
{
@@ -2050,7 +2041,7 @@ sal_Bool ScDPObject::GetMembersNA( sal_Int32 nDim, uno::Reference< container::XN
sal_Bool ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< container::XNameAccess >& xMembers )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
uno::Reference<container::XNameAccess> xDimsName( GetSource()->getDimensions() );
uno::Reference<container::XIndexAccess> xIntDims(new ScNameToIndexAccess( xDimsName ));
uno::Reference<beans::XPropertySet> xDim(xIntDims->getByIndex( nDim ), uno::UNO_QUERY);
@@ -2086,6 +2077,8 @@ sal_Bool ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Referen
//------------------------------------------------------------------------
// convert old pivot tables into new datapilot tables
+namespace {
+
String lcl_GetDimName( const uno::Reference<sheet::XDimensionsSupplier>& xSource, long nDim )
{
rtl::OUString aName;
@@ -2114,116 +2107,128 @@ String lcl_GetDimName( const uno::Reference<sheet::XDimensionsSupplier>& xSource
return aName;
}
-// static
-void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData,
- const ScPivotFieldVector& rFields, sal_uInt16 nOrient,
- ScDocument* pDoc, SCROW nRow, SCTAB nTab,
- const uno::Reference<sheet::XDimensionsSupplier>& xSource,
- bool bOldDefaults,
- const ScPivotFieldVector* pRefColFields,
- const ScPivotFieldVector* pRefRowFields,
- const ScPivotFieldVector* pRefPageFields )
+bool hasFieldColumn(const vector<PivotField>* pRefFields, SCCOL nCol)
{
- // pDoc or xSource must be set
- DBG_ASSERT( pDoc || xSource.is(), "missing string source" );
+ if (!pRefFields)
+ return false;
+
+ vector<PivotField>::const_iterator itr = pRefFields->begin(), itrEnd = pRefFields->end();
+ for (; itr != itrEnd; ++itr)
+ {
+ if (itr->nCol == nCol)
+ // This array of fields contains the specified column.
+ return true;
+ }
+ return false;
+}
- String aDocStr;
- ScDPSaveDimension* pDim;
+}
- for (ScPivotFieldVector::const_iterator aIt = rFields.begin(), aEnd = rFields.end(); aIt != aEnd; ++aIt)
+void ScDPObject::ConvertOrientation(
+ ScDPSaveData& rSaveData, const vector<PivotField>& rFields, sal_uInt16 nOrient,
+ const Reference<XDimensionsSupplier>& xSource,
+ vector<PivotField>* pRefColFields, vector<PivotField>* pRefRowFields, vector<PivotField>* pRefPageFields )
+{
+ // xSource must be set
+ DBG_ASSERT( xSource.is(), "missing string source" );
+
+ vector<PivotField>::const_iterator itr, itrBeg = rFields.begin(), itrEnd = rFields.end();
+ for (itr = itrBeg; itr != itrEnd; ++itr)
{
- SCCOL nCol = aIt->nCol;
- sal_uInt16 nFuncs = aIt->nFuncMask;
- const sheet::DataPilotFieldReference& rFieldRef = aIt->maFieldRef;
+ const PivotField& rField = *itr;
+
+ SCCOL nCol = rField.nCol;
+ sal_uInt16 nFuncs = rField.nFuncMask;
+ const sheet::DataPilotFieldReference& rFieldRef = rField.maFieldRef;
+ ScDPSaveDimension* pDim = NULL;
if ( nCol == PIVOT_DATA_FIELD )
pDim = rSaveData.GetDataLayoutDimension();
else
{
- if ( pDoc )
- pDoc->GetString( nCol, nRow, nTab, aDocStr );
- else
- aDocStr = lcl_GetDimName( xSource, nCol ); // cols must start at 0
-
+ String aDocStr = lcl_GetDimName( xSource, nCol ); // cols must start at 0
if ( aDocStr.Len() )
pDim = rSaveData.GetDimensionByName(aDocStr);
else
pDim = NULL;
}
- if ( pDim )
+ if (!pDim)
+ continue;
+
+ if ( nOrient == sheet::DataPilotFieldOrientation_DATA ) // set summary function
{
- if ( nOrient == sheet::DataPilotFieldOrientation_DATA ) // set summary function
- {
- // generate an individual entry for each function
- bool bFirst = true;
-
- // if a dimension is used for column/row/page and data,
- // use duplicated dimensions for all data occurrences
- if (pRefColFields)
- for (ScPivotFieldVector::const_iterator aRefIt = pRefColFields->begin(), aRefEnd = pRefColFields->end(); bFirst && (aRefIt != aRefEnd); ++aRefIt)
- if (aRefIt->nCol == nCol)
- bFirst = false;
- if (pRefRowFields)
- for (ScPivotFieldVector::const_iterator aRefIt = pRefRowFields->begin(), aRefEnd = pRefRowFields->end(); bFirst && (aRefIt != aRefEnd); ++aRefIt)
- if (aRefIt->nCol == nCol)
- bFirst = false;
- if (pRefPageFields)
- for (ScPivotFieldVector::const_iterator aRefIt = pRefPageFields->begin(), aRefEnd = pRefPageFields->end(); bFirst && (aRefIt != aRefEnd); ++aRefIt)
- if (aRefIt->nCol == nCol)
- bFirst = false;
+ // generate an individual entry for each function
+ bool bFirst = true;
+
+ // if a dimension is used for column/row/page and data,
+ // use duplicated dimensions for all data occurrences
+ if (hasFieldColumn(pRefColFields, nCol))
+ bFirst = false;
+
+ if (bFirst && hasFieldColumn(pRefRowFields, nCol))
+ bFirst = false;
+ if (bFirst && hasFieldColumn(pRefPageFields, nCol))
+ bFirst = false;
+
+ if (bFirst)
+ {
// if set via api, a data column may occur several times
// (if the function hasn't been changed yet) -> also look for duplicate data column
- for (ScPivotFieldVector::const_iterator aRefIt = rFields.begin(); bFirst && (aRefIt != aIt); ++aRefIt)
- if (aRefIt->nCol == nCol)
- bFirst = false;
-
- sal_uInt16 nMask = 1;
- for (sal_uInt16 nBit=0; nBit<16; nBit++)
+ for (vector<PivotField>::const_iterator itr2 = itrBeg; itr2 != itr; ++itr2)
{
- if ( nFuncs & nMask )
+ if (itr2->nCol == nCol)
{
- sheet::GeneralFunction eFunc = ScDataPilotConversion::FirstFunc( nMask );
- ScDPSaveDimension* pCurrDim = bFirst ? pDim : rSaveData.DuplicateDimension(pDim->GetName());
- pCurrDim->SetOrientation( nOrient );
- pCurrDim->SetFunction( sal::static_int_cast<sal_uInt16>(eFunc) );
-
- if( rFieldRef.ReferenceType == sheet::DataPilotFieldReferenceType::NONE )
- pCurrDim->SetReferenceValue( 0 );
- else
- pCurrDim->SetReferenceValue( &rFieldRef );
-
bFirst = false;
+ break;
}
- nMask *= 2;
}
}
- else // set SubTotals
- {
- pDim->SetOrientation( nOrient );
- sal_uInt16 nFuncArray[16];
- sal_uInt16 nFuncCount = 0;
- sal_uInt16 nMask = 1;
- for (sal_uInt16 nBit=0; nBit<16; nBit++)
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 nBit=0; nBit<16; nBit++)
+ {
+ if ( nFuncs & nMask )
{
- if ( nFuncs & nMask )
- nFuncArray[nFuncCount++] = sal::static_int_cast<sal_uInt16>(ScDataPilotConversion::FirstFunc( nMask ));
- nMask *= 2;
+ sheet::GeneralFunction eFunc = ScDataPilotConversion::FirstFunc( nMask );
+ ScDPSaveDimension* pCurrDim = bFirst ? pDim : rSaveData.DuplicateDimension(pDim->GetName());
+ pCurrDim->SetOrientation( nOrient );
+ pCurrDim->SetFunction( sal::static_int_cast<sal_uInt16>(eFunc) );
+
+ if( rFieldRef.ReferenceType == sheet::DataPilotFieldReferenceType::NONE )
+ pCurrDim->SetReferenceValue( 0 );
+ else
+ pCurrDim->SetReferenceValue( &rFieldRef );
+
+ bFirst = false;
}
- pDim->SetSubTotals( nFuncCount, nFuncArray );
+ nMask *= 2;
+ }
+ }
+ else // set SubTotals
+ {
+ pDim->SetOrientation( nOrient );
- // ShowEmpty was implicit in old tables,
- // must be set for data layout dimension (not accessible in dialog)
- if ( bOldDefaults || nCol == PIVOT_DATA_FIELD )
- pDim->SetShowEmpty( sal_True );
+ sal_uInt16 nFuncArray[16];
+ sal_uInt16 nFuncCount = 0;
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 nBit=0; nBit<16; nBit++)
+ {
+ if ( nFuncs & nMask )
+ nFuncArray[nFuncCount++] = sal::static_int_cast<sal_uInt16>(ScDataPilotConversion::FirstFunc( nMask ));
+ nMask *= 2;
}
+ pDim->SetSubTotals( nFuncCount, nFuncArray );
+
+ // ShowEmpty was implicit in old tables,
+ // must be set for data layout dimension (not accessible in dialog)
+ if ( nCol == PIVOT_DATA_FIELD )
+ pDim->SetShowEmpty( true );
}
}
}
-// static
bool ScDPObject::IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags )
{
bool bAllowed = true;
@@ -2251,17 +2256,16 @@ bool ScDPObject::IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags )
// -----------------------------------------------------------------------
-// static
sal_Bool ScDPObject::HasRegisteredSources()
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
uno::Reference<lang::XMultiServiceFactory> xManager = comphelper::getProcessServiceFactory();
uno::Reference<container::XContentEnumerationAccess> xEnAc( xManager, uno::UNO_QUERY );
if ( xEnAc.is() )
{
uno::Reference<container::XEnumeration> xEnum = xEnAc->createContentEnumeration(
- rtl::OUString::createFromAscii( SCDPSOURCE_SERVICE ) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDPSOURCE_SERVICE )) );
if ( xEnum.is() && xEnum->hasMoreElements() )
bFound = sal_True;
}
@@ -2269,10 +2273,8 @@ sal_Bool ScDPObject::HasRegisteredSources()
return bFound;
}
-// static
uno::Sequence<rtl::OUString> ScDPObject::GetRegisteredSources()
{
- long nCount = 0;
uno::Sequence<rtl::OUString> aSeq(0);
// use implementation names...
@@ -2282,9 +2284,10 @@ uno::Sequence<rtl::OUString> ScDPObject::GetRegisteredSources()
if ( xEnAc.is() )
{
uno::Reference<container::XEnumeration> xEnum = xEnAc->createContentEnumeration(
- rtl::OUString::createFromAscii( SCDPSOURCE_SERVICE ) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDPSOURCE_SERVICE )) );
if ( xEnum.is() )
{
+ long nCount = 0;
while ( xEnum->hasMoreElements() )
{
uno::Any aAddInAny = xEnum->nextElement();
@@ -2315,7 +2318,6 @@ uno::Sequence<rtl::OUString> ScDPObject::GetRegisteredSources()
// use getContext from addincol.cxx
uno::Reference<uno::XComponentContext> getContext(uno::Reference<lang::XMultiServiceFactory> xMSF);
-// static
uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPServiceDesc& rDesc )
{
rtl::OUString aImplName = rDesc.aServiceName;
@@ -2326,7 +2328,7 @@ uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS
if ( xEnAc.is() )
{
uno::Reference<container::XEnumeration> xEnum = xEnAc->createContentEnumeration(
- rtl::OUString::createFromAscii( SCDPSOURCE_SERVICE ) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDPSOURCE_SERVICE )) );
if ( xEnum.is() )
{
while ( xEnum->hasMoreElements() && !xRet.is() )
@@ -2394,202 +2396,158 @@ ScDPCollection::ScDPCollection(ScDocument* pDocument) :
}
ScDPCollection::ScDPCollection(const ScDPCollection& r) :
- ScCollection(r),
pDoc(r.pDoc)
{
}
ScDPCollection::~ScDPCollection()
{
+ maTables.clear();
}
-ScDataObject* ScDPCollection::Clone() const
+namespace {
+
+/**
+ * Unary predicate to match DP objects by the table ID.
+ */
+class MatchByTable : public unary_function<bool, ScDPObject>
{
- return new ScDPCollection(*this);
+ SCTAB mnTab;
+public:
+ MatchByTable(SCTAB nTab) : mnTab(nTab) {}
+
+ bool operator() (const ScDPObject& rObj) const
+ {
+ return rObj.GetOutRange().aStart.Tab() == mnTab;
+ }
+};
+
}
void ScDPCollection::DeleteOnTab( SCTAB nTab )
{
- sal_uInt16 nPos = 0;
- while ( nPos < nCount )
- {
- // look for output positions on the deleted sheet
- if ( static_cast<const ScDPObject*>(At(nPos))->GetOutRange().aStart.Tab() == nTab )
- AtFree(nPos);
- else
- ++nPos;
- }
+ maTables.erase(
+ remove_if(maTables.begin(), maTables.end(), MatchByTable(nTab)),
+ maTables.end());
}
void ScDPCollection::UpdateReference( UpdateRefMode eUpdateRefMode,
const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
{
- for (sal_uInt16 i=0; i<nCount; i++)
- ((ScDPObject*)At(i))->UpdateReference( eUpdateRefMode, r, nDx, nDy, nDz );
+ TablesType::iterator itr = maTables.begin(), itrEnd = maTables.end();
+ for (; itr != itrEnd; ++itr)
+ itr->UpdateReference(eUpdateRefMode, r, nDx, nDy, nDz);
}
-sal_Bool ScDPCollection::RefsEqual( const ScDPCollection& r ) const
+bool ScDPCollection::RefsEqual( const ScDPCollection& r ) const
{
- if ( nCount != r.nCount )
- return sal_False;
+ if (maTables.size() != r.maTables.size())
+ return false;
- for (sal_uInt16 i=0; i<nCount; i++)
- if ( ! ((const ScDPObject*)At(i))->RefsEqual( *((const ScDPObject*)r.At(i)) ) )
- return sal_False;
+ TablesType::const_iterator itr = maTables.begin(), itr2 = r.maTables.begin(), itrEnd = maTables.end();
+ for (; itr != itrEnd; ++itr, ++itr2)
+ if (!itr->RefsEqual(*itr2))
+ return false;
- return sal_True; // all equal
+ return true;
}
void ScDPCollection::WriteRefsTo( ScDPCollection& r ) const
{
- if ( nCount == r.nCount )
+ if ( maTables.size() == r.maTables.size() )
{
//! assert equal names?
- for (sal_uInt16 i=0; i<nCount; i++)
- ((const ScDPObject*)At(i))->WriteRefsTo( *((ScDPObject*)r.At(i)) );
+ TablesType::const_iterator itr = maTables.begin(), itrEnd = maTables.end();
+ TablesType::iterator itr2 = r.maTables.begin();
+ for (; itr != itrEnd; ++itr, ++itr2)
+ itr->WriteRefsTo(*itr2);
}
else
{
// #i8180# If data pilot tables were deleted with their sheet,
// this collection contains extra entries that must be restored.
// Matching objects are found by their names.
-
- DBG_ASSERT( nCount >= r.nCount, "WriteRefsTo: missing entries in document" );
- for (sal_uInt16 nSourcePos=0; nSourcePos<nCount; nSourcePos++)
+ size_t nSrcSize = maTables.size();
+ size_t nDestSize = r.maTables.size();
+ DBG_ASSERT( nSrcSize >= nDestSize, "WriteRefsTo: missing entries in document" );
+ for (size_t nSrcPos = 0; nSrcPos < nSrcSize; ++nSrcPos)
{
- const ScDPObject* pSourceObj = static_cast<const ScDPObject*>(At(nSourcePos));
- String aName = pSourceObj->GetName();
+ const ScDPObject& rSrcObj = maTables[nSrcPos];
+ String aName = rSrcObj.GetName();
bool bFound = false;
- for (sal_uInt16 nDestPos=0; nDestPos<r.nCount && !bFound; nDestPos++)
+ for (size_t nDestPos = 0; nDestPos < nDestSize && !bFound; ++nDestPos)
{
- ScDPObject* pDestObj = static_cast<ScDPObject*>(r.At(nDestPos));
- if ( pDestObj->GetName() == aName )
+ ScDPObject& rDestObj = r.maTables[nDestPos];
+ if (rDestObj.GetName() == aName)
{
- pSourceObj->WriteRefsTo( *pDestObj ); // found object, copy refs
+ rSrcObj.WriteRefsTo(rDestObj); // found object, copy refs
bFound = true;
}
}
- if ( !bFound )
+
+ if (!bFound)
{
// none found, re-insert deleted object (see ScUndoDataPilot::Undo)
- ScDPObject* pDestObj = new ScDPObject( *pSourceObj );
- pDestObj->SetAlive(sal_True);
- if ( !r.InsertNewTable(pDestObj) )
- {
- DBG_ERROR("cannot insert DPObject");
- DELETEZ( pDestObj );
- }
+ ScDPObject* pDestObj = new ScDPObject(rSrcObj);
+ pDestObj->SetAlive(true);
+ r.InsertNewTable(pDestObj);
}
}
- DBG_ASSERT( nCount == r.nCount, "WriteRefsTo: couldn't restore all entries" );
+ DBG_ASSERT( maTables.size() == r.maTables.size(), "WriteRefsTo: couldn't restore all entries" );
}
}
-ScDPObject* ScDPCollection::GetByName(const String& rName) const
+size_t ScDPCollection::GetCount() const
{
- for (sal_uInt16 i=0; i<nCount; i++)
- if (static_cast<const ScDPObject*>(pItems[i])->GetName() == rName)
- return static_cast<ScDPObject*>(pItems[i]);
- return NULL;
+ return maTables.size();
}
-String ScDPCollection::CreateNewName( sal_uInt16 nMin ) const
+ScDPObject* ScDPCollection::operator [](size_t nIndex)
{
- String aBase( RTL_CONSTASCII_USTRINGPARAM( "Pivot" ) );
- //! from Resource?
-
- for (sal_uInt16 nAdd=0; nAdd<=nCount; nAdd++) // nCount+1 tries
- {
- String aNewName = aBase;
- aNewName += String::CreateFromInt32( nMin + nAdd );
- sal_Bool bFound = sal_False;
- for (sal_uInt16 i=0; i<nCount && !bFound; i++)
- if (((const ScDPObject*)pItems[i])->GetName() == aNewName)
- bFound = sal_True;
- if (!bFound)
- return aNewName; // found unused Name
- }
- return String(); // should not happen
+ return &maTables[nIndex];
}
+const ScDPObject* ScDPCollection::operator [](size_t nIndex) const
+{
+ return &maTables[nIndex];
+}
-
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
-long ScDPObject::GetCacheId() const
+const ScDPObject* ScDPCollection::GetByName(const String& rName) const
{
- if ( GetSaveData() )
- return GetSaveData()->GetCacheId();
- else
- return mnCacheId;
+ TablesType::const_iterator itr = maTables.begin(), itrEnd = maTables.end();
+ for (; itr != itrEnd; ++itr)
+ if (itr->GetName() == rName)
+ return &(*itr);
+
+ return NULL;
}
-sal_uLong ScDPObject::RefreshCache()
+
+String ScDPCollection::CreateNewName( sal_uInt16 nMin ) const
{
- if ( pServDesc )
- {
- // cache table isn't used for external service - do nothing, no error
- return 0;
- }
+ String aBase = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("DataPilot"));
+ //! from Resource?
- CreateObjects();
- sal_uLong nErrId = 0;
- if ( pSheetDesc)
- nErrId = pSheetDesc->CheckValidate( pDoc );
- if ( nErrId == 0 )
+ size_t n = maTables.size();
+ for (size_t nAdd = 0; nAdd <= n; ++nAdd) // nCount+1 tries
{
- long nOldId = GetCacheId();
- long nNewId = pDoc->GetNewDPObjectCacheId();
- if ( nOldId >= 0 )
- pDoc->RemoveDPObjectCache( nOldId );
-
- ScDPTableDataCache* pCache = NULL;
- if ( pSheetDesc )
- pCache = pSheetDesc->CreateCache( pDoc, nNewId );
- else if ( pImpDesc )
- pCache = pImpDesc->CreateCache( pDoc, nNewId );
-
- if ( pCache == NULL )
+ String aNewName = aBase;
+ aNewName += String::CreateFromInt32( nMin + nAdd );
+ bool bFound = false;
+ TablesType::const_iterator itr = maTables.begin(), itrEnd = maTables.end();
+ for (; itr != itrEnd; ++itr)
{
- //cache failed
- DBG_ASSERT( pCache , " pCache == NULL" );
- return STR_ERR_DATAPILOTSOURCE;
- }
-
- nNewId = pCache->GetId();
-
- bRefresh = sal_True;
- ScDPCollection* pDPCollection = pDoc->GetDPCollection();
- sal_uInt16 nCount = pDPCollection->GetCount();
- for (sal_uInt16 i=0; i<nCount; i++)
- { //set new cache id
- if ( (*pDPCollection)[i]->GetCacheId() == nOldId )
+ if (itr->GetName() == aNewName)
{
- (*pDPCollection)[i]->SetCacheId( nNewId );
- (*pDPCollection)[i]->SetRefresh();
-
+ bFound = true;
+ break;
}
}
- DBG_ASSERT( GetCacheId() >= 0, " GetCacheId() >= 0 " );
- }
- return nErrId;
-}
-void ScDPObject::SetCacheId( long nCacheId )
-{
- if ( GetCacheId() != nCacheId )
- {
- InvalidateSource();
- if ( GetSaveData() )
- GetSaveData()->SetCacheId( nCacheId );
-
- mnCacheId = nCacheId;
+ if (!bFound)
+ return aNewName; // found unused Name
}
+ return String(); // should not happen
}
-const ScDPTableDataCache* ScDPObject::GetCache() const
-{
- return pDoc->GetDPObjectCache( GetCacheId() );
-}
-// End Comments
void ScDPCollection::FreeTable(ScDPObject* pDPObj)
{
@@ -2597,20 +2555,27 @@ void ScDPCollection::FreeTable(ScDPObject* pDPObj)
const ScAddress& s = rOutRange.aStart;
const ScAddress& e = rOutRange.aEnd;
pDoc->RemoveFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE);
- Free(pDPObj);
+ TablesType::iterator itr = maTables.begin(), itrEnd = maTables.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ ScDPObject* p = &(*itr);
+ if (p == pDPObj)
+ {
+ maTables.erase(itr);
+ break;
+ }
+ }
}
bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
{
- bool bSuccess = Insert(pDPObj);
- if (bSuccess)
- {
- const ScRange& rOutRange = pDPObj->GetOutRange();
- const ScAddress& s = rOutRange.aStart;
- const ScAddress& e = rOutRange.aEnd;
- pDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE);
- }
- return bSuccess;
+ const ScRange& rOutRange = pDPObj->GetOutRange();
+ const ScAddress& s = rOutRange.aStart;
+ const ScAddress& e = rOutRange.aEnd;
+ pDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE);
+
+ maTables.push_back(pDPObj);
+ return true;
}
bool ScDPCollection::HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const
@@ -2624,4 +2589,4 @@ bool ScDPCollection::HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const
return pMergeAttr->HasDPTable();
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 6cdfe2a467e7..f91b403f8986 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include "scitems.hxx"
@@ -37,6 +36,7 @@
#include <editeng/boxitem.hxx>
#include <editeng/brshitem.hxx>
#include <editeng/wghtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <unotools/transliterationwrapper.hxx>
#include "dpoutput.hxx"
@@ -56,11 +56,8 @@
#include "scresid.hxx"
#include "unonames.hxx"
#include "sc.hrc"
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "scdpoutputimpl.hxx"
#include "dpglobal.hxx"
-// End Comments
#include <com/sun/star/beans/XPropertySet.hpp>
#include <vector>
@@ -97,7 +94,6 @@ using ::rtl::OUString;
//! dynamic!!!
#define SC_DPOUT_MAXLEVELS 256
-
struct ScDPOutLevelData
{
long nDim;
@@ -120,7 +116,6 @@ struct ScDPOutLevelData
( nDimPos==r.nDimPos && nHier==r.nHier && nLevel<r.nLevel ); }
void Swap(ScDPOutLevelData& r)
-//! { ScDPOutLevelData aTemp = r; r = *this; *this = aTemp; }
{ ScDPOutLevelData aTemp; aTemp = r; r = *this; *this = aTemp; }
//! bug (73840) in uno::Sequence - copy and then assign doesn't work!
@@ -134,7 +129,7 @@ void lcl_SetStyleById( ScDocument* pDoc, SCTAB nTab,
{
if ( nCol1 > nCol2 || nRow1 > nRow2 )
{
- DBG_ERROR("SetStyleById: invalid range");
+ OSL_FAIL("SetStyleById: invalid range");
return;
}
@@ -170,9 +165,9 @@ void lcl_SetFrame( ScDocument* pDoc, SCTAB nTab,
aBox.SetLine(&aLine, BOX_LINE_RIGHT);
aBox.SetLine(&aLine, BOX_LINE_BOTTOM);
SvxBoxInfoItem aBoxInfo( ATTR_BORDER_INNER );
- aBoxInfo.SetValid(VALID_HORI,sal_False);
- aBoxInfo.SetValid(VALID_VERT,sal_False);
- aBoxInfo.SetValid(VALID_DISTANCE,sal_False);
+ aBoxInfo.SetValid(VALID_HORI,false);
+ aBoxInfo.SetValid(VALID_VERT,false);
+ aBoxInfo.SetValid(VALID_DISTANCE,false);
pDoc->ApplyFrameAreaTab( ScRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab ), &aBox, &aBoxInfo );
}
@@ -200,7 +195,7 @@ void lcl_FillNumberFormats( sal_uInt32*& rFormats, long& rCount,
String aDataNames[SC_DPOUT_MAXLEVELS];
sal_uInt32 nDataFormats[SC_DPOUT_MAXLEVELS];
long nDataCount = 0;
- sal_Bool bAnySet = sal_False;
+ sal_Bool bAnySet = false;
long nDimCount = xDims->getCount();
for (long nDim=0; nDim<nDimCount; nDim++)
@@ -213,14 +208,14 @@ void lcl_FillNumberFormats( sal_uInt32*& rFormats, long& rCount,
{
sheet::DataPilotFieldOrientation eDimOrient =
(sheet::DataPilotFieldOrientation) ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)),
sheet::DataPilotFieldOrientation_HIDDEN );
if ( eDimOrient == sheet::DataPilotFieldOrientation_DATA )
{
aDataNames[nDataCount] = String( xDimName->getName() );
long nFormat = ScUnoHelpFunctions::GetLongProperty(
xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_NUMBERFORMAT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_NUMBERFORMAT)) );
nDataFormats[nDataCount] = nFormat;
if ( nFormat != 0 )
bAnySet = sal_True;
@@ -280,13 +275,13 @@ sal_uInt32 lcl_GetFirstNumberFormat( const uno::Reference<container::XIndexAcces
{
sheet::DataPilotFieldOrientation eDimOrient =
(sheet::DataPilotFieldOrientation) ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)),
sheet::DataPilotFieldOrientation_HIDDEN );
if ( eDimOrient == sheet::DataPilotFieldOrientation_DATA )
{
long nFormat = ScUnoHelpFunctions::GetLongProperty(
xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_NUMBERFORMAT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_NUMBERFORMAT)) );
return nFormat; // use format from first found data dimension
}
@@ -314,7 +309,7 @@ sal_Bool lcl_MemberEmpty( const uno::Sequence<sheet::MemberResult>& rSeq )
const sheet::MemberResult* pArray = rSeq.getConstArray();
for (long i=0; i<nLen; i++)
if (pArray[i].Flags & sheet::MemberResultFlags::HASMEMBER)
- return sal_False;
+ return false;
return sal_True; // no member data -> empty
}
@@ -328,7 +323,7 @@ uno::Sequence<sheet::MemberResult> lcl_GetSelectedPageAsResult( const uno::Refer
{
//! merge with ScDPDimension::setPropertyValue?
- uno::Any aValue = xDimProp->getPropertyValue( rtl::OUString::createFromAscii(DP_PROP_FILTER) );
+ uno::Any aValue = xDimProp->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_FILTER)) );
uno::Sequence<sheet::TableFilterField> aSeq;
if (aValue >>= aSeq)
@@ -361,15 +356,15 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
xSource( xSrc ),
aStartPos( rPos ),
bDoFilter( bFilter ),
- bResultsError( sal_False ),
+ bResultsError( false ),
mbHasDataLayout(false),
pColNumFmt( NULL ),
pRowNumFmt( NULL ),
nColFmtCount( 0 ),
nRowFmtCount( 0 ),
nSingleNumFmt( 0 ),
- bSizesValid( sal_False ),
- bSizeOverflow( sal_False ),
+ bSizesValid( false ),
+ bSizeOverflow( false ),
mbHeaderLayout( false )
{
nTabStartCol = nMemberStartCol = nDataStartCol = nTabEndCol = 0;
@@ -400,15 +395,15 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
{
sheet::DataPilotFieldOrientation eDimOrient =
(sheet::DataPilotFieldOrientation) ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)),
sheet::DataPilotFieldOrientation_HIDDEN );
long nDimPos = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_POSITION) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_POSITION)) );
sal_Bool bIsDataLayout = ScUnoHelpFunctions::GetBoolProperty(
xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
bool bHasHiddenMember = ScUnoHelpFunctions::GetBoolProperty(
- xDimProp, OUString::createFromAscii(SC_UNO_HAS_HIDDEN_MEMBER));
+ xDimProp, OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_HAS_HIDDEN_MEMBER)));
if ( eDimOrient != sheet::DataPilotFieldOrientation_HIDDEN )
{
@@ -416,7 +411,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
new ScNameToIndexAccess( xDimSupp->getHierarchies() );
long nHierarchy = ScUnoHelpFunctions::GetLongProperty(
xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_USEDHIERARCHY) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_USEDHIERARCHY)) );
if ( nHierarchy >= xHiers->getCount() )
nHierarchy = 0;
@@ -445,7 +440,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
// #i108948# use ScUnoHelpFunctions::GetStringProperty, because
// LayoutName is new and may not be present in external implementation
OUString aCaption = ScUnoHelpFunctions::GetStringProperty( xPropSet,
- OUString::createFromAscii(SC_UNO_LAYOUTNAME), aName );
+ OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_LAYOUTNAME)), aName );
bool bRowFieldHasMember = false;
switch ( eDimOrient )
@@ -544,7 +539,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
try
{
uno::Any aAny = xSrcProp->getPropertyValue(
- rtl::OUString::createFromAscii(SC_UNO_DATADESC) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_DATADESC)) );
rtl::OUString aUStr;
aAny >>= aUStr;
aDataDescription = String( aUStr );
@@ -568,7 +563,7 @@ ScDPOutput::~ScDPOutput()
void ScDPOutput::SetPosition( const ScAddress& rPos )
{
aStartPos = rPos;
- bSizesValid = bSizeOverflow = sal_False;
+ bSizesValid = bSizeOverflow = false;
}
void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::DataResult& rData )
@@ -609,11 +604,6 @@ void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::Data
if ( nFormat != 0 )
pDoc->ApplyAttr( nCol, nRow, nTab, SfxUInt32Item( ATTR_VALUE_FORMAT, nFormat ) );
}
- else
- {
- //pDoc->SetString( nCol, nRow, nTab, EMPTY_STRING );
- }
-
// SubTotal formatting is controlled by headers
}
@@ -622,38 +612,20 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
{
long nFlags = rData.Flags;
- rtl::OUStringBuffer aCaptionBuf;
- if (!(nFlags & sheet::MemberResultFlags::NUMERIC))
- // This caption is not a number. Make sure it won't get parsed as one.
- aCaptionBuf.append(sal_Unicode('\''));
- aCaptionBuf.append(rData.Caption);
-
if ( nFlags & sheet::MemberResultFlags::HASMEMBER )
{
- pDoc->SetString( nCol, nRow, nTab, aCaptionBuf.makeStringAndClear() );
- }
- else
- {
- //pDoc->SetString( nCol, nRow, nTab, EMPTY_STRING );
+ pDoc->SetString( nCol, nRow, nTab, rData.Caption);
}
if ( nFlags & sheet::MemberResultFlags::SUBTOTAL )
{
-// SvxWeightItem aItem( WEIGHT_BOLD ); // weight is in the style
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
OutputImpl outputimp( pDoc, nTab,
nTabStartCol, nTabStartRow, nMemberStartCol, nMemberStartRow,
nDataStartCol, nDataStartRow, nTabEndCol, nTabEndRow );
- // End Comments
//! limit frames to horizontal or vertical?
if (bColHeader)
{
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- //lcl_SetFrame( pDoc,nTab, nCol,nMemberStartRow+(SCROW)nLevel, nCol,nTabEndRow, SC_DP_FRAME_INNER_BOLD );
outputimp.OutputBlockFrame( nCol,nMemberStartRow+(SCROW)nLevel, nCol,nDataStartRow-1 );
- // End Comments
lcl_SetStyleById( pDoc,nTab, nCol,nMemberStartRow+(SCROW)nLevel, nCol,nDataStartRow-1,
STR_PIVOT_STYLE_TITLE );
@@ -662,11 +634,7 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
}
else
{
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- //lcl_SetFrame( pDoc,nTab, nMemberStartCol+(sal_uInt16)nLevel,nRow, nTabEndCol,nRow, SC_DP_FRAME_INNER_BOLD );
outputimp.OutputBlockFrame( nMemberStartCol+(SCCOL)nLevel,nRow, nDataStartCol-1,nRow );
- // End Comments
lcl_SetStyleById( pDoc,nTab, nMemberStartCol+(SCCOL)nLevel,nRow, nDataStartCol-1,nRow,
STR_PIVOT_STYLE_TITLE );
lcl_SetStyleById( pDoc,nTab, nDataStartCol,nRow, nTabEndCol,nRow,
@@ -871,12 +839,9 @@ void ScDPOutput::Output()
STR_PIVOT_STYLE_INNER );
// output column headers:
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
OutputImpl outputimp( pDoc, nTab,
nTabStartCol, nTabStartRow, nMemberStartCol, nMemberStartRow,
nDataStartCol, nDataStartRow, nTabEndCol, nTabEndRow );
- // End Comments
for (nField=0; nField<nColFieldCount; nField++)
{
SCCOL nHdrCol = nDataStartCol + (SCCOL)nField; //! check for overflow
@@ -890,9 +855,7 @@ void ScDPOutput::Output()
for (long nCol=0; nCol<nThisColCount; nCol++)
{
SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow
- HeaderCell( nColPos, nRowPos, nTab, pArray[nCol], sal_True, nField );
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
+ HeaderCell( nColPos, nRowPos, nTab, pArray[nCol], true, nField );
if ( ( pArray[nCol].Flags & sheet::MemberResultFlags::HASMEMBER ) &&
!( pArray[nCol].Flags & sheet::MemberResultFlags::SUBTOTAL ) )
{
@@ -902,8 +865,6 @@ void ScDPOutput::Output()
SCCOL nEndColPos = nDataStartCol + (SCCOL)nEnd; //! check for overflow
if ( nField+1 < nColFieldCount )
{
- // lcl_SetFrame( pDoc,nTab, nColPos,nRowPos, nEndColPos,nRowPos, SC_DP_FRAME_INNER_BOLD );
- // lcl_SetFrame( pDoc,nTab, nColPos,nRowPos, nEndColPos,nTabEndRow, SC_DP_FRAME_INNER_BOLD );
if ( nField == nColFieldCount - 2 )
{
outputimp.AddCol( nColPos );
@@ -923,12 +884,11 @@ void ScDPOutput::Output()
}
if ( nField== 0 && nColFieldCount == 1 )
outputimp.OutputBlockFrame( nDataStartCol,nTabStartRow, nTabEndCol,nRowPos-1 );
- // End Comments
}
// output row headers:
std::vector<sal_Bool> vbSetBorder;
- vbSetBorder.resize( nTabEndRow - nDataStartRow + 1, sal_False );
+ vbSetBorder.resize( nTabEndRow - nDataStartRow + 1, false );
for (nField=0; nField<nRowFieldCount; nField++)
{
bool bDataLayout = mbHasDataLayout && (nField == nRowFieldCount-1);
@@ -946,7 +906,7 @@ void ScDPOutput::Output()
for (long nRow=0; nRow<nThisRowCount; nRow++)
{
SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow
- HeaderCell( nColPos, nRowPos, nTab, pArray[nRow], sal_False, nField );
+ HeaderCell( nColPos, nRowPos, nTab, pArray[nRow], false, nField );
if ( ( pArray[nRow].Flags & sheet::MemberResultFlags::HASMEMBER ) &&
!( pArray[nRow].Flags & sheet::MemberResultFlags::SUBTOTAL ) )
{
@@ -956,12 +916,8 @@ void ScDPOutput::Output()
while ( nEnd+1 < nThisRowCount && ( pArray[nEnd+1].Flags & sheet::MemberResultFlags::CONTINUE ) )
++nEnd;
SCROW nEndRowPos = nDataStartRow + (SCROW)nEnd; //! check for overflow
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- // lcl_SetFrame( pDoc,nTab, nColPos,nRowPos, nColPos,nEndRowPos, SC_DP_FRAME_INNER_BOLD );
- //lcl_SetFrame( pDoc,nTab, nColPos,nRowPos, nTabEndCol,nEndRowPos, SC_DP_FRAME_INNER_BOLD );
outputimp.AddRow( nRowPos );
- if ( vbSetBorder[ nRow ] == sal_False )
+ if ( vbSetBorder[ nRow ] == false )
{
outputimp.OutputBlockFrame( nColPos, nRowPos, nTabEndCol, nEndRowPos );
vbSetBorder[ nRow ] = sal_True;
@@ -970,25 +926,18 @@ void ScDPOutput::Output()
if ( nField == nRowFieldCount - 2 )
outputimp.OutputBlockFrame( nColPos+1, nRowPos, nColPos+1, nEndRowPos );
- // End Comments
lcl_SetStyleById( pDoc, nTab, nColPos,nRowPos, nDataStartCol-1,nEndRowPos, STR_PIVOT_STYLE_CATEGORY );
}
else
lcl_SetStyleById( pDoc, nTab, nColPos,nRowPos, nDataStartCol-1,nRowPos, STR_PIVOT_STYLE_CATEGORY );
}
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
else if ( pArray[nRow].Flags & sheet::MemberResultFlags::SUBTOTAL )
outputimp.AddRow( nRowPos );
- // End Comments
}
}
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
outputimp.OutputDataArea();
-// End Comments
}
ScRange ScDPOutput::GetOutputRange( sal_Int32 nRegionType )
@@ -997,12 +946,6 @@ ScRange ScDPOutput::GetOutputRange( sal_Int32 nRegionType )
CalcSizes();
-// fprintf(stdout, "ScDPOutput::GetOutputRange: aStartPos = (%ld, %d)\n", aStartPos.Row(), aStartPos.Col());fflush(stdout);
-// fprintf(stdout, "ScDPOutput::GetOutputRange: nTabStart (Row = %ld, Col = %ld)\n", nTabStartRow, nTabStartCol);fflush(stdout);
-// fprintf(stdout, "ScDPOutput::GetOutputRange: nMemberStart (Row = %ld, Col = %ld)\n", nMemberStartRow, nMemberStartCol);fflush(stdout);
-// fprintf(stdout, "ScDPOutput::GetOutputRange: nDataStart (Row = %ld, Col = %ld)\n", nDataStartRow, nDataStartCol);fflush(stdout);
-// fprintf(stdout, "ScDPOutput::GetOutputRange: nTabEnd (Row = %ld, Col = %ld)\n", nTabEndRow, nTabStartCol);fflush(stdout);
-
SCTAB nTab = aStartPos.Tab();
switch (nRegionType)
{
@@ -1017,7 +960,7 @@ ScRange ScDPOutput::GetOutputRange( sal_Int32 nRegionType )
return ScRange(aStartPos.Col(), aStartPos.Row(), nTab, nTabEndCol, nTabEndRow, nTab);
}
-sal_Bool ScDPOutput::HasError()
+bool ScDPOutput::HasError()
{
CalcSizes();
@@ -1099,12 +1042,12 @@ void lcl_GetTableVars( sal_Int32& rGrandTotalCols, sal_Int32& rGrandTotalRows, s
uno::Reference<beans::XPropertySet> xSrcProp( xSource, uno::UNO_QUERY );
sal_Bool bColGrand = ScUnoHelpFunctions::GetBoolProperty( xSrcProp,
- rtl::OUString::createFromAscii(DP_PROP_COLUMNGRAND) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)) );
if ( bColGrand )
rGrandTotalCols = 1; // default if data layout not in columns
sal_Bool bRowGrand = ScUnoHelpFunctions::GetBoolProperty( xSrcProp,
- rtl::OUString::createFromAscii(DP_PROP_ROWGRAND) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)) );
if ( bRowGrand )
rGrandTotalRows = 1; // default if data layout not in rows
@@ -1125,10 +1068,10 @@ void lcl_GetTableVars( sal_Int32& rGrandTotalCols, sal_Int32& rGrandTotalRows, s
{
sheet::DataPilotFieldOrientation eDimOrient =
(sheet::DataPilotFieldOrientation) ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_ORIENTATION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)),
sheet::DataPilotFieldOrientation_HIDDEN );
if ( ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) ) )
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) ) )
{
rDataLayoutIndex = nDim;
rDataOrient = eDimOrient;
@@ -1186,7 +1129,7 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa
if (xPropSet.is())
{
sal_Int32 nDataFieldCount = ScUnoHelpFunctions::GetLongProperty( xPropSet,
- rtl::OUString::createFromAscii(SC_UNO_DATAFIELDCOUNT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_DATAFIELDCOUNT)) );
if (nDataFieldCount > 0)
aResData.DataFieldIndex = (nRow - nDataStartRow) % nDataFieldCount;
}
@@ -1268,7 +1211,7 @@ bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>&
return false;
sal_Int32 nDataFieldCount = ScUnoHelpFunctions::GetLongProperty( xPropSet,
- rtl::OUString::createFromAscii(SC_UNO_DATAFIELDCOUNT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_DATAFIELDCOUNT)) );
if (nDataFieldCount == 0)
// No data field is present in this datapilot table.
return false;
@@ -1448,7 +1391,7 @@ uno::Sequence<sheet::GeneralFunction> lcl_GetSubTotals(
{
try
{
- uno::Any aValue = xLevelProp->getPropertyValue( rtl::OUString::createFromAscii(DP_PROP_SUBTOTALS) );
+ uno::Any aValue = xLevelProp->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SUBTOTALS)) );
aValue >>= aSubTotals;
}
catch(uno::Exception&)
@@ -1597,7 +1540,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32
// if a function was specified, automatic subtotals never match
if ( bHasFunc )
- rResult[j] = sal_False;
+ rResult[j] = false;
}
}
@@ -1631,7 +1574,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32
// if a function was specified, simple (non-subtotal) values never match
if ( bHasFunc && nSubTotalCount == 0 )
- rResult[j] = sal_False;
+ rResult[j] = false;
}
// if no condition is given, keep the columns/rows included
}
@@ -1652,7 +1595,7 @@ void lcl_StripSubTotals( std::vector< sal_Bool >& rResult, const std::vector< sa
DBG_ASSERT( nStart >= 0, "invalid subtotal count" );
for (sal_Int32 nPrev = nStart; nPrev < nPos; nPrev++)
- rResult[nPrev] = sal_False;
+ rResult[nPrev] = false;
}
}
@@ -1688,7 +1631,6 @@ String lcl_GetDataFieldName( const String& rSourceName, sheet::GeneralFunction e
return aRet;
}
-// static
void ScDPOutput::GetDataDimensionNames( String& rSourceName, String& rGivenName,
const uno::Reference<uno::XInterface>& xDim )
{
@@ -1705,7 +1647,7 @@ void ScDPOutput::GetDataDimensionNames( String& rSourceName, String& rGivenName,
//! Should use a stored name when available
sheet::GeneralFunction eFunc = (sheet::GeneralFunction)ScUnoHelpFunctions::GetEnumProperty(
- xDimProp, rtl::OUString::createFromAscii(DP_PROP_FUNCTION),
+ xDimProp, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_FUNCTION)),
sheet::GeneralFunction_NONE );
rGivenName = lcl_GetDataFieldName( rSourceName, eFunc );
}
@@ -1728,7 +1670,7 @@ sal_Bool ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget,
lcl_GetTableVars( nGrandTotalCols, nGrandTotalRows, nDataLayoutIndex, aDataNames, aGivenNames, eDataOrient, xSource );
if ( aDataNames.empty() )
- return sal_False; // incomplete table without data fields -> no result
+ return false; // incomplete table without data fields -> no result
if ( eDataOrient == sheet::DataPilotFieldOrientation_HIDDEN )
{
@@ -1736,7 +1678,7 @@ sal_Bool ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget,
DBG_ASSERT( aDataNames.size() == 1, "several data fields but no data layout field" );
if ( !lcl_IsNamedDataField( rTarget, aDataNames[0], aGivenNames[0] ) )
- return sal_False;
+ return false;
}
std::vector< sal_Bool > aIncludeCol( nColCount, sal_True );
@@ -1744,7 +1686,7 @@ sal_Bool ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget,
std::vector< sal_Bool > aIncludeRow( nRowCount, sal_True );
std::vector< sal_Int32 > aSubtotalRow( nRowCount, 0 );
- std::vector< sal_Bool > aFilterUsed( rFilters.size(), sal_False );
+ std::vector< sal_Bool > aFilterUsed( rFilters.size(), false );
long nField;
long nCol;
@@ -1769,12 +1711,12 @@ sal_Bool ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget,
for (nField=0; nField<nPageFieldCount; nField++)
if ( !lcl_CheckPageField( pPageFields[nField], rFilters, aFilterUsed ) )
- return sal_False;
+ return false;
// all filter fields must be used
for (SCSIZE nFilter=0; nFilter<aFilterUsed.size(); nFilter++)
if (!aFilterUsed[nFilter])
- return sal_False;
+ return false;
lcl_StripSubTotals( aIncludeCol, aSubtotalCol );
lcl_StripSubTotals( aIncludeRow, aSubtotalRow );
@@ -1798,17 +1740,17 @@ sal_Bool ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget,
}
if ( nColIncluded != 1 || nRowIncluded != 1 )
- return sal_False;
+ return false;
const uno::Sequence<sheet::DataResult>& rDataRow = aData[nRowPos];
if ( nColPos >= rDataRow.getLength() )
- return sal_False;
+ return false;
const sheet::DataResult& rResult = rDataRow[nColPos];
if ( rResult.Flags & sheet::DataResultFlags::ERROR )
- return sal_False; //! different error?
+ return false; //! different error?
- rTarget.mbValIsStr = sal_False;
+ rTarget.mbValIsStr = false;
rTarget.mnValNum = rResult.Value;
return sal_True;
@@ -1820,7 +1762,7 @@ sal_Bool ScDPOutput::IsFilterButton( const ScAddress& rPos )
SCROW nRow = rPos.Row();
SCTAB nTab = rPos.Tab();
if ( nTab != aStartPos.Tab() || !bDoFilter )
- return sal_False; // wrong sheet or no button at all
+ return false; // wrong sheet or no button at all
// filter button is at top left
return ( nCol == aStartPos.Col() && nRow == aStartPos.Row() );
@@ -1882,7 +1824,7 @@ sal_Bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, sal_Bool bMouseLeft,
SCROW nRow = rPos.Row();
SCTAB nTab = rPos.Tab();
if ( nTab != aStartPos.Tab() )
- return sal_False; // wrong sheet
+ return false; // wrong sheet
// calculate output positions and sizes
@@ -1904,9 +1846,9 @@ sal_Bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, sal_Bool bMouseLeft,
rPosRect = Rectangle( nDataStartCol, nMemberStartRow + nField,
nTabEndCol, nMemberStartRow + nField -1 );
- sal_Bool bFound = sal_False; // is this within the same orientation?
- sal_Bool bBeforeDrag = sal_False;
- sal_Bool bAfterDrag = sal_False;
+ sal_Bool bFound = false; // is this within the same orientation?
+ sal_Bool bBeforeDrag = false;
+ sal_Bool bAfterDrag = false;
for (long nPos=0; nPos<nColFieldCount && !bFound; nPos++)
{
if (pColFields[nPos].nDim == nDragDim)
@@ -1958,9 +1900,9 @@ sal_Bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, sal_Bool bMouseLeft,
rPosRect = Rectangle( nTabStartCol + nField, nDataStartRow - 1,
nTabStartCol + nField - 1, nTabEndRow );
- sal_Bool bFound = sal_False; // is this within the same orientation?
- sal_Bool bBeforeDrag = sal_False;
- sal_Bool bAfterDrag = sal_False;
+ sal_Bool bFound = false; // is this within the same orientation?
+ sal_Bool bBeforeDrag = false;
+ sal_Bool bAfterDrag = false;
for (long nPos=0; nPos<nRowFieldCount && !bFound; nPos++)
{
if (pRowFields[nPos].nDim == nDragDim)
@@ -2014,9 +1956,9 @@ sal_Bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, sal_Bool bMouseLeft,
rPosRect = Rectangle( aStartPos.Col(), nPageStartRow + nField,
nTabEndCol, nPageStartRow + nField - 1 );
- sal_Bool bFound = sal_False; // is this within the same orientation?
- sal_Bool bBeforeDrag = sal_False;
- sal_Bool bAfterDrag = sal_False;
+ sal_Bool bFound = false; // is this within the same orientation?
+ sal_Bool bBeforeDrag = false;
+ sal_Bool bAfterDrag = false;
for (long nPos=0; nPos<nPageFieldCount && !bFound; nPos++)
{
if (pPageFields[nPos].nDim == nDragDim)
@@ -2053,8 +1995,8 @@ sal_Bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, sal_Bool bMouseLeft,
return sal_True;
}
- return sal_False;
+ return false;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx
index fd9bee0ed572..99a465188105 100644
--- a/sc/source/core/data/dpoutputgeometry.cxx
+++ b/sc/source/core/data/dpoutputgeometry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -212,3 +213,5 @@ ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAdd
return None;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 100db65df4b7..e14c99b77966 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include "dpsave.hxx"
@@ -39,6 +38,7 @@
#include "unonames.hxx"
#include "global.hxx"
+#include <sal/types.h>
#include <tools/debug.hxx>
#include <com/sun/star/sheet/GeneralFunction.hpp>
@@ -54,37 +54,27 @@
#include <com/sun/star/sheet/XMembersSupplier.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "dptabsrc.hxx"
#include "dpglobal.hxx"
using namespace ScDPGlobal;
-#ifndef _COM_SUN_STAR_SHEET_DATAPILOTFIELDREFERENCETYPE_HPP_
#include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SHEET_DATAPILOTFIELDREFERENCEITEMTYPE_HPP_
#include <com/sun/star/sheet/DataPilotFieldReferenceItemType.hpp>
-#endif
using namespace com::sun::star::sheet;
-// End Comments
-#include <hash_map>
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
using namespace com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
using ::rtl::OUStringHash;
-using ::std::hash_map;
using ::std::auto_ptr;
-// -----------------------------------------------------------------------
-
-#define SC_DPSAVEMODE_NO 0
-#define SC_DPSAVEMODE_YES 1
-#define SC_DPSAVEMODE_DONTKNOW 2
-
-// -----------------------------------------------------------------------
+#define SC_DPSAVEMODE_NO 0
+#define SC_DPSAVEMODE_YES 1
+#define SC_DPSAVEMODE_DONTKNOW 2
void lcl_SetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp,
const rtl::OUString& rName, sal_Bool bValue )
@@ -94,9 +84,7 @@ void lcl_SetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp,
xProp->setPropertyValue( rName, uno::Any( &bValue, getBooleanCppuType() ) );
}
-// -----------------------------------------------------------------------
-
-ScDPSaveMember::ScDPSaveMember(const String& rName) :
+ScDPSaveMember::ScDPSaveMember(const ::rtl::OUString& rName) :
aName( rName ),
mpLayoutName(NULL),
nVisibleMode( SC_DPSAVEMODE_DONTKNOW ),
@@ -118,37 +106,37 @@ ScDPSaveMember::~ScDPSaveMember()
{
}
-sal_Bool ScDPSaveMember::operator== ( const ScDPSaveMember& r ) const
+bool ScDPSaveMember::operator== ( const ScDPSaveMember& r ) const
{
- if ( aName != r.aName ||
- nVisibleMode != r.nVisibleMode ||
+ if ( aName != r.aName ||
+ nVisibleMode != r.nVisibleMode ||
nShowDetailsMode != r.nShowDetailsMode )
- return sal_False;
+ return false;
- return sal_True;
+ return true;
}
-sal_Bool ScDPSaveMember::HasIsVisible() const
+bool ScDPSaveMember::HasIsVisible() const
{
return nVisibleMode != SC_DPSAVEMODE_DONTKNOW;
}
-void ScDPSaveMember::SetIsVisible(sal_Bool bSet)
+void ScDPSaveMember::SetIsVisible(bool bSet)
{
nVisibleMode = bSet;
}
-sal_Bool ScDPSaveMember::HasShowDetails() const
+bool ScDPSaveMember::HasShowDetails() const
{
return nShowDetailsMode != SC_DPSAVEMODE_DONTKNOW;
}
-void ScDPSaveMember::SetShowDetails(sal_Bool bSet)
+void ScDPSaveMember::SetShowDetails(bool bSet)
{
nShowDetailsMode = bSet;
}
-void ScDPSaveMember::SetName( const String& rNew )
+void ScDPSaveMember::SetName( const ::rtl::OUString& rNew )
{
// Used only if the source member was renamed (groups).
// For UI renaming of members, a layout name must be used.
@@ -181,11 +169,11 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb
if ( nVisibleMode != SC_DPSAVEMODE_DONTKNOW )
lcl_SetBoolProperty( xMembProp,
- rtl::OUString::createFromAscii(DP_PROP_ISVISIBLE), (sal_Bool)nVisibleMode );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISVISIBLE)), (bool)nVisibleMode );
if ( nShowDetailsMode != SC_DPSAVEMODE_DONTKNOW )
lcl_SetBoolProperty( xMembProp,
- rtl::OUString::createFromAscii(DP_PROP_SHOWDETAILS), (sal_Bool)nShowDetailsMode );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWDETAILS)), (bool)nShowDetailsMode );
if (mpLayoutName.get())
ScUnoHelpFunctions::SetOptionalPropertyValue(xMembProp, SC_UNO_LAYOUTNAME, *mpLayoutName);
@@ -195,20 +183,18 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb
}
}
-// -----------------------------------------------------------------------
-
-ScDPSaveDimension::ScDPSaveDimension(const String& rName, sal_Bool bDataLayout) :
+ScDPSaveDimension::ScDPSaveDimension(const ::rtl::OUString& rName, bool bDataLayout) :
aName( rName ),
pSelectedPage( NULL ),
mpLayoutName(NULL),
mpSubtotalName(NULL),
bIsDataLayout( bDataLayout ),
- bDupFlag( sal_False ),
+ bDupFlag( false ),
nOrientation( sheet::DataPilotFieldOrientation_HIDDEN ),
nFunction( sheet::GeneralFunction_AUTO ),
nUsedHierarchy( -1 ),
nShowEmptyMode( SC_DPSAVEMODE_DONTKNOW ),
- bSubTotalDefault( sal_True ),
+ bSubTotalDefault( true ),
nSubTotalCount( 0 ),
pSubTotalFuncs( NULL ),
pReferenceValue( NULL ),
@@ -239,9 +225,9 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) :
pSubTotalFuncs[nSub] = r.pSubTotalFuncs[nSub];
}
- for (MemberList::const_iterator i=r.maMemberList.begin(); i != r.maMemberList.end() ; i++)
+ for (MemberList::const_iterator i=r.maMemberList.begin(); i != r.maMemberList.end() ; ++i)
{
- const String& rName = (*i)->GetName();
+ const ::rtl::OUString& rName = (*i)->GetName();
ScDPSaveMember* pNew = new ScDPSaveMember( **i );
maMemberHash[rName] = pNew;
maMemberList.push_back( pNew );
@@ -263,7 +249,7 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) :
else
pLayoutInfo = NULL;
if (r.pSelectedPage)
- pSelectedPage = new String( *(r.pSelectedPage) );
+ pSelectedPage = new ::rtl::OUString( *(r.pSelectedPage) );
else
pSelectedPage = NULL;
if (r.mpLayoutName.get())
@@ -274,7 +260,7 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) :
ScDPSaveDimension::~ScDPSaveDimension()
{
- for (MemberHash::const_iterator i=maMemberHash.begin(); i != maMemberHash.end() ; i++)
+ for (MemberHash::const_iterator i=maMemberHash.begin(); i != maMemberHash.end() ; ++i)
delete i->second;
delete pReferenceValue;
delete pSortInfo;
@@ -284,7 +270,7 @@ ScDPSaveDimension::~ScDPSaveDimension()
delete [] pSubTotalFuncs;
}
-sal_Bool ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
+bool ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
{
if ( aName != r.aName ||
bIsDataLayout != r.bIsDataLayout ||
@@ -294,81 +280,81 @@ sal_Bool ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
nUsedHierarchy != r.nUsedHierarchy ||
nShowEmptyMode != r.nShowEmptyMode ||
bSubTotalDefault != r.bSubTotalDefault ||
- nSubTotalCount != r.nSubTotalCount )
- return sal_False;
+ nSubTotalCount != r.nSubTotalCount )
+ return false;
- if ( nSubTotalCount && ( !pSubTotalFuncs || !r.pSubTotalFuncs ) ) // should not happen
- return sal_False;
+ if ( nSubTotalCount && ( !pSubTotalFuncs || !r.pSubTotalFuncs ) ) // should not happen
+ return false;
long i;
for (i=0; i<nSubTotalCount; i++)
if ( pSubTotalFuncs[i] != r.pSubTotalFuncs[i] )
- return sal_False;
+ return false;
if (maMemberHash.size() != r.maMemberHash.size() )
- return sal_False;
+ return false;
MemberList::const_iterator a=maMemberList.begin();
MemberList::const_iterator b=r.maMemberList.begin();
for (; a != maMemberList.end() ; ++a, ++b)
if (!(**a == **b))
- return sal_False;
+ return false;
if ( this->HasCurrentPage() && r.HasCurrentPage() )
{
if ( this->GetCurrentPage() != r.GetCurrentPage() )
{
- return sal_False;
+ return false;
}
}
else if ( this->HasCurrentPage() || r.HasCurrentPage() )
{
- return sal_False;
+ return false;
}
if( pReferenceValue && r.pReferenceValue )
{
if ( !(*pReferenceValue == *r.pReferenceValue) )
{
- return sal_False;
+ return false;
}
}
else if ( pReferenceValue || r.pReferenceValue )
{
- return sal_False;
+ return false;
}
if( this->pSortInfo && r.pSortInfo )
{
if ( !(*this->pSortInfo == *r.pSortInfo) )
{
- return sal_False;
+ return false;
}
}
else if ( this->pSortInfo || r.pSortInfo )
{
- return sal_False;
+ return false;
}
if( this->pAutoShowInfo && r.pAutoShowInfo )
{
if ( !(*this->pAutoShowInfo == *r.pAutoShowInfo) )
{
- return sal_False;
+ return false;
}
}
else if ( this->pAutoShowInfo || r.pAutoShowInfo )
{
- return sal_False;
+ return false;
}
- return sal_True;
+ return true;
}
void ScDPSaveDimension::AddMember(ScDPSaveMember* pMember)
{
- const String & rName = pMember->GetName();
+ const ::rtl::OUString & rName = pMember->GetName();
MemberHash::iterator aExisting = maMemberHash.find( rName );
if ( aExisting == maMemberHash.end() )
{
- std::pair< const String, ScDPSaveMember *> key( rName, pMember );
+ std::pair< const ::rtl::OUString, ScDPSaveMember *> key( rName, pMember );
maMemberHash.insert ( key );
}
else
@@ -380,7 +366,7 @@ void ScDPSaveDimension::AddMember(ScDPSaveMember* pMember)
maMemberList.push_back( pMember );
}
-void ScDPSaveDimension::SetName( const String& rNew )
+void ScDPSaveDimension::SetName( const ::rtl::OUString& rNew )
{
// Used only if the source dim was renamed (groups).
// For UI renaming of dimensions, the layout name must be used.
@@ -407,7 +393,7 @@ void ScDPSaveDimension::SetSubTotals(long nCount, const sal_uInt16* pFuncs)
else
pSubTotalFuncs = NULL;
- bSubTotalDefault = sal_False;
+ bSubTotalDefault = false;
}
bool ScDPSaveDimension::HasShowEmpty() const
@@ -415,7 +401,7 @@ bool ScDPSaveDimension::HasShowEmpty() const
return nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW;
}
-void ScDPSaveDimension::SetShowEmpty(sal_Bool bSet)
+void ScDPSaveDimension::SetShowEmpty(bool bSet)
{
nShowEmptyMode = bSet;
}
@@ -507,28 +493,29 @@ void ScDPSaveDimension::SetLayoutInfo(const sheet::DataPilotFieldLayoutInfo* pNe
pLayoutInfo = NULL;
}
-void ScDPSaveDimension::SetCurrentPage( const String* pPage )
+void ScDPSaveDimension::SetCurrentPage( const ::rtl::OUString* pPage )
{
delete pSelectedPage;
if (pPage)
- pSelectedPage = new String( *pPage );
+ pSelectedPage = new ::rtl::OUString( *pPage );
else
pSelectedPage = NULL;
}
-sal_Bool ScDPSaveDimension::HasCurrentPage() const
+bool ScDPSaveDimension::HasCurrentPage() const
{
return ( pSelectedPage != NULL );
}
-const String& ScDPSaveDimension::GetCurrentPage() const
+const ::rtl::OUString& ScDPSaveDimension::GetCurrentPage() const
{
+ static const ::rtl::OUString emptyOUString = ::rtl::OUString();
if (pSelectedPage)
return *pSelectedPage;
- return EMPTY_STRING;
+ return emptyOUString;
}
-ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const String& rName)
+ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const ::rtl::OUString& rName)
{
MemberHash::const_iterator res = maMemberHash.find (rName);
if (res != maMemberHash.end())
@@ -536,8 +523,7 @@ ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const String& rName)
return NULL;
}
-
-ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const String& rName)
+ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const ::rtl::OUString& rName)
{
MemberHash::const_iterator res = maMemberHash.find (rName);
if (res != maMemberHash.end())
@@ -549,9 +535,9 @@ ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const String& rName)
return pNew;
}
-void ScDPSaveDimension::SetMemberPosition( const String& rName, sal_Int32 nNewPos )
+void ScDPSaveDimension::SetMemberPosition( const ::rtl::OUString& rName, sal_Int32 nNewPos )
{
- ScDPSaveMember* pMember = GetMemberByName( rName ); // make sure it exists and is in the hash
+ ScDPSaveMember* pMember = GetMemberByName( rName ); // make sure it exists and is in the hash
maMemberList.remove( pMember );
@@ -572,22 +558,22 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
sheet::DataPilotFieldOrientation eOrient = (sheet::DataPilotFieldOrientation)nOrientation;
aAny <<= eOrient;
- xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_ORIENTATION), aAny );
+ xDimProp->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)), aAny );
sheet::GeneralFunction eFunc = (sheet::GeneralFunction)nFunction;
aAny <<= eFunc;
- xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_FUNCTION), aAny );
+ xDimProp->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_FUNCTION)), aAny );
if ( nUsedHierarchy >= 0 )
{
- aAny <<= (sal_Int32)nUsedHierarchy;
- xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_USEDHIERARCHY), aAny );
+ aAny <<= (INT32)nUsedHierarchy;
+ xDimProp->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_USEDHIERARCHY)), aAny );
}
if ( pReferenceValue )
{
aAny <<= *pReferenceValue;
- xDimProp->setPropertyValue( rtl::OUString::createFromAscii(SC_UNO_REFVALUE), aAny );
+ xDimProp->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_REFVALUE)), aAny );
}
uno::Sequence<sheet::TableFilterField> aFilter;
@@ -596,7 +582,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
{
// single filter field: first field equal to selected string
sheet::TableFilterField aField( sheet::FilterConnection_AND, 0,
- sheet::FilterOperator_EQUAL, sal_False, 0.0, *pSelectedPage );
+ sheet::FilterOperator_EQUAL, false, 0.0, *pSelectedPage );
aFilter = uno::Sequence<sheet::TableFilterField>( &aField, 1 );
}
// else keep empty sequence
@@ -611,8 +597,8 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_FIELD_SUBTOTALNAME, *pSubTotalName);
}
- // Level loop outside of maMemberList loop
- // because SubTotals have to be set independently of known members
+ // Level loop outside of maMemberList loop
+ // because SubTotals have to be set independently of known members
long nCount = maMemberHash.size();
@@ -660,11 +646,11 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
for (long i=0; i<nSubTotalCount; i++)
pArray[i] = (sheet::GeneralFunction)pSubTotalFuncs[i];
aAny <<= aSeq;
- xLevProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_SUBTOTALS), aAny );
+ xLevProp->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SUBTOTALS)), aAny );
}
if ( nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW )
lcl_SetBoolProperty( xLevProp,
- rtl::OUString::createFromAscii(DP_PROP_SHOWEMPTY), (sal_Bool)nShowEmptyMode );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWEMPTY)), (bool)nShowEmptyMode );
if ( pSortInfo )
ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_SORTING, *pSortInfo);
@@ -686,11 +672,11 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
uno::Reference<container::XNameAccess> xMembers = xMembSupp->getMembers();
if ( xMembers.is() )
{
- sal_Int32 nPosition = -1; // set position only in manual mode
+ sal_Int32 nPosition = -1; // set position only in manual mode
if ( !pSortInfo || pSortInfo->Mode == sheet::DataPilotFieldSortMode::MANUAL )
nPosition = 0;
- for (MemberList::const_iterator i=maMemberList.begin(); i != maMemberList.end() ; i++)
+ for (MemberList::const_iterator i=maMemberList.begin(); i != maMemberList.end() ; ++i)
{
ScDPSaveMember* pMember = *i;
if (!pMember->GetIsVisible())
@@ -703,7 +689,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
pMember->WriteToSource( xMemberInt, nPosition );
if ( nPosition >= 0 )
- ++nPosition; // increase if initialized
+ ++nPosition; // increase if initialized
}
// missing member is no error
}
@@ -717,14 +703,14 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_HAS_HIDDEN_MEMBER, bHasHiddenMember);
}
-void ScDPSaveDimension::UpdateMemberVisibility(const hash_map<OUString, bool, OUStringHash>& rData)
+void ScDPSaveDimension::UpdateMemberVisibility(const boost::unordered_map<OUString, bool, OUStringHash>& rData)
{
- typedef hash_map<OUString, bool, OUStringHash> DataMap;
+ typedef boost::unordered_map<OUString, bool, OUStringHash> DataMap;
MemberList::iterator itrMem = maMemberList.begin(), itrMemEnd = maMemberList.end();
for (; itrMem != itrMemEnd; ++itrMem)
{
ScDPSaveMember* pMem = *itrMem;
- const String& rMemName = pMem->GetName();
+ const ::rtl::OUString& rMemName = pMem->GetName();
DataMap::const_iterator itr = rData.find(rMemName);
if (itr != rData.end())
pMem->SetIsVisible(itr->second);
@@ -743,20 +729,14 @@ bool ScDPSaveDimension::HasInvisibleMember() const
return false;
}
-// -----------------------------------------------------------------------
-
ScDPSaveData::ScDPSaveData() :
pDimensionData( NULL ),
nColumnGrandMode( SC_DPSAVEMODE_DONTKNOW ),
nRowGrandMode( SC_DPSAVEMODE_DONTKNOW ),
nIgnoreEmptyMode( SC_DPSAVEMODE_DONTKNOW ),
nRepeatEmptyMode( SC_DPSAVEMODE_DONTKNOW ),
- bFilterButton( sal_True ),
- bDrillDown( sal_True ),
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- mnCacheId( -1),
- // End Comments
+ bFilterButton( true ),
+ bDrillDown( true ),
mbDimensionMembersBuilt(false),
mpGrandTotalName(NULL)
{
@@ -769,10 +749,6 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) :
nRepeatEmptyMode( r.nRepeatEmptyMode ),
bFilterButton( r.bFilterButton ),
bDrillDown( r.bDrillDown ),
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
- mnCacheId( r.mnCacheId ),
- // End Comments
mbDimensionMembersBuilt(r.mbDimensionMembersBuilt),
mpGrandTotalName(NULL)
{
@@ -781,12 +757,7 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) :
else
pDimensionData = NULL;
- long nCount = r.aDimList.Count();
- for (long i=0; i<nCount; i++)
- {
- ScDPSaveDimension* pNew = new ScDPSaveDimension( *(ScDPSaveDimension*)r.aDimList.GetObject(i) );
- aDimList.Insert( pNew, LIST_APPEND );
- }
+ aDimList = r.aDimList.clone();
if (r.mpGrandTotalName.get())
mpGrandTotalName.reset(new OUString(*r.mpGrandTotalName));
@@ -796,39 +767,32 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r )
{
if ( &r != this )
{
- // Wang Xu Ming -- 2009-8-17
- // DataPilot Migration - Cache&&Performance
this->~ScDPSaveData();
new( this ) ScDPSaveData ( r );
- // End Comments
}
return *this;
}
-sal_Bool ScDPSaveData::operator== ( const ScDPSaveData& r ) const
+bool ScDPSaveData::operator== ( const ScDPSaveData& r ) const
{
if ( nColumnGrandMode != r.nColumnGrandMode ||
nRowGrandMode != r.nRowGrandMode ||
nIgnoreEmptyMode != r.nIgnoreEmptyMode ||
nRepeatEmptyMode != r.nRepeatEmptyMode ||
bFilterButton != r.bFilterButton ||
- mnCacheId != r.mnCacheId ||/// Wang Xu Ming -- 2009-6-18 DataPilot Migration
- bDrillDown != r.bDrillDown ||
+ bDrillDown != r.bDrillDown ||
mbDimensionMembersBuilt != r.mbDimensionMembersBuilt)
- return sal_False;
+ return false;
if ( pDimensionData || r.pDimensionData )
if ( !pDimensionData || !r.pDimensionData || !( *pDimensionData == *r.pDimensionData ) )
- return sal_False;
+ return false;
- sal_uLong nCount = aDimList.Count();
- if ( nCount != r.aDimList.Count() )
- return sal_False;
+ if ( aDimList.size() != r.aDimList.size() )
+ return false;
- for (sal_uLong i=0; i<nCount; i++)
- if ( !( *(ScDPSaveDimension*)aDimList.GetObject(i) ==
- *(ScDPSaveDimension*)r.aDimList.GetObject(i) ) )
- return sal_False;
+ if (aDimList != r.aDimList)
+ return false;
if (mpGrandTotalName.get())
{
@@ -840,16 +804,11 @@ sal_Bool ScDPSaveData::operator== ( const ScDPSaveData& r ) const
else if (r.mpGrandTotalName.get())
return false;
- return sal_True;
+ return true;
}
ScDPSaveData::~ScDPSaveData()
{
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
- delete (ScDPSaveDimension*)aDimList.GetObject(i);
- aDimList.Clear();
-
delete pDimensionData;
}
@@ -863,43 +822,42 @@ const OUString* ScDPSaveData::GetGrandTotalName() const
return mpGrandTotalName.get();
}
-ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName)
+ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const ::rtl::OUString& rName)
{
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
- return pDim;
+ if (iter->GetName() == rName && !iter->IsDataLayout() )
+ return const_cast<ScDPSaveDimension*>(&(*iter));
}
- ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, sal_False );
- aDimList.Insert( pNew, LIST_APPEND );
+
+ ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
+ aDimList.push_back(pNew);
return pNew;
}
-ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName) const
+ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const ::rtl::OUString& rName) const
{
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
- return pDim;
+ if (iter->GetName() == rName && !iter->IsDataLayout() )
+ return const_cast<ScDPSaveDimension*>(&(*iter));
}
- return NULL; // don't create new
+ return NULL; // don't create new
}
-ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const String& rName)
+ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const ::rtl::OUString& rName)
{
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
+ if (iter->GetName() == rName && !iter->IsDataLayout() )
return DuplicateDimension(rName);
}
- ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, sal_False );
- aDimList.Insert( pNew, LIST_APPEND );
+
+ ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
+ aDimList.push_back(pNew);
return pNew;
}
@@ -909,45 +867,42 @@ ScDPSaveDimension* ScDPSaveData::GetDataLayoutDimension()
if (pDim)
return pDim;
- ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), sal_True );
- aDimList.Insert( pNew, LIST_APPEND );
+ ScDPSaveDimension* pNew = new ScDPSaveDimension( ::rtl::OUString(), true );
+ aDimList.push_back(pNew);
return pNew;
}
ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const
{
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->IsDataLayout() )
- return pDim;
+ if ( iter->IsDataLayout() )
+ return const_cast<ScDPSaveDimension*>(&(*iter));
}
return NULL;
}
-ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName)
+ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const ::rtl::OUString& rName)
{
- // always insert new
+ // always insert new
//! check if dimension is there?
ScDPSaveDimension* pOld = GetDimensionByName( rName );
ScDPSaveDimension* pNew = new ScDPSaveDimension( *pOld );
- pNew->SetDupFlag( sal_True );
- aDimList.Insert( pNew, LIST_APPEND );
+ pNew->SetDupFlag( true );
+ aDimList.push_back(pNew);
return pNew;
}
-void ScDPSaveData::RemoveDimensionByName(const String& rName)
+void ScDPSaveData::RemoveDimensionByName(const ::rtl::OUString& rName)
{
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
+ if ( iter->GetName() == rName && !iter->IsDataLayout() )
{
- delete pDim;
- aDimList.Remove(i);
+ aDimList.erase(iter);
break;
}
}
@@ -956,35 +911,33 @@ void ScDPSaveData::RemoveDimensionByName(const String& rName)
ScDPSaveDimension& ScDPSaveData::DuplicateDimension( const ScDPSaveDimension& rDim )
{
ScDPSaveDimension* pNew = new ScDPSaveDimension( rDim );
- pNew->SetDupFlag( sal_True );
- aDimList.Insert( pNew, LIST_APPEND );
+ pNew->SetDupFlag( true );
+ aDimList.push_back(pNew);
return *pNew;
}
ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(sal_uInt16 nOrientation)
{
- // return the innermost dimension for the given orientation,
- // excluding data layout dimension
+ // return the innermost dimension for the given orientation,
+ // excluding data layout dimension
- ScDPSaveDimension* pInner = NULL;
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::const_reverse_iterator iter;
+ for (iter = aDimList.rbegin(); iter != aDimList.rend(); ++iter)
{
- ScDPSaveDimension* pDim = static_cast<ScDPSaveDimension*>(aDimList.GetObject(i));
- if ( pDim->GetOrientation() == nOrientation && !pDim->IsDataLayout() )
- pInner = pDim;
+ if (iter->GetOrientation() == nOrientation && !iter->IsDataLayout())
+ return const_cast<ScDPSaveDimension*>(&(*iter));
}
- return pInner; // the last matching one
+
+ return NULL;
}
ScDPSaveDimension* ScDPSaveData::GetFirstDimension(sheet::DataPilotFieldOrientation eOrientation)
{
- long nCount = aDimList.Count();
- for (long i = 0; i < nCount; ++i)
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = static_cast<ScDPSaveDimension*>(aDimList.GetObject(i));
- if (pDim->GetOrientation() == eOrientation && !pDim->IsDataLayout())
- return pDim;
+ if (iter->GetOrientation() == eOrientation && !iter->IsDataLayout())
+ return const_cast<ScDPSaveDimension*>(&(*iter));
}
return NULL;
}
@@ -993,11 +946,10 @@ long ScDPSaveData::GetDataDimensionCount() const
{
long nDataCount = 0;
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- const ScDPSaveDimension* pDim = static_cast<const ScDPSaveDimension*>(aDimList.GetObject(i));
- if ( pDim->GetOrientation() == sheet::DataPilotFieldOrientation_DATA )
+ if (iter->GetOrientation() == sheet::DataPilotFieldOrientation_DATA)
++nDataCount;
}
@@ -1006,50 +958,58 @@ long ScDPSaveData::GetDataDimensionCount() const
void ScDPSaveData::SetPosition( ScDPSaveDimension* pDim, long nNew )
{
- // position (nNew) is counted within dimensions of the same orientation
+ // position (nNew) is counted within dimensions of the same orientation
sal_uInt16 nOrient = pDim->GetOrientation();
- aDimList.Remove( pDim );
- sal_uLong nCount = aDimList.Count(); // after remove
+ boost::ptr_vector<ScDPSaveDimension>::iterator it;
+ for ( it = aDimList.begin(); it != aDimList.end(); ++it)
+ {
+ if (pDim == &(*it))
+ {
+ aDimList.erase(it);
+ break;
+ }
+ }
- sal_uLong nInsPos = 0;
- while ( nNew > 0 && nInsPos < nCount )
+ boost::ptr_vector<ScDPSaveDimension>::iterator iterInsert = aDimList.begin();
+ while ( nNew > 0 && iterInsert != aDimList.end())
{
- if ( ((ScDPSaveDimension*)aDimList.GetObject(nInsPos))->GetOrientation() == nOrient )
+ if (iterInsert->GetOrientation() == nOrient )
--nNew;
- ++nInsPos;
+
+ ++iterInsert;
}
- aDimList.Insert( pDim, nInsPos );
+ aDimList.insert(iterInsert,pDim);
}
-void ScDPSaveData::SetColumnGrand(sal_Bool bSet)
+void ScDPSaveData::SetColumnGrand(bool bSet)
{
nColumnGrandMode = bSet;
}
-void ScDPSaveData::SetRowGrand(sal_Bool bSet)
+void ScDPSaveData::SetRowGrand(bool bSet)
{
nRowGrandMode = bSet;
}
-void ScDPSaveData::SetIgnoreEmptyRows(sal_Bool bSet)
+void ScDPSaveData::SetIgnoreEmptyRows(bool bSet)
{
nIgnoreEmptyMode = bSet;
}
-void ScDPSaveData::SetRepeatIfEmpty(sal_Bool bSet)
+void ScDPSaveData::SetRepeatIfEmpty(bool bSet)
{
nRepeatEmptyMode = bSet;
}
-void ScDPSaveData::SetFilterButton(sal_Bool bSet)
+void ScDPSaveData::SetFilterButton(bool bSet)
{
bFilterButton = bSet;
}
-void ScDPSaveData::SetDrillDown(sal_Bool bSet)
+void ScDPSaveData::SetDrillDown(bool bSet)
{
bDrillDown = bSet;
}
@@ -1069,7 +1029,7 @@ void lcl_ResetOrient( const uno::Reference<sheet::XDimensionsSupplier>& xSource
{
uno::Any aAny;
aAny <<= eOrient;
- xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_ORIENTATION), aAny );
+ xDimProp->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ORIENTATION)), aAny );
}
}
}
@@ -1079,23 +1039,23 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
if (!xSource.is())
return;
- // source options must be first!
+ // source options must be first!
uno::Reference<beans::XPropertySet> xSourceProp( xSource, uno::UNO_QUERY );
DBG_ASSERT( xSourceProp.is(), "no properties at source" );
if ( xSourceProp.is() )
{
- // source options are not available for external sources
+ // source options are not available for external sources
//! use XPropertySetInfo to test for availability?
try
{
if ( nIgnoreEmptyMode != SC_DPSAVEMODE_DONTKNOW )
lcl_SetBoolProperty( xSourceProp,
- rtl::OUString::createFromAscii(DP_PROP_IGNOREEMPTY), (sal_Bool)nIgnoreEmptyMode );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_IGNOREEMPTY)), (bool)nIgnoreEmptyMode );
if ( nRepeatEmptyMode != SC_DPSAVEMODE_DONTKNOW )
lcl_SetBoolProperty( xSourceProp,
- rtl::OUString::createFromAscii(DP_PROP_REPEATIFEMPTY), (sal_Bool)nRepeatEmptyMode );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_REPEATIFEMPTY)), (bool)nRepeatEmptyMode );
}
catch(uno::Exception&)
{
@@ -1110,29 +1070,28 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
// exceptions in the other calls are errors
try
{
- // reset all orientations
+ // reset all orientations
//! "forgetSettings" or similar at source ?????
//! reset all duplicated dimensions, or reuse them below !!!
DBG_TRACE( "ScDPSaveData::WriteToSource" );
lcl_ResetOrient( xSource );
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::iterator iter = aDimList.begin();
+ for (long i = 0; iter != aDimList.end(); ++iter, ++i)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- rtl::OUString aName = pDim->GetName();
+ rtl::OUString aName = iter->GetName();
- DBG_TRACESTR(pDim->GetName());
+ DBG_TRACESTR(String(iter->GetName()));
- sal_Bool bData = pDim->IsDataLayout();
+ bool bData = iter->IsDataLayout();
//! getByName for ScDPSource, including DataLayoutDimension !!!!!!!!
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
long nIntCount = xIntDims->getCount();
- sal_Bool bFound = sal_False;
+ bool bFound = false;
for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
{
uno::Reference<uno::XInterface> xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(nIntDim) );
@@ -1142,7 +1101,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
if ( xDimProp.is() )
{
bFound = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_ISDATALAYOUT) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
//! error checking -- is "IsDataLayoutDimension" property required??
}
}
@@ -1150,18 +1109,18 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
{
uno::Reference<container::XNamed> xDimName( xIntDim, uno::UNO_QUERY );
if ( xDimName.is() && xDimName->getName() == aName )
- bFound = sal_True;
+ bFound = true;
}
if ( bFound )
{
- if ( pDim->GetDupFlag() )
+ if ( iter->GetDupFlag() )
{
- String aNewName = pDim->GetName();
+ OUStringBuffer aBuf(iter->GetName());
// different name for each duplication of a (real) dimension...
- for (long j=0; j<=i; j++) //! Test !!!!!!
- aNewName += '*'; //! modify name at creation of SaveDimension
+ for (long j=0; j<=i; ++j) //! Test !!!!!!
+ aBuf.append(sal_Unicode('*')); //! modify name at creation of SaveDimension
uno::Reference<util::XCloneable> xCloneable( xIntDim, uno::UNO_QUERY );
DBG_ASSERT( xCloneable.is(), "cannot clone dimension" );
@@ -1171,13 +1130,13 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
uno::Reference<container::XNamed> xNewName( xNew, uno::UNO_QUERY );
if (xNewName.is())
{
- xNewName->setName( aNewName );
- pDim->WriteToSource( xNew );
+ xNewName->setName(aBuf.makeStringAndClear());
+ iter->WriteToSource( xNew );
}
}
}
else
- pDim->WriteToSource( xIntDim );
+ iter->WriteToSource( xIntDim );
}
}
DBG_ASSERT(bFound, "WriteToSource: Dimension not found");
@@ -1187,28 +1146,27 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
{
if ( nColumnGrandMode != SC_DPSAVEMODE_DONTKNOW )
lcl_SetBoolProperty( xSourceProp,
- rtl::OUString::createFromAscii(DP_PROP_COLUMNGRAND), (sal_Bool)nColumnGrandMode );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)), (bool)nColumnGrandMode );
if ( nRowGrandMode != SC_DPSAVEMODE_DONTKNOW )
lcl_SetBoolProperty( xSourceProp,
- rtl::OUString::createFromAscii(DP_PROP_ROWGRAND), (sal_Bool)nRowGrandMode );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)), (bool)nRowGrandMode );
}
}
catch(uno::Exception&)
{
- DBG_ERROR("exception in WriteToSource");
+ OSL_FAIL("exception in WriteToSource");
}
}
-sal_Bool ScDPSaveData::IsEmpty() const
+bool ScDPSaveData::IsEmpty() const
{
- long nCount = aDimList.Count();
- for (long i=0; i<nCount; i++)
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetOrientation() != sheet::DataPilotFieldOrientation_HIDDEN && !pDim->IsDataLayout() )
- return sal_False;
+ if (iter->GetOrientation() != sheet::DataPilotFieldOrientation_HIDDEN && !iter->IsDataLayout())
+ return false;
}
- return sal_True; // no entries that are not hidden
+ return true; // no entries that are not hidden
}
ScDPDimensionSaveData* ScDPSaveData::GetDimensionData()
@@ -1233,7 +1191,7 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
return;
// First, build a dimension name-to-index map.
- typedef hash_map<OUString, long, ::rtl::OUStringHash> NameIndexMap;
+ typedef boost::unordered_map<OUString, long, ::rtl::OUStringHash> NameIndexMap;
NameIndexMap aMap;
long nColCount = pData->GetColumnCount();
for (long i = 0; i < nColCount; ++i)
@@ -1241,18 +1199,17 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
NameIndexMap::const_iterator itrEnd = aMap.end();
- sal_uInt32 n = aDimList.Count();
- for (sal_uInt32 i = 0; i < n; ++i)
+ boost::ptr_vector<ScDPSaveDimension>::iterator iter;
+ for (iter = aDimList.begin(); iter != aDimList.end(); ++iter)
{
- ScDPSaveDimension* pDim = static_cast<ScDPSaveDimension*>(aDimList.GetObject(i));
- const String& rDimName = pDim->GetName();
- if (!rDimName.Len())
- // empty dimension name. It must be data layout.
+ const ::rtl::OUString& rDimName = iter->GetName();
+ if (!rDimName.getLength())
+ // empty dimension name. It must be data layout.
continue;
NameIndexMap::const_iterator itr = aMap.find(rDimName);
if (itr == itrEnd)
- // dimension name not in the data. This should never happen!
+ // dimension name not in the data. This should never happen!
continue;
long nDimIndex = itr->second;
@@ -1261,14 +1218,14 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
for (size_t j = 0; j < mMemberCount; ++j)
{
const ScDPItemData* pMemberData = pData->GetMemberById( nDimIndex, rMembers[j] );
- String aMemName = pMemberData->GetString();
- if (pDim->GetExistingMemberByName(aMemName))
- // this member instance already exists. nothing to do.
+ ::rtl::OUString aMemName = pMemberData->GetString();
+ if (iter->GetExistingMemberByName(aMemName))
+ // this member instance already exists. nothing to do.
continue;
auto_ptr<ScDPSaveMember> pNewMember(new ScDPSaveMember(aMemName));
pNewMember->SetIsVisible(true);
- pDim->AddMember(pNewMember.release());
+ iter->AddMember(pNewMember.release());
}
}
@@ -1288,67 +1245,67 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
{
try
{
- long nCount = aDimList.Count();
- std::list<String> deletedDims;
- for (long i=nCount-1; i >=0 ; i--)
+ std::list<rtl::OUString> deletedDims;
+
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
+ boost::ptr_vector<ScDPSaveDimension>::iterator iter = aDimList.end()-1;
+ for (long i = aDimList.size()-1; i >= 0; ++i,--iter)
+ {
+ rtl::OUString aName = iter->GetName();
+ if ( iter->IsDataLayout() )
+ continue;
+
+ uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
+ uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
+ long nIntCount = xIntDims->getCount();
+ bool bFound = false;
+ for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
+ {
+ uno::Reference<uno::XInterface> xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(nIntDim) );
+ uno::Reference<container::XNamed> xDimName( xIntDim, uno::UNO_QUERY );
+ if ( xDimName.is() && xDimName->getName() == aName )
+ bFound = true;
+ }
- rtl::OUString aName = pDim->GetName();
- if ( pDim->IsDataLayout() )
- continue;
+ if ( !bFound )
+ {
+ deletedDims.push_back( aName );
+ iter = aDimList.erase(iter);
+ DBG_TRACE( "\n Remove dim: \t" );
+ DBG_TRACESTR( String( aName ) );
+ }
- uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
- uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
- long nIntCount = xIntDims->getCount();
- sal_Bool bFound = sal_False;
- for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
- {
- uno::Reference<uno::XInterface> xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(nIntDim) );
- uno::Reference<container::XNamed> xDimName( xIntDim, uno::UNO_QUERY );
- if ( xDimName.is() && xDimName->getName() == aName )
- bFound = sal_True;
}
- if ( !bFound )
- {
- deletedDims.push_back( aName );
- aDimList.Remove(i);
- DBG_TRACE( "\n Remove dim: \t" );
- DBG_TRACESTR( String( aName ) );
- }
-
}
- nCount = aDimList.Count();
- for (long i=nCount-1; i >=0 ; i--) //check every dimension ??
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
-
- rtl::OUString aName = pDim->GetName();
- if ( pDim->IsDataLayout() )
- continue;
- pDim->Refresh( xSource, deletedDims );
+ boost::ptr_vector<ScDPSaveDimension>::reverse_iterator iter;
+ for (iter = aDimList.rbegin(); iter != aDimList.rend(); ++iter) //check every dimension ??
+ {
+ rtl::OUString aName = iter->GetName();
+ if ( iter->IsDataLayout() )
+ continue;
+ iter->Refresh( xSource, deletedDims );
+ }
}
- mbDimensionMembersBuilt = false; // there may be new members
+ mbDimensionMembersBuilt = false; // there may be new members
}
catch(uno::Exception&)
{
- DBG_ERROR("error in ScDPSaveData::Refresh");
+ OSL_FAIL("error in ScDPSaveData::Refresh");
}
-
}
+
void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
com::sun::star::sheet::XDimensionsSupplier>& xSource ,
- const std::list<String>& deletedDims)
+ const std::list<rtl::OUString>& deletedDims)
{
if ( xSource.is() )
{
ScDPSource* pTabSource = static_cast<ScDPSource*>( xSource.get() );
- ScDPTableDataCache* pCache = pTabSource->GetCache();
- if ( pCache->GetId() == -1 )
- return;
+ const ScDPCache* pCache = pTabSource->GetCache();
SCCOL nSrcDim = pCache->GetDimensionIndex( GetName() );
@@ -1356,7 +1313,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
return;
if ( pSelectedPage )
{//check pSelected page
- DBG_TRACESTR( (*pSelectedPage) );
+ DBG_TRACESTR( String(*pSelectedPage) );
if ( pCache->GetIdByItemData( nSrcDim, *pSelectedPage ) == -1 )
{
delete pSelectedPage;
@@ -1367,7 +1324,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
if ( pReferenceValue && pReferenceValue->ReferenceItemType == DataPilotFieldReferenceItemType::NAMED )
{//check pReferenceValue
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
switch( pReferenceValue->ReferenceType)
{
case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE: //both
@@ -1391,18 +1348,18 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE:
case sheet::DataPilotFieldReferenceType::RUNNING_TOTAL:
{
- if( pReferenceValue->ReferenceItemType == DataPilotFieldReferenceItemType::NAMED )
+ if( pReferenceValue->ReferenceItemType == DataPilotFieldReferenceItemType::NAMED )
{
- const String& sReferenceFieldName = pReferenceValue->ReferenceField;
- DBG_TRACESTR( sReferenceFieldName );
+ const ::rtl::OUString& sReferenceFieldName = pReferenceValue->ReferenceField;
+ DBG_TRACESTR( String(sReferenceFieldName) );
SCCOL nRefDim = pCache->GetDimensionIndex( sReferenceFieldName );
bool bValid = true;
if ( nRefDim == -1 )
bValid = false;
else if ( pReferenceValue->ReferenceType != sheet::DataPilotFieldReferenceType::RUNNING_TOTAL )
{ //running total has not reference item
- const String& sReferenceItemName = pReferenceValue->ReferenceItemName;
- DBG_TRACESTR( sReferenceItemName );
+ const ::rtl::OUString& sReferenceItemName = pReferenceValue->ReferenceItemName;
+ DBG_TRACESTR( String(sReferenceItemName) );
if ( pCache->GetIdByItemData( nRefDim, sReferenceItemName ) == -1 )
bValid = false;
}
@@ -1423,27 +1380,25 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
if ( pSortInfo->Mode == DataPilotFieldSortMode::DATA )
{
DBG_TRACE( "\n DataPilotFieldSortMode::DATA \n" );
- const String& sFieldDimName = pSortInfo->Field;
- std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
- if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
+ const ::rtl::OUString& sFieldDimName = pSortInfo->Field;
+ std::list<rtl::OUString>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
+ if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
{
pSortInfo->Mode = DataPilotFieldSortMode::MANUAL;
pSortInfo->Field = GetName();
}
}
-
};
if ( pAutoShowInfo )
{ //check autoshow
- const String& sFieldDimName = pAutoShowInfo->DataField;
- std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
- if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
+ const ::rtl::OUString& sFieldDimName = pAutoShowInfo->DataField;
+ std::list<rtl::OUString>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
+ if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
{
delete pAutoShowInfo;
pAutoShowInfo = NULL;
}
-
};
//remove unused members
@@ -1454,11 +1409,11 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
if ( pCache->GetIdByItemData( nSrcDim, aMemberName ) == -1 )
i = maMemberList.erase( i );
else
- i++;
+ ++i;
}
}
}
-// End Comments
+
bool operator == (const ::com::sun::star::sheet::DataPilotFieldSortInfo &l, const ::com::sun::star::sheet::DataPilotFieldSortInfo &r )
{
return l.Field == r.Field && l.IsAscending == r.IsAscending && l.Mode == r.Mode;
@@ -1478,3 +1433,4 @@ bool operator == (const ::com::sun::star::sheet::DataPilotFieldReference &l, con
l.ReferenceItemName == r.ReferenceItemName;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx
index f0e060e8cc7d..7eeb4b93e284 100644
--- a/sc/source/core/data/dpsdbtab.cxx
+++ b/sc/source/core/data/dpsdbtab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,8 +62,6 @@
using namespace com::sun::star;
using ::std::vector;
-using ::std::hash_map;
-using ::std::hash_set;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
@@ -75,33 +74,10 @@ using ::com::sun::star::uno::UNO_QUERY;
#define SC_DBPROP_DATASOURCENAME "DataSourceName"
#define SC_DBPROP_COMMAND "Command"
#define SC_DBPROP_COMMANDTYPE "CommandType"
-// -----------------------------------------------------------------------
-// Wang Xu Ming -- 2009-9-15
-// DataPilot Migration - Cache&&Performance
- ScDPTableDataCache* ScImportSourceDesc::GetExistDPObjectCache( ScDocument* pDoc ) const
-{
- ScDPTableDataCache* pCache = NULL;
- ScDPCollection* pDPCollection= pDoc->GetDPCollection();
- sal_uInt16 nCount = pDPCollection->GetCount();
-
- for ( short i=nCount-1; i>=0 ; i--)
- {
- if ( const ScImportSourceDesc* pUsedDesc = (*pDPCollection)[i]->GetImportSourceDesc() )
- if ( *this == *pUsedDesc )
- {
- long nID = (*pDPCollection)[i]->GetCacheId();
- if ( nID >= 0 )
- pCache= pDoc->GetDPObjectCache( nID );
- if ( pCache )
- return pCache;
- }
- }
- return NULL;
-}
-ScDPTableDataCache* ScImportSourceDesc::CreateCache( ScDocument* pDoc , long nID ) const
+ScDPCache* ScImportSourceDesc::CreateCache() const
{
- if ( !pDoc )
+ if (!mpDoc)
return NULL;
sal_Int32 nSdbType = -1;
@@ -115,21 +91,14 @@ ScDPTableDataCache* ScImportSourceDesc::CreateCache( ScDocument* pDoc , long nID
return NULL;
}
-
- ScDPTableDataCache* pCache = GetExistDPObjectCache( pDoc );
-
- if ( pCache && ( nID < 0 || nID == pCache->GetId() ) )
- return pCache;
-
- if ( pCache == NULL )
- pCache = new ScDPTableDataCache( pDoc );
+ ScDPCache* pCache = new ScDPCache(mpDoc);
uno::Reference<sdbc::XRowSet> xRowSet ;
try
{
xRowSet = uno::Reference<sdbc::XRowSet>(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_ROWSET ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ),
uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
DBG_ASSERT( xRowProp.is(), "can't get RowSet" );
@@ -141,32 +110,29 @@ ScDPTableDataCache* ScImportSourceDesc::CreateCache( ScDocument* pDoc , long nID
uno::Any aAny;
aAny <<= rtl::OUString( aDBName );
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_DATASOURCENAME), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_DATASOURCENAME)), aAny );
aAny <<= rtl::OUString( aObject );
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMAND), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );
aAny <<= nSdbType;
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMANDTYPE), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMANDTYPE)), aAny );
uno::Reference<sdb::XCompletedExecution> xExecute( xRowSet, uno::UNO_QUERY );
if ( xExecute.is() )
{
uno::Reference<task::XInteractionHandler> xHandler(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_INTHANDLER ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_INTHANDLER )) ),
uno::UNO_QUERY);
xExecute->executeWithCompletion( xHandler );
}
else
xRowSet->execute();
- SvNumberFormatter aFormat( pDoc->GetServiceManager(), ScGlobal::eLnge);
+ SvNumberFormatter aFormat(mpDoc->GetServiceManager(), ScGlobal::eLnge);
pCache->InitFromDataBase( xRowSet, *aFormat.GetNullDate() );
- pCache->SetId( nID );
- pDoc->AddDPObjectCache( pCache );
- DBG_TRACE1("Create a cache id = %d \n", pCache->GetId() );
}
}
catch ( sdbc::SQLException& rError )
@@ -181,7 +147,7 @@ ScDPTableDataCache* ScImportSourceDesc::CreateCache( ScDocument* pDoc , long nID
{
delete pCache;
pCache = NULL;
- DBG_ERROR("Unexpected exception in database");
+ OSL_FAIL("Unexpected exception in database");
}
@@ -189,34 +155,11 @@ ScDPTableDataCache* ScImportSourceDesc::CreateCache( ScDocument* pDoc , long nID
return pCache;
}
-ScDPTableDataCache* ScImportSourceDesc::GetCache( ScDocument* pDoc, long nID ) const
-{
- ScDPTableDataCache* pCache = pDoc->GetDPObjectCache( nID );
- if ( NULL == pCache && pDoc )
- pCache = GetExistDPObjectCache( pDoc);
- if ( NULL == pCache )
- pCache = CreateCache( pDoc , nID );
- return pCache;
-}
-
-long ScImportSourceDesc:: GetCacheId( ScDocument* pDoc, long nID ) const
-{
- ScDPTableDataCache* pCache = GetCache( pDoc, nID);
- if ( NULL == pCache )
- return -1;
- else
- return pCache->GetId();
-}
-
-// -----------------------------------------------------------------------
-
-ScDatabaseDPData::ScDatabaseDPData(
- ScDocument* pDoc,
- const ScImportSourceDesc& rImport, long nCacheId /*=-1 */ ) :
- ScDPTableData(pDoc, rImport.GetCacheId( pDoc, nCacheId) ),
- aCacheTable( pDoc, rImport.GetCacheId( pDoc, nCacheId))
+ScDatabaseDPData::ScDatabaseDPData(ScDocument* pDoc, const ScImportSourceDesc& rImport) :
+ ScDPTableData(pDoc),
+ mrImport(rImport),
+ aCacheTable(rImport.CreateCache())
{
-
}
ScDatabaseDPData::~ScDatabaseDPData()
@@ -226,7 +169,7 @@ ScDatabaseDPData::~ScDatabaseDPData()
void ScDatabaseDPData::DisposeData()
{
//! use OpenDatabase here?
- aCacheTable.clear();
+ aCacheTable.clear();
}
long ScDatabaseDPData::GetColumnCount()
@@ -235,7 +178,6 @@ long ScDatabaseDPData::GetColumnCount()
return GetCacheTable().getColSize();
}
-// End Comments
String ScDatabaseDPData::getDimensionName(long nColumn)
{
@@ -258,7 +200,7 @@ sal_Bool ScDatabaseDPData::getIsDataLayoutDimension(long nColumn)
sal_Bool ScDatabaseDPData::IsDateDimension(long /* nDim */)
{
//! later...
- return sal_False;
+ return false;
}
void ScDatabaseDPData::SetEmptyFlags( sal_Bool /* bIgnoreEmptyRows */, sal_Bool /* bRepeatIfEmpty */ )
@@ -272,17 +214,20 @@ void ScDatabaseDPData::CreateCacheTable()
if (!aCacheTable.empty())
return;
+ if (!aCacheTable.hasCache())
+ aCacheTable.setCache(mrImport.CreateCache());
+
aCacheTable.fillTable();
}
-void ScDatabaseDPData::FilterCacheTable(const vector<ScDPCacheTable::Criterion>& rCriteria, const hash_set<sal_Int32>& rCatDims)
+void ScDatabaseDPData::FilterCacheTable(const vector<ScDPCacheTable::Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rCatDims)
{
CreateCacheTable();
aCacheTable.filterByPageDimension(
- rCriteria, (IsRepeatIfEmpty() ? rCatDims : hash_set<sal_Int32>()));
+ rCriteria, (IsRepeatIfEmpty() ? rCatDims : boost::unordered_set<sal_Int32>()));
}
-void ScDatabaseDPData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>& rCriteria, const hash_set<sal_Int32>& rCatDims, Sequence< Sequence<Any> >& rData)
+void ScDatabaseDPData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rCatDims, Sequence< Sequence<Any> >& rData)
{
CreateCacheTable();
sal_Int32 nRowSize = aCacheTable.getRowSize();
@@ -290,7 +235,7 @@ void ScDatabaseDPData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>&
return;
aCacheTable.filterTable(
- rCriteria, rData, IsRepeatIfEmpty() ? rCatDims : hash_set<sal_Int32>());
+ rCriteria, rData, IsRepeatIfEmpty() ? rCatDims : boost::unordered_set<sal_Int32>());
}
void ScDatabaseDPData::CalcResults(CalcInfo& rInfo, bool bAutoShow)
@@ -307,6 +252,4 @@ const ScDPCacheTable& ScDatabaseDPData::GetCacheTable() const
// -----------------------------------------------------------------------
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx
index 33ce84cc94c2..c209fecf03bc 100644
--- a/sc/source/core/data/dpshttab.cxx
+++ b/sc/source/core/data/dpshttab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,10 +44,9 @@
#include "dpcachetable.hxx"
#include "dpobject.hxx"
#include "globstr.hrc"
-// Wang Xu Ming -- 2009-8-17
-// DataPilot Migration - Cache&&Performance
#include "dpglobal.hxx"
-// End Comments
+#include "rangenam.hxx"
+
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
#include <vector>
@@ -55,22 +55,22 @@
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Sequence;
+using ::rtl::OUString;
using ::std::vector;
-using ::std::hash_map;
-using ::std::hash_set;
// -----------------------------------------------------------------------
-ScSheetDPData::ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc , long nCacheId) :
- ScDPTableData(pD, rDesc.GetCacheId( pD, nCacheId) ), // DataPilot Migration - Cache&&Performance
- aQuery ( rDesc.aQueryParam ),
+ScSheetDPData::ScSheetDPData(ScDocument* pD, const ScSheetSourceDesc& rDesc) :
+ ScDPTableData(pD),
+ aQuery ( rDesc.GetQueryParam() ),
pSpecial(NULL),
- bIgnoreEmptyRows( sal_False ),
- bRepeatIfEmpty(sal_False),
- aCacheTable( pD, rDesc.GetCacheId( pD, nCacheId))
+ bIgnoreEmptyRows( false ),
+ bRepeatIfEmpty(false),
+ mrDesc(rDesc),
+ aCacheTable(rDesc.CreateCache())
{
SCSIZE nEntryCount( aQuery.GetEntryCount());
- pSpecial = new sal_Bool[nEntryCount];
+ pSpecial = new bool[nEntryCount];
for (SCSIZE j = 0; j < nEntryCount; ++j )
{
ScQueryEntry& rEntry = aQuery.GetEntry(j);
@@ -121,7 +121,7 @@ String ScSheetDPData::getDimensionName(long nColumn)
}
else if (nColumn >= aCacheTable.getColSize())
{
- DBG_ERROR("getDimensionName: invalid dimension");
+ OSL_FAIL("getDimensionName: invalid dimension");
return String();
}
else
@@ -136,16 +136,16 @@ sal_Bool ScSheetDPData::IsDateDimension(long nDim)
long nColCount = aCacheTable.getColSize();
if (getIsDataLayoutDimension(nDim))
{
- return sal_False;
+ return false;
}
else if (nDim >= nColCount)
{
- DBG_ERROR("IsDateDimension: invalid dimension");
- return sal_False;
+ OSL_FAIL("IsDateDimension: invalid dimension");
+ return false;
}
else
{
- return aCacheTable.GetCache()->IsDateDimension( nDim);
+ return GetCacheTable().getCache()->IsDateDimension( nDim);
}
}
@@ -158,12 +158,12 @@ sal_uLong ScSheetDPData::GetNumberFormat(long nDim)
}
else if (nDim >= GetCacheTable().getColSize())
{
- DBG_ERROR("GetNumberFormat: invalid dimension");
+ OSL_FAIL("GetNumberFormat: invalid dimension");
return 0;
}
else
{
- return GetCacheTable().GetCache()->GetNumberFormat( nDim );
+ return GetCacheTable().getCache()->GetNumberFormat( nDim );
}
}
sal_uInt32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx )
@@ -201,18 +201,20 @@ void ScSheetDPData::CreateCacheTable()
// already cached.
return;
- aCacheTable.fillTable( aQuery, pSpecial,
- bIgnoreEmptyRows, bRepeatIfEmpty );
+ if (!aCacheTable.hasCache())
+ aCacheTable.setCache(mrDesc.CreateCache());
+
+ aCacheTable.fillTable(aQuery, pSpecial, bIgnoreEmptyRows, bRepeatIfEmpty);
}
-void ScSheetDPData::FilterCacheTable(const vector<ScDPCacheTable::Criterion>& rCriteria, const hash_set<sal_Int32>& rCatDims)
+void ScSheetDPData::FilterCacheTable(const vector<ScDPCacheTable::Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rCatDims)
{
CreateCacheTable();
aCacheTable.filterByPageDimension(
- rCriteria, (IsRepeatIfEmpty() ? rCatDims : hash_set<sal_Int32>()));
+ rCriteria, (IsRepeatIfEmpty() ? rCatDims : boost::unordered_set<sal_Int32>()));
}
-void ScSheetDPData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>& rCriteria, const hash_set<sal_Int32>& rCatDims, Sequence< Sequence<Any> >& rData)
+void ScSheetDPData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>& rCriteria, const boost::unordered_set<sal_Int32>& rCatDims, Sequence< Sequence<Any> >& rData)
{
CreateCacheTable();
sal_Int32 nRowSize = aCacheTable.getRowSize();
@@ -220,7 +222,7 @@ void ScSheetDPData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>& rC
return;
aCacheTable.filterTable(
- rCriteria, rData, IsRepeatIfEmpty() ? rCatDims : hash_set<sal_Int32>());
+ rCriteria, rData, IsRepeatIfEmpty() ? rCatDims : boost::unordered_set<sal_Int32>());
}
void ScSheetDPData::CalcResults(CalcInfo& rInfo, bool bAutoShow)
@@ -234,82 +236,117 @@ const ScDPCacheTable& ScSheetDPData::GetCacheTable() const
return aCacheTable;
}
+ScSheetSourceDesc::ScSheetSourceDesc(ScDocument* pDoc) :
+ mpDoc(pDoc) {}
-// Wang Xu Ming -- 2009-8-5
-// DataPilot Migration - Cache&&Performance
-ScDPTableDataCache* ScSheetSourceDesc::CreateCache( ScDocument* pDoc , long nID ) const
+void ScSheetSourceDesc::SetSourceRange(const ScRange& rRange)
{
- if ( pDoc )
- {
- ScDPTableDataCache* pCache = GetExistDPObjectCache( pDoc );
- if ( pCache && ( nID < 0 || nID == pCache->GetId() ) )
- return pCache;
+ maSourceRange = rRange;
+ maRangeName = OUString(); // overwrite existing range name if any.
+}
- sal_uLong nErrId = CheckValidate( pDoc );
- if ( !nErrId )
+const ScRange& ScSheetSourceDesc::GetSourceRange() const
+{
+ if (maRangeName.getLength())
+ {
+ // Obtain the source range from the range name first.
+ maSourceRange = ScRange();
+ ScRangeName* pRangeName = mpDoc->GetRangeName();
+ do
{
- pCache = new ScDPTableDataCache( pDoc );
+ if (!pRangeName)
+ break;
- pCache->InitFromDoc( pDoc, aSourceRange );
- pCache->SetId( nID );
- pDoc->AddDPObjectCache( pCache );
+ OUString aUpper = ScGlobal::pCharClass->upper(maRangeName);
+ const ScRangeData* pData = pRangeName->findByUpperName(aUpper);
+ if (!pData)
+ break;
- DBG_TRACE1("Create a cache id = %d \n", pCache->GetId() );
+ // range name found. Fow now, we only use the first token and
+ // ignore the rest.
+ ScRange aRange;
+ if (!pData->IsReference(aRange))
+ break;
+
+ maSourceRange = aRange;
}
- else
- DBG_ERROR( "\n Error Create Cache" );
- return pCache;
+ while (false);
}
- return NULL;
+ return maSourceRange;
}
-ScDPTableDataCache* ScSheetSourceDesc::GetExistDPObjectCache ( ScDocument* pDoc ) const
+void ScSheetSourceDesc::SetRangeName(const OUString& rName)
{
- return pDoc->GetUsedDPObjectCache( aSourceRange );
+ maRangeName = rName;
}
-ScDPTableDataCache* ScSheetSourceDesc::GetCache( ScDocument* pDoc, long nID ) const
+
+const OUString& ScSheetSourceDesc::GetRangeName() const
{
- ScDPTableDataCache* pCache = pDoc->GetDPObjectCache( nID );
- if ( NULL == pCache && pDoc )
- pCache = GetExistDPObjectCache( pDoc );
- if ( NULL == pCache )
- pCache = CreateCache( pDoc );
- return pCache;
+ return maRangeName;
}
-long ScSheetSourceDesc:: GetCacheId( ScDocument* pDoc, long nID ) const
+bool ScSheetSourceDesc::HasRangeName() const
{
- ScDPTableDataCache* pCache = GetCache( pDoc, nID);
- if ( NULL == pCache )
- return -1;
- else
- return pCache->GetId();
+ return maRangeName.getLength() > 0;
}
-sal_uLong ScSheetSourceDesc::CheckValidate( ScDocument* pDoc ) const
+void ScSheetSourceDesc::SetQueryParam(const ScQueryParam& rParam)
{
- ScRange aSrcRange( aSourceRange);
- if ( !pDoc )
- return STR_ERR_DATAPILOTSOURCE;
- for(sal_uInt16 i= aSrcRange.aStart.Col();i <= aSrcRange.aEnd.Col();i++)
- {
- if ( pDoc->IsBlockEmpty( aSrcRange.aStart.Tab(),
- i, aSrcRange.aStart.Row(),i, aSrcRange.aStart.Row()))
- return STR_PIVOT_FIRSTROWEMPTYERR;
- }
- if( pDoc->IsBlockEmpty( aSrcRange.aStart.Tab(), aSrcRange.aStart.Col(), aSrcRange.aStart.Row()+1, aSrcRange.aEnd.Col(), aSrcRange.aEnd.Row() ) )
- {
- return STR_PIVOT_ONLYONEROWERR;
- }
- return 0;
+ maQueryParam = rParam;
}
-// End Comments
-// -----------------------------------------------------------------------
+const ScQueryParam& ScSheetSourceDesc::GetQueryParam() const
+{
+ return maQueryParam;
+}
+bool ScSheetSourceDesc::operator== (const ScSheetSourceDesc& rOther) const
+{
+ return maSourceRange == rOther.maSourceRange &&
+ maRangeName == rOther.maRangeName &&
+ maQueryParam == rOther.maQueryParam;
+}
+
+ScDPCache* ScSheetSourceDesc::CreateCache() const
+{
+ if (!mpDoc)
+ return NULL;
+
+ sal_uLong nErrId = CheckSourceRange();
+ if (nErrId)
+ {
+ OSL_FAIL( "Error Create Cache\n" );
+ return NULL;
+ }
+
+ ScDPCache* pCache = new ScDPCache(mpDoc);
+ pCache->InitFromDoc(mpDoc, GetSourceRange());
+ return pCache;
+}
+long ScSheetSourceDesc::GetCacheId() const
+{
+ return -1;
+}
+sal_uLong ScSheetSourceDesc::CheckSourceRange() const
+{
+ if (!mpDoc)
+ return STR_ERR_DATAPILOTSOURCE;
+ const ScRange& aSrcRange = GetSourceRange();
+ const ScAddress& s = aSrcRange.aStart;
+ const ScAddress& e = aSrcRange.aEnd;
+ for (SCCOL nCol = aSrcRange.aStart.Col(); nCol <= e.Col(); ++nCol)
+ {
+ if (mpDoc->IsBlockEmpty(s.Tab(), nCol, s.Row(), nCol, s.Row()))
+ return STR_PIVOT_FIRSTROWEMPTYERR;
+ }
+ if (mpDoc->IsBlockEmpty(s.Tab(), s.Col(), s.Row()+1, e.Col(), e.Row()))
+ return STR_PIVOT_ONLYONEROWERR;
+ return 0;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx
index f6b85117d63b..cca9ead058fb 100644
--- a/sc/source/core/data/dptabdat.cxx
+++ b/sc/source/core/data/dptabdat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,9 +62,8 @@ ScDPTableData::CalcInfo::CalcInfo() :
// ---------------------------------------------------------------------------
-ScDPTableData::ScDPTableData(ScDocument* pDoc, long nCacheId ) :
- mnCacheId( nCacheId ),
- mpDoc ( pDoc )
+ScDPTableData::ScDPTableData(ScDocument* pDoc) :
+ mpDoc(pDoc)
{
nLastDateVal = nLastHier = nLastLevel = nLastRet = -1; // invalid
@@ -93,7 +93,7 @@ long ScDPTableData::GetDatePart( long nDateVal, long nHierarchy, long nLevel )
case 2: nRet = aDate.GetMonth(); break;
case 3: nRet = aDate.GetDay(); break;
default:
- DBG_ERROR("GetDatePart: wrong level");
+ OSL_FAIL("GetDatePart: wrong level");
}
break;
case SC_DAPI_HIERARCHY_WEEK:
@@ -104,11 +104,11 @@ long ScDPTableData::GetDatePart( long nDateVal, long nHierarchy, long nLevel )
case 1: nRet = aDate.GetWeekOfYear(); break;
case 2: nRet = (long)aDate.GetDayOfWeek(); break;
default:
- DBG_ERROR("GetDatePart: wrong level");
+ OSL_FAIL("GetDatePart: wrong level");
}
break;
default:
- DBG_ERROR("GetDatePart: wrong hierarchy");
+ OSL_FAIL("GetDatePart: wrong hierarchy");
}
nLastDateVal = nDateVal;
@@ -131,7 +131,7 @@ sal_uLong ScDPTableData::GetNumberFormat(long)
sal_Bool ScDPTableData::IsBaseForGroup(long) const
{
- return sal_False; // always false
+ return false; // always false
}
long ScDPTableData::GetGroupBase(long) const
@@ -141,21 +141,21 @@ long ScDPTableData::GetGroupBase(long) const
sal_Bool ScDPTableData::IsNumOrDateGroup(long) const
{
- return sal_False; // always false
+ return false; // always false
}
sal_Bool ScDPTableData::IsInGroup( const ScDPItemData&, long,
const ScDPItemData&, long ) const
{
- DBG_ERROR("IsInGroup shouldn't be called for non-group data");
- return sal_False;
+ OSL_FAIL("IsInGroup shouldn't be called for non-group data");
+ return false;
}
sal_Bool ScDPTableData::HasCommonElement( const ScDPItemData&, long,
const ScDPItemData&, long ) const
{
- DBG_ERROR("HasCommonElement shouldn't be called for non-group data");
- return sal_False;
+ OSL_FAIL("HasCommonElement shouldn't be called for non-group data");
+ return false;
}
void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTable& rCacheTable,
const CalcInfo& rInfo, CalcRowData& rData)
@@ -169,7 +169,7 @@ void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTab
// page dimensions
GetItemData(rCacheTable, nRow, rInfo.aPageDims, rData.aPageData);
- long nCacheColumnCount = rCacheTable.GetCache()->GetColumnCount();
+ long nCacheColumnCount = rCacheTable.getCache()->GetColumnCount();
sal_Int32 n = rInfo.aDataSrcCols.size();
for (sal_Int32 i = 0; i < n; ++i)
{
@@ -187,22 +187,19 @@ void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTab
void ScDPTableData::ProcessRowData(CalcInfo& rInfo, CalcRowData& rData, bool bAutoShow)
{
- // Wang Xu Ming -- 2009-6-16
- // DataPilot Migration
if (!bAutoShow)
{
- LateInitParams aColParams( rInfo.aColDims, rInfo.aColLevels, sal_False );
+ LateInitParams aColParams( rInfo.aColDims, rInfo.aColLevels, false );
LateInitParams aRowParams ( rInfo.aRowDims, rInfo.aRowLevels, sal_True );
// root always init child
aColParams.SetInitChild( sal_True );
- aColParams.SetInitAllChildren( sal_False);
+ aColParams.SetInitAllChildren( false);
aRowParams.SetInitChild( sal_True );
- aRowParams.SetInitAllChildren( sal_False);
+ aRowParams.SetInitAllChildren( false);
rInfo.pColRoot->LateInitFrom( aColParams, rData.aColData,0, *rInfo.pInitState);
rInfo.pRowRoot->LateInitFrom( aRowParams, rData.aRowData, 0, *rInfo.pInitState);
}
- // End Comments
if ( ( !rInfo.pColRoot->GetChildDimension() || rInfo.pColRoot->GetChildDimension()->IsValidEntry(rData.aColData) ) &&
( !rInfo.pRowRoot->GetChildDimension() || rInfo.pRowRoot->GetChildDimension()->IsValidEntry(rData.aRowData) ) )
@@ -210,11 +207,8 @@ void ScDPTableData::ProcessRowData(CalcInfo& rInfo, CalcRowData& rData, bool bAu
//! single process method with ColMembers, RowMembers and data !!!
if (rInfo.pColRoot->GetChildDimension())
{
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
vector</*ScDPItemData*/ SCROW > aEmptyData;
rInfo.pColRoot->GetChildDimension()->ProcessData(rData.aColData, NULL, aEmptyData, rData.aValues);
-// End Comments
}
rInfo.pRowRoot->ProcessData(rData.aRowData, rInfo.pColRoot->GetChildDimension(),
@@ -236,11 +230,8 @@ void ScDPTableData::CalcResultsFromCacheTable(const ScDPCacheTable& rCacheTable,
}
}
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
void ScDPTableData::GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRow,
const vector<long>& rDims, vector< SCROW/*ScDPItemData*/>& rItemData)
-// End Comments
{
sal_Int32 nDimSize = rDims.size();
for (sal_Int32 i = 0; i < nDimSize; ++i)
@@ -254,10 +245,10 @@ void ScDPTableData::GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRo
}
nDim = GetSourceDim( nDim );
- if ( nDim >= rCacheTable.GetCache()->GetColumnCount() )
+ if ( nDim >= rCacheTable.getCache()->GetColumnCount() )
continue;
- SCROW nId= rCacheTable.GetCache()->GetItemDataId( static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow), IsRepeatIfEmpty());
+ SCROW nId= rCacheTable.getCache()->GetItemDataId( static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow), IsRepeatIfEmpty());
rItemData.push_back( nId );
}
@@ -265,8 +256,6 @@ void ScDPTableData::GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRo
// -----------------------------------------------------------------------
-// Wang Xu Ming -- 2009-6-8
-// DataPilot Migration
long ScDPTableData::GetMembersCount( long nDim )
{
if ( nDim > MAXCOL )
@@ -274,11 +263,6 @@ long ScDPTableData::GetMembersCount( long nDim )
return GetCacheTable().getFieldEntries( nDim ).size();
}
-long ScDPTableData::GetCacheId() const
-{
- return mnCacheId;
-}
-
const ScDPItemData* ScDPTableData::GetMemberByIndex( long nDim, long nIndex )
{
if ( nIndex >= GetMembersCount( nDim ) )
@@ -286,18 +270,18 @@ const ScDPItemData* ScDPTableData::GetMemberByIndex( long nDim, long nIndex )
const ::std::vector<SCROW>& nMembers = GetCacheTable().getFieldEntries( nDim );
- return GetCacheTable().GetCache()->GetItemDataById( (SCCOL) nDim, (SCROW)nMembers[nIndex] );
+ return GetCacheTable().getCache()->GetItemDataById( (SCCOL) nDim, (SCROW)nMembers[nIndex] );
}
const ScDPItemData* ScDPTableData::GetMemberById( long nDim, long nId)
{
- return GetCacheTable().GetCache()->GetItemDataById( (SCCOL) nDim, (SCROW)nId);
+ return GetCacheTable().getCache()->GetItemDataById( (SCCOL) nDim, (SCROW)nId);
}
SCROW ScDPTableData::GetIdOfItemData( long nDim, const ScDPItemData& rData )
{
- return GetCacheTable().GetCache()->GetIdByItemData((SCCOL) nDim, rData );
+ return GetCacheTable().getCache()->GetIdByItemData((SCCOL) nDim, rData );
}
const std::vector< SCROW >& ScDPTableData::GetColumnEntries( long nColumn )
@@ -311,13 +295,13 @@ long ScDPTableData::GetSourceDim( long nDim )
}
- long ScDPTableData::Compare( long nDim, long nDataId1, long nDataId2)
+long ScDPTableData::Compare( long nDim, long nDataId1, long nDataId2)
{
if ( getIsDataLayoutDimension(nDim) )
return 0;
- long n1 = GetCacheTable().GetCache()->GetOrder( nDim, nDataId1);
- long n2 = GetCacheTable().GetCache()->GetOrder( nDim, nDataId2);
+ long n1 = GetCacheTable().getOrder(nDim, nDataId1);
+ long n2 = GetCacheTable().getOrder(nDim, nDataId2);
if ( n1 > n2 )
return 1;
else if ( n1 == n2 )
@@ -325,5 +309,6 @@ long ScDPTableData::GetSourceDim( long nDim )
else
return -1;
}
-// End Comments
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index f2cc8d2c1e5c..e3ddbcbe0f59 100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -7,9 +8,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dptablecache.cxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,9 +26,9 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
- // MARKER(update_precomp.py): autogen include statement, do not remove
+// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-// INCLUDE ---------------------------------------------------------------
+
#include "dptablecache.hxx"
#include "document.hxx"
#include "cell.hxx"
@@ -39,15 +37,17 @@
#include <rtl/math.hxx>
#include "queryparam.hxx"
#include "dpglobal.hxx"
+#include "dptabdat.hxx"
-#include "docoptio.hxx" //for ValidQuery
-#include <unotools/textsearch.hxx> //for ValidQuery
+#include "docoptio.hxx"
+#include <unotools/textsearch.hxx>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
+
const double D_TIMEFACTOR = 86400.0;
using namespace ::com::sun::star;
@@ -56,61 +56,60 @@ using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
-// -----------------------------------------------------------------------
-namespace
+using ::std::vector;
+
+namespace {
+
+bool lcl_isDate( sal_uLong nNumType )
{
- sal_Bool lcl_isDate( sal_uLong nNumType )
- {
- return ( (nNumType & NUMBERFORMAT_DATE) != 0 )? 1:0 ;
- }
+ return ((nNumType & NUMBERFORMAT_DATE) != 0) ? 1 : 0;
+}
- sal_Bool lcl_Search( const std::vector<ScDPItemData*>& list, const ::std::vector<SCROW>& rOrder, const ScDPItemData& item, SCROW& rIndex)
+bool lcl_Search( const ScDPCache::DataListType& list, const ::std::vector<SCROW>& rOrder, const ScDPItemData& item, SCROW& rIndex)
+{
+ rIndex = list.size();
+ bool bFound = false;
+ SCROW nLo = 0;
+ SCROW nHi = list.size() - 1;
+ SCROW nIndex;
+ long nCompare;
+ while (nLo <= nHi)
{
- rIndex = list.size();
- sal_Bool bFound = sal_False;
- SCROW nLo = 0;
- SCROW nHi = list.size() - 1;
- SCROW nIndex;
- long nCompare;
- while (nLo <= nHi)
+ nIndex = (nLo + nHi) / 2;
+ nCompare = ScDPItemData::Compare( list[rOrder[nIndex]], item );
+ if (nCompare < 0)
+ nLo = nIndex + 1;
+ else
{
- nIndex = (nLo + nHi) / 2;
- nCompare = ScDPItemData::Compare( *list[rOrder[nIndex]], item );
- if (nCompare < 0)
- nLo = nIndex + 1;
- else
+ nHi = nIndex - 1;
+ if (nCompare == 0)
{
- nHi = nIndex - 1;
- if (nCompare == 0)
- {
- bFound = sal_True;
- nLo = nIndex;
- }
+ bFound = true;
+ nLo = nIndex;
}
}
- rIndex = nLo;
- return bFound;
}
+ rIndex = nLo;
+ return bFound;
+}
- ScDPItemData* lcl_GetItemValue(const Reference<sdbc::XRow>& xRow, sal_Int32 nType, long nCol,
- const Date& rNullDate )
+ScDPItemData* lcl_GetItemValue(
+ const Reference<sdbc::XRow>& xRow, sal_Int32 nType, long nCol, const Date& rNullDate)
+{
+ short nNumType = NUMBERFORMAT_NUMBER;
+ try
{
- short nNumType = NUMBERFORMAT_NUMBER;
- try
+ String rStr = xRow->getString(nCol);
+ double fValue = 0.0;
+ switch (nType)
{
- String rStr = xRow->getString(nCol);
- double fValue = 0.0;
- switch (nType)
- {
case sdbc::DataType::BIT:
case sdbc::DataType::BOOLEAN:
- {
- nNumType = NUMBERFORMAT_LOGICAL;
- fValue = xRow->getBoolean(nCol) ? 1 : 0;
- return new ScDPItemData( rStr, fValue,sal_True,nNumType);
- }
- //break;
-
+ {
+ nNumType = NUMBERFORMAT_LOGICAL;
+ fValue = xRow->getBoolean(nCol) ? 1 : 0;
+ return new ScDPItemData( rStr, fValue,true,nNumType);
+ }
case sdbc::DataType::TINYINT:
case sdbc::DataType::SMALLINT:
case sdbc::DataType::INTEGER:
@@ -120,45 +119,38 @@ namespace
case sdbc::DataType::DOUBLE:
case sdbc::DataType::NUMERIC:
case sdbc::DataType::DECIMAL:
- {
- //! do the conversion here?
- fValue = xRow->getDouble(nCol);
- return new ScDPItemData( rStr, fValue,sal_True);
- }
- //break;
-
+ {
+ //! do the conversion here?
+ fValue = xRow->getDouble(nCol);
+ return new ScDPItemData( rStr, fValue,true);
+ }
case sdbc::DataType::DATE:
- {
- nNumType = NUMBERFORMAT_DATE;
-
- util::Date aDate = xRow->getDate(nCol);
- fValue = Date(aDate.Day, aDate.Month, aDate.Year) - rNullDate;
- return new ScDPItemData( rStr, fValue, sal_True, nNumType );
- }
- //break;
+ {
+ nNumType = NUMBERFORMAT_DATE;
+ util::Date aDate = xRow->getDate(nCol);
+ fValue = Date(aDate.Day, aDate.Month, aDate.Year) - rNullDate;
+ return new ScDPItemData( rStr, fValue, true, nNumType );
+ }
case sdbc::DataType::TIME:
- {
- nNumType = NUMBERFORMAT_TIME;
-
- util::Time aTime = xRow->getTime(nCol);
- fValue = ( aTime.Hours * 3600 + aTime.Minutes * 60 +
- aTime.Seconds + aTime.HundredthSeconds / 100.0 ) / D_TIMEFACTOR;
- return new ScDPItemData( rStr,fValue, sal_True, nNumType );
- }
- //break;
+ {
+ nNumType = NUMBERFORMAT_TIME;
+ util::Time aTime = xRow->getTime(nCol);
+ fValue = ( aTime.Hours * 3600 + aTime.Minutes * 60 +
+ aTime.Seconds + aTime.HundredthSeconds / 100.0 ) / D_TIMEFACTOR;
+ return new ScDPItemData( rStr,fValue, true, nNumType );
+ }
case sdbc::DataType::TIMESTAMP:
- {
- nNumType = NUMBERFORMAT_DATETIME;
+ {
+ nNumType = NUMBERFORMAT_DATETIME;
- util::DateTime aStamp = xRow->getTimestamp(nCol);
- fValue = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) - rNullDate ) +
- ( aStamp.Hours * 3600 + aStamp.Minutes * 60 +
- aStamp.Seconds + aStamp.HundredthSeconds / 100.0 ) / D_TIMEFACTOR;
- return new ScDPItemData( rStr,fValue, sal_True, nNumType );
- }
- //break;
+ util::DateTime aStamp = xRow->getTimestamp(nCol);
+ fValue = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) - rNullDate ) +
+ ( aStamp.Hours * 3600 + aStamp.Minutes * 60 +
+ aStamp.Seconds + aStamp.HundredthSeconds / 100.0 ) / D_TIMEFACTOR;
+ return new ScDPItemData( rStr,fValue, true, nNumType );
+ }
case sdbc::DataType::CHAR:
case sdbc::DataType::VARCHAR:
case sdbc::DataType::LONGVARCHAR:
@@ -168,29 +160,25 @@ namespace
case sdbc::DataType::LONGVARBINARY:
default:
return new ScDPItemData ( rStr );
- //break;
- }
- }
- catch (uno::Exception&)
- {
}
- catch ( ... )
- {
-
- }
- return NULL;
}
+ catch (uno::Exception&)
+ {
+ }
+
+ return NULL;
+}
+
}
-// Wang Xu Ming -- 12/23/2008
-//Refactor cache data
-ScDPItemData::ScDPItemData( const String& rS, double fV/* = 0.0*/, sal_Bool bHV/* = sal_False*/, const sal_uLong nNumFormatP /*= 0*/ , sal_Bool bData/* = sal_True*/) :
-nNumFormat( nNumFormatP ), aString(rS), fValue(fV),
-mbFlag( (MK_VAL*!!bHV) | (MK_DATA*!!bData) | (MK_ERR*!!sal_False) | (MK_DATE*!!lcl_isDate( nNumFormat ) ) )
+
+ScDPItemData::ScDPItemData(const String& rS, double fV, bool bHV, const sal_uLong nNumFormatP, bool bData) :
+ nNumFormat( nNumFormatP ), aString(rS), fValue(fV),
+ mbFlag( (MK_VAL*!!bHV) | (MK_DATA*!!bData) | (MK_ERR*!!false) | (MK_DATE*!!lcl_isDate( nNumFormat ) ) )
{
}
-ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, sal_uInt16 nCol, sal_uInt16 nDocTab ):
- nNumFormat( 0 ), fValue(0.0), mbFlag( 0 )
+ScDPItemData::ScDPItemData(ScDocument* pDoc, SCROW nRow, sal_uInt16 nCol, sal_uInt16 nDocTab) :
+ nNumFormat( 0 ), fValue(0.0), mbFlag( 0 )
{
String aDocStr;
pDoc->GetString( nCol, nRow, nDocTab, aDocStr );
@@ -202,8 +190,7 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, sal_uInt16 nCol, sal_u
if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->GetErrCode() )
{
- SetString ( aDocStr ); //[SODC_19347] add liyi
- //bErr = sal_True; //[SODC_19347] del liyi
+ SetString ( aDocStr );
mbFlag |= MK_ERR;
}
else if ( pDoc->HasValueData( nCol, nRow, nDocTab ) )
@@ -221,10 +208,9 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, sal_uInt16 nCol, sal_u
else if ( pDoc->HasData( nCol,nRow, nDocTab ) )
SetString ( aDocStr );
}
-// End Comments
-sal_Bool ScDPItemData::IsCaseInsEqual( const ScDPItemData& r ) const
-{ //TODO: indified Date?
+bool ScDPItemData::IsCaseInsEqual( const ScDPItemData& r ) const
+{
//! pass Transliteration?
//! inline?
return IsValue() ? ( r.IsValue() && rtl::math::approxEqual( fValue, r.fValue ) ) :
@@ -242,27 +228,22 @@ size_t ScDPItemData::Hash() const
return rtl_ustr_hashCode_WithLength( aString.GetBuffer(), aString.Len() );
}
-sal_Bool ScDPItemData::operator==( const ScDPItemData& r ) const
+bool ScDPItemData::operator==( const ScDPItemData& r ) const
{
if ( IsValue() )
{
if( (HasDatePart() != r.HasDatePart()) || (HasDatePart() && mnDatePart != r.mnDatePart) )
- return sal_False;
+ return false;
-// Wang Xu Ming -- 1/9/2009
-// Add Data Cache Support.
-// Identify date
if ( IsDate() != r.IsDate() )
- return sal_False;
- else
- if ( r.IsValue() )
+ return false;
+ else if ( r.IsValue() )
return rtl::math::approxEqual( fValue, r.fValue );
else
- return sal_False;
-// End Comments
+ return false;
}
else if ( r.IsValue() )
- return sal_False;
+ return false;
else
// need exact equality until we have a safe case insensitive string hash
return aString == r.aString;
@@ -277,14 +258,10 @@ sal_Int32 ScDPItemData::Compare( const ScDPItemData& rA,
{
if ( rtl::math::approxEqual( rA.fValue, rB.fValue ) )
{
-// Wang Xu Ming -- 1/9/2009
-// Add Data Cache Support.
-// Date > number
if ( rA.IsDate() == rB.IsDate() )
return 0;
else
return rA.IsDate() ? 1: -1;
-// End Comments
}
else if ( rA.fValue < rB.fValue )
return -1;
@@ -299,9 +276,8 @@ sal_Int32 ScDPItemData::Compare( const ScDPItemData& rA,
else
return ScGlobal::GetCollator()->compareString( rA.aString, rB.aString );
}
-//
-//Wang Xu Ming SODC_17561
-#ifdef DEBUG
+
+#if OSL_DEBUG_LEVEL > 1
void ScDPItemData::dump() const
{
DBG_TRACE1( "Numberformat= %o", nNumFormat );
@@ -310,9 +286,8 @@ void ScDPItemData::dump() const
DBG_TRACE1( "mbFlag= %d", mbFlag);
}
#endif
-//End
-TypedStrData* ScDPItemData::CreateTypeString( )
+TypedStrData* ScDPItemData::CreateTypeString( )
{
if ( IsValue() )
return new TypedStrData( aString, fValue, SC_STRTYPE_VALUE );
@@ -322,7 +297,6 @@ TypedStrData* ScDPItemData::CreateTypeString( )
sal_uInt8 ScDPItemData::GetType() const
{
-
if ( IsHasErr() )
return SC_VALTYPE_ERROR;
else if ( !IsHasData() )
@@ -331,27 +305,25 @@ sal_uInt8 ScDPItemData::GetType() const
return SC_VALTYPE_VALUE;
else
return SC_VALTYPE_STRING;
-
}
-sal_Bool ScDPItemData::IsHasData() const
+bool ScDPItemData::IsHasData() const
{
return !!(mbFlag&MK_DATA);
}
-sal_Bool ScDPItemData::IsHasErr() const
+bool ScDPItemData::IsHasErr() const
{
return !!(mbFlag&MK_ERR);
}
-sal_Bool ScDPItemData::IsValue() const
+bool ScDPItemData::IsValue() const
{
return !!(mbFlag&MK_VAL);
}
String ScDPItemData::GetString() const
{
-
return aString;
}
@@ -364,20 +336,22 @@ sal_uLong ScDPItemData::GetNumFormat() const
return nNumFormat;
}
-sal_Bool ScDPItemData::HasStringData() const
-
+bool ScDPItemData::HasStringData() const
{
return IsHasData()&&!IsHasErr()&&!IsValue();
}
-sal_Bool ScDPItemData::IsDate() const
+
+bool ScDPItemData::IsDate() const
{
return !!(mbFlag&MK_DATE);
}
-sal_Bool ScDPItemData::HasDatePart() const
+
+bool ScDPItemData::HasDatePart() const
{
return !!(mbFlag&MK_DATEPART);
}
-void ScDPItemData::SetDate( sal_Bool b )
+
+void ScDPItemData::SetDate( bool b )
{
b ? ( mbFlag |= MK_DATE ) : ( mbFlag &= ~MK_DATE );
}
@@ -386,113 +360,59 @@ void ScDPItemData::SetDate( sal_Bool b )
//class ScDPTableDataCache
//To cache the pivot table data source
-sal_Bool ScDPTableDataCache::operator== ( const ScDPTableDataCache& r ) const
+bool ScDPCache::operator== ( const ScDPCache& r ) const
{
if ( GetColumnCount() == r.GetColumnCount() )
{
for ( SCCOL i = 0 ; i < GetColumnCount(); i++ )
{ //check dim names
if ( GetDimensionName( i ) != r.GetDimensionName( i ) )
- return sal_False;
+ return false;
//check rows count
if ( GetRowCount() != r.GetRowCount() )
- return sal_False;
+ return false;
//check dim member values
size_t nMembersCount = GetDimMemberValues( i ).size();
if ( GetDimMemberValues( i ).size() == r. GetDimMemberValues( i ).size() )
{
for ( size_t j = 0; j < nMembersCount; j++ )
{
- if ( *( GetDimMemberValues( i )[j] ) == *( r.GetDimMemberValues( i )[j] ) )
+ if ( GetDimMemberValues(i)[j] == r.GetDimMemberValues(i)[j] )
continue;
else
- return sal_False;
+ return false;
}
}
else
- return sal_False;
+ return false;
//check source table index
for ( SCROW k=0 ; k < GetRowCount(); k ++ )
{
- if ( GetItemDataId( i, k, sal_False ) == r.GetItemDataId( i,k,sal_False) )
+ if ( GetItemDataId( i, k, false ) == r.GetItemDataId( i,k,false) )
continue;
else
- return sal_False;
+ return false;
}
}
}
- return sal_True;
+ return true;
}
-ScDPTableDataCache::ScDPTableDataCache( ScDocument* pDoc ) :
-mpDoc( pDoc ),
-mnColumnCount ( 0 ),
-mpTableDataValues ( NULL ),
-mpSourceData ( NULL ),
-mpGlobalOrder( NULL ),
-mpIndexOrder( NULL)
+ScDPCache::ScDPCache(ScDocument* pDoc) :
+ mpDoc( pDoc ),
+ mnColumnCount ( 0 )
{
- mnID = -1;
}
-ScDPTableDataCache::~ScDPTableDataCache()
+ScDPCache::~ScDPCache()
{
- if ( IsValid() )
- {
-// Wang Xu Ming -- 2/17/2009
-// Performance issue
- sal_uInt16 nCol;
- for ( nCol=0; nCol < GetColumnCount() ; nCol++ )
- {
- for ( sal_uLong row = 0 ; row < mpTableDataValues[nCol].size(); row++ )
- delete mpTableDataValues[nCol][row];
- }
- for ( nCol =0; nCol < mrLabelNames.size(); nCol++ )
- delete mrLabelNames[nCol];
-// End Comments
-
- mnColumnCount = 0;
- delete [] mpTableDataValues;
- mpTableDataValues = NULL;
- delete [] mpSourceData;
- mpSourceData = NULL;
- delete [] mpGlobalOrder;
- mpGlobalOrder = NULL;
- delete [] mpIndexOrder;
- mpIndexOrder = NULL;
- }
}
-// -----------------------------------------------------------------------
-void ScDPTableDataCache::AddRow( ScDPItemData* pRow, sal_uInt16 nCount )
+bool ScDPCache::IsValid() const
{
- DBG_ASSERT( pRow , " empty pointer" );
- if ( !mrLabelNames.size() )
- {
- mnColumnCount= nCount;
- mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ];
- mpSourceData = new std::vector<SCROW>[ mnColumnCount ];
- mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ];
- mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ];
-
- for ( sal_uInt16 i = 0; i < nCount ; i ++ )
- AddLabel( new ScDPItemData( pRow[i] ) );
- }
- else
- {
- for ( sal_uInt16 i = 0; i < nCount && i < mnColumnCount; i ++ )
- AddData( i, new ScDPItemData( pRow[i] ) );
- }
+ return !maTableDataValues.empty() && !maSourceData.empty() && mnColumnCount > 0;
}
-// -----------------------------------------------------------------------
-bool ScDPTableDataCache::IsValid() const
-{ //TODO: continue check valid
- return mpTableDataValues!=NULL && mpSourceData!= NULL && mnColumnCount>0;
-}
-
-// -----------------------------------------------------------------------
-
namespace {
/**
@@ -517,8 +437,7 @@ private:
}
-// -----------------------------------------------------------------------
-bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange )
+bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange)
{
// Make sure the formula cells within the data range are interpreted
// during this call, for this method may be called from the interpretation
@@ -526,35 +445,33 @@ bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange )
// increasing the macro level.
MacroInterpretIncrementer aMacroInc(pDoc);
- //
SCROW nStartRow = rRange.aStart.Row(); // start of data
SCROW nEndRow = rRange.aEnd.Row();
sal_uInt16 nStartCol = rRange.aStart.Col();
sal_uInt16 nEndCol = rRange.aEnd.Col();
sal_uInt16 nDocTab = rRange.aStart.Tab();
- //init
- long nOldColumCount = mnColumnCount;
mnColumnCount = nEndCol - nStartCol + 1;
if ( IsValid() )
{
- for ( sal_uInt16 nCol=0; nCol < nOldColumCount ; nCol++ )
- {
- for ( sal_uLong row = 0 ; row < mpTableDataValues[nCol].size(); row++ )
- delete mpTableDataValues[nCol][row];
- delete mrLabelNames[nCol];
- }
- delete [] mpTableDataValues;
- delete [] mpSourceData;
- delete [] mpGlobalOrder;
- delete [] mpIndexOrder;
- mrLabelNames.clear();
+ maTableDataValues.clear();
+ maSourceData.clear();
+ maGlobalOrder.clear();
+ maIndexOrder.clear();
+ maLabelNames.clear();
}
- mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ];
- mpSourceData = new std::vector<SCROW>[ mnColumnCount ];
- mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ];
- mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ];
+ maTableDataValues.reserve(mnColumnCount);
+ maSourceData.reserve(mnColumnCount);
+ maGlobalOrder.reserve(mnColumnCount);
+ maIndexOrder.reserve(mnColumnCount);
+ for (long i = 0; i < mnColumnCount; ++i)
+ {
+ maTableDataValues.push_back(new DataListType);
+ maSourceData.push_back(new vector<SCROW>());
+ maGlobalOrder.push_back(new vector<SCROW>());
+ maIndexOrder.push_back(new vector<SCROW>());
+ }
//check valid
for ( SCROW nRow = nStartRow; nRow <= nEndRow; nRow ++ )
{
@@ -566,13 +483,12 @@ bool ScDPTableDataCache::InitFromDoc( ScDocument* pDoc, const ScRange& rRange )
AddData( nCol - nStartCol, new ScDPItemData( pDoc, nRow, nCol, nDocTab ) );
}
}
- return sal_True;
+ return true;
}
-// -----------------------------------------------------------------------
-bool ScDPTableDataCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const Date& rNullDate)
+bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const Date& rNullDate)
{
- if (!xRowSet.is())
+ if (!xRowSet.is())
// Dont' even waste time to go any further.
return false;
try
@@ -582,36 +498,37 @@ bool ScDPTableDataCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowS
if (!xMeta.is())
return false;
- long nOldColumCount = mnColumnCount;
- mnColumnCount = xMeta->getColumnCount();
- if ( IsValid() )
- {
- for ( sal_uInt16 nCol=0; nCol < nOldColumCount ; nCol++ )
+ mnColumnCount = xMeta->getColumnCount();
+ if (IsValid())
{
- for ( sal_uLong row = 0 ; row < mpTableDataValues[nCol].size(); row++ )
- delete mpTableDataValues[nCol][row];
- delete mrLabelNames[nCol];
+ maTableDataValues.clear();
+ maSourceData.clear();
+ maGlobalOrder.clear();
+ maIndexOrder.clear();
+ maLabelNames.clear();
}
- delete [] mpTableDataValues;
- delete [] mpSourceData;
- delete [] mpGlobalOrder;
- delete [] mpIndexOrder;
- mrLabelNames.clear();
- }
// Get column titles and types.
- mrLabelNames.reserve(mnColumnCount);
- mpTableDataValues = new std::vector<ScDPItemData*>[ mnColumnCount ];
- mpSourceData = new std::vector<SCROW>[ mnColumnCount ];
- mpGlobalOrder = new std::vector<SCROW>[ mnColumnCount ];
- mpIndexOrder = new std::vector<SCROW>[ mnColumnCount ];
+ maLabelNames.reserve(mnColumnCount);
+
+ maTableDataValues.reserve(mnColumnCount);
+ maSourceData.reserve(mnColumnCount);
+ maGlobalOrder.reserve(mnColumnCount);
+ maIndexOrder.reserve(mnColumnCount);
+ for (long i = 0; i < mnColumnCount; ++i)
+ {
+ maTableDataValues.push_back(new DataListType);
+ maSourceData.push_back(new vector<SCROW>());
+ maGlobalOrder.push_back(new vector<SCROW>());
+ maIndexOrder.push_back(new vector<SCROW>());
+ }
- std::vector<sal_Int32> aColTypes(mnColumnCount);
+ std::vector<sal_Int32> aColTypes(mnColumnCount);
for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol)
{
String aColTitle = xMeta->getColumnLabel(nCol+1);
aColTypes[nCol] = xMeta->getColumnType(nCol+1);
- AddLabel( new ScDPItemData( aColTitle) );
+ AddLabel( new ScDPItemData( aColTitle) );
}
// Now get the data rows.
@@ -621,334 +538,325 @@ bool ScDPTableDataCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowS
{
for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol)
{
- ScDPItemData * pNew = lcl_GetItemValue( xRow, aColTypes[nCol], nCol+1, rNullDate );
- if ( pNew )
- AddData( nCol , pNew );
+ ScDPItemData * pNew = lcl_GetItemValue( xRow, aColTypes[nCol], nCol+1, rNullDate );
+ if (pNew)
+ AddData(nCol , pNew);
}
}
while (xRowSet->next());
- xRowSet->beforeFirst();
+ xRowSet->beforeFirst();
- return true;
+ return true;
}
catch (const Exception&)
{
return false;
}
}
-// -----------------------------------------------------------------------
-sal_uLong ScDPTableDataCache::GetDimNumType( SCCOL nDim) const
+
+sal_uLong ScDPCache::GetDimNumType( SCCOL nDim) const
{
DBG_ASSERT( IsValid(), " IsValid() == false " );
DBG_ASSERT( nDim < mnColumnCount && nDim >=0, " dimention out of bound " );
- if ( mpTableDataValues[nDim].size()==0 )
+ if ( maTableDataValues[nDim].size()==0 )
return NUMBERFORMAT_UNDEFINED;
else
- return GetNumType(mpTableDataValues[nDim][0]->nNumFormat);
+ return GetNumType(maTableDataValues[nDim][0].nNumFormat);
}
-// -----------------------------------------------------------------------
-bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, sal_Bool *pSpecial)
-{ //Copied and modified from ScTable::ValidQuery
- if (!rParam.GetEntry(0).bDoQuery)
- return sal_True;
- sal_Bool bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell();
-
- //---------------------------------------------------------------
-
- const SCSIZE nFixedBools = 32;
- sal_Bool aBool[nFixedBools];
- sal_Bool aTest[nFixedBools];
- SCSIZE nEntryCount = rParam.GetEntryCount();
- sal_Bool* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new sal_Bool[nEntryCount] );
- sal_Bool* pTest = ( nEntryCount <= nFixedBools ? &aTest[0] : new sal_Bool[nEntryCount] );
-
- long nPos = -1;
- SCSIZE i = 0;
- CollatorWrapper* pCollator = (rParam.bCaseSens ? ScGlobal::GetCaseCollator() :
- ScGlobal::GetCollator() );
- ::utl::TransliterationWrapper* pTransliteration = (rParam.bCaseSens ?
- ScGlobal::GetCaseTransliteration() : ScGlobal::GetpTransliteration());
-
- while ( (i < nEntryCount) && rParam.GetEntry(i).bDoQuery )
+bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, bool *pSpecial)
+{
+ if (!rParam.GetEntry(0).bDoQuery)
+ return true;
+ bool bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell();
+
+ //---------------------------------------------------------------
+
+ const SCSIZE nFixedBools = 32;
+ bool aBool[nFixedBools];
+ bool aTest[nFixedBools];
+ SCSIZE nEntryCount = rParam.GetEntryCount();
+ bool* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new bool[nEntryCount] );
+ bool* pTest = ( nEntryCount <= nFixedBools ? &aTest[0] : new bool[nEntryCount] );
+
+ long nPos = -1;
+ SCSIZE i = 0;
+ CollatorWrapper* pCollator = (rParam.bCaseSens ? ScGlobal::GetCaseCollator() :
+ ScGlobal::GetCollator() );
+ ::utl::TransliterationWrapper* pTransliteration = (rParam.bCaseSens ?
+ ScGlobal::GetCaseTransliteration() : ScGlobal::GetpTransliteration());
+
+ while ((i < nEntryCount) && rParam.GetEntry(i).bDoQuery)
+ {
+ ScQueryEntry& rEntry = rParam.GetEntry(i);
+ // we can only handle one single direct query
+ // #i115431# nField in QueryParam is the sheet column, not the field within the source range
+ SCCOL nQueryCol = (SCCOL)rEntry.nField;
+ if ( nQueryCol < rParam.nCol1 )
+ nQueryCol = rParam.nCol1;
+ if ( nQueryCol > rParam.nCol2 )
+ nQueryCol = rParam.nCol2;
+ SCCOL nSourceField = nQueryCol - rParam.nCol1;
+ SCROW nId = GetItemDataId( nSourceField, nRow, false );
+ const ScDPItemData* pCellData = GetItemDataById( nSourceField, nId );
+
+ bool bOk = false;
+ bool bTestEqual = false;
+
+ if (pSpecial && pSpecial[i])
{
- ScQueryEntry& rEntry = rParam.GetEntry(i);
- // we can only handle one single direct query
- // #i115431# nField in QueryParam is the sheet column, not the field within the source range
- SCCOL nQueryCol = (SCCOL)rEntry.nField;
- if ( nQueryCol < rParam.nCol1 )
- nQueryCol = rParam.nCol1;
- if ( nQueryCol > rParam.nCol2 )
- nQueryCol = rParam.nCol2;
- SCCOL nSourceField = nQueryCol - rParam.nCol1;
- SCROW nId = GetItemDataId( nSourceField, nRow, sal_False );
- const ScDPItemData* pCellData = GetItemDataById( nSourceField, nId );
-
- sal_Bool bOk = sal_False;
- sal_Bool bTestEqual = sal_False;
-
- if ( pSpecial && pSpecial[i] )
- {
- if (rEntry.nVal == SC_EMPTYFIELDS)
- bOk = ! pCellData->IsHasData();
- else // if (rEntry.nVal == SC_NONEMPTYFIELDS)
- bOk = pCellData->IsHasData();
- }
- else if ( !rEntry.bQueryByString && pCellData->IsValue() )
- { // by Value
- double nCellVal = pCellData->GetValue();
+ if (rEntry.nVal == SC_EMPTYFIELDS)
+ bOk = ! pCellData->IsHasData();
+ else // if (rEntry.nVal == SC_NONEMPTYFIELDS)
+ bOk = pCellData->IsHasData();
+ }
+ else if (!rEntry.bQueryByString && pCellData->IsValue())
+ { // by Value
+ double nCellVal = pCellData->GetValue();
- switch (rEntry.eOp)
- {
- case SC_EQUAL :
- bOk = ::rtl::math::approxEqual( nCellVal, rEntry.nVal );
- break;
- case SC_LESS :
- bOk = (nCellVal < rEntry.nVal) && !::rtl::math::approxEqual( nCellVal, rEntry.nVal );
- break;
- case SC_GREATER :
- bOk = (nCellVal > rEntry.nVal) && !::rtl::math::approxEqual( nCellVal, rEntry.nVal );
- break;
- case SC_LESS_EQUAL :
- bOk = (nCellVal < rEntry.nVal) || ::rtl::math::approxEqual( nCellVal, rEntry.nVal );
- break;
- case SC_GREATER_EQUAL :
- bOk = (nCellVal > rEntry.nVal) || ::rtl::math::approxEqual( nCellVal, rEntry.nVal );
- break;
- case SC_NOT_EQUAL :
- bOk = !::rtl::math::approxEqual( nCellVal, rEntry.nVal );
- break;
- default:
- bOk= sal_False;
- break;
- }
+ switch (rEntry.eOp)
+ {
+ case SC_EQUAL :
+ bOk = ::rtl::math::approxEqual( nCellVal, rEntry.nVal );
+ break;
+ case SC_LESS :
+ bOk = (nCellVal < rEntry.nVal) && !::rtl::math::approxEqual( nCellVal, rEntry.nVal );
+ break;
+ case SC_GREATER :
+ bOk = (nCellVal > rEntry.nVal) && !::rtl::math::approxEqual( nCellVal, rEntry.nVal );
+ break;
+ case SC_LESS_EQUAL :
+ bOk = (nCellVal < rEntry.nVal) || ::rtl::math::approxEqual( nCellVal, rEntry.nVal );
+ break;
+ case SC_GREATER_EQUAL :
+ bOk = (nCellVal > rEntry.nVal) || ::rtl::math::approxEqual( nCellVal, rEntry.nVal );
+ break;
+ case SC_NOT_EQUAL :
+ bOk = !::rtl::math::approxEqual( nCellVal, rEntry.nVal );
+ break;
+ default:
+ bOk= false;
+ break;
}
- else if ( (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL)
- || (rEntry.bQueryByString
- && pCellData->HasStringData() )
+ }
+ else if ((rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL)
+ || (rEntry.bQueryByString
+ && pCellData->HasStringData() )
)
- { // by String
- String aCellStr = pCellData->GetString();
+ { // by String
+ String aCellStr = pCellData->GetString();
- sal_Bool bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL)
- || (rEntry.eOp == SC_NOT_EQUAL)));
- sal_Bool bTestRegExp = sal_False;
- if ( bRealRegExp || bTestRegExp )
- {
- xub_StrLen nStart = 0;
- xub_StrLen nEnd = aCellStr.Len();
- sal_Bool bMatch = (sal_Bool) rEntry.GetSearchTextPtr( rParam.bCaseSens )
- ->SearchFrwrd( aCellStr, &nStart, &nEnd );
- // from 614 on, nEnd is behind the found text
- if ( bMatch && bMatchWholeCell
- && (nStart != 0 || nEnd != aCellStr.Len()) )
- bMatch = sal_False; // RegExp must match entire cell string
- if ( bRealRegExp )
- bOk = ((rEntry.eOp == SC_NOT_EQUAL) ? !bMatch : bMatch);
- else
- bTestEqual = bMatch;
- }
- if ( !bRealRegExp )
+ bool bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL)
+ || (rEntry.eOp == SC_NOT_EQUAL)));
+ bool bTestRegExp = false;
+ if (bRealRegExp || bTestRegExp)
+ {
+ xub_StrLen nStart = 0;
+ xub_StrLen nEnd = aCellStr.Len();
+ bool bMatch = (bool) rEntry.GetSearchTextPtr( rParam.bCaseSens )
+ ->SearchFrwrd( aCellStr, &nStart, &nEnd );
+ // from 614 on, nEnd is behind the found text
+ if (bMatch && bMatchWholeCell
+ && (nStart != 0 || nEnd != aCellStr.Len()))
+ bMatch = false; // RegExp must match entire cell string
+ if (bRealRegExp)
+ bOk = ((rEntry.eOp == SC_NOT_EQUAL) ? !bMatch : bMatch);
+ else
+ bTestEqual = bMatch;
+ }
+ if (!bRealRegExp)
+ {
+ if (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL)
{
- if ( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL )
+ if (bMatchWholeCell)
{
- if ( bMatchWholeCell )
+ bOk = pTransliteration->isEqual( aCellStr, *rEntry.pStr );
+ String aStr = *rEntry.pStr;
+ sal_Bool bHasStar = false;
+ xub_StrLen nIndex;
+ if (( nIndex = aStr.Search('*') ) != STRING_NOTFOUND)
+ bHasStar = sal_True;
+ if (bHasStar && (nIndex>0))
{
- bOk = pTransliteration->isEqual( aCellStr, *rEntry.pStr );
- //Added by zhaosz,for sodc_2702,20060808
- String aStr = *rEntry.pStr;//"f*"
- //modified by weihuaw,for SODC_16698
- //use another way to find "*" in aStr
- sal_Bool bHasStar = sal_False;
- xub_StrLen nIndex;
- if( ( nIndex = aStr.Search('*') ) != STRING_NOTFOUND )
- bHasStar = sal_True;
- if(bHasStar && (nIndex>0))
+ for (i=0;(i<nIndex) && (i< aCellStr.Len()) ; i++)
{
- for(i=0;(i<nIndex) && (i< aCellStr.Len()) ; i++)
+ if (aCellStr.GetChar( (sal_uInt16)i ) == aStr.GetChar((sal_uInt16) i ))
{
- if(aCellStr.GetChar( (sal_uInt16)i ) == aStr.GetChar((sal_uInt16) i ))
- {
- bOk=1;
- }
- else
- {
- bOk=0;
- break;
- }
+ bOk=1;
+ }
+ else
+ {
+ bOk=0;
+ break;
}
}
- //end modified
- //Added end,20060808
- }
- else
- {
- ::com::sun::star::uno::Sequence< sal_Int32 > xOff;
- String aCell( pTransliteration->transliterate(
- aCellStr, ScGlobal::eLnge, 0, aCellStr.Len(),
- &xOff ) );
- String aQuer( pTransliteration->transliterate(
- *rEntry.pStr, ScGlobal::eLnge, 0, rEntry.pStr->Len(),
- &xOff ) );
- bOk = (aCell.Search( aQuer ) != STRING_NOTFOUND);
}
- if ( rEntry.eOp == SC_NOT_EQUAL )
- bOk = !bOk;
}
else
- { // use collator here because data was probably sorted
- sal_Int32 nCompare = pCollator->compareString(
- aCellStr, *rEntry.pStr );
- switch (rEntry.eOp)
- {
- case SC_LESS :
- bOk = (nCompare < 0);
- break;
- case SC_GREATER :
- bOk = (nCompare > 0);
- break;
- case SC_LESS_EQUAL :
- bOk = (nCompare <= 0);
- break;
- case SC_GREATER_EQUAL :
- bOk = (nCompare >= 0);
- break;
- case SC_NOT_EQUAL:
- DBG_ASSERT( false , "SC_NOT_EQUAL");
- break;
- case SC_TOPVAL:
- case SC_BOTVAL:
- case SC_TOPPERC:
- case SC_BOTPERC:
- default:
- break;
- }
+ {
+ ::com::sun::star::uno::Sequence< sal_Int32 > xOff;
+ String aCell( pTransliteration->transliterate(
+ aCellStr, ScGlobal::eLnge, 0, aCellStr.Len(),
+ &xOff ) );
+ String aQuer( pTransliteration->transliterate(
+ *rEntry.pStr, ScGlobal::eLnge, 0, rEntry.pStr->Len(),
+ &xOff ) );
+ bOk = (aCell.Search( aQuer ) != STRING_NOTFOUND);
+ }
+ if (rEntry.eOp == SC_NOT_EQUAL)
+ bOk = !bOk;
+ }
+ else
+ { // use collator here because data was probably sorted
+ sal_Int32 nCompare = pCollator->compareString(
+ aCellStr, *rEntry.pStr );
+ switch (rEntry.eOp)
+ {
+ case SC_LESS :
+ bOk = (nCompare < 0);
+ break;
+ case SC_GREATER :
+ bOk = (nCompare > 0);
+ break;
+ case SC_LESS_EQUAL :
+ bOk = (nCompare <= 0);
+ break;
+ case SC_GREATER_EQUAL :
+ bOk = (nCompare >= 0);
+ break;
+ case SC_NOT_EQUAL:
+ DBG_ASSERT( false , "SC_NOT_EQUAL");
+ break;
+ case SC_TOPVAL:
+ case SC_BOTVAL:
+ case SC_TOPPERC:
+ case SC_BOTPERC:
+ default:
+ break;
}
}
}
+ }
- if (nPos == -1)
+ if (nPos == -1)
+ {
+ nPos++;
+ pPasst[nPos] = bOk;
+ pTest[nPos] = bTestEqual;
+ }
+ else
+ {
+ if (rEntry.eConnect == SC_AND)
{
- nPos++;
- pPasst[nPos] = bOk;
- pTest[nPos] = bTestEqual;
+ pPasst[nPos] = pPasst[nPos] && bOk;
+ pTest[nPos] = pTest[nPos] && bTestEqual;
}
else
{
- if (rEntry.eConnect == SC_AND)
- {
- pPasst[nPos] = pPasst[nPos] && bOk;
- pTest[nPos] = pTest[nPos] && bTestEqual;
- }
- else
- {
- nPos++;
- pPasst[nPos] = bOk;
- pTest[nPos] = bTestEqual;
- }
+ nPos++;
+ pPasst[nPos] = bOk;
+ pTest[nPos] = bTestEqual;
}
- i++;
}
+ i++;
+ }
- for ( long j=1; j <= nPos; j++ )
- {
- pPasst[0] = pPasst[0] || pPasst[j];
- pTest[0] = pTest[0] || pTest[j];
- }
+ for (long j=1; j <= nPos; j++)
+ {
+ pPasst[0] = pPasst[0] || pPasst[j];
+ pTest[0] = pTest[0] || pTest[j];
+ }
- sal_Bool bRet = pPasst[0];
- if ( pPasst != &aBool[0] )
- delete [] pPasst;
- if ( pTest != &aTest[0] )
- delete [] pTest;
+ bool bRet = pPasst[0];
+ if (pPasst != &aBool[0])
+ delete [] pPasst;
+ if (pTest != &aTest[0])
+ delete [] pTest;
- return bRet;
+ return bRet;
}
-// -----------------------------------------------------------------------
-bool ScDPTableDataCache::IsRowEmpty( SCROW nRow ) const
+bool ScDPCache::IsRowEmpty( SCROW nRow ) const
{
- return mbEmptyRow[ nRow ];
-
+ return mbEmptyRow[ nRow ];
}
-// -----------------------------------------------------------------------
-bool ScDPTableDataCache::IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const
+bool ScDPCache::IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const
{
- return !GetItemDataById( nColumn, GetItemDataId( nColumn, nRow, sal_False ) )->IsHasData();
+ return !GetItemDataById( nColumn, GetItemDataId( nColumn, nRow, false ) )->IsHasData();
}
-sal_Bool ScDPTableDataCache::AddData(long nDim, ScDPItemData* pitemData)
+bool ScDPCache::AddData(long nDim, ScDPItemData* pitemData)
{
DBG_ASSERT( IsValid(), " IsValid() == false " );
DBG_ASSERT( nDim < mnColumnCount && nDim >=0 , "dimension out of bound" );
SCROW nIndex = 0;
- sal_Bool bInserted = sal_False;
+ bool bInserted = false;
pitemData->SetDate( lcl_isDate( GetNumType( pitemData->nNumFormat ) ) );
- if ( !lcl_Search( mpTableDataValues[nDim], mpGlobalOrder[nDim], *pitemData, nIndex ) )
+ if ( !lcl_Search( maTableDataValues[nDim], maGlobalOrder[nDim], *pitemData, nIndex ) )
{
- mpTableDataValues[nDim].push_back( pitemData );
- mpGlobalOrder[nDim].insert( mpGlobalOrder[nDim].begin()+nIndex, mpTableDataValues[nDim].size()-1 );
- DBG_ASSERT( (size_t) mpGlobalOrder[nDim][nIndex] == mpTableDataValues[nDim].size()-1 ,"ScDPTableDataCache::AddData ");
- mpSourceData[nDim].push_back( mpTableDataValues[nDim].size()-1 );
- bInserted = sal_True;
+ maTableDataValues[nDim].push_back( pitemData );
+ maGlobalOrder[nDim].insert( maGlobalOrder[nDim].begin()+nIndex, maTableDataValues[nDim].size()-1 );
+ DBG_ASSERT( (size_t) maGlobalOrder[nDim][nIndex] == maTableDataValues[nDim].size()-1 ,"ScDPTableDataCache::AddData ");
+ maSourceData[nDim].push_back( maTableDataValues[nDim].size()-1 );
+ bInserted = true;
}
else
- mpSourceData[nDim].push_back( mpGlobalOrder[nDim][nIndex] );
+ maSourceData[nDim].push_back( maGlobalOrder[nDim][nIndex] );
//init empty row tag
- size_t nCurRow = mpSourceData[nDim].size() -1 ;
+ size_t nCurRow = maSourceData[nDim].size() - 1;
while ( mbEmptyRow.size() <= nCurRow )
- mbEmptyRow.push_back( sal_True );
+ mbEmptyRow.push_back( true );
if ( pitemData->IsHasData() )
- mbEmptyRow[ nCurRow ] = sal_False;
+ mbEmptyRow[ nCurRow ] = false;
if ( !bInserted )
delete pitemData;
- return sal_True;
+ return true;
}
-String ScDPTableDataCache::GetDimensionName( sal_uInt16 nColumn ) const
+String ScDPCache::GetDimensionName( sal_uInt16 nColumn ) const
{
- DBG_ASSERT( /* nColumn>=0 && */ nColumn < mrLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName");
- DBG_ASSERT( mrLabelNames.size() == static_cast <sal_uInt16> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName");
- if ( static_cast<size_t>(nColumn+1) < mrLabelNames.size() )
+ DBG_ASSERT(nColumn < maLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName");
+ DBG_ASSERT(maLabelNames.size() == static_cast <sal_uInt16> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName");
+
+ if ( static_cast<size_t>(nColumn+1) < maLabelNames.size() )
{
- return mrLabelNames[nColumn+1]->aString;
+ return maLabelNames[nColumn+1].aString;
}
else
return String();
}
-void ScDPTableDataCache::AddLabel(ScDPItemData *pData)
+void ScDPCache::AddLabel(ScDPItemData *pData)
{
DBG_ASSERT( IsValid(), " IsValid() == false " );
- if ( mrLabelNames.size() == 0 )
- mrLabelNames.push_back( new ScDPItemData( ScGlobal::GetRscString(STR_PIVOT_DATA) ) );
-
+ if ( maLabelNames.size() == 0 )
+ maLabelNames.push_back( new ScDPItemData(ScGlobal::GetRscString(STR_PIVOT_DATA)) );
//reset name if needed
String strNewName = pData->aString;
- sal_Bool bFound = sal_False;
+ bool bFound = false;
long nIndex = 1;
do
{
- for ( long i= mrLabelNames.size()-1; i>=0; i-- )
+ for ( long i= maLabelNames.size()-1; i>=0; i-- )
{
- if( mrLabelNames[i]->aString == strNewName )
+ if( maLabelNames[i].aString == strNewName )
{
strNewName = pData->aString;
strNewName += String::CreateFromInt32( nIndex );
nIndex ++ ;
- bFound = sal_True;
+ bFound = true;
}
}
bFound = !bFound;
@@ -956,58 +864,58 @@ void ScDPTableDataCache::AddLabel(ScDPItemData *pData)
while ( !bFound );
pData->aString = strNewName;
- mrLabelNames.push_back( pData );
+ maLabelNames.push_back( pData );
}
-SCROW ScDPTableDataCache::GetItemDataId(sal_uInt16 nDim, SCROW nRow, sal_Bool bRepeatIfEmpty) const
-{ //
+SCROW ScDPCache::GetItemDataId(sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty) const
+{
DBG_ASSERT( IsValid(), " IsValid() == false " );
DBG_ASSERT( /* nDim >= 0 && */ nDim < mnColumnCount, "ScDPTableDataCache::GetItemDataId " );
if ( bRepeatIfEmpty )
{
- while ( nRow >0 && !mpTableDataValues[nDim][ mpSourceData[nDim][nRow] ]->IsHasData() )
- --nRow;
+ while ( nRow >0 && !maTableDataValues[nDim][ maSourceData[nDim][nRow] ].IsHasData() )
+ --nRow;
}
- return mpSourceData[nDim][nRow];
+ return maSourceData[nDim][nRow];
}
-const ScDPItemData* ScDPTableDataCache::GetItemDataById(long nDim, SCROW nId) const
+const ScDPItemData* ScDPCache::GetItemDataById(long nDim, SCROW nId) const
{
if ( nId >= GetRowCount() )
- return maAdditionalDatas.getData( nId - GetRowCount() );
+ return maAdditionalData.getData( nId - GetRowCount() );
- if ( (size_t)nId >= mpTableDataValues[nDim].size() || nDim >= mnColumnCount || nId < 0 )
+ if ( (size_t)nId >= maTableDataValues[nDim].size() || nDim >= mnColumnCount || nId < 0 )
return NULL;
else
- return mpTableDataValues[nDim][nId];
+ return &maTableDataValues[nDim][nId];
}
-SCROW ScDPTableDataCache::GetRowCount() const
+SCROW ScDPCache::GetRowCount() const
{
if ( IsValid() )
- return mpSourceData[0].size();
+ return maSourceData[0].size();
else
return 0;
}
-const std::vector<ScDPItemData*>& ScDPTableDataCache::GetDimMemberValues(SCCOL nDim) const
+const ScDPCache::DataListType& ScDPCache::GetDimMemberValues(SCCOL nDim) const
{
DBG_ASSERT( nDim>=0 && nDim < mnColumnCount ," nDim < mnColumnCount ");
- return mpTableDataValues[nDim];
+ return maTableDataValues[nDim];
}
-SCROW ScDPTableDataCache::GetSortedItemDataId(SCCOL nDim, SCROW nOrder) const
+SCROW ScDPCache::GetSortedItemDataId(SCCOL nDim, SCROW nOrder) const
{
DBG_ASSERT ( IsValid(), "IsValid");
DBG_ASSERT( nDim>=0 && nDim < mnColumnCount, "nDim < mnColumnCount");
- DBG_ASSERT( nOrder >= 0 && (size_t) nOrder < mpGlobalOrder[nDim].size(), "nOrder < mpGlobalOrder[nDim].size()" );
+ DBG_ASSERT( nOrder >= 0 && (size_t) nOrder < maGlobalOrder[nDim].size(), "nOrder < mpGlobalOrder[nDim].size()" );
- return mpGlobalOrder[nDim][nOrder];
+ return maGlobalOrder[nDim][nOrder];
}
-sal_uLong ScDPTableDataCache::GetNumType(sal_uLong nFormat) const
+sal_uLong ScDPCache::GetNumType(sal_uLong nFormat) const
{
SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
sal_uLong nType = NUMBERFORMAT_NUMBER;
@@ -1016,120 +924,117 @@ sal_uLong ScDPTableDataCache::GetNumType(sal_uLong nFormat) const
return nType;
}
-sal_uLong ScDPTableDataCache::GetNumberFormat( long nDim ) const
+sal_uLong ScDPCache::GetNumberFormat( long nDim ) const
{
if ( nDim >= mnColumnCount )
return 0;
- if ( mpTableDataValues[nDim].size()==0 )
+ if ( maTableDataValues[nDim].size()==0 )
return 0;
else
- return mpTableDataValues[nDim][0]->nNumFormat;
+ return maTableDataValues[nDim][0].nNumFormat;
}
-sal_Bool ScDPTableDataCache::IsDateDimension( long nDim ) const
+bool ScDPCache::IsDateDimension( long nDim ) const
{
if ( nDim >= mnColumnCount )
return false;
- else if ( mpTableDataValues[nDim].size()==0 )
+ else if ( maTableDataValues[nDim].size()==0 )
return false;
else
- return mpTableDataValues[nDim][0]->IsDate();
+ return maTableDataValues[nDim][0].IsDate();
}
-SCROW ScDPTableDataCache::GetDimMemberCount( SCCOL nDim ) const
+SCROW ScDPCache::GetDimMemberCount( SCCOL nDim ) const
{
DBG_ASSERT( nDim>=0 && nDim < mnColumnCount ," ScDPTableDataCache::GetDimMemberCount : out of bound ");
- return mpTableDataValues[nDim].size();
+ return maTableDataValues[nDim].size();
}
-const ScDPItemData* ScDPTableDataCache::GetSortedItemData(SCCOL nDim, SCROW nOrder) const
+const ScDPItemData* ScDPCache::GetSortedItemData(SCCOL nDim, SCROW nOrder) const
{
SCROW n = GetSortedItemDataId( nDim, nOrder );
return GetItemDataById( nDim, n );
}
-SCCOL ScDPTableDataCache::GetDimensionIndex(String sName) const
+SCCOL ScDPCache::GetDimensionIndex(String sName) const
{
- for ( size_t n = 1; n < mrLabelNames.size(); n ++ ) //defects, label name map wrong SODC_17590, SODC_18932,SODC_18827,SODC_18960,SODC_18923
+ for (size_t i = 1; i < maLabelNames.size(); ++i)
{
- if ( mrLabelNames[n]->GetString() == sName )
- return (SCCOL)(n-1);
+ if ( maLabelNames[i].GetString() == sName )
+ return (SCCOL)(i-1);
}
return -1;
}
-SCROW ScDPTableDataCache::GetIdByItemData(long nDim, String sItemData ) const
+SCROW ScDPCache::GetIdByItemData(long nDim, String sItemData ) const
{
if ( nDim < mnColumnCount && nDim >=0 )
{
- for ( size_t n = 0; n< mpTableDataValues[nDim].size(); n++ )
+ for (size_t i = 0; i < maTableDataValues[nDim].size(); ++i)
{
- if ( mpTableDataValues[nDim][n]->GetString() == sItemData )
- return n;
+ if ( maTableDataValues[nDim][i].GetString() == sItemData )
+ return i;
}
}
ScDPItemData rData ( sItemData );
- return GetRowCount() +maAdditionalDatas.getDataId(rData);
+ return GetRowCount() +maAdditionalData.getDataId(rData);
}
-SCROW ScDPTableDataCache::GetIdByItemData( long nDim, const ScDPItemData& rData ) const
+SCROW ScDPCache::GetIdByItemData( long nDim, const ScDPItemData& rData ) const
{
if ( nDim < mnColumnCount && nDim >=0 )
{
- for ( size_t n = 0; n< mpTableDataValues[nDim].size(); n++ )
+ for (size_t i = 0; i < maTableDataValues[nDim].size(); ++i)
{
- if ( *mpTableDataValues[nDim][n] == rData )
- return n;
+ if ( maTableDataValues[nDim][i] == rData )
+ return i;
}
}
- return GetRowCount() + maAdditionalDatas.getDataId(rData);
+ return GetRowCount() + maAdditionalData.getDataId(rData);
}
-SCROW ScDPTableDataCache::GetAdditionalItemID ( String sItemData )
+SCROW ScDPCache::GetAdditionalItemID ( String sItemData ) const
{
ScDPItemData rData ( sItemData );
return GetAdditionalItemID( rData );
}
-SCROW ScDPTableDataCache::GetAdditionalItemID( const ScDPItemData& rData )
+SCROW ScDPCache::GetAdditionalItemID( const ScDPItemData& rData ) const
{
- return GetRowCount() + maAdditionalDatas.insertData( rData );
+ return GetRowCount() + maAdditionalData.insertData( rData );
}
-SCROW ScDPTableDataCache::GetOrder(long nDim, SCROW nIndex) const
+SCROW ScDPCache::GetOrder(long nDim, SCROW nIndex) const
{
DBG_ASSERT( IsValid(), " IsValid() == false " );
DBG_ASSERT( nDim >=0 && nDim < mnColumnCount, "ScDPTableDataCache::GetOrder : out of bound" );
- if ( mpIndexOrder[nDim].size() != mpGlobalOrder[nDim].size() )
+ if ( maIndexOrder[nDim].size() != maGlobalOrder[nDim].size() )
{ //not inited
- SCROW i = 0;
- mpIndexOrder[nDim].resize( mpGlobalOrder[nDim].size(), 0 );
- for ( size_t n = 0 ; n< mpGlobalOrder[nDim].size(); n++ )
+ SCROW nRow = 0;
+ maIndexOrder[nDim].resize(maGlobalOrder[nDim].size(), 0);
+ for (size_t i = 0 ; i < maGlobalOrder[nDim].size(); ++i)
{
- i = mpGlobalOrder[nDim][n];
- mpIndexOrder[nDim][ i ] = n;
+ nRow = maGlobalOrder[nDim][i];
+ maIndexOrder[nDim][nRow] = i;
}
}
- DBG_ASSERT( nIndex>=0 && (size_t)nIndex < mpIndexOrder[nDim].size() , "ScDPTableDataCache::GetOrder");
- return mpIndexOrder[nDim][nIndex];
+ DBG_ASSERT( nIndex>=0 && (size_t)nIndex < maIndexOrder[nDim].size() , "ScDPTableDataCache::GetOrder");
+ return maIndexOrder[nDim][nIndex];
}
-ScDocument* ScDPTableDataCache::GetDoc() const
+ScDocument* ScDPCache::GetDoc() const
{
return mpDoc;
};
-long ScDPTableDataCache::GetColumnCount() const
+long ScDPCache::GetColumnCount() const
{
return mnColumnCount;
}
-long ScDPTableDataCache::GetId() const
-{
- return mnID;
-}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index e7cb9dd2b679..cae8fad17d2c 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,7 @@
#include <math.h>
#include <float.h> //! Test !!!
#include <algorithm>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/sheet/DataResultFlags.hpp>
#include <com/sun/star/sheet/MemberResultFlags.hpp>
@@ -62,7 +63,6 @@
using namespace com::sun::star;
using ::std::vector;
using ::std::pair;
-using ::std::hash_map;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
@@ -102,7 +102,7 @@ namespace {
sal_Bool lcl_SearchMember( const std::vector <ScDPResultMember *>& list, SCROW nOrder, SCROW& rIndex)
{
rIndex = list.size();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCROW nLo = 0;
SCROW nHi = list.size() - 1;
SCROW nIndex;
@@ -178,9 +178,9 @@ static sal_Bool lcl_IsLess( const ScDPDataMember* pDataMember1, const ScDPDataMe
if ( bError1 )
{
if ( bError2 )
- return sal_False; // equal
+ return false; // equal
else
- return sal_False; // errors are always sorted at the end
+ return false; // errors are always sorted at the end
}
else if ( bError2 )
return sal_True; // errors are always sorted at the end
@@ -211,10 +211,10 @@ static sal_Bool lcl_IsEqual( const ScDPDataMember* pDataMember1, const ScDPDataM
if ( bError2 )
return sal_True; // equal
else
- return sal_False;
+ return false;
}
else if ( bError2 )
- return sal_False;
+ return false;
else
{
double fVal1 = ( pAgg1 && pAgg1->HasData() ) ? pAgg1->GetResult() : 0.0; // no data is sorted as 0
@@ -231,14 +231,12 @@ sal_Bool ScDPRowMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 )
{
const ScDPResultMember* pMember1 = rDimension.GetMember(nIndex1);
const ScDPResultMember* pMember2 = rDimension.GetMember(nIndex2);
-// Wang Xu Ming -- 3/17/2009
// make the hide item to the largest order.
if ( !pMember1->IsVisible() || !pMember2->IsVisible() )
return pMember1->IsVisible();
const ScDPDataMember* pDataMember1 = pMember1->GetDataRoot() ;
const ScDPDataMember* pDataMember2 = pMember2->GetDataRoot();
-// End Comments
// GetDataRoot can be NULL if there was no data.
// IsVisible == sal_False can happen after AutoShow.
return lcl_IsLess( pDataMember1, pDataMember2, nMeasure, bAscending );
@@ -248,12 +246,10 @@ sal_Bool ScDPColMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 )
{
ScDPDataMember* pDataMember1 = rDimension.GetMember(nIndex1);
ScDPDataMember* pDataMember2 = rDimension.GetMember(nIndex2);
- // Wang Xu Ming -- 2009-6-17
sal_Bool bHide1 = pDataMember1 && !pDataMember1->IsVisible();
sal_Bool bHide2 = pDataMember2 && !pDataMember2->IsVisible();
if ( bHide1 || bHide2 )
return !bHide1;
- // End Comments
return lcl_IsLess( pDataMember1, pDataMember2, nMeasure, bAscending );
}
@@ -486,7 +482,7 @@ void ScDPAggData::Update( const ScDPValueData& rNext, ScSubTotalFunc eFunc, cons
}
break;
default:
- DBG_ERROR("invalid function");
+ OSL_FAIL("invalid function");
}
}
@@ -510,7 +506,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub
// check the error conditions for the selected function
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
switch (eFunc)
{
case SUBTOTAL_FUNC_SUM:
@@ -534,7 +530,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub
break;
default:
- DBG_ERROR("invalid function");
+ OSL_FAIL("invalid function");
}
// calculate the selected function
@@ -581,7 +577,7 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub
fResult = (fAux - fVal*fVal/(double)(nCount)) / (double)nCount;
break;
default:
- DBG_ERROR("invalid function");
+ OSL_FAIL("invalid function");
}
}
@@ -603,7 +599,6 @@ void ScDPAggData::Calculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSub
if ( bEmpty || bError )
fResult = 0.0; // default, in case the state is later modified
-// fprintf(stdout, "ScDPAggData::Calculate: result = %g\n", fResult);fflush(stdout);
fVal = fResult; // used directly from now on
fAux = 0.0; // used for running total or original result of reference value
}
@@ -693,7 +688,7 @@ void ScDPAggData::Reset()
// -----------------------------------------------------------------------
ScDPRowTotals::ScDPRowTotals() :
- bIsInColRoot( sal_False )
+ bIsInColRoot( false )
{
}
@@ -772,9 +767,9 @@ ScDPResultData::ScDPResultData( ScDPSource* pSrc ) : //! Ref
pMeasRefs( NULL ),
pMeasRefOrient( NULL ),
pMeasNames( NULL ),
- bLateInit( sal_False ),
- bDataAtCol( sal_False ),
- bDataAtRow( sal_False )
+ bLateInit( false ),
+ bDataAtCol( false ),
+ bDataAtRow( false )
{
lcl_ResizePointVector( mpDimMembers , SC_DAPI_MAXFIELDS );
@@ -912,7 +907,7 @@ String ScDPResultData::GetMeasureDimensionName(long nMeasure) const
{
if ( nMeasure < 0 )
{
- DBG_ERROR("GetMeasureDimensionName: negative");
+ OSL_FAIL("GetMeasureDimensionName: negative");
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("***"));
}
@@ -941,7 +936,7 @@ sal_Bool ScDPResultData::IsInGroup( const ScDPItemData& rGroupData, long nGroupI
if ( pData )
return pSource->GetData()->IsInGroup( rGroupData, nGroupIndex, *pData , nBaseIndex );
else
- return sal_False;
+ return false;
}
sal_Bool ScDPResultData::IsInGroup( SCROW nGroupDataId, long nGroupIndex,
const ScDPItemData& rBaseData, long nBaseIndex ) const
@@ -950,7 +945,7 @@ sal_Bool ScDPResultData::IsInGroup( SCROW nGroupDataId, long nGroupIndex,
if ( pGroupData )
return pSource->GetData()->IsInGroup( *pGroupData, nGroupIndex, rBaseData , nBaseIndex );
else
- return sal_False;
+ return false;
}
sal_Bool ScDPResultData::HasCommonElement(/* const ScDPItemData& rFirstData*/SCROW nFirstDataId, long nFirstIndex,
@@ -960,7 +955,7 @@ sal_Bool ScDPResultData::HasCommonElement(/* const ScDPItemData& rFirstData*/SCR
if ( pFirstData )
return pSource->GetData()->HasCommonElement( *pFirstData, nFirstIndex, rSecondData, nSecondIndex );
else
- return sal_False;
+ return false;
}
const ScDPSource* ScDPResultData::GetSource() const
@@ -1007,11 +1002,11 @@ ScDPResultMember::ScDPResultMember( const ScDPResultData* pData, const ScDPPare
aParentDimData( rParentDimData ),
pChildDimension( NULL ),
pDataRoot( NULL ),
- bHasElements( sal_False ),
+ bHasElements( false ),
bForceSubTotal( bForceSub ),
- bHasHiddenDetails( sal_False ),
- bInitialized( sal_False ),
- bAutoHidden( sal_False ),
+ bHasHiddenDetails( false ),
+ bInitialized( false ),
+ bAutoHidden( false ),
nMemberStep( 1 )
{
// pParentLevel/pMemberDesc is 0 for root members
@@ -1022,11 +1017,11 @@ ScDPResultMember::ScDPResultMember( const ScDPResultData* pData,
pResultData( pData ),
pChildDimension( NULL ),
pDataRoot( NULL ),
- bHasElements( sal_False ),
+ bHasElements( false ),
bForceSubTotal( bForceSub ),
- bHasHiddenDetails( sal_False ),
- bInitialized( sal_False ),
- bAutoHidden( sal_False ),
+ bHasHiddenDetails( false ),
+ bInitialized( false ),
+ bAutoHidden( false ),
nMemberStep( 1 )
{
}
@@ -1060,7 +1055,7 @@ sal_Bool ScDPResultMember::IsNamedItem( SCROW nIndex ) const
const ScDPMember* pMemberDesc = GetDPMember();
if (pMemberDesc)
return ((ScDPMember*)pMemberDesc)->IsNamedItem( nIndex );
- return sal_False;
+ return false;
}
bool ScDPResultMember::IsValidEntry( const vector< SCROW >& aMembers ) const
@@ -1098,7 +1093,6 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect
// skip child dimension if details are not shown
if ( GetDPMember() && !GetDPMember()->getShowDetails() )
{
- // Wang Xu Ming -- 2009-6-16
// Show DataLayout dimention
nMemberStep = 1;
while ( nPos < ppDim.size() )
@@ -1107,7 +1101,7 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect
{
if ( !pChildDimension )
pChildDimension = new ScDPResultDimension( pResultData );
- pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , sal_False );
+ pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , false );
return;
}
else
@@ -1116,8 +1110,7 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect
nMemberStep ++;
}
}
- // End Comments
- bHasHiddenDetails = sal_True; // only if there is a next dimension
+ bHasHiddenDetails = true; // only if there is a next dimension
return;
}
@@ -1145,8 +1138,6 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD
// skip child dimension if details are not shown
if ( GetDPMember() && !GetDPMember()->getShowDetails() )
{
- // Wang Xu Ming -- 2009-6-16
- // DataPilot Migration
// Show DataLayout dimention
nMemberStep = 1;
while ( !rParams.IsEnd( nPos ) )
@@ -1159,7 +1150,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD
// #i111462# reset InitChild flag only for this child dimension's LateInitFrom call,
// not for following members of parent dimensions
sal_Bool bWasInitChild = rParams.GetInitChild();
- rParams.SetInitChild( sal_False );
+ rParams.SetInitChild( false );
pChildDimension->LateInitFrom( rParams, pItemData, nPos, rInitState );
rParams.SetInitChild( bWasInitChild );
return;
@@ -1170,8 +1161,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD
nMemberStep ++;
}
}
- // End Comments
- bHasHiddenDetails = sal_True; // only if there is a next dimension
+ bHasHiddenDetails = true; // only if there is a next dimension
return;
}
@@ -1186,7 +1176,7 @@ void ScDPResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPD
sal_Bool ScDPResultMember::IsSubTotalInTitle(long nMeasure) const
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
if ( pChildDimension && /*pParentLevel*/GetParentLevel() &&
/*pParentLevel*/GetParentLevel()->IsOutlineLayout() && /*pParentLevel*/GetParentLevel()->IsSubtotalsAtTop() )
{
@@ -1258,10 +1248,10 @@ sal_Bool ScDPResultMember::IsValid() const
// was member set no invisible at the DataPilotSource?
const ScDPMember* pMemberDesc =GetDPMember();
if ( pMemberDesc && !pMemberDesc->getIsVisible() )
- return sal_False;
+ return false;
if ( bAutoHidden )
- return sal_False;
+ return false;
return sal_True;
}
@@ -1382,7 +1372,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS
sheet::MemberResult* pArray = pSequences->getArray();
DBG_ASSERT( rPos+nSize <= pSequences->getLength(), "bumm" );
- sal_Bool bIsNumeric = sal_False;
+ sal_Bool bIsNumeric = false;
String aName;
if ( pMemberName ) // if pMemberName != NULL, use instead of real member name
aName = *pMemberName;
@@ -1398,7 +1388,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS
{
// Numeric group dimensions use numeric entries for proper sorting,
// but the group titles must be output as text.
- bIsNumeric = sal_False;
+ bIsNumeric = false;
}
String aCaption = aName;
@@ -1439,7 +1429,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS
if ( pParentLevel && pParentLevel->IsAddEmpty() )
++nExtraSpace;
- sal_Bool bTitleLine = sal_False;
+ sal_Bool bTitleLine = false;
if ( pParentLevel && pParentLevel->IsOutlineLayout() )
bTitleLine = sal_True;
@@ -1456,7 +1446,6 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS
if (bRoot) // same sequence for root member
pChildDimension->FillMemberResults( pSequences, rPos, nMeasure );
else
- //pChildDimension->FillMemberResults( pSequences + 1, rPos, nMeasure );
pChildDimension->FillMemberResults( pSequences + nMemberStep/*1*/, rPos, nMeasure );
if ( bTitleLine ) // title row is included in GetSize, so the following
@@ -1489,7 +1478,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS
bool bTotalResult = false;
String aSubStr = aCaption;
aSubStr += ' ';
- aSubStr += pResultData->GetMeasureString(nMemberMeasure, sal_False, eForce, bTotalResult);
+ aSubStr += pResultData->GetMeasureString(nMemberMeasure, false, eForce, bTotalResult);
if (bTotalResult)
{
@@ -1560,7 +1549,7 @@ void ScDPResultMember::FillDataResults( const ScDPResultMember* pRefMember,
if ( pParentLevel && pParentLevel->IsAddEmpty() )
++nExtraSpace;
- sal_Bool bTitleLine = sal_False;
+ sal_Bool bTitleLine = false;
if ( pParentLevel && pParentLevel->IsOutlineLayout() )
bTitleLine = sal_True;
@@ -1843,7 +1832,7 @@ sal_Bool ScDPDataMember::IsVisible() const
if (pResultMember)
return pResultMember->IsVisible();
else
- return sal_False;
+ return false;
}
sal_Bool ScDPDataMember::IsNamedItem( /*const ScDPItemData& r*/SCROW r ) const
@@ -1851,7 +1840,7 @@ sal_Bool ScDPDataMember::IsNamedItem( /*const ScDPItemData& r*/SCROW r ) const
if (pResultMember)
return pResultMember->IsNamedItem(r);
else
- return sal_False;
+ return false;
}
sal_Bool ScDPDataMember::HasHiddenDetails() const
@@ -1859,7 +1848,7 @@ sal_Bool ScDPDataMember::HasHiddenDetails() const
if (pResultMember)
return pResultMember->HasHiddenDetails();
else
- return sal_False;
+ return false;
}
void ScDPDataMember::InitFrom( const ScDPResultDimension* pDim )
@@ -1953,13 +1942,13 @@ sal_Bool ScDPDataMember::HasData( long nMeasure, const ScDPSubTotalState& rSubSt
{
if ( rSubState.eColForce != SUBTOTAL_FUNC_NONE && rSubState.eRowForce != SUBTOTAL_FUNC_NONE &&
rSubState.eColForce != rSubState.eRowForce )
- return sal_False;
+ return false;
- // #74542# HasData can be different between measures!
+ // HasData can be different between measures!
const ScDPAggData* pAgg = GetConstAggData( nMeasure, rSubState );
if (!pAgg)
- return sal_False; //! error?
+ return false; //! error?
return pAgg->HasData();
}
@@ -2042,7 +2031,7 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember,
if ( pRefParentLevel && pRefParentLevel->IsAddEmpty() )
++nExtraSpace;
- sal_Bool bTitleLine = sal_False;
+ sal_Bool bTitleLine = false;
if ( pRefParentLevel && pRefParentLevel->IsOutlineLayout() )
bTitleLine = sal_True;
@@ -2268,7 +2257,6 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
sal_Bool bHasChild = ( pRefChild != NULL );
long nUserSubCount = pRefMember->GetSubTotalCount();
- //if ( nUserSubCount || !bHasChild )
{
// Calculate at least automatic if no subtotals are selected,
// show only own values if there's no child dimension (innermost).
@@ -2367,7 +2355,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
pSelectDim = NULL;
}
- sal_Bool bNoDetailsInRef = sal_False;
+ sal_Bool bNoDetailsInRef = false;
if ( pSelectDim && bRunningTotal )
{
// Running totals:
@@ -2449,7 +2437,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
fTotal += pAggData->GetResult();
pSelectData->SetAuxiliary( fTotal );
pAggData->SetResult( fTotal );
- pAggData->SetEmpty(sal_False); // always display
+ pAggData->SetEmpty(false); // always display
}
}
else
@@ -2509,7 +2497,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
double fOtherResult = pOtherAggData->GetAuxiliary();
double fThisResult = pAggData->GetResult();
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
switch ( eRefType )
{
case sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE:
@@ -2528,7 +2516,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
fThisResult = ( fThisResult - fOtherResult ) / fOtherResult;
break;
default:
- DBG_ERROR("invalid calculation type");
+ OSL_FAIL("invalid calculation type");
}
if ( bError )
{
@@ -2537,7 +2525,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
else
{
pAggData->SetResult(fThisResult);
- pAggData->SetEmpty(sal_False); // always display
+ pAggData->SetEmpty(false); // always display
}
//! errors in data?
}
@@ -2657,10 +2645,7 @@ private:
sal_Bool bIncludeAll;
sal_Bool bIsBase;
long nGroupBase;
- // Wang Xu Ming -- 2009-8-6
- // DataPilot Migration - Cache&&Performance
SCROW nBaseDataId;
- // End Comments
public:
ScDPGroupCompare( const ScDPResultData* pData, const ScDPInitState& rState, long nDimension );
~ScDPGroupCompare() {}
@@ -2738,13 +2723,13 @@ sal_Bool ScDPGroupCompare::TestIncluded( const ScDPMember& rMember )
ScDPResultDimension::ScDPResultDimension( const ScDPResultData* pData ) :
pResultData( pData ),
- bInitialized( sal_False ),
- bIsDataLayout( sal_False ),
- bSortByData( sal_False ),
- bSortAscending( sal_False ),
+ bInitialized( false ),
+ bIsDataLayout( false ),
+ bSortByData( false ),
+ bSortAscending( false ),
nSortMeasure( 0 ),
- bAutoShow( sal_False ),
- bAutoTopItems( sal_False ),
+ bAutoShow( false ),
+ bAutoTopItems( false ),
nAutoMeasure( 0 ),
nAutoCount( 0 )
{
@@ -2765,7 +2750,7 @@ ScDPResultMember *ScDPResultDimension::FindMember( SCROW iData ) const
if( aRes != maMemberHash.end()) {
if ( aRes->second->IsNamedItem( iData ) )
return aRes->second;
- DBG_ERROR("problem! hash result is not the same as IsNamedItem");
+ OSL_FAIL("problem! hash result is not the same as IsNamedItem");
}
unsigned int i;
@@ -2850,7 +2835,6 @@ void ScDPResultDimension::InitFrom( const vector<ScDPDimension*>& ppDim, const v
void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev*/,
const vector<SCROW>& pItemData, size_t nPos,
ScDPInitState& rInitState )
-// End Comments
{
if ( rParams.IsEnd( nPos ) )
return;
@@ -2903,7 +2887,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S
if ( pMembers->IsHasHideDetailsMembers() )
DBG_TRACE ( "HasHideDetailsMembers" );
#endif
- pMembers->SetHasHideDetailsMembers( sal_False );
+ pMembers->SetHasHideDetailsMembers( false );
}
bool bNewAllMembers =(!rParams.IsRow()) || nPos == 0 || bLateInitAllMembers ;
@@ -2940,11 +2924,11 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S
ScDPResultMember* pResultMember = maMemberArray[i];
// check show empty
- sal_Bool bAllChildren = sal_False;
+ sal_Bool bAllChildren = false;
if( bShowEmpty )
{
if ( pResultMember->IsNamedItem( rThisData ) )
- bAllChildren = sal_False;
+ bAllChildren = false;
else
bAllChildren = sal_True;
}
@@ -2959,9 +2943,6 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S
ScDPResultMember* pResultMember = FindMember( rThisData );
if( NULL != pResultMember )
{
- //DBG_TRACE( "ScDPResultDimension::LateInitFrom");
- // DBG_TRACESTR( pResultMember->GetDPMember()->GetNameStr());
-
rInitState.AddMember( nDimSource, pResultMember->GetDataId() );
pResultMember->LateInitFrom( rParams, pItemData, nPos+1, rInitState );
rInitState.RemoveMember();
@@ -3004,7 +2985,6 @@ bool ScDPResultDimension::IsValidEntry( const vector< SCROW >& aMembers ) const
ByteString strTemp ("IsValidEntry: Member not found, DimName = " );
strTemp += ByteString( GetName(), RTL_TEXTENCODING_UTF8 );
DBG_TRACE( strTemp.GetBuffer() );
- // DBG_ERROR("IsValidEntry: Member not found");
#endif
return false;
}
@@ -3030,7 +3010,7 @@ void ScDPResultDimension::ProcessData( const vector< SCROW >& aMembers,
return;
}
- DBG_ERROR("ProcessData: Member not found");
+ OSL_FAIL("ProcessData: Member not found");
}
void ScDPResultDimension::FillMemberResults( uno::Sequence<sheet::MemberResult>* pSequences,
@@ -3049,11 +3029,11 @@ void ScDPResultDimension::FillMemberResults( uno::Sequence<sheet::MemberResult>*
{
bool bTotalResult = false;
String aMbrName = pResultData->GetMeasureDimensionName( nSorted );
- String aMbrCapt = pResultData->GetMeasureString( nSorted, sal_False, SUBTOTAL_FUNC_NONE, bTotalResult );
- maMemberArray[0]->FillMemberResults( pSequences, nPos, nSorted, sal_False, &aMbrName, &aMbrCapt );
+ String aMbrCapt = pResultData->GetMeasureString( nSorted, false, SUBTOTAL_FUNC_NONE, bTotalResult );
+ maMemberArray[0]->FillMemberResults( pSequences, nPos, nSorted, false, &aMbrName, &aMbrCapt );
}
else if ( pMember->IsVisible() )
- pMember->FillMemberResults( pSequences, nPos, nMeasure, sal_False, NULL, NULL );
+ pMember->FillMemberResults( pSequences, nPos, nMeasure, false, NULL, NULL );
// nPos is modified
}
}
@@ -3173,7 +3153,7 @@ void ScDPResultDimension::DoAutoShow( ScDPResultMember* pRefMember )
sal_Bool bContinue = sal_True;
while ( bContinue )
{
- bContinue = sal_False;
+ bContinue = false;
if ( nIncluded < nCount )
{
const ScDPResultMember* pMember2 = maMemberArray[aAutoOrder[nIncluded]];
@@ -3204,7 +3184,7 @@ void ScDPResultDimension::ResetResults()
{
// sort order doesn't matter
ScDPResultMember* pMember = maMemberArray[bIsDataLayout ? 0 : i];
- pMember->ResetResults( sal_False );
+ pMember->ResetResults( false );
}
}
@@ -3334,7 +3314,6 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( const ScDPRelativePo
return pColMember;
}
-// static
ScDPDataMember* ScDPResultDimension::GetColReferenceMember( const ScDPRelativePos* pRelativePos, const String* pName,
long nRefDimPos, const ScDPRunningTotalState& rRunning )
{
@@ -3519,7 +3498,7 @@ void ScDPResultDimension::FillVisibilityData(ScDPResultVisibilityData& rData) co
ScDPDataDimension::ScDPDataDimension( const ScDPResultData* pData ) :
pResultData( pData ),
pResultDimension( NULL ),
- bIsDataLayout( sal_False )
+ bIsDataLayout( false )
{
}
@@ -3581,7 +3560,7 @@ void ScDPDataDimension::ProcessData( const vector< SCROW >& aDataMembers, const
}
}
- DBG_ERROR("ProcessData: Member not found");
+ OSL_FAIL("ProcessData: Member not found");
}
void ScDPDataDimension::FillDataRow( const ScDPResultDimension* pRefDim,
@@ -3726,7 +3705,7 @@ void ScDPDataDimension::DoAutoShow( ScDPResultDimension* pRefDim )
sal_Bool bContinue = sal_True;
while ( bContinue )
{
- bContinue = sal_False;
+ bContinue = false;
if ( nIncluded < nCount )
{
ScDPDataMember* pDataMember2 = aMembers[(sal_uInt16)aAutoOrder[nIncluded]];
@@ -3876,7 +3855,7 @@ void ScDPResultVisibilityData::addVisibleMember(const String& rDimName, const Sc
void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPCacheTable::Criterion>& rFilters) const
{
- typedef hash_map<String, long, ScStringHashCode> FieldNameMapType;
+ typedef boost::unordered_map<String, long, ScStringHashCode> FieldNameMapType;
FieldNameMapType aFieldNames;
ScDPTableData* pData = mpSource->GetData();
long nColumnCount = pData->GetColumnCount();
@@ -3927,8 +3906,6 @@ size_t ScDPResultVisibilityData::MemberHash::operator() (const ScDPItemData& r)
else
return rtl_ustr_hashCode_WithLength(r.GetString().GetBuffer(), r.GetString().Len());
}
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
SCROW ScDPResultMember::GetDataId( ) const
{
const ScDPMember* pMemberDesc = GetDPMember();
@@ -3939,7 +3916,7 @@ SCROW ScDPResultMember::GetDataId( ) const
ScDPResultMember* ScDPResultDimension::AddMember(const ScDPParentDimData &aData )
{
- ScDPResultMember* pMember = new ScDPResultMember( pResultData, aData, sal_False );
+ ScDPResultMember* pMember = new ScDPResultMember( pResultData, aData, false );
SCROW nDataIndex = pMember->GetDataId();
maMemberArray.push_back( pMember );
@@ -3948,33 +3925,12 @@ ScDPResultMember* ScDPResultDimension::AddMember(const ScDPParentDimData &aData
return pMember;
}
-ResultMembers* ScDPResultDimension::GetResultMember( ScDPDimension* pThisDim, ScDPLevel* pThisLevel )
-{
- ResultMembers* pResultMembers = new ResultMembers();
- // global order is used to initialize aMembers, so it doesn't have to be looked at later
- const ScMemberSortOrder& rGlobalOrder = pThisLevel->GetGlobalOrder();
-
- ScDPMembers* pMembers = pThisLevel->GetMembersObject();
- long nMembCount = pMembers->getCount();
- for ( long i=0; i<nMembCount; i++ )
- {
- long nSorted = rGlobalOrder.empty() ? i : rGlobalOrder[i];
- ScDPMember* pMember = pMembers->getByIndex(nSorted);
- if ( NULL == pResultMembers->FindMember( pMember->GetItemDataId() ) )
- {
- ScDPParentDimData* pNew = new ScDPParentDimData( i, pThisDim, pThisLevel, pMember );
- pResultMembers->InsertMember( pNew );
- }
- }
- return pResultMembers;
-}
-
ScDPResultMember* ScDPResultDimension::InsertMember(ScDPParentDimData *pMemberData)
{
SCROW nInsert = 0;
if ( !lcl_SearchMember( maMemberArray, pMemberData->mnOrder , nInsert ) )
{ //Member not exist
- ScDPResultMember* pNew = new ScDPResultMember( pResultData, *pMemberData, sal_False );
+ ScDPResultMember* pNew = new ScDPResultMember( pResultData, *pMemberData, false );
maMemberArray.insert( maMemberArray.begin()+nInsert, pNew );
SCROW nDataIndex = pMemberData->mpMemberDesc->GetItemDataId();
@@ -4018,8 +3974,6 @@ void ScDPResultDimension:: InitWithMembers( LateInitParams& rParams,
}
if ( pResultMember )
{
- // DBG_TRACE( "ScDPResultDimension::InitWithMembers");
- // DBG_TRACESTR( pResultMember->GetDPMember()->GetNameStr());
rInitState.AddMember( nDimSource, pResultMember->GetDataId() );
pResultMember->LateInitFrom( rParams /*ppDim, ppLev*/, pItemData, nPos+1 , rInitState );
rInitState.RemoveMember();
@@ -4044,12 +3998,12 @@ void ResultMembers::InsertMember( ScDPParentDimData* pNew )
}
ResultMembers::ResultMembers():
- mbHasHideDetailsMember( sal_False )
+ mbHasHideDetailsMember( false )
{
}
ResultMembers::~ResultMembers()
{
- for ( DimMemberHash::const_iterator iter = maMemberHash.begin(); iter != maMemberHash.end(); iter++ )
+ for ( DimMemberHash::const_iterator iter = maMemberHash.begin(); iter != maMemberHash.end(); ++iter )
delete iter->second;
}
// -----------------------------------------------------------------------
@@ -4071,9 +4025,6 @@ sal_Bool LateInitParams::IsEnd( size_t nPos ) const
return nPos >= mppDim.size();
}
-// End Comments
-// Wang Xu Ming -- 2009-8-4
-// DataPilot Migration - old defects merge
void ScDPResultDimension::CheckShowEmpty( sal_Bool bShow )
{
long nCount = maMemberArray.size();
@@ -4106,4 +4057,6 @@ void ScDPResultMember::CheckShowEmpty( sal_Bool bShow )
pChildDim->CheckShowEmpty( sal_True );
}
}
-}// End Comments
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 81c85a6acb54..366ca1495dd6 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,13 +37,14 @@
#include <algorithm>
#include <vector>
#include <set>
-#include <hash_map>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
+#include <boost/unordered_map.hpp>
#include <tools/debug.hxx>
#include <rtl/math.hxx>
#include <svl/itemprop.hxx>
#include <svl/intitem.hxx>
+#include <vcl/svapp.hxx>
#include "scitems.hxx"
#include "document.hxx"
@@ -56,7 +58,6 @@
#include "global.hxx"
#include "collect.hxx"
#include "datauno.hxx" // ScDataUnoConversion
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "unonames.hxx"
@@ -76,8 +77,6 @@
using namespace com::sun::star;
using ::std::vector;
using ::std::set;
-using ::std::hash_map;
-using ::std::hash_set;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any;
@@ -112,7 +111,7 @@ sal_Bool lcl_GetBoolFromAny( const uno::Any& aAny )
{
if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN )
return *(sal_Bool*)aAny.getValue();
- return sal_False;
+ return false;
}
void lcl_SetBoolInAny( uno::Any& rAny, sal_Bool bValue )
@@ -131,15 +130,15 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) :
nPageDimCount( 0 ),
bColumnGrand( sal_True ), // default is true
bRowGrand( sal_True ),
- bIgnoreEmptyRows( sal_False ),
- bRepeatIfEmpty( sal_False ),
+ bIgnoreEmptyRows( false ),
+ bRepeatIfEmpty( false ),
nDupCount( 0 ),
pResData( NULL ),
pColResRoot( NULL ),
pRowResRoot( NULL ),
pColResults( NULL ),
pRowResults( NULL ),
- bResultOverflow( sal_False ),
+ bResultOverflow( false ),
mpGrandTotalName(NULL)
{
pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty );
@@ -160,11 +159,6 @@ ScDPSource::~ScDPSource()
delete pResData;
}
-void ScDPSource::SetGrandTotalName(const ::rtl::OUString& rName)
-{
- mpGrandTotalName.reset(new ::rtl::OUString(rName));
-}
-
const ::rtl::OUString* ScDPSource::GetGrandTotalName() const
{
return mpGrandTotalName.get();
@@ -236,7 +230,7 @@ sal_Bool lcl_TestSubTotal( sal_Bool& rAllowed, long nColumn, long* pArray, long
{
// no subtotals for data layout dim, no matter where
if ( pSource->IsDataLayoutDimension(nColumn) )
- rAllowed = sal_False;
+ rAllowed = false;
else
{
// no subtotals if no other dim but data layout follows
@@ -244,12 +238,12 @@ sal_Bool lcl_TestSubTotal( sal_Bool& rAllowed, long nColumn, long* pArray, long
if ( nNextIndex < nCount && pSource->IsDataLayoutDimension(pArray[nNextIndex]) )
++nNextIndex;
if ( nNextIndex >= nCount )
- rAllowed = sal_False;
+ rAllowed = false;
}
return sal_True; // found
}
- return sal_False;
+ return false;
}
sal_Bool ScDPSource::SubTotalAllowed(long nColumn)
@@ -300,13 +294,11 @@ void ScDPSource::SetOrientation(long nColumn, sal_uInt16 nNew)
case sheet::DataPilotFieldOrientation_PAGE:
nPageDims[nPageDimCount++] = nColumn;
break;
- // Wang Xu Ming -- 2009-9-1
// DataPilot Migration - Cache&&Performance
case sheet::DataPilotFieldOrientation_HIDDEN:
break;
- // End Comments
default:
- DBG_ERROR( "ScDPSource::SetOrientation: unexpected orientation" );
+ OSL_FAIL( "ScDPSource::SetOrientation: unexpected orientation" );
break;
}
}
@@ -326,11 +318,6 @@ sal_Bool ScDPSource::IsDateDimension(long nDim)
return pData->IsDateDimension(nDim);
}
-sal_uInt32 ScDPSource::GetNumberFormat(long nDim)
-{
- return pData->GetNumberFormat( nDim );
-}
-
ScDPDimensions* ScDPSource::GetDimensionsObject()
{
if (!pDimensions)
@@ -391,7 +378,7 @@ long ScDPSource::GetSourceDim(long nDim)
}
}
- DBG_ERROR("GetSourceDim: wrong dim");
+ OSL_FAIL("GetSourceDim: wrong dim");
return nDim;
}
@@ -435,13 +422,13 @@ void SAL_CALL ScDPSource::refresh() throw(uno::RuntimeException)
void SAL_CALL ScDPSource::addRefreshListener( const uno::Reference<util::XRefreshListener >& )
throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented"); //! exception?
+ OSL_FAIL("not implemented"); //! exception?
}
void SAL_CALL ScDPSource::removeRefreshListener( const uno::Reference<util::XRefreshListener >& )
throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented"); //! exception?
+ OSL_FAIL("not implemented"); //! exception?
}
Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<sheet::DataPilotFieldFilter>& aFilters)
@@ -449,7 +436,7 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s
{
long nColumnCount = GetData()->GetColumnCount();
- typedef hash_map<String, long, ScStringHashCode> FieldNameMapType;
+ typedef boost::unordered_map<String, long, ScStringHashCode> FieldNameMapType;
FieldNameMapType aFieldNames;
for (long i = 0; i < nColumnCount; ++i)
{
@@ -492,7 +479,7 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s
aResVisData.fillFieldFilters(aFilterCriteria);
Sequence< Sequence<Any> > aTabData;
- hash_set<sal_Int32> aCatDims;
+ boost::unordered_set<sal_Int32> aCatDims;
GetCategoryDimensionIndices(aCatDims);
pData->GetDrillDownData(aFilterCriteria, aCatDims, aTabData);
return aTabData;
@@ -574,8 +561,8 @@ void ScDPSource::disposeData()
delete[] pRowResults;
pColResults = NULL;
pRowResults = NULL;
- aColLevelList.Clear();
- aRowLevelList.Clear();
+ aColLevelList.clear();
+ aRowLevelList.clear();
}
if ( pDimensions )
@@ -589,7 +576,7 @@ void ScDPSource::disposeData()
nColDimCount = nRowDimCount = nDataDimCount = nPageDimCount = 0;
pData->DisposeData(); // cached entries etc.
- bResultOverflow = sal_False;
+ bResultOverflow = false;
}
long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLevel, long nLevels )
@@ -607,11 +594,11 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL
if ( nPos+1 < nLevels && ppDim[nPos] == ppDim[nPos+1] )
{
- DBG_ERROR("lcl_CountMinMembers: multiple levels from one dimension not implemented");
+ OSL_FAIL("lcl_CountMinMembers: multiple levels from one dimension not implemented");
return 0;
}
- sal_Bool bDo = sal_False;
+ sal_Bool bDo = false;
if ( ppDim[nPos]->getIsDataLayoutDimension() )
{
// data layout dim doesn't interfere with "show all" flags
@@ -625,7 +612,7 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL
if ( !ppLevel[nPos]->getShowEmpty() )
{
// this level is counted, following ones are not
- bWasShowAll = sal_False;
+ bWasShowAll = false;
}
}
if ( bDo )
@@ -712,9 +699,9 @@ void ScDPSource::FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool
}
}
-void ScDPSource::GetCategoryDimensionIndices(hash_set<sal_Int32>& rCatDims)
+void ScDPSource::GetCategoryDimensionIndices(boost::unordered_set<sal_Int32>& rCatDims)
{
- hash_set<sal_Int32> aCatDims;
+ boost::unordered_set<sal_Int32> aCatDims;
for (long i = 0; i < nColDimCount; ++i)
{
sal_Int32 nDim = static_cast<sal_Int32>(nColDims[i]);
@@ -784,7 +771,7 @@ void ScDPSource::FilterCacheTableByPageDimensions()
}
if (!aCriteria.empty())
{
- hash_set<sal_Int32> aCatDims;
+ boost::unordered_set<sal_Int32> aCatDims;
GetCategoryDimensionIndices(aCatDims);
pData->FilterCacheTable(aCriteria, aCatDims);
}
@@ -859,7 +846,7 @@ void ScDPSource::CreateRes_Impl()
// need fully initialized results to find reference values
// (both in column or row dimensions), so updated values or
// differences to 0 can be displayed even for empty results.
- bLateInit = sal_False;
+ bLateInit = false;
}
}
@@ -905,8 +892,8 @@ void ScDPSource::CreateRes_Impl()
aInitState.AddMember( nPageDims[i], GetMemberId( nPageDims[i], pDim->GetSelectedData() ) );
}
- pColResRoot = new ScDPResultMember( pResData, /*NULL, NULL, NULL, */bColumnGrand );
- pRowResRoot = new ScDPResultMember( pResData, /*NULL, NULL, NULL, */bRowGrand );
+ pColResRoot = new ScDPResultMember( pResData, bColumnGrand );
+ pRowResRoot = new ScDPResultMember( pResData, bRowGrand );
FillCalcInfo(false, aInfo, bHasAutoShow);
long nColLevelCount = aInfo.aColLevels.size();
@@ -920,7 +907,7 @@ void ScDPSource::CreateRes_Impl()
if ( nRowLevelCount > 0 )
{
// disable layout flags for the innermost row field (level)
- aInfo.aRowLevels[nRowLevelCount-1]->SetEnableLayout( sal_False );
+ aInfo.aRowLevels[nRowLevelCount-1]->SetEnableLayout( false );
}
pRowResRoot->InitFrom( aInfo.aRowDims, aInfo.aRowLevels, 0, aInitState );
@@ -1010,20 +997,10 @@ void ScDPSource::CreateRes_Impl()
}
}
-//UNUSED2009-05 void ScDPSource::DumpState( ScDocument* pDoc, const ScAddress& rPos )
-//UNUSED2009-05 {
-//UNUSED2009-05 CreateRes_Impl();
-//UNUSED2009-05
-//UNUSED2009-05 ScAddress aDocPos( rPos );
-//UNUSED2009-05
-//UNUSED2009-05 if (pColResRoot->GetChildDimension())
-//UNUSED2009-05 pColResRoot->GetChildDimension()->DumpState( NULL, pDoc, aDocPos );
-//UNUSED2009-05 pRowResRoot->DumpState( pColResRoot, pDoc, aDocPos );
-//UNUSED2009-05 }
-void ScDPSource::FillLevelList( sal_uInt16 nOrientation, List& rList )
+void ScDPSource::FillLevelList( sal_uInt16 nOrientation, std::vector<ScDPLevel*> &rList )
{
- rList.Clear();
+ rList.clear();
long nDimCount = 0;
long* pDimIndex = NULL;
@@ -1046,12 +1023,12 @@ void ScDPSource::FillLevelList( sal_uInt16 nOrientation, List& rList )
nDimCount = nPageDimCount;
break;
default:
- DBG_ERROR( "ScDPSource::FillLevelList: unexpected orientation" );
+ OSL_FAIL( "ScDPSource::FillLevelList: unexpected orientation" );
break;
}
if (!pDimIndex)
{
- DBG_ERROR("invalid orientation");
+ OSL_FAIL("invalid orientation");
return;
}
@@ -1071,7 +1048,7 @@ void ScDPSource::FillLevelList( sal_uInt16 nOrientation, List& rList )
for (long nLev=0; nLev<nLevCount; nLev++)
{
ScDPLevel* pLevel = pLevels->getByIndex(nLev);
- rList.Insert( pLevel, LIST_APPEND );
+ rList.push_back(pLevel);
}
}
}
@@ -1090,7 +1067,7 @@ void ScDPSource::FillMemberResults()
}
FillLevelList( sheet::DataPilotFieldOrientation_COLUMN, aColLevelList );
- long nColLevelCount = aColLevelList.Count();
+ long nColLevelCount = aColLevelList.size();
if (nColLevelCount)
{
long nColDimSize = pColResRoot->GetSize(pResData->GetColStartMeasure());
@@ -1098,15 +1075,13 @@ void ScDPSource::FillMemberResults()
for (long i=0; i<nColLevelCount; i++)
pColResults[i].realloc(nColDimSize);
- // ScDPResultDimension* pColResDim = pColResRoot->GetChildDimension();
- // pColResDim->FillMemberResults( pColResults, 0, pResData->GetColStartMeasure() );
long nPos = 0;
pColResRoot->FillMemberResults( pColResults, nPos, pResData->GetColStartMeasure(),
sal_True, NULL, NULL );
}
FillLevelList( sheet::DataPilotFieldOrientation_ROW, aRowLevelList );
- long nRowLevelCount = aRowLevelList.Count();
+ long nRowLevelCount = aRowLevelList.size();
if (nRowLevelCount)
{
long nRowDimSize = pRowResRoot->GetSize(pResData->GetRowStartMeasure());
@@ -1114,8 +1089,6 @@ void ScDPSource::FillMemberResults()
for (long i=0; i<nRowLevelCount; i++)
pRowResults[i].realloc(nRowDimSize);
- // ScDPResultDimension* pRowResDim = pRowResRoot->GetChildDimension();
- // pRowResDim->FillMemberResults( pRowResults, 0, pResData->GetRowStartMeasure() );
long nPos = 0;
pRowResRoot->FillMemberResults( pRowResults, nPos, pResData->GetRowStartMeasure(),
sal_True, NULL, NULL );
@@ -1127,18 +1100,18 @@ const uno::Sequence<sheet::MemberResult>* ScDPSource::GetMemberResults( ScDPLeve
{
FillMemberResults();
- long i;
- long nColCount = aColLevelList.Count();
+ long i = 0;
+ long nColCount = aColLevelList.size();
for (i=0; i<nColCount; i++)
{
- ScDPLevel* pColLevel = (ScDPLevel*)aColLevelList.GetObject(i);
+ ScDPLevel* pColLevel = aColLevelList[i];
if ( pColLevel == pLevel )
return pColResults+i;
}
- long nRowCount = aRowLevelList.Count();
+ long nRowCount = aRowLevelList.size();
for (i=0; i<nRowCount; i++)
{
- ScDPLevel* pRowLevel = (ScDPLevel*)aRowLevelList.GetObject(i);
+ ScDPLevel* pRowLevel = aRowLevelList[i];
if ( pRowLevel == pLevel )
return pRowResults+i;
}
@@ -1150,7 +1123,7 @@ const uno::Sequence<sheet::MemberResult>* ScDPSource::GetMemberResults( ScDPLeve
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPSource::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
using beans::PropertyAttribute::READONLY;
static SfxItemPropertyMapEntry aDPSourceMap_Impl[] =
@@ -1193,7 +1166,7 @@ void SAL_CALL ScDPSource::setPropertyValue( const rtl::OUString& aPropertyName,
}
else
{
- DBG_ERROR("unknown property");
+ OSL_FAIL("unknown property");
//! THROW( UnknownPropertyException() );
}
}
@@ -1227,7 +1200,7 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const rtl::OUString& aPropertyNa
}
else
{
- DBG_ERROR("unknown property");
+ OSL_FAIL("unknown property");
//! THROW( UnknownPropertyException() );
}
return aRet;
@@ -1320,7 +1293,7 @@ sal_Bool SAL_CALL ScDPDimensions::hasByName( const rtl::OUString& aName ) throw(
for (long i=0; i<nCount; i++)
if ( getByIndex(i)->getName() == aName )
return sal_True;
- return sal_False;
+ return false;
}
uno::Type SAL_CALL ScDPDimensions::getElementType() throw(uno::RuntimeException)
@@ -1375,7 +1348,7 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) :
mpLayoutName(NULL),
mpSubtotalName(NULL),
nSourceDim( -1 ),
- bHasSelectedPage( sal_False ),
+ bHasSelectedPage( false ),
pSelectedData( NULL ),
mbHasHiddenMember(false)
{
@@ -1475,7 +1448,6 @@ long ScDPDimension::getUsedHierarchy() const
void ScDPDimension::setUsedHierarchy(long /* nNew */)
{
// #i52547# don't use the incomplete date hierarchy implementation - ignore the call
- // nUsedHier = nNew;
}
ScDPDimension* ScDPDimension::CreateCloneObject()
@@ -1539,39 +1511,18 @@ const ScDPItemData& ScDPDimension::GetSelectedData()
}
if ( !pSelectedData )
- pSelectedData = new ScDPItemData( aSelectedPage, 0.0, sal_False ); // default - name only
+ pSelectedData = new ScDPItemData( aSelectedPage, 0.0, false ); // default - name only
}
return *pSelectedData;
}
-//UNUSED2009-05 sal_Bool ScDPDimension::IsValidPage( const ScDPItemData& rData )
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( bHasSelectedPage )
-//UNUSED2009-05 return rData.IsCaseInsEqual( GetSelectedData() );
-//UNUSED2009-05
-//UNUSED2009-05 return sal_True; // no selection -> all data
-//UNUSED2009-05 }
-
-sal_Bool ScDPDimension::IsVisible( const ScDPItemData& rData )
-{
- if( ScDPMembers* pMembers = this->GetHierarchiesObject()->getByIndex(0)->
- GetLevelsObject()->getByIndex(0)->GetMembersObject() )
- {
- for( long i = pMembers->getCount()-1; i>=0; i-- )
- if( ScDPMember *pDPMbr = pMembers->getByIndex( i ) )
- if( rData.IsCaseInsEqual( pDPMbr->GetItemData() ) && !pDPMbr->getIsVisible() )
- return sal_False;
- }
-
- return sal_True;
-}
// XPropertySet
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPDimension::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static SfxItemPropertyMapEntry aDPDimensionMap_Impl[] =
{
@@ -1629,7 +1580,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam
aValue >>= aReferenceValue;
else if ( aNameStr.EqualsAscii( SC_UNO_FILTER ) )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
uno::Sequence<sheet::TableFilterField> aSeq;
if (aValue >>= aSeq)
{
@@ -1637,7 +1588,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam
if ( nLength == 0 )
{
aSelectedPage.Erase();
- bHasSelectedPage = sal_False;
+ bHasSelectedPage = false;
bDone = sal_True;
}
else if ( nLength == 1 )
@@ -1653,7 +1604,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam
}
if ( !bDone )
{
- DBG_ERROR("Filter property is not a single string");
+ OSL_FAIL("Filter property is not a single string");
throw lang::IllegalArgumentException();
}
DELETEZ( pSelectedData ); // invalid after changing aSelectedPage
@@ -1674,7 +1625,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam
aValue >>= mbHasHiddenMember;
else
{
- DBG_ERROR("unknown property");
+ OSL_FAIL("unknown property");
//! THROW( UnknownPropertyException() );
}
}
@@ -1742,16 +1693,16 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert
{
// single filter field: first field equal to selected string
sheet::TableFilterField aField( sheet::FilterConnection_AND, 0,
- sheet::FilterOperator_EQUAL, sal_False, 0.0, aSelectedPage );
+ sheet::FilterOperator_EQUAL, false, 0.0, aSelectedPage );
aRet <<= uno::Sequence<sheet::TableFilterField>( &aField, 1 );
}
else
aRet <<= uno::Sequence<sheet::TableFilterField>(0);
}
else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME))
- aRet <<= mpLayoutName.get() ? *mpLayoutName : OUString::createFromAscii("");
+ aRet <<= mpLayoutName.get() ? *mpLayoutName : OUString(RTL_CONSTASCII_USTRINGPARAM(""));
else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME))
- aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii("");
+ aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString(RTL_CONSTASCII_USTRINGPARAM(""));
else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER))
aRet <<= mbHasHiddenMember;
else if (aNameStr.EqualsAscii(SC_UNO_FLAGS))
@@ -1761,7 +1712,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert
}
else
{
- DBG_ERROR("unknown property");
+ OSL_FAIL("unknown property");
//! THROW( UnknownPropertyException() );
}
return aRet;
@@ -1778,14 +1729,7 @@ ScDPHierarchies::ScDPHierarchies( ScDPSource* pSrc, long nD ) :
{
//! hold pSource
-#if 0
// date columns have 3 hierarchies (flat/quarter/week), other columns only one
- long nSrcDim = pSource->GetSourceDim( nDim );
- if ( pSource->IsDateDimension( nSrcDim ) )
- nHierCount = SC_DAPI_DATE_HIERARCHIES;
- else
- nHierCount = 1;
-#endif
// #i52547# don't offer the incomplete date hierarchy implementation
nHierCount = 1;
@@ -1821,7 +1765,6 @@ uno::Any SAL_CALL ScDPHierarchies::getByName( const rtl::OUString& aName )
}
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScDPHierarchies::getElementNames() throw(uno::RuntimeException)
@@ -1840,7 +1783,7 @@ sal_Bool SAL_CALL ScDPHierarchies::hasByName( const rtl::OUString& aName ) throw
for (long i=0; i<nCount; i++)
if ( getByIndex(i)->getName() == aName )
return sal_True;
- return sal_False;
+ return false;
}
uno::Type SAL_CALL ScDPHierarchies::getElementType() throw(uno::RuntimeException)
@@ -1935,7 +1878,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScDPHierarchy::getLevels()
aRet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Week"));
break; //! name ???????
default:
- DBG_ERROR( "ScDPHierarchy::getName: unexpected hierarchy" );
+ OSL_FAIL( "ScDPHierarchy::getName: unexpected hierarchy" );
break;
}
return aRet;
@@ -1943,7 +1886,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScDPHierarchy::getLevels()
void SAL_CALL ScDPHierarchy::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented"); //! exception?
+ OSL_FAIL("not implemented"); //! exception?
}
// -----------------------------------------------------------------------
@@ -1967,7 +1910,7 @@ ScDPLevels::ScDPLevels( ScDPSource* pSrc, long nD, long nH ) :
case SC_DAPI_HIERARCHY_QUARTER: nLevCount = SC_DAPI_QUARTER_LEVELS; break;
case SC_DAPI_HIERARCHY_WEEK: nLevCount = SC_DAPI_WEEK_LEVELS; break;
default:
- DBG_ERROR("wrong hierarchy");
+ OSL_FAIL("wrong hierarchy");
nLevCount = 0;
}
}
@@ -2005,7 +1948,6 @@ uno::Any SAL_CALL ScDPLevels::getByName( const rtl::OUString& aName )
}
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScDPLevels::getElementNames() throw(uno::RuntimeException)
@@ -2024,7 +1966,7 @@ sal_Bool SAL_CALL ScDPLevels::hasByName( const rtl::OUString& aName ) throw(uno:
for (long i=0; i<nCount; i++)
if ( getByIndex(i)->getName() == aName )
return sal_True;
- return sal_False;
+ return false;
}
uno::Type SAL_CALL ScDPLevels::getElementType() throw(uno::RuntimeException)
@@ -2105,11 +2047,11 @@ ScDPLevel::ScDPLevel( ScDPSource* pSrc, long nD, long nH, long nL ) :
nHier( nH ),
nLev( nL ),
pMembers( NULL ),
- bShowEmpty( sal_False ),
+ bShowEmpty( false ),
aSortInfo( EMPTY_STRING, sal_True, sheet::DataPilotFieldSortMode::NAME ), // default: sort by name
nSortMeasure( 0 ),
nAutoMeasure( 0 ),
- bEnableLayout( sal_False )
+ bEnableLayout( false )
{
//! hold pSource
// aSubTotals is empty
@@ -2151,7 +2093,6 @@ void ScDPLevel::EvaluateSortOrder()
ScDPMembers* pLocalMembers = GetMembersObject();
long nCount = pLocalMembers->getCount();
-// DBG_ASSERT( aGlobalOrder.empty(), "sort twice?" );
aGlobalOrder.resize( nCount );
for (long nPos=0; nPos<nCount; nPos++)
aGlobalOrder[nPos] = nPos;
@@ -2236,7 +2177,7 @@ uno::Sequence<sheet::MemberResult> SAL_CALL ScDPLevel::getResults() throw(uno::R
aRet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Day"));
break;
default:
- DBG_ERROR( "ScDPLevel::getName: unexpected level" );
+ OSL_FAIL( "ScDPLevel::getName: unexpected level" );
break;
}
}
@@ -2254,7 +2195,7 @@ uno::Sequence<sheet::MemberResult> SAL_CALL ScDPLevel::getResults() throw(uno::R
aRet = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Weekday"));
break;
default:
- DBG_ERROR( "ScDPLevel::getName: unexpected level" );
+ OSL_FAIL( "ScDPLevel::getName: unexpected level" );
break;
}
}
@@ -2271,7 +2212,7 @@ uno::Sequence<sheet::MemberResult> SAL_CALL ScDPLevel::getResults() throw(uno::R
void SAL_CALL ScDPLevel::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented"); //! exception?
+ OSL_FAIL("not implemented"); //! exception?
}
uno::Sequence<sheet::GeneralFunction> ScDPLevel::getSubTotals() const
@@ -2306,7 +2247,7 @@ void ScDPLevel::setShowEmpty(sal_Bool bSet)
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPLevel::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static SfxItemPropertyMapEntry aDPLevelMap_Impl[] =
{
@@ -2345,8 +2286,7 @@ void SAL_CALL ScDPLevel::setPropertyValue( const rtl::OUString& aPropertyName, c
aValue >>= aLayoutInfo;
else
{
- DBG_ERROR("unknown property");
- //! THROW( UnknownPropertyException() );
+ OSL_FAIL("unknown property");
}
}
@@ -2385,8 +2325,7 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const rtl::OUString& aPropertyNam
}
else
{
- DBG_ERROR("unknown property");
- //! THROW( UnknownPropertyException() );
+ OSL_FAIL("unknown property");
}
return aRet;
}
@@ -2416,7 +2355,6 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) :
{
case SC_DAPI_LEVEL_YEAR:
{
- // Wang Xu Ming - DataPilot migration
const ScDPItemData* pLastNumData = NULL;
for ( SCROW n = 0 ;n <GetSrcItemsCount() ; n-- )
{
@@ -2426,7 +2364,6 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) :
else
pLastNumData = pData;
}
- // End Comments
if ( pLastNumData )
{
@@ -2451,7 +2388,7 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) :
case SC_DAPI_LEVEL_MONTH: nMbrCount = 12; break;
case SC_DAPI_LEVEL_DAY: nMbrCount = 31; break;
default:
- DBG_ERROR( "ScDPMembers::ScDPMembers: unexpected level" );
+ OSL_FAIL( "ScDPMembers::ScDPMembers: unexpected level" );
break;
}
}
@@ -2463,7 +2400,7 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) :
case SC_DAPI_LEVEL_WEEK: nMbrCount = 53; break;
case SC_DAPI_LEVEL_WEEKDAY: nMbrCount = 7; break;
default:
- DBG_ERROR( "ScDPMembers::ScDPMembers: unexpected level" );
+ OSL_FAIL( "ScDPMembers::ScDPMembers: unexpected level" );
break;
}
}
@@ -2519,7 +2456,6 @@ uno::Any SAL_CALL ScDPMembers::getByName( const rtl::OUString& aName )
}
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScDPMembers::getElementNames() throw(uno::RuntimeException)
@@ -2616,13 +2552,11 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const
{
//! cache year range here!
- // Wang Xu Ming - DataPilot migration
double fFirstVal = pSource->GetData()->GetMemberByIndex( nSrcDim, 0 )->GetValue();
long nFirstYear = pSource->GetData()->GetDatePart(
(long)::rtl::math::approxFloor( fFirstVal ),
nHier, nLev );
- // End Comments
nVal = nFirstYear + nIndex;
}
else if ( nHier == SC_DAPI_HIERARCHY_WEEK && nLev == SC_DAPI_LEVEL_WEEKDAY )
@@ -2687,22 +2621,6 @@ ScDPMember::~ScDPMember()
//! release pSource
}
-sal_Bool ScDPMember::IsNamedItem( const ScDPItemData& r ) const
-{
- long nSrcDim = pSource->GetSourceDim( nDim );
- if ( nHier != SC_DAPI_HIERARCHY_FLAT && pSource->IsDateDimension( nSrcDim ) && r.IsValue() )
- {
- long nComp = pSource->GetData()->GetDatePart(
- (long)::rtl::math::approxFloor( r.GetValue() ),
- nHier, nLev );
-
- // fValue is converted from integer, so simple comparison works
- return nComp == GetItemData().GetValue();
- }
-
- return r.IsCaseInsEqual( GetItemData() );
-}
-
sal_Bool ScDPMember::IsNamedItem( SCROW nIndex ) const
{
long nSrcDim = pSource->GetSourceDim( nDim );
@@ -2771,7 +2689,7 @@ String ScDPMember::GetNameStr() const
void SAL_CALL ScDPMember::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented"); //! exception?
+ OSL_FAIL("not implemented"); //! exception?
}
sal_Bool ScDPMember::getIsVisible() const
@@ -2811,7 +2729,7 @@ void ScDPMember::setPosition(sal_Int32 nNew)
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPMember::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static SfxItemPropertyMapEntry aDPMemberMap_Impl[] =
{
@@ -2850,8 +2768,7 @@ void SAL_CALL ScDPMember::setPropertyValue( const rtl::OUString& aPropertyName,
}
else
{
- DBG_ERROR("unknown property");
- //! THROW( UnknownPropertyException() );
+ OSL_FAIL("unknown property");
}
}
@@ -2871,8 +2788,7 @@ uno::Any SAL_CALL ScDPMember::getPropertyValue( const rtl::OUString& aPropertyNa
aRet <<= mpLayoutName.get() ? *mpLayoutName : rtl::OUString();
else
{
- DBG_ERROR("unknown property");
- //! THROW( UnknownPropertyException() );
+ OSL_FAIL("unknown property");
}
return aRet;
}
@@ -2880,10 +2796,10 @@ uno::Any SAL_CALL ScDPMember::getPropertyValue( const rtl::OUString& aPropertyNa
SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDPMember )
-ScDPTableDataCache* ScDPSource::GetCache()
+const ScDPCache* ScDPSource::GetCache()
{
DBG_ASSERT( GetData() , "empty ScDPTableData pointer");
- return ( GetData()!=NULL) ? GetData()->GetCacheTable().GetCache() : NULL ;
+ return ( GetData()!=NULL) ? GetData()->GetCacheTable().getCache() : NULL ;
}
const ScDPItemData& ScDPMember::GetItemData() const
@@ -2923,5 +2839,5 @@ const ScDPItemData* ScDPMembers::GetSrcItemDataByIndex( SCROW nIndex)
{
return pSource->GetData()->GetColumnEntries( nDim ).size();
}
-// End Comments
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx
index d4de55f4942f..ff18ac6e05e9 100644
--- a/sc/source/core/data/drawpage.cxx
+++ b/sc/source/core/data/drawpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,7 @@
// -----------------------------------------------------------------------
-ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, sal_Bool bMasterPage) :
+ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, bool bMasterPage) :
FmFormPage(rNewModel, pBasic, bMasterPage)
{
SetSize( Size( LONG_MAX, LONG_MAX ) );
@@ -51,7 +52,7 @@ ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, sal_Bool bMast
// -----------------------------------------------------------------------
-__EXPORT ScDrawPage::~ScDrawPage()
+ScDrawPage::~ScDrawPage()
{
}
@@ -63,3 +64,4 @@ __EXPORT ScDrawPage::~ScDrawPage()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index e3b75436f72c..fbc2ea0814c9 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,6 +69,9 @@
#include <vcl/svapp.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+
#include "drwlayer.hxx"
#include "drawpage.hxx"
#include "global.hxx"
@@ -82,11 +86,12 @@
#include "attrib.hxx"
#include "charthelper.hxx"
+#include <vcl/field.hxx>
+
#define DET_ARROW_OFFSET 1000
// Abstand zur naechsten Zelle beim Loeschen (bShrink), damit der Anker
// immer an der richtigen Zelle angezeigt wird
-//#define SHRINK_DIST 3
// und noch etwas mehr, damit das Objekt auch sichtbar in der Zelle liegt
#define SHRINK_DIST 25
@@ -104,9 +109,8 @@ static E3dObjFactory* pF3d = NULL;
static sal_uInt16 nInst = 0;
SfxObjectShell* ScDrawLayer::pGlobalDrawPersist = NULL;
-//REMOVE SvPersist* ScDrawLayer::pGlobalDrawPersist = NULL;
-sal_Bool bDrawIsInUndo = sal_False; //! Member
+sal_Bool bDrawIsInUndo = false; //! Member
// -----------------------------------------------------------------------
@@ -120,7 +124,7 @@ ScUndoObjData::ScUndoObjData( SdrObject* pObjP, const ScAddress& rOS, const ScAd
{
}
-__EXPORT ScUndoObjData::~ScUndoObjData()
+ScUndoObjData::~ScUndoObjData()
{
}
@@ -135,7 +139,7 @@ void ScUndoObjData::Undo()
}
}
-void __EXPORT ScUndoObjData::Redo()
+void ScUndoObjData::Redo()
{
ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj );
DBG_ASSERT(pData,"ScUndoObjData: Daten nicht da");
@@ -153,7 +157,7 @@ ScTabDeletedHint::ScTabDeletedHint( SCTAB nTabNo ) :
{
}
-__EXPORT ScTabDeletedHint::~ScTabDeletedHint()
+ScTabDeletedHint::~ScTabDeletedHint()
{
}
@@ -162,7 +166,7 @@ ScTabSizeChangedHint::ScTabSizeChangedHint( SCTAB nTabNo ) :
{
}
-__EXPORT ScTabSizeChangedHint::~ScTabSizeChangedHint()
+ScTabSizeChangedHint::~ScTabSizeChangedHint()
{
}
@@ -170,16 +174,26 @@ __EXPORT ScTabSizeChangedHint::~ScTabSizeChangedHint()
#define MAXMM 10000000
+inline long TwipsToHmm (long nVal)
+{
+ return static_cast< long >( MetricField::ConvertDoubleValue (static_cast<sal_Int64>(nVal), 0, 0,
+ FUNIT_TWIP, FUNIT_100TH_MM) );
+}
+
+inline long HmmToTwips (long nVal)
+{
+ return static_cast< long > ( MetricField::ConvertDoubleValue (static_cast<sal_Int64>(nVal), 0, 0,
+ FUNIT_100TH_MM, FUNIT_TWIP) );
+}
+
inline void TwipsToMM( long& nVal )
{
- nVal = (long) ( nVal * HMM_PER_TWIPS );
+ nVal = TwipsToHmm (nVal);
}
inline void ReverseTwipsToMM( long& nVal )
{
- // reverse the effect of TwipsToMM - round up here (add 1)
-
- nVal = ((long) ( nVal / HMM_PER_TWIPS )) + 1;
+ nVal = HmmToTwips (nVal);
}
void lcl_TwipsToMM( Point& rPoint )
@@ -215,9 +229,9 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
aName( rName ),
pDoc( pDocument ),
pUndoGroup( NULL ),
- bRecording( sal_False ),
+ bRecording( false ),
bAdjustEnabled( sal_True ),
- bHyphenatorSet( sal_False )
+ bHyphenatorSet( false )
{
pGlobalDrawPersist = NULL; // nur einmal benutzen
@@ -248,13 +262,13 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
rPool.SetPoolDefaultItem(SdrShadowXDistItem(300));
rPool.SetPoolDefaultItem(SdrShadowYDistItem(300));
- // #111216# default for script spacing depends on locale, see SdDrawDocument ctor in sd
+ // default for script spacing depends on locale, see SdDrawDocument ctor in sd
LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage();
if ( eOfficeLanguage == LANGUAGE_KOREAN || eOfficeLanguage == LANGUAGE_KOREAN_JOHAB ||
eOfficeLanguage == LANGUAGE_JAPANESE )
{
// secondary is edit engine pool
- rPool.GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( sal_False, EE_PARA_ASIANCJKSPACING ) );
+ rPool.GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
}
rPool.FreezeIdRanges(); // the pool is also used directly
@@ -275,7 +289,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
Outliner& rHitOutliner = GetHitTestOutliner();
rHitOutliner.SetCalcFieldValueHdl( LINK( pScMod, ScModule, CalcFieldValueHdl ) );
- // #95129# SJ: set FontHeight pool defaults without changing static SdrEngineDefaults
+ // set FontHeight pool defaults without changing static SdrEngineDefaults
SfxItemPool* pOutlinerPool = rOutliner.GetEditTextObjectPool();
if ( pOutlinerPool )
pItemPool->SetPoolDefaultItem(SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT )); // 12Pt
@@ -292,12 +306,10 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
}
}
-__EXPORT ScDrawLayer::~ScDrawLayer()
+ScDrawLayer::~ScDrawLayer()
{
Broadcast(SdrHint(HINT_MODELCLEARED));
- // #116168#
- //Clear();
ClearModel(sal_True);
delete pUndoGroup;
@@ -322,17 +334,17 @@ void ScDrawLayer::UseHyphenator()
}
}
-SdrPage* __EXPORT ScDrawLayer::AllocPage(FASTBOOL bMasterPage)
+SdrPage* ScDrawLayer::AllocPage(bool bMasterPage)
{
// don't create basic until it is needed
StarBASIC* pBasic = NULL;
- ScDrawPage* pPage = new ScDrawPage( *this, pBasic, sal::static_int_cast<sal_Bool>(bMasterPage) );
+ ScDrawPage* pPage = new ScDrawPage( *this, pBasic, bMasterPage);
return pPage;
}
sal_Bool ScDrawLayer::HasObjects() const
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 nCount = GetPageCount();
for (sal_uInt16 i=0; i<nCount && !bFound; i++)
@@ -348,15 +360,15 @@ void ScDrawLayer::UpdateBasic()
//! remove this method?
}
-SdrModel* __EXPORT ScDrawLayer::AllocModel() const
+SdrModel* ScDrawLayer::AllocModel() const
{
- // #103849# Allocated model (for clipboard etc) must not have a pointer
+ // Allocated model (for clipboard etc) must not have a pointer
// to the original model's document, pass NULL as document:
return new ScDrawLayer( NULL, aName );
}
-Window* __EXPORT ScDrawLayer::GetCurDocViewWin()
+Window* ScDrawLayer::GetCurDocViewWin()
{
DBG_ASSERT( pDoc, "ScDrawLayer::GetCurDocViewWin without document" );
if ( !pDoc )
@@ -374,9 +386,9 @@ Window* __EXPORT ScDrawLayer::GetCurDocViewWin()
sal_Bool ScDrawLayer::ScAddPage( SCTAB nTab )
{
if (bDrawIsInUndo)
- return sal_False; // not inserted
+ return false; // not inserted
- ScDrawPage* pPage = (ScDrawPage*)AllocPage( sal_False );
+ ScDrawPage* pPage = (ScDrawPage*)AllocPage( false );
InsertPage(pPage, static_cast<sal_uInt16>(nTab));
if (bRecording)
AddCalcUndo(new SdrUndoNewPage(*pPage));
@@ -420,7 +432,7 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool b
return;
SdrPage* pOldPage = GetPage(nOldPos);
- SdrPage* pNewPage = bAlloc ? AllocPage(sal_False) : GetPage(nNewPos);
+ SdrPage* pNewPage = bAlloc ? AllocPage(false) : GetPage(nNewPos);
// kopieren
@@ -430,9 +442,7 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool b
SdrObject* pOldObject = aIter.Next();
while (pOldObject)
{
- // #116235#
SdrObject* pNewObject = pOldObject->Clone();
- //SdrObject* pNewObject = pOldObject->Clone( pNewPage, this );
pNewObject->SetModel(this);
pNewObject->SetPage(pNewPage);
@@ -474,7 +484,7 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC
{
const ScAddress aOldStt = pData->maStart;
const ScAddress aOldEnd = pData->maEnd;
- sal_Bool bChange = sal_False;
+ sal_Bool bChange = false;
if ( aOldStt.IsValid() && IsInBlock( aOldStt, nCol1,nRow1, nCol2,nRow2 ) )
{
pData->maStart.IncCol( nDx );
@@ -526,7 +536,41 @@ void ScDrawLayer::SetPageSize( sal_uInt16 nPageNo, const Size& rSize, bool bUpda
}
}
-void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos )
+namespace
+{
+ //Can't have a zero width dimension
+ Rectangle lcl_makeSafeRectangle(const Rectangle &rNew)
+ {
+ Rectangle aRect = rNew;
+ if (aRect.Bottom() == aRect.Top())
+ aRect.Bottom() = aRect.Top()+1;
+ if (aRect.Right() == aRect.Left())
+ aRect.Right() = aRect.Left()+1;
+ return aRect;
+ }
+
+ Point lcl_calcAvailableDiff(ScDocument &rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const Point &aWantedDiff)
+ {
+ Point aAvailableDiff(aWantedDiff);
+ long nHeight = rDoc.GetRowHeight( nRow, nTab ) * HMM_PER_TWIPS;
+ long nWidth = rDoc.GetColWidth( nCol, nTab ) * HMM_PER_TWIPS;
+ if (aAvailableDiff.Y() > nHeight)
+ aAvailableDiff.Y() = nHeight;
+ if (aAvailableDiff.X() > nWidth)
+ aAvailableDiff.X() = nWidth;
+ return aAvailableDiff;
+ }
+
+ Rectangle lcl_UpdateCalcPoly(basegfx::B2DPolygon &rCalcPoly, int nWhichPoint, const Point &rPos)
+ {
+ rCalcPoly.setB2DPoint(nWhichPoint, basegfx::B2DPoint(rPos.X(), rPos.Y()));
+ basegfx::B2DRange aRange(basegfx::tools::getRange(rCalcPoly));
+ return Rectangle(aRange.getMinX(), aRange.getMinY(),
+ aRange.getMaxX(), aRange.getMaxY());
+ }
+}
+
+void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos )
{
DBG_ASSERT( pDoc, "ScDrawLayer::RecalcPos - missing document" );
if( !pDoc )
@@ -565,14 +609,16 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
if( bCircle )
{
+ rData.maLastRect = pObj->GetLogicRect();
+
Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
TwipsToMM( aPos.X() );
TwipsToMM( aPos.Y() );
// Berechnung und Werte wie in detfunc.cxx
- Size aSize( (long)(pDoc->GetColWidth( nCol1, nTab1 ) * HMM_PER_TWIPS),
- (long)(pDoc->GetRowHeight( nRow1, nTab1 ) * HMM_PER_TWIPS) );
+ Size aSize( (long)( TwipsToHmm( pDoc->GetColWidth( nCol1, nTab1) ) ),
+ (long)( TwipsToHmm( pDoc->GetRowHeight( nRow1, nTab1) ) ) );
Rectangle aRect( aPos, aSize );
aRect.Left() -= 250;
aRect.Right() += 250;
@@ -585,11 +631,18 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
{
if (bRecording)
AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
- pObj->SetLogicRect(aRect);
+ rData.maLastRect = lcl_makeSafeRectangle(aRect);
+ pObj->SetLogicRect(rData.maLastRect);
}
}
else if( bArrow )
{
+ rData.maLastRect = pObj->GetLogicRect();
+ basegfx::B2DPolygon aCalcPoly;
+ Point aOrigStartPos(pObj->GetPoint(0));
+ Point aOrigEndPos(pObj->GetPoint(1));
+ aCalcPoly.append(basegfx::B2DPoint(aOrigStartPos.X(), aOrigStartPos.Y()));
+ aCalcPoly.append(basegfx::B2DPoint(aOrigEndPos.X(), aOrigEndPos.Y()));
//! nicht mehrere Undos fuer ein Objekt erzeugen (hinteres kann dann weggelassen werden)
SCCOL nLastCol;
@@ -597,9 +650,9 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
if( bValid1 )
{
Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
- if (!pDoc->ColHidden(nCol1, nTab1, nLastCol))
+ if (!pDoc->ColHidden(nCol1, nTab1, NULL, &nLastCol))
aPos.X() += pDoc->GetColWidth( nCol1, nTab1 ) / 4;
- if (!pDoc->RowHidden(nRow1, nTab1, nLastRow))
+ if (!pDoc->RowHidden(nRow1, nTab1, NULL, &nLastRow))
aPos.Y() += pDoc->GetRowHeight( nRow1, nTab1 ) / 2;
TwipsToMM( aPos.X() );
TwipsToMM( aPos.Y() );
@@ -610,6 +663,8 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
{
if (bRecording)
AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 0, aStartPos);
pObj->SetPoint( aStartPos, 0 );
}
@@ -624,6 +679,8 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
{
if (bRecording)
AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 1, aEndPos);
pObj->SetPoint( aEndPos, 1 );
}
}
@@ -631,9 +688,9 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
if( bValid2 )
{
Point aPos( pDoc->GetColOffset( nCol2, nTab2 ), pDoc->GetRowOffset( nRow2, nTab2 ) );
- if (!pDoc->ColHidden(nCol2, nTab2, nLastCol))
+ if (!pDoc->ColHidden(nCol2, nTab2, NULL, &nLastCol))
aPos.X() += pDoc->GetColWidth( nCol2, nTab2 ) / 4;
- if (!pDoc->RowHidden(nRow2, nTab2, nLastRow))
+ if (!pDoc->RowHidden(nRow2, nTab2, NULL, &nLastRow))
aPos.Y() += pDoc->GetRowHeight( nRow2, nTab2 ) / 2;
TwipsToMM( aPos.X() );
TwipsToMM( aPos.Y() );
@@ -644,6 +701,8 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
{
if (bRecording)
AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 1, aEndPos);
pObj->SetPoint( aEndPos, 1 );
}
@@ -660,45 +719,68 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
{
if (bRecording)
AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+
+ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 0, aStartPos);
pObj->SetPoint( aStartPos, 0 );
}
}
}
}
- else // Referenz-Rahmen
+ else
{
+ bool bCanResize = bValid2 && !pObj->IsResizeProtect();
+
+ //First time positioning, must be able to at least move it
+ if (rData.maLastRect.IsEmpty())
+ rData.maLastRect = pObj->GetLogicRect();
+
DBG_ASSERT( bValid1, "ScDrawLayer::RecalcPos - invalid start position" );
Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
TwipsToMM( aPos.X() );
TwipsToMM( aPos.Y() );
+ aPos += lcl_calcAvailableDiff(*pDoc, nCol1, nRow1, nTab1, rData.maStartOffset);
- if( bValid2 )
+ if( bCanResize )
{
- Point aEnd( pDoc->GetColOffset( nCol2 + 1, nTab2 ), pDoc->GetRowOffset( nRow2 + 1, nTab2 ) );
+ Point aEnd( pDoc->GetColOffset( nCol2, nTab2 ), pDoc->GetRowOffset( nRow2, nTab2 ) );
TwipsToMM( aEnd.X() );
TwipsToMM( aEnd.Y() );
+ aEnd += lcl_calcAvailableDiff(*pDoc, nCol2, nRow2, nTab2, rData.maEndOffset);
Rectangle aNew( aPos, aEnd );
if ( bNegativePage )
MirrorRectRTL( aNew );
if ( pObj->GetLogicRect() != aNew )
{
+ Rectangle aOld(pObj->GetLogicRect());
+
if (bRecording)
AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
- pObj->SetLogicRect(aNew);
+ rData.maLastRect = lcl_makeSafeRectangle(aNew);
+ pObj->SetLogicRect(rData.maLastRect);
}
}
else
{
if ( bNegativePage )
- aPos.X() = -aPos.X();
+ aPos.X() = -aPos.X() - rData.maLastRect.GetWidth();
if ( pObj->GetRelativePos() != aPos )
{
if (bRecording)
AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+ rData.maLastRect.SetPos( aPos );
pObj->SetRelativePos( aPos );
}
}
+
+ /*
+ * If we were not allowed resize the object, then the end cell anchor
+ * is possibly incorrect now, and if the object has no end-cell (e.g.
+ * missing in original .xml) we are also forced to generate one
+ */
+ bool bEndAnchorIsBad = !bValid2 || pObj->IsResizeProtect();
+ if (bEndAnchorIsBad)
+ ScDrawLayer::UpdateCellAnchorFromPositionEnd(*pObj, *pDoc, nTab1);
}
}
@@ -706,14 +788,14 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool
{
DBG_ASSERT( pDoc, "ScDrawLayer::GetPrintArea without document" );
if ( !pDoc )
- return sal_False;
+ return false;
SCTAB nTab = rRange.aStart.Tab();
DBG_ASSERT( rRange.aEnd.Tab() == nTab, "GetPrintArea: Tab unterschiedlich" );
sal_Bool bNegativePage = pDoc->IsNegativePage( nTab );
- sal_Bool bAny = sal_False;
+ sal_Bool bAny = false;
long nEndX = 0;
long nEndY = 0;
long nStartX = LONG_MAX;
@@ -732,16 +814,16 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool
SCCOL nEndCol = rRange.aEnd.Col();
for (i=nStartCol; i<=nEndCol; i++)
nEndX += pDoc->GetColWidth(i,nTab);
- nStartX = (long)(nStartX * HMM_PER_TWIPS);
- nEndX = (long)(nEndX * HMM_PER_TWIPS);
+ nStartX = TwipsToHmm( nStartX );
+ nEndX = TwipsToHmm( nEndX );
}
if (!bSetVer)
{
nStartY = pDoc->GetRowHeight( 0, rRange.aStart.Row()-1, nTab);
nEndY = nStartY + pDoc->GetRowHeight( rRange.aStart.Row(),
rRange.aEnd.Row(), nTab);
- nStartY = (long)(nStartY * HMM_PER_TWIPS);
- nEndY = (long)(nEndY * HMM_PER_TWIPS);
+ nStartY = TwipsToHmm( nStartY );
+ nEndY = TwipsToHmm( nEndY );
}
if ( bNegativePage )
@@ -764,9 +846,9 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool
Rectangle aObjRect = pObject->GetCurrentBoundRect();
sal_Bool bFit = sal_True;
if ( !bSetHor && ( aObjRect.Right() < nStartX || aObjRect.Left() > nEndX ) )
- bFit = sal_False;
+ bFit = false;
if ( !bSetVer && ( aObjRect.Bottom() < nStartY || aObjRect.Top() > nEndY ) )
- bFit = sal_False;
+ bFit = false;
if ( bFit )
{
if (bSetHor)
@@ -799,8 +881,8 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool
if (bSetHor)
{
- nStartX = (long) (nStartX / HMM_PER_TWIPS);
- nEndX = (long) (nEndX / HMM_PER_TWIPS);
+ nStartX = HmmToTwips( nStartX );
+ nEndX = HmmToTwips( nEndX );
long nWidth;
SCCOL i;
@@ -817,8 +899,8 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool
if (bSetVer)
{
- nStartY = (long) (nStartY / HMM_PER_TWIPS);
- nEndY = (long) (nEndY / HMM_PER_TWIPS);
+ nStartY = HmmToTwips( nStartY );
+ nEndY = HmmToTwips( nEndY );
SCROW nRow = pDoc->GetRowForHeight( nTab, nStartY);
rRange.aStart.SetRow( nRow>0 ? (nRow-1) : 0);
nRow = pDoc->GetRowForHeight( nTab, nEndY);
@@ -857,167 +939,18 @@ void ScDrawLayer::AddCalcUndo( SdrUndoAction* pUndo )
void ScDrawLayer::BeginCalcUndo()
{
-//! DBG_ASSERT( !bRecording, "BeginCalcUndo ohne GetCalcUndo" );
-
DELETEZ(pUndoGroup);
bRecording = sal_True;
}
SdrUndoGroup* ScDrawLayer::GetCalcUndo()
{
-//! DBG_ASSERT( bRecording, "GetCalcUndo ohne BeginCalcUndo" );
-
SdrUndoGroup* pRet = pUndoGroup;
pUndoGroup = NULL;
- bRecording = sal_False;
+ bRecording = false;
return pRet;
}
-// MoveAreaTwips: all measures are kept in twips
-void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea,
- const Point& rMove, const Point& rTopLeft )
-{
- if (!rMove.X() && !rMove.Y())
- return; // nix
-
- SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
- DBG_ASSERT(pPage,"Page nicht gefunden");
- if (!pPage)
- return;
-
- sal_Bool bNegativePage = pDoc && pDoc->IsNegativePage( nTab );
-
- // fuer Shrinking!
- Rectangle aNew( rArea );
- sal_Bool bShrink = sal_False;
- if ( rMove.X() < 0 || rMove.Y() < 0 ) // verkleinern
- {
- if ( rTopLeft != rArea.TopLeft() ) // sind gleich beim Verschieben von Zellen
- {
- bShrink = sal_True;
- aNew.Left() = rTopLeft.X();
- aNew.Top() = rTopLeft.Y();
- }
- }
- SdrObjListIter aIter( *pPage, IM_FLAT );
- SdrObject* pObject = aIter.Next();
- while (pObject)
- {
- if( GetAnchor( pObject ) == SCA_CELL )
- {
- if ( GetObjData( pObject ) ) // Detektiv-Pfeil ?
- {
- // hier nichts
- }
- else if ( pObject->ISA( SdrEdgeObj ) ) // Verbinder?
- {
- // hier auch nichts
- //! nicht verbundene Enden wie bei Linien (s.u.) behandeln?
- }
- else if ( pObject->IsPolyObj() && pObject->GetPointCount()==2 )
- {
- for (sal_uInt16 i=0; i<2; i++)
- {
- sal_Bool bMoved = sal_False;
- Point aPoint = pObject->GetPoint(i);
- lcl_ReverseTwipsToMM( aPoint );
- if (rArea.IsInside(aPoint))
- {
- aPoint += rMove; bMoved = sal_True;
- }
- else if (bShrink && aNew.IsInside(aPoint))
- {
- // Punkt ist in betroffener Zelle - Test auf geloeschten Bereich
- if ( rMove.X() && aPoint.X() >= rArea.Left() + rMove.X() )
- {
- aPoint.X() = rArea.Left() + rMove.X() - SHRINK_DIST_TWIPS;
- if ( aPoint.X() < 0 ) aPoint.X() = 0;
- bMoved = sal_True;
- }
- if ( rMove.Y() && aPoint.Y() >= rArea.Top() + rMove.Y() )
- {
- aPoint.Y() = rArea.Top() + rMove.Y() - SHRINK_DIST_TWIPS;
- if ( aPoint.Y() < 0 ) aPoint.Y() = 0;
- bMoved = sal_True;
- }
- }
- if( bMoved )
- {
- AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
- lcl_TwipsToMM( aPoint );
- pObject->SetPoint( aPoint, i );
- }
- }
- }
- else
- {
- Rectangle aObjRect = pObject->GetLogicRect();
- // aOldMMPos: not converted, millimeters
- Point aOldMMPos = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft();
- lcl_ReverseTwipsToMM( aObjRect );
- Point aTopLeft = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft(); // logical left
- Size aMoveSize;
- sal_Bool bDoMove = sal_False;
- if (rArea.IsInside(aTopLeft))
- {
- aMoveSize = Size(rMove.X(),rMove.Y());
- bDoMove = sal_True;
- }
- else if (bShrink && aNew.IsInside(aTopLeft))
- {
- // Position ist in betroffener Zelle - Test auf geloeschten Bereich
- if ( rMove.X() && aTopLeft.X() >= rArea.Left() + rMove.X() )
- {
- aMoveSize.Width() = rArea.Left() + rMove.X() - SHRINK_DIST - aTopLeft.X();
- bDoMove = sal_True;
- }
- if ( rMove.Y() && aTopLeft.Y() >= rArea.Top() + rMove.Y() )
- {
- aMoveSize.Height() = rArea.Top() + rMove.Y() - SHRINK_DIST - aTopLeft.Y();
- bDoMove = sal_True;
- }
- }
- if ( bDoMove )
- {
- if ( bNegativePage )
- {
- if ( aTopLeft.X() + aMoveSize.Width() > 0 )
- aMoveSize.Width() = -aTopLeft.X();
- }
- else
- {
- if ( aTopLeft.X() + aMoveSize.Width() < 0 )
- aMoveSize.Width() = -aTopLeft.X();
- }
- if ( aTopLeft.Y() + aMoveSize.Height() < 0 )
- aMoveSize.Height() = -aTopLeft.Y();
-
- // get corresponding move size in millimeters:
- Point aNewPos( aTopLeft.X() + aMoveSize.Width(), aTopLeft.Y() + aMoveSize.Height() );
- lcl_TwipsToMM( aNewPos );
- aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() ); // millimeters
-
- AddCalcUndo( new SdrUndoMoveObj( *pObject, aMoveSize ) );
- pObject->Move( aMoveSize );
- }
- else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) &&
- !pObject->IsResizeProtect() )
- {
- // geschuetzte Groessen werden nicht veraendert
- // (Positionen schon, weil sie ja an der Zelle "verankert" sind)
- AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
- long nOldSizeX = aObjRect.Right() - aObjRect.Left() + 1;
- long nOldSizeY = aObjRect.Bottom() - aObjRect.Top() + 1;
- long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 ); // logical direction
- pObject->Resize( aOldMMPos, Fraction( nOldSizeX+nLogMoveX, nOldSizeX ),
- Fraction( nOldSizeY+rMove.Y(), nOldSizeY ) );
- }
- }
- }
- pObject = aIter.Next();
- }
-}
-
void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
SCsCOL nDx,SCsROW nDy, sal_Bool bInsDel, bool bUpdateNoteCaptionPos )
{
@@ -1059,11 +992,6 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR
aTopLeft.Y() += aMove.Y();
}
- // drawing objects are now directly included in cut&paste
- // -> only update references when inserting/deleting (or changing widths or heights)
- if ( bInsDel )
- MoveAreaTwips( nTab, aRect, aMove, aTopLeft );
-
//
// Detektiv-Pfeile: Zellpositionen anpassen
//
@@ -1071,77 +999,11 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR
MoveCells( nTab, nCol1,nRow1, nCol2,nRow2, nDx,nDy, bUpdateNoteCaptionPos );
}
-void ScDrawLayer::WidthChanged( SCTAB nTab, SCCOL nCol, long nDifTwips )
-{
- DBG_ASSERT( pDoc, "ScDrawLayer::WidthChanged without document" );
- if ( !pDoc )
- return;
-
- if (!bAdjustEnabled)
- return;
-
- Rectangle aRect;
- Point aTopLeft;
-
- for (SCCOL i=0; i<nCol; i++)
- aRect.Left() += pDoc->GetColWidth(i,nTab);
- aTopLeft.X() = aRect.Left();
- aRect.Left() += pDoc->GetColWidth(nCol,nTab);
-
- aRect.Right() = MAXMM;
- aRect.Top() = 0;
- aRect.Bottom() = MAXMM;
-
- //! aTopLeft ist falsch, wenn mehrere Spalten auf einmal ausgeblendet werden
-
- sal_Bool bNegativePage = pDoc->IsNegativePage( nTab );
- if ( bNegativePage )
- {
- MirrorRectRTL( aRect );
- aTopLeft.X() = -aTopLeft.X();
- nDifTwips = -nDifTwips;
- }
-
- MoveAreaTwips( nTab, aRect, Point( nDifTwips,0 ), aTopLeft );
-}
-
-void ScDrawLayer::HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips )
-{
- DBG_ASSERT( pDoc, "ScDrawLayer::HeightChanged without document" );
- if ( !pDoc )
- return;
-
- if (!bAdjustEnabled)
- return;
-
- Rectangle aRect;
- Point aTopLeft;
-
- aRect.Top() += pDoc->GetRowHeight( 0, nRow-1, nTab);
- aTopLeft.Y() = aRect.Top();
- aRect.Top() += pDoc->GetRowHeight(nRow, nTab);
-
- aRect.Bottom() = MAXMM;
- aRect.Left() = 0;
- aRect.Right() = MAXMM;
-
- //! aTopLeft ist falsch, wenn mehrere Zeilen auf einmal ausgeblendet werden
-
- sal_Bool bNegativePage = pDoc->IsNegativePage( nTab );
- if ( bNegativePage )
- {
- MirrorRectRTL( aRect );
- aTopLeft.X() = -aTopLeft.X();
- }
-
- MoveAreaTwips( nTab, aRect, Point( 0,nDifTwips ), aTopLeft );
-}
-
-sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, bool bIncludeNotes )
+sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow )
{
DBG_ASSERT( pDoc, "ScDrawLayer::HasObjectsInRows without document" );
if ( !pDoc )
- return sal_False;
+ return false;
Rectangle aTestRect;
@@ -1168,9 +1030,9 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR
SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page nicht gefunden");
if (!pPage)
- return sal_False;
+ return false;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
Rectangle aObjRect;
SdrObjListIter aIter( *pPage );
@@ -1178,10 +1040,8 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR
while ( pObject && !bFound )
{
aObjRect = pObject->GetSnapRect(); //! GetLogicRect ?
- // #i116164# note captions are handled separately, don't have to be included for each single row height change
- if ( (aTestRect.IsInside(aObjRect.TopLeft()) || aTestRect.IsInside(aObjRect.BottomLeft())) &&
- (bIncludeNotes || !IsNoteCaption(pObject)) )
- bFound = sal_True;
+ if (aTestRect.IsInside(aObjRect.TopLeft()) || aTestRect.IsInside(aObjRect.BottomLeft()))
+ bFound = true;
pObject = aIter.Next();
}
@@ -1189,44 +1049,6 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR
return bFound;
}
-#if 0
-void ScDrawLayer::DeleteObjects( SCTAB nTab )
-{
- SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
- DBG_ASSERT(pPage,"Page ?");
- if (!pPage)
- return;
-
- pPage->RecalcObjOrdNums();
-
- long nDelCount = 0;
- sal_uLong nObjCount = pPage->GetObjCount();
- if (nObjCount)
- {
- SdrObject** ppObj = new SdrObject*[nObjCount];
-
- SdrObjListIter aIter( *pPage, IM_FLAT );
- SdrObject* pObject = aIter.Next();
- while (pObject)
- {
- // alle loeschen
- ppObj[nDelCount++] = pObject;
- pObject = aIter.Next();
- }
-
- long i;
- if (bRecording)
- for (i=1; i<=nDelCount; i++)
- AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
-
- for (i=1; i<=nDelCount; i++)
- pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
-
- delete[] ppObj;
- }
-}
-#endif
-
void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
SCCOL nCol2,SCROW nRow2 )
{
@@ -1241,10 +1063,10 @@ void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
pPage->RecalcObjOrdNums();
- long nDelCount = 0;
sal_uLong nObjCount = pPage->GetObjCount();
if (nObjCount)
{
+ long nDelCount = 0;
Rectangle aDelRect = pDoc->GetMMRect( nCol1, nRow1, nCol2, nRow2, nTab );
SdrObject** ppObj = new SdrObject*[nObjCount];
@@ -1297,10 +1119,10 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark )
if (pPage)
{
pPage->RecalcObjOrdNums();
- long nDelCount = 0;
sal_uLong nObjCount = pPage->GetObjCount();
if (nObjCount)
{
+ long nDelCount = 0;
// Rechteck um die ganze Selektion
Rectangle aMarkBound = pDoc->GetMMRect(
aMarkRange.aStart.Col(), aMarkRange.aStart.Row(),
@@ -1343,7 +1165,7 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark )
}
else
{
- DBG_ERROR("pPage?");
+ OSL_FAIL("pPage?");
}
}
}
@@ -1383,9 +1205,7 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle&
DBG_ASSERT( pDestPage, "no page" );
if (pDestPage)
{
- // #116235#
SdrObject* pNewObject = pOldObject->Clone();
- //SdrObject* pNewObject = pOldObject->Clone( pDestPage, pDestModel );
pNewObject->SetModel(pDestModel);
pNewObject->SetPage(pDestPage);
@@ -1412,13 +1232,12 @@ sal_Bool lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, co
for( ;aIt!=rRangesVector.end(); ++aIt )
{
const ScRangeList& rRanges = *aIt;
- sal_uLong nCount = rRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
{
- ScRange aRange = *rRanges.GetObject(i);
+ ScRange aRange = *rRanges[ i ];
if ( !rClipRange.In( aRange ) )
{
- return sal_False; // at least one range is not valid
+ return false; // at least one range is not valid
}
}
}
@@ -1428,16 +1247,15 @@ sal_Bool lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, co
sal_Bool lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRange& rSourceRange, const ScAddress& rDestPos )
{
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
::std::vector< ScRangeList >::iterator aIt = rRangesVector.begin();
for( ;aIt!=rRangesVector.end(); ++aIt )
{
ScRangeList& rRanges = *aIt;
- sal_uLong nCount = rRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
{
- ScRange* pRange = rRanges.GetObject(i);
+ ScRange* pRange = rRanges[ i ];
if ( rSourceRange.In( *pRange ) )
{
SCsCOL nDiffX = rDestPos.Col() - (SCsCOL)rSourceRange.aStart.Col();
@@ -1464,7 +1282,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
if (bDrawIsInUndo) //! can this happen?
{
- DBG_ERROR("CopyFromClip, bDrawIsInUndo");
+ OSL_FAIL("CopyFromClip, bDrawIsInUndo");
return;
}
@@ -1497,7 +1315,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
//#i110034# charts need correct sheet names for xml range conversion during load
//so the target sheet name is temporarily renamed (if we have any SdrObjects)
String aDestTabName;
- sal_Bool bRestoreDestTabName = sal_False;
+ sal_Bool bRestoreDestTabName = false;
if( pOldObject && !bSameDoc && !bDestClip )
{
if( pDoc && pClipDoc )
@@ -1528,7 +1346,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
Fraction aHorFract(1,1);
Fraction aVerFract(1,1);
- sal_Bool bResize = sal_False;
+ sal_Bool bResize = false;
// sizes can differ by 1 from twips->1/100mm conversion for equal cell sizes,
// don't resize to empty size when pasting into hidden columns or rows
if ( Abs(nWidthDiff) > 1 && nDestWidth > 1 && nSourceWidth > 1 )
@@ -1549,9 +1367,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
// do not copy internal objects (detective) and note captions
if ( rSourceRange.IsInside( aObjRect ) && (pOldObject->GetLayer() != SC_LAYER_INTERN) && !IsNoteCaption( pOldObject ) )
{
- // #116235#
SdrObject* pNewObject = pOldObject->Clone();
- //SdrObject* pNewObject = pOldObject->Clone( pDestPage, this );
pNewObject->SetModel(this);
pNewObject->SetPage(pDestPage);
@@ -1593,7 +1409,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
pDoc->GetChartRanges( aChartName, aRangesVector, pDoc );
if( !aRangesVector.empty() )
{
- sal_Bool bInSourceRange = sal_False;
+ sal_Bool bInSourceRange = false;
ScRange aClipRange;
if ( pClipDoc )
{
@@ -1690,7 +1506,6 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj )
}
}
-// static
void ScDrawLayer::MirrorRectRTL( Rectangle& rRect )
{
// mirror and swap left/right
@@ -1740,13 +1555,12 @@ Rectangle ScDrawLayer::GetCellRect( ScDocument& rDoc, const ScAddress& rPos, boo
return aCellRect;
}
-// static
String ScDrawLayer::GetVisibleName( SdrObject* pObj )
{
String aName = pObj->GetName();
if ( pObj->GetObjIdentifier() == OBJ_OLE2 )
{
- // #95575# For OLE, the user defined name (GetName) is used
+ // For OLE, the user defined name (GetName) is used
// if it's not empty (accepting possibly duplicate names),
// otherwise the persist name is used so every object appears
// in the Navigator at all.
@@ -1832,7 +1646,7 @@ void ScDrawLayer::EnsureGraphicNames()
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
SdrObject* pObject = aIter.Next();
- /* #101799# The index passed to GetNewGraphicName() will be set to
+ /* The index passed to GetNewGraphicName() will be set to
the used index in each call. This prevents the repeated search
for all names from 1 to current index. */
long nCounter = 0;
@@ -1848,35 +1662,105 @@ void ScDrawLayer::EnsureGraphicNames()
}
}
-void ScDrawLayer::SetAnchor( SdrObject* pObj, ScAnchorType eType )
+namespace
{
- ScAnchorType eOldAnchorType = GetAnchor( pObj );
+ SdrObjUserData* GetFirstUserDataOfType(const SdrObject *pObj, UINT16 nId)
+ {
+ sal_uInt16 nCount = pObj ? pObj->GetUserDataCount() : 0;
+ for( sal_uInt16 i = 0; i < nCount; i++ )
+ {
+ SdrObjUserData* pData = pObj->GetUserData( i );
+ if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId )
+ return pData;
+ }
+ return NULL;
+ }
- // Ein an der Seite verankertes Objekt zeichnet sich durch eine Anker-Pos
- // von (0,1) aus. Das ist ein shabby Trick, der aber funktioniert!
- Point aAnchor( 0, eType == SCA_PAGE ? 1 : 0 );
- pObj->SetAnchorPos( aAnchor );
+ void DeleteFirstUserDataOfType(SdrObject *pObj, UINT16 nId)
+ {
+ sal_uInt16 nCount = pObj ? pObj->GetUserDataCount() : 0;
+ for( sal_uInt16 i = nCount; i > 0; i-- )
+ {
+ SdrObjUserData* pData = pObj->GetUserData( i-1 );
+ if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId )
+ pObj->DeleteUserData(i-1);
+ }
+ }
+}
- if ( eOldAnchorType != eType )
- pObj->notifyShapePropertyChange( ::svx::eSpreadsheetAnchor );
+void ScDrawLayer::SetCellAnchored( SdrObject &rObj, const ScDrawObjData &rAnchor )
+{
+ ScDrawObjData* pAnchor = GetObjData( &rObj, true );
+ pAnchor->maStart = rAnchor.maStart;
+ pAnchor->maEnd = rAnchor.maEnd;
+ pAnchor->maStartOffset = rAnchor.maStartOffset;
+ pAnchor->maEndOffset = rAnchor.maEndOffset;
}
-ScAnchorType ScDrawLayer::GetAnchor( const SdrObject* pObj )
+void ScDrawLayer::SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab )
{
- Point aAnchor( pObj->GetAnchorPos() );
- return ( aAnchor.Y() != 0 ) ? SCA_PAGE : SCA_CELL;
+ Rectangle aObjRect(rObj.GetLogicRect());
+ ScRange aRange = rDoc.GetRange( nTab, aObjRect );
+
+ Rectangle aCellRect;
+
+ ScDrawObjData aAnchor;
+ aAnchor.maStart = aRange.aStart;
+ aCellRect = rDoc.GetMMRect( aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() );
+ aAnchor.maStartOffset.Y() = aObjRect.Top()-aCellRect.Top();
+ if (!rDoc.IsNegativePage(nTab))
+ aAnchor.maStartOffset.X() = aObjRect.Left()-aCellRect.Left();
+ else
+ aAnchor.maStartOffset.X() = aCellRect.Right()-aObjRect.Right();
+
+ aAnchor.maEnd = aRange.aEnd;
+ aCellRect = rDoc.GetMMRect( aRange.aEnd.Col(), aRange.aEnd.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab() );
+ aAnchor.maEndOffset.Y() = aObjRect.Bottom()-aCellRect.Top();
+ if (!rDoc.IsNegativePage(nTab))
+ aAnchor.maEndOffset.X() = aObjRect.Right()-aCellRect.Left();
+ else
+ aAnchor.maEndOffset.X() = aCellRect.Right()-aObjRect.Left();
+
+ SetCellAnchored( rObj, aAnchor );
}
-ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate ) // static
+void ScDrawLayer::UpdateCellAnchorFromPositionEnd( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab )
{
- sal_uInt16 nCount = pObj ? pObj->GetUserDataCount() : 0;
- for( sal_uInt16 i = 0; i < nCount; i++ )
- {
- SdrObjUserData* pData = pObj->GetUserData( i );
- if( pData && pData->GetInventor() == SC_DRAWLAYER
- && pData->GetId() == SC_UD_OBJDATA )
- return (ScDrawObjData*) pData;
- }
+ Rectangle aObjRect(rObj.GetLogicRect());
+ ScRange aRange = rDoc.GetRange( nTab, aObjRect );
+
+ ScDrawObjData* pAnchor = GetObjData( &rObj, true );
+ pAnchor->maEnd = aRange.aEnd;
+
+ Rectangle aCellRect;
+ aCellRect = rDoc.GetMMRect( aRange.aEnd.Col(), aRange.aEnd.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab() );
+ pAnchor->maEndOffset.Y() = aObjRect.Bottom()-aCellRect.Top();
+ if (!rDoc.IsNegativePage(nTab))
+ pAnchor->maEndOffset.X() = aObjRect.Right()-aCellRect.Left();
+ else
+ pAnchor->maEndOffset.X() = aCellRect.Right()-aObjRect.Left();
+}
+
+void ScDrawLayer::SetPageAnchored( SdrObject &rObj )
+{
+ DeleteFirstUserDataOfType(&rObj, SC_UD_OBJDATA);
+}
+
+ScAnchorType ScDrawLayer::GetAnchorType( const SdrObject &rObj )
+{
+ //If this object has a cell anchor associated with it
+ //then its cell-anchored, otherwise its page-anchored
+ return ScDrawLayer::GetObjData(const_cast<SdrObject*>(&rObj)) ? SCA_CELL : SCA_PAGE;
+}
+
+ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate )
+{
+ if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_OBJDATA))
+ return (ScDrawObjData*) pData;
+
if( pObj && bCreate )
{
ScDrawObjData* pData = new ScDrawObjData;
@@ -1886,7 +1770,7 @@ ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate )
return 0;
}
-ScDrawObjData* ScDrawLayer::GetObjDataTab( SdrObject* pObj, SCTAB nTab ) // static
+ScDrawObjData* ScDrawLayer::GetObjDataTab( SdrObject* pObj, SCTAB nTab )
{
ScDrawObjData* pData = GetObjData( pObj );
if ( pData )
@@ -1911,20 +1795,11 @@ ScDrawObjData* ScDrawLayer::GetNoteCaptionData( SdrObject* pObj, SCTAB nTab )
return (pData && pData->mbNote) ? pData : 0;
}
-ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj ) // static
+ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj )
{
- sal_uInt16 nCount = pObj->GetUserDataCount();
- for( sal_uInt16 i = 0; i < nCount; i++ )
- {
- SdrObjUserData* pData = pObj->GetUserData( i );
- if( pData && pData->GetInventor() == SC_DRAWLAYER
- && pData->GetId() == SC_UD_IMAPDATA )
- return (ScIMapInfo*) pData;
- }
- return NULL;
+ return (ScIMapInfo*)GetFirstUserDataOfType(pObj, SC_UD_IMAPDATA);
}
-// static:
IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
const Point& rWinPoint, const Window& rCmpWnd )
{
@@ -1940,7 +1815,7 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
Size aGraphSize;
ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap();
Graphic aGraphic;
- sal_Bool bObjSupported = sal_False;
+ sal_Bool bObjSupported = false;
if ( pObj->ISA( SdrGrafObj ) ) // einfaches Grafik-Objekt
{
@@ -1974,8 +1849,8 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
else if ( pObj->ISA( SdrOle2Obj ) ) // OLE-Objekt
{
// TODO/LEAN: working with visual area needs running state
- aGraphSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize();
- bObjSupported = sal_True;
+ aGraphSize = ((const SdrOle2Obj*)pObj)->GetOrigObjSize();
+ bObjSupported = true;
}
// hat alles geklappt, dann HitTest ausfuehren
@@ -1990,16 +1865,11 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
return pIMapObj;
}
-ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, sal_Bool bCreate ) // static
+ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, sal_Bool bCreate )
{
- sal_uInt16 nCount = pObj->GetUserDataCount();
- for( sal_uInt16 i = 0; i < nCount; i++ )
- {
- SdrObjUserData* pData = pObj->GetUserData( i );
- if( pData && pData->GetInventor() == SC_DRAWLAYER
- && pData->GetId() == SC_UD_MACRODATA )
- return (ScMacroInfo*) pData;
- }
+ if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_MACRODATA))
+ return (ScMacroInfo*) pData;
+
if ( bCreate )
{
ScMacroInfo* pData = new ScMacroInfo;
@@ -2009,20 +1879,20 @@ ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, sal_Bool bCreate )
return 0;
}
-void ScDrawLayer::SetGlobalDrawPersist(SfxObjectShell* pPersist) // static
+void ScDrawLayer::SetGlobalDrawPersist(SfxObjectShell* pPersist)
{
DBG_ASSERT(!pGlobalDrawPersist,"SetGlobalDrawPersist mehrfach");
pGlobalDrawPersist = pPersist;
}
-void __EXPORT ScDrawLayer::SetChanged( sal_Bool bFlg /* = sal_True */ )
+void ScDrawLayer::SetChanged( sal_Bool bFlg /* = sal_True */ )
{
if ( bFlg && pDoc )
pDoc->SetChartListenerCollectionNeedsUpdate( sal_True );
FmFormModel::SetChanged( bFlg );
}
-SvStream* __EXPORT ScDrawLayer::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const
+SvStream* ScDrawLayer::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const
{
DBG_ASSERT( pDoc, "ScDrawLayer::GetDocumentStream without document" );
if ( !pDoc )
@@ -2069,31 +1939,13 @@ SvStream* __EXPORT ScDrawLayer::GetDocumentStream(SdrDocumentStreamInfo& rStream
}
}
}
- // the following code seems to be related to binary format
-//REMOVE else
-//REMOVE {
-//REMOVE pRet = pStor->OpenStream( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STRING_SCSTREAM)),
-//REMOVE STREAM_READ | STREAM_WRITE | STREAM_TRUNC );
-//REMOVE
-//REMOVE if( pRet )
-//REMOVE {
-//REMOVE pRet->SetVersion( pStor->GetVersion() );
-//REMOVE pRet->SetKey( pStor->GetKey() );
-//REMOVE }
-//REMOVE }
-
rStreamInfo.mbDeleteAfterUse = ( pRet != NULL );
}
return pRet;
}
-//REMOVE void ScDrawLayer::ReleasePictureStorage()
-//REMOVE {
-//REMOVE xPictureStorage.Clear();
-//REMOVE }
-
-SdrLayerID __EXPORT ScDrawLayer::GetControlExportLayerId( const SdrObject & ) const
+SdrLayerID ScDrawLayer::GetControlExportLayerId( const SdrObject & ) const
{
// Layer fuer Export von Form-Controls in Versionen vor 5.0 - immer SC_LAYER_FRONT
return SC_LAYER_FRONT;
@@ -2107,3 +1959,5 @@ SdrLayerID __EXPORT ScDrawLayer::GetControlExportLayerId( const SdrObject & ) co
return xRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 6cc56405448e..8839eaf19bc1 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,7 +103,7 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY,
while (bHOver) // nY konstant
{
--rStartX;
- if (rStartX >= (SCsCOL) nX1 && !pDoc->ColHidden(rStartX, nTab, nLastCol))
+ if (rStartX >= (SCsCOL) nX1 && !pDoc->ColHidden(rStartX, nTab, NULL, &nLastCol))
{
bHOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bHOverlapped;
bVOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bVOverlapped;
@@ -124,8 +125,8 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY,
--nArrY; // lokale Kopie !
if (rStartX >= (SCsCOL) nX1 && rStartY >= (SCsROW) nY1 &&
- !pDoc->ColHidden(rStartX, nTab, nLastCol) &&
- !pDoc->RowHidden(rStartY, nTab, nLastRow) &&
+ !pDoc->ColHidden(rStartX, nTab, NULL, &nLastCol) &&
+ !pDoc->RowHidden(rStartY, nTab, NULL, &nLastRow) &&
(SCsROW) pRowInfo[nArrY].nRowNo == rStartY)
{
bHOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bHOverlapped;
@@ -142,8 +143,8 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY,
const ScMergeAttr* pMerge;
if (rStartX >= (SCsCOL) nX1 && rStartY >= (SCsROW) nY1 &&
- !pDoc->ColHidden(rStartX, nTab, nLastCol) &&
- !pDoc->RowHidden(rStartY, nTab, nLastRow) &&
+ !pDoc->ColHidden(rStartX, nTab, NULL, &nLastCol) &&
+ !pDoc->RowHidden(rStartY, nTab, NULL, &nLastRow) &&
(SCsROW) pRowInfo[nArrY].nRowNo == rStartY)
{
pMerge = (const ScMergeAttr*) &pRowInfo[nArrY].pCellInfo[rStartX+1].pPatternAttr->
@@ -185,16 +186,16 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
SCCOL nArrX;
SCSIZE nArrY;
SCSIZE nArrCount;
- sal_Bool bAnyMerged = sal_False;
- sal_Bool bAnyShadow = sal_False;
- sal_Bool bAnyCondition = sal_False;
+ sal_Bool bAnyMerged = false;
+ sal_Bool bAnyShadow = false;
+ sal_Bool bAnyCondition = false;
sal_Bool bTabProtect = IsTabProtected(nTab);
// fuer Blockmarken von zusammengefassten Zellen mit
// versteckter erster Zeile / Spalte
- sal_Bool bPaintMarks = sal_False;
- sal_Bool bSkipMarks = sal_False;
+ sal_Bool bPaintMarks = false;
+ sal_Bool bSkipMarks = false;
SCCOL nBlockStartX = 0, nBlockEndX = 0;
SCROW nBlockEndY = 0, nBlockStartY = 0;
if (pMarkData && pMarkData->IsMarked())
@@ -250,14 +251,14 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
pThisRowInfo->bEmptyBack = sal_True;
pThisRowInfo->bEmptyText = sal_True;
pThisRowInfo->bChanged = sal_True;
- pThisRowInfo->bAutoFilter = sal_False;
- pThisRowInfo->bPushButton = sal_False;
+ pThisRowInfo->bAutoFilter = false;
+ pThisRowInfo->bPushButton = false;
pThisRowInfo->nRotMaxCol = SC_ROTMAX_NONE;
++nArrY;
if (nArrY >= ROWINFO_MAX)
{
- DBG_ERROR("Zu grosser Bereich bei FillInfo" );
+ OSL_FAIL("Zu grosser Bereich bei FillInfo" );
nYExtra = nSignedY; // Ende
nY2 = nYExtra - 1; // Bereich anpassen
}
@@ -271,7 +272,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
// rotierter Text...
// Attribut im Dokument ueberhaupt verwendet?
- sal_Bool bAnyItem = sal_False;
+ sal_Bool bAnyItem = false;
sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE );
for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++)
if (pPool->GetItem2( ATTR_ROTATE_VALUE, nItem ))
@@ -319,22 +320,22 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
pInfo->bMarked = ( nX >= nBlockStartX && nX <= nBlockEndX
&& nY >= nBlockStartY && nY <= nBlockEndY );
else
- pInfo->bMarked = sal_False;
+ pInfo->bMarked = false;
pInfo->nWidth = 0;
pInfo->nClipMark = SC_CLIPMARK_NONE;
- pInfo->bMerged = sal_False;
- pInfo->bHOverlapped = sal_False;
- pInfo->bVOverlapped = sal_False;
- pInfo->bAutoFilter = sal_False;
- pInfo->bPushButton = sal_False;
+ pInfo->bMerged = false;
+ pInfo->bHOverlapped = false;
+ pInfo->bVOverlapped = false;
+ pInfo->bAutoFilter = false;
+ pInfo->bPushButton = false;
pInfo->bPopupButton = false;
pInfo->bFilterActive = false;
pInfo->nRotateDir = SC_ROTDIR_NONE;
- pInfo->bPrinted = sal_False; // view-intern
- pInfo->bHideGrid = sal_False; // view-intern
- pInfo->bEditEngine = sal_False; // view-intern
+ pInfo->bPrinted = false; // view-intern
+ pInfo->bHideGrid = false; // view-intern
+ pInfo->bEditEngine = false; // view-intern
pInfo->pBackground = NULL; //! weglassen?
pInfo->pPatternAttr = NULL;
@@ -395,7 +396,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
(nThisRow=pThisCol->pItems[nUIndex].nRow) <= nY2 )
{
if (nThisRow > nHiddenEndRow)
- bHiddenRow = RowHidden( nThisRow, nTab, nHiddenEndRow);
+ bHiddenRow = RowHidden( nThisRow, nTab, NULL, &nHiddenEndRow);
if ( !bHiddenRow )
{
while ( pRowInfo[nArrY].nRowNo < nThisRow )
@@ -407,8 +408,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
pInfo->pCell = pThisCol->pItems[nUIndex].pCell;
if (pInfo->pCell->GetCellType() != CELLTYPE_NOTE)
{
- pThisRowInfo->bEmptyText = sal_False; // Zeile nicht leer
- pInfo->bEmptyCellText = sal_False; // Zelle nicht leer
+ pThisRowInfo->bEmptyText = false; // Zeile nicht leer
+ pInfo->bEmptyCellText = false; // Zelle nicht leer
}
++nArrY;
}
@@ -475,7 +476,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
bHideFormula = rProtAttr.GetHideFormula();
}
else
- bHidden = bHideFormula = sal_False;
+ bHidden = bHideFormula = false;
sal_uLong nConditional = ((const SfxUInt32Item&)pPattern->
GetItem(ATTR_CONDITIONAL)).GetValue();
@@ -486,12 +487,12 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
do
{
SCROW nLastHiddenRow = -1;
- bool bRowHidden = RowHidden(nCurRow, nTab, nLastHiddenRow);
+ bool bRowHidden = RowHidden(nCurRow, nTab, NULL, &nLastHiddenRow);
if ( nArrY==0 || !bRowHidden )
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
if (pBackground != pDefBackground) // Spalten-HG == Standard ?
- pThisRowInfo->bEmptyBack = sal_False;
+ pThisRowInfo->bEmptyBack = false;
if (bAutoFilter)
pThisRowInfo->bAutoFilter = sal_True;
if (bPushButton)
@@ -513,7 +514,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
pInfo->pShadowAttr = pShadowAttr;
// nWidth wird nicht mehr einzeln gesetzt
- sal_Bool bEmbed = sal_False; //bIsEmbedded &&
+ sal_Bool bEmbed = false; //bIsEmbedded &&
nTab >= aEmbedRange.aStart.Tab() &&
nTab <= aEmbedRange.aEnd.Tab() &&
nX >= aEmbedRange.aStart.Col() &&
@@ -524,12 +525,12 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
if (bScenario)
{
pInfo->pBackground = ScGlobal::GetButtonBrushItem();
- pThisRowInfo->bEmptyBack = sal_False;
+ pThisRowInfo->bEmptyBack = false;
}
else if (bEmbed)
{
pInfo->pBackground = ScGlobal::GetEmbeddedBrushItem();
- pThisRowInfo->bEmptyBack = sal_False;
+ pThisRowInfo->bEmptyBack = false;
}
if (bHidden || ( bFormulaMode && bHideFormula && pInfo->pCell
@@ -652,7 +653,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
if ( pCondSet->GetItemState( ATTR_BACKGROUND, sal_True, &pItem ) == SFX_ITEM_SET )
{
pInfo->pBackground = (const SvxBrushItem*) pItem;
- pRowInfo[nArrY].bEmptyBack = sal_False;
+ pRowInfo[nArrY].bEmptyBack = false;
}
// Umrandung
@@ -712,7 +713,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
GetItemState(ATTR_BACKGROUND,sal_True,&pItem) != SFX_ITEM_SET )
pItem = &pStartPattern->GetItem(ATTR_BACKGROUND);
pInfo->pBackground = (const SvxBrushItem*) pItem;
- pRowInfo[nArrY].bEmptyBack = sal_False;
+ pRowInfo[nArrY].bEmptyBack = false;
// Schatten
@@ -725,7 +726,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
// Blockmarken - wieder mit Original-Merge-Werten
- sal_Bool bCellMarked = sal_False;
+ sal_Bool bCellMarked = false;
if (bPaintMarks)
bCellMarked = ( nStartX >= (SCsCOL) nBlockStartX
&& nStartX <= (SCsCOL) nBlockEndX
@@ -879,7 +880,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
break;
default:
- DBG_ERROR("falscher Shadow-Enum");
+ OSL_FAIL("falscher Shadow-Enum");
}
}
}
@@ -1077,3 +1078,4 @@ ScTableInfo::~ScTableInfo()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
new file mode 100644
index 000000000000..c4cb2d61d0df
--- /dev/null
+++ b/sc/source/core/data/funcdesc.cxx
@@ -0,0 +1,889 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * 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_sc.hxx"
+
+#include "funcdesc.hxx"
+
+#include "addincol.hxx"
+#include "appoptio.hxx"
+#include "callform.hxx"
+#include "compiler.hxx"
+#include "global.hxx"
+#include "sc.hrc"
+#include "scmod.hxx"
+#include "scresid.hxx"
+
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/rcid.h>
+#include <tools/resid.hxx>
+#include <unotools/collatorwrapper.hxx>
+
+#include <numeric>
+#include <boost/scoped_ptr.hpp>
+
+class ScFuncRes : public Resource
+{
+public:
+ ScFuncRes( ResId&, ScFuncDesc*, bool & rbSuppressed );
+
+private:
+ sal_uInt16 GetNum();
+};
+
+
+class ScResourcePublisher : public Resource
+{
+private:
+ void FreeResource() { Resource::FreeResource(); }
+public:
+ ScResourcePublisher( const ScResId& rId ) : Resource( rId ) {}
+ ~ScResourcePublisher() { FreeResource(); }
+ bool IsAvailableRes( const ResId& rId ) const
+ { return Resource::IsAvailableRes( rId ); }
+
+};
+
+//========================================================================
+// class ScFuncDesc:
+//========================================================================
+
+ScFuncDesc::ScFuncDesc() :
+ pFuncName (NULL),
+ pFuncDesc (NULL),
+ ppDefArgNames (NULL),
+ ppDefArgDescs (NULL),
+ pDefArgFlags (NULL),
+ nFIndex (0),
+ nCategory (0),
+ nArgCount (0),
+ nHelpId (0),
+ bIncomplete (false),
+ bHasSuppressedArgs(false)
+{}
+
+ScFuncDesc::~ScFuncDesc()
+{
+ Clear();
+}
+
+void ScFuncDesc::Clear()
+{
+ sal_uInt16 nArgs = nArgCount;
+ if (nArgs >= VAR_ARGS) nArgs -= VAR_ARGS-1;
+ if (nArgs)
+ {
+ for (sal_uInt16 i=0; i<nArgs; i++ )
+ {
+ delete ppDefArgNames[i];
+ delete ppDefArgDescs[i];
+ }
+ delete [] ppDefArgNames;
+ delete [] ppDefArgDescs;
+ delete [] pDefArgFlags;
+ }
+ nArgCount = 0;
+ ppDefArgNames = NULL;
+ ppDefArgDescs = NULL;
+ pDefArgFlags = NULL;
+
+ delete pFuncName;
+ pFuncName = NULL;
+
+ delete pFuncDesc;
+ pFuncDesc = NULL;
+
+ nFIndex = 0;
+ nCategory = 0;
+ nHelpId = 0;
+ bIncomplete = false;
+ bHasSuppressedArgs = false;
+}
+
+::rtl::OUString ScFuncDesc::GetParamList() const
+{
+ ::rtl::OUString sep(ScCompiler::GetNativeSymbol(ocSep));
+
+ ::rtl::OUStringBuffer aSig;
+
+ if ( nArgCount > 0 )
+ {
+ if ( nArgCount < VAR_ARGS )
+ {
+ sal_uInt16 nLastSuppressed = nArgCount;
+ sal_uInt16 nLastAdded = nArgCount;
+ for ( sal_uInt16 i=0; i<nArgCount; i++ )
+ {
+ if (pDefArgFlags[i].bSuppress)
+ nLastSuppressed = i;
+ else
+ {
+ nLastAdded = i;
+ aSig.append(*(ppDefArgNames[i]));
+ if ( i != nArgCount-1 )
+ {
+ aSig.append(sep);
+ aSig.appendAscii( " " );
+ }
+ }
+ }
+ // If only suppressed parameters follow the last added parameter,
+ // remove one "; "
+ if (nLastSuppressed < nArgCount && nLastAdded < nLastSuppressed &&
+ aSig.getLength() >= 2)
+ aSig.setLength(aSig.getLength() - 2);
+ }
+ else
+ {
+ sal_uInt16 nFix = nArgCount - VAR_ARGS;
+ for ( sal_uInt16 nArg = 0; nArg < nFix; nArg++ )
+ {
+ if (!pDefArgFlags[nArg].bSuppress)
+ {
+ aSig.append(*(ppDefArgNames[nArg]));
+ aSig.append(sep);
+ aSig.appendAscii( " " );
+ }
+ }
+ /* NOTE: Currently there are no suppressed var args parameters. If
+ * there were, we'd have to cope with it here and above for the fix
+ * parameters. For now parameters are always added, so no special
+ * treatment of a trailing "; " necessary. */
+ aSig.append(*(ppDefArgNames[nFix]));
+ aSig.append(sal_Unicode('1'));
+ aSig.append(sep);
+ aSig.append(sal_Unicode(' '));
+ aSig.append(*(ppDefArgNames[nFix]));
+ aSig.append(sal_Unicode('2'));
+ aSig.append(sep);
+ aSig.appendAscii(" ... ");
+ }
+ }
+
+ return aSig.makeStringAndClear();
+}
+
+::rtl::OUString ScFuncDesc::getSignature() const
+{
+ ::rtl::OUStringBuffer aSig;
+
+ if(pFuncName)
+ {
+ aSig.append(*pFuncName);
+
+ ::rtl::OUString aParamList = GetParamList();
+ if( aParamList.getLength() )
+ {
+ aSig.appendAscii( "( " );
+ aSig.append(aParamList);
+ // U+00A0 (NBSP) prevents automatic line break
+ aSig.append( static_cast< sal_Unicode >(0xA0) );
+ aSig.appendAscii( ")" );
+ }
+ else
+ aSig.appendAscii( "()" );
+ }
+ return aSig.makeStringAndClear();
+}
+
+::rtl::OUString ScFuncDesc::getFormula( const ::std::vector< ::rtl::OUString >& _aArguments ) const
+{
+ ::rtl::OUString sep = ScCompiler::GetNativeSymbol(ocSep);
+
+ ::rtl::OUStringBuffer aFormula;
+
+ if(pFuncName)
+ {
+ aFormula.append( *pFuncName );
+
+ aFormula.appendAscii( "(" );
+ ::std::vector< ::rtl::OUString >::const_iterator aIter = _aArguments.begin();
+ ::std::vector< ::rtl::OUString >::const_iterator aEnd = _aArguments.end();
+
+ if ( nArgCount > 0 && aIter != aEnd )
+ {
+ bool bLastArg = ( aIter->getLength() == 0 );
+
+ while( aIter != aEnd && !bLastArg )
+ {
+ aFormula.append( *(aIter) );
+ if ( aIter != (aEnd-1) )
+ {
+ bLastArg = !( (aIter+1)->getLength() > 0 );
+ if ( !bLastArg )
+ aFormula.append( sep );
+ }
+
+ ++aIter;
+ }
+ }
+
+ aFormula.appendAscii( ")" );
+ }
+ return aFormula.makeStringAndClear();
+}
+
+sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const
+{
+ if (!bHasSuppressedArgs || !pDefArgFlags)
+ return nArgCount;
+
+ sal_uInt16 nArgs = nArgCount;
+ if (nArgs >= VAR_ARGS)
+ nArgs -= VAR_ARGS - 1;
+ sal_uInt16 nCount = nArgs;
+ for (sal_uInt16 i=0; i < nArgs; ++i)
+ {
+ if (pDefArgFlags[i].bSuppress)
+ --nCount;
+ }
+ if (nArgCount >= VAR_ARGS)
+ nCount += VAR_ARGS - 1;
+ return nCount;
+}
+
+::rtl::OUString ScFuncDesc::getFunctionName() const
+{
+ ::rtl::OUString sRet;
+ if ( pFuncName )
+ sRet = *pFuncName;
+ return sRet;
+}
+
+const formula::IFunctionCategory* ScFuncDesc::getCategory() const
+{
+ return ScGlobal::GetStarCalcFunctionMgr()->getCategory(nCategory);
+}
+
+::rtl::OUString ScFuncDesc::getDescription() const
+{
+ ::rtl::OUString sRet;
+ if ( pFuncDesc )
+ sRet = *pFuncDesc;
+ return sRet;
+}
+
+xub_StrLen ScFuncDesc::getSuppressedArgumentCount() const
+{
+ return GetSuppressedArgCount();
+}
+
+void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const
+{
+ if (!bHasSuppressedArgs || !pDefArgFlags)
+ {
+ _rArguments.resize( nArgCount);
+ ::std::vector<sal_uInt16>::iterator iter = _rArguments.begin();
+ sal_uInt16 value = 0;
+ while (iter != _rArguments.end())
+ *iter++ = value++;
+ }
+
+ _rArguments.reserve( nArgCount);
+ sal_uInt16 nArgs = nArgCount;
+ if (nArgs >= VAR_ARGS)
+ nArgs -= VAR_ARGS - 1;
+ for (sal_uInt16 i=0; i < nArgs; ++i)
+ {
+ if (!pDefArgFlags[i].bSuppress)
+ _rArguments.push_back(i);
+ }
+}
+
+void ScFuncDesc::initArgumentInfo() const
+{
+ // get the full argument description
+ // (add-in has to be instantiated to get the type information)
+
+ if ( bIncomplete && pFuncName )
+ {
+ ScUnoAddInCollection& rAddIns = *ScGlobal::GetAddInCollection();
+ ::rtl::OUString aIntName(rAddIns.FindFunction( *pFuncName, true )); // pFuncName is upper-case
+
+ if ( aIntName.getLength() )
+ {
+ // GetFuncData with bComplete=true loads the component and updates
+ // the global function list if needed.
+
+ rAddIns.GetFuncData( aIntName, true );
+ }
+
+ if ( bIncomplete )
+ {
+ DBG_ERRORFILE( "couldn't initialize add-in function" );
+ const_cast<ScFuncDesc*>(this)->bIncomplete = false; // even if there was an error, don't try again
+ }
+ }
+}
+
+long ScFuncDesc::getHelpId() const
+{
+ return (long)nHelpId;
+}
+
+sal_uInt32 ScFuncDesc::getParameterCount() const
+{
+ return nArgCount;
+}
+
+::rtl::OUString ScFuncDesc::getParameterName(sal_uInt32 _nPos) const
+{
+ return *(ppDefArgNames[_nPos]);
+}
+
+::rtl::OUString ScFuncDesc::getParameterDescription(sal_uInt32 _nPos) const
+{
+ return *(ppDefArgDescs[_nPos]);
+}
+
+bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const
+{
+ return pDefArgFlags[_nPos].bOptional;
+}
+
+bool ScFuncDesc::compareByName(const ScFuncDesc* a, const ScFuncDesc* b)
+{
+ return (ScGlobal::GetCaseCollator()->compareString(*a->pFuncName, *b->pFuncName ) == COMPARE_LESS);
+}
+
+//===================================================================
+// class ScFunctionList:
+//===================================================================
+
+ScFunctionList::ScFunctionList() :
+ nMaxFuncNameLen ( 0 )
+{
+ ScFuncDesc* pDesc = NULL;
+ xub_StrLen nStrLen = 0;
+ FuncCollection* pFuncColl;
+ ::std::list<ScFuncDesc*> tmpFuncList;
+ sal_uInt16 nDescBlock[] =
+ {
+ RID_SC_FUNCTION_DESCRIPTIONS1,
+ RID_SC_FUNCTION_DESCRIPTIONS2
+ };
+
+ for (sal_uInt16 k = 0; k < SAL_N_ELEMENTS(nDescBlock); ++k)
+ {
+ ::std::auto_ptr<ScResourcePublisher> pBlock( new ScResourcePublisher( ScResId( nDescBlock[k] ) ) );
+ // Browse for all possible OpCodes. This is not the fastest method, but
+ // otherwise the sub resources within the resource blocks and the
+ // resource blocks themselfs would had to be ordered according to
+ // OpCodes, which is utopian..
+ for (sal_uInt16 i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i)
+ {
+ ScResId aRes(i);
+ aRes.SetRT(RSC_RESOURCE);
+ // Sub resource of OpCode available?
+ if (pBlock->IsAvailableRes(aRes))
+ {
+ pDesc = new ScFuncDesc;
+ bool bSuppressed = false;
+ ScFuncRes aSubRes( aRes, pDesc, bSuppressed);
+ // Instead of dealing with this exceptional case at 1001 places
+ // we simply don't add an entirely suppressed function to the
+ // list and delete it.
+ if (bSuppressed)
+ delete pDesc;
+ else
+ {
+ pDesc->nFIndex = i;
+ tmpFuncList.push_back(pDesc);
+
+ nStrLen = (*(pDesc->pFuncName)).getLength();
+ if (nStrLen > nMaxFuncNameLen)
+ nMaxFuncNameLen = nStrLen;
+ }
+ }
+ }
+ }
+
+ sal_uInt16 nNextId = SC_OPCODE_LAST_OPCODE_ID + 1; // FuncID for AddIn functions
+
+ // Interpretation of AddIn list
+ ::rtl::OUString aDefArgNameValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"));
+ ::rtl::OUString aDefArgNameString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string"));
+ ::rtl::OUString aDefArgNameValues = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("values"));
+ ::rtl::OUString aDefArgNameStrings = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("strings"));
+ ::rtl::OUString aDefArgNameCells = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cells"));
+ ::rtl::OUString aDefArgNameNone = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("none"));
+ ::rtl::OUString aDefArgDescValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a value"));
+ ::rtl::OUString aDefArgDescString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a string"));
+ ::rtl::OUString aDefArgDescValues = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("array of values"));
+ ::rtl::OUString aDefArgDescStrings = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("array of strings"));
+ ::rtl::OUString aDefArgDescCells = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("range of cells"));
+ ::rtl::OUString aDefArgDescNone = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("none"));
+
+ ::rtl::OUString aArgName, aArgDesc;
+ pFuncColl = ScGlobal::GetFuncCollection();
+ for (sal_uInt16 i = 0; i < pFuncColl->GetCount(); ++i)
+ {
+ pDesc = new ScFuncDesc;
+ FuncData *pAddInFuncData = (FuncData*)pFuncColl->At(i);
+ sal_uInt16 nArgs = pAddInFuncData->GetParamCount() - 1;
+ pAddInFuncData->getParamDesc( aArgName, aArgDesc, 0 );
+ pDesc->nFIndex = nNextId++; // ??? OpCode vergeben
+ pDesc->nCategory = ID_FUNCTION_GRP_ADDINS;
+ pDesc->pFuncName = new ::rtl::OUString(pAddInFuncData->GetInternalName());
+ pDesc->pFuncName->toAsciiUpperCase();
+
+ ::rtl::OUStringBuffer aBuf(aArgDesc);
+ aBuf.append(sal_Unicode('\n'));
+ aBuf.appendAscii("( AddIn: ");
+ aBuf.append(pAddInFuncData->GetModuleName());
+ aBuf.appendAscii(" )");
+ pDesc->pFuncDesc = new ::rtl::OUString(aBuf.makeStringAndClear());
+
+ pDesc->nArgCount = nArgs;
+ if (nArgs)
+ {
+ pDesc->pDefArgFlags = new ScFuncDesc::ParameterFlags[nArgs];
+ pDesc->ppDefArgNames = new ::rtl::OUString*[nArgs];
+ pDesc->ppDefArgDescs = new ::rtl::OUString*[nArgs];
+ for (sal_uInt16 j = 0; j < nArgs; ++j)
+ {
+ pDesc->pDefArgFlags[j].bOptional = false;
+ pDesc->pDefArgFlags[j].bSuppress = false;
+ pAddInFuncData->getParamDesc( aArgName, aArgDesc, j+1 );
+ if ( aArgName.getLength() )
+ pDesc->ppDefArgNames[j] = new ::rtl::OUString( aArgName );
+ else
+ {
+ switch (pAddInFuncData->GetParamType(j+1))
+ {
+ case PTR_DOUBLE:
+ pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameValue );
+ break;
+ case PTR_STRING:
+ pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameString );
+ break;
+ case PTR_DOUBLE_ARR:
+ pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameValues );
+ break;
+ case PTR_STRING_ARR:
+ pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameStrings );
+ break;
+ case PTR_CELL_ARR:
+ pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameCells );
+ break;
+ default:
+ pDesc->ppDefArgNames[j] = new ::rtl::OUString( aDefArgNameNone );
+ break;
+ }
+ }
+ if ( aArgDesc.getLength() )
+ pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aArgDesc );
+ else
+ {
+ switch (pAddInFuncData->GetParamType(j+1))
+ {
+ case PTR_DOUBLE:
+ pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescValue );
+ break;
+ case PTR_STRING:
+ pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescString );
+ break;
+ case PTR_DOUBLE_ARR:
+ pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescValues );
+ break;
+ case PTR_STRING_ARR:
+ pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescStrings );
+ break;
+ case PTR_CELL_ARR:
+ pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescCells );
+ break;
+ default:
+ pDesc->ppDefArgDescs[j] = new ::rtl::OUString( aDefArgDescNone );
+ break;
+ }
+ }
+ }
+ }
+
+ tmpFuncList.push_back(pDesc);
+ nStrLen = (*(pDesc->pFuncName)).getLength();
+ if ( nStrLen > nMaxFuncNameLen)
+ nMaxFuncNameLen = nStrLen;
+ }
+
+ // StarOne AddIns
+
+ ScUnoAddInCollection* pUnoAddIns = ScGlobal::GetAddInCollection();
+ long nUnoCount = pUnoAddIns->GetFuncCount();
+ for (long nFunc=0; nFunc<nUnoCount; nFunc++)
+ {
+ pDesc = new ScFuncDesc;
+ pDesc->nFIndex = nNextId++;
+
+ if ( pUnoAddIns->FillFunctionDesc( nFunc, *pDesc ) )
+ {
+ tmpFuncList.push_back(pDesc);
+ nStrLen = (*(pDesc->pFuncName)).getLength();
+ if (nStrLen > nMaxFuncNameLen)
+ nMaxFuncNameLen = nStrLen;
+ }
+ else
+ delete pDesc;
+ }
+
+ //Move list to vector for better random access performance
+ ::std::vector<const ScFuncDesc*> tmp(tmpFuncList.begin(), tmpFuncList.end());
+ tmpFuncList.clear();
+ aFunctionList.swap(tmp);
+
+ //Initialize iterator
+ aFunctionListIter = aFunctionList.end();
+}
+
+ScFunctionList::~ScFunctionList()
+{
+ const ScFuncDesc* pDesc = First();
+ while (pDesc)
+ {
+ delete pDesc;
+ pDesc = Next();
+ }
+}
+
+const ScFuncDesc* ScFunctionList::First()
+{
+ const ScFuncDesc* pDesc = NULL;
+ aFunctionListIter = aFunctionList.begin();
+ if(aFunctionListIter != aFunctionList.end())
+ pDesc = *aFunctionListIter;
+
+ return pDesc;
+}
+
+const ScFuncDesc* ScFunctionList::Next()
+{
+ const ScFuncDesc* pDesc = NULL;
+ if(aFunctionListIter != aFunctionList.end())
+ {
+ if((++aFunctionListIter) != aFunctionList.end())
+ pDesc = *aFunctionListIter;
+ }
+ return pDesc;
+}
+
+const ScFuncDesc* ScFunctionList::GetFunction( sal_uInt32 nIndex ) const
+{
+ const ScFuncDesc* pDesc = NULL;
+ if(nIndex < aFunctionList.size())
+ pDesc = aFunctionList.at(nIndex);
+
+ return pDesc;
+}
+
+//===================================================================
+// class ScFunctionCategory:
+//===================================================================
+
+sal_uInt32 ScFunctionCategory::getCount() const
+{
+ return m_pCategory->size();
+}
+
+const formula::IFunctionManager* ScFunctionCategory::getFunctionManager() const
+{
+ return m_pMgr;
+}
+
+::rtl::OUString ScFunctionCategory::getName() const
+{
+ if ( !m_sName.getLength() )
+ m_sName = ScFunctionMgr::GetCategoryName(m_nCategory+1);
+ return m_sName;
+}
+
+const formula::IFunctionDescription* ScFunctionCategory::getFunction(sal_uInt32 _nPos) const
+{
+ const ScFuncDesc* pDesc = NULL;
+ if(_nPos < m_pCategory->size())
+ pDesc = m_pCategory->at(_nPos);
+ return pDesc;
+}
+
+sal_uInt32 ScFunctionCategory::getNumber() const
+{
+ return m_nCategory;
+}
+
+//========================================================================
+// class ScFunctionMgr:
+//========================================================================
+
+ScFunctionMgr::ScFunctionMgr() :
+ pFuncList( ScGlobal::GetStarCalcFunctionList() )
+{
+ DBG_ASSERT( pFuncList, "Functionlist not found." );
+ sal_uInt32 catCount[MAX_FUNCCAT] = {0};
+
+ aCatLists[0] = new ::std::vector<const ScFuncDesc*>();
+ aCatLists[0]->reserve(pFuncList->GetCount());
+
+ // Retrieve all functions, store in cumulative ("All") category, and count
+ // number of functions in each category
+ for(const ScFuncDesc* pDesc = pFuncList->First(); pDesc; pDesc = pFuncList->Next())
+ {
+ DBG_ASSERT((pDesc->nCategory) < MAX_FUNCCAT, "Unknown category");
+ if ((pDesc->nCategory) < MAX_FUNCCAT)
+ ++catCount[pDesc->nCategory];
+ aCatLists[0]->push_back(pDesc);
+ }
+
+ // Sort functions in cumulative category by name
+ ::std::sort(aCatLists[0]->begin(), aCatLists[0]->end(), ScFuncDesc::compareByName);
+
+ // Allocate correct amount of space for categories
+ for (sal_uInt16 i = 1; i < MAX_FUNCCAT; ++i)
+ {
+ aCatLists[i] = new ::std::vector<const ScFuncDesc*>();
+ aCatLists[i]->reserve(catCount[i]);
+ }
+
+ // Fill categories with the corresponding functions (still sorted by name)
+ for(::std::vector<const ScFuncDesc*>::iterator iter = aCatLists[0]->begin(); iter!=aCatLists[0]->end(); ++iter)
+ {
+ if (((*iter)->nCategory) < MAX_FUNCCAT)
+ aCatLists[(*iter)->nCategory]->push_back(*iter);
+ }
+
+ // Initialize iterators
+ pCurCatListIter = aCatLists[0]->end();
+ pCurCatListEnd = aCatLists[0]->end();
+}
+
+ScFunctionMgr::~ScFunctionMgr()
+{
+ for (sal_uInt16 i = 0; i < MAX_FUNCCAT; ++i)
+ delete aCatLists[i];
+}
+
+const ScFuncDesc* ScFunctionMgr::Get( const ::rtl::OUString& rFName ) const
+{
+ const ScFuncDesc* pDesc = NULL;
+ if (rFName.getLength() <= pFuncList->GetMaxFuncNameLen())
+ {
+ ::boost::scoped_ptr<ScFuncDesc> dummy(new ScFuncDesc);
+ dummy->pFuncName = new ::rtl::OUString(rFName);
+ ::std::vector<const ScFuncDesc*>::iterator lower =
+ ::std::lower_bound(aCatLists[0]->begin(), aCatLists[0]->end(),
+ static_cast<const ScFuncDesc*>(dummy.get()), ScFuncDesc::compareByName);
+
+ if(rFName.equalsIgnoreAsciiCase(*(*lower)->pFuncName))
+ pDesc = *lower;
+ }
+ return pDesc;
+}
+
+const ScFuncDesc* ScFunctionMgr::Get( sal_uInt16 nFIndex ) const
+{
+ const ScFuncDesc* pDesc;
+ for (pDesc = First(0); pDesc; pDesc = Next())
+ if (pDesc->nFIndex == nFIndex)
+ break;
+ return pDesc;
+}
+
+const ScFuncDesc* ScFunctionMgr::First( sal_uInt16 nCategory ) const
+{
+ DBG_ASSERT( nCategory < MAX_FUNCCAT, "Unbekannte Kategorie" );
+ const ScFuncDesc* pDesc = NULL;
+ if ( nCategory < MAX_FUNCCAT )
+ {
+ pCurCatListIter = aCatLists[nCategory]->begin();
+ pCurCatListEnd = aCatLists[nCategory]->end();
+ pDesc = *pCurCatListIter;
+ }
+ else
+ {
+ pCurCatListIter = aCatLists[0]->end();
+ pCurCatListEnd = aCatLists[0]->end();
+ }
+ return pDesc;
+}
+
+const ScFuncDesc* ScFunctionMgr::Next() const
+{
+ const ScFuncDesc* pDesc = NULL;
+ if ( pCurCatListIter != pCurCatListEnd )
+ {
+ if ( (++pCurCatListIter) != pCurCatListEnd )
+ {
+ pDesc = *pCurCatListIter;
+ }
+ }
+ return pDesc;
+}
+
+sal_uInt32 ScFunctionMgr::getCount() const
+{
+ return MAX_FUNCCAT - 1;
+}
+
+const formula::IFunctionCategory* ScFunctionMgr::getCategory(sal_uInt32 nCategory) const
+{
+ formula::IFunctionCategory* pRet = NULL;
+ if ( nCategory < (MAX_FUNCCAT-1) )
+ {
+ pRet = new ScFunctionCategory(const_cast<ScFunctionMgr*>(this),aCatLists[nCategory+1],nCategory); // aCatLists[0] is "all"
+ }
+ return pRet;
+}
+
+const formula::IFunctionDescription* ScFunctionMgr::getFunctionByName(const ::rtl::OUString& _sFunctionName) const
+{
+ return Get(_sFunctionName);
+}
+
+void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const
+{
+ const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
+ sal_uInt16 nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX );
+ sal_uInt16* pLRUListIds = rAppOpt.GetLRUFuncList();
+
+ if ( pLRUListIds )
+ {
+ for (sal_uInt16 i = 0; i < nLRUFuncCount; ++i)
+ _rLastRUFunctions.push_back( Get( pLRUListIds[i] ) );
+ }
+}
+
+::rtl::OUString ScFunctionMgr::GetCategoryName(sal_uInt32 _nCategoryNumber )
+{
+ if ( _nCategoryNumber > SC_FUNCGROUP_COUNT )
+ {
+ OSL_FAIL("Invalid category number!");
+ return ::rtl::OUString();
+ }
+
+ ::std::auto_ptr<ScResourcePublisher> pCategories( new ScResourcePublisher( ScResId( RID_FUNCTION_CATEGORIES ) ) );
+ return ResId::toString(ScResId(static_cast<sal_uInt16>(_nCategoryNumber)));
+}
+
+sal_Unicode ScFunctionMgr::getSingleToken(const formula::IFunctionManager::EToken _eToken) const
+{
+ switch(_eToken)
+ {
+ case eOk:
+ return ScCompiler::GetNativeSymbol(ocOpen).GetChar(0);
+ case eClose:
+ return ScCompiler::GetNativeSymbol(ocClose).GetChar(0);
+ case eSep:
+ return ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
+ case eArrayOpen:
+ return ScCompiler::GetNativeSymbol(ocArrayOpen).GetChar(0);
+ case eArrayClose:
+ return ScCompiler::GetNativeSymbol(ocArrayClose).GetChar(0);
+ }
+ return 0;
+}
+
+//========================================================================
+// class ScFuncRes:
+//========================================================================
+
+ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed )
+ : Resource(aRes)
+{
+ rbSuppressed = (bool)GetNum();
+ pDesc->nCategory = GetNum();
+ pDesc->nHelpId = GetNum() + 32768; //! Hack, see scfuncs.src
+ pDesc->nArgCount = GetNum();
+ sal_uInt16 nArgs = pDesc->nArgCount;
+ if (nArgs >= VAR_ARGS)
+ nArgs -= VAR_ARGS - 1;
+ if (nArgs)
+ {
+ pDesc->pDefArgFlags = new ScFuncDesc::ParameterFlags[nArgs];
+ for (sal_uInt16 i = 0; i < nArgs; ++i)
+ {
+ pDesc->pDefArgFlags[i].bOptional = (bool)GetNum();
+ }
+ }
+ // Need to read the value from the resource even if nArgs==0 to advance the
+ // resource position pointer, so this can't be in the if(nArgs) block above.
+ sal_uInt16 nSuppressed = GetNum();
+ if (nSuppressed)
+ {
+ if (nSuppressed > nArgs)
+ {
+ DBG_ERROR3( "ScFuncRes: suppressed parameters count mismatch on OpCode %u: suppressed %d > params %d",
+ aRes.GetId(), (int)nSuppressed, (int)nArgs);
+ nSuppressed = nArgs; // sanitize
+ }
+ for (sal_uInt16 i = 0; i < nSuppressed; ++i)
+ {
+ sal_uInt16 nParam = GetNum();
+ if (nParam < nArgs)
+ {
+ if (pDesc->nArgCount >= VAR_ARGS && nParam == nArgs-1)
+ {
+ DBG_ERROR3( "ScFuncRes: VAR_ARGS parameters can't be suppressed, on OpCode %u: param %d == arg %d-1",
+ aRes.GetId(), (int)nParam, (int)nArgs);
+ }
+ else
+ {
+ pDesc->pDefArgFlags[nParam].bSuppress = true;
+ pDesc->bHasSuppressedArgs = true;
+ }
+ }
+ else
+ {
+ DBG_ERROR3( "ScFuncRes: suppressed parameter exceeds count on OpCode %u: param %d >= args %d",
+ aRes.GetId(), (int)nParam, (int)nArgs);
+ }
+ }
+ }
+
+ pDesc->pFuncName = new ::rtl::OUString( ScCompiler::GetNativeSymbol( static_cast<OpCode>( aRes.GetId())));
+ pDesc->pFuncDesc = new ::rtl::OUString( ResId::toString(ScResId(1)));
+
+ if (nArgs)
+ {
+ pDesc->ppDefArgNames = new ::rtl::OUString*[nArgs];
+ pDesc->ppDefArgDescs = new ::rtl::OUString*[nArgs];
+ for (sal_uInt16 i = 0; i < nArgs; ++i)
+ {
+ pDesc->ppDefArgNames[i] = new ::rtl::OUString(ResId::toString(ScResId(2*(i+1) )));
+ pDesc->ppDefArgDescs[i] = new ::rtl::OUString(ResId::toString(ScResId(2*(i+1)+1)));
+ }
+ }
+
+ FreeResource();
+}
+
+sal_uInt16 ScFuncRes::GetNum()
+{
+ return ReadShortRes();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 0db09d4d50d9..57c517c9b977 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,7 @@
#include <svl/zformat.hxx>
#include <vcl/image.hxx>
#include <vcl/virdev.hxx>
+#include <sal/macros.h>
#include <tools/rcid.h>
#include <unotools/charclass.hxx>
#include <stdlib.h>
@@ -90,6 +92,9 @@
// -----------------------------------------------------------------------
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
#define CLIPST_AVAILABLE 0
#define CLIPST_CAPTURED 1
#define CLIPST_DELETE 2
@@ -124,7 +129,6 @@ SvxBrushItem* ScGlobal::pEmbeddedBrushItem = NULL;
SvxBrushItem* ScGlobal::pProtectedBrushItem = NULL;
ImageList* ScGlobal::pOutlineBitmaps = NULL;
-ImageList* ScGlobal::pOutlineBitmapsHC = NULL;
ScFunctionList* ScGlobal::pStarCalcFunctionList = NULL;
ScFunctionMgr* ScGlobal::pStarCalcFunctionMgr = NULL;
@@ -164,7 +168,7 @@ sal_Bool ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs,
const SfxItemSet& rOldAttrs,
const sal_uInt16 nWhich )
{
- sal_Bool bInvalidate = sal_False;
+ sal_Bool bInvalidate = false;
const SfxItemState eNewState = rNewAttrs.GetItemState( nWhich );
const SfxItemState eOldState = rOldAttrs.GetItemState( nWhich );
@@ -216,7 +220,6 @@ sal_uLong ScGlobal::GetStandardFormat( double fNumber, SvNumberFormatter& rForma
}
-// static
SvNumberFormatter* ScGlobal::GetEnglishFormatter()
{
if ( !pEnglishFormatter )
@@ -522,11 +525,11 @@ const String& ScGlobal::GetEmptyString()
return *pEmptyString;
}
-ImageList* ScGlobal::GetOutlineSymbols( bool bHC )
+ImageList* ScGlobal::GetOutlineSymbols()
{
- ImageList*& rpImageList = bHC ? pOutlineBitmapsHC : pOutlineBitmaps;
+ ImageList*& rpImageList = pOutlineBitmaps;
if( !rpImageList )
- rpImageList = new ImageList( ScResId( bHC ? RID_OUTLINEBITMAPS_H : RID_OUTLINEBITMAPS ) );
+ rpImageList = new ImageList( ScResId( RID_OUTLINEBITMAPS ) );
return rpImageList;
}
@@ -603,18 +606,17 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
{
if (!pPool)
{
- DBG_ERROR("kein Pool bei ScGlobal::InitTextHeight");
+ OSL_FAIL("kein Pool bei ScGlobal::InitTextHeight");
return;
}
const ScPatternAttr* pPattern = (const ScPatternAttr*)&pPool->GetDefaultItem(ATTR_PATTERN);
if (!pPattern)
{
- DBG_ERROR("kein Default-Pattern bei ScGlobal::InitTextHeight");
+ OSL_FAIL("kein Default-Pattern bei ScGlobal::InitTextHeight");
return;
}
-// String aTestString('X');
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
VirtualDevice aVirtWindow( *pDefaultDev );
aVirtWindow.SetMapMode(MAP_PIXEL);
@@ -658,9 +660,6 @@ void ScGlobal::Clear()
DELETEZ(pEmbeddedBrushItem);
DELETEZ(pProtectedBrushItem);
DELETEZ(pOutlineBitmaps);
- DELETEZ(pOutlineBitmapsHC);
-// DELETEZ(pAnchorBitmap);
-// DELETEZ(pGrayAnchorBitmap);
DELETEZ(pEnglishFormatter);
DELETEZ(pCaseTransliteration);
DELETEZ(pTransliteration);
@@ -685,7 +684,6 @@ void ScGlobal::Clear()
//------------------------------------------------------------------------
-// static
CharSet ScGlobal::GetCharsetValue( const String& rCharSet )
{
// new TextEncoding values
@@ -706,13 +704,11 @@ CharSet ScGlobal::GetCharsetValue( const String& rCharSet )
else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_861")) return RTL_TEXTENCODING_IBM_861;
else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_863")) return RTL_TEXTENCODING_IBM_863;
else if (rCharSet.EqualsIgnoreCaseAscii("IBMPC_865")) return RTL_TEXTENCODING_IBM_865;
-// else if (rCharSet.EqualsIgnoreCaseAscii("SYSTEM") ) return gsl_getSystemTextEncoding();
else return gsl_getSystemTextEncoding();
}
//------------------------------------------------------------------------
-// static
String ScGlobal::GetCharsetString( CharSet eVal )
{
const sal_Char* pChar;
@@ -771,7 +767,6 @@ void ScGlobal::ResetFunctionList()
//------------------------------------------------------------------------
-// static
ScUnitConverter* ScGlobal::GetUnitConverter()
{
if ( !pUnitConverter )
@@ -783,7 +778,6 @@ ScUnitConverter* ScGlobal::GetUnitConverter()
//------------------------------------------------------------------------
-// static
const sal_Unicode* ScGlobal::UnicodeStrChr( const sal_Unicode* pStr,
sal_Unicode c )
{
@@ -900,10 +894,10 @@ sal_Bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
// first test for equal text content
sal_uInt16 nParCount = pObj1->GetParagraphCount();
if ( nParCount != pObj2->GetParagraphCount() )
- return sal_False;
+ return false;
for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
if ( pObj1->GetText(nPar) != pObj2->GetText(nPar) )
- return sal_False;
+ return false;
SvMemoryStream aStream1;
SvMemoryStream aStream2;
@@ -915,7 +909,7 @@ sal_Bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
return sal_True;
}
- return sal_False;
+ return false;
}
void ScGlobal::OpenURL( const String& rURL, const String& rTarget )
@@ -943,10 +937,10 @@ void ScGlobal::OpenURL( const String& rURL, const String& rTarget )
SfxFrameItem aFrm( SID_DOCFRAME, pFrame );
SfxStringItem aReferer( SID_REFERER, aReferName );
- SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, sal_False );
+ SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
SfxBoolItem aBrowsing( SID_BROWSE, sal_True );
- // kein SID_SILENT mehr wegen Bug #42525# (war angeblich sowieso falsch)
+ // kein SID_SILENT mehr
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
@@ -1074,11 +1068,11 @@ sal_uInt16 ScGlobal::GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhic
void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter )
{
- DBG_ASSERT( rSet.GetItemState( ATTR_LANGUAGE_FORMAT, sal_False ) == SFX_ITEM_DEFAULT,
+ DBG_ASSERT( rSet.GetItemState( ATTR_LANGUAGE_FORMAT, false ) == SFX_ITEM_DEFAULT,
"ScGlobal::AddLanguage - language already added");
const SfxPoolItem* pHardItem;
- if ( rSet.GetItemState( ATTR_VALUE_FORMAT, sal_False, &pHardItem ) == SFX_ITEM_SET )
+ if ( rSet.GetItemState( ATTR_VALUE_FORMAT, false, &pHardItem ) == SFX_ITEM_SET )
{
const SvNumberformat* pHardFormat = rFormatter.GetEntry(
((const SfxUInt32Item*)pHardItem)->GetValue() );
@@ -1096,824 +1090,13 @@ void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter )
}
-
-
-
-//===================================================================
-// class ScFunctionList:
-//===================================================================
-
-//===================================================================
-// class ScFuncRes
-// fuer temporaere Objekte zum Holen der Resourcen
-
-class ScFuncRes : public Resource
-{
-public:
- ScFuncRes( ResId&, ScFuncDesc*, bool & rbSuppressed );
-
-private:
- sal_uInt16 GetNum();
-};
-
//--------------------------------------------------------------------
-ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed )
- : Resource(aRes)
-{
- rbSuppressed = (bool)GetNum();
- pDesc->nCategory = GetNum();
- pDesc->sHelpId = ReadByteStringRes(); //! Hack, see scfuncs.src
- pDesc->nArgCount = GetNum();
- sal_uInt16 nArgs = pDesc->nArgCount;
- if (nArgs >= VAR_ARGS)
- nArgs -= VAR_ARGS - 1;
- if (nArgs)
- {
- pDesc->pDefArgFlags = new ScFuncDesc::ParameterFlags[nArgs];
- for (sal_uInt16 i = 0; i < nArgs; i++)
- {
- pDesc->pDefArgFlags[i].bOptional = (bool)GetNum();
- }
- }
- // Need to read the value from the resource even if nArgs==0 to advance the
- // resource position pointer, so this can't be in the if(nArgs) block above.
- sal_uInt16 nSuppressed = GetNum();
- if (nSuppressed)
- {
- if (nSuppressed > nArgs)
- {
- DBG_ERROR3( "ScFuncRes: suppressed parameters count mismatch on OpCode %u: suppressed %d > params %d",
- aRes.GetId(), (int)nSuppressed, (int)nArgs);
- nSuppressed = nArgs; // sanitize
- }
- for (sal_uInt16 i=0; i < nSuppressed; ++i)
- {
- sal_uInt16 nParam = GetNum();
- if (nParam < nArgs)
- {
- if (pDesc->nArgCount >= VAR_ARGS && nParam == nArgs-1)
- {
- DBG_ERROR3( "ScFuncRes: VAR_ARGS parameters can't be suppressed, on OpCode %u: param %d == arg %d-1",
- aRes.GetId(), (int)nParam, (int)nArgs);
- }
- else
- {
- pDesc->pDefArgFlags[nParam].bSuppress = true;
- pDesc->bHasSuppressedArgs = true;
- }
- }
- else
- {
- DBG_ERROR3( "ScFuncRes: suppressed parameter exceeds count on OpCode %u: param %d >= args %d",
- aRes.GetId(), (int)nParam, (int)nArgs);
- }
- }
- }
-
- pDesc->pFuncName = new String( ScCompiler::GetNativeSymbol( static_cast<OpCode>( aRes.GetId())));
- pDesc->pFuncDesc = new String(ScResId(1));
-
- if (nArgs)
- {
- pDesc->ppDefArgNames = new String*[nArgs];
- pDesc->ppDefArgDescs = new String*[nArgs];
- for (sal_uInt16 i = 0; i < nArgs; i++)
- {
- pDesc->ppDefArgNames[i] = new String(ScResId(2*(i+1) ));
- pDesc->ppDefArgDescs[i] = new String(ScResId(2*(i+1)+1));
- }
- }
-
- FreeResource();
-}
-
-//------------------------------------------------------------------------
-
-sal_uInt16 ScFuncRes::GetNum()
-{
- return ReadShortRes();
-}
-
-//=========================================================================
-
-// um an die protected von Resource ranzukommen
-class ScResourcePublisher : public Resource
-{
-private:
- void FreeResource() { Resource::FreeResource(); }
-public:
- ScResourcePublisher( const ScResId& rId ) : Resource( rId ) {}
- ~ScResourcePublisher() { FreeResource(); }
- sal_Bool IsAvailableRes( const ResId& rId ) const
- { return Resource::IsAvailableRes( rId ); }
-
-};
-
-
-ScFunctionList::ScFunctionList() :
- nMaxFuncNameLen ( 0 )
-{
- ScFuncDesc* pDesc = NULL;
- xub_StrLen nStrLen = 0;
- FuncCollection* pFuncColl;
- sal_uInt16 i,j;
- sal_uInt16 nDescBlock[] =
- {
- RID_SC_FUNCTION_DESCRIPTIONS1,
- RID_SC_FUNCTION_DESCRIPTIONS2
- };
- const sal_uInt16 nBlocks = sizeof(nDescBlock) / sizeof(sal_uInt16);
-
- aFunctionList.Clear();
-
- for ( sal_uInt16 k = 0; k < nBlocks; k++ )
- {
- ::std::auto_ptr<ScResourcePublisher> pBlock( new ScResourcePublisher( ScResId( nDescBlock[k] ) ) );
- // Browse for all possible OpCodes. This is not the fastest method, but
- // otherwise the sub resources within the resource blocks and the
- // resource blocks themselfs would had to be ordered according to
- // OpCodes, which is utopian..
- for (i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; i++)
- {
- ScResId aRes(i);
- aRes.SetRT(RSC_RESOURCE);
- // Sub resource of OpCode available?
- if (pBlock->IsAvailableRes(aRes))
- {
- pDesc = new ScFuncDesc;
- bool bSuppressed = false;
- ScFuncRes aSubRes( aRes, pDesc, bSuppressed);
- // Instead of dealing with this exceptional case at 1001 places
- // we simply don't add an entirely suppressed function to the
- // list and delete it.
- if (bSuppressed)
- delete pDesc;
- else
- {
- pDesc->nFIndex = i;
- aFunctionList.Insert( pDesc, LIST_APPEND );
-
- nStrLen = (*(pDesc->pFuncName)).Len();
- if (nStrLen > nMaxFuncNameLen)
- nMaxFuncNameLen = nStrLen;
- }
- }
- }
- }
-
- sal_uInt16 nNextId = SC_OPCODE_LAST_OPCODE_ID + 1; // FuncID for AddIn functions
-
- // Auswertung AddIn-Liste
- String aDefArgNameValue(RTL_CONSTASCII_STRINGPARAM("value"));
- String aDefArgNameString(RTL_CONSTASCII_STRINGPARAM("string"));
- String aDefArgNameValues(RTL_CONSTASCII_STRINGPARAM("values"));
- String aDefArgNameStrings(RTL_CONSTASCII_STRINGPARAM("strings"));
- String aDefArgNameCells(RTL_CONSTASCII_STRINGPARAM("cells"));
- String aDefArgNameNone(RTL_CONSTASCII_STRINGPARAM("none"));
- String aDefArgDescValue(RTL_CONSTASCII_STRINGPARAM("a value"));
- String aDefArgDescString(RTL_CONSTASCII_STRINGPARAM("a string"));
- String aDefArgDescValues(RTL_CONSTASCII_STRINGPARAM("array of values"));
- String aDefArgDescStrings(RTL_CONSTASCII_STRINGPARAM("array of strings"));
- String aDefArgDescCells(RTL_CONSTASCII_STRINGPARAM("range of cells"));
- String aDefArgDescNone(RTL_CONSTASCII_STRINGPARAM("none"));
- String aArgName, aArgDesc;
- pFuncColl = ScGlobal::GetFuncCollection();
- for (i = 0; i < pFuncColl->GetCount(); i++)
- {
- pDesc = new ScFuncDesc;
- FuncData *pAddInFuncData = (FuncData*)pFuncColl->At(i);
- sal_uInt16 nArgs = pAddInFuncData->GetParamCount() - 1;
- pAddInFuncData->GetParamDesc( aArgName, aArgDesc, 0 );
- pDesc->nFIndex = nNextId++; // ??? OpCode vergeben
- pDesc->nCategory = ID_FUNCTION_GRP_ADDINS;
- pDesc->pFuncName = new String(pAddInFuncData->GetInternalName());
- pDesc->pFuncName->ToUpperAscii();
- pDesc->pFuncDesc = new String( aArgDesc );
- *(pDesc->pFuncDesc) += '\n';
- pDesc->pFuncDesc->AppendAscii(RTL_CONSTASCII_STRINGPARAM( "( AddIn: " ));
- *(pDesc->pFuncDesc) += pAddInFuncData->GetModuleName();
- pDesc->pFuncDesc->AppendAscii(RTL_CONSTASCII_STRINGPARAM( " )" ));
- pDesc->nArgCount = nArgs;
- if (nArgs)
- {
- pDesc->pDefArgFlags = new ScFuncDesc::ParameterFlags[nArgs];
- pDesc->ppDefArgNames = new String*[nArgs];
- pDesc->ppDefArgDescs = new String*[nArgs];
- for (j = 0; j < nArgs; j++)
- {
- pDesc->pDefArgFlags[j].bOptional = false;
- pDesc->pDefArgFlags[j].bSuppress = false;
- pAddInFuncData->GetParamDesc( aArgName, aArgDesc, j+1 );
- if ( aArgName.Len() )
- pDesc->ppDefArgNames[j] = new String( aArgName );
- else
- {
- switch (pAddInFuncData->GetParamType(j+1))
- {
- case PTR_DOUBLE:
- pDesc->ppDefArgNames[j] = new String( aDefArgNameValue );
- break;
- case PTR_STRING:
- pDesc->ppDefArgNames[j] = new String( aDefArgNameString );
- break;
- case PTR_DOUBLE_ARR:
- pDesc->ppDefArgNames[j] = new String( aDefArgNameValues );
- break;
- case PTR_STRING_ARR:
- pDesc->ppDefArgNames[j] = new String( aDefArgNameStrings );
- break;
- case PTR_CELL_ARR:
- pDesc->ppDefArgNames[j] = new String( aDefArgNameCells );
- break;
- default:
- pDesc->ppDefArgNames[j] = new String( aDefArgNameNone );
- break;
- }
- }
- if ( aArgDesc.Len() )
- pDesc->ppDefArgDescs[j] = new String( aArgDesc );
- else
- {
- switch (pAddInFuncData->GetParamType(j+1))
- {
- case PTR_DOUBLE:
- pDesc->ppDefArgDescs[j] = new String( aDefArgDescValue );
- break;
- case PTR_STRING:
- pDesc->ppDefArgDescs[j] = new String( aDefArgDescString );
- break;
- case PTR_DOUBLE_ARR:
- pDesc->ppDefArgDescs[j] = new String( aDefArgDescValues );
- break;
- case PTR_STRING_ARR:
- pDesc->ppDefArgDescs[j] = new String( aDefArgDescStrings );
- break;
- case PTR_CELL_ARR:
- pDesc->ppDefArgDescs[j] = new String( aDefArgDescCells );
- break;
- default:
- pDesc->ppDefArgDescs[j] = new String( aDefArgDescNone );
- break;
- }
- }
- }
- }
-// pDesc->nHelpId = 0;
-
- aFunctionList.Insert(pDesc, LIST_APPEND);
- nStrLen = (*(pDesc->pFuncName)).Len();
- if ( nStrLen > nMaxFuncNameLen)
- nMaxFuncNameLen = nStrLen;
- }
-
- // StarOne AddIns
-
- ScUnoAddInCollection* pUnoAddIns = ScGlobal::GetAddInCollection();
- long nUnoCount = pUnoAddIns->GetFuncCount();
- for (long nFunc=0; nFunc<nUnoCount; nFunc++)
- {
- pDesc = new ScFuncDesc;
- pDesc->nFIndex = nNextId++;
-
- if ( pUnoAddIns->FillFunctionDesc( nFunc, *pDesc ) )
- {
- aFunctionList.Insert(pDesc, LIST_APPEND);
- nStrLen = (*(pDesc->pFuncName)).Len();
- if (nStrLen > nMaxFuncNameLen)
- nMaxFuncNameLen = nStrLen;
- }
- else
- delete pDesc;
- }
-}
-
-//------------------------------------------------------------------------
-
-ScFunctionList::~ScFunctionList()
-{
- const ScFuncDesc* pDesc = First();
- while (pDesc)
- {
- delete pDesc;
- pDesc = Next();
- }
-}
-
-
-//========================================================================
-// class ScFuncDesc:
-
-ScFuncDesc::ScFuncDesc() :
- pFuncName (NULL),
- pFuncDesc (NULL),
- ppDefArgNames (NULL),
- ppDefArgDescs (NULL),
- pDefArgFlags (NULL),
- nFIndex (0),
- nCategory (0),
- nArgCount (0),
- bIncomplete (false),
- bHasSuppressedArgs(false)
-{}
-
-//------------------------------------------------------------------------
-
-ScFuncDesc::~ScFuncDesc()
-{
- Clear();
-}
-
-//------------------------------------------------------------------------
-
-void ScFuncDesc::Clear()
-{
- sal_uInt16 nArgs = nArgCount;
- if (nArgs >= VAR_ARGS) nArgs -= VAR_ARGS-1;
- if (nArgs)
- {
- for (sal_uInt16 i=0; i<nArgs; i++ )
- {
- delete ppDefArgNames[i];
- delete ppDefArgDescs[i];
- }
- delete [] ppDefArgNames;
- delete [] ppDefArgDescs;
- delete [] pDefArgFlags;
- }
- nArgCount = 0;
- ppDefArgNames = NULL;
- ppDefArgDescs = NULL;
- pDefArgFlags = NULL;
-
- delete pFuncName;
- pFuncName = NULL;
-
- delete pFuncDesc;
- pFuncDesc = NULL;
-
- nFIndex = 0;
- nCategory = 0;
- sHelpId = "";
- bIncomplete = false;
- bHasSuppressedArgs = false;
-}
-
-//------------------------------------------------------------------------
-
-String ScFuncDesc::GetParamList() const
-{
- const String& sep = ScCompiler::GetNativeSymbol(ocSep);
-
- String aSig;
-
- if ( nArgCount > 0 )
- {
- if ( nArgCount < VAR_ARGS )
- {
- sal_uInt16 nLastSuppressed = nArgCount;
- sal_uInt16 nLastAdded = nArgCount;
- for ( sal_uInt16 i=0; i<nArgCount; i++ )
- {
- if (pDefArgFlags[i].bSuppress)
- nLastSuppressed = i;
- else
- {
- nLastAdded = i;
- aSig += *(ppDefArgNames[i]);
- if ( i != nArgCount-1 )
- {
- aSig.Append(sep);
- aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
- }
- }
- }
- // If only suppressed parameters follow the last added parameter,
- // remove one "; "
- if (nLastSuppressed < nArgCount && nLastAdded < nLastSuppressed &&
- aSig.Len() >= 2)
- aSig.Erase( aSig.Len() - 2 );
- }
- else
- {
- sal_uInt16 nFix = nArgCount - VAR_ARGS;
- for ( sal_uInt16 nArg = 0; nArg < nFix; nArg++ )
- {
- if (!pDefArgFlags[nArg].bSuppress)
- {
- aSig += *(ppDefArgNames[nArg]);
- aSig.Append(sep);
- aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
- }
- }
- /* NOTE: Currently there are no suppressed var args parameters. If
- * there were, we'd have to cope with it here and above for the fix
- * parameters. For now parameters are always added, so no special
- * treatment of a trailing "; " necessary. */
- aSig += *(ppDefArgNames[nFix]);
- aSig += '1';
- aSig.Append(sep);
- aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
- aSig += *(ppDefArgNames[nFix]);
- aSig += '2';
- aSig.Append(sep);
- aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ... " ));
- }
- }
-
- return aSig;
-}
-
-//------------------------------------------------------------------------
-
-String ScFuncDesc::GetSignature() const
-{
- String aSig;
-
- if(pFuncName)
- {
- aSig = *pFuncName;
-
- String aParamList( GetParamList() );
- if( aParamList.Len() )
- {
- aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "( " ));
- aSig.Append( aParamList );
- // U+00A0 (NBSP) prevents automatic line break
- aSig.Append( static_cast< sal_Unicode >(0xA0) ).Append( ')' );
- }
- else
- aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "()" ));
- }
- return aSig;
-}
-
-//------------------------------------------------------------------------
-
-::rtl::OUString ScFuncDesc::getFormula( const ::std::vector< ::rtl::OUString >& _aArguments ) const
-{
- const String& sep = ScCompiler::GetNativeSymbol(ocSep);
-
- ::rtl::OUStringBuffer aFormula;
-
- if(pFuncName)
- {
- aFormula.append( *pFuncName );
-
- aFormula.appendAscii( "(" );
- ::std::vector< ::rtl::OUString >::const_iterator aIter = _aArguments.begin();
- ::std::vector< ::rtl::OUString >::const_iterator aEnd = _aArguments.end();
-
- if ( nArgCount > 0 && aIter != aEnd )
- {
- sal_Bool bLastArg = ( aIter->getLength() == 0 );
-
- while( aIter != aEnd && !bLastArg )
- {
- aFormula.append( *(aIter) );
- if ( aIter != (aEnd-1) )
- {
- bLastArg = !( (aIter+1)->getLength() > 0 );
- if ( !bLastArg )
- aFormula.append( sep );
- }
-
- ++aIter;
- }
- }
-
- aFormula.appendAscii( ")" );
- }
- return aFormula.makeStringAndClear();
-}
-
-//------------------------------------------------------------------------
-
-sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const
-{
- if (!bHasSuppressedArgs || !pDefArgFlags)
- return nArgCount;
-
- sal_uInt16 nArgs = nArgCount;
- if (nArgs >= VAR_ARGS)
- nArgs -= VAR_ARGS - 1;
- sal_uInt16 nCount = nArgs;
- for (sal_uInt16 i=0; i < nArgs; ++i)
- {
- if (pDefArgFlags[i].bSuppress)
- --nCount;
- }
- if (nArgCount >= VAR_ARGS)
- nCount += VAR_ARGS - 1;
- return nCount;
-}
-
-//------------------------------------------------------------------------
-
-::rtl::OUString ScFuncDesc::getFunctionName() const
-{
- ::rtl::OUString sRet;
- if ( pFuncName )
- sRet = *pFuncName;
- return sRet;
-}
-// -----------------------------------------------------------------------------
-const formula::IFunctionCategory* ScFuncDesc::getCategory() const
-{
- return ScGlobal::GetStarCalcFunctionMgr()->getCategory(nCategory);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ScFuncDesc::getDescription() const
-{
- ::rtl::OUString sRet;
- if ( pFuncDesc )
- sRet = *pFuncDesc;
- return sRet;
-}
-// -----------------------------------------------------------------------------
-// GetSuppressedArgCount
-xub_StrLen ScFuncDesc::getSuppressedArgumentCount() const
-{
- return GetSuppressedArgCount();
-}
-// -----------------------------------------------------------------------------
-//
-void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const
-{
- if (!bHasSuppressedArgs || !pDefArgFlags)
- {
- _rArguments.resize( nArgCount);
- ::std::iota( _rArguments.begin(), _rArguments.end(), 0);
- }
-
- _rArguments.reserve( nArgCount);
- sal_uInt16 nArgs = nArgCount;
- if (nArgs >= VAR_ARGS)
- nArgs -= VAR_ARGS - 1;
- for (sal_uInt16 i=0; i < nArgs; ++i)
- {
- if (!pDefArgFlags[i].bSuppress)
- _rArguments.push_back(i);
- }
-}
-// -----------------------------------------------------------------------------
-void ScFuncDesc::initArgumentInfo() const
-{
- // get the full argument description
- // (add-in has to be instantiated to get the type information)
-
- if ( bIncomplete && pFuncName )
- {
- ScUnoAddInCollection& rAddIns = *ScGlobal::GetAddInCollection();
- String aIntName = rAddIns.FindFunction( *pFuncName, sal_True ); // pFuncName is upper-case
-
- if ( aIntName.Len() )
- {
- // GetFuncData with bComplete=true loads the component and updates
- // the global function list if needed.
-
- rAddIns.GetFuncData( aIntName, true );
- }
-
- if ( bIncomplete )
- {
- DBG_ERRORFILE( "couldn't initialize add-in function" );
- const_cast<ScFuncDesc*>(this)->bIncomplete = sal_False; // even if there was an error, don't try again
- }
- }
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ScFuncDesc::getSignature() const
-{
- return GetSignature();
-}
-// -----------------------------------------------------------------------------
-rtl::OString ScFuncDesc::getHelpId() const
-{
- return sHelpId;
-}
-// -----------------------------------------------------------------------------
-
-// parameter
-sal_uInt32 ScFuncDesc::getParameterCount() const
-{
- return nArgCount;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ScFuncDesc::getParameterName(sal_uInt32 _nPos) const
-{
- return *(ppDefArgNames[_nPos]);
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ScFuncDesc::getParameterDescription(sal_uInt32 _nPos) const
-{
- return *(ppDefArgDescs[_nPos]);
-}
-// -----------------------------------------------------------------------------
-bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const
-{
- return pDefArgFlags[_nPos].bOptional;
-}
-// -----------------------------------------------------------------------------
-//========================================================================
-// class ScFunctionMgr:
-
-ScFunctionMgr::ScFunctionMgr()
- : pFuncList ( ScGlobal::GetStarCalcFunctionList() ),
- pCurCatList ( NULL )
-{
- DBG_ASSERT( pFuncList, "Funktionsliste nicht gefunden." );
- sal_uLong nCount = pFuncList->GetCount();
- const ScFuncDesc* pDesc;
- List* pRootList;
- sal_uLong n;
-
- for ( sal_uInt16 i=0; i<MAX_FUNCCAT; i++ ) // Kategorie-Listen erstellen
- aCatLists[i] = new List;
-
- pRootList = aCatLists[0]; // Gesamtliste ("Alle") erstellen
- CollatorWrapper* pCaseCollator = ScGlobal::GetCaseCollator();
- for ( n=0; n<nCount; n++ )
- {
- sal_uLong nTmpCnt=0;
- pDesc = pFuncList->GetFunction(n);
- for (nTmpCnt = 0; nTmpCnt < n; nTmpCnt++)
- {
- // ist zwar case-sensitiv, aber Umlaute muessen richtig einsortiert werden
-
- const ScFuncDesc* pTmpDesc = (const ScFuncDesc*)pRootList->GetObject(nTmpCnt);
- if ( pCaseCollator->compareString(*pDesc->pFuncName, *pTmpDesc->pFuncName ) == COMPARE_LESS )
- break;
- }
- pRootList->Insert((void*)pDesc, nTmpCnt); // Einsortieren
- }
-
- for ( n=0; n<nCount; n++ ) // in Gruppenlisten kopieren
- {
- pDesc = (const ScFuncDesc*)pRootList->GetObject(n);
- DBG_ASSERT((pDesc->nCategory) < MAX_FUNCCAT, "Unbekannte Kategorie");
- if ((pDesc->nCategory) < MAX_FUNCCAT)
- aCatLists[pDesc->nCategory]->Insert((void*)pDesc, LIST_APPEND);
- }
-}
-
-//------------------------------------------------------------------------
-
-ScFunctionMgr::~ScFunctionMgr()
-{
- for (sal_uInt16 i = 0; i < MAX_FUNCCAT; i++)
- delete aCatLists[i];
-// delete pFuncList; // Macht spaeter die App
-}
-
-//------------------------------------------------------------------------
-
-const ScFuncDesc* ScFunctionMgr::Get( const String& rFName ) const
-{
- const ScFuncDesc* pDesc = NULL;
- if (rFName.Len() <= pFuncList->GetMaxFuncNameLen())
- for (pDesc = First(0); pDesc; pDesc = Next())
- if (rFName.EqualsIgnoreCaseAscii(*(pDesc->pFuncName)))
- break;
- return pDesc;
-}
-
-//------------------------------------------------------------------------
-const ScFuncDesc* ScFunctionMgr::Get( sal_uInt16 nFIndex ) const
-{
- const ScFuncDesc* pDesc;
- for (pDesc = First(0); pDesc; pDesc = Next())
- if (pDesc->nFIndex == nFIndex)
- break;
- return pDesc;
-}
//------------------------------------------------------------------------
-const ScFuncDesc* ScFunctionMgr::First( sal_uInt16 nCategory ) const
-{
- DBG_ASSERT( nCategory < MAX_FUNCCAT, "Unbekannte Kategorie" );
-
- if ( nCategory < MAX_FUNCCAT )
- {
- pCurCatList = aCatLists[nCategory];
- return (const ScFuncDesc*)pCurCatList->First();
- }
- else
- {
- pCurCatList = NULL;
- return NULL;
- }
-}
-
-//------------------------------------------------------------------------
-
-const ScFuncDesc* ScFunctionMgr::Next() const
-{
- if ( pCurCatList )
- return (const ScFuncDesc*)pCurCatList->Next();
- else
- return NULL;
-}
-sal_uInt32 ScFunctionMgr::getCount() const
-{
- return MAX_FUNCCAT - 1;
-}
-const formula::IFunctionCategory* ScFunctionMgr::getCategory(sal_uInt32 nCategory) const
-{
- formula::IFunctionCategory* pRet = NULL;
- if ( nCategory < (MAX_FUNCCAT-1) )
- {
- pRet = new ScFunctionCategory(const_cast<ScFunctionMgr*>(this),aCatLists[nCategory+1],nCategory); // aCatLists[0] is "all"
- }
- return pRet;
-}
-// -----------------------------------------------------------------------------
-const formula::IFunctionDescription* ScFunctionMgr::getFunctionByName(const ::rtl::OUString& _sFunctionName) const
-{
- return Get(_sFunctionName);
-}
-// -----------------------------------------------------------------------------
-void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const
-{
-#define LRU_MAX 10
-
- const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
- sal_uInt16 nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX );
- sal_uInt16* pLRUListIds = rAppOpt.GetLRUFuncList();
-
- if ( pLRUListIds )
- {
- for ( sal_uInt16 i=0; i<nLRUFuncCount; i++ )
- _rLastRUFunctions.push_back( Get( pLRUListIds[i] ) );
- }
-}
-// -----------------------------------------------------------------------------
-String ScFunctionMgr::GetCategoryName(sal_uInt32 _nCategoryNumber )
-{
- if ( _nCategoryNumber > SC_FUNCGROUP_COUNT )
- {
- DBG_ERROR("Invalid category number!");
- return String();
- } // if ( _nCategoryNumber >= SC_FUNCGROUP_COUNT )
-
- ::std::auto_ptr<ScResourcePublisher> pCategories( new ScResourcePublisher( ScResId( RID_FUNCTION_CATEGORIES ) ) );
- return String(ScResId((sal_uInt16)_nCategoryNumber));
-}
-sal_Unicode ScFunctionMgr::getSingleToken(const formula::IFunctionManager::EToken _eToken) const
-{
- switch(_eToken)
- {
- case eOk:
- return ScCompiler::GetNativeSymbol(ocOpen).GetChar(0);
- case eClose:
- return ScCompiler::GetNativeSymbol(ocClose).GetChar(0);
- case eSep:
- return ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
- case eArrayOpen:
- return ScCompiler::GetNativeSymbol(ocArrayOpen).GetChar(0);
- case eArrayClose:
- return ScCompiler::GetNativeSymbol(ocArrayClose).GetChar(0);
- } // switch(_eToken)
- return 0;
-}
-// -----------------------------------------------------------------------------
-sal_uInt32 ScFunctionCategory::getCount() const
-{
- return m_pCategory->Count();
-}
-// -----------------------------------------------------------------------------
-const formula::IFunctionManager* ScFunctionCategory::getFunctionManager() const
-{
- return m_pMgr;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString ScFunctionCategory::getName() const
-{
- if ( !m_sName.getLength() )
- m_sName = ScFunctionMgr::GetCategoryName(m_nCategory+1);
- return m_sName;
-}
-// -----------------------------------------------------------------------------
-const formula::IFunctionDescription* ScFunctionCategory::getFunction(sal_uInt32 _nPos) const
-{
- const ScFuncDesc* pDesc = NULL;
- sal_uInt32 i = 0;
- for (pDesc = (const ScFuncDesc*)m_pCategory->First(); i < _nPos && pDesc; pDesc = (const ScFuncDesc*)m_pCategory->Next(),++i)
- ;
- return pDesc;
-}
-// -----------------------------------------------------------------------------
-sal_uInt32 ScFunctionCategory::getNumber() const
-{
- return m_nCategory;
-}
-// -----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------
-
-utl::TransliterationWrapper* ScGlobal::GetpTransliteration() //add by CHINA001
+utl::TransliterationWrapper* ScGlobal::GetpTransliteration()
{
if ( !pTransliteration )
{
@@ -1950,7 +1133,7 @@ CollatorWrapper* ScGlobal::GetCollator()
{
pCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
pCollator->loadDefaultCollator( *GetLocale(), SC_COLLATOR_IGNORES );
- } // if ( !pCollator )
+ }
return pCollator;
}
CollatorWrapper* ScGlobal::GetCaseCollator()
@@ -1959,7 +1142,7 @@ CollatorWrapper* ScGlobal::GetCaseCollator()
{
pCaseCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() );
pCaseCollator->loadDefaultCollator( *GetLocale(), 0 );
- } // if ( !pCaseCollator )
+ }
return pCaseCollator;
}
::utl::TransliterationWrapper* ScGlobal::GetCaseTransliteration()
@@ -1969,7 +1152,7 @@ CollatorWrapper* ScGlobal::GetCaseCollator()
const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage();
pCaseTransliteration = new ::utl::TransliterationWrapper(::comphelper::getProcessServiceFactory(), SC_TRANSLITERATION_CASESENSE );
pCaseTransliteration->loadModuleIfNeeded( eOfficeLanguage );
- } // if ( !pCaseTransliteration )
+ }
return pCaseTransliteration;
}
IntlWrapper* ScGlobal::GetScIntlWrapper()
@@ -1989,3 +1172,4 @@ IntlWrapper* ScGlobal::GetScIntlWrapper()
return pLocale;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index 3b64328f8b3b..fb03c65ce2bf 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include <sfx2/docfile.hxx>
@@ -48,6 +47,7 @@
#include "rechead.hxx"
#include "compiler.hxx"
#include "paramisc.hxx"
+#include "dpglobal.hxx"
#include "sc.hrc"
#include "globstr.hrc"
@@ -56,9 +56,6 @@ using ::std::vector;
// -----------------------------------------------------------------------
-
-
-
//------------------------------------------------------------------------
// struct ScImportParam:
@@ -67,8 +64,8 @@ ScImportParam::ScImportParam() :
nRow1(0),
nCol2(0),
nRow2(0),
- bImport(sal_False),
- bNative(sal_False),
+ bImport(false),
+ bNative(false),
bSql(sal_True),
nType(ScDbTable)
{
@@ -92,18 +89,6 @@ ScImportParam::~ScImportParam()
{
}
-//UNUSED2009-05 void ScImportParam::Clear()
-//UNUSED2009-05 {
-//UNUSED2009-05 nCol1 = nCol2 = 0;
-//UNUSED2009-05 nRow1 = nRow2 = 0;
-//UNUSED2009-05 bImport = sal_False;
-//UNUSED2009-05 bNative = sal_False;
-//UNUSED2009-05 bSql = sal_True;
-//UNUSED2009-05 nType = ScDbTable;
-//UNUSED2009-05 aDBName.Erase();
-//UNUSED2009-05 aStatement.Erase();
-//UNUSED2009-05 }
-
ScImportParam& ScImportParam::operator=( const ScImportParam& r )
{
nCol1 = r.nCol1;
@@ -136,13 +121,12 @@ sal_Bool ScImportParam::operator==( const ScImportParam& rOther ) const
//! nQuerySh und pConnection sind gleich ?
}
-
//------------------------------------------------------------------------
// struct ScQueryParam:
ScQueryEntry::ScQueryEntry() :
- bDoQuery(sal_False),
- bQueryByString(sal_False),
+ bDoQuery(false),
+ bQueryByString(false),
bQueryByDate(false),
nField(0),
eOp(SC_EQUAL),
@@ -201,8 +185,8 @@ ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r )
void ScQueryEntry::Clear()
{
- bDoQuery = sal_False;
- bQueryByString = sal_False;
+ bDoQuery = false;
+ bQueryByString = false;
bQueryByDate = false;
eOp = SC_EQUAL;
eConnect = SC_AND;
@@ -236,7 +220,7 @@ utl::TextSearch* ScQueryEntry::GetSearchTextPtr( sal_Bool bCaseSens )
if ( !pSearchParam )
{
pSearchParam = new utl::SearchParam( *pStr, utl::SearchParam::SRCH_REGEXP,
- bCaseSens, sal_False, sal_False );
+ bCaseSens, false, false );
pSearchText = new utl::TextSearch( *pSearchParam, *ScGlobal::pCharClass );
}
return pSearchText;
@@ -298,12 +282,12 @@ void ScSubTotalParam::Clear()
nCol1=nCol2= 0;
nRow1=nRow2 = 0;
nUserIndex = 0;
- bPagebreak=bCaseSens=bUserDef=bIncludePattern=bRemoveOnly = sal_False;
+ bPagebreak=bCaseSens=bUserDef=bIncludePattern=bRemoveOnly = false;
bAscending=bReplace=bDoSort = sal_True;
for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++)
{
- bGroupActive[i] = sal_False;
+ bGroupActive[i] = false;
nField[i] = 0;
if ( (nSubTotals[i] > 0) && pSubTotals[i] && pFunctions[i] )
@@ -474,14 +458,14 @@ ScConsolidateParam::ScConsolidateParam( const ScConsolidateParam& r ) :
//------------------------------------------------------------------------
-__EXPORT ScConsolidateParam::~ScConsolidateParam()
+ScConsolidateParam::~ScConsolidateParam()
{
ClearDataAreas();
}
//------------------------------------------------------------------------
-void __EXPORT ScConsolidateParam::ClearDataAreas()
+void ScConsolidateParam::ClearDataAreas()
{
if ( ppDataAreas )
{
@@ -495,20 +479,20 @@ void __EXPORT ScConsolidateParam::ClearDataAreas()
//------------------------------------------------------------------------
-void __EXPORT ScConsolidateParam::Clear()
+void ScConsolidateParam::Clear()
{
ClearDataAreas();
nCol = 0;
nRow = 0;
nTab = 0;
- bByCol = bByRow = bReferenceData = sal_False;
+ bByCol = bByRow = bReferenceData = false;
eFunction = SUBTOTAL_FUNC_SUM;
}
//------------------------------------------------------------------------
-ScConsolidateParam& __EXPORT ScConsolidateParam::operator=( const ScConsolidateParam& r )
+ScConsolidateParam& ScConsolidateParam::operator=( const ScConsolidateParam& r )
{
nCol = r.nCol;
nRow = r.nRow;
@@ -524,7 +508,7 @@ ScConsolidateParam& __EXPORT ScConsolidateParam::operator=( const ScConsolidateP
//------------------------------------------------------------------------
-sal_Bool __EXPORT ScConsolidateParam::operator==( const ScConsolidateParam& r ) const
+sal_Bool ScConsolidateParam::operator==( const ScConsolidateParam& r ) const
{
sal_Bool bEqual = (nCol == r.nCol)
&& (nRow == r.nRow)
@@ -549,7 +533,7 @@ sal_Bool __EXPORT ScConsolidateParam::operator==( const ScConsolidateParam& r )
//------------------------------------------------------------------------
-void __EXPORT ScConsolidateParam::SetAreas( ScArea* const* ppAreas, sal_uInt16 nCount )
+void ScConsolidateParam::SetAreas( ScArea* const* ppAreas, sal_uInt16 nCount )
{
ClearDataAreas();
if ( ppAreas && nCount > 0 )
@@ -561,6 +545,126 @@ void __EXPORT ScConsolidateParam::SetAreas( ScArea* const* ppAreas, sal_uInt16 n
}
}
+// -----------------------------------------------------------------------
+
+PivotField::PivotField( SCsCOL nNewCol, sal_uInt16 nNewFuncMask ) :
+ nCol( nNewCol ),
+ nFuncMask( nNewFuncMask ),
+ nFuncCount( 0 )
+{
+}
+
+PivotField::PivotField( const PivotField& r ) :
+ nCol(r.nCol), nFuncMask(r.nFuncMask), nFuncCount(r.nFuncCount), maFieldRef(r.maFieldRef)
+{
+}
+
+bool PivotField::operator==( const PivotField& r ) const
+{
+ return (nCol == r.nCol)
+ && (nFuncMask == r.nFuncMask)
+ && (nFuncCount == r.nFuncCount)
+ && (maFieldRef.ReferenceType == r.maFieldRef.ReferenceType)
+ && (maFieldRef.ReferenceField == r.maFieldRef.ReferenceField)
+ && (maFieldRef.ReferenceItemType == r.maFieldRef.ReferenceItemType)
+ && (maFieldRef.ReferenceItemName == r.maFieldRef.ReferenceItemName);
+}
+
+//------------------------------------------------------------------------
+// struct ScPivotParam:
+
+ScPivotParam::ScPivotParam()
+ : nCol(0), nRow(0), nTab(0),
+ bIgnoreEmptyRows(false), bDetectCategories(false),
+ bMakeTotalCol(true), bMakeTotalRow(true)
+{
+}
+
+//------------------------------------------------------------------------
+
+ScPivotParam::ScPivotParam( const ScPivotParam& r )
+ : nCol( r.nCol ), nRow( r.nRow ), nTab( r.nTab ),
+ maPageFields(r.maPageFields),
+ maColFields(r.maColFields),
+ maRowFields(r.maRowFields),
+ maDataFields(r.maDataFields),
+ bIgnoreEmptyRows(r.bIgnoreEmptyRows),
+ bDetectCategories(r.bDetectCategories),
+ bMakeTotalCol(r.bMakeTotalCol),
+ bMakeTotalRow(r.bMakeTotalRow)
+{
+ SetLabelData(r.maLabelArray);
+}
+
+//------------------------------------------------------------------------
+
+ScPivotParam::~ScPivotParam()
+{
+}
+
+//------------------------------------------------------------------------
+
+void ScPivotParam::ClearPivotArrays()
+{
+ maPageFields.clear();
+ maColFields.clear();
+ maRowFields.clear();
+ maDataFields.clear();
+}
+
+void ScPivotParam::SetLabelData(const vector<ScDPLabelDataRef>& r)
+{
+ vector<ScDPLabelDataRef> aNewArray;
+ aNewArray.reserve(r.size());
+ for (vector<ScDPLabelDataRef>::const_iterator itr = r.begin(), itrEnd = r.end();
+ itr != itrEnd; ++itr)
+ {
+ ScDPLabelDataRef p(new ScDPLabelData(**itr));
+ aNewArray.push_back(p);
+ }
+ maLabelArray.swap(aNewArray);
+}
+
+//------------------------------------------------------------------------
+
+ScPivotParam& ScPivotParam::operator=( const ScPivotParam& r )
+{
+ nCol = r.nCol;
+ nRow = r.nRow;
+ nTab = r.nTab;
+ bIgnoreEmptyRows = r.bIgnoreEmptyRows;
+ bDetectCategories = r.bDetectCategories;
+ bMakeTotalCol = r.bMakeTotalCol;
+ bMakeTotalRow = r.bMakeTotalRow;
+
+ maPageFields = r.maPageFields;
+ maColFields = r.maColFields;
+ maRowFields = r.maRowFields;
+ maDataFields = r.maDataFields;
+ SetLabelData(r.maLabelArray);
+ return *this;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool ScPivotParam::operator==( const ScPivotParam& r ) const
+{
+ sal_Bool bEqual = (nCol == r.nCol)
+ && (nRow == r.nRow)
+ && (nTab == r.nTab)
+ && (bIgnoreEmptyRows == r.bIgnoreEmptyRows)
+ && (bDetectCategories == r.bDetectCategories)
+ && (bMakeTotalCol == r.bMakeTotalCol)
+ && (bMakeTotalRow == r.bMakeTotalRow)
+ && (maLabelArray.size() == r.maLabelArray.size())
+ && maPageFields == r.maPageFields
+ && maColFields == r.maColFields
+ && maRowFields == r.maRowFields
+ && maDataFields == r.maDataFields;
+
+ return bEqual;
+}
+
//------------------------------------------------------------------------
// struct ScSolveParam
@@ -600,7 +704,7 @@ ScSolveParam::~ScSolveParam()
//------------------------------------------------------------------------
-ScSolveParam& __EXPORT ScSolveParam::operator=( const ScSolveParam& r )
+ScSolveParam& ScSolveParam::operator=( const ScSolveParam& r )
{
delete pStrTargetVal;
@@ -624,7 +728,7 @@ sal_Bool ScSolveParam::operator==( const ScSolveParam& r ) const
if ( !pStrTargetVal && !r.pStrTargetVal )
bEqual = sal_True;
else if ( !pStrTargetVal || !r.pStrTargetVal )
- bEqual = sal_False;
+ bEqual = false;
else if ( pStrTargetVal && r.pStrTargetVal )
bEqual = ( *pStrTargetVal == *(r.pStrTargetVal) );
}
@@ -632,7 +736,6 @@ sal_Bool ScSolveParam::operator==( const ScSolveParam& r ) const
return bEqual;
}
-
//------------------------------------------------------------------------
// struct ScTabOpParam
@@ -674,7 +777,7 @@ ScTabOpParam& ScTabOpParam::operator=( const ScTabOpParam& r )
//------------------------------------------------------------------------
-sal_Bool __EXPORT ScTabOpParam::operator==( const ScTabOpParam& r ) const
+sal_Bool ScTabOpParam::operator==( const ScTabOpParam& r ) const
{
return ( (aRefFormulaCell == r.aRefFormulaCell)
&& (aRefFormulaEnd == r.aRefFormulaEnd)
@@ -716,7 +819,6 @@ String ScGlobal::GetAbsDocName( const String& rFileName,
return aAbsName;
}
-
String ScGlobal::GetDocTabName( const String& rFileName,
const String& rTabName )
{
@@ -735,3 +837,4 @@ String ScGlobal::GetDocTabName( const String& rFileName,
return aDocTab;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx
index 2accdadeb781..8d043ac7a1e8 100644
--- a/sc/source/core/data/globalx.cxx
+++ b/sc/source/core/data/globalx.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
-// static
void ScGlobal::InitAddIns()
{
// multi paths separated by semicolons
@@ -134,7 +134,6 @@ void ScGlobal::InitAddIns()
}
-// static
String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber)
{
if (!xOrdinalSuffix.is())
@@ -145,7 +144,7 @@ String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber)
::comphelper::getProcessServiceFactory();
Reference< XInterface > xInterface =
xServiceManager->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.i18n.OrdinalSuffix"));
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.OrdinalSuffix")));
if (xInterface.is())
xOrdinalSuffix = Reference< i18n::XOrdinalSuffix >( xInterface, UNO_QUERY);
}
@@ -169,3 +168,5 @@ String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber)
}
return String();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/makefile.mk b/sc/source/core/data/makefile.mk
index b164721744b7..efb3fca9e14e 100644
--- a/sc/source/core/data/makefile.mk
+++ b/sc/source/core/data/makefile.mk
@@ -38,42 +38,45 @@ AUTOSEG=true
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/attarray.obj \
+ $(EXCEPTIONSFILES) \
+ $(EXCEPTIONSNOOPTFILES) \
$(SLO)$/attrib.obj \
+ $(SLO)$/compressedarray.obj \
+ $(SLO)$/docparam.obj \
+ $(SLO)$/markarr.obj \
+ $(SLO)$/markdata.obj \
+ $(SLO)$/pagepar.obj \
+ $(SLO)$/sheetevents.obj \
+ $(SLO)$/sortparam.obj
+
+EXCEPTIONSFILES= \
+ $(SLO)$/attarray.obj \
$(SLO)$/autonamecache.obj \
$(SLO)$/bcaslot.obj \
- $(SLO)$/cell.obj \
$(SLO)$/cell2.obj \
- $(SLO)$/clipparam.obj \
+ $(SLO)$/clipparam.obj \
$(SLO)$/column.obj \
- $(SLO)$/column2.obj \
- $(SLO)$/column3.obj \
- $(SLO)$/compressedarray.obj \
- $(SLO)$/conditio.obj \
$(SLO)$/dbdocutl.obj \
$(SLO)$/dociter.obj \
$(SLO)$/docpool.obj \
$(SLO)$/documen2.obj \
$(SLO)$/documen3.obj \
- $(SLO)$/documen4.obj \
$(SLO)$/documen5.obj \
$(SLO)$/documen6.obj \
$(SLO)$/documen7.obj \
$(SLO)$/documen8.obj \
$(SLO)$/documen9.obj \
$(SLO)$/document.obj \
- $(SLO)$/dpcachetable.obj \
- $(SLO)$/dpdimsave.obj \
+ $(SLO)$/dpcachetable.obj \
+ $(SLO)$/dpdimsave.obj \
$(SLO)$/dpglobal.obj \
- $(SLO)$/dpgroup.obj \
+ $(SLO)$/dpgroup.obj \
$(SLO)$/dpobject.obj \
$(SLO)$/dpoutput.obj \
$(SLO)$/dpoutputgeometry.obj \
@@ -81,98 +84,54 @@ SLOFILES = \
$(SLO)$/dpsdbtab.obj \
$(SLO)$/dpshttab.obj \
$(SLO)$/dptabdat.obj \
+ $(SLO)$/dptablecache.obj \
$(SLO)$/dptabres.obj \
$(SLO)$/dptabsrc.obj \
- $(SLO)$/dptablecache.obj\
- $(SLO)$/scdpoutputimpl.obj\
$(SLO)$/drawpage.obj \
$(SLO)$/drwlayer.obj \
$(SLO)$/fillinfo.obj \
+ $(SLO)$/funcdesc.obj \
$(SLO)$/global.obj \
$(SLO)$/global2.obj \
$(SLO)$/globalx.obj \
- $(SLO)$/markarr.obj \
- $(SLO)$/markdata.obj \
$(SLO)$/olinetab.obj \
- $(SLO)$/pagepar.obj \
$(SLO)$/patattr.obj \
$(SLO)$/pivot2.obj \
$(SLO)$/poolhelp.obj \
- $(SLO)$/sheetevents.obj \
+ $(SLO)$/postit.obj \
+ $(SLO)$/scdpoutputimpl.obj \
$(SLO)$/segmenttree.obj \
- $(SLO)$/sortparam.obj \
$(SLO)$/stlpool.obj \
$(SLO)$/stlsheet.obj \
- $(SLO)$/tabbgcolor.obj \
+ $(SLO)$/tabbgcolor.obj \
$(SLO)$/table1.obj \
$(SLO)$/table2.obj \
- $(SLO)$/table3.obj \
- $(SLO)$/table4.obj \
$(SLO)$/table5.obj \
$(SLO)$/table6.obj \
$(SLO)$/tabprotection.obj \
- $(SLO)$/userdat.obj \
- $(SLO)$/validat.obj \
- $(SLO)$/postit.obj
+ $(SLO)$/userdat.obj
-EXCEPTIONSFILES= \
- $(SLO)$/autonamecache.obj \
- $(SLO)$/bcaslot.obj \
- $(SLO)$/cell2.obj \
- $(SLO)$/clipparam.obj \
- $(SLO)$/column.obj \
+.IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCSPARC"
+EXCEPTIONSNOOPTFILES= \
+ $(SLO)$/cell.obj \
+ $(SLO)$/column2.obj \
$(SLO)$/column3.obj \
- $(SLO)$/documen2.obj \
- $(SLO)$/document.obj \
- $(SLO)$/dpdimsave.obj \
- $(SLO)$/dpglobal.obj \
- $(SLO)$/dpgroup.obj \
- $(SLO)$/dpshttab.obj \
- $(SLO)$/dptabres.obj \
- $(SLO)$/dptabdat.obj \
- $(SLO)$/global2.obj \
- $(SLO)$/pivot2.obj \
- $(SLO)$/tabbgcolor.obj \
- $(SLO)$/table1.obj \
- $(SLO)$/table2.obj \
+ $(SLO)$/conditio.obj \
+ $(SLO)$/documen4.obj \
$(SLO)$/table3.obj \
- $(SLO)$/tabprotection.obj \
- $(SLO)$/postit.obj \
- $(SLO)$/documen3.obj \
- $(SLO)$/documen5.obj \
- $(SLO)$/documen6.obj \
- $(SLO)$/documen8.obj \
- $(SLO)$/documen9.obj \
- $(SLO)$/dpcachetable.obj \
- $(SLO)$/dptablecache.obj \
- $(SLO)$/scdpoutputimpl.obj \
- $(SLO)$/dpsdbtab.obj \
- $(SLO)$/dpobject.obj \
- $(SLO)$/dpoutput.obj \
- $(SLO)$/dpoutputgeometry.obj \
- $(SLO)$/dpsave.obj \
- $(SLO)$/dbdocutl.obj \
- $(SLO)$/dptabsrc.obj \
- $(SLO)$/drwlayer.obj \
- $(SLO)$/globalx.obj \
- $(SLO)$/segmenttree.obj
+ $(SLO)$/table4.obj \
+ $(SLO)$/validat.obj
-.IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCSPARC"
-NOOPTFILES= \
- $(SLO)$/column2.obj \
- $(SLO)$/column3.obj \
- $(SLO)$/table3.obj \
- $(SLO)$/table4.obj \
- $(SLO)$/documen4.obj \
- $(SLO)$/conditio.obj \
- $(SLO)$/validat.obj
-EXCEPTIONSNOOPTFILES= \
- $(SLO)$/cell.obj
.ELSE
EXCEPTIONSFILES+= \
$(SLO)$/cell.obj \
- $(SLO)$/global.obj \
- $(SLO)$/table5.obj
+ $(SLO)$/column2.obj \
+ $(SLO)$/column3.obj \
+ $(SLO)$/conditio.obj \
+ $(SLO)$/documen4.obj \
+ $(SLO)$/table3.obj \
+ $(SLO)$/table4.obj \
+ $(SLO)$/validat.obj
.ENDIF
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx
index d6258229c1e3..940ef895ea1c 100644
--- a/sc/source/core/data/markarr.cxx
+++ b/sc/source/core/data/markarr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,14 +77,13 @@ void ScMarkArray::Reset( sal_Bool bMarked )
sal_Bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const
{
- long nLo = 0;
long nHi = static_cast<long>(nCount) - 1;
- long nStartRow = 0;
- long nEndRow = 0;
long i = 0;
sal_Bool bFound = (nCount == 1);
if (pData)
{
+ long nLo = 0;
+ long nStartRow = 0;
while ( !bFound && nLo <= nHi )
{
i = (nLo + nHi) / 2;
@@ -91,7 +91,7 @@ sal_Bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const
nStartRow = (long) pData[i - 1].nRow;
else
nStartRow = -1;
- nEndRow = (long) pData[i].nRow;
+ long nEndRow = (long) pData[i].nRow;
if (nEndRow < (long) nRow)
nLo = ++i;
else
@@ -102,7 +102,7 @@ sal_Bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const
}
}
else
- bFound = sal_False;
+ bFound = false;
if (bFound)
nIndex=(SCSIZE)i;
@@ -117,7 +117,7 @@ sal_Bool ScMarkArray::GetMark( SCROW nRow ) const
if (Search( nRow, i ))
return pData[i].bMarked;
else
- return sal_False;
+ return false;
}
@@ -134,7 +134,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, sal_Bool bMarked
else
{
if (!pData)
- Reset(sal_False); // create pData for further processing - could use special case handling!
+ Reset(false); // create pData for further processing - could use special case handling!
SCSIZE nNeeded = nCount + 2;
if ( nLimit < nNeeded )
@@ -150,8 +150,8 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, sal_Bool bMarked
SCSIZE ni; // number of entries in beginning
SCSIZE nInsert; // insert position (MAXROW+1 := no insert)
- sal_Bool bCombined = sal_False;
- sal_Bool bSplit = sal_False;
+ sal_Bool bCombined = false;
+ sal_Bool bSplit = false;
if ( nStartRow > 0 )
{
// skip beginning
@@ -248,14 +248,8 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, sal_Bool bMarked
}
}
}
-// InfoBox(0, String(nCount) + String(" Eintraege") ).Execute();
}
-//UNUSED2009-05 void ScMarkArray::DeleteArea(SCROW nStartRow, SCROW nEndRow)
-//UNUSED2009-05 {
-//UNUSED2009-05 SetMarkArea(nStartRow, nEndRow, sal_False);
-//UNUSED2009-05 }
-
sal_Bool ScMarkArray::IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const
{
SCSIZE nStartIndex;
@@ -267,12 +261,12 @@ sal_Bool ScMarkArray::IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const
if (nEndIndex==nStartIndex)
return sal_True;
- return sal_False;
+ return false;
}
sal_Bool ScMarkArray::HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
if ( nCount == 1 )
{
if ( pData[0].bMarked )
@@ -326,7 +320,7 @@ void ScMarkArray::CopyMarksTo( ScMarkArray& rDestMarkArray ) const
SCsROW ScMarkArray::GetNextMarked( SCsROW nRow, sal_Bool bUp ) const
{
if (!pData)
- const_cast<ScMarkArray*>(this)->Reset(sal_False); // create pData for further processing
+ const_cast<ScMarkArray*>(this)->Reset(false); // create pData for further processing
SCsROW nRet = nRow;
if (VALIDROW(nRow))
@@ -352,7 +346,7 @@ SCsROW ScMarkArray::GetNextMarked( SCsROW nRow, sal_Bool bUp ) const
SCROW ScMarkArray::GetMarkEnd( SCROW nRow, sal_Bool bUp ) const
{
if (!pData)
- const_cast<ScMarkArray*>(this)->Reset(sal_False); // create pData for further processing
+ const_cast<ScMarkArray*>(this)->Reset(false); // create pData for further processing
SCROW nRet;
SCSIZE nIndex;
@@ -388,12 +382,12 @@ ScMarkArrayIter::~ScMarkArrayIter()
sal_Bool ScMarkArrayIter::Next( SCROW& rTop, SCROW& rBottom )
{
if ( nPos >= pArray->nCount )
- return sal_False;
+ return false;
while (!pArray->pData[nPos].bMarked)
{
++nPos;
if ( nPos >= pArray->nCount )
- return sal_False;
+ return false;
}
rBottom = pArray->pData[nPos].nRow;
if (nPos==0)
@@ -408,3 +402,4 @@ sal_Bool ScMarkArrayIter::Next( SCROW& rTop, SCROW& rBottom )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx
index 66d205d305db..b5627a8d162a 100644
--- a/sc/source/core/data/markdata.cxx
+++ b/sc/source/core/data/markdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ ScMarkData::ScMarkData() :
pMultiSel( NULL )
{
for (SCTAB i=0; i<=MAXTAB; i++)
- bTabMarked[i] = sal_False;
+ bTabMarked[i] = false;
ResetMark();
}
@@ -110,8 +111,8 @@ void ScMarkData::ResetMark()
delete[] pMultiSel;
pMultiSel = NULL;
- bMarked = bMultiMarked = sal_False;
- bMarking = bMarkIsNeg = sal_False;
+ bMarked = bMultiMarked = false;
+ bMarking = bMarkIsNeg = false;
}
void ScMarkData::SetMarkArea( const ScRange& rRange )
@@ -120,7 +121,7 @@ void ScMarkData::SetMarkArea( const ScRange& rRange )
aMarkRange.Justify();
if ( !bMarked )
{
- // #77987# Upon creation of a document ScFormatShell GetTextAttrState
+ // Upon creation of a document ScFormatShell GetTextAttrState
// may query (default) attributes although no sheet is marked yet.
// => mark that one.
if ( !GetSelectCount() )
@@ -148,7 +149,7 @@ void ScMarkData::SetMultiMarkArea( const ScRange& rRange, sal_Bool bMark )
// if simple mark range is set, copy to multi marks
if ( bMarked && !bMarkIsNeg )
{
- bMarked = sal_False;
+ bMarked = false;
SetMultiMarkArea( aMarkRange, sal_True );
}
}
@@ -212,7 +213,7 @@ SCTAB ScMarkData::GetFirstSelected() const
if (bTabMarked[i])
return i;
- DBG_ERROR("GetFirstSelected: keine markiert");
+ OSL_FAIL("GetFirstSelected: keine markiert");
return 0;
}
@@ -221,7 +222,7 @@ void ScMarkData::MarkToMulti()
if ( bMarked && !bMarking )
{
SetMultiMarkArea( aMarkRange, !bMarkIsNeg );
- bMarked = sal_False;
+ bMarked = false;
// check if all multi mark ranges have been removed
if ( bMarkIsNeg && !HasAnyMultiMarks() )
@@ -243,7 +244,7 @@ void ScMarkData::MarkToSimple()
ScRange aNew = aMultiRange;
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
SCCOL nStartCol = aNew.aStart.Col();
SCCOL nEndCol = aNew.aEnd.Col();
@@ -261,7 +262,7 @@ void ScMarkData::MarkToSimple()
for (SCCOL nCol=nStartCol+1; nCol<=nEndCol && bOk; nCol++)
if ( !pMultiSel[nCol].HasOneMark( nCmpStart, nCmpEnd )
|| nCmpStart != nStartRow || nCmpEnd != nEndRow )
- bOk = sal_False;
+ bOk = false;
}
if (bOk)
@@ -274,7 +275,7 @@ void ScMarkData::MarkToSimple()
ResetMark();
aMarkRange = aNew;
bMarked = sal_True;
- bMarkIsNeg = sal_False;
+ bMarkIsNeg = false;
}
}
}
@@ -294,7 +295,7 @@ sal_Bool ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, sal_Bool bNoSimple )
return pMultiSel[nCol].GetMark( nRow );
}
- return sal_False;
+ return false;
}
sal_Bool ScMarkData::IsColumnMarked( SCCOL nCol ) const
@@ -310,7 +311,7 @@ sal_Bool ScMarkData::IsColumnMarked( SCCOL nCol ) const
if ( bMultiMarked && pMultiSel[nCol].IsAllMarked(0,MAXROW) )
return sal_True;
- return sal_False;
+ return false;
}
sal_Bool ScMarkData::IsRowMarked( SCROW nRow ) const
@@ -328,11 +329,11 @@ sal_Bool ScMarkData::IsRowMarked( SCROW nRow ) const
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
for (SCCOL nCol=0; nCol<=MAXCOL; nCol++)
if (!pMultiSel[nCol].GetMark(nRow))
- return sal_False;
+ return false;
return sal_True;
}
- return sal_False;
+ return false;
}
void ScMarkData::MarkFromRangeList( const ScRangeList& rList, sal_Bool bReset )
@@ -340,24 +341,24 @@ void ScMarkData::MarkFromRangeList( const ScRangeList& rList, sal_Bool bReset )
if (bReset)
{
for (SCTAB i=0; i<=MAXTAB; i++)
- bTabMarked[i] = sal_False; // Tabellen sind nicht in ResetMark
+ bTabMarked[i] = false; // Tabellen sind nicht in ResetMark
ResetMark();
}
- sal_uLong nCount = rList.Count();
+ size_t nCount = rList.size();
if ( nCount == 1 && !bMarked && !bMultiMarked )
{
- ScRange aRange = *rList.GetObject(0);
+ ScRange aRange = *rList[ 0 ];
SetMarkArea( aRange );
SelectTable( aRange.aStart.Tab(), sal_True );
}
else
{
- for (sal_uLong i=0; i<nCount; i++)
+ for (size_t i=0; i < nCount; i++)
{
- ScRange aRange = *rList.GetObject(i);
- SetMultiMarkArea( aRange, sal_True );
- SelectTable( aRange.aStart.Tab(), sal_True );
+ ScRange aRange = *rList[ i ];
+ SetMultiMarkArea( aRange, true );
+ SelectTable( aRange.aStart.Tab(), true );
}
}
}
@@ -410,10 +411,9 @@ void ScMarkData::ExtendRangeListTables( ScRangeList* pList ) const
for (SCTAB nTab=0; nTab<=MAXTAB; nTab++)
if (bTabMarked[nTab])
{
- sal_uLong nCount = aOldList.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i=0, nCount = aOldList.size(); i<nCount; i++)
{
- ScRange aRange = *aOldList.GetObject(i);
+ ScRange aRange = *aOldList[ i ];
aRange.aStart.SetTab(nTab);
aRange.aEnd.SetTab(nTab);
pList->Append( aRange );
@@ -538,7 +538,7 @@ SCCOLROW ScMarkData::GetMarkRowRanges( SCCOLROW* pRanges )
sal_Bool ScMarkData::IsAllMarked( const ScRange& rRange ) const
{
if ( !bMultiMarked )
- return sal_False;
+ return false;
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
@@ -549,7 +549,7 @@ sal_Bool ScMarkData::IsAllMarked( const ScRange& rRange ) const
sal_Bool bOk = sal_True;
for (SCCOL nCol=nStartCol; nCol<=nEndCol && bOk; nCol++)
if ( !pMultiSel[nCol].IsAllMarked( nStartRow, nEndRow ) )
- bOk = sal_False;
+ bOk = false;
return bOk;
}
@@ -567,7 +567,7 @@ SCsROW ScMarkData::GetNextMarked( SCCOL nCol, SCsROW nRow, sal_Bool bUp ) const
sal_Bool ScMarkData::HasMultiMarks( SCCOL nCol ) const
{
if ( !bMultiMarked )
- return sal_False;
+ return false;
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
@@ -577,7 +577,7 @@ sal_Bool ScMarkData::HasMultiMarks( SCCOL nCol ) const
sal_Bool ScMarkData::HasAnyMultiMarks() const
{
if ( !bMultiMarked )
- return sal_False;
+ return false;
DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0");
@@ -585,24 +585,25 @@ sal_Bool ScMarkData::HasAnyMultiMarks() const
if ( pMultiSel[nCol].HasMarks() )
return sal_True;
- return sal_False; // nix
+ return false; // nix
}
void ScMarkData::InsertTab( SCTAB nTab )
{
for (SCTAB i=MAXTAB; i>nTab; i--)
bTabMarked[i] = bTabMarked[i-1];
- bTabMarked[nTab] = sal_False;
+ bTabMarked[nTab] = false;
}
void ScMarkData::DeleteTab( SCTAB nTab )
{
for (SCTAB i=nTab; i<MAXTAB; i++)
bTabMarked[i] = bTabMarked[i+1];
- bTabMarked[MAXTAB] = sal_False;
+ bTabMarked[MAXTAB] = false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx
index 636cf42d7511..f4dc662f40b7 100644
--- a/sc/source/core/data/olinetab.cxx
+++ b/sc/source/core/data/olinetab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,7 @@ void ScOutlineEntry::Move( SCsCOLROW nDelta )
SCCOLROW nNewPos = nStart + nDelta;
if (nNewPos<0)
{
- DBG_ERROR("OutlineEntry < 0");
+ OSL_FAIL("OutlineEntry < 0");
nNewPos = 0;
}
nStart = nNewPos;
@@ -84,7 +85,7 @@ void ScOutlineEntry::SetSize( SCSIZE nNewSize )
nSize = nNewSize;
else
{
- DBG_ERROR("ScOutlineEntry Size == 0");
+ OSL_FAIL("ScOutlineEntry Size == 0");
}
}
@@ -107,7 +108,7 @@ void ScOutlineEntry::SetVisible( bool bNewVisible )
//------------------------------------------------------------------------
ScOutlineCollection::ScOutlineCollection() :
- ScSortedCollection( 4,4,sal_False )
+ ScSortedCollection( 4,4,false )
{
}
@@ -130,7 +131,7 @@ sal_uInt16 ScOutlineCollection::FindStart( SCCOLROW nMinStart )
sal_uInt16 nPos = 0;
sal_uInt16 nLocalCount = GetCount();
- while ( (nPos<nLocalCount) ? (((ScOutlineEntry*)At(nPos))->GetStart() < nMinStart) : sal_False )
+ while ( (nPos<nLocalCount) ? (((ScOutlineEntry*)At(nPos))->GetStart() < nMinStart) : false )
++nPos;
return nPos;
@@ -184,13 +185,13 @@ void ScOutlineArray::FindEntry( SCCOLROW nSearchPos, sal_uInt16& rFindLevel, sal
sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool& rSizeChanged,
sal_Bool bHidden, sal_Bool bVisible )
{
- rSizeChanged = sal_False;
+ rSizeChanged = false;
sal_uInt16 nStartLevel;
sal_uInt16 nStartIndex;
sal_uInt16 nEndLevel;
sal_uInt16 nEndIndex;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_Bool bCont;
sal_uInt16 nFindMax;
@@ -199,7 +200,7 @@ sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool&
nFindMax = Max(nStartLevel,nEndLevel);
do
{
- bCont = sal_False;
+ bCont = false;
if ( nStartLevel == nEndLevel && nStartIndex == nEndIndex && nStartLevel < SC_OL_MAXDEPTH )
bFound = sal_True;
@@ -224,17 +225,17 @@ sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool&
while ( !bFound && bCont );
if (!bFound)
- return sal_False;
+ return false;
sal_uInt16 nLevel = nStartLevel;
// untere verschieben
- sal_Bool bNeedSize = sal_False;
+ sal_Bool bNeedSize = false;
for ( short nMoveLevel = nDepth-1; nMoveLevel >= (short) nLevel; nMoveLevel-- )
{
sal_uInt16 nCount = aCollections[nMoveLevel].GetCount();
- sal_Bool bMoved = sal_False;
+ sal_Bool bMoved = false;
for ( sal_uInt16 i=0; i<nCount; i += bMoved ? 0 : 1 )
{
ScOutlineEntry* pEntry = (ScOutlineEntry*) aCollections[nMoveLevel].At(i);
@@ -243,8 +244,8 @@ sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool&
{
if (nMoveLevel >= SC_OL_MAXDEPTH - 1)
{
- rSizeChanged = sal_False; // kein Platz
- return sal_False;
+ rSizeChanged = false; // kein Platz
+ return false;
}
aCollections[nMoveLevel+1].Insert( new ScOutlineEntry( *pEntry ) );
aCollections[nMoveLevel].AtFree( i );
@@ -254,7 +255,7 @@ sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool&
bNeedSize = sal_True;
}
else
- bMoved = sal_False;
+ bMoved = false;
}
}
@@ -270,35 +271,6 @@ sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool&
rSizeChanged = sal_True;
}
-/* nicht zusammenfassen!
-
- // zusammenfassen
-
- sal_uInt16 nCount = aCollections[nLevel].GetCount();
- sal_uInt16 nIndex;
- bFound = sal_False;
- for ( nIndex=0; nIndex<nCount && !bFound; nIndex++ )
- {
- if ( ((ScOutlineEntry*) aCollections[nLevel].At(nIndex))->GetEnd() + 1 == nStartCol )
- {
- nStartCol = ((ScOutlineEntry*) aCollections[nLevel].At(nIndex))->GetStart();
- aCollections[nLevel].AtFree(nIndex);
- nCount = aCollections[nLevel].GetCount(); // Daten geaendert
- bFound = sal_True;
- }
- }
-
- bFound = sal_False;
- for ( nIndex=0; nIndex<nCount && !bFound; nIndex++ )
- {
- if ( ((ScOutlineEntry*) aCollections[nLevel].At(nIndex))->GetStart() == nEndCol + 1 )
- {
- nEndCol = ((ScOutlineEntry*) aCollections[nLevel].At(nIndex))->GetEnd();
- aCollections[nLevel].AtFree(nIndex);
- bFound = sal_True;
- }
- }
-*/
ScOutlineEntry* pNewEntry = new ScOutlineEntry( nStartCol, nEndCol+1-nStartCol, bHidden );
pNewEntry->SetVisible( bVisible );
aCollections[nLevel].Insert( pNewEntry );
@@ -308,7 +280,7 @@ sal_Bool ScOutlineArray::Insert( SCCOLROW nStartCol, SCCOLROW nEndCol, sal_Bool&
sal_Bool ScOutlineArray::FindTouchedLevel( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, sal_uInt16& rFindLevel ) const
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
rFindLevel = 0;
for (sal_uInt16 nLevel=0; nLevel<nDepth; nLevel++)
@@ -339,10 +311,10 @@ void ScOutlineArray::RemoveSub( SCCOLROW nStartPos, SCCOLROW nEndPos, sal_uInt16
return;
ScOutlineCollection* pCollect = &aCollections[nLevel];
sal_uInt16 nCount = pCollect->GetCount();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for ( sal_uInt16 i=0; i<nCount; i += ( bFound ? 0 : 1 ) )
{
- bFound = sal_False;
+ bFound = false;
ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i);
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
@@ -361,7 +333,7 @@ void ScOutlineArray::PromoteSub( SCCOLROW nStartPos, SCCOLROW nEndPos, sal_uInt1
{
if (nStartLevel==0)
{
- DBG_ERROR("PromoteSub mit Level 0");
+ OSL_FAIL("PromoteSub mit Level 0");
return;
}
@@ -369,10 +341,10 @@ void ScOutlineArray::PromoteSub( SCCOLROW nStartPos, SCCOLROW nEndPos, sal_uInt1
{
ScOutlineCollection* pCollect = &aCollections[nLevel];
sal_uInt16 nCount = pCollect->GetCount();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for ( sal_uInt16 i=0; i<nCount; i += ( bFound ? 0 : 1 ) )
{
- bFound = sal_False;
+ bFound = false;
ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i);
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
@@ -390,11 +362,11 @@ void ScOutlineArray::PromoteSub( SCCOLROW nStartPos, SCCOLROW nEndPos, sal_uInt1
sal_Bool ScOutlineArray::DecDepth() // nDepth auf leere Levels anpassen
{
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
sal_Bool bCont;
do
{
- bCont = sal_False;
+ bCont = false;
if (nDepth)
if (aCollections[nDepth-1].GetCount() == 0)
{
@@ -414,18 +386,17 @@ sal_Bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, sal_B
ScOutlineCollection* pCollect = &aCollections[nLevel];
sal_uInt16 nCount = pCollect->GetCount();
- sal_Bool bFound = sal_False;
- sal_Bool bAny = sal_False;
+ sal_Bool bFound = false;
+ sal_Bool bAny = false;
for ( sal_uInt16 i=0; i<nCount; i += ( bFound ? 0 : 1 ) )
{
- bFound = sal_False;
+ bFound = false;
ScOutlineEntry* pEntry = (ScOutlineEntry*) pCollect->At(i);
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
if ( nBlockStart<=nEnd && nBlockEnd>=nStart )
{
-// RemoveSub( nStart, nEnd, nLevel+1 );
pCollect->AtFree(i);
PromoteSub( nStart, nEnd, nLevel+1 );
nCount = pCollect->GetCount();
@@ -476,7 +447,7 @@ sal_Bool ScOutlineArray::GetEntryIndex( sal_uInt16 nLevel, SCCOLROW nPos, sal_uI
if ( (pEntry->GetStart() <= nPos) && (nPos <= pEntry->GetEnd()) )
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScOutlineArray::GetEntryIndexInRange(
@@ -490,7 +461,7 @@ sal_Bool ScOutlineArray::GetEntryIndexInRange(
if ( (nBlockStart <= pEntry->GetStart()) && (pEntry->GetEnd() <= nBlockEnd) )
return sal_True;
}
- return sal_False;
+ return false;
}
void ScOutlineArray::SetVisibleBelow( sal_uInt16 nLevel, sal_uInt16 nEntry, sal_Bool bValue, sal_Bool bSkipHidden )
@@ -599,8 +570,8 @@ void ScOutlineArray::InsertSpace( SCCOLROW nStartPos, SCSIZE nSize )
sal_Bool ScOutlineArray::DeleteSpace( SCCOLROW nStartPos, SCSIZE nSize )
{
SCCOLROW nEndPos = nStartPos + nSize - 1;
- sal_Bool bNeedSave = sal_False; // Original fuer Undo benoetigt?
- sal_Bool bChanged = sal_False; // fuer Test auf Level
+ sal_Bool bNeedSave = false; // Original fuer Undo benoetigt?
+ sal_Bool bChanged = false; // fuer Test auf Level
ScSubOutlineIterator aIter( this );
ScOutlineEntry* pEntry;
@@ -748,7 +719,7 @@ ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray* pOutlineArray,
ScOutlineEntry* ScSubOutlineIterator::GetNext()
{
ScOutlineEntry* pEntry;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
do
{
if (nSubLevel >= nDepth)
@@ -780,7 +751,7 @@ sal_uInt16 ScSubOutlineIterator::LastEntry() const
{
if (nSubEntry == 0)
{
- DBG_ERROR("ScSubOutlineIterator::LastEntry vor GetNext");
+ OSL_FAIL("ScSubOutlineIterator::LastEntry vor GetNext");
return 0;
}
return nSubEntry-1;
@@ -790,12 +761,12 @@ void ScSubOutlineIterator::DeleteLast()
{
if (nSubLevel >= nDepth)
{
- DBG_ERROR("ScSubOutlineIterator::DeleteLast nach Ende");
+ OSL_FAIL("ScSubOutlineIterator::DeleteLast nach Ende");
return;
}
if (nSubEntry == 0)
{
- DBG_ERROR("ScSubOutlineIterator::DeleteLast vor GetNext");
+ OSL_FAIL("ScSubOutlineIterator::DeleteLast vor GetNext");
return;
}
@@ -804,3 +775,4 @@ void ScSubOutlineIterator::DeleteLast()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/pagepar.cxx b/sc/source/core/data/pagepar.cxx
index ddd21c01b313..bbaac42b6292 100644
--- a/sc/source/core/data/pagepar.cxx
+++ b/sc/source/core/data/pagepar.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,7 +61,7 @@ void ScPageTableParam::Reset()
bCellContent = sal_True;
bNotes=bGrid=bHeaders=bDrawings=
bLeftRight=bScaleAll=bScaleTo=bScalePageNum=
- bFormulas=bNullVals=bSkipEmpty = sal_False;
+ bFormulas=bNullVals=bSkipEmpty = false;
bTopDown=bScaleNone=bCharts=bObjects = sal_True;
nScaleAll = 100;
nScalePageNum = nScaleWidth = nScaleHeight = 0;
@@ -92,7 +93,7 @@ ScPageAreaParam::~ScPageAreaParam()
void ScPageAreaParam::Reset()
{
- bPrintArea = bRepeatRow = bRepeatCol = sal_False;
+ bPrintArea = bRepeatRow = bRepeatCol = false;
memset( &aPrintArea, 0, sizeof(ScRange) );
memset( &aRepeatRow, 0, sizeof(ScRange) );
@@ -120,3 +121,5 @@ sal_Bool ScPageAreaParam::operator==( const ScPageAreaParam& r ) const
return bEqual;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index eadcac860496..1c58a1644af7 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,6 +58,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/wrlmitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/intitem.hxx>
#include <svl/zforlist.hxx>
#include <vcl/outdev.hxx>
@@ -119,12 +121,12 @@ ScPatternAttr::ScPatternAttr( const ScPatternAttr& rPatternAttr )
pName = NULL;
}
-__EXPORT ScPatternAttr::~ScPatternAttr()
+ScPatternAttr::~ScPatternAttr()
{
delete pName;
}
-SfxPoolItem* __EXPORT ScPatternAttr::Clone( SfxItemPool *pPool ) const
+SfxPoolItem* ScPatternAttr::Clone( SfxItemPool *pPool ) const
{
ScPatternAttr* pPattern = new ScPatternAttr( GetItemSet().Clone(sal_True, pPool) );
@@ -136,7 +138,7 @@ SfxPoolItem* __EXPORT ScPatternAttr::Clone( SfxItemPool *pPool ) const
inline int StrCmp( const String* pStr1, const String* pStr2 )
{
- return ( pStr1 ? ( pStr2 ? ( *pStr1 == *pStr2 ) : sal_False ) : ( pStr2 ? sal_False : sal_True ) );
+ return ( pStr1 ? ( pStr2 ? ( *pStr1 == *pStr2 ) : false ) : ( pStr2 ? false : sal_True ) );
}
inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 )
@@ -154,7 +156,7 @@ inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 )
return ( 0 == memcmp( pItems1, pItems2, (ATTR_PATTERN_END - ATTR_PATTERN_START + 1) * sizeof(pItems1[0]) ) );
}
-int __EXPORT ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const
+int ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const
{
// #i62090# Use quick comparison between ScPatternAttr's ItemSets
@@ -162,16 +164,16 @@ int __EXPORT ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const
StrCmp( GetStyleName(), static_cast<const ScPatternAttr&>(rCmp).GetStyleName() ) );
}
-SfxPoolItem* __EXPORT ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */ ) const
+SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */ ) const
{
String* pStr;
sal_Bool bHasStyle;
- short eFamDummy;
rStream >> bHasStyle;
if ( bHasStyle )
{
+ short eFamDummy;
pStr = new String;
rStream.ReadByteString( *pStr, rStream.GetStreamCharSet() );
rStream >> eFamDummy; // wg. altem Dateiformat
@@ -190,7 +192,7 @@ SfxPoolItem* __EXPORT ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nV
return pPattern;
}
-SvStream& __EXPORT ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) const
+SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) const
{
rStream << (sal_Bool)sal_True;
@@ -699,7 +701,7 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r
if ( aColorItem.GetValue().GetColor() == COL_AUTO )
{
- // #108979# When cell attributes are converted to EditEngine paragraph attributes,
+ // When cell attributes are converted to EditEngine paragraph attributes,
// don't create a hard item for automatic color, because that would be converted
// to black when the item's Store method is used in CreateTransferable/WriteBin.
// COL_AUTO is the EditEngine's pool default, so ClearItem will result in automatic
@@ -735,12 +737,12 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r
rEditSet.Put( SfxBoolItem ( EE_PARA_HYPHENATE, bHyphenate ) );
rEditSet.Put( SvxFrameDirectionItem( eDirection, EE_PARA_WRITINGDIR ) );
- // #111216# Script spacing is always off.
+ // Script spacing is always off.
// The cell attribute isn't used here as long as there is no UI to set it
// (don't evaluate attributes that can't be changed).
// If a locale-dependent default is needed, it has to go into the cell
// style, like the fonts.
- rEditSet.Put( SvxScriptSpaceItem( sal_False, EE_PARA_ASIANCJKSPACING ) );
+ rEditSet.Put( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
}
void ScPatternAttr::FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCondSet ) const
@@ -833,7 +835,7 @@ void ScPatternAttr::GetFromEditItemSet( SfxItemSet& rDestSet, const SfxItemSet&
switch ( ((const SvxAdjustItem*)pItem)->GetAdjust() )
{
case SVX_ADJUST_LEFT:
- // #30154# EditEngine Default ist bei dem GetAttribs() ItemSet
+ // EditEngine Default ist bei dem GetAttribs() ItemSet
// immer gesetzt!
// ob links oder rechts entscheiden wir selbst bei Text/Zahl
eVal = SVX_HOR_JUSTIFY_STANDARD;
@@ -899,7 +901,7 @@ void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs )
for ( sal_uInt16 nSubWhich=ATTR_PATTERN_START; nSubWhich<=ATTR_PATTERN_END; nSubWhich++ )
{
// only items that are set are interesting
- if ( rThisSet.GetItemState( nSubWhich, sal_False, &pThisItem ) == SFX_ITEM_SET )
+ if ( rThisSet.GetItemState( nSubWhich, false, &pThisItem ) == SFX_ITEM_SET )
{
SfxItemState eOldState = rOldSet.GetItemState( nSubWhich, sal_True, &pOldItem );
if ( eOldState == SFX_ITEM_SET )
@@ -922,9 +924,9 @@ sal_Bool ScPatternAttr::HasItemsSet( const sal_uInt16* pWhich ) const
{
const SfxItemSet& rSet = GetItemSet();
for (sal_uInt16 i=0; pWhich[i]; i++)
- if ( rSet.GetItemState( pWhich[i], sal_False ) == SFX_ITEM_SET )
+ if ( rSet.GetItemState( pWhich[i], false ) == SFX_ITEM_SET )
return sal_True;
- return sal_False;
+ return false;
}
void ScPatternAttr::ClearItems( const sal_uInt16* pWhich )
@@ -944,7 +946,7 @@ SfxStyleSheetBase* lcl_CopyStyleToPool
{
if ( !pSrcStyle || !pDestPool || !pSrcPool )
{
- DBG_ERROR( "CopyStyleToPool: Invalid Arguments :-/" );
+ OSL_FAIL( "CopyStyleToPool: Invalid Arguments :-/" );
return NULL;
}
@@ -963,12 +965,12 @@ SfxStyleSheetBase* lcl_CopyStyleToPool
SfxItemSet& rDestSet = pDestStyle->GetItemSet();
rDestSet.Put( rSrcSet );
- // #b5017505# number format exchange list has to be handled here, too
+ // number format exchange list has to be handled here, too
// (only called for cell styles)
const SfxPoolItem* pSrcItem;
if ( pFormatExchangeList &&
- rSrcSet.GetItemState( ATTR_VALUE_FORMAT, sal_False, &pSrcItem ) == SFX_ITEM_SET )
+ rSrcSet.GetItemState( ATTR_VALUE_FORMAT, false, &pSrcItem ) == SFX_ITEM_SET )
{
sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pSrcItem)->GetValue();
sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pFormatExchangeList->Get( nOldFormat ));
@@ -1019,7 +1021,7 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD
for ( sal_uInt16 nAttrId = ATTR_PATTERN_START; nAttrId <= ATTR_PATTERN_END; nAttrId++ )
{
const SfxPoolItem* pSrcItem;
- SfxItemState eItemState = pSrcSet->GetItemState( nAttrId, sal_False, &pSrcItem );
+ SfxItemState eItemState = pSrcSet->GetItemState( nAttrId, false, &pSrcItem );
if (eItemState==SFX_ITEM_ON)
{
SfxPoolItem* pNewItem = NULL;
@@ -1133,7 +1135,7 @@ sal_Bool ScPatternAttr::IsVisible() const
if ( ((const SvxShadowItem*)pItem)->GetLocation() != SVX_SHADOW_NONE )
return sal_True;
- return sal_False;
+ return false;
}
inline sal_Bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId )
@@ -1181,7 +1183,7 @@ void ScPatternAttr::SetStyleSheet( ScStyleSheet* pNewStyle )
}
else
{
- DBG_ERROR( "ScPatternAttr::SetStyleSheet( NULL ) :-|" );
+ OSL_FAIL( "ScPatternAttr::SetStyleSheet( NULL ) :-|" );
GetItemSet().SetParent(NULL);
pStyle = NULL;
}
@@ -1236,19 +1238,9 @@ sal_Bool ScPatternAttr::IsSymbolFont() const
return sal_Bool( ((const SvxFontItem*) pItem)->GetCharSet()
== RTL_TEXTENCODING_SYMBOL );
else
- return sal_False;
+ return false;
}
-//UNUSED2008-05 FontToSubsFontConverter ScPatternAttr::GetSubsFontConverter( sal_uLong nFlags ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 const SfxPoolItem* pItem;
-//UNUSED2008-05 if( GetItemSet().GetItemState( ATTR_FONT, sal_True, &pItem ) == SFX_ITEM_SET )
-//UNUSED2008-05 return CreateFontToSubsFontConverter(
-//UNUSED2008-05 ((const SvxFontItem*) pItem)->GetFamilyName(), nFlags );
-//UNUSED2008-05 else
-//UNUSED2008-05 return 0;
-//UNUSED2008-05 }
-
sal_uLong ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const
{
@@ -1345,3 +1337,4 @@ sal_uInt8 ScPatternAttr::GetRotateDir( const SfxItemSet* pCondSet ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index 6b540781b66d..a76d4dac6cd3 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,11 @@ using ::rtl::OUString;
// ============================================================================
+ScDPName::ScDPName(const OUString& rName, const OUString& rLayoutName) :
+ maName(rName), maLayoutName(rLayoutName) {}
+
+// ============================================================================
+
ScDPLabelData::Member::Member() :
mbVisible(true),
mbShowDetails(true)
@@ -156,3 +162,4 @@ ScPivotFuncData::ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask, const DataPi
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index aa7e5adeb834..0596070e459a 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126,3 +127,4 @@ void ScPoolHelper::SourceDocumentGone()
// -----------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d1534f1b014c..ddf0941d1b44 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,7 +100,6 @@ void ScCaptionUtil::SetCaptionLayer( SdrCaptionObj& rCaption, bool bShown )
void ScCaptionUtil::SetBasicCaptionSettings( SdrCaptionObj& rCaption, bool bShown )
{
- ScDrawLayer::SetAnchor( &rCaption, SCA_PAGE );
SetCaptionLayer( rCaption, bShown );
rCaption.SetFixedTail();
rCaption.SetSpecialTextBoxShadow();
@@ -124,12 +124,12 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc )
aTriangle.append( ::basegfx::B2DPoint( 0.0, 30.0 ) );
aTriangle.append( ::basegfx::B2DPoint( 20.0, 30.0 ) );
aTriangle.setClosed( true );
- /* #99319# Line ends are now created with an empty name. The
+ /* Line ends are now created with an empty name. The
checkForUniqueItem() method then finds a unique name for the item's
value. */
aItemSet.Put( XLineStartItem( String::EmptyString(), ::basegfx::B2DPolyPolygon( aTriangle ) ) );
aItemSet.Put( XLineStartWidthItem( 200 ) );
- aItemSet.Put( XLineStartCenterItem( sal_False ) );
+ aItemSet.Put( XLineStartCenterItem( false ) );
aItemSet.Put( XFillStyleItem( XFILL_SOLID ) );
aItemSet.Put( XFillColorItem( String::EmptyString(), ScDetectiveFunc::GetCommentColor() ) );
aItemSet.Put( SdrCaptionEscDirItem( SDRCAPT_ESCBESTFIT ) );
@@ -138,7 +138,7 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc )
/* SdrShadowItem has sal_False, instead the shadow is set for the
rectangle only with SetSpecialTextBoxShadow() when the object is
created (item must be set to adjust objects from older files). */
- aItemSet.Put( SdrShadowItem( sal_False ) );
+ aItemSet.Put( SdrShadowItem( false ) );
aItemSet.Put( SdrShadowXDistItem( 100 ) );
aItemSet.Put( SdrShadowYDistItem( 100 ) );
@@ -147,9 +147,9 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc )
aItemSet.Put( SdrTextRightDistItem( 100 ) );
aItemSet.Put( SdrTextUpperDistItem( 100 ) );
aItemSet.Put( SdrTextLowerDistItem( 100 ) );
- aItemSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aItemSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
- // #78943# use the default cell style to be able to modify the caption font
+ aItemSet.Put( SdrTextAutoGrowWidthItem( false ) );
+ aItemSet.Put( SdrTextAutoGrowHeightItem( true ) );
+ // use the default cell style to be able to modify the caption font
const ScPatternAttr& rDefPattern = static_cast< const ScPatternAttr& >( rDoc.GetPool()->GetDefaultItem( ATTR_PATTERN ) );
rDefPattern.FillEditItemSet( &aItemSet );
@@ -161,7 +161,7 @@ void ScCaptionUtil::SetCaptionItems( SdrCaptionObj& rCaption, const SfxItemSet&
// copy all items
rCaption.SetMergedItemSet( rItemSet );
// reset shadow items
- rCaption.SetMergedItem( SdrShadowItem( sal_False ) );
+ rCaption.SetMergedItem( SdrShadowItem( false ) );
rCaption.SetMergedItem( SdrShadowXDistItem( 100 ) );
rCaption.SetMergedItem( SdrShadowYDistItem( 100 ) );
rCaption.SetSpecialTextBoxShadow();
@@ -921,3 +921,5 @@ ScPostIt* ScNoteUtil::CreateNoteFromString(
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/scdpoutputimpl.cxx b/sc/source/core/data/scdpoutputimpl.cxx
index 2cd711ac4497..1f533e034d32 100644
--- a/sc/source/core/data/scdpoutputimpl.cxx
+++ b/sc/source/core/data/scdpoutputimpl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -7,9 +8,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: scdpoutputimpl.cxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -122,7 +120,7 @@ sal_Bool OutputImpl::AddRow( SCROW nRow )
return sal_True;
}
else
- return sal_False;
+ return false;
}
sal_Bool OutputImpl::AddCol( SCCOL nCol )
@@ -135,7 +133,7 @@ sal_Bool OutputImpl::AddCol( SCCOL nCol )
return sal_True;
}
else
- return sal_False;
+ return false;
}
void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Bool bHori )
@@ -171,17 +169,19 @@ void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEnd
SvxBoxInfoItem aBoxInfo( ATTR_BORDER_INNER );
- aBoxInfo.SetValid(VALID_VERT,sal_False );
+ aBoxInfo.SetValid(VALID_VERT,false );
if ( bHori )
{
aBoxInfo.SetValid(VALID_HORI,sal_True);
aBoxInfo.SetLine( &aLine, BOXINFO_LINE_HORI );
}
else
- aBoxInfo.SetValid(VALID_HORI,sal_False );
+ aBoxInfo.SetValid(VALID_HORI,false );
- aBoxInfo.SetValid(VALID_DISTANCE,sal_False);
+ aBoxInfo.SetValid(VALID_DISTANCE,false);
mpDoc->ApplyFrameAreaTab( ScRange( nStartCol, nStartRow, mnTab, nEndCol, nEndRow , mnTab ), &aBox, &aBoxInfo );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/scdpoutputimpl.hxx b/sc/source/core/data/scdpoutputimpl.hxx
index a1b0a6c3a55b..35a0a65a06fc 100644
--- a/sc/source/core/data/scdpoutputimpl.hxx
+++ b/sc/source/core/data/scdpoutputimpl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -7,9 +8,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: scdpoutputimpl.hxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -72,8 +70,10 @@ public:
sal_Bool AddCol( SCCOL nCol );
void OutputDataArea();
- void OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Bool bHori = sal_False );
+ void OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Bool bHori = false );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx
index 86b53582d1d4..a517b9ae38c6 100644
--- a/sc/source/core/data/segmenttree.cxx
+++ b/sc/source/core/data/segmenttree.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,10 +57,11 @@ public:
ScFlatSegmentsImpl(const ScFlatSegmentsImpl& r);
~ScFlatSegmentsImpl();
- void setValue(SCCOLROW nPos1, SCCOLROW nPos2, ValueType nValue);
+ bool setValue(SCCOLROW nPos1, SCCOLROW nPos2, ValueType nValue);
ValueType getValue(SCCOLROW nPos);
ExtValueType getSumValue(SCCOLROW nPos1, SCCOLROW nPos2);
bool getRangeData(SCCOLROW nPos, RangeData& rData);
+ bool getRangeDataLeaf(SCCOLROW nPos, RangeData& rData);
void removeSegment(SCCOLROW nPos1, SCCOLROW nPos2);
void insertSegment(SCCOLROW nPos, SCCOLROW nSize, bool bSkipStartBoundary);
@@ -74,33 +76,25 @@ public:
mbTreeSearchEnabled = b;
}
- void setInsertFromBack(bool b)
- {
- mbInsertFromBack = b;
- }
-
private:
typedef ::mdds::flat_segment_tree<SCCOLROW, ValueType> fst_type;
fst_type maSegments;
typename fst_type::const_iterator maItr;
bool mbTreeSearchEnabled:1;
- bool mbInsertFromBack:1;
};
template<typename _ValueType, typename _ExtValueType>
ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ScFlatSegmentsImpl(SCCOLROW nMax, ValueType nDefault) :
maSegments(0, nMax+1, nDefault),
- mbTreeSearchEnabled(true),
- mbInsertFromBack(false)
+ mbTreeSearchEnabled(true)
{
}
template<typename _ValueType, typename _ExtValueType>
ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ScFlatSegmentsImpl(const ScFlatSegmentsImpl<_ValueType, _ExtValueType>& r) :
maSegments(r.maSegments),
- mbTreeSearchEnabled(r.mbTreeSearchEnabled),
- mbInsertFromBack(r.mbInsertFromBack)
+ mbTreeSearchEnabled(r.mbTreeSearchEnabled)
{
}
@@ -110,12 +104,12 @@ ScFlatSegmentsImpl<_ValueType, _ExtValueType>::~ScFlatSegmentsImpl()
}
template<typename _ValueType, typename _ExtValueType>
-void ScFlatSegmentsImpl<_ValueType, _ExtValueType>::setValue(SCCOLROW nPos1, SCCOLROW nPos2, ValueType nValue)
+bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::setValue(SCCOLROW nPos1, SCCOLROW nPos2, ValueType nValue)
{
- if (mbInsertFromBack)
- maSegments.insert_back(nPos1, nPos2+1, nValue);
- else
- maSegments.insert_front(nPos1, nPos2+1, nValue);
+ ::std::pair<typename fst_type::const_iterator, bool> ret;
+ ret = maSegments.insert(maItr, nPos1, nPos2+1, nValue);
+ maItr = ret.first;
+ return ret.second;
}
template<typename _ValueType, typename _ExtValueType>
@@ -167,23 +161,38 @@ ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getSumValue(SCCOLROW nPos1, SCCOL
template<typename _ValueType, typename _ExtValueType>
bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getRangeData(SCCOLROW nPos, RangeData& rData)
{
+ if (!mbTreeSearchEnabled)
+ return getRangeDataLeaf(nPos, rData);
+
ValueType nValue;
SCCOLROW nPos1, nPos2;
- if (mbTreeSearchEnabled)
- {
- if (!maSegments.is_tree_valid())
- maSegments.build_tree();
+ if (!maSegments.is_tree_valid())
+ maSegments.build_tree();
- if (!maSegments.search_tree(nPos, nValue, &nPos1, &nPos2))
- return false;
- }
- else
- {
- // Conduct leaf-node only search. Faster when searching between range insertion.
- if (!maSegments.search(nPos, nValue, &nPos1, &nPos2))
- return false;
- }
+ if (!maSegments.search_tree(nPos, nValue, &nPos1, &nPos2))
+ return false;
+
+ rData.mnPos1 = nPos1;
+ rData.mnPos2 = nPos2-1; // end point is not inclusive.
+ rData.mnValue = nValue;
+ return true;
+}
+
+template<typename _ValueType, typename _ExtValueType>
+bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getRangeDataLeaf(SCCOLROW nPos, RangeData& rData)
+{
+ ValueType nValue;
+ SCCOLROW nPos1, nPos2;
+
+ // Conduct leaf-node only search. Faster when searching between range insertion.
+ ::std::pair<typename fst_type::const_iterator, bool> ret =
+ maSegments.search(maItr, nPos, nValue, &nPos1, &nPos2);
+
+ if (!ret.second)
+ return false;
+
+ maItr = ret.first;
rData.mnPos1 = nPos1;
rData.mnPos2 = nPos2-1; // end point is not inclusive.
@@ -267,18 +276,18 @@ public:
{
}
- void setTrue(SCCOLROW nPos1, SCCOLROW nPos2);
- void setFalse(SCCOLROW nPos1, SCCOLROW nPos2);
+ bool setTrue(SCCOLROW nPos1, SCCOLROW nPos2);
+ bool setFalse(SCCOLROW nPos1, SCCOLROW nPos2);
};
-void ScFlatBoolSegmentsImpl::setTrue(SCCOLROW nPos1, SCCOLROW nPos2)
+bool ScFlatBoolSegmentsImpl::setTrue(SCCOLROW nPos1, SCCOLROW nPos2)
{
- setValue(nPos1, nPos2, true);
+ return setValue(nPos1, nPos2, true);
}
-void ScFlatBoolSegmentsImpl::setFalse(SCCOLROW nPos1, SCCOLROW nPos2)
+bool ScFlatBoolSegmentsImpl::setFalse(SCCOLROW nPos1, SCCOLROW nPos2)
{
- setValue(nPos1, nPos2, false);
+ return setValue(nPos1, nPos2, false);
}
// ============================================================================
@@ -361,14 +370,14 @@ ScFlatBoolRowSegments::~ScFlatBoolRowSegments()
{
}
-void ScFlatBoolRowSegments::setTrue(SCROW nRow1, SCROW nRow2)
+bool ScFlatBoolRowSegments::setTrue(SCROW nRow1, SCROW nRow2)
{
- mpImpl->setTrue(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
+ return mpImpl->setTrue(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
}
-void ScFlatBoolRowSegments::setFalse(SCROW nRow1, SCROW nRow2)
+bool ScFlatBoolRowSegments::setFalse(SCROW nRow1, SCROW nRow2)
{
- mpImpl->setFalse(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
+ return mpImpl->setFalse(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
}
bool ScFlatBoolRowSegments::getValue(SCROW nRow)
@@ -388,6 +397,18 @@ bool ScFlatBoolRowSegments::getRangeData(SCROW nRow, RangeData& rData)
return true;
}
+bool ScFlatBoolRowSegments::getRangeDataLeaf(SCROW nRow, RangeData& rData)
+{
+ ScFlatBoolSegmentsImpl::RangeData aData;
+ if (!mpImpl->getRangeDataLeaf(static_cast<SCCOLROW>(nRow), aData))
+ return false;
+
+ rData.mbValue = aData.mnValue;
+ rData.mnRow1 = static_cast<SCROW>(aData.mnPos1);
+ rData.mnRow2 = static_cast<SCROW>(aData.mnPos2);
+ return true;
+}
+
void ScFlatBoolRowSegments::removeSegment(SCROW nRow1, SCROW nRow2)
{
mpImpl->removeSegment(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
@@ -403,16 +424,6 @@ SCROW ScFlatBoolRowSegments::findLastNotOf(bool bValue) const
return static_cast<SCROW>(mpImpl->findLastNotOf(bValue));
}
-void ScFlatBoolRowSegments::enableTreeSearch(bool bEnable)
-{
- mpImpl->enableTreeSearch(bEnable);
-}
-
-void ScFlatBoolRowSegments::setInsertFromBack(bool bInsertFromBack)
-{
- mpImpl->setInsertFromBack(bInsertFromBack);
-}
-
// ============================================================================
ScFlatBoolColSegments::ScFlatBoolColSegments() :
@@ -429,19 +440,14 @@ ScFlatBoolColSegments::~ScFlatBoolColSegments()
{
}
-void ScFlatBoolColSegments::setTrue(SCCOL nCol1, SCCOL nCol2)
+bool ScFlatBoolColSegments::setTrue(SCCOL nCol1, SCCOL nCol2)
{
- mpImpl->setTrue(static_cast<SCCOLROW>(nCol1), static_cast<SCCOLROW>(nCol2));
+ return mpImpl->setTrue(static_cast<SCCOLROW>(nCol1), static_cast<SCCOLROW>(nCol2));
}
-void ScFlatBoolColSegments::setFalse(SCCOL nCol1, SCCOL nCol2)
+bool ScFlatBoolColSegments::setFalse(SCCOL nCol1, SCCOL nCol2)
{
- mpImpl->setFalse(static_cast<SCCOLROW>(nCol1), static_cast<SCCOLROW>(nCol2));
-}
-
-bool ScFlatBoolColSegments::getValue(SCCOL nCol)
-{
- return mpImpl->getValue(static_cast<SCCOLROW>(nCol));
+ return mpImpl->setFalse(static_cast<SCCOLROW>(nCol1), static_cast<SCCOLROW>(nCol2));
}
bool ScFlatBoolColSegments::getRangeData(SCCOL nCol, RangeData& rData)
@@ -466,19 +472,6 @@ void ScFlatBoolColSegments::insertSegment(SCCOL nCol, SCCOL nSize, bool bSkipSta
mpImpl->insertSegment(static_cast<SCCOLROW>(nCol), static_cast<SCCOLROW>(nSize), bSkipStartBoundary);
}
-void ScFlatBoolColSegments::enableTreeSearch(bool bEnable)
-{
- mpImpl->enableTreeSearch(bEnable);
-}
-
-void ScFlatBoolColSegments::setInsertFromBack(bool bInsertFromBack)
-{
- mpImpl->setInsertFromBack(bInsertFromBack);
-}
-
-// ============================================================================
-
-
// ============================================================================
ScFlatUInt16RowSegments::ForwardIterator::ForwardIterator(ScFlatUInt16RowSegments& rSegs) :
@@ -575,8 +568,4 @@ void ScFlatUInt16RowSegments::enableTreeSearch(bool bEnable)
mpImpl->enableTreeSearch(bEnable);
}
-void ScFlatUInt16RowSegments::setInsertFromBack(bool bInsertFromBack)
-{
- mpImpl->setInsertFromBack(bInsertFromBack);
-}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/sheetevents.cxx b/sc/source/core/data/sheetevents.cxx
index e1875b5db15b..652d2cc3eda2 100644
--- a/sc/source/core/data/sheetevents.cxx
+++ b/sc/source/core/data/sheetevents.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sheetdata.cxx,v $
- * $Revision: 1.69.32.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -39,7 +37,6 @@
// -----------------------------------------------------------------------
-// static
rtl::OUString ScSheetEvents::GetEventName(sal_Int32 nEvent)
{
if (nEvent<0 || nEvent>=SC_SHEETEVENT_COUNT)
@@ -61,7 +58,6 @@ rtl::OUString ScSheetEvents::GetEventName(sal_Int32 nEvent)
return rtl::OUString::createFromAscii(aEventNames[nEvent]);
}
-// static
sal_Int32 ScSheetEvents::GetVbaSheetEventId(sal_Int32 nEvent)
{
using namespace ::com::sun::star::script::vba::VBAEventId;
@@ -84,7 +80,6 @@ sal_Int32 ScSheetEvents::GetVbaSheetEventId(sal_Int32 nEvent)
return nVbaEventIds[nEvent];
}
-// static
sal_Int32 ScSheetEvents::GetVbaDocumentEventId(sal_Int32 nEvent)
{
using namespace ::com::sun::star::script::vba::VBAEventId;
@@ -170,3 +165,4 @@ void ScSheetEvents::SetScript(sal_Int32 nEvent, const rtl::OUString* pNew)
mpScriptNames[nEvent] = NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx
index d6c3308a47e0..fc3b4957c9ca 100644
--- a/sc/source/core/data/sortparam.cxx
+++ b/sc/source/core/data/sortparam.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,11 +49,12 @@ ScSortParam::ScSortParam()
ScSortParam::ScSortParam( const ScSortParam& r ) :
nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),
- bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),
+ bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),bNaturalSort(r.bNaturalSort),
bUserDef(r.bUserDef),nUserIndex(r.nUserIndex),bIncludePattern(r.bIncludePattern),
bInplace(r.bInplace),
nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow),
- aCollatorLocale( r.aCollatorLocale ), aCollatorAlgorithm( r.aCollatorAlgorithm )
+ aCollatorLocale( r.aCollatorLocale ), aCollatorAlgorithm( r.aCollatorAlgorithm ),
+ nCompatHeader( r.nCompatHeader )
{
for (sal_uInt16 i=0; i<MAXSORT; i++)
{
@@ -71,14 +73,14 @@ void ScSortParam::Clear()
nCompatHeader = 2;
nDestTab = 0;
nUserIndex = 0;
- bHasHeader=bCaseSens=bUserDef = sal_False;
- bByRow=bIncludePattern=bInplace = sal_True;
+ bHasHeader=bCaseSens=bUserDef=bNaturalSort = false;
+ bByRow=bIncludePattern=bInplace = true;
aCollatorLocale = ::com::sun::star::lang::Locale();
aCollatorAlgorithm.Erase();
for (sal_uInt16 i=0; i<MAXSORT; i++)
{
- bDoSort[i] = sal_False;
+ bDoSort[i] = false;
nField[i] = 0;
bAscending[i] = sal_True;
}
@@ -93,8 +95,9 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r )
nCol2 = r.nCol2;
nRow2 = r.nRow2;
bHasHeader = r.bHasHeader;
- bCaseSens = r.bCaseSens;
bByRow = r.bByRow;
+ bCaseSens = r.bCaseSens;
+ bNaturalSort = r.bNaturalSort;
bUserDef = r.bUserDef;
nUserIndex = r.nUserIndex;
bIncludePattern = r.bIncludePattern;
@@ -104,6 +107,7 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r )
nDestRow = r.nDestRow;
aCollatorLocale = r.aCollatorLocale;
aCollatorAlgorithm = r.aCollatorAlgorithm;
+ nCompatHeader = r.nCompatHeader;
for (sal_uInt16 i=0; i<MAXSORT; i++)
{
@@ -119,7 +123,7 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r )
sal_Bool ScSortParam::operator==( const ScSortParam& rOther ) const
{
- sal_Bool bEqual = sal_False;
+ sal_Bool bEqual = false;
// Anzahl der Sorts gleich?
sal_uInt16 nLast = 0;
sal_uInt16 nOtherLast = 0;
@@ -135,6 +139,7 @@ sal_Bool ScSortParam::operator==( const ScSortParam& rOther ) const
&& (bHasHeader == rOther.bHasHeader)
&& (bByRow == rOther.bByRow)
&& (bCaseSens == rOther.bCaseSens)
+ && (bNaturalSort == rOther.bNaturalSort)
&& (bUserDef == rOther.bUserDef)
&& (nUserIndex == rOther.nUserIndex)
&& (bIncludePattern == rOther.bIncludePattern)
@@ -161,11 +166,12 @@ sal_Bool ScSortParam::operator==( const ScSortParam& rOther ) const
ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) :
nCol1(rSub.nCol1),nRow1(rSub.nRow1),nCol2(rSub.nCol2),nRow2(rSub.nRow2),
- bHasHeader(sal_True),bByRow(sal_True),bCaseSens(rSub.bCaseSens),
+ bHasHeader(true),bByRow(true),bCaseSens(rSub.bCaseSens),bNaturalSort(rOld.bNaturalSort),
bUserDef(rSub.bUserDef),nUserIndex(rSub.nUserIndex),bIncludePattern(rSub.bIncludePattern),
bInplace(sal_True),
nDestTab(0),nDestCol(0),nDestRow(0),
- aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( rOld.aCollatorAlgorithm )
+ aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( rOld.aCollatorAlgorithm ),
+ nCompatHeader( rOld.nCompatHeader )
{
sal_uInt16 nNewCount = 0;
sal_uInt16 i;
@@ -189,7 +195,7 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
if (rOld.bDoSort[i])
{
SCCOLROW nThisField = rOld.nField[i];
- sal_Bool bDouble = sal_False;
+ sal_Bool bDouble = false;
for (sal_uInt16 j=0; j<nNewCount; j++)
if ( nField[j] == nThisField )
bDouble = sal_True;
@@ -207,7 +213,7 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
for (i=nNewCount; i<MAXSORT; i++) // Rest loeschen
{
- bDoSort[i] = sal_False;
+ bDoSort[i] = false;
nField[i] = 0;
bAscending[i] = sal_True;
}
@@ -217,18 +223,19 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
ScSortParam::ScSortParam( const ScQueryParam& rParam, SCCOL nCol ) :
nCol1(nCol),nRow1(rParam.nRow1),nCol2(nCol),nRow2(rParam.nRow2),
- bHasHeader(rParam.bHasHeader),bByRow(sal_True),bCaseSens(rParam.bCaseSens),
+ bHasHeader(rParam.bHasHeader),bByRow(true),bCaseSens(rParam.bCaseSens),
+ bNaturalSort(false),
//! TODO: what about Locale and Algorithm?
- bUserDef(sal_False),nUserIndex(0),bIncludePattern(sal_False),
- bInplace(sal_True),
- nDestTab(0),nDestCol(0),nDestRow(0)
+ bUserDef(false),nUserIndex(0),bIncludePattern(false),
+ bInplace(true),
+ nDestTab(0),nDestCol(0),nDestRow(0), nCompatHeader(2)
{
bDoSort[0] = sal_True;
nField[0] = nCol;
bAscending[0] = sal_True;
for (sal_uInt16 i=1; i<MAXSORT; i++)
{
- bDoSort[i] = sal_False;
+ bDoSort[i] = false;
nField[i] = 0;
bAscending[i] = sal_True;
}
@@ -257,7 +264,8 @@ void ScSortParam::MoveToDest()
}
else
{
- DBG_ERROR("MoveToDest, bInplace == TRUE");
+ OSL_FAIL("MoveToDest, bInplace == TRUE");
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 6af80e51e7a2..a72a0c9953d9 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,6 +47,7 @@
#include <editeng/postitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/itemset.hxx>
#include <svl/zforlist.hxx>
#include <unotools/charclass.hxx>
@@ -79,7 +81,7 @@ ScStyleSheetPool::ScStyleSheetPool( SfxItemPool& rPoolP,
//------------------------------------------------------------------------
-__EXPORT ScStyleSheetPool::~ScStyleSheetPool()
+ScStyleSheetPool::~ScStyleSheetPool()
{
}
@@ -92,13 +94,6 @@ void ScStyleSheetPool::SetDocument( ScDocument* pDocument )
//------------------------------------------------------------------------
-//UNUSED2009-05 void ScStyleSheetPool::SetForceStdName( const String* pSet )
-//UNUSED2009-05 {
-//UNUSED2009-05 pForceStdName = pSet;
-//UNUSED2009-05 }
-
-//------------------------------------------------------------------------
-
SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName,
SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos )
{
@@ -110,7 +105,7 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName,
if ( rName.EqualsAscii(STRING_STANDARD) && Find( rName, eFam ) != NULL )
{
- DBG_ERROR("renaming additional default style");
+ OSL_FAIL("renaming additional default style");
sal_uInt32 nCount = aStyles.size();
for ( sal_uInt32 nAdd = 1; nAdd <= nCount; nAdd++ )
{
@@ -126,7 +121,7 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName,
//------------------------------------------------------------------------
-SfxStyleSheetBase* __EXPORT ScStyleSheetPool::Create(
+SfxStyleSheetBase* ScStyleSheetPool::Create(
const String& rName,
SfxStyleFamily eFamily,
sal_uInt16 nMaskP )
@@ -140,7 +135,7 @@ SfxStyleSheetBase* __EXPORT ScStyleSheetPool::Create(
//------------------------------------------------------------------------
-SfxStyleSheetBase* __EXPORT ScStyleSheetPool::Create( const SfxStyleSheetBase& rStyle )
+SfxStyleSheetBase* ScStyleSheetPool::Create( const SfxStyleSheetBase& rStyle )
{
DBG_ASSERT( rStyle.ISA(ScStyleSheet), "Invalid StyleSheet-class! :-/" );
return new ScStyleSheet( (const ScStyleSheet&) rStyle );
@@ -148,7 +143,7 @@ SfxStyleSheetBase* __EXPORT ScStyleSheetPool::Create( const SfxStyleSheetBase& r
//------------------------------------------------------------------------
-void __EXPORT ScStyleSheetPool::Remove( SfxStyleSheetBase* pStyle )
+void ScStyleSheetPool::Remove( SfxStyleSheetBase* pStyle )
{
if ( pStyle )
{
@@ -182,14 +177,14 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool,
{
// Set-Items
- if ( rSourceSet.GetItemState( ATTR_PAGE_HEADERSET, sal_False, &pItem ) == SFX_ITEM_SET )
+ if ( rSourceSet.GetItemState( ATTR_PAGE_HEADERSET, false, &pItem ) == SFX_ITEM_SET )
{
const SfxItemSet& rSrcSub = ((const SvxSetItem*) pItem)->GetItemSet();
SfxItemSet aDestSub( *rDestSet.GetPool(), rSrcSub.GetRanges() );
aDestSub.PutExtended( rSrcSub, SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT );
rDestSet.Put( SvxSetItem( ATTR_PAGE_HEADERSET, aDestSub ) );
}
- if ( rSourceSet.GetItemState( ATTR_PAGE_FOOTERSET, sal_False, &pItem ) == SFX_ITEM_SET )
+ if ( rSourceSet.GetItemState( ATTR_PAGE_FOOTERSET, false, &pItem ) == SFX_ITEM_SET )
{
const SfxItemSet& rSrcSub = ((const SvxSetItem*) pItem)->GetItemSet();
SfxItemSet aDestSub( *rDestSet.GetPool(), rSrcSub.GetRanges() );
@@ -199,10 +194,10 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool,
}
else // cell styles
{
- // #b5017505# number format exchange list has to be handled here, too
+ // number format exchange list has to be handled here, too
if ( pDoc && pDoc->GetFormatExchangeList() &&
- rSourceSet.GetItemState( ATTR_VALUE_FORMAT, sal_False, &pItem ) == SFX_ITEM_SET )
+ rSourceSet.GetItemState( ATTR_VALUE_FORMAT, false, &pItem ) == SFX_ITEM_SET )
{
sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pDoc->GetFormatExchangeList()->Get( nOldFormat ));
@@ -260,12 +255,11 @@ void ScStyleSheetPool::CreateStandardStyles()
String aStr;
xub_StrLen nStrLen;
String aHelpFile;//XXX JN welcher Text???
- //sal_uLong nNumFmt = 0L;
SfxItemSet* pSet = NULL;
SfxItemSet* pHFSet = NULL;
SvxSetItem* pHFSetItem = NULL;
ScEditEngineDefaulter* pEdEngine = new ScEditEngineDefaulter( EditEngine::CreatePool(), sal_True );
- pEdEngine->SetUpdateMode( sal_False );
+ pEdEngine->SetUpdateMode( false );
EditTextObject* pEmptyTxtObj = pEdEngine->CreateTextObject();
EditTextObject* pTxtObj = NULL;
ScPageHFItem* pHeaderItem = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT );
@@ -296,7 +290,7 @@ void ScStyleSheetPool::CreateStandardStyles()
LanguageType eLatin, eCjk, eCtl;
pDoc->GetLanguage( eLatin, eCjk, eCtl );
- // #108374# / #107782#: If the UI language is Korean, the default Latin font has to
+ // If the UI language is Korean, the default Latin font has to
// be queried for Korean, too (the Latin language from the document can't be Korean).
// This is the same logic as in SwDocShell::InitNew.
LanguageType eUiLanguage = Application::GetSettings().GetUILanguage();
@@ -342,11 +336,6 @@ void ScStyleSheetPool::CreateStandardStyles()
pSheet->SetParent( SCSTR( STR_STYLENAME_RESULT ) );
pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_CELL_ERG1 );
- // will now be done in GetItemSet();
- // pSet = &pSheet->GetItemSet();
- // nNumFmt = pDoc->GetFormatTable()->GetStandardFormat( NUMBERFORMAT_CURRENCY,
- // ScGlobal::eLnge );
- // pSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNumFmt ) );
//----------------
// 4. Ueberschrift
@@ -447,7 +436,7 @@ void ScStyleSheetPool::CreateStandardStyles()
aBoxInfoItem.SetValid( VALID_LEFT, sal_True );
aBoxInfoItem.SetValid( VALID_RIGHT, sal_True );
aBoxInfoItem.SetValid( VALID_DISTANCE, sal_True );
- aBoxInfoItem.SetTable( sal_False );
+ aBoxInfoItem.SetTable( false );
aBoxInfoItem.SetDist ( sal_True );
pHFSetItem = new SvxSetItem( ((SvxSetItem&)pSet->Get( ATTR_PAGE_HEADERSET ) ) );
@@ -509,114 +498,6 @@ void ScStyleSheetPool::CreateStandardStyles()
//------------------------------------------------------------------------
-//UNUSED2008-05 void ScStyleSheetPool::UpdateStdNames()
-//UNUSED2008-05 {
-//UNUSED2008-05 // Standard-Styles den richtigen Namen in der Programm-Sprache geben
-//UNUSED2008-05
-//UNUSED2008-05 String aHelpFile;
-//UNUSED2008-05 sal_uInt32 nCount = aStyles.size();
-//UNUSED2008-05 for (sal_uInt32 n=0; n<nCount; n++)
-//UNUSED2008-05 {
-//UNUSED2008-05 SfxStyleSheetBase* pStyle = aStyles[n].get();
-//UNUSED2008-05 if (!pStyle->IsUserDefined())
-//UNUSED2008-05 {
-//UNUSED2008-05 String aOldName = pStyle->GetName();
-//UNUSED2008-05 sal_uLong nHelpId = pStyle->GetHelpId( aHelpFile );
-//UNUSED2008-05 SfxStyleFamily eFam = pStyle->GetFamily();
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool bHelpKnown = sal_True;
-//UNUSED2008-05 String aNewName;
-//UNUSED2008-05 sal_uInt16 nNameId = 0;
-//UNUSED2008-05 switch( nHelpId )
-//UNUSED2008-05 {
-//UNUSED2008-05 case HID_SC_SHEET_CELL_STD:
-//UNUSED2008-05 case HID_SC_SHEET_PAGE_STD: nNameId = STR_STYLENAME_STANDARD; break;
-//UNUSED2008-05 case HID_SC_SHEET_CELL_ERG: nNameId = STR_STYLENAME_RESULT; break;
-//UNUSED2008-05 case HID_SC_SHEET_CELL_ERG1: nNameId = STR_STYLENAME_RESULT1; break;
-//UNUSED2008-05 case HID_SC_SHEET_CELL_UEB: nNameId = STR_STYLENAME_HEADLINE; break;
-//UNUSED2008-05 case HID_SC_SHEET_CELL_UEB1: nNameId = STR_STYLENAME_HEADLINE1; break;
-//UNUSED2008-05 case HID_SC_SHEET_PAGE_REP: nNameId = STR_STYLENAME_REPORT; break;
-//UNUSED2008-05 default:
-//UNUSED2008-05 // 0 oder falsche (alte) HelpId
-//UNUSED2008-05 bHelpKnown = sal_False;
-//UNUSED2008-05 }
-//UNUSED2008-05 if (bHelpKnown)
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( nNameId )
-//UNUSED2008-05 aNewName = SCSTR( nNameId );
-//UNUSED2008-05
-//UNUSED2008-05 if ( aNewName.Len() && aNewName != aOldName && !Find( aNewName, eFam ) )
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_TRACE( "Renaming style..." );
-//UNUSED2008-05
-//UNUSED2008-05 pStyle->SetName( aNewName ); // setzt auch Parents um
-//UNUSED2008-05
-//UNUSED2008-05 // Styles in Patterns sind schon auf Pointer umgesetzt
-//UNUSED2008-05 if (eFam == SFX_STYLE_FAMILY_PAGE)
-//UNUSED2008-05 {
-//UNUSED2008-05 // Page-Styles umsetzen
-//UNUSED2008-05 // TableCount am Doc ist noch nicht initialisiert
-//UNUSED2008-05 for (SCTAB nTab=0; nTab<=MAXTAB && pDoc->HasTable(nTab); nTab++)
-//UNUSED2008-05 if (pDoc->GetPageStyle(nTab) == aOldName)
-//UNUSED2008-05 pDoc->SetPageStyle(nTab, aNewName);
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 // wrong or no HelpId -> set new HelpId
-//UNUSED2008-05
-//UNUSED2008-05 // no assertion for wrong HelpIds because this happens
-//UNUSED2008-05 // with old files (#67218#) or with old files that were
-//UNUSED2008-05 // saved again with a new version in a different language
-//UNUSED2008-05 // (so SrcVersion doesn't help)
-//UNUSED2008-05
-//UNUSED2008-05 sal_uInt16 nNewId = 0;
-//UNUSED2008-05 if ( eFam == SFX_STYLE_FAMILY_PARA )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( aOldName == SCSTR( STR_STYLENAME_STANDARD ) )
-//UNUSED2008-05 nNewId = HID_SC_SHEET_CELL_STD;
-//UNUSED2008-05 else if ( aOldName == SCSTR( STR_STYLENAME_RESULT ) )
-//UNUSED2008-05 nNewId = HID_SC_SHEET_CELL_ERG;
-//UNUSED2008-05 else if ( aOldName == SCSTR( STR_STYLENAME_RESULT1 ) )
-//UNUSED2008-05 nNewId = HID_SC_SHEET_CELL_ERG1;
-//UNUSED2008-05 else if ( aOldName == SCSTR( STR_STYLENAME_HEADLINE ) )
-//UNUSED2008-05 nNewId = HID_SC_SHEET_CELL_UEB;
-//UNUSED2008-05 else if ( aOldName == SCSTR( STR_STYLENAME_HEADLINE1 ) )
-//UNUSED2008-05 nNewId = HID_SC_SHEET_CELL_UEB1;
-//UNUSED2008-05 }
-//UNUSED2008-05 else // PAGE
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( aOldName == SCSTR( STR_STYLENAME_STANDARD ) )
-//UNUSED2008-05 nNewId = HID_SC_SHEET_PAGE_STD;
-//UNUSED2008-05 else if ( aOldName == SCSTR( STR_STYLENAME_REPORT ) )
-//UNUSED2008-05 nNewId = HID_SC_SHEET_PAGE_REP;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 if ( nNewId ) // new ID found from name -> set ID
-//UNUSED2008-05 {
-//UNUSED2008-05 pStyle->SetHelpId( aHelpFile, nNewId );
-//UNUSED2008-05 }
-//UNUSED2008-05 else if ( nHelpId == 0 ) // no old and no new ID
-//UNUSED2008-05 {
-//UNUSED2008-05 // #71471# probably user defined style without SFXSTYLEBIT_USERDEF set
-//UNUSED2008-05 // (from StarCalc 1.0 import), fixed in src563 and above
-//UNUSED2008-05 //! may also be default style from a different language
-//UNUSED2008-05 //! test if name was generated from StarCalc 1.0 import?
-//UNUSED2008-05 DBG_ASSERT(pDoc->GetSrcVersion() <= SC_SUBTOTAL_BUGFIX,
-//UNUSED2008-05 "user defined style without SFXSTYLEBIT_USERDEF");
-//UNUSED2008-05 pStyle->SetMask( pStyle->GetMask() | SFXSTYLEBIT_USERDEF );
-//UNUSED2008-05 }
-//UNUSED2008-05 // else: wrong old ID and no new ID found:
-//UNUSED2008-05 // probably default style from a different language
-//UNUSED2008-05 // -> leave unchanged (HelpId will be set if loaded with matching
-//UNUSED2008-05 // language version later)
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-
-//------------------------------------------------------------------------
ScStyleSheet* ScStyleSheetPool::FindCaseIns( const String& rName, SfxStyleFamily eFam )
{
@@ -639,3 +520,4 @@ ScStyleSheet* ScStyleSheetPool::FindCaseIns( const String& rName, SfxStyleFamily
return NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index fbb37c1c5775..d51582370045 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,27 +85,27 @@ ScStyleSheet::ScStyleSheet( const ScStyleSheet& rStyle )
//------------------------------------------------------------------------
-__EXPORT ScStyleSheet::~ScStyleSheet()
+ScStyleSheet::~ScStyleSheet()
{
}
//------------------------------------------------------------------------
-sal_Bool __EXPORT ScStyleSheet::HasFollowSupport() const
+sal_Bool ScStyleSheet::HasFollowSupport() const
{
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
-sal_Bool __EXPORT ScStyleSheet::HasParentSupport () const
+sal_Bool ScStyleSheet::HasParentSupport () const
{
- sal_Bool bHasParentSupport = sal_False;
+ sal_Bool bHasParentSupport = false;
switch ( GetFamily() )
{
case SFX_STYLE_FAMILY_PARA: bHasParentSupport = sal_True; break;
- case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = sal_False; break;
+ case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break;
default:
{
// added to avoid warnings
@@ -116,9 +117,9 @@ sal_Bool __EXPORT ScStyleSheet::HasParentSupport () const
//------------------------------------------------------------------------
-sal_Bool __EXPORT ScStyleSheet::SetParent( const String& rParentName )
+sal_Bool ScStyleSheet::SetParent( const String& rParentName )
{
- sal_Bool bResult = sal_False;
+ sal_Bool bResult = false;
String aEffName = rParentName;
SfxStyleSheetBase* pStyle = rPool.Find( aEffName, nFamily );
if (!pStyle)
@@ -151,7 +152,7 @@ sal_Bool __EXPORT ScStyleSheet::SetParent( const String& rParentName )
//------------------------------------------------------------------------
-SfxItemSet& __EXPORT ScStyleSheet::GetItemSet()
+SfxItemSet& ScStyleSheet::GetItemSet()
{
if ( !pSet )
{
@@ -207,12 +208,11 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet()
ATTR_ULSPACE );
SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
- aBoxInfoItem.SetTable( sal_False );
+ aBoxInfoItem.SetTable( false );
aBoxInfoItem.SetDist( sal_True );
aBoxInfoItem.SetValid( VALID_DISTANCE, sal_True );
- // aPageItem.SetLandscape( ORIENTATION_LANDSCAPE == pPrinter->GetOrientation() );
- aPageItem.SetLandscape( sal_False );
+ aPageItem.SetLandscape( false );
rHFSet.Put( aBoxInfoItem );
rHFSet.Put( aHFSizeItem );
@@ -251,8 +251,8 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet()
0 );
break;
}
- bMySet = sal_True;
- } // if ( !pSet )
+ bMySet = true;
+ }
if ( nHelpId == HID_SC_SHEET_CELL_ERG1 )
{
if ( !pSet->Count() )
@@ -262,7 +262,7 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet()
{
sal_uLong nNumFmt = pDoc->GetFormatTable()->GetStandardFormat( NUMBERFORMAT_CURRENCY,ScGlobal::eLnge );
pSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNumFmt ) );
- } // if ( pDoc && pDoc->IsLoadingDone() )
+ }
}
}
@@ -271,7 +271,7 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet()
//------------------------------------------------------------------------
-sal_Bool __EXPORT ScStyleSheet::IsUsed() const
+sal_Bool ScStyleSheet::IsUsed() const
{
if ( GetFamily() == SFX_STYLE_FAMILY_PARA )
{
@@ -290,7 +290,7 @@ sal_Bool __EXPORT ScStyleSheet::IsUsed() const
//------------------------------------------------------------------------
-void __EXPORT ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
+void ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.ISA(SfxSimpleHint) )
if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
@@ -299,7 +299,7 @@ void __EXPORT ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
//------------------------------------------------------------------------
-// #66123# schmutzige Tricks, um die Standard-Vorlage immer als "Standard" zu speichern,
+// schmutzige Tricks, um die Standard-Vorlage immer als "Standard" zu speichern,
// obwohl der fuer den Benutzer sichtbare Name uebersetzt ist:
const String& ScStyleSheet::GetName() const
@@ -344,10 +344,11 @@ sal_Bool ScStyleSheet::SetName( const String& rNew )
{
String aFileStdName = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STRING_STANDARD));
if ( rNew == aFileStdName && aFileStdName != ScGlobal::GetRscString(STR_STYLENAME_STANDARD) )
- return sal_False;
+ return false;
else
return SfxStyleSheet::SetName( rNew );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/tabbgcolor.cxx b/sc/source/core/data/tabbgcolor.cxx
index a3d9eec16d99..0008ab2fa3f2 100644
--- a/sc/source/core/data/tabbgcolor.cxx
+++ b/sc/source/core/data/tabbgcolor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: tabbgcolor.hxx,v $
- * $Revision: 1.00 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -37,16 +35,6 @@
#include "tabbgcolor.hxx"
-bool ScUndoTabColorInfo::IsDefaultOldTabBgColor() const
-{
- return maOldTabBgColor == Color(COL_AUTO);
-}
-
-bool ScUndoTabColorInfo::IsDefaultNewTabBgColor() const
-{
- return maOldTabBgColor == Color(COL_AUTO);
-}
-
ScUndoTabColorInfo::ScUndoTabColorInfo(SCTAB nTab) :
mnTabId(nTab),
maOldTabBgColor(COL_AUTO),
@@ -60,3 +48,5 @@ ScUndoTabColorInfo::ScUndoTabColorInfo(const ScUndoTabColorInfo& r) :
maNewTabBgColor(r.maNewTabBgColor)
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index be7cab80508b..cc82529f149b 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "scitems.hxx"
#include <svx/algitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <unotools/textsearch.hxx>
#include <sfx2/objsh.hxx>
@@ -54,18 +56,189 @@
#include "sheetevents.hxx"
#include "segmenttree.hxx"
+#include <vector>
+
+using ::std::vector;
+
+namespace {
+
+ScProgress* GetProgressBar(
+ SCSIZE nCount, SCSIZE nTotalCount, ScProgress* pOuterProgress, ScDocument* pDoc)
+{
+ if (nTotalCount < 1000)
+ {
+ // if the total number of rows is less than 1000, don't even bother
+ // with the progress bar because drawing progress bar can be very
+ // expensive especially in GTK.
+ return NULL;
+ }
+
+ if (pOuterProgress)
+ return pOuterProgress;
+
+ if (nCount > 1)
+ return new ScProgress(
+ pDoc->GetDocumentShell(), ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nTotalCount);
+
+ return NULL;
+}
+
+void GetOptimalHeightsInColumn(
+ ScColumn* pCol, SCROW nStartRow, SCROW nEndRow, vector<sal_uInt16>& aHeights,
+ OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, bool bForce,
+ ScProgress* pProgress, sal_uInt32 nProgressStart)
+{
+ SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1);
+
+ // zuerst einmal ueber den ganzen Bereich
+ // (mit der letzten Spalte in der Hoffnung, dass die am ehesten noch auf
+ // Standard formatiert ist)
+
+ pCol[MAXCOL].GetOptimalHeight(
+ nStartRow, nEndRow, &aHeights[0], pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce, 0, 0 );
+
+ // daraus Standardhoehe suchen, die im unteren Bereich gilt
+
+ sal_uInt16 nMinHeight = aHeights[nCount-1];
+ SCSIZE nPos = nCount-1;
+ while ( nPos && aHeights[nPos-1] >= nMinHeight )
+ --nPos;
+ SCROW nMinStart = nStartRow + nPos;
+
+ sal_uLong nWeightedCount = 0;
+ for (SCCOL nCol=0; nCol<MAXCOL; nCol++) // MAXCOL schon oben
+ {
+ pCol[nCol].GetOptimalHeight(
+ nStartRow, nEndRow, &aHeights[0], pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce,
+ nMinHeight, nMinStart );
+
+ if (pProgress)
+ {
+ sal_uLong nWeight = pCol[nCol].GetWeightedCount();
+ if (nWeight) // nochmal denselben Status muss auch nicht sein
+ {
+ nWeightedCount += nWeight;
+ pProgress->SetState( nWeightedCount + nProgressStart );
+ }
+ }
+ }
+}
+
+struct OptimalHeightsFuncObjBase
+{
+ virtual ~OptimalHeightsFuncObjBase() {}
+ virtual bool operator() (SCROW nStartRow, SCROW nEndRow, sal_uInt16 nHeight) = 0;
+};
+
+struct SetRowHeightOnlyFunc : public OptimalHeightsFuncObjBase
+{
+ ScTable* mpTab;
+ SetRowHeightOnlyFunc(ScTable* pTab) :
+ mpTab(pTab)
+ {}
+
+ virtual bool operator() (SCROW nStartRow, SCROW nEndRow, sal_uInt16 nHeight)
+ {
+ mpTab->SetRowHeightOnly(nStartRow, nEndRow, nHeight);
+ return false;
+ }
+};
+
+struct SetRowHeightRangeFunc : public OptimalHeightsFuncObjBase
+{
+ ScTable* mpTab;
+ double mnPPTX;
+ double mnPPTY;
+
+ SetRowHeightRangeFunc(ScTable* pTab, double nPPTX, double nPPTY) :
+ mpTab(pTab),
+ mnPPTX(nPPTX),
+ mnPPTY(nPPTY)
+ {}
+
+ virtual bool operator() (SCROW nStartRow, SCROW nEndRow, sal_uInt16 nHeight)
+ {
+ return mpTab->SetRowHeightRange(nStartRow, nEndRow, nHeight, mnPPTX, mnPPTY);
+ }
+};
+
+bool SetOptimalHeightsToRows(OptimalHeightsFuncObjBase& rFuncObj,
+ ScBitMaskCompressedArray<SCROW, sal_uInt8>* pRowFlags, SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra,
+ const vector<sal_uInt16>& aHeights, bool bForce)
+{
+ SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1);
+ bool bChanged = false;
+ SCROW nRngStart = 0;
+ SCROW nRngEnd = 0;
+ sal_uInt16 nLast = 0;
+ for (SCSIZE i=0; i<nCount; i++)
+ {
+ size_t nIndex;
+ SCROW nRegionEndRow;
+ sal_uInt8 nRowFlag = pRowFlags->GetValue( nStartRow+i, nIndex, nRegionEndRow );
+ if ( nRegionEndRow > nEndRow )
+ nRegionEndRow = nEndRow;
+ SCSIZE nMoreRows = nRegionEndRow - ( nStartRow+i ); // additional equal rows after first
+
+ bool bAutoSize = ((nRowFlag & CR_MANUALSIZE) == 0);
+ if ( bAutoSize || bForce )
+ {
+ if (nExtra)
+ {
+ if (bAutoSize)
+ pRowFlags->SetValue( nStartRow+i, nRegionEndRow, nRowFlag | CR_MANUALSIZE);
+ }
+ else if (!bAutoSize)
+ pRowFlags->SetValue( nStartRow+i, nRegionEndRow, nRowFlag & ~CR_MANUALSIZE);
+
+ for (SCSIZE nInner = i; nInner <= i + nMoreRows; ++nInner)
+ {
+ if (nLast)
+ {
+ if (aHeights[nInner]+nExtra == nLast)
+ nRngEnd = nStartRow+nInner;
+ else
+ {
+ bChanged |= rFuncObj(nRngStart, nRngEnd, nLast);
+ nLast = 0;
+ }
+ }
+ if (!nLast)
+ {
+ nLast = aHeights[nInner]+nExtra;
+ nRngStart = nStartRow+nInner;
+ nRngEnd = nStartRow+nInner;
+ }
+ }
+ }
+ else
+ {
+ if (nLast)
+ bChanged |= rFuncObj(nRngStart, nRngEnd, nLast);
+ nLast = 0;
+ }
+ i += nMoreRows; // already handled - skip
+ }
+ if (nLast)
+ bChanged |= rFuncObj(nRngStart, nRngEnd, nLast);
+
+ return bChanged;
+}
+
+}
+
// -----------------------------------------------------------------------
ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName,
sal_Bool bColInfo, sal_Bool bRowInfo ) :
aName( rNewName ),
aCodeName( rNewName ),
- bScenario( sal_False ),
- bLayoutRTL( sal_False ),
- bLoadingRTL( sal_False ),
+ bScenario( false ),
+ bLayoutRTL( false ),
+ bLoadingRTL( false ),
nLinkMode( 0 ),
aPageStyle( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ),
- bPageSizeValid( sal_False ),
+ bPageSizeValid( false ),
nRepeatStartX( SCCOL_REPEAT_NONE ),
nRepeatStartY( SCROW_REPEAT_NONE ),
pTabProtection( NULL ),
@@ -79,18 +252,18 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName,
mpFilteredRows(new ScFlatBoolRowSegments),
pOutlineTable( NULL ),
pSheetEvents( NULL ),
- bTableAreaValid( sal_False ),
+ bTableAreaValid( false ),
bVisible( sal_True ),
- bStreamValid( sal_False ),
- bPendingRowHeights( sal_False ),
- bCalcNotification( sal_False ),
+ bStreamValid( false ),
+ bPendingRowHeights( false ),
+ bCalcNotification( false ),
nTab( nNewTab ),
nRecalcLvl( 0 ),
pDocument( pDoc ),
pSearchParam( NULL ),
pSearchText ( NULL ),
pSortCollator( NULL ),
- bPrintEntireSheet( sal_False ),
+ bPrintEntireSheet(true),
pRepeatColRange( NULL ),
pRepeatRowRange( NULL ),
nLockCount( 0 ),
@@ -98,7 +271,7 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName,
aScenarioColor( COL_LIGHTGRAY ),
aTabBgColor( COL_AUTO ),
nScenarioFlags( 0 ),
- bActiveScenario( sal_False ),
+ bActiveScenario( false ),
mbPageBreaksValid(false)
{
@@ -192,7 +365,7 @@ const String& ScTable::GetUpperName() const
void ScTable::SetVisible( sal_Bool bVis )
{
if (bVisible != bVis && IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
bVisible = bVis;
}
@@ -251,17 +424,17 @@ void ScTable::SetLink( sal_uInt8 nMode,
nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
sal_uInt16 ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev,
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
sal_Bool bFormula, const ScMarkData* pMarkData,
- sal_Bool bSimpleTextImport )
+ const ScColWidthParam* pParam )
{
return aCol[nCol].GetOptimalColWidth( pDev, nPPTX, nPPTY, rZoomX, rZoomY,
- bFormula, STD_COL_WIDTH - STD_EXTRA_WIDTH, pMarkData, bSimpleTextImport );
+ bFormula, STD_COL_WIDTH - STD_EXTRA_WIDTH, pMarkData, pParam );
}
long ScTable::GetNeededSize( SCCOL nCol, SCROW nRow,
@@ -271,7 +444,7 @@ long ScTable::GetNeededSize( SCCOL nCol, SCROW nRow,
sal_Bool bWidth, sal_Bool bTotalSize )
{
ScNeededSizeOptions aOptions;
- aOptions.bSkipMerged = sal_False; // zusammengefasste mitzaehlen
+ aOptions.bSkipMerged = false; // zusammengefasste mitzaehlen
aOptions.bTotalSize = bTotalSize;
return aCol[nCol].GetNeededSize
@@ -288,119 +461,61 @@ sal_Bool ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 n
if ( !pDocument->IsAdjustHeightEnabled() )
{
- return sal_False;
+ return false;
}
- sal_Bool bChanged = sal_False;
SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1);
- ScProgress* pProgress = NULL;
- if ( pOuterProgress )
- pProgress = pOuterProgress;
- else if ( nCount > 1 )
- pProgress = new ScProgress( pDocument->GetDocumentShell(),
- ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), GetWeightedCount() );
+ ScProgress* pProgress = GetProgressBar(nCount, GetWeightedCount(), pOuterProgress, pDocument);
- sal_uInt16* pHeight = new sal_uInt16[nCount]; // Twips !
- memset( pHeight, 0, sizeof(sal_uInt16) * nCount );
+ vector<sal_uInt16> aHeights(nCount, 0);
- // zuerst einmal ueber den ganzen Bereich
- // (mit der letzten Spalte in der Hoffnung, dass die am ehesten noch auf
- // Standard formatiert ist)
+ GetOptimalHeightsInColumn(
+ aCol, nStartRow, nEndRow, aHeights, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce,
+ pProgress, nProgressStart);
- aCol[MAXCOL].GetOptimalHeight(
- nStartRow, nEndRow, pHeight, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce, 0, 0 );
+ SetRowHeightRangeFunc aFunc(this, nPPTX, nPPTY);
+ bool bChanged = SetOptimalHeightsToRows(
+ aFunc, pRowFlags, nStartRow, nEndRow, nExtra, aHeights, bForce);
- // daraus Standardhoehe suchen, die im unteren Bereich gilt
+ if ( pProgress != pOuterProgress )
+ delete pProgress;
- sal_uInt16 nMinHeight = pHeight[nCount-1];
- SCSIZE nPos = nCount-1;
- while ( nPos && pHeight[nPos-1] >= nMinHeight )
- --nPos;
- SCROW nMinStart = nStartRow + nPos;
+ return bChanged;
+}
- sal_uLong nWeightedCount = 0;
- for (SCCOL nCol=0; nCol<MAXCOL; nCol++) // MAXCOL schon oben
- {
- aCol[nCol].GetOptimalHeight(
- nStartRow, nEndRow, pHeight, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce,
- nMinHeight, nMinStart );
+void ScTable::SetOptimalHeightOnly( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra,
+ OutputDevice* pDev,
+ double nPPTX, double nPPTY,
+ const Fraction& rZoomX, const Fraction& rZoomY,
+ sal_Bool bForce, ScProgress* pOuterProgress, sal_uLong nProgressStart )
+{
+ DBG_ASSERT( nExtra==0 || bForce, "autom. OptimalHeight mit Extra" );
- if (pProgress)
- {
- sal_uLong nWeight = aCol[nCol].GetWeightedCount();
- if (nWeight) // nochmal denselben Status muss auch nicht sein
- {
- nWeightedCount += nWeight;
- pProgress->SetState( nWeightedCount + nProgressStart );
- }
- }
- }
+ if ( !pDocument->IsAdjustHeightEnabled() )
+ return;
- SCROW nRngStart = 0;
- SCROW nRngEnd = 0;
- sal_uInt16 nLast = 0;
- for (SCSIZE i=0; i<nCount; i++)
- {
- size_t nIndex;
- SCROW nRegionEndRow;
- sal_uInt8 nRowFlag = pRowFlags->GetValue( nStartRow+i, nIndex, nRegionEndRow );
- if ( nRegionEndRow > nEndRow )
- nRegionEndRow = nEndRow;
- SCSIZE nMoreRows = nRegionEndRow - ( nStartRow+i ); // additional equal rows after first
+ SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1);
- bool bAutoSize = ((nRowFlag & CR_MANUALSIZE) == 0);
- if ( bAutoSize || bForce )
- {
- if (nExtra)
- {
- if (bAutoSize)
- pRowFlags->SetValue( nStartRow+i, nRegionEndRow, nRowFlag | CR_MANUALSIZE);
- }
- else if (!bAutoSize)
- pRowFlags->SetValue( nStartRow+i, nRegionEndRow, nRowFlag & ~CR_MANUALSIZE);
+ ScProgress* pProgress = GetProgressBar(nCount, GetWeightedCount(), pOuterProgress, pDocument);
- for (SCSIZE nInner = i; nInner <= i + nMoreRows; ++nInner)
- {
- if (nLast)
- {
- if (pHeight[nInner]+nExtra == nLast)
- nRngEnd = nStartRow+nInner;
- else
- {
- bChanged |= SetRowHeightRange( nRngStart, nRngEnd, nLast, nPPTX, nPPTY );
- nLast = 0;
- }
- }
- if (!nLast)
- {
- nLast = pHeight[nInner]+nExtra;
- nRngStart = nStartRow+nInner;
- nRngEnd = nStartRow+nInner;
- }
- }
- }
- else
- {
- if (nLast)
- bChanged |= SetRowHeightRange( nRngStart, nRngEnd, nLast, nPPTX, nPPTY );
- nLast = 0;
- }
- i += nMoreRows; // already handled - skip
- }
- if (nLast)
- bChanged |= SetRowHeightRange( nRngStart, nRngEnd, nLast, nPPTX, nPPTY );
+ vector<sal_uInt16> aHeights(nCount, 0);
+
+ GetOptimalHeightsInColumn(
+ aCol, nStartRow, nEndRow, aHeights, pDev, nPPTX, nPPTY, rZoomX, rZoomY, bForce,
+ pProgress, nProgressStart);
+
+ SetRowHeightOnlyFunc aFunc(this);
+ SetOptimalHeightsToRows(
+ aFunc, pRowFlags, nStartRow, nEndRow, nExtra, aHeights, bForce);
- delete[] pHeight;
if ( pProgress != pOuterProgress )
delete pProgress;
-
- return bChanged;
}
sal_Bool ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nMaxX = 0;
SCROW nMaxY = 0;
for (SCCOL i=0; i<=MAXCOL; i++)
@@ -432,31 +547,11 @@ sal_Bool ScTable::GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const
return bRet;
}
-/* vorher:
-
- sal_Bool bFound = sal_False;
- SCCOL nMaxX = 0;
- SCROW nMaxY = 0;
- for (SCCOL i=0; i<=MAXCOL; i++)
- if (!aCol[i].IsEmpty())
- {
- bFound = sal_True;
- nMaxX = i;
- SCCOL nColY = aCol[i].GetLastEntryPos();
- if (nColY > nMaxY)
- nMaxY = nColY;
- }
-
- rEndCol = nMaxX;
- rEndRow = nMaxY;
- return bFound;
-*/
-
const SCCOL SC_COLUMNS_STOP = 30;
sal_Bool ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, sal_Bool bNotes ) const
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nMaxX = 0;
SCROW nMaxY = 0;
SCCOL i;
@@ -528,7 +623,7 @@ sal_Bool ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, sal_Bool bNotes
sal_Bool ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,
SCCOL& rEndCol, sal_Bool /* bNotes */ ) const
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nMaxX = 0;
SCCOL i;
@@ -565,7 +660,7 @@ sal_Bool ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,
sal_Bool ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol,
SCROW& rEndRow, sal_Bool bNotes ) const
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCROW nMaxY = 0;
SCCOL i;
@@ -595,7 +690,7 @@ sal_Bool ScTable::GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol,
sal_Bool ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nMinX = MAXCOL;
SCROW nMinY = MAXROW;
SCCOL i;
@@ -623,7 +718,7 @@ sal_Bool ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const
}
}
- sal_Bool bDatFound = sal_False;
+ sal_Bool bDatFound = false;
for (i=0; i<=MAXCOL; i++) // Daten testen
if (!aCol[i].IsEmptyVisData(sal_True))
{
@@ -643,10 +738,10 @@ sal_Bool ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const
void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow,
sal_Bool bIncludeOld, bool bOnlyDown ) const
{
- sal_Bool bLeft = sal_False;
- sal_Bool bRight = sal_False;
- sal_Bool bTop = sal_False;
- sal_Bool bBottom = sal_False;
+ sal_Bool bLeft = false;
+ sal_Bool bRight = false;
+ sal_Bool bTop = false;
+ sal_Bool bBottom = false;
sal_Bool bChanged;
sal_Bool bFound;
SCCOL i;
@@ -654,7 +749,7 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S
do
{
- bChanged = sal_False;
+ bChanged = false;
if (!bOnlyDown)
{
@@ -682,7 +777,7 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S
if (rStartRow > 0)
{
nTest = rStartRow-1;
- bFound = sal_False;
+ bFound = false;
for (i=rStartCol; i<=rEndCol && !bFound; i++)
if (aCol[i].HasDataAt(nTest))
bFound = sal_True;
@@ -698,7 +793,7 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S
if (rEndRow < MAXROW)
{
nTest = rEndRow+1;
- bFound = sal_False;
+ bFound = false;
for (i=rStartCol; i<=rEndCol && !bFound; i++)
if (aCol[i].HasDataAt(nTest))
bFound = sal_True;
@@ -722,7 +817,7 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S
--rEndCol;
if ( !bTop && rStartRow < MAXROW && rStartRow < rEndRow )
{
- bFound = sal_False;
+ bFound = false;
for (i=rStartCol; i<=rEndCol && !bFound; i++)
if (aCol[i].HasDataAt(rStartRow))
bFound = sal_True;
@@ -731,7 +826,7 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S
}
if ( !bBottom && rEndRow > 0 && rStartRow < rEndRow )
{
- bFound = sal_False;
+ bFound = false;
for (i=rStartCol; i<=rEndCol && !bFound; i++)
if (aCol[i].HasDataAt(rEndRow))
bFound = sal_True;
@@ -859,7 +954,7 @@ SCSIZE ScTable::GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
sal_Bool ScTable::IsEmptyLine( SCROW nRow, SCCOL nStartCol, SCCOL nEndCol )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (SCCOL i=nStartCol; i<=nEndCol && !bFound; i++)
if (aCol[i].HasDataAt(nRow))
bFound = sal_True;
@@ -893,13 +988,13 @@ void ScTable::FindAreaPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY
do
{
nNewCol = sal::static_int_cast<SCsCOL>( nNewCol + nMovX );
- bFnd = (nNewCol>=0 && nNewCol<=MAXCOL) ? aCol[nNewCol].HasVisibleDataAt(rRow) : sal_False;
+ bFnd = (nNewCol>=0 && nNewCol<=MAXCOL) ? aCol[nNewCol].HasVisibleDataAt(rRow) : false;
}
while (bFnd);
nNewCol = sal::static_int_cast<SCsCOL>( nNewCol - nMovX );
if (nNewCol == (SCsCOL)rCol)
- bThere = sal_False;
+ bThere = false;
}
if (!bThere)
@@ -925,30 +1020,30 @@ sal_Bool ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark,
sal_Bool bMarked, sal_Bool bUnprotected )
{
if (!ValidCol(nCol) || !ValidRow(nRow))
- return sal_False;
+ return false;
if (pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED))
// Skip an overlapped cell.
return false;
if (bMarked && !rMark.IsCellMarked(nCol,nRow))
- return sal_False;
+ return false;
if (bUnprotected && ((const ScProtectionAttr*)
GetAttr(nCol,nRow,ATTR_PROTECTION))->GetProtection())
- return sal_False;
+ return false;
if (bMarked || bUnprotected) //! auch sonst ???
{
- // #53697# ausgeblendete muessen uebersprungen werden, weil der Cursor sonst
+ // ausgeblendete muessen uebersprungen werden, weil der Cursor sonst
// auf der naechsten Zelle landet, auch wenn die geschuetzt/nicht markiert ist.
//! per Extra-Parameter steuern, nur fuer Cursor-Bewegung ???
if (RowHidden(nRow))
- return sal_False;
+ return false;
if (ColHidden(nCol))
- return sal_False;
+ return false;
}
return sal_True;
@@ -958,7 +1053,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
sal_Bool bMarked, sal_Bool bUnprotected, const ScMarkData& rMark )
{
if (bUnprotected && !IsProtected()) // Tabelle ueberhaupt geschuetzt?
- bUnprotected = sal_False;
+ bUnprotected = false;
sal_uInt16 nWrap = 0;
SCsCOL nCol = rCol;
@@ -977,7 +1072,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
while ( VALIDROW(nRow) &&
(RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) )
{
- // #53697# ausgeblendete ueberspringen (s.o.)
+ // ausgeblendete ueberspringen (s.o.)
nRow += nMovY;
nRow = rMark.GetNextMarked( nCol, nRow, bUp );
}
@@ -986,7 +1081,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
{
nCol = sal::static_int_cast<SCsCOL>( nCol + static_cast<SCsCOL>(nMovY) );
while ( VALIDCOL(nCol) && ColHidden(nCol) )
- nCol = sal::static_int_cast<SCsCOL>( nCol + static_cast<SCsCOL>(nMovY) ); // #53697# skip hidden rows (see above)
+ nCol = sal::static_int_cast<SCsCOL>( nCol + static_cast<SCsCOL>(nMovY) ); // skip hidden rows (see above)
if (nCol < 0)
{
nCol = MAXCOL;
@@ -1007,7 +1102,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
while ( VALIDROW(nRow) &&
(RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) )
{
- // #53697# ausgeblendete ueberspringen (s.o.)
+ // ausgeblendete ueberspringen (s.o.)
nRow += nMovY;
nRow = rMark.GetNextMarked( nCol, nRow, bUp );
}
@@ -1045,9 +1140,9 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
{
SCsROW nNextRow = pNextRows[nCol] + 1;
if ( bMarked )
- nNextRow = rMark.GetNextMarked( nCol, nNextRow, sal_False );
+ nNextRow = rMark.GetNextMarked( nCol, nNextRow, false );
if ( bUnprotected )
- nNextRow = aCol[nCol].GetNextUnprotected( nNextRow, sal_False );
+ nNextRow = aCol[nCol].GetNextUnprotected( nNextRow, false );
pNextRows[nCol] = nNextRow;
SCsROW nMinRow = MAXROW+1;
@@ -1124,7 +1219,7 @@ sal_Bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData&
const ScMarkArray* pMarkArray = rMark.GetArray();
DBG_ASSERT(pMarkArray,"GetNextMarkedCell ohne MarkArray");
if ( !pMarkArray )
- return sal_False;
+ return false;
++rRow; // naechste Zelle ist gesucht
@@ -1133,10 +1228,10 @@ sal_Bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData&
const ScMarkArray& rArray = pMarkArray[rCol];
while ( rRow <= MAXROW )
{
- SCROW nStart = (SCROW) rArray.GetNextMarked( (SCsROW) rRow, sal_False );
+ SCROW nStart = (SCROW) rArray.GetNextMarked( (SCsROW) rRow, false );
if ( nStart <= MAXROW )
{
- SCROW nEnd = rArray.GetMarkEnd( nStart, sal_False );
+ SCROW nEnd = rArray.GetMarkEnd( nStart, false );
ScColumnIterator aColIter( &aCol[rCol], nStart, nEnd );
SCROW nCellRow;
ScBaseCell* pCell = NULL;
@@ -1157,7 +1252,7 @@ sal_Bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData&
++rCol; // naechste Spalte testen
}
- return sal_False; // alle Spalten durch
+ return false; // alle Spalten durch
}
void ScTable::UpdateDrawRef( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
@@ -1187,6 +1282,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
ScDocument* pUndoDoc, sal_Bool bIncludeDraw, bool bUpdateNoteCaptionPos )
{
+ bool bUpdated = false;
SCCOL i;
SCCOL iMax;
if ( eUpdateRefMode == URM_COPY )
@@ -1200,8 +1296,8 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
iMax = MAXCOL;
}
for ( ; i<=iMax; i++)
- aCol[i].UpdateReference( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2,
- nDx, nDy, nDz, pUndoDoc );
+ bUpdated |= aCol[i].UpdateReference(
+ eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, pUndoDoc );
if ( bIncludeDraw )
UpdateDrawRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, bUpdateNoteCaptionPos );
@@ -1214,7 +1310,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
SCROW nSRow = 0;
SCCOL nECol = 0;
SCROW nERow = 0;
- sal_Bool bRecalcPages = sal_False;
+ sal_Bool bRecalcPages = false;
for ( ScRangeVec::iterator aIt = aPrintRanges.begin(), aEnd = aPrintRanges.end(); aIt != aEnd; ++aIt )
{
@@ -1282,6 +1378,9 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
pDocument->RepaintRange( ScRange(0,0,nTab,MAXCOL,MAXROW,nTab) );
}
}
+
+ if (bUpdated && IsStreamValid())
+ SetStreamValid(false);
}
void ScTable::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
@@ -1303,14 +1402,9 @@ void ScTable::UpdateInsertTab(SCTAB nTable)
for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable);
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
-//UNUSED2008-05 void ScTable::UpdateInsertTabOnlyCells(SCTAB nTable)
-//UNUSED2008-05 {
-//UNUSED2008-05 for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTabOnlyCells(nTable);
-//UNUSED2008-05 }
-
void ScTable::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo )
{
if (nTab > nTable) nTab--;
@@ -1322,7 +1416,7 @@ void ScTable::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo
for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, NULL);
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
void ScTable::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo,
@@ -1336,7 +1430,7 @@ void ScTable::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo,
}
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
void ScTable::UpdateCompile( sal_Bool bForceIfNameInUse )
@@ -1356,7 +1450,7 @@ void ScTable::SetTabNo(SCTAB nNewTab)
sal_Bool ScTable::IsRangeNameInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
sal_uInt16 nIndex) const
{
- sal_Bool bInUse = sal_False;
+ sal_Bool bInUse = false;
for (SCCOL i = nCol1; !bInUse && (i <= nCol2) && (ValidCol(i)); i++)
bInUse = aCol[i].IsRangeNameInUse(nRow1, nRow2, nIndex);
return bInUse;
@@ -1384,7 +1478,7 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
{
if ( !pColFlags || !pRowFlags )
{
- DBG_ERROR("keine ColInfo oder RowInfo in ExtendPrintArea");
+ OSL_FAIL("keine ColInfo oder RowInfo in ExtendPrintArea");
return;
}
@@ -1395,7 +1489,6 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
// First, mark those columns that we need to skip i.e. hidden and empty columns.
ScFlatBoolColSegments aSkipCols;
- aSkipCols.setInsertFromBack(true); // speed optimazation.
aSkipCols.setFalse(0, MAXCOL);
for (SCCOL i = 0; i <= MAXCOL; ++i)
{
@@ -1479,7 +1572,7 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, d
ScNeededSizeOptions aOptions;
aOptions.bTotalSize = sal_True;
aOptions.bFormula = bFormula;
- aOptions.bSkipMerged = sal_False;
+ aOptions.bSkipMerged = false;
Fraction aZoom(1,1);
nPixel = aCol[rCol].GetNeededSize(
@@ -1550,7 +1643,7 @@ void ScTable::SetRepeatColRange( const ScRange* pNew )
SET_PRINTRANGE( pRepeatColRange, pNew );
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
void ScTable::SetRepeatRowRange( const ScRange* pNew )
@@ -1558,33 +1651,28 @@ void ScTable::SetRepeatRowRange( const ScRange* pNew )
SET_PRINTRANGE( pRepeatRowRange, pNew );
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
void ScTable::ClearPrintRanges()
{
aPrintRanges.clear();
- bPrintEntireSheet = sal_False;
+ bPrintEntireSheet = false;
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
void ScTable::AddPrintRange( const ScRange& rNew )
{
- bPrintEntireSheet = sal_False;
+ bPrintEntireSheet = false;
if( aPrintRanges.size() < 0xFFFF )
aPrintRanges.push_back( rNew );
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
-//UNUSED2009-05 void ScTable::SetPrintRange( const ScRange& rNew )
-//UNUSED2009-05 {
-//UNUSED2009-05 ClearPrintRanges();
-//UNUSED2009-05 AddPrintRange( rNew );
-//UNUSED2009-05 }
void ScTable::SetPrintEntireSheet()
{
@@ -1717,3 +1805,4 @@ SCROW ScTable::VisibleDataCellIterator::getRow() const
return mnCurRow;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 3b10e51355e8..31a5bca64866 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,8 +61,6 @@
#include "globstr.hrc"
#include "segmenttree.hxx"
-#include <math.h>
-
// STATIC DATA -----------------------------------------------------------
@@ -107,10 +106,10 @@ void ScTable::SetSheetEvents( const ScSheetEvents* pNew )
else
pSheetEvents = NULL;
- SetCalcNotification( sal_False ); // discard notifications before the events were set
+ SetCalcNotification( false ); // discard notifications before the events were set
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
@@ -178,6 +177,11 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE
DecRecalcLevel( false );
InvalidatePageBreaks();
+
+ if (IsStreamValid())
+ // TODO: In the future we may want to check if the table has been
+ // really modified before setting the stream invalid.
+ SetStreamValid(false);
}
@@ -223,6 +227,11 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE
DecRecalcLevel();
InvalidatePageBreaks();
+
+ if (IsStreamValid())
+ // TODO: In the future we may want to check if the table has been
+ // really modified before setting the stream invalid.
+ SetStreamValid(false);
}
@@ -234,7 +243,7 @@ sal_Bool ScTable::TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize )
bTest = pOutlineTable->TestInsertCol(nSize);
if ( nSize > static_cast<SCSIZE>(MAXCOL) )
- bTest = sal_False;
+ bTest = false;
for (SCCOL i=MAXCOL; (i+static_cast<SCCOL>(nSize)>MAXCOL) && bTest; i--)
bTest = aCol[i].TestInsertCol(nStartRow, nEndRow);
@@ -301,7 +310,7 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE
for (SCSIZE i=0; i<nSize; i++)
{
aCol[nStartCol-1].CopyToColumn( nStartRow, nEndRow, IDF_ATTRIB,
- sal_False, aCol[nStartCol+i] );
+ false, aCol[nStartCol+i] );
aCol[nStartCol+i].RemoveFlags( nStartRow, nEndRow,
SC_MF_HOR | SC_MF_VER | SC_MF_AUTO );
aCol[nStartCol+i].ClearItems( nStartRow, nEndRow, nWhichArray );
@@ -310,6 +319,11 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE
DecRecalcLevel();
InvalidatePageBreaks();
+
+ if (IsStreamValid())
+ // TODO: In the future we may want to check if the table has been
+ // really modified before setting the stream invalid.
+ SetStreamValid(false);
}
@@ -370,6 +384,11 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE
DecRecalcLevel();
InvalidatePageBreaks();
+
+ if (IsStreamValid())
+ // TODO: In the future we may want to check if the table has been
+ // really modified before setting the stream invalid.
+ SetStreamValid(false);
}
@@ -379,8 +398,6 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal
if (nRow2 > MAXROW) nRow2 = MAXROW;
if (ValidColRow(nCol1, nRow1) && ValidColRow(nCol2, nRow2))
{
-// IncRecalcLevel();
-
{ // scope for bulk broadcast
ScBulkBroadcast aBulkBroadcast( pDocument->GetBASM());
for (SCCOL i = nCol1; i <= nCol2; i++)
@@ -394,12 +411,15 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal
if ( IsProtected() && (nDelFlag & IDF_ATTRIB) )
{
ScPatternAttr aPattern(pDocument->GetPool());
- aPattern.GetItemSet().Put( ScProtectionAttr( sal_False ) );
+ aPattern.GetItemSet().Put( ScProtectionAttr( false ) );
ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern );
}
-
-// DecRecalcLevel();
}
+
+ if (IsStreamValid())
+ // TODO: In the future we may want to check if the table has been
+ // really modified before setting the stream invalid.
+ SetStreamValid(false);
}
@@ -419,10 +439,15 @@ void ScTable::DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark )
{
ScDocumentPool* pPool = pDocument->GetPool();
SfxItemSet aSet( *pPool, ATTR_PATTERN_START, ATTR_PATTERN_END );
- aSet.Put( ScProtectionAttr( sal_False ) );
+ aSet.Put( ScProtectionAttr( false ) );
SfxItemPoolCache aCache( pPool, &aSet );
ApplySelectionCache( &aCache, rMark );
}
+
+ if (IsStreamValid())
+ // TODO: In the future we may want to check if the table has been
+ // really modified before setting the stream invalid.
+ SetStreamValid(false);
}
@@ -469,8 +494,9 @@ void ScTable::CopyToClip(const ScRangeList& rRanges, ScTable* pTable,
bool bKeepScenarioFlags, bool bCloneNoteCaptions)
{
ScRangeList aRanges(rRanges);
- for (ScRangePtr p = aRanges.First(); p; p = aRanges.Next())
+ for ( size_t i = 0, nListSize = aRanges.size(); i < nListSize; ++i )
{
+ ScRange* p = aRanges[ i ];
CopyToClip(p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(),
pTable, bKeepScenarioFlags, bCloneNoteCaptions);
}
@@ -517,7 +543,7 @@ void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if ( IsProtected() && (nInsFlag & IDF_ATTRIB) )
{
ScPatternAttr aPattern(pDocument->GetPool());
- aPattern.GetItemSet().Put( ScProtectionAttr( sal_False ) );
+ aPattern.GetItemSet().Put( ScProtectionAttr( false ) );
ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern );
}
}
@@ -557,7 +583,7 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if ( bAsLink && nFlags == IDF_ALL )
{
- // #68989# with IDF_ALL, also create links (formulas) for empty cells
+ // with IDF_ALL, also create links (formulas) for empty cells
for ( nRow=nRow1; nRow<=nRow2; nRow++ )
{
@@ -622,9 +648,9 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if ( !IsDefaultItem( pPattern ) )
{
const SfxItemSet& rSet = pPattern->GetItemSet();
- if ( rSet.GetItemState( ATTR_MERGE, sal_False ) == SFX_ITEM_DEFAULT &&
- rSet.GetItemState( ATTR_MERGE_FLAG, sal_False ) == SFX_ITEM_DEFAULT &&
- rSet.GetItemState( ATTR_BORDER, sal_False ) == SFX_ITEM_DEFAULT )
+ if ( rSet.GetItemState( ATTR_MERGE, false ) == SFX_ITEM_DEFAULT &&
+ rSet.GetItemState( ATTR_MERGE_FLAG, false ) == SFX_ITEM_DEFAULT &&
+ rSet.GetItemState( ATTR_BORDER, false ) == SFX_ITEM_DEFAULT )
{
// no borders or merge items involved - use pattern as-is
for (nRow = nAttrRow1; nRow<=nAttrRow2; nRow++)
@@ -722,125 +748,100 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
const ScMarkData* pMarkData,
sal_Bool bAsLink, sal_Bool bColRowFlags)
{
- if (ValidColRow(nCol1, nRow1) && ValidColRow(nCol2, nRow2))
- {
- if (nFlags)
- for (SCCOL i = nCol1; i <= nCol2; i++)
- aCol[i].CopyToColumn(nRow1, nRow2, nFlags, bMarked,
- pDestTab->aCol[i], pMarkData, bAsLink);
-
- if (bColRowFlags) // Spaltenbreiten/Zeilenhoehen/Flags
- {
- // Charts muessen beim Ein-/Ausblenden angepasst werden
- ScChartListenerCollection* pCharts = pDestTab->pDocument->GetChartListenerCollection();
-
- bool bFlagChange = false;
-
- sal_Bool bWidth = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth);
- sal_Bool bHeight = (nCol1==0 && nCol2==MAXCOL && mpRowHeights && pDestTab->mpRowHeights);
-
- if (bWidth||bHeight)
- {
- pDestTab->IncRecalcLevel();
-
- if (bWidth)
- {
- for (SCCOL i=nCol1; i<=nCol2; i++)
- {
- bool bThisHidden = ColHidden(i);
- bool bHiddenChange = (pDestTab->ColHidden(i) != bThisHidden);
- bool bChange = bHiddenChange || (pDestTab->pColWidth[i] != pColWidth[i]);
- pDestTab->pColWidth[i] = pColWidth[i];
- pDestTab->pColFlags[i] = pColFlags[i];
- pDestTab->SetColHidden(i, i, bThisHidden);
- //! Aenderungen zusammenfassen?
- if (bHiddenChange && pCharts)
- pCharts->SetRangeDirty(ScRange( i, 0, nTab, i, MAXROW, nTab ));
-
- if (bChange)
- bFlagChange = true;
- }
- pDestTab->SetColManualBreaks( maColManualBreaks);
- }
+ if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2))
+ return;
- if (bHeight)
- {
- bool bChange = pDestTab->GetRowHeight(nRow1, nRow2) != GetRowHeight(nRow1, nRow2);
+ if (nFlags)
+ for (SCCOL i = nCol1; i <= nCol2; i++)
+ aCol[i].CopyToColumn(nRow1, nRow2, nFlags, bMarked,
+ pDestTab->aCol[i], pMarkData, bAsLink);
- if (bChange)
- bFlagChange = true;
+ if (!bColRowFlags) // Spaltenbreiten/Zeilenhoehen/Flags
+ return;
- pDestTab->CopyRowHeight(*this, nRow1, nRow2, 0);
- pDestTab->pRowFlags->CopyFrom(*pRowFlags, nRow1, nRow2);
+ // Charts muessen beim Ein-/Ausblenden angepasst werden
+ ScChartListenerCollection* pCharts = pDestTab->pDocument->GetChartListenerCollection();
- // Hidden flags.
- // #i116164# Collect information first, then apply the changes,
- // so RowHidden doesn't rebuild the tree for each row range.
- std::vector<ScShowRowsEntry> aEntries;
- for (SCROW i = nRow1; i <= nRow2; ++i)
- {
- SCROW nThisLastRow, nDestLastRow;
- bool bThisHidden = RowHidden(i, NULL, &nThisLastRow);
- bool bDestHidden = pDestTab->RowHidden(i, NULL, &nDestLastRow);
+ bool bFlagChange = false;
- // If the segment sizes differ, we take the shorter segment of the two.
- SCROW nLastRow = ::std::min(nThisLastRow, nDestLastRow);
- if (nLastRow >= nRow2)
- // the last row shouldn't exceed the upper bound the caller specified.
- nLastRow = nRow2;
+ sal_Bool bWidth = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth);
+ sal_Bool bHeight = (nCol1==0 && nCol2==MAXCOL && mpRowHeights && pDestTab->mpRowHeights);
- //pDestTab->SetRowHidden(i, nLastRow, bThisHidden);
- aEntries.push_back(ScShowRowsEntry(i, nLastRow, !bThisHidden));
+ if (bWidth || bHeight)
+ {
+ pDestTab->IncRecalcLevel();
- bool bThisHiddenChange = (bThisHidden != bDestHidden);
- if (bThisHiddenChange && pCharts)
- {
- // Hidden flags differ.
- pCharts->SetRangeDirty(ScRange(0, i, nTab, MAXCOL, nLastRow, nTab));
- }
+ if (bWidth)
+ {
+ for (SCCOL i = nCol1; i <= nCol2; ++i)
+ {
+ bool bThisHidden = ColHidden(i);
+ bool bHiddenChange = (pDestTab->ColHidden(i) != bThisHidden);
+ bool bChange = bHiddenChange || (pDestTab->pColWidth[i] != pColWidth[i]);
+ pDestTab->pColWidth[i] = pColWidth[i];
+ pDestTab->pColFlags[i] = pColFlags[i];
+ pDestTab->SetColHidden(i, i, bThisHidden);
+ //! Aenderungen zusammenfassen?
+ if (bHiddenChange && pCharts)
+ pCharts->SetRangeDirty(ScRange( i, 0, nTab, i, MAXROW, nTab ));
+
+ if (bChange)
+ bFlagChange = true;
+ }
+ pDestTab->SetColManualBreaks( maColManualBreaks);
+ }
- if (bThisHiddenChange)
- bFlagChange = true;
+ if (bHeight)
+ {
+ bool bChange = pDestTab->GetRowHeight(nRow1, nRow2) != GetRowHeight(nRow1, nRow2);
- // Jump to the last row of the identical flag segment.
- i = nLastRow;
- }
+ if (bChange)
+ bFlagChange = true;
- std::vector<ScShowRowsEntry>::const_iterator aEnd = aEntries.end();
- std::vector<ScShowRowsEntry>::const_iterator aIter = aEntries.begin();
- if ( aIter != aEnd )
- {
- pDestTab->mpHiddenRows->setInsertFromBack(true); // important for undo document
- while (aIter != aEnd)
- {
- pDestTab->SetRowHidden(aIter->mnRow1, aIter->mnRow2, !aIter->mbShow);
- ++aIter;
- }
- pDestTab->mpHiddenRows->setInsertFromBack(false);
- }
+ pDestTab->CopyRowHeight(*this, nRow1, nRow2, 0);
+ pDestTab->pRowFlags->CopyFrom(*pRowFlags, nRow1, nRow2);
- // Filtered flags.
- for (SCROW i = nRow1; i <= nRow2; ++i)
- {
- SCROW nLastRow;
- bool bFiltered = RowFiltered(i, NULL, &nLastRow);
- if (nLastRow >= nRow2)
- // the last row shouldn't exceed the upper bound the caller specified.
- nLastRow = nRow2;
- pDestTab->SetRowFiltered(i, nLastRow, bFiltered);
- i = nLastRow;
- }
- pDestTab->SetRowManualBreaks( maRowManualBreaks);
- }
- pDestTab->DecRecalcLevel();
+ // Hidden flags.
+ for (SCROW i = nRow1; i <= nRow2; ++i)
+ {
+ SCROW nLastRow;
+ bool bHidden = RowHidden(i, NULL, &nLastRow);
+ if (nLastRow >= nRow2)
+ // the last row shouldn't exceed the upper bound the caller specified.
+ nLastRow = nRow2;
+
+ bool bHiddenChanged = pDestTab->SetRowHidden(i, nLastRow, bHidden);
+ if (bHiddenChanged && pCharts)
+ // Hidden flags differ.
+ pCharts->SetRangeDirty(ScRange(0, i, nTab, MAXCOL, nLastRow, nTab));
+
+ if (bHiddenChanged)
+ bFlagChange = true;
+
+ // Jump to the last row of the identical flag segment.
+ i = nLastRow;
}
- if (bFlagChange)
- pDestTab->InvalidatePageBreaks();
-
- pDestTab->SetOutlineTable( pOutlineTable ); // auch nur wenn bColRowFlags
+ // Filtered flags.
+ for (SCROW i = nRow1; i <= nRow2; ++i)
+ {
+ SCROW nLastRow;
+ bool bFiltered = RowFiltered(i, NULL, &nLastRow);
+ if (nLastRow >= nRow2)
+ // the last row shouldn't exceed the upper bound the caller specified.
+ nLastRow = nRow2;
+ pDestTab->SetRowFiltered(i, nLastRow, bFiltered);
+ i = nLastRow;
+ }
+ pDestTab->SetRowManualBreaks( maRowManualBreaks);
}
+ pDestTab->DecRecalcLevel();
}
+
+ if (bFlagChange)
+ pDestTab->InvalidatePageBreaks();
+
+ pDestTab->SetOutlineTable( pOutlineTable ); // auch nur wenn bColRowFlags
}
@@ -862,7 +863,7 @@ void ScTable::UndoToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
aCol[i].UndoToColumn(nRow1, nRow2, nFlags, bMarked, pDestTab->aCol[i],
pMarkData);
else
- aCol[i].CopyToColumn(0, MAXROW, IDF_FORMULA, sal_False, pDestTab->aCol[i]);
+ aCol[i].CopyToColumn(0, MAXROW, IDF_FORMULA, false, pDestTab->aCol[i]);
}
if (bWidth||bHeight)
@@ -892,7 +893,7 @@ void ScTable::CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const
void ScTable::InvalidateTableArea()
{
- bTableAreaValid = sal_False;
+ bTableAreaValid = false;
}
void ScTable::InvalidatePageBreaks()
@@ -931,29 +932,23 @@ sal_Bool ScTable::HasScenarioRange( const ScRange& rRange ) const
{
DBG_ASSERT( bScenario, "bScenario == FALSE" );
-// ScMarkData aMark;
-// MarkScenarioIn( aMark, 0 ); //! Bits als Parameter von HasScenarioRange?
-// return aMark.IsAllMarked( rRange );
-
ScRange aTabRange = rRange;
aTabRange.aStart.SetTab( nTab );
aTabRange.aEnd.SetTab( nTab );
const ScRangeList* pList = GetScenarioRanges();
-// return ( pList && pList->Find( aTabRange ) );
if (pList)
{
- sal_uLong nCount = pList->Count();
- for ( sal_uLong j = 0; j < nCount; j++ )
+ for ( size_t j = 0, n = pList->size(); j < n; j++ )
{
- ScRange* pR = pList->GetObject( j );
+ const ScRange* pR = (*pList)[j];
if ( pR->Intersects( aTabRange ) )
return sal_True;
}
}
- return sal_False;
+ return false;
}
void ScTable::InvalidateScenarioRanges()
@@ -971,7 +966,7 @@ const ScRangeList* ScTable::GetScenarioRanges() const
((ScTable*)this)->pScenarioRanges = new ScRangeList;
ScMarkData aMark;
MarkScenarioIn( aMark, 0 ); // immer
- aMark.FillRangeListWithMarks( pScenarioRanges, sal_False );
+ aMark.FillRangeListWithMarks( pScenarioRanges, false );
}
return pScenarioRanges;
}
@@ -1022,23 +1017,14 @@ void ScTable::PutCell( const ScAddress& rPos, ScBaseCell* pCell )
}
-//UNUSED2009-05 void ScTable::PutCell( const ScAddress& rPos, sal_uLong nFormatIndex, ScBaseCell* pCell )
-//UNUSED2009-05 {
-//UNUSED2009-05 if (pCell)
-//UNUSED2009-05 aCol[rPos.Col()].Insert( rPos.Row(), nFormatIndex, pCell );
-//UNUSED2009-05 else
-//UNUSED2009-05 aCol[rPos.Col()].Delete( rPos.Row() );
-//UNUSED2009-05 }
-
-
sal_Bool ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString,
- SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
+ ScSetStringParam* pParam )
{
if (ValidColRow(nCol,nRow))
return aCol[nCol].SetString(
- nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat );
+ nRow, nTabP, rString, pDocument->GetAddressConvention(), pParam );
else
- return sal_False;
+ return false;
}
@@ -1075,11 +1061,10 @@ double ScTable::GetValue( SCCOL nCol, SCROW nRow )
}
-void ScTable::GetFormula( SCCOL nCol, SCROW nRow, String& rFormula,
- sal_Bool bAsciiExport )
+void ScTable::GetFormula( SCCOL nCol, SCROW nRow, String& rFormula )
{
if (ValidColRow(nCol,nRow))
- aCol[nCol].GetFormula( nRow, rFormula, bAsciiExport );
+ aCol[nCol].GetFormula( nRow, rFormula );
else
rFormula.Erase();
}
@@ -1145,7 +1130,7 @@ ScBaseCell* ScTable::GetCell( SCCOL nCol, SCROW nRow ) const
if (ValidColRow( nCol, nRow ))
return aCol[nCol].GetCell( nRow );
- DBG_ERROR("GetCell ausserhalb");
+ OSL_FAIL("GetCell ausserhalb");
return NULL;
}
@@ -1181,7 +1166,7 @@ sal_Bool ScTable::HasData( SCCOL nCol, SCROW nRow )
if (ValidColRow(nCol,nRow))
return aCol[nCol].HasDataAt( nRow );
else
- return sal_False;
+ return false;
}
@@ -1190,7 +1175,7 @@ sal_Bool ScTable::HasStringData( SCCOL nCol, SCROW nRow )
if (ValidColRow(nCol,nRow))
return aCol[nCol].HasStringData( nRow );
else
- return sal_False;
+ return false;
}
@@ -1199,7 +1184,7 @@ sal_Bool ScTable::HasValueData( SCCOL nCol, SCROW nRow )
if (ValidColRow(nCol,nRow))
return aCol[nCol].HasValueData( nRow );
else
- return sal_False;
+ return false;
}
@@ -1211,18 +1196,10 @@ sal_Bool ScTable::HasStringCells( SCCOL nStartCol, SCROW nStartRow,
if (aCol[nCol].HasStringCells(nStartRow, nEndRow))
return sal_True;
- return sal_False;
+ return false;
}
-//UNUSED2008-05 sal_uInt16 ScTable::GetErrCode( SCCOL nCol, SCROW nRow ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 if (ValidColRow( nCol, nRow ))
-//UNUSED2008-05 return aCol[nCol].GetErrCode( nRow );
-//UNUSED2008-05 return 0;
-//UNUSED2008-05 }
-
-
void ScTable::SetDirtyVar()
{
for (SCCOL i=0; i<=MAXCOL; i++)
@@ -1233,7 +1210,7 @@ void ScTable::SetDirtyVar()
void ScTable::SetDirty()
{
sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
for (SCCOL i=0; i<=MAXCOL; i++)
aCol[i].SetDirty();
pDocument->SetAutoCalc( bOldAutoCalc );
@@ -1243,7 +1220,7 @@ void ScTable::SetDirty()
void ScTable::SetDirty( const ScRange& rRange )
{
sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
SCCOL nCol2 = rRange.aEnd.Col();
for (SCCOL i=rRange.aStart.Col(); i<=nCol2; i++)
aCol[i].SetDirty( rRange );
@@ -1254,7 +1231,7 @@ void ScTable::SetDirty( const ScRange& rRange )
void ScTable::SetTableOpDirty( const ScRange& rRange )
{
sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // no multiple recalculation
+ pDocument->SetAutoCalc( false ); // no multiple recalculation
SCCOL nCol2 = rRange.aEnd.Col();
for (SCCOL i=rRange.aStart.Col(); i<=nCol2; i++)
aCol[i].SetTableOpDirty( rRange );
@@ -1265,7 +1242,7 @@ void ScTable::SetTableOpDirty( const ScRange& rRange )
void ScTable::SetDirtyAfterLoad()
{
sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
for (SCCOL i=0; i<=MAXCOL; i++)
aCol[i].SetDirtyAfterLoad();
pDocument->SetAutoCalc( bOldAutoCalc );
@@ -1275,7 +1252,7 @@ void ScTable::SetDirtyAfterLoad()
void ScTable::SetRelNameDirty()
{
sal_Bool bOldAutoCalc = pDocument->GetAutoCalc();
- pDocument->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDocument->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
for (SCCOL i=0; i<=MAXCOL; i++)
aCol[i].SetRelNameDirty();
pDocument->SetAutoCalc( bOldAutoCalc );
@@ -1285,11 +1262,6 @@ void ScTable::SetRelNameDirty()
void ScTable::SetLoadingMedium(bool bLoading)
{
mpRowHeights->enableTreeSearch(!bLoading);
-
- // When loading a medium, prefer inserting row heights from the back
- // position since the row heights are stored and read in ascending order
- // during import.
- mpRowHeights->setInsertFromBack(bLoading);
}
@@ -1349,6 +1321,14 @@ sal_uLong ScTable::GetNumberFormat( SCCOL nCol, SCROW nRow ) const
return 0;
}
+sal_uInt32 ScTable::GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const
+{
+ if (!ValidCol(nCol) || !ValidRow(nStartRow) || !ValidRow(nEndRow))
+ return 0;
+
+ return aCol[nCol].GetNumberFormat(nStartRow, nEndRow);
+}
+
const ScPatternAttr* ScTable::GetPattern( SCCOL nCol, SCROW nRow ) const
{
@@ -1356,7 +1336,7 @@ const ScPatternAttr* ScTable::GetPattern( SCCOL nCol, SCROW nRow ) const
return aCol[nCol].GetPattern( nRow );
else
{
- DBG_ERROR("wrong column or row");
+ OSL_FAIL("wrong column or row");
return pDocument->GetDefPattern(); // for safety
}
}
@@ -1380,43 +1360,25 @@ bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal
}
-//UNUSED2009-05 sal_Bool ScTable::HasLines( const ScRange& rRange, Rectangle& rSizes ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 SCCOL nCol1 = rRange.aStart.Col();
-//UNUSED2009-05 SCROW nRow1 = rRange.aStart.Row();
-//UNUSED2009-05 SCCOL nCol2 = rRange.aEnd.Col();
-//UNUSED2009-05 SCROW nRow2 = rRange.aEnd.Row();
-//UNUSED2009-05 PutInOrder( nCol1, nCol2 );
-//UNUSED2009-05 PutInOrder( nRow1, nRow2 );
-//UNUSED2009-05
-//UNUSED2009-05 sal_Bool bFound = sal_False;
-//UNUSED2009-05 for (SCCOL i=nCol1; i<=nCol2; i++)
-//UNUSED2009-05 if (aCol[i].HasLines( nRow1, nRow2, rSizes, (i==nCol1), (i==nCol2) ))
-//UNUSED2009-05 bFound = sal_True;
-//UNUSED2009-05
-//UNUSED2009-05 return bFound;
-//UNUSED2009-05 }
-
-
-sal_Bool ScTable::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const
+bool ScTable::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const
{
- sal_Bool bFound=sal_False;
+ bool bFound = false;
for (SCCOL i=0; i<=MAXCOL && !bFound; i++)
bFound |= aCol[i].HasAttribSelection( rMark, nMask );
return bFound;
}
-sal_Bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
+bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
SCCOL& rEndCol, SCROW& rEndRow,
sal_Bool bRefresh, sal_Bool bAttrs )
{
if (!(ValidCol(nStartCol) && ValidCol(rEndCol)))
{
DBG_ERRORFILE("ScTable::ExtendMerge: invalid column number");
- return sal_False;
+ return false;
}
- sal_Bool bFound=sal_False;
+ bool bFound = false;
SCCOL nOldEndX = rEndCol;
SCROW nOldEndY = rEndRow;
for (SCCOL i=nStartCol; i<=nOldEndX; i++)
@@ -1430,7 +1392,7 @@ sal_Bool ScTable::IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRo
if (!(ValidCol(nCol1) && ValidCol(nCol2)))
{
DBG_ERRORFILE("ScTable::IsBlockEmpty: invalid column number");
- return sal_False;
+ return false;
}
sal_Bool bEmpty = sal_True;
for (SCCOL i=nCol1; i<=nCol2 && bEmpty; i++)
@@ -1489,7 +1451,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO
nWidth += GetColWidth( nTouchedCol );
}
if ( nTouchedCol > nX2 )
- bHitOne = sal_False;
+ bHitOne = false;
}
if (bHitOne)
@@ -1511,7 +1473,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC
{
if ( !pColWidth || !mpRowHeights || !pColFlags || !pRowFlags )
{
- DBG_ERROR( "Spalten-/Zeileninfo fehlt" );
+ OSL_FAIL( "Spalten-/Zeileninfo fehlt" );
return;
}
@@ -1605,7 +1567,7 @@ sal_Bool ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
if ( nRow1 == nRow2 )
{ // obere und untere Zeile
- sal_Bool bOpen = sal_False;
+ sal_Bool bOpen = false;
const sal_uInt16 n = 2 | 8;
for ( SCCOL i=nCol1; i<=nCol2; i++)
{
@@ -1619,7 +1581,7 @@ sal_Bool ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
else if ( !bOpen )
return sal_True; // es gibt was, was nicht geoeffnet wurde
if ( nEdges & 16 )
- bOpen = sal_False; // rechte Kante schliesst
+ bOpen = false; // rechte Kante schliesst
}
}
if ( bOpen )
@@ -1632,7 +1594,7 @@ sal_Bool ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
// erst obere Zeile, dann untere Zeile
for ( j=0, nR=nRow1, n=8; j<2; j++, nR=nRow2, n=2 )
{
- sal_Bool bOpen = sal_False;
+ sal_Bool bOpen = false;
for ( SCCOL i=nCol1; i<=nCol2; i++)
{
nEdges = aCol[i].GetBlockMatrixEdges( nR, nR, n );
@@ -1647,20 +1609,20 @@ sal_Bool ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
else if ( !bOpen )
return sal_True; // es gibt was, was nicht geoeffnet wurde
if ( nEdges & 16 )
- bOpen = sal_False; // rechte Kante schliesst
+ bOpen = false; // rechte Kante schliesst
}
}
if ( bOpen )
return sal_True; // es geht noch weiter
}
}
- return sal_False;
+ return false;
}
-sal_Bool ScTable::HasSelectionMatrixFragment( const ScMarkData& rMark ) const
+bool ScTable::HasSelectionMatrixFragment( const ScMarkData& rMark ) const
{
- sal_Bool bFound=sal_False;
+ bool bFound = false;
for (SCCOL i=0; i<=MAXCOL && !bFound; i++)
bFound |= aCol[i].HasSelectionMatrixFragment(rMark);
return bFound;
@@ -1674,16 +1636,16 @@ sal_Bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
{
DBG_ERRORFILE("IsBlockEditable: invalid column or row");
if (pOnlyNotBecauseOfMatrix)
- *pOnlyNotBecauseOfMatrix = sal_False;
- return sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
+ return false;
}
sal_Bool bIsEditable = sal_True;
if ( nLockCount )
- bIsEditable = sal_False;
+ bIsEditable = false;
else if ( IsProtected() && !pDocument->IsScenario(nTab) )
{
- if((bIsEditable = !HasAttrib( nCol1, nRow1, nCol2, nRow2, HASATTR_PROTECTED )) != sal_False)
+ if((bIsEditable = !HasAttrib( nCol1, nRow1, nCol2, nRow2, HASATTR_PROTECTED )) != false)
{
// If Sheet is protected and cells are not protected then
// check the active scenario protect flag if this range is
@@ -1729,15 +1691,15 @@ sal_Bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
{
if ( HasBlockMatrixFragment( nCol1, nRow1, nCol2, nRow2 ) )
{
- bIsEditable = sal_False;
+ bIsEditable = false;
if ( pOnlyNotBecauseOfMatrix )
*pOnlyNotBecauseOfMatrix = sal_True;
}
else if ( pOnlyNotBecauseOfMatrix )
- *pOnlyNotBecauseOfMatrix = sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
}
else if ( pOnlyNotBecauseOfMatrix )
- *pOnlyNotBecauseOfMatrix = sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
return bIsEditable;
}
@@ -1747,25 +1709,24 @@ sal_Bool ScTable::IsSelectionEditable( const ScMarkData& rMark,
{
sal_Bool bIsEditable = sal_True;
if ( nLockCount )
- bIsEditable = sal_False;
+ bIsEditable = false;
else if ( IsProtected() && !pDocument->IsScenario(nTab) )
{
- if((bIsEditable = !HasAttribSelection( rMark, HASATTR_PROTECTED )) != sal_False)
+ if((bIsEditable = !HasAttribSelection( rMark, HASATTR_PROTECTED )) != false)
{
// If Sheet is protected and cells are not protected then
// check the active scenario protect flag if this area is
// in the active scenario range.
ScRangeList aRanges;
- rMark.FillRangeListWithMarks( &aRanges, sal_False );
- sal_uLong nRangeCount = aRanges.Count();
+ rMark.FillRangeListWithMarks( &aRanges, false );
SCTAB nScenTab = nTab+1;
while(pDocument->IsScenario(nScenTab) && bIsEditable)
{
if(pDocument->IsActiveScenario(nScenTab))
{
- for (sal_uLong i=0; i<nRangeCount && bIsEditable; i++)
+ for (size_t i=0, nRange = aRanges.size(); (i < nRange) && bIsEditable; i++ )
{
- ScRange aRange = *aRanges.GetObject(i);
+ ScRange aRange = *aRanges[ i ];
if(pDocument->HasScenarioRange(nScenTab, aRange))
{
sal_uInt16 nFlags;
@@ -1791,11 +1752,10 @@ sal_Bool ScTable::IsSelectionEditable( const ScMarkData& rMark,
if(pDocument->IsTabProtected(nActualTab))
{
ScRangeList aRanges;
- rMark.FillRangeListWithMarks( &aRanges, sal_False );
- sal_uLong nRangeCount = aRanges.Count();
- for (sal_uLong i=0; i<nRangeCount && bIsEditable; i++)
+ rMark.FillRangeListWithMarks( &aRanges, false );
+ for (size_t i = 0, nRange = aRanges.size(); (i < nRange) && bIsEditable; i++)
{
- ScRange aRange = *aRanges.GetObject(i);
+ ScRange aRange = *aRanges[ i ];
if(pDocument->HasScenarioRange(nTab, aRange))
{
sal_uInt16 nFlags;
@@ -1809,15 +1769,15 @@ sal_Bool ScTable::IsSelectionEditable( const ScMarkData& rMark,
{
if ( HasSelectionMatrixFragment( rMark ) )
{
- bIsEditable = sal_False;
+ bIsEditable = false;
if ( pOnlyNotBecauseOfMatrix )
*pOnlyNotBecauseOfMatrix = sal_True;
}
else if ( pOnlyNotBecauseOfMatrix )
- *pOnlyNotBecauseOfMatrix = sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
}
else if ( pOnlyNotBecauseOfMatrix )
- *pOnlyNotBecauseOfMatrix = sal_False;
+ *pOnlyNotBecauseOfMatrix = false;
return bIsEditable;
}
@@ -1835,7 +1795,7 @@ void ScTable::UnlockTable()
--nLockCount;
else
{
- DBG_ERROR("UnlockTable ohne LockTable");
+ OSL_FAIL("UnlockTable ohne LockTable");
}
}
@@ -1891,17 +1851,25 @@ void ScTable::ApplyPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr )
void ScTable::ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
- const ScPatternAttr& rAttr )
+ const ScPatternAttr& rAttr, ScEditDataArray* pDataArray )
{
if (ValidColRow(nStartCol, nStartRow) && ValidColRow(nEndCol, nEndRow))
{
PutInOrder(nStartCol, nEndCol);
PutInOrder(nStartRow, nEndRow);
for (SCCOL i = nStartCol; i <= nEndCol; i++)
- aCol[i].ApplyPatternArea(nStartRow, nEndRow, rAttr);
+ aCol[i].ApplyPatternArea(nStartRow, nEndRow, rAttr, pDataArray);
}
}
+bool ScTable::SetAttrEntries(SCCOL nCol, ScAttrEntry* pData, SCSIZE nSize)
+{
+ if (!ValidCol(nCol))
+ return false;
+
+ return aCol[nCol].SetAttrEntries(pData, nSize);
+}
+
void ScTable::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
const ScPatternAttr& rPattern, short nNewType )
{
@@ -1962,10 +1930,10 @@ const ScStyleSheet* ScTable::GetStyle( SCCOL nCol, SCROW nRow ) const
const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, sal_Bool& rFound ) const
{
- rFound = sal_False;
+ rFound = false;
- sal_Bool bEqual = sal_True;
- sal_Bool bColFound;
+ sal_Bool bEqual = true;
+ bool bColFound;
const ScStyleSheet* pStyle = NULL;
const ScStyleSheet* pNewStyle;
@@ -1978,7 +1946,7 @@ const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, sal_Boo
{
rFound = sal_True;
if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
- bEqual = sal_False; // unterschiedliche
+ bEqual = false; // unterschiedliche
pStyle = pNewStyle;
}
}
@@ -1990,10 +1958,10 @@ const ScStyleSheet* ScTable::GetSelectionStyle( const ScMarkData& rMark, sal_Boo
const ScStyleSheet* ScTable::GetAreaStyle( sal_Bool& rFound, SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2 ) const
{
- rFound = sal_False;
+ rFound = false;
- sal_Bool bEqual = sal_True;
- sal_Bool bColFound;
+ sal_Bool bEqual = true;
+ bool bColFound;
const ScStyleSheet* pStyle = NULL;
const ScStyleSheet* pNewStyle;
@@ -2005,7 +1973,7 @@ const ScStyleSheet* ScTable::GetAreaStyle( sal_Bool& rFound, SCCOL nCol1, SCROW
{
rFound = sal_True;
if ( !pNewStyle || ( pStyle && pNewStyle != pStyle ) )
- bEqual = sal_False; // unterschiedliche
+ bEqual = false; // unterschiedliche
pStyle = pNewStyle;
}
}
@@ -2016,7 +1984,7 @@ const ScStyleSheet* ScTable::GetAreaStyle( sal_Bool& rFound, SCCOL nCol1, SCROW
sal_Bool ScTable::IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const
{
- sal_Bool bIsUsed = sal_False;
+ sal_Bool bIsUsed = false;
for ( SCCOL i=0; i<=MAXCOL; i++ )
{
@@ -2051,17 +2019,17 @@ void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, sal_Bool
SCROW nEndRow = aData.mnRow2;
if (aData.mbValue)
- SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, sal_False);
+ SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, false);
nRow = nEndRow + 1;
}
}
-sal_Bool ScTable::ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
- sal_Int16 nFlags )
+bool ScTable::ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
+ INT16 nFlags )
{
- sal_Bool bChanged = sal_False;
+ bool bChanged = false;
if (ValidColRow(nStartCol, nStartRow) && ValidColRow(nEndCol, nEndRow))
for (SCCOL i = nStartCol; i <= nEndCol; i++)
bChanged |= aCol[i].ApplyFlags(nStartRow, nEndRow, nFlags);
@@ -2069,10 +2037,10 @@ sal_Bool ScTable::ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, S
}
-sal_Bool ScTable::RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
- sal_Int16 nFlags )
+bool ScTable::RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
+ INT16 nFlags )
{
- sal_Bool bChanged = sal_False;
+ bool bChanged = false;
if (ValidColRow(nStartCol, nStartRow) && ValidColRow(nEndCol, nEndRow))
for (SCCOL i = nStartCol; i <= nEndCol; i++)
bChanged |= aCol[i].RemoveFlags(nStartRow, nEndRow, nFlags);
@@ -2094,10 +2062,11 @@ void ScTable::ApplyAttr( SCCOL nCol, SCROW nRow, const SfxPoolItem& rAttr )
}
-void ScTable::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark )
+void ScTable::ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark,
+ ScEditDataArray* pDataArray )
{
for (SCCOL i=0; i<=MAXCOL; i++)
- aCol[i].ApplySelectionCache( pCache, rMark );
+ aCol[i].ApplySelectionCache( pCache, rMark, pDataArray );
}
@@ -2123,7 +2092,6 @@ void ScTable::SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth )
{
if (!nNewWidth)
{
-// DBG_ERROR("Spaltenbreite 0 in SetColWidth");
nNewWidth = STD_COL_WIDTH;
}
@@ -2131,9 +2099,6 @@ void ScTable::SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth )
{
IncRecalcLevel();
InitializeNoteCaptions();
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- if (pDrawLayer)
- pDrawLayer->WidthChanged( nTab, nCol, ((long) nNewWidth) - (long) pColWidth[nCol] );
pColWidth[nCol] = nNewWidth;
DecRecalcLevel();
@@ -2142,10 +2107,21 @@ void ScTable::SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth )
}
else
{
- DBG_ERROR("Falsche Spaltennummer oder keine Breiten");
+ OSL_FAIL("Falsche Spaltennummer oder keine Breiten");
}
}
+void ScTable::SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth )
+{
+ if (!VALIDCOL(nCol) || !pColWidth)
+ return;
+
+ if (!nNewWidth)
+ nNewWidth = STD_COL_WIDTH;
+
+ if (nNewWidth != pColWidth[nCol])
+ pColWidth[nCol] = nNewWidth;
+}
void ScTable::SetRowHeight( SCROW nRow, sal_uInt16 nNewHeight )
{
@@ -2153,27 +2129,20 @@ void ScTable::SetRowHeight( SCROW nRow, sal_uInt16 nNewHeight )
{
if (!nNewHeight)
{
- DBG_ERROR("Zeilenhoehe 0 in SetRowHeight");
+ OSL_FAIL("Zeilenhoehe 0 in SetRowHeight");
nNewHeight = ScGlobal::nStdRowHeight;
}
sal_uInt16 nOldHeight = mpRowHeights->getValue(nRow);
if ( nNewHeight != nOldHeight )
{
- IncRecalcLevel();
- InitializeNoteCaptions();
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- if (pDrawLayer)
- pDrawLayer->HeightChanged( nTab, nRow, ((long) nNewHeight) - (long) nOldHeight );
mpRowHeights->setValue(nRow, nRow, nNewHeight);
- DecRecalcLevel();
-
InvalidatePageBreaks();
}
}
else
{
- DBG_ERROR("Falsche Zeilennummer oder keine Hoehen");
+ OSL_FAIL("Falsche Zeilennummer oder keine Hoehen");
}
}
@@ -2214,18 +2183,16 @@ bool lcl_pixelSizeChanged(
sal_Bool ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight,
double /* nPPTX */, double nPPTY )
{
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && mpRowHeights)
{
- IncRecalcLevel();
- InitializeNoteCaptions();
if (!nNewHeight)
{
- DBG_ERROR("Zeilenhoehe 0 in SetRowHeight");
+ OSL_FAIL("Zeilenhoehe 0 in SetRowHeight");
nNewHeight = ScGlobal::nStdRowHeight;
}
- sal_Bool bSingle = sal_False; // sal_True = process every row for its own
+ sal_Bool bSingle = false; // sal_True = process every row for its own
ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
if (pDrawLayer)
if (pDrawLayer->HasObjectsInRows( nTab, nStartRow, nEndRow ))
@@ -2236,7 +2203,7 @@ sal_Bool ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16
ScFlatUInt16RowSegments::RangeData aData;
mpRowHeights->getRangeData(nStartRow, aData);
if (nNewHeight == aData.mnValue && nEndRow <= aData.mnRow2)
- bSingle = sal_False; // no difference in this range
+ bSingle = false; // no difference in this range
}
if (bSingle)
{
@@ -2245,22 +2212,7 @@ sal_Bool ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16
if (!bChanged)
bChanged = lcl_pixelSizeChanged(*mpRowHeights, nStartRow, nEndRow, nNewHeight, nPPTY);
- /* #i94028# #i94991# If drawing objects are involved, each row
- has to be changed for its own, because each call to
- ScDrawLayer::HeightChanged expects correct row heights
- above passed row in the document. Cannot use array iterator
- because array changes in every cycle. */
- if( pDrawLayer )
- {
- for( SCROW nRow = nStartRow; nRow <= nEndRow ; ++nRow )
- {
- pDrawLayer->HeightChanged( nTab, nRow,
- static_cast<long>(nNewHeight) - static_cast<long>(mpRowHeights->getValue(nRow)));
- mpRowHeights->setValue(nRow, nRow, nNewHeight);
- }
- }
- else
- mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight);
+ mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight);
}
else
{
@@ -2273,17 +2225,6 @@ sal_Bool ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16
}
else
{
- if (pDrawLayer)
- {
- // #i115025# When comparing to nNewHeight for the whole range, the height
- // including hidden rows has to be used (same behavior as 3.2).
- unsigned long nOldHeights = mpRowHeights->getSumValue(nStartRow, nEndRow);
- // FIXME: should we test for overflows?
- long nHeightDif = (long) (unsigned long) nNewHeight *
- (nEndRow - nStartRow + 1) - nOldHeights;
- pDrawLayer->HeightChanged( nTab, nEndRow, nHeightDif );
- }
-
if (!bChanged)
bChanged = lcl_pixelSizeChanged(*mpRowHeights, nStartRow, nEndRow, nNewHeight, nPPTY);
@@ -2296,7 +2237,7 @@ sal_Bool ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16
}
else
{
- DBG_ERROR("Falsche Zeilennummer oder keine Hoehen");
+ OSL_FAIL("Falsche Zeilennummer oder keine Hoehen");
}
return bChanged;
@@ -2324,7 +2265,7 @@ void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, sal_Bool bManual
}
else
{
- DBG_ERROR("Falsche Zeilennummer oder keine Zeilenflags");
+ OSL_FAIL("Falsche Zeilennummer oder keine Zeilenflags");
}
}
@@ -2362,7 +2303,7 @@ sal_uInt16 ScTable::GetCommonWidth( SCCOL nEndCol )
if ( !ValidCol(nEndCol) )
{
- DBG_ERROR("wrong column");
+ OSL_FAIL("wrong column");
nEndCol = MAXCOL;
}
@@ -2457,7 +2398,7 @@ sal_uLong ScTable::GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const
while (nRow <= nEndRow)
{
SCROW nLastRow = -1;
- if (!RowHidden(nRow, nLastRow))
+ if (!RowHidden(nRow, NULL, &nLastRow))
{
if (nLastRow > nEndRow)
nLastRow = nEndRow;
@@ -2483,7 +2424,7 @@ sal_uLong ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fS
while (nRow <= nEndRow)
{
SCROW nLastRow = -1;
- if (!RowHidden(nRow, nLastRow))
+ if (!RowHidden(nRow, NULL, &nLastRow))
{
if (nLastRow > nEndRow)
nLastRow = nEndRow;
@@ -2519,7 +2460,7 @@ SCROW ScTable::GetHiddenRowCount( SCROW nRow )
return 0;
SCROW nLastRow = -1;
- if (!RowHidden(nRow, nLastRow) || !ValidRow(nLastRow))
+ if (!RowHidden(nRow, NULL, &nLastRow) || !ValidRow(nLastRow))
return 0;
return nLastRow - nRow + 1;
@@ -2537,17 +2478,9 @@ void ScTable::ShowCol(SCCOL nCol, bool bShow)
{
IncRecalcLevel();
InitializeNoteCaptions();
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- if (pDrawLayer)
- {
- if (bShow)
- pDrawLayer->WidthChanged( nTab, nCol, (long) pColWidth[nCol] );
- else
- pDrawLayer->WidthChanged( nTab, nCol, -(long) pColWidth[nCol] );
- }
SetColHidden(nCol, nCol, !bShow);
- DecRecalcLevel();
+ DecRecalcLevel();
ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
if ( pCharts )
@@ -2556,7 +2489,7 @@ void ScTable::ShowCol(SCCOL nCol, bool bShow)
}
else
{
- DBG_ERROR("Falsche Spaltennummer oder keine Flags");
+ OSL_FAIL("Falsche Spaltennummer oder keine Flags");
}
}
@@ -2568,24 +2501,9 @@ void ScTable::ShowRow(SCROW nRow, bool bShow)
bool bWasVis = !RowHidden(nRow);
if (bWasVis != bShow)
{
- IncRecalcLevel();
- InitializeNoteCaptions();
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- if (pDrawLayer)
- {
- if (bShow)
- pDrawLayer->HeightChanged(
- nTab, nRow, static_cast<long>(mpRowHeights->getValue(nRow)));
- else
- pDrawLayer->HeightChanged(
- nTab, nRow, -static_cast<long>(mpRowHeights->getValue(nRow)));
- }
-
SetRowHidden(nRow, nRow, !bShow);
if (bShow)
SetRowFiltered(nRow, nRow, false);
- DecRecalcLevel();
-
ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
if ( pCharts )
pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab ));
@@ -2595,7 +2513,7 @@ void ScTable::ShowRow(SCROW nRow, bool bShow)
}
else
{
- DBG_ERROR("Falsche Zeilennummer oder keine Flags");
+ OSL_FAIL("Falsche Zeilennummer oder keine Flags");
}
}
@@ -2604,29 +2522,11 @@ void ScTable::DBShowRow(SCROW nRow, bool bShow)
{
if (VALIDROW(nRow) && pRowFlags)
{
- bool bWasVis = !RowHidden(nRow);
- IncRecalcLevel();
- InitializeNoteCaptions();
- if (bWasVis != bShow)
- {
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- if (pDrawLayer)
- {
- if (bShow)
- pDrawLayer->HeightChanged(
- nTab, nRow, static_cast<long>(mpRowHeights->getValue(nRow)));
- else
- pDrawLayer->HeightChanged(
- nTab, nRow, -static_cast<long>(mpRowHeights->getValue(nRow)));
- }
- }
-
// Filter-Flag immer setzen, auch wenn Hidden unveraendert
- SetRowHidden(nRow, nRow, !bShow);
+ bool bChanged = SetRowHidden(nRow, nRow, !bShow);
SetRowFiltered(nRow, nRow, !bShow);
- DecRecalcLevel();
- if (bWasVis != bShow)
+ if (bChanged)
{
ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
if ( pCharts )
@@ -2640,44 +2540,25 @@ void ScTable::DBShowRow(SCROW nRow, bool bShow)
}
else
{
- DBG_ERROR("Falsche Zeilennummer oder keine Flags");
+ OSL_FAIL("Falsche Zeilennummer oder keine Flags");
}
}
-void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow, bool bSetFlags)
+void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
{
- // #i116164# IncRecalcLevel/DecRecalcLevel is in ScTable::Query
SCROW nStartRow = nRow1;
- InitializeNoteCaptions();
while (nStartRow <= nRow2)
{
SCROW nEndRow = -1;
- bool bWasVis = !RowHidden(nStartRow, nEndRow);
+ bool bWasVis = !RowHiddenLeaf(nStartRow, NULL, &nEndRow);
if (nEndRow > nRow2)
nEndRow = nRow2;
sal_Bool bChanged = ( bWasVis != bShow );
- if ( bChanged && bSetFlags )
- {
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- if (pDrawLayer)
- {
- long nHeight = static_cast<long>(mpRowHeights->getSumValue(nStartRow, nEndRow));
- if (bShow)
- pDrawLayer->HeightChanged( nTab, nStartRow, nHeight );
- else
- pDrawLayer->HeightChanged( nTab, nStartRow, -nHeight );
- }
- }
- // #i116164# Directly modify the flags only if there are drawing objects within the area.
- // Otherwise, all modifications are made together in ScTable::Query, so the tree isn't constantly rebuilt.
- if ( bSetFlags )
- {
- SetRowHidden(nStartRow, nEndRow, !bShow);
- SetRowFiltered(nStartRow, nEndRow, !bShow);
- }
+ SetRowHidden(nStartRow, nEndRow, !bShow);
+ SetRowFiltered(nStartRow, nEndRow, !bShow);
if ( bChanged )
{
@@ -2705,39 +2586,20 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
// #i116164# if there are no drawing objects within the row range, a single HeightChanged call is enough
ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- bool bHasObjects = pDrawLayer && pDrawLayer->HasObjectsInRows( nTab, nRow1, nRow2, false );
- long nOldHeight = 0;
- if ( pDrawLayer && !bHasObjects )
- nOldHeight = static_cast<long>(GetRowHeight(nRow1, nRow2));
+ bool bHasObjects = pDrawLayer && pDrawLayer->HasObjectsInRows( nTab, nRow1, nRow2 );
while (nStartRow <= nRow2)
{
SCROW nEndRow = -1;
- bool bWasVis = !RowHidden(nStartRow, nEndRow);
+ bool bWasVis = !RowHiddenLeaf(nStartRow, NULL, &nEndRow);
if (nEndRow > nRow2)
nEndRow = nRow2;
sal_Bool bChanged = ( bWasVis != bShow );
- if ( bChanged && bHasObjects )
- {
- if (pDrawLayer)
- {
- long nHeight = static_cast<long>(mpRowHeights->getSumValue(nStartRow, nEndRow));
- if (bShow)
- pDrawLayer->HeightChanged( nTab, nStartRow, nHeight );
- else
- pDrawLayer->HeightChanged( nTab, nStartRow, -nHeight );
- }
- }
- // #i116164# Directly modify the flags only if there are drawing objects within the area.
- // Otherwise, all rows are modified together after the loop, so the tree isn't constantly rebuilt.
- if ( bHasObjects )
- {
- SetRowHidden(nStartRow, nEndRow, !bShow);
- if (bShow)
- SetRowFiltered(nStartRow, nEndRow, false);
- }
+ SetRowHidden(nStartRow, nEndRow, !bShow);
+ if (bShow)
+ SetRowFiltered(nStartRow, nEndRow, false);
if ( bChanged )
{
@@ -2757,16 +2619,6 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
SetRowHidden(nRow1, nRow2, !bShow);
if (bShow)
SetRowFiltered(nRow1, nRow2, false);
-
- if ( pDrawLayer )
- {
- // if there are no objects in the range, a single HeightChanged call is enough
- long nNewHeight = 0;
- if ( bShow )
- nNewHeight = static_cast<long>(GetRowHeight(nRow1, nRow2));
- if ( nNewHeight != nOldHeight )
- pDrawLayer->HeightChanged( nTab, nRow1, nNewHeight - nOldHeight );
- }
}
DecRecalcLevel();
@@ -2779,7 +2631,7 @@ void ScTable::SetColFlags( SCCOL nCol, sal_uInt8 nNewFlags )
pColFlags[nCol] = nNewFlags;
else
{
- DBG_ERROR("Falsche Spaltennummer oder keine Flags");
+ OSL_FAIL("Falsche Spaltennummer oder keine Flags");
}
}
@@ -2790,7 +2642,7 @@ void ScTable::SetRowFlags( SCROW nRow, sal_uInt8 nNewFlags )
pRowFlags->SetValue( nRow, nNewFlags);
else
{
- DBG_ERROR("Falsche Zeilennummer oder keine Flags");
+ OSL_FAIL("Falsche Zeilennummer oder keine Flags");
}
}
@@ -2801,7 +2653,7 @@ void ScTable::SetRowFlags( SCROW nStartRow, SCROW nEndRow, sal_uInt8 nNewFlags )
pRowFlags->SetValue( nStartRow, nEndRow, nNewFlags);
else
{
- DBG_ERROR("Falsche Zeilennummer(n) oder keine Flags");
+ OSL_FAIL("Falsche Zeilennummer(n) oder keine Flags");
}
}
@@ -2895,7 +2747,7 @@ sal_Bool ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, sal_Bool bSh
return pOutlineTable->GetColArray()->ManualAction( nStartCol, nEndCol, bShow, *this, true );
}
else
- return sal_False;
+ return false;
}
@@ -2904,7 +2756,7 @@ sal_Bool ScTable::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, sal_Bool bSh
if (pOutlineTable && pRowFlags)
return pOutlineTable->GetRowArray()->ManualAction( nStartRow, nEndRow, bShow, *this, false );
else
- return sal_False;
+ return false;
}
@@ -2933,7 +2785,7 @@ void ScTable::ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
if (rY2 < MAXROW)
{
SCROW nEndRow = -1;
- if (RowHidden(rY2+1, nEndRow) && ValidRow(nEndRow))
+ if (RowHidden(rY2+1, NULL, &nEndRow) && ValidRow(nEndRow))
rY2 = nEndRow;
}
}
@@ -2960,7 +2812,7 @@ void ScTable::StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
if (rY1 < rY2)
{
SCROW nEndRow = -1;
- if (RowHidden(rY1, nEndRow) && ValidRow(nEndRow) && nEndRow <= rY2)
+ if (RowHidden(rY1, NULL, &nEndRow) && ValidRow(nEndRow) && nEndRow <= rY2)
rY1 = nEndRow;
}
}
@@ -2978,8 +2830,7 @@ short DiffSign( T a, T b )
void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow )
{
- sal_Bool bSizeChanged = sal_False;
- sal_Bool bMissed = sal_False;
+ sal_Bool bSizeChanged = false;
SCCOL nCol;
SCROW nRow;
@@ -2988,18 +2839,15 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
ScOutlineArray* pArray;
ScBaseCell* pCell;
ScRange aRef;
-/* ScPatternAttr aBoldPattern( pDocument->GetPool() ); //! spezielle Format-Vorlage
- aBoldPattern.GetItemSet().Put( SvxWeightItem( WEIGHT_BOLD ) );
-*/
StartOutlineTable();
// Zeilen
SCROW nCount = nEndRow-nStartRow+1;
- sal_Bool* pUsed = new sal_Bool[nCount];
+ bool* pUsed = new bool[nCount];
for (i=0; i<nCount; i++)
- pUsed[i] = sal_False;
+ pUsed[i] = false;
for (nCol=nStartCol; nCol<=nEndCol; nCol++)
if (!aCol[nCol].IsEmptyData())
aCol[nCol].FindUsed( nStartRow, nEndRow, pUsed );
@@ -3008,7 +2856,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
for (nRow=nStartRow; nRow<=nEndRow; nRow++)
if (pUsed[nRow-nStartRow])
{
- bFound = sal_False;
+ bFound = false;
for (nCol=nStartCol; nCol<=nEndCol && !bFound; nCol++)
if (!aCol[nCol].IsEmptyData())
{
@@ -3023,11 +2871,8 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
{
if (pArray->Insert( aRef.aStart.Row(), aRef.aEnd.Row(), bSizeChanged ))
{
-// ApplyPatternArea( nStartCol, nRow, nEndCol, nRow, aBoldPattern );
- bFound = sal_True;
+ bFound = true;
}
- else
- bMissed = sal_True;
}
}
}
@@ -3041,7 +2886,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
{
if (!aCol[nCol].IsEmptyData())
{
- bFound = sal_False;
+ bFound = false;
ScColumnIterator aIter( &aCol[nCol], nStartRow, nEndRow );
while ( aIter.Next( nRow, pCell ) && !bFound )
{
@@ -3054,11 +2899,8 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
{
if (pArray->Insert( aRef.aStart.Col(), aRef.aEnd.Col(), bSizeChanged ))
{
-// ApplyPatternArea( nCol, nStartRow, nCol, nEndRow, aBoldPattern );
- bFound = sal_True;
+ bFound = true;
}
- else
- bMissed = sal_True;
}
}
}
@@ -3132,7 +2974,7 @@ sal_Bool ScTable::RefVisible(ScFormulaCell* pCell)
if (!ValidRow(nEndRow) || nEndRow < aRef.aEnd.Row())
return sal_True; // at least partly visible
- return sal_False; // completely invisible
+ return false; // completely invisible
}
}
@@ -3173,7 +3015,7 @@ void ScTable::SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos
// #i102616# actions that modify the draw page size count as sheet modification
// (exception: InitDrawLayer)
if (bResetStreamValid && IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
@@ -3195,7 +3037,7 @@ sal_uLong ScTable::GetRowOffset( SCROW nRow ) const
}
else
{
- DBG_ERROR("GetRowOffset: Daten fehlen");
+ OSL_FAIL("GetRowOffset: Daten fehlen");
}
return n;
}
@@ -3239,8 +3081,9 @@ sal_uLong ScTable::GetColOffset( SCCOL nCol ) const
}
else
{
- DBG_ERROR("GetColumnOffset: Daten fehlen");
+ OSL_FAIL("GetColumnOffset: Daten fehlen");
}
return n;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 1c5fd71243cc..a2b4556e2738 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,10 +61,146 @@
#include "postit.hxx"
#include "queryparam.hxx"
#include "segmenttree.hxx"
-#include "drwlayer.hxx"
#include <vector>
+using namespace ::com::sun::star;
+
+namespace naturalsort {
+
+using namespace ::com::sun::star::i18n;
+
+/** Splits a given string into three parts: the prefix, number string, and
+ the suffix.
+
+ @param sWhole
+ Original string to be split into pieces
+
+ @param sPrefix
+ Prefix string that consists of the part before the first number token
+
+ @param sSuffix
+ String after the last number token. This may still contain number strings.
+
+ @param fNum
+ Number converted from the middle number string
+
+ @return Returns TRUE if a numeral element is found in a given string, or
+ FALSE if no numeral element is found.
+*/
+bool SplitString( const rtl::OUString &sWhole,
+ rtl::OUString &sPrefix, rtl::OUString &sSuffix, double &fNum )
+{
+ i18n::LocaleDataItem aLocaleItem = ScGlobal::pLocaleData->getLocaleItem();
+
+ // Get prefix element
+ rtl::OUString sEmpty, sUser = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "-" ));
+ ParseResult aPRPre = ScGlobal::pCharClass->parsePredefinedToken(
+ KParseType::IDENTNAME, sWhole, 0,
+ KParseTokens::ANY_LETTER, sUser, KParseTokens::ANY_LETTER, sUser );
+ sPrefix = sWhole.copy( 0, aPRPre.EndPos );
+
+ // Return FALSE if no numeral element is found
+ if ( aPRPre.EndPos == sWhole.getLength() )
+ return false;
+
+ // Get numeral element
+ sUser = aLocaleItem.decimalSeparator;
+ ParseResult aPRNum = ScGlobal::pCharClass->parsePredefinedToken(
+ KParseType::ANY_NUMBER, sWhole, aPRPre.EndPos,
+ KParseTokens::ANY_NUMBER, sEmpty, KParseTokens::ANY_NUMBER, sUser );
+
+ if ( aPRNum.EndPos == aPRPre.EndPos )
+ return false;
+
+ fNum = aPRNum.Value;
+ sSuffix = sWhole.copy( aPRNum.EndPos );
+
+ return true;
+}
+
+/** Naturally compares two given strings.
+
+ This is the main function that should be called externally. It returns
+ either 1, 0, or -1 depending on the comparison result of given two strings.
+
+ @param sInput1
+ Input string 1
+
+ @param sInput2
+ Input string 2
+
+ @param bCaseSens
+ Boolean value for case sensitivity
+
+ @param pData
+ Pointer to user defined sort list
+
+ @param pCW
+ Pointer to collator wrapper for normal string comparison
+
+ @return Returnes 1 if sInput1 is greater, 0 if sInput1 == sInput2, and -1 if
+ sInput2 is greater.
+*/
+short Compare( const String &sInput1, const String &sInput2,
+ const sal_Bool bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW )
+{
+ rtl::OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2;
+
+ do
+ {
+ double nNum1, nNum2;
+ sal_Bool bNumFound1 = SplitString( sStr1, sPre1, sSuf1, nNum1 );
+ sal_Bool bNumFound2 = SplitString( sStr2, sPre2, sSuf2, nNum2 );
+
+ short nPreRes; // Prefix comparison result
+ if ( pData )
+ {
+ if ( bCaseSens )
+ {
+ if ( !bNumFound1 || !bNumFound2 )
+ return static_cast<short>(pData->Compare( sStr1, sStr2 ));
+ else
+ nPreRes = pData->Compare( sPre1, sPre2 );
+ }
+ else
+ {
+ if ( !bNumFound1 || !bNumFound2 )
+ return static_cast<short>(pData->ICompare( sStr1, sStr2 ));
+ else
+ nPreRes = pData->ICompare( sPre1, sPre2 );
+ }
+ }
+ else
+ {
+ if ( !bNumFound1 || !bNumFound2 )
+ return static_cast<short>(pCW->compareString( sStr1, sStr2 ));
+ else
+ nPreRes = static_cast<short>(pCW->compareString( sPre1, sPre2 ));
+ }
+
+ // Prefix strings differ. Return immediately.
+ if ( nPreRes != 0 ) return nPreRes;
+
+ if ( nNum1 != nNum2 )
+ {
+ if ( nNum1 < nNum2 ) return -1;
+ return static_cast<short>( nNum1 > nNum2 );
+ }
+
+ // The prefix and the first numerical elements are equal, but the suffix
+ // strings may still differ. Stay in the loop.
+
+ sStr1 = sSuf1;
+ sStr2 = sSuf2;
+
+ } while (true);
+
+ return 0;
+}
+
+}
+
// STATIC DATA -----------------------------------------------------------
const sal_uInt16 nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam
@@ -265,10 +402,10 @@ short ScTable::CompareCell( sal_uInt16 nSort,
{
sal_Bool bStr1 = ( eType1 != CELLTYPE_VALUE );
if ( eType1 == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell1)->IsValue() )
- bStr1 = sal_False;
+ bStr1 = false;
sal_Bool bStr2 = ( eType2 != CELLTYPE_VALUE );
if ( eType2 == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell2)->IsValue() )
- bStr2 = sal_False;
+ bStr2 = false;
if ( bStr1 && bStr2 ) // nur Strings untereinander als String vergleichen!
{
@@ -282,25 +419,40 @@ short ScTable::CompareCell( sal_uInt16 nSort,
((ScStringCell*)pCell2)->GetString(aStr2);
else
GetString(nCell2Col, nCell2Row, aStr2);
- sal_Bool bUserDef = aSortParam.bUserDef;
+
+ sal_Bool bUserDef = aSortParam.bUserDef; // custom sort order
+ sal_Bool bNaturalSort = aSortParam.bNaturalSort; // natural sort
+ sal_Bool bCaseSens = aSortParam.bCaseSens; // case sensitivity
+
if (bUserDef)
{
ScUserListData* pData =
- (ScUserListData*)(ScGlobal::GetUserList()->At(
- aSortParam.nUserIndex));
+ static_cast<ScUserListData*>( (ScGlobal::GetUserList()->At(
+ aSortParam.nUserIndex)) );
+
if (pData)
{
- if ( aSortParam.bCaseSens )
- nRes = sal::static_int_cast<short>( pData->Compare(aStr1, aStr2) );
+ if ( bNaturalSort )
+ nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, pData, pSortCollator );
else
- nRes = sal::static_int_cast<short>( pData->ICompare(aStr1, aStr2) );
+ {
+ if ( bCaseSens )
+ nRes = sal::static_int_cast<short>( pData->Compare(aStr1, aStr2) );
+ else
+ nRes = sal::static_int_cast<short>( pData->ICompare(aStr1, aStr2) );
+ }
}
else
- bUserDef = sal_False;
+ bUserDef = false;
}
if (!bUserDef)
- nRes = (short) pSortCollator->compareString( aStr1, aStr2 );
+ {
+ if ( bNaturalSort )
+ nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, NULL, pSortCollator );
+ else
+ nRes = static_cast<short>( pSortCollator->compareString( aStr1, aStr2 ) );
+ }
}
else if ( bStr1 ) // String <-> Zahl
nRes = 1; // Zahl vorne
@@ -495,7 +647,7 @@ sal_Bool ScTable::IsSorted( SCCOLROW nStart, SCCOLROW nEnd ) // ueber aSortPa
for (SCCOLROW i=nStart; i<nEnd; i++)
{
if (Compare( i, i+1 ) > 0)
- return sal_False;
+ return false;
}
return sal_True;
}
@@ -534,7 +686,7 @@ void ScTable::Sort(const ScSortParam& rSortParam, sal_Bool bKeepQuery)
QuickSort( pArray, nRow1, nLastRow );
SortReorder( pArray, aProgress );
delete pArray;
- // #158377# #i59745# update position of caption objects of cell notes
+ // #i59745# update position of caption objects of cell notes
ScNoteUtil::UpdateCaptionPositions( *pDocument, ScRange( aSortParam.nCol1, nRow1, nTab, aSortParam.nCol2, nLastRow, nTab ) );
}
}
@@ -555,7 +707,7 @@ void ScTable::Sort(const ScSortParam& rSortParam, sal_Bool bKeepQuery)
QuickSort( pArray, nCol1, nLastCol );
SortReorder( pArray, aProgress );
delete pArray;
- // #158377# #i59745# update position of caption objects of cell notes
+ // #i59745# update position of caption objects of cell notes
ScNoteUtil::UpdateCaptionPositions( *pDocument, ScRange( nCol1, aSortParam.nRow1, nTab, nLastCol, aSortParam.nRow2, nTab ) );
}
}
@@ -577,7 +729,7 @@ sal_Bool ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam )
SCROW nRow;
ScBaseCell* pCell;
- sal_Bool bWillDelete = sal_False;
+ sal_Bool bWillDelete = false;
for ( nCol=nStartCol; nCol<=nEndCol && !bWillDelete; nCol++ )
{
ScColumnIterator aIter( &aCol[nCol],nStartRow,nEndRow );
@@ -634,7 +786,7 @@ void ScTable::RemoveSubTotals( ScSubTotalParam& rParam )
void lcl_RemoveNumberFormat( ScTable* pTab, SCCOL nCol, SCROW nRow )
{
const ScPatternAttr* pPattern = pTab->GetPattern( nCol, nRow );
- if ( pPattern->GetItemSet().GetItemState( ATTR_VALUE_FORMAT, sal_False )
+ if ( pPattern->GetItemSet().GetItemState( ATTR_VALUE_FORMAT, false )
== SFX_ITEM_SET )
{
ScPatternAttr aNewPattern( *pPattern );
@@ -679,7 +831,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
if (rParam.bGroupActive[i])
nLevelCount = i+1;
else
- bDoThis = sal_False;
+ bDoThis = false;
if (nLevelCount==0) // nichts tun
return sal_True;
@@ -687,7 +839,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
SCCOL* nGroupCol = rParam.nField; // Spalten nach denen
// gruppiert wird
- // #44444# Durch (leer) als eigene Kategorie muss immer auf
+ // Durch (leer) als eigene Kategorie muss immer auf
// Teilergebniszeilen aus den anderen Spalten getestet werden
// (frueher nur, wenn eine Spalte mehrfach vorkam)
sal_Bool bTestPrevSub = ( nLevelCount > 1 );
@@ -708,7 +860,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
sal_Bool bSpaceLeft = sal_True; // Erfolg beim Einfuegen?
- // #90279# For performance reasons collect formula entries so their
+ // For performance reasons collect formula entries so their
// references don't have to be tested for updates each time a new row is
// inserted
RowEntry aRowEntry;
@@ -735,7 +887,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
*pCompString[i] = aSubString;
} // aSubString bleibt auf dem letzten stehen
- sal_Bool bBlockVis = sal_False; // Gruppe eingeblendet?
+ sal_Bool bBlockVis = false; // Gruppe eingeblendet?
aRowEntry.nSubStartRow = nStartRow;
for (SCROW nRow=nStartRow; nRow<=nEndRow+1 && bSpaceLeft; nRow++)
{
@@ -744,7 +896,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
bChanged = sal_True;
else
{
- bChanged = sal_False;
+ bChanged = false;
if (!bTotal)
{
String aString;
@@ -753,7 +905,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
GetString( nGroupCol[i], nRow, aString );
if (bIgnoreCase)
ScGlobal::pCharClass->toUpper( aString );
- // #41427# wenn sortiert, ist "leer" eine eigene Gruppe
+ // wenn sortiert, ist "leer" eine eigene Gruppe
// sonst sind leere Zellen unten erlaubt
bChanged = ( ( aString.Len() || rParam.bDoSort ) &&
aString != *pCompString[i] );
@@ -767,7 +919,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
{
if ( iEntry->nDestRow == nRow )
{
- bChanged = sal_False;
+ bChanged = false;
break;
}
}
@@ -783,7 +935,7 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
bSpaceLeft = pDocument->InsertRow( 0, nTab, MAXCOL, nTab,
aRowEntry.nDestRow, 1 );
DBShowRow( aRowEntry.nDestRow, bBlockVis );
- bBlockVis = sal_False;
+ bBlockVis = false;
if ( rParam.bPagebreak && nRow < MAXROW &&
aRowEntry.nSubStartRow != nStartRow && nLevel == 0)
SetRowBreak(aRowEntry.nSubStartRow, false, true);
@@ -855,10 +1007,6 @@ sal_Bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
bBlockVis = !RowFiltered(nRow);
}
}
- else
- {
-// DBG_ERROR( "nSubTotals==0 bei DoSubTotals" );
- }
}
// now insert the formulas
@@ -948,8 +1096,8 @@ sal_Bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
if ( !pCell || i > 0 )
pCell = GetCell( static_cast<SCCOL>(rEntry.nField), nRow );
- sal_Bool bOk = sal_False;
- sal_Bool bTestEqual = sal_False;
+ sal_Bool bOk = false;
+ sal_Bool bTestEqual = false;
if ( pSpecial && pSpecial[i] )
{
@@ -1051,7 +1199,7 @@ sal_Bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
if( rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN
|| rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH
|| rEntry.eOp == SC_DOES_NOT_BEGIN_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH )
- bMatchWholeCell = sal_False;
+ bMatchWholeCell = false;
if ( pCell )
{
if (pCell->GetCellType() != CELLTYPE_NOTE)
@@ -1077,7 +1225,7 @@ sal_Bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
xub_StrLen nEnd = aCellStr.Len();
// from 614 on, nEnd is behind the found text
- sal_Bool bMatch = sal_False;
+ sal_Bool bMatch = false;
if ( rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH )
{
nEnd = 0;
@@ -1092,7 +1240,7 @@ sal_Bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
}
if ( bMatch && bMatchWholeCell
&& (nStart != 0 || nEnd != aCellStr.Len()) )
- bMatch = sal_False; // RegExp must match entire cell string
+ bMatch = false; // RegExp must match entire cell string
if ( bRealRegExp )
switch (rEntry.eOp)
{
@@ -1136,7 +1284,7 @@ sal_Bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
// #i18374# When used from functions (match, countif, sumif, vlookup, hlookup, lookup),
// the query value is assigned directly, and the string is empty. In that case,
// don't find any string (isEqual would find empty string results in formula cells).
- bOk = sal_False;
+ bOk = false;
if ( rEntry.eOp == SC_NOT_EQUAL )
bOk = !bOk;
}
@@ -1276,7 +1424,7 @@ sal_Bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
void ScTable::TopTenQuery( ScQueryParam& rParam )
{
- sal_Bool bSortCollatorInitialized = sal_False;
+ sal_Bool bSortCollatorInitialized = false;
SCSIZE nEntryCount = rParam.GetEntryCount();
SCROW nRow1 = (rParam.bHasHeader ? rParam.nRow1 + 1 : rParam.nRow1);
SCSIZE nCount = static_cast<SCSIZE>(rParam.nRow2 - nRow1 + 1);
@@ -1314,7 +1462,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam )
{
if ( rEntry.bQueryByString )
{ // dat wird nix
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = 10; // 10 bzw. 10%
}
SCSIZE nVal = (rEntry.nVal >= 1 ? static_cast<SCSIZE>(rEntry.nVal) : 1);
@@ -1380,7 +1528,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam )
else
{
rEntry.eOp = SC_GREATER_EQUAL;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = 0;
}
delete pArray;
@@ -1403,7 +1551,7 @@ static void lcl_PrepareQuery( ScDocument* pDoc, ScTable* pTab, ScQueryParam& rPa
for ( SCSIZE i = 0; i < nEntryCount; ++i )
{
- pSpecial[i] = sal_False;
+ pSpecial[i] = false;
ScQueryEntry& rEntry = rParam.GetEntry(i);
if ( rEntry.bDoQuery )
{
@@ -1432,7 +1580,7 @@ static void lcl_PrepareQuery( ScDocument* pDoc, ScTable* pTab, ScQueryParam& rPa
}
else
{
- // #58736# call from UNO or second call from autofilter
+ // call from UNO or second call from autofilter
if ( rEntry.nVal == SC_EMPTYFIELDS || rEntry.nVal == SC_NONEMPTYFIELDS )
{
pSpecial[i] = sal_True;
@@ -1470,7 +1618,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, sal_Bool bKeepSub)
ScStrCollection aScStrCollection;
StrData* pStrData = NULL;
- sal_Bool bStarted = sal_False;
+ sal_Bool bStarted = false;
sal_Bool bOldResult = sal_True;
SCROW nOldStart = 0;
SCROW nOldEnd = 0;
@@ -1491,15 +1639,12 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, sal_Bool bKeepSub)
aParam.nDestCol, aParam.nDestRow, aParam.nDestTab );
}
- if (aParam.bInplace)
- IncRecalcLevel(); // #i116164# once for all entries
- // #i116164# If there are no drawing objects within the area, call SetRowHidden/SetRowFiltered for all rows at the end
- std::vector<ScShowRowsEntry> aEntries;
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
- bool bHasObjects = pDrawLayer && pDrawLayer->HasObjectsInRows( nTab, aParam.nRow1 + nHeader, aParam.nRow2, false );
+ if (aParam.bInplace)
+ InitializeNoteCaptions();
- for (SCROW j=aParam.nRow1 + nHeader; j<=aParam.nRow2; j++)
+ SCROW nRealRow2 = aParam.bUseDynamicRange ? aParam.nDynamicEndRow : aParam.nRow2;
+ for (SCROW j = aParam.nRow1 + nHeader; j <= nRealRow2; ++j)
{
sal_Bool bResult; // Filterergebnis
sal_Bool bValid = ValidQuery(j, aParam, pSpecial);
@@ -1540,12 +1685,12 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, sal_Bool bKeepSub)
else
{
delete pStrData;
- bResult = sal_False;
+ bResult = false;
}
}
}
else
- bResult = sal_False;
+ bResult = false;
if (aParam.bInplace)
{
@@ -1554,11 +1699,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, sal_Bool bKeepSub)
else
{
if (bStarted)
- {
- DBShowRows(nOldStart,nOldEnd, bOldResult, bHasObjects);
- if (!bHasObjects)
- aEntries.push_back(ScShowRowsEntry(nOldStart, nOldEnd, bOldResult));
- }
+ DBShowRows(nOldStart,nOldEnd, bOldResult);
nOldStart = nOldEnd = j;
bOldResult = bResult;
}
@@ -1577,61 +1718,12 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, sal_Bool bKeepSub)
}
if (aParam.bInplace && bStarted)
- {
- DBShowRows(nOldStart,nOldEnd, bOldResult, bHasObjects);
- if (!bHasObjects)
- aEntries.push_back(ScShowRowsEntry(nOldStart, nOldEnd, bOldResult));
- }
-
- // #i116164# execute the collected SetRowHidden/SetRowFiltered calls
- if (!bHasObjects)
- {
- std::vector<ScShowRowsEntry>::const_iterator aEnd = aEntries.end();
- std::vector<ScShowRowsEntry>::const_iterator aIter = aEntries.begin();
- if ( aIter != aEnd )
- {
- // do only one HeightChanged call with the final difference in heights
- long nOldHeight = 0;
- if ( pDrawLayer )
- nOldHeight = static_cast<long>(GetRowHeight(aParam.nRow1 + nHeader, aParam.nRow2));
-
- // clear the range first instead of many changes in the middle of the filled array
- SetRowHidden(aParam.nRow1 + nHeader, aParam.nRow2, false);
- SetRowFiltered(aParam.nRow1 + nHeader, aParam.nRow2, false);
-
- // insert from back, in case the filter range is large
- mpHiddenRows->setInsertFromBack(true);
- mpFilteredRows->setInsertFromBack(true);
-
- while (aIter != aEnd)
- {
- if (!aIter->mbShow)
- {
- SCROW nStartRow = aIter->mnRow1;
- SCROW nEndRow = aIter->mnRow2;
- SetRowHidden(nStartRow, nEndRow, true);
- SetRowFiltered(nStartRow, nEndRow, true);
- }
- ++aIter;
- }
-
- mpHiddenRows->setInsertFromBack(false);
- mpFilteredRows->setInsertFromBack(false);
-
- if ( pDrawLayer )
- {
- // if there are no objects in the filtered range, a single HeightChanged call is enough
- long nNewHeight = static_cast<long>(GetRowHeight(aParam.nRow1 + nHeader, aParam.nRow2));
- pDrawLayer->HeightChanged( nTab, aParam.nRow1 + nHeader, nNewHeight - nOldHeight );
- }
- }
- }
+ DBShowRows(nOldStart,nOldEnd, bOldResult);
if (aParam.bInplace)
- DecRecalcLevel();
+ SetDrawPageSize();
delete[] pSpecial;
-
return nCount;
}
@@ -1650,7 +1742,7 @@ sal_Bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
{
String aQueryStr;
GetUpperCellString(nCol, nRow1, aQueryStr);
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL i = rQueryParam.nCol1;
while (!bFound && (i <= nDBCol2))
{
@@ -1664,7 +1756,7 @@ sal_Bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
if (bFound)
pFields[nCol - nCol1] = i;
else
- bValid = sal_False;
+ bValid = false;
nCol++;
}
if (bValid)
@@ -1675,7 +1767,7 @@ sal_Bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
if ( nVisible > SCSIZE_MAX / sizeof(void*) )
{
- DBG_ERROR("zu viele Filterkritierien");
+ OSL_FAIL("zu viele Filterkritierien");
nVisible = 0;
}
@@ -1702,7 +1794,7 @@ sal_Bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
rQueryParam.GetEntry(nIndex).eConnect = SC_AND;
}
else
- bValid = sal_False;
+ bValid = false;
}
nCol++;
}
@@ -1726,7 +1818,7 @@ sal_Bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
// range wasn't sufficiently specified data changes wouldn't flag formula
// cells for recalculation.
if (nCol2 - nCol1 < 3)
- return sal_False;
+ return false;
sal_Bool bValid;
sal_Bool bFound;
@@ -1745,7 +1837,7 @@ sal_Bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
{
ScQueryEntry& rEntry = rQueryParam.GetEntry(nIndex);
- bValid = sal_False;
+ bValid = false;
// Erste Spalte UND/ODER
if (nIndex > 0)
{
@@ -1764,7 +1856,7 @@ sal_Bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
// Zweite Spalte FeldName
if ((nIndex < 1) || bValid)
{
- bFound = sal_False;
+ bFound = false;
GetUpperCellString(nCol1 + 1, nRow, aCellStr);
for (SCCOL i=rQueryParam.nCol1; (i <= nDBCol2) && (!bFound); i++)
{
@@ -1780,13 +1872,13 @@ sal_Bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
bValid = sal_True;
}
else
- bValid = sal_False;
+ bValid = false;
}
}
// Dritte Spalte Operator =<>...
if (bValid)
{
- bFound = sal_False;
+ bFound = false;
GetUpperCellString(nCol1 + 2, nRow, aCellStr);
if (aCellStr.GetChar(0) == '<')
{
@@ -1859,7 +1951,7 @@ sal_Bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol,
{
CellType eType = GetCellType( nCol, nStartRow );
if (eType != CELLTYPE_STRING && eType != CELLTYPE_EDIT)
- return sal_False;
+ return false;
}
return sal_True;
}
@@ -1870,7 +1962,7 @@ sal_Bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndC
{
CellType eType = GetCellType( nStartCol, nRow );
if (eType != CELLTYPE_STRING && eType != CELLTYPE_EDIT)
- return sal_False;
+ return false;
}
return sal_True;
}
@@ -2017,6 +2109,16 @@ void ScTable::FindConditionalFormat( sal_uLong nKey, ScRangeList& rList )
}
}
+void ScTable::IncRecalcLevel()
+{
+ ++nRecalcLvl;
+}
+void ScTable::DecRecalcLevel(bool bUpdateNoteCaptionPos)
+{
+ if (!--nRecalcLvl)
+ SetDrawPageSize(true, bUpdateNoteCaptionPos);
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 5c7c872f6c64..e7ba2153a3f1 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,7 +114,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDi
if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || !CharClass::isAsciiNumeric(cLast) ) )
{ // number at the beginning
nVal = aValue.Copy( 0, nNum ).ToInt32();
- // #60893# any number with a leading zero sets the minimum number of digits
+ // any number with a leading zero sets the minimum number of digits
if ( p[nNeg] == '0' && pMinDigits && ( nNum - nNeg > *pMinDigits ) )
*pMinDigits = nNum - nNeg;
aValue.Erase( 0, nNum );
@@ -133,7 +134,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDi
if ( nNum < nEnd - nNeg )
{ // number at the end
nVal = aValue.Copy( nNum + 1 ).ToInt32();
- // #60893# any number with a leading zero sets the minimum number of digits
+ // any number with a leading zero sets the minimum number of digits
if ( p[nNum+1+nNeg] == '0' && pMinDigits && ( nEnd - nNum - nNeg > *pMinDigits ) )
*pMinDigits = nEnd - nNum - nNeg;
aValue.Erase( nNum + 1 );
@@ -231,7 +232,6 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
if (nCount > 1)
{
- long nCmpInc = 0;
double nVal;
Date aNullDate = *pDocument->GetFormatTable()->GetNullDate();
Date aDate1 = aNullDate;
@@ -242,6 +242,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
aDate2 += (long)nVal;
if ( aDate1 != aDate2 )
{
+ long nCmpInc = 0;
FillDateCmd eType;
long nDDiff = aDate2.GetDay() - (long) aDate1.GetDay();
long nMDiff = aDate2.GetMonth() - (long) aDate1.GetMonth();
@@ -270,7 +271,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if ( eType == FILL_DAY )
{
if ( aDate2-aDate1 != nCmpInc )
- bVal = sal_False;
+ bVal = false;
}
else
{
@@ -278,14 +279,14 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nMDiff = aDate2.GetMonth() - (long) aDate1.GetMonth();
nYDiff = aDate2.GetYear() - (long) aDate1.GetYear();
if (nDDiff || ( nMDiff + 12 * nYDiff != nCmpInc ))
- bVal = sal_False;
+ bVal = false;
}
aDate1 = aDate2;
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
}
else
- bVal = sal_False; // #50965# kein Datum passt auch nicht
+ bVal = false; // kein Datum passt auch nicht
}
if (bVal)
{
@@ -325,11 +326,11 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nVal2 = ((ScValueCell*)pCell)->GetValue();
double nDiff = nVal2 - nVal1;
if ( !::rtl::math::approxEqual( nDiff, rInc ) )
- bVal = sal_False;
+ bVal = false;
nVal1 = nVal2;
}
else
- bVal = sal_False;
+ bVal = false;
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
}
@@ -390,14 +391,14 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
double nDiff = (double)nVal2 - (double)nVal1;
if ( !::rtl::math::approxEqual( nDiff, rInc ) )
- bVal = sal_False;
+ bVal = false;
nVal1 = nVal2;
}
else
- bVal = sal_False;
+ bVal = false;
}
else
- bVal = sal_False;
+ bVal = false;
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
}
@@ -418,88 +419,45 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
void ScTable::FillFormula(sal_uLong& /* nFormulaCounter */, sal_Bool /* bFirst */, ScFormulaCell* pSrcCell,
SCCOL nDestCol, SCROW nDestRow, sal_Bool bLast )
{
-/* sal_uInt16 nTokArrLen = pSrcCell->GetTokenArrayLen();
- if ( nTokArrLen > 15 ) // mehr als =A1 oder =67
+
+ pDocument->SetNoListening( true ); // noch falsche Referenzen
+ ScAddress aAddr( nDestCol, nDestRow, nTab );
+ ScFormulaCell* pDestCell = new ScFormulaCell( *pSrcCell, *pDocument, aAddr );
+ aCol[nDestCol].Insert(nDestRow, pDestCell);
+
+ if ( bLast && pDestCell->GetMatrixFlag() )
{
- ScRangeName* pRangeName = pDocument->GetRangeName();
- String aName("___SC_"); // Wird dieser String veraendert,
- // auch in document2 EraseNonUsed...
- // mitaendern!!
- aName += pRangeName->GetSharedMaxIndex() + 1;
- aName += '_';
- aName += nFormulaCounter;
- nFormulaCounter++;
- if (bFirst)
- {
- ScRangeData *pAktRange = new ScRangeData(
- pDocument, aName, pSrcCell->GetTokenArray(), nTokArrLen,
- pSrcCell->GetCol(), pSrcCell->GetRow(), nTab ,RT_SHARED);
- if (!pRangeName->Insert( pAktRange ))
- delete pAktRange;
- else
- bSharedNameInserted = sal_True;
- }
- sal_uInt16 nIndex;
- pRangeName->SearchName(aName, nIndex);
- if (!pRangeName)
- {
- DBG_ERROR("ScTable::FillFormula: Falscher Name");
- return;
- }
- nIndex = ((ScRangeData*) ((*pRangeName)[nIndex]))->GetIndex();
- ScTokenArray aArr;
- aArr.AddName(nIndex);
- aArr.AddOpCode(ocStop);
- ScFormulaCell* pDestCell = new ScFormulaCell
- (pDocument, ScAddress( nDestCol, nDestRow, nTab ), aArr );
- aCol[nDestCol].Insert(nDestRow, pDestCell);
- }
- else
-*/ {
- pDocument->SetNoListening( sal_True ); // noch falsche Referenzen
- ScAddress aAddr( nDestCol, nDestRow, nTab );
- ScFormulaCell* pDestCell = new ScFormulaCell( *pSrcCell, *pDocument, aAddr );
- aCol[nDestCol].Insert(nDestRow, pDestCell);
-#if 0
-// mit RelRefs unnoetig
- pDestCell->UpdateReference(URM_COPY,
- ScRange( aAddr, aAddr ),
- nDestCol - pSrcCell->aPos.Col(),
- nDestRow - pSrcCell->aPos.Row(), 0);
-#endif
- if ( bLast && pDestCell->GetMatrixFlag() )
+ ScAddress aOrg;
+ if ( pDestCell->GetMatrixOrigin( aOrg ) )
{
- ScAddress aOrg;
- if ( pDestCell->GetMatrixOrigin( aOrg ) )
+ if ( nDestCol >= aOrg.Col() && nDestRow >= aOrg.Row() )
{
- if ( nDestCol >= aOrg.Col() && nDestRow >= aOrg.Row() )
+ ScBaseCell* pOrgCell = pDocument->GetCell( aOrg );
+ if ( pOrgCell && pOrgCell->GetCellType() == CELLTYPE_FORMULA
+ && ((ScFormulaCell*)pOrgCell)->GetMatrixFlag() == MM_FORMULA )
{
- ScBaseCell* pOrgCell = pDocument->GetCell( aOrg );
- if ( pOrgCell && pOrgCell->GetCellType() == CELLTYPE_FORMULA
- && ((ScFormulaCell*)pOrgCell)->GetMatrixFlag() == MM_FORMULA )
- {
- ((ScFormulaCell*)pOrgCell)->SetMatColsRows(
- nDestCol - aOrg.Col() + 1,
- nDestRow - aOrg.Row() + 1 );
- }
- else
- {
- DBG_ERRORFILE( "FillFormula: MatrixOrigin keine Formelzelle mit MM_FORMULA" );
- }
+ ((ScFormulaCell*)pOrgCell)->SetMatColsRows(
+ nDestCol - aOrg.Col() + 1,
+ nDestRow - aOrg.Row() + 1 );
}
else
{
- DBG_ERRORFILE( "FillFormula: MatrixOrigin rechts unten" );
+ DBG_ERRORFILE( "FillFormula: MatrixOrigin keine Formelzelle mit MM_FORMULA" );
}
}
else
{
- DBG_ERRORFILE( "FillFormula: kein MatrixOrigin" );
+ DBG_ERRORFILE( "FillFormula: MatrixOrigin rechts unten" );
}
}
- pDocument->SetNoListening( sal_False );
- pDestCell->StartListeningTo( pDocument );
+ else
+ {
+ DBG_ERRORFILE( "FillFormula: kein MatrixOrigin" );
+ }
}
+ pDocument->SetNoListening( false );
+ pDestCell->StartListeningTo( pDocument );
+
}
void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
@@ -601,12 +559,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
pSrcPattern = aCol[nCol].GetPattern(static_cast<SCROW>(nAtSrc));
else // rInner&:=nCol, rOuter&:=nRow
pSrcPattern = aCol[nAtSrc].GetPattern(static_cast<SCROW>(nRow));
- bGetPattern = sal_False;
+ bGetPattern = false;
pStyleSheet = pSrcPattern->GetStyleSheet();
// Merge/Mergeflag nicht uebernehmen,
const SfxItemSet& rSet = pSrcPattern->GetItemSet();
- if ( rSet.GetItemState(ATTR_MERGE, sal_False) == SFX_ITEM_SET
- || rSet.GetItemState(ATTR_MERGE_FLAG, sal_False) == SFX_ITEM_SET )
+ if ( rSet.GetItemState(ATTR_MERGE, false) == SFX_ITEM_SET
+ || rSet.GetItemState(ATTR_MERGE_FLAG, false) == SFX_ITEM_SET )
{
pNewPattern = new ScPatternAttr( *pSrcPattern );
SfxItemSet& rNewSet = pNewPattern->GetItemSet();
@@ -749,7 +707,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
String aValue;
ScBaseCell* pSrcCell = NULL;
CellType eCellType = CELLTYPE_NONE;
- sal_Bool bIsOrdinalSuffix = sal_False;
+ sal_Bool bIsOrdinalSuffix = false;
rInner = nIStart;
while (true) // #i53728# with "for (;;)" old solaris/x86 compiler mis-optimizes
@@ -760,7 +718,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
pSrcCell = aCol[nCol].GetCell( static_cast<SCROW>(nSource) );
else // rInner&:=nCol, rOuter&:=nRow
pSrcCell = aCol[nSource].GetCell( static_cast<SCROW>(nRow) );
- bGetCell = sal_False;
+ bGetCell = false;
if ( pSrcCell )
{
eCellType = pSrcCell->GetCellType();
@@ -869,7 +827,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nDelta -= 1.0;
}
nFormulaCounter = nActFormCnt;
- bFirst = sal_False;
+ bFirst = false;
}
else if (bPositive)
{
@@ -902,12 +860,12 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if (bVertical)
FillSeries( static_cast<SCCOL>(nCol), nRow1,
static_cast<SCCOL>(nCol), nRow2, nFillCount, eFillDir,
- eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, sal_False,
+ eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, false,
rProgress );
else
FillSeries( nCol1, static_cast<SCROW>(nRow), nCol2,
static_cast<SCROW>(nRow), nFillCount, eFillDir,
- eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, sal_False,
+ eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits, false,
rProgress );
nProgress = rProgress.GetState();
}
@@ -929,7 +887,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n
sal_uLong nSrcCount = 0;
FillDir eFillDir = FILL_TO_BOTTOM;
if ( nEndX == nCol2 && nEndY == nRow2 ) // leer
- bOk = sal_False;
+ bOk = false;
else if ( nEndX == nCol2 ) // nach oben/unten
{
nEndX = nCol2 = nCol1; // nur erste Spalte ansehen
@@ -951,7 +909,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n
eFillDir = FILL_TO_LEFT;
}
else // Richtung nicht eindeutig
- bOk = sal_False;
+ bOk = false;
if ( bOk )
{
@@ -1129,7 +1087,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n
}
else
{
- DBG_ERROR("GetAutoFillPreview: falscher Modus");
+ OSL_FAIL("GetAutoFillPreview: falscher Modus");
}
}
@@ -1345,10 +1303,12 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
for (rInner = nIMin; rInner <= nIMax; rInner++)
{
+ if (pDocument->RowFiltered( rInner, nTab))
+ continue;
sal_uLong nInd = nActFormCnt;
FillFormula(nInd, bFirst, (ScFormulaCell*)pSrcCell,
static_cast<SCCOL>(nCol), nRow, (rInner == nIEnd) );
- bFirst = sal_False;
+ bFirst = false;
rProgress.SetStateOnPercent( ++nProgress );
}
}
@@ -1356,6 +1316,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
for (rInner = nIMin; rInner <= nIMax; rInner++)
{
+ if (pDocument->RowFiltered( rInner, nTab))
+ continue;
ScAddress aDestPos( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), nTab );
aCol[nCol].Insert( aDestPos.Row(), pSrcCell->CloneWithoutNote( *pDocument ) );
}
@@ -1373,8 +1335,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
double nVal = nStartVal;
long nIndex = 0;
- sal_Bool bError = sal_False;
- sal_Bool bOverflow = sal_False;
+ sal_Bool bError = false;
+ sal_Bool bOverflow = false;
sal_uInt16 nDayOfMonth = 0;
rInner = nIStart;
@@ -1386,7 +1348,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
case FILL_LINEAR:
{
- // #86365# use multiplication instead of repeated addition
+ // use multiplication instead of repeated addition
// to avoid accumulating rounding errors
nVal = nStartVal;
double nAdd = nStepValue;
@@ -1465,8 +1427,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
double nStartVal = (double)nStringValue;
double nVal = nStartVal;
long nIndex = 0;
- sal_Bool bError = sal_False;
- sal_Bool bOverflow = sal_False;
+ sal_Bool bError = false;
+ sal_Bool bOverflow = false;
sal_Bool bIsOrdinalSuffix = aValue.Equals( ScGlobal::GetOrdinalSuffix(
(sal_Int32)nStartVal));
@@ -1480,7 +1442,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
case FILL_LINEAR:
{
- // #86365# use multiplication instead of repeated addition
+ // use multiplication instead of repeated addition
// to avoid accumulating rounding errors
nVal = nStartVal;
double nAdd = nStepValue;
@@ -1569,7 +1531,7 @@ void ScTable::Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
ScProgress aProgress( pDocument->GetDocumentShell(),
ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount );
- bSharedNameInserted = sal_False;
+ bSharedNameInserted = false;
if (eFillCmd == FILL_AUTO)
FillAuto(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, aProgress);
@@ -1592,8 +1554,6 @@ void ScTable::AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
ScAutoFormatData* pData = (*pAutoFormat)[nFormatNo];
if (pData)
{
-// ScPatternAttr aPattern(pDocument->GetPool());
-// pData->FillToItemSet(nIndex, aPattern.GetItemSet(), *pDocument);
ApplyPatternArea(nStartCol, nStartRow, nEndCol, nEndRow, rAttr);
}
}
@@ -1898,14 +1858,6 @@ void ScTable::UpdateInsertTabAbs(SCTAB nTable)
aCol[i].UpdateInsertTabAbs(nTable);
}
-//UNUSED2008-05 sal_uInt16 ScTable::GetErrorData( SCCOL nCol, SCROW nRow ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 if (ValidColRow(nCol,nRow))
-//UNUSED2008-05 return aCol[nCol].GetErrorData( nRow );
-//UNUSED2008-05 else
-//UNUSED2008-05 return 0;
-//UNUSED2008-05 }
-
sal_Bool ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, sal_Bool bInSel,
const ScMarkData& rMark) const
{
@@ -1927,7 +1879,7 @@ sal_Bool ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, sal_Bool bInSel,
return sal_True;
else
{
- sal_Bool bStop = sal_False;
+ sal_Bool bStop = false;
while (!bStop)
{
if (ValidCol(rCol))
@@ -1945,7 +1897,7 @@ sal_Bool ScTable::GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, sal_Bool bInSel,
return sal_True;
}
}
- return sal_False;
+ return false;
}
void ScTable::RemoveAutoSpellObj()
@@ -1956,7 +1908,7 @@ void ScTable::RemoveAutoSpellObj()
sal_Bool ScTable::TestTabRefAbs(SCTAB nTable)
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
for (SCCOL i=0; i <= MAXCOL; i++)
if (aCol[i].TestTabRefAbs(nTable))
bRet = sal_True;
@@ -1988,3 +1940,4 @@ void ScTable::CompileColRowNameFormula()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 0548e3ce0abd..d11e38cd2472 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
Find( aPageStyle, SFX_STYLE_FAMILY_PAGE );
if ( !pStyle )
{
- DBG_ERROR("UpdatePageBreaks: Style nicht gefunden");
+ OSL_FAIL("UpdatePageBreaks: Style nicht gefunden");
return;
}
SfxItemSet* pStyleSet = &pStyle->GetItemSet();
@@ -135,14 +136,15 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
bool bSkipColBreaks = false;
bool bSkipRowBreaks = false;
+ bool bSkipBreaks = false;
- if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, sal_False, &pItem ) == SFX_ITEM_SET )
+ if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, false, &pItem ) == SFX_ITEM_SET )
{
DBG_ASSERT( pItem->ISA(SfxUInt16Item), "falsches Item" );
bSkipColBreaks = bSkipRowBreaks = ( ((const SfxUInt16Item*)pItem)->GetValue() > 0 );
}
- if ( !bSkipColBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( !bSkipColBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, false, &pItem) == SFX_ITEM_SET )
{
// #i54993# when fitting to width or height, ignore only manual breaks in that direction
const ScPageScaleToItem* pScaleToItem = static_cast<const ScPageScaleToItem*>(pItem);
@@ -152,6 +154,15 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
bSkipRowBreaks = true;
}
+ if (!bSkipBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, false, &pItem) == SFX_ITEM_SET)
+ {
+ const ScPageScaleToItem& rScaleToItem = static_cast<const ScPageScaleToItem&>(
+ pStyleSet->Get(ATTR_PAGE_SCALETO));
+ if (rScaleToItem.GetWidth() > 0 || rScaleToItem.GetHeight() > 0)
+ // when fitting to a fixed width x height, ignore manual breaks.
+ bSkipBreaks = true;
+ }
+
//--------------------------------------------------------------------------
long nPageSizeX = aPageSizeTwips.Width();
@@ -171,11 +182,11 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
// Mittelteil: Breaks verteilen
sal_Bool bRepeatCol = ( nRepeatStartX != SCCOL_REPEAT_NONE );
- sal_Bool bColFound = sal_False;
+ sal_Bool bColFound = false;
long nSizeX = 0;
for (nX=nStartCol; nX<=nEndCol; nX++)
{
- sal_Bool bStartOfPage = sal_False;
+ sal_Bool bStartOfPage = false;
long nThisX = ColHidden(nX) ? 0 : pColWidth[nX];
bool bManualBreak = HasColManualBreak(nX);
if ( (nSizeX+nThisX > nPageSizeX) || (bManualBreak && !bSkipColBreaks) )
@@ -207,14 +218,14 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
// And set new page breaks.
sal_Bool bRepeatRow = ( nRepeatStartY != SCROW_REPEAT_NONE );
- sal_Bool bRowFound = sal_False;
+ sal_Bool bRowFound = false;
long nSizeY = 0;
ScFlatBoolRowSegments::ForwardIterator aIterHidden(*mpHiddenRows);
ScFlatUInt16RowSegments::ForwardIterator aIterHeights(*mpRowHeights);
SCROW nNextManualBreak = GetNextManualBreak(nStartRow); // -1 => no more manual breaks
for (SCROW nY = nStartRow; nY <= nEndRow; ++nY)
{
- sal_Bool bStartOfPage = sal_False;
+ sal_Bool bStartOfPage = false;
bool bThisRowHidden = false;
aIterHidden.getValue(nY, bThisRowHidden);
long nThisY = 0;
@@ -318,7 +329,7 @@ void ScTable::RemoveManualBreaks()
InvalidatePageBreaks();
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
sal_Bool ScTable::HasManualBreaks() const
@@ -331,7 +342,7 @@ void ScTable::SetRowManualBreaks( const ::std::set<SCROW>& rBreaks )
maRowManualBreaks = rBreaks;
InvalidatePageBreaks();
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
void ScTable::SetColManualBreaks( const ::std::set<SCCOL>& rBreaks )
@@ -339,7 +350,7 @@ void ScTable::SetColManualBreaks( const ::std::set<SCCOL>& rBreaks )
maColManualBreaks = rBreaks;
InvalidatePageBreaks();
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
void ScTable::GetAllRowBreaks(set<SCROW>& rBreaks, bool bPage, bool bManual) const
@@ -529,19 +540,33 @@ bool ScTable::RowHidden(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const
return aData.mbValue;
}
-
-bool ScTable::RowHidden(SCROW nRow, SCROW& rLastRow) const
+bool ScTable::RowHiddenLeaf(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const
{
- rLastRow = nRow;
if (!ValidRow(nRow))
+ {
+ if (pFirstRow)
+ *pFirstRow = nRow;
+ if (pLastRow)
+ *pLastRow = nRow;
return true;
+ }
ScFlatBoolRowSegments::RangeData aData;
- if (!mpHiddenRows->getRangeData(nRow, aData))
+ if (!mpHiddenRows->getRangeDataLeaf(nRow, aData))
+ {
// search failed.
+ if (pFirstRow)
+ *pFirstRow = nRow;
+ if (pLastRow)
+ *pLastRow = nRow;
return true;
+ }
+
+ if (pFirstRow)
+ *pFirstRow = aData.mnRow1;
+ if (pLastRow)
+ *pLastRow = aData.mnRow2;
- rLastRow = aData.mnRow2;
return aData.mbValue;
}
@@ -551,7 +576,7 @@ bool ScTable::HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const
while (nRow <= nEndRow)
{
SCROW nLastRow = -1;
- bool bHidden = RowHidden(nRow, nLastRow);
+ bool bHidden = RowHidden(nRow, NULL, &nLastRow);
if (bHidden)
return true;
@@ -560,20 +585,6 @@ bool ScTable::HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const
return false;
}
-bool ScTable::ColHidden(SCCOL nCol, SCCOL& rLastCol) const
-{
- rLastCol = nCol;
- if (!ValidCol(nCol))
- return true;
-
- ScFlatBoolColSegments::RangeData aData;
- if (!mpHiddenCols->getRangeData(nCol, aData))
- return true;
-
- rLastCol = aData.mnCol2;
- return aData.mbValue;
-}
-
bool ScTable::ColHidden(SCCOL nCol, SCCOL* pFirstCol, SCCOL* pLastCol) const
{
if (!ValidCol(nCol))
@@ -591,20 +602,38 @@ bool ScTable::ColHidden(SCCOL nCol, SCCOL* pFirstCol, SCCOL* pLastCol) const
return aData.mbValue;
}
-void ScTable::SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden)
+bool ScTable::SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden)
{
+ bool bChanged = false;
if (bHidden)
- mpHiddenRows->setTrue(nStartRow, nEndRow);
+ bChanged = mpHiddenRows->setTrue(nStartRow, nEndRow);
else
- mpHiddenRows->setFalse(nStartRow, nEndRow);
+ bChanged = mpHiddenRows->setFalse(nStartRow, nEndRow);
+
+ if (bChanged)
+ {
+ if (IsStreamValid())
+ SetStreamValid(false);
+ }
+
+ return bChanged;
}
-void ScTable::SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden)
+bool ScTable::SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden)
{
+ bool bChanged = false;
if (bHidden)
- mpHiddenCols->setTrue(nStartCol, nEndCol);
+ bChanged = mpHiddenCols->setTrue(nStartCol, nEndCol);
else
- mpHiddenCols->setFalse(nStartCol, nEndCol);
+ bChanged = mpHiddenCols->setFalse(nStartCol, nEndCol);
+
+ if (bChanged)
+ {
+ if (IsStreamValid())
+ SetStreamValid(false);
+ }
+
+ return bChanged;
}
void ScTable::CopyColHidden(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol)
@@ -628,7 +657,7 @@ void ScTable::CopyRowHidden(ScTable& rTable, SCROW nStartRow, SCROW nEndRow)
while (nRow <= nEndRow)
{
SCROW nLastRow = -1;
- bool bHidden = rTable.RowHidden(nRow, nLastRow);
+ bool bHidden = rTable.RowHidden(nRow, NULL, &nLastRow);
if (nLastRow > nEndRow)
nLastRow = nEndRow;
SetRowHidden(nRow, nLastRow, bHidden);
@@ -1022,7 +1051,7 @@ void ScTable::SetPageSize( const Size& rSize )
aPageSizeTwips = rSize;
}
else
- bPageSizeValid = sal_False;
+ bPageSizeValid = false;
}
sal_Bool ScTable::IsProtected() const
@@ -1038,7 +1067,7 @@ void ScTable::SetProtection(const ScTableProtection* pProtect)
pTabProtection.reset(NULL);
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
ScTableProtection* ScTable::GetProtection()
@@ -1100,14 +1129,14 @@ void ScTable::SetPageStyle( const String& rName )
const sal_uInt16 nNewScaleToPages = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALETOPAGES);
if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) )
- InvalidateTextWidth(NULL, NULL, sal_False, sal_False);
+ InvalidateTextWidth(NULL, NULL, false, false);
}
if ( pNewStyle ) // auch ohne den alten (fuer UpdateStdNames)
aPageStyle = aStrNew;
if (IsStreamValid())
- SetStreamValid(sal_False);
+ SetStreamValid(false);
}
}
}
@@ -1115,7 +1144,7 @@ void ScTable::SetPageStyle( const String& rName )
void ScTable::PageStyleModified( const String& rNewName )
{
aPageStyle = rNewName;
- InvalidateTextWidth(NULL, NULL, sal_False, sal_False); // don't know what was in the style before
+ InvalidateTextWidth(NULL, NULL, false, false); // don't know what was in the style before
}
void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
@@ -1193,3 +1222,4 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 41f73d3d5cf0..20ad1ca1b007 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,8 @@
//--------------------------------------------------------------------------
+using ::com::sun::star::util::SearchOptions;
+
sal_Bool lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& rVal )
{
// sal_True = more than 1 paragraph
@@ -64,7 +67,7 @@ sal_Bool lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, Strin
sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRow,
const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc)
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_Bool bDoSearch = sal_True;
sal_Bool bDoBack = rSearchItem.GetBackward();
@@ -74,7 +77,7 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
bDoSearch = rMark.IsCellMarked(nCol, nRow);
if ( bDoSearch && ((pCell = aCol[nCol].GetCell( nRow )) != NULL) )
{
- sal_Bool bMultiLine = sal_False;
+ sal_Bool bMultiLine = false;
CellType eCellType = pCell->GetCellType();
switch (rSearchItem.GetCellType())
{
@@ -133,7 +136,7 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
}
else
{
- DBG_ERROR("pSearchText == NULL");
+ OSL_FAIL("pSearchText == NULL");
return bFound;
}
@@ -141,7 +144,7 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
if ( bFound &&
( (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE)
||(rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL) ) &&
- // #60558# Matrix nicht zerreissen, nur Matrixformel ersetzen
+ // Matrix nicht zerreissen, nur Matrixformel ersetzen
!( (eCellType == CELLTYPE_FORMULA &&
((cMatrixFlag = ((ScFormulaCell*)pCell)->GetMatrixFlag()) == MM_REFERENCE))
// kein UndoDoc => Matrix nicht wiederherstellbar => nicht ersetzen
@@ -162,7 +165,7 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
// wenn der gefundene Text leer ist, nicht weitersuchen,
// sonst wuerde man nie mehr aufhoeren (#35410#)
if ( nEnd < nStart || nEnd == STRING_MAXLEN )
- bRepeat = sal_False;
+ bRepeat = false;
String sReplStr = rSearchItem.GetReplaceString();
if (rSearchItem.GetRegExp())
@@ -194,7 +197,7 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
if (bRepeat)
{
if ( rSearchItem.GetCommand() != SVX_SEARCHCMD_REPLACE_ALL || nStart >= nEnd )
- bRepeat = sal_False;
+ bRepeat = false;
else if (bDoBack)
{
xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp;
@@ -219,7 +222,7 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
pNote->SetText( ScAddress( nCol, nRow, nTab ), aString );
}
else if ( cMatrixFlag != MM_NONE )
- { // #60558# Matrix nicht zerreissen
+ { // Matrix nicht zerreissen
if ( aString.Len() > 2 )
{ // {} raus, erst hier damit auch "{=" durch "{=..." ersetzt werden kann
if ( aString.GetChar( aString.Len()-1 ) == '}' )
@@ -246,10 +249,46 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
return bFound;
}
+void ScTable::SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bForward)
+{
+ if (bForward)
+ {
+ // forward search
+
+ if (rRow <= rLastNonFilteredRow)
+ return;
+
+ SCROW nLastRow = rRow;
+ if (RowFiltered(rRow, NULL, &nLastRow))
+ // move to the first non-filtered row.
+ rRow = nLastRow + 1;
+ else
+ // record the last non-filtered row to avoid checking
+ // the filtered state for each and every row.
+ rLastNonFilteredRow = nLastRow;
+ }
+ else
+ {
+ // backward search
+
+ if (rRow >= rLastNonFilteredRow)
+ return;
+
+ SCROW nFirstRow = rRow;
+ if (RowFiltered(rRow, &nFirstRow, NULL))
+ // move to the first non-filtered row.
+ rRow = nFirstRow - 1;
+ else
+ // record the last non-filtered row to avoid checking
+ // the filtered state for each and every row.
+ rLastNonFilteredRow = nFirstRow;
+ }
+}
+
sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc)
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_Bool bAll = (rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND_ALL)
||(rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL);
SCCOL nCol = rCol;
@@ -257,8 +296,10 @@ sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& r
SCCOL nLastCol;
SCROW nLastRow;
GetLastDataPos(nLastCol, nLastRow);
+ bool bSkipFiltered = !rSearchItem.IsSearchFiltered();
if (!bAll && rSearchItem.GetBackward())
{
+ SCROW nLastNonFilteredRow = MAXROW + 1;
nCol = Min(nCol, (SCCOL)(nLastCol + 1));
nRow = Min(nRow, (SCROW)(nLastRow + 1));
if (rSearchItem.GetRowDirection())
@@ -266,6 +307,9 @@ sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& r
nCol--;
while (!bFound && ((SCsROW)nRow >= 0))
{
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, false);
+
while (!bFound && ((SCsCOL)nCol >= 0))
{
bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc);
@@ -297,6 +341,9 @@ sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& r
{
while (!bFound && ((SCsROW)nRow >= 0))
{
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, false);
+
bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc);
if (!bFound)
{
@@ -306,8 +353,10 @@ sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& r
}
if (!bFound)
{
+ // Not found in this column. Move to the next column.
sal_Bool bIsEmpty;
nRow = nLastRow;
+ nLastNonFilteredRow = MAXROW + 1;
do
{
nCol--;
@@ -323,11 +372,15 @@ sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& r
}
else
{
+ SCROW nLastNonFilteredRow = -1;
if (!bAll && rSearchItem.GetRowDirection())
{
nCol++;
while (!bFound && (nRow <= nLastRow))
{
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, true);
+
while (!bFound && (nCol <= nLastCol))
{
bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc);
@@ -351,6 +404,9 @@ sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& r
{
while (!bFound && (nRow <= nLastRow))
{
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, true);
+
bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc);
if (!bFound)
{
@@ -360,7 +416,9 @@ sal_Bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& r
}
if (!bFound)
{
+ // Not found in this column. Move to the next column.
nRow = 0;
+ nLastNonFilteredRow = -1;
nCol++;
while ((nCol <= nLastCol) && aCol[nCol].IsEmptyData()) nCol++;
}
@@ -401,7 +459,7 @@ sal_Bool ScTable::SearchAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark,
sal_Bool ScTable::Replace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc)
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nCol = rCol;
SCROW nRow = rRow;
if (rSearchItem.GetBackward())
@@ -465,7 +523,7 @@ sal_Bool ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCR
SCsCOL nCol = rCol;
SCsROW nRow = rRow;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_Bool bSelect = rSearchItem.GetSelection();
sal_Bool bRows = rSearchItem.GetRowDirection();
@@ -554,7 +612,7 @@ sal_Bool ScTable::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SC
ApplyStyle( rCol, rRow, *pReplaceStyle );
else
{
- DBG_ERROR("pReplaceStyle==0");
+ OSL_FAIL("pReplaceStyle==0");
}
}
@@ -618,7 +676,7 @@ sal_Bool ScTable::ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData&
}
else
{
- DBG_ERROR("pReplaceStyle==0");
+ OSL_FAIL("pReplaceStyle==0");
}
}
@@ -630,7 +688,7 @@ sal_Bool ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem,
String& rUndoStr, ScDocument* pUndoDoc)
{
sal_uInt16 nCommand = rSearchItem.GetCommand();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if ( ValidColRow(rCol, rRow) ||
((nCommand == SVX_SEARCHCMD_FIND || nCommand == SVX_SEARCHCMD_REPLACE) &&
(((rCol == MAXCOLCOUNT || rCol == -1) && VALIDROW(rRow)) ||
@@ -645,7 +703,7 @@ sal_Bool ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem,
if (nCommand == SVX_SEARCHCMD_FIND)
bFound = SearchStyle(rSearchItem, rCol, rRow, rMark);
else if (nCommand == SVX_SEARCHCMD_REPLACE)
- bFound = ReplaceStyle(rSearchItem, rCol, rRow, rMark, sal_False);
+ bFound = ReplaceStyle(rSearchItem, rCol, rRow, rMark, false);
else if (nCommand == SVX_SEARCHCMD_FIND_ALL)
bFound = SearchAllStyle(rSearchItem, rMark);
else if (nCommand == SVX_SEARCHCMD_REPLACE_ALL)
@@ -657,7 +715,13 @@ sal_Bool ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem,
com::sun::star::util::SearchOptions aSearchOptions = rSearchItem.GetSearchOptions();
aSearchOptions.Locale = *ScGlobal::GetLocale();
- // #107259# reflect UseAsianOptions flag in SearchOptions
+ if (!aSearchOptions.searchString.getLength())
+ {
+ // Search for empty cells.
+ return SearchAndReplaceEmptyCells(rSearchItem, rCol, rRow, rMark, rUndoStr, pUndoDoc);
+ }
+
+ // reflect UseAsianOptions flag in SearchOptions
// (use only ignore case and width if asian options are disabled).
// This is also done in SvxSearchDialog CommandHdl, but not in API object.
if ( !rSearchItem.IsUseAsianOptions() )
@@ -683,8 +747,307 @@ sal_Bool ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem,
return bFound;
}
+bool ScTable::SearchAndReplaceEmptyCells(
+ const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, ScMarkData& rMark,
+ String& rUndoStr, ScDocument* pUndoDoc)
+{
+ SCCOL nColStart, nColEnd;
+ SCROW nRowStart, nRowEnd;
+ GetFirstDataPos(nColStart, nRowStart);
+ GetLastDataPos(nColEnd, nRowEnd);
+ ScRangeList aRanges;
+ aRanges.Append(ScRange(nColStart, nRowStart, nTab, nColEnd, nRowEnd, nTab));
+ if (rSearchItem.GetSelection())
+ {
+ // current selection only.
+ if (!rMark.IsMarked() && !rMark.IsMultiMarked())
+ // There is no selection. Bail out.
+ return false;
+
+ ScRangeList aMarkedRanges, aNewRanges;
+ rMark.FillRangeListWithMarks(&aMarkedRanges, true);
+ for ( size_t i = 0, n = aMarkedRanges.size(); i < n; ++i )
+ {
+ ScRange* p = aMarkedRanges[ i ];
+ if (p->aStart.Col() > nColEnd || p->aStart.Row() > nRowEnd)
+ // This range is outside the data area. Skip it.
+ continue;
+
+ // Shrink the range into data area only.
+ if (p->aStart.Col() < nColStart)
+ p->aStart.SetCol(rCol);
+ if (p->aStart.Row() < nRowStart)
+ p->aStart.SetRow(rRow);
+
+ if (p->aEnd.Col() > nColEnd)
+ p->aEnd.SetCol(nColEnd);
+ if (p->aEnd.Row() > nRowEnd)
+ p->aEnd.SetRow(nRowEnd);
+
+ aNewRanges.Append(*p);
+ }
+ aRanges = aNewRanges;
+ }
+
+ sal_uInt16 nCommand = rSearchItem.GetCommand();
+ if (nCommand == SVX_SEARCHCMD_FIND || nCommand == SVX_SEARCHCMD_REPLACE)
+ {
+ if (rSearchItem.GetBackward())
+ {
+ for ( size_t i = aRanges.size(); i > 0; --i )
+ {
+ ScRange* p = aRanges[ i - 1 ];
+ if (SearchRangeForEmptyCell( *p, rSearchItem, rCol, rRow, rUndoStr, pUndoDoc))
+ return true;
+ }
+ }
+ else
+ {
+ for ( size_t i = 0, nListSize = aRanges.size(); i < nListSize; ++i )
+ {
+ ScRange* p = aRanges[ i ];
+ if (SearchRangeForEmptyCell( *p, rSearchItem, rCol, rRow, rUndoStr, pUndoDoc ))
+ return true;
+ }
+ }
+ }
+ else if (nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == SVX_SEARCHCMD_REPLACE_ALL)
+ {
+ bool bFound = false;
+ ScMarkData aNewMark(rMark);
+ aNewMark.ResetMark();
+ for ( size_t i = 0, nListSize = aRanges.size(); i < nListSize; ++i )
+ {
+ ScRange* p = aRanges[ i ];
+ bFound |= SearchRangeForAllEmptyCells(*p, rSearchItem, aNewMark, rUndoStr, pUndoDoc);
+ }
+ rMark = aNewMark;
+ return bFound;
+ }
+ return false;
+}
+
+namespace {
+
+bool lcl_maybeReplaceCellString(
+ ScColumn& rColObj, SCCOL& rCol, SCROW& rRow, String& rUndoStr, SCCOL nCol, SCROW nRow, const SvxSearchItem& rSearchItem)
+{
+ ScBaseCell* pCell = rColObj.GetCell(nRow);
+ if (!pCell || pCell->GetCellType() == CELLTYPE_NOTE)
+ {
+ // empty cell found.
+ rCol = nCol;
+ rRow = nRow;
+ if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE &&
+ rSearchItem.GetReplaceString().Len())
+ {
+ rColObj.Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString()));
+ rUndoStr = String();
+ }
+ return true;
+ }
+ return false;
+}
+
+}
+
+bool ScTable::SearchRangeForEmptyCell(
+ const ScRange& rRange, const SvxSearchItem& rSearchItem,
+ SCCOL& rCol, SCROW& rRow, String& rUndoStr, ScDocument* /*pUndoDoc*/)
+{
+ sal_uInt16 nCmd = rSearchItem.GetCommand();
+ bool bSkipFiltered = rSearchItem.IsSearchFiltered();
+ if (rSearchItem.GetBackward())
+ {
+ // backward search
+ if (rSearchItem.GetRowDirection())
+ {
+ // row direction.
+ SCROW nLastNonFilteredRow = MAXROW + 1;
+ SCROW nBeginRow = rRange.aEnd.Row() > rRow ? rRow : rRange.aEnd.Row();
+ for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow)
+ {
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, false);
+ if (nRow < rRange.aStart.Row())
+ break;
+ SCCOL nBeginCol = rRange.aEnd.Col();
+ if (nRow == rRow && nBeginCol >= rCol)
+ // always start from one cell before the cursor.
+ nBeginCol = rCol - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0);
+ for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol)
+ {
+ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem))
+ return true;
+ }
+ }
+ }
+ else
+ {
+ // column direction.
+ SCCOL nBeginCol = rRange.aEnd.Col() > rCol ? rCol : rRange.aEnd.Col();
+ for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol)
+ {
+ SCROW nLastNonFilteredRow = MAXROW + 1;
+ SCROW nBeginRow = rRange.aEnd.Row();
+ if (nCol == rCol && nBeginRow >= rRow)
+ // always start from one cell before the cursor.
+ nBeginRow = rRow - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0);
+ for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow)
+ {
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, false);
+ if (nRow < rRange.aStart.Row())
+ break;
+
+ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem))
+ return true;
+ }
+ }
+ }
+ }
+ else
+ {
+ // forward search
+ if (rSearchItem.GetRowDirection())
+ {
+ // row direction.
+ SCROW nLastNonFilteredRow = -1;
+ SCROW nBeginRow = rRange.aStart.Row() < rRow ? rRow : rRange.aStart.Row();
+ for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow)
+ {
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, true);
+ if (nRow > rRange.aEnd.Row())
+ break;
+
+ SCCOL nBeginCol = rRange.aStart.Col();
+ if (nRow == rRow && nBeginCol <= rCol)
+ // always start from one cell past the cursor.
+ nBeginCol = rCol + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0);
+ for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol)
+ {
+ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem))
+ return true;
+ }
+ }
+ }
+ else
+ {
+ // column direction.
+ SCCOL nBeginCol = rRange.aStart.Col() < rCol ? rCol : rRange.aStart.Col();
+ for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol)
+ {
+ SCROW nLastNonFilteredRow = -1;
+ SCROW nBeginRow = rRange.aStart.Row();
+ if (nCol == rCol && nBeginRow <= rRow)
+ // always start from one cell past the cursor.
+ nBeginRow = rRow + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0);
+ for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow)
+ {
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, true);
+ if (nRow > rRange.aEnd.Row())
+ break;
+
+ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem))
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+bool ScTable::SearchRangeForAllEmptyCells(
+ const ScRange& rRange, const SvxSearchItem& rSearchItem, ScMarkData& rMark,
+ String& rUndoStr, ScDocument* pUndoDoc)
+{
+ bool bFound = false;
+ bool bReplace = (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL) &&
+ (rSearchItem.GetReplaceString().Len() > 0);
+ bool bSkipFiltered = rSearchItem.IsSearchFiltered();
+
+ for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol)
+ {
+ SCROW nLastNonFilteredRow = -1;
+ if (aCol[nCol].IsEmptyData())
+ {
+ // The entire column is empty.
+ for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow)
+ {
+ SCROW nLastRow;
+ if (!RowFiltered(nRow, NULL, &nLastRow))
+ {
+ rMark.SetMultiMarkArea(ScRange(nCol, nRow, nTab, nCol, nLastRow, nTab));
+ if (bReplace)
+ {
+ const String& rNewStr = rSearchItem.GetReplaceString();
+ for (SCROW i = nRow; i <= nLastRow; ++i)
+ {
+ aCol[nCol].Insert(i, new ScStringCell(rNewStr));
+ if (pUndoDoc)
+ // TODO: I'm using a string cell with empty content to
+ // trigger deletion of cell instance on undo. Maybe I
+ // should create a new cell type for this?
+ pUndoDoc->PutCell(nCol, i, nTab, new ScStringCell(String()));
+ }
+ rUndoStr = String();
+ }
+ }
+
+ nRow = nLastRow; // move to the last filtered row.
+ }
+ bFound = true;
+ continue;
+ }
+
+ for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow)
+ {
+ if (bSkipFiltered)
+ SkipFilteredRows(nRow, nLastNonFilteredRow, true);
+ if (nRow > rRange.aEnd.Row())
+ break;
+
+ ScBaseCell* pCell = aCol[nCol].GetCell(nRow);
+ if (!pCell)
+ {
+ // empty cell found
+ rMark.SetMultiMarkArea(ScRange(nCol, nRow, nTab));
+ bFound = true;
+
+ if (bReplace)
+ {
+ aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString()));
+ if (pUndoDoc)
+ // TODO: I'm using a string cell with empty content to
+ // trigger deletion of cell instance on undo. Maybe I
+ // should create a new cell type for this?
+ pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String()));
+ }
+ }
+ else if (pCell->GetCellType() == CELLTYPE_NOTE)
+ {
+ rMark.SetMultiMarkArea(ScRange(nCol, nRow, nTab));
+ bFound = true;
+
+ if (bReplace)
+ {
+ if (pUndoDoc)
+ {
+ ScAddress aCellPos(nCol, nRow, nTab);
+ pUndoDoc->PutCell(nCol, nRow, nTab, pCell->CloneWithNote(aCellPos, *pUndoDoc, aCellPos));
+ }
+ aCol[nCol].SetString(nRow, nTab, rSearchItem.GetReplaceString());
+ }
+ }
+ }
+ }
+ return bFound;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx
index 2709dd54d1fb..3d43b6d052b1 100644
--- a/sc/source/core/data/tabprotection.cxx
+++ b/sc/source/core/data/tabprotection.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,20 +37,27 @@
#include <comphelper/docpasswordhelper.hxx>
#include "document.hxx"
+#include <vector>
+
#define DEBUG_TAB_PROTECTION 0
+#define URI_SHA1 "http://www.w3.org/2000/09/xmldsig#sha1"
+#define URI_XLS_LEGACY "http://docs.oasis-open.org/office/ns/table/legacy-hash-excel"
+
using namespace ::com::sun::star;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+using ::std::vector;
// ============================================================================
-bool ScPassHashHelper::needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash)
+bool ScPassHashHelper::needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash1, ScPasswordHash eHash2)
{
if (rDoc.IsDocProtected())
{
const ScDocProtection* p = rDoc.GetDocProtection();
- if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash))
+ if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash1, eHash2))
return true;
}
@@ -61,13 +69,37 @@ bool ScPassHashHelper::needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash
// Sheet not protected. Skip it.
continue;
- if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash))
+ if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash1, eHash2))
return true;
}
return false;
}
+OUString ScPassHashHelper::getHashURI(ScPasswordHash eHash)
+{
+ switch (eHash)
+ {
+ case PASSHASH_SHA1:
+ return OUString(RTL_CONSTASCII_USTRINGPARAM(URI_SHA1));
+ case PASSHASH_XL:
+ return OUString(RTL_CONSTASCII_USTRINGPARAM(URI_XLS_LEGACY));
+ case PASSHASH_UNSPECIFIED:
+ default:
+ ;
+ }
+ return OUString();
+}
+
+ScPasswordHash ScPassHashHelper::getHashTypeFromURI(const OUString& rURI)
+{
+ if (rURI.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(URI_SHA1)))
+ return PASSHASH_SHA1;
+ else if (rURI.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(URI_XLS_LEGACY)))
+ return PASSHASH_XL;
+ return PASSHASH_UNSPECIFIED;
+}
+
// ============================================================================
ScPassHashProtectable::~ScPassHashProtectable()
@@ -79,7 +111,8 @@ ScPassHashProtectable::~ScPassHashProtectable()
class ScTableProtectionImpl
{
public:
- static ::com::sun::star::uno::Sequence<sal_Int8> hashPassword(const String& aPassText, ScPasswordHash eHash = PASSHASH_OOO);
+ static Sequence<sal_Int8> hashPassword(const String& aPassText, ScPasswordHash eHash = PASSHASH_SHA1);
+ static Sequence<sal_Int8> hashPassword(const Sequence<sal_Int8>& rPassHash, ScPasswordHash eHash = PASSHASH_SHA1);
explicit ScTableProtectionImpl(SCSIZE nOptSize);
explicit ScTableProtectionImpl(const ScTableProtectionImpl& r);
@@ -89,10 +122,13 @@ public:
void setProtected(bool bProtected);
bool isPasswordEmpty() const;
- bool hasPasswordHash(ScPasswordHash eHash) const;
+ bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const;
void setPassword(const String& aPassText);
- ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(ScPasswordHash eHash) const;
- void setPasswordHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword, ScPasswordHash eHash = PASSHASH_OOO);
+ ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(
+ ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const;
+ void setPasswordHash(
+ const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword,
+ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED);
bool verifyPassword(const String& aPassText) const;
bool isOptionEnabled(SCSIZE nOptId) const;
@@ -104,7 +140,8 @@ private:
::std::vector<bool> maOptions;
bool mbEmptyPass;
bool mbProtected;
- ScPasswordHash meHash;
+ ScPasswordHash meHash1;
+ ScPasswordHash meHash2;
};
Sequence<sal_Int8> ScTableProtectionImpl::hashPassword(const String& aPassText, ScPasswordHash eHash)
@@ -115,19 +152,44 @@ Sequence<sal_Int8> ScTableProtectionImpl::hashPassword(const String& aPassText,
case PASSHASH_XL:
aHash = ::comphelper::DocPasswordHelper::GetXLHashAsSequence( aPassText, RTL_TEXTENCODING_UTF8 );
break;
- case PASSHASH_OOO:
- default:
+ case PASSHASH_SHA1:
SvPasswordHelper::GetHashPassword(aHash, aPassText);
break;
+ default:
+ ;
}
return aHash;
}
+Sequence<sal_Int8> ScTableProtectionImpl::hashPassword(
+ const Sequence<sal_Int8>& rPassHash, ScPasswordHash eHash)
+{
+ if (!rPassHash.getLength() || eHash == PASSHASH_UNSPECIFIED)
+ return rPassHash;
+
+ // TODO: Right now, we only support double-hash by SHA1.
+ if (eHash == PASSHASH_SHA1)
+ {
+ vector<sal_Char> aChars;
+ sal_Int32 n = rPassHash.getLength();
+ aChars.reserve(n);
+ for (sal_Int32 i = 0; i < n; ++i)
+ aChars.push_back(static_cast<sal_Char>(rPassHash[i]));
+
+ Sequence<sal_Int8> aNewHash;
+ SvPasswordHelper::GetHashPassword(aNewHash, &aChars[0], aChars.size());
+ return aNewHash;
+ }
+
+ return rPassHash;
+}
+
ScTableProtectionImpl::ScTableProtectionImpl(SCSIZE nOptSize) :
maOptions(nOptSize),
mbEmptyPass(true),
mbProtected(false),
- meHash(PASSHASH_OOO)
+ meHash1(PASSHASH_SHA1),
+ meHash2(PASSHASH_UNSPECIFIED)
{
}
@@ -137,7 +199,8 @@ ScTableProtectionImpl::ScTableProtectionImpl(const ScTableProtectionImpl& r) :
maOptions(r.maOptions),
mbEmptyPass(r.mbEmptyPass),
mbProtected(r.mbProtected),
- meHash(r.meHash)
+ meHash1(r.meHash1),
+ meHash2(r.meHash2)
{
}
@@ -181,7 +244,7 @@ bool ScTableProtectionImpl::isPasswordEmpty() const
return mbEmptyPass;
}
-bool ScTableProtectionImpl::hasPasswordHash(ScPasswordHash eHash) const
+bool ScTableProtectionImpl::hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const
{
if (mbEmptyPass)
return true;
@@ -189,35 +252,65 @@ bool ScTableProtectionImpl::hasPasswordHash(ScPasswordHash eHash) const
if (maPassText.Len())
return true;
- if (meHash == eHash)
- return true;
+ if (meHash1 == eHash)
+ {
+ if (meHash2 == PASSHASH_UNSPECIFIED)
+ // single hash.
+ return true;
+
+ return meHash2 == eHash2;
+ }
return false;
}
-Sequence<sal_Int8> ScTableProtectionImpl::getPasswordHash(ScPasswordHash eHash) const
+Sequence<sal_Int8> ScTableProtectionImpl::getPasswordHash(
+ ScPasswordHash eHash, ScPasswordHash eHash2) const
{
+ Sequence<sal_Int8> aPassHash;
+
if (mbEmptyPass)
// Flaged as empty.
- return Sequence<sal_Int8>();
+ return aPassHash;
if (maPassText.Len())
+ {
// Cleartext password exists. Hash it.
- return hashPassword(maPassText, eHash);
+ aPassHash = hashPassword(maPassText, eHash);
+ if (eHash2 != PASSHASH_UNSPECIFIED)
+ // Double-hash it.
+ aPassHash = hashPassword(aPassHash, eHash2);
- if (meHash == eHash)
- // Stored hash exists.
- return maPassHash;
+ return aPassHash;
+ }
+ else
+ {
+ // No clear text password. Check if we have a hash value of the right hash type.
+ if (meHash1 == eHash)
+ {
+ aPassHash = maPassHash;
+
+ if (meHash2 == eHash2)
+ // Matching double-hash requested.
+ return aPassHash;
+ else if (meHash2 == PASSHASH_UNSPECIFIED)
+ // primary hashing type match. Double hash it by the requested
+ // double-hash type.
+ return hashPassword(aPassHash, eHash2);
+ }
+ }
- // Failed to find a matching hash.
+ // failed.
return Sequence<sal_Int8>();
}
-void ScTableProtectionImpl::setPasswordHash(const uno::Sequence<sal_Int8>& aPassword, ScPasswordHash eHash)
+void ScTableProtectionImpl::setPasswordHash(
+ const uno::Sequence<sal_Int8>& aPassword, ScPasswordHash eHash, ScPasswordHash eHash2)
{
sal_Int32 nLen = aPassword.getLength();
mbEmptyPass = nLen <= 0 ? true : false;
- meHash = eHash;
+ meHash1 = eHash;
+ meHash2 = eHash2;
maPassHash = aPassword;
#if DEBUG_TAB_PROTECTION
@@ -241,7 +334,8 @@ bool ScTableProtectionImpl::verifyPassword(const String& aPassText) const
// Clear text password exists, and this one takes precedence.
return aPassText.Equals(maPassText);
- Sequence<sal_Int8> aHash = hashPassword(aPassText, meHash);
+ Sequence<sal_Int8> aHash = hashPassword(aPassText, meHash1);
+ aHash = hashPassword(aHash, meHash2);
#if DEBUG_TAB_PROTECTION
fprintf(stdout, "ScTableProtectionImpl::verifyPassword: hash = ");
@@ -257,7 +351,7 @@ bool ScTableProtectionImpl::isOptionEnabled(SCSIZE nOptId) const
{
if ( maOptions.size() <= static_cast<size_t>(nOptId) )
{
- DBG_ERROR("ScTableProtectionImpl::isOptionEnabled: wrong size");
+ OSL_FAIL("ScTableProtectionImpl::isOptionEnabled: wrong size");
return false;
}
@@ -268,7 +362,7 @@ void ScTableProtectionImpl::setOption(SCSIZE nOptId, bool bEnabled)
{
if ( maOptions.size() <= static_cast<size_t>(nOptId) )
{
- DBG_ERROR("ScTableProtectionImpl::setOption: wrong size");
+ OSL_FAIL("ScTableProtectionImpl::setOption: wrong size");
return;
}
@@ -317,9 +411,9 @@ bool ScDocProtection::isPasswordEmpty() const
return mpImpl->isPasswordEmpty();
}
-bool ScDocProtection::hasPasswordHash(ScPasswordHash eHash) const
+bool ScDocProtection::hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const
{
- return mpImpl->hasPasswordHash(eHash);
+ return mpImpl->hasPasswordHash(eHash, eHash2);
}
void ScDocProtection::setPassword(const String& aPassText)
@@ -327,14 +421,15 @@ void ScDocProtection::setPassword(const String& aPassText)
mpImpl->setPassword(aPassText);
}
-uno::Sequence<sal_Int8> ScDocProtection::getPasswordHash(ScPasswordHash eHash) const
+uno::Sequence<sal_Int8> ScDocProtection::getPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const
{
- return mpImpl->getPasswordHash(eHash);
+ return mpImpl->getPasswordHash(eHash, eHash2);
}
-void ScDocProtection::setPasswordHash(const uno::Sequence<sal_Int8>& aPassword, ScPasswordHash eHash)
+void ScDocProtection::setPasswordHash(
+ const uno::Sequence<sal_Int8>& aPassword, ScPasswordHash eHash, ScPasswordHash eHash2)
{
- mpImpl->setPasswordHash(aPassword, eHash);
+ mpImpl->setPasswordHash(aPassword, eHash, eHash2);
}
bool ScDocProtection::verifyPassword(const String& aPassText) const
@@ -392,9 +487,9 @@ bool ScTableProtection::isPasswordEmpty() const
return mpImpl->isPasswordEmpty();
}
-bool ScTableProtection::hasPasswordHash(ScPasswordHash eHash) const
+bool ScTableProtection::hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const
{
- return mpImpl->hasPasswordHash(eHash);
+ return mpImpl->hasPasswordHash(eHash, eHash2);
}
void ScTableProtection::setPassword(const String& aPassText)
@@ -402,14 +497,15 @@ void ScTableProtection::setPassword(const String& aPassText)
mpImpl->setPassword(aPassText);
}
-Sequence<sal_Int8> ScTableProtection::getPasswordHash(ScPasswordHash eHash) const
+Sequence<sal_Int8> ScTableProtection::getPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const
{
- return mpImpl->getPasswordHash(eHash);
+ return mpImpl->getPasswordHash(eHash, eHash2);
}
-void ScTableProtection::setPasswordHash(const uno::Sequence<sal_Int8>& aPassword, ScPasswordHash eHash)
+void ScTableProtection::setPasswordHash(
+ const uno::Sequence<sal_Int8>& aPassword, ScPasswordHash eHash, ScPasswordHash eHash2)
{
- mpImpl->setPasswordHash(aPassword, eHash);
+ mpImpl->setPasswordHash(aPassword, eHash, eHash2);
}
bool ScTableProtection::verifyPassword(const String& aPassText) const
@@ -426,4 +522,4 @@ void ScTableProtection::setOption(Option eOption, bool bEnabled)
{
mpImpl->setOption(eOption, bEnabled);
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx
index 466e83b15fad..39dca1b2e319 100644
--- a/sc/source/core/data/userdat.cxx
+++ b/sc/source/core/data/userdat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,7 +60,7 @@ IMPL_LINK_INLINE_START( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFac
pObjFactory->pNewData = new ScMacroInfo;
else
{
- DBG_ERROR("MakeUserData: falsche ID");
+ OSL_FAIL("MakeUserData: falsche ID");
}
}
return 0;
@@ -125,3 +126,4 @@ SdrObjUserData* ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const
return new ScMacroInfo( *this );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 0d7e39273000..137759d674da 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,7 +82,7 @@ ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOpe
eErrorStyle( SC_VALERR_STOP ),
mnListType( ValidListType::UNSORTED )
{
- bShowInput = bShowError = sal_False;
+ bShowInput = bShowError = false;
}
ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
@@ -93,7 +94,7 @@ ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOpe
eErrorStyle( SC_VALERR_STOP ),
mnListType( ValidListType::UNSORTED )
{
- bShowInput = bShowError = sal_False;
+ bShowInput = bShowError = false;
}
ScValidationData::ScValidationData( const ScValidationData& r ) :
@@ -157,12 +158,12 @@ sal_Bool ScValidationData::EqualEntries( const ScValidationData& r ) const
void ScValidationData::ResetInput()
{
- bShowInput = sal_False;
+ bShowInput = false;
}
void ScValidationData::ResetError()
{
- bShowError = sal_False;
+ bShowError = false;
}
void ScValidationData::SetInput( const String& rTitle, const String& rMsg )
@@ -196,9 +197,9 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
ScDocument* pDocument = GetDocument();
SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
if ( !pDocSh || !pDocument->CheckMacroWarn() )
- return sal_False;
+ return false;
- sal_Bool bScriptReturnedFalse = sal_False; // Standard: kein Abbruch
+ sal_Bool bScriptReturnedFalse = false; // Standard: kein Abbruch
// Set up parameters
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aParams(2);
@@ -206,7 +207,7 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
// 1) eingegebener / berechneter Wert
String aValStr = rInput;
double nValue;
- sal_Bool bIsValue = sal_False;
+ sal_Bool bIsValue = false;
if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen
{
bIsValue = pCell->IsValue();
@@ -245,15 +246,15 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
pDocument->UnlockTable( rPos.Tab() );
if ( !bWasInLinkUpdate )
- pDocument->SetInLinkUpdate( sal_False );
+ pDocument->SetInLinkUpdate( false );
// Check the return value from the script
// The contents of the cell get reset if the script returns false
- sal_Bool bTmp = sal_False;
+ sal_Bool bTmp = false;
if ( eRet == ERRCODE_NONE &&
aRet.getValueType() == getCppuBooleanType() &&
sal_True == ( aRet >>= bTmp ) &&
- bTmp == sal_False )
+ bTmp == false )
{
bScriptReturnedFalse = sal_True;
}
@@ -284,10 +285,10 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
ScDocument* pDocument = GetDocument();
SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
if ( !pDocSh || !pDocument->CheckMacroWarn() )
- return sal_False;
+ return false;
- sal_Bool bDone = sal_False;
- sal_Bool bRet = sal_False; // Standard: kein Abbruch
+ sal_Bool bDone = false;
+ sal_Bool bRet = false; // Standard: kein Abbruch
// Wenn das Dok waehrend eines Basic-Calls geladen wurde,
// ist das Sbx-Objekt evtl. nicht angelegt (?)
@@ -295,16 +296,6 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
// keine Sicherheitsabfrage mehr vorneweg (nur CheckMacroWarn), das passiert im CallBasic
-#if 0
- // Makro-Name liegt in folgender Form vor:
- // "Macroname.Modulname.Libname.Dokumentname" oder
- // "Macroname.Modulname.Libname.Applikationsname"
- String aMacroName = aErrorTitle.GetToken(0, '.');
- String aModulName = aErrorTitle.GetToken(1, '.');
- String aLibName = aErrorTitle.GetToken(2, '.');
- String aDocName = aErrorTitle.GetToken(3, '.');
-#endif
-
// Funktion ueber den einfachen Namen suchen,
// dann aBasicStr, aMacroStr fuer SfxObjectShell::CallBasic zusammenbauen
@@ -322,7 +313,7 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
aMacroStr += pMethod->GetName();
String aBasicStr;
- // #95867# the distinction between document- and app-basic has to be done
+ // the distinction between document- and app-basic has to be done
// by checking the parent (as in ScInterpreter::ScMacro), not by looping
// over all open documents, because this may be called from within loading,
// when SfxObjectShell::GetFirst/GetNext won't find the document.
@@ -338,7 +329,7 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
// 1) eingegebener / berechneter Wert
String aValStr = rInput;
double nValue = 0.0;
- sal_Bool bIsValue = sal_False;
+ sal_Bool bIsValue = false;
if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen
{
bIsValue = pCell->IsValue();
@@ -371,10 +362,10 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
pDocument->UnlockTable( rPos.Tab() );
if ( !bWasInLinkUpdate )
- pDocument->SetInLinkUpdate( sal_False );
+ pDocument->SetInLinkUpdate( false );
// Eingabe abbrechen, wenn Basic-Makro sal_False zurueckgibt
- if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && refRes->GetBool() == sal_False )
+ if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && refRes->GetBool() == false )
bRet = sal_True;
bDone = sal_True;
}
@@ -449,7 +440,7 @@ sal_Bool ScValidationData::IsDataValid( const String& rTest, const ScPatternAttr
return sal_True; // alles erlaubt
if ( rTest.GetChar(0) == '=' )
- return sal_False; // Formeln sind sonst immer ungueltig
+ return false; // Formeln sind sonst immer ungueltig
if ( !rTest.Len() )
return IsIgnoreBlank(); // leer: wie eingestellt
@@ -490,11 +481,11 @@ sal_Bool ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos
break;
case CELLTYPE_STRING:
((ScStringCell*)pCell)->GetString( aString );
- bIsVal = sal_False;
+ bIsVal = false;
break;
case CELLTYPE_EDIT:
((ScEditCell*)pCell)->GetString( aString );
- bIsVal = sal_False;
+ bIsVal = false;
break;
case CELLTYPE_FORMULA:
{
@@ -543,7 +534,7 @@ sal_Bool ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos
break;
default:
- DBG_ERROR("hammanochnich");
+ OSL_FAIL("hammanochnich");
break;
}
@@ -651,7 +642,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
const ScMatrix *pValues = aValidationSrc.GetMatrix();
if (!pValues)
{
- // The somewhat nasty case of either an error occured, or the
+ // The somewhat nasty case of either an error occurred, or the
// dereferenced value of a single cell reference or an immediate result
// is stored as a single value.
@@ -666,7 +657,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
* rStrResult += ScGlobal::GetLongErrorString(nErrCode);
*/
- xMatRef->PutError( nErrCode, 0);
+ xMatRef->PutError( nErrCode, 0, 0);
bOk = false;
}
else if (aValidationSrc.HasValueData())
@@ -678,7 +669,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
xMatRef->PutString( aStr, 0);
}
- pValues = xMatRef;
+ pValues = xMatRef.get();
}
// which index matched. We will want it eventually to pre-select that item.
@@ -690,7 +681,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
SCSIZE nCol, nRow, nCols, nRows, n = 0;
pValues->GetDimensions( nCols, nRows );
- sal_Bool bRef = sal_False;
+ sal_Bool bRef = false;
ScRange aRange;
ScTokenArray* pArr = (ScTokenArray*) &rTokArr;
@@ -708,7 +699,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
}
else if (t->GetOpCode() == ocName)
{
- ScRangeData* pName = pDocument->GetRangeName()->FindIndex( t->GetIndex() );
+ ScRangeData* pName = pDocument->GetRangeName()->findByIndex( t->GetIndex() );
if (pName && pName->IsReference(aRange))
{
bRef = sal_True;
@@ -736,15 +727,13 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
{
ScTokenArray aCondTokArr;
TypedStrData* pEntry = NULL;
- ScMatValType nMatValType;
String aValStr;
- const ScMatrixValue* pMatVal = pValues->Get( nCol, nRow, nMatValType);
+ ScMatrixValue nMatVal = pValues->Get( nCol, nRow);
// strings and empties
- if( NULL == pMatVal || ScMatrix::IsNonValueType( nMatValType ) )
+ if( ScMatrix::IsNonValueType( nMatVal.nType ) )
{
- if( NULL != pMatVal )
- aValStr = pMatVal->GetString();
+ aValStr = nMatVal.GetString();
if( NULL != pStrings )
pEntry = new TypedStrData( aValStr, 0.0, SC_STRTYPE_STANDARD);
@@ -754,7 +743,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
}
else
{
- sal_uInt16 nErr = pMatVal->GetError();
+ sal_uInt16 nErr = nMatVal.GetError();
if( 0 != nErr )
{
@@ -772,17 +761,17 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings,
(SCROW)(nRow+aRange.aStart.Row()), aRange.aStart.Tab() , aValStr);
}
else
- pFormatter->GetInputLineString( pMatVal->fVal, 0, aValStr );
+ pFormatter->GetInputLineString( nMatVal.fVal, 0, aValStr );
}
if( pCell && rMatch < 0 )
{
// I am not sure errors will work here, but a user can no
// manually enter an error yet so the point is somewhat moot.
- aCondTokArr.AddDouble( pMatVal->fVal );
+ aCondTokArr.AddDouble( nMatVal.fVal );
}
if( NULL != pStrings )
- pEntry = new TypedStrData( aValStr, pMatVal->fVal, SC_STRTYPE_VALUE);
+ pEntry = new TypedStrData( aValStr, nMatVal.fVal, SC_STRTYPE_VALUE);
}
if( rMatch < 0 && NULL != pCell && IsEqualToTokenArray( pCell, rPos, aCondTokArr ) )
@@ -943,7 +932,7 @@ ScValidationData* ScValidationDataList::GetData( sal_uInt32 nKey )
if ((*this)[i]->GetKey() == nKey)
return (*this)[i];
- DBG_ERROR("ScValidationDataList: Eintrag nicht gefunden");
+ OSL_FAIL("ScValidationDataList: Eintrag nicht gefunden");
return NULL;
}
@@ -969,15 +958,6 @@ void ScValidationDataList::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos )
(*this)[i]->UpdateMoveTab( nOldPos, nNewPos );
}
-bool ScValidationDataList::MarkUsedExternalReferences() const
-{
- bool bAllMarked = false;
- sal_uInt16 nCount = Count();
- for (sal_uInt16 i=0; !bAllMarked && i<nCount; i++)
- bAllMarked = (*this)[i]->MarkUsedExternalReferences();
- return bAllMarked;
-}
-
sal_Bool ScValidationDataList::operator==( const ScValidationDataList& r ) const
{
// fuer Ref-Undo - interne Variablen werden nicht verglichen
@@ -986,8 +966,9 @@ sal_Bool ScValidationDataList::operator==( const ScValidationDataList& r ) const
sal_Bool bEqual = ( nCount == r.Count() );
for (sal_uInt16 i=0; i<nCount && bEqual; i++) // Eintraege sind sortiert
if ( !(*this)[i]->EqualEntries(*r[i]) ) // Eintraege unterschiedlich ?
- bEqual = sal_False;
+ bEqual = false;
return bEqual;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/addinhelpid.hxx b/sc/source/core/inc/addinhelpid.hxx
index f5186daf0dac..94ccfb64fbb3 100644
--- a/sc/source/core/inc/addinhelpid.hxx
+++ b/sc/source/core/inc/addinhelpid.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,3 +59,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/addinlis.hxx b/sc/source/core/inc/addinlis.hxx
index 11831701cef1..401a1ee1f8a0 100644
--- a/sc/source/core/inc/addinlis.hxx
+++ b/sc/source/core/inc/addinlis.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,14 @@
#ifndef SC_ADDINLIS_HXX
#define SC_ADDINLIS_HXX
-#include "adiasync.hxx" // for ScAddInDocs PtrArr
-#include <tools/list.hxx>
+#include "adiasync.hxx" // for ScAddInDocs PtrArr
#include <com/sun/star/sheet/XResultListener.hpp>
#include <com/sun/star/sheet/XVolatileResult.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
-
-
class ScDocument;
-
class ScAddInListener : public cppu::WeakImplHelper2<
com::sun::star::sheet::XResultListener,
com::sun::star::lang::XServiceInfo >,
@@ -47,52 +44,56 @@ class ScAddInListener : public cppu::WeakImplHelper2<
{
private:
com::sun::star::uno::Reference<com::sun::star::sheet::XVolatileResult> xVolRes;
- com::sun::star::uno::Any aResult;
- ScAddInDocs* pDocs; // documents where this is used
+ com::sun::star::uno::Any aResult;
+ ScAddInDocs* pDocs; // documents where this is used
- static List aAllListeners;
+ static ::std::list<ScAddInListener*> aAllListeners;
- // always allocated via CreateListener
- ScAddInListener(
- com::sun::star::uno::Reference<
- com::sun::star::sheet::XVolatileResult> xVR,
- ScDocument* pD );
+ // always allocated via CreateListener
+ ScAddInListener( com::sun::star::uno::Reference<com::sun::star::sheet::XVolatileResult> xVR,
+ ScDocument* pD );
public:
- virtual ~ScAddInListener();
+ virtual ~ScAddInListener();
- // create Listener and put it into global list
+ // create Listener and put it into global list
static ScAddInListener* CreateListener(
- com::sun::star::uno::Reference<
- com::sun::star::sheet::XVolatileResult> xVR,
+ com::sun::star::uno::Reference<com::sun::star::sheet::XVolatileResult> xVR,
ScDocument* pDoc );
- static ScAddInListener* Get( com::sun::star::uno::Reference<
+ static ScAddInListener*Get( com::sun::star::uno::Reference<
com::sun::star::sheet::XVolatileResult> xVR );
- static void RemoveDocument( ScDocument* pDocument );
- sal_Bool HasDocument( ScDocument* pDoc ) const { return pDocs->Seek_Entry( pDoc ); }
- void AddDocument( ScDocument* pDoc ) { pDocs->Insert( pDoc ); }
- const com::sun::star::uno::Any& GetResult() const { return aResult; }
+ static void RemoveDocument( ScDocument* pDocument );
+ bool HasDocument( ScDocument* pDoc ) const
+ { return pDocs->Seek_Entry( pDoc ); }
- // XResultListener
- virtual void SAL_CALL modified( const ::com::sun::star::sheet::ResultEvent& aEvent )
- throw(::com::sun::star::uno::RuntimeException);
+ void AddDocument( ScDocument* pDoc )
+ { pDocs->Insert( pDoc ); }
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
- throw(::com::sun::star::uno::RuntimeException);
+ const com::sun::star::uno::Any& GetResult() const
+ { return aResult; }
+
+ // XResultListener
+ virtual void SAL_CALL modified( const ::com::sun::star::sheet::ResultEvent& aEvent )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw(::com::sun::star::uno::RuntimeException);
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( )
- throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
- throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw(::com::sun::star::uno::RuntimeException);
};
+#endif // SC_ADDINLIS_HXX
-#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/adiasync.hxx b/sc/source/core/inc/adiasync.hxx
index 46b147eab142..061c5077137b 100644
--- a/sc/source/core/inc/adiasync.hxx
+++ b/sc/source/core/inc/adiasync.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,3 +91,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx
index a912a8c6e550..642baa97262b 100644
--- a/sc/source/core/inc/bcaslot.hxx
+++ b/sc/source/core/inc/bcaslot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#define SC_BCASLOT_HXX
#include <set>
-#include <hash_set>
+#include <boost/unordered_set.hpp>
#include <functional>
#include <svl/broadcast.hxx>
#include <svl/svarray.hxx>
@@ -53,7 +54,7 @@ private:
public:
ScBroadcastArea( const ScRange& rRange )
: pUpdateChainNext( NULL ), aRange( rRange ),
- nRefCount( 0 ), bInUpdateChain( sal_False ) {}
+ nRefCount( 0 ), bInUpdateChain( false ) {}
inline SvtBroadcaster& GetBroadcaster() { return aBroadcaster; }
inline const SvtBroadcaster& GetBroadcaster() const { return aBroadcaster; }
inline void UpdateRange( const ScRange& rNewRange )
@@ -96,7 +97,7 @@ struct ScBroadcastAreaEqual
}
};
-typedef ::std::hash_set< ScBroadcastArea*, ScBroadcastAreaHash, ScBroadcastAreaEqual > ScBroadcastAreas;
+typedef ::boost::unordered_set< ScBroadcastArea*, ScBroadcastAreaHash, ScBroadcastAreaEqual > ScBroadcastAreas;
//=============================================================================
@@ -116,7 +117,7 @@ struct ScBroadcastAreaBulkEqual
}
};
-typedef ::std::hash_set< const ScBroadcastArea*, ScBroadcastAreaBulkHash,
+typedef ::boost::unordered_set< const ScBroadcastArea*, ScBroadcastAreaBulkHash,
ScBroadcastAreaBulkEqual > ScBroadcastAreasBulk;
//=============================================================================
@@ -304,3 +305,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/cellkeytranslator.hxx b/sc/source/core/inc/cellkeytranslator.hxx
index 536e521a78da..0ec2c36c5ef3 100644
--- a/sc/source/core/inc/cellkeytranslator.hxx
+++ b/sc/source/core/inc/cellkeytranslator.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include "global.hxx"
#include "formula/opcode.hxx"
#include "unotools/transliterationwrapper.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <list>
#include <memory>
@@ -48,7 +49,7 @@ struct ScCellKeyword
ScCellKeyword(const sal_Char* pName, OpCode eOpCode, const ::com::sun::star::lang::Locale& rLocale);
};
-typedef ::std::hash_map< String, ::std::list<ScCellKeyword>, ScStringHashCode, ::std::equal_to<String> > ScCellKeywordHashMap;
+typedef ::boost::unordered_map< String, ::std::list<ScCellKeyword>, ScStringHashCode, ::std::equal_to<String> > ScCellKeywordHashMap;
/** Translate cell function keywords.
@@ -89,3 +90,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx
index 36595fe4c956..2d906c5b1de8 100644
--- a/sc/source/core/inc/core_pch.hxx
+++ b/sc/source/core/inc/core_pch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,7 +26,7 @@
*
************************************************************************/
-// ItemID-Defines etc. muessen immer ganz vorne stehen
+// ItemID-Defines etc. must be included first
#include "scitems.hxx"
@@ -34,17 +35,12 @@
#define SC_PROGRESS_CXX
-// ab hier automatisch per makepch generiert
-// folgende duerfen nicht aufgenommen werden:
-// setjmp.h
-
#include <tools/solar.h>
#include <string.h>
#include <tools/string.hxx>
#include <tools/rtti.hxx>
#include <limits.h>
#include <tools/ref.hxx>
-#include <tools/list.hxx>
#include <tools/contnr.hxx>
#include <tools/link.hxx>
#include <tools/stream.hxx>
@@ -104,7 +100,6 @@
#include <sot/sotdata.hxx>
#include <vcl/keycod.hxx>
#include <vcl/keycodes.hxx>
-#include <sot/sotref.hxx>
#include <rechead.hxx>
#include <tools/unqid.hxx>
#include <vcl/apptypes.hxx>
@@ -146,7 +141,6 @@
#include <vcl/prntypes.hxx>
#include <vcl/jobset.hxx>
#include <vcl/gdimtf.hxx>
-//#include <setjmp.h>
#include <tools/urlobj.hxx>
#include <vcl/print.hxx>
#include <docoptio.hxx>
@@ -246,3 +240,4 @@
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/ddelink.hxx b/sc/source/core/inc/ddelink.hxx
index c2f7d9b4497b..fd9317ce28f5 100644
--- a/sc/source/core/inc/ddelink.hxx
+++ b/sc/source/core/inc/ddelink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,8 +76,8 @@ public:
// fuer Interpreter:
- const ScMatrix* GetResult() const { return pResult; }
- void SetResult( ScMatrix* pRes ) { pResult = pRes; }
+ const ScMatrix* GetResult() const { return pResult.get(); }
+ void SetResult( ScMatrixRef pRes ) { pResult = pRes; }
// XML and Excel import after NewData()
ScMatrixRef GetModifiableResult() { return pResult; }
@@ -97,3 +98,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/doubleref.hxx b/sc/source/core/inc/doubleref.hxx
index 10221d942c9c..885d3a780c04 100644
--- a/sc/source/core/inc/doubleref.hxx
+++ b/sc/source/core/inc/doubleref.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: interpre.hxx,v $
- * $Revision: 1.35.44.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -191,3 +189,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 926c44c06317..ce59c16ffa20 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include "scdll.hxx"
#include "document.hxx"
#include "scmatrix.hxx"
+#include "externalrefmgr.hxx"
#include <math.h>
#include <map>
@@ -59,8 +61,8 @@ struct ScCompare
{
pVal[ 0 ] = p1;
pVal[ 1 ] = p2;
- bEmpty[0] = sal_False;
- bEmpty[1] = sal_False;
+ bEmpty[0] = false;
+ bEmpty[1] = false;
}
};
@@ -91,12 +93,12 @@ public:
};
enum ScIterFunc {
- ifSUM, // Aufsummieren
- ifSUMSQ, // Quadratsummen
- ifPRODUCT, // Multiplizieren
- ifAVERAGE, // Durchschnitt
- ifCOUNT, // Anzahl Werte
- ifCOUNT2, // Anzahl Werte (nichtleer)
+ ifSUM, // Add up
+ ifSUMSQ, // Sums of squares
+ ifPRODUCT, // Product
+ ifAVERAGE, // Average
+ ifCOUNT, // Count Values
+ ifCOUNT2, // Count Values (not empty)
ifMIN, // Minimum
ifMAX // Maximum
};
@@ -134,6 +136,15 @@ public:
static inline double div( const double& fNumerator, const double& fDenominator );
ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR);
+
+ enum VolatileType {
+ VOLATILE,
+ VOLATILE_MACRO,
+ NOT_VOLATILE
+ };
+
+ VolatileType GetVolatileType() const;
+
private:
static ScTokenStack* pGlobalStack;
static sal_Bool bGlobalStackInUse;
@@ -168,6 +179,8 @@ private:
sal_Bool bCalcAsShown; // precision as shown
sal_Bool bMatrixFormula; // formula cell is a matrix formula
+ VolatileType meVolaileType;
+
//---------------------------------Funktionen in interpre.cxx---------
// nMust <= nAct <= nMax ? ok : PushError
inline sal_Bool MustHaveParamCount( short nAct, short nMust );
@@ -201,10 +214,10 @@ inline sal_Bool HasCellEmptyData( const ScBaseCell* pCell )
{ return pCell ? pCell->HasEmptyData() : sal_True; }
/// This includes inherited emptiness, which usually is regarded as value!
inline sal_Bool HasCellValueData( const ScBaseCell* pCell )
- { return pCell ? pCell->HasValueData() : sal_False; }
+ { return pCell ? pCell->HasValueData() : false; }
/// Not empty and not value.
inline sal_Bool HasCellStringData( const ScBaseCell* pCell )
- { return pCell ? pCell->HasStringData() : sal_False; }
+ { return pCell ? pCell->HasStringData() : false; }
sal_Bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
@@ -279,7 +292,7 @@ void ValidateRef( const ScRefList & rRefList );
void SingleRefToVars( const ScSingleRefData & rRef, SCCOL & rCol, SCROW & rRow, SCTAB & rTab );
void PopSingleRef( ScAddress& );
void PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab);
-void DoubleRefToRange( const ScComplexRefData&, ScRange&, sal_Bool bDontCheckForTableOp = sal_False );
+void DoubleRefToRange( const ScComplexRefData&, ScRange&, sal_Bool bDontCheckForTableOp = false );
/** If formula::StackVar formula::svDoubleRef pop ScDoubleRefToken and return values of
ScComplexRefData.
Else if StackVar svRefList return values of the ScComplexRefData where
@@ -289,15 +302,20 @@ void DoubleRefToRange( const ScComplexRefData&, ScRange&, sal_Bool bDontCheckFor
while(nParamCount--) PopDoubleRef(aRange,nParamCount,nRefInList);
*/
void PopDoubleRef( ScRange & rRange, short & rParam, size_t & rRefInList );
-void PopDoubleRef( ScRange&, sal_Bool bDontCheckForTableOp = sal_False );
+void PopDoubleRef( ScRange&, sal_Bool bDontCheckForTableOp = false );
void DoubleRefToVars( const ScToken* p,
SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2,
- sal_Bool bDontCheckForTableOp = sal_False );
-ScDBRangeBase* PopDoubleRef();
+ sal_Bool bDontCheckForTableOp = false );
+ScDBRangeBase* PopDBDoubleRef();
void PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2,
- sal_Bool bDontCheckForTableOp = sal_False );
+ sal_Bool bDontCheckForTableOp = false );
+void PopExternalSingleRef(sal_uInt16& rFileId, String& rTabName, ScSingleRefData& rRef);
+void PopExternalSingleRef(ScExternalRefCache::TokenRef& rToken, ScExternalRefCache::CellFormat* pFmt = NULL);
+void PopExternalDoubleRef(sal_uInt16& rFileId, String& rTabName, ScComplexRefData& rRef);
+void PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArray);
+void PopExternalDoubleRef(ScMatrixRef& rMat);
sal_Bool PopDoubleRefOrSingleRef( ScAddress& rAdr );
void PopDoubleRefPushMatrix();
// If MatrixFormula: convert formula::svDoubleRef to svMatrix, create JumpMatrix.
@@ -308,15 +326,21 @@ inline void MatrixDoubleRefToMatrix(); // if MatrixFormula: PopDoubleRefPus
// If MatrixFormula or ForceArray: ConvertMatrixParameters()
inline bool MatrixParameterConversion();
ScMatrixRef PopMatrix();
-//void PushByte(sal_uInt8 nVal);
+void QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_uLong& rRetIndexExpr);
+//void PushByte(BYTE nVal);
void PushDouble(double nVal);
void PushInt( int nVal );
void PushStringBuffer( const sal_Unicode* pString );
void PushString( const String& rString );
void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab);
void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
- SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
-void PushMatrix(ScMatrix* pMat);
+ SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
+void PushExternalSingleRef(sal_uInt16 nFileId, const String& rTabName,
+ SCCOL nCol, SCROW nRow, SCTAB nTab);
+void PushExternalDoubleRef(sal_uInt16 nFileId, const String& rTabName,
+ SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+ SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
+void PushMatrix(const ScMatrixRef& pMat);
void PushError( sal_uInt16 nError );
/// Raw stack type without default replacements.
formula::StackVar GetRawStackType();
@@ -327,11 +351,13 @@ formula::StackVar GetStackType( sal_uInt8 nParam );
sal_uInt8 GetByte() { return cPar; }
// generiert aus DoubleRef positionsabhaengige SingleRef
sal_Bool DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr );
+double GetDoubleFromMatrix(const ScMatrixRef& pMat);
double GetDouble();
double GetDoubleWithDefault(double nDefault);
sal_Bool IsMissing();
sal_Bool GetBool() { return GetDouble() != 0.0; }
const String& GetString();
+const String& GetStringFromMatrix(const ScMatrixRef& pMat);
// pop matrix and obtain one element, upper left or according to jump matrix
ScMatValType GetDoubleOrStringFromMatrix( double& rDouble, String& rString );
ScMatrixRef CreateMatrixFromDoubleRef( const formula::FormulaToken* pToken,
@@ -374,7 +400,7 @@ double Compare();
NULL means case sensitivity document option is to be used!
*/
ScMatrixRef CompareMat( ScCompareOptions* pOptions = NULL );
-ScMatrixRef QueryMat( ScMatrix* pMat, ScCompareOptions& rOptions );
+ScMatrixRef QueryMat( const ScMatrixRef& pMat, ScCompareOptions& rOptions );
void ScEqual();
void ScNotEqual();
void ScLess();
@@ -449,20 +475,20 @@ void ScJis();
void ScAsc();
void ScUnicode();
void ScUnichar();
-void ScMin( sal_Bool bTextAsZero = sal_False );
-void ScMax( sal_Bool bTextAsZero = sal_False );
-double IterateParameters( ScIterFunc, sal_Bool bTextAsZero = sal_False );
+void ScMin( sal_Bool bTextAsZero = false );
+void ScMax( sal_Bool bTextAsZero = false );
+double IterateParameters( ScIterFunc, sal_Bool bTextAsZero = false );
void ScSumSQ();
void ScSum();
void ScProduct();
-void ScAverage( sal_Bool bTextAsZero = sal_False );
+void ScAverage( sal_Bool bTextAsZero = false );
void ScCount();
void ScCount2();
-void GetStVarParams( double& rVal, double& rValCount, sal_Bool bTextAsZero = sal_False );
-void ScVar( sal_Bool bTextAsZero = sal_False );
-void ScVarP( sal_Bool bTextAsZero = sal_False );
-void ScStDev( sal_Bool bTextAsZero = sal_False );
-void ScStDevP( sal_Bool bTextAsZero = sal_False );
+void GetStVarParams( double& rVal, double& rValCount, sal_Bool bTextAsZero = false );
+void ScVar( sal_Bool bTextAsZero = false );
+void ScVarP( sal_Bool bTextAsZero = false );
+void ScStDev( sal_Bool bTextAsZero = false );
+void ScStDevP( sal_Bool bTextAsZero = false );
void ScColumns();
void ScRows();
void ScTables();
@@ -527,7 +553,6 @@ sal_Bool SetSbxVariable( SbxVariable* pVar, SCCOL nCol, SCROW nRow, SCTAB nTab )
void ScErrorType();
void ScDBArea();
void ScColRowNameAuto();
-void ScExternalRef();
void ScGetPivotData();
void ScHyperLink();
void ScBahtText();
@@ -537,10 +562,10 @@ void ScTTT();
/** Obtain the date serial number for a given date.
@param bStrict
- If sal_False, nYear < 100 takes the two-digit year setting into account,
+ If FALSE, nYear < 100 takes the two-digit year setting into account,
and rollover of invalid calendar dates takes place, e.g. 1999-02-31 =>
1999-03-03.
- If sal_True, the date passed must be a valid Gregorian calendar date. No
+ If TRUE, the date passed must be a valid Gregorian calendar date. No
two-digit expanding or rollover is done.
*/
double GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict );
@@ -638,27 +663,19 @@ void ScLCM();
//-------------------------- Matrixfunktionen ---------------------------------
void ScMatValue();
-void MEMat(ScMatrix* mM, SCSIZE n);
-void MFastMult(ScMatrix* pA, ScMatrix* pB, ScMatrix* pR, SCSIZE n, SCSIZE m, SCSIZE l);
+void MEMat(const ScMatrixRef& mM, SCSIZE n);
void ScMatDet();
void ScMatInv();
void ScMatMult();
void ScMatTrans();
void ScEMat();
void ScMatRef();
-ScMatrixRef MatConcat(ScMatrix* pMat1, ScMatrix* pMat2);
+ScMatrixRef MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef& pMat2);
void ScSumProduct();
void ScSumX2MY2();
void ScSumX2DY2();
void ScSumXMY2();
void ScGrowth();
-// multiple Regression: Varianzen der Koeffizienten
-sal_Bool RGetVariances( ScMatrix* pV, ScMatrix* pX, SCSIZE nC, SCSIZE nR,
- sal_Bool bSwapColRow, sal_Bool bZeroConstant );
-void Calculate(ScMatrixRef& pResMat,ScMatrixRef& pE,ScMatrixRef& pQ,ScMatrixRef& pV,ScMatrixRef& pMatX,sal_Bool bConstant,SCSIZE N,SCSIZE M,sal_uInt8 nCase);
-ScMatrixRef Calculate2(const sal_Bool bConstant,const SCSIZE M ,const SCSIZE N,ScMatrixRef& pMatX,ScMatrixRef& pMatY,sal_uInt8 nCase);
-bool Calculate3(const SCSIZE M ,ScMatrixRef& pQ);
-bool Calculate4(sal_Bool _bExp,ScMatrixRef& pResMat,ScMatrixRef& pQ,sal_Bool bConstant,SCSIZE N,SCSIZE M);
bool CalculateSkew(double& fSum,double& fCount,double& vSum,std::vector<double>& values);
void CalculateSlopeIntercept(sal_Bool bSlope);
void CalculateSmallLarge(sal_Bool bSmall);
@@ -670,12 +687,11 @@ bool CalculateTest( sal_Bool _bTemplin
void CalculateLookup(sal_Bool HLookup);
bool FillEntry(ScQueryEntry& rEntry);
void CalculateAddSub(sal_Bool _bSub);
-void CalculateTrendGrowth(sal_Bool _bGrowth);
-void CalulateRGPRKP(sal_Bool _bRKP);
+void CalculateTrendGrowth(bool _bGrowth);
+void CalulateRGPRKP(bool _bRKP);
void CalculateSumX2MY2SumX2DY2(sal_Bool _bSumX2DY2);
void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR);
-bool CheckMatrix(sal_Bool _bLOG,sal_Bool _bTrendGrowth,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY);
-
+bool CheckMatrix(bool _bLOG,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY);
void ScRGP();
void ScRKP();
void ScForecast();
@@ -788,7 +804,6 @@ double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
// cumulative distribution function; fLambda is "scale" parameter
double GetGammaDist(double fX, double fAlpha, double fLambda);
-//----------------------------------------------------------------------------
public:
ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
const ScAddress&, ScTokenArray& );
@@ -844,7 +859,7 @@ inline sal_Bool ScInterpreter::MustHaveParamCount( short nAct, short nMust )
PushParameterExpected();
else
PushIllegalParameter();
- return sal_False;
+ return false;
}
@@ -856,7 +871,7 @@ inline sal_Bool ScInterpreter::MustHaveParamCount( short nAct, short nMust, shor
PushParameterExpected();
else
PushIllegalParameter();
- return sal_False;
+ return false;
}
@@ -865,7 +880,7 @@ inline sal_Bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin )
if ( nAct >= nMin )
return sal_True;
PushParameterExpected();
- return sal_False;
+ return false;
}
@@ -875,7 +890,7 @@ inline sal_Bool ScInterpreter::CheckStringResultLen( String& rResult, const Stri
{
SetError( errStringOverflow );
rResult.Erase();
- return sal_False;
+ return false;
}
return sal_True;
}
@@ -895,7 +910,6 @@ inline void ScInterpreter::TreatDoubleError( double& rVal )
}
-// static
inline double ScInterpreter::div( const double& fNumerator, const double& fDenominator )
{
return (fDenominator != 0.0) ? (fNumerator / fDenominator) :
@@ -903,3 +917,5 @@ inline double ScInterpreter::div( const double& fNumerator, const double& fDenom
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/jumpmatrix.hxx b/sc/source/core/inc/jumpmatrix.hxx
index 667a8918a2f6..be2719c0a213 100644
--- a/sc/source/core/inc/jumpmatrix.hxx
+++ b/sc/source/core/inc/jumpmatrix.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -140,7 +141,7 @@ public:
nRow = 0;
else if (nCols <= nCol || nRows <= nRow)
{
- DBG_ERROR("ScJumpMatrix::GetJump: dimension error");
+ OSL_FAIL("ScJumpMatrix::GetJump: dimension error");
nCol = 0;
nRow = 0;
}
@@ -161,7 +162,7 @@ public:
void SetJumpParameters( ScTokenVec* p )
{ pParams = p; }
const ScTokenVec* GetJumpParameters() const { return pParams; }
- ScMatrix* GetResultMatrix() const { return pMat; }
+ ScMatrix* GetResultMatrix() const { return pMat.get(); }
void GetPos( SCSIZE& rCol, SCSIZE& rRow ) const
{
rCol = nCurCol;
@@ -194,7 +195,7 @@ public:
{
if ( nNewCols > nResMatCols || nNewRows > nResMatRows )
{
- pMat = pMat->CloneAndExtend( nNewCols, nNewRows );
+ pMat = pMat->CloneAndExtend( nNewCols, nNewRows, pMat->GetDensityType() );
if ( nResMatCols < nNewCols )
{
pMat->FillDouble( CreateDoubleError(
@@ -220,3 +221,4 @@ public:
#endif // SC_JUMPMATRIX_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/parclass.hxx b/sc/source/core/inc/parclass.hxx
index 24887ea08290..2bd309f08d30 100644
--- a/sc/source/core/inc/parclass.hxx
+++ b/sc/source/core/inc/parclass.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -178,3 +179,4 @@ private:
#endif // SC_PARCLASS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/poolhelp.hxx b/sc/source/core/inc/poolhelp.hxx
index f98963513c59..2b3946f8ddcf 100644
--- a/sc/source/core/inc/poolhelp.hxx
+++ b/sc/source/core/inc/poolhelp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#define SC_POOLHELP_HXX
#include <rtl/ref.hxx>
-#include <vos/refernce.hxx>
+#include <salhelper/simplereferenceobject.hxx>
#include <tools/link.hxx>
#include "docoptio.hxx"
@@ -40,7 +41,7 @@ class SvNumberFormatter;
class SfxItemPool;
-class ScPoolHelper : public vos::OReference
+class ScPoolHelper : public salhelper::SimpleReferenceObject
{
private:
ScDocOptions aOpt;
@@ -72,3 +73,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/refupdat.hxx b/sc/source/core/inc/refupdat.hxx
index e32bfd47561c..544de4029661 100644
--- a/sc/source/core/inc/refupdat.hxx
+++ b/sc/source/core/inc/refupdat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98,3 +99,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/inc/scrdata.hxx b/sc/source/core/inc/scrdata.hxx
index b569bddddd6b..7a10045fda26 100644
--- a/sc/source/core/inc/scrdata.hxx
+++ b/sc/source/core/inc/scrdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/src/compiler.src b/sc/source/core/src/compiler.src
index a45c2b6aa458..a3740562b850 100644
--- a/sc/source/core/src/compiler.src
+++ b/sc/source/core/src/compiler.src
@@ -24,11 +24,10 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#include "sc.hrc" // Definition RID_XXX
#include <formula/compiler.hrc> // Definition SC_OPCODE_XXX (interne OpCodes)
-
-
Resource RID_FUNCTION_CATEGORIES
{
String 1
@@ -76,4 +75,3 @@ Resource RID_FUNCTION_CATEGORIES
Text[ en-US ] = "Add-in" ;
};
};
-
diff --git a/sc/source/core/src/makefile.mk b/sc/source/core/src/makefile.mk
index 13d0c2127c6d..10da79821c74 100644
--- a/sc/source/core/src/makefile.mk
+++ b/sc/source/core/src/makefile.mk
@@ -33,9 +33,7 @@ TARGET=core
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
diff --git a/sc/source/core/tool/addincfg.cxx b/sc/source/core/tool/addincfg.cxx
index c76b60eae077..051b1a088e9c 100644
--- a/sc/source/core/tool/addincfg.cxx
+++ b/sc/source/core/tool/addincfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,7 @@ using namespace com::sun::star;
#define CFGPATH_ADDINS "Office.CalcAddIns/AddInInfo"
ScAddInCfg::ScAddInCfg() :
- ConfigItem( rtl::OUString::createFromAscii( CFGPATH_ADDINS ) )
+ ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_ADDINS )) )
{
uno::Sequence<rtl::OUString> aNames(1); // one entry: empty string
EnableNotification( aNames );
@@ -55,7 +56,7 @@ ScAddInCfg::ScAddInCfg() :
void ScAddInCfg::Commit()
{
- DBG_ERROR("ScAddInCfg shouldn't be modified");
+ OSL_FAIL("ScAddInCfg shouldn't be modified");
}
void ScAddInCfg::Notify( const uno::Sequence<rtl::OUString>& )
@@ -70,3 +71,4 @@ void ScAddInCfg::Notify( const uno::Sequence<rtl::OUString>& )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 5c4f4dc33550..dd86967431d2 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,6 @@
#include <tools/debug.hxx>
#include <i18npool/mslangid.hxx>
#include <vcl/svapp.hxx>
-#include <vos/xception.hxx>
#include <sfx2/objsh.hxx>
#include <unotools/charclass.hxx>
@@ -99,7 +99,7 @@ ScUnoAddInFuncData::ScUnoAddInFuncData( const String& rNam, const String& rLoc,
nCallerPos( nCP ),
nCategory( nCat ),
sHelpId( sHelp ),
- bCompInitialized( sal_False )
+ bCompInitialized( false )
{
if ( nArgCount )
{
@@ -225,7 +225,7 @@ sal_Bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, String& rRetE
rRetExcelName = pArray[0].Name;
return sal_True;
}
- return sal_False;
+ return false;
}
void ScUnoAddInFuncData::SetFunction( const uno::Reference< reflection::XIdlMethod>& rNewFunc, const uno::Any& rNewObj )
@@ -262,7 +262,7 @@ ScUnoAddInCollection::ScUnoAddInCollection() :
pExactHashMap( NULL ),
pNameHashMap( NULL ),
pLocalHashMap( NULL ),
- bInitialized( sal_False )
+ bInitialized( false )
{
}
@@ -285,7 +285,7 @@ void ScUnoAddInCollection::Clear()
ppFuncData = NULL;
nFuncCount = 0;
- bInitialized = sal_False;
+ bInitialized = false;
}
uno::Reference<uno::XComponentContext> getContext(uno::Reference<lang::XMultiServiceFactory> xMSF)
@@ -294,7 +294,7 @@ uno::Reference<uno::XComponentContext> getContext(uno::Reference<lang::XMultiSer
try {
uno::Reference<beans::XPropertySet> xPropset(xMSF, uno::UNO_QUERY);
xPropset->getPropertyValue(
- ::rtl::OUString::createFromAscii("DefaultContext")) >>= xCtx;
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))) >>= xCtx;
}
catch ( uno::Exception & ) {
}
@@ -311,14 +311,14 @@ void ScUnoAddInCollection::Initialize()
{
uno::Reference<container::XEnumeration> xEnum =
xEnAc->createContentEnumeration(
- rtl::OUString::createFromAscii(SCADDINSUPPLIER_SERVICE) );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SCADDINSUPPLIER_SERVICE)) );
if ( xEnum.is() )
{
// loop through all AddIns
while ( xEnum->hasMoreElements() )
{
uno::Any aAddInAny = xEnum->nextElement();
-//? if ( aAddInAny.getReflection()->getTypeClass() == uno::TypeClass_INTERFACE )
+
{
uno::Reference<uno::XInterface> xIntFac;
aAddInAny >>= xIntFac;
@@ -411,7 +411,7 @@ void ScUnoAddInCollection::ReadConfiguration()
ScAddInCfg& rAddInConfig = SC_MOD()->GetAddInCfg();
// additional, temporary config item for the compatibility names
- ScLinkConfigItem aAllLocalesConfig( rtl::OUString::createFromAscii( CFGPATH_ADDINS ), CONFIG_MODE_ALL_LOCALES );
+ ScLinkConfigItem aAllLocalesConfig( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_ADDINS )), CONFIG_MODE_ALL_LOCALES );
// CommitLink is not used (only reading values)
const rtl::OUString sSlash('/');
@@ -428,7 +428,7 @@ void ScUnoAddInCollection::ReadConfiguration()
rtl::OUString aFunctionsPath = aServiceName;
aFunctionsPath += sSlash;
- aFunctionsPath += rtl::OUString::createFromAscii( CFGSTR_ADDINFUNCTIONS );
+ aFunctionsPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_ADDINFUNCTIONS) );
uno::Sequence<rtl::OUString> aFunctionNames = rAddInConfig.GetNodeNames( aFunctionsPath );
sal_Int32 nNewCount = aFunctionNames.getLength();
@@ -486,11 +486,11 @@ void ScUnoAddInCollection::ReadConfiguration()
uno::Sequence<rtl::OUString> aFuncPropNames(CFG_FUNCPROP_COUNT);
rtl::OUString* pNameArray = aFuncPropNames.getArray();
pNameArray[CFG_FUNCPROP_DISPLAYNAME] = aFuncPropPath;
- pNameArray[CFG_FUNCPROP_DISPLAYNAME] += rtl::OUString::createFromAscii( CFGSTR_DISPLAYNAME );
+ pNameArray[CFG_FUNCPROP_DISPLAYNAME] += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_DISPLAYNAME) );
pNameArray[CFG_FUNCPROP_DESCRIPTION] = aFuncPropPath;
- pNameArray[CFG_FUNCPROP_DESCRIPTION] += rtl::OUString::createFromAscii( CFGSTR_DESCRIPTION );
+ pNameArray[CFG_FUNCPROP_DESCRIPTION] += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_DESCRIPTION ));
pNameArray[CFG_FUNCPROP_CATEGORY] = aFuncPropPath;
- pNameArray[CFG_FUNCPROP_CATEGORY] += rtl::OUString::createFromAscii( CFGSTR_CATEGORY );
+ pNameArray[CFG_FUNCPROP_CATEGORY] += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_CATEGORY) );
uno::Sequence<uno::Any> aFuncProperties = rAddInConfig.GetProperties( aFuncPropNames );
if ( aFuncProperties.getLength() == CFG_FUNCPROP_COUNT )
@@ -508,7 +508,7 @@ void ScUnoAddInCollection::ReadConfiguration()
uno::Sequence<sheet::LocalizedName> aCompNames;
rtl::OUString aCompPath = aFuncPropPath;
- aCompPath += rtl::OUString::createFromAscii( CFGSTR_COMPATIBILITYNAME );
+ aCompPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_COMPATIBILITYNAME ));
uno::Sequence<rtl::OUString> aCompPropNames( &aCompPath, 1 );
uno::Sequence<uno::Any> aCompProperties = aAllLocalesConfig.GetProperties( aCompPropNames );
@@ -553,7 +553,7 @@ void ScUnoAddInCollection::ReadConfiguration()
long nCallerPos = SC_CALLERPOS_NONE;
rtl::OUString aArgumentsPath = aFuncPropPath;
- aArgumentsPath += rtl::OUString::createFromAscii( CFGSTR_PARAMETERS );
+ aArgumentsPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_PARAMETERS) );
uno::Sequence<rtl::OUString> aArgumentNames = rAddInConfig.GetNodeNames( aArgumentsPath );
sal_Int32 nArgumentCount = aArgumentNames.getLength();
@@ -574,9 +574,9 @@ void ScUnoAddInCollection::ReadConfiguration()
aOneArgPath += sSlash;
pPropNameArray[nIndex] = aOneArgPath;
- pPropNameArray[nIndex++] += rtl::OUString::createFromAscii( CFGSTR_DISPLAYNAME );
+ pPropNameArray[nIndex++] += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_DISPLAYNAME ));
pPropNameArray[nIndex] = aOneArgPath;
- pPropNameArray[nIndex++] += rtl::OUString::createFromAscii( CFGSTR_DESCRIPTION );
+ pPropNameArray[nIndex++] += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_DESCRIPTION ));
}
uno::Sequence<uno::Any> aArgProperties = rAddInConfig.GetProperties( aArgPropNames );
@@ -588,7 +588,7 @@ void ScUnoAddInCollection::ReadConfiguration()
ScAddInArgDesc aDesc;
aDesc.eType = SC_ADDINARG_NONE; // arg type is not in configuration
- aDesc.bOptional = sal_False;
+ aDesc.bOptional = false;
nVisibleCount = nArgumentCount;
pVisibleArgs = new ScAddInArgDesc[nVisibleCount];
@@ -666,7 +666,7 @@ sal_Bool ScUnoAddInCollection::GetExcelName( const String& rCalcName,
const ScUnoAddInFuncData* pFuncData = GetFuncData( rCalcName );
if ( pFuncData )
return pFuncData->GetExcelName( eDestLang, rRetExcelName);
- return sal_False;
+ return false;
}
sal_Bool ScUnoAddInCollection::GetCalcName( const String& rExcelName, String& rRetCalcName )
@@ -699,7 +699,7 @@ sal_Bool ScUnoAddInCollection::GetCalcName( const String& rExcelName, String& rR
}
}
}
- return sal_False;
+ return false;
}
inline sal_Bool IsTypeName( const rtl::OUString& rName, const uno::Type& rType )
@@ -711,13 +711,10 @@ sal_Bool lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClas
{
// this must match with ScUnoAddInCall::SetResult
- if ( !xClass.is() ) return sal_False;
+ if ( !xClass.is() ) return false;
switch (xClass->getTypeClass())
{
- // case uno::TypeClass_VOID:
- // ???
-
case uno::TypeClass_ANY: // variable type
case uno::TypeClass_ENUM: //! ???
case uno::TypeClass_BOOLEAN:
@@ -756,7 +753,7 @@ sal_Bool lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClas
IsTypeName( sName, getCppuType((uno::Sequence< uno::Sequence<uno::Any> >*)0) ) );
}
}
- return sal_False;
+ return false;
}
ScAddInArgumentType lcl_GetArgType( const uno::Reference<reflection::XIdlClass>& xClass )
@@ -826,8 +823,8 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
if ( xManager.is() )
{
uno::Reference<beans::XIntrospection> xIntro(
- xManager->createInstance(rtl::OUString::createFromAscii(
- "com.sun.star.beans.Introspection" )),
+ xManager->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.beans.Introspection" ))),
uno::UNO_QUERY );
if ( xIntro.is() )
{
@@ -918,12 +915,12 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
{
if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN )
- bValid = sal_False;
+ bValid = false;
uno::Reference<reflection::XIdlClass> xParClass =
pParArr[nParamPos].aType;
ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
if ( eArgType == SC_ADDINARG_NONE )
- bValid = sal_False;
+ bValid = false;
else if ( eArgType == SC_ADDINARG_CALLER )
nCallerPos = nParamPos;
else
@@ -946,7 +943,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
}
catch(uno::Exception&)
{
- aLocalU = rtl::OUString::createFromAscii( "###" );
+ aLocalU = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "###" ));
}
String aLocalName = String( aLocalU );
@@ -958,7 +955,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
}
catch(uno::Exception&)
{
- aDescU = rtl::OUString::createFromAscii( "###" );
+ aDescU = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "###" ));
}
String aDescription = String( aDescU );
@@ -983,7 +980,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
}
catch(uno::Exception&)
{
- aArgName = rtl::OUString::createFromAscii( "###" );
+ aArgName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "###" ));
}
rtl::OUString aArgDesc;
try
@@ -993,7 +990,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
}
catch(uno::Exception&)
{
- aArgName = rtl::OUString::createFromAscii( "###" );
+ aArgName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "###" ));
}
sal_Bool bOptional =
@@ -1048,7 +1045,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
void lcl_UpdateFunctionList( ScFunctionList& rFunctionList, const ScUnoAddInFuncData& rFuncData )
{
- String aCompare = rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData
+ ::rtl::OUString aCompare = rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData
sal_uLong nCount = rFunctionList.GetCount();
for (sal_uLong nPos=0; nPos<nCount; nPos++)
@@ -1097,8 +1094,8 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface
if ( xManager.is() )
{
uno::Reference<beans::XIntrospection> xIntro(
- xManager->createInstance(rtl::OUString::createFromAscii(
- "com.sun.star.beans.Introspection" )),
+ xManager->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.beans.Introspection" ))),
uno::UNO_QUERY );
if ( xIntro.is() )
{
@@ -1144,12 +1141,12 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface
for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
{
if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN )
- bValid = sal_False;
+ bValid = false;
uno::Reference<reflection::XIdlClass> xParClass =
pParArr[nParamPos].aType;
ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
if ( eArgType == SC_ADDINARG_NONE )
- bValid = sal_False;
+ bValid = false;
else if ( eArgType == SC_ADDINARG_CALLER )
nCallerPos = nParamPos;
else
@@ -1227,14 +1224,6 @@ String ScUnoAddInCollection::FindFunction( const String& rUpperName, sal_Bool bL
ScAddInHashMap::const_iterator iLook( pLocalHashMap->find( rUpperName ) );
if ( iLook != pLocalHashMap->end() )
return iLook->second->GetOriginalName();
-
-#if 0
- // after that, scan international names (really?)
-
- iLook = pNameHashMap->find( rUpperName );
- if ( iLook != pNameHashMap->end() )
- return iLook->second->GetOriginalName();
-#endif
}
else
{
@@ -1313,14 +1302,13 @@ sal_Bool ScUnoAddInCollection::FillFunctionDesc( long nFunc, ScFuncDesc& rDesc )
Initialize();
if (nFunc >= nFuncCount || !ppFuncData[nFunc])
- return sal_False;
+ return false;
const ScUnoAddInFuncData& rFuncData = *ppFuncData[nFunc];
return FillFunctionDescFromData( rFuncData, rDesc );
}
-// static
sal_Bool ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& rFuncData, ScFuncDesc& rDesc )
{
rDesc.Clear();
@@ -1329,42 +1317,42 @@ sal_Bool ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncDat
long nArgCount = rFuncData.GetArgumentCount();
if ( nArgCount > USHRT_MAX )
- return sal_False;
+ return false;
if ( bIncomplete )
nArgCount = 0; // if incomplete, fill without argument info (no wrong order)
// nFIndex is set from outside
- rDesc.pFuncName = new String( rFuncData.GetUpperLocal() ); //! upper?
+ rDesc.pFuncName = new ::rtl::OUString( rFuncData.GetUpperLocal() ); //! upper?
rDesc.nCategory = rFuncData.GetCategory();
rDesc.sHelpId = rFuncData.GetHelpId();
String aDesc = rFuncData.GetDescription();
if (!aDesc.Len())
aDesc = rFuncData.GetLocalName(); // use name if no description is available
- rDesc.pFuncDesc = new String( aDesc );
+ rDesc.pFuncDesc = new ::rtl::OUString( aDesc );
// AddInArgumentType_CALLER is already left out in FuncData
rDesc.nArgCount = (sal_uInt16)nArgCount;
if ( nArgCount )
{
- sal_Bool bMultiple = sal_False;
+ sal_Bool bMultiple = false;
const ScAddInArgDesc* pArgs = rFuncData.GetArguments();
- rDesc.ppDefArgNames = new String*[nArgCount];
- rDesc.ppDefArgDescs = new String*[nArgCount];
+ rDesc.ppDefArgNames = new ::rtl::OUString*[nArgCount];
+ rDesc.ppDefArgDescs = new ::rtl::OUString*[nArgCount];
rDesc.pDefArgFlags = new ScFuncDesc::ParameterFlags[nArgCount];
for ( long nArg=0; nArg<nArgCount; nArg++ )
{
- rDesc.ppDefArgNames[nArg] = new String( pArgs[nArg].aName );
- rDesc.ppDefArgDescs[nArg] = new String( pArgs[nArg].aDescription );
+ rDesc.ppDefArgNames[nArg] = new ::rtl::OUString( pArgs[nArg].aName );
+ rDesc.ppDefArgDescs[nArg] = new ::rtl::OUString( pArgs[nArg].aDescription );
rDesc.pDefArgFlags[nArg].bOptional = pArgs[nArg].bOptional;
rDesc.pDefArgFlags[nArg].bSuppress = false;
// no empty names...
- if ( rDesc.ppDefArgNames[nArg]->Len() == 0 )
+ if ( rDesc.ppDefArgNames[nArg]->getLength() == 0 )
{
String aDefName( RTL_CONSTASCII_USTRINGPARAM("arg") );
aDefName += String::CreateFromInt32( nArg+1 );
@@ -1390,7 +1378,7 @@ sal_Bool ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncDat
ScUnoAddInCall::ScUnoAddInCall( ScUnoAddInCollection& rColl, const String& rName,
long nParamCount ) :
- bValidCount( sal_False ),
+ bValidCount( false ),
nErrCode( errNoCode ), // before function was called
bHasString( sal_True ),
fValue( 0.0 ),
@@ -1417,7 +1405,7 @@ ScUnoAddInCall::ScUnoAddInCall( ScUnoAddInCollection& rColl, const String& rName
bValidCount = sal_True;
for (long i=nParamCount; i<nDescCount; i++)
if ( !pArgs[i].bOptional )
- bValidCount = sal_False;
+ bValidCount = false;
}
// else invalid (too many arguments)
@@ -1485,14 +1473,14 @@ void ScUnoAddInCall::SetParam( long nPos, const uno::Any& rValue )
aVarArg.getArray()[nVarPos] = rValue;
else
{
- DBG_ERROR("wrong argument number");
+ OSL_FAIL("wrong argument number");
}
}
else if ( nPos < aArgs.getLength() )
aArgs.getArray()[nPos] = rValue;
else
{
- DBG_ERROR("wrong argument number");
+ OSL_FAIL("wrong argument number");
}
}
}
@@ -1522,7 +1510,7 @@ void ScUnoAddInCall::ExecuteCall()
long nCallPos = pFuncData->GetCallerPos();
if (nCallPos>nUserLen) // should not happen
{
- DBG_ERROR("wrong CallPos");
+ OSL_FAIL("wrong CallPos");
nCallPos = nUserLen;
}
@@ -1572,12 +1560,7 @@ void ScUnoAddInCall::ExecuteCallWithArgs(uno::Sequence<uno::Any>& rCallArgs)
{
nErrCode = errIllegalArgument;
}
-#if 0
- catch(FloatingPointException&)
- {
- nErrCode = errIllegalFPOperation;
- }
-#endif
+
catch(reflection::InvocationTargetException& rWrapped)
{
if ( rWrapped.TargetException.getValueType().equals(
@@ -1628,7 +1611,7 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes )
{
uno::TypeClass eMyClass;
ScApiTypeConversion::ConvertAnyToDouble( fValue, eMyClass, rNewRes);
- bHasString = sal_False;
+ bHasString = false;
}
break;
@@ -1681,17 +1664,16 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes )
xMatrix = new ScMatrix(
static_cast<SCSIZE>(nMaxColCount),
static_cast<SCSIZE>(nRowCount) );
- ScMatrix* pMatrix = xMatrix;
for (nRow=0; nRow<nRowCount; nRow++)
{
long nColCount = pRowArr[nRow].getLength();
const sal_Int32* pColArr = pRowArr[nRow].getConstArray();
for (nCol=0; nCol<nColCount; nCol++)
- pMatrix->PutDouble( pColArr[nCol],
+ xMatrix->PutDouble( pColArr[nCol],
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
for (nCol=nColCount; nCol<nMaxColCount; nCol++)
- pMatrix->PutDouble( 0.0,
+ xMatrix->PutDouble( 0.0,
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
}
@@ -1724,17 +1706,16 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes )
xMatrix = new ScMatrix(
static_cast<SCSIZE>(nMaxColCount),
static_cast<SCSIZE>(nRowCount) );
- ScMatrix* pMatrix = xMatrix;
for (nRow=0; nRow<nRowCount; nRow++)
{
long nColCount = pRowArr[nRow].getLength();
const double* pColArr = pRowArr[nRow].getConstArray();
for (nCol=0; nCol<nColCount; nCol++)
- pMatrix->PutDouble( pColArr[nCol],
+ xMatrix->PutDouble( pColArr[nCol],
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
for (nCol=nColCount; nCol<nMaxColCount; nCol++)
- pMatrix->PutDouble( 0.0,
+ xMatrix->PutDouble( 0.0,
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
}
@@ -1767,17 +1748,16 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes )
xMatrix = new ScMatrix(
static_cast<SCSIZE>(nMaxColCount),
static_cast<SCSIZE>(nRowCount) );
- ScMatrix* pMatrix = xMatrix;
for (nRow=0; nRow<nRowCount; nRow++)
{
long nColCount = pRowArr[nRow].getLength();
const rtl::OUString* pColArr = pRowArr[nRow].getConstArray();
for (nCol=0; nCol<nColCount; nCol++)
- pMatrix->PutString( String( pColArr[nCol] ),
+ xMatrix->PutString( String( pColArr[nCol] ),
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
for (nCol=nColCount; nCol<nMaxColCount; nCol++)
- pMatrix->PutString( EMPTY_STRING,
+ xMatrix->PutString( EMPTY_STRING,
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
}
@@ -1799,4 +1779,4 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes )
//------------------------------------------------------------------------
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/addinhelpid.cxx b/sc/source/core/tool/addinhelpid.cxx
index 3f261fd3917c..02fe446f4293 100644
--- a/sc/source/core/tool/addinhelpid.cxx
+++ b/sc/source/core/tool/addinhelpid.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -159,11 +160,6 @@ const ScUnoAddInHelpId pDateFuncHelpIds[] =
// ============================================================================
-//UNUSED2008-05 ScUnoAddInHelpIdGenerator::ScUnoAddInHelpIdGenerator() :
-//UNUSED2008-05 pCurrHelpIds( NULL ),
-//UNUSED2008-05 nArrayCount( 0 )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
ScUnoAddInHelpIdGenerator::ScUnoAddInHelpIdGenerator( const ::rtl::OUString& rServiceName )
{
@@ -175,12 +171,12 @@ void ScUnoAddInHelpIdGenerator::SetServiceName( const ::rtl::OUString& rServiceN
pCurrHelpIds = NULL;
sal_uInt32 nSize = 0;
- if( rServiceName.equalsAscii( "com.sun.star.sheet.addin.Analysis" ) )
+ if( rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sheet.addin.Analysis" ) ) )
{
pCurrHelpIds = pAnalysisHelpIds;
nSize = sizeof( pAnalysisHelpIds );
}
- else if( rServiceName.equalsAscii( "com.sun.star.sheet.addin.DateFunctions" ) )
+ else if( rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sheet.addin.DateFunctions" ) ) )
{
pCurrHelpIds = pDateFuncHelpIds;
nSize = sizeof( pDateFuncHelpIds );
@@ -215,3 +211,4 @@ rtl::OString ScUnoAddInHelpIdGenerator::GetHelpId( const ::rtl::OUString& rFuncN
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx
index c43702c4ae1e..267d006cf55c 100644
--- a/sc/source/core/tool/addinlis.cxx
+++ b/sc/source/core/tool/addinlis.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,44 +29,31 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
-#include <tools/debug.hxx>
#include <sfx2/objsh.hxx>
-
+#include <vcl/svapp.hxx>
#include "addinlis.hxx"
-#include "miscuno.hxx" // SC_IMPL_SERVICE_INFO
+#include "miscuno.hxx" // SC_IMPL_SERVICE_INFO
#include "document.hxx"
#include "brdcst.hxx"
-#include "unoguard.hxx"
#include "sc.hrc"
using namespace com::sun::star;
-//------------------------------------------------------------------------
-
-//SMART_UNO_IMPLEMENTATION( ScAddInListener, UsrObject );
-
SC_SIMPLE_SERVICE_INFO( ScAddInListener, "ScAddInListener", "stardiv.one.sheet.AddInListener" )
-//------------------------------------------------------------------------
+::std::list<ScAddInListener*> ScAddInListener::aAllListeners;
-List ScAddInListener::aAllListeners;
-
-//------------------------------------------------------------------------
-
-// static
ScAddInListener* ScAddInListener::CreateListener(
uno::Reference<sheet::XVolatileResult> xVR, ScDocument* pDoc )
{
ScAddInListener* pNew = new ScAddInListener( xVR, pDoc );
- pNew->acquire(); // for aAllListeners
- aAllListeners.Insert( pNew, LIST_APPEND );
+ pNew->acquire(); // for aAllListeners
+ aAllListeners.push_back( pNew );
if ( xVR.is() )
- xVR->addResultListener( pNew ); // after at least 1 ref exists!
+ xVR->addResultListener( pNew ); // after at least 1 ref exists!
return pNew;
}
@@ -82,78 +70,61 @@ ScAddInListener::~ScAddInListener()
delete pDocs;
}
-// static
ScAddInListener* ScAddInListener::Get( uno::Reference<sheet::XVolatileResult> xVR )
{
+ ScAddInListener* pLst = NULL;
sheet::XVolatileResult* pComp = xVR.get();
- sal_uLong nCount = aAllListeners.Count();
- for (sal_uLong nPos=0; nPos<nCount; nPos++)
+ for(::std::list<ScAddInListener*>::iterator iter = aAllListeners.begin(); iter != aAllListeners.end(); ++iter)
{
- ScAddInListener* pLst = (ScAddInListener*)aAllListeners.GetObject(nPos);
- if ( pComp == (sheet::XVolatileResult*)pLst->xVolRes.get() )
- return pLst;
+ if ( pComp == (sheet::XVolatileResult*)(*iter)->xVolRes.get() )
+ {
+ pLst = *iter;
+ break;
+ }
}
- return NULL; // not found
+ return pLst;
}
//! move to some container object?
-// static
void ScAddInListener::RemoveDocument( ScDocument* pDocumentP )
{
- sal_uLong nPos = aAllListeners.Count();
- while (nPos)
+ ::std::list<ScAddInListener*>::iterator iter = aAllListeners.begin();
+ while(iter != aAllListeners.end())
{
- // loop backwards because elements are removed
- --nPos;
- ScAddInListener* pLst = (ScAddInListener*)aAllListeners.GetObject(nPos);
- ScAddInDocs* p = pLst->pDocs;
+ ScAddInDocs* p = (*iter)->pDocs;
sal_uInt16 nFoundPos;
if ( p->Seek_Entry( pDocumentP, &nFoundPos ) )
{
p->Remove( nFoundPos );
if ( p->Count() == 0 )
{
- // this AddIn is no longer used
- // dont delete, just remove the ref for the list
+ if ( (*iter)->xVolRes.is() )
+ (*iter)->xVolRes->removeResultListener( *iter );
- aAllListeners.Remove( nPos );
+ (*iter)->release(); // Ref for aAllListeners - pLst may be deleted here
- if ( pLst->xVolRes.is() )
- pLst->xVolRes->removeResultListener( pLst );
+ // this AddIn is no longer used
+ // dont delete, just remove the ref for the list
- pLst->release(); // Ref for aAllListeners - pLst may be deleted here
+ iter = aAllListeners.erase( iter );
+ continue;
}
}
+ ++iter;
}
}
-//------------------------------------------------------------------------
-
// XResultListener
void SAL_CALL ScAddInListener::modified( const ::com::sun::star::sheet::ResultEvent& aEvent )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard; //! or generate a UserEvent
-
- aResult = aEvent.Value; // store result
+ SolarMutexGuard aGuard; //! or generate a UserEvent
- if ( !HasListeners() )
- {
- //! remove from list and removeListener, as in RemoveDocument ???
-
-#if 0
- //! this will crash if called before first StartListening !!!
- aAllListeners.Remove( this );
- if ( xVolRes.is() )
- xVolRes->removeResultListener( this );
- release(); // Ref for aAllListeners - this may be deleted here
- return;
-#endif
- }
+ aResult = aEvent.Value; // store result
- // notify document of changes
+ // notify document of changes
Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) );
@@ -183,8 +154,4 @@ void SAL_CALL ScAddInListener::disposing( const ::com::sun::star::lang::EventObj
}
}
-
-//------------------------------------------------------------------------
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 26a194b731ef..5c058c1a26f3 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,9 +44,10 @@
#include <com/sun/star/sheet/ExternalLinkType.hpp>
#include <sfx2/objsh.hxx>
#include <tools/urlobj.hxx>
+
using namespace ::com::sun::star;
+using ::rtl::OUString;
-////////////////////////////////////////////////////////////////////////////
const ScAddress::Details ScAddress::detailsOOOa1( formula::FormulaGrammar::CONV_OOO, 0, 0 );
ScAddress::Details::Details ( const ScDocument* pDoc,
@@ -56,13 +58,6 @@ ScAddress::Details::Details ( const ScDocument* pDoc,
{
}
-//UNUSED2009-05 void ScAddress::Details::SetPos ( const ScDocument* pDoc,
-//UNUSED2009-05 const ScAddress & rAddr )
-//UNUSED2009-05 {
-//UNUSED2009-05 nRow = rAddr.Row();
-//UNUSED2009-05 nCol = rAddr.Col();
-//UNUSED2009-05 eConv = pDoc->GetAddressConvention();
-//UNUSED2009-05 }
////////////////////////////////////////////////////////////////////////////
@@ -299,7 +294,7 @@ lcl_XL_ParseSheetRef( const sal_Unicode* start,
p = start;
break;
}
- only_digits = sal_False;
+ only_digits = false;
p++;
}
else if( CharClass::isAsciiDigit( uc ))
@@ -638,13 +633,6 @@ lcl_ScRange_Parse_XL_R1C1( ScRange& r,
// Keep in mind that nFlags2 gets left-shifted by 4 bits before being merged.
sal_uInt16 nFlags2 = SCA_VALID_TAB;
-#if 0
- {
- ByteString aStr(p, RTL_TEXTENCODING_UTF8);
- aStr.Append(static_cast< char >(0));
- std::cerr << "parse::XL::R1C1 \'" << aStr.GetBuffer() << '\'' << std::endl;
- }
-#endif
p = r.Parse_XL_Header( p, pDoc, aExternDocName, aStartTabName,
aEndTabName, nFlags, bOnlyAcceptSingle, NULL );
@@ -820,13 +808,6 @@ lcl_ScRange_Parse_XL_A1( ScRange& r,
String aExternDocName, aStartTabName, aEndTabName; // for external link table
sal_uInt16 nFlags = SCA_VALID | SCA_VALID_TAB, nFlags2 = SCA_VALID_TAB;
-#if 0
- {
- ByteString aStr(p, RTL_TEXTENCODING_UTF8);
- aStr.Append(static_cast< char >(0));
- std::cerr << "parse::XL::A1 \'" << aStr.GetBuffer() << '\'' << std::endl;
- }
-#endif
p = r.Parse_XL_Header( p, pDoc, aExternDocName, aStartTabName,
aEndTabName, nFlags, bOnlyAcceptSingle, pExternalLinks );
@@ -923,6 +904,21 @@ lcl_ScRange_Parse_XL_A1( ScRange& r,
p = tmp2;
p = lcl_eatWhiteSpace( p+1 );
tmp1 = lcl_a1_get_col( p, &r.aEnd, &nFlags2 );
+ if( !tmp1 && !aEndTabName.Len() ) // Probably the aEndTabName was specified after the first range
+ {
+ p = lcl_XL_ParseSheetRef( p, aEndTabName, false, NULL );
+ if( p )
+ {
+ SCTAB nTab = 0;
+ if( aEndTabName.Len() && pDoc->GetTable( aEndTabName, nTab ) )
+ {
+ r.aEnd.SetTab( nTab );
+ nFlags |= SCA_VALID_TAB2 | SCA_TAB2_3D | SCA_TAB2_ABSOLUTE;
+ }
+ p = lcl_eatWhiteSpace( p+1 );
+ tmp1 = lcl_a1_get_col( p, &r.aEnd, &nFlags2 );
+ }
+ }
if( !tmp1 ) // strange, but valid singleton
return nFlags;
@@ -1015,7 +1011,18 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd
nBits = 0;
if (!bExtDoc && (!pDoc || !pDoc->GetTable( aTab, nTab )))
- nBits = 0;
+ {
+ // Specified table name is not found in this document. Assume this is an external document.
+ bExtDoc = true;
+ aDocName = aTab;
+ xub_StrLen n = aTab.SearchBackward('.');
+ if (n != STRING_NOTFOUND && n > 0)
+ // Extension found. Strip it.
+ aTab.Erase(n);
+ else
+ // No extension found. This is probably not an external document.
+ nBits = 0;
+ }
}
else
{
@@ -1369,12 +1376,12 @@ lcl_ScRange_Parse_OOo( ScRange &aRange, const String& r, ScDocument* pDoc, ScAdd
nRes2 |= SCA_TAB_ABSOLUTE;
}
else
- nRes1 = 0; // #38840# keine Tokens aus halben Sachen
+ nRes1 = 0; // keine Tokens aus halben Sachen
}
}
nRes1 = ( ( nRes1 | nRes2 ) & SCA_VALID )
| nRes1
- | ( ( nRes2 & 0x070F ) << 4 );
+ | ( ( nRes2 & SCA_BITS ) << 4 );
return nRes1;
}
@@ -1431,7 +1438,7 @@ sal_uInt16 ScRange::ParseCols( const String& rStr, ScDocument* pDoc,
if( NULL == p )
return 0;
- pDoc = NULL; // make compiler shutup we may need this later
+ (void)pDoc; // make compiler shutup we may need this later
switch (rDetails.eConv)
{
@@ -1490,7 +1497,7 @@ sal_uInt16 ScRange::ParseRows( const String& rStr, ScDocument* pDoc,
if( NULL == p )
return 0;
- pDoc = NULL; // make compiler shutup we may need this later
+ (void)pDoc; // make compiler shutup we may need this later
switch (rDetails.eConv)
{
@@ -1617,13 +1624,6 @@ getFileNameFromDoc( const ScDocument* pDoc )
sFileName = pShell->GetTitle();
}
}
-#if 0
- {
- ByteString aStr( sFileName, RTL_TEXTENCODING_UTF8 );
- aStr.Append(static_cast< char >(0));
- std::cerr << "docname \'" << aStr.GetBuffer() << '\'' << std::endl;
- }
-#endif
return sFileName;
}
@@ -1640,7 +1640,6 @@ void ScAddress::Format( String& r, sal_uInt16 nFlags, ScDocument* pDoc,
r = ScGlobal::GetRscString( STR_NOREF_STR );
return;
}
-// if( nFlags & ( SCA_TAB_ABSOLUTE | SCA_TAB_3D ) )
if( nFlags & SCA_TAB_3D )
{
String aTabName, aDocName;
@@ -1721,13 +1720,6 @@ lcl_Split_DocTab( const ScDocument* pDoc, SCTAB nTab,
{
pDoc->GetName( nTab, rTabName );
rDocName.Erase();
-#if 0
- {
- ByteString aStr(rTabName, RTL_TEXTENCODING_UTF8);
- aStr.Append(static_cast< char >(0));
- std::cerr << "tabname \'" << aStr.GetBuffer() << '\'' << std::endl;
- }
-#endif
// External reference, same as in ScCompiler::MakeTabStr()
if ( rTabName.GetChar(0) == '\'' )
{ // "'Doc'#Tab"
@@ -1883,6 +1875,14 @@ void ScRange::Format( String& r, sal_uInt16 nFlags, ScDocument* pDoc,
#undef absrel_differ
}
+void ScRange::Format( OUString& r, sal_uInt16 nFlags, ScDocument* pDoc,
+ const ScAddress::Details& rDetails ) const
+{
+ String aStr;
+ Format(aStr, nFlags, pDoc, rDetails);
+ r = aStr;
+}
+
bool ScAddress::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc )
{
SCsTAB nMaxTab = pDoc ? pDoc->GetTableCount() : MAXTAB+1;
@@ -1891,17 +1891,17 @@ bool ScAddress::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc )
dz = Tab() + dz;
sal_Bool bValid = sal_True;
if( dx < 0 )
- dx = 0, bValid = sal_False;
+ dx = 0, bValid = false;
else if( dx > MAXCOL )
- dx = MAXCOL, bValid =sal_False;
+ dx = MAXCOL, bValid =false;
if( dy < 0 )
- dy = 0, bValid = sal_False;
+ dy = 0, bValid = false;
else if( dy > MAXROW )
- dy = MAXROW, bValid =sal_False;
+ dy = MAXROW, bValid =false;
if( dz < 0 )
- dz = 0, bValid = sal_False;
+ dz = 0, bValid = false;
else if( dz >= nMaxTab )
- dz = nMaxTab-1, bValid =sal_False;
+ dz = nMaxTab-1, bValid =false;
Set( dx, dy, dz );
return bValid;
}
@@ -2027,3 +2027,5 @@ bool AlphaToCol( SCCOL& rCol, const String& rStr)
rCol = nResult;
return bOk;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx
index 37f760b615ac..341aee188fd0 100644
--- a/sc/source/core/tool/adiasync.cxx
+++ b/sc/source/core/tool/adiasync.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,7 +74,7 @@ ScAddInAsync::ScAddInAsync( sal_uLong nHandleP, sal_uInt16 nIndex, ScDocument* p
SvtBroadcaster(),
pStr( NULL ),
nHandle( nHandleP ),
- bValid( sal_False )
+ bValid( false )
{
pDocs = new ScAddInDocs( 1, 1 );
pDocs->Insert( pDoc );
@@ -137,7 +138,7 @@ void ScAddInAsync::CallBack( sal_uLong nHandleP, void* pData )
p->pStr = new String( (sal_Char*)pData, osl_getThreadTextEncoding() );
break;
default :
- DBG_ERROR( "unbekannter AsyncType" );
+ OSL_FAIL( "unbekannter AsyncType" );
return;
}
p->bValid = sal_True;
@@ -185,3 +186,4 @@ void ScAddInAsync::RemoveDocument( ScDocument* pDocumentP )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index 4ff3b20f14b2..616002e1c0c2 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,9 +49,10 @@
#include "miscuno.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
// STATIC DATA -----------------------------------------------------------
#define SC_VERSION ((sal_uInt16)304)
@@ -82,6 +84,9 @@ ScAppOptions::~ScAppOptions()
void ScAppOptions::SetDefaults()
{
+ // Set default tab count for new spreadsheet.
+ nTabCountInNewSpreadsheet = 3;
+
if ( ScOptionsUtil::IsMetricSystem() )
eMetric = FUNIT_CM; // default for countries with metric system
else
@@ -119,6 +124,7 @@ void ScAppOptions::SetDefaults()
const ScAppOptions& ScAppOptions::operator=( const ScAppOptions& rCpy )
{
+ nTabCountInNewSpreadsheet = rCpy.nTabCountInNewSpreadsheet;
eMetric = rCpy.eMetric;
eZoomType = rCpy.eZoomType;
bSynchronizeZoom = rCpy.bSynchronizeZoom;
@@ -304,7 +310,7 @@ Sequence<OUString> ScAppCfg::GetLayoutPropertyNames()
// adjust for metric system
if (ScOptionsUtil::IsMetricSystem())
- pNames[SCLAYOUTOPT_MEASURE] = OUString::createFromAscii( "Other/MeasureUnit/Metric" );
+ pNames[SCLAYOUTOPT_MEASURE] = OUString(RTL_CONSTASCII_USTRINGPARAM( "Other/MeasureUnit/Metric") );
return aNames;
}
@@ -388,12 +394,12 @@ Sequence<OUString> ScAppCfg::GetMiscPropertyNames()
ScAppCfg::ScAppCfg() :
- aLayoutItem( OUString::createFromAscii( CFGPATH_LAYOUT ) ),
- aInputItem( OUString::createFromAscii( CFGPATH_INPUT ) ),
- aRevisionItem( OUString::createFromAscii( CFGPATH_REVISION ) ),
- aContentItem( OUString::createFromAscii( CFGPATH_CONTENT ) ),
- aSortListItem( OUString::createFromAscii( CFGPATH_SORTLIST ) ),
- aMiscItem( OUString::createFromAscii( CFGPATH_MISC ) )
+ aLayoutItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_LAYOUT )) ),
+ aInputItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_INPUT )) ),
+ aRevisionItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_REVISION )) ),
+ aContentItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_CONTENT )) ),
+ aSortListItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_SORTLIST )) ),
+ aMiscItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_MISC )) )
{
sal_Int32 nIntVal = 0;
@@ -743,3 +749,4 @@ void ScAppCfg::OptionsChanged()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 85447b6a8730..7492f52ecaa2 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,10 +56,7 @@
const sal_Char *linker_dummy = "";
-// Standard-Name ist jetzt STR_STYLENAME_STANDARD (wie Vorlagen)
-//static const sal_Char __FAR_DATA cStandardName[] = "Standard";
-
-static const sal_Char __FAR_DATA sAutoTblFmtName[] = "autotbl.fmt";
+static const sal_Char sAutoTblFmtName[] = "autotbl.fmt";
// bis SO5PF
const sal_uInt16 AUTOFORMAT_ID_X = 9501;
@@ -81,11 +79,11 @@ const sal_uInt16 AUTOFORMAT_DATA_ID_641 = 10002;
const sal_uInt16 AUTOFORMAT_ID_680DR14 = 10011;
const sal_uInt16 AUTOFORMAT_DATA_ID_680DR14 = 10012;
-// --- from 680/dr25 on: #21549# store strings as UTF-8
+// --- from 680/dr25 on: store strings as UTF-8
const sal_uInt16 AUTOFORMAT_ID_680DR25 = 10021;
const sal_uInt16 AUTOFORMAT_DATA_ID_680DR25 = 10022;
-// --- from DEV300/overline2 on: #5991# overline support
+// --- from DEV300/overline2 on: overline support
const sal_uInt16 AUTOFORMAT_ID_300OVRLN = 10031;
const sal_uInt16 AUTOFORMAT_DATA_ID_300OVRLN = 10032;
@@ -203,8 +201,8 @@ void ScAfVersions::Write(SvStream& rStream)
rStream << SvxUnderlineItem(UNDERLINE_NONE, ATTR_FONT_UNDERLINE).GetVersion(SOFFICE_FILEFORMAT_40);
rStream << SvxOverlineItem(UNDERLINE_NONE, ATTR_FONT_OVERLINE).GetVersion(SOFFICE_FILEFORMAT_40);
rStream << SvxCrossedOutItem(STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT).GetVersion(SOFFICE_FILEFORMAT_40);
- rStream << SvxContourItem(sal_False, ATTR_FONT_CONTOUR).GetVersion(SOFFICE_FILEFORMAT_40);
- rStream << SvxShadowedItem(sal_False, ATTR_FONT_SHADOWED).GetVersion(SOFFICE_FILEFORMAT_40);
+ rStream << SvxContourItem(false, ATTR_FONT_CONTOUR).GetVersion(SOFFICE_FILEFORMAT_40);
+ rStream << SvxShadowedItem(false, ATTR_FONT_SHADOWED).GetVersion(SOFFICE_FILEFORMAT_40);
rStream << SvxColorItem(ATTR_FONT_COLOR).GetVersion(SOFFICE_FILEFORMAT_40);
rStream << SvxBoxItem(ATTR_BORDER).GetVersion(SOFFICE_FILEFORMAT_40);
rStream << SvxLineItem(SID_FRAME_LINESTYLE).GetVersion(SOFFICE_FILEFORMAT_40);
@@ -244,8 +242,8 @@ ScAutoFormatDataField::ScAutoFormatDataField() :
aUnderline( UNDERLINE_NONE,ATTR_FONT_UNDERLINE ),
aOverline( UNDERLINE_NONE,ATTR_FONT_OVERLINE ),
aCrossedOut( STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT ),
- aContour( sal_False, ATTR_FONT_CONTOUR ),
- aShadowed( sal_False, ATTR_FONT_SHADOWED ),
+ aContour( false, ATTR_FONT_CONTOUR ),
+ aShadowed( false, ATTR_FONT_SHADOWED ),
aColor( ATTR_FONT_COLOR ),
aBox( ATTR_BORDER ),
aTLBR( ATTR_BORDER_TLBR ),
@@ -378,7 +376,7 @@ sal_Bool ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVe
if( 0 == rVersions.nNumFmtVersion )
{
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
aNumFormat.Load( rStream, eCharSet );
}
@@ -473,7 +471,7 @@ sal_Bool ScAutoFormatDataField::Save( SvStream& rStream )
aRotateAngle.Store ( rStream, aRotateAngle.GetVersion( SOFFICE_FILEFORMAT_40 ) );
aRotateMode.Store ( rStream, aRotateMode.GetVersion( SOFFICE_FILEFORMAT_40 ) );
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
aNumFormat.Save( rStream, RTL_TEXTENCODING_UTF8 );
return (rStream.GetError() == 0);
@@ -699,7 +697,7 @@ void ScAutoFormatData::FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, S
rItemSet.Put( rField.GetHeight() );
rItemSet.Put( rField.GetWeight() );
rItemSet.Put( rField.GetPosture() );
- // #103065# do not insert empty CJK font
+ // do not insert empty CJK font
const SvxFontItem& rCJKFont = rField.GetCJKFont();
if( rCJKFont.GetStyleName().Len() )
{
@@ -714,7 +712,7 @@ void ScAutoFormatData::FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, S
rItemSet.Put( rField.GetWeight(), ATTR_CJK_FONT_WEIGHT );
rItemSet.Put( rField.GetPosture(), ATTR_CJK_FONT_POSTURE );
}
- // #103065# do not insert empty CTL font
+ // do not insert empty CTL font
const SvxFontItem& rCTLFont = rField.GetCTLFont();
if( rCTLFont.GetStyleName().Len() )
{
@@ -800,7 +798,7 @@ sal_Bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersion
if( bRet && (nVer == AUTOFORMAT_DATA_ID_X ||
(AUTOFORMAT_DATA_ID_504 <= nVer && nVer <= AUTOFORMAT_DATA_ID)) )
{
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
rStream.ReadByteString( aName, eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVer )
@@ -829,7 +827,7 @@ sal_Bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersion
bRet = GetField( i ).Load( rStream, rVersions, nVer );
}
else
- bRet = sal_False;
+ bRet = false;
return bRet;
}
@@ -856,7 +854,7 @@ sal_Bool ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVers
bRet = GetField( i ).LoadOld( rStream, rVersions );
}
else
- bRet = sal_False;
+ bRet = false;
return bRet;
}
#endif
@@ -866,34 +864,9 @@ sal_Bool ScAutoFormatData::Save(SvStream& rStream)
sal_uInt16 nVal = AUTOFORMAT_DATA_ID;
sal_Bool b;
rStream << nVal;
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 );
-#if 0
- // This was an internal flag to allow creating AutoFormats with localized names
-
- if ( USHRT_MAX == nStrResId )
- {
- String aIniVal( SFX_APP()->GetIniManager()->Get(
- SFX_GROUP_WORKINGSET_IMPL,
- String( RTL_CONSTASCII_USTRINGPARAM( "SaveTableAutoFmtNameId" ))));
- if( 0 != aIniVal.ToInt32() )
- {
- // check Name for ResId
- for( sal_uInt16 nId = RID_SVXSTR_TBLAFMT_BEGIN;
- RID_SVXSTR_TBLAFMT_END > nId; ++nId )
- {
- String s( SVX_RES( nId ) );
- if( s == aName )
- {
- nStrResId = nId - RID_SVXSTR_TBLAFMT_BEGIN;
- break;
- }
- }
- }
- }
-#endif
-
rStream << nStrResId;
rStream << ( b = bIncludeFont );
rStream << ( b = bIncludeJustify );
@@ -914,7 +887,7 @@ sal_Bool ScAutoFormatData::Save(SvStream& rStream)
ScAutoFormat::ScAutoFormat(sal_uInt16 nLim, sal_uInt16 nDel, sal_Bool bDup):
ScSortedCollection (nLim, nDel, bDup),
- bSaveLater (sal_False)
+ bSaveLater (false)
{
// create default autoformat
ScAutoFormatData* pData = new ScAutoFormatData;
@@ -999,7 +972,7 @@ ScAutoFormat::ScAutoFormat(sal_uInt16 nLim, sal_uInt16 nDel, sal_Bool bDup):
ScAutoFormat::ScAutoFormat(const ScAutoFormat& rAutoFormat) :
ScSortedCollection (rAutoFormat),
- bSaveLater (sal_False)
+ bSaveLater (false)
{}
ScAutoFormat::~ScAutoFormat()
@@ -1062,8 +1035,6 @@ sal_Bool ScAutoFormat::Load()
sal_uInt8 nChrSet, nCnt;
long nPos = rStream.Tell();
rStream >> nCnt >> nChrSet;
-// if( 4 <= nCnt )
-// rStream >> nFileVers;
if( rStream.Tell() != sal_uLong(nPos + nCnt) )
{
DBG_ERRORFILE( "Der Header enthaelt mehr/neuere Daten" );
@@ -1127,12 +1098,12 @@ sal_Bool ScAutoFormat::Load()
}
}
else
- bRet = sal_False;
+ bRet = false;
}
#endif
}
}
- bSaveLater = sal_False;
+ bSaveLater = false;
return bRet;
}
@@ -1160,9 +1131,6 @@ sal_Bool ScAutoFormat::Save()
<< (sal_uInt8)2 // Anzahl von Zeichen des Headers incl. diesem
<< (sal_uInt8)::GetSOStoreTextEncoding(
gsl_getSystemTextEncoding(), sal::static_int_cast<sal_uInt16>(rStream.GetVersion()) );
-// << (sal_uInt8)4 // Anzahl von Zeichen des Headers incl. diesem
-// << (sal_uInt8)::GetStoreCharSet(::GetSystemCharSet())
-// << (UNIT16)SOFFICE_FILEFORMAT_NOW;
ScAfVersions::Write(rStream); // Item-Versionen
bRet = (rStream.GetError() == 0);
@@ -1175,7 +1143,7 @@ sal_Bool ScAutoFormat::Save()
aMedium.Commit();
}
- bSaveLater = sal_False;
+ bSaveLater = false;
return bRet;
}
@@ -1198,3 +1166,4 @@ sal_uInt16 ScAutoFormat::FindIndexPerName( const String& rName ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx
index f13420c8733f..67d5d913fc96 100644
--- a/sc/source/core/tool/callform.cxx
+++ b/sc/source/core/tool/callform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,15 +80,6 @@ typedef void (CALLTYPE* FARPROC) ( void );
}
-#if defined(OS2) && defined(BLC)
-#define GETFUNCTIONCOUNT "_GetFunctionCount"
-#define GETFUNCTIONDATA "_GetFunctionData"
-#define SETLANGUAGE "_SetLanguage"
-#define GETPARAMDESC "_GetParameterDescription"
-#define ISASYNC "_IsAsync"
-#define ADVICE "_Advice"
-#define UNADVICE "_Unadvice"
-#else // Pascal oder extern "C"
#define GETFUNCTIONCOUNT "GetFunctionCount"
#define GETFUNCTIONDATA "GetFunctionData"
#define SETLANGUAGE "SetLanguage"
@@ -95,7 +87,6 @@ typedef void (CALLTYPE* FARPROC) ( void );
#define ISASYNC "IsAsync"
#define ADVICE "Advice"
#define UNADVICE "Unadvice"
-#endif
#define LIBFUNCNAME( name ) \
(String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( name ) ))
@@ -105,7 +96,6 @@ typedef void (CALLTYPE* FARPROC) ( void );
FuncData::FuncData(const String& rIName) :
pModuleData (NULL),
aInternalName (rIName),
-// aFuncName (""),
nNumber (0),
nParamCount (0),
eAsyncType (NONE)
@@ -186,7 +176,7 @@ public:
class ModuleCollection : public ScSortedCollection
{
public:
- ModuleCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = sal_False) : ScSortedCollection ( nLim, nDel, bDup ) {}
+ ModuleCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false) : ScSortedCollection ( nLim, nDel, bDup ) {}
ModuleCollection(const ModuleCollection& rModuleCollection) : ScSortedCollection ( rModuleCollection ) {}
virtual ScDataObject* Clone() const { return new ModuleCollection(*this); }
@@ -230,12 +220,12 @@ sal_Bool InitExternalFunc(const rtl::OUString& rModuleName)
// Module schon geladen?
const ModuleData* pTemp;
if (aModuleCollection.SearchModule(aModuleName, pTemp))
- return sal_False;
+ return false;
rtl::OUString aNP;
aNP = rModuleName;
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
osl::Module* pLib = new osl::Module( aNP );
if (pLib->is())
{
@@ -270,7 +260,7 @@ sal_Bool InitExternalFunc(const rtl::OUString& rModuleName)
sal_uInt16 nParamCount;
ParamType eParamType[MAXFUNCPARAM];
ParamType eAsyncType = NONE;
- // #62113# alles initialisieren, falls das AddIn sich schlecht verhaelt
+ // alles initialisieren, falls das AddIn sich schlecht verhaelt
cFuncName[0] = 0;
cInternalName[0] = 0;
nParamCount = 0;
@@ -323,7 +313,7 @@ void ExitExternalFunc()
sal_Bool FuncData::Call(void** ppParam)
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
osl::Module* pLib = pModuleData->GetInstance();
FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(aFuncName);
if (fProc != NULL)
@@ -418,7 +408,7 @@ sal_Bool FuncData::Call(void** ppParam)
sal_Bool FuncData::Unadvice( double nHandle )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
osl::Module* pLib = pModuleData->GetInstance();
FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(LIBFUNCNAME(UNADVICE));
if (fProc != NULL)
@@ -433,15 +423,12 @@ sal_Bool FuncData::Unadvice( double nHandle )
const String& FuncData::GetModuleName() const
{
- // DBG_ASSERT( pModuleData, "Keine Arme, keine Kekse" ):
return pModuleData->GetName();
}
-//------------------------------------------------------------------------
-
-sal_Bool FuncData::GetParamDesc( String& aName, String& aDesc, sal_uInt16 nParam )
+bool FuncData::getParamDesc( ::rtl::OUString& aName, ::rtl::OUString& aDesc, sal_uInt16 nParam )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if ( nParam <= nParamCount )
{
osl::Module* pLib = pModuleData->GetInstance();
@@ -453,17 +440,17 @@ sal_Bool FuncData::GetParamDesc( String& aName, String& aDesc, sal_uInt16 nParam
*pcName = *pcDesc = 0;
sal_uInt16 nFuncNo = nNumber; // nicht per Reference versauen lassen..
((::GetParamDesc)fProc)( nFuncNo, nParam, pcName, pcDesc );
- aName = String( pcName, osl_getThreadTextEncoding() );
- aDesc = String( pcDesc, osl_getThreadTextEncoding() );
- bRet = sal_True;
+ aName = ::rtl::OUString( pcName, 256, osl_getThreadTextEncoding() );
+ aDesc = ::rtl::OUString( pcDesc, 256, osl_getThreadTextEncoding() );
+ bRet = true;
}
}
if ( !bRet )
{
- aName.Erase();
- aDesc.Erase();
+ aName = ::rtl::OUString();
+ aDesc = ::rtl::OUString();
}
return bRet;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index e7108d43824f..48be5206566b 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,12 +107,12 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
pFCell->GetFormula( rString );
else
{
- // #62160# Ein via Interpreter gestartetes Makro, das hart
- // auf Formelzellen zugreift, bekommt einen CellText, auch
- // wenn dadurch ein weiterer Interpreter gestartet wird,
- // aber nicht wenn diese Zelle gerade interpretiert wird.
- // IdleCalc startet generell keine weiteren Interpreter,
- // um keine Err522 (zirkulaer) zu bekommen.
+ // A macro started from the interpreter, which has
+ // access to Formular Cells, becomes a CellText, even if
+ // that triggers further interpretation, except if those
+ // cells are already being interpreted.
+ // IdleCalc generally doesn't trigger futher interpretation,
+ // as not to get Err522 (circular).
if ( pFCell->GetDocument()->IsInInterpreter() &&
(!pFCell->GetDocument()->GetMacroInterpretLevel()
|| pFCell->IsRunning()) )
@@ -122,7 +123,7 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
{
sal_uInt16 nErrCode = pFCell->GetErrCode();
- // erst nach dem Interpretieren (GetErrCode) das Zahlformat holen:
+ // get the number format only after interpretation (GetErrCode):
if ( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 )
nFormat = pFCell->GetStandardFormat( rFormatter,
nFormat );
@@ -214,3 +215,4 @@ void ScCellFormat::GetInputString( ScBaseCell* pCell, sal_uLong nFormat, String&
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index 4db8c22d19d8..1932d3a2687c 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
using ::com::sun::star::lang::Locale;
using ::com::sun::star::uno::Sequence;
using ::std::list;
-using ::std::hash_map;
+using ::boost::unordered_map;
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -230,3 +231,5 @@ void ScCellKeywordTranslator::addToMap(const TransItem* pItems, const Locale& rL
for (sal_uInt16 i = 0; pItems[i].from != NULL; ++i)
addToMap(String(pItems[i].from), pItems[i].to, rLocale, pItems[i].func);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/cellkeywords.inl b/sc/source/core/tool/cellkeywords.inl
index 9fb58c02797b..5060b366e554 100644
--- a/sc/source/core/tool/cellkeywords.inl
+++ b/sc/source/core/tool/cellkeywords.inl
@@ -3,7 +3,7 @@
// ---------------------------------------------------------------------------
// French language locale (automatically generated)
// ---------------------------------------------------------------------------
-static const Locale aFr(OUString::createFromAscii("fr"), OUString(), OUString());
+static const Locale aFr(OUString(RTL_CONSTASCII_USTRINGPARAM("fr")), OUString(), OUString());
// pre instantiations of localized function names
static const sal_Unicode cell_address_fr[] = {
@@ -58,7 +58,7 @@ addToMap(pFr, aFr);
// ---------------------------------------------------------------------------
// Hungarian language locale (automatically generated)
// ---------------------------------------------------------------------------
-static const Locale aHu(OUString::createFromAscii("hu"), OUString(), OUString());
+static const Locale aHu(OUString(RTL_CONSTASCII_USTRINGPARAM("hu")), OUString(), OUString());
// pre instantiations of localized function names
static const sal_Unicode cell_address_hu[] = {
@@ -128,7 +128,7 @@ addToMap(pHu, aHu);
// ---------------------------------------------------------------------------
// German language locale (automatically generated)
// ---------------------------------------------------------------------------
-static const Locale aDe(OUString::createFromAscii("de"), OUString(), OUString());
+static const Locale aDe(OUString(RTL_CONSTASCII_USTRINGPARAM("de")), OUString(), OUString());
// pre instantiations of localized function names
static const sal_Unicode cell_row_de[] = {
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx
index ec48a27fed80..6148dac2fa11 100644
--- a/sc/source/core/tool/chartarr.cxx
+++ b/sc/source/core/tool/chartarr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,12 +129,12 @@ sal_Bool ScChartArray::operator==(const ScChartArray& rCmp) const
ScMemChart* ScChartArray::CreateMemChart()
{
ScRangeListRef aRangeListRef(GetRangeList());
- sal_uLong nCount = aRangeListRef->Count();
+ size_t nCount = aRangeListRef->size();
if ( nCount > 1 )
return CreateMemChartMulti();
else if ( nCount == 1 )
{
- ScRange* pR = aRangeListRef->First();
+ ScRange* pR = aRangeListRef->front();
if ( pR->aStart.Tab() != pR->aEnd.Tab() )
return CreateMemChartMulti();
else
@@ -162,19 +163,19 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
SCROW nRow2;
SCTAB nTab2;
ScRangeListRef aRangeListRef(GetRangeList());
- aRangeListRef->First()->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+ aRangeListRef->front()->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
SCCOL nStrCol = nCol1; // fuer Beschriftung merken
SCROW nStrRow = nRow1;
// Skip hidden columns.
// TODO: make use of last column value once implemented.
SCCOL nLastCol = -1;
- while (pDocument->ColHidden(nCol1, nTab1, nLastCol))
+ while (pDocument->ColHidden(nCol1, nTab1, NULL, &nLastCol))
++nCol1;
// Skip hidden rows.
SCROW nLastRow = -1;
- if (pDocument->RowHidden(nRow1, nTab1, nLastRow))
+ if (pDocument->RowHidden(nRow1, nTab1, NULL, &nLastRow))
nRow1 = nLastRow + 1;
// falls alles hidden ist, bleibt die Beschriftung am Anfang
@@ -195,7 +196,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
for (SCSIZE i=0; i<nTotalCols; i++)
{
SCCOL nThisCol = sal::static_int_cast<SCCOL>(nCol1+i);
- if (!pDocument->ColHidden(nThisCol, nTab1, nLastCol))
+ if (!pDocument->ColHidden(nThisCol, nTab1, NULL, &nLastCol))
aCols.push_back(nThisCol);
}
SCSIZE nColCount = aCols.size();
@@ -209,7 +210,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
SCROW nThisRow = nRow1;
while (nThisRow <= nRow2)
{
- if (pDocument->RowHidden(nThisRow, nTab1, nLastRow))
+ if (pDocument->RowHidden(nThisRow, nTab1, NULL, &nLastRow))
nThisRow = nLastRow;
else
aRows.push_back(nThisRow);
@@ -228,13 +229,13 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
sal_Bool bValidData = sal_True;
if ( !nColCount )
{
- bValidData = sal_False;
+ bValidData = false;
nColCount = 1;
aCols.push_back(nStrCol);
}
if ( !nRowCount )
{
- bValidData = sal_False;
+ bValidData = false;
nRowCount = 1;
aRows.push_back(nStrRow);
}
@@ -247,8 +248,6 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
static_cast<short>(nColCount), static_cast<short>(nRowCount) );
if (pMemChart)
{
-// SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
-// pMemChart->SetNumberFormatter( pFormatter );
if ( bValidData )
{
sal_Bool bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown();
@@ -307,16 +306,11 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
{
aString = ScGlobal::GetRscString(STR_COLUMN);
aString += ' ';
-// aString += String::CreateFromInt32( pCols[nCol]+1 );
ScAddress aPos( aCols[ nCol ], 0, 0 );
aPos.Format( aColStr, SCA_VALID_COL, NULL );
aString += aColStr;
}
pMemChart->SetColText( static_cast<short>(nCol), aString);
-
-// sal_uLong nNumberAttr = (nTotalRows ? pDocument->GetNumberFormat(
-// ScAddress( pCols[nCol], nRow1, nTab1)) : 0);
-// pMemChart->SetNumFormatIdCol( static_cast<long>(nCol), nNumberAttr );
}
//
@@ -338,37 +332,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
aString += String::CreateFromInt32( aRows[nRow]+1 );
}
pMemChart->SetRowText( static_cast<short>(nRow), aString);
-
-// sal_uLong nNumberAttr = (nTotalCols ? pDocument->GetNumberFormat(
-// ScAddress( nCol1, pRows[nRow], nTab1)) : 0);
-// pMemChart->SetNumFormatIdRow( static_cast<long>(nRow), nNumberAttr );
}
-
- //
- // Titel
- //
-
-// pMemChart->SetMainTitle(ScGlobal::GetRscString(STR_CHART_MAINTITLE));
-// pMemChart->SetSubTitle(ScGlobal::GetRscString(STR_CHART_SUBTITLE));
-// pMemChart->SetXAxisTitle(ScGlobal::GetRscString(STR_CHART_XTITLE));
-// pMemChart->SetYAxisTitle(ScGlobal::GetRscString(STR_CHART_YTITLE));
-// pMemChart->SetZAxisTitle(ScGlobal::GetRscString(STR_CHART_ZTITLE));
-
- //
- // Zahlen-Typ
- //
-
-// sal_uLong nNumberAttr = (nTotalCols && nTotalRows ?
-// pDocument->GetNumberFormat( ScAddress( nCol1, nRow1, nTab1)) :
-// 0);
-// if (pFormatter)
-// pMemChart->SetDataType(pFormatter->GetType( nNumberAttr ));
-
- //
- // Parameter-Strings
- //
-
-// SetExtraStrings( *pMemChart );
}
return pMemChart;
@@ -379,9 +343,6 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
SCSIZE nColCount = GetPositionMap()->GetColCount();
SCSIZE nRowCount = GetPositionMap()->GetRowCount();
- SCSIZE nCol = 0;
- SCSIZE nRow = 0;
-
// May happen at least with more than 32k rows.
if (nColCount > SHRT_MAX || nRowCount > SHRT_MAX)
{
@@ -392,12 +353,12 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
sal_Bool bValidData = sal_True;
if ( !nColCount )
{
- bValidData = sal_False;
+ bValidData = false;
nColCount = 1;
}
if ( !nRowCount )
{
- bValidData = sal_False;
+ bValidData = false;
nRowCount = 1;
}
@@ -409,7 +370,8 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
static_cast<short>(nColCount), static_cast<short>(nRowCount) );
if (pMemChart)
{
-// pMemChart->SetNumberFormatter( pDocument->GetFormatTable() );
+ SCSIZE nCol = 0;
+ SCSIZE nRow = 0;
sal_Bool bCalcAsShown = pDocument->GetDocOptions().IsCalcAsShown();
sal_uLong nIndex = 0;
if (bValidData)
@@ -504,16 +466,9 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
nPosCol++;
ScAddress aPos( nPosCol - 1, 0, 0 );
aPos.Format( aColStr, SCA_VALID_COL, NULL );
-// aString += String::CreateFromInt32( nPosCol );
aString += aColStr;
}
pMemChart->SetColText( static_cast<short>(nCol), aString);
-
-// sal_uLong nNumberAttr = 0;
-// pPos = GetPositionMap()->GetPosition( nCol, 0 );
-// if ( pPos )
-// nNumberAttr = pDocument->GetNumberFormat( *pPos );
-// pMemChart->SetNumFormatIdCol( static_cast<long>(nCol), nNumberAttr );
}
//
@@ -541,47 +496,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
aString += String::CreateFromInt32( nPosRow );
}
pMemChart->SetRowText( static_cast<short>(nRow), aString);
-
-// sal_uLong nNumberAttr = 0;
-// pPos = GetPositionMap()->GetPosition( 0, nRow );
-// if ( pPos )
-// nNumberAttr = pDocument->GetNumberFormat( *pPos );
-// pMemChart->SetNumFormatIdRow( static_cast<long>(nRow), nNumberAttr );
}
-
- //
- // Titel
- //
-
-// pMemChart->SetMainTitle(ScGlobal::GetRscString(STR_CHART_MAINTITLE));
-// pMemChart->SetSubTitle(ScGlobal::GetRscString(STR_CHART_SUBTITLE));
-// pMemChart->SetXAxisTitle(ScGlobal::GetRscString(STR_CHART_XTITLE));
-// pMemChart->SetYAxisTitle(ScGlobal::GetRscString(STR_CHART_YTITLE));
-// pMemChart->SetZAxisTitle(ScGlobal::GetRscString(STR_CHART_ZTITLE));
-
- //
- // Zahlen-Typ
- //
-
-// SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
-// if (pFormatter)
-// {
-// sal_uLong nIndex = 0;
-// sal_uLong nCount = GetPositionMap()->GetCount();
-// const ScAddress* pPos;
-// do
-// {
-// pPos = GetPositionMap()->GetPosition( nIndex );
-// } while ( !pPos && ++nIndex < nCount );
-// sal_uLong nFormat = ( pPos ? pDocument->GetNumberFormat( *pPos ) : 0 );
-// pMemChart->SetDataType( pFormatter->GetType( nFormat ) );
-// }
-
- //
- // Parameter-Strings
- //
-
-// SetExtraStrings( *pMemChart );
}
return pMemChart;
@@ -604,12 +519,13 @@ ScDataObject* ScChartCollection::Clone() const
sal_Bool ScChartCollection::operator==(const ScChartCollection& rCmp) const
{
if (nCount != rCmp.nCount)
- return sal_False;
+ return false;
for (sal_uInt16 i=0; i<nCount; i++)
if (!((*(const ScChartArray*)pItems[i]) == (*(const ScChartArray*)rCmp.pItems[i])))
- return sal_False;
+ return false;
return sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index a2db16dff690..47854ec57f37 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,6 @@
#include "chartlis.hxx"
#include "docuno.hxx"
-//#include <vcl/svapp.hxx>
#include <svx/svditer.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdpage.hxx>
@@ -77,8 +77,8 @@ sal_uInt16 lcl_DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool
if ( !bAllCharts )
{
ScRangeList aRanges;
- sal_Bool bColHeaders = sal_False;
- sal_Bool bRowHeaders = sal_False;
+ sal_Bool bColHeaders = false;
+ sal_Bool bRowHeaders = false;
pDoc->GetOldChartParameters( aName, aRanges, bColHeaders, bRowHeaders );
bHit = aRanges.In( rPos );
}
@@ -98,27 +98,26 @@ sal_Bool lcl_AdjustRanges( ScRangeList& rRanges, SCTAB nSourceTab, SCTAB nDestTa
{
//! if multiple sheets are copied, update references into the other copied sheets?
- sal_Bool bChanged = sal_False;
+ bool bChanged = false;
- sal_uLong nCount = rRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i=0, nCount = rRanges.size(); i < nCount; i++ )
{
- ScRange* pRange = rRanges.GetObject(i);
+ ScRange* pRange = rRanges[ i ];
if ( pRange->aStart.Tab() == nSourceTab && pRange->aEnd.Tab() == nSourceTab )
{
pRange->aStart.SetTab( nDestTab );
pRange->aEnd.SetTab( nDestTab );
- bChanged = sal_True;
+ bChanged = true;
}
if ( pRange->aStart.Tab() >= nTabCount )
{
pRange->aStart.SetTab( nTabCount > 0 ? ( nTabCount - 1 ) : 0 );
- bChanged = sal_True;
+ bChanged = true;
}
if ( pRange->aEnd.Tab() >= nTabCount )
{
pRange->aEnd.SetTab( nTabCount > 0 ? ( nTabCount - 1 ) : 0 );
- bChanged = sal_True;
+ bChanged = true;
}
}
@@ -128,20 +127,11 @@ sal_Bool lcl_AdjustRanges( ScRangeList& rRanges, SCTAB nSourceTab, SCTAB nDestTa
}//end anonymous namespace
// === ScChartHelper ======================================
-
-//static
-sal_uInt16 ScChartHelper::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc )
-{
- return lcl_DoUpdateCharts( rPos, pDoc, sal_False );
-}
-
-//static
sal_uInt16 ScChartHelper::DoUpdateAllCharts( ScDocument* pDoc )
{
return lcl_DoUpdateCharts( ScAddress(), pDoc, sal_True );
}
-//static
void ScChartHelper::AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc, ScDocument* pDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab )
{
if( !pSrcDoc || !pDestDoc )
@@ -182,7 +172,6 @@ void ScChartHelper::AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc,
}
}
-//static
uno::Reference< chart2::XChartDocument > ScChartHelper::GetChartFromSdrObject( SdrObject* pObject )
{
uno::Reference< chart2::XChartDocument > xReturn;
@@ -209,7 +198,6 @@ void ScChartHelper::GetChartRanges( const uno::Reference< chart2::XChartDocument
uno::Reference< chart2::data::XDataSource > xDataSource( xChartDoc, uno::UNO_QUERY );
if( !xDataSource.is() )
return;
- //uno::Reference< chart2::data::XDataProvider > xProvider = xChartDoc->getDataProvider();
uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aLabeledDataSequences( xDataSource->getDataSequences() );
rRanges.realloc(2*aLabeledDataSequences.getLength());
@@ -246,7 +234,7 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument
try
{
- rtl::OUString aPropertyNameRole( ::rtl::OUString::createFromAscii("Role") );
+ rtl::OUString aPropertyNameRole( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Role")) );
uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aLabeledDataSequences( xDataSource->getDataSequences() );
sal_Int32 nRange=0;
@@ -291,161 +279,11 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument
catch ( uno::Exception& ex )
{
(void)ex;
- DBG_ERROR("Exception in ScChartHelper::SetChartRanges - invalid range string?");
+ OSL_FAIL("Exception in ScChartHelper::SetChartRanges - invalid range string?");
}
if( xModel.is() )
xModel->unlockControllers();
}
-void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, ScDocument* pDocument, SdrObject* pObject )
-{
- if ( pDocument && pObject && ( pObject->GetObjIdentifier() == OBJ_OLE2 ) )
- {
- SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >( pObject );
- if ( pSdrOle2Obj && pSdrOle2Obj->IsChart() )
- {
- uno::Reference< embed::XEmbeddedObject > xEmbeddedObj = pSdrOle2Obj->GetObjRef();
- if ( xEmbeddedObj.is() )
- {
- bool bDisableDataTableDialog = false;
- svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj );
- uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
- if ( xProps.is() &&
- ( xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ) ) >>= bDisableDataTableDialog ) &&
- bDisableDataTableDialog )
- {
- ::rtl::OUString aChartName = pSdrOle2Obj->GetPersistName();
- ScRange aEmptyRange;
- ScChartListener aSearcher( aChartName, pDocument, aEmptyRange );
- sal_uInt16 nIndex = 0;
- ScChartListenerCollection* pCollection = pDocument->GetChartListenerCollection();
- if ( pCollection && pCollection->Search( &aSearcher, nIndex ) )
- {
- ScChartListener* pListener = static_cast< ScChartListener* >( pCollection->At( nIndex ) );
- if ( pListener )
- {
- const ScRangeListRef& rRangeList = pListener->GetRangeList();
- if ( rRangeList.Is() )
- {
- rRangesVector.push_back( *rRangeList );
- }
- }
- }
- }
- }
- }
- }
-}
-
-void ScChartHelper::FillProtectedChartRangesVector( ScRangeListVector& rRangesVector, ScDocument* pDocument, SdrPage* pPage )
-{
- if ( pDocument && pPage )
- {
- SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
- SdrObject* pObject = aIter.Next();
- while ( pObject )
- {
- AddRangesIfProtectedChart( rRangesVector, pDocument, pObject );
- pObject = aIter.Next();
- }
- }
-}
-
-void ScChartHelper::GetChartNames( ::std::vector< ::rtl::OUString >& rChartNames, SdrPage* pPage )
-{
- if ( pPage )
- {
- SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
- SdrObject* pObject = aIter.Next();
- while ( pObject )
- {
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 )
- {
- SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >( pObject );
- if ( pSdrOle2Obj && pSdrOle2Obj->IsChart() )
- {
- rChartNames.push_back( pSdrOle2Obj->GetPersistName() );
- }
- }
- pObject = aIter.Next();
- }
- }
-}
-
-void ScChartHelper::CreateProtectedChartListenersAndNotify( ScDocument* pDoc, SdrPage* pPage, ScModelObj* pModelObj, SCTAB nTab,
- const ScRangeListVector& rRangesVector, const ::std::vector< ::rtl::OUString >& rExcludedChartNames, bool bSameDoc )
-{
- if ( pDoc && pPage && pModelObj )
- {
- size_t nRangeListCount = rRangesVector.size();
- size_t nRangeList = 0;
- SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
- SdrObject* pObject = aIter.Next();
- while ( pObject )
- {
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 )
- {
- SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >( pObject );
- if ( pSdrOle2Obj && pSdrOle2Obj->IsChart() )
- {
- ::rtl::OUString aChartName = pSdrOle2Obj->GetPersistName();
- ::std::vector< ::rtl::OUString >::const_iterator aEnd = rExcludedChartNames.end();
- ::std::vector< ::rtl::OUString >::const_iterator aFound = ::std::find( rExcludedChartNames.begin(), aEnd, aChartName );
- if ( aFound == aEnd )
- {
- uno::Reference< embed::XEmbeddedObject > xEmbeddedObj = pSdrOle2Obj->GetObjRef();
- if ( xEmbeddedObj.is() && ( nRangeList < nRangeListCount ) )
- {
- bool bDisableDataTableDialog = false;
- svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj );
- uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
- if ( xProps.is() &&
- ( xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ) ) >>= bDisableDataTableDialog ) &&
- bDisableDataTableDialog )
- {
- if ( bSameDoc )
- {
- ScRange aEmptyRange;
- ScChartListener aSearcher( aChartName, pDoc, aEmptyRange );
- sal_uInt16 nIndex = 0;
- ScChartListenerCollection* pCollection = pDoc->GetChartListenerCollection();
- if ( pCollection && !pCollection->Search( &aSearcher, nIndex ) )
- {
- ScRangeList aRangeList( rRangesVector[ nRangeList++ ] );
- ScRangeListRef rRangeList( new ScRangeList( aRangeList ) );
- ScChartListener* pChartListener = new ScChartListener( aChartName, pDoc, rRangeList );
- pCollection->Insert( pChartListener );
- pChartListener->StartListeningTo();
- }
- }
- else
- {
- xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ),
- uno::makeAny( sal_False ) );
- xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableComplexChartTypes" ) ),
- uno::makeAny( sal_False ) );
- }
- }
- }
-
- if ( pModelObj && pModelObj->HasChangesListeners() )
- {
- Rectangle aRectangle = pSdrOle2Obj->GetSnapRect();
- ScRange aRange( pDoc->GetRange( nTab, aRectangle ) );
- ScRangeList aChangeRanges;
- aChangeRanges.Append( aRange );
-
- uno::Sequence< beans::PropertyValue > aProperties( 1 );
- aProperties[ 0 ].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) );
- aProperties[ 0 ].Value <<= aChartName;
-
- pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert-chart" ) ), aChangeRanges, aProperties );
- }
- }
- }
- }
- pObject = aIter.Next();
- }
- }
-}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 411d5d6c72e8..2fa1ede0b851 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,14 +41,10 @@
using namespace com::sun::star;
using ::std::vector;
using ::std::list;
-using ::std::hash_set;
using ::std::auto_ptr;
using ::std::unary_function;
using ::std::for_each;
-//2do: DocOption TimeOut?
-//#define SC_CHARTTIMEOUT 1000 // eine Sekunde keine Aenderung/KeyEvent
-
// Update chart listeners quickly, to get a similar behavior to loaded charts
// which register UNO listeners.
#define SC_CHARTTIMEOUT 10
@@ -116,7 +113,7 @@ void ScChartListener::ExternalRefListener::removeFileId(sal_uInt16 nFileId)
maFileIds.erase(nFileId);
}
-hash_set<sal_uInt16>& ScChartListener::ExternalRefListener::getAllFileIds()
+boost::unordered_set<sal_uInt16>& ScChartListener::ExternalRefListener::getAllFileIds()
{
return maFileIds;
}
@@ -128,12 +125,12 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP,
StrData( rName ),
SvtListener(),
mpExtRefListener(NULL),
- mpTokens(new vector<ScSharedTokenRef>),
+ mpTokens(new vector<ScTokenRef>),
pUnoData( NULL ),
pDoc( pDocP ),
- bUsed( sal_False ),
- bDirty( sal_False ),
- bSeriesRangesScheduled( sal_False )
+ bUsed( false ),
+ bDirty( false ),
+ bSeriesRangesScheduled( false )
{
SetRangeList( rRange );
}
@@ -143,26 +140,26 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP,
StrData( rName ),
SvtListener(),
mpExtRefListener(NULL),
- mpTokens(new vector<ScSharedTokenRef>),
+ mpTokens(new vector<ScTokenRef>),
pUnoData( NULL ),
pDoc( pDocP ),
- bUsed( sal_False ),
- bDirty( sal_False ),
- bSeriesRangesScheduled( sal_False )
+ bUsed( false ),
+ bDirty( false ),
+ bSeriesRangesScheduled( false )
{
ScRefTokenHelper::getTokensFromRangeList(*mpTokens, *rRangeList);
}
-ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP, vector<ScSharedTokenRef>* pTokens ) :
+ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP, vector<ScTokenRef>* pTokens ) :
StrData( rName ),
SvtListener(),
mpExtRefListener(NULL),
mpTokens(pTokens),
pUnoData( NULL ),
pDoc( pDocP ),
- bUsed( sal_False ),
- bDirty( sal_False ),
- bSeriesRangesScheduled( sal_False )
+ bUsed( false ),
+ bDirty( false ),
+ bSeriesRangesScheduled( false )
{
}
@@ -170,10 +167,10 @@ ScChartListener::ScChartListener( const ScChartListener& r ) :
StrData( r ),
SvtListener(),
mpExtRefListener(NULL),
- mpTokens(new vector<ScSharedTokenRef>(*r.mpTokens)),
+ mpTokens(new vector<ScTokenRef>(*r.mpTokens)),
pUnoData( NULL ),
pDoc( r.pDoc ),
- bUsed( sal_False ),
+ bUsed( false ),
bDirty( r.bDirty ),
bSeriesRangesScheduled( r.bSeriesRangesScheduled )
{
@@ -186,9 +183,9 @@ ScChartListener::ScChartListener( const ScChartListener& r ) :
// was listening to.
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const hash_set<sal_uInt16>& rFileIds = r.mpExtRefListener->getAllFileIds();
+ const boost::unordered_set<sal_uInt16>& rFileIds = r.mpExtRefListener->getAllFileIds();
mpExtRefListener.reset(new ExternalRefListener(*this, pDoc));
- hash_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
+ boost::unordered_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
for (; itr != itrEnd; ++itr)
{
pRefMgr->addLinkListener(*itr, mpExtRefListener.get());
@@ -207,8 +204,8 @@ ScChartListener::~ScChartListener()
{
// Stop listening to all external files.
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const hash_set<sal_uInt16>& rFileIds = mpExtRefListener->getAllFileIds();
- hash_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
+ const boost::unordered_set<sal_uInt16>& rFileIds = mpExtRefListener->getAllFileIds();
+ boost::unordered_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
for (; itr != itrEnd; ++itr)
pRefMgr->removeLinkListener(*itr, mpExtRefListener.get());
}
@@ -223,7 +220,6 @@ void ScChartListener::SetUno(
const uno::Reference< chart::XChartDataChangeEventListener >& rListener,
const uno::Reference< chart::XChartData >& rSource )
{
-// DBG_ASSERT( rListener.is() && rSource.is(), "Nullpointer bei SetUno" );
delete pUnoData;
pUnoData = new ScChartUnoData( rListener, rSource );
}
@@ -252,7 +248,7 @@ void ScChartListener::Notify( SvtBroadcaster&, const SfxHint& rHint )
void ScChartListener::Update()
{
if ( pDoc->IsInInterpreter() )
- { // #73482# If interpreting do nothing and restart timer so we don't
+ { // If interpreting do nothing and restart timer so we don't
// interfere with interpreter and don't produce an Err522 or similar.
// This may happen if we are rescheduled via Basic function.
pDoc->GetChartListenerCollection()->StartTimer();
@@ -260,7 +256,7 @@ void ScChartListener::Update()
}
if ( pUnoData )
{
- bDirty = sal_False;
+ bDirty = false;
//! irgendwann mal erkennen, was sich innerhalb des Charts geaendert hat
chart::ChartDataChangeEvent aEvent( pUnoData->GetSource(),
chart::ChartDataChangeType_ALL,
@@ -269,7 +265,7 @@ void ScChartListener::Update()
}
else if ( pDoc->GetAutoCalc() )
{
- bDirty = sal_False;
+ bDirty = false;
pDoc->UpdateChart( GetString());
}
}
@@ -283,27 +279,27 @@ ScRangeListRef ScChartListener::GetRangeList() const
void ScChartListener::SetRangeList( const ScRangeListRef& rNew )
{
- vector<ScSharedTokenRef> aTokens;
+ vector<ScTokenRef> aTokens;
ScRefTokenHelper::getTokensFromRangeList(aTokens, *rNew);
mpTokens->swap(aTokens);
}
void ScChartListener::SetRangeList( const ScRange& rRange )
{
- ScSharedTokenRef pToken;
+ ScTokenRef pToken;
ScRefTokenHelper::getTokenFromRange(pToken, rRange);
mpTokens->push_back(pToken);
}
namespace {
-class StartEndListening : public unary_function<ScSharedTokenRef, void>
+class StartEndListening : public unary_function<ScTokenRef, void>
{
public:
StartEndListening(ScDocument* pDoc, ScChartListener& rParent, bool bStart) :
mpDoc(pDoc), mrParent(rParent), mbStart(bStart) {}
- void operator() (const ScSharedTokenRef& pToken)
+ void operator() (const ScTokenRef& pToken)
{
if (!ScRefTokenHelper::isRef(pToken))
return;
@@ -335,7 +331,6 @@ public:
endListening(aRange);
}
}
-
private:
void startListening(const ScRange& rRange)
{
@@ -352,7 +347,6 @@ private:
else
mpDoc->EndListeningArea(rRange, &mrParent);
}
-
private:
ScDocument* mpDoc;
ScChartListener& mrParent;
@@ -395,7 +389,7 @@ void ScChartListener::UpdateScheduledSeriesRanges()
{
if ( bSeriesRangesScheduled )
{
- bSeriesRangesScheduled = sal_False;
+ bSeriesRangesScheduled = false;
UpdateSeriesRanges();
}
}
@@ -403,7 +397,7 @@ void ScChartListener::UpdateScheduledSeriesRanges()
void ScChartListener::UpdateChartIntersecting( const ScRange& rRange )
{
- ScSharedTokenRef pToken;
+ ScTokenRef pToken;
ScRefTokenHelper::getTokenFromRange(pToken, rRange);
if (ScRefTokenHelper::intersects(*mpTokens, pToken))
@@ -471,7 +465,7 @@ ScChartListenerCollection::RangeListenerItem::RangeListenerItem(const ScRange& r
}
ScChartListenerCollection::ScChartListenerCollection( ScDocument* pDocP ) :
- ScStrCollection( 4, 4, sal_False ),
+ ScStrCollection( 4, 4, false ),
pDoc( pDocP )
{
aTimer.SetTimeoutHdl( LINK( this, ScChartListenerCollection, TimerHdl ) );
@@ -487,7 +481,7 @@ ScChartListenerCollection::ScChartListenerCollection(
ScChartListenerCollection::~ScChartListenerCollection()
{
- // #96783# remove ChartListener objects before aTimer dtor is called, because
+ // remove ChartListener objects before aTimer dtor is called, because
// ScChartListener::EndListeningTo may cause ScChartListenerCollection::StartTimer
// to be called if an empty ScNoteCell is deleted
@@ -541,7 +535,7 @@ void ScChartListenerCollection::FreeUnused()
if ( !pCL->IsUno() )
{
if ( pCL->IsUsed() )
- pCL->SetUsed( sal_False );
+ pCL->SetUsed( false );
else
Free( pCL );
}
@@ -609,7 +603,7 @@ void ScChartListenerCollection::SetDirty()
void ScChartListenerCollection::SetDiffDirty(
const ScChartListenerCollection& rCmp, sal_Bool bSetChartRangeLists )
{
- sal_Bool bDirty = sal_False;
+ sal_Bool bDirty = false;
for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ )
{
ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ];
@@ -643,7 +637,7 @@ void ScChartListenerCollection::SetDiffDirty(
void ScChartListenerCollection::SetRangeDirty( const ScRange& rRange )
{
- sal_Bool bDirty = sal_False;
+ sal_Bool bDirty = false;
for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ )
{
ScChartListener* pCL = (ScChartListener*) pItems[ nIndex ];
@@ -693,12 +687,12 @@ sal_Bool ScChartListenerCollection::operator==( const ScChartListenerCollection&
// hier nicht ScStrCollection::operator==() verwenden, der umstaendlich via
// IsEqual und Compare laeuft, stattdessen ScChartListener::operator==()
if ( pDoc != r.pDoc || nCount != r.nCount )
- return sal_False;
+ return false;
for ( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ )
{
if ( *((ScChartListener*) pItems[ nIndex ]) !=
*((ScChartListener*) r.pItems[ nIndex ]) )
- return sal_False;
+ return false;
}
return sal_True;
}
@@ -734,3 +728,4 @@ void ScChartListenerCollection::EndListeningHiddenRange( ScChartHiddenRangeListe
maHiddenListeners.remove_if(MatchListener(pListener));
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx
index 54a49fb4b4aa..bf2a5d1015dd 100644
--- a/sc/source/core/tool/chartlock.cxx
+++ b/sc/source/core/tool/chartlock.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,7 +106,7 @@ ScChartLockGuard::ScChartLockGuard( ScDocument* pDoc ) :
}
catch ( uno::Exception& )
{
- DBG_ERROR("Unexpected exception in ScChartLockGuard");
+ OSL_FAIL("Unexpected exception in ScChartLockGuard");
}
}
}
@@ -124,7 +125,7 @@ ScChartLockGuard::~ScChartLockGuard()
}
catch ( uno::Exception& )
{
- DBG_ERROR("Unexpected exception in ScChartLockGuard");
+ OSL_FAIL("Unexpected exception in ScChartLockGuard");
}
}
}
@@ -148,7 +149,7 @@ void ScChartLockGuard::AlsoLockThisChart( const Reference< frame::XModel >& xMod
}
catch ( uno::Exception& )
{
- DBG_ERROR("Unexpected exception in ScChartLockGuard");
+ OSL_FAIL("Unexpected exception in ScChartLockGuard");
}
}
}
@@ -193,3 +194,5 @@ IMPL_LINK( ScTemporaryChartLock, TimeoutHdl, Timer*, EMPTYARG )
mapScChartLockGuard.reset();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index e80e0f2188e5..7baa02ad5dc7 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,9 +61,9 @@ ScChartPositioner::ScChartPositioner( ScDocument* pDoc, SCTAB nTab,
eGlue( SC_CHARTGLUE_NA ),
nStartCol(0),
nStartRow(0),
- bColHeaders( sal_False ),
- bRowHeaders( sal_False ),
- bDummyUpperLeft( sal_False )
+ bColHeaders( false ),
+ bRowHeaders( false ),
+ bDummyUpperLeft( false )
{
SetRangeList( ScRange( nStartColP, nStartRowP, nTab, nEndColP, nEndRowP, nTab ) );
CheckColRowHeaders();
@@ -75,9 +76,9 @@ ScChartPositioner::ScChartPositioner( ScDocument* pDoc, const ScRangeListRef& rR
eGlue( SC_CHARTGLUE_NA ),
nStartCol(0),
nStartRow(0),
- bColHeaders( sal_False ),
- bRowHeaders( sal_False ),
- bDummyUpperLeft( sal_False )
+ bColHeaders( false ),
+ bRowHeaders( false ),
+ bDummyUpperLeft( false )
{
if ( aRangeListRef.Is() )
CheckColRowHeaders();
@@ -119,12 +120,13 @@ void ScChartPositioner::GlueState()
{
if ( eGlue != SC_CHARTGLUE_NA )
return;
- bDummyUpperLeft = sal_False;
- ScRangePtr pR;
- if ( aRangeListRef->Count() <= 1 )
+ bDummyUpperLeft = false;
+ ScRange* pR;
+ if ( aRangeListRef->size() <= 1 )
{
- if ( (pR = aRangeListRef->First())!=NULL )
+ if ( !aRangeListRef->empty() )
{
+ pR = aRangeListRef->front();
if ( pR->aStart.Tab() == pR->aEnd.Tab() )
eGlue = SC_CHARTGLUE_NONE;
else
@@ -140,31 +142,26 @@ void ScChartPositioner::GlueState()
}
return;
}
-// sal_uLong nOldPos = aRangeListRef->GetCurPos();
- pR = aRangeListRef->First();
+ pR = aRangeListRef->front();
nStartCol = pR->aStart.Col();
nStartRow = pR->aStart.Row();
SCCOL nMaxCols, nEndCol;
SCROW nMaxRows, nEndRow;
nMaxCols = nEndCol = 0;
nMaxRows = nEndRow = 0;
- do
+ for ( size_t i = 1, nRanges = aRangeListRef->size(); i <= nRanges; ++i ) // <= so 1 extra pass after last item
{ // umspannenden Bereich etc. feststellen
SCCOLROW nTmp, n1, n2;
- if ( (n1 = pR->aStart.Col()) < nStartCol )
- nStartCol = static_cast<SCCOL>(n1);
- if ( (n2 = pR->aEnd.Col()) > nEndCol )
- nEndCol = static_cast<SCCOL>(n2);
- if ( (nTmp = n2 - n1 + 1) > nMaxCols )
- nMaxCols = static_cast<SCCOL>(nTmp);
- if ( (n1 = pR->aStart.Row()) < nStartRow )
- nStartRow = static_cast<SCROW>(n1);
- if ( (n2 = pR->aEnd.Row()) > nEndRow )
- nEndRow = static_cast<SCROW>(n2);
- if ( (nTmp = n2 - n1 + 1) > nMaxRows )
- nMaxRows = static_cast<SCROW>(nTmp);
- } while ( (pR = aRangeListRef->Next())!=NULL );
+ if ( (n1 = pR->aStart.Col()) < nStartCol ) nStartCol = static_cast<SCCOL>(n1 );
+ if ( (n2 = pR->aEnd.Col() ) > nEndCol ) nEndCol = static_cast<SCCOL>(n2 );
+ if ( (nTmp = n2 - n1 + 1 ) > nMaxCols ) nMaxCols = static_cast<SCCOL>(nTmp);
+ if ( (n1 = pR->aStart.Row()) < nStartRow ) nStartRow = static_cast<SCROW>(n1 );
+ if ( (n2 = pR->aEnd.Row() ) > nEndRow ) nEndRow = static_cast<SCROW>(n2 );
+ if ( (nTmp = n2 - n1 + 1 ) > nMaxRows ) nMaxRows = static_cast<SCROW>(nTmp);
+ if ( i < nRanges ) // in last pass; i = nRanges so don't use at()
+ pR = (*aRangeListRef)[i];
+ }
SCCOL nC = nEndCol - nStartCol + 1;
if ( nC == 1 )
{
@@ -197,8 +194,9 @@ void ScChartPositioner::GlueState()
SCCOL nCol, nCol1, nCol2;
SCROW nRow, nRow1, nRow2;
- for ( pR = aRangeListRef->First(); pR; pR = aRangeListRef->Next() )
+ for ( size_t i = 0, nRanges = aRangeListRef->size(); i < nRanges; ++i )
{ // Selektionen 2D als belegt markieren
+ pR = (*aRangeListRef)[i];
nCol1 = pR->aStart.Col() - nStartCol;
nCol2 = pR->aEnd.Col() - nStartCol;
nRow1 = pR->aStart.Row() - nStartRow;
@@ -212,7 +210,7 @@ void ScChartPositioner::GlueState()
}
sal_Bool bGlue = sal_True;
- sal_Bool bGlueCols = sal_False;
+ sal_Bool bGlueCols = false;
for ( nCol = 0; bGlue && nCol < nC; nCol++ )
{ // Spalten probieren durchzugehen und als frei markieren
p = pA + (sal_uLong)nCol * nR;
@@ -223,7 +221,7 @@ void ScChartPositioner::GlueState()
// moeglich. Am Rand koennte ok sein, wenn in dieser Spalte
// in jeder belegten Zeile einer belegt ist.
if ( nRow > 0 && nCol > 0 )
- bGlue = sal_False; // nCol==0 kann DummyUpperLeft sein
+ bGlue = false; // nCol==0 kann DummyUpperLeft sein
else
nRow = nR;
}
@@ -237,7 +235,7 @@ void ScChartPositioner::GlueState()
}
}
- sal_Bool bGlueRows = sal_False;
+ sal_Bool bGlueRows = false;
for ( nRow = 0; bGlue && nRow < nR; nRow++ )
{ // Zeilen probieren durchzugehen und als frei markieren
p = pA + nRow;
@@ -246,7 +244,7 @@ void ScChartPositioner::GlueState()
if ( *p == nOccu )
{
if ( nCol > 0 && nRow > 0 )
- bGlue = sal_False; // nRow==0 kann DummyUpperLeft sein
+ bGlue = false; // nRow==0 kann DummyUpperLeft sein
else
nCol = nC;
}
@@ -267,7 +265,7 @@ void ScChartPositioner::GlueState()
{ // ein unberuehrtes Feld heisst, dass es weder spaltenweise noch
// zeilenweise zu erreichen war, also nichts zusamenzufassen
if ( *p == nHole )
- bGlue = sal_False;
+ bGlue = false;
}
if ( bGlue )
{
@@ -297,32 +295,34 @@ void ScChartPositioner::CheckColRowHeaders()
sal_Bool bColStrings = sal_True;
sal_Bool bRowStrings = sal_True;
GlueState();
- if ( aRangeListRef->Count() == 1 )
+ if ( aRangeListRef->size() == 1 )
{
- aRangeListRef->First()->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+ aRangeListRef->front()->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
if ( nCol1 > nCol2 || nRow1 > nRow2 )
- bColStrings = bRowStrings = sal_False;
+ bColStrings = bRowStrings = false;
else
{
for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++)
{
if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 ))
- bColStrings = sal_False;
+ bColStrings = false;
}
for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++)
{
if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 ))
- bRowStrings = sal_False;
+ bRowStrings = false;
}
}
}
else
{
sal_Bool bVert = (eGlue == SC_CHARTGLUE_NONE || eGlue == SC_CHARTGLUE_ROWS);
- for ( ScRangePtr pR = aRangeListRef->First();
- pR && (bColStrings || bRowStrings);
- pR = aRangeListRef->Next() )
+ for ( size_t i = 0, nRanges = aRangeListRef->size();
+ (i < nRanges) && (bColStrings || bRowStrings);
+ ++i
+ )
{
+ ScRange* pR = (*aRangeListRef)[i];
pR->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
sal_Bool bTopRow = (nRow1 == nStartRow);
if ( bRowStrings && (bVert || nCol1 == nStartCol) )
@@ -332,7 +332,7 @@ void ScChartPositioner::CheckColRowHeaders()
for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++)
{
if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 ))
- bRowStrings = sal_False;
+ bRowStrings = false;
}
}
if ( bColStrings && bTopRow )
@@ -341,7 +341,7 @@ void ScChartPositioner::CheckColRowHeaders()
for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++)
{
if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 ))
- bColStrings = sal_False;
+ bColStrings = false;
}
}
}
@@ -388,12 +388,12 @@ void ScChartPositioner::CreatePositionMap()
Table* pCols = new Table;
Table* pNewRowTable = new Table;
ScAddress* pNewAddress = new ScAddress;
- ScRangePtr pR;
Table* pCol;
ScAddress* pPos;
SCROW nNoGlueRow = 0;
- for ( pR = aRangeListRef->First(); pR; pR = aRangeListRef->Next() )
+ for ( size_t i = 0, nRanges = aRangeListRef->size(); i < nRanges; ++i )
{
+ ScRange* pR = (*aRangeListRef)[i];
pR->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
for ( nTab = nTab1; nTab <= nTab2; nTab++ )
{
@@ -457,7 +457,6 @@ void ScChartPositioner::CreatePositionMap()
if ( nColCount==0 || nRowCount==0 )
{ // einen Eintrag ohne Daten erzeugen
- pR = aRangeListRef->First();
if ( pCols->Count() > 0 )
pCol = (Table*) pCols->First();
else
@@ -605,35 +604,4 @@ ScChartPositionMap::~ScChartPositionMap()
delete [] ppRowHeader;
}
-
-//UNUSED2009-05 ScRangeListRef ScChartPositionMap::GetColRanges( SCCOL nChartCol ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 ScRangeListRef xRangeList = new ScRangeList;
-//UNUSED2009-05 if ( nChartCol < nColCount )
-//UNUSED2009-05 {
-//UNUSED2009-05 sal_uLong nStop = GetIndex( nChartCol, nRowCount );
-//UNUSED2009-05 for ( sal_uLong nIndex = GetIndex( nChartCol, 0 ); nIndex < nStop; nIndex++ )
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( ppData[ nIndex ] )
-//UNUSED2009-05 xRangeList->Join( *ppData[ nIndex ] );
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 return xRangeList;
-//UNUSED2009-05 }
-
-
-//UNUSED2009-05 ScRangeListRef ScChartPositionMap::GetRowRanges( SCROW nChartRow ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 ScRangeListRef xRangeList = new ScRangeList;
-//UNUSED2009-05 if ( nChartRow < nRowCount )
-//UNUSED2009-05 {
-//UNUSED2009-05 sal_uLong nStop = GetIndex( nColCount, nChartRow );
-//UNUSED2009-05 for ( sal_uLong nIndex = GetIndex( 0, nChartRow ); nIndex < nStop;
-//UNUSED2009-05 nIndex += nRowCount )
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( ppData[ nIndex ] )
-//UNUSED2009-05 xRangeList->Join( *ppData[ nIndex ] );
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 return xRangeList;
-//UNUSED2009-05 }
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 3cabca7b7647..dd9ecebe89d5 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,30 +72,6 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionLinkEntry, nMemPoolChangeActionLinkEntry
#define SC_CHGTRACK_FILEFORMAT_FIRST 0x0001
#define SC_CHGTRACK_FILEFORMAT 0x0001
-// --- ScChangeActionLinkEntry ---------------------------------------------
-
-#if DEBUG_CHANGETRACK
-String ScChangeActionLinkEntry::ToString() const
-{
- String aReturn;
- if ( pAction )
- {
- aReturn = String::CreateFromInt64( static_cast< sal_Int64 >( pAction->GetActionNumber() ) );
- }
- else if ( pLink && pLink->pAction )
- {
- aReturn = String::CreateFromAscii( "*" );
- aReturn += String::CreateFromInt64( static_cast< sal_Int64 >( pLink->pAction->GetActionNumber() ) );
- }
- else
- {
- aReturn = String::CreateFromAscii( "-" );
- }
-
- return aReturn;
-}
-#endif // DEBUG_CHANGETRACK
-
// --- ScChangeAction ------------------------------------------------------
ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScRange& rRange )
@@ -165,7 +142,7 @@ sal_Bool ScChangeAction::IsVisible() const
{
//! sequence order of execution is significant
if ( IsRejected() || GetType() == SC_CAT_DELETE_TABS || IsDeletedIn() )
- return sal_False;
+ return false;
if ( GetType() == SC_CAT_CONTENT )
return ((ScChangeActionContent*)this)->IsTopContent();
return sal_True;
@@ -176,12 +153,12 @@ sal_Bool ScChangeAction::IsTouchable() const
{
//! sequence order of execution is significant
if ( IsRejected() || GetType() == SC_CAT_REJECT || IsDeletedIn() )
- return sal_False;
+ return false;
// content may reject and be touchable if on top
if ( GetType() == SC_CAT_CONTENT )
return ((ScChangeActionContent*)this)->IsTopContent();
if ( IsRejecting() )
- return sal_False;
+ return false;
return sal_True;
}
@@ -190,16 +167,16 @@ sal_Bool ScChangeAction::IsClickable() const
{
//! sequence order of execution is significant
if ( !IsVirgin() )
- return sal_False;
+ return false;
if ( IsDeletedIn() )
- return sal_False;
+ return false;
if ( GetType() == SC_CAT_CONTENT )
{
ScChangeActionContentCellType eCCT =
ScChangeActionContent::GetContentCellType(
((ScChangeActionContent*)this)->GetNewCell() );
if ( eCCT == SC_CACCT_MATREF )
- return sal_False;
+ return false;
if ( eCCT == SC_CACCT_MATORG )
{ // no Accept-Select if one of the references is in a deleted col/row
const ScChangeActionLinkEntry* pL =
@@ -208,7 +185,7 @@ sal_Bool ScChangeAction::IsClickable() const
{
ScChangeAction* p = (ScChangeAction*) pL->GetAction();
if ( p && p->IsDeletedIn() )
- return sal_False;
+ return false;
pL = pL->GetNext();
}
}
@@ -222,11 +199,11 @@ sal_Bool ScChangeAction::IsRejectable() const
{
//! sequence order of execution is significant
if ( !IsClickable() )
- return sal_False;
+ return false;
if ( GetType() == SC_CAT_CONTENT )
{
if ( ((ScChangeActionContent*)this)->IsOldMatrixReference() )
- return sal_False;
+ return false;
ScChangeActionContent* pNextContent =
((ScChangeActionContent*)this)->GetNextContent();
if ( pNextContent == NULL )
@@ -241,9 +218,9 @@ sal_Bool ScChangeAction::IsInternalRejectable() const
{
//! sequence order of execution is significant
if ( !IsVirgin() )
- return sal_False;
+ return false;
if ( IsDeletedIn() )
- return sal_False;
+ return false;
if ( GetType() == SC_CAT_CONTENT )
{
ScChangeActionContent* pNextContent =
@@ -268,7 +245,7 @@ sal_Bool ScChangeAction::IsDialogParent() const
if ( GetType() == SC_CAT_CONTENT )
{
if ( !IsDialogRoot() )
- return sal_False;
+ return false;
if ( ((ScChangeActionContent*)this)->IsMatrixOrigin() && HasDependent() )
return sal_True;
ScChangeActionContent* pPrevContent =
@@ -295,14 +272,14 @@ sal_Bool ScChangeAction::IsDialogParent() const
else
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScChangeAction::IsMasterDelete() const
{
if ( !IsDeleteType() )
- return sal_False;
+ return false;
ScChangeActionDel* pDel = (ScChangeActionDel*) this;
return pDel->IsMultiDelete() && (pDel->IsTopDelete() || pDel->IsRejectable());
}
@@ -326,7 +303,7 @@ void ScChangeAction::RemoveAllAnyLinks()
sal_Bool ScChangeAction::RemoveDeletedIn( const ScChangeAction* p )
{
- sal_Bool bRemoved = sal_False;
+ sal_Bool bRemoved = false;
ScChangeActionLinkEntry* pL = GetDeletedIn();
while ( pL )
{
@@ -351,7 +328,7 @@ sal_Bool ScChangeAction::IsDeletedIn( const ScChangeAction* p ) const
return sal_True;
pL = pL->GetNext();
}
- return sal_False;
+ return false;
}
@@ -393,7 +370,7 @@ sal_Bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const
pL = pL->GetNext();
}
}
- return sal_False;
+ return false;
}
@@ -444,7 +421,7 @@ void ScChangeAction::GetDescription( String& rStr, ScDocument* /* pDoc */,
{
if ( IsRejecting() && bWarning )
{
- // #112261# Add comment if rejection may have resulted in references
+ // Add comment if rejection may have resulted in references
// not properly restored in formulas. See specification at
// http://specs.openoffice.org/calc/ease-of-use/redlining_comment.sxw
if (GetType() == SC_CAT_MOVE)
@@ -483,7 +460,7 @@ void ScChangeAction::GetDescription( String& rStr, ScDocument* /* pDoc */,
else if (pReject->HasDependent())
{
ScChangeActionTable aTable;
- pCT->GetDependents( pReject, aTable, sal_False, sal_True );
+ pCT->GetDependents( pReject, aTable, false, sal_True );
for ( const ScChangeAction* p = aTable.First(); p;
p = aTable.Next() )
{
@@ -650,148 +627,6 @@ void ScChangeAction::AddDependent( sal_uLong nActionNumber,
}
}
-
-#if DEBUG_CHANGETRACK
-String ScChangeAction::ToString( ScDocument* pDoc ) const
-{
- String aReturn;
-
- String aNumber = String::CreateFromInt64( static_cast< sal_Int64 >( GetActionNumber() ) );
-
- String aActionState;
- ScChangeActionState eActionState = GetState();
- switch ( eActionState )
- {
- case SC_CAS_VIRGIN:
- {
- aActionState = String::CreateFromAscii( " " );
- }
- break;
- case SC_CAS_ACCEPTED:
- {
- aActionState = String::CreateFromAscii( "+" );
- }
- break;
- case SC_CAS_REJECTED:
- {
- aActionState = String::CreateFromAscii( "-" );
- }
- break;
- }
-
- String aRejectAction;
- if ( IsRejecting() )
- {
- aRejectAction += 'r';
- aRejectAction += String::CreateFromInt64( static_cast< sal_Int64 >( GetRejectAction() ) );
- }
-
- String aReference;
- GetRefString( aReference, pDoc, sal_True );
-
- String aAuthor = GetUser();
-
- DateTime aDT = GetDateTime();
- String aDate = ScGlobal::pLocaleData->getDate( aDT );
- aDate += ' ';
- aDate += ScGlobal::pLocaleData->getTime( aDT, sal_False, sal_False );
-
- String aDescription;
- GetDescription( aDescription, pDoc );
-
- String aLinkAny;
- const ScChangeActionLinkEntry* pLinkA = pLinkAny;
- while ( pLinkA )
- {
- if ( !aLinkAny.Len() )
- {
- aLinkAny = String::CreateFromAscii( "(Any:" );
- }
- aLinkAny += String::CreateFromAscii( " ->" );
- aLinkAny += pLinkA->ToString();
- pLinkA = pLinkA->GetNext();
- }
- if ( aLinkAny.Len() )
- {
- aLinkAny += ')';
- }
-
- String aLinkDeletedIn;
- const ScChangeActionLinkEntry* pLinkDI = pLinkDeletedIn;
- while ( pLinkDI )
- {
- if ( !aLinkDeletedIn.Len() )
- {
- aLinkDeletedIn = String::CreateFromAscii( "(DeletedIn:" );
- }
- aLinkDeletedIn += String::CreateFromAscii( " ->" );
- aLinkDeletedIn += pLinkDI->ToString();
- pLinkDI = pLinkDI->GetNext();
- }
- if ( aLinkDeletedIn.Len() )
- {
- aLinkDeletedIn += ')';
- }
-
- String aLinkDeleted;
- const ScChangeActionLinkEntry* pLinkD = pLinkDeleted;
- while ( pLinkD )
- {
- if ( !aLinkDeleted.Len() )
- {
- aLinkDeleted = String::CreateFromAscii( "(Deleted:" );
- }
- aLinkDeleted += String::CreateFromAscii( " ->" );
- aLinkDeleted += pLinkD->ToString();
- pLinkD = pLinkD->GetNext();
- }
- if ( aLinkDeleted.Len() )
- {
- aLinkDeleted += ')';
- }
-
- String aLinkDependent;
- const ScChangeActionLinkEntry* pLinkDp = pLinkDependent;
- while ( pLinkDp )
- {
- if ( !aLinkDependent.Len() )
- {
- aLinkDependent = String::CreateFromAscii( "(Dependent:" );
- }
- aLinkDependent += String::CreateFromAscii( " ->" );
- aLinkDependent += pLinkDp->ToString();
- pLinkDp = pLinkDp->GetNext();
- }
- if ( aLinkDependent.Len() )
- {
- aLinkDependent += ')';
- }
-
- aReturn += aNumber;
- aReturn += aActionState;
- aReturn += aRejectAction;
- aReturn += String::CreateFromAscii( ": " );
- aReturn += aReference;
- aReturn += ' ';
- aReturn += aAuthor;
- aReturn += ' ';
- aReturn += aDate;
- aReturn += ' ';
- aReturn += aDescription;
- aReturn += ' ';
- aReturn += aLinkAny;
- aReturn += ' ';
- aReturn += aLinkDeletedIn;
- aReturn += ' ';
- aReturn += aLinkDeleted;
- aReturn += ' ';
- aReturn += aLinkDependent;
-
- return aReturn;
-}
-#endif // DEBUG_CHANGETRACK
-
-
// --- ScChangeActionIns ---------------------------------------------------
ScChangeActionIns::ScChangeActionIns( const ScRange& rRange )
@@ -818,7 +653,7 @@ ScChangeActionIns::ScChangeActionIns( const ScRange& rRange )
}
else
{
- DBG_ERROR( "ScChangeActionIns: Block not supported!" );
+ OSL_FAIL( "ScChangeActionIns: Block not supported!" );
}
}
@@ -867,12 +702,12 @@ void ScChangeActionIns::GetDescription( String& rStr, ScDocument* pDoc,
sal_Bool ScChangeActionIns::Reject( ScDocument* pDoc )
{
if ( !aBigRange.IsValid( pDoc ) )
- return sal_False;
+ return false;
ScRange aRange( aBigRange.MakeRange() );
if ( !pDoc->IsBlockEditable( aRange.aStart.Tab(), aRange.aStart.Col(),
aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row() ) )
- return sal_False;
+ return false;
switch ( GetType() )
{
@@ -931,7 +766,7 @@ ScChangeActionDel::ScChangeActionDel( const ScRange& rRange,
}
else
{
- DBG_ERROR( "ScChangeActionDel: Block not supported!" );
+ OSL_FAIL( "ScChangeActionDel: Block not supported!" );
}
}
@@ -997,19 +832,19 @@ sal_Bool ScChangeActionDel::IsMultiDelete() const
return sal_True;
const ScChangeAction* p = GetNext();
if ( !p || p->GetType() != GetType() )
- return sal_False;
+ return false;
const ScChangeActionDel* pDel = (const ScChangeActionDel*) p;
if ( (pDel->GetDx() > GetDx() || pDel->GetDy() > GetDy()) &&
pDel->GetBigRange() == aBigRange )
return sal_True;
- return sal_False;
+ return false;
}
sal_Bool ScChangeActionDel::IsTabDeleteCol() const
{
if ( GetType() != SC_CAT_DELETE_COLS )
- return sal_False;
+ return false;
const ScChangeAction* p = this;
while ( p && p->GetType() == SC_CAT_DELETE_COLS &&
!((const ScChangeActionDel*)p)->IsTopDelete() )
@@ -1108,7 +943,7 @@ void ScChangeActionDel::GetDescription( String& rStr, ScDocument* pDoc,
sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc )
{
if ( !aBigRange.IsValid( pDoc ) && GetType() != SC_CAT_DELETE_TABS )
- return sal_False;
+ return false;
sal_Bool bOk = sal_True;
@@ -1120,10 +955,10 @@ sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc )
if ( GetType() == SC_CAT_DELETE_TABS )
{ // wird Tab angehaengt?
if ( aTmpRange.aStart.Tab() > pDoc->GetMaxTableNumber() )
- bOk = sal_False;
+ bOk = false;
}
else
- bOk = sal_False;
+ bOk = false;
}
if ( bOk )
{
@@ -1138,12 +973,12 @@ sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc )
case SC_CAT_DELETE_COLS :
if ( !(aRange.aStart.Col() == 0 && aRange.aEnd.Col() == MAXCOL) )
{ // nur wenn nicht TabDelete
- if ( ( bOk = pDoc->CanInsertCol( aRange ) ) != sal_False )
+ if ( ( bOk = pDoc->CanInsertCol( aRange ) ) != false )
bOk = pDoc->InsertCol( aRange );
}
break;
case SC_CAT_DELETE_ROWS :
- if ( ( bOk = pDoc->CanInsertRow( aRange ) ) != sal_False )
+ if ( ( bOk = pDoc->CanInsertRow( aRange ) ) != false )
bOk = pDoc->InsertRow( aRange );
break;
case SC_CAT_DELETE_TABS :
@@ -1151,7 +986,7 @@ sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc )
//2do: Tabellennamen merken?
String aName;
pDoc->CreateValidTabName( aName );
- if ( ( bOk = pDoc->ValidNewTabName( aName ) ) != sal_False )
+ if ( ( bOk = pDoc->ValidNewTabName( aName ) ) != false )
bOk = pDoc->InsertTab( aRange.aStart.Tab(), aName );
}
break;
@@ -1160,13 +995,13 @@ sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc )
// added to avoid warnings
}
}
- pTrack->SetInDelete( sal_False );
- pTrack->SetInDeleteUndo( sal_False );
+ pTrack->SetInDelete( false );
+ pTrack->SetInDeleteUndo( false );
}
if ( !bOk )
{
- pTrack->SetInDeleteTop( sal_False );
- return sal_False;
+ pTrack->SetInDeleteTop( false );
+ return false;
}
// InDeleteTop fuer UpdateReference-Undo behalten
}
@@ -1174,7 +1009,7 @@ sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc )
// setzt rejected und ruft UpdateReference-Undo und DeleteCellEntries
RejectRestoreContents( pTrack, GetDx(), GetDy() );
- pTrack->SetInDeleteTop( sal_False );
+ pTrack->SetInDeleteTop( false );
RemoveAllLinks();
return sal_True;
}
@@ -1357,7 +1192,7 @@ void ScChangeActionMove::GetRefString( String& rStr, ScDocument* pDoc,
sal_Bool ScChangeActionMove::Reject( ScDocument* pDoc )
{
if ( !(aBigRange.IsValid( pDoc ) && aFromRange.IsValid( pDoc )) )
- return sal_False;
+ return false;
ScRange aToRange( aBigRange.MakeRange() );
ScRange aFrmRange( aFromRange.MakeRange() );
@@ -1370,7 +1205,7 @@ sal_Bool ScChangeActionMove::Reject( ScDocument* pDoc )
aFrmRange.aStart.Col(), aFrmRange.aStart.Row(),
aFrmRange.aEnd.Col(), aFrmRange.aEnd.Row() );
if ( !bOk )
- return sal_False;
+ return false;
pTrack->LookUpContents( aToRange, pDoc, 0, 0, 0 ); // zu movende Contents
@@ -1669,7 +1504,7 @@ void ScChangeActionContent::GetRefString( String& rStr, ScDocument* pDoc,
sal_Bool ScChangeActionContent::Reject( ScDocument* pDoc )
{
if ( !aBigRange.IsValid( pDoc ) )
- return sal_False;
+ return false;
PutOldValueToDoc( pDoc, 0, 0 );
@@ -1684,7 +1519,7 @@ sal_Bool ScChangeActionContent::Select( ScDocument* pDoc, ScChangeTrack* pTrack,
sal_Bool bOldest, Stack* pRejectActions )
{
if ( !aBigRange.IsValid( pDoc ) )
- return sal_False;
+ return false;
ScChangeActionContent* pContent = this;
// accept previous contents
@@ -1743,7 +1578,6 @@ sal_Bool ScChangeActionContent::Select( ScDocument* pDoc, ScChangeTrack* pTrack,
}
-// static
void ScChangeActionContent::GetStringOfCell( String& rStr,
const ScBaseCell* pCell, const ScDocument* pDoc, const ScAddress& rPos )
{
@@ -1759,7 +1593,6 @@ void ScChangeActionContent::GetStringOfCell( String& rStr,
}
-// static
void ScChangeActionContent::GetStringOfCell( String& rStr,
const ScBaseCell* pCell, const ScDocument* pDoc, sal_uLong nFormat )
{
@@ -1792,7 +1625,6 @@ void ScChangeActionContent::GetStringOfCell( String& rStr,
}
-// static
ScChangeActionContentCellType ScChangeActionContent::GetContentCellType( const ScBaseCell* pCell )
{
if ( pCell )
@@ -1828,14 +1660,12 @@ ScChangeActionContentCellType ScChangeActionContent::GetContentCellType( const S
}
-// static
sal_Bool ScChangeActionContent::NeedsNumberFormat( const ScBaseCell* pCell )
{
return pCell && pCell->GetCellType() == CELLTYPE_VALUE;
}
-// static
void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell,
const ScAddress& rPos, const ScBaseCell* pOrgCell,
const ScDocument* pFromDoc, ScDocument* pToDoc )
@@ -1844,8 +1674,6 @@ void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell,
SetValue( rStr, pCell, nFormat, pOrgCell, pFromDoc, pToDoc );
}
-
-// static
void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell,
sal_uLong nFormat, const ScBaseCell* pOrgCell,
const ScDocument* pFromDoc, ScDocument* pToDoc )
@@ -1879,7 +1707,6 @@ void ScChangeActionContent::SetValue( String& rStr, ScBaseCell*& pCell,
}
-// static
void ScChangeActionContent::SetCell( String& rStr, ScBaseCell* pCell,
sal_uLong nFormat, const ScDocument* pDoc )
{
@@ -1950,7 +1777,7 @@ void ScChangeActionContent::GetFormulaString( String& rStr,
pCell->GetFormula( rStr );
else
{
- DBG_ERROR( "ScChangeActionContent::GetFormulaString: aPos != pCell->aPos" );
+ OSL_FAIL( "ScChangeActionContent::GetFormulaString: aPos != pCell->aPos" );
ScFormulaCell* pNew = new ScFormulaCell( *pCell, *pCell->GetDocument(), aPos );
pNew->GetFormula( rStr );
delete pNew;
@@ -2211,7 +2038,6 @@ const SCROW ScChangeTrack::nContentRowsPerSlot = InitContentRowsPerSlot();
const SCSIZE ScChangeTrack::nContentSlots =
(MAXROWCOUNT) / InitContentRowsPerSlot() + 2;
-// static
SCROW ScChangeTrack::InitContentRowsPerSlot()
{
const SCSIZE nMaxSlots = 0xffe0 / sizeof( ScChangeActionContent* ) - 2;
@@ -2269,12 +2095,12 @@ void ScChangeTrack::Init()
nLastMerge = 0;
eMergeState = SC_CTMS_NONE;
nLoadedFileFormatVersion = SC_CHGTRACK_FILEFORMAT;
- bLoadSave = sal_False;
- bInDelete = sal_False;
- bInDeleteTop = sal_False;
- bInDeleteUndo = sal_False;
- bInPasteCut = sal_False;
- bUseFixDateTime = sal_False;
+ bLoadSave = false;
+ bInDelete = false;
+ bInDeleteTop = false;
+ bInDeleteUndo = false;
+ bInPasteCut = false;
+ bUseFixDateTime = false;
bTime100thSeconds = sal_True;
const SvtUserOptions& rUserOpt = SC_MOD()->GetUserOptions();
@@ -2337,7 +2163,7 @@ void ScChangeTrack::Clear()
}
-void __EXPORT ScChangeTrack::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 )
+void ScChangeTrack::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 )
{
if ( !pDoc->IsInDtorClear() )
{
@@ -2408,7 +2234,7 @@ void ScChangeTrack::EndBlockModify( sal_uLong nEndAction )
}
if ( !pBlockModifyMsg )
{
- sal_Bool bNew = sal_False;
+ sal_Bool bNew = false;
ScChangeTrackMsgInfo* pMsg;
while ( ( pMsg = aMsgStackFinal.Pop() ) != NULL )
{
@@ -2524,7 +2350,7 @@ void ScChangeTrack::Append( ScChangeAction* pAppend, sal_uLong nAction )
// UpdateReference auch wenn pLast==NULL, weil pAppend ein Delete sein
// kann, dass DelContents generiert haben kann
if ( pAppend->IsInsertType() && !pAppend->IsRejecting() )
- UpdateReference( pAppend, sal_False );
+ UpdateReference( pAppend, false );
if ( !pLast )
pFirst = pLast = pAppend;
else
@@ -2539,7 +2365,7 @@ void ScChangeTrack::Append( ScChangeAction* pAppend, sal_uLong nAction )
// ToRange nicht deleten.
if ( !pAppend->IsInsertType() &&
!(pAppend->GetType() == SC_CAT_MOVE && pAppend->IsRejecting()) )
- UpdateReference( pAppend, sal_False );
+ UpdateReference( pAppend, false );
MasterLinks( pAppend );
if ( aModifiedLink.IsSet() )
@@ -2640,9 +2466,9 @@ void ScChangeTrack::AppendDeleteRange( const ScRange& rRange,
}
else
{
- DBG_ERROR( "ScChangeTrack::AppendDeleteRange: Block not supported!" );
+ OSL_FAIL( "ScChangeTrack::AppendDeleteRange: Block not supported!" );
}
- SetInDeleteTop( sal_False );
+ SetInDeleteTop( false );
}
}
EndBlockModify( GetActionMax() );
@@ -2725,7 +2551,6 @@ void ScChangeTrack::AppendMove( const ScRange& rFromRange,
}
-// static
sal_Bool ScChangeTrack::IsMatrixFormulaRangeDifferent( const ScBaseCell* pOldCell,
const ScBaseCell* pNewCell )
{
@@ -2742,24 +2567,6 @@ sal_Bool ScChangeTrack::IsMatrixFormulaRangeDifferent( const ScBaseCell* pOldCel
return nC1 != nC2 || nR1 != nR2;
}
-
-void ScChangeTrack::AppendContent( const ScAddress& rPos,
- const String& rNewValue, ScBaseCell* pOldCell )
-{
- String aOldValue;
- ScChangeActionContent::GetStringOfCell( aOldValue, pOldCell, pDoc, rPos );
- if ( aOldValue != rNewValue ||
- IsMatrixFormulaRangeDifferent( pOldCell, NULL ) )
- { // nur wirkliche Aenderung tracken
- ScRange aRange( rPos );
- ScChangeActionContent* pAct = new ScChangeActionContent( aRange );
- pAct->SetOldValue( pOldCell, pDoc, pDoc );
- pAct->SetNewValue( rNewValue, pDoc );
- Append( pAct );
- }
-}
-
-
void ScChangeTrack::AppendContent( const ScAddress& rPos,
const ScBaseCell* pOldCell, sal_uLong nOldFormat, ScDocument* pRefDoc )
{
@@ -2854,7 +2661,7 @@ void ScChangeTrack::AppendContentRange( const ScRange& rRange,
sal_Bool bDoContents;
if ( eClipMode == SC_CACM_PASTE && HasLastCut() )
{
- bDoContents = sal_False;
+ bDoContents = false;
SetInPasteCut( sal_True );
// Paste und Cut abstimmen, Paste kann groesserer Range sein
ScRange aRange( rRange );
@@ -2892,7 +2699,7 @@ void ScChangeTrack::AppendContentRange( const ScRange& rRange,
Append( pLastCutMove );
pLastCutMove = NULL;
ResetLastCut();
- SetInPasteCut( sal_False );
+ SetInPasteCut( false );
}
else
{
@@ -3299,7 +3106,7 @@ void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMe
}
}
UpdateReference( pAct, sal_True );
- SetInDeleteTop( sal_False );
+ SetInDeleteTop( false );
Remove( pAct );
if ( IsInPasteCut() )
aPasteCutTable.Insert( pAct->GetActionNumber(), pAct );
@@ -3325,7 +3132,7 @@ void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMe
}
else
{
- DBG_ERROR( "ScChangeTrack::Undo: nCut not found" );
+ OSL_FAIL( "ScChangeTrack::Undo: nCut not found" );
}
}
EndBlockModify( nEnd );
@@ -3355,7 +3162,6 @@ void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMe
}
-// static
sal_Bool ScChangeTrack::MergeIgnore( const ScChangeAction& rAction, sal_uLong nFirstMerge )
{
if ( rAction.IsRejected() )
@@ -3364,7 +3170,7 @@ sal_Bool ScChangeTrack::MergeIgnore( const ScChangeAction& rAction, sal_uLong nF
if ( rAction.IsRejecting() && rAction.GetRejectAction() >= nFirstMerge )
return sal_True; // da ist sie
- return sal_False; // alles andere
+ return false; // alles andere
}
@@ -3391,7 +3197,7 @@ void ScChangeTrack::MergePrepare( ScChangeAction* pFirstMerge, bool bShared )
}
}
UpdateReference( pAct, sal_True );
- SetInDeleteTop( sal_False );
+ SetInDeleteTop( false );
pAct->DeleteCellEntries(); // sonst GPF bei Track Clear()
}
pAct = ( pAct == pFirstMerge ? NULL : pAct->GetPrev() );
@@ -3416,8 +3222,8 @@ void ScChangeTrack::MergeOwn( ScChangeAction* pAct, sal_uLong nFirstMerge, bool
GetOverAllRange().MakeRange() );
}
}
- UpdateReference( pAct, sal_False );
- SetInDeleteTop( sal_False );
+ UpdateReference( pAct, false );
+ SetInDeleteTop( false );
SetMergeState( SC_CTMS_OTHER ); //! nachfolgende per default MergeOther
}
}
@@ -3431,7 +3237,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction* pAct, sal_Bool bUndo )
//! Formelzellen haengen nicht im Dokument
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( sal_False );
+ pDoc->SetAutoCalc( false );
sal_Bool bOldNoListening = pDoc->GetNoListening();
pDoc->SetNoListening( sal_True );
//! Formelzellen ExpandRefs synchronisiert zu denen im Dokument
@@ -3458,8 +3264,8 @@ void ScChangeTrack::UpdateReference( ScChangeAction* pAct, sal_Bool bUndo )
bUndo );
UpdateReference( &pFirst, pAct, bUndo );
- SetInDelete( sal_False );
- SetInDeleteUndo( sal_False );
+ SetInDelete( false );
+ SetInDeleteUndo( false );
pDoc->SetExpandRefs( bOldExpandRefs );
pDoc->SetNoListening( bOldNoListening );
@@ -3479,7 +3285,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction,
sal_Int32 nDx, nDy, nDz;
nDx = nDy = nDz = 0;
UpdateRefMode eMode = URM_INSDEL;
- sal_Bool bDel = sal_False;
+ sal_Bool bDel = false;
switch ( eActType )
{
case SC_CAT_INSERT_COLS :
@@ -3517,7 +3323,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction,
((ScChangeActionMove*)pAct)->GetDelta( nDx, nDy, nDz );
break;
default:
- DBG_ERROR( "ScChangeTrack::UpdateReference: unknown Type" );
+ OSL_FAIL( "ScChangeTrack::UpdateReference: unknown Type" );
}
if ( bUndo )
{
@@ -3562,7 +3368,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction,
// das Insert nicht schneidet.
if ( !aDelRange.Intersects( p->GetBigRange() ) )
p->UpdateReference( this, eMode, aRange, nDx, nDy, nDz );
- bUpdate = sal_False;
+ bUpdate = false;
}
else if ( p->GetType() == SC_CAT_CONTENT &&
p->IsDeletedInDelType( eInsType ) )
@@ -3570,7 +3376,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction,
// Nicht anpassen, wenn dieses Delete in dem
// Insert-"Delete" sein wuerde (ist nur verschoben).
if ( aDelRange.In( p->GetBigRange().aStart ) )
- bUpdate = sal_False;
+ bUpdate = false;
else
{
const ScChangeActionLinkEntry* pLink = p->GetDeletedIn();
@@ -3579,7 +3385,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction,
const ScChangeAction* pDel = pLink->GetAction();
if ( pDel && pDel->GetType() == eInsType &&
pDel->GetBigRange().In( aDelRange ) )
- bUpdate = sal_False;
+ bUpdate = false;
pLink = pLink->GetNext();
}
}
@@ -3600,7 +3406,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction,
if ( bGeneratedDelContents )
pActDel->AddContent( (ScChangeActionContent*) p );
}
- bUpdate = sal_False;
+ bUpdate = false;
}
else
{
@@ -3790,13 +3596,13 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction,
// geloescht wird in DeleteCellEntries
}
}
- bUpdate = sal_False;
+ bUpdate = false;
}
else if ( eActType != SC_CAT_DELETE_TABS &&
p->IsDeletedInDelType( SC_CAT_DELETE_TABS ) )
{ // in geloeschten Tabellen nicht updaten,
// ausser wenn Tabelle verschoben wird
- bUpdate = sal_False;
+ bUpdate = false;
}
if ( p->GetType() == eActType && pActDel->IsDeletedIn( p ) )
{
@@ -4217,7 +4023,7 @@ void ScChangeTrack::GetDependents( ScChangeAction* pAct,
sal_Bool ScChangeTrack::SelectContent( ScChangeAction* pAct, sal_Bool bOldest )
{
if ( pAct->GetType() != SC_CAT_CONTENT )
- return sal_False;
+ return false;
ScChangeActionContent* pContent = (ScChangeActionContent*) pAct;
if ( bOldest )
@@ -4230,7 +4036,7 @@ sal_Bool ScChangeTrack::SelectContent( ScChangeAction* pAct, sal_Bool bOldest )
}
if ( !pContent->IsClickable() )
- return sal_False;
+ return false;
ScBigRange aBigRange( pContent->GetBigRange() );
const ScBaseCell* pCell = (bOldest ? pContent->GetOldCell() :
@@ -4245,12 +4051,12 @@ sal_Bool ScChangeTrack::SelectContent( ScChangeAction* pAct, sal_Bool bOldest )
}
if ( !aBigRange.IsValid( pDoc ) )
- return sal_False;
+ return false;
ScRange aRange( aBigRange.MakeRange() );
if ( !pDoc->IsBlockEditable( aRange.aStart.Tab(), aRange.aStart.Col(),
aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row() ) )
- return sal_False;
+ return false;
if ( pContent->HasDependent() )
{
@@ -4305,12 +4111,12 @@ void ScChangeTrack::AcceptAll()
sal_Bool ScChangeTrack::Accept( ScChangeAction* pAct )
{
if ( !pAct->IsClickable() )
- return sal_False;
+ return false;
if ( pAct->IsDeleteType() || pAct->GetType() == SC_CAT_CONTENT )
{
ScChangeActionTable aActionTable;
- GetDependents( pAct, aActionTable, sal_False, sal_True );
+ GetDependents( pAct, aActionTable, false, sal_True );
for ( ScChangeAction* p = aActionTable.First(); p; p = aActionTable.Next() )
{
p->Accept();
@@ -4341,15 +4147,15 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, bool bShared )
pAct->RemoveAllDeletedIn();
if ( !pAct->IsRejectable() )
- return sal_False;
+ return false;
ScChangeActionTable* pTable = NULL;
if ( pAct->HasDependent() )
{
pTable = new ScChangeActionTable;
- GetDependents( pAct, *pTable, sal_False, sal_True );
+ GetDependents( pAct, *pTable, false, sal_True );
}
- sal_Bool bRejected = Reject( pAct, pTable, sal_False );
+ sal_Bool bRejected = Reject( pAct, pTable, false );
if ( pTable )
delete pTable;
return bRejected;
@@ -4360,10 +4166,10 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl
sal_Bool bRecursion )
{
if ( !pAct->IsInternalRejectable() )
- return sal_False;
+ return false;
sal_Bool bOk = sal_True;
- sal_Bool bRejected = sal_False;
+ sal_Bool bRejected = false;
if ( pAct->IsInsertType() )
{
if ( pAct->HasDependent() && !bRecursion )
@@ -4380,7 +4186,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl
bOk = Reject( p, NULL, sal_True ); //! rekursiv
}
}
- if ( bOk && (bRejected = pAct->Reject( pDoc )) != sal_False )
+ if ( bOk && (bRejected = pAct->Reject( pDoc )) != false )
{
// pRefDoc NULL := geloeschte Zellen nicht speichern
AppendDeleteRange( pAct->GetBigRange().MakeRange(), NULL, (short) 0,
@@ -4405,14 +4211,14 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl
}
}
else
- bTabDel = bTabDelOk = sal_False;
+ bTabDel = bTabDelOk = false;
ScChangeActionDel* pDel = (ScChangeActionDel*) pAct;
if ( bOk )
{
aDelRange = pDel->GetOverAllRange();
bOk = aDelRange.IsValid( pDoc );
}
- sal_Bool bOneOk = sal_False;
+ sal_Bool bOneOk = false;
if ( bOk )
{
ScChangeActionType eActType = pAct->GetType();
@@ -4463,7 +4269,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl
bOneOk = sal_True;
}
if ( pDel->IsBaseDelete() )
- bLoop = sal_False;
+ bLoop = false;
else
p = p->GetPrev();
} while ( bOk && bLoop && p && p->GetType() == eActType &&
@@ -4490,7 +4296,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl
bOk = Reject( p, NULL, sal_True ); //! rekursiv
}
}
- if ( bOk && (bRejected = pAct->Reject( pDoc )) != sal_False )
+ if ( bOk && (bRejected = pAct->Reject( pDoc )) != false )
{
ScChangeActionMove* pReject = new ScChangeActionMove(
pAct->GetBigRange().MakeRange(),
@@ -4512,7 +4318,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl
pReject = new ScChangeActionContent( aRange );
pReject->SetOldValue( pDoc->GetCell( aRange.aStart ), pDoc, pDoc );
}
- if ( (bRejected = pAct->Reject( pDoc )) != sal_False && !bRecursion )
+ if ( (bRejected = pAct->Reject( pDoc )) != false && !bRecursion )
{
pReject->SetNewValue( pDoc->GetCell( aRange.aStart ), pDoc );
pReject->SetRejectAction( pAct->GetActionNumber() );
@@ -4524,7 +4330,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl
}
else
{
- DBG_ERROR( "ScChangeTrack::Reject: say what?" );
+ OSL_FAIL( "ScChangeTrack::Reject: say what?" );
}
return bRejected;
@@ -4838,32 +4644,4 @@ void ScChangeTrack::MergeActionState( ScChangeAction* pAct, const ScChangeAction
}
}
-#if DEBUG_CHANGETRACK
-String ScChangeTrack::ToString() const
-{
- String aReturn;
-
- aReturn += String::CreateFromAscii( "============================================================\n" );
-
- const ScChangeAction* pGenerated = GetFirstGenerated();
- while ( pGenerated )
- {
- aReturn += pGenerated->ToString( pDoc );
- aReturn += '\n';
- pGenerated = pGenerated->GetNext();
- }
-
- aReturn += String::CreateFromAscii( "------------------------------------------------------------\n" );
-
- const ScChangeAction* pAction = GetFirst();
- while ( pAction )
- {
- aReturn += pAction->ToString( pDoc );
- aReturn += '\n';
- pAction = pAction->GetNext();
- }
- aReturn += String::CreateFromAscii( "============================================================\n" );
-
- return aReturn;
-}
-#endif // DEBUG_CHANGETRACK
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx
index a1fad7dcfeb1..e50b43859e52 100644
--- a/sc/source/core/tool/chgviset.cxx
+++ b/sc/source/core/tool/chgviset.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116,7 +117,7 @@ void ScChangeViewSettings::SetTheComment(const String& rString)
if(rString.Len()>0)
{
utl::SearchParam aSearchParam( rString,
- utl::SearchParam::SRCH_REGEXP,sal_False,sal_False,sal_False );
+ utl::SearchParam::SRCH_REGEXP,false,false,false );
pCommentSearcher = new utl::TextSearch( aSearchParam, *ScGlobal::pCharClass );
}
@@ -142,22 +143,13 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc )
if ( pLast )
{
aFirstDateTime = pLast->GetDateTime();
-#if 0
-// This would be the proper handling. But since the SvxTPFilter dialog uses
-// DateField/TimeField, and the filter dialog is used in ScAcceptChgDlg as the
-// controlling instance, and the TimeFields are used there without seconds or
-// 100ths, we'd display some extra entries between the floor of the minute and
-// the start of the next minute.
- // add one 100th second to point past last saved
- aFirstDateTime += Time( 0, 0, 0, 1 );
-#else
+
// Set the next minute as the start time and assume that
// the document isn't saved, reloaded, edited and filter set
// all together during the gap between those two times.
aFirstDateTime += Time( 0, 1 );
aFirstDateTime.SetSec(0);
aFirstDateTime.Set100Sec(0);
-#endif
}
}
if ( !pLast )
@@ -176,3 +168,4 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/collect.cxx b/sc/source/core/tool/collect.cxx
index ec91244aaa34..c202107ea425 100644
--- a/sc/source/core/tool/collect.cxx
+++ b/sc/source/core/tool/collect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,7 +132,7 @@ sal_Bool ScCollection::AtInsert(sal_uInt16 nIndex, ScDataObject* pScDataObject)
{
ScDataObject** pNewItems = new ScDataObject*[nLimit + nDelta];
if (!pNewItems)
- return sal_False;
+ return false;
nLimit = sal::static_int_cast<sal_uInt16>( nLimit + nDelta );
memmove(pNewItems, pItems, nCount * sizeof(ScDataObject*));
delete[] pItems;
@@ -143,7 +144,7 @@ sal_Bool ScCollection::AtInsert(sal_uInt16 nIndex, ScDataObject* pScDataObject)
nCount++;
return sal_True;
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -224,7 +225,7 @@ sal_uInt16 ScSortedCollection::IndexOf(ScDataObject* pScDataObject) const
sal_Bool ScSortedCollection::Search(ScDataObject* pScDataObject, sal_uInt16& rIndex) const
{
rIndex = nCount;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
short nLo = 0;
short nHi = nCount - 1;
short nIndex;
@@ -260,7 +261,7 @@ sal_Bool ScSortedCollection::Insert(ScDataObject* pScDataObject)
if (bDuplicates)
return AtInsert(nIndex, pScDataObject);
else
- return sal_False;
+ return false;
}
else
return AtInsert(nIndex, pScDataObject);
@@ -276,7 +277,7 @@ sal_Bool ScSortedCollection::InsertPos(ScDataObject* pScDataObject, sal_uInt16&
if (bDuplicates)
return AtInsert(nIndex, pScDataObject);
else
- return sal_False;
+ return false;
}
else
return AtInsert(nIndex, pScDataObject);
@@ -287,10 +288,10 @@ sal_Bool ScSortedCollection::InsertPos(ScDataObject* pScDataObject, sal_uInt16&
sal_Bool ScSortedCollection::operator==(const ScSortedCollection& rCmp) const
{
if ( nCount != rCmp.nCount )
- return sal_False;
+ return false;
for (sal_uInt16 i=0; i<nCount; i++)
if ( !IsEqual(pItems[i],rCmp.pItems[i]) )
- return sal_False;
+ return false;
return sal_True;
}
@@ -334,24 +335,6 @@ ScDataObject* ScStrCollection::Clone() const
// TypedScStrCollection
//------------------------------------------------------------------------
-//UNUSED2008-05 TypedStrData::TypedStrData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab,
-//UNUSED2008-05 sal_Bool bAllStrings )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( pDoc->HasValueData( nCol, nRow, nTab ) )
-//UNUSED2008-05 {
-//UNUSED2008-05 pDoc->GetValue( nCol, nRow, nTab, nValue );
-//UNUSED2008-05 if (bAllStrings)
-//UNUSED2008-05 pDoc->GetString( nCol, nRow, nTab, aStrValue );
-//UNUSED2008-05 nStrType = 0;
-//UNUSED2008-05 }
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 pDoc->GetString( nCol, nRow, nTab, aStrValue );
-//UNUSED2008-05 nValue = 0.0;
-//UNUSED2008-05 nStrType = 1; //! Typ uebergeben ?
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-
ScDataObject* TypedStrData::Clone() const
{
@@ -361,7 +344,7 @@ ScDataObject* TypedStrData::Clone() const
TypedScStrCollection::TypedScStrCollection( sal_uInt16 nLim , sal_uInt16 nDel , sal_Bool bDup )
: ScSortedCollection( nLim, nDel, bDup )
{
- bCaseSensitive = sal_False;
+ bCaseSensitive = false;
}
TypedScStrCollection::~TypedScStrCollection()
@@ -429,7 +412,7 @@ sal_Bool TypedScStrCollection::FindText( const String& rStart, String& rResult,
// Die Collection ist nach String-Vergleichen sortiert, darum muss hier
// alles durchsucht werden
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
String aOldResult;
if ( rPos != SCPOS_INVALID && rPos < nCount )
@@ -515,8 +498,9 @@ sal_Bool TypedScStrCollection::GetExactMatch( String& rString ) const
}
}
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 3dd25801532f..746438a70f1e 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include <basic/sbmeth.hxx>
#include <basic/sbstar.hxx>
#include <svl/zforlist.hxx>
+#include <sal/macros.h>
#include <tools/rcid.h>
#include <tools/rc.hxx>
#include <tools/solar.h>
@@ -200,93 +202,6 @@ void ScCompiler::fillFromAddInCollectionEnglishName( NonConstOpCodeMapPtr xMap )
}
}
-
-#ifdef erGENERATEMAPPING
-// Run in en-US UI by calling from within gdb, edit pODFF entries afterwards.
-void dbg_call_generateMappingODFF()
-{
- // static ScCompiler members
- fprintf( stdout, "%s", "static struct AddInMap\n{\n const char* pODFF;\n const char* pEnglish;\n bool bMapDupToInternal;\n const char* pOriginal;\n const char* pUpper;\n} maAddInMap[];\n");
- fprintf( stdout, "%s", "static const AddInMap* GetAddInMap();\n");
- fprintf( stdout, "%s", "static size_t GetAddInMapCount();\n");
- fprintf( stdout, "addinfuncdata___:%s", "ScCompiler::AddInMap ScCompiler::maAddInMap[] =\n{\n");
- ScUnoAddInCollection* pColl = ScGlobal::GetAddInCollection();
- long nCount = pColl->GetFuncCount();
- for (long i=0; i < nCount; ++i)
- {
- const ScUnoAddInFuncData* pFuncData = pColl->GetFuncData(i);
- if (pFuncData)
- {
-#define out(rStr) (ByteString( rStr, RTL_TEXTENCODING_UTF8).GetBuffer())
- String aL = pFuncData->GetUpperLocal();
- String aP = pFuncData->GetOriginalName();
- String aU = pFuncData->GetUpperName();
- fprintf( stdout, "addinfuncdata%3ld: { \"%s\", \"%s\", false, \"%s\", \"%s\" },\n",
- i, out(aL), out(aL), out(aP), out(aU));
-#undef out
- }
- }
- fprintf( stdout, "addinfuncdata___:%s", "};\n");
- fprintf( stdout, "%s", "\n// static\nconst ScCompiler::AddInMap* ScCompiler::GetAddInMap()\n{\n return maAddInMap;\n}\n");
- fprintf( stdout, "%s", "\n// static\nsize_t ScCompiler::GetAddInMapCount()\n{\n return sizeof(maAddInMap)/sizeof(maAddInMap[0]);\n}\n");
- fflush( stdout);
-}
-#endif // erGENERATEMAPPING
-
-#ifdef erGENERATEMAPPINGDIFF
-// Run in en-US UI by calling from within gdb.
-void dbg_call_generateMappingDiff()
-{
- using namespace ::com::sun::star::sheet;
- ScCompiler::OpCodeMapPtr xPODF = ScCompiler::GetOpCodeMap(
- FormulaLanguage::ODF_11);
- ScCompiler::OpCodeMapPtr xODFF = ScCompiler::GetOpCodeMap(
- FormulaLanguage::ODFF);
- ScCompiler::OpCodeMapPtr xENUS = ScCompiler::GetOpCodeMap(
- FormulaLanguage::ENGLISH);
- sal_uInt16 nPODF = xPODF->getSymbolCount();
- sal_uInt16 nODFF = xODFF->getSymbolCount();
- sal_uInt16 nENUS = xENUS->getSymbolCount();
- printf( "%s\n", "This is a semicolon separated file, you may import it as such to Calc.");
- printf( "%s\n", "Spreadsheet functions name differences between PODF (ODF < 1.2) and ODFF (ODF >= 1.2), plus English UI names.");
- printf( "\nInternal OpCodes; PODF: %d; ODFF: %d; ENUS: %d\n",
- (int)nPODF, (int)nODFF, (int)nENUS);
- sal_uInt16 nMax = ::std::max( ::std::max( nPODF, nODFF), nENUS);
-#define out(rStr) (ByteString( rStr, RTL_TEXTENCODING_UTF8).GetBuffer())
- for (sal_uInt16 i=0; i < nMax; ++i)
- {
- const String& rPODF = xPODF->getSymbol(static_cast<OpCode>(i));
- const String& rODFF = xODFF->getSymbol(static_cast<OpCode>(i));
- const String& rENUS = xENUS->getSymbol(static_cast<OpCode>(i));
- if (rPODF != rODFF)
- printf( "%d;%s;%s;%s\n", (int)i, out(rPODF), out(rODFF), out(rENUS));
- }
- // Actually they should all differ, so we could simply list them all, but
- // this is correct and we would find odd things, if any.
- const ExternalHashMap* pPODF = xPODF->getReverseExternalHashMap();
- const ExternalHashMap* pODFF = xODFF->getReverseExternalHashMap();
- const ExternalHashMap* pENUS = xENUS->getReverseExternalHashMap();
- printf( "\n%s\n", "Add-In mapping");
- for (ExternalHashMap::const_iterator it = pPODF->begin(); it != pPODF->end(); ++it)
- {
- ExternalHashMap::const_iterator iLookODFF = pODFF->find( (*it).first);
- ExternalHashMap::const_iterator iLookENUS = pENUS->find( (*it).first);
- String aNative( iLookENUS == pENUS->end() ?
- String::CreateFromAscii( "ENGLISH_SYMBOL_NOT_FOUND") :
- (*iLookENUS).second);
- if (iLookODFF == pODFF->end())
- printf( "NOT FOUND;%s;;%s\n", out((*it).first), out(aNative));
- else if((*it).second == (*iLookODFF).second) // upper equal
- printf( "EQUAL;%s;%s;%s\n", out((*it).first), out((*iLookODFF).second), out(aNative));
- else
- printf( ";%s;%s;%s\n", out((*it).first), out((*iLookODFF).second), out(aNative));
- }
-#undef out
- fflush( stdout);
-}
-#endif // erGENERATEMAPPINGDIFF
-
-// static
void ScCompiler::DeInit()
{
if (pCharClassEnglish)
@@ -315,7 +230,7 @@ bool ScCompiler::IsEnglishSymbol( const String& rName )
}
// 3. new (uno) add in functions
- String aIntName(ScGlobal::GetAddInCollection()->FindFunction( aUpper, sal_False ));
+ String aIntName(ScGlobal::GetAddInCollection()->FindFunction( aUpper, false ));
if (aIntName.Len())
{
return true;
@@ -323,7 +238,6 @@ bool ScCompiler::IsEnglishSymbol( const String& rName )
return false; // no valid function name
}
-// static
void ScCompiler::InitCharClassEnglish()
{
::com::sun::star::lang::Locale aLocale(
@@ -369,11 +283,6 @@ void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar )
}
}
-void ScCompiler::SetEncodeUrlMode( EncodeUrlMode eMode )
-{
- meEncodeUrlMode = eMode;
-}
-
ScCompiler::EncodeUrlMode ScCompiler::GetEncodeUrlMode() const
{
return meEncodeUrlMode;
@@ -419,15 +328,6 @@ String ScCompiler::FindAddInFunction( const String& rUpperName, sal_Bool bLocalF
}
-#ifdef erDEBUG
-void dbg_call_testcreatemapping()
-{
- using namespace ::com::sun::star::sheet;
- ScCompiler::OpCodeMapPtr xMap = ScCompiler::GetOpCodeMap( FormulaLanguage::ODFF);
- xMap->createSequenceOfAvailableMappings( FormulaMapGroup::FUNCTIONS);
-}
-#endif
-
//-----------------------------------------------------------------------------
ScCompiler::Convention::~Convention()
@@ -548,7 +448,6 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv )
if( FormulaGrammar::CONV_XL_R1C1 == meConv )
{
-/* - */ t[45] |= SC_COMPILER_C_IDENT;
/* [ */ t[91] |= SC_COMPILER_C_IDENT;
/* ] */ t[93] |= SC_COMPILER_C_IDENT;
}
@@ -631,7 +530,7 @@ static bool lcl_parseExternalName(
if (c == '\'')
{
- // Move to the next chart and loop until the second single
+ // Move to the next char and loop until the second single
// quote.
cPrev = c;
++i; ++p;
@@ -648,8 +547,8 @@ static bool lcl_parseExternalName(
if (cPrev == '\'')
{
- // two consecutive quotes equals a single
- // quote in the file name.
+ // two consecutive quotes equal a single quote in
+ // the file name.
aTmpFile.Append(c);
cPrev = 'a';
}
@@ -661,12 +560,14 @@ static bool lcl_parseExternalName(
if (cPrev == '\'' && j != i)
{
- // this is not a quote but the previous one
- // is. This ends the parsing of the quoted
- // segment.
+ // this is not a quote but the previous one is. This
+ // ends the parsing of the quoted segment. At this
+ // point, the current char must equal the separator
+ // char.
i = j;
bInName = true;
+ aTmpName.Append(c); // Keep the separator as part of the name.
break;
}
aTmpFile.Append(c);
@@ -704,6 +605,7 @@ static bool lcl_parseExternalName(
if (c == cSep)
{
bInName = true;
+ aTmpName.Append(c); // Keep the separator as part of the name.
}
else
{
@@ -745,8 +647,29 @@ static bool lcl_parseExternalName(
return false;
}
+ xub_StrLen nNameLen = aTmpName.Len();
+ if (nNameLen < 2)
+ {
+ // Name must be at least 2-char long (separator plus name).
+ return false;
+ }
+
+ if (aTmpName.GetChar(0) != cSep)
+ {
+ // 1st char of the name must equal the separator.
+ return false;
+ }
+
+ sal_Unicode cLast = aTmpName.GetChar(nNameLen-1);
+ if (cLast == sal_Unicode('!'))
+ {
+ // Check against #REF!.
+ if (aTmpName.EqualsAscii("#REF!"))
+ return false;
+ }
+
rFile = aTmpFile;
- rName = aTmpName;
+ rName = aTmpName.Copy(1); // Skip the first char as it is always the separator.
return true;
}
@@ -772,15 +695,15 @@ static String lcl_makeExternalNameStr( const String& rFile, const String& rName,
return String( aBuf.makeStringAndClear());
}
-static bool lcl_getLastTabName( String& rTabName2, const String& rTabName1,
- const vector<String>& rTabNames, const ScComplexRefData& rRef )
+static bool lcl_getLastTabName( OUString& rTabName2, const OUString& rTabName1,
+ const vector<OUString>& rTabNames, const ScComplexRefData& rRef )
{
SCsTAB nTabSpan = rRef.Ref2.nTab - rRef.Ref1.nTab;
if (nTabSpan > 0)
{
size_t nCount = rTabNames.size();
- vector<String>::const_iterator itrBeg = rTabNames.begin(), itrEnd = rTabNames.end();
- vector<String>::const_iterator itr = ::std::find(itrBeg, itrEnd, rTabName1);
+ vector<OUString>::const_iterator itrBeg = rTabNames.begin(), itrEnd = rTabNames.end();
+ vector<OUString>::const_iterator itr = ::std::find(itrBeg, itrEnd, rTabName1);
if (itr == rTabNames.end())
{
rTabName2 = ScGlobal::GetRscString(STR_NO_REF_TABLE);
@@ -824,6 +747,11 @@ struct Convention_A1 : public ScCompiler::Convention
return pCharClass->parseAnyToken( rFormula,
nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed );
}
+
+ virtual sal_uLong getCharTableFlags( sal_Unicode c, sal_Unicode /*cLast*/ ) const
+ {
+ return mpCharTable[static_cast<sal_uInt8>(c)];
+ }
};
void Convention_A1::MakeColStr( rtl::OUStringBuffer& rBuffer, SCCOL nCol )
@@ -887,9 +815,6 @@ struct ConventionOOO_A1 : public Convention_A1
ScComplexRefData aRef( rRef );
// In case absolute/relative positions weren't separately available:
// transform relative to absolute!
- // AdjustReference( aRef.Ref1 );
- // if( !bSingleRef )
- // AdjustReference( aRef.Ref2 );
aRef.Ref1.CalcAbsIfRel( rComp.GetPos() );
if( !bSingleRef )
aRef.Ref2.CalcAbsIfRel( rComp.GetPos() );
@@ -1108,12 +1033,12 @@ struct ConventionOOO_A1 : public Convention_A1
rBuffer.append(sal_Unicode(':'));
- String aLastTabName;
+ OUString aLastTabName;
bool bDisplayTabName = (aRef.Ref1.nTab != aRef.Ref2.nTab);
if (bDisplayTabName)
{
// Get the name of the last table.
- vector<String> aTabNames;
+ vector<OUString> aTabNames;
pRefMgr->getAllCachedTableNames(nFileId, aTabNames);
if (aTabNames.empty())
{
@@ -1122,7 +1047,7 @@ struct ConventionOOO_A1 : public Convention_A1
if (!lcl_getLastTabName(aLastTabName, rTabName, aTabNames, aRef))
{
- DBG_ERROR( "ConventionOOO_A1::makeExternalRefStrImpl: sheet name not found");
+ OSL_FAIL( "ConventionOOO_A1::makeExternalRefStrImpl: sheet name not found");
// aLastTabName contains #REF!, proceed.
}
}
@@ -1321,11 +1246,11 @@ struct ConventionXL
rBuffer.append(sal_Unicode(']'));
}
- static void makeExternalTabNameRange( ::rtl::OUStringBuffer& rBuf, const String& rTabName,
- const vector<String>& rTabNames,
+ static void makeExternalTabNameRange( ::rtl::OUStringBuffer& rBuf, const OUString& rTabName,
+ const vector<OUString>& rTabNames,
const ScComplexRefData& rRef )
{
- String aLastTabName;
+ OUString aLastTabName;
if (!lcl_getLastTabName(aLastTabName, rTabName, rTabNames, rRef))
{
ScRangeStringConverter::AppendTableName(rBuf, aLastTabName);
@@ -1538,7 +1463,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
if (!pFullName)
return;
- vector<String> aTabNames;
+ vector<OUString> aTabNames;
pRefMgr->getAllCachedTableNames(nFileId, aTabNames);
if (aTabNames.empty())
return;
@@ -1745,7 +1670,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
if (!pFullName)
return;
- vector<String> aTabNames;
+ vector<OUString> aTabNames;
pRefMgr->getAllCachedTableNames(nFileId, aTabNames);
if (aTabNames.empty())
return;
@@ -1792,6 +1717,15 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
r1c1_add_row(rBuffer, aRef.Ref2);
r1c1_add_col(rBuffer, aRef.Ref2);
}
+
+ virtual sal_uLong getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const
+ {
+ sal_uLong nFlags = mpCharTable[static_cast<sal_uInt8>(c)];
+ if (c == '-' && cLast == '[')
+ // '-' can occur within a reference string only after '[' e.g. R[-1]C.
+ nFlags |= SC_COMPILER_C_IDENT;
+ return nFlags;
+ }
};
static const ConventionXL_R1C1 ConvXL_R1C1;
@@ -1982,7 +1916,8 @@ xub_StrLen ScCompiler::NextSymbol(bool bInArray)
while ((c != 0) && (eState != ssStop) )
{
pSrc++;
- sal_uLong nMask = GetCharTableFlags( c );
+ sal_uLong nMask = GetCharTableFlags( c, cLast );
+
// The parameter separator and the array column and row separators end
// things unconditionally if not in string or reference.
if (c == cSep || (bInArray && (c == cArrayColSep || c == cArrayRowSep)))
@@ -2012,7 +1947,7 @@ Label_MaskStateMachine:
if( nMask & SC_COMPILER_C_ODF_LABEL_OP )
{
// '!!' automatic intersection
- if (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_ODF_LABEL_OP)
+ if (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_ODF_LABEL_OP)
{
/* TODO: For now the UI "space operator" is used, this
* could be enhanced using a specialized OpCode to get
@@ -2043,7 +1978,7 @@ Label_MaskStateMachine:
else if( nMask & SC_COMPILER_C_ODF_NAME_MARKER )
{
// '$$' defined name marker
- if (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_ODF_NAME_MARKER)
+ if (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_ODF_NAME_MARKER)
{
// both eaten, not added to pSym
++pSrc;
@@ -2177,7 +2112,7 @@ Label_MaskStateMachine:
}
else if (c == 'E' || c == 'e')
{
- if (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_VALUE_EXP)
+ if (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_VALUE_EXP)
*pSym++ = c;
else
{
@@ -2189,7 +2124,7 @@ Label_MaskStateMachine:
else if( nMask & SC_COMPILER_C_VALUE_SIGN )
{
if (((cLast == 'E') || (cLast == 'e')) &&
- (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_VALUE_VALUE))
+ (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_VALUE_VALUE))
{
*pSym++ = c;
}
@@ -2461,6 +2396,7 @@ Label_MaskStateMachine:
nLen = MAXSTRLEN-1;
}
lcl_UnicodeStrNCpy( cSymbol, aSymbol.GetBuffer(), nLen );
+ pSym = &cSymbol[nLen];
}
else
{
@@ -2524,7 +2460,7 @@ sal_Bool ScCompiler::IsOpCode( const String& rName, bool bInArray )
{ "LEGACY.TDIST", ocTDist }, // TDIST -> LEGACY.TDIST
{ "ORG.OPENOFFICE.EASTERSUNDAY", ocEasterSunday } // EASTERSUNDAY -> ORG.OPENOFFICE.EASTERSUNDAY
};
- static const size_t nOdffAliases = sizeof(aOdffAliases) / sizeof(aOdffAliases[0]);
+ static const size_t nOdffAliases = SAL_N_ELEMENTS(aOdffAliases);
for (size_t i=0; i<nOdffAliases; ++i)
{
if (rName.EqualsIgnoreCaseAscii( aOdffAliases[i].pName))
@@ -2556,7 +2492,7 @@ sal_Bool ScCompiler::IsOpCode( const String& rName, bool bInArray )
// last resort by just falling through to FindFunction(), but
// it shouldn't happen if the map was setup correctly. Don't
// waste time and bail out.
- return sal_False;
+ return false;
}
}
if (!aIntName.Len())
@@ -2603,7 +2539,7 @@ sal_Bool ScCompiler::IsOpCode( const String& rName, bool bInArray )
sal_Bool ScCompiler::IsOpCode2( const String& rName )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 i;
for( i = ocInternalBegin; i <= ocInternalEnd && !bFound; i++ )
@@ -2623,8 +2559,7 @@ sal_Bool ScCompiler::IsValue( const String& rSym )
double fVal;
sal_uInt32 nIndex = ( mxSymbols->isEnglish() ?
pDoc->GetFormatTable()->GetStandardIndex( LANGUAGE_ENGLISH_US ) : 0 );
-// sal_uLong nIndex = 0;
-//// sal_uLong nIndex = pDoc->GetFormatTable()->GetStandardIndex(ScGlobal::eLnge);
+
if (pDoc->GetFormatTable()->IsNumberFormat( rSym, nIndex, fVal ) )
{
sal_uInt16 nType = pDoc->GetFormatTable()->GetType(nIndex);
@@ -2635,7 +2570,7 @@ sal_Bool ScCompiler::IsValue( const String& rSym )
// Usually it wouldn't be accepted anyway because the date separator
// clashed with other separators or operators.
if (nType & (NUMBERFORMAT_TIME | NUMBERFORMAT_DATE))
- return sal_False;
+ return false;
if (nType == NUMBERFORMAT_LOGICAL)
{
@@ -2643,13 +2578,9 @@ sal_Bool ScCompiler::IsValue( const String& rSym )
while( *p == ' ' )
p++;
if (*p == '(')
- return sal_False; // Boolean function instead.
+ return false; // Boolean function instead.
}
- if( aFormula.GetChar(nSrcPos) == '.' )
- // numerical sheet name?
- return sal_False;
-
if( nType == NUMBERFORMAT_TEXT )
// HACK: number too big!
SetError( errIllegalArgument );
@@ -2659,7 +2590,7 @@ sal_Bool ScCompiler::IsValue( const String& rSym )
return sal_True;
}
else
- return sal_False;
+ return false;
}
sal_Bool ScCompiler::IsString()
@@ -2672,7 +2603,7 @@ sal_Bool ScCompiler::IsString()
if ((bQuote ? nLen-2 : nLen) > MAXSTRLEN-1)
{
SetError(errStringOverflow);
- return sal_False;
+ return false;
}
if ( bQuote )
{
@@ -2682,7 +2613,7 @@ sal_Bool ScCompiler::IsString()
pRawToken = aToken.Clone();
return sal_True;
}
- return sal_False;
+ return false;
}
@@ -2833,7 +2764,7 @@ sal_Bool ScCompiler::IsReference( const String& rName )
sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' :
ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0) );
if ( ch1 == cDecSep )
- return sal_False;
+ return false;
// Who was that imbecile introducing '.' as the sheet name separator!?!
if ( CharClass::isAsciiNumeric( ch1 ) )
{
@@ -2848,14 +2779,14 @@ sal_Bool ScCompiler::IsReference( const String& rName )
{
if (ScGlobal::FindUnquoted( rName, ':') != STRING_NOTFOUND)
break; // may be 3:3, continue as usual
- return sal_False;
+ return false;
}
sal_Unicode const * const pTabSep = rName.GetBuffer() + nPos;
sal_Unicode ch2 = pTabSep[1]; // maybe a column identifier
if ( !(ch2 == '$' || CharClass::isAsciiAlpha( ch2 )) )
- return sal_False;
+ return false;
if ( cDecSep == '.' && (ch2 == 'E' || ch2 == 'e') // E + - digit
- && (GetCharTableFlags( pTabSep[2] ) & SC_COMPILER_C_VALUE_EXP) )
+ && (GetCharTableFlags( pTabSep[2], pTabSep[1] ) & SC_COMPILER_C_VALUE_EXP) )
{ // #91053#
// If it is an 1.E2 expression check if "1" is an existent sheet
// name. If so, a desired value 1.E2 would have to be entered as
@@ -2870,7 +2801,7 @@ sal_Bool ScCompiler::IsReference( const String& rName )
String aTabName( rName.Copy( 0, nPos ) );
SCTAB nTab;
if ( !pDoc->GetTable( aTabName, nTab ) )
- return sal_False;
+ return false;
// If sheet "1" exists and the expression is 1.E+2 continue as
// usual, the ScRange/ScAddress parser will take care of it.
}
@@ -2941,14 +2872,14 @@ sal_Bool ScCompiler::IsMacro( const String& rName )
SbxMethod* pMeth = (SbxMethod*) pObj->Find( aName, SbxCLASS_METHOD );
if( !pMeth )
{
- return sal_False;
+ return false;
}
// It really should be a BASIC function!
if( pMeth->GetType() == SbxVOID
|| ( pMeth->IsFixed() && pMeth->GetType() == SbxEMPTY )
|| !pMeth->ISA(SbMethod) )
{
- return sal_False;
+ return false;
}
ScRawToken aToken;
aToken.SetExternal( aName.GetBuffer() );
@@ -2961,18 +2892,17 @@ sal_Bool ScCompiler::IsNamedRange( const String& rUpperName )
{
// IsNamedRange is called only from NextNewToken, with an upper-case string
- sal_uInt16 n;
ScRangeName* pRangeName = pDoc->GetRangeName();
- if (pRangeName->SearchNameUpper( rUpperName, n ) )
+ const ScRangeData* pData = pRangeName->findByUpperName(rUpperName);
+ if (pData)
{
- ScRangeData* pData = (*pRangeName)[n];
ScRawToken aToken;
aToken.SetName( pData->GetIndex() );
pRawToken = aToken.Clone();
- return sal_True;
+ return true;
}
else
- return sal_False;
+ return false;
}
bool ScCompiler::IsExternalNamedRange( const String& rSymbol )
@@ -2983,7 +2913,6 @@ bool ScCompiler::IsExternalNamedRange( const String& rSymbol )
* spec first. Until then don't pretend to support external names that
* wouldn't survive a save and reload cycle, return false instead. */
-#if 0
if (!pConv)
return false;
@@ -3006,10 +2935,6 @@ bool ScCompiler::IsExternalNamedRange( const String& rSymbol )
aToken.SetExternalName(nFileId, pRealName ? *pRealName : aName);
pRawToken = aToken.Clone();
return true;
-#else
- (void)rSymbol;
- return false;
-#endif
}
sal_Bool ScCompiler::IsDBRange( const String& rName )
@@ -3026,19 +2951,19 @@ sal_Bool ScCompiler::IsDBRange( const String& rName )
return sal_True;
}
else
- return sal_False;
+ return false;
}
sal_Bool ScCompiler::IsColRowName( const String& rName )
{
- sal_Bool bInList = sal_False;
- sal_Bool bFound = sal_False;
+ sal_Bool bInList = false;
+ sal_Bool bFound = false;
ScSingleRefData aRef;
String aName( rName );
DeQuote( aName );
SCTAB nThisTab = aPos.Tab();
for ( short jThisTab = 1; jThisTab >= 0 && !bInList; jThisTab-- )
- { // #50300# first check ranges on this sheet, in case of duplicated names
+ { // first check ranges on this sheet, in case of duplicated names
for ( short jRow=0; jRow<2 && !bInList; jRow++ )
{
ScRangePairList* pRL;
@@ -3046,8 +2971,9 @@ sal_Bool ScCompiler::IsColRowName( const String& rName )
pRL = pDoc->GetColNameRanges();
else
pRL = pDoc->GetRowNameRanges();
- for ( ScRangePair* pR = pRL->First(); pR && !bInList; pR = pRL->Next() )
+ for ( size_t iPair = 0, nPairs = pRL->size(); iPair < nPairs && !bInList; ++iPair )
{
+ ScRangePair* pR = (*pRL)[iPair];
const ScRange& rNameRange = pR->GetRange(0);
if ( jThisTab && !(rNameRange.aStart.Tab() <= nThisTab &&
nThisTab <= rNameRange.aEnd.Tab()) )
@@ -3113,17 +3039,17 @@ sal_Bool ScCompiler::IsColRowName( const String& rName )
long nDistance = 0, nMax = 0;
long nMyCol = (long) aPos.Col();
long nMyRow = (long) aPos.Row();
- sal_Bool bTwo = sal_False;
+ sal_Bool bTwo = false;
ScAddress aOne( 0, 0, aPos.Tab() );
ScAddress aTwo( MAXCOL, MAXROW, aPos.Tab() );
ScAutoNameCache* pNameCache = pDoc->GetAutoNameCache();
if ( pNameCache )
{
- // #b6355215# use GetNameOccurences to collect all positions of aName on the sheet
+ // use GetNameOccurrences to collect all positions of aName on the sheet
// (only once), similar to the outer part of the loop in the "else" branch.
- const ScAutoNameAddresses& rAddresses = pNameCache->GetNameOccurences( aName, aPos.Tab() );
+ const ScAutoNameAddresses& rAddresses = pNameCache->GetNameOccurrences( aName, aPos.Tab() );
// Loop through the found positions, similar to the inner part of the loop in the "else" branch.
// The order of addresses in the vector is the same as from ScCellIterator.
@@ -3163,7 +3089,7 @@ sal_Bool ScCompiler::IsColRowName( const String& rName )
// upper left, only if not further up than the
// current entry and nMyRow is below (CellIter
// runs column-wise)
- bTwo = sal_False;
+ bTwo = false;
aOne.Set( nCol, nRow, aAddress.Tab() );
nMax = Max( nMyCol + nC, nMyRow + nR );
nDistance = nD;
@@ -3242,7 +3168,7 @@ sal_Bool ScCompiler::IsColRowName( const String& rName )
// upper left, only if not further up than the
// current entry and nMyRow is below (CellIter
// runs column-wise)
- bTwo = sal_False;
+ bTwo = false;
aOne.Set( nCol, nRow, aIter.GetTab() );
nMax = Max( nMyCol + nC, nMyRow + nR );
nDistance = nD;
@@ -3312,7 +3238,7 @@ sal_Bool ScCompiler::IsColRowName( const String& rName )
return sal_True;
}
else
- return sal_False;
+ return false;
}
sal_Bool ScCompiler::IsBoolean( const String& rName )
@@ -3328,7 +3254,7 @@ sal_Bool ScCompiler::IsBoolean( const String& rName )
return sal_True;
}
else
- return sal_False;
+ return false;
}
//---------------------------------------------------------------------------
@@ -3344,12 +3270,13 @@ void ScCompiler::AutoCorrectParsedSymbol()
const sal_Unicode cX = 'X';
sal_Unicode c1 = aCorrectedSymbol.GetChar( 0 );
sal_Unicode c2 = aCorrectedSymbol.GetChar( nPos );
+ sal_Unicode c2p = nPos > 0 ? aCorrectedSymbol.GetChar( nPos-1 ) : 0;
if ( c1 == cQuote && c2 != cQuote )
{ // "...
// What's not a word doesn't belong to it.
// Don't be pedantic: c < 128 should be sufficient here.
while ( nPos && ((aCorrectedSymbol.GetChar(nPos) < 128) &&
- ((GetCharTableFlags( aCorrectedSymbol.GetChar(nPos) ) &
+ ((GetCharTableFlags(aCorrectedSymbol.GetChar(nPos), aCorrectedSymbol.GetChar(nPos-1)) &
(SC_COMPILER_C_WORD | SC_COMPILER_C_CHAR_DONTCARE)) == 0)) )
nPos--;
if ( nPos == MAXSTRLEN - 2 )
@@ -3368,8 +3295,8 @@ void ScCompiler::AutoCorrectParsedSymbol()
aCorrectedSymbol = mxSymbols->getSymbol(ocMul);
bCorrected = sal_True;
}
- else if ( (GetCharTableFlags( c1 ) & SC_COMPILER_C_CHAR_VALUE)
- && (GetCharTableFlags( c2 ) & SC_COMPILER_C_CHAR_VALUE) )
+ else if ( (GetCharTableFlags( c1, 0 ) & SC_COMPILER_C_CHAR_VALUE)
+ && (GetCharTableFlags( c2, c2p ) & SC_COMPILER_C_CHAR_VALUE) )
{
xub_StrLen nXcount;
if ( (nXcount = aCorrectedSymbol.GetTokenCount( cx )) > 1 )
@@ -3466,7 +3393,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
aSymbol += aTmp1;
}
else
- bColons = sal_False;
+ bColons = false;
if ( nRefs && nRefs <= 2 )
{ // reference twisted? 4A => A4 etc.
String aTab[2], aRef[2];
@@ -3479,7 +3406,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
else
aRef[0] = aSymbol;
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
sal_Bool bOk = sal_True;
sal_uInt16 nMask = SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW;
for ( int j=0; j<nRefs; j++ )
@@ -3547,11 +3474,6 @@ sal_Bool ScCompiler::NextNewToken( bool bInArray )
bool bAllowBooleans = bInArray;
xub_StrLen nSpaces = NextSymbol(bInArray);
-#if 0
- fprintf( stderr, "NextNewToken '%s' (spaces = %d)\n",
- rtl::OUStringToOString( cSymbol, RTL_TEXTENCODING_UTF8 ).getStr(), nSpaces );
-#endif
-
if (!cSymbol[0])
return false;
@@ -3588,8 +3510,8 @@ sal_Bool ScCompiler::NextNewToken( bool bInArray )
if ( (cSymbol[0] == '#' || cSymbol[0] == '$') && cSymbol[1] == 0 &&
!bAutoCorrect )
- { // #101100# special case to speed up broken [$]#REF documents
- /* FIXME: ISERROR(#REF!) would be valid and sal_True and the formula to
+ { // special case to speed up broken [$]#REF documents
+ /* FIXME: ISERROR(#REF!) would be valid and TRUE and the formula to
* be processed as usual. That would need some special treatment,
* also in NextSymbol() because of possible combinations of
* #REF!.#REF!#REF! parts. In case of reading ODF that is all
@@ -3625,12 +3547,7 @@ sal_Bool ScCompiler::NextNewToken( bool bInArray )
bMayBeFuncName = ( *p == '(' );
}
-#if 0
- fprintf( stderr, "Token '%s'\n",
- rtl::OUStringToOString( aUpper, RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
-
- // #42016# Italian ARCTAN.2 resulted in #REF! => IsOpcode() before
+ // Italian ARCTAN.2 resulted in #REF! => IsOpcode() before
// IsReference().
String aUpper;
@@ -3730,11 +3647,6 @@ void ScCompiler::CreateStringFromXMLTokenArray( String& rFormula, String& rFormu
ScTokenArray* ScCompiler::CompileString( const String& rFormula )
{
-#if 0
- fprintf( stderr, "CompileString '%s'\n",
- rtl::OUStringToOString( rFormula, RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
-
OSL_ENSURE( meGrammar != FormulaGrammar::GRAM_EXTERNAL, "ScCompiler::CompileString - unexpected grammar GRAM_EXTERNAL" );
if( meGrammar == FormulaGrammar::GRAM_EXTERNAL )
SetGrammar( FormulaGrammar::GRAM_PODF );
@@ -3746,7 +3658,7 @@ ScTokenArray* ScCompiler::CompileString( const String& rFormula )
aFormula.EraseLeadingChars();
aFormula.EraseTrailingChars();
nSrcPos = 0;
- bCorrected = sal_False;
+ bCorrected = false;
if ( bAutoCorrect )
{
aCorrectedFormula.Erase();
@@ -3971,7 +3883,7 @@ ScTokenArray* ScCompiler::CompileString( const String& rFormula, const String& r
sal_Bool ScCompiler::HandleRange()
{
- ScRangeData* pRangeData = pDoc->GetRangeName()->FindIndex( pToken->GetIndex() );
+ ScRangeData* pRangeData = pDoc->GetRangeName()->findByIndex( pToken->GetIndex() );
if (pRangeData)
{
sal_uInt16 nErr = pRangeData->GetErrCode();
@@ -3980,8 +3892,8 @@ sal_Bool ScCompiler::HandleRange()
else if ( !bCompileForFAP )
{
ScTokenArray* pNew;
- // #35168# put named formula into parentheses.
- // #37680# But only if there aren't any yet, parenthetical
+ // put named formula into parentheses.
+ // But only if there aren't any yet, parenthetical
// ocSep doesn't work, e.g. SUM((...;...))
// or if not directly between ocSep/parenthesis,
// e.g. SUM(...;(...;...)) no, SUM(...;(...)*3) yes,
@@ -4063,8 +3975,8 @@ sal_Bool ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
return GetToken();
}
default:
- DBG_ERROR("Wrong type for external reference!");
- return sal_False;
+ OSL_FAIL("Wrong type for external reference!");
+ return false;
}
return sal_True;
}
@@ -4096,7 +4008,7 @@ sal_Bool ScCompiler::HasModifiedRange()
OpCode eOpCode = t->GetOpCode();
if ( eOpCode == ocName )
{
- ScRangeData* pRangeData = pDoc->GetRangeName()->FindIndex(t->GetIndex());
+ ScRangeData* pRangeData = pDoc->GetRangeName()->findByIndex(t->GetIndex());
if (pRangeData && pRangeData->IsModified())
return sal_True;
@@ -4109,7 +4021,7 @@ sal_Bool ScCompiler::HasModifiedRange()
return sal_True;
}
}
- return sal_False;
+ return false;
}
@@ -4165,7 +4077,6 @@ void ScCompiler::MoveRelWrap( SCCOL nMaxCol, SCROW nMaxRow )
}
}
-// static
// Wrap-adjust relative references of a RangeName to current position,
// don't call for other token arrays!
void ScCompiler::MoveRelWrap( ScTokenArray& rArr, ScDocument* pDoc, const ScAddress& rPos,
@@ -4185,14 +4096,14 @@ void ScCompiler::MoveRelWrap( ScTokenArray& rArr, ScDocument* pDoc, const ScAddr
ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
const ScAddress& rOldPos, const ScRange& r,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
- sal_Bool& rChanged, sal_Bool& rRefSizeChanged )
+ bool& rChanged, bool& rRefSizeChanged )
{
- rChanged = rRefSizeChanged = sal_False;
+ rChanged = rRefSizeChanged = false;
if ( eUpdateRefMode == URM_COPY )
{ // Normally nothing has to be done here since RelRefs are used, also
// SharedFormulas don't need any special handling, except if they
// wrapped around sheet borders.
- // #67383# But ColRowName tokens pointing to a ColRow header which was
+ // But ColRowName tokens pointing to a ColRow header which was
// copied along with this formula need to be updated to point to the
// copied header instead of the old position's new intersection.
ScToken* t;
@@ -4209,7 +4120,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
SingleDoubleRefModifier( rRef ).Ref() )
!= UR_NOTHING
)
- rChanged = sal_True;
+ rChanged = true;
}
}
// Check for SharedFormulas.
@@ -4220,7 +4131,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
{
if( j->GetOpCode() == ocName )
{
- ScRangeData* pName = pDoc->GetRangeName()->FindIndex( j->GetIndex() );
+ ScRangeData* pName = pDoc->GetRangeName()->findByIndex( j->GetIndex() );
if (pName && pName->HasType(RT_SHARED))
pRangeData = pName;
}
@@ -4249,7 +4160,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
if (!bValid)
{
pRangeData = pName;
- rChanged = sal_True;
+ rChanged = true;
}
}
}
@@ -4273,12 +4184,12 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
{
if( t->GetOpCode() == ocName )
{
- ScRangeData* pName = pDoc->GetRangeName()->FindIndex( t->GetIndex() );
+ ScRangeData* pName = pDoc->GetRangeName()->findByIndex( t->GetIndex() );
if (pName && pName->HasType(RT_SHAREDMOD))
{
pRangeData = pName; // maybe need a replacement of shared with own code
#if ! SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE
- rChanged = sal_True;
+ rChanged = true;
#endif
}
}
@@ -4303,7 +4214,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
SingleDoubleRefModifier(
t->GetSingleRef()).Ref())
!= UR_NOTHING)
- rChanged = sal_True;
+ rChanged = true;
}
break;
default:
@@ -4316,11 +4227,11 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
aPos, r, nDx, nDy, nDz,
t->GetDoubleRef()) != UR_NOTHING)
{
- rChanged = sal_True;
+ rChanged = true;
if (rRef.Ref2.nCol - rRef.Ref1.nCol != nCols ||
rRef.Ref2.nRow - rRef.Ref1.nRow != nRows ||
rRef.Ref2.nTab - rRef.Ref1.nTab != nTabs)
- rRefSizeChanged = sal_True;
+ rRefSizeChanged = true;
}
}
}
@@ -4329,7 +4240,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE
sal_Bool bEasyShared, bPosInRange;
if ( !pRangeData )
- bEasyShared = bPosInRange = sal_False;
+ bEasyShared = bPosInRange = false;
else
{
bEasyShared = sal_True;
@@ -4342,7 +4253,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
if ( t->GetRef() != 1 )
{
#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE
- bEasyShared = sal_False;
+ bEasyShared = false;
#endif
}
else
@@ -4354,7 +4265,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
if ( rRef.IsRelName() )
{
ScRefUpdate::MoveRelWrap( pDoc, aPos, MAXCOL, MAXROW, aMod.Ref() );
- rChanged = sal_True;
+ rChanged = true;
}
else
{
@@ -4363,7 +4274,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
r, nDx, nDy, nDz, aMod.Ref() )
!= UR_NOTHING
)
- rChanged = sal_True;
+ rChanged = true;
}
#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE
if ( bEasyShared )
@@ -4371,7 +4282,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
const ScSingleRefData& rSRD = aMod.Ref().Ref1;
ScAddress aRef( rSRD.nCol, rSRD.nRow, rSRD.nTab );
if ( r.In( aRef ) != bPosInRange )
- bEasyShared = sal_False;
+ bEasyShared = false;
}
#endif
}
@@ -4384,7 +4295,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
if ( rRef.Ref1.IsRelName() || rRef.Ref2.IsRelName() )
{
ScRefUpdate::MoveRelWrap( pDoc, aPos, MAXCOL, MAXROW, rRef );
- rChanged = sal_True;
+ rChanged = true;
}
else
{
@@ -4393,14 +4304,14 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
!= UR_NOTHING
)
{
- rChanged = sal_True;
+ rChanged = true;
if (rRef.Ref2.nCol - rRef.Ref1.nCol != nCols ||
rRef.Ref2.nRow - rRef.Ref1.nRow != nRows ||
rRef.Ref2.nTab - rRef.Ref1.nTab != nTabs)
{
- rRefSizeChanged = sal_True;
+ rRefSizeChanged = true;
#if SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE
- bEasyShared = sal_False;
+ bEasyShared = false;
#endif
}
}
@@ -4412,7 +4323,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
rRef.Ref1.nTab, rRef.Ref2.nCol, rRef.Ref2.nRow,
rRef.Ref2.nTab );
if ( r.In( aRef ) != bPosInRange )
- bEasyShared = sal_False;
+ bEasyShared = false;
}
#endif
}
@@ -4424,7 +4335,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
if ( bEasyShared )
pRangeData = 0;
else
- rChanged = sal_True;
+ rChanged = true;
}
#endif
#undef SC_PRESERVE_SHARED_FORMULAS_IF_POSSIBLE
@@ -4437,8 +4348,8 @@ sal_Bool ScCompiler::UpdateNameReference(UpdateRefMode eUpdateRefMode,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
sal_Bool& rChanged, sal_Bool bSharedFormula)
{
- sal_Bool bRelRef = sal_False; // set if relative reference
- rChanged = sal_False;
+ sal_Bool bRelRef = false; // set if relative reference
+ rChanged = false;
pArr->Reset();
ScToken* t;
while ( (t = static_cast<ScToken*>(pArr->GetNextReference())) != NULL )
@@ -4553,7 +4464,7 @@ ScRangeData* ScCompiler::UpdateInsertTab( SCTAB nTable, sal_Bool bIsName )
ScRangeData* pRangeData = NULL;
SCTAB nPosTab = aPos.Tab(); // _after_ incremented!
SCTAB nOldPosTab = ((nPosTab > nTable) ? (nPosTab - 1) : nPosTab);
- sal_Bool bIsRel = sal_False;
+ sal_Bool bIsRel = false;
ScToken* t;
pArr->Reset();
if (bIsName)
@@ -4566,7 +4477,7 @@ ScRangeData* ScCompiler::UpdateInsertTab( SCTAB nTable, sal_Bool bIsName )
{
if (!bIsName)
{
- ScRangeData* pName = pDoc->GetRangeName()->FindIndex(t->GetIndex());
+ ScRangeData* pName = pDoc->GetRangeName()->findByIndex(t->GetIndex());
if (pName && pName->HasType(RT_SHAREDMOD))
pRangeData = pName;
}
@@ -4663,8 +4574,8 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, sal_Bool /* bIsMove */, s
SCTAB nTab, nTab2;
SCTAB nPosTab = aPos.Tab(); // _after_ decremented!
SCTAB nOldPosTab = ((nPosTab >= nTable) ? (nPosTab + 1) : nPosTab);
- rChanged = sal_False;
- sal_Bool bIsRel = sal_False;
+ rChanged = false;
+ sal_Bool bIsRel = false;
ScToken* t;
pArr->Reset();
if (bIsName)
@@ -4677,7 +4588,7 @@ ScRangeData* ScCompiler::UpdateDeleteTab(SCTAB nTable, sal_Bool /* bIsMove */, s
{
if (!bIsName)
{
- ScRangeData* pName = pDoc->GetRangeName()->FindIndex(t->GetIndex());
+ ScRangeData* pName = pDoc->GetRangeName()->findByIndex(t->GetIndex());
if (pName && pName->HasType(RT_SHAREDMOD))
pRangeData = pName;
}
@@ -4874,7 +4785,7 @@ ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab,
else
nOldPosTab = nPosTab - nDir; // moved by one
- sal_Bool bIsRel = sal_False;
+ sal_Bool bIsRel = false;
ScToken* t;
pArr->Reset();
if (bIsName)
@@ -4887,7 +4798,7 @@ ScRangeData* ScCompiler::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab,
{
if (!bIsName)
{
- ScRangeData* pName = pDoc->GetRangeName()->FindIndex(t->GetIndex());
+ ScRangeData* pName = pDoc->GetRangeName()->findByIndex(t->GetIndex());
if (pName && pName->HasType(RT_SHAREDMOD))
pRangeData = pName;
}
@@ -5082,18 +4993,15 @@ void ScCompiler::CreateStringFromMatrix( rtl::OUStringBuffer& rBuffer,
if( pMatrix->IsValue( nC, nR ) )
{
- ScMatValType nType;
- const ScMatrixValue* pVal = pMatrix->Get( nC, nR, nType);
-
- if( nType == SC_MATVAL_BOOLEAN )
- AppendBoolean( rBuffer, pVal->GetBoolean() );
+ if (pMatrix->IsBoolean(nC, nR))
+ AppendBoolean(rBuffer, pMatrix->GetDouble(nC, nR) != 0.0);
else
{
- sal_uInt16 nErr = pVal->GetError();
- if( nErr )
- rBuffer.append( ScGlobal::GetErrorString( nErr ) );
+ sal_uInt16 nErr = pMatrix->GetError(nC, nR);
+ if (nErr)
+ rBuffer.append(ScGlobal::GetErrorString(nErr));
else
- AppendDouble( rBuffer, pVal->fVal );
+ AppendDouble(rBuffer, pMatrix->GetDouble(nC, nR));
}
}
else if( pMatrix->IsEmpty( nC, nR ) )
@@ -5133,7 +5041,7 @@ void ScCompiler::CreateStringFromSingleRef(rtl::OUStringBuffer& rBuffer,FormulaT
// -----------------------------------------------------------------------------
void ScCompiler::CreateStringFromDoubleRef(rtl::OUStringBuffer& rBuffer,FormulaToken* _pTokenP)
{
- pConv->MakeRefStr( rBuffer, *this, static_cast<ScToken*>(_pTokenP)->GetDoubleRef(), sal_False );
+ pConv->MakeRefStr( rBuffer, *this, static_cast<ScToken*>(_pTokenP)->GetDoubleRef(), false );
}
// -----------------------------------------------------------------------------
void ScCompiler::CreateStringFromIndex(rtl::OUStringBuffer& rBuffer,FormulaToken* _pTokenP)
@@ -5144,7 +5052,7 @@ void ScCompiler::CreateStringFromIndex(rtl::OUStringBuffer& rBuffer,FormulaToken
{
case ocName:
{
- ScRangeData* pData = pDoc->GetRangeName()->FindIndex(_pTokenP->GetIndex());
+ ScRangeData* pData = pDoc->GetRangeName()->findByIndex(_pTokenP->GetIndex());
if (pData)
{
if (pData->HasType(RT_SHARED))
@@ -5187,7 +5095,7 @@ sal_Bool ScCompiler::EnQuote( String& rStr )
sal_Int32 nType = ScGlobal::pCharClass->getStringType( rStr, 0, rStr.Len() );
if ( !CharClass::isNumericType( nType )
&& CharClass::isAlphaNumericType( nType ) )
- return sal_False;
+ return false;
xub_StrLen nPos = 0;
while ( (nPos = rStr.Search( '\'', nPos)) != STRING_NOTFOUND )
@@ -5237,7 +5145,7 @@ void ScCompiler::fillAddInToken(::std::vector< ::com::sun::star::sheet::FormulaO
// -----------------------------------------------------------------------------
sal_Bool ScCompiler::HandleSingleRef()
{
- ScSingleRefData& rRef = static_cast<ScToken*>((FormulaToken*)pToken)->GetSingleRef();
+ ScSingleRefData& rRef = static_cast<ScToken*>(pToken.get())->GetSingleRef();
rRef.CalcAbsIfRel( aPos );
if ( !rRef.Valid() )
{
@@ -5251,13 +5159,14 @@ sal_Bool ScCompiler::HandleSingleRef()
sal_Bool bColName = rRef.IsColRel();
SCCOL nMyCol = aPos.Col();
SCROW nMyRow = aPos.Row();
- sal_Bool bInList = sal_False;
- sal_Bool bValidName = sal_False;
+ sal_Bool bInList = false;
+ sal_Bool bValidName = false;
ScRangePairList* pRL = (bColName ?
pDoc->GetColNameRanges() : pDoc->GetRowNameRanges());
ScRange aRange;
- for ( ScRangePair* pR = pRL->First(); pR; pR = pRL->Next() )
+ for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
{
+ ScRangePair* pR = (*pRL)[i];
if ( pR->GetRange(0).In( aLook ) )
{
bInList = bValidName = sal_True;
@@ -5302,8 +5211,9 @@ sal_Bool ScCompiler::HandleSingleRef()
nMaxRow = nMyRow - 1;
}
}
- for ( ScRangePair* pR = pRL->First(); pR; pR = pRL->Next() )
+ for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
{ // next defined ColNameRange below limits row
+ ScRangePair* pR = (*pRL)[i];
const ScRange& rRange = pR->GetRange(1);
if ( rRange.aStart.Col() <= nCol && nCol <= rRange.aEnd.Col() )
{ // identical column range
@@ -5334,8 +5244,9 @@ sal_Bool ScCompiler::HandleSingleRef()
nMaxCol = nMyCol - 1;
}
}
- for ( ScRangePair* pR = pRL->First(); pR; pR = pRL->Next() )
+ for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
{ // next defined RowNameRange to the right limits column
+ ScRangePair* pR = (*pRL)[i];
const ScRange& rRange = pR->GetRange(1);
if ( rRange.aStart.Row() <= nRow && nRow <= rRange.aEnd.Row() )
{ // identical row range
@@ -5469,12 +5380,10 @@ sal_Bool ScCompiler::HandleDbData()
return sal_True;
}
-String GetScCompilerNativeSymbol( OpCode eOp )
-{
- return ScCompiler::GetNativeSymbol( eOp );
-}
// -----------------------------------------------------------------------------
FormulaTokenRef ScCompiler::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, bool bReuseDoubleRef )
{
return ScToken::ExtendRangeReference( rTok1, rTok2, aPos,bReuseDoubleRef );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index 565a469de9f4..e92963b0c645 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,22 +50,6 @@
// STATIC DATA -----------------------------------------------------------
-/* Strings bei Gelegenheit ganz raus...
-static sal_uInt16 nFuncRes[] = { // Reihenfolge wie bei enum ScSubTotalFunc
- 0, // none
- STR_PIVOTFUNC_AVG,
- STR_PIVOTFUNC_COUNT,
- STR_PIVOTFUNC_COUNT2,
- STR_PIVOTFUNC_MAX,
- STR_PIVOTFUNC_MIN,
- STR_PIVOTFUNC_PROD,
- STR_PIVOTFUNC_STDDEV,
- STR_PIVOTFUNC_STDDEV2,
- STR_PIVOTFUNC_SUM,
- STR_PIVOTFUNC_VAR,
- STR_PIVOTFUNC_VAR2 };
-*/
-
static OpCode eOpCodeTable[] = { // Reihenfolge wie bei enum ScSubTotalFunc
ocBad, // none
ocAverage,
@@ -122,10 +107,10 @@ void lcl_AddString( String**& pData, T& nCount, const String& rInsert )
ScConsData::ScConsData() :
eFunction(SUBTOTAL_FUNC_SUM),
- bReference(sal_False),
- bColByName(sal_False),
- bRowByName(sal_False),
- bSubTitles(sal_False),
+ bReference(false),
+ bColByName(false),
+ bRowByName(false),
+ bSubTitles(false),
nColCount(0),
nRowCount(0),
ppUsed(NULL),
@@ -139,7 +124,7 @@ ScConsData::ScConsData() :
nTitleCount(0),
ppTitles(NULL),
ppTitlePos(NULL),
- bCornerUsed(sal_False)
+ bCornerUsed(false)
{
}
@@ -184,8 +169,6 @@ void ScConsData::DeleteData()
ppRefs = NULL;
}
-// DELETEARR( ppData1, nColCount );
-// DELETEARR( ppData2, nColCount );
DELETEARR( ppCount, nColCount );
DELETEARR( ppSum, nColCount );
DELETEARR( ppSumSqr,nColCount );
@@ -200,7 +183,7 @@ void ScConsData::DeleteData()
if (bColByName) nColCount = 0; // sonst stimmt ppColHeaders nicht
if (bRowByName) nRowCount = 0;
- bCornerUsed = sal_False;
+ bCornerUsed = false;
aCornerText.Erase();
}
@@ -256,7 +239,7 @@ void ScConsData::InitData( sal_Bool bDelete )
void ScConsData::DoneFields()
{
- InitData(sal_False);
+ InitData(false);
}
void ScConsData::SetSize( SCCOL nCols, SCROW nRows )
@@ -302,7 +285,7 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab,
pSrcDoc->GetString( nCol, nRow1, nTab, aTitle );
if (aTitle.Len())
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (SCSIZE i=0; i<nColCount && !bFound; i++)
if ( *ppColHeaders[i] == aTitle )
bFound = sal_True;
@@ -319,7 +302,7 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab,
pSrcDoc->GetString( nCol1, nRow, nTab, aTitle );
if (aTitle.Len())
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (SCSIZE i=0; i<nRowCount && !bFound; i++)
if ( *ppRowHeaders[i] == aTitle )
bFound = sal_True;
@@ -512,7 +495,7 @@ double lcl_CalcData( ScSubTotalFunc eFunc,
break;
default:
{
- DBG_ERROR("unbekannte Funktion bei Consoli::CalcData");
+ OSL_FAIL("unbekannte Funktion bei Consoli::CalcData");
fCount = -MAXDOUBLE;
}
break;
@@ -575,7 +558,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
SCCOL nPos = SC_CONS_NOTFOUND;
if (aTitle.Len())
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (SCSIZE i=0; i<nColCount && !bFound; i++)
if ( *ppColHeaders[i] == aTitle )
{
@@ -596,7 +579,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
SCROW nPos = SC_CONS_NOTFOUND;
if (aTitle.Len())
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (SCSIZE i=0; i<nRowCount && !bFound; i++)
if ( *ppRowHeaders[i] == aTitle )
{
@@ -818,11 +801,13 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
ScOutlineArray* pOutArr = pDestDoc->GetOutlineTable( nTab, sal_True )->GetRowArray();
SCROW nOutStart = nRow+nArrY;
SCROW nOutEnd = nRow+nArrY+nNeeded-1;
- sal_Bool bSize = sal_False;
+ sal_Bool bSize = false;
pOutArr->Insert( nOutStart, nOutEnd, bSize );
+ pDestDoc->InitializeNoteCaptions(nTab);
for (SCROW nOutRow=nOutStart; nOutRow<=nOutEnd; nOutRow++)
- pDestDoc->ShowRow( nOutRow, nTab, sal_False );
- pDestDoc->UpdateOutlineRow( nOutStart, nOutEnd, nTab, sal_False );
+ pDestDoc->ShowRow( nOutRow, nTab, false );
+ pDestDoc->SetDrawPageSize(nTab);
+ pDestDoc->UpdateOutlineRow( nOutStart, nOutEnd, nTab, false );
// Zwischentitel
@@ -835,7 +820,7 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
sal_Bool bDo = sal_True;
if (nPos+1<nDataCount)
if (ppTitlePos[nArrY][nPos+1] == nTPos)
- bDo = sal_False; // leer
+ bDo = false; // leer
if ( bDo && nTPos < nNeeded )
{
aString = *ppRowHeaders[nArrY];
@@ -856,3 +841,4 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx
index 800716bef3b6..a7e27dcf4dd2 100644
--- a/sc/source/core/tool/dbcolect.cxx
+++ b/sc/source/core/tool/dbcolect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,14 +56,14 @@ ScDBData::ScDBData( const String& rName,
nEndRow (nRow2),
bByRow (bByR),
bHasHeader (bHasH),
- bDoSize (sal_False),
- bKeepFmt (sal_False),
- bStripData (sal_False),
- bIsAdvanced (sal_False),
- bDBSelection(sal_False),
+ bDoSize (false),
+ bKeepFmt (false),
+ bStripData (false),
+ bIsAdvanced (false),
+ bDBSelection(false),
nIndex (0),
- bAutoFilter (sal_False),
- bModified (sal_False)
+ bAutoFilter (false),
+ bModified (false)
{
sal_uInt16 i;
@@ -102,6 +103,7 @@ ScDBData::ScDBData( const ScDBData& rData ) :
bKeepFmt (rData.bKeepFmt),
bStripData (rData.bStripData),
bSortCaseSens (rData.bSortCaseSens),
+ bSortNaturalSort (rData.bSortNaturalSort),
bIncludePattern (rData.bIncludePattern),
bSortInplace (rData.bSortInplace),
bSortUserDef (rData.bSortUserDef),
@@ -196,6 +198,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData)
bKeepFmt = rData.bKeepFmt;
bStripData = rData.bStripData;
bSortCaseSens = rData.bSortCaseSens;
+ bSortNaturalSort = rData.bSortNaturalSort;
bIncludePattern = rData.bIncludePattern;
bSortInplace = rData.bSortInplace;
nSortDestTab = rData.nSortDestTab;
@@ -285,34 +288,34 @@ sal_Bool ScDBData::operator== (const ScDBData& rData) const
// bAutoFilter!= rData.bAutoFilter||
ScRefreshTimer::operator!=( rData )
)
- return sal_False;
+ return false;
if ( bIsAdvanced && aAdvSource != rData.aAdvSource )
- return sal_False;
+ return false;
ScSortParam aSort1, aSort2;
GetSortParam(aSort1);
rData.GetSortParam(aSort2);
if (!(aSort1 == aSort2))
- return sal_False;
+ return false;
ScQueryParam aQuery1, aQuery2;
GetQueryParam(aQuery1);
rData.GetQueryParam(aQuery2);
if (!(aQuery1 == aQuery2))
- return sal_False;
+ return false;
ScSubTotalParam aSubTotal1, aSubTotal2;
GetSubTotalParam(aSubTotal1);
rData.GetSubTotalParam(aSubTotal2);
if (!(aSubTotal1 == aSubTotal2))
- return sal_False;
+ return false;
ScImportParam aImport1, aImport2;
GetImportParam(aImport1);
rData.GetImportParam(aImport2);
if (!(aImport1 == aImport2))
- return sal_False;
+ return false;
return sal_True;
}
@@ -331,12 +334,6 @@ ScDBData::~ScDBData()
}
}
-//UNUSED2008-05 sal_Bool ScDBData::IsBeyond(SCROW nMaxRow) const
-//UNUSED2008-05 {
-//UNUSED2008-05 return ( nStartRow > nMaxRow ||
-//UNUSED2008-05 nEndRow > nMaxRow ||
-//UNUSED2008-05 nQueryDestRow > nMaxRow );
-//UNUSED2008-05 }
String ScDBData::GetSourceString() const
{
@@ -376,18 +373,20 @@ String ScDBData::GetOperations() const
return aVal;
}
-void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const
+void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2,
+ bool bUseDynamicRange) const
{
rTab = nTable;
rCol1 = nStartCol;
rRow1 = nStartRow;
rCol2 = nEndCol;
- rRow2 = nEndRow;
+ rRow2 = bUseDynamicRange ? nDynamicEndRow : nEndRow;
}
-void ScDBData::GetArea(ScRange& rRange) const
+void ScDBData::GetArea(ScRange& rRange, bool bUseDynamicRange) const
{
- rRange = ScRange( nStartCol,nStartRow,nTable, nEndCol,nEndRow,nTable );
+ SCROW nNewEndRow = bUseDynamicRange ? nDynamicEndRow : nEndRow;
+ rRange = ScRange( nStartCol, nStartRow, nTable, nEndCol, nNewEndRow, nTable );
}
void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
@@ -399,6 +398,11 @@ void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
nEndRow = nRow2;
}
+void ScDBData::SetDynamicEndRow(SCROW nRow)
+{
+ nDynamicEndRow = nRow;
+}
+
void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
{
sal_uInt16 i;
@@ -414,7 +418,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
if (nSortField[i] > nSortEnd)
{
nSortField[i] = 0;
- bDoSort[i] = sal_False;
+ bDoSort[i] = false;
}
}
for (i=0; i<MAXQUERY; i++)
@@ -423,7 +427,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
if (nQueryField[i] > nCol2)
{
nQueryField[i] = 0;
- bDoQuery[i] = sal_False;
+ bDoQuery[i] = false;
}
}
for (i=0; i<MAXSUBTOTAL; i++)
@@ -432,7 +436,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
if (nSubField[i] > nCol2)
{
nSubField[i] = 0;
- bDoSubTotal[i] = sal_False;
+ bDoSubTotal[i] = false;
}
}
@@ -448,6 +452,7 @@ void ScDBData::GetSortParam( ScSortParam& rSortParam ) const
rSortParam.bByRow = bByRow;
rSortParam.bHasHeader = bHasHeader;
rSortParam.bCaseSens = bSortCaseSens;
+ rSortParam.bNaturalSort = bSortNaturalSort;
rSortParam.bInplace = bSortInplace;
rSortParam.nDestTab = nSortDestTab;
rSortParam.nDestCol = nSortDestCol;
@@ -468,6 +473,7 @@ void ScDBData::GetSortParam( ScSortParam& rSortParam ) const
void ScDBData::SetSortParam( const ScSortParam& rSortParam )
{
bSortCaseSens = rSortParam.bCaseSens;
+ bSortNaturalSort = rSortParam.bNaturalSort;
bIncludePattern = rSortParam.bIncludePattern;
bSortInplace = rSortParam.bInplace;
nSortDestTab = rSortParam.nDestTab;
@@ -504,6 +510,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const
rQueryParam.nDestTab = nQueryDestTab;
rQueryParam.nDestCol = nQueryDestCol;
rQueryParam.nDestRow = nQueryDestRow;
+ rQueryParam.nDynamicEndRow = nDynamicEndRow;
rQueryParam.Resize( MAXQUERY );
for (SCSIZE i=0; i<MAXQUERY; i++)
@@ -529,7 +536,7 @@ void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam)
// set bIsAdvanced to sal_False for everything that is not from the
// advanced filter dialog
- bIsAdvanced = sal_False;
+ bIsAdvanced = false;
bQueryInplace = rQueryParam.bInplace;
bQueryCaseSens = rQueryParam.bCaseSens;
@@ -561,7 +568,7 @@ void ScDBData::SetAdvancedQuerySource(const ScRange* pSource)
bIsAdvanced = sal_True;
}
else
- bIsAdvanced = sal_False;
+ bIsAdvanced = false;
}
sal_Bool ScDBData::GetAdvancedQuerySource(ScRange& rSource) const
@@ -680,7 +687,7 @@ sal_Bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bSt
nRow >= nStartRow && nRow <= nEndRow );
}
- return sal_False;
+ return false;
}
sal_Bool ScDBData::IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
@@ -889,3 +896,4 @@ sal_Bool ScDBCollection::Insert(ScDataObject* pScDataObject)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index ae4cd2b92d72..1f0a1f7b5f8c 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
-// INCLUDE ---------------------------------------------------------------
-#include <tools/list.hxx>
#include <sfx2/linkmgr.hxx>
#include <sfx2/bindings.hxx>
#include <svl/zforlist.hxx>
@@ -50,7 +47,7 @@ TYPEINIT2(ScDdeLink,::sfx2::SvBaseLink,SfxBroadcaster);
#define DDE_TXT_ENCODING gsl_getSystemTextEncoding()
-sal_Bool ScDdeLink::bIsInUpdate = sal_False;
+sal_Bool ScDdeLink::bIsInUpdate = false;
//------------------------------------------------------------------------
@@ -62,12 +59,12 @@ ScDdeLink::ScDdeLink( ScDocument* pD, const String& rA, const String& rT, const
aTopic( rT ),
aItem( rI ),
nMode( nM ),
- bNeedUpdate( sal_False ),
+ bNeedUpdate( false ),
pResult( NULL )
{
}
-__EXPORT ScDdeLink::~ScDdeLink()
+ScDdeLink::~ScDdeLink()
{
// Verbindung aufheben
@@ -81,7 +78,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ) :
aTopic ( rOther.aTopic ),
aItem ( rOther.aItem ),
nMode ( rOther.nMode ),
- bNeedUpdate( sal_False ),
+ bNeedUpdate( false ),
pResult ( NULL )
{
if (rOther.pResult)
@@ -91,7 +88,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ) :
ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& rHdr ) :
::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,FORMAT_STRING),
pDoc( pD ),
- bNeedUpdate( sal_False ),
+ bNeedUpdate( false ),
pResult( NULL )
{
rHdr.StartEntry();
@@ -104,7 +101,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& r
sal_Bool bHasValue;
rStream >> bHasValue;
if ( bHasValue )
- pResult = new ScMatrix( rStream );
+ pResult = new ScMatrix(0, 0);
if (rHdr.BytesLeft()) // neu in 388b und der 364w (RealTime-Client) Version
rStream >> nMode;
@@ -125,8 +122,6 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const
sal_Bool bHasValue = ( pResult != NULL );
rStream << bHasValue;
- if (bHasValue)
- pResult->Store( rStream );
if( rStream.GetVersion() > SOFFICE_FILEFORMAT_40 ) // nicht bei 4.0 Export
rStream << nMode; // seit 388b
@@ -137,7 +132,7 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const
rHdr.EndEntry();
}
-void __EXPORT ScDdeLink::DataChanged( const String& rMimeType,
+void ScDdeLink::DataChanged( const String& rMimeType,
const ::com::sun::star::uno::Any & rValue )
{
// wir koennen nur Strings...
@@ -167,7 +162,7 @@ void __EXPORT ScDdeLink::DataChanged( const String& rMimeType,
if (!nRows || !nCols) // keine Daten
{
- pResult.Clear();
+ pResult.reset();
}
else // Daten aufteilen
{
@@ -201,6 +196,9 @@ void __EXPORT ScDdeLink::DataChanged( const String& rMimeType,
double fVal;
if ( nMode != SC_DDE_TEXT && pFormatter->IsNumberFormat( aEntry, nIndex, fVal ) )
pResult->PutDouble( fVal, nC, nR );
+ else if (aEntry.Len() == 0)
+ // empty cell
+ pResult->PutEmpty(nC, nR);
else
pResult->PutString( aEntry, nC, nR );
}
@@ -231,7 +229,7 @@ void __EXPORT ScDdeLink::DataChanged( const String& rMimeType,
void ScDdeLink::ResetValue()
{
- pResult.Clear();
+ pResult.reset();
// Es hat sich was getan...
// Tracking, FID_DATACHANGED etc. passiert von aussen
@@ -240,7 +238,7 @@ void ScDdeLink::ResetValue()
Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) );
}
-void __EXPORT ScDdeLink::ListenersGone()
+void ScDdeLink::ListenersGone()
{
sal_Bool bWas = bIsInUpdate;
bIsInUpdate = sal_True; // Remove() kann Reschedule ausloesen??!?
@@ -266,14 +264,14 @@ void ScDdeLink::TryUpdate()
bNeedUpdate = sal_True; // kann jetzt nicht ausgefuehrt werden
else
{
- bIsInUpdate = sal_True;
- //Application::Reschedule(); //! OS/2-Simulation
+ bIsInUpdate = true;
pDoc->IncInDdeLinkUpdate();
Update();
pDoc->DecInDdeLinkUpdate();
- bIsInUpdate = sal_False;
- bNeedUpdate = sal_False;
+ bIsInUpdate = false;
+ bNeedUpdate = false;
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx
index cf6de00ec008..57000eb99844 100644
--- a/sc/source/core/tool/detdata.cxx
+++ b/sc/source/core/tool/detdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ SV_IMPL_PTRARR( ScDetOpArr_Impl, ScDetOpDataPtr );
ScDetOpList::ScDetOpList(const ScDetOpList& rList) :
ScDetOpArr_Impl(),
- bHasAddError( sal_False )
+ bHasAddError( false )
{
sal_uInt16 nCount = rList.Count();
@@ -109,10 +110,11 @@ sal_Bool ScDetOpList::operator==( const ScDetOpList& r ) const
sal_Bool bEqual = ( nCount == r.Count() );
for (sal_uInt16 i=0; i<nCount && bEqual; i++) // Reihenfolge muss auch gleich sein
if ( !(*(*this)[i] == *r[i]) ) // Eintraege unterschiedlich ?
- bEqual = sal_False;
+ bEqual = false;
return bEqual;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index fc420a83367c..801a0535c4e4 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,10 +78,16 @@
#include "attrib.hxx"
#include "scmod.hxx"
#include "postit.hxx"
+#include "rangelst.hxx"
+#include "reftokenhelper.hxx"
+
+#include <vector>
+
+using ::std::vector;
//------------------------------------------------------------------------
-// #99319# line ends are now created with an empty name.
+// line ends are now created with an empty name.
// The checkForUniqueItem method then finds a unique name for the item's value.
#define SC_LINEEND_NAME EMPTY_STRING
@@ -135,7 +142,7 @@ private:
ColorData ScDetectiveFunc::nArrowColor = 0;
ColorData ScDetectiveFunc::nErrorColor = 0;
ColorData ScDetectiveFunc::nCommentColor = 0;
-sal_Bool ScDetectiveFunc::bColorsInitialized = sal_False;
+sal_Bool ScDetectiveFunc::bColorsInitialized = false;
//------------------------------------------------------------------------
@@ -160,7 +167,7 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
aBoxSet.Put( XLineColorItem( EMPTY_STRING, Color( ScDetectiveFunc::GetArrowColor() ) ) );
aBoxSet.Put( XFillStyleItem( XFILL_NONE ) );
- // #66479# Standard-Linienenden (wie aus XLineEndList::Create) selber zusammenbasteln,
+ // Standard-Linienenden (wie aus XLineEndList::Create) selber zusammenbasteln,
// um von den konfigurierten Linienenden unabhaengig zu sein
basegfx::B2DPolygon aTriangle;
@@ -186,21 +193,21 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
aArrowSet.Put( XLineStartCenterItem( sal_True ) );
aArrowSet.Put( XLineEndItem( aName, basegfx::B2DPolyPolygon(aTriangle) ) );
aArrowSet.Put( XLineEndWidthItem( 200 ) );
- aArrowSet.Put( XLineEndCenterItem( sal_False ) );
+ aArrowSet.Put( XLineEndCenterItem( false ) );
aToTabSet.Put( XLineStartItem( aName, basegfx::B2DPolyPolygon(aCircle) ) );
aToTabSet.Put( XLineStartWidthItem( 200 ) );
aToTabSet.Put( XLineStartCenterItem( sal_True ) );
aToTabSet.Put( XLineEndItem( aName, basegfx::B2DPolyPolygon(aSquare) ) );
aToTabSet.Put( XLineEndWidthItem( 300 ) );
- aToTabSet.Put( XLineEndCenterItem( sal_False ) );
+ aToTabSet.Put( XLineEndCenterItem( false ) );
aFromTabSet.Put( XLineStartItem( aName, basegfx::B2DPolyPolygon(aSquare) ) );
aFromTabSet.Put( XLineStartWidthItem( 300 ) );
aFromTabSet.Put( XLineStartCenterItem( sal_True ) );
aFromTabSet.Put( XLineEndItem( aName, basegfx::B2DPolyPolygon(aTriangle) ) );
aFromTabSet.Put( XLineEndWidthItem( 200 ) );
- aFromTabSet.Put( XLineEndCenterItem( sal_False ) );
+ aFromTabSet.Put( XLineEndCenterItem( false ) );
aCircleSet.Put( XLineColorItem( String(), Color( ScDetectiveFunc::GetErrorColor() ) ) );
aCircleSet.Put( XFillStyleItem( XFILL_NONE ) );
@@ -221,7 +228,7 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
aCaptionSet.Put( XLineStartItem( aName, basegfx::B2DPolyPolygon(aTriangle) ) );
aCaptionSet.Put( XLineStartWidthItem( 200 ) );
- aCaptionSet.Put( XLineStartCenterItem( sal_False ) );
+ aCaptionSet.Put( XLineStartCenterItem( false ) );
aCaptionSet.Put( XFillStyleItem( XFILL_SOLID ) );
Color aYellow( ScDetectiveFunc::GetCommentColor() );
aCaptionSet.Put( XFillColorItem( String(), aYellow ) );
@@ -230,7 +237,7 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
// SdrShadowItem has sal_False, instead the shadow is set for the rectangle
// only with SetSpecialTextBoxShadow when the object is created
// (item must be set to adjust objects from older files)
- aCaptionSet.Put( SdrShadowItem( sal_False ) );
+ aCaptionSet.Put( SdrShadowItem( false ) );
aCaptionSet.Put( SdrShadowXDistItem( 100 ) );
aCaptionSet.Put( SdrShadowYDistItem( 100 ) );
@@ -240,10 +247,10 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
aCaptionSet.Put( SdrTextUpperDistItem( 100 ) );
aCaptionSet.Put( SdrTextLowerDistItem( 100 ) );
- aCaptionSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
+ aCaptionSet.Put( SdrTextAutoGrowWidthItem( false ) );
aCaptionSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
- // #78943# do use the default cell style, so the user has a chance to
+ // do use the default cell style, so the user has a chance to
// modify the font for the annotations
((const ScPatternAttr&)rDoc.GetPool()->GetDefaultItem(ATTR_PATTERN)).
FillEditItemSet( &aCaptionSet );
@@ -260,7 +267,7 @@ void ScCommentData::UpdateCaptionSet( const SfxItemSet& rItemSet )
for( sal_uInt16 nWhich = aWhichIter.FirstWhich(); nWhich > 0; nWhich = aWhichIter.NextWhich() )
{
- if(rItemSet.GetItemState(nWhich, sal_False, &pPoolItem) == SFX_ITEM_SET)
+ if(rItemSet.GetItemState(nWhich, false, &pPoolItem) == SFX_ITEM_SET)
{
switch(nWhich)
{
@@ -290,7 +297,7 @@ void ScCommentData::UpdateCaptionSet( const SfxItemSet& rItemSet )
void ScDetectiveFunc::Modified()
{
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
}
inline sal_Bool Intersect( SCCOL nStartCol1, SCROW nStartRow1, SCCOL nEndCol1, SCROW nEndRow1,
@@ -410,8 +417,8 @@ sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart,
if (bStartAlien && bEndAlien)
{
- DBG_ERROR("bStartAlien && bEndAlien");
- return sal_True;
+ OSL_FAIL("bStartAlien && bEndAlien");
+ return true;
}
Rectangle aStartRect;
@@ -425,7 +432,7 @@ sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart,
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SdrObjListIter aIter( *pPage, IM_FLAT );
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
@@ -454,7 +461,7 @@ sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart,
return bFound;
}
-sal_Bool ScDetectiveFunc::IsNonAlienArrow( SdrObject* pObject ) // static
+sal_Bool ScDetectiveFunc::IsNonAlienArrow( SdrObject* pObject )
{
if ( pObject->GetLayer()==SC_LAYER_INTERN &&
pObject->IsPolyObj() && pObject->GetPointCount()==2 )
@@ -469,7 +476,7 @@ sal_Bool ScDetectiveFunc::IsNonAlienArrow( SdrObject* pObject ) // stati
return !bObjStartAlien && !bObjEndAlien;
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -495,7 +502,6 @@ sal_Bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
- ScDrawLayer::SetAnchor( pBox, SCA_CELL );
pBox->SetLayer( SC_LAYER_INTERN );
pPage->InsertObject( pBox );
pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
@@ -537,7 +543,6 @@ sal_Bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
pArrow->NbcSetLogicRect(Rectangle(aStartPos,aEndPos)); //! noetig ???
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
- ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
pArrow->SetLayer( SC_LAYER_INTERN );
pPage->InsertObject( pArrow );
pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
@@ -569,7 +574,6 @@ sal_Bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
- ScDrawLayer::SetAnchor( pBox, SCA_CELL );
pBox->SetLayer( SC_LAYER_INTERN );
pPage->InsertObject( pBox );
pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
@@ -604,7 +608,6 @@ sal_Bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
- ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
pArrow->SetLayer( SC_LAYER_INTERN );
pPage->InsertObject( pArrow );
pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
@@ -631,7 +634,7 @@ sal_Bool ScDetectiveFunc::DrawEntry( SCCOL nCol, SCROW nRow,
ScDetectiveData& rData )
{
if ( HasArrow( rRef.aStart, nCol, nRow, nTab ) )
- return sal_False;
+ return false;
ScAddress aErrorPos;
sal_Bool bError = HasError( rRef, aErrorPos );
@@ -647,7 +650,7 @@ sal_Bool ScDetectiveFunc::DrawAlienEntry( const ScRange& rRef,
ScDetectiveData& rData )
{
if ( HasArrow( rRef.aStart, 0, 0, nTab+1 ) )
- return sal_False;
+ return false;
ScAddress aErrorPos;
sal_Bool bError = HasError( rRef, aErrorPos );
@@ -673,7 +676,6 @@ void ScDetectiveFunc::DrawCircle( SCCOL nCol, SCROW nRow, ScDetectiveData& rData
pCircle->SetMergedItemSetAndBroadcast(rAttrSet);
- ScDrawLayer::SetAnchor( pCircle, SCA_CELL );
pCircle->SetLayer( SC_LAYER_INTERN );
pPage->InsertObject( pCircle );
pModel->AddCalcUndo( new SdrUndoInsertObj( *pCircle ) );
@@ -695,10 +697,10 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, sal_Bool bDestPnt
pPage->RecalcObjOrdNums();
- long nDelCount = 0;
- sal_uLong nObjCount = pPage->GetObjCount();
+ sal_uLong nObjCount = pPage->GetObjCount();
if (nObjCount)
{
+ long nDelCount = 0;
SdrObject** ppObj = new SdrObject*[nObjCount];
SdrObjListIter aIter( *pPage, IM_FLAT );
@@ -748,17 +750,6 @@ inline sal_Bool RectIsPoints( const Rectangle& rRect, const Point& rStart, const
void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
{
-/* String aStr;
- aStr += nCol1;
- aStr += '/';
- aStr += nRow1;
- aStr += '/';
- aStr += nCol2;
- aStr += '/';
- aStr += nRow2;
- InfoBox(0,aStr).Execute();
-*/
-
Rectangle aCornerRect = GetDrawRect( nCol1, nRow1, nCol2, nRow2 );
Point aStartCorner = aCornerRect.TopLeft();
Point aEndCorner = aCornerRect.BottomRight();
@@ -770,10 +761,10 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR
pPage->RecalcObjOrdNums();
- long nDelCount = 0;
- sal_uLong nObjCount = pPage->GetObjCount();
+ sal_uLong nObjCount = pPage->GetObjCount();
if (nObjCount)
{
+ long nDelCount = 0;
SdrObject** ppObj = new SdrObject*[nObjCount];
SdrObjListIter aIter( *pPage, IM_FLAT );
@@ -902,7 +893,7 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetective
}
}
- pFCell->SetRunning(sal_False);
+ pFCell->SetRunning(false);
return nResult;
}
@@ -986,7 +977,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL
}
}
- pFCell->SetRunning(sal_False);
+ pFCell->SetRunning(false);
return nResult;
}
@@ -1016,7 +1007,7 @@ sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiv
ScDetectiveRefIter aIter( (ScFormulaCell*) pCell );
ScRange aRef;
ScAddress aErrorPos;
- sal_Bool bHasError = sal_False;
+ sal_Bool bHasError = false;
while ( aIter.GetNextRef( aRef ) )
{
if (HasError( aRef, aErrorPos ))
@@ -1036,7 +1027,7 @@ sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiv
}
}
- pFCell->SetRunning(sal_False);
+ pFCell->SetRunning(false);
// Blaetter ?
if (!bHasError)
@@ -1054,7 +1045,6 @@ sal_uInt16 ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCo
// ueber ganzes Dokument
sal_uInt16 nResult = DET_INS_EMPTY;
-// ScCellIterator aCellIter( pDoc, 0,0, nTab, MAXCOL,MAXROW, nTab );
ScCellIterator aCellIter( pDoc, 0,0,0, MAXCOL,MAXROW,MAXTAB ); // alle Tabellen
ScBaseCell* pCell = aCellIter.GetFirst();
while (pCell)
@@ -1176,7 +1166,7 @@ sal_uInt16 ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2
DeleteBox( aRef.aStart.Col(), aRef.aStart.Row(),
aRef.aEnd.Col(), aRef.aEnd.Row() );
}
- DeleteArrowsAt( aRef.aStart.Col(), aRef.aStart.Row(), sal_False );
+ DeleteArrowsAt( aRef.aStart.Col(), aRef.aStart.Row(), false );
}
else if ( !bRunning &&
HasArrow( aRef.aStart,
@@ -1209,7 +1199,7 @@ sal_Bool ScDetectiveFunc::ShowPred( SCCOL nCol, SCROW nRow )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
ScDetectiveData aData( pModel );
@@ -1229,7 +1219,7 @@ sal_Bool ScDetectiveFunc::ShowSucc( SCCOL nCol, SCROW nRow )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
ScDetectiveData aData( pModel );
@@ -1249,12 +1239,12 @@ sal_Bool ScDetectiveFunc::ShowError( SCCOL nCol, SCROW nRow )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
ScRange aRange( nCol, nRow, nTab );
ScAddress aErrPos;
if ( !HasError( aRange,aErrPos ) )
- return sal_False;
+ return false;
ScDetectiveData aData( pModel );
@@ -1268,7 +1258,7 @@ sal_Bool ScDetectiveFunc::DeleteSucc( SCCOL nCol, SCROW nRow )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
sal_uInt16 nLevelCount = FindSuccLevel( nCol, nRow, nCol, nRow, 0, 0 );
if ( nLevelCount )
@@ -1281,7 +1271,7 @@ sal_Bool ScDetectiveFunc::DeletePred( SCCOL nCol, SCROW nRow )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
sal_uInt16 nLevelCount = FindPredLevel( nCol, nRow, 0, 0 );
if ( nLevelCount )
@@ -1294,7 +1284,7 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
@@ -1326,7 +1316,7 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat )
bDoThis = !bCaption && !bCircle; // don't include circles
else
{
- DBG_ERROR("wat?");
+ OSL_FAIL("wat?");
}
}
if ( bDoThis )
@@ -1353,10 +1343,10 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat )
sal_Bool ScDetectiveFunc::MarkInvalid(sal_Bool& rOverflow)
{
- rOverflow = sal_False;
+ rOverflow = false;
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
sal_Bool bDeleted = DeleteAll( SC_DET_CIRCLES ); // nur die Kreise
@@ -1420,6 +1410,52 @@ sal_Bool ScDetectiveFunc::MarkInvalid(sal_Bool& rOverflow)
return ( bDeleted || nInsCount != 0 );
}
+void ScDetectiveFunc::GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+ vector<ScTokenRef>& rRefTokens)
+{
+ ScCellIterator aCellIter(pDoc, nCol1, nRow1, nTab, nCol2, nRow2, nTab);
+ for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext())
+ {
+ if (pCell->GetCellType() != CELLTYPE_FORMULA)
+ continue;
+
+ ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+ ScDetectiveRefIter aRefIter(pFCell);
+ for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken())
+ {
+ ScTokenRef pRef(static_cast<ScToken*>(p->Clone()));
+ ScRefTokenHelper::join(rRefTokens, pRef);
+ }
+ }
+}
+
+void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+ vector<ScTokenRef>& rRefTokens)
+{
+ vector<ScTokenRef> aSrcRange;
+ aSrcRange.push_back(
+ ScRefTokenHelper::createRefToken(ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab)));
+
+ ScCellIterator aCellIter(pDoc, 0, 0, nTab, MAXCOL, MAXROW, nTab);
+ for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext())
+ {
+ if (pCell->GetCellType() != CELLTYPE_FORMULA)
+ continue;
+
+ ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+ ScDetectiveRefIter aRefIter(pFCell);
+ for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken())
+ {
+ ScTokenRef pRef(static_cast<ScToken*>(p->Clone()));
+ if (ScRefTokenHelper::intersects(aSrcRange, pRef))
+ {
+ pRef = ScRefTokenHelper::createRefToken(aCellIter.GetPos());
+ ScRefTokenHelper::join(rRefTokens, pRef);
+ }
+ }
+ }
+}
+
void ScDetectiveFunc::UpdateAllComments( ScDocument& rDoc )
{
// for all caption objects, update attributes and SpecialTextBoxShadow flag
@@ -1484,8 +1520,8 @@ void ScDetectiveFunc::UpdateAllArrowColors()
{
if ( pObject->GetLayer() == SC_LAYER_INTERN )
{
- sal_Bool bArrow = sal_False;
- sal_Bool bError = sal_False;
+ sal_Bool bArrow = false;
+ sal_Bool bError = false;
ScAddress aPos;
ScRange aSource;
@@ -1532,12 +1568,10 @@ void ScDetectiveFunc::UpdateAllArrowColors()
if ( bArrow || bError )
{
ColorData nColorData = ( bError ? GetErrorColor() : GetArrowColor() );
- //pObject->SendRepaintBroadcast(pObject->GetBoundRect());
pObject->SetMergedItem( XLineColorItem( String(), Color( nColorData ) ) );
// repaint only
pObject->ActionChanged();
- // pObject->SendRepaintBroadcast(pObject->GetBoundRect());
}
}
}
@@ -1551,11 +1585,11 @@ sal_Bool ScDetectiveFunc::FindFrameForObject( SdrObject* pObject, ScRange& rRang
// rRange must be initialized to the source cell of the arrow (start of area)
ScDrawLayer* pModel = pDoc->GetDrawLayer();
- if (!pModel) return sal_False;
+ if (!pModel) return false;
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
- if (!pPage) return sal_False;
+ if (!pPage) return false;
// test if the object is a direct page member
if( pObject && pObject->GetPage() && (pObject->GetPage() == pObject->GetObjList()) )
@@ -1578,13 +1612,13 @@ sal_Bool ScDetectiveFunc::FindFrameForObject( SdrObject* pObject, ScRange& rRang
}
}
}
- return sal_False;
+ return false;
}
ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject, SCTAB nObjTab,
ScAddress& rPosition, ScRange& rSource, sal_Bool& rRedLine )
{
- rRedLine = sal_False;
+ rRedLine = false;
ScDetectiveObjType eType = SC_DETOBJ_NONE;
if ( pObject && pObject->GetLayer() == SC_LAYER_INTERN )
@@ -1667,7 +1701,6 @@ void ScDetectiveFunc::InsertObject( ScDetectiveObjType eType,
}
}
-// static
ColorData ScDetectiveFunc::GetArrowColor()
{
if (!bColorsInitialized)
@@ -1675,7 +1708,6 @@ ColorData ScDetectiveFunc::GetArrowColor()
return nArrowColor;
}
-// static
ColorData ScDetectiveFunc::GetErrorColor()
{
if (!bColorsInitialized)
@@ -1683,7 +1715,6 @@ ColorData ScDetectiveFunc::GetErrorColor()
return nErrorColor;
}
-// static
ColorData ScDetectiveFunc::GetCommentColor()
{
if (!bColorsInitialized)
@@ -1691,7 +1722,6 @@ ColorData ScDetectiveFunc::GetCommentColor()
return nCommentColor;
}
-// static
void ScDetectiveFunc::InitializeColors()
{
// may be called several times to update colors from configuration
@@ -1704,9 +1734,9 @@ void ScDetectiveFunc::InitializeColors()
bColorsInitialized = sal_True;
}
-// static
sal_Bool ScDetectiveFunc::IsColorsInitialized()
{
return bColorsInitialized;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx
index 1591779909e2..113af9a69db6 100644
--- a/sc/source/core/tool/docoptio.cxx
+++ b/sc/source/core/tool/docoptio.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,8 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/i18n/LocaleDataItem.hpp>
#include "cfgids.hxx"
#include "docoptio.hxx"
@@ -42,10 +45,13 @@
#include "scresid.hxx"
#include "sc.hrc"
#include "miscuno.hxx"
+#include "global.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::com::sun::star::lang::Locale;
+using ::com::sun::star::i18n::LocaleDataItem;
+using ::rtl::OUString;
//------------------------------------------------------------------------
@@ -86,6 +92,7 @@ ScDocOptions::ScDocOptions( const ScDocOptions& rCpy )
: fIterEps( rCpy.fIterEps ),
nIterCount( rCpy.nIterCount ),
nPrecStandardFormat( rCpy.nPrecStandardFormat ),
+ eKeyBindingType( rCpy.eKeyBindingType ),
nDay( rCpy.nDay ),
nMonth( rCpy.nMonth ),
nYear( rCpy.nYear ),
@@ -97,7 +104,12 @@ ScDocOptions::ScDocOptions( const ScDocOptions& rCpy )
bMatchWholeCell( rCpy.bMatchWholeCell ),
bDoAutoSpell( rCpy.bDoAutoSpell ),
bLookUpColRowNames( rCpy.bLookUpColRowNames ),
- bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled )
+ bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ),
+ bUseEnglishFuncName( rCpy.bUseEnglishFuncName ),
+ eFormulaGrammar( rCpy.eFormulaGrammar ),
+ aFormulaSepArg( rCpy.aFormulaSepArg ),
+ aFormulaSepArrayRow( rCpy.aFormulaSepArrayRow ),
+ aFormulaSepArrayCol( rCpy.aFormulaSepArrayCol )
{
}
@@ -111,31 +123,89 @@ ScDocOptions::~ScDocOptions()
void ScDocOptions::ResetDocOptions()
{
- bIsIgnoreCase = sal_False;
- bIsIter = sal_False;
+ bIsIgnoreCase = false;
+ bIsIter = false;
nIterCount = 100;
fIterEps = 1.0E-3;
nPrecStandardFormat = SvNumberFormatter::UNLIMITED_PRECISION;
+ eKeyBindingType = ScOptionsUtil::KEY_DEFAULT;
nDay = 30;
nMonth = 12;
nYear = 1899;
nYear2000 = SvNumberFormatter::GetYear2000Default();
nTabDistance = lcl_GetDefaultTabDist();
- bCalcAsShown = sal_False;
- bMatchWholeCell = sal_True;
- bDoAutoSpell = sal_False;
- bLookUpColRowNames = sal_True;
- bFormulaRegexEnabled= sal_True;
+ bCalcAsShown = false;
+ bMatchWholeCell = true;
+ bDoAutoSpell = false;
+ bLookUpColRowNames = true;
+ bFormulaRegexEnabled= true;
+ bUseEnglishFuncName = false;
+ eFormulaGrammar = ::formula::FormulaGrammar::GRAM_NATIVE;
+
+ ResetFormulaSeparators();
+}
+
+void ScDocOptions::ResetFormulaSeparators()
+{
+ // Defaults to the old separator values.
+ aFormulaSepArg = OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
+ aFormulaSepArrayCol = OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
+ aFormulaSepArrayRow = OUString(RTL_CONSTASCII_USTRINGPARAM("|"));
+
+ const Locale& rLocale = *ScGlobal::GetLocale();
+ const OUString& rLang = rLocale.Language;
+ if (rLang.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ru")))
+ // Don't do automatic guess for these languages, and fall back to
+ // the old separator set.
+ return;
+
+ const LocaleDataWrapper& rLocaleData = GetLocaleDataWrapper();
+ const OUString& rDecSep = rLocaleData.getNumDecimalSep();
+ const OUString& rListSep = rLocaleData.getListSep();
+
+ if (!rDecSep.getLength() || !rListSep.getLength())
+ // Something is wrong. Stick with the default separators.
+ return;
+
+ sal_Unicode cDecSep = rDecSep.getStr()[0];
+ sal_Unicode cListSep = rListSep.getStr()[0];
+
+ // Excel by default uses system's list separator as the parameter
+ // separator, which in English locales is a comma. However, OOo's list
+ // separator value is set to ';' for all English locales. Because of this
+ // discrepancy, we will hardcode the separator value here, for now.
+ if (cDecSep == sal_Unicode('.'))
+ cListSep = sal_Unicode(',');
+
+ // Special case for de_CH locale.
+ if (rLocale.Language.equalsAsciiL("de", 2) && rLocale.Country.equalsAsciiL("CH", 2))
+ cListSep = sal_Unicode(';');
+
+ // by default, the parameter separator equals the locale-specific
+ // list separator.
+ aFormulaSepArg = OUString(cListSep);
+
+ if (cDecSep == cListSep && cDecSep != sal_Unicode(';'))
+ // if the decimal and list separators are equal, set the
+ // parameter separator to be ';', unless they are both
+ // semicolon in which case don't change the decimal separator.
+ aFormulaSepArg = OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
+
+ aFormulaSepArrayCol = OUString(RTL_CONSTASCII_USTRINGPARAM(","));
+ if (cDecSep == sal_Unicode(','))
+ aFormulaSepArrayCol = OUString(RTL_CONSTASCII_USTRINGPARAM("."));
+ aFormulaSepArrayRow = OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
+}
+
+const LocaleDataWrapper& ScDocOptions::GetLocaleDataWrapper()
+{
+ return *ScGlobal::pLocaleData;
}
//========================================================================
// ScTpCalcItem - Daten fuer die CalcOptions-TabPage
//========================================================================
-//UNUSED2008-05 ScTpCalcItem::ScTpCalcItem( sal_uInt16 nWhichP ) : SfxPoolItem( nWhichP )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
//------------------------------------------------------------------------
ScTpCalcItem::ScTpCalcItem( sal_uInt16 nWhichP, const ScDocOptions& rOpt )
@@ -154,20 +224,20 @@ ScTpCalcItem::ScTpCalcItem( const ScTpCalcItem& rItem )
//------------------------------------------------------------------------
-__EXPORT ScTpCalcItem::~ScTpCalcItem()
+ScTpCalcItem::~ScTpCalcItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScTpCalcItem::GetValueText() const
+String ScTpCalcItem::GetValueText() const
{
return String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("ScTpCalcItem") );
}
//------------------------------------------------------------------------
-int __EXPORT ScTpCalcItem::operator==( const SfxPoolItem& rItem ) const
+int ScTpCalcItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -178,7 +248,7 @@ int __EXPORT ScTpCalcItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScTpCalcItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScTpCalcItem::Clone( SfxItemPool * ) const
{
return new ScTpCalcItem( *this );
}
@@ -203,11 +273,22 @@ SfxPoolItem* __EXPORT ScTpCalcItem::Clone( SfxItemPool * ) const
#define SCCALCOPT_REGEX 11
#define SCCALCOPT_COUNT 12
+#define CFGPATH_FORMULA "Office.Calc/Formula"
+#define SCFORMULAOPT_GRAMMAR 0
+#define SCFORMULAOPT_ENGLISH_FUNCNAME 1
+#define SCFORMULAOPT_SEP_ARG 2
+#define SCFORMULAOPT_SEP_ARRAY_ROW 3
+#define SCFORMULAOPT_SEP_ARRAY_COL 4
+#define SCFORMULAOPT_COUNT 5
+
#define CFGPATH_DOCLAYOUT "Office.Calc/Layout/Other"
#define SCDOCLAYOUTOPT_TABSTOP 0
#define SCDOCLAYOUTOPT_COUNT 1
+#define CFGPATH_COMPAT "Office.Calc/Compatibility"
+#define SCCOMPATOPT_KEY_BINDING 0
+#define SCCOMPATOPT_COUNT 1
Sequence<OUString> ScDocCfg::GetCalcPropertyNames()
{
@@ -224,7 +305,7 @@ Sequence<OUString> ScDocCfg::GetCalcPropertyNames()
"Other/Precision", // SCCALCOPT_PRECISION
"Other/SearchCriteria", // SCCALCOPT_SEARCHCRIT
"Other/FindLabel", // SCCALCOPT_FINDLABEL
- "Other/RegularExpressions" // SCCALCOPT_REGEX
+ "Other/RegularExpressions", // SCCALCOPT_REGEX
};
Sequence<OUString> aNames(SCCALCOPT_COUNT);
OUString* pNames = aNames.getArray();
@@ -234,6 +315,24 @@ Sequence<OUString> ScDocCfg::GetCalcPropertyNames()
return aNames;
}
+Sequence<OUString> ScDocCfg::GetFormulaPropertyNames()
+{
+ static const char* aPropNames[] =
+ {
+ "Syntax/Grammar", // SCFORMULAOPT_GRAMMAR
+ "Syntax/EnglishFunctionName", // SCFORMULAOPT_ENGLISH_FUNCNAME
+ "Syntax/SeparatorArg", // SCFORMULAOPT_SEP_ARG
+ "Syntax/SeparatorArrayRow", // SCFORMULAOPT_SEP_ARRAY_ROW
+ "Syntax/SeparatorArrayCol", // SCFORMULAOPT_SEP_ARRAY_COL
+ };
+ Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
+ OUString* pNames = aNames.getArray();
+ for (int i = 0; i < SCFORMULAOPT_COUNT; ++i)
+ pNames[i] = OUString::createFromAscii(aPropNames[i]);
+
+ return aNames;
+}
+
Sequence<OUString> ScDocCfg::GetLayoutPropertyNames()
{
static const char* aPropNames[] =
@@ -247,17 +346,32 @@ Sequence<OUString> ScDocCfg::GetLayoutPropertyNames()
// adjust for metric system
if (ScOptionsUtil::IsMetricSystem())
- pNames[SCDOCLAYOUTOPT_TABSTOP] = OUString::createFromAscii( "TabStop/Metric" );
+ pNames[SCDOCLAYOUTOPT_TABSTOP] = OUString(RTL_CONSTASCII_USTRINGPARAM( "TabStop/Metric") );
+
+ return aNames;
+}
+
+Sequence<OUString> ScDocCfg::GetCompatPropertyNames()
+{
+ static const char* aPropNames[] =
+ {
+ "KeyBindings/BaseGroup" // SCCOMPATOPT_KEY_BINDING
+ };
+ Sequence<OUString> aNames(SCCOMPATOPT_COUNT);
+ OUString* pNames = aNames.getArray();
+ for (int i = 0; i < SCCOMPATOPT_COUNT; ++i)
+ pNames[i] = OUString::createFromAscii(aPropNames[i]);
return aNames;
}
ScDocCfg::ScDocCfg() :
- aCalcItem( OUString::createFromAscii( CFGPATH_CALC ) ),
- aLayoutItem( OUString::createFromAscii( CFGPATH_DOCLAYOUT ) )
+ aCalcItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_CALC )) ),
+ aFormulaItem(OUString(RTL_CONSTASCII_USTRINGPARAM(CFGPATH_FORMULA))),
+ aLayoutItem(OUString(RTL_CONSTASCII_USTRINGPARAM(CFGPATH_DOCLAYOUT))),
+ aCompatItem(OUString(RTL_CONSTASCII_USTRINGPARAM(CFGPATH_COMPAT)))
{
sal_Int32 nIntVal = 0;
- double fDoubleVal = 0;
Sequence<OUString> aNames;
Sequence<Any> aValues;
@@ -270,9 +384,10 @@ ScDocCfg::ScDocCfg() :
aValues = aCalcItem.GetProperties(aNames);
aCalcItem.EnableNotification(aNames);
pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
+ double fDoubleVal = 0;
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
{
DBG_ASSERT(pValues[nProp].hasValue(), "property value missing");
@@ -325,6 +440,79 @@ ScDocCfg::ScDocCfg() :
SetDate( nDateDay, nDateMonth, nDateYear );
+ aNames = GetFormulaPropertyNames();
+ aValues = aFormulaItem.GetProperties(aNames);
+ aFormulaItem.EnableNotification(aNames);
+ pValues = aValues.getConstArray();
+ if (aValues.getLength() == aNames.getLength())
+ {
+ for (int nProp = 0; nProp < aNames.getLength(); ++nProp)
+ {
+ switch (nProp)
+ {
+ case SCFORMULAOPT_GRAMMAR:
+ {
+ // Get default value in case this option is not set.
+ ::formula::FormulaGrammar::Grammar eGram = GetFormulaSyntax();
+
+ do
+ {
+ if (!(pValues[nProp] >>= nIntVal))
+ // extractino failed.
+ break;
+
+ switch (nIntVal)
+ {
+ case 0: // Calc A1
+ eGram = ::formula::FormulaGrammar::GRAM_NATIVE;
+ break;
+ case 1: // Excel A1
+ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1;
+ break;
+ case 2: // Excel R1C1
+ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1;
+ break;
+ default:
+ ;
+ }
+ }
+ while (false);
+ SetFormulaSyntax(eGram);
+ }
+ break;
+ case SCFORMULAOPT_ENGLISH_FUNCNAME:
+ {
+ sal_Bool bEnglish = false;
+ if (pValues[nProp] >>= bEnglish)
+ SetUseEnglishFuncName(bEnglish);
+ }
+ break;
+ case SCFORMULAOPT_SEP_ARG:
+ {
+ OUString aSep;
+ if ((pValues[nProp] >>= aSep) && aSep.getLength())
+ SetFormulaSepArg(aSep);
+ }
+ break;
+ case SCFORMULAOPT_SEP_ARRAY_ROW:
+ {
+ OUString aSep;
+ if ((pValues[nProp] >>= aSep) && aSep.getLength())
+ SetFormulaSepArrayRow(aSep);
+ }
+ break;
+ case SCFORMULAOPT_SEP_ARRAY_COL:
+ {
+ OUString aSep;
+ if ((pValues[nProp] >>= aSep) && aSep.getLength())
+ SetFormulaSepArrayCol(aSep);
+ }
+ break;
+ }
+ }
+ }
+ aFormulaItem.SetCommitLink( LINK(this, ScDocCfg, FormulaCommitHdl) );
+
aNames = GetLayoutPropertyNames();
aValues = aLayoutItem.GetProperties(aNames);
aLayoutItem.EnableNotification(aNames);
@@ -349,6 +537,28 @@ ScDocCfg::ScDocCfg() :
}
}
aLayoutItem.SetCommitLink( LINK( this, ScDocCfg, LayoutCommitHdl ) );
+
+ aNames = GetCompatPropertyNames();
+ aValues = aCompatItem.GetProperties(aNames);
+ aCompatItem.EnableNotification(aNames);
+ pValues = aValues.getConstArray();
+ if (aValues.getLength() == aNames.getLength())
+ {
+ for (int nProp = 0; nProp < aNames.getLength(); ++nProp)
+ {
+ switch (nProp)
+ {
+ case SCCOMPATOPT_KEY_BINDING:
+ {
+ nIntVal = 0; // 0 = 'Default'
+ pValues[nProp] >>= nIntVal;
+ SetKeyBindingType(static_cast<ScOptionsUtil::KeyBindingType>(nIntVal));
+ }
+ break;
+ }
+ }
+ }
+ aCompatItem.SetCommitLink( LINK(this, ScDocCfg, CompatCommitHdl) );
}
IMPL_LINK( ScDocCfg, CalcCommitHdl, void *, EMPTYARG )
@@ -407,6 +617,50 @@ IMPL_LINK( ScDocCfg, CalcCommitHdl, void *, EMPTYARG )
return 0;
}
+IMPL_LINK( ScDocCfg, FormulaCommitHdl, void *, EMPTYARG )
+{
+ Sequence<OUString> aNames = GetFormulaPropertyNames();
+ Sequence<Any> aValues(aNames.getLength());
+ Any* pValues = aValues.getArray();
+
+ for (int nProp = 0; nProp < aNames.getLength(); ++nProp)
+ {
+ switch (nProp)
+ {
+ case SCFORMULAOPT_GRAMMAR :
+ {
+ sal_Int32 nVal = 0;
+ switch (GetFormulaSyntax())
+ {
+ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1: nVal = 1; break;
+ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1: nVal = 2; break;
+ default: break;
+ }
+ pValues[nProp] <<= nVal;
+ }
+ break;
+ case SCFORMULAOPT_ENGLISH_FUNCNAME:
+ {
+ sal_Bool b = GetUseEnglishFuncName();
+ pValues[nProp] <<= b;
+ }
+ break;
+ case SCFORMULAOPT_SEP_ARG:
+ pValues[nProp] <<= GetFormulaSepArg();
+ break;
+ case SCFORMULAOPT_SEP_ARRAY_ROW:
+ pValues[nProp] <<= GetFormulaSepArrayRow();
+ break;
+ case SCFORMULAOPT_SEP_ARRAY_COL:
+ pValues[nProp] <<= GetFormulaSepArrayCol();
+ break;
+ }
+ }
+ aFormulaItem.PutProperties(aNames, aValues);
+
+ return 0;
+}
+
IMPL_LINK( ScDocCfg, LayoutCommitHdl, void *, EMPTYARG )
{
Sequence<OUString> aNames = GetLayoutPropertyNames();
@@ -430,13 +684,34 @@ IMPL_LINK( ScDocCfg, LayoutCommitHdl, void *, EMPTYARG )
return 0;
}
+IMPL_LINK( ScDocCfg, CompatCommitHdl, void *, EMPTYARG )
+{
+ Sequence<OUString> aNames = GetCompatPropertyNames();
+ Sequence<Any> aValues(aNames.getLength());
+ Any* pValues = aValues.getArray();
+
+ for (int nProp = 0; nProp < aNames.getLength(); ++nProp)
+ {
+ switch(nProp)
+ {
+ case SCCOMPATOPT_KEY_BINDING:
+ pValues[nProp] <<= static_cast<sal_Int32>(GetKeyBindingType());
+ break;
+ }
+ }
+ aCompatItem.PutProperties(aNames, aValues);
+ return 0;
+}
void ScDocCfg::SetOptions( const ScDocOptions& rNew )
{
*(ScDocOptions*)this = rNew;
aCalcItem.SetModified();
+ aFormulaItem.SetModified();
aLayoutItem.SetModified();
+ aCompatItem.SetModified();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx
index 7af5a17125ee..5724c79715e2 100644
--- a/sc/source/core/tool/doubleref.cxx
+++ b/sc/source/core/tool/doubleref.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: interpre.hxx,v $
- * $Revision: 1.35.44.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -69,7 +67,6 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef,
return false;
sal_Bool bValid;
- sal_Bool bFound;
OUString aCellStr;
SCSIZE nIndex = 0;
SCROW nRow = 0;
@@ -81,7 +78,7 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef,
{
ScQueryEntry& rEntry = pParam->GetEntry(nIndex);
- bValid = sal_False;
+ bValid = false;
if (nIndex > 0)
{
@@ -103,7 +100,6 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef,
if ((nIndex < 1) || bValid)
{
// field name in the 2nd column.
- bFound = sal_False;
aCellStr = pQueryRef->getString(1, nRow);
SCCOL nField = pDBRef->findFieldColumn(aCellStr); // TODO: must be case insensitive comparison.
if (ValidCol(nField))
@@ -118,7 +114,6 @@ bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef,
if (bValid)
{
// equality, non-equality operator in the 3rd column.
- bFound = sal_False;
aCellStr = pQueryRef->getString(2, nRow);
lcl_toUpper(aCellStr);
const sal_Unicode* p = aCellStr.getStr();
@@ -177,16 +172,12 @@ bool lcl_createExcelQuery(
if (bValid)
{
-// sal_uLong nVisible = 0;
-// for ( nCol=nCol1; nCol<=nCol2; nCol++ )
-// nVisible += aCol[nCol].VisibleCount( nRow1+1, nRow2 );
-
// Count the number of visible cells (excluding the header row). Each
// visible cell corresponds with a single query.
SCSIZE nVisible = pQueryRef->getVisibleDataCellCount();
if ( nVisible > SCSIZE_MAX / sizeof(void*) )
{
- DBG_ERROR("zu viele Filterkritierien");
+ OSL_FAIL("zu viele Filterkritierien");
nVisible = 0;
}
@@ -214,7 +205,7 @@ bool lcl_createExcelQuery(
pParam->GetEntry(nIndex).eConnect = SC_AND;
}
else
- bValid = sal_False;
+ bValid = false;
}
nCol++;
}
@@ -330,11 +321,13 @@ SCSIZE ScDBInternalRange::getVisibleDataCellCount() const
OUString ScDBInternalRange::getString(SCCOL nCol, SCROW nRow) const
{
- String aStr;
+ OUString aStr;
const ScAddress& s = maRange.aStart;
- // #i109200# this is used in formula calculation, use GetInputString, not GetString
- // (consistent with ScDBInternalRange::getCellString)
- getDoc()->GetInputString(s.Col() + nCol, s.Row() + nRow, maRange.aStart.Tab(), aStr);
+ ScBaseCell* pCell = getDoc()->GetCell(ScAddress(s.Col() + nCol, s.Row() + nRow, maRange.aStart.Tab()));
+ if (!pCell)
+ return aStr;
+
+ getCellString(aStr, pCell);
return aStr;
}
@@ -347,15 +340,11 @@ SCCOL ScDBInternalRange::findFieldColumn(SCCOL nIndex) const
{
const ScRange& rRange = getRange();
const ScAddress& s = rRange.aStart;
- const ScAddress& e = rRange.aEnd;
SCCOL nDBCol1 = s.Col();
- SCCOL nDBCol2 = e.Col();
- if ( nIndex <= 0 || nIndex > (nDBCol2 - nDBCol1 + 1) )
- return nDBCol1;
-
- return Min(nDBCol2, static_cast<SCCOL>(nDBCol1 + nIndex - 1));
+ // Don't handle out-of-bound condition here. We'll do that later.
+ return nIndex + nDBCol1 - 1;
}
sal_uInt16 ScDBInternalRange::getCellString(OUString& rStr, ScBaseCell* pCell) const
@@ -421,7 +410,7 @@ SCCOL ScDBInternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr)
SCCOL nField = nDBCol1;
sal_Bool bFound = sal_True;
- bFound = sal_False;
+ bFound = false;
OUString aCellStr;
ScAddress aLook( nDBCol1, nDBRow1, nDBTab1 );
while (!bFound && (aLook.Col() <= nDBCol2))
@@ -517,14 +506,6 @@ SCCOL ScDBExternalRange::getFirstFieldColumn() const
SCCOL ScDBExternalRange::findFieldColumn(SCCOL nIndex) const
{
- if (nIndex < 1)
- // 1st field
- return 0;
-
- if (nIndex > mnCols)
- // last field
- return mnCols - 1;
-
return nIndex - 1;
}
@@ -563,3 +544,4 @@ bool ScDBExternalRange::isRangeEqual(const ScRange& /*rRange*/) const
return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 13ea3a9437b3..fe31cd9a0d79 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,6 +45,7 @@
#include <editeng/escpitem.hxx>
#include <editeng/flditem.hxx>
#include <editeng/numitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <svl/inethist.hxx>
@@ -67,7 +69,7 @@
// Delimiters zusaetzlich zu EditEngine-Default:
-const sal_Char __FAR_DATA ScEditUtil::pCalcDelimiters[] = "=()+-*/^&<>";
+const sal_Char ScEditUtil::pCalcDelimiters[] = "=()+-*/^&<>";
//------------------------------------------------------------------------
@@ -163,7 +165,7 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, sal_Bool bForc
pDev->SetMapMode( MAP_PIXEL );
long nTextHeight = pDoc->GetNeededSize( nCol, nRow, nTab,
- pDev, nPPTX, nPPTY, aZoomX, aZoomY, sal_False );
+ pDev, nPPTX, nPPTY, aZoomX, aZoomY, false );
if (!nTextHeight)
{ // leere Zelle
Font aFont;
@@ -202,8 +204,8 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, sal_Bool bForc
ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) :
pEngine( pEng ),
pEditAttrs( NULL ),
- bNeedsObject( sal_False ),
- bNeedsCellAttr( sal_False )
+ bNeedsObject( false ),
+ bNeedsCellAttr( false )
{
if ( pEngine->GetParagraphCount() > 1 )
{
@@ -218,7 +220,7 @@ ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) :
for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END && !bNeedsObject; nId++)
{
- SfxItemState eState = pEditAttrs->GetItemState( nId, sal_False, &pItem );
+ SfxItemState eState = pEditAttrs->GetItemState( nId, false, &pItem );
if (eState == SFX_ITEM_DONTCARE)
bNeedsObject = sal_True;
else if (eState == SFX_ITEM_SET)
@@ -244,13 +246,13 @@ ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) :
// Feldbefehle enthalten?
- SfxItemState eFieldState = pEditAttrs->GetItemState( EE_FEATURE_FIELD, sal_False );
+ SfxItemState eFieldState = pEditAttrs->GetItemState( EE_FEATURE_FIELD, false );
if ( eFieldState == SFX_ITEM_DONTCARE || eFieldState == SFX_ITEM_SET )
bNeedsObject = sal_True;
// not converted characters?
- SfxItemState eConvState = pEditAttrs->GetItemState( EE_FEATURE_NOTCONV, sal_False );
+ SfxItemState eConvState = pEditAttrs->GetItemState( EE_FEATURE_NOTCONV, false );
if ( eConvState == SFX_ITEM_DONTCARE || eConvState == SFX_ITEM_SET )
bNeedsObject = sal_True;
}
@@ -270,7 +272,7 @@ ScEnginePoolHelper::ScEnginePoolHelper( SfxItemPool* pEnginePoolP,
pEnginePool( pEnginePoolP ),
pDefaults( NULL ),
bDeleteEnginePool( bDeleteEnginePoolP ),
- bDeleteDefaults( sal_False )
+ bDeleteDefaults( false )
{
}
@@ -280,7 +282,7 @@ ScEnginePoolHelper::ScEnginePoolHelper( const ScEnginePoolHelper& rOrg )
pEnginePool( rOrg.bDeleteEnginePool ? rOrg.pEnginePool->Clone() : rOrg.pEnginePool ),
pDefaults( NULL ),
bDeleteEnginePool( rOrg.bDeleteEnginePool ),
- bDeleteDefaults( sal_False )
+ bDeleteDefaults( false )
{
}
@@ -334,10 +336,10 @@ void ScEditEngineDefaulter::SetDefaults( const SfxItemSet& rSet, sal_Bool bRemem
}
const SfxItemSet& rNewSet = bRememberCopy ? *pDefaults : rSet;
sal_Bool bUndo = IsUndoEnabled();
- EnableUndo( sal_False );
+ EnableUndo( false );
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
sal_uInt16 nPara = GetParagraphCount();
for ( sal_uInt16 j=0; j<nPara; j++ )
{
@@ -357,7 +359,7 @@ void ScEditEngineDefaulter::SetDefaults( SfxItemSet* pSet, sal_Bool bTakeOwnersh
pDefaults = pSet;
bDeleteDefaults = bTakeOwnership;
if ( pDefaults )
- SetDefaults( *pDefaults, sal_False );
+ SetDefaults( *pDefaults, false );
}
@@ -369,7 +371,7 @@ void ScEditEngineDefaulter::SetDefaultItem( const SfxPoolItem& rItem )
bDeleteDefaults = sal_True;
}
pDefaults->Put( rItem );
- SetDefaults( *pDefaults, sal_False );
+ SetDefaults( *pDefaults, false );
}
const SfxItemSet& ScEditEngineDefaulter::GetDefaults()
@@ -386,10 +388,10 @@ void ScEditEngineDefaulter::SetText( const EditTextObject& rTextObject )
{
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
EditEngine::SetText( rTextObject );
if ( pDefaults )
- SetDefaults( *pDefaults, sal_False );
+ SetDefaults( *pDefaults, false );
if ( bUpdateMode )
SetUpdateMode( sal_True );
}
@@ -399,7 +401,7 @@ void ScEditEngineDefaulter::SetTextNewDefaults( const EditTextObject& rTextObjec
{
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
EditEngine::SetText( rTextObject );
SetDefaults( rSet, bRememberCopy );
if ( bUpdateMode )
@@ -411,7 +413,7 @@ void ScEditEngineDefaulter::SetTextNewDefaults( const EditTextObject& rTextObjec
{
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
EditEngine::SetText( rTextObject );
SetDefaults( pSet, bTakeOwnership );
if ( bUpdateMode )
@@ -423,10 +425,10 @@ void ScEditEngineDefaulter::SetText( const String& rText )
{
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
EditEngine::SetText( rText );
if ( pDefaults )
- SetDefaults( *pDefaults, sal_False );
+ SetDefaults( *pDefaults, false );
if ( bUpdateMode )
SetUpdateMode( sal_True );
}
@@ -436,7 +438,7 @@ void ScEditEngineDefaulter::SetTextNewDefaults( const String& rText,
{
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
EditEngine::SetText( rText );
SetDefaults( rSet, bRememberCopy );
if ( bUpdateMode )
@@ -448,7 +450,7 @@ void ScEditEngineDefaulter::SetTextNewDefaults( const String& rText,
{
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
EditEngine::SetText( rText );
SetDefaults( pSet, bTakeOwnership );
if ( bUpdateMode )
@@ -470,7 +472,7 @@ void ScEditEngineDefaulter::RemoveParaAttribs()
SfxItemSet* pCharItems = NULL;
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
sal_uInt16 nParCount = GetParagraphCount();
for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
{
@@ -479,7 +481,7 @@ void ScEditEngineDefaulter::RemoveParaAttribs()
for (nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich ++)
{
const SfxPoolItem* pParaItem;
- if ( rParaAttribs.GetItemState( nWhich, sal_False, &pParaItem ) == SFX_ITEM_SET )
+ if ( rParaAttribs.GetItemState( nWhich, false, &pParaItem ) == SFX_ITEM_SET )
{
// if defaults are set, use only items that are different from default
if ( !pDefaults || *pParaItem != pDefaults->Get(nWhich) )
@@ -512,7 +514,7 @@ void ScEditEngineDefaulter::RemoveParaAttribs()
// Clear those items that are different from existing character attributes.
// Where no character attributes are set, GetAttribs returns the paragraph attributes.
const SfxPoolItem* pItem;
- if ( aNewCharAttrs.GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
+ if ( aNewCharAttrs.GetItemState( nWhich, false, &pItem ) == SFX_ITEM_SET &&
*pItem != aOldCharAttrs.Get(nWhich) )
{
aNewCharAttrs.ClearItem(nWhich);
@@ -645,7 +647,7 @@ ScHeaderEditEngine::ScHeaderEditEngine( SfxItemPool* pEnginePoolP, sal_Bool bDel
{
}
-String __EXPORT ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
+String ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
sal_uInt16 /* nPara */, sal_uInt16 /* nPos */,
Color*& /* rTxtColor */, Color*& /* rFldColor */ )
{
@@ -679,13 +681,12 @@ String __EXPORT ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
aRet = ScGlobal::pLocaleData->getDate(aData.aDate);
else
{
- //DBG_ERROR("unbekannter Feldbefehl");
aRet = '?';
}
}
else
{
- DBG_ERROR("FieldData ist 0");
+ OSL_FAIL("FieldData ist 0");
aRet = '?';
}
@@ -711,7 +712,7 @@ ScFieldEditEngine::ScFieldEditEngine( SfxItemPool* pEnginePoolP,
SetControlWord( (GetControlWord() | EE_CNTRL_MARKFIELDS) & ~EE_CNTRL_RTFSTYLESHEETS );
}
-String __EXPORT ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
+String ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
sal_uInt16 /* nPara */, sal_uInt16 /* nPos */,
Color*& rTxtColor, Color*& /* rFldColor */ )
{
@@ -744,7 +745,6 @@ String __EXPORT ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
}
else
{
- //DBG_ERROR("unbekannter Feldbefehl");
aRet = '?';
}
}
@@ -755,7 +755,7 @@ String __EXPORT ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
return aRet;
}
-void __EXPORT ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_uInt16, sal_uInt16 )
+void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_uInt16, sal_uInt16 )
{
const SvxFieldData* pFld = rField.GetField();
@@ -776,3 +776,5 @@ ScNoteEditEngine::ScNoteEditEngine( SfxItemPool* pEnginePoolP,
SetEditTextObjectPool( pTextObjectPool );
SetControlWord( (GetControlWord() | EE_CNTRL_MARKFIELDS) & ~EE_CNTRL_RTFSTYLESHEETS );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/filtopt.cxx b/sc/source/core/tool/filtopt.cxx
index c3aa2d93febc..c43a2b9c844f 100644
--- a/sc/source/core/tool/filtopt.cxx
+++ b/sc/source/core/tool/filtopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,9 +42,10 @@
#include "miscuno.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
//------------------------------------------------------------------
#define CFGPATH_FILTER "Office.Calc/Filter/Import"
@@ -70,14 +72,13 @@ Sequence<OUString> ScFilterOptions::GetPropertyNames()
}
ScFilterOptions::ScFilterOptions() :
- ConfigItem( OUString::createFromAscii( CFGPATH_FILTER ) ),
- bWK3Flag( sal_False ),
+ ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_FILTER )) ),
+ bWK3Flag( false ),
fExcelColScale( 0 ),
fExcelRowScale( 0 )
{
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
-// EnableNotification(aNames);
const Any* pValues = aValues.getConstArray();
DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
@@ -109,12 +110,13 @@ void ScFilterOptions::Commit()
{
// options are never modified from office
- DBG_ERROR("trying to commit changed ScFilterOptions?");
+ OSL_FAIL("trying to commit changed ScFilterOptions?");
}
-void ScFilterOptions::Notify( const Sequence<rtl::OUString>& /* aPropertyNames */ )
+void ScFilterOptions::Notify( const Sequence<OUString>& /* aPropertyNames */ )
{
- DBG_ERROR("properties have been changed");
+ OSL_FAIL("properties have been changed");
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/formulaparserpool.cxx b/sc/source/core/tool/formulaparserpool.cxx
index c4c2f3b5a4ab..0add593eae10 100644
--- a/sc/source/core/tool/formulaparserpool.cxx
+++ b/sc/source/core/tool/formulaparserpool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,11 @@ public:
const OUString& rNamespace );
private:
- typedef ::std::hash_map< OUString, Reference< XSingleComponentFactory >, OUStringHash > FactoryMap;
+ typedef ::boost::unordered_map<
+ OUString,
+ Reference< XSingleComponentFactory >,
+ OUStringHash,
+ ::std::equal_to< OUString > > FactoryMap;
Reference< XComponentContext > mxContext; /// Global component context.
FactoryMap maFactories; /// All parser factories, mapped by formula namespace.
@@ -157,3 +162,4 @@ Reference< XFormulaParser > ScFormulaParserPool::getFormulaParser( const OUStrin
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/hints.cxx b/sc/source/core/tool/hints.cxx
index 18bf2e6cccbe..aadc8fcb2a8a 100644
--- a/sc/source/core/tool/hints.cxx
+++ b/sc/source/core/tool/hints.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,10 +80,6 @@ ScUpdateRefHint::~ScUpdateRefHint()
// ScPointerChangedHint - Pointer ist ungueltig geworden
// -----------------------------------------------------------------------
-//UNUSED2008-05 ScPointerChangedHint::ScPointerChangedHint( sal_uInt16 nF ) :
-//UNUSED2008-05 nFlags( nF )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
ScPointerChangedHint::~ScPointerChangedHint()
{
@@ -160,3 +157,4 @@ ScDataPilotModifiedHint::~ScDataPilotModifiedHint()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx
index 70aa722c0c90..8d300c5ebfff 100644
--- a/sc/source/core/tool/inputopt.cxx
+++ b/sc/source/core/tool/inputopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,9 +47,10 @@
#include "miscuno.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
//------------------------------------------------------------------
// Version, ab der das Item kompatibel ist
@@ -83,13 +85,13 @@ void ScInputOptions::SetDefaults()
{
nMoveDir = DIR_BOTTOM;
bMoveSelection = sal_True;
- bEnterEdit = sal_False;
- bExtendFormat = sal_False;
+ bEnterEdit = false;
+ bExtendFormat = false;
bRangeFinder = sal_True;
- bExpandRefs = sal_False;
+ bExpandRefs = false;
bMarkHeader = sal_True;
- bUseTabCol = sal_False;
- bTextWysiwyg = sal_False;
+ bUseTabCol = false;
+ bTextWysiwyg = false;
bReplCellsWarn = sal_True;
}
@@ -154,10 +156,8 @@ Sequence<OUString> ScInputCfg::GetPropertyNames()
}
ScInputCfg::ScInputCfg() :
- ConfigItem( OUString::createFromAscii( CFGPATH_INPUT ) )
+ ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_INPUT )) )
{
- sal_Int32 nIntVal = 0;
-
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
EnableNotification(aNames);
@@ -170,6 +170,7 @@ ScInputCfg::ScInputCfg() :
DBG_ASSERT(pValues[nProp].hasValue(), "property value missing");
if(pValues[nProp].hasValue())
{
+ sal_Int32 nIntVal = 0;
switch(nProp)
{
case SCINPUTOPT_MOVEDIR:
@@ -255,9 +256,9 @@ void ScInputCfg::Commit()
PutProperties(aNames, aValues);
}
-void ScInputCfg::Notify( const Sequence<rtl::OUString>& /* aPropertyNames */ )
+void ScInputCfg::Notify( const Sequence<OUString>& /* aPropertyNames */ )
{
- DBG_ERROR("properties have been changed");
+ OSL_FAIL("properties have been changed");
}
void ScInputCfg::SetOptions( const ScInputOptions& rNew )
@@ -272,3 +273,4 @@ void ScInputCfg::OptionsChanged()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 23c13331db26..3e630425e7f4 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "scitems.hxx"
#include <editeng/langitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/algitem.hxx>
#include <unotools/textsearch.hxx>
#include <svl/zforlist.hxx>
@@ -57,9 +59,7 @@
#include "attrib.hxx"
#include "jumpmatrix.hxx"
-#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#include <comphelper/processfactory.hxx>
-#endif
#include <stdlib.h>
#include <string.h>
@@ -71,6 +71,7 @@
#include "rangenam.hxx"
#include "compiler.hxx"
#include "externalrefmgr.hxx"
+#include <basic/sbstar.hxx>
#include "doubleref.hxx"
#include "queryparam.hxx"
@@ -80,13 +81,13 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScTokenStack, 8, 4 )
IMPL_FIXEDMEMPOOL_NEWDEL( ScInterpreter, 32, 16 )
ScTokenStack* ScInterpreter::pGlobalStack = NULL;
-sal_Bool ScInterpreter::bGlobalStackInUse = sal_False;
+sal_Bool ScInterpreter::bGlobalStackInUse = false;
using namespace formula;
using ::std::auto_ptr;
//-----------------------------------------------------------------------------
-// Funktionen
+// Functions
//-----------------------------------------------------------------------------
@@ -125,23 +126,20 @@ void ScInterpreter::ScIfJump()
{
double fVal;
bool bTrue;
- ScMatValType nType = 0;
- const ScMatrixValue* pMatVal = pMat->Get( nC, nR,
- nType);
- bool bIsValue = ScMatrix::IsValueType( nType);
- if ( bIsValue )
+ bool bIsValue = pMat->IsValue(nC, nR);
+ if (bIsValue)
{
- fVal = pMatVal->fVal;
- bIsValue = ::rtl::math::isFinite( fVal );
+ fVal = pMat->GetDouble(nC, nR);
+ bIsValue = ::rtl::math::isFinite(fVal);
bTrue = bIsValue && (fVal != 0.0);
- if ( bTrue )
+ if (bTrue)
fVal = 1.0;
}
else
{
// Treat empty and empty path as 0, but string
// as error.
- bIsValue = !ScMatrix::IsRealStringType( nType);
+ bIsValue = (!pMat->IsString(nC, nR) || pMat->IsEmpty(nC, nR));
bTrue = false;
fVal = (bIsValue ? 0.0 : CreateDoubleError( errNoValue));
}
@@ -181,7 +179,7 @@ void ScInterpreter::ScIfJump()
xNew = new ScJumpMatrixToken( pJumpMat );
GetTokenMatrixMap().insert( ScTokenMatrixMap::value_type(pCur, xNew));
}
- PushTempToken( xNew);
+ PushTempToken( xNew.get());
// set endpoint of path for main code line
aCode.Jump( pJump[ nJumpCount ], pJump[ nJumpCount ] );
}
@@ -257,20 +255,17 @@ void ScInterpreter::ScChoseJump()
for ( SCSIZE nR=0; nR < nRows; ++nR )
{
double fVal;
- ScMatValType nType;
- const ScMatrixValue* pMatVal = pMat->Get( nC, nR,
- nType);
- bool bIsValue = ScMatrix::IsValueType( nType);
+ bool bIsValue = pMat->IsValue(nC, nR);
if ( bIsValue )
{
- fVal = pMatVal->fVal;
+ fVal = pMat->GetDouble(nC, nR);
bIsValue = ::rtl::math::isFinite( fVal );
if ( bIsValue )
{
fVal = ::rtl::math::approxFloor( fVal);
if ( (fVal < 1) || (fVal >= nJumpCount))
{
- bIsValue = sal_False;
+ bIsValue = false;
fVal = CreateDoubleError(
errIllegalArgument);
}
@@ -298,7 +293,7 @@ void ScInterpreter::ScChoseJump()
GetTokenMatrixMap().insert( ScTokenMatrixMap::value_type(
pCur, xNew));
}
- PushTempToken( xNew);
+ PushTempToken( xNew.get());
// set endpoint of path for main code line
aCode.Jump( pJump[ nJumpCount ], pJump[ nJumpCount ] );
bHaveJump = true;
@@ -792,7 +787,7 @@ double ScInterpreter::Compare()
break;
case svString:
*aComp.pVal[ i ] = GetString();
- aComp.bVal[ i ] = sal_False;
+ aComp.bVal[ i ] = false;
break;
case svDoubleRef :
case svSingleRef :
@@ -806,7 +801,7 @@ double ScInterpreter::Compare()
else if (HasCellStringData( pCell))
{
GetCellString( *aComp.pVal[ i ], pCell);
- aComp.bVal[ i ] = sal_False;
+ aComp.bVal[ i ] = false;
}
else
{
@@ -849,7 +844,7 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions )
break;
case svString:
*aComp.pVal[ i ] = GetString();
- aComp.bVal[ i ] = sal_False;
+ aComp.bVal[ i ] = false;
break;
case svSingleRef:
{
@@ -860,7 +855,7 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions )
else if (HasCellStringData( pCell))
{
GetCellString( *aComp.pVal[ i ], pCell);
- aComp.bVal[ i ] = sal_False;
+ aComp.bVal[ i ] = false;
}
else
{
@@ -909,7 +904,7 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions )
{
if ( pMat[i]->IsString(j,k) )
{
- aComp.bVal[i] = sal_False;
+ aComp.bVal[i] = false;
*aComp.pVal[i] = pMat[i]->GetString(j,k);
aComp.bEmpty[i] = pMat[i]->IsEmpty(j,k);
}
@@ -917,7 +912,7 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions )
{
aComp.bVal[i] = sal_True;
aComp.nVal[i] = pMat[i]->GetDouble(j,k);
- aComp.bEmpty[i] = sal_False;
+ aComp.bEmpty[i] = false;
}
}
pResMat->PutDouble( CompareFunc( aComp, pOptions ), j,k );
@@ -935,22 +930,25 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions )
pResMat = GetNewMat( nC, nR);
if ( !pResMat )
return NULL;
- SCSIZE n = nC * nR;
- for ( SCSIZE j=0; j<n; j++ )
+
+ for (SCSIZE j = 0; j < nC; ++j)
{
- if ( pMat[i]->IsValue(j) )
- {
- aComp.bVal[i] = sal_True;
- aComp.nVal[i] = pMat[i]->GetDouble(j);
- aComp.bEmpty[i] = sal_False;
- }
- else
+ for (SCSIZE k = 0; k < nR; ++k)
{
- aComp.bVal[i] = sal_False;
- *aComp.pVal[i] = pMat[i]->GetString(j);
- aComp.bEmpty[i] = pMat[i]->IsEmpty(j);
+ if ( pMat[i]->IsValue(j,k) )
+ {
+ aComp.bVal[i] = true;
+ aComp.nVal[i] = pMat[i]->GetDouble(j,k);
+ aComp.bEmpty[i] = false;
+ }
+ else
+ {
+ aComp.bVal[i] = false;
+ *aComp.pVal[i] = pMat[i]->GetString(j,k);
+ aComp.bEmpty[i] = pMat[i]->IsEmpty(j,k);
+ }
+ pResMat->PutDouble( CompareFunc(aComp, pOptions), j, k);
}
- pResMat->PutDouble( CompareFunc( aComp, pOptions ), j );
}
}
}
@@ -959,7 +957,7 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions )
}
-ScMatrixRef ScInterpreter::QueryMat( ScMatrix* pMat, ScCompareOptions& rOptions )
+ScMatrixRef ScInterpreter::QueryMat( const ScMatrixRef& pMat, ScCompareOptions& rOptions )
{
short nSaveCurFmtType = nCurFmtType;
short nSaveFuncFmtType = nFuncFmtType;
@@ -1126,7 +1124,7 @@ void ScInterpreter::ScAnd()
short nParamCount = GetByte();
if ( MustHaveParamCountMin( nParamCount, 1 ) )
{
- sal_Bool bHaveValue = sal_False;
+ sal_Bool bHaveValue = false;
short nRes = sal_True;
size_t nRefInList = 0;
while( nParamCount-- > 0)
@@ -1155,7 +1153,7 @@ void ScInterpreter::ScAnd()
bHaveValue = sal_True;
nRes &= ( GetCellValue( aAdr, pCell ) != 0.0 );
}
- // else: Xcl setzt hier keinen Fehler
+ // else: Xcl raises no error here
}
}
break;
@@ -1193,7 +1191,7 @@ void ScInterpreter::ScAnd()
if ( nErr )
{
SetError( nErr );
- nRes = sal_False;
+ nRes = false;
}
else
nRes &= (fVal != 0.0);
@@ -1224,8 +1222,8 @@ void ScInterpreter::ScOr()
short nParamCount = GetByte();
if ( MustHaveParamCountMin( nParamCount, 1 ) )
{
- sal_Bool bHaveValue = sal_False;
- short nRes = sal_False;
+ sal_Bool bHaveValue = false;
+ short nRes = false;
size_t nRefInList = 0;
while( nParamCount-- > 0)
{
@@ -1253,7 +1251,7 @@ void ScInterpreter::ScOr()
bHaveValue = sal_True;
nRes |= ( GetCellValue( aAdr, pCell ) != 0.0 );
}
- // else: Xcl setzt hier keinen Fehler
+ // else: Xcl raises no error here
}
}
break;
@@ -1292,7 +1290,7 @@ void ScInterpreter::ScOr()
if ( nErr )
{
SetError( nErr );
- nRes = sal_False;
+ nRes = false;
}
else
nRes |= (fVal != 0.0);
@@ -1338,14 +1336,16 @@ void ScInterpreter::ScNeg()
PushIllegalArgument();
else
{
- SCSIZE nCount = nC * nR;
- for ( SCSIZE j=0; j<nCount; ++j )
+ for (SCSIZE i = 0; i < nC; ++i)
{
- if ( pMat->IsValueOrEmpty(j) )
- pResMat->PutDouble( -pMat->GetDouble(j), j );
- else
- pResMat->PutString(
- ScGlobal::GetRscString( STR_NO_VALUE ), j );
+ for (SCSIZE j = 0; j < nR; ++j)
+ {
+ if ( pMat->IsValueOrEmpty(i,j) )
+ pResMat->PutDouble( -pMat->GetDouble(i,j), i, j );
+ else
+ pResMat->PutString(
+ ScGlobal::GetRscString( STR_NO_VALUE ), i, j );
+ }
}
PushMatrix( pResMat );
}
@@ -1394,14 +1394,16 @@ void ScInterpreter::ScNot()
PushIllegalArgument();
else
{
- SCSIZE nCount = nC * nR;
- for ( SCSIZE j=0; j<nCount; ++j )
+ for (SCSIZE i = 0; i < nC; ++i)
{
- if ( pMat->IsValueOrEmpty(j) )
- pResMat->PutDouble( (pMat->GetDouble(j) == 0.0), j );
- else
- pResMat->PutString(
- ScGlobal::GetRscString( STR_NO_VALUE ), j );
+ for (SCSIZE j = 0; j < nR; ++j)
+ {
+ if ( pMat->IsValueOrEmpty(i,j) )
+ pResMat->PutDouble( (pMat->GetDouble(i,j) == 0.0), i, j );
+ else
+ pResMat->PutString(
+ ScGlobal::GetRscString( STR_NO_VALUE ), i, j );
+ }
}
PushMatrix( pResMat );
}
@@ -1633,7 +1635,7 @@ void ScInterpreter::ScIsEmpty()
if ( !pMat )
; // nothing
else if ( !pJumpMatrix )
- nRes = pMat->IsEmpty( 0 );
+ nRes = pMat->IsEmpty( 0, 0);
else
{
SCSIZE nCols, nRows, nC, nR;
@@ -1695,7 +1697,7 @@ short ScInterpreter::IsString()
if ( !pMat )
; // nothing
else if ( !pJumpMatrix )
- nRes = pMat->IsString(0) && !pMat->IsEmpty(0);
+ nRes = pMat->IsString(0, 0) && !pMat->IsEmpty(0, 0);
else
{
SCSIZE nCols, nRows, nC, nR;
@@ -1867,7 +1869,7 @@ void ScInterpreter::ScCell()
if( MustHaveParamCount( nParamCount, 1, 2 ) )
{
ScAddress aCellPos( aPos );
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
if( nParamCount == 2 )
bError = !PopDoubleRefOrSingleRef( aCellPos );
String aInfoType( GetString() );
@@ -2014,7 +2016,7 @@ void ScInterpreter::ScCell()
case NUMBERFORMAT_PERCENT: aFuncResult = 'P'; break;
default:
{
- bAppendPrec = sal_False;
+ bAppendPrec = false;
switch( pFormatter->GetIndexTableOffset( nFormat ) )
{
case NF_DATE_SYSTEM_SHORT:
@@ -2145,8 +2147,8 @@ void ScInterpreter::ScIsValue()
; // nothing
else if ( !pJumpMatrix )
{
- if (pMat->GetErrorIfNotString( 0 ) == 0)
- nRes = pMat->IsValue( 0 );
+ if (pMat->GetErrorIfNotString( 0, 0) == 0)
+ nRes = pMat->IsValue( 0, 0);
}
else
{
@@ -2251,7 +2253,7 @@ void ScInterpreter::ScIsNV()
if ( !pMat )
; // nothing
else if ( !pJumpMatrix )
- nRes = (pMat->GetErrorIfNotString( 0 ) == NOTAVAILABLE);
+ nRes = (pMat->GetErrorIfNotString( 0, 0) == NOTAVAILABLE);
else
{
SCSIZE nCols, nRows, nC, nR;
@@ -2301,7 +2303,7 @@ void ScInterpreter::ScIsErr()
nRes = ((nGlobalError && nGlobalError != NOTAVAILABLE) || !pMat);
else if ( !pJumpMatrix )
{
- sal_uInt16 nErr = pMat->GetErrorIfNotString( 0 );
+ sal_uInt16 nErr = pMat->GetErrorIfNotString( 0, 0);
nRes = (nErr && nErr != NOTAVAILABLE);
}
else
@@ -2358,7 +2360,7 @@ void ScInterpreter::ScIsError()
if ( nGlobalError || !pMat )
nRes = 1;
else if ( !pJumpMatrix )
- nRes = (pMat->GetErrorIfNotString( 0 ) != 0);
+ nRes = (pMat->GetErrorIfNotString( 0, 0) != 0);
else
{
SCSIZE nCols, nRows, nC, nR;
@@ -2431,9 +2433,9 @@ short ScInterpreter::IsEven()
; // nothing
else if ( !pJumpMatrix )
{
- nRes = pMat->IsValue( 0 );
+ nRes = pMat->IsValue( 0, 0);
if ( nRes )
- fVal = pMat->GetDouble( 0 );
+ fVal = pMat->GetDouble( 0, 0);
}
else
{
@@ -2496,7 +2498,7 @@ void ScInterpreter::ScN()
void ScInterpreter::ScTrim()
-{ // trimmt nicht nur sondern schnibbelt auch doppelte raus!
+{ // Doesn't only trim but writes out twice!
String aVal( GetString() );
aVal.EraseLeadingChars();
aVal.EraseTrailingChars();
@@ -2505,7 +2507,7 @@ void ScInterpreter::ScTrim()
register const sal_Unicode* const pEnd = p + aVal.Len();
while ( p < pEnd )
{
- if ( *p != ' ' || p[-1] != ' ' ) // erster kann kein ' ' sein, -1 ist also ok
+ if ( *p != ' ' || p[-1] != ' ' ) // ' ' can't be first, -1 is fine too
aStr += *p;
p++;
}
@@ -2586,7 +2588,7 @@ void ScInterpreter::ScT()
PushInt(0);
return ;
}
- sal_Bool bValue = sal_False;
+ sal_Bool bValue = false;
ScBaseCell* pCell = GetCell( aAdr );
if ( GetCellErrCode( pCell ) == 0 )
{
@@ -2606,7 +2608,7 @@ void ScInterpreter::ScT()
PushString( EMPTY_STRING );
else
{
- // wie GetString()
+ // like GetString()
GetCellString( aTempStr, pCell );
PushString( aTempStr );
}
@@ -2758,7 +2760,7 @@ static ::rtl::OUString lcl_convertIntoHalfWidth( const ::rtl::OUString & rStr )
if( bFirstASCCall )
{
- aTrans.loadModuleByImplName( ::rtl::OUString::createFromAscii( "FULLWIDTH_HALFWIDTH_LIKE_ASC" ), LANGUAGE_SYSTEM );
+ aTrans.loadModuleByImplName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FULLWIDTH_HALFWIDTH_LIKE_ASC" )), LANGUAGE_SYSTEM );
bFirstASCCall = false;
}
@@ -2773,7 +2775,7 @@ static ::rtl::OUString lcl_convertIntoFullWidth( const ::rtl::OUString & rStr )
if( bFirstJISCall )
{
- aTrans.loadModuleByImplName( ::rtl::OUString::createFromAscii( "HALFWIDTH_FULLWIDTH_LIKE_JIS" ), LANGUAGE_SYSTEM );
+ aTrans.loadModuleByImplName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "HALFWIDTH_FULLWIDTH_LIKE_JIS" )), LANGUAGE_SYSTEM );
bFirstJISCall = false;
}
@@ -3087,6 +3089,63 @@ void ScInterpreter::ScMax( sal_Bool bTextAsZero )
else
PushDouble(nMax);
}
+#if defined(WIN) && defined(MSC)
+#pragma optimize("",on)
+#endif
+
+namespace {
+
+void IterateMatrix(
+ const ScMatrixRef& pMat, ScIterFunc eFunc, sal_Bool bTextAsZero,
+ sal_uLong& rCount, short& rFuncFmtType, double& fRes, double& fMem, bool& bNull)
+{
+ if (!pMat)
+ return;
+
+ rFuncFmtType = NUMBERFORMAT_NUMBER;
+ switch (eFunc)
+ {
+ case ifAVERAGE:
+ case ifSUM:
+ {
+ ScMatrix::IterateResult aRes = pMat->Sum(bTextAsZero);
+ if (bNull)
+ {
+ bNull = false;
+ fMem = aRes.mfFirst;
+ fRes += aRes.mfRest;
+ }
+ else
+ fRes += aRes.mfFirst + aRes.mfRest;
+ rCount += aRes.mnCount;
+ }
+ break;
+ case ifCOUNT:
+ rCount += pMat->Count(bTextAsZero);
+ break;
+ case ifCOUNT2:
+ rCount += pMat->Count(true);
+ break;
+ case ifPRODUCT:
+ {
+ ScMatrix::IterateResult aRes = pMat->Product(bTextAsZero);
+ fRes *= aRes.mfRest;
+ rCount += aRes.mnCount;
+ }
+ break;
+ case ifSUMSQ:
+ {
+ ScMatrix::IterateResult aRes = pMat->SumSquare(bTextAsZero);
+ fRes += aRes.mfRest;
+ rCount += aRes.mnCount;
+ }
+ break;
+ default:
+ ;
+ }
+}
+
+}
double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero )
{
@@ -3094,8 +3153,8 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
short nParamCount = GetByte();
double fRes = ( eFunc == ifPRODUCT ) ? 1.0 : 0.0;
double fVal = 0.0;
- double fMem = 0.0;
- sal_Bool bNull = sal_True;
+ double fMem = 0.0; // first numeric value.
+ bool bNull = true;
sal_uLong nCount = 0;
ScAddress aAdr;
ScRange aRange;
@@ -3156,7 +3215,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
case ifSUM:
if ( bNull && fVal != 0.0 )
{
- bNull = sal_False;
+ bNull = false;
fMem = fVal;
}
else
@@ -3168,6 +3227,71 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
}
nFuncFmtType = NUMBERFORMAT_NUMBER;
break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ ScExternalRefCache::CellFormat aFmt;
+ PopExternalSingleRef(pToken, &aFmt);
+ if (nGlobalError && (eFunc == ifCOUNT2 || eFunc == ifCOUNT))
+ {
+ nGlobalError = 0;
+ if ( eFunc == ifCOUNT2 )
+ ++nCount;
+ break;
+ }
+
+ if (!pToken)
+ break;
+
+ StackVar eType = pToken->GetType();
+ if (eFunc == ifCOUNT2)
+ {
+ if (eType != formula::svEmptyCell)
+ nCount++;
+ if (nGlobalError)
+ nGlobalError = 0;
+ }
+ else if (eType == formula::svDouble)
+ {
+ nCount++;
+ fVal = pToken->GetDouble();
+ if (aFmt.mbIsSet)
+ {
+ nFuncFmtType = aFmt.mnType;
+ nFuncFmtIndex = aFmt.mnIndex;
+ }
+ switch( eFunc )
+ {
+ case ifAVERAGE:
+ case ifSUM:
+ if ( bNull && fVal != 0.0 )
+ {
+ bNull = false;
+ fMem = fVal;
+ }
+ else
+ fRes += fVal;
+ break;
+ case ifSUMSQ: fRes += fVal * fVal; break;
+ case ifPRODUCT: fRes *= fVal; break;
+ case ifCOUNT:
+ if ( nGlobalError )
+ {
+ nGlobalError = 0;
+ nCount--;
+ }
+ break;
+ default: ; // nothing
+ }
+ }
+ else if (bTextAsZero && eType == formula::svString)
+ {
+ nCount++;
+ if ( eFunc == ifPRODUCT )
+ fRes = 0.0;
+ }
+ }
+ break;
case svSingleRef :
{
PopSingleRef( aAdr );
@@ -3200,7 +3324,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
case ifSUM:
if ( bNull && fVal != 0.0 )
{
- bNull = sal_False;
+ bNull = false;
fMem = fVal;
}
else
@@ -3230,7 +3354,6 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
case svDoubleRef :
case svRefList :
{
- sal_uInt16 nErr = 0;
PopDoubleRef( aRange, nParamCount, nRefInList);
if ( nGlobalError && ( eFunc == ifCOUNT2 || eFunc == ifCOUNT ) )
{
@@ -3259,9 +3382,10 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
else
{
ScValueIterator aValIter( pDok, aRange, glSubTotal, bTextAsZero );
+ sal_uInt16 nErr = 0;
if (aValIter.GetFirst(fVal, nErr))
{
- // Schleife aus Performance-Gruenden nach innen verlegt:
+ // placed the loop on the inside for performance reasons:
aValIter.GetCurNumFmtInfo( nFuncFmtType, nFuncFmtIndex );
switch( eFunc )
{
@@ -3272,7 +3396,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
SetError(nErr);
if ( bNull && fVal != 0.0 )
{
- bNull = sal_False;
+ bNull = false;
fMem = fVal;
}
else
@@ -3314,53 +3438,20 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, sal_Bool bTextAsZero
}
}
break;
+ case svExternalDoubleRef:
+ {
+ ScMatrixRef pMat;
+ PopExternalDoubleRef(pMat);
+ if (nGlobalError)
+ break;
+
+ IterateMatrix(pMat, eFunc, bTextAsZero, nCount, nFuncFmtType, fRes, fMem, bNull);
+ }
+ break;
case svMatrix :
{
ScMatrixRef pMat = PopMatrix();
- if (pMat)
- {
- SCSIZE nC, nR;
- nFuncFmtType = NUMBERFORMAT_NUMBER;
- pMat->GetDimensions(nC, nR);
- if( eFunc == ifCOUNT2 )
- nCount += (sal_uLong) nC * nR;
- else
- {
- for (SCSIZE nMatCol = 0; nMatCol < nC; nMatCol++)
- {
- for (SCSIZE nMatRow = 0; nMatRow < nR; nMatRow++)
- {
- if (!pMat->IsString(nMatCol,nMatRow))
- {
- nCount++;
- fVal = pMat->GetDouble(nMatCol,nMatRow);
- switch( eFunc )
- {
- case ifAVERAGE:
- case ifSUM:
- if ( bNull && fVal != 0.0 )
- {
- bNull = sal_False;
- fMem = fVal;
- }
- else
- fRes += fVal;
- break;
- case ifSUMSQ: fRes += fVal * fVal; break;
- case ifPRODUCT: fRes *= fVal; break;
- default: ; // nothing
- }
- }
- else if ( bTextAsZero )
- {
- nCount++;
- if ( eFunc == ifPRODUCT )
- fRes = 0.0;
- }
- }
- }
- }
- }
+ IterateMatrix(pMat, eFunc, bTextAsZero, nCount, nFuncFmtType, fRes, fMem, bNull);
}
break;
case svError:
@@ -3960,11 +4051,61 @@ void ScInterpreter::ScTable()
}
}
+namespace {
+
+class VectorMatrixAccessor
+{
+public:
+ VectorMatrixAccessor(const ScMatrix& rMat, bool bColVec) :
+ mrMat(rMat), mbColVec(bColVec) {}
+
+ bool IsEmpty(SCSIZE i) const
+ {
+ return mbColVec ? mrMat.IsEmpty(0, i) : mrMat.IsEmpty(i, 0);
+ }
+
+ bool IsEmptyPath(SCSIZE i) const
+ {
+ return mbColVec ? mrMat.IsEmptyPath(0, i) : mrMat.IsEmptyPath(i, 0);
+ }
+
+ bool IsValue(SCSIZE i) const
+ {
+ return mbColVec ? mrMat.IsValue(0, i) : mrMat.IsValue(i, 0);
+ }
+
+ bool IsString(SCSIZE i) const
+ {
+ return mbColVec ? mrMat.IsString(0, i) : mrMat.IsString(i, 0);
+ }
+
+ double GetDouble(SCSIZE i) const
+ {
+ return mbColVec ? mrMat.GetDouble(0, i) : mrMat.GetDouble(i, 0);
+ }
+
+ const String& GetString(SCSIZE i) const
+ {
+ return mbColVec ? mrMat.GetString(0, i) : mrMat.GetString(i, 0);
+ }
+
+ SCSIZE GetElementCount() const
+ {
+ SCSIZE nC, nR;
+ mrMat.GetDimensions(nC, nR);
+ return mbColVec ? nR : nC;
+ }
+
+private:
+ const ScMatrix& mrMat;
+ bool mbColVec;
+};
+
/** returns -1 when the matrix value is smaller than the query value, 0 when
they are equal, and 1 when the matrix value is larger than the query
value. */
-static sal_Int32 lcl_CompareMatrix2Query( SCSIZE i, const ScMatrix& rMat,
- const ScQueryEntry& rEntry)
+static sal_Int32 lcl_CompareMatrix2Query(
+ SCSIZE i, const VectorMatrixAccessor& rMat, const ScQueryEntry& rEntry)
{
if (rMat.IsEmpty(i))
{
@@ -4004,7 +4145,7 @@ static sal_Int32 lcl_CompareMatrix2Query( SCSIZE i, const ScMatrix& rMat,
/** returns the last item with the identical value as the original item
value. */
-static void lcl_GetLastMatch( SCSIZE& rIndex, const ScMatrix& rMat,
+static void lcl_GetLastMatch( SCSIZE& rIndex, const VectorMatrixAccessor& rMat,
SCSIZE nMatCount, bool bReverse)
{
if (rMat.IsValue(rIndex))
@@ -4056,10 +4197,11 @@ static void lcl_GetLastMatch( SCSIZE& rIndex, const ScMatrix& rMat,
}
}
+}
+
void ScInterpreter::ScMatch()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMatch" );
- ScMatrixRef pMatSrc = NULL;
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 2, 3 ) )
@@ -4075,29 +4217,40 @@ void ScInterpreter::ScMatch()
SCCOL nCol2 = 0;
SCROW nRow2 = 0;
SCTAB nTab2 = 0;
- if (GetStackType() == svDoubleRef)
+ ScMatrixRef pMatSrc = NULL;
+
+ switch (GetStackType())
{
- PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
- if (nTab1 != nTab2 || (nCol1 != nCol2 && nRow1 != nRow2))
+ case svDoubleRef:
{
- PushIllegalParameter();
- return;
+ PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
+ if (nTab1 != nTab2 || (nCol1 != nCol2 && nRow1 != nRow2))
+ {
+ PushIllegalParameter();
+ return;
+ }
}
- }
- else if (GetStackType() == svMatrix)
- {
- pMatSrc = PopMatrix();
- if (!pMatSrc)
+ break;
+ case svMatrix:
+ case svExternalDoubleRef:
{
+ if (GetStackType() == svMatrix)
+ pMatSrc = PopMatrix();
+ else
+ PopExternalDoubleRef(pMatSrc);
+
+ if (!pMatSrc)
+ {
+ PushIllegalParameter();
+ return;
+ }
+ }
+ break;
+ default:
PushIllegalParameter();
return;
- }
- }
- else
- {
- PushIllegalParameter();
- return;
}
+
if (nGlobalError == 0)
{
double fVal;
@@ -4120,7 +4273,7 @@ void ScInterpreter::ScMatch()
case svDouble:
{
fVal = GetDouble();
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = fVal;
}
break;
@@ -4144,7 +4297,7 @@ void ScInterpreter::ScMatch()
if (HasCellValueData(pCell))
{
fVal = GetCellValue( aAdr, pCell );
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = fVal;
}
else
@@ -4155,6 +4308,32 @@ void ScInterpreter::ScMatch()
}
}
break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ if (!pToken)
+ {
+ PushInt(0);
+ return;
+ }
+ if (pToken->GetType() == svDouble)
+ {
+ rEntry.bQueryByString = false;
+ rEntry.nVal = pToken->GetDouble();
+ }
+ else
+ {
+ rEntry.bQueryByString = true;
+ *rEntry.pStr = pToken->GetString();
+ }
+ }
+ break;
+ case svExternalDoubleRef:
+ // TODO: Implement this.
+ PushIllegalParameter();
+ return;
+ break;
case svMatrix :
{
ScMatValType nType = GetDoubleOrStringFromMatrix(
@@ -4169,7 +4348,17 @@ void ScInterpreter::ScMatch()
}
}
if ( rEntry.bQueryByString )
- rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok );
+ {
+ sal_Bool bIsVBAMode = false;
+ if ( pDok )
+ bIsVBAMode = pDok->IsInVBAMode();
+
+ // #TODO handle MSO wildcards
+ if ( bIsVBAMode )
+ rParam.bRegExp = false;
+ else
+ rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok );
+ }
if (pMatSrc) // The source data is matrix array.
{
@@ -4182,6 +4371,7 @@ void ScInterpreter::ScMatch()
return;
}
SCSIZE nMatCount = (nC == 1) ? nR : nC;
+ VectorMatrixAccessor aMatAcc(*pMatSrc, nC == 1);
// simple serial search for equality mode (source data doesn't
// need to be sorted).
@@ -4190,7 +4380,7 @@ void ScInterpreter::ScMatch()
{
for (SCSIZE i = 0; i < nMatCount; ++i)
{
- if (lcl_CompareMatrix2Query( i, *pMatSrc, rEntry) == 0)
+ if (lcl_CompareMatrix2Query( i, aMatAcc, rEntry) == 0)
{
PushDouble(i+1); // found !
return;
@@ -4208,11 +4398,11 @@ void ScInterpreter::ScMatch()
for (SCSIZE nLen = nLast-nFirst; nLen > 0; nLen = nLast-nFirst)
{
SCSIZE nMid = nFirst + nLen/2;
- sal_Int32 nCmp = lcl_CompareMatrix2Query( nMid, *pMatSrc, rEntry);
+ sal_Int32 nCmp = lcl_CompareMatrix2Query( nMid, aMatAcc, rEntry);
if (nCmp == 0)
{
// exact match. find the last item with the same value.
- lcl_GetLastMatch( nMid, *pMatSrc, nMatCount, !bAscOrder);
+ lcl_GetLastMatch( nMid, aMatAcc, nMatCount, !bAscOrder);
PushDouble( nMid+1);
return;
}
@@ -4244,7 +4434,7 @@ void ScInterpreter::ScMatch()
if (nHitIndex == nMatCount-1) // last item
{
- sal_Int32 nCmp = lcl_CompareMatrix2Query( nHitIndex, *pMatSrc, rEntry);
+ sal_Int32 nCmp = lcl_CompareMatrix2Query( nHitIndex, aMatAcc, rEntry);
if ((bAscOrder && nCmp <= 0) || (!bAscOrder && nCmp >= 0))
{
// either the last item is an exact match or the real
@@ -4280,10 +4470,10 @@ void ScInterpreter::ScMatch()
else
{ // search column in row
SCCOL nC;
- rParam.bByRow = sal_False;
+ rParam.bByRow = false;
rParam.nRow2 = nRow1;
rEntry.nField = nCol1;
- ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False);
+ ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false);
// Advance Entry.nField in Iterator if column changed
aCellIter.SetAdvanceQueryParamEntryField( sal_True );
if (fTyp == 0.0)
@@ -4392,13 +4582,13 @@ void ScInterpreter::ScCountIf()
{
case CELLTYPE_VALUE :
fVal = GetCellValue( aAdr, pCell );
- bIsString = sal_False;
+ bIsString = false;
break;
case CELLTYPE_FORMULA :
if( ((ScFormulaCell*)pCell)->IsValue() )
{
fVal = GetCellValue( aAdr, pCell );
- bIsString = sal_False;
+ bIsString = false;
}
else
GetCellString(rString, pCell);
@@ -4409,7 +4599,7 @@ void ScInterpreter::ScCountIf()
break;
default:
fVal = 0.0;
- bIsString = sal_False;
+ bIsString = false;
}
}
break;
@@ -4426,7 +4616,7 @@ void ScInterpreter::ScCountIf()
default:
{
fVal = GetDouble();
- bIsString = sal_False;
+ bIsString = false;
}
}
double fSum = 0.0;
@@ -4499,7 +4689,7 @@ void ScInterpreter::ScCountIf()
rEntry.bDoQuery = sal_True;
if (!bIsString)
{
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = fVal;
rEntry.eOp = SC_EQUAL;
}
@@ -4537,9 +4727,9 @@ void ScInterpreter::ScCountIf()
}
else
{
- ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False);
- // Entry.nField im Iterator bei Spaltenwechsel weiterschalten
- aCellIter.SetAdvanceQueryParamEntryField( sal_True );
+ ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false);
+ // Keep Entry.nField in iterator on column change
+ aCellIter.SetAdvanceQueryParamEntryField( true );
if ( aCellIter.GetFirst() )
{
do
@@ -4562,368 +4752,406 @@ void ScInterpreter::ScCountIf()
void ScInterpreter::ScSumIf()
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSumIf" );
sal_uInt8 nParamCount = GetByte();
- if ( MustHaveParamCount( nParamCount, 2, 3 ) )
- {
- SCCOL nCol3 = 0;
- SCROW nRow3 = 0;
- SCTAB nTab3 = 0;
+ if ( !MustHaveParamCount( nParamCount, 2, 3 ) )
+ return;
- ScMatrixRef pSumExtraMatrix;
- bool bSumExtraRange = (nParamCount == 3);
- if (bSumExtraRange)
- {
- // Save only the upperleft cell in case of cell range. The geometry
- // of the 3rd parameter is taken from the 1st parameter.
+ SCCOL nCol3 = 0;
+ SCROW nRow3 = 0;
+ SCTAB nTab3 = 0;
+
+ ScMatrixRef pSumExtraMatrix;
+ bool bSumExtraRange = (nParamCount == 3);
+ if (bSumExtraRange)
+ {
+ // Save only the upperleft cell in case of cell range. The geometry
+ // of the 3rd parameter is taken from the 1st parameter.
- switch ( GetStackType() )
- {
- case svDoubleRef :
- {
- SCCOL nColJunk = 0;
- SCROW nRowJunk = 0;
- SCTAB nTabJunk = 0;
- PopDoubleRef( nCol3, nRow3, nTab3, nColJunk, nRowJunk, nTabJunk );
- if ( nTabJunk != nTab3 )
- {
- PushIllegalParameter();
- return;
- }
- }
- break;
- case svSingleRef :
- PopSingleRef( nCol3, nRow3, nTab3 );
- break;
- case svMatrix:
- pSumExtraMatrix = PopMatrix();
- //! nCol3, nRow3, nTab3 remain 0
- break;
- default:
- PushIllegalParameter();
- return ;
- }
- }
- String rString;
- double fVal = 0.0;
- sal_Bool bIsString = sal_True;
switch ( GetStackType() )
{
case svDoubleRef :
- case svSingleRef :
{
- ScAddress aAdr;
- if ( !PopDoubleRefOrSingleRef( aAdr ) )
+ SCCOL nColJunk = 0;
+ SCROW nRowJunk = 0;
+ SCTAB nTabJunk = 0;
+ PopDoubleRef( nCol3, nRow3, nTab3, nColJunk, nRowJunk, nTabJunk );
+ if ( nTabJunk != nTab3 )
{
- PushInt(0);
- return ;
- }
- ScBaseCell* pCell = GetCell( aAdr );
- switch ( GetCellType( pCell ) )
- {
- case CELLTYPE_VALUE :
- fVal = GetCellValue( aAdr, pCell );
- bIsString = sal_False;
- break;
- case CELLTYPE_FORMULA :
- if( ((ScFormulaCell*)pCell)->IsValue() )
- {
- fVal = GetCellValue( aAdr, pCell );
- bIsString = sal_False;
- }
- else
- GetCellString(rString, pCell);
- break;
- case CELLTYPE_STRING :
- case CELLTYPE_EDIT :
- GetCellString(rString, pCell);
- break;
- default:
- fVal = 0.0;
- bIsString = sal_False;
+ PushIllegalParameter();
+ return;
}
}
break;
- case svString:
- rString = GetString();
+ case svSingleRef :
+ PopSingleRef( nCol3, nRow3, nTab3 );
break;
- case svMatrix :
+ case svMatrix:
+ pSumExtraMatrix = PopMatrix();
+ //! nCol3, nRow3, nTab3 remain 0
+ break;
+ case svExternalSingleRef:
{
- ScMatValType nType = GetDoubleOrStringFromMatrix( fVal,
- rString);
- bIsString = ScMatrix::IsNonValueType( nType);
+ pSumExtraMatrix = new ScMatrix(1, 1);
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ if (!pToken)
+ {
+ PushIllegalParameter();
+ return;
+ }
+
+ if (pToken->GetType() == svDouble)
+ pSumExtraMatrix->PutDouble(pToken->GetDouble(), 0, 0);
+ else
+ pSumExtraMatrix->PutString(pToken->GetString(), 0, 0);
}
break;
+ case svExternalDoubleRef:
+ PopExternalDoubleRef(pSumExtraMatrix);
+ break;
default:
- {
- fVal = GetDouble();
- bIsString = sal_False;
- }
+ PushIllegalParameter();
+ return ;
}
+ }
- double fSum = 0.0;
- double fMem = 0.0;
- sal_Bool bNull = sal_True;
- short nParam = 1;
- size_t nRefInList = 0;
- while (nParam-- > 0)
+ String aString;
+ double fVal = 0.0;
+ bool bIsString = true;
+ switch ( GetStackType() )
+ {
+ case svDoubleRef :
+ case svSingleRef :
{
- SCCOL nCol1;
- SCROW nRow1;
- SCTAB nTab1;
- SCCOL nCol2;
- SCROW nRow2;
- SCTAB nTab2;
- ScMatrixRef pQueryMatrix;
- switch ( GetStackType() )
+ ScAddress aAdr;
+ if ( !PopDoubleRefOrSingleRef( aAdr ) )
{
- case svRefList :
- if (bSumExtraRange)
+ PushInt(0);
+ return ;
+ }
+ ScBaseCell* pCell = GetCell( aAdr );
+ switch ( GetCellType( pCell ) )
+ {
+ case CELLTYPE_VALUE :
+ fVal = GetCellValue( aAdr, pCell );
+ bIsString = false;
+ break;
+ case CELLTYPE_FORMULA :
+ if( ((ScFormulaCell*)pCell)->IsValue() )
{
- PushIllegalParameter();
- return;
+ fVal = GetCellValue( aAdr, pCell );
+ bIsString = false;
}
else
- {
- ScRange aRange;
- PopDoubleRef( aRange, nParam, nRefInList);
- aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
- }
- break;
- case svDoubleRef :
- PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+ GetCellString(aString, pCell);
break;
- case svSingleRef :
- PopSingleRef( nCol1, nRow1, nTab1 );
- nCol2 = nCol1;
- nRow2 = nRow1;
- nTab2 = nTab1;
- break;
- case svMatrix:
- {
- pQueryMatrix = PopMatrix();
- if (!pQueryMatrix)
- {
- PushIllegalParameter();
- return;
- }
- nCol1 = 0;
- nRow1 = 0;
- nTab1 = 0;
- SCSIZE nC, nR;
- pQueryMatrix->GetDimensions( nC, nR);
- nCol2 = static_cast<SCCOL>(nC - 1);
- nRow2 = static_cast<SCROW>(nR - 1);
- nTab2 = 0;
- }
+ case CELLTYPE_STRING :
+ case CELLTYPE_EDIT :
+ GetCellString(aString, pCell);
break;
default:
- PushIllegalParameter();
- return ;
+ fVal = 0.0;
+ bIsString = false;
}
- if ( nTab1 != nTab2 )
+ }
+ break;
+ case svString:
+ aString = GetString();
+ break;
+ case svMatrix :
+ case svExternalDoubleRef:
+ {
+ ScMatValType nType = GetDoubleOrStringFromMatrix(fVal, aString);
+ bIsString = ScMatrix::IsNonValueType( nType);
+ }
+ break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ if (pToken)
{
- PushIllegalArgument();
- return;
+ if (pToken->GetType() == svDouble)
+ {
+ fVal = pToken->GetDouble();
+ bIsString = false;
+ }
+ else
+ aString = pToken->GetString();
}
+ }
+ break;
+ default:
+ {
+ fVal = GetDouble();
+ bIsString = false;
+ }
+ }
- if (bSumExtraRange)
- {
- // Take the range geometry of the 1st parameter and apply it to
- // the 3rd. If parts of the resulting range would point outside
- // the sheet, don't complain but silently ignore and simply cut
- // them away, this is what Xcl does :-/
-
- // For the cut-away part we also don't need to determine the
- // criteria match, so shrink the source range accordingly,
- // instead of the result range.
- SCCOL nColDelta = nCol2 - nCol1;
- SCROW nRowDelta = nRow2 - nRow1;
- SCCOL nMaxCol;
- SCROW nMaxRow;
- if (pSumExtraMatrix)
+ double fSum = 0.0;
+ double fMem = 0.0;
+ sal_Bool bNull = true;
+ short nParam = 1;
+ size_t nRefInList = 0;
+ while (nParam-- > 0)
+ {
+ SCCOL nCol1;
+ SCROW nRow1;
+ SCTAB nTab1;
+ SCCOL nCol2;
+ SCROW nRow2;
+ SCTAB nTab2;
+ ScMatrixRef pQueryMatrix;
+ switch ( GetStackType() )
+ {
+ case svRefList :
+ if (bSumExtraRange)
{
- SCSIZE nC, nR;
- pSumExtraMatrix->GetDimensions( nC, nR);
- nMaxCol = static_cast<SCCOL>(nC - 1);
- nMaxRow = static_cast<SCROW>(nR - 1);
+ PushIllegalParameter();
+ return;
}
else
{
- nMaxCol = MAXCOL;
- nMaxRow = MAXROW;
+ ScRange aRange;
+ PopDoubleRef( aRange, nParam, nRefInList);
+ aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
}
- if (nCol3 + nColDelta > nMaxCol)
+ break;
+ case svDoubleRef :
+ PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+ break;
+ case svSingleRef :
+ PopSingleRef( nCol1, nRow1, nTab1 );
+ nCol2 = nCol1;
+ nRow2 = nRow1;
+ nTab2 = nTab1;
+ break;
+ case svMatrix:
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
+ {
+ pQueryMatrix = GetMatrix();
+ if (!pQueryMatrix)
{
- SCCOL nNewDelta = nMaxCol - nCol3;
- nCol2 = nCol1 + nNewDelta;
+ PushIllegalParameter();
+ return;
}
+ nCol1 = 0;
+ nRow1 = 0;
+ nTab1 = 0;
+ SCSIZE nC, nR;
+ pQueryMatrix->GetDimensions( nC, nR);
+ nCol2 = static_cast<SCCOL>(nC - 1);
+ nRow2 = static_cast<SCROW>(nR - 1);
+ nTab2 = 0;
+ }
+ break;
+ default:
+ PushIllegalParameter();
+ return ;
+ }
+ if ( nTab1 != nTab2 )
+ {
+ PushIllegalArgument();
+ return;
+ }
- if (nRow3 + nRowDelta > nMaxRow)
- {
- SCROW nNewDelta = nMaxRow - nRow3;
- nRow2 = nRow1 + nNewDelta;
- }
+ if (bSumExtraRange)
+ {
+ // Take the range geometry of the 1st parameter and apply it to
+ // the 3rd. If parts of the resulting range would point outside
+ // the sheet, don't complain but silently ignore and simply cut
+ // them away, this is what Xcl does :-/
+
+ // For the cut-away part we also don't need to determine the
+ // criteria match, so shrink the source range accordingly,
+ // instead of the result range.
+ SCCOL nColDelta = nCol2 - nCol1;
+ SCROW nRowDelta = nRow2 - nRow1;
+ SCCOL nMaxCol;
+ SCROW nMaxRow;
+ if (pSumExtraMatrix)
+ {
+ SCSIZE nC, nR;
+ pSumExtraMatrix->GetDimensions( nC, nR);
+ nMaxCol = static_cast<SCCOL>(nC - 1);
+ nMaxRow = static_cast<SCROW>(nR - 1);
}
else
{
- nCol3 = nCol1;
- nRow3 = nRow1;
- nTab3 = nTab1;
+ nMaxCol = MAXCOL;
+ nMaxRow = MAXROW;
+ }
+ if (nCol3 + nColDelta > nMaxCol)
+ {
+ SCCOL nNewDelta = nMaxCol - nCol3;
+ nCol2 = nCol1 + nNewDelta;
}
- if (nGlobalError == 0)
+ if (nRow3 + nRowDelta > nMaxRow)
{
- ScQueryParam rParam;
- rParam.nRow1 = nRow1;
- rParam.nRow2 = nRow2;
+ SCROW nNewDelta = nMaxRow - nRow3;
+ nRow2 = nRow1 + nNewDelta;
+ }
+ }
+ else
+ {
+ nCol3 = nCol1;
+ nRow3 = nRow1;
+ nTab3 = nTab1;
+ }
- ScQueryEntry& rEntry = rParam.GetEntry(0);
- rEntry.bDoQuery = sal_True;
- if (!bIsString)
- {
- rEntry.bQueryByString = sal_False;
- rEntry.nVal = fVal;
- rEntry.eOp = SC_EQUAL;
- }
- else
+ if (nGlobalError == 0)
+ {
+ ScQueryParam rParam;
+ rParam.nRow1 = nRow1;
+ rParam.nRow2 = nRow2;
+
+ ScQueryEntry& rEntry = rParam.GetEntry(0);
+ rEntry.bDoQuery = true;
+ if (!bIsString)
+ {
+ rEntry.bQueryByString = false;
+ rEntry.nVal = fVal;
+ rEntry.eOp = SC_EQUAL;
+ }
+ else
+ {
+ rParam.FillInExcelSyntax(aString, 0);
+ sal_uInt32 nIndex = 0;
+ rEntry.bQueryByString =
+ !(pFormatter->IsNumberFormat(
+ *rEntry.pStr, nIndex, rEntry.nVal));
+ if ( rEntry.bQueryByString )
+ rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok );
+ }
+ ScAddress aAdr;
+ aAdr.SetTab( nTab3 );
+ rParam.nCol1 = nCol1;
+ rParam.nCol2 = nCol2;
+ rEntry.nField = nCol1;
+ SCsCOL nColDiff = nCol3 - nCol1;
+ SCsROW nRowDiff = nRow3 - nRow1;
+ if (pQueryMatrix)
+ {
+ // Never case-sensitive.
+ ScCompareOptions aOptions( pDok, rEntry, rParam.bRegExp);
+ ScMatrixRef pResultMatrix = QueryMat( pQueryMatrix, aOptions);
+ if (nGlobalError || !pResultMatrix)
{
- rParam.FillInExcelSyntax(rString, 0);
- sal_uInt32 nIndex = 0;
- rEntry.bQueryByString =
- !(pFormatter->IsNumberFormat(
- *rEntry.pStr, nIndex, rEntry.nVal));
- if ( rEntry.bQueryByString )
- rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok );
+ PushIllegalParameter();
+ return;
}
- ScAddress aAdr;
- aAdr.SetTab( nTab3 );
- rParam.nCol1 = nCol1;
- rParam.nCol2 = nCol2;
- rEntry.nField = nCol1;
- SCsCOL nColDiff = nCol3 - nCol1;
- SCsROW nRowDiff = nRow3 - nRow1;
- if (pQueryMatrix)
- {
- // Never case-sensitive.
- ScCompareOptions aOptions( pDok, rEntry, rParam.bRegExp);
- ScMatrixRef pResultMatrix = QueryMat( pQueryMatrix, aOptions);
- if (nGlobalError || !pResultMatrix)
- {
- PushIllegalParameter();
- return;
- }
- if (pSumExtraMatrix)
- {
- for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
- {
- for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
- {
- if (pResultMatrix->IsValue( nCol, nRow) &&
- pResultMatrix->GetDouble( nCol, nRow))
- {
- SCSIZE nC = nCol + nColDiff;
- SCSIZE nR = nRow + nRowDiff;
- if (pSumExtraMatrix->IsValue( nC, nR))
- {
- fVal = pSumExtraMatrix->GetDouble( nC, nR);
- if ( bNull && fVal != 0.0 )
- {
- bNull = sal_False;
- fMem = fVal;
- }
- else
- fSum += fVal;
- }
- }
- }
- }
- }
- else
- {
- for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
- {
- for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
- {
- if (pResultMatrix->GetDouble( nCol, nRow))
- {
- aAdr.SetCol( nCol + nColDiff);
- aAdr.SetRow( nRow + nRowDiff);
- ScBaseCell* pCell = GetCell( aAdr );
- if ( HasCellValueData(pCell) )
- {
- fVal = GetCellValue( aAdr, pCell );
- if ( bNull && fVal != 0.0 )
- {
- bNull = sal_False;
- fMem = fVal;
- }
- else
- fSum += fVal;
- }
- }
- }
- }
- }
- }
- else
+ if (pSumExtraMatrix)
{
- ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False);
- // Increment Entry.nField in iterator when switching to next column.
- aCellIter.SetAdvanceQueryParamEntryField( sal_True );
- if ( aCellIter.GetFirst() )
+ for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
{
- if (pSumExtraMatrix)
+ for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
{
- do
+ if (pResultMatrix->IsValue( nCol, nRow) &&
+ pResultMatrix->GetDouble( nCol, nRow))
{
- SCSIZE nC = aCellIter.GetCol() + nColDiff;
- SCSIZE nR = aCellIter.GetRow() + nRowDiff;
+ SCSIZE nC = nCol + nColDiff;
+ SCSIZE nR = nRow + nRowDiff;
if (pSumExtraMatrix->IsValue( nC, nR))
{
fVal = pSumExtraMatrix->GetDouble( nC, nR);
if ( bNull && fVal != 0.0 )
{
- bNull = sal_False;
+ bNull = false;
fMem = fVal;
}
else
fSum += fVal;
}
- } while ( aCellIter.GetNext() );
+ }
}
- else
+ }
+ }
+ else
+ {
+ for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
+ {
+ for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
{
- do
+ if (pResultMatrix->GetDouble( nCol, nRow))
{
- aAdr.SetCol( aCellIter.GetCol() + nColDiff);
- aAdr.SetRow( aCellIter.GetRow() + nRowDiff);
+ aAdr.SetCol( nCol + nColDiff);
+ aAdr.SetRow( nRow + nRowDiff);
ScBaseCell* pCell = GetCell( aAdr );
if ( HasCellValueData(pCell) )
{
fVal = GetCellValue( aAdr, pCell );
if ( bNull && fVal != 0.0 )
{
- bNull = sal_False;
+ bNull = false;
fMem = fVal;
}
else
fSum += fVal;
}
- } while ( aCellIter.GetNext() );
+ }
}
}
}
}
else
{
- PushIllegalParameter();
- return;
+ ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false);
+ // Increment Entry.nField in iterator when switching to next column.
+ aCellIter.SetAdvanceQueryParamEntryField( true );
+ if ( aCellIter.GetFirst() )
+ {
+ if (pSumExtraMatrix)
+ {
+ do
+ {
+ SCSIZE nC = aCellIter.GetCol() + nColDiff;
+ SCSIZE nR = aCellIter.GetRow() + nRowDiff;
+ if (pSumExtraMatrix->IsValue( nC, nR))
+ {
+ fVal = pSumExtraMatrix->GetDouble( nC, nR);
+ if ( bNull && fVal != 0.0 )
+ {
+ bNull = false;
+ fMem = fVal;
+ }
+ else
+ fSum += fVal;
+ }
+ } while ( aCellIter.GetNext() );
+ }
+ else
+ {
+ do
+ {
+ aAdr.SetCol( aCellIter.GetCol() + nColDiff);
+ aAdr.SetRow( aCellIter.GetRow() + nRowDiff);
+ ScBaseCell* pCell = GetCell( aAdr );
+ if ( HasCellValueData(pCell) )
+ {
+ fVal = GetCellValue( aAdr, pCell );
+ if ( bNull && fVal != 0.0 )
+ {
+ bNull = false;
+ fMem = fVal;
+ }
+ else
+ fSum += fVal;
+ }
+ } while ( aCellIter.GetNext() );
+ }
+ }
}
}
- PushDouble( ::rtl::math::approxAdd( fSum, fMem ) );
+ else
+ {
+ PushIllegalParameter();
+ return;
+ }
}
+ PushDouble( ::rtl::math::approxAdd( fSum, fMem ) );
}
@@ -4967,8 +5195,10 @@ void ScInterpreter::ScLookup()
}
break;
case svMatrix:
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- pResMat = PopMatrix();
+ pResMat = GetMatrix();
if (!pResMat)
{
PushIllegalParameter();
@@ -5025,8 +5255,10 @@ void ScInterpreter::ScLookup()
}
break;
case svMatrix:
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- pDataMat = PopMatrix();
+ pDataMat = GetMatrix();
if (!pDataMat)
{
PushIllegalParameter();
@@ -5119,10 +5351,10 @@ void ScInterpreter::ScLookup()
if (pResMat)
{
- if (pResMat->IsValue( 0 ))
- PushDouble(pResMat->GetDouble( 0 ));
+ if (pResMat->IsValue( 0, 0 ))
+ PushDouble(pResMat->GetDouble( 0, 0 ));
else
- PushString(pResMat->GetString( 0 ));
+ PushString(pResMat->GetString( 0, 0 ));
}
else if (nParamCount == 3)
{
@@ -5199,6 +5431,8 @@ void ScInterpreter::ScLookup()
pDataMat2 = pTempMat;
}
+ VectorMatrixAccessor aMatAcc2(*pDataMat2, bVertical);
+
// binary search for non-equality mode (the source data is
// assumed to be sorted in ascending order).
@@ -5208,11 +5442,11 @@ void ScInterpreter::ScLookup()
for (SCSIZE nLen = nLast-nFirst; nLen > 0; nLen = nLast-nFirst)
{
SCSIZE nMid = nFirst + nLen/2;
- sal_Int32 nCmp = lcl_CompareMatrix2Query( nMid, *pDataMat2, rEntry);
+ sal_Int32 nCmp = lcl_CompareMatrix2Query( nMid, aMatAcc2, rEntry);
if (nCmp == 0)
{
// exact match. find the last item with the same value.
- lcl_GetLastMatch( nMid, *pDataMat2, nLenMajor, false);
+ lcl_GetLastMatch( nMid, aMatAcc2, nLenMajor, false);
nDelta = nMid;
bFound = true;
break;
@@ -5234,7 +5468,7 @@ void ScInterpreter::ScLookup()
if (nDelta == static_cast<SCCOLROW>(nLenMajor-2)) // last item
{
- sal_Int32 nCmp = lcl_CompareMatrix2Query(nDelta+1, *pDataMat2, rEntry);
+ sal_Int32 nCmp = lcl_CompareMatrix2Query(nDelta+1, aMatAcc2, rEntry);
if (nCmp <= 0)
{
// either the last item is an exact match or the real
@@ -5255,11 +5489,12 @@ void ScInterpreter::ScLookup()
if (bFound)
{
+ VectorMatrixAccessor aMatAcc(*pDataMat, bVertical);
SCCOLROW i = nDelta;
- SCSIZE n = pDataMat->GetElementCount();
+ SCSIZE n = aMatAcc.GetElementCount();
if (static_cast<SCSIZE>(i) >= n)
i = static_cast<SCCOLROW>(n);
- if (bool(rEntry.bQueryByString) == bool(pDataMat->IsValue(i)))
+ if (static_cast<bool>(rEntry.bQueryByString) == aMatAcc.IsValue(i))
bFound = false;
}
@@ -5273,16 +5508,17 @@ void ScInterpreter::ScLookup()
if (pResMat)
{
+ VectorMatrixAccessor aResMatAcc(*pResMat, bVertical);
// result array is matrix.
- if (static_cast<SCSIZE>(nDelta) >= pResMat->GetElementCount())
+ if (static_cast<SCSIZE>(nDelta) >= aResMatAcc.GetElementCount())
{
PushNA();
return;
}
- if (pResMat->IsValue(nDelta))
- PushDouble(pResMat->GetDouble(nDelta));
+ if (aResMatAcc.IsValue(nDelta))
+ PushDouble(aResMatAcc.GetDouble(nDelta));
else
- PushString(pResMat->GetString(nDelta));
+ PushString(aResMatAcc.GetString(nDelta));
}
else if (nParamCount == 3)
{
@@ -5351,7 +5587,7 @@ void ScInterpreter::ScLookup()
if ( rEntry.bQueryByString )
aParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok );
- ScQueryCellIterator aCellIter(pDok, nTab1, aParam, sal_False);
+ ScQueryCellIterator aCellIter(pDok, nTab1, aParam, false);
SCCOL nC;
SCROW nR;
// Advance Entry.nField in iterator upon switching columns if
@@ -5367,11 +5603,12 @@ void ScInterpreter::ScLookup()
if (pResMat)
{
+ VectorMatrixAccessor aResMatAcc(*pResMat, bVertical);
// Use the matrix result array.
- if (pResMat->IsValue(nDelta))
- PushDouble(pResMat->GetDouble(nDelta));
+ if (aResMatAcc.IsValue(nDelta))
+ PushDouble(aResMatAcc.GetDouble(nDelta));
else
- PushString(pResMat->GetString(nDelta));
+ PushString(aResMatAcc.GetString(nDelta));
}
else if (nParamCount == 3)
{
@@ -5498,7 +5735,8 @@ void ScInterpreter::CalculateLookup(sal_Bool HLookup)
SCCOL nCol2 = 0;
SCROW nRow2 = 0;
SCTAB nTab2;
- if (GetStackType() == svDoubleRef)
+ StackVar eType = GetStackType();
+ if (eType == svDoubleRef)
{
PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
if (nTab1 != nTab2)
@@ -5507,9 +5745,10 @@ void ScInterpreter::CalculateLookup(sal_Bool HLookup)
return;
}
}
- else if (GetStackType() == svMatrix)
+ else if (eType == svMatrix || eType == svExternalDoubleRef || eType == svExternalSingleRef)
{
- pMat = PopMatrix();
+ pMat = GetMatrix();
+
if (pMat)
pMat->GetDimensions(nC, nR);
else
@@ -5546,7 +5785,7 @@ void ScInterpreter::CalculateLookup(sal_Bool HLookup)
{
rParam.nCol2 = nCol2;
rParam.nRow2 = nRow1; // nur in der ersten Zeile suchen
- rParam.bByRow = sal_False;
+ rParam.bByRow = false;
} // if ( HLookup )
else
{
@@ -5659,14 +5898,14 @@ void ScInterpreter::CalculateLookup(sal_Bool HLookup)
else
{
rEntry.nField = nCol1;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nCol = 0;
SCROW nRow = 0;
if ( bSorted )
rEntry.eOp = SC_LESS_EQUAL;
if ( HLookup )
{
- ScQueryCellIterator aCellIter(pDok, nTab1, rParam, sal_False);
+ ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false);
// advance Entry.nField in Iterator upon switching columns
aCellIter.SetAdvanceQueryParamEntryField( sal_True );
if ( bSorted )
@@ -5709,7 +5948,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
{
case svDouble:
{
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = GetDouble();
}
break;
@@ -5732,14 +5971,14 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
ScBaseCell* pCell = GetCell( aAdr );
if (HasCellValueData(pCell))
{
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = GetCellValue( aAdr, pCell );
}
else
{
if ( GetCellType( pCell ) == CELLTYPE_NOTE )
{
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
rEntry.nVal = 0.0;
}
else
@@ -5769,7 +6008,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
void ScInterpreter::ScVLookup()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScVLookup" );
- CalculateLookup(sal_False);
+ CalculateLookup(false);
}
void ScInterpreter::ScSubTotal()
@@ -5803,7 +6042,7 @@ void ScInterpreter::ScSubTotal()
case SUBTOTAL_FUNC_VARP : ScVarP(); break;
default : PushIllegalArgument(); break;
}
- glSubTotal = sal_False;
+ glSubTotal = false;
}
// Get rid of the 1st (fished) parameter.
double nVal = GetDouble();
@@ -5815,16 +6054,16 @@ void ScInterpreter::ScSubTotal()
ScDBQueryParamBase* ScInterpreter::GetDBParams( sal_Bool& rMissingField )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetDBParams" );
- sal_Bool bAllowMissingField = sal_False;
+ sal_Bool bAllowMissingField = false;
if ( rMissingField )
{
bAllowMissingField = sal_True;
- rMissingField = sal_False;
+ rMissingField = false;
}
if ( GetByte() == 3 )
{
// First, get the query criteria range.
- ::std::auto_ptr<ScDBRangeBase> pQueryRef( PopDoubleRef() );
+ ::std::auto_ptr<ScDBRangeBase> pQueryRef( PopDBDoubleRef() );
if (!pQueryRef.get())
return NULL;
@@ -5832,7 +6071,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( sal_Bool& rMissingField )
double nVal = 0.0;
String aStr;
ScRange aMissingRange;
- sal_Bool bRangeFake = sal_False;
+ sal_Bool bRangeFake = false;
switch (GetStackType())
{
case svDouble :
@@ -5841,7 +6080,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( sal_Bool& rMissingField )
rMissingField = sal_True; // fake missing parameter
break;
case svString :
- bByVal = sal_False;
+ bByVal = false;
aStr = GetString();
break;
case svSingleRef :
@@ -5853,7 +6092,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( sal_Bool& rMissingField )
nVal = GetCellValue( aAdr, pCell );
else
{
- bByVal = sal_False;
+ bByVal = false;
GetCellString(aStr, pCell);
}
}
@@ -5882,7 +6121,7 @@ ScDBQueryParamBase* ScInterpreter::GetDBParams( sal_Bool& rMissingField )
SetError( errIllegalParameter );
}
- auto_ptr<ScDBRangeBase> pDBRef( PopDoubleRef() );
+ auto_ptr<ScDBRangeBase> pDBRef( PopDBDoubleRef() );
if (nGlobalError || !pDBRef.get())
return NULL;
@@ -5954,10 +6193,15 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc )
double fMem = 0.0;
sal_Bool bNull = sal_True;
sal_uLong nCount = 0;
- sal_Bool bMissingField = sal_False;
+ sal_Bool bMissingField = false;
auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) );
if (pQueryParam.get())
{
+ if (!pQueryParam->IsValidFieldIndex())
+ {
+ SetError(errNoValue);
+ return;
+ }
ScDBQueryDataIterator aValIter(pDok, pQueryParam.release());
ScDBQueryDataIterator::Value aValue;
if ( aValIter.GetFirst(aValue) && !aValue.mnError )
@@ -5978,7 +6222,7 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc )
case ifSUM:
if ( bNull && aValue.mfValue != 0.0 )
{
- bNull = sal_False;
+ bNull = false;
fMem = aValue.mfValue;
}
else
@@ -6034,6 +6278,7 @@ void ScInterpreter::ScDBCount()
// return empty cells, which would mean to adapt all callers of
// iterators.
ScDBQueryParamInternal* p = static_cast<ScDBQueryParamInternal*>(pQueryParam.get());
+ p->nCol2 = p->nCol1; // Don't forget to select only one column.
SCTAB nTab = p->nTab;
// ScQueryCellIterator doesn't make use of ScDBQueryParamBase::mnField,
// so the source range has to be restricted, like before the introduction
@@ -6050,6 +6295,11 @@ void ScInterpreter::ScDBCount()
}
else
{ // count only matching records with a value in the "result" field
+ if (!pQueryParam->IsValidFieldIndex())
+ {
+ SetError(errNoValue);
+ return;
+ }
ScDBQueryDataIterator aValIter( pDok, pQueryParam.release());
ScDBQueryDataIterator::Value aValue;
if ( aValIter.GetFirst(aValue) && !aValue.mnError )
@@ -6076,6 +6326,11 @@ void ScInterpreter::ScDBCount2()
auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) );
if (pQueryParam.get())
{
+ if (!pQueryParam->IsValidFieldIndex())
+ {
+ SetError(errNoValue);
+ return;
+ }
sal_uLong nCount = 0;
pQueryParam->mbSkipString = false;
ScDBQueryDataIterator aValIter( pDok, pQueryParam.release());
@@ -6133,10 +6388,15 @@ void ScInterpreter::GetDBStVarParams( double& rVal, double& rValCount )
rValCount = 0.0;
double fSum = 0.0;
- sal_Bool bMissingField = sal_False;
+ sal_Bool bMissingField = false;
auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) );
if (pQueryParam.get())
{
+ if (!pQueryParam->IsValidFieldIndex())
+ {
+ SetError(errNoValue);
+ return;
+ }
ScDBQueryDataIterator aValIter(pDok, pQueryParam.release());
ScDBQueryDataIterator::Value aValue;
if (aValIter.GetFirst(aValue) && !aValue.mnError)
@@ -6270,15 +6530,10 @@ void ScInterpreter::ScIndirect()
{
if (aExtInfo.mbExternal)
{
- /* TODO: future versions should implement a proper subroutine
- * token. This procedure here is a minimally invasive fix for
- * #i101645# in OOo3.1.1 */
- // Push a subroutine on the instruction code stack that
- // resolves the external reference as the next instruction.
- aCode.Push( lcl_CreateExternalRefTokenArray( aPos, pDok,
- aExtInfo, aRefAd, &aRefAd2));
- // Signal subroutine call to interpreter.
- PushTempToken( new FormulaUnknownToken( ocCall));
+ PushExternalDoubleRef(
+ aExtInfo.mnFileId, aExtInfo.maTabName,
+ aRefAd.Col(), aRefAd.Row(), aRefAd.Tab(),
+ aRefAd2.Col(), aRefAd2.Row(), aRefAd2.Tab());
}
else
PushDoubleRef( aRefAd.Col(), aRefAd.Row(), aRefAd.Tab(),
@@ -6290,15 +6545,8 @@ void ScInterpreter::ScIndirect()
{
if (aExtInfo.mbExternal)
{
- /* TODO: future versions should implement a proper subroutine
- * token. This procedure here is a minimally invasive fix for
- * #i101645# in OOo3.1.1 */
- // Push a subroutine on the instruction code stack that
- // resolves the external reference as the next instruction.
- aCode.Push( lcl_CreateExternalRefTokenArray( aPos, pDok,
- aExtInfo, aRefAd, NULL));
- // Signal subroutine call to interpreter.
- PushTempToken( new FormulaUnknownToken( ocCall));
+ PushExternalSingleRef(
+ aExtInfo.mnFileId, aExtInfo.maTabName, aRefAd.Col(), aRefAd.Row(), aRefAd.Tab());
}
else
PushSingleRef( aRefAd.Col(), aRefAd.Row(), aRefAd.Tab() );
@@ -6311,29 +6559,19 @@ void ScInterpreter::ScIndirect()
if (!pNames)
break;
- sal_uInt16 nPos = 0;
- if (!pNames->SearchName( sRefStr, nPos))
- break;
-
- ScRangeData* rData = (*pNames)[nPos];
- if (!rData)
+ ScRangeData* pData = pNames->findByName(sRefStr);
+ if (!pData)
break;
// We need this in order to obtain a good range.
- rData->ValidateTabRefs();
+ pData->ValidateTabRefs();
ScRange aRange;
-#if 0
- // This is some really odd Excel behavior and renders named
- // ranges containing relative references totally useless.
- if (!rData->IsReference(aRange, ScAddress( aPos.Tab(), 0, 0)))
- break;
-#else
+
// This is the usual way to treat named ranges containing
// relative references.
- if (!rData->IsReference( aRange, aPos))
+ if (!pData->IsReference( aRange, aPos))
break;
-#endif
if (aRange.aStart == aRange.aEnd)
PushSingleRef( aRange.aStart.Col(), aRange.aStart.Row(),
@@ -6482,6 +6720,43 @@ void ScInterpreter::ScOffset()
PushDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab1);
}
}
+ else if (GetStackType() == svExternalSingleRef)
+ {
+ sal_uInt16 nFileId;
+ String aTabName;
+ ScSingleRefData aRef;
+ PopExternalSingleRef(nFileId, aTabName, aRef);
+ aRef.CalcAbsIfRel(aPos);
+ nCol1 = aRef.nCol;
+ nRow1 = aRef.nRow;
+ nTab1 = aRef.nTab;
+
+ if (nParamCount == 3 || (nColNew < 0 && nRowNew < 0))
+ {
+ nCol1 = (SCCOL)((long) nCol1 + nColPlus);
+ nRow1 = (SCROW)((long) nRow1 + nRowPlus);
+ if (!ValidCol(nCol1) || !ValidRow(nRow1))
+ PushIllegalArgument();
+ else
+ PushExternalSingleRef(nFileId, aTabName, nCol1, nRow1, nTab1);
+ }
+ else
+ {
+ if (nColNew < 0)
+ nColNew = 1;
+ if (nRowNew < 0)
+ nRowNew = 1;
+ nCol1 = (SCCOL)((long)nCol1+nColPlus); // ! nCol1 wird veraendert!
+ nRow1 = (SCROW)((long)nRow1+nRowPlus);
+ nCol2 = (SCCOL)((long)nCol1+nColNew-1);
+ nTab2 = nTab1;
+ if (!ValidCol(nCol1) || !ValidRow(nRow1) ||
+ !ValidCol(nCol2) || !ValidRow(nRow2))
+ PushIllegalArgument();
+ else
+ PushExternalDoubleRef(nFileId, aTabName, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
+ }
+ }
else if (GetStackType() == svDoubleRef)
{
PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
@@ -6499,6 +6774,33 @@ void ScInterpreter::ScOffset()
else
PushDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab1);
}
+ else if (GetStackType() == svExternalDoubleRef)
+ {
+ sal_uInt16 nFileId;
+ String aTabName;
+ ScComplexRefData aRef;
+ PopExternalDoubleRef(nFileId, aTabName, aRef);
+ aRef.CalcAbsIfRel(aPos);
+ nCol1 = aRef.Ref1.nCol;
+ nRow1 = aRef.Ref1.nRow;
+ nTab1 = aRef.Ref1.nTab;
+ nCol2 = aRef.Ref2.nCol;
+ nRow2 = aRef.Ref2.nRow;
+ nTab2 = aRef.Ref2.nTab;
+ if (nColNew < 0)
+ nColNew = nCol2 - nCol1 + 1;
+ if (nRowNew < 0)
+ nRowNew = nRow2 - nRow1 + 1;
+ nCol1 = (SCCOL)((long)nCol1+nColPlus);
+ nRow1 = (SCROW)((long)nRow1+nRowPlus);
+ nCol2 = (SCCOL)((long)nCol1+nColNew-1);
+ nRow2 = (SCROW)((long)nRow1+nRowNew-1);
+ if (!ValidCol(nCol1) || !ValidRow(nRow1) ||
+ !ValidCol(nCol2) || !ValidRow(nRow2) || nTab1 != nTab2)
+ PushIllegalArgument();
+ else
+ PushExternalDoubleRef(nFileId, aTabName, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
+ }
else
PushIllegalParameter();
}
@@ -6544,6 +6846,8 @@ void ScInterpreter::ScIndex()
switch (GetStackType())
{
case svMatrix:
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
if (nArea != 1)
SetError(errIllegalArgument);
@@ -6645,7 +6949,7 @@ void ScInterpreter::ScIndex()
SCCOL nCol2 = 0;
SCROW nRow2 = 0;
SCTAB nTab2 = 0;
- sal_Bool bRowArray = sal_False;
+ sal_Bool bRowArray = false;
if (GetStackType() == svRefList)
{
FormulaTokenRef xRef = PopToken();
@@ -6806,7 +7110,7 @@ void ScInterpreter::ScCurrency()
nIndex,
ScGlobal::eLnge,
sal_True, // mit Tausenderpunkt
- sal_False, // nicht rot
+ false, // nicht rot
(sal_uInt16) fDec,// Nachkommastellen
1); // 1 Vorkommanull
if (!pFormatter->GetPreviewString(sFormatString,
@@ -6900,7 +7204,7 @@ void ScInterpreter::ScFixed()
nIndex,
ScGlobal::eLnge,
bThousand, // mit Tausenderpunkt
- sal_False, // nicht rot
+ false, // nicht rot
(sal_uInt16) fDec,// Nachkommastellen
1); // 1 Vorkommanull
if (!pFormatter->GetPreviewString(sFormatString,
@@ -7012,10 +7316,10 @@ void ScInterpreter::ScRight()
void ScInterpreter::ScSearch()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSearch" );
- double fAnz;
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 2, 3 ) )
{
+ double fAnz;
if (nParamCount == 3)
{
fAnz = ::rtl::math::approxFloor(GetDouble());
@@ -7038,7 +7342,7 @@ void ScInterpreter::ScSearch()
utl::SearchParam::SearchType eSearchType =
(MayBeRegExp( SearchStr, pDok ) ?
utl::SearchParam::SRCH_REGEXP : utl::SearchParam::SRCH_NORMAL);
- utl::SearchParam sPar(SearchStr, eSearchType, sal_False, sal_False, sal_False);
+ utl::SearchParam sPar(SearchStr, eSearchType, false, false, false);
utl::TextSearch sT( sPar, *ScGlobal::pCharClass );
int nBool = sT.SearchFrwrd(sStr, &nPos, &nEndPos);
if (!nBool)
@@ -7088,7 +7392,7 @@ void ScInterpreter::ScText()
FormulaTokenRef xTok( PopToken());
if (!nGlobalError)
{
- PushTempToken( xTok);
+ PushTempToken( xTok.get());
// Temporarily override the ConvertStringToValue()
// error for GetCellValue() / GetCellValueOrZero()
sal_uInt16 nSErr = mnStringNoValueError;
@@ -7099,7 +7403,7 @@ void ScInterpreter::ScText()
{
// Not numeric.
nGlobalError = 0;
- PushTempToken( xTok);
+ PushTempToken( xTok.get());
aStr = GetString();
bString = true;
}
@@ -7329,9 +7633,9 @@ sal_Bool ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::MayBeRegExp" );
if ( pDoc && !pDoc->GetDocOptions().IsFormulaRegexEnabled() )
- return sal_False;
+ return false;
if ( !rStr.Len() || (rStr.Len() == 1 && rStr.GetChar(0) != '.') )
- return sal_False; // einzelnes Metazeichen kann keine RegExp sein
+ return false; // einzelnes Metazeichen kann keine RegExp sein
static const sal_Unicode cre[] = { '.','*','+','?','[',']','^','$','\\','<','>','(',')','|', 0 };
const sal_Unicode* p1 = rStr.GetBuffer();
sal_Unicode c1;
@@ -7344,14 +7648,14 @@ sal_Bool ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc
return sal_True;
}
}
- return sal_False;
+ return false;
}
static bool lcl_LookupQuery( ScAddress & o_rResultPos, ScDocument * pDoc,
const ScQueryParam & rParam, const ScQueryEntry & rEntry )
{
bool bFound = false;
- ScQueryCellIterator aCellIter( pDoc, rParam.nTab, rParam, sal_False);
+ ScQueryCellIterator aCellIter( pDoc, rParam.nTab, rParam, false);
if (rEntry.eOp != SC_EQUAL)
{
// range lookup <= or >=
@@ -7374,26 +7678,6 @@ static bool lcl_LookupQuery( ScAddress & o_rResultPos, ScDocument * pDoc,
return bFound;
}
-#define erDEBUG_LOOKUPCACHE 0
-#if erDEBUG_LOOKUPCACHE
-#include <cstdio>
-using ::std::fprintf;
-using ::std::fflush;
-static struct LookupCacheDebugCounter
-{
- unsigned long nMiss;
- unsigned long nHit;
- LookupCacheDebugCounter() : nMiss(0), nHit(0) {}
- ~LookupCacheDebugCounter()
- {
- fprintf( stderr, "\nmiss: %lu, hit: %lu, total: %lu, hit/miss: %lu, hit/total %lu%\n",
- nMiss, nHit, nHit+nMiss, (nMiss>0 ? nHit/nMiss : 0),
- ((nHit+nMiss)>0 ? (100*nHit)/(nHit+nMiss) : 0));
- fflush( stderr);
- }
-} aLookupCacheDebugCounter;
-#endif
-
bool ScInterpreter::LookupQueryWithCache( ScAddress & o_rResultPos,
const ScQueryParam & rParam ) const
{
@@ -7416,23 +7700,11 @@ bool ScInterpreter::LookupQueryWithCache( ScAddress & o_rResultPos,
{
case ScLookupCache::NOT_CACHED :
case ScLookupCache::CRITERIA_DIFFERENT :
-#if erDEBUG_LOOKUPCACHE
- ++aLookupCacheDebugCounter.nMiss;
-#if erDEBUG_LOOKUPCACHE > 1
- fprintf( stderr, "miss %d,%d,%d\n", (int)aPos.Col(), (int)aPos.Row(), (int)aPos.Tab());
-#endif
-#endif
bFound = lcl_LookupQuery( o_rResultPos, pDok, rParam, rEntry);
if (eCacheResult == ScLookupCache::NOT_CACHED)
rCache.insert( o_rResultPos, aCriteria, aPos, bFound);
break;
case ScLookupCache::FOUND :
-#if erDEBUG_LOOKUPCACHE
- ++aLookupCacheDebugCounter.nHit;
-#if erDEBUG_LOOKUPCACHE > 1
- fprintf( stderr, "hit %d,%d,%d\n", (int)aPos.Col(), (int)aPos.Row(), (int)aPos.Tab());
-#endif
-#endif
bFound = true;
break;
case ScLookupCache::NOT_AVAILABLE :
@@ -7442,3 +7714,5 @@ bool ScInterpreter::LookupQueryWithCache( ScAddress & o_rResultPos,
}
return bFound;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index c13cb5c924c4..aa06d915cb14 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,7 @@
#include <svl/stritem.hxx>
#include <svl/zforlist.hxx>
#include <rtl/logfile.hxx>
+#include <sal/macros.h>
#include "interpre.hxx"
#include "attrib.hxx"
@@ -347,14 +349,14 @@ void ScInterpreter::ScGetDiffDate360()
if (nParamCount == 3)
bFlag = GetBool();
else
- bFlag = sal_False;
+ bFlag = false;
double nDate2 = GetDouble();
double nDate1 = GetDouble();
- double fSign;
if (nGlobalError)
PushError( nGlobalError);
else
{
+ double fSign;
// #i84934# only for non-US European algorithm swap dates. Else
// follow Excel's meaningless extrapolation for "interoperability".
if (bFlag && (nDate2 < nDate1))
@@ -499,7 +501,7 @@ void ScInterpreter::ScCeil()
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 2, 3 ) )
{
- sal_Bool bAbs = ( nParamCount == 3 ? GetBool() : sal_False );
+ sal_Bool bAbs = ( nParamCount == 3 ? GetBool() : false );
double fDec = GetDouble();
double fVal = GetDouble();
if ( fDec == 0.0 )
@@ -522,7 +524,7 @@ void ScInterpreter::ScFloor()
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 2, 3 ) )
{
- sal_Bool bAbs = ( nParamCount == 3 ? GetBool() : sal_False );
+ sal_Bool bAbs = ( nParamCount == 3 ? GetBool() : false );
double fDec = GetDouble();
double fVal = GetDouble();
if ( fDec == 0.0 )
@@ -755,12 +757,7 @@ void ScInterpreter::ScMIRR()
if( MustHaveParamCount( GetByte(), 3 ) )
{
double fRate1_reinvest = GetDouble() + 1;
- double fNPV_reinvest = 0.0;
- double fPow_reinvest = 1.0;
-
double fRate1_invest = GetDouble() + 1;
- double fNPV_invest = 0.0;
- double fPow_invest = 1.0;
ScRange aRange;
PopDoubleRef( aRange );
@@ -769,6 +766,10 @@ void ScInterpreter::ScMIRR()
PushError( nGlobalError);
else
{
+ double fNPV_reinvest = 0.0;
+ double fPow_reinvest = 1.0;
+ double fNPV_invest = 0.0;
+ double fPow_invest = 1.0;
ScValueIterator aValIter( pDok, aRange, glSubTotal );
double fCellValue;
sal_uLong nCount = 0;
@@ -978,7 +979,7 @@ double ScInterpreter::ScInterVDB(double fWert,double fRest,double fDauer,
double fTerm, fLia;
double fRestwert = fWert - fRest;
- sal_Bool bNowLia = sal_False;
+ sal_Bool bNowLia = false;
double fGda;
sal_uLong i;
@@ -1032,7 +1033,7 @@ void ScInterpreter::ScVDB()
if (nParamCount == 7)
bFlag = GetBool();
else
- bFlag = sal_False;
+ bFlag = false;
if (nParamCount >= 6)
fFaktor = GetDouble();
else
@@ -1072,7 +1073,6 @@ void ScInterpreter::ScVDB()
{
double fDauer1=fDauer;
- double fPart;
//@Die Frage aller Fragen: "Ist das hier richtig"
if(!::rtl::math::approxEqual(fAnfang,::rtl::math::approxFloor(fAnfang)))
@@ -1081,7 +1081,7 @@ void ScInterpreter::ScVDB()
{
if(fAnfang>fDauer/2 || ::rtl::math::approxEqual(fAnfang,fDauer/2))
{
- fPart=fAnfang-fDauer/2;
+ double fPart=fAnfang-fDauer/2;
fAnfang=fDauer/2;
fEnde-=fPart;
fDauer1+=1;
@@ -1388,7 +1388,7 @@ double ScInterpreter::ScGetZinsZ(double fZins, double fZr, double fZzr, double f
void ScInterpreter::ScZinsZ()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScZinsZ" );
- double nZins, nZr, nRmz, nZzr, nBw, nZw = 0, nFlag = 0;
+ double nZins, nZr, nZzr, nBw, nZw = 0, nFlag = 0;
nFuncFmtType = NUMBERFORMAT_CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 4, 6 ) )
@@ -1404,13 +1404,16 @@ void ScInterpreter::ScZinsZ()
if (nZr < 1.0 || nZr > nZzr)
PushIllegalArgument();
else
+ {
+ double nRmz;
PushDouble(ScGetZinsZ(nZins, nZr, nZzr, nBw, nZw, nFlag, nRmz));
+ }
}
void ScInterpreter::ScKapz()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScKapz" );
- double nZins, nZr, nZzr, nBw, nZw = 0, nFlag = 0, nRmz, nZinsz;
+ double nZins, nZr, nZzr, nBw, nZw = 0, nFlag = 0;
nFuncFmtType = NUMBERFORMAT_CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 4, 6 ) )
@@ -1427,7 +1430,8 @@ void ScInterpreter::ScKapz()
PushIllegalArgument();
else
{
- nZinsz = ScGetZinsZ(nZins, nZr, nZzr, nBw, nZw, nFlag, nRmz);
+ double nRmz;
+ double nZinsz = ScGetZinsZ(nZins, nZr, nZzr, nBw, nZw, nFlag, nRmz);
PushDouble(nRmz - nZinsz);
}
}
@@ -1438,7 +1442,7 @@ void ScInterpreter::ScKumZinsZ()
nFuncFmtType = NUMBERFORMAT_CURRENCY;
if ( MustHaveParamCount( GetByte(), 6 ) )
{
- double fZins, fZzr, fBw, fAnfang, fEnde, fF, fRmz, fZinsZ;
+ double fZins, fZzr, fBw, fAnfang, fEnde, fF;
fF = GetDouble();
fEnde = ::rtl::math::approxFloor(GetDouble());
fAnfang = ::rtl::math::approxFloor(GetDouble());
@@ -1452,8 +1456,8 @@ void ScInterpreter::ScKumZinsZ()
{
sal_uLong nAnfang = (sal_uLong) fAnfang;
sal_uLong nEnde = (sal_uLong) fEnde ;
- fRmz = ScGetRmz(fZins, fZzr, fBw, 0.0, fF);
- fZinsZ = 0.0;
+ double fRmz = ScGetRmz(fZins, fZzr, fBw, 0.0, fF);
+ double fZinsZ = 0.0;
if (nAnfang == 1)
{
if (fF <= 0.0)
@@ -1479,7 +1483,7 @@ void ScInterpreter::ScKumKapZ()
nFuncFmtType = NUMBERFORMAT_CURRENCY;
if ( MustHaveParamCount( GetByte(), 6 ) )
{
- double fZins, fZzr, fBw, fAnfang, fEnde, fF, fRmz, fKapZ;
+ double fZins, fZzr, fBw, fAnfang, fEnde, fF;
fF = GetDouble();
fEnde = ::rtl::math::approxFloor(GetDouble());
fAnfang = ::rtl::math::approxFloor(GetDouble());
@@ -1491,8 +1495,8 @@ void ScInterpreter::ScKumKapZ()
PushIllegalArgument();
else
{
- fRmz = ScGetRmz(fZins, fZzr, fBw, 0.0, fF);
- fKapZ = 0.0;
+ double fRmz = ScGetRmz(fZins, fZzr, fBw, 0.0, fF);
+ double fKapZ = 0.0;
sal_uLong nAnfang = (sal_uLong) fAnfang;
sal_uLong nEnde = (sal_uLong) fEnde;
if (nAnfang == 1)
@@ -1594,7 +1598,7 @@ void ScInterpreter::ScBackSolver()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScBackSolver" );
if ( MustHaveParamCount( GetByte(), 3 ) )
{
- sal_Bool bDoneIteration = sal_False;
+ sal_Bool bDoneIteration = false;
ScAddress aValueAdr, aFormulaAdr;
double fTargetVal = GetDouble();
PopSingleRef( aFormulaAdr );
@@ -1651,7 +1655,7 @@ void ScInterpreter::ScBackSolver()
sal_uInt16 nIter = 0;
- sal_Bool bHorMoveError = sal_False;
+ sal_Bool bHorMoveError = false;
// Nach der Regula Falsi Methode
while ( !bDoneIteration && ( nIter++ < nMaxIter ) )
{
@@ -1673,7 +1677,7 @@ void ScInterpreter::ScBackSolver()
const double fHorStepAngle = 5.0;
const double fHorMaxAngle = 80.0;
int nHorMaxIter = static_cast<int>( fHorMaxAngle / fHorStepAngle );
- sal_Bool bDoneHorMove = sal_False;
+ sal_Bool bDoneHorMove = false;
while ( !bDoneHorMove && !bHorMoveError && nHorIter++ < nHorMaxIter )
{
@@ -1750,7 +1754,6 @@ void ScInterpreter::ScBackSolver()
// Try a nice rounded input value if possible.
const double fNiceDelta = (bDoneIteration && fabs(fBestX) >= 1e-3 ? 1e-3 : fDelta);
double nX = ::rtl::math::approxFloor((fBestX / fNiceDelta) + 0.5) * fNiceDelta;
-// double nX = ::rtl::math::approxFloor((fBestX / fDelta) + 0.5) * fDelta;
if ( bDoneIteration )
{
@@ -1885,7 +1888,7 @@ void ScInterpreter::ScIntersect()
PushTempToken( new ScDoubleRefToken( rRef));
}
else
- PushTempToken( xRes);
+ PushTempToken( xRes.get());
}
else
{
@@ -1956,7 +1959,7 @@ void ScInterpreter::ScRangeFunc()
if (!xRes)
PushIllegalArgument();
else
- PushTempToken( xRes);
+ PushTempToken( xRes.get());
}
@@ -2034,7 +2037,7 @@ void ScInterpreter::ScUnionFunc()
}
}
ValidateRef( *pRes); // set #REF! if needed
- PushTempToken( xRes);
+ PushTempToken( xRes.get());
}
@@ -2044,8 +2047,8 @@ void ScInterpreter::ScCurrent()
FormulaTokenRef xTok( PopToken());
if (xTok)
{
- PushTempToken( xTok);
- PushTempToken( xTok);
+ PushTempToken( xTok.get());
+ PushTempToken( xTok.get());
}
else
PushError( errUnknownStackVariable);
@@ -2210,6 +2213,7 @@ void ScInterpreter::ScDde()
PushNA();
pDok->DisableIdle( bOldDis );
+ pLinkMgr->CloseCachedComps();
}
}
@@ -2218,13 +2222,13 @@ void ScInterpreter::ScBase()
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 2, 3 ) )
{
- static const sal_Unicode __FAR_DATA pDigits[] = {
+ static const sal_Unicode pDigits[] = {
'0','1','2','3','4','5','6','7','8','9',
'A','B','C','D','E','F','G','H','I','J','K','L','M',
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
0
};
- static const int nDigits = (sizeof(pDigits)/sizeof(sal_Unicode))-1;
+ static const int nDigits = SAL_N_ELEMENTS(pDigits)-1;
xub_StrLen nMinLen;
if ( nParamCount == 3 )
{
@@ -2271,7 +2275,7 @@ void ScInterpreter::ScBase()
}
else
{
- sal_Bool bDirt = sal_False;
+ sal_Bool bDirt = false;
while ( fVal && p > pBuf )
{
//! mit fmod Rundungsfehler ab 2**48
@@ -2280,7 +2284,7 @@ void ScInterpreter::ScBase()
double fInt = ::rtl::math::approxFloor( fVal / fBase );
double fMult = fInt * fBase;
#if OSL_DEBUG_LEVEL > 1
- // #53943# =BASIS(1e308;36) => GPF mit
+ // =BASIS(1e308;36) => GPF mit
// nDig = (size_t) ::rtl::math::approxFloor( fVal - fMult );
// trotz vorheriger Pruefung ob fVal >= fMult
double fDebug1 = fVal - fMult;
@@ -2309,7 +2313,7 @@ void ScInterpreter::ScBase()
double fDig = ::rtl::math::approxFloor( ::rtl::math::approxSub( fVal, fMult ) );
if ( bDirt )
{
- bDirt = sal_False;
+ bDirt = false;
--fDig;
}
if ( fDig <= 0.0 )
@@ -2433,7 +2437,7 @@ void ScInterpreter::ScRoman()
{
static const sal_Unicode pChars[] = { 'M', 'D', 'C', 'L', 'X', 'V', 'I' };
static const sal_uInt16 pValues[] = { 1000, 500, 100, 50, 10, 5, 1 };
- static const sal_uInt16 nMaxIndex = (sal_uInt16)(sizeof(pValues) / sizeof(pValues[0]) - 1);
+ static const sal_uInt16 nMaxIndex = (sal_uInt16)(SAL_N_ELEMENTS(pValues) - 1);
String aRoman;
sal_uInt16 nVal = (sal_uInt16) fVal;
@@ -2484,13 +2488,13 @@ sal_Bool lcl_GetArabicValue( sal_Unicode cChar, sal_uInt16& rnValue, sal_Bool& r
switch( cChar )
{
case 'M': rnValue = 1000; rbIsDec = sal_True; break;
- case 'D': rnValue = 500; rbIsDec = sal_False; break;
+ case 'D': rnValue = 500; rbIsDec = false; break;
case 'C': rnValue = 100; rbIsDec = sal_True; break;
- case 'L': rnValue = 50; rbIsDec = sal_False; break;
+ case 'L': rnValue = 50; rbIsDec = false; break;
case 'X': rnValue = 10; rbIsDec = sal_True; break;
- case 'V': rnValue = 5; rbIsDec = sal_False; break;
+ case 'V': rnValue = 5; rbIsDec = false; break;
case 'I': rnValue = 1; rbIsDec = sal_True; break;
- default: return sal_False;
+ default: return false;
}
return sal_True;
}
@@ -2516,8 +2520,8 @@ void ScInterpreter::ScArabic()
{
sal_uInt16 nDigit1 = 0;
sal_uInt16 nDigit2 = 0;
- sal_Bool bIsDec1 = sal_False;
- sal_Bool bIsDec2 = sal_False;
+ sal_Bool bIsDec1 = false;
+ sal_Bool bIsDec2 = false;
bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex ), nDigit1, bIsDec1 );
if( bValid && (nCharIndex + 1 < nCharCount) )
bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex + 1 ), nDigit2, bIsDec2 );
@@ -2542,7 +2546,7 @@ void ScInterpreter::ScArabic()
nCharIndex += 2;
}
else
- bValid = sal_False;
+ bValid = false;
}
}
if( bValid )
@@ -2666,7 +2670,7 @@ sal_Bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec
{ "SKK", 30.1260, 2 }
};
- const size_t nConversionCount = sizeof( aConvertTable ) / sizeof( aConvertTable[0] );
+ const size_t nConversionCount = SAL_N_ELEMENTS(aConvertTable);
for ( size_t i = 0; i < nConversionCount; i++ )
if ( aSearchUnit.EqualsIgnoreCaseAscii( aConvertTable[i].pCurrText ) )
{
@@ -2674,7 +2678,7 @@ sal_Bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec
rnDec = aConvertTable[i].nDec;
return sal_True;
}
- return sal_False;
+ return false;
}
void ScInterpreter::ScEuroConvert()
@@ -2692,7 +2696,7 @@ void ScInterpreter::ScEuroConvert()
return;
}
}
- sal_Bool bFullPrecision = sal_False;
+ sal_Bool bFullPrecision = false;
if ( nParamCount >= 4 )
bFullPrecision = GetBool();
String aToUnit( GetString() );
@@ -2702,7 +2706,6 @@ void ScInterpreter::ScEuroConvert()
PushError( nGlobalError);
else
{
- double fRes;
double fFromRate;
double fToRate;
int nFromDec;
@@ -2711,6 +2714,7 @@ void ScInterpreter::ScEuroConvert()
if ( lclConvertMoney( aFromUnit, fFromRate, nFromDec )
&& lclConvertMoney( aToUnit, fToRate, nToDec ) )
{
+ double fRes;
if ( aFromUnit.EqualsIgnoreCaseAscii( aToUnit ) )
fRes = fVal;
else
@@ -3022,3 +3026,4 @@ failed :
PushError( errNoRef );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index dfcce4c06c3f..3eec9942195f 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,8 +57,6 @@ using namespace formula;
#define SCdEpsilon 1.0E-7
#define SC_MAX_ITERATION_COUNT 20
#define MAX_ANZ_DOUBLE_FOR_SORT 100000
-// PI jetzt als F_PI aus solar.h
-//#define PI 3.1415926535897932
const double ScInterpreter::fMaxGammaArgument = 171.624376956302; // found experimental
const double fMachEps = ::std::numeric_limits<double>::epsilon();
@@ -461,10 +460,6 @@ double ScInterpreter::Fakultaet(double x)
}
else
SetError(errNoValue);
-/* // Stirlingsche Naeherung zu ungenau
- else
- x = pow(x/exp(1), x) * sqrt(x) * SQRT_2_PI * (1.0 + 1.0 / (12.0 * x));
-*/
return x;
}
@@ -488,25 +483,11 @@ double ScInterpreter::BinomKoeff(double n, double k)
k--;
n--;
}
-/*
- double f1 = n; // Zaehler
- double f2 = k; // Nenner
- n--;
- k--;
- while (k > 0.0)
- {
- f2 *= k;
- f1 *= n;
- k--;
- n--;
- }
- nVal = f1 / f2;
-*/
+
}
return nVal;
}
-
// The algorithm is based on lanczos13m53 in lanczos.hpp
// in math library from http://www.boost.org
/** you must ensure fZ>0
@@ -547,7 +528,6 @@ double lcl_getLanczosSum(double fZ)
double fSumNum;
double fSumDenom;
int nI;
- double fZInv;
if (fZ<=1.0)
{
fSumNum = fNum[12];
@@ -563,7 +543,7 @@ double lcl_getLanczosSum(double fZ)
else
// Cancel down with fZ^12; Horner scheme with reverse coefficients
{
- fZInv = 1/fZ;
+ double fZInv = 1/fZ;
fSumNum = fNum[0];
fSumDenom = fDenom[0];
for (nI = 1; nI <=12; ++nI)
@@ -650,7 +630,6 @@ double ScInterpreter::GetGamma(double fZ)
return exp( fLogPi - fLogDivisor) * ((::rtl::math::sin( F_PI*fZ) < 0.0) ? -1.0 : 1.0);
}
-
/** You must ensure fZ>0 */
double ScInterpreter::GetLogGamma(double fZ)
{
@@ -671,48 +650,12 @@ double ScInterpreter::GetFDist(double x, double fF1, double fF2)
double alpha = fF2/2.0;
double beta = fF1/2.0;
return (GetBetaDist(arg, alpha, beta));
-/*
- double Z = (pow(fF,1.0/3.0)*(1.0-2.0/(9.0*fF2)) - (1.0-2.0/(9.0*fF1))) /
- sqrt(2.0/(9.0*fF1) + pow(fF,2.0/3.0)*2.0/(9.0*fF2));
- return (0.5-gauss(Z));
-*/
}
double ScInterpreter::GetTDist(double T, double fDF)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetTDist" );
return 0.5 * GetBetaDist(fDF/(fDF+T*T), fDF/2.0, 0.5);
-/*
- sal_uInt16 DF = (sal_uInt16) fDF;
- double A = T / sqrt(DF);
- double B = 1.0 + A*A;
- double R;
- if (DF == 1)
- R = 0.5 + atan(A)/F_PI;
- else if (DF % 2 == 0)
- {
- double S0 = A/(2.0 * sqrt(B));
- double C0 = S0;
- for (sal_uInt16 i = 2; i <= DF-2; i+=2)
- {
- C0 *= (1.0 - 1.0/(double)i)/B;
- S0 += C0;
- }
- R = 0.5 + S0;
- }
- else
- {
- double S1 = A / (B * F_PI);
- double C1 = S1;
- for (sal_uInt16 i = 3; i <= DF-2; i+=2)
- {
- C1 *= (1.0 - 1.0/(double)i)/B;
- S1 += C1;
- }
- R = 0.5 + atan(A)/F_PI + S1;
- }
- return 1.0 - R;
-*/
}
// for LEGACY.CHIDIST, returns right tail, fDF=degrees of freedom
@@ -743,7 +686,6 @@ double ScInterpreter::GetChiSqDistPDF(double fX, double fDF)
{
// you must ensure fDF is positive integer
double fValue;
- double fCount;
if (fX <= 0.0)
return 0.0; // see ODFF
if (fDF*fX > 1391000.0)
@@ -753,6 +695,7 @@ double ScInterpreter::GetChiSqDistPDF(double fX, double fDF)
}
else // fDF is small in most cases, we can iterate
{
+ double fCount;
if (fmod(fDF,2.0)<0.5)
{
// even
@@ -782,7 +725,6 @@ void ScInterpreter::ScChiSqDist()
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 2, 3 ) )
return;
- double fX;
bool bCumulative;
if (nParamCount == 3)
bCumulative = GetBool();
@@ -793,7 +735,7 @@ void ScInterpreter::ScChiSqDist()
PushIllegalArgument();
else
{
- fX = GetDouble();
+ double fX = GetDouble();
if (bCumulative)
PushDouble(GetChiSqDistCDF(fX,fDF));
else
@@ -805,12 +747,11 @@ void ScInterpreter::ScGamma()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGamma" );
double x = GetDouble();
- double fResult;
if (x <= 0.0 && x == ::rtl::math::approxFloor(x))
PushIllegalArgument();
else
{
- fResult = GetGamma(x);
+ double fResult = GetGamma(x);
if (nGlobalError)
{
PushError( nGlobalError);
@@ -820,7 +761,6 @@ void ScInterpreter::ScGamma()
}
}
-
void ScInterpreter::ScLogGamma()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLogGamma" );
@@ -962,7 +902,6 @@ double ScInterpreter::GetBetaDistPDF(double fX, double fA, double fB)
return exp((fA-1.0)*fLogX + (fB-1.0)* fLogY - fLogBeta);
}
-
/*
x^a * (1-x)^b
I_x(a,b) = ---------------- * result of ContFrac
@@ -1369,7 +1308,7 @@ void ScInterpreter::ScBinomDist()
double p = GetDouble(); // p
double n = ::rtl::math::approxFloor(GetDouble()); // n
double x = ::rtl::math::approxFloor(GetDouble()); // x
- double fFactor, q, fSum;
+ double fFactor, q;
if (n < 0.0 || x < 0.0 || x > n || p < 0.0 || p > 1.0)
PushIllegalArgument();
else if (kum == 0.0) // Dichte
@@ -1403,6 +1342,7 @@ void ScInterpreter::ScBinomDist()
PushDouble(1.0);
else
{
+ double fSum;
q = 1.0 - p;
fFactor = pow(q, n);
if (fFactor == 0.0)
@@ -2249,7 +2189,6 @@ public:
double GetValue( double x ) const { return fp - rInt.GetChiSqDistCDF(x, fDF); }
};
-
void ScInterpreter::ScChiSqInv()
{
if ( !MustHaveParamCount( GetByte(), 2 ) )
@@ -2270,7 +2209,6 @@ void ScInterpreter::ScChiSqInv()
PushDouble(fVal);
}
-
void ScInterpreter::ScConfidence()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScConfidence" );
@@ -2360,8 +2298,10 @@ void ScInterpreter::ScZTest()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nCount = pMat->GetElementCount();
@@ -2457,9 +2397,6 @@ bool ScInterpreter::CalculateTest(sal_Bool _bTemplin
}
fT = fabs(fSum1/fCount1 - fSum2/fCount2)/sqrt(fS1+fS2);
double c = fS1/(fS1+fS2);
-// s.u. fF = ::rtl::math::approxFloor(1.0/(c*c/(fCount1-1.0)+(1.0-c)*(1.0-c)/(fCount2-1.0)));
-// fF = ::rtl::math::approxFloor((fS1+fS2)*(fS1+fS2)/(fS1*fS1/(fCount1-1.0) + fS2*fS2/(fCount2-1.0)));
-
// GetTDist wird mit GetBetaDist berechnet und kommt auch mit nicht ganzzahligen
// Freiheitsgraden klar. Dann stimmt das Ergebnis auch mit Excel ueberein (#52406#):
fF = 1.0/(c*c/(fCount1-1.0)+(1.0-c)*(1.0-c)/(fCount2-1.0));
@@ -2538,7 +2475,7 @@ void ScInterpreter::ScTTest()
}
else if (fTyp == 2.0)
{
- CalculateTest(sal_False,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF);
+ CalculateTest(false,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF);
}
else if (fTyp == 3.0)
{
@@ -2628,11 +2565,6 @@ void ScInterpreter::ScFTest()
fF2 = fCount1-1.0;
}
PushDouble(2.0*GetFDist(fF, fF1, fF2));
-/*
- double Z = (pow(fF,1.0/3.0)*(1.0-2.0/(9.0*fF2)) - (1.0-2.0/(9.0*fF1))) /
- sqrt(2.0/(9.0*fF1) + pow(fF,2.0/3.0)*2.0/(9.0*fF2));
- PushDouble(1.0-2.0*gauss(Z));
-*/
}
void ScInterpreter::ScChiTest()
@@ -2687,25 +2619,6 @@ void ScInterpreter::ScChiTest()
else
fDF = (double)(nC1-1)*(double)(nR1-1);
PushDouble(GetChiDist(fChi, fDF));
-/*
- double fX, fS, fT, fG;
- fX = 1.0;
- for (double fi = fDF; fi >= 2.0; fi -= 2.0)
- fX *= fChi/fi;
- fX *= exp(-fChi/2.0);
- if (fmod(fDF, 2.0) != 0.0)
- fX *= sqrt(2.0*fChi/F_PI);
- fS = 1.0;
- fT = 1.0;
- fG = fDF;
- while (fT >= 1.0E-7)
- {
- fG += 2.0;
- fT *= fChi/fG;
- fS += fT;
- }
- PushDouble(1.0 - fX*fS);
-*/
}
void ScInterpreter::ScKurt()
@@ -2824,8 +2737,10 @@ void ScInterpreter::ScHarMean()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nCount = pMat->GetElementCount();
@@ -2945,8 +2860,10 @@ void ScInterpreter::ScGeoMean()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nCount = pMat->GetElementCount();
@@ -3069,8 +2986,10 @@ bool ScInterpreter::CalculateSkew(double& fSum,double& fCount,double& vSum,std::
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nCount = pMat->GetElementCount();
@@ -3306,7 +3225,6 @@ void ScInterpreter::CalculateSmallLarge(sal_Bool bSmall)
* actually are defined to return an array of values if an array of
* positions was passed, in which case, depending on the number of values,
* we may or will need a real sorted array again, see #i32345. */
- //GetSortArray(1, aSortArray);
GetNumberSequenceArray(1, aSortArray);
SCSIZE nSize = aSortArray.size();
if (aSortArray.empty() || nSize == 0 || nGlobalError || nSize < k)
@@ -3323,7 +3241,7 @@ void ScInterpreter::CalculateSmallLarge(sal_Bool bSmall)
void ScInterpreter::ScLarge()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScLarge" );
- CalculateSmallLarge(sal_False);
+ CalculateSmallLarge(false);
}
void ScInterpreter::ScSmall()
@@ -3338,22 +3256,7 @@ void ScInterpreter::ScPercentrank()
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 2 ) )
return;
-#if 0
-/* wird nicht unterstuetzt
- double fPrec;
- if (nParamCount == 3)
- {
- fPrec = ::rtl::math::approxFloor(GetDouble());
- if (fPrec < 1.0)
- {
- PushIllegalArgument();
- return;
- }
- }
- else
- fPrec = 3.0;
-*/
-#endif
+
double fNum = GetDouble();
vector<double> aSortArray;
GetSortArray(1, aSortArray);
@@ -3386,13 +3289,13 @@ void ScInterpreter::ScPercentrank()
fRes = (double)nOldCount/(double)(nSize-1);
else
{
- // #75312# nOldCount is the count of smaller entries
+ // nOldCount is the count of smaller entries
// fNum is between pSortArray[nOldCount-1] and pSortArray[nOldCount]
// use linear interpolation to find a position between the entries
if ( nOldCount == 0 )
{
- DBG_ERROR("should not happen");
+ OSL_FAIL("should not happen");
fRes = 0.0;
}
else
@@ -3485,8 +3388,10 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (!pMat)
break;
@@ -3621,9 +3526,9 @@ void ScInterpreter::ScRank()
if (nParamCount == 3)
bDescending = GetBool();
else
- bDescending = sal_False;
+ bDescending = false;
double fCount = 1.0;
- sal_Bool bValid = sal_False;
+ sal_Bool bValid = false;
switch (GetStackType())
{
case formula::svDouble :
@@ -3689,8 +3594,10 @@ void ScInterpreter::ScRank()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
double fVal = GetDouble();
if (pMat)
{
@@ -3786,8 +3693,10 @@ void ScInterpreter::ScAveDev()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nCount = pMat->GetElementCount();
@@ -3857,8 +3766,10 @@ void ScInterpreter::ScAveDev()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nCount = pMat->GetElementCount();
@@ -3930,26 +3841,28 @@ void ScInterpreter::ScProbability()
{
double fSum = 0.0;
double fRes = 0.0;
- sal_Bool bStop = sal_False;
+ sal_Bool bStop = false;
double fP, fW;
- SCSIZE nCount1 = nC1 * nR1;
- for ( SCSIZE i = 0; i < nCount1 && !bStop; i++ )
+ for ( SCSIZE i = 0; i < nC1 && !bStop; i++ )
{
- if (pMatP->IsValue(i) && pMatW->IsValue(i))
+ for (SCSIZE j = 0; j < nR1 && !bStop; ++j )
{
- fP = pMatP->GetDouble(i);
- fW = pMatW->GetDouble(i);
- if (fP < 0.0 || fP > 1.0)
- bStop = sal_True;
- else
+ if (pMatP->IsValue(i,j) && pMatW->IsValue(i,j))
{
- fSum += fP;
- if (fW >= fLo && fW <= fUp)
- fRes += fP;
+ fP = pMatP->GetDouble(i,j);
+ fW = pMatW->GetDouble(i,j);
+ if (fP < 0.0 || fP > 1.0)
+ bStop = true;
+ else
+ {
+ fSum += fP;
+ if (fW >= fLo && fW <= fUp)
+ fRes += fP;
+ }
}
+ else
+ SetError( errIllegalArgument);
}
- else
- SetError( errIllegalArgument);
}
if (bStop || fabs(fSum -1.0) > 1.0E-7)
PushNoValue();
@@ -3969,13 +3882,13 @@ void ScInterpreter::ScCorrel()
void ScInterpreter::ScCovar()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScCovar" );
- CalculatePearsonCovar(sal_False,sal_False);
+ CalculatePearsonCovar(false,false);
}
void ScInterpreter::ScPearson()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScPearson" );
- CalculatePearsonCovar(sal_True,sal_False);
+ CalculatePearsonCovar(sal_True,false);
}
void ScInterpreter::CalculatePearsonCovar(sal_Bool _bPearson,sal_Bool _bStexy)
{
@@ -4088,7 +4001,7 @@ void ScInterpreter::ScRSQ()
void ScInterpreter::ScSTEXY()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSTEXY" );
- CalculatePearsonCovar(sal_True,sal_True);
+ CalculatePearsonCovar(true,true);
}
void ScInterpreter::CalculateSlopeIntercept(sal_Bool bSlope)
{
@@ -4171,7 +4084,7 @@ void ScInterpreter::ScSlope()
void ScInterpreter::ScIntercept()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIntercept" );
- CalculateSlopeIntercept(sal_False);
+ CalculateSlopeIntercept(false);
}
void ScInterpreter::ScForecast()
@@ -4242,3 +4155,4 @@ void ScInterpreter::ScForecast()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7a4ac7ecdac8..17d789b0eb56 100755
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,10 +34,14 @@
#include <sfx2/app.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/docfilt.hxx>
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbstar.hxx>
#include <basic/sbx.hxx>
+#include <basic/sbxobj.hxx>
+#include <basic/sbuno.hxx>
+#include <svl/zforlist.hxx>
#include <svl/zforlist.hxx>
#include <tools/urlobj.hxx>
#include <rtl/logfile.hxx>
@@ -45,6 +50,8 @@
#include <signal.h>
#include <com/sun/star/table/XCellRange.hpp>
+#include <com/sun/star/sheet/XSheetCellRange.hpp>
+#include <comphelper/processfactory.hxx>
#include "interpre.hxx"
#include "global.hxx"
@@ -65,6 +72,8 @@
#include "jumpmatrix.hxx"
#include "parclass.hxx"
#include "externalrefmgr.hxx"
+#include "formula/FormulaCompiler.hxx"
+#include "macromgr.hxx"
#include "doubleref.hxx"
#include <math.h>
@@ -72,6 +81,8 @@
#include <map>
#include <algorithm>
#include <functional>
+#include <basic/basmgr.hxx>
+#include <vbahelper/vbaaccesshelper.hxx>
#include <memory>
using namespace com::sun::star;
@@ -90,9 +101,10 @@ using ::std::auto_ptr;
void ScInterpreter::ReplaceCell( ScAddress& rPos )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ReplaceCell" );
- ScInterpreterTableOpParams* pTOp = pDok->aTableOpList.First();
- while (pTOp)
+ size_t ListSize = pDok->aTableOpList.size();
+ for ( size_t i = 0; i < ListSize; ++i )
{
+ ScInterpreterTableOpParams* pTOp = &pDok->aTableOpList[ i ];
if ( rPos == pTOp->aOld1 )
{
rPos = pTOp->aNew1;
@@ -103,8 +115,6 @@ void ScInterpreter::ReplaceCell( ScAddress& rPos )
rPos = pTOp->aNew2;
return ;
}
- else
- pTOp = pDok->aTableOpList.Next();
}
}
@@ -113,9 +123,10 @@ void ScInterpreter::ReplaceCell( SCCOL& rCol, SCROW& rRow, SCTAB& rTab )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ReplaceCell" );
ScAddress aCellPos( rCol, rRow, rTab );
- ScInterpreterTableOpParams* pTOp = pDok->aTableOpList.First();
- while (pTOp)
+ size_t ListSize = pDok->aTableOpList.size();
+ for ( size_t i = 0; i < ListSize; ++i )
{
+ ScInterpreterTableOpParams* pTOp = &pDok->aTableOpList[ i ];
if ( aCellPos == pTOp->aOld1 )
{
rCol = pTOp->aNew1.Col();
@@ -130,8 +141,6 @@ void ScInterpreter::ReplaceCell( SCCOL& rCol, SCROW& rRow, SCTAB& rTab )
rTab = pTOp->aNew2.Tab();
return ;
}
- else
- pTOp = pDok->aTableOpList.Next();
}
}
@@ -140,19 +149,19 @@ sal_Bool ScInterpreter::IsTableOpInRange( const ScRange& rRange )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::IsTableOpInRange" );
if ( rRange.aStart == rRange.aEnd )
- return sal_False; // not considered to be a range in TableOp sense
+ return false; // not considered to be a range in TableOp sense
// we can't replace a single cell in a range
- ScInterpreterTableOpParams* pTOp = pDok->aTableOpList.First();
- while (pTOp)
+ size_t ListSize = pDok->aTableOpList.size();
+ for ( size_t i = 0; i < ListSize; ++i )
{
+ ScInterpreterTableOpParams* pTOp = &pDok->aTableOpList[ i ];
if ( rRange.In( pTOp->aOld1 ) )
return sal_True;
if ( rRange.In( pTOp->aOld2 ) )
- return sal_True;
- pTOp = pDok->aTableOpList.Next();
+ return true;
}
- return sal_False;
+ return false;
}
@@ -382,9 +391,9 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
::rtl::math::pow10Exp( nUnit[fraction],
static_cast<int>( -ceil( log10( static_cast<double>( nUnit[fraction]))))));
fValue = (bDate ? GetDateSerial(
- sal::static_int_cast<sal_Int16>(nUnit[year]),
- sal::static_int_cast<sal_Int16>(nUnit[month]),
- sal::static_int_cast<sal_Int16>(nUnit[day]),
+ sal::static_int_cast<INT16>(nUnit[year]),
+ sal::static_int_cast<INT16>(nUnit[month]),
+ sal::static_int_cast<INT16>(nUnit[day]),
true) : 0.0);
fValue += ((nUnit[hour] * 3600) + (nUnit[minute] * 60) + nUnit[second] + fFraction) / 86400.0;
}
@@ -549,7 +558,7 @@ sal_Bool ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
#error Add check for columns > USHRT_MAX!
#endif
if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX)
- return sal_False;
+ return false;
sal_uInt16 nCount = 0;
sal_uInt16* p = (sal_uInt16*) pCellArr;
@@ -593,16 +602,16 @@ sal_Bool ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
nVal = ((ScFormulaCell*)pCell)->GetValue();
}
else
- bOk = sal_False;
+ bOk = false;
break;
default :
- bOk = sal_False;
+ bOk = false;
break;
}
if (bOk)
{
if ((nPos + (4 * sizeof(sal_uInt16)) + sizeof(double)) > MAXARRSIZE)
- return sal_False;
+ return false;
*p++ = static_cast<sal_uInt16>(nCol);
*p++ = static_cast<sal_uInt16>(nRow);
*p++ = static_cast<sal_uInt16>(nTab);
@@ -635,7 +644,7 @@ sal_Bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
#error Add check for columns > USHRT_MAX!
#endif
if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX)
- return sal_False;
+ return false;
sal_uInt16 nCount = 0;
sal_uInt16* p = (sal_uInt16*) pCellArr;
@@ -679,10 +688,10 @@ sal_Bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
((ScFormulaCell*)pCell)->GetString(aStr);
}
else
- bOk = sal_False;
+ bOk = false;
break;
default :
- bOk = sal_False;
+ bOk = false;
break;
}
if (bOk)
@@ -691,14 +700,14 @@ sal_Bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
// In case the xub_StrLen will be longer than USHORT
// one day, and room for pad byte check.
if ( aTmp.Len() > ((sal_uInt16)(~0)) - 2 )
- return sal_False;
+ return false;
// Append a 0-pad-byte if string length is not even
//! MUST be sal_uInt16 and not xub_StrLen
sal_uInt16 nStrLen = (sal_uInt16) aTmp.Len();
sal_uInt16 nLen = ( nStrLen + 2 ) & ~1;
if (((sal_uLong)nPos + (5 * sizeof(sal_uInt16)) + nLen) > MAXARRSIZE)
- return sal_False;
+ return false;
*p++ = static_cast<sal_uInt16>(nCol);
*p++ = static_cast<sal_uInt16>(nRow);
*p++ = static_cast<sal_uInt16>(nTab);
@@ -735,7 +744,7 @@ sal_Bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
#error Add check for columns > USHRT_MAX!
#endif
if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX)
- return sal_False;
+ return false;
sal_uInt16 nCount = 0;
sal_uInt16* p = (sal_uInt16*) pCellArr;
@@ -790,13 +799,13 @@ sal_Bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
((ScFormulaCell*)pCell)->GetString(aStr);
break;
default :
- bOk = sal_False;
+ bOk = false;
break;
}
if (bOk)
{
if ((nPos + (5 * sizeof(sal_uInt16))) > MAXARRSIZE)
- return sal_False;
+ return false;
*p++ = static_cast<sal_uInt16>(nCol);
*p++ = static_cast<sal_uInt16>(nRow);
*p++ = static_cast<sal_uInt16>(nTab);
@@ -806,7 +815,7 @@ sal_Bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
if (nType == 0)
{
if ((nPos + sizeof(double)) > MAXARRSIZE)
- return sal_False;
+ return false;
memcpy( p, &nVal, sizeof(double));
nPos += sizeof(double);
}
@@ -816,13 +825,13 @@ sal_Bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
// In case the xub_StrLen will be longer than USHORT
// one day, and room for pad byte check.
if ( aTmp.Len() > ((sal_uInt16)(~0)) - 2 )
- return sal_False;
+ return false;
// Append a 0-pad-byte if string length is not even
//! MUST be sal_uInt16 and not xub_StrLen
sal_uInt16 nStrLen = (sal_uInt16) aTmp.Len();
sal_uInt16 nLen = ( nStrLen + 2 ) & ~1;
if ( ((sal_uLong)nPos + 2 + nLen) > MAXARRSIZE)
- return sal_False;
+ return false;
*p++ = nLen;
memcpy( p, aTmp.GetBuffer(), nStrLen + 1);
nPos += 2 + nStrLen + 1;
@@ -1172,7 +1181,7 @@ void ScInterpreter::PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab)
break;
case svSingleRef:
SingleRefToVars( static_cast<ScToken*>(p)->GetSingleRef(), rCol, rRow, rTab);
- if ( pDok->aTableOpList.Count() > 0 )
+ if ( !pDok->aTableOpList.empty() )
ReplaceCell( rCol, rRow, rTab );
break;
default:
@@ -1203,7 +1212,7 @@ void ScInterpreter::PopSingleRef( ScAddress& rAdr )
SCTAB nTab;
SingleRefToVars( static_cast<ScToken*>(p)->GetSingleRef(), nCol, nRow, nTab);
rAdr.Set( nCol, nRow, nTab );
- if ( pDok->aTableOpList.Count() > 0 )
+ if ( !pDok->aTableOpList.empty() )
ReplaceCell( rAdr );
}
break;
@@ -1225,7 +1234,7 @@ void ScInterpreter::DoubleRefToVars( const ScToken* p,
const ScComplexRefData& rCRef = p->GetDoubleRef();
SingleRefToVars( rCRef.Ref1, rCol1, rRow1, rTab1);
SingleRefToVars( rCRef.Ref2, rCol2, rRow2, rTab2);
- if ( pDok->aTableOpList.Count() > 0 && !bDontCheckForTableOp )
+ if ( !pDok->aTableOpList.empty() && !bDontCheckForTableOp )
{
ScRange aRange( rCol1, rRow1, rTab1, rCol2, rRow2, rTab2 );
if ( IsTableOpInRange( aRange ) )
@@ -1233,40 +1242,42 @@ void ScInterpreter::DoubleRefToVars( const ScToken* p,
}
}
-ScDBRangeBase* ScInterpreter::PopDoubleRef()
+ScDBRangeBase* ScInterpreter::PopDBDoubleRef()
{
- if (!sp)
- {
- SetError(errUnknownStackVariable);
- return NULL;
- }
-
- --sp;
- FormulaToken* p = pStack[sp];
- switch (p->GetType())
+ StackVar eType = GetStackType();
+ switch (eType)
{
+ case svUnknown:
+ SetError(errUnknownStackVariable);
+ break;
case svError:
- nGlobalError = p->GetError();
+ PopError();
break;
case svDoubleRef:
{
SCCOL nCol1, nCol2;
SCROW nRow1, nRow2;
SCTAB nTab1, nTab2;
- DoubleRefToVars(static_cast<ScToken*>(p),
- nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, false);
-
+ PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, false);
+ if (nGlobalError)
+ break;
return new ScDBInternalRange(pDok,
ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2));
}
case svMatrix:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = static_cast<ScToken*>(p)->GetMatrix();
+ ScMatrixRef pMat;
+ if (eType == svMatrix)
+ pMat = PopMatrix();
+ else
+ PopExternalDoubleRef(pMat);
return new ScDBExternalRange(pDok, pMat);
}
default:
SetError( errIllegalParameter);
}
+
return NULL;
}
@@ -1308,7 +1319,7 @@ void ScInterpreter::DoubleRefToRange( const ScComplexRefData & rCRef,
rRange.aStart.Set( nCol, nRow, nTab );
SingleRefToVars( rCRef.Ref2, nCol, nRow, nTab);
rRange.aEnd.Set( nCol, nRow, nTab );
- if ( pDok->aTableOpList.Count() > 0 && !bDontCheckForTableOp )
+ if (! pDok->aTableOpList.empty() && !bDontCheckForTableOp )
{
if ( IsTableOpInRange( rRange ) )
SetError( errIllegalParameter );
@@ -1386,6 +1397,171 @@ void ScInterpreter::PopDoubleRef( ScRange& rRange, sal_Bool bDontCheckForTableOp
SetError( errUnknownStackVariable);
}
+void ScInterpreter::PopExternalSingleRef(sal_uInt16& rFileId, String& rTabName, ScSingleRefData& rRef)
+{
+ if (!sp)
+ {
+ SetError(errUnknownStackVariable);
+ return;
+ }
+
+ --sp;
+ FormulaToken* p = pStack[sp];
+ StackVar eType = p->GetType();
+
+ if (eType == svError)
+ {
+ nGlobalError = p->GetError();
+ return;
+ }
+
+ if (eType != svExternalSingleRef)
+ {
+ SetError( errIllegalParameter);
+ return;
+ }
+
+ rFileId = p->GetIndex();
+ rTabName = p->GetString();
+ rRef = static_cast<ScToken*>(p)->GetSingleRef();
+}
+
+void ScInterpreter::PopExternalSingleRef(ScExternalRefCache::TokenRef& rToken, ScExternalRefCache::CellFormat* pFmt)
+{
+
+ sal_uInt16 nFileId;
+ String aTabName;
+ ScSingleRefData aData;
+ PopExternalSingleRef(nFileId, aTabName, aData);
+ if (nGlobalError)
+ return;
+
+ ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager();
+ const String* pFile = pRefMgr->getExternalFileName(nFileId);
+ if (!pFile)
+ {
+ SetError(errNoName);
+ return;
+ }
+
+ if (aData.IsTabRel())
+ {
+ OSL_FAIL("ScCompiler::GetToken: external single reference must have an absolute table reference!");
+ SetError(errNoRef);
+ return;
+ }
+
+ aData.CalcAbsIfRel(aPos);
+ ScAddress aAddr(aData.nCol, aData.nRow, aData.nTab);
+ ScExternalRefCache::CellFormat aFmt;
+ ScExternalRefCache::TokenRef xNew = pRefMgr->getSingleRefToken(
+ nFileId, aTabName, aAddr, &aPos, NULL, &aFmt);
+
+ if (!xNew)
+ {
+ SetError(errNoRef);
+ return;
+ }
+
+ rToken = xNew;
+ if (pFmt)
+ *pFmt = aFmt;
+}
+
+void ScInterpreter::PopExternalDoubleRef(sal_uInt16& rFileId, String& rTabName, ScComplexRefData& rRef)
+{
+ if (!sp)
+ {
+ SetError(errUnknownStackVariable);
+ return;
+ }
+
+ --sp;
+ FormulaToken* p = pStack[sp];
+ StackVar eType = p->GetType();
+
+ if (eType == svError)
+ {
+ nGlobalError = p->GetError();
+ return;
+ }
+
+ if (eType != svExternalDoubleRef)
+ {
+ SetError( errIllegalParameter);
+ return;
+ }
+
+ rFileId = p->GetIndex();
+ rTabName = p->GetString();
+ rRef = static_cast<ScToken*>(p)->GetDoubleRef();
+}
+
+void ScInterpreter::PopExternalDoubleRef(ScExternalRefCache::TokenArrayRef& rArray)
+{
+ sal_uInt16 nFileId;
+ String aTabName;
+ ScComplexRefData aData;
+ PopExternalDoubleRef(nFileId, aTabName, aData);
+ if (nGlobalError)
+ return;
+
+ ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager();
+ const String* pFile = pRefMgr->getExternalFileName(nFileId);
+ if (!pFile)
+ {
+ SetError(errNoName);
+ return;
+ }
+ if (aData.Ref1.IsTabRel() || aData.Ref2.IsTabRel())
+ {
+ OSL_FAIL("ScCompiler::GetToken: external double reference must have an absolute table reference!");
+ SetError(errNoRef);
+ return;
+ }
+
+ aData.CalcAbsIfRel(aPos);
+ ScRange aRange(aData.Ref1.nCol, aData.Ref1.nRow, aData.Ref1.nTab,
+ aData.Ref2.nCol, aData.Ref2.nRow, aData.Ref2.nTab);
+ ScExternalRefCache::TokenArrayRef pArray = pRefMgr->getDoubleRefTokens(
+ nFileId, aTabName, aRange, &aPos);
+
+ if (!pArray)
+ {
+ SetError(errIllegalArgument);
+ return;
+ }
+
+ ScToken* pToken = static_cast<ScToken*>(pArray->First());
+ if (pToken->GetType() != svMatrix)
+ {
+ SetError(errIllegalArgument);
+ return;
+ }
+
+ if (pArray->Next())
+ {
+ // Can't handle more than one matrix per parameter.
+ SetError( errIllegalArgument);
+ return;
+ }
+
+ rArray = pArray;
+}
+
+void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat)
+{
+ ScExternalRefCache::TokenArrayRef pArray;
+ PopExternalDoubleRef(pArray);
+ if (nGlobalError)
+ return;
+
+ // For now, we only support single range data for external
+ // references, which means the array should only contain a
+ // single matrix token.
+ ScToken* p = static_cast<ScToken*>(pArray->First());
+ rMat = p->GetMatrix();
+}
sal_Bool ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr )
{
@@ -1398,18 +1574,16 @@ sal_Bool ScInterpreter::PopDoubleRefOrSingleRef( ScAddress& rAdr )
PopDoubleRef( aRange, sal_True );
return DoubleRefToPosSingleRef( aRange, rAdr );
}
- //break;
case svSingleRef :
{
PopSingleRef( rAdr );
return sal_True;
}
- //break;
default:
PopError();
SetError( errNoRef );
}
- return sal_False;
+ return false;
}
@@ -1445,7 +1619,7 @@ bool ScInterpreter::ConvertMatrixParameters()
for ( sal_uInt16 i=1; i <= nParams && i <= sp; ++i )
{
FormulaToken* p = pStack[ sp - i ];
- if ( p->GetOpCode() != ocPush )
+ if ( p->GetOpCode() != ocPush && p->GetOpCode() != ocMissing)
{
DBG_ERRORFILE( "ConvertMatrixParameters: not a push");
}
@@ -1559,7 +1733,7 @@ bool ScInterpreter::ConvertMatrixParameters()
GetTokenMatrixMap().insert( ScTokenMatrixMap::value_type( pCur,
xNew));
}
- PushTempToken( xNew);
+ PushTempToken( xNew.get());
// set continuation point of path for main code line
aCode.Jump( nNext, nNext);
return true;
@@ -1598,6 +1772,47 @@ ScMatrixRef ScInterpreter::PopMatrix()
return NULL;
}
+void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_uLong& rRetIndexExpr)
+{
+ if (xMat)
+ {
+ ScMatrixValue nMatVal = xMat->Get(0, 0);
+ ScMatValType nMatValType = nMatVal.nType;
+ if (ScMatrix::IsNonValueType( nMatValType))
+ {
+ if ( xMat->IsEmptyPath( 0, 0))
+ { // result of empty FALSE jump path
+ FormulaTokenRef xRes = new FormulaDoubleToken( 0.0);
+ PushTempToken( new ScMatrixCellResultToken( xMat, xRes.get()));
+ rRetTypeExpr = NUMBERFORMAT_LOGICAL;
+ }
+ else
+ {
+ String aStr( nMatVal.GetString());
+ FormulaTokenRef xRes = new FormulaStringToken( aStr);
+ PushTempToken( new ScMatrixCellResultToken( xMat, xRes.get()));
+ rRetTypeExpr = NUMBERFORMAT_TEXT;
+ }
+ }
+ else
+ {
+ sal_uInt16 nErr = GetDoubleErrorValue( nMatVal.fVal);
+ FormulaTokenRef xRes;
+ if (nErr)
+ xRes = new FormulaErrorToken( nErr);
+ else
+ xRes = new FormulaDoubleToken( nMatVal.fVal);
+ PushTempToken( new ScMatrixCellResultToken( xMat, xRes.get()));
+ if ( rRetTypeExpr != NUMBERFORMAT_LOGICAL )
+ rRetTypeExpr = NUMBERFORMAT_NUMBER;
+ }
+ rRetIndexExpr = 0;
+ xMat->SetErrorInterpreter( NULL);
+ }
+ else
+ SetError( errUnknownStackVariable);
+}
+
void ScInterpreter::PushDouble(double nVal)
{
@@ -1668,7 +1883,41 @@ void ScInterpreter::PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
}
-void ScInterpreter::PushMatrix(ScMatrix* pMat)
+void ScInterpreter::PushExternalSingleRef(
+ sal_uInt16 nFileId, const String& rTabName, SCCOL nCol, SCROW nRow, SCTAB nTab)
+{
+ if (!IfErrorPushError())
+ {
+ ScSingleRefData aRef;
+ aRef.InitFlags();
+ aRef.nCol = nCol;
+ aRef.nRow = nRow;
+ aRef.nTab = nTab;
+ PushTempTokenWithoutError( new ScExternalSingleRefToken(nFileId, rTabName, aRef)) ;
+ }
+}
+
+
+void ScInterpreter::PushExternalDoubleRef(
+ sal_uInt16 nFileId, const String& rTabName,
+ SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
+{
+ if (!IfErrorPushError())
+ {
+ ScComplexRefData aRef;
+ aRef.InitFlags();
+ aRef.Ref1.nCol = nCol1;
+ aRef.Ref1.nRow = nRow1;
+ aRef.Ref1.nTab = nTab1;
+ aRef.Ref2.nCol = nCol2;
+ aRef.Ref2.nRow = nRow2;
+ aRef.Ref2.nTab = nTab2;
+ PushTempTokenWithoutError( new ScExternalDoubleRefToken(nFileId, rTabName, aRef) );
+ }
+}
+
+
+void ScInterpreter::PushMatrix(const ScMatrixRef& pMat)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PushMatrix" );
pMat->SetErrorInterpreter( NULL);
@@ -1792,7 +2041,7 @@ sal_Bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddres
return sal_True;
}
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
if ( pJumpMatrix )
{
@@ -1861,7 +2110,7 @@ sal_Bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddres
else if ( nTab <= nMyTab && nMyTab <= rRange.aEnd.Tab() )
nTab = nMyTab;
else
- bOk = sal_False;
+ bOk = false;
if ( bOk )
rAdr.Set( nCol, nRow, nTab );
}
@@ -1870,11 +2119,28 @@ sal_Bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddres
return bOk;
}
+double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
+{
+ if (!pMat)
+ return 0.0;
+
+ if ( !pJumpMatrix )
+ return pMat->GetDouble( 0 );
+
+ SCSIZE nCols, nRows, nC, nR;
+ pMat->GetDimensions( nCols, nRows);
+ pJumpMatrix->GetPos( nC, nR);
+ if ( nC < nCols && nR < nRows )
+ return pMat->GetDouble( nC, nR);
+
+ SetError( errNoValue);
+ return 0.0;
+}
double ScInterpreter::GetDouble()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetDouble" );
- double nVal;
+ double nVal(0.0);
switch( GetRawStackType() )
{
case svDouble:
@@ -1905,26 +2171,28 @@ double ScInterpreter::GetDouble()
nVal = 0.0;
}
break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ if (!nGlobalError && pToken)
+ nVal = pToken->GetDouble();
+ }
+ break;
+ case svExternalDoubleRef:
+ {
+ ScMatrixRef pMat;
+ PopExternalDoubleRef(pMat);
+ if (nGlobalError)
+ break;
+
+ nVal = GetDoubleFromMatrix(pMat);
+ }
+ break;
case svMatrix:
{
ScMatrixRef pMat = PopMatrix();
- if ( !pMat )
- nVal = 0.0;
- else if ( !pJumpMatrix )
- nVal = pMat->GetDouble( 0 );
- else
- {
- SCSIZE nCols, nRows, nC, nR;
- pMat->GetDimensions( nCols, nRows);
- pJumpMatrix->GetPos( nC, nR);
- if ( nC < nCols && nR < nRows )
- nVal = pMat->GetDouble( nC, nR);
- else
- {
- SetError( errNoValue);
- nVal = 0.0;
- }
- }
+ nVal = GetDoubleFromMatrix(pMat);
}
break;
case svError:
@@ -1966,12 +2234,10 @@ const String& ScInterpreter::GetString()
case svError:
PopError();
return EMPTY_STRING;
- //break;
case svMissing:
case svEmptyCell:
Pop();
return EMPTY_STRING;
- //break;
case svDouble:
{
double fVal = PopDouble();
@@ -1981,10 +2247,8 @@ const String& ScInterpreter::GetString()
pFormatter->GetInputLineString(fVal, nIndex, aTempStr);
return aTempStr;
}
- //break;
case svString:
return PopString();
- //break;
case svSingleRef:
{
ScAddress aAdr;
@@ -1998,7 +2262,6 @@ const String& ScInterpreter::GetString()
else
return EMPTY_STRING;
}
- //break;
case svDoubleRef:
{ // generate position dependent SingleRef
ScRange aRange;
@@ -2013,30 +2276,22 @@ const String& ScInterpreter::GetString()
else
return EMPTY_STRING;
}
- //break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ return nGlobalError ? EMPTY_STRING : pToken->GetString();
+ }
+ case svExternalDoubleRef:
+ {
+ ScMatrixRef pMat;
+ PopExternalDoubleRef(pMat);
+ return GetStringFromMatrix(pMat);
+ }
case svMatrix:
{
ScMatrixRef pMat = PopMatrix();
- if ( !pMat )
- ; // nothing
- else if ( !pJumpMatrix )
- {
- aTempStr = pMat->GetString( *pFormatter, 0, 0);
- return aTempStr;
- }
- else
- {
- SCSIZE nCols, nRows, nC, nR;
- pMat->GetDimensions( nCols, nRows);
- pJumpMatrix->GetPos( nC, nR);
- if ( nC < nCols && nR < nRows )
- {
- aTempStr = pMat->GetString( *pFormatter, nC, nR);
- return aTempStr;
- }
- else
- SetError( errNoValue);
- }
+ return GetStringFromMatrix(pMat);
}
break;
default:
@@ -2046,55 +2301,91 @@ const String& ScInterpreter::GetString()
return EMPTY_STRING;
}
-
+const String& ScInterpreter::GetStringFromMatrix(const ScMatrixRef& pMat)
+{
+ if ( !pMat )
+ ; // nothing
+ else if ( !pJumpMatrix )
+ {
+ aTempStr = pMat->GetString( *pFormatter, 0, 0);
+ return aTempStr;
+ }
+ else
+ {
+ SCSIZE nCols, nRows, nC, nR;
+ pMat->GetDimensions( nCols, nRows);
+ pJumpMatrix->GetPos( nC, nR);
+ if ( nC < nCols && nR < nRows )
+ {
+ aTempStr = pMat->GetString( *pFormatter, nC, nR);
+ return aTempStr;
+ }
+ else
+ SetError( errNoValue);
+ }
+ return EMPTY_STRING;
+}
ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble,
String& rString )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetDoubleOrStringFromMatrix" );
+
+ rDouble = 0.0;
+ rString.Erase();
ScMatValType nMatValType = SC_MATVAL_EMPTY;
- switch ( GetStackType() )
+
+ ScMatrixRef pMat;
+ StackVar eType = GetStackType();
+ if (eType == svExternalDoubleRef)
{
- case svMatrix:
- {
- const ScMatrixValue* pMatVal = 0;
- ScMatrixRef pMat = PopMatrix();
- if (!pMat)
- ; // nothing
- else if (!pJumpMatrix)
- pMatVal = pMat->Get( 0, 0, nMatValType);
- else
- {
- SCSIZE nCols, nRows, nC, nR;
- pMat->GetDimensions( nCols, nRows);
- pJumpMatrix->GetPos( nC, nR);
- if ( nC < nCols && nR < nRows )
- pMatVal = pMat->Get( nC, nR, nMatValType);
- else
- SetError( errNoValue);
- }
- if (!pMatVal)
- {
- rDouble = 0.0;
- rString.Erase();
- }
- else if (nMatValType == SC_MATVAL_VALUE)
- rDouble = pMatVal->fVal;
- else if (nMatValType == SC_MATVAL_BOOLEAN)
- {
- rDouble = pMatVal->fVal;
- nMatValType = SC_MATVAL_VALUE;
- }
- else
- rString = pMatVal->GetString();
- }
- break;
- default:
- PopError();
- rDouble = 0.0;
- rString.Erase();
- SetError( errIllegalParameter);
+ PopExternalDoubleRef(pMat);
+ }
+ else if (eType == svMatrix)
+ {
+ pMat = PopMatrix();
+ }
+ else
+ {
+ PopError();
+ SetError( errIllegalParameter);
+ return nMatValType;
}
+
+ ScMatrixValue nMatVal;
+ if (!pMat)
+ {
+ // nothing
+ }
+ else if (!pJumpMatrix)
+ {
+ nMatVal = pMat->Get(0, 0);
+ nMatValType = nMatVal.nType;
+ }
+ else
+ {
+ SCSIZE nCols, nRows, nC, nR;
+ pMat->GetDimensions( nCols, nRows);
+ pJumpMatrix->GetPos( nC, nR);
+ if ( nC < nCols && nR < nRows )
+ {
+ nMatVal = pMat->Get( nC, nR);
+ nMatValType = nMatVal.nType;
+ }
+ else
+ SetError( errNoValue);
+ }
+
+ if (nMatValType == SC_MATVAL_VALUE)
+ rDouble = nMatVal.fVal;
+ else if (nMatValType == SC_MATVAL_BOOLEAN)
+ {
+ rDouble = nMatVal.fVal;
+ nMatValType = SC_MATVAL_VALUE;
+ }
+ else
+ rString = nMatVal.GetString();
+
return nMatValType;
}
@@ -2102,7 +2393,7 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble,
void ScInterpreter::ScDBGet()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScDBGet" );
- sal_Bool bMissingField = sal_False;
+ sal_Bool bMissingField = false;
auto_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) );
if (!pQueryParam.get())
{
@@ -2334,7 +2625,7 @@ void ScInterpreter::ScExternal()
PushIllegalParameter();
}
}
- else if ( ( aUnoName = ScGlobal::GetAddInCollection()->FindFunction(aFuncName, sal_False) ).Len() )
+ else if ( ( aUnoName = ScGlobal::GetAddInCollection()->FindFunction(aFuncName, false) ).Len() )
{
// bLocalFirst=sal_False in FindFunction, cFunc should be the stored internal name
@@ -2417,7 +2708,7 @@ void ScInterpreter::ScExternal()
}
break;
case svMatrix:
- if (!ScRangeToSequence::FillLongArray( aParam, PopMatrix() ))
+ if (!ScRangeToSequence::FillLongArray( aParam, PopMatrix().get() ))
SetError(errIllegalParameter);
break;
default:
@@ -2448,7 +2739,7 @@ void ScInterpreter::ScExternal()
}
break;
case svMatrix:
- if (!ScRangeToSequence::FillDoubleArray( aParam, PopMatrix() ))
+ if (!ScRangeToSequence::FillDoubleArray( aParam, PopMatrix().get() ))
SetError(errIllegalParameter);
break;
default:
@@ -2479,7 +2770,7 @@ void ScInterpreter::ScExternal()
}
break;
case svMatrix:
- if (!ScRangeToSequence::FillStringArray( aParam, PopMatrix(), pFormatter ))
+ if (!ScRangeToSequence::FillStringArray( aParam, PopMatrix().get(), pFormatter ))
SetError(errIllegalParameter);
break;
default:
@@ -2530,7 +2821,7 @@ void ScInterpreter::ScExternal()
}
break;
case svMatrix:
- if (!ScRangeToSequence::FillMixedArray( aParam, PopMatrix() ))
+ if (!ScRangeToSequence::FillMixedArray( aParam, PopMatrix().get() ))
SetError(errIllegalParameter);
break;
default:
@@ -2576,7 +2867,7 @@ void ScInterpreter::ScExternal()
}
break;
case svMatrix:
- if (!ScRangeToSequence::FillMixedArray( aParam, PopMatrix() ))
+ if (!ScRangeToSequence::FillMixedArray( aParam, PopMatrix().get() ))
SetError(errIllegalParameter);
break;
case svMissing:
@@ -2689,6 +2980,61 @@ void ScInterpreter::ScMissing()
PushTempToken( new FormulaMissingToken );
}
+uno::Any lcl_getSheetModule( const uno::Reference<table::XCellRange>& xCellRange, ScDocument* pDok )
+{
+ uno::Reference< sheet::XSheetCellRange > xSheetRange( xCellRange, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xSheetRange->getSpreadsheet(), uno::UNO_QUERY_THROW );
+ rtl::OUString sCodeName;
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CodeName") ) ) >>= sCodeName;
+ // #TODO #FIXME ideally we should 'throw' here if we don't get a valid parent, but... it is possible
+ // to create a module ( and use 'Option VBASupport 1' ) for a calc document, in this scenario there
+ // are *NO* special document module objects ( of course being able to switch between vba/non vba mode at
+ // the document in the future could fix this, especially IF the switching of the vba mode takes care to
+ // create the special document module objects if they don't exist.
+ BasicManager* pBasMgr = pDok->GetDocumentShell()->GetBasicManager();
+
+ uno::Reference< uno::XInterface > xIf;
+ if ( pBasMgr && pBasMgr->GetName().Len() )
+ {
+ String sProj = String( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+ if ( pDok->GetDocumentShell()->GetBasicManager()->GetName().Len() )
+ sProj = pDok->GetDocumentShell()->GetBasicManager()->GetName();
+ StarBASIC* pBasic = pDok->GetDocumentShell()->GetBasicManager()->GetLib( sProj );
+ if ( pBasic )
+ {
+ SbModule* pMod = pBasic->FindModule( sCodeName );
+ if ( pMod )
+ xIf = pMod->GetUnoModule();
+ }
+ }
+ return uno::makeAny( xIf );
+}
+
+bool
+lcl_setVBARange( ScRange& aRange, ScDocument* pDok, SbxVariable* pPar )
+{
+ bool bOk = false;
+ try
+ {
+ uno::Reference< uno::XInterface > xVBARange;
+ uno::Reference<table::XCellRange> xCellRange = ScCellRangeObj::CreateRangeFromDoc( pDok, aRange );
+ uno::Sequence< uno::Any > aArgs(2);
+ aArgs[0] = lcl_getSheetModule( xCellRange, pDok );
+ aArgs[1] = uno::Any( xCellRange );
+ xVBARange = ooo::vba::createVBAUnoAPIServiceWithArgs( pDok->GetDocumentShell(), "ooo.vba.excel.Range", aArgs );
+ if ( xVBARange.is() )
+ {
+ String sDummy(RTL_CONSTASCII_USTRINGPARAM("A-Range") );
+ SbxObjectRef aObj = GetSbUnoObject( sDummy, uno::Any( xVBARange ) );
+ SetSbUnoObjectDfltPropName( aObj );
+ bOk = pPar->PutObject( aObj );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ return bOk;
+}
void ScInterpreter::ScMacro()
{
@@ -2722,8 +3068,11 @@ void ScInterpreter::ScMacro()
return;
}
+ bool bVolatileMacro = false;
SbMethod* pMethod = (SbMethod*)pVar;
+
SbModule* pModule = pMethod->GetModule();
+ bool bUseVBAObjects = pModule->IsVBACompat();
SbxObject* pObject = pModule->GetParent();
DBG_ASSERT(pObject->IsA(TYPE(StarBASIC)), "Kein Basic gefunden!");
String aMacroStr = pObject->GetName();
@@ -2733,7 +3082,13 @@ void ScInterpreter::ScMacro()
aMacroStr += pMethod->GetName();
String aBasicStr;
if (pObject->GetParent())
+ {
aBasicStr = pObject->GetParent()->GetName(); // Dokumentenbasic
+ const SfxFilter* pFilter = NULL;
+ SfxMedium* pMedium = pDok->GetDocumentShell()->GetMedium();
+ if ( pMedium )
+ pFilter = pMedium->GetFilter();
+ }
else
aBasicStr = SFX_APP()->GetName(); // Applikationsbasic
@@ -2757,7 +3112,13 @@ void ScInterpreter::ScMacro()
{
ScAddress aAdr;
PopSingleRef( aAdr );
- bOk = SetSbxVariable( pPar, aAdr );
+ if ( bUseVBAObjects )
+ {
+ ScRange aRange( aAdr );
+ bOk = lcl_setVBARange( aRange, pDok, pPar );
+ }
+ else
+ bOk = SetSbxVariable( pPar, aAdr );
}
break;
case svDoubleRef:
@@ -2772,28 +3133,36 @@ void ScInterpreter::ScMacro()
if( nTab1 != nTab2 )
{
SetError( errIllegalParameter );
- bOk = sal_False;
+ bOk = false;
}
else
{
- SbxDimArrayRef refArray = new SbxDimArray;
- refArray->AddDim32( 1, nRow2 - nRow1 + 1 );
- refArray->AddDim32( 1, nCol2 - nCol1 + 1 );
- ScAddress aAdr( nCol1, nRow1, nTab1 );
- for( SCROW nRow = nRow1; bOk && nRow <= nRow2; nRow++ )
+ if ( bUseVBAObjects )
{
- aAdr.SetRow( nRow );
- sal_Int32 nIdx[ 2 ];
- nIdx[ 0 ] = nRow-nRow1+1;
- for( SCCOL nCol = nCol1; bOk && nCol <= nCol2; nCol++ )
+ ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+ bOk = lcl_setVBARange( aRange, pDok, pPar );
+ }
+ else
+ {
+ SbxDimArrayRef refArray = new SbxDimArray;
+ refArray->AddDim32( 1, nRow2 - nRow1 + 1 );
+ refArray->AddDim32( 1, nCol2 - nCol1 + 1 );
+ ScAddress aAdr( nCol1, nRow1, nTab1 );
+ for( SCROW nRow = nRow1; bOk && nRow <= nRow2; nRow++ )
{
- aAdr.SetCol( nCol );
- nIdx[ 1 ] = nCol-nCol1+1;
- SbxVariable* p = refArray->Get32( nIdx );
- bOk = SetSbxVariable( p, aAdr );
+ aAdr.SetRow( nRow );
+ INT32 nIdx[ 2 ];
+ nIdx[ 0 ] = nRow-nRow1+1;
+ for( SCCOL nCol = nCol1; bOk && nCol <= nCol2; nCol++ )
+ {
+ aAdr.SetCol( nCol );
+ nIdx[ 1 ] = nCol-nCol1+1;
+ SbxVariable* p = refArray->Get32( nIdx );
+ bOk = SetSbxVariable( p, aAdr );
+ }
}
+ pPar->PutObject( refArray );
}
- pPar->PutObject( refArray );
}
}
break;
@@ -2829,7 +3198,7 @@ void ScInterpreter::ScMacro()
break;
default:
SetError( errIllegalParameter );
- bOk = sal_False;
+ bOk = false;
}
}
if( bOk )
@@ -2841,6 +3210,13 @@ void ScInterpreter::ScMacro()
pDok->DecMacroInterpretLevel();
pDok->UnlockTable( aPos.Tab() );
+ ScMacroManager* pMacroMgr = pDok->GetMacroManager();
+ if (pMacroMgr)
+ {
+ bVolatileMacro = pMacroMgr->GetUserFuncVolatile( pMethod->GetName() );
+ pMacroMgr->AddDependentCell(pModule->GetName(), pMyFormulaCell);
+ }
+
SbxDataType eResType = refRes->GetType();
if( pVar->GetError() )
SetError( errNoValue);
@@ -2910,6 +3286,11 @@ void ScInterpreter::ScMacro()
else
PushString( refRes->GetString() );
}
+
+ pSfxApp->LeaveBasicCall();
+
+ if (bVolatileMacro && meVolaileType == NOT_VOLATILE)
+ meVolaileType = VOLATILE_MACRO;
}
@@ -2959,7 +3340,7 @@ sal_Bool ScInterpreter::SetSbxVariable( SbxVariable* pVar, const ScAddress& rPos
}
}
else
- SetError( nErr ), bOk = sal_False;
+ SetError( nErr ), bOk = false;
break;
default :
pVar->PutDouble( 0.0 );
@@ -2990,8 +3371,8 @@ void ScInterpreter::ScTableOp()
PopSingleRef( pTableOp->aOld1 );
PopSingleRef( pTableOp->aFormulaPos );
- pTableOp->bValid = sal_True;
- pDok->aTableOpList.Insert( pTableOp );
+ pTableOp->bValid = true;
+ pDok->aTableOpList.push_back( pTableOp );
pDok->IncInterpreterTableOpLevel();
sal_Bool bReuseLastParams = (pDok->aLastTableOpParams == *pTableOp);
@@ -3015,7 +3396,7 @@ void ScInterpreter::ScTableOp()
if ( nParamCount == 5 )
pDok->SetTableOpDirty( pTableOp->aOld2 );
}
- pTableOp->bCollectNotifications = sal_False;
+ pTableOp->bCollectNotifications = false;
ScBaseCell* pFCell = pDok->GetCell( pTableOp->aFormulaPos );
if ( pFCell && pFCell->GetCellType() == CELLTYPE_FORMULA )
@@ -3029,7 +3410,7 @@ void ScInterpreter::ScTableOp()
PushString( aCellString );
}
- pDok->aTableOpList.Remove( pTableOp );
+ pTableOp = pDok->aTableOpList.release( pDok->aTableOpList.end() ).release();
// set dirty again once more to be able to recalculate original
for ( ::std::vector< ScFormulaCell* >::const_iterator iBroadcast(
pTableOp->aNotifiedFormulaCells.begin() );
@@ -3064,17 +3445,6 @@ void ScInterpreter::ScTableOp()
pDok->DecInterpreterTableOpLevel();
}
-
-/*
-
-void ScInterpreter::ScErrCell()
-{
-RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScErrCell" );
- double fErrNum = GetDouble();
- PushError((sal_uInt16) fErrNum);
-}
-*/
-
void ScInterpreter::ScDBArea()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScDBArea" );
@@ -3179,82 +3549,6 @@ void ScInterpreter::ScColRowNameAuto()
PushError( errNoRef );
}
-void ScInterpreter::ScExternalRef()
-{
- ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager();
- const String* pFile = pRefMgr->getExternalFileName(pCur->GetIndex());
- if (!pFile)
- PushError(errNoName);
-
- switch (pCur->GetType())
- {
- case svExternalSingleRef:
- {
- ScSingleRefData aData(static_cast<const ScToken*>(pCur)->GetSingleRef());
- if (aData.IsTabRel())
- {
- DBG_ERROR("ScCompiler::GetToken: external single reference must have an absolute table reference!");
- break;
- }
-
- aData.CalcAbsIfRel(aPos);
- ScAddress aAddr(aData.nCol, aData.nRow, aData.nTab);
- ScExternalRefCache::CellFormat aFmt;
- ScExternalRefCache::TokenRef xNew = pRefMgr->getSingleRefToken(
- pCur->GetIndex(), pCur->GetString(), aAddr, &aPos, NULL, &aFmt);
-
- if (!xNew)
- break;
-
- PushTempToken( *xNew); // push a clone
-
- if (aFmt.mbIsSet)
- {
- nFuncFmtType = aFmt.mnType;
- nFuncFmtIndex = aFmt.mnIndex;
- }
- return;
- }
- //break; // unreachable, prevent compiler warning
- case svExternalDoubleRef:
- {
- ScComplexRefData aData(static_cast<const ScToken*>(pCur)->GetDoubleRef());
- if (aData.Ref1.IsTabRel() || aData.Ref2.IsTabRel())
- {
- DBG_ERROR("ScCompiler::GetToken: external double reference must have an absolute table reference!");
- break;
- }
-
- aData.CalcAbsIfRel(aPos);
- ScRange aRange(aData.Ref1.nCol, aData.Ref1.nRow, aData.Ref1.nTab,
- aData.Ref2.nCol, aData.Ref2.nRow, aData.Ref2.nTab);
- ScExternalRefCache::TokenArrayRef xNew = pRefMgr->getDoubleRefTokens(
- pCur->GetIndex(), pCur->GetString(), aRange, &aPos);
-
- if (!xNew)
- break;
-
- ScToken* p = static_cast<ScToken*>(xNew->First());
- if (p->GetType() != svMatrix)
- break;
-
- if (xNew->Next())
- {
- // Can't handle more than one matrix per parameter.
- SetError( errIllegalArgument);
- break;
- }
-
- PushMatrix(p->GetMatrix());
- return;
- }
- //break; // unreachable, prevent compiler warning
- default:
- ;
- }
- PushError(errNoRef);
-}
-
// --- internals ------------------------------------------------------------
@@ -3282,10 +3576,10 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
pMyFormulaCell( pCell ),
pFormatter( pDoc->GetFormatTable() ),
mnStringNoValueError( errNoValue),
- bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() )
+ bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() ),
+ meVolaileType(r.IsRecalcModeAlways() ? VOLATILE : NOT_VOLATILE)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTTT" );
-// pStack = new ScToken*[ MAXSTACK ];
sal_uInt8 cMatFlag = pMyFormulaCell->GetMatrixFlag();
bMatrixFormula = ( cMatFlag == MM_FORMULA || cMatFlag == MM_FAKE );
@@ -3308,7 +3602,7 @@ ScInterpreter::~ScInterpreter()
// delete pStack;
if ( pStackObj == pGlobalStack )
- bGlobalStackInUse = sal_False;
+ bGlobalStackInUse = false;
else
delete pStackObj;
if (pTokenMatrixMap)
@@ -3316,7 +3610,7 @@ ScInterpreter::~ScInterpreter()
}
-void ScInterpreter::GlobalExit() // static
+void ScInterpreter::GlobalExit()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GlobalExit" );
DBG_ASSERT(!bGlobalStackInUse, "wer benutzt noch den TokenStack?");
@@ -3340,7 +3634,7 @@ StackVar ScInterpreter::Interpret()
nFuncFmtIndex = nCurFmtIndex = nRetFmtIndex = 0;
xResult = NULL;
pJumpMatrix = NULL;
- glSubTotal = sal_False;
+ glSubTotal = false;
ScTokenMatrixMap::const_iterator aTokenMatrixMapIter;
// Once upon a time we used to have FP exceptions on, and there was a
@@ -3371,7 +3665,7 @@ StackVar ScInterpreter::Interpret()
if ( nStackBase > sp )
nStackBase = sp; // underflow?!?
sp = nStackBase;
- PushTempToken( (*aTokenMatrixMapIter).second);
+ PushTempToken( (*aTokenMatrixMapIter).second.get());
}
else
{
@@ -3408,8 +3702,6 @@ StackVar ScInterpreter::Interpret()
case ocMacro : ScMacro(); break;
case ocDBArea : ScDBArea(); break;
case ocColRowNameAuto : ScColRowNameAuto(); break;
-// separated case ocPush : Push( (ScToken&) *pCur ); break;
- case ocExternalRef : ScExternalRef(); break;
case ocIf : ScIfJump(); break;
case ocChose : ScChoseJump(); break;
case ocAdd : ScAdd(); break;
@@ -3434,7 +3726,6 @@ StackVar ScInterpreter::Interpret()
case ocNeg : ScNeg(); break;
case ocPercentSign : ScPercentSign(); break;
case ocPi : ScPi(); break;
-// case ocDefPar : ScDefPar(); break;
case ocRandom : ScRandom(); break;
case ocTrue : ScTrue(); break;
case ocFalse : ScFalse(); break;
@@ -3532,9 +3823,9 @@ StackVar ScInterpreter::Interpret()
case ocGetTime : ScGetTime(); break;
case ocGetDiffDate : ScGetDiffDate(); break;
case ocGetDiffDate360 : ScGetDiffDate360(); break;
- case ocMin : ScMin( sal_False ); break;
+ case ocMin : ScMin( false ); break;
case ocMinA : ScMin( sal_True ); break;
- case ocMax : ScMax( sal_False ); break;
+ case ocMax : ScMax( false ); break;
case ocMaxA : ScMax( sal_True ); break;
case ocSum : ScSum(); break;
case ocProduct : ScProduct(); break;
@@ -3542,17 +3833,17 @@ StackVar ScInterpreter::Interpret()
case ocIRR : ScIRR(); break;
case ocMIRR : ScMIRR(); break;
case ocISPMT : ScISPMT(); break;
- case ocAverage : ScAverage( sal_False ); break;
+ case ocAverage : ScAverage( false ); break;
case ocAverageA : ScAverage( sal_True ); break;
case ocCount : ScCount(); break;
case ocCount2 : ScCount2(); break;
- case ocVar : ScVar( sal_False ); break;
+ case ocVar : ScVar( false ); break;
case ocVarA : ScVar( sal_True ); break;
- case ocVarP : ScVarP( sal_False ); break;
+ case ocVarP : ScVarP( false ); break;
case ocVarPA : ScVarP( sal_True ); break;
- case ocStDev : ScStDev( sal_False ); break;
+ case ocStDev : ScStDev( false ); break;
case ocStDevA : ScStDev( sal_True ); break;
- case ocStDevP : ScStDevP( sal_False ); break;
+ case ocStDevP : ScStDevP( false ); break;
case ocStDevPA : ScStDevP( sal_True ); break;
case ocBW : ScBW(); break;
case ocDIA : ScDIA(); break;
@@ -3695,7 +3986,6 @@ StackVar ScInterpreter::Interpret()
case ocBetaInv : ScBetaInv(); break;
case ocExternal : ScExternal(); break;
case ocTableOp : ScTableOp(); break;
-// case ocErrCell : ScErrCell(); break;
case ocStop : break;
case ocErrorType : ScErrorType(); break;
case ocCurrent : ScCurrent(); break;
@@ -3729,6 +4019,9 @@ StackVar ScInterpreter::Interpret()
continue; // while( ( pCur = aCode.Next() ) != NULL ...
}
+ if (FormulaCompiler::IsOpCodeVolatile(eOp))
+ meVolaileType = VOLATILE;
+
// Remember result matrix in case it could be reused.
if (pTokenMatrixMap && sp && GetStackType() == svMatrix)
pTokenMatrixMap->insert( ScTokenMatrixMap::value_type( pCur,
@@ -3864,7 +4157,8 @@ StackVar ScInterpreter::Interpret()
if ( bMatrixFormula )
{ // create matrix for {=A1:A5}
PopDoubleRefPushMatrix();
- // no break, continue with svMatrix
+ ScMatrixRef xMat = PopMatrix();
+ QueryMatrixType(xMat, nRetTypeExpr, nRetIndexExpr);
}
else
{
@@ -3874,55 +4168,36 @@ StackVar ScInterpreter::Interpret()
if ( !nGlobalError && DoubleRefToPosSingleRef( aRange, aAdr))
PushCellResultToken( false, aAdr,
&nRetTypeExpr, &nRetIndexExpr);
- break;
}
}
- // no break
+ break;
+ case svExternalDoubleRef:
case svMatrix :
{
- ScMatrixRef xMat = PopMatrix();
- if (xMat)
+ ScMatrixRef xMat;
+ if (pCur->GetType() == svMatrix)
+ xMat = PopMatrix();
+ else
+ PopExternalDoubleRef(xMat);
+
+ QueryMatrixType(xMat, nRetTypeExpr, nRetIndexExpr);
+ }
+ break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ ScExternalRefCache::CellFormat aFmt;
+ PopExternalSingleRef(pToken, &aFmt);
+ if (nGlobalError)
+ break;
+
+ PushTempToken(*pToken);
+
+ if (aFmt.mbIsSet)
{
- ScMatValType nMatValType;
- const ScMatrixValue* pMatVal = xMat->Get(0, 0, nMatValType);
- if ( pMatVal )
- {
- if (ScMatrix::IsNonValueType( nMatValType))
- {
- if ( xMat->IsEmptyPath( 0, 0))
- { // result of empty sal_False jump path
- FormulaTokenRef xRes = new FormulaDoubleToken( 0.0);
- PushTempToken( new ScMatrixCellResultToken( xMat, xRes));
- nRetTypeExpr = NUMBERFORMAT_LOGICAL;
- }
- else
- {
- String aStr( pMatVal->GetString());
- FormulaTokenRef xRes = new FormulaStringToken( aStr);
- PushTempToken( new ScMatrixCellResultToken( xMat, xRes));
- nRetTypeExpr = NUMBERFORMAT_TEXT;
- }
- }
- else
- {
- sal_uInt16 nErr = GetDoubleErrorValue( pMatVal->fVal);
- FormulaTokenRef xRes;
- if (nErr)
- xRes = new FormulaErrorToken( nErr);
- else
- xRes = new FormulaDoubleToken( pMatVal->fVal);
- PushTempToken( new ScMatrixCellResultToken( xMat, xRes));
- if ( nRetTypeExpr != NUMBERFORMAT_LOGICAL )
- nRetTypeExpr = NUMBERFORMAT_NUMBER;
- }
- nRetIndexExpr = 0;
- }
- else
- SetError( errUnknownStackVariable);
- xMat->SetErrorInterpreter( NULL);
+ nFuncFmtType = aFmt.mnType;
+ nFuncFmtIndex = aFmt.mnIndex;
}
- else
- SetError( errUnknownStackVariable);
}
break;
default :
@@ -3971,3 +4246,5 @@ StackVar ScInterpreter::Interpret()
static_cast<ScToken*>(xResult.operator->())->GetMatrix()->SetImmutable( true);
return eType;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index cf22b23e69ef..0d0b50d70baf 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
// INCLUDE ---------------------------------------------------------------
-#ifndef INCLUDED_RTL_MATH_HXX
#include <rtl/math.hxx>
-#endif
#include <rtl/logfile.hxx>
#include <string.h>
#include <math.h>
@@ -101,6 +100,28 @@ const double fInvEpsilon = 1.0E-7;
}
};
+namespace
+{
+
+// Multiply n x m Mat A with m x l Mat B to n x l Mat R
+void lcl_MFastMult(ScMatrixRef pA, ScMatrixRef pB, ScMatrixRef pR,
+ SCSIZE n, SCSIZE m, SCSIZE l)
+{
+ double sum;
+ for (SCSIZE row = 0; row < n; row++)
+ {
+ for (SCSIZE col = 0; col < l; col++)
+ { // result element(col, row) =sum[ (row of A) * (column of B)]
+ sum = 0.0;
+ for (SCSIZE k = 0; k < m; k++)
+ sum += pA->GetDouble(k,row) * pB->GetDouble(col,k);
+ pR->PutDouble(sum, col, row);
+ }
+ }
+}
+
+}
+
double ScInterpreter::ScGetGCD(double fx, double fy)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::div" );
@@ -173,8 +194,10 @@ void ScInterpreter::ScGCD()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nC, nR;
@@ -183,21 +206,23 @@ void ScInterpreter::ScGCD()
SetError(errIllegalArgument);
else
{
- SCSIZE nCount = nC * nR;
- for ( SCSIZE j = 0; j < nCount; j++ )
+ for ( SCSIZE j = 0; j < nC; j++ )
{
- if (!pMat->IsValue(j))
+ for (SCSIZE k = 0; k < nR; ++k)
{
- PushIllegalArgument();
- return;
+ if (!pMat->IsValue(j,k))
+ {
+ PushIllegalArgument();
+ return;
+ }
+ fx = ::rtl::math::approxFloor( pMat->GetDouble(j,k));
+ if (fx < 0.0)
+ {
+ PushIllegalArgument();
+ return;
+ }
+ fy = ScGetGCD(fx, fy);
}
- fx = ::rtl::math::approxFloor( pMat->GetDouble(j));
- if (fx < 0.0)
- {
- PushIllegalArgument();
- return;
- }
- fy = ScGetGCD(fx, fy);
}
}
}
@@ -265,8 +290,10 @@ void ScInterpreter:: ScLCM()
}
break;
case svMatrix :
+ case svExternalSingleRef:
+ case svExternalDoubleRef:
{
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if (pMat)
{
SCSIZE nC, nR;
@@ -275,24 +302,26 @@ void ScInterpreter:: ScLCM()
SetError(errIllegalArgument);
else
{
- SCSIZE nCount = nC * nR;
- for ( SCSIZE j = 0; j < nCount; j++ )
+ for ( SCSIZE j = 0; j < nC; j++ )
{
- if (!pMat->IsValue(j))
- {
- PushIllegalArgument();
- return;
- }
- fx = ::rtl::math::approxFloor( pMat->GetDouble(j));
- if (fx < 0.0)
+ for (SCSIZE k = 0; k < nR; ++k)
{
- PushIllegalArgument();
- return;
+ if (!pMat->IsValue(j,k))
+ {
+ PushIllegalArgument();
+ return;
+ }
+ fx = ::rtl::math::approxFloor( pMat->GetDouble(j,k));
+ if (fx < 0.0)
+ {
+ PushIllegalArgument();
+ return;
+ }
+ if (fx == 0.0 || fy == 0.0)
+ fy = 0.0;
+ else
+ fy = fx * fy / ScGetGCD(fx, fy);
}
- if (fx == 0.0 || fy == 0.0)
- fy = 0.0;
- else
- fy = fx * fy / ScGetGCD(fx, fy);
}
}
}
@@ -308,7 +337,7 @@ void ScInterpreter:: ScLCM()
ScMatrixRef ScInterpreter::GetNewMat(SCSIZE nC, SCSIZE nR)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetNewMat" );
- ScMatrix* pMat = new ScMatrix( nC, nR);
+ ScMatrixRef pMat = new ScMatrix( nC, nR);
pMat->SetErrorInterpreter( this);
// A temporary matrix is mutable and ScMatrix::CloneIfConst() returns the
// very matrix.
@@ -318,12 +347,16 @@ ScMatrixRef ScInterpreter::GetNewMat(SCSIZE nC, SCSIZE nR)
if ( nCols != nC || nRows != nR )
{ // arbitray limit of elements exceeded
SetError( errStackOverflow);
- pMat->Delete();
- pMat = NULL;
+ pMat.reset();
}
return pMat;
}
+ScInterpreter::VolatileType ScInterpreter::GetVolatileType() const
+{
+ return meVolaileType;
+}
+
ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken,
SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2 )
@@ -462,7 +495,7 @@ ScMatrixRef ScInterpreter::GetMatrix()
{
ScBaseCell* pCell = GetCell( aAdr );
if (HasCellEmptyData(pCell))
- pMat->PutEmpty( 0 );
+ pMat->PutEmpty(0, 0);
else if (HasCellValueData(pCell))
pMat->PutDouble(GetCellValue(aAdr, pCell), 0);
else
@@ -522,6 +555,31 @@ ScMatrixRef ScInterpreter::GetMatrix()
}
}
break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ if (!pToken)
+ {
+ PopError();
+ SetError( errIllegalArgument);
+ break;
+ }
+ if (pToken->GetType() == svDouble)
+ {
+ pMat = new ScMatrix(1, 1);
+ pMat->PutDouble(pToken->GetDouble(), 0, 0);
+ }
+ else
+ {
+ pMat = new ScMatrix(1, 1);
+ pMat->PutString(pToken->GetString(), 0, 0);
+ }
+ }
+ break;
+ case svExternalDoubleRef:
+ PopExternalDoubleRef(pMat);
+ break;
default:
PopError();
SetError( errIllegalArgument);
@@ -592,7 +650,7 @@ void ScInterpreter::ScMatValue()
case svMatrix:
{
ScMatrixRef pMat = PopMatrix();
- CalculateMatrixValue(pMat,nC,nR);
+ CalculateMatrixValue(pMat.get(),nC,nR);
}
break;
default:
@@ -611,12 +669,12 @@ void ScInterpreter::CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE n
pMat->GetDimensions(nCl, nRw);
if (nC < nCl && nR < nRw)
{
- ScMatValType nMatValType;
- const ScMatrixValue* pMatVal = pMat->Get( nC, nR,nMatValType);
+ const ScMatrixValue nMatVal = pMat->Get( nC, nR);
+ ScMatValType nMatValType = nMatVal.nType;
if (ScMatrix::IsNonValueType( nMatValType))
- PushString( pMatVal->GetString() );
+ PushString( nMatVal.GetString() );
else
- PushDouble(pMatVal->fVal);
+ PushDouble(nMatVal.fVal);
// also handles DoubleError
}
else
@@ -648,7 +706,7 @@ void ScInterpreter::ScEMat()
}
}
-void ScInterpreter::MEMat(ScMatrix* mM, SCSIZE n)
+void ScInterpreter::MEMat(const ScMatrixRef& mM, SCSIZE n)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::MEMat" );
mM->FillDouble(0.0, 0, 0, n-1, n-1);
@@ -656,25 +714,6 @@ void ScInterpreter::MEMat(ScMatrix* mM, SCSIZE n)
mM->PutDouble(1.0, i, i);
}
-void ScInterpreter::MFastMult(ScMatrix* pA, ScMatrix* pB, ScMatrix* pR,
- SCSIZE n, SCSIZE m, SCSIZE l)
- // Multipliziert n x m Mat a mit m x l Mat b nach Mat r
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::MFastMult" );
- double sum;
- for (SCSIZE i = 0; i < n; i++)
- {
- for (SCSIZE j = 0; j < l; j++)
- {
- sum = 0.0;
- for (SCSIZE k = 0; k < m; k++)
- sum += pA->GetDouble(i,k)*pB->GetDouble(k,j);
- pR->PutDouble(sum, i, j);
- }
- }
-}
-
-
/* Matrix LUP decomposition according to the pseudocode of "Introduction to
* Algorithms" by Cormen, Leiserson, Rivest, Stein.
*
@@ -690,7 +729,7 @@ void ScInterpreter::MFastMult(ScMatrix* pA, ScMatrix* pB, ScMatrix* pR,
* permutations (row exchanges).
*
* Returns 0 if a singular matrix is encountered, else +1 if an even number of
- * permutations occured, or -1 if odd, which is the sign of the determinant.
+ * permutations occurred, or -1 if odd, which is the sign of the determinant.
* This may be used to calculate the determinant by multiplying the sign with
* the product of the diagonal elements of the LU matrix.
*/
@@ -779,6 +818,13 @@ static int lcl_LUP_decompose( ScMatrix* mA, const SCSIZE n,
fprintf( stderr, "%5u ", (unsigned)P[j]);
fprintf( stderr, "\n%s\n", "");
#endif
+
+ bool bSingular=false;
+ for (SCSIZE i=0; i<n && !bSingular; i++)
+ bSingular = bSingular || ((mA->GetDouble(i,i))==0.0);
+ if (bSingular)
+ nSign = 0;
+
return nSign;
}
@@ -857,7 +903,7 @@ void ScInterpreter::ScMatDet()
else
{
::std::vector< SCSIZE> P(nR);
- int nDetSign = lcl_LUP_decompose( xLU, nR, P);
+ int nDetSign = lcl_LUP_decompose( xLU.get(), nR, P);
if (!nDetSign)
PushInt(0); // singular matrix
else
@@ -865,9 +911,8 @@ void ScInterpreter::ScMatDet()
// In an LU matrix the determinant is simply the product of
// all diagonal elements.
double fDet = nDetSign;
- ScMatrix* pLU = xLU;
for (SCSIZE i=0; i < nR; ++i)
- fDet *= pLU->GetDouble( i, i);
+ fDet *= xLU->GetDouble( i, i);
PushDouble( fDet);
}
}
@@ -906,13 +951,12 @@ void ScInterpreter::ScMatInv()
else
{
::std::vector< SCSIZE> P(nR);
- int nDetSign = lcl_LUP_decompose( xLU, nR, P);
+ int nDetSign = lcl_LUP_decompose( xLU.get(), nR, P);
if (!nDetSign)
PushIllegalArgument();
else
{
// Solve equation for each column.
- ScMatrix* pY = xY;
::std::vector< double> B(nR);
::std::vector< double> X(nR);
for (SCSIZE j=0; j < nR; ++j)
@@ -920,11 +964,11 @@ void ScInterpreter::ScMatInv()
for (SCSIZE i=0; i < nR; ++i)
B[i] = 0.0;
B[j] = 1.0;
- lcl_LUP_solve( xLU, nR, P, B, X);
+ lcl_LUP_solve( xLU.get(), nR, P, B, X);
for (SCSIZE i=0; i < nR; ++i)
- pY->PutDouble( X[i], j, i);
+ xY->PutDouble( X[i], j, i);
}
-#if 0
+#if OSL_DEBUG_LEVEL > 1
/* Possible checks for ill-condition:
* 1. Scale matrix, invert scaled matrix. If there are
* elements of the inverted matrix that are several
@@ -945,32 +989,26 @@ void ScInterpreter::ScMatInv()
ScMatrixRef xR = GetNewMat( nR, nR);
if (xR)
{
- ScMatrix* pR = xR;
- MFastMult( pMat, pY, pR, nR, nR, nR);
-#if OSL_DEBUG_LEVEL > 1
+ ScMatrix* pR = xR.get();
+ lcl_MFastMult( pMat, xY.get(), pR, nR, nR, nR);
fprintf( stderr, "\n%s\n", "ScMatInv(): mult-identity");
-#endif
for (SCSIZE i=0; i < nR; ++i)
{
for (SCSIZE j=0; j < nR; ++j)
{
double fTmp = pR->GetDouble( j, i);
-#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "%8.2g ", fTmp);
-#endif
if (fabs( fTmp - (i == j)) > fInvEpsilon)
SetError( errIllegalArgument);
}
-#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "\n%s\n", "");
-#endif
}
}
#endif
if (nGlobalError)
PushError( nGlobalError);
else
- PushMatrix( pY);
+ PushMatrix( xY);
}
}
}
@@ -1082,7 +1120,6 @@ ScMatrixRef lcl_MatrixCalculation(const _Function& _pOperation,ScMatrix* pMat1,
ScMatrixRef xResMat = _pIterpreter->GetNewMat(nMinC, nMinR);
if (xResMat)
{
- ScMatrix* pResMat = xResMat;
for (i = 0; i < nMinC; i++)
{
for (j = 0; j < nMinR; j++)
@@ -1090,17 +1127,17 @@ ScMatrixRef lcl_MatrixCalculation(const _Function& _pOperation,ScMatrix* pMat1,
if (pMat1->IsValueOrEmpty(i,j) && pMat2->IsValueOrEmpty(i,j))
{
double d = _pOperation(pMat1->GetDouble(i,j),pMat2->GetDouble(i,j));
- pResMat->PutDouble( d, i, j);
+ xResMat->PutDouble( d, i, j);
}
else
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i, j);
+ xResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i, j);
}
}
}
return xResMat;
}
-ScMatrixRef ScInterpreter::MatConcat(ScMatrix* pMat1, ScMatrix* pMat2)
+ScMatrixRef ScInterpreter::MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef& pMat2)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::MatConcat" );
SCSIZE nC1, nC2, nMinC;
@@ -1113,7 +1150,6 @@ ScMatrixRef ScInterpreter::MatConcat(ScMatrix* pMat1, ScMatrix* pMat2)
ScMatrixRef xResMat = GetNewMat(nMinC, nMinR);
if (xResMat)
{
- ScMatrix* pResMat = xResMat;
for (i = 0; i < nMinC; i++)
{
for (j = 0; j < nMinR; j++)
@@ -1122,12 +1158,12 @@ ScMatrixRef ScInterpreter::MatConcat(ScMatrix* pMat1, ScMatrix* pMat2)
if (!nErr)
nErr = pMat2->GetErrorIfNotString( i, j);
if (nErr)
- pResMat->PutError( nErr, i, j);
+ xResMat->PutError( nErr, i, j);
else
{
String aTmp( pMat1->GetString( *pFormatter, i, j));
aTmp += pMat2->GetString( *pFormatter, i, j);
- pResMat->PutString( aTmp, i, j);
+ xResMat->PutString( aTmp, i, j);
}
}
}
@@ -1167,7 +1203,7 @@ void lcl_GetDiffDateTimeFmtType( short& nFuncFmt, short nFmt1, short nFmt2 )
void ScInterpreter::ScAdd()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScAdd" );
- CalculateAddSub(sal_False);
+ CalculateAddSub(false);
}
void ScInterpreter::CalculateAddSub(sal_Bool _bSub)
{
@@ -1228,12 +1264,12 @@ void ScInterpreter::CalculateAddSub(sal_Bool _bSub)
if ( _bSub )
{
MatrixSub aSub;
- pResMat = lcl_MatrixCalculation(aSub ,pMat1, pMat2,this);
+ pResMat = lcl_MatrixCalculation(aSub ,pMat1.get(), pMat2.get(),this);
}
else
{
MatrixAdd aAdd;
- pResMat = lcl_MatrixCalculation(aAdd ,pMat1, pMat2,this);
+ pResMat = lcl_MatrixCalculation(aAdd ,pMat1.get(), pMat2.get(),this);
}
if (!pResMat)
@@ -1255,7 +1291,7 @@ void ScInterpreter::CalculateAddSub(sal_Bool _bSub)
else
{
fVal = fVal2;
- bFlag = sal_False; // Matrix - double
+ bFlag = false; // Matrix - double
}
SCSIZE nC, nR;
pMat->GetDimensions(nC, nR);
@@ -1340,48 +1376,50 @@ void ScInterpreter::ScAmpersand()
else
{
sStr = sStr2;
- bFlag = sal_False; // Matrix - double
+ bFlag = false; // Matrix - double
}
SCSIZE nC, nR;
pMat->GetDimensions(nC, nR);
ScMatrixRef pResMat = GetNewMat(nC, nR);
if (pResMat)
{
- SCSIZE nCount = nC * nR;
if (nGlobalError)
{
- for ( SCSIZE i = 0; i < nCount; i++ )
- pResMat->PutError( nGlobalError, i);
+ for (SCSIZE i = 0; i < nC; ++i)
+ for (SCSIZE j = 0; j < nR; ++j)
+ pResMat->PutError( nGlobalError, i, j);
}
else if (bFlag)
{
- for ( SCSIZE i = 0; i < nCount; i++ )
- {
- sal_uInt16 nErr = pMat->GetErrorIfNotString( i);
- if (nErr)
- pResMat->PutError( nErr, i);
- else
+ for (SCSIZE i = 0; i < nC; ++i)
+ for (SCSIZE j = 0; j < nR; ++j)
{
- String aTmp( sStr);
- aTmp += pMat->GetString( *pFormatter, i);
- pResMat->PutString( aTmp, i);
+ sal_uInt16 nErr = pMat->GetErrorIfNotString( i, j);
+ if (nErr)
+ pResMat->PutError( nErr, i, j);
+ else
+ {
+ String aTmp( sStr);
+ aTmp += pMat->GetString( *pFormatter, i, j);
+ pResMat->PutString( aTmp, i, j);
+ }
}
- }
}
else
{
- for ( SCSIZE i = 0; i < nCount; i++ )
- {
- sal_uInt16 nErr = pMat->GetErrorIfNotString( i);
- if (nErr)
- pResMat->PutError( nErr, i);
- else
+ for (SCSIZE i = 0; i < nC; ++i)
+ for (SCSIZE j = 0; j < nR; ++j)
{
- String aTmp( pMat->GetString( *pFormatter, i));
- aTmp += sStr;
- pResMat->PutString( aTmp, i);
+ sal_uInt16 nErr = pMat->GetErrorIfNotString( i, j);
+ if (nErr)
+ pResMat->PutError( nErr, i, j);
+ else
+ {
+ String aTmp( pMat->GetString( *pFormatter, i, j));
+ aTmp += sStr;
+ pResMat->PutString( aTmp, i, j);
+ }
}
- }
}
PushMatrix(pResMat);
}
@@ -1439,7 +1477,7 @@ void ScInterpreter::ScMul()
if (pMat1 && pMat2)
{
MatrixMul aMul;
- ScMatrixRef pResMat = lcl_MatrixCalculation(aMul,pMat1, pMat2,this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation(aMul,pMat1.get(), pMat2.get(),this);
if (!pResMat)
PushNoValue();
else
@@ -1514,7 +1552,7 @@ void ScInterpreter::ScDiv()
if (pMat1 && pMat2)
{
MatrixDiv aDiv;
- ScMatrixRef pResMat = lcl_MatrixCalculation(aDiv,pMat1, pMat2,this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation(aDiv,pMat1.get(), pMat2.get(),this);
if (!pResMat)
PushNoValue();
else
@@ -1534,7 +1572,7 @@ void ScInterpreter::ScDiv()
else
{
fVal = fVal2;
- bFlag = sal_False; // Matrix - double
+ bFlag = false; // Matrix - double
}
SCSIZE nC, nR;
pMat->GetDimensions(nC, nR);
@@ -1596,7 +1634,7 @@ void ScInterpreter::ScPow()
if (pMat1 && pMat2)
{
MatrixPow aPow;
- ScMatrixRef pResMat = lcl_MatrixCalculation(aPow,pMat1, pMat2,this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation(aPow,pMat1.get(), pMat2.get(),this);
if (!pResMat)
PushNoValue();
else
@@ -1616,7 +1654,7 @@ void ScInterpreter::ScPow()
else
{
fVal = fVal2;
- bFlag = sal_False; // Matrix - double
+ bFlag = false; // Matrix - double
}
SCSIZE nC, nR;
pMat->GetDimensions(nC, nR);
@@ -1682,7 +1720,7 @@ void ScInterpreter::ScSumProduct()
PushNoValue();
return;
}
- ScMatrixRef pResMat = lcl_MatrixCalculation(aMul,pMat1, pMat,this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation(aMul,pMat1.get(), pMat.get(),this);
if (!pResMat)
{
PushNoValue();
@@ -1704,7 +1742,7 @@ void ScInterpreter::ScSumProduct()
void ScInterpreter::ScSumX2MY2()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScSumX2MY2" );
- CalculateSumX2MY2SumX2DY2(sal_False);
+ CalculateSumX2MY2SumX2DY2(false);
}
void ScInterpreter::CalculateSumX2MY2SumX2DY2(sal_Bool _bSumX2DY2)
{
@@ -1778,7 +1816,7 @@ void ScInterpreter::ScSumXMY2()
return;
} // if (nC1 != nC2 || nR1 != nR2)
MatrixSub aSub;
- ScMatrixRef pResMat = lcl_MatrixCalculation(aSub,pMat1, pMat2,this);
+ ScMatrixRef pResMat = lcl_MatrixCalculation(aSub,pMat1.get(), pMat2.get(),this);
if (!pResMat)
{
PushNoValue();
@@ -1852,212 +1890,386 @@ void ScInterpreter::ScFrequency()
PushMatrix(pResMat);
}
-sal_Bool ScInterpreter::RGetVariances( ScMatrix* pV, ScMatrix* pX,
- SCSIZE nC, SCSIZE nR, sal_Bool bSwapColRow, sal_Bool bZeroConstant )
-{ // multiple Regression: Varianzen der Koeffizienten
- // bSwapColRow==sal_True : Koeffizienten in Zeilen statt Spalten angeordnet
- SCSIZE i, j, k;
- double sum;
- ScMatrixRef pC = GetNewMat(nC, nC);
- if ( !pC )
- return sal_False;
- // X transformiert mit X multipziert, X'X Matrix
- if ( !bZeroConstant )
- { // in der X-Designmatrix existiert ein gedachtes X0j==1
- if ( bSwapColRow )
- {
- for ( i=0; i<nC; i++ )
- {
- for ( j=0; j<nC; j++ )
- {
- sum = 0.0;
- for ( k=0; k<nR; k++ )
- {
- sum += (j==0 ? 1 : pX->GetDouble(k,j-1))
- * (i==0 ? 1 : pX->GetDouble(k,i-1));
- }
- pC->PutDouble(sum, i, j);
- }
- }
+namespace {
+
+// -----------------------------------------------------------------------------
+// Helper methods for LINEST/LOGEST and TREND/GROWTH
+// All matrices must already exist and have the needed size, no control tests
+// done. Those methodes, which names start with lcl_T, are adapted to case 3,
+// where Y (=observed values) is given as row.
+// Remember, ScMatrix matrices are zero based, index access (column,row).
+// -----------------------------------------------------------------------------
+
+// <A;B> over all elements; uses the matrices as vectors of length M
+double lcl_GetSumProduct(ScMatrixRef pMatA, ScMatrixRef pMatB, SCSIZE nM)
+{
+ double fSum = 0.0;
+ for (SCSIZE i=0; i<nM; i++)
+ fSum += pMatA->GetDouble(i) * pMatB->GetDouble(i);
+ return fSum;
+}
+
+// Special version for use within QR decomposition.
+// Euclidean norm of column index C starting in row index R;
+// matrix A has count N rows.
+double lcl_GetColumnEuclideanNorm(ScMatrixRef pMatA, SCSIZE nC, SCSIZE nR, SCSIZE nN)
+{
+ double fNorm = 0.0;
+ for (SCSIZE row=nR; row<nN; row++)
+ fNorm += (pMatA->GetDouble(nC,row)) * (pMatA->GetDouble(nC,row));
+ return sqrt(fNorm);
+}
+
+// Euclidean norm of row index R starting in column index C;
+// matrix A has count N columns.
+double lcl_TGetColumnEuclideanNorm(ScMatrixRef pMatA, SCSIZE nR, SCSIZE nC, SCSIZE nN)
+{
+ double fNorm = 0.0;
+ for (SCSIZE col=nC; col<nN; col++)
+ fNorm += (pMatA->GetDouble(col,nR)) * (pMatA->GetDouble(col,nR));
+ return sqrt(fNorm);
+}
+
+// Special version for use within QR decomposition.
+// Maximum norm of column index C starting in row index R;
+// matrix A has count N rows.
+double lcl_GetColumnMaximumNorm(ScMatrixRef pMatA, SCSIZE nC, SCSIZE nR, SCSIZE nN)
+{
+ double fNorm = 0.0;
+ for (SCSIZE row=nR; row<nN; row++)
+ if (fNorm < fabs(pMatA->GetDouble(nC,row)))
+ fNorm = fabs(pMatA->GetDouble(nC,row));
+ return fNorm;
+}
+
+// Maximum norm of row index R starting in col index C;
+// matrix A has count N columns.
+double lcl_TGetColumnMaximumNorm(ScMatrixRef pMatA, SCSIZE nR, SCSIZE nC, SCSIZE nN)
+{
+ double fNorm = 0.0;
+ for (SCSIZE col=nC; col<nN; col++)
+ if (fNorm < fabs(pMatA->GetDouble(col,nR)))
+ fNorm = fabs(pMatA->GetDouble(col,nR));
+ return fNorm;
+}
+
+// Special version for use within QR decomposition.
+// <A(Ca);B(Cb)> starting in row index R;
+// Ca and Cb are indices of columns, matrices A and B have count N rows.
+double lcl_GetColumnSumProduct(ScMatrixRef pMatA, SCSIZE nCa,
+ ScMatrixRef pMatB, SCSIZE nCb, SCSIZE nR, SCSIZE nN)
+{
+ double fResult = 0.0;
+ for (SCSIZE row=nR; row<nN; row++)
+ fResult += pMatA->GetDouble(nCa,row) * pMatB->GetDouble(nCb,row);
+ return fResult;
+}
+
+// <A(Ra);B(Rb)> starting in column index C;
+// Ra and Rb are indices of rows, matrices A and B have count N columns.
+double lcl_TGetColumnSumProduct(ScMatrixRef pMatA, SCSIZE nRa,
+ ScMatrixRef pMatB, SCSIZE nRb, SCSIZE nC, SCSIZE nN)
+{
+ double fResult = 0.0;
+ for (SCSIZE col=nC; col<nN; col++)
+ fResult += pMatA->GetDouble(col,nRa) * pMatB->GetDouble(col,nRb);
+ return fResult;
+}
+
+double lcl_GetSign(double fValue)
+{
+ if (fValue < 0.0)
+ return -1.0;
+ else if (fValue > 0.0)
+ return 1.0;
+ else
+ return 0.0;
+}
+
+/* Calculates a QR decomposition with Householder reflection.
+ * For each NxK matrix A exists a decomposition A=Q*R with an orthogonal
+ * NxN matrix Q and a NxK matrix R.
+ * Q=H1*H2*...*Hk with Householder matrices H. Such a householder matrix can
+ * be build from a vector u by H=I-(2/u'u)*(u u'). This vectors u are returned
+ * in the columns of matrix A, overwriting the old content.
+ * The matrix R has a quadric upper part KxK with values in the upper right
+ * triangle and zeros in all other elements. Here the diagonal elements of R
+ * are stored in the vector R and the other upper right elements in the upper
+ * right of the matrix A.
+ * The function returns false, if calculation breaks. But because of round-off
+ * errors singularity is often not detected.
+ */
+bool lcl_CalculateQRdecomposition(ScMatrixRef pMatA,
+ ::std::vector< double>& pVecR, SCSIZE nK, SCSIZE nN)
+{
+ double fScale ;
+ double fEuclid ;
+ double fFactor ;
+ double fSignum ;
+ double fSum ;
+ // ScMatrix matrices are zero based, index access (column,row)
+ for (SCSIZE col = 0; col <nK; col++)
+ {
+ // calculate vector u of the householder transformation
+ fScale = lcl_GetColumnMaximumNorm(pMatA, col, col, nN);
+ if (fScale == 0.0)
+ {
+ // A is singular
+ return false;
}
- else
+ for (SCSIZE row = col; row <nN; row++)
+ pMatA->PutDouble( pMatA->GetDouble(col,row)/fScale, col, row);
+
+ fEuclid = lcl_GetColumnEuclideanNorm(pMatA, col, col, nN);
+ fFactor = 1.0/fEuclid/(fEuclid + fabs(pMatA->GetDouble(col,col)));
+ fSignum = lcl_GetSign(pMatA->GetDouble(col,col));
+ pMatA->PutDouble( pMatA->GetDouble(col,col) + fSignum*fEuclid, col,col);
+ pVecR[col] = -fSignum * fScale * fEuclid;
+
+ // apply Householder transformation to A
+ for (SCSIZE c=col+1; c<nK; c++)
{
- for ( i=0; i<nC; i++ )
- {
- for ( j=0; j<nC; j++ )
- {
- sum = 0.0;
- for ( k=0; k<nR; k++ )
- {
- sum += (j==0 ? 1 : pX->GetDouble(j-1,k))
- * (i==0 ? 1 : pX->GetDouble(i-1,k));
- }
- pC->PutDouble(sum, i, j);
- }
- }
+ fSum =lcl_GetColumnSumProduct(pMatA, col, pMatA, c, col, nN);
+ for (SCSIZE row = col; row <nN; row++)
+ pMatA->PutDouble( pMatA->GetDouble(c,row) - fSum * fFactor * pMatA->GetDouble(col,row), c, row);
}
}
- else
- {
- if ( bSwapColRow )
- {
- for ( i=0; i<nC; i++ )
- {
- for ( j=0; j<nC; j++ )
- {
- sum = 0.0;
- for ( k=0; k<nR; k++ )
- {
- sum += pX->GetDouble(k,j) * pX->GetDouble(k,i);
- }
- pC->PutDouble(sum, i, j);
- }
- }
+ return true;
+}
+
+// same with transposed matrix A, N is count of columns, K count of rows
+bool lcl_TCalculateQRdecomposition(ScMatrixRef pMatA,
+ ::std::vector< double>& pVecR, SCSIZE nK, SCSIZE nN)
+{
+ double fScale ;
+ double fEuclid ;
+ double fFactor ;
+ double fSignum ;
+ double fSum ;
+ // ScMatrix matrices are zero based, index access (column,row)
+ for (SCSIZE row = 0; row <nK; row++)
+ {
+ // calculate vector u of the householder transformation
+ fScale = lcl_TGetColumnMaximumNorm(pMatA, row, row, nN);
+ if (fScale == 0.0)
+ {
+ // A is singular
+ return false;
}
- else
+ for (SCSIZE col = row; col <nN; col++)
+ pMatA->PutDouble( pMatA->GetDouble(col,row)/fScale, col, row);
+
+ fEuclid = lcl_TGetColumnEuclideanNorm(pMatA, row, row, nN);
+ fFactor = 1.0/fEuclid/(fEuclid + fabs(pMatA->GetDouble(row,row)));
+ fSignum = lcl_GetSign(pMatA->GetDouble(row,row));
+ pMatA->PutDouble( pMatA->GetDouble(row,row) + fSignum*fEuclid, row,row);
+ pVecR[row] = -fSignum * fScale * fEuclid;
+
+ // apply Householder transformation to A
+ for (SCSIZE r=row+1; r<nK; r++)
{
- for ( i=0; i<nC; i++ )
- {
- for ( j=0; j<nC; j++ )
- {
- sum = 0.0;
- for ( k=0; k<nR; k++ )
- {
- sum += pX->GetDouble(j,k) * pX->GetDouble(i,k);
- }
- pC->PutDouble(sum, i, j);
- }
- }
+ fSum =lcl_TGetColumnSumProduct(pMatA, row, pMatA, r, row, nN);
+ for (SCSIZE col = row; col <nN; col++)
+ pMatA->PutDouble(
+ pMatA->GetDouble(col,r) - fSum * fFactor * pMatA->GetDouble(col,row), col, r);
}
}
- // X'X Inverse
- sal_Bool bOk = sal_True;
- sal_uInt16 nErr = nGlobalError;
- PushMatrix(pC);
- sal_uInt8 nTmp = cPar;
- cPar = 1;
- ScMatInv();
- cPar = nTmp;
- if ( nGlobalError )
- {
- nGlobalError = nErr;
- bOk = sal_False;
+ return true;
+}
+
+
+/* Applies a Householder transformation to a column vector Y with is given as
+ * Nx1 Matrix. The Vektor u, from which the Householder transformation is build,
+ * is the column part in matrix A, with column index C, starting with row
+ * index C. A is the result of the QR decomposition as obtained from
+ * lcl_CaluclateQRdecomposition.
+ */
+void lcl_ApplyHouseholderTransformation(ScMatrixRef pMatA, SCSIZE nC,
+ ScMatrixRef pMatY, SCSIZE nN)
+{
+ // ScMatrix matrices are zero based, index access (column,row)
+ double fDenominator = lcl_GetColumnSumProduct(pMatA, nC, pMatA, nC, nC, nN);
+ double fNumerator = lcl_GetColumnSumProduct(pMatA, nC, pMatY, 0, nC, nN);
+ double fFactor = 2.0 * (fNumerator/fDenominator);
+ for (SCSIZE row = nC; row < nN; row++)
+ pMatY->PutDouble(
+ pMatY->GetDouble(row) - fFactor * pMatA->GetDouble(nC,row), row);
+}
+
+// Same with transposed matrices A and Y.
+void lcl_TApplyHouseholderTransformation(ScMatrixRef pMatA, SCSIZE nR,
+ ScMatrixRef pMatY, SCSIZE nN)
+{
+ // ScMatrix matrices are zero based, index access (column,row)
+ double fDenominator = lcl_TGetColumnSumProduct(pMatA, nR, pMatA, nR, nR, nN);
+ double fNumerator = lcl_TGetColumnSumProduct(pMatA, nR, pMatY, 0, nR, nN);
+ double fFactor = 2.0 * (fNumerator/fDenominator);
+ for (SCSIZE col = nR; col < nN; col++)
+ pMatY->PutDouble(
+ pMatY->GetDouble(col) - fFactor * pMatA->GetDouble(col,nR), col);
+}
+
+/* Solve for X in R*X=S using back substitution. The solution X overwrites S.
+ * Uses R from the result of the QR decomposition of a NxK matrix A.
+ * S is a column vector given as matrix, with at least elements on index
+ * 0 to K-1; elements on index>=K are ignored. Vector R must not have zero
+ * elements, no check is done.
+ */
+void lcl_SolveWithUpperRightTriangle(ScMatrixRef pMatA,
+ ::std::vector< double>& pVecR, ScMatrixRef pMatS,
+ SCSIZE nK, bool bIsTransposed)
+{
+ // ScMatrix matrices are zero based, index access (column,row)
+ double fSum;
+ SCSIZE row;
+ // SCSIZE is never negative, therefore test with rowp1=row+1
+ for (SCSIZE rowp1 = nK; rowp1>0; rowp1--)
+ {
+ row = rowp1-1;
+ fSum = pMatS->GetDouble(row);
+ for (SCSIZE col = rowp1; col<nK ; col++)
+ if (bIsTransposed)
+ fSum -= pMatA->GetDouble(row,col) * pMatS->GetDouble(col);
+ else
+ fSum -= pMatA->GetDouble(col,row) * pMatS->GetDouble(col);
+ pMatS->PutDouble( fSum / pVecR[row] , row);
}
- else
+}
+
+/* Solve for X in R' * X= T using forward substitution. The solution X
+ * overwrites T. Uses R from the result of the QR decomposition of a NxK
+ * matrix A. T is a column vectors given as matrix, with at least elements on
+ * index 0 to K-1; elements on index>=K are ignored. Vector R must not have
+ * zero elements, no check is done.
+ */
+void lcl_SolveWithLowerLeftTriangle(ScMatrixRef pMatA,
+ ::std::vector< double>& pVecR, ScMatrixRef pMatT,
+ SCSIZE nK, bool bIsTransposed)
+{
+ // ScMatrix matrices are zero based, index access (column,row)
+ double fSum;
+ for (SCSIZE row = 0; row < nK; row++)
{
- // #i61216# ScMatInv no longer modifies the original matrix, so just calling Pop() doesn't work
- pC = PopMatrix();
- if ( pC.Is() )
+ fSum = pMatT -> GetDouble(row);
+ for (SCSIZE col=0; col < row; col++)
{
- // Varianzen auf der Diagonalen, andere sind Kovarianzen
- for (i = 0; i < nC; i++)
- pV->PutDouble(pC->GetDouble(i, i), i);
+ if (bIsTransposed)
+ fSum -= pMatA->GetDouble(col,row) * pMatT->GetDouble(col);
+ else
+ fSum -= pMatA->GetDouble(row,col) * pMatT->GetDouble(col);
}
+ pMatT->PutDouble( fSum / pVecR[row] , row);
}
- return bOk;
}
-// -----------------------------------------------------------------------------
-void ScInterpreter::Calculate(ScMatrixRef& pResMat,ScMatrixRef& pE,ScMatrixRef& pQ,ScMatrixRef& pV,ScMatrixRef& pMatX,sal_Bool bConstant,SCSIZE N,SCSIZE M,sal_uInt8 nCase)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::RGetVariances" );
- // pE[0] := Sigma i=1...n (Yi)
- // pE[k] := Sigma i=1...n (Xki*Yi)
- // pE[M+1] := Sigma i=1...n (Yi**2)
- // pQ[0,M+1]:= B
- // pQ[k,M+1]:= Mk
- double fSQR, fSQT, fSQE;
- fSQT = pE->GetDouble(M+1)
- - pE->GetDouble(0) * pE->GetDouble(0) / (double)N;
- fSQR = pE->GetDouble(M+1);
- SCSIZE i, j;
- for (i = 0; i < M+1; i++)
- fSQR -= pQ->GetDouble(i, M+1) * pE->GetDouble(i);
- fSQE = fSQT-fSQR;
- // r2 (Bestimmtheitsmass, 0...1)
- if (fSQT == 0.0)
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 0, 2);
- else
- pResMat->PutDouble (fSQE/fSQT, 0, 2);
- // ssReg (Regressions-Quadratsumme)
- pResMat->PutDouble(fSQE, 0, 4);
- // ssResid (Residual-Quadratsumme, Summe der Abweichungsquadrate)
- pResMat->PutDouble(fSQR, 1, 4);
- for (i = 2; i < 5; i++)
- for (j = 2; j < M+1; j++)
- pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), j, i);
- if (bConstant)
- {
- if (N-M-1 == 0)
- {
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 1, 2);
- for (i = 0; i < M+1; i++)
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i, 1);
- }
- else
- {
- double fSE2 = fSQR/(N-M-1);
- // sey (Standardfehler des Schaetzwertes y)
- pResMat->PutDouble(sqrt(fSE2), 1, 2);
- // sen...se1 (Standardfehler der Koeffizienten mn...m1)
- // seb (Standardfehler der Konstanten b)
- if ( RGetVariances( pV, pMatX, M+1, N, nCase != 2, sal_False ) )
- {
- for (i = 0; i < M+1; i++)
- pResMat->PutDouble( sqrt(fSE2 * pV->GetDouble(i)), M-i, 1 );
- }
+
+/* Calculates Z = R * B
+ * R is given in matrix A and vector VecR as obtained from the QR
+ * decompostion in lcl_CalculateQRdecomposition. B and Z are column vectors
+ * given as matrix with at least index 0 to K-1; elements on index>=K are
+ * not used.
+ */
+void lcl_ApplyUpperRightTriangle(ScMatrixRef pMatA,
+ ::std::vector< double>& pVecR, ScMatrixRef pMatB,
+ ScMatrixRef pMatZ, SCSIZE nK, bool bIsTransposed)
+{
+ // ScMatrix matrices are zero based, index access (column,row)
+ double fSum;
+ for (SCSIZE row = 0; row < nK; row++)
+ {
+ fSum = pVecR[row] * pMatB->GetDouble(row);
+ for (SCSIZE col = row+1; col < nK; col++)
+ if (bIsTransposed)
+ fSum += pMatA->GetDouble(row,col) * pMatB->GetDouble(col);
else
- {
- for (i = 0; i < M+1; i++)
- pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), i, 1);
- }
- }
- // F (F-Statistik)
- if (fSQR == 0.0)
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 0, 3);
- else
- pResMat->PutDouble(((double)(N-M-1))*fSQE/fSQR/((double)M),0, 3);
- // df (Freiheitsgrad)
- pResMat->PutDouble(((double)(N-M-1)), 1, 3);
+ fSum += pMatA->GetDouble(col,row) * pMatB->GetDouble(col);
+ pMatZ->PutDouble( fSum, row);
}
- else
+}
+
+
+
+double lcl_GetMeanOverAll(ScMatrixRef pMat, SCSIZE nN)
+{
+ double fSum = 0.0;
+ for (SCSIZE i=0 ; i<nN; i++)
+ fSum += pMat->GetDouble(i);
+ return fSum/static_cast<double>(nN);
+}
+
+// Calculates means of the columns of matrix X. X is a RxC matrix;
+// ResMat is a 1xC matrix (=row).
+void lcl_CalculateColumnMeans(ScMatrixRef pX, ScMatrixRef pResMat,
+ SCSIZE nC, SCSIZE nR)
+{
+ double fSum = 0.0;
+ for (SCSIZE i=0; i < nC; i++)
{
- if (N-M == 0)
- {
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 1, 2);
- for (i = 0; i < M+1; i++)
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i, 1);
- }
- else
- {
- double fSE2 = fSQR/(N-M);
- pResMat->PutDouble(sqrt(fSE2), 1, 2);
- if ( RGetVariances( pV, pMatX, M, N, nCase != 2, sal_True ) )
- {
- for (i = 0; i < M; i++)
- pResMat->PutDouble( sqrt(fSE2 * pV->GetDouble(i)), M-i-1, 1 );
- pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), M, 1);
- }
- else
- {
- for (i = 0; i < M+1; i++)
- pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), i, 1);
- }
- }
- if (fSQR == 0.0)
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 0, 3);
- else
- pResMat->PutDouble(((double)(N-M))*fSQE/fSQR/((double)M),0, 3);
- pResMat->PutDouble(((double)(N-M)), 1, 3);
+ fSum =0.0;
+ for (SCSIZE k=0; k < nR; k++)
+ fSum += pX->GetDouble(i,k); // GetDouble(Column,Row)
+ pResMat ->PutDouble( fSum/static_cast<double>(nR),i);
}
}
-void ScInterpreter::ScRGP()
+// Calculates means of the rows of matrix X. X is a RxC matrix;
+// ResMat is a Rx1 matrix (=column).
+void lcl_CalculateRowMeans(ScMatrixRef pX, ScMatrixRef pResMat,
+ SCSIZE nC, SCSIZE nR)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRGP" );
- CalulateRGPRKP(sal_False);
+ double fSum = 0.0;
+ for (SCSIZE k=0; k < nR; k++)
+ {
+ fSum =0.0;
+ for (SCSIZE i=0; i < nC; i++)
+ fSum += pX->GetDouble(i,k); // GetDouble(Column,Row)
+ pResMat ->PutDouble( fSum/static_cast<double>(nC),k);
+ }
}
-bool ScInterpreter::CheckMatrix(sal_Bool _bLOG,sal_Bool _bTrendGrowth,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY)
+
+void lcl_CalculateColumnsDelta(ScMatrixRef pMat, ScMatrixRef pColumnMeans,
+ SCSIZE nC, SCSIZE nR)
{
+ for (SCSIZE i = 0; i < nC; i++)
+ for (SCSIZE k = 0; k < nR; k++)
+ pMat->PutDouble( ::rtl::math::approxSub
+ (pMat->GetDouble(i,k) , pColumnMeans->GetDouble(i) ) , i, k);
+}
+
+void lcl_CalculateRowsDelta(ScMatrixRef pMat, ScMatrixRef pRowMeans,
+ SCSIZE nC, SCSIZE nR)
+{
+ for (SCSIZE k = 0; k < nR; k++)
+ for (SCSIZE i = 0; i < nC; i++)
+ pMat->PutDouble( ::rtl::math::approxSub
+ ( pMat->GetDouble(i,k) , pRowMeans->GetDouble(k) ) , i, k);
+}
+
+// Case1 = simple regression
+// MatX = X - MeanX, MatY = Y - MeanY, y - haty = (y - MeanY) - (haty - MeanY)
+// = (y-MeanY)-((slope*x+a)-(slope*MeanX+a)) = (y-MeanY)-slope*(x-MeanX)
+double lcl_GetSSresid(ScMatrixRef pMatX, ScMatrixRef pMatY, double fSlope,
+ SCSIZE nN)
+{
+ double fSum = 0.0;
+ double fTemp = 0.0;
+ for (SCSIZE i=0; i<nN; i++)
+ {
+ fTemp = pMatY->GetDouble(i) - fSlope * pMatX->GetDouble(i);
+ fSum += fTemp * fTemp;
+ }
+ return fSum;
+}
+
+}
+
+// Fill default values in matrix X, transform Y to log(Y) in case LOGEST|GROWTH,
+// determine sizes of matrices X and Y, determine kind of regression, clone
+// Y in case LOGEST|GROWTH, if constant.
+bool ScInterpreter::CheckMatrix(bool _bLOG, sal_uInt8& nCase, SCSIZE& nCX,
+ SCSIZE& nCY, SCSIZE& nRX, SCSIZE& nRY, SCSIZE& M,
+ SCSIZE& N, ScMatrixRef& pMatX, ScMatrixRef& pMatY)
+{
+
nCX = 0;
nCY = 0;
nRX = 0;
@@ -2103,7 +2315,11 @@ bool ScInterpreter::CheckMatrix(sal_Bool _bLOG,sal_Bool _bTrendGrowth,sal_uInt8&
return false;
}
if (nCX == nCY && nRX == nRY)
- nCase = 1; // einfache Regression
+ {
+ nCase = 1; // simple regression
+ M = 1;
+ N = nCountY;
+ }
else if (nCY != 1 && nRY != 1)
{
PushIllegalArgument();
@@ -2118,7 +2334,7 @@ bool ScInterpreter::CheckMatrix(sal_Bool _bLOG,sal_Bool _bTrendGrowth,sal_uInt8&
}
else
{
- nCase = 2; // zeilenweise
+ nCase = 2; // Y is column
N = nRY;
M = nCX;
}
@@ -2130,7 +2346,7 @@ bool ScInterpreter::CheckMatrix(sal_Bool _bLOG,sal_Bool _bTrendGrowth,sal_uInt8&
}
else
{
- nCase = 3; // spaltenweise
+ nCase = 3; // Y is row
N = nCY;
M = nRX;
}
@@ -2138,460 +2354,644 @@ bool ScInterpreter::CheckMatrix(sal_Bool _bLOG,sal_Bool _bTrendGrowth,sal_uInt8&
else
{
pMatX = GetNewMat(nCY, nRY);
- if ( _bTrendGrowth )
- {
nCX = nCY;
nRX = nRY;
- }
if (!pMatX)
{
PushIllegalArgument();
return false;
}
for ( SCSIZE i = 1; i <= nCountY; i++ )
- pMatX->PutDouble((double)i, i-1);
+ pMatX->PutDouble(static_cast<double>(i), i-1);
nCase = 1;
+ N = nCountY;
+ M = 1;
}
return true;
}
-void ScInterpreter::CalulateRGPRKP(sal_Bool _bRKP)
+
+// -----------------------------------------------------------------------------
+
+// LINEST
+void ScInterpreter::ScRGP()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRGP" );
+ CalulateRGPRKP(false);
+}
+
+// LOGEST
+void ScInterpreter::ScRKP()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRKP" );
+ CalulateRGPRKP(true);
+}
+
+void ScInterpreter::CalulateRGPRKP(bool _bRKP)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CheckMatrix" );
sal_uInt8 nParamCount = GetByte();
- if ( !MustHaveParamCount( nParamCount, 1, 4 ) )
+ if (!MustHaveParamCount( nParamCount, 1, 4 ))
return;
- sal_Bool bConstant, bStats;
+ bool bConstant, bStats;
+
+ // optional forth parameter
if (nParamCount == 4)
bStats = GetBool();
else
- bStats = sal_False;
+ bStats = false;
+
+ // The third parameter may not be missing in ODF, if the forth parameter
+ // is present. But Excel allows it with default true, we too.
if (nParamCount >= 3)
- bConstant = GetBool();
+ {
+ if (IsMissing())
+ {
+ Pop();
+ bConstant = true;
+// PushIllegalParameter(); if ODF behavior is desired
+// return;
+ }
+ else
+ bConstant = GetBool();
+ }
else
- bConstant = sal_True;
+ bConstant = true;
+
ScMatrixRef pMatX;
- ScMatrixRef pMatY;
if (nParamCount >= 2)
- pMatX = GetMatrix();
+ {
+ if (IsMissing())
+ { //In ODF1.2 empty second parameter (which is two ;; ) is allowed
+ Pop();
+ pMatX = NULL;
+ }
+ else
+ {
+ pMatX = GetMatrix();
+ }
+ }
else
pMatX = NULL;
+
+ ScMatrixRef pMatY;
pMatY = GetMatrix();
if (!pMatY)
{
PushIllegalParameter();
return;
- } // if (!pMatY)
- sal_uInt8 nCase; // 1 = normal, 2,3 = mehrfach
- SCSIZE nCX, nCY;
- SCSIZE nRX, nRY;
- SCSIZE M = 0, N = 0;
- if ( !CheckMatrix(_bRKP,sal_False,nCase,nCX,nCY,nRX,nRY,M,N,pMatX,pMatY) )
+ }
+
+ // 1 = simple; 2 = multiple with Y as column; 3 = multiple with Y as row
+ sal_uInt8 nCase;
+
+ SCSIZE nCX, nCY; // number of columns
+ SCSIZE nRX, nRY; //number of rows
+ SCSIZE K = 0, N = 0; // K=number of variables X, N=number of data samples
+ if (!CheckMatrix(_bRKP,nCase,nCX,nCY,nRX,nRY,K,N,pMatX,pMatY))
+ {
+ PushIllegalParameter();
return;
+ }
+
+ // Enough data samples?
+ if ((bConstant && (N<K+1)) || (!bConstant && (N<K)) || (N<1) || (K<1))
+ {
+ PushIllegalParameter();
+ return;
+ }
ScMatrixRef pResMat;
- if (nCase == 1)
+ if (bStats)
+ pResMat = GetNewMat(K+1,5);
+ else
+ pResMat = GetNewMat(K+1,1);
+ if (!pResMat)
{
- if (!bStats)
- pResMat = GetNewMat(2,1);
- else
- pResMat = GetNewMat(2,5);
- if (!pResMat)
+ PushError(errCodeOverflow);
+ return;
+ }
+ // Fill unused cells in pResMat; order (column,row)
+ if (bStats)
+ {
+ for (SCSIZE i=2; i<K+1; i++)
{
- PushIllegalArgument();
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), i, 2 );
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), i, 3 );
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), i, 4 );
+ }
+ }
+
+ // Uses sum(x-MeanX)^2 and not [sum x^2]-N * MeanX^2 in case bConstant.
+ // Clone constant matrices, so that Mat = Mat - Mean is possible.
+ double fMeanY = 0.0;
+ if (bConstant)
+ {
+ ScMatrixRef pNewX = pMatX->CloneIfConst();
+ ScMatrixRef pNewY = pMatY->CloneIfConst();
+ if (!pNewX || !pNewY)
+ {
+ PushError(errCodeOverflow);
return;
}
- double fCount = 0.0;
- double fSumX = 0.0;
- double fSumSqrX = 0.0;
- double fSumY = 0.0;
- double fSumSqrY = 0.0;
- double fSumXY = 0.0;
- double fValX, fValY;
- for (SCSIZE i = 0; i < nCY; i++)
- for (SCSIZE j = 0; j < nRY; j++)
- {
- fValX = pMatX->GetDouble(i,j);
- fValY = pMatY->GetDouble(i,j);
- fSumX += fValX;
- fSumSqrX += fValX * fValX;
- fSumY += fValY;
- fSumSqrY += fValY * fValY;
- fSumXY += fValX*fValY;
- fCount++;
- }
- if (fCount < 1.0)
- PushNoValue();
- else
+ pMatX = pNewX;
+ pMatY = pNewY;
+ // DeltaY is possible here; DeltaX depends on nCase, so later
+ fMeanY = lcl_GetMeanOverAll(pMatY, N);
+ for (SCSIZE i=0; i<N; i++)
{
- double f1 = fCount*fSumXY-fSumX*fSumY;
- double fX = fCount*fSumSqrX-fSumX*fSumX;
- double b, m;
- if (bConstant)
+ pMatY->PutDouble( ::rtl::math::approxSub(pMatY->GetDouble(i),fMeanY), i );
+ }
+ }
+
+ if (nCase==1)
+ {
+ // calculate simple regression
+ double fMeanX = 0.0;
+ if (bConstant)
+ { // Mat = Mat - Mean
+ fMeanX = lcl_GetMeanOverAll(pMatX, N);
+ for (SCSIZE i=0; i<N; i++)
{
- b = fSumY/fCount - f1/fX*fSumX/fCount;
- m = f1/fX;
+ pMatX->PutDouble( ::rtl::math::approxSub(pMatX->GetDouble(i),fMeanX), i );
}
- else
- {
- b = 0.0;
- m = fSumXY/fSumSqrX;
+ }
+ double fSumXY = lcl_GetSumProduct(pMatX,pMatY,N);
+ double fSumX2 = lcl_GetSumProduct(pMatX,pMatX,N);
+ if (fSumX2==0.0)
+ {
+ PushNoValue(); // all x-values are identical
+ return;
+ }
+ double fSlope = fSumXY / fSumX2;
+ double fIntercept = 0.0;
+ if (bConstant)
+ fIntercept = fMeanY - fSlope * fMeanX;
+ pResMat->PutDouble(_bRKP ? exp(fIntercept) : fIntercept, 1, 0); //order (column,row)
+ pResMat->PutDouble(_bRKP ? exp(fSlope) : fSlope, 0, 0);
+
+ if (bStats)
+ {
+ double fSSreg = fSlope * fSlope * fSumX2;
+ pResMat->PutDouble(fSSreg, 0, 4);
+
+ double fDegreesFreedom =static_cast<double>( (bConstant) ? N-2 : N-1 );
+ pResMat->PutDouble(fDegreesFreedom, 1, 3);
+
+ double fSSresid = lcl_GetSSresid(pMatX,pMatY,fSlope,N);
+ pResMat->PutDouble(fSSresid, 1, 4);
+
+ if (fDegreesFreedom == 0.0 || fSSresid == 0.0 || fSSreg == 0.0)
+ { // exact fit; test SSreg too, because SSresid might be
+ // unequal zero due to round of errors
+ pResMat->PutDouble(0.0, 1, 4); // SSresid
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), 0, 3); // F
+ pResMat->PutDouble(0.0, 1, 2); // RMSE
+ pResMat->PutDouble(0.0, 0, 1); // SigmaSlope
+ if (bConstant)
+ pResMat->PutDouble(0.0, 1, 1); //SigmaIntercept
+ else
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), 1, 1);
+ pResMat->PutDouble(1.0, 0, 2); // R^2
}
- pResMat->PutDouble(_bRKP ? exp(m) : m, 0, 0);
- pResMat->PutDouble(_bRKP ? exp(b) : b, 1, 0);
- if (bStats)
+ else
{
- double fY = fCount*fSumSqrY-fSumY*fSumY;
- double fSyx = fSumSqrY-b*fSumY-m*fSumXY;
- double fR2 = f1*f1/(fX*fY);
- pResMat->PutDouble (fR2, 0, 2);
- if (fCount < 3.0)
+ double fFstatistic = (fSSreg / static_cast<double>(K))
+ / (fSSresid / fDegreesFreedom);
+ pResMat->PutDouble(fFstatistic, 0, 3);
+
+ // standard error of estimate
+ double fRMSE = sqrt(fSSresid / fDegreesFreedom);
+ pResMat->PutDouble(fRMSE, 1, 2);
+
+ double fSigmaSlope = fRMSE / sqrt(fSumX2);
+ pResMat->PutDouble(fSigmaSlope, 0, 1);
+
+ if (bConstant)
{
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 0, 1 );
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 1, 1 );
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 1, 2 );
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 0, 3 );
+ double fSigmaIntercept = fRMSE
+ * sqrt(fMeanX*fMeanX/fSumX2 + 1.0/static_cast<double>(N));
+ pResMat->PutDouble(fSigmaIntercept, 1, 1);
}
else
{
- pResMat->PutDouble(sqrt(fSyx*fCount/(fX*(fCount-2.0))), 0, 1);
- pResMat->PutDouble(sqrt(fSyx*fSumSqrX/fX/(fCount-2.0)), 1, 1);
- pResMat->PutDouble(
- sqrt((fCount*fSumSqrY - fSumY*fSumY - f1*f1/fX)/
- (fCount*(fCount-2.0))), 1, 2);
- if (fR2 == 1.0)
- pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), 0, 3 );
- else
- pResMat->PutDouble(fR2*(fCount-2.0)/(1.0-fR2), 0, 3);
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), 1, 1);
}
- pResMat->PutDouble(((double)(nCY*nRY))-2.0, 1, 3);
- pResMat->PutDouble(fY/fCount-fSyx, 0, 4);
- pResMat->PutDouble(fSyx, 1, 4);
+
+ double fR2 = fSSreg / (fSSreg + fSSresid);
+ pResMat->PutDouble(fR2, 0, 2);
}
}
- } // if (nCase == 1)
- if ( nCase != 1 )
+ PushMatrix(pResMat);
+ }
+ else // calculate multiple regression;
{
- SCSIZE i, j, k;
- if (!bStats)
- pResMat = GetNewMat(M+1,1);
- else
- pResMat = GetNewMat(M+1,5);
- if (!pResMat)
+ // Uses a QR decomposition X = QR. The solution B = (X'X)^(-1) * X' * Y
+ // becomes B = R^(-1) * Q' * Y
+ if (nCase ==2) // Y is column
{
- PushIllegalArgument();
- return;
- }
- ScMatrixRef pQ = GetNewMat(M+1, M+2);
- ScMatrixRef pE = GetNewMat(M+2, 1);
- ScMatrixRef pV = GetNewMat(M+1, 1);
- pE->PutDouble(0.0, M+1);
- pQ->FillDouble(0.0, 0, 0, M, M+1);
- if (nCase == 2)
- {
- for (k = 0; k < N; k++)
- {
- double Yk = pMatY->GetDouble(k);
- pE->PutDouble( pE->GetDouble(M+1)+Yk*Yk, M+1 );
- double sumYk = pQ->GetDouble(0, M+1) + Yk;
- pQ->PutDouble( sumYk, 0, M+1 );
- pE->PutDouble( sumYk, 0 );
- for (i = 0; i < M; i++)
- {
- double Xik = pMatX->GetDouble(i,k);
- double sumXik = pQ->GetDouble(0, i+1) + Xik;
- pQ->PutDouble( sumXik, 0, i+1);
- pQ->PutDouble( sumXik, i+1, 0);
- double sumXikYk = pQ->GetDouble(i+1, M+1) + Xik * Yk;
- pQ->PutDouble( sumXikYk, i+1, M+1);
- pE->PutDouble( sumXikYk, i+1);
- for (j = i; j < M; j++)
- {
- const double fVal = pMatX->GetDouble(j,k);
- double sumXikXjk = pQ->GetDouble(j+1, i+1) +
- Xik * fVal;
- pQ->PutDouble( sumXikXjk, j+1, i+1);
- pQ->PutDouble( sumXikXjk, i+1, j+1);
- }
- }
+ ::std::vector< double> aVecR(N); // for QR decomposition
+ // Enough memory for needed matrices?
+ ScMatrixRef pMeans = GetNewMat(K, 1); // mean of each column
+ ScMatrixRef pMatZ; // for Q' * Y , inter alia
+ if (bStats)
+ pMatZ = pMatY->Clone(); // Y is used in statistic, keep it
+ else
+ pMatZ = pMatY; // Y can be overwritten
+ ScMatrixRef pSlopes = GetNewMat(1,K); // from b1 to bK
+ if (!pMeans || !pMatZ || !pSlopes)
+ {
+ PushError(errCodeOverflow);
+ return;
}
- }
- else
- {
- for (k = 0; k < N; k++)
+ if (bConstant)
{
- double Yk = pMatY->GetDouble(k);
- pE->PutDouble( pE->GetDouble(M+1)+Yk*Yk, M+1 );
- double sumYk = pQ->GetDouble(0, M+1) + Yk;
- pQ->PutDouble( sumYk, 0, M+1 );
- pE->PutDouble( sumYk, 0 );
- for (i = 0; i < M; i++)
- {
- double Xki = pMatX->GetDouble(k,i);
- double sumXki = pQ->GetDouble(0, i+1) + Xki;
- pQ->PutDouble( sumXki, 0, i+1);
- pQ->PutDouble( sumXki, i+1, 0);
- double sumXkiYk = pQ->GetDouble(i+1, M+1) + Xki * Yk;
- pQ->PutDouble( sumXkiYk, i+1, M+1);
- pE->PutDouble( sumXkiYk, i+1);
- for (j = i; j < M; j++)
- {
- const double fVal = pMatX->GetDouble(k,j);
- double sumXkiXkj = pQ->GetDouble(j+1, i+1) +
- Xki * fVal;
- pQ->PutDouble( sumXkiXkj, j+1, i+1);
- pQ->PutDouble( sumXkiXkj, i+1, j+1);
- }
- }
+ lcl_CalculateColumnMeans(pMatX, pMeans, K, N);
+ lcl_CalculateColumnsDelta(pMatX, pMeans, K, N);
}
- }
- if ( !Calculate4(_bRKP,pResMat,pQ,bConstant,N,M) )
- return;
-
- if (bStats)
- Calculate(pResMat,pE,pQ,pV,pMatX,bConstant,N,M,nCase);
- }
- PushMatrix(pResMat);
-}
-
-void ScInterpreter::ScRKP()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRKP" );
- CalulateRGPRKP(sal_True);
-}
-// -----------------------------------------------------------------------------
-bool ScInterpreter::Calculate4(sal_Bool _bExp,ScMatrixRef& pResMat,ScMatrixRef& pQ,sal_Bool bConstant,SCSIZE N,SCSIZE M)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::Calculate4" );
- pQ->PutDouble((double)N, 0, 0);
- if (bConstant)
- {
- SCSIZE S, L;
- for (S = 0; S < M+1; S++)
- {
- SCSIZE i = S;
- while (i < M+1 && pQ->GetDouble(i, S) == 0.0)
- i++;
- if (i >= M+1)
+ if (!lcl_CalculateQRdecomposition(pMatX, aVecR, K, N))
{
PushNoValue();
- return false;
+ return;
}
- double fVal;
- for (L = 0; L < M+2; L++)
+ // Later on we will divide by elements of aVecR, so make sure
+ // that they aren't zero.
+ bool bIsSingular=false;
+ for (SCSIZE row=0; row < K && !bIsSingular; row++)
+ bIsSingular = bIsSingular || aVecR[row]==0.0;
+ if (bIsSingular)
{
- fVal = pQ->GetDouble(S, L);
- pQ->PutDouble(pQ->GetDouble(i, L), S, L);
- pQ->PutDouble(fVal, i, L);
+ PushNoValue();
+ return;
}
- fVal = 1.0/pQ->GetDouble(S, S);
- for (L = 0; L < M+2; L++)
- pQ->PutDouble(pQ->GetDouble(S, L)*fVal, S, L);
- for (i = 0; i < M+1; i++)
+ // Z = Q' Y;
+ for (SCSIZE col = 0; col < K; col++)
{
- if (i != S)
- {
- fVal = -pQ->GetDouble(i, S);
- for (L = 0; L < M+2; L++)
- pQ->PutDouble(
- pQ->GetDouble(i,L)+fVal*pQ->GetDouble(S,L),i,L);
- }
+ lcl_ApplyHouseholderTransformation(pMatX, col, pMatZ, N);
}
- }
- }
- else
- {
- if ( !Calculate3(M,pQ) )
- return false;
+ // B = R^(-1) * Q' * Y <=> B = R^(-1) * Z <=> R * B = Z
+ // result Z should have zeros for index>=K; if not, ignore values
+ for (SCSIZE col = 0; col < K ; col++)
+ {
+ pSlopes->PutDouble( pMatZ->GetDouble(col), col);
+ }
+ lcl_SolveWithUpperRightTriangle(pMatX, aVecR, pSlopes, K, false);
+ double fIntercept = 0.0;
+ if (bConstant)
+ fIntercept = fMeanY - lcl_GetSumProduct(pMeans,pSlopes,K);
+ // Fill first line in result matrix
+ pResMat->PutDouble(_bRKP ? exp(fIntercept) : fIntercept, K, 0 );
+ for (SCSIZE i = 0; i < K; i++)
+ pResMat->PutDouble(_bRKP ? exp(pSlopes->GetDouble(i))
+ : pSlopes->GetDouble(i) , K-1-i, 0);
- }
- for (SCSIZE i = 0; i < M+1; i++)
- {
- const double d = pQ->GetDouble(M-i,M+1);
- pResMat->PutDouble(_bExp ? exp(d) : d, i, 0);
- } // for (SCSIZE i = 0; i < M+1; i++)
- return true;
-}
-ScMatrixRef ScInterpreter::Calculate2(const sal_Bool bConstant,const SCSIZE M ,const SCSIZE N,ScMatrixRef& pMatX,ScMatrixRef& pMatY,sal_uInt8 nCase)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::Calculate2" );
- SCSIZE i, j, k;
- ScMatrixRef pQ = GetNewMat(M+1, M+2);
- ScMatrixRef pE = GetNewMat(M+2, 1);
- pE->PutDouble(0.0, M+1);
- pQ->FillDouble(0.0, 0, 0, M, M+1);
- if (nCase == 2)
- {
- for (k = 0; k < N; k++)
- {
- pE->PutDouble(
- pE->GetDouble(M+1)+pMatY->GetDouble(k)*pMatY->GetDouble(k), M+1);
- pQ->PutDouble(pQ->GetDouble(0, M+1) + pMatY->GetDouble(k), 0, M+1);
- pE->PutDouble(pQ->GetDouble(0, M+1), 0);
- for (i = 0; i < M; i++)
+ if (bStats)
{
- pQ->PutDouble(pQ->GetDouble(0, i+1)+pMatX->GetDouble(i,k), 0, i+1);
- pQ->PutDouble(pQ->GetDouble(0, i+1), i+1, 0);
- pQ->PutDouble(pQ->GetDouble(i+1, M+1) +
- pMatX->GetDouble(i,k)*pMatY->GetDouble(k), i+1, M+1);
- pE->PutDouble(pQ->GetDouble(i+1, M+1), i+1);
- for (j = i; j < M; j++)
+ double fSSreg = 0.0;
+ double fSSresid = 0.0;
+ // re-use memory of Z;
+ pMatZ->FillDouble(0.0, 0, 0, 0, N-1);
+ // Z = R * Slopes
+ lcl_ApplyUpperRightTriangle(pMatX, aVecR, pSlopes, pMatZ, K, false);
+ // Z = Q * Z, that is Q * R * Slopes = X * Slopes
+ for (SCSIZE colp1 = K; colp1 > 0; colp1--)
{
- pQ->PutDouble(pQ->GetDouble(j+1, i+1) +
- pMatX->GetDouble(i,k)*pMatX->GetDouble(j,k), j+1, i+1);
- pQ->PutDouble(pQ->GetDouble(j+1, i+1), i+1, j+1);
+ lcl_ApplyHouseholderTransformation(pMatX, colp1-1, pMatZ,N);
}
- }
- }
- }
- else
- {
- for (k = 0; k < N; k++)
- {
- pE->PutDouble(
- pE->GetDouble(M+1)+pMatY->GetDouble(k)*pMatY->GetDouble(k), M+1);
- pQ->PutDouble(pQ->GetDouble(0, M+1) + pMatY->GetDouble(k), 0, M+1);
- pE->PutDouble(pQ->GetDouble(0, M+1), 0);
- for (i = 0; i < M; i++)
- {
- pQ->PutDouble(pQ->GetDouble(0, i+1)+pMatX->GetDouble(k,i), 0, i+1);
- pQ->PutDouble(pQ->GetDouble(0, i+1), i+1, 0);
- pQ->PutDouble(pQ->GetDouble(i+1, M+1) +
- pMatX->GetDouble(k,i)*pMatY->GetDouble(k), i+1, M+1);
- pE->PutDouble(pQ->GetDouble(i+1, M+1), i+1);
- for (j = i; j < M; j++)
+ fSSreg =lcl_GetSumProduct(pMatZ, pMatZ, N);
+ // re-use Y for residuals, Y = Y-Z
+ for (SCSIZE row = 0; row < N; row++)
+ pMatY->PutDouble(pMatY->GetDouble(row) - pMatZ->GetDouble(row), row);
+ fSSresid = lcl_GetSumProduct(pMatY, pMatY, N);
+ pResMat->PutDouble(fSSreg, 0, 4);
+ pResMat->PutDouble(fSSresid, 1, 4);
+
+ double fDegreesFreedom =static_cast<double>( (bConstant) ? N-K-1 : N-K );
+ pResMat->PutDouble(fDegreesFreedom, 1, 3);
+
+ if (fDegreesFreedom == 0.0 || fSSresid == 0.0 || fSSreg == 0.0)
+ { // exact fit; incl. observed values Y are identical
+ pResMat->PutDouble(0.0, 1, 4); // SSresid
+ // F = (SSreg/K) / (SSresid/df) = #DIV/0!
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), 0, 3); // F
+ // RMSE = sqrt(SSresid / df) = sqrt(0 / df) = 0
+ pResMat->PutDouble(0.0, 1, 2); // RMSE
+ // SigmaSlope[i] = RMSE * sqrt(matrix[i,i]) = 0 * sqrt(...) = 0
+ for (SCSIZE i=0; i<K; i++)
+ pResMat->PutDouble(0.0, K-1-i, 1);
+
+ // SigmaIntercept = RMSE * sqrt(...) = 0
+ if (bConstant)
+ pResMat->PutDouble(0.0, K, 1); //SigmaIntercept
+ else
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), K, 1);
+
+ // R^2 = SSreg / (SSreg + SSresid) = 1.0
+ pResMat->PutDouble(1.0, 0, 2); // R^2
+ }
+ else
{
- pQ->PutDouble(pQ->GetDouble(j+1, i+1) +
- pMatX->GetDouble(k, i)*pMatX->GetDouble(k, j), j+1, i+1);
- pQ->PutDouble(pQ->GetDouble(j+1, i+1), i+1, j+1);
+ double fFstatistic = (fSSreg / static_cast<double>(K))
+ / (fSSresid / fDegreesFreedom);
+ pResMat->PutDouble(fFstatistic, 0, 3);
+
+ // standard error of estimate = root mean SSE
+ double fRMSE = sqrt(fSSresid / fDegreesFreedom);
+ pResMat->PutDouble(fRMSE, 1, 2);
+
+ // standard error of slopes
+ // = RMSE * sqrt(diagonal element of (R' R)^(-1) )
+ // standard error of intercept
+ // = RMSE * sqrt( Xmean * (R' R)^(-1) * Xmean' + 1/N)
+ // (R' R)^(-1) = R^(-1) * (R')^(-1). Do not calculate it as
+ // a whole matrix, but iterate over unit vectors.
+ double fSigmaSlope = 0.0;
+ double fSigmaIntercept = 0.0;
+ double fPart; // for Xmean * single column of (R' R)^(-1)
+ for (SCSIZE col = 0; col < K; col++)
+ {
+ //re-use memory of MatZ
+ pMatZ->FillDouble(0.0,0,0,0,K-1); // Z = unit vector e
+ pMatZ->PutDouble(1.0, col);
+ //Solve R' * Z = e
+ lcl_SolveWithLowerLeftTriangle(pMatX, aVecR, pMatZ, K, false);
+ // Solve R * Znew = Zold
+ lcl_SolveWithUpperRightTriangle(pMatX, aVecR, pMatZ, K, false);
+ // now Z is column col in (R' R)^(-1)
+ fSigmaSlope = fRMSE * sqrt(pMatZ->GetDouble(col));
+ pResMat->PutDouble(fSigmaSlope, K-1-col, 1);
+ // (R' R) ^(-1) is symmetric
+ if (bConstant)
+ {
+ fPart = lcl_GetSumProduct(pMeans, pMatZ, K);
+ fSigmaIntercept += fPart * pMeans->GetDouble(col);
+ }
+ }
+ if (bConstant)
+ {
+ fSigmaIntercept = fRMSE
+ * sqrt(fSigmaIntercept + 1.0 / static_cast<double>(N));
+ pResMat->PutDouble(fSigmaIntercept, K, 1);
+ }
+ else
+ {
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), K, 1);
+ }
+
+ double fR2 = fSSreg / (fSSreg + fSSresid);
+ pResMat->PutDouble(fR2, 0, 2);
}
}
+ PushMatrix(pResMat);
}
- }
- pQ->PutDouble((double)N, 0, 0);
- if (bConstant)
- {
- SCSIZE S, L;
- for (S = 0; S < M+1; S++)
+ else // nCase == 3, Y is row, all matrices are transposed
{
- i = S;
- while (i < M+1 && pQ->GetDouble(i, S) == 0.0)
- i++;
- if (i >= M+1)
+ ::std::vector< double> aVecR(N); // for QR decomposition
+ // Enough memory for needed matrices?
+ ScMatrixRef pMeans = GetNewMat(1, K); // mean of each row
+ ScMatrixRef pMatZ; // for Q' * Y , inter alia
+ if (bStats)
+ pMatZ = pMatY->Clone(); // Y is used in statistic, keep it
+ else
+ pMatZ = pMatY; // Y can be overwritten
+ ScMatrixRef pSlopes = GetNewMat(K,1); // from b1 to bK
+ if (!pMeans || !pMatZ || !pSlopes)
+ {
+ PushError(errCodeOverflow);
+ return;
+ }
+ if (bConstant)
+ {
+ lcl_CalculateRowMeans(pMatX, pMeans, N, K);
+ lcl_CalculateRowsDelta(pMatX, pMeans, N, K);
+ }
+
+ if (!lcl_TCalculateQRdecomposition(pMatX, aVecR, K, N))
{
PushNoValue();
- return ScMatrixRef();
+ return;
}
- double fVal;
- for (L = 0; L < M+2; L++)
+
+ // Later on we will divide by elements of aVecR, so make sure
+ // that they aren't zero.
+ bool bIsSingular=false;
+ for (SCSIZE row=0; row < K && !bIsSingular; row++)
+ bIsSingular = bIsSingular || aVecR[row]==0.0;
+ if (bIsSingular)
+ {
+ PushNoValue();
+ return;
+ }
+ // Z = Q' Y
+ for (SCSIZE row = 0; row < K; row++)
{
- fVal = pQ->GetDouble(S, L);
- pQ->PutDouble(pQ->GetDouble(i, L), S, L);
- pQ->PutDouble(fVal, i, L);
+ lcl_TApplyHouseholderTransformation(pMatX, row, pMatZ, N);
}
- fVal = 1.0/pQ->GetDouble(S, S);
- for (L = 0; L < M+2; L++)
- pQ->PutDouble(pQ->GetDouble(S, L)*fVal, S, L);
- for (i = 0; i < M+1; i++)
+ // B = R^(-1) * Q' * Y <=> B = R^(-1) * Z <=> R * B = Z
+ // result Z should have zeros for index>=K; if not, ignore values
+ for (SCSIZE col = 0; col < K ; col++)
{
- if (i != S)
+ pSlopes->PutDouble( pMatZ->GetDouble(col), col);
+ }
+ lcl_SolveWithUpperRightTriangle(pMatX, aVecR, pSlopes, K, true);
+ double fIntercept = 0.0;
+ if (bConstant)
+ fIntercept = fMeanY - lcl_GetSumProduct(pMeans,pSlopes,K);
+ // Fill first line in result matrix
+ pResMat->PutDouble(_bRKP ? exp(fIntercept) : fIntercept, K, 0 );
+ for (SCSIZE i = 0; i < K; i++)
+ pResMat->PutDouble(_bRKP ? exp(pSlopes->GetDouble(i))
+ : pSlopes->GetDouble(i) , K-1-i, 0);
+
+
+ if (bStats)
+ {
+ double fSSreg = 0.0;
+ double fSSresid = 0.0;
+ // re-use memory of Z;
+ pMatZ->FillDouble(0.0, 0, 0, N-1, 0);
+ // Z = R * Slopes
+ lcl_ApplyUpperRightTriangle(pMatX, aVecR, pSlopes, pMatZ, K, true);
+ // Z = Q * Z, that is Q * R * Slopes = X * Slopes
+ for (SCSIZE rowp1 = K; rowp1 > 0; rowp1--)
+ {
+ lcl_TApplyHouseholderTransformation(pMatX, rowp1-1, pMatZ,N);
+ }
+ fSSreg =lcl_GetSumProduct(pMatZ, pMatZ, N);
+ // re-use Y for residuals, Y = Y-Z
+ for (SCSIZE col = 0; col < N; col++)
+ pMatY->PutDouble(pMatY->GetDouble(col) - pMatZ->GetDouble(col), col);
+ fSSresid = lcl_GetSumProduct(pMatY, pMatY, N);
+ pResMat->PutDouble(fSSreg, 0, 4);
+ pResMat->PutDouble(fSSresid, 1, 4);
+
+ double fDegreesFreedom =static_cast<double>( (bConstant) ? N-K-1 : N-K );
+ pResMat->PutDouble(fDegreesFreedom, 1, 3);
+
+ if (fDegreesFreedom == 0.0 || fSSresid == 0.0 || fSSreg == 0.0)
+ { // exact fit; incl. case observed values Y are identical
+ pResMat->PutDouble(0.0, 1, 4); // SSresid
+ // F = (SSreg/K) / (SSresid/df) = #DIV/0!
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), 0, 3); // F
+ // RMSE = sqrt(SSresid / df) = sqrt(0 / df) = 0
+ pResMat->PutDouble(0.0, 1, 2); // RMSE
+ // SigmaSlope[i] = RMSE * sqrt(matrix[i,i]) = 0 * sqrt(...) = 0
+ for (SCSIZE i=0; i<K; i++)
+ pResMat->PutDouble(0.0, K-1-i, 1);
+
+ // SigmaIntercept = RMSE * sqrt(...) = 0
+ if (bConstant)
+ pResMat->PutDouble(0.0, K, 1); //SigmaIntercept
+ else
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), K, 1);
+
+ // R^2 = SSreg / (SSreg + SSresid) = 1.0
+ pResMat->PutDouble(1.0, 0, 2); // R^2
+ }
+ else
{
- fVal = -pQ->GetDouble(i, S);
- for (L = 0; L < M+2; L++)
- pQ->PutDouble(
- pQ->GetDouble(i,L)+fVal*pQ->GetDouble(S,L),i,L);
+ double fFstatistic = (fSSreg / static_cast<double>(K))
+ / (fSSresid / fDegreesFreedom);
+ pResMat->PutDouble(fFstatistic, 0, 3);
+
+ // standard error of estimate = root mean SSE
+ double fRMSE = sqrt(fSSresid / fDegreesFreedom);
+ pResMat->PutDouble(fRMSE, 1, 2);
+
+ // standard error of slopes
+ // = RMSE * sqrt(diagonal element of (R' R)^(-1) )
+ // standard error of intercept
+ // = RMSE * sqrt( Xmean * (R' R)^(-1) * Xmean' + 1/N)
+ // (R' R)^(-1) = R^(-1) * (R')^(-1). Do not calculate it as
+ // a whole matrix, but iterate over unit vectors.
+ // (R' R) ^(-1) is symmetric
+ double fSigmaSlope = 0.0;
+ double fSigmaIntercept = 0.0;
+ double fPart; // for Xmean * single col of (R' R)^(-1)
+ for (SCSIZE row = 0; row < K; row++)
+ {
+ //re-use memory of MatZ
+ pMatZ->FillDouble(0.0,0,0,K-1,0); // Z = unit vector e
+ pMatZ->PutDouble(1.0, row);
+ //Solve R' * Z = e
+ lcl_SolveWithLowerLeftTriangle(pMatX, aVecR, pMatZ, K, true);
+ // Solve R * Znew = Zold
+ lcl_SolveWithUpperRightTriangle(pMatX, aVecR, pMatZ, K, true);
+ // now Z is column col in (R' R)^(-1)
+ fSigmaSlope = fRMSE * sqrt(pMatZ->GetDouble(row));
+ pResMat->PutDouble(fSigmaSlope, K-1-row, 1);
+ if (bConstant)
+ {
+ fPart = lcl_GetSumProduct(pMeans, pMatZ, K);
+ fSigmaIntercept += fPart * pMeans->GetDouble(row);
+ }
+ }
+ if (bConstant)
+ {
+ fSigmaIntercept = fRMSE
+ * sqrt(fSigmaIntercept + 1.0 / static_cast<double>(N));
+ pResMat->PutDouble(fSigmaIntercept, K, 1);
+ }
+ else
+ {
+ pResMat->PutString(ScGlobal::GetRscString(STR_NV_STR), K, 1);
+ }
+
+ double fR2 = fSSreg / (fSSreg + fSSresid);
+ pResMat->PutDouble(fR2, 0, 2);
}
}
+ PushMatrix(pResMat);
}
}
- else
- {
- if ( !Calculate3(M,pQ) )
- return ScMatrixRef();
- }
- return pQ;
-}
-bool ScInterpreter::Calculate3(const SCSIZE M ,ScMatrixRef& pQ)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::Calculate3" );
- SCSIZE S, L;
- for (S = 1; S < M+1; S++)
- {
- SCSIZE i = S;
- while (i < M+1 && pQ->GetDouble(i, S) == 0.0)
- i++;
- if (i >= M+1)
- {
- PushNoValue();
- return ScMatrixRef();
- }
- double fVal;
- for (L = 1; L < M+2; L++)
- {
- fVal = pQ->GetDouble(S, L);
- pQ->PutDouble(pQ->GetDouble(i, L), S, L);
- pQ->PutDouble(fVal, i, L);
- }
- fVal = 1.0/pQ->GetDouble(S, S);
- for (L = 1; L < M+2; L++)
- pQ->PutDouble(pQ->GetDouble(S, L)*fVal, S, L);
- for (i = 1; i < M+1; i++)
- {
- if (i != S)
- {
- fVal = -pQ->GetDouble(i, S);
- for (L = 1; L < M+2; L++)
- pQ->PutDouble(
- pQ->GetDouble(i,L)+fVal*pQ->GetDouble(S,L),i,L);
- }
- }
- pQ->PutDouble(0.0, 0, M+1);
- } // for (S = 1; S < M+1; S++)
- return true;
}
void ScInterpreter::ScTrend()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTrend" );
- CalculateTrendGrowth(sal_False);
+ CalculateTrendGrowth(false);
}
-void ScInterpreter::CalculateTrendGrowth(sal_Bool _bGrowth)
+
+void ScInterpreter::ScGrowth()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGrowth" );
+ CalculateTrendGrowth(true);
+}
+
+void ScInterpreter::CalculateTrendGrowth(bool _bGrowth)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::CalculateTrendGrowth" );
sal_uInt8 nParamCount = GetByte();
- if ( !MustHaveParamCount( nParamCount, 1, 4 ) )
+ if (!MustHaveParamCount( nParamCount, 1, 4 ))
return;
- sal_Bool bConstant;
+
+ // optional forth parameter
+ bool bConstant;
if (nParamCount == 4)
bConstant = GetBool();
else
- bConstant = sal_True;
- ScMatrixRef pMatX;
- ScMatrixRef pMatY;
+ bConstant = true;
+
+ // The third parameter may be missing in ODF, although the forth parameter
+ // is present. Default values depend on data not yet read.
ScMatrixRef pMatNewX;
if (nParamCount >= 3)
- pMatNewX = GetMatrix();
+ {
+ if (IsMissing())
+ {
+ Pop();
+ pMatNewX = NULL;
+ }
+ else
+ pMatNewX = GetMatrix();
+ }
else
pMatNewX = NULL;
+
+ //In ODF1.2 empty second parameter (which is two ;; ) is allowed
+ //Defaults will be set in CheckMatrix
+ ScMatrixRef pMatX;
if (nParamCount >= 2)
- pMatX = GetMatrix();
+ {
+ if (IsMissing())
+ {
+ Pop();
+ pMatX = NULL;
+ }
+ else
+ {
+ pMatX = GetMatrix();
+ }
+ }
else
pMatX = NULL;
+
+ ScMatrixRef pMatY;
pMatY = GetMatrix();
if (!pMatY)
{
PushIllegalParameter();
return;
- } // if (!pMatY)
+ }
+
+ // 1 = simple; 2 = multiple with Y as column; 3 = multiple with Y as row
+ sal_uInt8 nCase;
- sal_uInt8 nCase; // 1 = normal, 2,3 = mehrfach
- SCSIZE nCX, nCY;
- SCSIZE nRX, nRY;
- SCSIZE M = 0, N = 0;
- if ( !CheckMatrix(_bGrowth,sal_True,nCase,nCX,nCY,nRX,nRY,M,N,pMatX,pMatY) )
+ SCSIZE nCX, nCY; // number of columns
+ SCSIZE nRX, nRY; //number of rows
+ SCSIZE K = 0, N = 0; // K=number of variables X, N=number of data samples
+ if (!CheckMatrix(_bGrowth,nCase,nCX,nCY,nRX,nRY,K,N,pMatX,pMatY))
+ {
+ PushIllegalParameter();
return;
+ }
+ // Enough data samples?
+ if ((bConstant && (N<K+1)) || (!bConstant && (N<K)) || (N<1) || (K<1))
+ {
+ PushIllegalParameter();
+ return;
+ }
+ // Set default pMatNewX if necessary
SCSIZE nCXN, nRXN;
SCSIZE nCountXN;
if (!pMatNewX)
@@ -2599,128 +2999,223 @@ void ScInterpreter::CalculateTrendGrowth(sal_Bool _bGrowth)
nCXN = nCX;
nRXN = nRX;
nCountXN = nCXN * nRXN;
- pMatNewX = pMatX;
+ pMatNewX = pMatX->Clone(); // pMatX will be changed to X-meanX
}
else
{
pMatNewX->GetDimensions(nCXN, nRXN);
- if ((nCase == 2 && nCX != nCXN) || (nCase == 3 && nRX != nRXN))
+ if ((nCase == 2 && K != nCXN) || (nCase == 3 && K != nRXN))
{
PushIllegalArgument();
return;
}
nCountXN = nCXN * nRXN;
- for ( SCSIZE i = 0; i < nCountXN; i++ )
+ for (SCSIZE i = 0; i < nCountXN; i++)
if (!pMatNewX->IsValue(i))
{
PushIllegalArgument();
return;
}
}
- ScMatrixRef pResMat;
+ ScMatrixRef pResMat; // size depends on nCase
if (nCase == 1)
+ pResMat = GetNewMat(nCXN,nRXN);
+ else
{
- double fCount = 0.0;
- double fSumX = 0.0;
- double fSumSqrX = 0.0;
- double fSumY = 0.0;
- double fSumSqrY = 0.0;
- double fSumXY = 0.0;
- double fValX, fValY;
- SCSIZE i;
- for (i = 0; i < nCY; i++)
- for (SCSIZE j = 0; j < nRY; j++)
- {
- fValX = pMatX->GetDouble(i,j);
- fValY = pMatY->GetDouble(i,j);
- fSumX += fValX;
- fSumSqrX += fValX * fValX;
- fSumY += fValY;
- fSumSqrY += fValY * fValY;
- fSumXY += fValX*fValY;
- fCount++;
- }
- if (fCount < 1.0)
+ if (nCase==2)
+ pResMat = GetNewMat(1,nRXN);
+ else
+ pResMat = GetNewMat(nCXN,1);
+ }
+ if (!pResMat)
+ {
+ PushError(errCodeOverflow);
+ return;
+ }
+ // Uses sum(x-MeanX)^2 and not [sum x^2]-N * MeanX^2 in case bConstant.
+ // Clone constant matrices, so that Mat = Mat - Mean is possible.
+ double fMeanY = 0.0;
+ if (bConstant)
+ {
+ ScMatrixRef pCopyX = pMatX->CloneIfConst();
+ ScMatrixRef pCopyY = pMatY->CloneIfConst();
+ if (!pCopyX || !pCopyY)
{
- PushNoValue();
+ PushError(errStackOverflow);
return;
}
- else
+ pMatX = pCopyX;
+ pMatY = pCopyY;
+ // DeltaY is possible here; DeltaX depends on nCase, so later
+ fMeanY = lcl_GetMeanOverAll(pMatY, N);
+ for (SCSIZE i=0; i<N; i++)
{
- double f1 = fCount*fSumXY-fSumX*fSumY;
- double fX = fCount*fSumSqrX-fSumX*fSumX;
- double b, m;
- if (bConstant)
- {
- b = fSumY/fCount - f1/fX*fSumX/fCount;
- m = f1/fX;
- }
- else
+ pMatY->PutDouble( ::rtl::math::approxSub(pMatY->GetDouble(i),fMeanY), i );
+ }
+ }
+
+ if (nCase==1)
+ {
+ // calculate simple regression
+ double fMeanX = 0.0;
+ if (bConstant)
+ { // Mat = Mat - Mean
+ fMeanX = lcl_GetMeanOverAll(pMatX, N);
+ for (SCSIZE i=0; i<N; i++)
{
- b = 0.0;
- m = fSumXY/fSumSqrX;
+ pMatX->PutDouble( ::rtl::math::approxSub(pMatX->GetDouble(i),fMeanX), i );
}
- pResMat = GetNewMat(nCXN, nRXN);
- if (!pResMat)
+ }
+ double fSumXY = lcl_GetSumProduct(pMatX,pMatY,N);
+ double fSumX2 = lcl_GetSumProduct(pMatX,pMatX,N);
+ if (fSumX2==0.0)
+ {
+ PushNoValue(); // all x-values are identical
+ return;
+ }
+ double fSlope = fSumXY / fSumX2;
+ double fHelp;
+ if (bConstant)
+ {
+ double fIntercept = fMeanY - fSlope * fMeanX;
+ for (SCSIZE i = 0; i < nCountXN; i++)
{
- PushIllegalArgument();
- return;
+ fHelp = pMatNewX->GetDouble(i)*fSlope + fIntercept;
+ pResMat->PutDouble(_bGrowth ? exp(fHelp) : fHelp, i);
}
- for (i = 0; i < nCountXN; i++)
+ }
+ else
+ {
+ for (SCSIZE i = 0; i < nCountXN; i++)
{
- const double d = pMatNewX->GetDouble(i)*m+b;
- pResMat->PutDouble(_bGrowth ? exp(d) : d, i);
+ fHelp = pMatNewX->GetDouble(i)*fSlope;
+ pResMat->PutDouble(_bGrowth ? exp(fHelp) : fHelp, i);
}
}
}
- else
+ else // calculate multiple regression;
{
- ScMatrixRef pQ = Calculate2(bConstant,M ,N,pMatX,pMatY,nCase);
- if ( !pQ.Is() )
- return;
- if (nCase == 2)
+ if (nCase ==2) // Y is column
{
- pResMat = GetNewMat(1, nRXN);
- if (!pResMat)
+ ::std::vector< double> aVecR(N); // for QR decomposition
+ // Enough memory for needed matrices?
+ ScMatrixRef pMeans = GetNewMat(K, 1); // mean of each column
+ ScMatrixRef pSlopes = GetNewMat(1,K); // from b1 to bK
+ if (!pMeans || !pSlopes)
{
- PushIllegalArgument();
+ PushError(errCodeOverflow);
+ return;
+ }
+ if (bConstant)
+ {
+ lcl_CalculateColumnMeans(pMatX, pMeans, K, N);
+ lcl_CalculateColumnsDelta(pMatX, pMeans, K, N);
+ }
+ if (!lcl_CalculateQRdecomposition(pMatX, aVecR, K, N))
+ {
+ PushNoValue();
return;
}
- double fVal;
- for (SCSIZE i = 0; i < nRXN; i++)
+ // Later on we will divide by elements of aVecR, so make sure
+ // that they aren't zero.
+ bool bIsSingular=false;
+ for (SCSIZE row=0; row < K && !bIsSingular; row++)
+ bIsSingular = bIsSingular || aVecR[row]==0.0;
+ if (bIsSingular)
{
- fVal = pQ->GetDouble(0, M+1);
- for (SCSIZE j = 0; j < M; j++)
- fVal += pQ->GetDouble(j+1, M+1)*pMatNewX->GetDouble(j, i);
- pResMat->PutDouble(_bGrowth ? exp(fVal) : fVal, i);
+ PushNoValue();
+ return;
+ }
+ // Z := Q' Y; Y is overwritten with result Z
+ for (SCSIZE col = 0; col < K; col++)
+ {
+ lcl_ApplyHouseholderTransformation(pMatX, col, pMatY, N);
+ }
+ // B = R^(-1) * Q' * Y <=> B = R^(-1) * Z <=> R * B = Z
+ // result Z should have zeros for index>=K; if not, ignore values
+ for (SCSIZE col = 0; col < K ; col++)
+ {
+ pSlopes->PutDouble( pMatY->GetDouble(col), col);
+ }
+ lcl_SolveWithUpperRightTriangle(pMatX, aVecR, pSlopes, K, false);
+
+ // Fill result matrix
+ lcl_MFastMult(pMatNewX,pSlopes,pResMat,nRXN,K,1);
+ if (bConstant)
+ {
+ double fIntercept = fMeanY - lcl_GetSumProduct(pMeans,pSlopes,K);
+ for (SCSIZE row = 0; row < nRXN; row++)
+ pResMat->PutDouble(pResMat->GetDouble(row)+fIntercept, row);
+ }
+ if (_bGrowth)
+ {
+ for (SCSIZE i = 0; i < nRXN; i++)
+ pResMat->PutDouble(exp(pResMat->GetDouble(i)), i);
}
}
else
- {
- pResMat = GetNewMat(nCXN, 1);
- if (!pResMat)
+ { // nCase == 3, Y is row, all matrices are transposed
+
+ ::std::vector< double> aVecR(N); // for QR decomposition
+ // Enough memory for needed matrices?
+ ScMatrixRef pMeans = GetNewMat(1, K); // mean of each row
+ ScMatrixRef pSlopes = GetNewMat(K,1); // row from b1 to bK
+ if (!pMeans || !pSlopes)
{
- PushIllegalArgument();
+ PushError(errCodeOverflow);
return;
}
- double fVal;
- for (SCSIZE i = 0; i < nCXN; i++)
+ if (bConstant)
{
- fVal = pQ->GetDouble(0, M+1);
- for (SCSIZE j = 0; j < M; j++)
- fVal += pQ->GetDouble(j+1, M+1)*pMatNewX->GetDouble(i, j);
- pResMat->PutDouble(_bGrowth ? exp(fVal) : fVal, i);
+ lcl_CalculateRowMeans(pMatX, pMeans, N, K);
+ lcl_CalculateRowsDelta(pMatX, pMeans, N, K);
+ }
+ if (!lcl_TCalculateQRdecomposition(pMatX, aVecR, K, N))
+ {
+ PushNoValue();
+ return;
+ }
+ // Later on we will divide by elements of aVecR, so make sure
+ // that they aren't zero.
+ bool bIsSingular=false;
+ for (SCSIZE row=0; row < K && !bIsSingular; row++)
+ bIsSingular = bIsSingular || aVecR[row]==0.0;
+ if (bIsSingular)
+ {
+ PushNoValue();
+ return;
+ }
+ // Z := Q' Y; Y is overwritten with result Z
+ for (SCSIZE row = 0; row < K; row++)
+ {
+ lcl_TApplyHouseholderTransformation(pMatX, row, pMatY, N);
+ }
+ // B = R^(-1) * Q' * Y <=> B = R^(-1) * Z <=> R * B = Z
+ // result Z should have zeros for index>=K; if not, ignore values
+ for (SCSIZE col = 0; col < K ; col++)
+ {
+ pSlopes->PutDouble( pMatY->GetDouble(col), col);
+ }
+ lcl_SolveWithUpperRightTriangle(pMatX, aVecR, pSlopes, K, true);
+
+ // Fill result matrix
+ lcl_MFastMult(pSlopes,pMatNewX,pResMat,1,K,nCXN);
+ if (bConstant)
+ {
+ double fIntercept = fMeanY - lcl_GetSumProduct(pMeans,pSlopes,K);
+ for (SCSIZE col = 0; col < nCXN; col++)
+ pResMat->PutDouble(pResMat->GetDouble(col)+fIntercept, col);
+ }
+ if (_bGrowth)
+ {
+ for (SCSIZE i = 0; i < nCXN; i++)
+ pResMat->PutDouble(exp(pResMat->GetDouble(i)), i);
}
}
}
PushMatrix(pResMat);
}
-void ScInterpreter::ScGrowth()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGrowth" );
- CalculateTrendGrowth(sal_True);
-}
void ScInterpreter::ScMatRef()
{
@@ -2743,8 +3238,9 @@ void ScInterpreter::ScMatRef()
PushNA();
else
{
- ScMatValType nMatValType;
- const ScMatrixValue* pMatVal = pMat->Get( nC, nR, nMatValType);
+ const ScMatrixValue nMatVal = pMat->Get( nC, nR);
+ ScMatValType nMatValType = nMatVal.nType;
+
if (ScMatrix::IsNonValueType( nMatValType))
{
if (ScMatrix::IsEmptyPathType( nMatValType))
@@ -2758,11 +3254,11 @@ void ScInterpreter::ScMatRef()
PushTempToken( new ScEmptyCellToken( false, true));
}
else
- PushString( pMatVal->GetString() );
+ PushString( nMatVal.GetString() );
}
else
{
- PushDouble(pMatVal->fVal); // handles DoubleError
+ PushDouble(nMatVal.fVal); // handles DoubleError
pDok->GetNumberFormatInfo( nCurFmtType, nCurFmtIndex, aAdr, pCell );
nFuncFmtType = nCurFmtType;
nFuncFmtIndex = nCurFmtIndex;
@@ -2813,3 +3309,5 @@ void ScInterpreter::ScInfo()
PushIllegalArgument();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 1e3a9a292f16..109495ddb6d2 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-// #include <math.h>
-
#include <tools/debug.hxx>
#include <rtl/logfile.hxx>
#include "interpre.hxx"
@@ -197,3 +196,5 @@ double ScInterpreter::GetGammaDist( double fX, double fAlpha, double fLambda )
else
return GetLowRegIGamma( fAlpha, fX / fLambda);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
new file mode 100644
index 000000000000..ffac3d686501
--- /dev/null
+++ b/sc/source/core/tool/interpr7.cxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Kohei Yoshida <kyoshida@novell.com> (Novell, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Kohei Yoshida <kyoshida@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+// INCLUDE ---------------------------------------------------------------
+
+#include "interpre.hxx"
+
+// TODO: Add new methods for ScInterpreter here.
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx
index 3ba66011d0e4..1fbc1ec78975 100644
--- a/sc/source/core/tool/lookupcache.cxx
+++ b/sc/source/core/tool/lookupcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,40 +32,15 @@
#include "lookupcache.hxx"
#include "document.hxx"
-#ifdef erDEBUG
-#include <cstdio>
-using ::std::fprintf;
-static long nCacheCount = 0;
-#endif
-
-
ScLookupCache::ScLookupCache( ScDocument * pDoc, const ScRange & rRange ) :
maRange( rRange),
mpDoc( pDoc)
{
-#ifdef erDEBUG
- ++nCacheCount;
- fprintf( stderr, "\nctor ScLookupCache %ld: %d, %d, %d, %d, %d, %d; buckets: %lu, size: %lu\n",
- nCacheCount,
- (int)getRange().aStart.Col(), (int)getRange().aStart.Row(),
- (int)getRange().aStart.Tab(), (int)getRange().aEnd.Col(),
- (int)getRange().aEnd.Row(), (int)getRange().aEnd.Tab(),
- (unsigned long)maQueryMap.bucket_count(), (unsigned long)maQueryMap.size());
-#endif
}
ScLookupCache::~ScLookupCache()
{
-#ifdef erDEBUG
- fprintf( stderr, "\ndtor ScLookupCache %ld: %d, %d, %d, %d, %d, %d; buckets: %lu, size: %lu\n",
- nCacheCount,
- (int)getRange().aStart.Col(), (int)getRange().aStart.Row(),
- (int)getRange().aStart.Tab(), (int)getRange().aEnd.Col(),
- (int)getRange().aEnd.Row(), (int)getRange().aEnd.Tab(),
- (unsigned long)maQueryMap.bucket_count(), (unsigned long)maQueryMap.size());
- --nCacheCount;
-#endif
}
@@ -89,25 +65,13 @@ bool ScLookupCache::insert( const ScAddress & rResultAddress,
const QueryCriteria & rCriteria, const ScAddress & rQueryAddress,
const bool bAvailable )
{
-#ifdef erDEBUG
- size_t nBuckets = maQueryMap.bucket_count();
-#endif
QueryKey aKey( rQueryAddress, rCriteria.getQueryOp());
QueryCriteriaAndResult aResult( rCriteria, rResultAddress);
if (!bAvailable)
aResult.maAddress.SetRow(-1);
bool bInserted = maQueryMap.insert( ::std::pair< const QueryKey,
QueryCriteriaAndResult>( aKey, aResult)).second;
-#ifdef erDEBUG
- if (nBuckets != maQueryMap.bucket_count())
- {
- fprintf( stderr, "\nbuck ScLookupCache: %d, %d, %d, %d, %d, %d; buckets: %lu, size: %lu\n",
- (int)getRange().aStart.Col(), (int)getRange().aStart.Row(),
- (int)getRange().aStart.Tab(), (int)getRange().aEnd.Col(),
- (int)getRange().aEnd.Row(), (int)getRange().aEnd.Tab(),
- (unsigned long)maQueryMap.bucket_count(), (unsigned long)maQueryMap.size());
- }
-#endif
+
return bInserted;
}
@@ -124,3 +88,5 @@ void ScLookupCache::Notify( SvtBroadcaster & /* rBC */ , const SfxHint & rHint
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/makefile.mk b/sc/source/core/tool/makefile.mk
index c0258e6f0575..904f0d14d245 100644
--- a/sc/source/core/tool/makefile.mk
+++ b/sc/source/core/tool/makefile.mk
@@ -38,17 +38,27 @@ AUTOSEG=true
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
+ $(EXCEPTIONSFILES) \
+ $(SLO)$/addinhelpid.obj \
+ $(SLO)$/detdata.obj \
+ $(SLO)$/filtopt.obj \
+ $(SLO)$/hints.obj \
+ $(SLO)$/inputopt.obj \
+ $(SLO)$/navicfg.obj \
+ $(SLO)$/printopt.obj \
+ $(SLO)$/rechead.obj \
+ $(SLO)$/refdata.obj \
+ $(SLO)$/refreshtimer.obj
+
+EXCEPTIONSFILES= \
$(SLO)$/addincfg.obj \
$(SLO)$/addincol.obj \
- $(SLO)$/addinhelpid.obj \
$(SLO)$/addinlis.obj \
$(SLO)$/address.obj \
$(SLO)$/adiasync.obj \
@@ -57,11 +67,11 @@ SLOFILES = \
$(SLO)$/callform.obj \
$(SLO)$/cellform.obj \
$(SLO)$/cellkeytranslator.obj \
- $(SLO)$/charthelper.obj \
$(SLO)$/chartarr.obj \
- $(SLO)$/chartpos.obj \
+ $(SLO)$/charthelper.obj \
$(SLO)$/chartlis.obj \
$(SLO)$/chartlock.obj \
+ $(SLO)$/chartpos.obj \
$(SLO)$/chgtrack.obj \
$(SLO)$/chgviset.obj \
$(SLO)$/collect.obj \
@@ -69,27 +79,22 @@ SLOFILES = \
$(SLO)$/consoli.obj \
$(SLO)$/dbcolect.obj \
$(SLO)$/ddelink.obj \
- $(SLO)$/detdata.obj \
- $(SLO)$/detfunc.obj \
+ $(SLO)$/detfunc.obj \
$(SLO)$/docoptio.obj \
$(SLO)$/doubleref.obj \
$(SLO)$/editutil.obj \
- $(SLO)$/filtopt.obj \
$(SLO)$/formulaparserpool.obj \
- $(SLO)$/hints.obj \
- $(SLO)$/inputopt.obj \
$(SLO)$/interpr1.obj \
$(SLO)$/interpr2.obj \
$(SLO)$/interpr3.obj \
$(SLO)$/interpr4.obj \
$(SLO)$/interpr5.obj \
$(SLO)$/interpr6.obj \
+ $(SLO)$/interpr7.obj \
$(SLO)$/lookupcache.obj \
- $(SLO)$/navicfg.obj \
$(SLO)$/odffmap.obj \
$(SLO)$/optutil.obj \
$(SLO)$/parclass.obj \
- $(SLO)$/printopt.obj \
$(SLO)$/prnsave.obj \
$(SLO)$/progress.obj \
$(SLO)$/queryparam.obj \
@@ -97,13 +102,11 @@ SLOFILES = \
$(SLO)$/rangenam.obj \
$(SLO)$/rangeseq.obj \
$(SLO)$/rangeutl.obj \
- $(SLO)$/rechead.obj \
- $(SLO)$/refdata.obj \
$(SLO)$/reffind.obj \
- $(SLO)$/refreshtimer.obj \
$(SLO)$/reftokenhelper.obj \
- $(SLO)$/refupdat.obj \
$(SLO)$/scmatrix.obj \
+ $(SLO)$/refupdat.obj \
+ $(SLO)$/simplerangelist.obj \
$(SLO)$/stringutil.obj \
$(SLO)$/subtotal.obj \
$(SLO)$/token.obj \
@@ -112,29 +115,6 @@ SLOFILES = \
$(SLO)$/viewopti.obj \
$(SLO)$/zforauto.obj
-EXCEPTIONSFILES= \
- $(SLO)$/addincol.obj \
- $(SLO)$/cellkeytranslator.obj \
- $(SLO)$/charthelper.obj \
- $(SLO)$/chartarr.obj \
- $(SLO)$/chartlis.obj \
- $(SLO)$/chartlock.obj \
- $(SLO)$/chgtrack.obj \
- $(SLO)$/compiler.obj \
- $(SLO)$/doubleref.obj \
- $(SLO)$/formulaparserpool.obj \
- $(SLO)$/interpr1.obj \
- $(SLO)$/interpr2.obj \
- $(SLO)$/interpr3.obj \
- $(SLO)$/interpr4.obj \
- $(SLO)$/interpr5.obj \
- $(SLO)$/lookupcache.obj \
- $(SLO)$/prnsave.obj \
- $(SLO)$/queryparam.obj \
- $(SLO)$/reftokenhelper.obj \
- $(SLO)$/stringutil.obj \
- $(SLO)$/token.obj
-
# [kh] POWERPC compiler problem
.IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCPOWERPC"
NOOPTFILES= \
diff --git a/sc/source/core/tool/navicfg.cxx b/sc/source/core/tool/navicfg.cxx
index 56a4aed1ab3a..a4c6891db19c 100644
--- a/sc/source/core/tool/navicfg.cxx
+++ b/sc/source/core/tool/navicfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@
//------------------------------------------------------------------
ScNavipiCfg::ScNavipiCfg() :
-//! ConfigItem( OUString::createFromAscii( CFGPATH_NAVIPI ) ),
+//! ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_NAVIPI )) ),
nListMode(0),
nDragMode(0),
nRootType(0)
@@ -78,3 +79,4 @@ void ScNavipiCfg::SetRootType(sal_uInt16 nNew)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/odffmap.cxx b/sc/source/core/tool/odffmap.cxx
index 0ffaa4aae025..fc89705d1c39 100644
--- a/sc/source/core/tool/odffmap.cxx
+++ b/sc/source/core/tool/odffmap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#include "precompiled_sc.hxx"
#include "compiler.hxx"
+#include <sal/macros.h>
// ODFF, English, Programmatical, ODF_11
ScCompiler::AddInMap ScCompiler::maAddInMap[] =
@@ -136,14 +138,14 @@ ScCompiler::AddInMap ScCompiler::maAddInMap[] =
{ "FVSCHEDULE", "FVSCHEDULE", false, "com.sun.star.sheet.addin.Analysis.getFvschedule", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETFVSCHEDULE" },
};
-// static
const ScCompiler::AddInMap* ScCompiler::GetAddInMap()
{
return maAddInMap;
}
-// static
size_t ScCompiler::GetAddInMapCount()
{
- return sizeof(maAddInMap)/sizeof(maAddInMap[0]);
+ return SAL_N_ELEMENTS(maAddInMap);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/optutil.cxx b/sc/source/core/tool/optutil.cxx
index 9fdd42637762..e11322e9a056 100644
--- a/sc/source/core/tool/optutil.cxx
+++ b/sc/source/core/tool/optutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,12 +39,10 @@
//------------------------------------------------------------------
-// static
sal_Bool ScOptionsUtil::IsMetricSystem()
{
//! which language should be used here - system language or installed office language?
-// MeasurementSystem eSys = Application::GetAppInternational().GetMeasurementSystem();
MeasurementSystem eSys = ScGlobal::pLocaleData->getMeasurementSystemEnum();
return ( eSys == MEASURE_METRIC );
@@ -77,3 +76,4 @@ void ScLinkConfigItem::Commit()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 77a92ff0cef2..698601ee6ef3 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,12 +38,14 @@
#include "funcdesc.hxx"
#include <unotools/charclass.hxx>
#include <tools/debug.hxx>
+#include <sal/macros.h>
#include <string.h>
#if OSL_DEBUG_LEVEL > 1
// the documentation thingy
#include <stdio.h>
#include <com/sun/star/sheet/FormulaLanguage.hpp>
+#include <rtl/strbuf.hxx>
#include "compiler.hxx"
#include "sc.hrc" // VAR_ARGS
#endif
@@ -213,7 +216,7 @@ void ScParameterClassification::Init()
memset( pData, 0, sizeof(RunData) * (SC_OPCODE_LAST_OPCODE_ID + 1));
// init from specified static data above
- for ( size_t i=0; i < sizeof(pRawData) / sizeof(RawData); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS(pRawData); ++i )
{
const RawData* pRaw = &pRawData[i];
if ( pRaw->eOp > SC_OPCODE_LAST_OPCODE_ID )
@@ -347,7 +350,7 @@ ScParameterClassification::GetExternalParameterType( const formula::FormulaToken
}
}
else if ( (aUnoName = ScGlobal::GetAddInCollection()->FindFunction(
- aFuncName, sal_False)).Len() )
+ aFuncName, false)).Len() )
{
// the relevant parts of ScUnoAddInCall without having to create one
const ScUnoAddInFuncData* pFuncData =
@@ -405,7 +408,7 @@ void ScParameterClassification::MergeArgumentsFromFunctionResource()
continue; // not an internal opcode or already done
RunData* pRun = &pData[ pDesc->nFIndex ];
- sal_uInt16 nArgs = pDesc->GetSuppressedArgCount();
+ sal_Int32 nArgs = pDesc->GetSuppressedArgCount();
if ( nArgs >= VAR_ARGS )
{
nArgs -= VAR_ARGS - 1;
@@ -413,9 +416,12 @@ void ScParameterClassification::MergeArgumentsFromFunctionResource()
}
if ( nArgs > CommonData::nMaxParams )
{
- DBG_ERROR2( "ScParameterClassification::Init: too many arguments in listed function: %s: %d",
- ByteString( *(pDesc->pFuncName),
- RTL_TEXTENCODING_UTF8).GetBuffer(), nArgs);
+ rtl::OStringBuffer aBuf;
+ aBuf.append("ScParameterClassification::Init: too many arguments in listed function: ");
+ aBuf.append(rtl::OUStringToOString(*(pDesc->pFuncName), RTL_TEXTENCODING_UTF8));
+ aBuf.append(": ");
+ aBuf.append(nArgs);
+ OSL_ENSURE(false, aBuf.getStr());
nArgs = CommonData::nMaxParams;
pRun->aData.bRepeatLast = true;
}
@@ -576,3 +582,4 @@ void ScParameterClassification::GenerateDocumentation()
#endif // OSL_DEBUG_LEVEL
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx
index 5d96ba3e0dad..35b91f1734de 100644
--- a/sc/source/core/tool/printopt.cxx
+++ b/sc/source/core/tool/printopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,10 @@
#include "miscuno.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
// -----------------------------------------------------------------------
TYPEINIT1(ScTpPrintItem, SfxPoolItem);
@@ -64,7 +66,7 @@ ScPrintOptions::~ScPrintOptions()
void ScPrintOptions::SetDefaults()
{
bSkipEmpty = sal_True;
- bAllSheets = sal_False;
+ bAllSheets = false;
}
const ScPrintOptions& ScPrintOptions::operator=( const ScPrintOptions& rCpy )
@@ -87,9 +89,6 @@ int ScPrintOptions::operator!=( const ScPrintOptions& rOpt ) const
// -----------------------------------------------------------------------
-//UNUSED2008-05 ScTpPrintItem::ScTpPrintItem( sal_uInt16 nWhichP ) : SfxPoolItem( nWhichP )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
ScTpPrintItem::ScTpPrintItem( sal_uInt16 nWhichP, const ScPrintOptions& rOpt ) :
SfxPoolItem ( nWhichP ),
@@ -149,11 +148,10 @@ Sequence<OUString> ScPrintCfg::GetPropertyNames()
}
ScPrintCfg::ScPrintCfg() :
- ConfigItem( OUString::createFromAscii( CFGPATH_PRINT ) )
+ ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_PRINT )) )
{
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
-// EnableNotification(aNames);
const Any* pValues = aValues.getConstArray();
DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
@@ -207,5 +205,6 @@ void ScPrintCfg::SetOptions( const ScPrintOptions& rNew )
SetModified();
}
-void ScPrintCfg::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {}
+void ScPrintCfg::Notify( const ::com::sun::star::uno::Sequence< OUString >& ) {}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx
index 091148d7bb1d..7813539dc06b 100644
--- a/sc/source/core/tool/prnsave.cxx
+++ b/sc/source/core/tool/prnsave.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,7 +50,7 @@
ScPrintSaverTab::ScPrintSaverTab() :
mpRepeatCol(NULL),
mpRepeatRow(NULL),
- mbEntireSheet(sal_False)
+ mbEntireSheet(false)
{
}
@@ -124,7 +125,7 @@ sal_Bool ScPrintRangeSaver::operator==( const ScPrintRangeSaver& rCmp ) const
for (SCTAB i=0; i<nTabCount; i++)
if (!(pData[i]==rCmp.pData[i]))
{
- bEqual = sal_False;
+ bEqual = false;
break;
}
return bEqual;
@@ -133,3 +134,4 @@ sal_Bool ScPrintRangeSaver::operator==( const ScPrintRangeSaver& rCmp ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index 3b94a9b7ed80..9cb767b7a487 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,7 +60,7 @@ ScProgress* ScProgress::pOldInterpretProgress = NULL;
sal_uLong ScProgress::nInterpretProgress = 0;
sal_Bool ScProgress::bAllowInterpretProgress = sal_True;
ScDocument* ScProgress::pInterpretDoc;
-sal_Bool ScProgress::bIdleWasDisabled = sal_False;
+sal_Bool ScProgress::bIdleWasDisabled = false;
sal_Bool lcl_IsHiddenDocument( SfxObjectShell* pObjSh )
@@ -76,7 +77,7 @@ sal_Bool lcl_IsHiddenDocument( SfxObjectShell* pObjSh )
return sal_True;
}
}
- return sal_False;
+ return false;
}
bool lcl_HasControllersLocked( SfxObjectShell& rObjSh )
@@ -100,7 +101,7 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const String& rText,
}
else
{
- DBG_ERROR( "ScProgress: there can be only one!" );
+ OSL_FAIL( "ScProgress: there can be only one!" );
pProgress = NULL;
}
}
@@ -116,9 +117,8 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const String& rText,
pObjSh->GetProgress() ||
lcl_HasControllersLocked(*pObjSh) ) )
{
- // #62808# no own progress for embedded objects,
- // #73633# no second progress if the document already has one
- // #163566# no progress while controllers are locked (repaint disabled)
+ // no own progress for embedded objects,
+ // no second progress if the document already has one
pProgress = NULL;
}
@@ -151,7 +151,6 @@ ScProgress::~ScProgress()
}
}
-// static
void ScProgress::CreateInterpretProgress( ScDocument* pDoc, sal_Bool bWait )
{
@@ -170,14 +169,13 @@ void ScProgress::CreateInterpretProgress( ScDocument* pDoc, sal_Bool bWait )
if ( !pGlobalProgress )
pInterpretProgress = new ScProgress( pDoc->GetDocumentShell(),
ScGlobal::GetRscString( STR_PROGRESS_CALCULATING ),
- pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, sal_False, bWait );
+ pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, false, bWait );
pInterpretDoc = pDoc;
}
}
}
-// static
void ScProgress::DeleteInterpretProgress()
{
@@ -188,7 +186,6 @@ void ScProgress::DeleteInterpretProgress()
a refresh of the sheet window which may call CreateInterpretProgress
and DeleteInterpretProgress again (from Output::DrawStrings),
resulting in double deletion of 'pInterpretProgress'. */
-// if ( --nInterpretProgress == 0 )
if ( nInterpretProgress == 1 )
{
if ( pInterpretProgress != &theDummyInterpretProgress )
@@ -207,3 +204,4 @@ void ScProgress::DeleteInterpretProgress()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index 3e755ed10d1e..e991b4d7277c 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: interpr4.cxx,v $
- * $Revision: 1.57.92.5 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -57,6 +55,11 @@ ScQueryParamBase::~ScQueryParamBase()
{
}
+bool ScQueryParamBase::IsValidFieldIndex() const
+{
+ return true;
+}
+
SCSIZE ScQueryParamBase::GetEntryCount() const
{
return maEntries.size();
@@ -185,7 +188,8 @@ ScQueryParam::ScQueryParam() :
ScQueryParam::ScQueryParam( const ScQueryParam& r ) :
ScQueryParamBase(r),
ScQueryParamTable(r),
- bDestPers(r.bDestPers), nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow)
+ bDestPers(r.bDestPers), nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow),
+ nDynamicEndRow(r.nDynamicEndRow), bUseDynamicRange(r.bUseDynamicRange)
{
}
@@ -195,7 +199,9 @@ ScQueryParam::ScQueryParam( const ScDBQueryParamInternal& r ) :
bDestPers(true),
nDestTab(0),
nDestCol(0),
- nDestRow(0)
+ nDestRow(0),
+ nDynamicEndRow(0),
+ bUseDynamicRange(false)
{
}
@@ -213,7 +219,7 @@ void ScQueryParam::Clear()
nCol1=nCol2 = 0;
nRow1=nRow2 = 0;
nTab = SCTAB_MAX;
- bHasHeader = bCaseSens = bRegExp = bMixedComparison = sal_False;
+ bHasHeader = bCaseSens = bRegExp = bMixedComparison = false;
bInplace = bByRow = bDuplicate = sal_True;
Resize( MAXQUERY );
@@ -229,6 +235,8 @@ void ScQueryParam::ClearDestParams()
nDestTab = 0;
nDestCol = 0;
nDestRow = 0;
+ nDynamicEndRow = 0;
+ bUseDynamicRange = false;
}
//------------------------------------------------------------------------
@@ -251,6 +259,8 @@ ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r )
bDuplicate = r.bDuplicate;
bByRow = r.bByRow;
bDestPers = r.bDestPers;
+ nDynamicEndRow = r.nDynamicEndRow;
+ bUseDynamicRange = r.bUseDynamicRange;
maEntries = r.maEntries;
@@ -261,7 +271,7 @@ ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r )
sal_Bool ScQueryParam::operator==( const ScQueryParam& rOther ) const
{
- sal_Bool bEqual = sal_False;
+ sal_Bool bEqual = false;
// Anzahl der Queries gleich?
SCSIZE nUsed = 0;
@@ -289,7 +299,9 @@ sal_Bool ScQueryParam::operator==( const ScQueryParam& rOther ) const
&& (bDestPers == rOther.bDestPers)
&& (nDestTab == rOther.nDestTab)
&& (nDestCol == rOther.nDestCol)
- && (nDestRow == rOther.nDestRow) )
+ && (nDestRow == rOther.nDestRow)
+ && (nDynamicEndRow == rOther.nDynamicEndRow)
+ && (bUseDynamicRange == rOther.bUseDynamicRange) )
{
bEqual = sal_True;
for ( SCSIZE i=0; i<nUsed && bEqual; i++ )
@@ -313,6 +325,7 @@ void ScQueryParam::MoveToDest()
nCol2 = sal::static_int_cast<SCCOL>( nCol2 + nDifX );
nRow2 = sal::static_int_cast<SCROW>( nRow2 + nDifY );
nTab = sal::static_int_cast<SCTAB>( nTab + nDifZ );
+ nDynamicEndRow = sal::static_int_cast<SCROW>( nDynamicEndRow + nDifY );
size_t n = maEntries.size();
for (size_t i=0; i<n; i++)
maEntries[i].nField += nDifX;
@@ -321,7 +334,7 @@ void ScQueryParam::MoveToDest()
}
else
{
- DBG_ERROR("MoveToDest, bInplace == TRUE");
+ OSL_FAIL("MoveToDest, bInplace == TRUE");
}
}
@@ -356,6 +369,11 @@ ScDBQueryParamInternal::~ScDBQueryParamInternal()
{
}
+bool ScDBQueryParamInternal::IsValidFieldIndex() const
+{
+ return nCol1 <= mnField && mnField <= nCol2;
+}
+
// ============================================================================
ScDBQueryParamMatrix::ScDBQueryParamMatrix() :
@@ -363,7 +381,15 @@ ScDBQueryParamMatrix::ScDBQueryParamMatrix() :
{
}
+bool ScDBQueryParamMatrix::IsValidFieldIndex() const
+{
+ SCSIZE nC, nR;
+ mpMatrix->GetDimensions(nC, nR);
+ return 0 <= mnField && mnField <= static_cast<SCCOL>(nC);
+}
+
ScDBQueryParamMatrix::~ScDBQueryParamMatrix()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index d1f22a3cb257..7395da73d33e 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,19 +44,129 @@
#include "rechead.hxx"
#include "compiler.hxx"
-// === ScRangeList ====================================================
+using ::std::vector;
+using ::std::advance;
+using ::std::find_if;
+using ::std::for_each;
+using ::formula::FormulaGrammar;
-ScRangeList::~ScRangeList()
+namespace {
+
+template<typename T>
+class FindEnclosingRange : public ::std::unary_function<bool, ScRange*>
+{
+public:
+ FindEnclosingRange(const T& rTest) : mrTest(rTest) {}
+ FindEnclosingRange(const FindEnclosingRange& r) : mrTest(r.mrTest) {}
+ bool operator() (const ScRange* pRange) const
+ {
+ return pRange->In(mrTest);
+ }
+private:
+ const T& mrTest;
+};
+
+template<typename T>
+class FindIntersectingRange : public ::std::unary_function<bool, ScRange*>
+{
+public:
+ FindIntersectingRange(const T& rTest) : mrTest(rTest) {}
+ FindIntersectingRange(const FindIntersectingRange& r) : mrTest(r.mrTest) {}
+ bool operator() (const ScRange* pRange) const
+ {
+ return pRange->Intersects(mrTest);
+ }
+private:
+ const T& mrTest;
+};
+
+class AppendToList : public ::std::unary_function<void, const ScRange*>
+{
+public:
+ AppendToList(vector<ScRange*>& rRanges) : mrRanges(rRanges) {}
+ AppendToList(const AppendToList& r) : mrRanges(r.mrRanges) {}
+ void operator() (const ScRange* p)
+ {
+ mrRanges.push_back(new ScRange(*p));
+ }
+private:
+ vector<ScRange*>& mrRanges;
+};
+
+template<typename T>
+struct DeleteObject : public ::std::unary_function<void, T*>
{
- for ( ScRangePtr pR = First(); pR; pR = Next() )
- delete pR;
+ void operator() (T* p)
+ {
+ delete p;
+ }
+};
+
+class CountCells : public ::std::unary_function<void, const ScRange*>
+{
+public:
+ CountCells() : mnCellCount(0) {}
+ CountCells(const CountCells& r) : mnCellCount(r.mnCellCount) {}
+
+ void operator() (const ScRange* p)
+ {
+ mnCellCount +=
+ size_t(p->aEnd.Col() - p->aStart.Col() + 1)
+ * size_t(p->aEnd.Row() - p->aStart.Row() + 1)
+ * size_t(p->aEnd.Tab() - p->aStart.Tab() + 1);
+ }
+
+ size_t getCellCount() const { return mnCellCount; }
+
+private:
+ size_t mnCellCount;
+};
+
+class FormatString : public ::std::unary_function<void, const ScRange*>
+{
+public:
+ FormatString(String& rStr, sal_uInt16 nFlags, ScDocument* pDoc, FormulaGrammar::AddressConvention eConv, sal_Unicode cDelim) :
+ mrStr(rStr),
+ mnFlags(nFlags),
+ mpDoc(pDoc),
+ meConv(eConv),
+ mcDelim(cDelim),
+ mbFirst(true) {}
+
+ FormatString(const FormatString& r) :
+ mrStr(r.mrStr),
+ mnFlags(r.mnFlags),
+ mpDoc(r.mpDoc),
+ meConv(r.meConv),
+ mcDelim(r.mcDelim),
+ mbFirst(r.mbFirst) {}
+
+ void operator() (const ScRange* p)
+ {
+ String aStr;
+ p->Format(aStr, mnFlags, mpDoc, meConv);
+ if (mbFirst)
+ mbFirst = false;
+ else
+ mrStr += mcDelim;
+ mrStr += aStr;
+ }
+private:
+ String& mrStr;
+ sal_uInt16 mnFlags;
+ ScDocument* mpDoc;
+ FormulaGrammar::AddressConvention meConv;
+ sal_Unicode mcDelim;
+ bool mbFirst;
+};
+
}
-void ScRangeList::RemoveAll()
+// === ScRangeList ====================================================
+
+ScRangeList::~ScRangeList()
{
- for ( ScRangePtr pR = First(); pR; pR = Next() )
- delete pR;
- Clear();
+ RemoveAll();
}
sal_uInt16 ScRangeList::Parse( const String& rStr, ScDocument* pDoc, sal_uInt16 nMask,
@@ -83,15 +194,17 @@ sal_uInt16 ScRangeList::Parse( const String& rStr, ScDocument* pDoc, sal_uInt16
for ( sal_uInt16 i=0; i<nTCount; i++ )
{
aOne = rStr.GetToken( i, cDelimiter );
- // FIXME : broken for Lotus
- if ( aOne.Search( ':' ) == STRING_NOTFOUND )
- { // Range muss es sein
- String aStrTmp( aOne );
- aOne += ':';
- aOne += aStrTmp;
- }
aRange.aStart.SetTab( nTab ); // Default Tab wenn nicht angegeben
- sal_uInt16 nRes = aRange.Parse( aOne, pDoc, eConv );
+ sal_uInt16 nRes = aRange.ParseAny( aOne, pDoc, eConv );
+ sal_uInt16 nEndRangeBits = SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2;
+ sal_uInt16 nTmp1 = ( nRes & SCA_BITS );
+ sal_uInt16 nTmp2 = ( nRes & nEndRangeBits );
+ // If we have a valid single range with
+ // any of the address bits we are interested in
+ // set - set the equiv end range bits
+ if ( (nRes & SCA_VALID ) && nTmp1 && ( nTmp2 != nEndRangeBits ) )
+ nRes |= ( nTmp1 << 4 );
+
if ( (nRes & nMask) == nMask )
Append( aRange );
nResult &= nRes; // alle gemeinsamen Bits bleiben erhalten
@@ -112,21 +225,14 @@ void ScRangeList::Format( String& rStr, sal_uInt16 nFlags, ScDocument* pDoc,
if (!cDelimiter)
cDelimiter = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
- sal_uLong nCnt = Count();
- for ( sal_uLong nIdx = 0; nIdx < nCnt; nIdx++ )
- {
- String aStr;
- GetObject( nIdx )->Format( aStr, nFlags, pDoc, eConv );
- if ( nIdx )
- rStr += cDelimiter;
- rStr += aStr;
- }
+ FormatString func(rStr, nFlags, pDoc, eConv, cDelimiter);
+ for_each(maRanges.begin(), maRanges.end(), func);
}
-void ScRangeList::Join( const ScRange& r, sal_Bool bIsInList )
+void ScRangeList::Join( const ScRange& r, bool bIsInList )
{
- if ( !Count() )
+ if ( maRanges.empty() )
{
Append( r );
return ;
@@ -137,32 +243,43 @@ void ScRangeList::Join( const ScRange& r, sal_Bool bIsInList )
SCCOL nCol2 = r.aEnd.Col();
SCROW nRow2 = r.aEnd.Row();
SCTAB nTab2 = r.aEnd.Tab();
- ScRangePtr pOver = (ScRangePtr) &r; // fies aber wahr wenn bInList
- sal_uLong nOldPos = 0;
+
+ ScRange* pOver = (ScRange*) &r; // fies aber wahr wenn bInList
+ size_t nOldPos = 0;
if ( bIsInList )
- { // merken um ggbf. zu loeschen bzw. wiederherzustellen
- nOldPos = GetPos( pOver );
+ {
+ // Find the current position of this range.
+ for ( size_t i = 0, nRanges = maRanges.size(); i < nRanges; ++i )
+ {
+ if ( maRanges[i] == pOver )
+ {
+ nOldPos = i;
+ break;
+ }
+ }
}
- sal_Bool bJoinedInput = sal_False;
- for ( ScRangePtr p = First(); p && pOver; p = Next() )
+ bool bJoinedInput = false;
+
+ for ( size_t i = 0, nRanges = maRanges.size(); i < nRanges && pOver; ++i )
{
+ ScRange* p = maRanges[i];
if ( p == pOver )
continue; // derselbe, weiter mit dem naechsten
- sal_Bool bJoined = sal_False;
+ bool bJoined = false;
if ( p->In( r ) )
{ // Range r in Range p enthalten oder identisch
if ( bIsInList )
- bJoined = sal_True; // weg mit Range r
+ bJoined = true; // weg mit Range r
else
{ // das war's dann
- bJoinedInput = sal_True; // nicht anhaengen
+ bJoinedInput = true; // nicht anhaengen
break; // for
}
}
else if ( r.In( *p ) )
{ // Range p in Range r enthalten, r zum neuen Range machen
*p = r;
- bJoined = sal_True;
+ bJoined = true;
}
if ( !bJoined && p->aStart.Tab() == nTab1 && p->aEnd.Tab() == nTab2 )
{ // 2D
@@ -171,12 +288,12 @@ void ScRangeList::Join( const ScRange& r, sal_Bool bIsInList )
if ( p->aStart.Row() == nRow2+1 )
{ // oben
p->aStart.SetRow( nRow1 );
- bJoined = sal_True;
+ bJoined = true;
}
else if ( p->aEnd.Row() == nRow1-1 )
{ // unten
p->aEnd.SetRow( nRow2 );
- bJoined = sal_True;
+ bJoined = true;
}
}
else if ( p->aStart.Row() == nRow1 && p->aEnd.Row() == nRow2 )
@@ -184,12 +301,12 @@ void ScRangeList::Join( const ScRange& r, sal_Bool bIsInList )
if ( p->aStart.Col() == nCol2+1 )
{ // links
p->aStart.SetCol( nCol1 );
- bJoined = sal_True;
+ bJoined = true;
}
else if ( p->aEnd.Col() == nCol1-1 )
{ // rechts
p->aEnd.SetCol( nCol2 );
- bJoined = sal_True;
+ bJoined = true;
}
}
}
@@ -197,296 +314,284 @@ void ScRangeList::Join( const ScRange& r, sal_Bool bIsInList )
{
if ( bIsInList )
{ // innerhalb der Liste Range loeschen
- Remove( nOldPos );
+ Remove(nOldPos);
delete pOver;
pOver = NULL;
if ( nOldPos )
nOldPos--; // Seek richtig aufsetzen
}
- bJoinedInput = sal_True;
- Join( *p, sal_True ); // rekursiv!
+ bJoinedInput = true;
+ Join( *p, true ); // rekursiv!
}
}
- if ( bIsInList )
- Seek( nOldPos );
- else if ( !bJoinedInput )
+ if ( !bIsInList && !bJoinedInput )
Append( r );
}
-sal_Bool ScRangeList::operator==( const ScRangeList& r ) const
+bool ScRangeList::operator==( const ScRangeList& r ) const
{
if ( this == &r )
- return sal_True; // identische Referenz
- if ( Count() != r.Count() )
- return sal_False;
- sal_uLong nCnt = Count();
- for ( sal_uLong nIdx = 0; nIdx < nCnt; nIdx++ )
+ return true;
+
+ if (maRanges.size() != r.maRanges.size())
+ return false;
+
+ vector<ScRange*>::const_iterator itr1 = maRanges.begin(), itrEnd = maRanges.end();
+ vector<ScRange*>::const_iterator itr2 = r.maRanges.begin();
+ for (; itr1 != itrEnd; ++itr1, ++itr2)
{
- if ( *GetObject( nIdx ) != *r.GetObject( nIdx ) )
- return sal_False; // auch andere Reihenfolge ist ungleich
+ const ScRange* p1 = *itr1;
+ const ScRange* p2 = *itr2;
+ if (*p1 != *p2)
+ return false;
}
- return sal_True;
+ return true;
}
-sal_Bool ScRangeList::operator!=( const ScRangeList& r ) const
+bool ScRangeList::operator!=( const ScRangeList& r ) const
{
return !operator==( r );
}
-sal_Bool ScRangeList::UpdateReference( UpdateRefMode eUpdateRefMode,
- ScDocument* pDoc, const ScRange& rWhere,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+bool ScRangeList::UpdateReference(
+ UpdateRefMode eUpdateRefMode,
+ ScDocument* pDoc,
+ const ScRange& rWhere,
+ SCsCOL nDx,
+ SCsROW nDy,
+ SCsTAB nDz
+)
{
- sal_Bool bChanged = sal_False;
- if ( Count() )
+ if (maRanges.empty())
+ // No ranges to update. Bail out.
+ return false;
+
+ bool bChanged = false;
+ SCCOL nCol1;
+ SCROW nRow1;
+ SCTAB nTab1;
+ SCCOL nCol2;
+ SCROW nRow2;
+ SCTAB nTab2;
+ rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+
+ vector<ScRange*>::iterator itr = maRanges.begin(), itrEnd = maRanges.end();
+ for (; itr != itrEnd; ++itr)
{
- SCCOL nCol1;
- SCROW nRow1;
- SCTAB nTab1;
- SCCOL nCol2;
- SCROW nRow2;
- SCTAB nTab2;
- rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
- for ( ScRange* pR = First(); pR; pR = Next() )
+ ScRange* pR = *itr;
+ SCCOL theCol1;
+ SCROW theRow1;
+ SCTAB theTab1;
+ SCCOL theCol2;
+ SCROW theRow2;
+ SCTAB theTab2;
+ pR->GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 );
+ if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
+ nCol1, nRow1, nTab1, nCol2, nRow2, nTab2,
+ nDx, nDy, nDz,
+ theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 )
+ != UR_NOTHING )
{
- SCCOL theCol1;
- SCROW theRow1;
- SCTAB theTab1;
- SCCOL theCol2;
- SCROW theRow2;
- SCTAB theTab2;
- pR->GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 );
- if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
- nCol1, nRow1, nTab1, nCol2, nRow2, nTab2,
- nDx, nDy, nDz,
- theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 )
- != UR_NOTHING )
- {
- bChanged = sal_True;
- pR->aStart.Set( theCol1, theRow1, theTab1 );
- pR->aEnd.Set( theCol2, theRow2, theTab2 );
- }
+ bChanged = true;
+ pR->aStart.Set( theCol1, theRow1, theTab1 );
+ pR->aEnd.Set( theCol2, theRow2, theTab2 );
}
}
return bChanged;
}
-
-ScRange* ScRangeList::Find( const ScAddress& rAdr ) const
+const ScRange* ScRangeList::Find( const ScAddress& rAdr ) const
{
- sal_uLong nListCount = Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
- {
- ScRange* pR = GetObject( j );
- if ( pR->In( rAdr ) )
- return pR;
- }
- return NULL;
+ vector<ScRange*>::const_iterator itr = find_if(
+ maRanges.begin(), maRanges.end(), FindEnclosingRange<ScAddress>(rAdr));
+ return itr == maRanges.end() ? NULL : *itr;
}
+ScRange* ScRangeList::Find( const ScAddress& rAdr )
+{
+ vector<ScRange*>::iterator itr = find_if(
+ maRanges.begin(), maRanges.end(), FindEnclosingRange<ScAddress>(rAdr));
+ return itr == maRanges.end() ? NULL : *itr;
+}
ScRangeList::ScRangeList( const ScRangeList& rList ) :
- ScRangeListBase(),
SvRefBase()
{
- sal_uLong nListCount = rList.Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
- Append( *rList.GetObject( j ) );
+ maRanges.reserve(rList.maRanges.size());
+ for_each(rList.maRanges.begin(), rList.maRanges.end(), AppendToList(maRanges));
}
-
ScRangeList& ScRangeList::operator=(const ScRangeList& rList)
{
RemoveAll();
+ maRanges.reserve(rList.maRanges.size());
+ for_each(rList.maRanges.begin(), rList.maRanges.end(), AppendToList(maRanges));
+ return *this;
+}
- sal_uLong nListCount = rList.Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
- Append( *rList.GetObject( j ) );
+bool ScRangeList::Intersects( const ScRange& rRange ) const
+{
+ vector<ScRange*>::const_iterator itrEnd = maRanges.end();
+ vector<ScRange*>::const_iterator itr =
+ find_if(maRanges.begin(), itrEnd, FindIntersectingRange<ScRange>(rRange));
+ return itr != itrEnd;
+}
- return *this;
+bool ScRangeList::In( const ScRange& rRange ) const
+{
+ vector<ScRange*>::const_iterator itrEnd = maRanges.end();
+ vector<ScRange*>::const_iterator itr =
+ find_if(maRanges.begin(), itrEnd, FindEnclosingRange<ScRange>(rRange));
+ return itr != itrEnd;
}
-sal_Bool ScRangeList::Intersects( const ScRange& rRange ) const
+size_t ScRangeList::GetCellCount() const
{
- sal_uLong nListCount = Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
- if ( GetObject(j)->Intersects( rRange ) )
- return sal_True;
+ CountCells func;
+ return for_each(maRanges.begin(), maRanges.end(), func).getCellCount();
+}
- return sal_False;
+ScRange* ScRangeList::Remove(size_t nPos)
+{
+ if (maRanges.size() <= nPos)
+ // Out-of-bound condition. Bail out.
+ return NULL;
+
+ vector<ScRange*>::iterator itr = maRanges.begin();
+ advance(itr, nPos);
+ ScRange* p = *itr;
+ maRanges.erase(itr);
+ return p;
}
+void ScRangeList::RemoveAll()
+{
+ for_each(maRanges.begin(), maRanges.end(), DeleteObject<ScRange>());
+ maRanges.clear();
+}
-sal_Bool ScRangeList::In( const ScRange& rRange ) const
+bool ScRangeList::empty() const
{
- sal_uLong nListCount = Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
- if ( GetObject(j)->In( rRange ) )
- return sal_True;
+ return maRanges.empty();
+}
- return sal_False;
+size_t ScRangeList::size() const
+{
+ return maRanges.size();
}
+ScRange* ScRangeList::operator [](size_t idx)
+{
+ return maRanges[idx];
+}
-sal_uLong ScRangeList::GetCellCount() const
+const ScRange* ScRangeList::operator [](size_t idx) const
{
- sal_uLong nCellCount = 0;
- sal_uLong nListCount = Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
- {
- ScRange* pR = GetObject( j );
- nCellCount += sal_uLong(pR->aEnd.Col() - pR->aStart.Col() + 1)
- * sal_uLong(pR->aEnd.Row() - pR->aStart.Row() + 1)
- * sal_uLong(pR->aEnd.Tab() - pR->aStart.Tab() + 1);
- }
- return nCellCount;
+ return maRanges[idx];
}
+ScRange* ScRangeList::front()
+{
+ return maRanges.front();
+}
-// === ScRangePairList ====================================================
+const ScRange* ScRangeList::front() const
+{
+ return maRanges.front();
+}
+
+ScRange* ScRangeList::back()
+{
+ return maRanges.back();
+}
+
+const ScRange* ScRangeList::back() const
+{
+ return maRanges.back();
+}
+
+void ScRangeList::push_back(ScRange* p)
+{
+ maRanges.push_back(p);
+}
+
+// === ScRangePairList ========================================================
ScRangePairList::~ScRangePairList()
{
- for ( ScRangePair* pR = First(); pR; pR = Next() )
- delete pR;
+ for_each( maPairs.begin(), maPairs.end(), DeleteObject<ScRangePair>() );
+ maPairs.clear();
}
+//-----------------------------------------------------------------------------
+ScRangePair* ScRangePairList::Remove(size_t nPos)
+{
+ if (maPairs.size() <= nPos)
+ // Out-of-bound condition. Bail out.
+ return NULL;
+
+ vector<ScRangePair*>::iterator itr = maPairs.begin();
+ advance(itr, nPos);
+ ScRangePair* p = *itr;
+ maPairs.erase(itr);
+ return p;
+}
-void ScRangePairList::Join( const ScRangePair& r, sal_Bool bIsInList )
+//-----------------------------------------------------------------------------
+ScRangePair* ScRangePairList::Remove( ScRangePair* Adr)
{
- if ( !Count() )
- {
- Append( r );
- return ;
- }
- const ScRange& r1 = r.GetRange(0);
- const ScRange& r2 = r.GetRange(1);
- SCCOL nCol1 = r1.aStart.Col();
- SCROW nRow1 = r1.aStart.Row();
- SCTAB nTab1 = r1.aStart.Tab();
- SCCOL nCol2 = r1.aEnd.Col();
- SCROW nRow2 = r1.aEnd.Row();
- SCTAB nTab2 = r1.aEnd.Tab();
- ScRangePair* pOver = (ScRangePair*) &r; // fies aber wahr wenn bInList
- sal_uLong nOldPos = 0;
- if ( bIsInList )
- { // merken um ggbf. zu loeschen bzw. wiederherzustellen
- nOldPos = GetPos( pOver );
- }
- sal_Bool bJoinedInput = sal_False;
- for ( ScRangePair* p = First(); p && pOver; p = Next() )
+ ScRangePair* p = NULL;
+
+ if (Adr == NULL) return NULL;
+
+ for ( vector<ScRangePair*>::iterator itr = maPairs.begin(); itr < maPairs.end(); ++itr )
{
- if ( p == pOver )
- continue; // derselbe, weiter mit dem naechsten
- sal_Bool bJoined = sal_False;
- ScRange& rp1 = p->GetRange(0);
- ScRange& rp2 = p->GetRange(1);
- if ( rp2 == r2 )
- { // nur wenn Range2 gleich ist
- if ( rp1.In( r1 ) )
- { // RangePair r in RangePair p enthalten oder identisch
- if ( bIsInList )
- bJoined = sal_True; // weg mit RangePair r
- else
- { // das war's dann
- bJoinedInput = sal_True; // nicht anhaengen
- break; // for
- }
- }
- else if ( r1.In( rp1 ) )
- { // RangePair p in RangePair r enthalten, r zum neuen RangePair machen
- *p = r;
- bJoined = sal_True;
- }
- }
- if ( !bJoined && rp1.aStart.Tab() == nTab1 && rp1.aEnd.Tab() == nTab2
- && rp2.aStart.Tab() == r2.aStart.Tab()
- && rp2.aEnd.Tab() == r2.aEnd.Tab() )
- { // 2D, Range2 muss genauso nebeneinander liegen wie Range1
- if ( rp1.aStart.Col() == nCol1 && rp1.aEnd.Col() == nCol2
- && rp2.aStart.Col() == r2.aStart.Col()
- && rp2.aEnd.Col() == r2.aEnd.Col() )
- {
- if ( rp1.aStart.Row() == nRow2+1
- && rp2.aStart.Row() == r2.aEnd.Row()+1 )
- { // oben
- rp1.aStart.SetRow( nRow1 );
- rp2.aStart.SetRow( r2.aStart.Row() );
- bJoined = sal_True;
- }
- else if ( rp1.aEnd.Row() == nRow1-1
- && rp2.aEnd.Row() == r2.aStart.Row()-1 )
- { // unten
- rp1.aEnd.SetRow( nRow2 );
- rp2.aEnd.SetRow( r2.aEnd.Row() );
- bJoined = sal_True;
- }
- }
- else if ( rp1.aStart.Row() == nRow1 && rp1.aEnd.Row() == nRow2
- && rp2.aStart.Row() == r2.aStart.Row()
- && rp2.aEnd.Row() == r2.aEnd.Row() )
- {
- if ( rp1.aStart.Col() == nCol2+1
- && rp2.aStart.Col() == r2.aEnd.Col()+1 )
- { // links
- rp1.aStart.SetCol( nCol1 );
- rp2.aStart.SetCol( r2.aStart.Col() );
- bJoined = sal_True;
- }
- else if ( rp1.aEnd.Col() == nCol1-1
- && rp2.aEnd.Col() == r2.aEnd.Col()-1 )
- { // rechts
- rp1.aEnd.SetCol( nCol2 );
- rp2.aEnd.SetCol( r2.aEnd.Col() );
- bJoined = sal_True;
- }
- }
- }
- if ( bJoined )
+ if ( Adr == (p = *itr) )
{
- if ( bIsInList )
- { // innerhalb der Liste RangePair loeschen
- Remove( nOldPos );
- delete pOver;
- pOver = NULL;
- if ( nOldPos )
- nOldPos--; // Seek richtig aufsetzen
- }
- bJoinedInput = sal_True;
- Join( *p, sal_True ); // rekursiv!
+ maPairs.erase( itr );
+ break;
}
}
- if ( bIsInList )
- Seek( nOldPos );
- else if ( !bJoinedInput )
- Append( r );
+ return p;
}
-
-sal_Bool ScRangePairList::operator==( const ScRangePairList& r ) const
+bool ScRangePairList::operator==( const ScRangePairList& r ) const
{
if ( this == &r )
- return sal_True; // identische Referenz
- if ( Count() != r.Count() )
- return sal_False;
- sal_uLong nCnt = Count();
- for ( sal_uLong nIdx = 0; nIdx < nCnt; nIdx++ )
+ return true; // identische Referenz
+ if ( maPairs.size() != r.size() )
+ return false;
+ for ( size_t nIdx = 0, nCnt = maPairs.size(); nIdx < nCnt; ++nIdx )
{
- if ( *GetObject( nIdx ) != *r.GetObject( nIdx ) )
- return sal_False; // auch andere Reihenfolge ist ungleich
+ if ( *maPairs[ nIdx ] != *r[ nIdx ] )
+ return false; // auch andere Reihenfolge ist ungleich
}
- return sal_True;
+ return true;
+}
+
+ScRangePair* ScRangePairList::operator [](size_t idx)
+{
+ return maPairs[idx];
}
+const ScRangePair* ScRangePairList::operator [](size_t idx) const
+{
+ return maPairs[idx];
+}
-sal_Bool ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
+size_t ScRangePairList::size() const
+{
+ return maPairs.size();
+}
+
+bool ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
ScDocument* pDoc, const ScRange& rWhere,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
{
- sal_Bool bChanged = sal_False;
- if ( Count() )
+ bool bChanged = false;
+ if ( !maPairs.empty() )
{
SCCOL nCol1;
SCROW nRow1;
@@ -495,8 +600,9 @@ sal_Bool ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
SCROW nRow2;
SCTAB nTab2;
rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
- for ( ScRangePair* pR = First(); pR; pR = Next() )
+ for ( size_t i = 0, nPairs = maPairs.size(); i < nPairs; ++i )
{
+ ScRangePair* pR = maPairs[ i ];
for ( sal_uInt16 j=0; j<2; j++ )
{
ScRange& rRange = pR->GetRange(j);
@@ -513,7 +619,7 @@ sal_Bool ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 )
!= UR_NOTHING )
{
- bChanged = sal_True;
+ bChanged = true;
rRange.aStart.Set( theCol1, theRow1, theTab1 );
rRange.aEnd.Set( theCol2, theRow2, theTab2 );
}
@@ -523,48 +629,45 @@ sal_Bool ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
return bChanged;
}
-
+//-----------------------------------------------------------------------------
+// Delete entries that have the labels (first range) on nTab
void ScRangePairList::DeleteOnTab( SCTAB nTab )
{
- // Delete entries that have the labels (first range) on nTab
-
- sal_uLong nListCount = Count();
- sal_uLong nPos = 0;
+ size_t nListCount = maPairs.size();
+ size_t nPos = 0;
while ( nPos < nListCount )
{
- ScRangePair* pR = GetObject( nPos );
+ ScRangePair* pR = maPairs[ nPos ];
ScRange aRange = pR->GetRange(0);
if ( aRange.aStart.Tab() == nTab && aRange.aEnd.Tab() == nTab )
{
Remove( nPos );
delete pR;
- nListCount = Count();
+ nListCount = maPairs.size();
}
else
++nPos;
}
}
-
+//-----------------------------------------------------------------------------
ScRangePair* ScRangePairList::Find( const ScAddress& rAdr ) const
{
- sal_uLong nListCount = Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
+ for ( size_t j = 0, nListCount = maPairs.size(); j < nListCount; j++ )
{
- ScRangePair* pR = GetObject( j );
+ ScRangePair* pR = maPairs[ j ];
if ( pR->GetRange(0).In( rAdr ) )
return pR;
}
return NULL;
}
-
+//-----------------------------------------------------------------------------
ScRangePair* ScRangePairList::Find( const ScRange& rRange ) const
{
- sal_uLong nListCount = Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
+ for ( size_t j = 0, nListCount = maPairs.size(); j < nListCount; j++ )
{
- ScRangePair* pR = GetObject( j );
+ ScRangePair* pR = maPairs[ j ];
if ( pR->GetRange(0) == rRange )
return pR;
}
@@ -572,25 +675,25 @@ ScRangePair* ScRangePairList::Find( const ScRange& rRange ) const
}
+//-----------------------------------------------------------------------------
ScRangePairList* ScRangePairList::Clone() const
{
ScRangePairList* pNew = new ScRangePairList;
- sal_uLong nListCount = Count();
- for ( sal_uLong j = 0; j < nListCount; j++ )
+ for ( size_t j = 0, nListCount = maPairs.size(); j < nListCount; j++ )
{
- pNew->Append( *GetObject( j ) );
+ pNew->Append( *maPairs[ j ] );
}
return pNew;
}
-
+//-----------------------------------------------------------------------------
struct ScRangePairNameSort
{
ScRangePair* pPair;
ScDocument* pDoc;
};
-
+//-----------------------------------------------------------------------------
extern "C" int
#ifdef WNT
__cdecl
@@ -669,11 +772,130 @@ ScRangePairList_QsortNameCompare( const void* p1, const void* p2 )
return 0; // just in case
}
+//-----------------------------------------------------------------------------
+void ScRangePairList::Join( const ScRangePair& r, bool bIsInList )
+{
+ if ( maPairs.empty() )
+ {
+ Append( r );
+ return ;
+ }
+ const ScRange& r1 = r.GetRange(0);
+ const ScRange& r2 = r.GetRange(1);
+ SCCOL nCol1 = r1.aStart.Col();
+ SCROW nRow1 = r1.aStart.Row();
+ SCTAB nTab1 = r1.aStart.Tab();
+ SCCOL nCol2 = r1.aEnd.Col();
+ SCROW nRow2 = r1.aEnd.Row();
+ SCTAB nTab2 = r1.aEnd.Tab();
+ ScRangePair* pOver = (ScRangePair*) &r; // fies aber wahr wenn bInList
+ size_t nOldPos = 0;
+ if ( bIsInList )
+ {
+ // Find the current position of this range.
+ for ( size_t i = 0, nPairs = maPairs.size(); i < nPairs; ++i )
+ {
+ if ( maPairs[i] == pOver )
+ {
+ nOldPos = i;
+ break;
+ }
+ }
+ }
+ bool bJoinedInput = false;
+
+ for ( size_t i = 0, nPairs = maPairs.size(); i < nPairs && pOver; ++i )
+ {
+ ScRangePair* p = maPairs[ i ];
+ if ( p == pOver )
+ continue; // derselbe, weiter mit dem naechsten
+ bool bJoined = false;
+ ScRange& rp1 = p->GetRange(0);
+ ScRange& rp2 = p->GetRange(1);
+ if ( rp2 == r2 )
+ { // nur wenn Range2 gleich ist
+ if ( rp1.In( r1 ) )
+ { // RangePair r in RangePair p enthalten oder identisch
+ if ( bIsInList )
+ bJoined = true; // weg mit RangePair r
+ else
+ { // das war's dann
+ bJoinedInput = true; // nicht anhaengen
+ break; // for
+ }
+ }
+ else if ( r1.In( rp1 ) )
+ { // RangePair p in RangePair r enthalten, r zum neuen RangePair machen
+ *p = r;
+ bJoined = true;
+ }
+ }
+ if ( !bJoined && rp1.aStart.Tab() == nTab1 && rp1.aEnd.Tab() == nTab2
+ && rp2.aStart.Tab() == r2.aStart.Tab()
+ && rp2.aEnd.Tab() == r2.aEnd.Tab() )
+ { // 2D, Range2 muss genauso nebeneinander liegen wie Range1
+ if ( rp1.aStart.Col() == nCol1 && rp1.aEnd.Col() == nCol2
+ && rp2.aStart.Col() == r2.aStart.Col()
+ && rp2.aEnd.Col() == r2.aEnd.Col() )
+ {
+ if ( rp1.aStart.Row() == nRow2+1
+ && rp2.aStart.Row() == r2.aEnd.Row()+1 )
+ { // oben
+ rp1.aStart.SetRow( nRow1 );
+ rp2.aStart.SetRow( r2.aStart.Row() );
+ bJoined = true;
+ }
+ else if ( rp1.aEnd.Row() == nRow1-1
+ && rp2.aEnd.Row() == r2.aStart.Row()-1 )
+ { // unten
+ rp1.aEnd.SetRow( nRow2 );
+ rp2.aEnd.SetRow( r2.aEnd.Row() );
+ bJoined = true;
+ }
+ }
+ else if ( rp1.aStart.Row() == nRow1 && rp1.aEnd.Row() == nRow2
+ && rp2.aStart.Row() == r2.aStart.Row()
+ && rp2.aEnd.Row() == r2.aEnd.Row() )
+ {
+ if ( rp1.aStart.Col() == nCol2+1
+ && rp2.aStart.Col() == r2.aEnd.Col()+1 )
+ { // links
+ rp1.aStart.SetCol( nCol1 );
+ rp2.aStart.SetCol( r2.aStart.Col() );
+ bJoined = true;
+ }
+ else if ( rp1.aEnd.Col() == nCol1-1
+ && rp2.aEnd.Col() == r2.aEnd.Col()-1 )
+ { // rechts
+ rp1.aEnd.SetCol( nCol2 );
+ rp2.aEnd.SetCol( r2.aEnd.Col() );
+ bJoined = true;
+ }
+ }
+ }
+ if ( bJoined )
+ {
+ if ( bIsInList )
+ { // innerhalb der Liste RangePair loeschen
+ Remove( nOldPos );
+ delete pOver;
+ pOver = NULL;
+ if ( nOldPos )
+ nOldPos--; // Seek richtig aufsetzen
+ }
+ bJoinedInput = true;
+ Join( *p, true ); // rekursiv!
+ }
+ }
+ if ( !bIsInList && !bJoinedInput )
+ Append( r );
+}
-ScRangePair** ScRangePairList::CreateNameSortedArray( sal_uLong& nListCount,
+//-----------------------------------------------------------------------------
+ScRangePair** ScRangePairList::CreateNameSortedArray( size_t& nListCount,
ScDocument* pDoc ) const
{
- nListCount = Count();
+ nListCount = maPairs.size();
DBG_ASSERT( nListCount * sizeof(ScRangePairNameSort) <= (size_t)~0x1F,
"ScRangePairList::CreateNameSortedArray nListCount * sizeof(ScRangePairNameSort) > (size_t)~0x1F" );
ScRangePairNameSort* pSortArray = (ScRangePairNameSort*)
@@ -681,7 +903,7 @@ ScRangePair** ScRangePairList::CreateNameSortedArray( sal_uLong& nListCount,
sal_uLong j;
for ( j=0; j < nListCount; j++ )
{
- pSortArray[j].pPair = GetObject( j );
+ pSortArray[j].pPair = maPairs[ j ];
pSortArray[j].pDoc = pDoc;
}
#if !(defined(ICC ) && defined(OS2))
@@ -698,6 +920,4 @@ ScRangePair** ScRangePairList::CreateNameSortedArray( sal_uLong& nListCount,
return ppSortArray;
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index cfd1b1135bec..05d70f834a2d 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,6 +49,9 @@
#include "document.hxx"
using namespace formula;
+using ::std::pair;
+using ::std::unary_function;
+using ::rtl::OUString;
//========================================================================
// ScRangeData
@@ -56,7 +60,7 @@ using namespace formula;
// Interner ctor fuer das Suchen nach einem Index
ScRangeData::ScRangeData( sal_uInt16 n )
- : pCode( NULL ), nIndex( n ), bModified( sal_False ), mnMaxRow(-1), mnMaxCol(-1)
+ : pCode( NULL ), nIndex( n ), bModified( false ), mnMaxRow(-1), mnMaxCol(-1)
{}
ScRangeData::ScRangeData( ScDocument* pDok,
@@ -72,7 +76,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
eType ( nType ),
pDoc ( pDok ),
nIndex ( 0 ),
- bModified ( sal_False ),
+ bModified ( false ),
mnMaxRow (-1),
mnMaxCol (-1)
{
@@ -120,7 +124,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
eType ( nType ),
pDoc ( pDok ),
nIndex ( 0 ),
- bModified ( sal_False ),
+ bModified ( false ),
mnMaxRow (-1),
mnMaxCol (-1)
{
@@ -135,15 +139,6 @@ ScRangeData::ScRangeData( ScDocument* pDok,
else
eType = eType | RT_ABSAREA;
}
- // Die Importfilter haben diesen Test nicht,
- // da die benannten Bereiche z.T. noch unvollstaendig sind.
-// if( !pCode->GetCodeLen() )
-// {
-// // ggf. den Fehlercode wg. unvollstaendiger Formel setzen!
-// ScCompiler aComp( pDok, aPos, *pCode );
-// aComp.CompileTokenArray();
-// pCode->DelRPN();
-// }
}
}
@@ -157,7 +152,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
eType ( RT_NAME ),
pDoc ( pDok ),
nIndex ( 0 ),
- bModified ( sal_False ),
+ bModified ( false ),
mnMaxRow (-1),
mnMaxCol (-1)
{
@@ -173,7 +168,6 @@ ScRangeData::ScRangeData( ScDocument* pDok,
}
ScRangeData::ScRangeData(const ScRangeData& rScRangeData) :
- ScDataObject(),
aName (rScRangeData.aName),
aUpperName (rScRangeData.aUpperName),
pCode (rScRangeData.pCode ? rScRangeData.pCode->Clone() : new ScTokenArray()), // echte Kopie erzeugen (nicht copy-ctor)
@@ -191,11 +185,6 @@ ScRangeData::~ScRangeData()
delete pCode;
}
-ScDataObject* ScRangeData::Clone() const
-{
- return new ScRangeData(*this);
-}
-
void ScRangeData::GuessPosition()
{
// setzt eine Position, mit der alle relative Referenzen bei CalcAbsIfRel
@@ -232,10 +221,6 @@ void ScRangeData::GuessPosition()
}
aPos = ScAddress( (SCCOL)(-nMinCol), (SCROW)(-nMinRow), (SCTAB)(-nMinTab) );
-
- //! Test
-// DBG_ERROR(String("Pos ")+String((SCCOL)(-nMinCol))+String("/")+
-// String((SCROW)(-nMinRow))+String("/")+String((SCTAB)(-nMinTab)));
}
void ScRangeData::GetSymbol( String& rSymbol, const FormulaGrammar::Grammar eGrammar ) const
@@ -245,6 +230,13 @@ void ScRangeData::GetSymbol( String& rSymbol, const FormulaGrammar::Grammar eGra
aComp.CreateStringFromTokenArray( rSymbol );
}
+void ScRangeData::GetSymbol( OUString& rSymbol, const FormulaGrammar::Grammar eGrammar ) const
+{
+ String aStr;
+ GetSymbol(aStr, eGrammar);
+ rSymbol = aStr;
+}
+
void ScRangeData::UpdateSymbol( rtl::OUStringBuffer& rBuffer, const ScAddress& rPos,
const FormulaGrammar::Grammar eGrammar )
{
@@ -259,7 +251,7 @@ void ScRangeData::UpdateReference( UpdateRefMode eUpdateRefMode,
const ScRange& r,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
{
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
pCode->Reset();
if( pCode->GetNextReference() )
@@ -285,7 +277,7 @@ void ScRangeData::UpdateReference( UpdateRefMode eUpdateRefMode,
void ScRangeData::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest )
{
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
ScToken* t;
pCode->Reset();
@@ -313,7 +305,7 @@ void ScRangeData::UpdateTranspose( const ScRange& rSource, const ScAddress& rDes
void ScRangeData::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY )
{
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
ScToken* t;
pCode->Reset();
@@ -344,38 +336,25 @@ sal_Bool ScRangeData::operator== (const ScRangeData& rData) const // fuer
if ( nIndex != rData.nIndex ||
aName != rData.aName ||
aPos != rData.aPos ||
- eType != rData.eType ) return sal_False;
+ eType != rData.eType ) return false;
sal_uInt16 nLen = pCode->GetLen();
- if ( nLen != rData.pCode->GetLen() ) return sal_False;
+ if ( nLen != rData.pCode->GetLen() ) return false;
FormulaToken** ppThis = pCode->GetArray();
FormulaToken** ppOther = rData.pCode->GetArray();
for ( sal_uInt16 i=0; i<nLen; i++ )
if ( ppThis[i] != ppOther[i] && !(*ppThis[i] == *ppOther[i]) )
- return sal_False;
+ return false;
return sal_True;
}
-//UNUSED2009-05 sal_Bool ScRangeData::IsRangeAtCursor( const ScAddress& rPos, sal_Bool bStartOnly ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 sal_Bool bRet = sal_False;
-//UNUSED2009-05 ScRange aRange;
-//UNUSED2009-05 if ( IsReference(aRange) )
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( bStartOnly )
-//UNUSED2009-05 bRet = ( rPos == aRange.aStart );
-//UNUSED2009-05 else
-//UNUSED2009-05 bRet = ( aRange.In( rPos ) );
-//UNUSED2009-05 }
-//UNUSED2009-05 return bRet;
-//UNUSED2009-05 }
sal_Bool ScRangeData::IsRangeAtBlock( const ScRange& rBlock ) const
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScRange aRange;
if ( IsReference(aRange) )
bRet = ( rBlock == aRange );
@@ -387,7 +366,7 @@ sal_Bool ScRangeData::IsReference( ScRange& rRange ) const
if ( (eType & ( RT_ABSAREA | RT_REFAREA | RT_ABSPOS )) && pCode )
return pCode->IsReference( rRange );
- return sal_False;
+ return false;
}
sal_Bool ScRangeData::IsReference( ScRange& rRange, const ScAddress& rPos ) const
@@ -401,7 +380,7 @@ sal_Bool ScRangeData::IsReference( ScRange& rRange, const ScAddress& rPos ) cons
return pTemp->IsReference( rRange );
}
- return sal_False;
+ return false;
}
sal_Bool ScRangeData::IsValidReference( ScRange& rRange ) const
@@ -409,7 +388,7 @@ sal_Bool ScRangeData::IsValidReference( ScRange& rRange ) const
if ( (eType & ( RT_ABSAREA | RT_REFAREA | RT_ABSPOS ) ) && pCode )
return pCode->IsValidReference( rRange );
- return sal_False;
+ return false;
}
void ScRangeData::UpdateTabRef(SCTAB nOldTable, sal_uInt16 nFlag, SCTAB nNewTable)
@@ -427,7 +406,7 @@ void ScRangeData::UpdateTabRef(SCTAB nOldTable, sal_uInt16 nFlag, SCTAB nNewTabl
pRangeData = aComp.UpdateInsertTab(nOldTable, sal_True ); // und CopyTab (doc2.cxx)
break;
case 2: // einfaches delete (doc.cxx)
- pRangeData = aComp.UpdateDeleteTab(nOldTable, sal_False, sal_True, bChanged);
+ pRangeData = aComp.UpdateDeleteTab(nOldTable, false, sal_True, bChanged);
break;
case 3: // move (doc2.cxx)
{
@@ -436,7 +415,7 @@ void ScRangeData::UpdateTabRef(SCTAB nOldTable, sal_uInt16 nFlag, SCTAB nNewTabl
break;
default:
{
- DBG_ERROR("ScRangeName::UpdateTabRef: Unknown Flag");
+ OSL_FAIL("ScRangeName::UpdateTabRef: Unknown Flag");
}
break;
}
@@ -451,9 +430,8 @@ void ScRangeData::UpdateTabRef(SCTAB nOldTable, sal_uInt16 nFlag, SCTAB nNewTabl
}
-void ScRangeData::MakeValidName( String& rName ) // static
+void ScRangeData::MakeValidName( String& rName )
{
- //ScCompiler::InitSymbolsNative();
// strip leading invalid characters
xub_StrLen nPos = 0;
@@ -501,11 +479,11 @@ sal_Bool ScRangeData::IsNameValid( const String& rName, ScDocument* pDoc )
xub_StrLen nPos = 0;
xub_StrLen nLen = rName.Len();
if ( !nLen || !ScCompiler::IsCharFlagAllConventions( rName, nPos++, SC_COMPILER_C_CHAR_NAME ) )
- return sal_False;
+ return false;
while ( nPos < nLen )
{
if ( !ScCompiler::IsCharFlagAllConventions( rName, nPos++, SC_COMPILER_C_NAME ) )
- return sal_False;
+ return false;
}
ScAddress aAddr;
ScRange aRange;
@@ -515,7 +493,7 @@ sal_Bool ScRangeData::IsNameValid( const String& rName, ScDocument* pDoc )
// Don't check Parse on VALID, any partial only VALID may result in
// #REF! during compile later!
if (aRange.Parse( rName, pDoc, details) || aAddr.Parse( rName, pDoc, details))
- return sal_False;
+ return false;
}
return sal_True;
}
@@ -680,145 +658,220 @@ ScRangeData_QsortNameCompare( const void* p1, const void* p2 )
(*(const ScRangeData**)p2)->GetName() );
}
+bool operator<(const ScRangeData& left, const ScRangeData& right)
+{
+ return left.GetName() < right.GetName();
+}
-//========================================================================
-// ScRangeName
-//========================================================================
+namespace {
-ScRangeName::ScRangeName(const ScRangeName& rScRangeName, ScDocument* pDocument) :
- ScSortedCollection ( rScRangeName ),
- pDoc ( pDocument ),
- nSharedMaxIndex (rScRangeName.nSharedMaxIndex)
+/**
+ * Predicate to check if the name references the specified range.
+ */
+class MatchByRange : public unary_function<ScRangeData, bool>
{
- for (sal_uInt16 i = 0; i < nCount; i++)
+ const ScRange& mrRange;
+public:
+ MatchByRange(const ScRange& rRange) : mrRange(rRange) {}
+ bool operator() (const ScRangeData& r) const
{
- ((ScRangeData*)At(i))->SetDocument(pDocument);
- ((ScRangeData*)At(i))->SetIndex(((ScRangeData*)rScRangeName.At(i))->GetIndex());
+ return r.IsRangeAtBlock(mrRange);
}
-}
+};
-short ScRangeName::Compare(ScDataObject* pKey1, ScDataObject* pKey2) const
+class MatchByName : public unary_function<ScRangeData, bool>
{
- sal_uInt16 i1 = ((ScRangeData*)pKey1)->GetIndex();
- sal_uInt16 i2 = ((ScRangeData*)pKey2)->GetIndex();
- return (short) i1 - (short) i2;
-}
+ const OUString& mrName;
+public:
+ MatchByName(const OUString& rName) : mrName(rName) {}
+ bool operator() (const ScRangeData& r) const
+ {
+ return mrName.equals(r.GetName());
+ }
+};
-sal_Bool ScRangeName::SearchNameUpper( const String& rUpperName, sal_uInt16& rIndex ) const
+class MatchByUpperName : public unary_function<ScRangeData, bool>
{
- // SearchNameUpper must be called with an upper-case search string
+ const OUString& mrName;
+public:
+ MatchByUpperName(const OUString& rName) : mrName(rName) {}
+ bool operator() (const ScRangeData& r) const
+ {
+ return mrName.equals(r.GetUpperName());
+ }
+};
- sal_uInt16 i = 0;
- while (i < nCount)
+class MatchByIndex : public unary_function<ScRangeData, bool>
+{
+ sal_uInt16 mnIndex;
+public:
+ MatchByIndex(sal_uInt16 nIndex) : mnIndex(nIndex) {}
+ bool operator() (const ScRangeData& r) const
{
- if ( ((*this)[i])->GetUpperName() == rUpperName )
- {
- rIndex = i;
- return sal_True;
- }
- i++;
+ return mnIndex == r.GetIndex();
}
- return sal_False;
+};
+
}
-sal_Bool ScRangeName::SearchName( const String& rName, sal_uInt16& rIndex ) const
+ScRangeName::ScRangeName(ScDocument* pDoc) :
+ mpDoc(pDoc) {}
+
+ScRangeName::ScRangeName(const ScRangeName& r) :
+ maData(r.maData), mpDoc(r.mpDoc), mnSharedMaxIndex(r.mnSharedMaxIndex) {}
+
+const ScRangeData* ScRangeName::findByRange(const ScRange& rRange) const
{
- if ( nCount > 0 )
- return SearchNameUpper( ScGlobal::pCharClass->upper( rName ), rIndex );
- else
- return sal_False;
+ DataType::const_iterator itr = std::find_if(
+ maData.begin(), maData.end(), MatchByRange(rRange));
+ return itr == maData.end() ? NULL : &(*itr);
}
-void ScRangeName::UpdateReference( UpdateRefMode eUpdateRefMode,
- const ScRange& rRange,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+ScRangeData* ScRangeName::findByName(const OUString& rName)
{
- for (sal_uInt16 i=0; i<nCount; i++)
- ((ScRangeData*)pItems[i])->UpdateReference(eUpdateRefMode, rRange,
- nDx, nDy, nDz);
+ DataType::iterator itr = std::find_if(
+ maData.begin(), maData.end(), MatchByName(rName));
+ return itr == maData.end() ? NULL : &(*itr);
}
-void ScRangeName::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest )
+const ScRangeData* ScRangeName::findByName(const OUString& rName) const
{
- for (sal_uInt16 i=0; i<nCount; i++)
- ((ScRangeData*)pItems[i])->UpdateTranspose( rSource, rDest );
+ DataType::const_iterator itr = std::find_if(
+ maData.begin(), maData.end(), MatchByName(rName));
+ return itr == maData.end() ? NULL : &(*itr);
}
-void ScRangeName::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY )
+ScRangeData* ScRangeName::findByUpperName(const OUString& rName)
{
- for (sal_uInt16 i=0; i<nCount; i++)
- ((ScRangeData*)pItems[i])->UpdateGrow( rArea, nGrowX, nGrowY );
+ DataType::iterator itr = std::find_if(
+ maData.begin(), maData.end(), MatchByUpperName(rName));
+ return itr == maData.end() ? NULL : &(*itr);
}
-sal_Bool ScRangeName::IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const
+const ScRangeData* ScRangeName::findByUpperName(const OUString& rName) const
{
- return *(ScRangeData*)pKey1 == *(ScRangeData*)pKey2;
+ DataType::const_iterator itr = std::find_if(
+ maData.begin(), maData.end(), MatchByUpperName(rName));
+ return itr == maData.end() ? NULL : &(*itr);
}
-sal_Bool ScRangeName::Insert(ScDataObject* pScDataObject)
+ScRangeData* ScRangeName::findByIndex(sal_uInt16 i)
{
- if (!((ScRangeData*)pScDataObject)->GetIndex()) // schon gesetzt?
- {
- ((ScRangeData*)pScDataObject)->SetIndex( GetEntryIndex() );
- }
+ DataType::iterator itr = std::find_if(
+ maData.begin(), maData.end(), MatchByIndex(i));
+ return itr == maData.end() ? NULL : &(*itr);
+}
- return ScSortedCollection::Insert(pScDataObject);
+void ScRangeName::UpdateReference(
+ UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz)
+{
+ DataType::iterator itr = maData.begin(), itrEnd = maData.end();
+ for (; itr != itrEnd; ++itr)
+ itr->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
}
-// Suche nach einem freien Index
+void ScRangeName::UpdateTabRef(SCTAB nTable, sal_uInt16 nFlag, SCTAB nNewTable)
+{
+ DataType::iterator itr = maData.begin(), itrEnd = maData.end();
+ for (; itr != itrEnd; ++itr)
+ itr->UpdateTabRef(nTable, nFlag, nNewTable);
+}
-sal_uInt16 ScRangeName::GetEntryIndex()
+void ScRangeName::UpdateTranspose(const ScRange& rSource, const ScAddress& rDest)
{
- sal_uInt16 nLast = 0;
- for ( sal_uInt16 i = 0; i < nCount; i++ )
- {
- sal_uInt16 nIdx = ((ScRangeData*)pItems[i])->GetIndex();
- if( nIdx > nLast )
- {
- nLast = nIdx;
- }
- }
- return nLast + 1;
+ DataType::iterator itr = maData.begin(), itrEnd = maData.end();
+ for (; itr != itrEnd; ++itr)
+ itr->UpdateTranspose(rSource, rDest);
}
-ScRangeData* ScRangeName::FindIndex( sal_uInt16 nIndex )
+void ScRangeName::UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY)
{
- ScRangeData aDataObj( nIndex );
- sal_uInt16 n;
- if( Search( &aDataObj, n ) )
- return (*this)[ n ];
- else
- return NULL;
+ DataType::iterator itr = maData.begin(), itrEnd = maData.end();
+ for (; itr != itrEnd; ++itr)
+ itr->UpdateGrow(rArea, nGrowX, nGrowY);
+}
+
+sal_uInt16 ScRangeName::GetSharedMaxIndex()
+{
+ return mnSharedMaxIndex;
+}
+
+void ScRangeName::SetSharedMaxIndex(sal_uInt16 nInd)
+{
+ mnSharedMaxIndex = nInd;
+}
+
+ScRangeName::const_iterator ScRangeName::begin() const
+{
+ return maData.begin();
+}
+
+ScRangeName::const_iterator ScRangeName::end() const
+{
+ return maData.end();
+}
+
+ScRangeName::iterator ScRangeName::begin()
+{
+ return maData.begin();
+}
+
+ScRangeName::iterator ScRangeName::end()
+{
+ return maData.end();
}
-//UNUSED2009-05 ScRangeData* ScRangeName::GetRangeAtCursor( const ScAddress& rPos, sal_Bool bStartOnly ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( pItems )
-//UNUSED2009-05 {
-//UNUSED2009-05 for ( sal_uInt16 i = 0; i < nCount; i++ )
-//UNUSED2009-05 if ( ((ScRangeData*)pItems[i])->IsRangeAtCursor( rPos, bStartOnly ) )
-//UNUSED2009-05 return (ScRangeData*)pItems[i];
-//UNUSED2009-05 }
-//UNUSED2009-05 return NULL;
-//UNUSED2009-05 }
+size_t ScRangeName::size() const
+{
+ return maData.size();
+}
-ScRangeData* ScRangeName::GetRangeAtBlock( const ScRange& rBlock ) const
+bool ScRangeName::empty() const
{
- if ( pItems )
+ return maData.empty();
+}
+
+bool ScRangeName::insert(ScRangeData* p)
+{
+ if (!p)
+ return false;
+
+ if (!p->GetIndex())
{
- for ( sal_uInt16 i = 0; i < nCount; i++ )
- if ( ((ScRangeData*)pItems[i])->IsRangeAtBlock( rBlock ) )
- return (ScRangeData*)pItems[i];
+ // Assign a new index. An index must be unique.
+ sal_uInt16 nHigh = 0;
+ DataType::const_iterator itr = maData.begin(), itrEnd = maData.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ sal_uInt16 n = itr->GetIndex();
+ if (n > nHigh)
+ nHigh = n;
+ }
+ p->SetIndex(nHigh + 1);
}
- return NULL;
+
+ pair<DataType::iterator, bool> r = maData.insert(p);
+ return r.second;
}
-void ScRangeName::UpdateTabRef(SCTAB nOldTable, sal_uInt16 nFlag, SCTAB nNewTable)
+void ScRangeName::erase(const ScRangeData& r)
{
- for (sal_uInt16 i=0; i<nCount; i++)
- ((ScRangeData*)pItems[i])->UpdateTabRef(nOldTable, nFlag, nNewTable);
+ maData.erase(r);
}
+void ScRangeName::erase(const iterator& itr)
+{
+ maData.erase(itr);
+}
+void ScRangeName::clear()
+{
+ maData.clear();
+}
+bool ScRangeName::operator== (const ScRangeName& r) const
+{
+ return maData == r.maData && mpDoc == r.mpDoc && mnSharedMaxIndex == r.mnSharedMaxIndex;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx
index ac1934302b6e..87c2a8f64556 100644
--- a/sc/source/core/tool/rangeseq.cxx
+++ b/sc/source/core/tool/rangeseq.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,7 +86,7 @@ sal_Bool ScRangeToSequence::FillLongArray( uno::Any& rAny, ScDocument* pDoc, con
sal_Bool ScRangeToSequence::FillLongArray( uno::Any& rAny, const ScMatrix* pMatrix )
{
if (!pMatrix)
- return sal_False;
+ return false;
SCSIZE nColCount;
SCSIZE nRowCount;
@@ -141,7 +142,7 @@ sal_Bool ScRangeToSequence::FillDoubleArray( uno::Any& rAny, ScDocument* pDoc, c
sal_Bool ScRangeToSequence::FillDoubleArray( uno::Any& rAny, const ScMatrix* pMatrix )
{
if (!pMatrix)
- return sal_False;
+ return false;
SCSIZE nColCount;
SCSIZE nRowCount;
@@ -201,7 +202,7 @@ sal_Bool ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMa
SvNumberFormatter* pFormatter )
{
if (!pMatrix)
- return sal_False;
+ return false;
SCSIZE nColCount;
SCSIZE nRowCount;
@@ -249,7 +250,7 @@ double lcl_GetValueFromCell( ScBaseCell& rCell )
else if ( eType == CELLTYPE_FORMULA )
return ((ScFormulaCell&)rCell).GetValue(); // called only if result is value
- DBG_ERROR( "GetValueFromCell: wrong type" );
+ OSL_FAIL( "GetValueFromCell: wrong type" );
return 0;
}
@@ -263,7 +264,7 @@ sal_Bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, co
long nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row();
String aDocStr;
- sal_Bool bHasErrors = sal_False;
+ sal_Bool bHasErrors = false;
uno::Sequence< uno::Sequence<uno::Any> > aRowSeq( nRowCount );
uno::Sequence<uno::Any>* pRowAry = aRowSeq.getArray();
@@ -304,7 +305,7 @@ sal_Bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, co
sal_Bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, const ScMatrix* pMatrix, bool bDataTypes )
{
if (!pMatrix)
- return sal_False;
+ return false;
SCSIZE nColCount;
SCSIZE nRowCount;
@@ -344,7 +345,6 @@ sal_Bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, const ScMatrix* pMat
//------------------------------------------------------------------------
-// static
bool ScApiTypeConversion::ConvertAnyToDouble( double & o_fVal,
com::sun::star::uno::TypeClass & o_eClass,
const com::sun::star::uno::Any & rAny )
@@ -377,7 +377,6 @@ bool ScApiTypeConversion::ConvertAnyToDouble( double & o_fVal,
//------------------------------------------------------------------------
-// static
ScMatrixRef ScSequenceToMatrix::CreateMixedMatrix( const com::sun::star::uno::Any & rAny )
{
ScMatrixRef xMatrix;
@@ -400,9 +399,8 @@ ScMatrixRef ScSequenceToMatrix::CreateMixedMatrix( const com::sun::star::uno::An
xMatrix = new ScMatrix(
static_cast<SCSIZE>(nMaxColCount),
static_cast<SCSIZE>(nRowCount) );
- ScMatrix* pMatrix = xMatrix;
SCSIZE nCols, nRows;
- pMatrix->GetDimensions( nCols, nRows);
+ xMatrix->GetDimensions( nCols, nRows);
if (nCols != static_cast<SCSIZE>(nMaxColCount) || nRows != static_cast<SCSIZE>(nRowCount))
{
DBG_ERRORFILE( "ScSequenceToMatrix::CreateMixedMatrix: matrix exceeded max size, returning NULL matrix");
@@ -419,11 +417,11 @@ ScMatrixRef ScSequenceToMatrix::CreateMixedMatrix( const com::sun::star::uno::An
if (ScApiTypeConversion::ConvertAnyToDouble( fVal, eClass, pColArr[nCol]))
{
if (eClass == uno::TypeClass_BOOLEAN)
- pMatrix->PutBoolean( (fVal ? true : false),
+ xMatrix->PutBoolean( (fVal ? true : false),
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
else
- pMatrix->PutDouble( fVal,
+ xMatrix->PutDouble( fVal,
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
}
@@ -431,21 +429,19 @@ ScMatrixRef ScSequenceToMatrix::CreateMixedMatrix( const com::sun::star::uno::An
{
// Try string, else use empty as last resort.
- //Reflection* pRefl = pColArr[nCol].getReflection();
- //if ( pRefl->equals( *OUString_getReflection() ) )
if ( pColArr[nCol] >>= aUStr )
- pMatrix->PutString( String( aUStr ),
+ xMatrix->PutString( String( aUStr ),
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
else
- pMatrix->PutEmpty(
+ xMatrix->PutEmpty(
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
}
}
for (nCol=nColCount; nCol<nMaxColCount; nCol++)
{
- pMatrix->PutEmpty(
+ xMatrix->PutEmpty(
static_cast<SCSIZE>(nCol),
static_cast<SCSIZE>(nRow) );
}
@@ -469,8 +465,9 @@ sal_Bool ScByteSequenceToString::GetString( String& rString, const uno::Any& rAn
rString.EraseTrailingChars( (sal_Unicode) 0 );
return sal_True;
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index c6fc8c79ccf6..87020e34498b 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@ sal_Bool ScRangeUtil::MakeArea( const String& rAreaStr,
// BROKEN BROKEN BROKEN
// but it is only used in the consolidate dialog. Ignore for now.
- sal_Bool nSuccess = sal_False;
+ sal_Bool nSuccess = false;
sal_uInt16 nPointPos = rAreaStr.Search('.');
sal_uInt16 nColonPos = rAreaStr.Search(':');
String aStrArea( rAreaStr );
@@ -117,7 +118,7 @@ sal_Bool ScRangeUtil::IsAbsTabArea( const String& rAreaStr,
{
DBG_ASSERT( pDoc, "Kein Dokument uebergeben!" );
if ( !pDoc )
- return sal_False;
+ return false;
// BROKEN BROKEN BROKEN
// but it is only used in the consolidate dialog. Ignore for now.
@@ -134,7 +135,7 @@ sal_Bool ScRangeUtil::IsAbsTabArea( const String& rAreaStr,
* wieder geloescht werden muss!
*/
- sal_Bool bStrOk = sal_False;
+ sal_Bool bStrOk = false;
String aTempAreaStr(rAreaStr);
String aStartPosStr;
String aEndPosStr;
@@ -160,12 +161,12 @@ sal_Bool ScRangeUtil::IsAbsTabArea( const String& rAreaStr,
{
if ( ConvertSingleRef( pDoc, aEndPosStr, aStartPos.Tab(), aEndPos, rDetails ) )
{
- aStartPos.SetRelCol( sal_False );
- aStartPos.SetRelRow( sal_False );
- aStartPos.SetRelTab( sal_False );
- aEndPos.SetRelCol( sal_False );
- aEndPos.SetRelRow( sal_False );
- aEndPos.SetRelTab( sal_False );
+ aStartPos.SetRelCol( false );
+ aStartPos.SetRelRow( false );
+ aStartPos.SetRelTab( false );
+ aEndPos.SetRelCol( false );
+ aEndPos.SetRelRow( false );
+ aEndPos.SetRelTab( false );
bStrOk = sal_True;
@@ -207,7 +208,7 @@ sal_Bool ScRangeUtil::IsAbsArea( const String& rAreaStr,
ScRefAddress* pEndPos,
ScAddress::Details const & rDetails ) const
{
- sal_Bool bIsAbsArea = sal_False;
+ sal_Bool bIsAbsArea = false;
ScRefAddress startPos;
ScRefAddress endPos;
@@ -215,12 +216,12 @@ sal_Bool ScRangeUtil::IsAbsArea( const String& rAreaStr,
if ( bIsAbsArea )
{
- startPos.SetRelCol( sal_False );
- startPos.SetRelRow( sal_False );
- startPos.SetRelTab( sal_False );
- endPos .SetRelCol( sal_False );
- endPos .SetRelRow( sal_False );
- endPos .SetRelTab( sal_False );
+ startPos.SetRelCol( false );
+ startPos.SetRelRow( false );
+ startPos.SetRelTab( false );
+ endPos .SetRelCol( false );
+ endPos .SetRelRow( false );
+ endPos .SetRelTab( false );
if ( pCompleteStr )
{
@@ -248,13 +249,13 @@ sal_Bool ScRangeUtil::IsAbsPos( const String& rPosStr,
ScRefAddress* pPosTripel,
ScAddress::Details const & rDetails ) const
{
- sal_Bool bIsAbsPos = sal_False;
+ sal_Bool bIsAbsPos = false;
ScRefAddress thePos;
bIsAbsPos = ConvertSingleRef( pDoc, rPosStr, nTab, thePos, rDetails );
- thePos.SetRelCol( sal_False );
- thePos.SetRelRow( sal_False );
- thePos.SetRelTab( sal_False );
+ thePos.SetRelCol( false );
+ thePos.SetRelRow( false );
+ thePos.SetRelTab( false );
if ( bIsAbsPos )
{
@@ -277,7 +278,7 @@ sal_Bool ScRangeUtil::MakeRangeFromName (
RutlNameScope eScope,
ScAddress::Details const & rDetails ) const
{
- sal_Bool bResult=sal_False;
+ sal_Bool bResult=false;
ScRangeUtil aRangeUtil;
SCTAB nTab = 0;
SCCOL nColStart = 0;
@@ -287,12 +288,10 @@ sal_Bool ScRangeUtil::MakeRangeFromName (
if( eScope==RUTL_NAMES )
{
- ScRangeName& rRangeNames = *(pDoc->GetRangeName());
- sal_uInt16 nAt = 0;
-
- if ( rRangeNames.SearchName( rName, nAt ) )
+ const ScRangeName& rRangeNames = *pDoc->GetRangeName();
+ const ScRangeData* pData = rRangeNames.findByName(rName);
+ if (pData)
{
- ScRangeData* pData = rRangeNames[nAt];
String aStrArea;
ScRefAddress aStartPos;
ScRefAddress aEndPos;
@@ -340,7 +339,7 @@ sal_Bool ScRangeUtil::MakeRangeFromName (
}
else
{
- DBG_ERROR( "ScRangeUtil::MakeRangeFromName" );
+ OSL_FAIL( "ScRangeUtil::MakeRangeFromName" );
}
if( bResult )
@@ -380,8 +379,8 @@ sal_Int32 ScRangeStringConverter::IndexOf(
{
sal_Int32 nLength = rString.getLength();
sal_Int32 nIndex = nOffset;
- sal_Bool bQuoted = sal_False;
- sal_Bool bExitLoop = sal_False;
+ sal_Bool bQuoted = false;
+ sal_Bool bExitLoop = false;
while( !bExitLoop && (nIndex < nLength) )
{
@@ -401,7 +400,7 @@ sal_Int32 ScRangeStringConverter::IndexOfDifferent(
{
sal_Int32 nLength = rString.getLength();
sal_Int32 nIndex = nOffset;
- sal_Bool bExitLoop = sal_False;
+ sal_Bool bExitLoop = false;
while( !bExitLoop && (nIndex < nLength) )
{
@@ -476,8 +475,11 @@ sal_Bool ScRangeStringConverter::GetAddressFromString(
{
if ((rAddress.Parse( sToken, const_cast<ScDocument*>(pDocument), eConv ) & SCA_VALID) == SCA_VALID)
return true;
+ ::formula::FormulaGrammar::AddressConvention eConvUI = pDocument->GetAddressConvention();
+ if (eConv != eConvUI)
+ return ((rAddress.Parse(sToken, const_cast<ScDocument*>(pDocument), eConvUI) & SCA_VALID) == SCA_VALID);
}
- return sal_False;
+ return false;
}
sal_Bool ScRangeStringConverter::GetRangeFromString(
@@ -490,7 +492,7 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
sal_Unicode cQuote )
{
OUString sToken;
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
GetTokenByOffset( sToken, rRangeStr, nOffset, cSeperator, cQuote );
if( nOffset >= 0 )
{
@@ -502,6 +504,9 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
if ( aUIString.GetChar(0) == (sal_Unicode) '.' )
aUIString.Erase( 0, 1 );
bResult = ((rRange.aStart.Parse( aUIString, const_cast<ScDocument*> (pDocument), eConv) & SCA_VALID) == SCA_VALID);
+ if (!bResult && eConv != eConv)
+ bResult = ((rRange.aStart.Parse(
+ aUIString, const_cast<ScDocument*>(pDocument), eConv) & SCA_VALID) == SCA_VALID);
rRange.aEnd = rRange.aStart;
}
else
@@ -526,6 +531,13 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
eConv) & SCA_VALID) == SCA_VALID) &&
((rRange.aEnd.Parse( aUIString.Copy((xub_StrLen)nIndex+1), const_cast<ScDocument*>(pDocument),
eConv) & SCA_VALID) == SCA_VALID);
+ if (!bResult && eConv != eConv)
+ {
+ bResult = ((rRange.aStart.Parse( aUIString.Copy(0, (xub_StrLen)nIndex), const_cast<ScDocument*>(pDocument),
+ eConv) & SCA_VALID) == SCA_VALID) &&
+ ((rRange.aEnd.Parse( aUIString.Copy((xub_StrLen)nIndex+1), const_cast<ScDocument*>(pDocument),
+ eConv) & SCA_VALID) == SCA_VALID);
+ }
}
}
}
@@ -546,10 +558,12 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
while( nOffset >= 0 )
{
ScRange* pRange = new ScRange;
- if( GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
- rRangeList.Insert( pRange, LIST_APPEND );
+ if ( GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote )
+ && (nOffset >= 0)
+ )
+ rRangeList.push_back( pRange );
else if (nOffset > -1)
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
@@ -567,7 +581,7 @@ sal_Bool ScRangeStringConverter::GetAreaFromString(
sal_Unicode cQuote )
{
ScRange aScRange;
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if( GetRangeFromString( aScRange, rRangeStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
{
rArea.nTab = aScRange.aStart.Tab();
@@ -593,7 +607,7 @@ sal_Bool ScRangeStringConverter::GetAddressFromString(
sal_Unicode cQuote )
{
ScAddress aScAddress;
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if( GetAddressFromString( aScAddress, rAddressStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
{
ScUnoConversion::FillApiAddress( rAddress, aScAddress );
@@ -612,7 +626,7 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
sal_Unicode cQuote )
{
ScRange aScRange;
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if( GetRangeFromString( aScRange, rRangeStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
{
ScUnoConversion::FillApiRange( rRange, aScRange );
@@ -641,7 +655,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
rRangeSeq[ rRangeSeq.getLength() - 1 ] = aRange;
}
else
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
@@ -701,10 +715,9 @@ void ScRangeStringConverter::GetStringFromRangeList(
OUString sRangeListStr;
if( pRangeList )
{
- sal_Int32 nCount = pRangeList->Count();
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ for( size_t nIndex = 0, nCount = pRangeList->size(); nIndex < nCount; nIndex++ )
{
- const ScRange* pRange = pRangeList->GetObject( nIndex );
+ const ScRange* pRange = (*pRangeList)[nIndex];
if( pRange )
GetStringFromRange( sRangeListStr, *pRange, pDocument, eConv, cSeperator, sal_True, nFormatFlags );
}
@@ -860,6 +873,8 @@ static void lcl_appendCellRangeAddress(
void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, const OUString& rXMLRange, ScDocument* pDoc )
{
+ FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
+ const OUString aRangeSep = ScCompiler::GetNativeSymbol(ocSep);
const sal_Unicode cSep = ' ';
const sal_Unicode cQuote = '\'';
@@ -912,13 +927,29 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con
rtl::OUString aBuf;
sal_uInt16 nRet = aCell1.Parse(aBeginCell, pDoc, FormulaGrammar::CONV_OOO, &aExtInfo1);
if ((nRet & SCA_VALID) != SCA_VALID)
+ {
// first cell is invalid.
- continue;
+ if (eConv == FormulaGrammar::CONV_OOO)
+ continue;
+
+ nRet = aCell1.Parse(aBeginCell, pDoc, eConv, &aExtInfo1);
+ if ((nRet & SCA_VALID) != SCA_VALID)
+ // first cell is really invalid.
+ continue;
+ }
nRet = aCell2.Parse(aEndCell, pDoc, FormulaGrammar::CONV_OOO, &aExtInfo2);
if ((nRet & SCA_VALID) != SCA_VALID)
+ {
// second cell is invalid.
- continue;
+ if (eConv == FormulaGrammar::CONV_OOO)
+ continue;
+
+ nRet = aCell2.Parse(aEndCell, pDoc, eConv, &aExtInfo2);
+ if ((nRet & SCA_VALID) != SCA_VALID)
+ // second cell is really invalid.
+ continue;
+ }
if (aExtInfo1.mnFileId != aExtInfo2.mnFileId || aExtInfo1.mbExternal != aExtInfo2.mbExternal)
// external info inconsistency.
@@ -929,7 +960,7 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con
if (bFirst)
bFirst = false;
else
- aRetStr.appendAscii(";");
+ aRetStr.append(aRangeSep);
lcl_appendCellRangeAddress(aRetStr, pDoc, aCell1, aCell2, aExtInfo1, aExtInfo2);
}
@@ -940,14 +971,18 @@ void ScRangeStringConverter::GetStringFromXMLRangeString( OUString& rString, con
ScAddress aCell;
sal_uInt16 nRet = aCell.Parse(aToken, pDoc, ::formula::FormulaGrammar::CONV_OOO, &aExtInfo);
if ((nRet & SCA_VALID) != SCA_VALID)
- continue;
+ {
+ nRet = aCell.Parse(aToken, pDoc, eConv, &aExtInfo);
+ if ((nRet & SCA_VALID) != SCA_VALID)
+ continue;
+ }
// Looks good!
if (bFirst)
bFirst = false;
else
- aRetStr.appendAscii(";");
+ aRetStr.append(aRangeSep);
lcl_appendCellAddress(aRetStr, pDoc, aCell, aExtInfo);
}
@@ -1002,12 +1037,17 @@ sal_Bool ScArea::operator==( const ScArea& r ) const
//------------------------------------------------------------------------
ScAreaNameIterator::ScAreaNameIterator( ScDocument* pDoc ) :
- aStrNoName( ScGlobal::GetRscString(STR_DB_NONAME) )
+ aStrNoName(ScGlobal::GetRscString(STR_DB_NONAME)),
+ pRangeName(pDoc->GetRangeName()),
+ pDBCollection(pDoc->GetDBCollection()),
+ bFirstPass(true),
+ nPos(0)
{
- pRangeName = pDoc->GetRangeName();
- pDBCollection = pDoc->GetDBCollection();
- nPos = 0;
- bFirstPass = sal_True;
+ if (pRangeName)
+ {
+ maRNPos = pRangeName->begin();
+ maRNEnd = pRangeName->end();
+ }
}
sal_Bool ScAreaNameIterator::Next( String& rName, ScRange& rRange )
@@ -1016,21 +1056,24 @@ sal_Bool ScAreaNameIterator::Next( String& rName, ScRange& rRange )
{
if ( bFirstPass ) // erst Bereichsnamen
{
- if ( pRangeName && nPos < pRangeName->GetCount() )
+ if ( pRangeName && maRNPos != maRNEnd )
{
- ScRangeData* pData = (*pRangeName)[nPos++];
- if ( pData && pData->IsValidReference(rRange) )
+ const ScRangeData& rData = *maRNPos;
+ ++maRNPos;
+ bool bValid = rData.IsValidReference(rRange);
+ if (bValid)
{
- rName = pData->GetName();
- return sal_True; // gefunden
+ rName = rData.GetName();
+ return true; // gefunden
}
}
else
{
- bFirstPass = sal_False;
+ bFirstPass = false;
nPos = 0;
}
}
+
if ( !bFirstPass ) // dann DB-Bereiche
{
if ( pDBCollection && nPos < pDBCollection->GetCount() )
@@ -1044,7 +1087,7 @@ sal_Bool ScAreaNameIterator::Next( String& rName, ScRange& rRange )
}
}
else
- return sal_False; // gibt nichts mehr
+ return false; // gibt nichts mehr
}
}
}
@@ -1052,3 +1095,4 @@ sal_Bool ScAreaNameIterator::Next( String& rName, ScRange& rRange )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/rechead.cxx b/sc/source/core/tool/rechead.cxx
index 0adc477b7992..47dee0c8b956 100644
--- a/sc/source/core/tool/rechead.cxx
+++ b/sc/source/core/tool/rechead.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,7 @@ ScMultipleReadHeader::ScMultipleReadHeader(SvStream& rNewStream) :
rStream >> nID;
if (nID != SCID_SIZES)
{
- DBG_ERROR("SCID_SIZES nicht gefunden");
+ OSL_FAIL("SCID_SIZES nicht gefunden");
if ( rStream.GetError() == SVSTREAM_OK )
rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
@@ -120,7 +121,7 @@ sal_uLong ScMultipleReadHeader::BytesLeft() const
if (nReadEnd <= nEntryEnd)
return nEntryEnd-nReadEnd;
- DBG_ERROR("Fehler bei ScMultipleReadHeader::BytesLeft");
+ OSL_FAIL("Fehler bei ScMultipleReadHeader::BytesLeft");
return 0;
}
@@ -171,3 +172,4 @@ void ScMultipleWriteHeader::StartEntry()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx
index 389b00859a26..a4bbe7d65d54 100644
--- a/sc/source/core/tool/refdata.cxx
+++ b/sc/source/core/tool/refdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,110 +83,6 @@ void ScSingleRefData::CalcAbsIfRel( const ScAddress& rPos )
}
}
-//UNUSED2008-05 void ScSingleRefData::OldBoolsToNewFlags( const OldSingleRefBools& rBools )
-//UNUSED2008-05 {
-//UNUSED2008-05 switch ( rBools.bRelCol )
-//UNUSED2008-05 {
-//UNUSED2008-05 case SR_DELETED :
-//UNUSED2008-05 Flags.bColRel = sal_True; // der war verlorengegangen
-//UNUSED2008-05 Flags.bColDeleted = sal_True;
-//UNUSED2008-05 break;
-//UNUSED2008-05 case SR_ABSOLUTE :
-//UNUSED2008-05 Flags.bColRel = sal_False;
-//UNUSED2008-05 Flags.bColDeleted = sal_False;
-//UNUSED2008-05 break;
-//UNUSED2008-05 case SR_RELABS :
-//UNUSED2008-05 case SR_RELATIVE :
-//UNUSED2008-05 default:
-//UNUSED2008-05 Flags.bColRel = sal_True;
-//UNUSED2008-05 Flags.bColDeleted = sal_False;
-//UNUSED2008-05 }
-//UNUSED2008-05 switch ( rBools.bRelRow )
-//UNUSED2008-05 {
-//UNUSED2008-05 case SR_DELETED :
-//UNUSED2008-05 Flags.bRowRel = sal_True; // der war verlorengegangen
-//UNUSED2008-05 Flags.bRowDeleted = sal_True;
-//UNUSED2008-05 break;
-//UNUSED2008-05 case SR_ABSOLUTE :
-//UNUSED2008-05 Flags.bRowRel = sal_False;
-//UNUSED2008-05 Flags.bRowDeleted = sal_False;
-//UNUSED2008-05 break;
-//UNUSED2008-05 case SR_RELABS :
-//UNUSED2008-05 case SR_RELATIVE :
-//UNUSED2008-05 default:
-//UNUSED2008-05 Flags.bRowRel = sal_True;
-//UNUSED2008-05 Flags.bRowDeleted = sal_False;
-//UNUSED2008-05 }
-//UNUSED2008-05 switch ( rBools.bRelTab )
-//UNUSED2008-05 {
-//UNUSED2008-05 case SR_DELETED :
-//UNUSED2008-05 Flags.bTabRel = sal_True; // der war verlorengegangen
-//UNUSED2008-05 Flags.bTabDeleted = sal_True;
-//UNUSED2008-05 break;
-//UNUSED2008-05 case SR_ABSOLUTE :
-//UNUSED2008-05 Flags.bTabRel = sal_False;
-//UNUSED2008-05 Flags.bTabDeleted = sal_False;
-//UNUSED2008-05 break;
-//UNUSED2008-05 case SR_RELABS :
-//UNUSED2008-05 case SR_RELATIVE :
-//UNUSED2008-05 default:
-//UNUSED2008-05 Flags.bTabRel = sal_True;
-//UNUSED2008-05 Flags.bTabDeleted = sal_False;
-//UNUSED2008-05 }
-//UNUSED2008-05 Flags.bFlag3D = (rBools.bOldFlag3D & SRF_3D ? sal_True : sal_False);
-//UNUSED2008-05 Flags.bRelName = (rBools.bOldFlag3D & SRF_RELNAME ? sal_True : sal_False);
-//UNUSED2008-05 if ( !Flags.bFlag3D )
-//UNUSED2008-05 Flags.bTabRel = sal_True; // ist bei einigen aelteren Dokumenten nicht gesetzt
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05
-//UNUSED2008-05 /*
-//UNUSED2008-05 bis Release 3.1 sah Store so aus
-//UNUSED2008-05
-//UNUSED2008-05 sal_uInt8 n = ( ( r.bOldFlag3D & 0x03 ) << 6 ) // RelName, 3D
-//UNUSED2008-05 | ( ( r.bRelTab & 0x03 ) << 4 ) // Relative, RelAbs
-//UNUSED2008-05 | ( ( r.bRelRow & 0x03 ) << 2 )
-//UNUSED2008-05 | ( r.bRelCol & 0x03 );
-//UNUSED2008-05
-//UNUSED2008-05 bis Release 3.1 sah Load so aus
-//UNUSED2008-05
-//UNUSED2008-05 r.bRelCol = ( n & 0x03 );
-//UNUSED2008-05 r.bRelRow = ( ( n >> 2 ) & 0x03 );
-//UNUSED2008-05 r.bRelTab = ( ( n >> 4 ) & 0x03 );
-//UNUSED2008-05 r.bOldFlag3D = ( ( n >> 6 ) & 0x03 );
-//UNUSED2008-05
-//UNUSED2008-05 bRelCol == SR_DELETED war identisch mit bRelCol == (SR_RELATIVE | SR_RELABS)
-//UNUSED2008-05 leider..
-//UNUSED2008-05 3.1 liest Zukunft: Deleted wird nicht unbedingt erkannt, nur wenn auch Relativ.
-//UNUSED2008-05 Aber immer noch nCol > MAXCOL und gut sollte sein..
-//UNUSED2008-05 */
-//UNUSED2008-05
-//UNUSED2008-05 sal_uInt8 ScSingleRefData::CreateStoreByteFromFlags() const
-//UNUSED2008-05 {
-//UNUSED2008-05 return (sal_uInt8)(
-//UNUSED2008-05 ( (Flags.bRelName & 0x01) << 7 )
-//UNUSED2008-05 | ( (Flags.bFlag3D & 0x01) << 6 )
-//UNUSED2008-05 | ( (Flags.bTabDeleted & 0x01) << 5 )
-//UNUSED2008-05 | ( (Flags.bTabRel & 0x01) << 4 )
-//UNUSED2008-05 | ( (Flags.bRowDeleted & 0x01) << 3 )
-//UNUSED2008-05 | ( (Flags.bRowRel & 0x01) << 2 )
-//UNUSED2008-05 | ( (Flags.bColDeleted & 0x01) << 1 )
-//UNUSED2008-05 | (Flags.bColRel & 0x01)
-//UNUSED2008-05 );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05
-//UNUSED2008-05 void ScSingleRefData::CreateFlagsFromLoadByte( sal_uInt8 n )
-//UNUSED2008-05 {
-//UNUSED2008-05 Flags.bColRel = (n & 0x01 );
-//UNUSED2008-05 Flags.bColDeleted = ( (n >> 1) & 0x01 );
-//UNUSED2008-05 Flags.bRowRel = ( (n >> 2) & 0x01 );
-//UNUSED2008-05 Flags.bRowDeleted = ( (n >> 3) & 0x01 );
-//UNUSED2008-05 Flags.bTabRel = ( (n >> 4) & 0x01 );
-//UNUSED2008-05 Flags.bTabDeleted = ( (n >> 5) & 0x01 );
-//UNUSED2008-05 Flags.bFlag3D = ( (n >> 6) & 0x01 );
-//UNUSED2008-05 Flags.bRelName = ( (n >> 7) & 0x01 );
-//UNUSED2008-05 }
sal_Bool ScSingleRefData::operator==( const ScSingleRefData& r ) const
@@ -288,8 +185,8 @@ static void lcl_putInOrder( ScSingleRefData & rRef1, ScSingleRefData & rRef2 )
rRef1.Flags.bTabDeleted = rRef2.Flags.bTabDeleted;
rRef2.Flags.bTabDeleted = bTmp;
}
- rRef1.Flags.bRelName = ( nRelState1 ? sal_True : sal_False );
- rRef2.Flags.bRelName = ( nRelState2 ? sal_True : sal_False );
+ rRef1.Flags.bRelName = ( nRelState1 ? sal_True : false );
+ rRef2.Flags.bRelName = ( nRelState2 ? sal_True : false );
}
@@ -370,3 +267,5 @@ ScComplexRefData& ScComplexRefData::Extend( const ScComplexRefData & rRef, const
{
return Extend( rRef.Ref1, rPos).Extend( rRef.Ref2, rPos);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx
index 831fcf5c0623..a3b2ce55585d 100644
--- a/sc/source/core/tool/reffind.cxx
+++ b/sc/source/core/tool/reffind.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,15 +43,22 @@
// STATIC DATA -----------------------------------------------------------
// incl. Doppelpunkt -> Doppelte Referenzen werden einzeln behandelt
-const sal_Unicode __FAR_DATA ScRefFinder::pDelimiters[] = {
- '=','(',')',';','+','-','*','/','^','&',' ','{','}','<','>',':', 0
+const sal_Unicode ScRefFinder::pDelimiters[] = {
+ '=','(',')','+','-','*','/','^','&',' ','{','}','<','>',':', 0
};
// =======================================================================
inline sal_Bool IsText( sal_Unicode c )
{
- return !ScGlobal::UnicodeStrChr( ScRefFinder::pDelimiters, c );
+ bool bFound = ScGlobal::UnicodeStrChr( ScRefFinder::pDelimiters, c );
+ if (bFound)
+ // This is one of delimiters, therefore not text.
+ return false;
+
+ // argument separator is configurable.
+ const sal_Unicode sep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
+ return c != sep;
}
inline sal_Bool IsText( sal_Bool& bQuote, sal_Unicode c )
@@ -124,7 +132,7 @@ void ScRefFinder::ToggleRel( xub_StrLen nStartPos, xub_StrLen nEndPos )
while ( nEStart <= nEndPos && !IsText(pSource[nEStart]) )
++nEStart;
- sal_Bool bQuote = sal_False;
+ sal_Bool bQuote = false;
xub_StrLen nEEnd = nEStart;
while ( nEEnd <= nEndPos && IsText(bQuote,pSource[nEEnd]) )
++nEEnd;
@@ -166,3 +174,4 @@ void ScRefFinder::ToggleRel( xub_StrLen nStartPos, xub_StrLen nEndPos )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/refreshtimer.cxx b/sc/source/core/tool/refreshtimer.cxx
index 220bdee8d260..ced9c1ebaa48 100644
--- a/sc/source/core/tool/refreshtimer.cxx
+++ b/sc/source/core/tool/refreshtimer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,9 +40,9 @@ ScRefreshTimerProtector::ScRefreshTimerProtector( ScRefreshTimerControl * const
{
if ( ppControl && *ppControl )
{
- (*ppControl)->SetAllowRefresh( sal_False );
+ (*ppControl)->SetAllowRefresh( false );
// wait for any running refresh in another thread to finnish
- ::vos::OGuard aGuard( (*ppControl)->GetMutex() );
+ ::osl::MutexGuard aGuard( (*ppControl)->GetMutex() );
}
}
@@ -70,7 +71,7 @@ void ScRefreshTimer::Timeout()
if ( ppControl && *ppControl && (*ppControl)->IsRefreshAllowed() )
{
// now we COULD make the call in another thread ...
- ::vos::OGuard aGuard( (*ppControl)->GetMutex() );
+ ::osl::MutexGuard aGuard( (*ppControl)->GetMutex() );
maTimeoutHdl.Call( this );
// restart from now on, don't execute immediately again if timed out
// a second time during refresh
@@ -79,3 +80,4 @@ void ScRefreshTimer::Timeout()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx
index 64580b094cf2..26167cdf8ba1 100644
--- a/sc/source/core/tool/reftokenhelper.cxx
+++ b/sc/source/core/tool/reftokenhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,9 +47,9 @@ using ::std::auto_ptr;
using ::rtl::OUString;
void ScRefTokenHelper::compileRangeRepresentation(
- vector<ScSharedTokenRef>& rRefTokens, const OUString& rRangeStr, ScDocument* pDoc, FormulaGrammar::Grammar eGrammar)
+ vector<ScTokenRef>& rRefTokens, const OUString& rRangeStr, ScDocument* pDoc, FormulaGrammar::Grammar eGrammar)
{
- const sal_Unicode cSep = GetScCompilerNativeSymbol(ocSep).GetChar(0);
+ const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
const sal_Unicode cQuote = '\'';
// #i107275# ignore parentheses
@@ -108,36 +109,16 @@ void ScRefTokenHelper::compileRangeRepresentation(
}
if (!bFailure)
rRefTokens.push_back(
- ScSharedTokenRef(static_cast<ScToken*>(p->Clone())));
+ ScTokenRef(static_cast<ScToken*>(p->Clone())));
}
}
-#if 0
- switch (p->GetType())
- {
- case svSingleRef:
- fprintf(stdout, "ScChart2DataProvider::compileRangeRepresentation: single ref\n");
- break;
- case svDoubleRef:
- fprintf(stdout, "ScChart2DataProvider::compileRangeRepresentation: double ref\n");
- break;
- case svExternalSingleRef:
- fprintf(stdout, "ScChart2DataProvider::compileRangeRepresentation: external single ref\n");
- break;
- case svExternalDoubleRef:
- fprintf(stdout, "ScChart2DataProvider::compileRangeRepresentation: external double ref\n");
- break;
- default:
- ;
- }
-#endif
-
}
if (bFailure)
rRefTokens.clear();
}
-bool ScRefTokenHelper::getRangeFromToken(ScRange& rRange, const ScSharedTokenRef& pToken, bool bExternal)
+bool ScRefTokenHelper::getRangeFromToken(ScRange& rRange, const ScTokenRef& pToken, bool bExternal)
{
StackVar eType = pToken->GetType();
switch (pToken->GetType())
@@ -178,9 +159,9 @@ bool ScRefTokenHelper::getRangeFromToken(ScRange& rRange, const ScSharedTokenRef
return false;
}
-void ScRefTokenHelper::getRangeListFromTokens(ScRangeList& rRangeList, const vector<ScSharedTokenRef>& rTokens)
+void ScRefTokenHelper::getRangeListFromTokens(ScRangeList& rRangeList, const vector<ScTokenRef>& rTokens)
{
- vector<ScSharedTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+ vector<ScTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
for (; itr != itrEnd; ++itr)
{
ScRange aRange;
@@ -189,7 +170,7 @@ void ScRefTokenHelper::getRangeListFromTokens(ScRangeList& rRangeList, const vec
}
}
-void ScRefTokenHelper::getTokenFromRange(ScSharedTokenRef& pToken, const ScRange& rRange)
+void ScRefTokenHelper::getTokenFromRange(ScTokenRef& pToken, const ScRange& rRange)
{
ScComplexRefData aData;
aData.InitFlags();
@@ -214,26 +195,26 @@ void ScRefTokenHelper::getTokenFromRange(ScSharedTokenRef& pToken, const ScRange
pToken.reset(new ScDoubleRefToken(aData));
}
-void ScRefTokenHelper::getTokensFromRangeList(vector<ScSharedTokenRef>& pTokens, const ScRangeList& rRanges)
+void ScRefTokenHelper::getTokensFromRangeList(vector<ScTokenRef>& pTokens, const ScRangeList& rRanges)
{
- vector<ScSharedTokenRef> aTokens;
- sal_uInt32 nCount = rRanges.Count();
+ vector<ScTokenRef> aTokens;
+ size_t nCount = rRanges.size();
aTokens.reserve(nCount);
- for (sal_uInt32 i = 0; i < nCount; ++i)
+ for (size_t i = 0; i < nCount; ++i)
{
- ScRange* pRange = static_cast<ScRange*>(rRanges.GetObject(i));
+ const ScRange* pRange = rRanges[i];
if (!pRange)
// failed.
return;
- ScSharedTokenRef pToken;
+ ScTokenRef pToken;
ScRefTokenHelper::getTokenFromRange(pToken,* pRange);
aTokens.push_back(pToken);
}
pTokens.swap(aTokens);
}
-bool ScRefTokenHelper::isRef(const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::isRef(const ScTokenRef& pToken)
{
switch (pToken->GetType())
{
@@ -248,7 +229,7 @@ bool ScRefTokenHelper::isRef(const ScSharedTokenRef& pToken)
return false;
}
-bool ScRefTokenHelper::isExternalRef(const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::isExternalRef(const ScTokenRef& pToken)
{
switch (pToken->GetType())
{
@@ -261,7 +242,7 @@ bool ScRefTokenHelper::isExternalRef(const ScSharedTokenRef& pToken)
return false;
}
-bool ScRefTokenHelper::intersects(const vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::intersects(const vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
{
if (!isRef(pToken))
return false;
@@ -272,10 +253,10 @@ bool ScRefTokenHelper::intersects(const vector<ScSharedTokenRef>& rTokens, const
ScRange aRange;
getRangeFromToken(aRange, pToken, bExternal);
- vector<ScSharedTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+ vector<ScTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
for (; itr != itrEnd; ++itr)
{
- const ScSharedTokenRef& p = *itr;
+ const ScTokenRef& p = *itr;
if (!isRef(p))
continue;
@@ -307,7 +288,7 @@ public:
* @param rTokens existing list of reference tokens
* @param rToken new token
*/
- void operator() (vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+ void operator() (vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
{
join(rTokens, pToken);
}
@@ -350,7 +331,7 @@ private:
return (bRowsContained && bColsContained);
}
- void join(vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+ void join(vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
{
// Normalize the token to a double reference.
ScComplexRefData aData;
@@ -363,10 +344,10 @@ private:
String aTabName = bExternal ? pToken->GetString() : String();
bool bJoined = false;
- vector<ScSharedTokenRef>::iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+ vector<ScTokenRef>::iterator itr = rTokens.begin(), itrEnd = rTokens.end();
for (; itr != itrEnd; ++itr)
{
- ScSharedTokenRef& pOldToken = *itr;
+ ScTokenRef& pOldToken = *itr;
if (!ScRefTokenHelper::isRef(pOldToken))
// A non-ref token should not have been added here in the first
@@ -436,7 +417,7 @@ private:
return;
// Pop the last token from the list, and keep joining recursively.
- ScSharedTokenRef p = rTokens.back();
+ ScTokenRef p = rTokens.back();
rTokens.pop_back();
join(rTokens, p);
}
@@ -447,13 +428,13 @@ private:
}
-void ScRefTokenHelper::join(vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+void ScRefTokenHelper::join(vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
{
JoinRefTokenRanges join;
join(rTokens, pToken);
}
-bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const ScTokenRef& pToken)
{
switch (pToken->GetType())
{
@@ -477,3 +458,21 @@ bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const
}
return true;
}
+
+ScTokenRef ScRefTokenHelper::createRefToken(const ScAddress& rAddr)
+{
+ ScSingleRefData aRefData;
+ aRefData.InitAddress(rAddr);
+ ScTokenRef pRef(new ScSingleRefToken(aRefData));
+ return pRef;
+}
+
+ScTokenRef ScRefTokenHelper::createRefToken(const ScRange& rRange)
+{
+ ScComplexRefData aRefData;
+ aRefData.InitRange(rRange);
+ ScTokenRef pRef(new ScDoubleRefToken(aRefData));
+ return pRef;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index 5dd077ed042f..e084b5e76d75 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,7 @@
template< typename R, typename S, typename U >
sal_Bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask )
{
- sal_Bool bCut = sal_False;
+ sal_Bool bCut = false;
if ( rRef >= nStart )
rRef = sal::static_int_cast<R>( rRef + nDelta );
else if ( nDelta < 0 && rRef >= nStart + nDelta )
@@ -64,7 +65,7 @@ sal_Bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask )
template< typename R, typename S, typename U >
sal_Bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask )
{
- sal_Bool bCut = sal_False;
+ sal_Bool bCut = false;
if ( rRef >= nStart )
rRef = sal::static_int_cast<R>( rRef + nDelta );
else if ( nDelta < 0 && rRef >= nStart + nDelta )
@@ -114,13 +115,13 @@ sal_Bool lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta )
}
}
- return sal_False;
+ return false;
}
template< typename R, typename S, typename U >
sal_Bool lcl_MoveItCut( R& rRef, S nDelta, U nMask )
{
- sal_Bool bCut = sal_False;
+ sal_Bool bCut = false;
rRef = sal::static_int_cast<R>( rRef + nDelta );
if ( rRef < 0 )
{
@@ -153,7 +154,7 @@ sal_Bool lcl_MoveRefPart( R& rRef1Val, sal_Bool& rRef1Del, sal_Bool bDo1,
if ( nDelta )
{
sal_Bool bDel, bCut1, bCut2;
- bDel = bCut1 = bCut2 = sal_False;
+ bDel = bCut1 = bCut2 = false;
S n;
if (bDo1 && bDo2)
{
@@ -199,7 +200,7 @@ sal_Bool lcl_MoveRefPart( R& rRef1Val, sal_Bool& rRef1Del, sal_Bool bDo1,
return bDel || bCut1 || bCut2 || rRef1Del || rRef2Del;
}
else
- return sal_False;
+ return false;
}
template< typename R, typename S, typename U >
@@ -235,13 +236,13 @@ sal_Bool lcl_IsWrapBig( sal_Int32 nRef, sal_Int32 nDelta )
return nRef + nDelta <= 0;
else if ( nRef < 0 && nDelta < 0 )
return nRef + nDelta >= 0;
- return sal_False;
+ return false;
}
sal_Bool lcl_MoveBig( sal_Int32& rRef, sal_Int32 nStart, sal_Int32 nDelta )
{
- sal_Bool bCut = sal_False;
+ sal_Bool bCut = false;
if ( rRef >= nStart )
{
if ( nDelta > 0 )
@@ -516,7 +517,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode,
const ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
sal_Bool bInDeleteUndo =
- ( pChangeTrack ? pChangeTrack->IsInDeleteUndo() : sal_False );
+ ( pChangeTrack ? pChangeTrack->IsInDeleteUndo() : false );
SCCOL oldCol1 = rRef.Ref1.nCol;
SCROW oldRow1 = rRef.Ref1.nRow;
@@ -555,10 +556,10 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode,
{
if ( bRef1ColDel && nCol1 <= rRef.Ref1.nCol &&
rRef.Ref1.nCol <= nCol1 + nDx )
- rRef.Ref1.SetColDeleted( sal_False );
+ rRef.Ref1.SetColDeleted( false );
if ( bRef2ColDel && nCol1 <= rRef.Ref2.nCol &&
rRef.Ref2.nCol <= nCol1 + nDx )
- rRef.Ref2.SetColDeleted( sal_False );
+ rRef.Ref2.SetColDeleted( false );
}
else
{
@@ -597,10 +598,10 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode,
{
if ( bRef1RowDel && nRow1 <= rRef.Ref1.nRow &&
rRef.Ref1.nRow <= nRow1 + nDy )
- rRef.Ref1.SetRowDeleted( sal_False );
+ rRef.Ref1.SetRowDeleted( false );
if ( bRef2RowDel && nRow1 <= rRef.Ref2.nRow &&
rRef.Ref2.nRow <= nRow1 + nDy )
- rRef.Ref2.SetRowDeleted( sal_False );
+ rRef.Ref2.SetRowDeleted( false );
}
else
{
@@ -640,10 +641,10 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode,
{
if ( bRef1TabDel && nTab1 <= rRef.Ref1.nTab &&
rRef.Ref1.nTab <= nTab1 + nDz )
- rRef.Ref1.SetTabDeleted( sal_False );
+ rRef.Ref1.SetTabDeleted( false );
if ( bRef2TabDel && nTab1 <= rRef.Ref2.nTab &&
rRef.Ref2.nTab <= nTab1 + nDz )
- rRef.Ref2.SetTabDeleted( sal_False );
+ rRef.Ref2.SetTabDeleted( false );
}
else
{
@@ -684,7 +685,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode,
&& rRef.Ref2.nRow <= nRow2-nDy
&& rRef.Ref2.nTab <= nTab2-nDz )
{
- eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, sal_False, sal_True ); // immer verschieben
+ eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, false, sal_True ); // immer verschieben
}
else if ( nDz && r.In( rPos ) )
{
@@ -698,7 +699,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eMode,
rRef.CalcRelFromAbs( rPos );
}
else if( eMode == URM_COPY && r.In( rPos ) )
- eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, sal_False, sal_False ); // nur relative
+ eRet = Move( pDoc, rPos, nDx, nDy, nDz, rRef, false, false ); // nur relative
// sollte nicht mehr verwendet werden muessen
else if (eWhat != ScRefUpdate::ABSOLUTE)
rRef.CalcRelFromAbs( rPos );
@@ -723,7 +724,7 @@ ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos,
sal_Bool bCut1, bCut2;
if ( nDx )
{
- bCut1 = bCut2 = sal_False;
+ bCut1 = bCut2 = false;
if( bAbsolute || rRef.Ref1.IsColRel() )
{
if( bWrap )
@@ -748,7 +749,7 @@ ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos,
}
if ( nDy )
{
- bCut1 = bCut2 = sal_False;
+ bCut1 = bCut2 = false;
if( bAbsolute || rRef.Ref1.IsRowRel() )
{
if( bWrap )
@@ -773,7 +774,7 @@ ScRefUpdateRes ScRefUpdate::Move( ScDocument* pDoc, const ScAddress& rPos,
}
if ( nDz )
{
- bCut1 = bCut2 = sal_False;
+ bCut1 = bCut2 = false;
SCsTAB nMaxTab = (SCsTAB) pDoc->GetTableCount() - 1;
if( bAbsolute || rRef.Ref1.IsTabRel() )
{
@@ -937,3 +938,4 @@ ScRefUpdateRes ScRefUpdate::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCRO
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index fea4ea06ba50..9add45e417ec 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,412 +42,461 @@
#include <math.h>
-//------------------------------------------------------------------------
+#define MDDS_HASH_CONTAINER_BOOST 1
+#include <mdds/mixed_type_matrix.hpp>
-void ScMatrix::CreateMatrix(SCSIZE nC, SCSIZE nR) // nur fuer ctor
+using ::std::pair;
+using ::std::for_each;
+using ::std::count_if;
+using ::std::advance;
+using ::std::unary_function;
+using ::mdds::matrix_element_t;
+
+// ============================================================================
+
+namespace {
+
+typedef ::mdds::mixed_type_matrix<String, sal_uInt8> MatrixImplType;
+
+struct ElemEqual : public unary_function<double, bool>
{
- pErrorInterpreter = NULL;
- nColCount = nC;
- nRowCount = nR;
- SCSIZE nCount = nColCount * nRowCount;
- if ( !nCount || nCount > GetElementsMax() )
+ bool operator() (double val) const
{
- DBG_ERRORFILE("ScMatrix::CreateMatrix: dimension error");
- nColCount = nRowCount = 1;
- pMat = new ScMatrixValue[1];
- pMat[0].fVal = CreateDoubleError( errStackOverflow);
+ return val == 0.0;
}
- else
- pMat = new ScMatrixValue[nCount];
- mnValType = NULL;
- mnNonValue = 0;
-}
+};
+
+struct ElemNotEqual : public unary_function<double, bool>
+{
+ bool operator() (double val) const
+ {
+ return val != 0.0;
+ }
+};
+
+struct ElemGreater : public unary_function<double, bool>
+{
+ bool operator() (double val) const
+ {
+ return val > 0.0;
+ }
+};
-void ScMatrix::Clear()
+struct ElemLess : public unary_function<double, bool>
{
- DeleteIsString();
- delete [] pMat;
+ bool operator() (double val) const
+ {
+ return val < 0.0;
+ }
+};
+
+struct ElemGreaterEqual : public unary_function<double, bool>
+{
+ bool operator() (double val) const
+ {
+ return val >= 0.0;
+ }
+};
+
+struct ElemLessEqual : public unary_function<double, bool>
+{
+ bool operator() (double val) const
+ {
+ return val <= 0.0;
+ }
+};
+
+template<typename _Comp>
+void compareMatrix(MatrixImplType& rMat)
+{
+ pair<size_t,size_t> aDim = rMat.size();
+ _Comp aComp;
+ for (size_t i = 0; i < aDim.first; ++i)
+ {
+ for (size_t j = 0; j < aDim.second; ++j)
+ {
+ matrix_element_t eType = rMat.get_type(i, j);
+ if (eType != mdds::element_numeric && eType == mdds::element_boolean)
+ continue;
+
+ double fVal = rMat.get_numeric(i, j);
+ if (!::rtl::math::isFinite(fVal))
+ continue;
+
+ rMat.set_boolean(i, j, aComp(fVal));
+ }
+ }
}
-ScMatrix::~ScMatrix()
+::mdds::matrix_density_t toMddsDensityType(ScMatrix::DensityType eType)
{
- Clear();
+ switch (eType)
+ {
+ case ScMatrix::FILLED_EMPTY:
+ return mdds::matrix_density_filled_empty;
+ case ScMatrix::FILLED_ZERO:
+ return mdds::matrix_density_filled_zero;
+ case ScMatrix::SPARSE_EMPTY:
+ return mdds::matrix_density_sparse_empty;
+ case ScMatrix::SPARSE_ZERO:
+ return mdds::matrix_density_sparse_zero;
+ default:
+ ;
+ }
+
+ // default density type
+ return mdds::matrix_density_filled_zero;
}
-ScMatrix* ScMatrix::Clone() const
+/**
+ * Return a numeric value from a matrix element no matter what its type is.
+ */
+double getNumericValue(const MatrixImplType::element& elem)
{
- ScMatrix* pScMat = new ScMatrix( nColCount, nRowCount);
- MatCopy(*pScMat);
- pScMat->SetErrorInterpreter( pErrorInterpreter); // TODO: really?
- return pScMat;
+ switch (elem.m_type)
+ {
+ case mdds::element_boolean:
+ return static_cast<double>(elem.m_boolean);
+ case mdds::element_numeric:
+ return elem.m_numeric;
+ default:
+ ;
+ }
+ return 0.0;
}
-ScMatrix* ScMatrix::CloneIfConst()
+}
+
+class ScMatrixImpl
+{
+ MatrixImplType maMat;
+ ScMatrix::DensityType meType;
+ ScInterpreter* pErrorInterpreter;
+ bool mbCloneIfConst; // Whether the matrix is cloned with a CloneIfConst() call.
+
+ ScMatrixImpl();
+ ScMatrixImpl(const ScMatrixImpl&);
+public:
+ ScMatrixImpl(SCSIZE nC, SCSIZE nR, ScMatrix::DensityType eType);
+ ~ScMatrixImpl();
+
+ void Clear();
+ void SetImmutable(bool bVal);
+ bool IsImmutable() const;
+ void Resize(SCSIZE nC, SCSIZE nR);
+ ScMatrix::DensityType GetDensityType() const;
+ void SetErrorInterpreter( ScInterpreter* p);
+ ScInterpreter* GetErrorInterpreter() const { return pErrorInterpreter; }
+
+ void GetDimensions( SCSIZE& rC, SCSIZE& rR) const;
+ SCSIZE GetElementCount() const;
+ bool ValidColRow( SCSIZE nC, SCSIZE nR) const;
+ SCSIZE CalcOffset( SCSIZE nC, SCSIZE nR) const;
+ bool ValidColRowReplicated( SCSIZE & rC, SCSIZE & rR ) const;
+ bool ValidColRowOrReplicated( SCSIZE & rC, SCSIZE & rR ) const;
+ void SetErrorAtInterpreter( sal_uInt16 nError ) const;
+ void PutDouble(double fVal, SCSIZE nC, SCSIZE nR);
+ void PutDouble( double fVal, SCSIZE nIndex);
+ void PutString(const String& rStr, SCSIZE nC, SCSIZE nR);
+ void PutString(const String& rStr, SCSIZE nIndex);
+
+ void PutEmpty(SCSIZE nC, SCSIZE nR);
+ void PutEmptyPath(SCSIZE nC, SCSIZE nR);
+ void PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR );
+ void PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR);
+ sal_uInt16 GetError( SCSIZE nC, SCSIZE nR) const;
+ double GetDouble(SCSIZE nC, SCSIZE nR) const;
+ double GetDouble( SCSIZE nIndex) const;
+ const String& GetString(SCSIZE nC, SCSIZE nR) const;
+ const String& GetString( SCSIZE nIndex) const;
+ String GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const;
+ ScMatrixValue Get(SCSIZE nC, SCSIZE nR) const;
+ bool IsString( SCSIZE nIndex ) const;
+ bool IsString( SCSIZE nC, SCSIZE nR ) const;
+ bool IsEmpty( SCSIZE nC, SCSIZE nR ) const;
+ bool IsEmptyPath( SCSIZE nC, SCSIZE nR ) const;
+ bool IsValue( SCSIZE nIndex ) const;
+ bool IsValue( SCSIZE nC, SCSIZE nR ) const;
+ bool IsValueOrEmpty( SCSIZE nC, SCSIZE nR ) const;
+ bool IsBoolean( SCSIZE nC, SCSIZE nR ) const;
+ bool IsNumeric() const;
+ void MatCopy(ScMatrixImpl& mRes) const;
+ void MatTrans(ScMatrixImpl& mRes) const;
+ void FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE nC2, SCSIZE nR2 );
+ void CompareEqual();
+ void CompareNotEqual();
+ void CompareLess();
+ void CompareGreater();
+ void CompareLessEqual();
+ void CompareGreaterEqual();
+ double And() const;
+ double Or() const;
+
+ ScMatrix::IterateResult Sum(bool bTextAsZero) const;
+ ScMatrix::IterateResult SumSquare(bool bTextAsZero) const;
+ ScMatrix::IterateResult Product(bool bTextAsZero) const;
+ size_t Count(bool bCountStrings) const;
+
+private:
+ void CalcPosition(SCSIZE nIndex, SCSIZE& rC, SCSIZE& rR) const;
+};
+
+ScMatrixImpl::ScMatrixImpl(SCSIZE nC, SCSIZE nR, ScMatrix::DensityType eType) :
+ maMat(nR, nC, toMddsDensityType(eType)),
+ meType(eType),
+ mbCloneIfConst(true)
{
- return (mbCloneIfConst || IsEternalRef()) ? Clone() : this;
}
-void ScMatrix::Resize( SCSIZE nC, SCSIZE nR)
+ScMatrixImpl::~ScMatrixImpl()
{
Clear();
- CreateMatrix(nC, nR);
}
-ScMatrix* ScMatrix::CloneAndExtend( SCSIZE nNewCols, SCSIZE nNewRows ) const
+void ScMatrixImpl::Clear()
{
- ScMatrix* pScMat = new ScMatrix( nNewCols, nNewRows);
- MatCopy(*pScMat);
- pScMat->SetErrorInterpreter( pErrorInterpreter);
- return pScMat;
+ maMat.clear();
}
-void ScMatrix::SetErrorAtInterpreter( sal_uInt16 nError ) const
+void ScMatrixImpl::SetImmutable(bool bVal)
{
- if ( pErrorInterpreter )
- pErrorInterpreter->SetError( nError);
+ mbCloneIfConst = bVal;
}
-//
-// File format: sal_uInt16 columns, sal_uInt16 rows, (columns*rows) entries:
-// sal_uInt8 type ( CELLTYPE_NONE, CELLTYPE_VALUE, CELLTYPE_STRING ); nothing, double or String
-//
+bool ScMatrixImpl::IsImmutable() const
+{
+ return mbCloneIfConst;
+}
-ScMatrix::ScMatrix(SvStream& /* rStream */)
- : pErrorInterpreter( NULL)
- , nRefCnt(0)
+void ScMatrixImpl::Resize(SCSIZE nC, SCSIZE nR)
{
-#if SC_ROWLIMIT_STREAM_ACCESS
-#error address types changed!
- sal_uInt16 nC;
- sal_uInt16 nR;
+ maMat.resize(nR, nC);
+}
- rStream >> nC;
- rStream >> nR;
+ScMatrix::DensityType ScMatrixImpl::GetDensityType() const
+{
+ return meType;
+}
- CreateMatrix(nC, nR);
- DBG_ASSERT( pMat, "pMat == NULL" );
+void ScMatrixImpl::SetErrorInterpreter( ScInterpreter* p)
+{
+ pErrorInterpreter = p;
+}
- String aMatStr;
- double fVal;
- rtl_TextEncoding eCharSet = rStream.GetStreamCharSet();
- SCSIZE nCount = nColCount * nRowCount;
- SCSIZE nReadCount = (SCSIZE) nC * nR;
- for (SCSIZE i=0; i<nReadCount; i++)
- {
- sal_uInt8 nType;
- rStream >> nType;
- if ( nType == CELLTYPE_VALUE )
- {
- if ( i < nCount )
- rStream >> pMat[i].fVal;
- else
- rStream >> fVal;
- }
- else
- {
- // For unknown types read and forget string (upwards compatibility)
-
- if ( nType != CELLTYPE_NONE )
- rStream.ReadByteString( aMatStr, eCharSet );
-
- if ( i < nCount )
- {
- if (!mnValType)
- ResetIsString(); // init string flags
- mnValType[i] = ( nType == CELLTYPE_NONE ? SC_MATVAL_EMPTY : SC_MATVAL_STRING );
- mnNonValue++;
-
- if ( nType == CELLTYPE_STRING )
- pMat[i].pS = new String(aMatStr);
- else
- pMat[i].pS = NULL;
- }
- }
- }
-#else
- CreateMatrix(0,0);
-#endif // SC_ROWLIMIT_STREAM_ACCESS
-}
-
-void ScMatrix::Store(SvStream& /* rStream */) const
-{
-#if SC_ROWLIMIT_STREAM_ACCESS
-#error address types changed!
- SCSIZE nCount = nColCount * nRowCount;
- // Don't store matrix with more than sal_uInt16 max elements, old versions
- // might get confused in loops for(sal_uInt16 i=0; i<nC*nR; i++)
- if ( !pMat || nCount > ((sal_uInt16)(~0)) )
- {
- DBG_ASSERT( pMat, "ScMatrix::Store: pMat == NULL" );
- // We can't store a 0 dimension because old versions rely on some
- // matrix being present, e.g. DDE link results, and old versions didn't
- // create a matrix if dimension was 0. Store an error result.
- rStream << (sal_uInt16) 1;
- rStream << (sal_uInt16) 1;
- rStream << (sal_uInt8) CELLTYPE_VALUE;
- double fVal;
- ::rtl::math::setNan( &fVal );
- rStream << fVal;
- return;
- }
+void ScMatrixImpl::GetDimensions( SCSIZE& rC, SCSIZE& rR) const
+{
+ MatrixImplType::size_pair_type aDims = maMat.size();
+ rR = aDims.first;
+ rC = aDims.second;
+}
- rStream << (sal_uInt16) nColCount;
-#if SC_ROWLIMIT_MORE_THAN_32K
- #error row32k
-#endif
- rStream << (sal_uInt16) nRowCount;
+SCSIZE ScMatrixImpl::GetElementCount() const
+{
+ MatrixImplType::size_pair_type aDims = maMat.size();
+ return aDims.first * aDims.second;
+}
- String aMatStr;
- rtl_TextEncoding eCharSet = rStream.GetStreamCharSet();
- for (SCSIZE i=0; i<nCount; i++)
- {
- sal_uInt8 nType = CELLTYPE_VALUE;
- if ( mnValType && IsNonValueType( mnValType[i]))
- {
- if ( pMat[i].pS )
- aMatStr = *pMat[i].pS;
- else
- aMatStr.Erase();
-
- if ( mnValType[i] == SC_MATVAL_STRING )
- nType = CELLTYPE_STRING;
- else
- nType = CELLTYPE_NONE;
- }
- rStream << nType;
- if ( nType == CELLTYPE_VALUE )
- rStream << pMat[i].fVal;
- else if ( nType == CELLTYPE_STRING )
- rStream.WriteByteString( aMatStr, eCharSet );
- }
-#endif // SC_ROWLIMIT_STREAM_ACCESS
+bool ScMatrixImpl::ValidColRow( SCSIZE nC, SCSIZE nR) const
+{
+ MatrixImplType::size_pair_type aDims = maMat.size();
+ return nR < aDims.first && nC < aDims.second;
}
-void ScMatrix::ResetIsString()
+SCSIZE ScMatrixImpl::CalcOffset( SCSIZE nC, SCSIZE nR) const
{
- SCSIZE nCount = nColCount * nRowCount;
- if (mnValType)
- {
- for (SCSIZE i = 0; i < nCount; i++)
- {
- if ( IsNonValueType( mnValType[i]))
- delete pMat[i].pS;
- }
- }
- else
- mnValType = new sal_uInt8[nCount];
- memset( mnValType, 0, nCount * sizeof( sal_uInt8 ) );
- mnNonValue = 0;
+ return nC * maMat.size().first + nR;
}
-void ScMatrix::DeleteIsString()
+bool ScMatrixImpl::ValidColRowReplicated( SCSIZE & rC, SCSIZE & rR ) const
{
- if ( mnValType )
+ pair<size_t, size_t> aDims = maMat.size();
+
+ if (aDims.second == 1 && aDims.first == 1)
{
- SCSIZE nCount = nColCount * nRowCount;
- for ( SCSIZE i = 0; i < nCount; i++ )
- {
- if (IsNonValueType( mnValType[i]))
- delete pMat[i].pS;
- }
- delete [] mnValType;
- mnValType = NULL;
- mnNonValue = 0;
+ rC = 0;
+ rR = 0;
+ return true;
+ }
+ else if (aDims.second == 1 && rR < aDims.first)
+ {
+ // single column matrix.
+ rC = 0;
+ return true;
}
+ else if (aDims.first == 1 && rC < aDims.second)
+ {
+ // single row matrix.
+ rR = 0;
+ return true;
+ }
+ return false;
}
-void ScMatrix::PutDouble(double fVal, SCSIZE nC, SCSIZE nR)
+bool ScMatrixImpl::ValidColRowOrReplicated( SCSIZE & rC, SCSIZE & rR ) const
{
- if (ValidColRow( nC, nR))
- PutDouble( fVal, CalcOffset( nC, nR) );
- else
- {
- DBG_ERRORFILE("ScMatrix::PutDouble: dimension error");
- }
+ return ValidColRow( rC, rR) || ValidColRowReplicated( rC, rR);
}
-void ScMatrix::PutString(const String& rStr, SCSIZE nC, SCSIZE nR)
+void ScMatrixImpl::SetErrorAtInterpreter( sal_uInt16 nError ) const
{
- if (ValidColRow( nC, nR))
- PutString( rStr, CalcOffset( nC, nR) );
- else
- {
- DBG_ERRORFILE("ScMatrix::PutString: dimension error");
- }
+ if ( pErrorInterpreter )
+ pErrorInterpreter->SetError( nError);
}
-void ScMatrix::PutString(const String& rStr, SCSIZE nIndex)
+void ScMatrixImpl::PutDouble(double fVal, SCSIZE nC, SCSIZE nR)
{
- if (mnValType == NULL)
- ResetIsString();
- if ( IsNonValueType( mnValType[nIndex]) && pMat[nIndex].pS )
- *(pMat[nIndex].pS) = rStr;
+ if (ValidColRow( nC, nR))
+ maMat.set_numeric(nR, nC, fVal);
else
{
- pMat[nIndex].pS = new String(rStr);
- mnNonValue++;
+ DBG_ERRORFILE("ScMatrixImpl::PutDouble: dimension error");
}
- mnValType[nIndex] = SC_MATVAL_STRING;
}
-void ScMatrix::PutStringEntry( const String* pStr, sal_uInt8 bFlag, SCSIZE nIndex )
+void ScMatrixImpl::PutDouble( double fVal, SCSIZE nIndex)
{
- DBG_ASSERT( bFlag, "ScMatrix::PutStringEntry: bFlag == 0" );
- if (mnValType == NULL)
- ResetIsString();
- // Make sure all bytes of the union are initialized to be able to access
- // the value with if (IsValueOrEmpty()) GetDouble(). Backup pS first.
- String* pS = pMat[nIndex].pS;
- pMat[nIndex].fVal = 0.0;
- // An EMPTY or EMPTYPATH entry must not have a string pointer therefor.
- DBG_ASSERT( (((bFlag & SC_MATVAL_EMPTY) == SC_MATVAL_EMPTY) && !pStr) || sal_True,
- "ScMatrix::PutStringEntry: pStr passed through EMPTY entry");
- if ( IsNonValueType( mnValType[nIndex]) && pS )
- {
- if ((bFlag & SC_MATVAL_EMPTY) == SC_MATVAL_EMPTY)
- delete pS, pS = NULL;
- if ( pStr )
- *pS = *pStr;
- else if (pS)
- pS->Erase();
- pMat[nIndex].pS = pS;
- }
- else
- {
- pMat[nIndex].pS = (pStr ? new String(*pStr) : NULL);
- mnNonValue++;
- }
- mnValType[nIndex] = bFlag;
+ SCSIZE nC, nR;
+ CalcPosition(nIndex, nC, nR);
+ PutDouble(fVal, nC, nR);
}
-void ScMatrix::PutEmpty(SCSIZE nC, SCSIZE nR)
+void ScMatrixImpl::PutString(const String& rStr, SCSIZE nC, SCSIZE nR)
{
if (ValidColRow( nC, nR))
- PutEmpty( CalcOffset( nC, nR) );
+ maMat.set_string(nR, nC, new String(rStr));
else
{
- DBG_ERRORFILE("ScMatrix::PutEmpty: dimension error");
+ DBG_ERRORFILE("ScMatrixImpl::PutString: dimension error");
}
}
-void ScMatrix::PutEmpty(SCSIZE nIndex)
+void ScMatrixImpl::PutString(const String& rStr, SCSIZE nIndex)
{
- if (mnValType == NULL)
- ResetIsString();
- if ( IsNonValueType( mnValType[nIndex]) && pMat[nIndex].pS )
- {
- delete pMat[nIndex].pS;
- }
- else
- {
- mnNonValue++;
- }
- mnValType[nIndex] = SC_MATVAL_EMPTY;
- pMat[nIndex].pS = NULL;
- pMat[nIndex].fVal = 0.0;
+ SCSIZE nC, nR;
+ CalcPosition(nIndex, nC, nR);
+ PutString(rStr, nC, nR);
}
-void ScMatrix::PutEmptyPath(SCSIZE nC, SCSIZE nR)
+void ScMatrixImpl::PutEmpty(SCSIZE nC, SCSIZE nR)
{
if (ValidColRow( nC, nR))
- PutEmptyPath( CalcOffset( nC, nR) );
+ {
+ maMat.set_empty(nR, nC);
+ maMat.clear_flag(nR, nC); // zero flag to indicate that this is 'empty', not 'empty path'.
+ }
else
{
- DBG_ERRORFILE("ScMatrix::PutEmptyPath: dimension error");
+ DBG_ERRORFILE("ScMatrixImpl::PutEmpty: dimension error");
}
}
-void ScMatrix::PutEmptyPath(SCSIZE nIndex)
+void ScMatrixImpl::PutEmptyPath(SCSIZE nC, SCSIZE nR)
{
- if (mnValType == NULL)
- ResetIsString();
- if ( IsNonValueType( mnValType[nIndex]) && pMat[nIndex].pS )
+ if (ValidColRow( nC, nR))
{
- delete pMat[nIndex].pS;
+ maMat.set_empty(nR, nC);
+ maMat.set_flag(nR, nC, 1); // non-zero flag to indicate empty 'path'.
}
else
{
- mnNonValue++;
+ DBG_ERRORFILE("ScMatrixImpl::PutEmptyPath: dimension error");
}
- mnValType[nIndex] = SC_MATVAL_EMPTYPATH;
- pMat[nIndex].pS = NULL;
- pMat[nIndex].fVal = 0.0;
}
-void ScMatrix::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR)
+void ScMatrixImpl::PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR )
{
- if (ValidColRow( nC, nR))
- PutBoolean( bVal, CalcOffset( nC, nR) );
- else
- {
- DBG_ERRORFILE("ScMatrix::PutBoolean: dimension error");
- }
+ maMat.set_numeric(nR, nC, CreateDoubleError(nErrorCode));
}
-void ScMatrix::PutBoolean( bool bVal, SCSIZE nIndex)
+void ScMatrixImpl::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR)
{
- if (mnValType == NULL)
- ResetIsString();
- if ( IsNonValueType( mnValType[nIndex]) && pMat[nIndex].pS )
+ if (ValidColRow( nC, nR))
+ maMat.set_boolean(nR, nC, bVal);
+ else
{
- delete pMat[nIndex].pS;
- mnNonValue--;
+ DBG_ERRORFILE("ScMatrixImpl::PutBoolean: dimension error");
}
-
- mnValType[nIndex] = SC_MATVAL_BOOLEAN;
- pMat[nIndex].pS = NULL;
- pMat[nIndex].fVal = bVal ? 1. : 0.;
}
-sal_uInt16 ScMatrix::GetError( SCSIZE nC, SCSIZE nR) const
+sal_uInt16 ScMatrixImpl::GetError( SCSIZE nC, SCSIZE nR) const
{
if (ValidColRowOrReplicated( nC, nR ))
- return GetError( CalcOffset( nC, nR) );
+ {
+ double fVal = maMat.get_numeric(nR, nC);
+ return GetDoubleErrorValue(fVal);
+ }
else
{
- DBG_ERRORFILE("ScMatrix::GetError: dimension error");
+ DBG_ERRORFILE("ScMatrixImpl::GetError: dimension error");
return errNoValue;
}
}
-double ScMatrix::GetDouble(SCSIZE nC, SCSIZE nR) const
+double ScMatrixImpl::GetDouble(SCSIZE nC, SCSIZE nR) const
{
if (ValidColRowOrReplicated( nC, nR ))
- return GetDouble( CalcOffset( nC, nR) );
+ {
+ double fVal = maMat.get_numeric(nR, nC);
+ if ( pErrorInterpreter )
+ {
+ sal_uInt16 nError = GetDoubleErrorValue(fVal);
+ if ( nError )
+ SetErrorAtInterpreter( nError);
+ }
+ return fVal;
+ }
else
{
- DBG_ERRORFILE("ScMatrix::GetDouble: dimension error");
+ DBG_ERRORFILE("ScMatrixImpl::GetDouble: dimension error");
return CreateDoubleError( errNoValue);
}
}
-const String& ScMatrix::GetString(SCSIZE nC, SCSIZE nR) const
+double ScMatrixImpl::GetDouble( SCSIZE nIndex) const
+{
+ SCSIZE nC, nR;
+ CalcPosition(nIndex, nC, nR);
+ return GetDouble(nC, nR);
+}
+
+const String& ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const
{
if (ValidColRowOrReplicated( nC, nR ))
{
- SCSIZE nIndex = CalcOffset( nC, nR);
- if ( IsString( nIndex ) )
- return GetString( nIndex );
+ if (maMat.get_type(nR, nC) == ::mdds::element_string)
+ return *maMat.get_string(nR, nC);
else
{
- SetErrorAtInterpreter( GetError( nIndex));
- DBG_ERRORFILE("ScMatrix::GetString: access error, no string");
+ SetErrorAtInterpreter( GetError(nC, nR));
+ DBG_ERRORFILE("ScMatrixImpl::GetString: access error, no string");
}
}
else
{
- DBG_ERRORFILE("ScMatrix::GetString: dimension error");
+ DBG_ERRORFILE("ScMatrixImpl::GetString: dimension error");
}
return ScGlobal::GetEmptyString();
}
+const String& ScMatrixImpl::GetString( SCSIZE nIndex) const
+{
+ SCSIZE nC, nR;
+ CalcPosition(nIndex, nC, nR);
+ return GetString(nC, nR);
+}
-String ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nIndex) const
+String ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const
{
- if (IsString( nIndex))
+ if (!ValidColRowOrReplicated( nC, nR ))
{
- if (IsEmptyPath( nIndex))
- { // result of empty sal_False jump path
+ DBG_ERRORFILE("ScMatrixImpl::GetString: dimension error");
+ return String();
+ }
+
+ if (IsString( nC, nR))
+ {
+ if (IsEmptyPath( nC, nR))
+ { // result of empty FALSE jump path
sal_uLong nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_LOGICAL,
ScGlobal::eLnge);
String aStr;
@@ -454,17 +504,17 @@ String ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nIndex) const
rFormatter.GetOutputString( 0.0, nKey, aStr, &pColor);
return aStr;
}
- return GetString( nIndex );
+ return GetString( nC, nR);
}
- sal_uInt16 nError = GetError( nIndex);
+ sal_uInt16 nError = GetError( nC, nR);
if (nError)
{
SetErrorAtInterpreter( nError);
return ScGlobal::GetErrorString( nError);
}
- double fVal= GetDouble( nIndex);
+ double fVal= GetDouble( nC, nR);
sal_uLong nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_NUMBER,
ScGlobal::eLnge);
String aStr;
@@ -472,388 +522,686 @@ String ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nIndex) const
return aStr;
}
-
-String ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const
+ScMatrixValue ScMatrixImpl::Get(SCSIZE nC, SCSIZE nR) const
{
- if (ValidColRowOrReplicated( nC, nR ))
+ ScMatrixValue aVal;
+ if (ValidColRowOrReplicated(nC, nR))
{
- SCSIZE nIndex = CalcOffset( nC, nR);
- return GetString( rFormatter, nIndex);
+ matrix_element_t eType = maMat.get_type(nR, nC);
+ switch (eType)
+ {
+ case mdds::element_boolean:
+ aVal.nType = SC_MATVAL_BOOLEAN;
+ aVal.fVal = maMat.get_boolean(nR, nC);
+ break;
+ case mdds::element_numeric:
+ aVal.nType = SC_MATVAL_VALUE;
+ aVal.fVal = maMat.get_numeric(nR, nC);
+ break;
+ case mdds::element_string:
+ aVal.nType = SC_MATVAL_STRING;
+ aVal.pS = maMat.get_string(nR, nC);
+ break;
+ case mdds::element_empty:
+ // Empty path equals empty plus flag.
+ aVal.nType = maMat.get_flag(nR, nC) ? SC_MATVAL_EMPTYPATH : SC_MATVAL_EMPTY;
+ aVal.fVal = 0.0;
+ default:
+ ;
+ }
}
else
{
- DBG_ERRORFILE("ScMatrix::GetString: dimension error");
+ DBG_ERRORFILE("ScMatrixImpl::Get: dimension error");
}
- return String();
+ return aVal;
}
+bool ScMatrixImpl::IsString( SCSIZE nIndex ) const
+{
+ SCSIZE nC, nR;
+ CalcPosition(nIndex, nC, nR);
+ return IsString(nC, nR);
+}
-const ScMatrixValue* ScMatrix::Get(SCSIZE nC, SCSIZE nR, ScMatValType& nType) const
+bool ScMatrixImpl::IsString( SCSIZE nC, SCSIZE nR ) const
{
- if (ValidColRowOrReplicated( nC, nR ))
+ ValidColRowReplicated( nC, nR );
+ switch (maMat.get_type(nR, nC))
{
- SCSIZE nIndex = CalcOffset( nC, nR);
- if (mnValType)
- nType = mnValType[nIndex];
- else
- nType = SC_MATVAL_VALUE;
- return &pMat[nIndex];
+ case mdds::element_empty:
+ case mdds::element_string:
+ return true;
+ default:
+ ;
}
- else
+ return false;
+}
+
+bool ScMatrixImpl::IsEmpty( SCSIZE nC, SCSIZE nR ) const
+{
+ // Flag must be zero for this to be an empty element, instead of being an
+ // empty path element.
+ ValidColRowReplicated( nC, nR );
+ return maMat.get_type(nR, nC) == ::mdds::element_empty && maMat.get_flag(nR, nC) == 0;
+}
+
+bool ScMatrixImpl::IsEmptyPath( SCSIZE nC, SCSIZE nR ) const
+{
+ // 'Empty path' is empty plus non-zero flag.
+ ValidColRowReplicated( nC, nR );
+ return maMat.get_type(nR, nC) == ::mdds::element_empty && maMat.get_flag(nR, nC) != 0;
+}
+
+bool ScMatrixImpl::IsValue( SCSIZE nIndex ) const
+{
+ SCSIZE nC, nR;
+ CalcPosition(nIndex, nC, nR);
+ return IsValue(nC, nR);
+}
+
+bool ScMatrixImpl::IsValue( SCSIZE nC, SCSIZE nR ) const
+{
+ ValidColRowReplicated(nC, nR);
+ switch (maMat.get_type(nR, nC))
{
- DBG_ERRORFILE("ScMatrix::Get: dimension error");
+ case mdds::element_boolean:
+ case mdds::element_numeric:
+ return true;
+ default:
+ ;
}
- nType = SC_MATVAL_EMPTY;
- return NULL;
+ return false;
}
-void ScMatrix::MatCopy(ScMatrix& mRes) const
+bool ScMatrixImpl::IsValueOrEmpty( SCSIZE nC, SCSIZE nR ) const
{
- if (nColCount > mRes.nColCount || nRowCount > mRes.nRowCount)
+ ValidColRowReplicated(nC, nR);
+ switch (maMat.get_type(nR, nC))
{
- DBG_ERRORFILE("ScMatrix::MatCopy: dimension error");
+ case mdds::element_boolean:
+ case mdds::element_numeric:
+ case mdds::element_empty:
+ return true;
+ default:
+ ;
}
- else if ( nColCount == mRes.nColCount && nRowCount == mRes.nRowCount )
+ return false;
+}
+
+bool ScMatrixImpl::IsBoolean( SCSIZE nC, SCSIZE nR ) const
+{
+ ValidColRowReplicated( nC, nR );
+ return maMat.get_type(nR, nC) == ::mdds::element_boolean;
+}
+
+bool ScMatrixImpl::IsNumeric() const
+{
+ return maMat.numeric();
+}
+
+void ScMatrixImpl::MatCopy(ScMatrixImpl& mRes) const
+{
+ MatrixImplType::size_pair_type s1 = maMat.size(), s2 = mRes.maMat.size();
+ if (s1.first > s2.first || s1.second > s2.second)
{
- if (mnValType)
- {
- ScMatValType nType;
- mRes.ResetIsString();
- for (SCSIZE i = 0; i < nColCount; i++)
- {
- SCSIZE nStart = i * nRowCount;
- for (SCSIZE j = 0; j < nRowCount; j++)
- {
- if (IsNonValueType( (nType = mnValType[nStart+j])))
- mRes.PutStringEntry( pMat[nStart+j].pS, nType, nStart+j );
- else
- {
- mRes.pMat[nStart+j].fVal = pMat[nStart+j].fVal;
- mRes.mnValType[nStart+j] = nType;
- }
- }
- }
- }
- else
- {
- mRes.DeleteIsString();
- SCSIZE nCount = nColCount * nRowCount;
- for (SCSIZE i = 0; i < nCount; i++)
- mRes.pMat[i].fVal = pMat[i].fVal;
- }
+ // destination matrix is not large enough.
+ DBG_ERRORFILE("ScMatrixImpl::MatCopy: dimension error");
+ return;
+ }
+
+ mRes.maMat.assign(maMat);
+}
+
+void ScMatrixImpl::MatTrans(ScMatrixImpl& mRes) const
+{
+ mRes.maMat = maMat;
+ mRes.maMat.transpose();
+}
+
+void ScMatrixImpl::FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE nC2, SCSIZE nR2 )
+{
+ if (ValidColRow( nC1, nR1) && ValidColRow( nC2, nR2))
+ {
+ for (SCSIZE i = nR1; i <= nR2; ++i)
+ for (SCSIZE j = nC1; j <= nC2; ++j)
+ maMat.set(i, j, fVal);
}
else
{
- // Copy this matrix to upper left rectangle of result matrix.
- if (mnValType)
- {
- ScMatValType nType;
- mRes.ResetIsString();
- for (SCSIZE i = 0; i < nColCount; i++)
- {
- SCSIZE nStart = i * nRowCount;
- SCSIZE nResStart = i * mRes.nRowCount;
- for (SCSIZE j = 0; j < nRowCount; j++)
- {
- if (IsNonValueType( (nType = mnValType[nStart+j])))
- mRes.PutStringEntry( pMat[nStart+j].pS, nType, nResStart+j );
- else
- {
- mRes.pMat[nResStart+j].fVal = pMat[nStart+j].fVal;
- mRes.mnValType[nResStart+j] = nType;
- }
- }
- }
- }
- else
- {
- mRes.DeleteIsString();
- for (SCSIZE i = 0; i < nColCount; i++)
- {
- SCSIZE nStart = i * nRowCount;
- SCSIZE nResStart = i * mRes.nRowCount;
- for (SCSIZE j = 0; j < nRowCount; j++)
- mRes.pMat[nResStart+j].fVal = pMat[nStart+j].fVal;
- }
- }
+ DBG_ERRORFILE("ScMatrixImpl::FillDouble: dimension error");
}
}
-void ScMatrix::MatTrans(ScMatrix& mRes) const
+void ScMatrixImpl::CompareEqual()
{
- if (nColCount != mRes.nRowCount || nRowCount != mRes.nColCount)
+ compareMatrix<ElemEqual>(maMat);
+}
+
+void ScMatrixImpl::CompareNotEqual()
+{
+ compareMatrix<ElemNotEqual>(maMat);
+}
+
+void ScMatrixImpl::CompareLess()
+{
+ compareMatrix<ElemLess>(maMat);
+}
+
+void ScMatrixImpl::CompareGreater()
+{
+ compareMatrix<ElemGreater>(maMat);
+}
+
+void ScMatrixImpl::CompareLessEqual()
+{
+ compareMatrix<ElemLessEqual>(maMat);
+}
+
+void ScMatrixImpl::CompareGreaterEqual()
+{
+ compareMatrix<ElemGreaterEqual>(maMat);
+}
+
+namespace {
+
+struct AndEvaluator
+{
+ bool isBadElem(double fVal) const { return fVal == 0; }
+ bool returnOnElem() const { return false; }
+ bool returnOnAllElems() const { return true; }
+};
+
+struct OrEvaluator
+{
+ bool isBadElem(double fVal) const { return fVal != 0; }
+ bool returnOnElem() const { return true; }
+ bool returnOnAllElems() const { return false; }
+};
+
+template <typename _Evaluator>
+bool EvalMatrix(const MatrixImplType& rMat)
+{
+ _Evaluator aEval;
+ pair<size_t,size_t> aDim = rMat.size();
+ size_t nRows = aDim.first, nCols = aDim.second;
+ for (size_t i = 0; i < nRows; ++i)
{
- DBG_ERRORFILE("ScMatrix::MatTrans: dimension error");
+ for (size_t j = 0; j < nCols; ++j)
+ {
+ matrix_element_t eType = rMat.get_type(i, j);
+ if (eType != mdds::element_numeric && eType == mdds::element_boolean)
+ // assuming a CompareMat this is an error
+ return CreateDoubleError(errIllegalArgument);
+
+ double fVal = rMat.get_numeric(i, j);
+ if (!::rtl::math::isFinite(fVal))
+ // DoubleError
+ return fVal;
+
+ if (aEval.isBadElem(fVal))
+ return aEval.returnOnElem();
+ }
}
- else
+ return aEval.returnOnAllElems();
+}
+
+}
+
+double ScMatrixImpl::And() const
+{
+ // All elements must be of value type.
+ // True only if all the elements have non-zero values.
+ return EvalMatrix<AndEvaluator>(maMat);
+}
+
+double ScMatrixImpl::Or() const
+{
+ // All elements must be of value type.
+ // True if at least one element has a non-zero value.
+ return EvalMatrix<OrEvaluator>(maMat);
+}
+
+namespace {
+
+/**
+ * Function object to sum all numeric elements (including boolean). It
+ * stores the first non-zero element value into maRes.mfFirst while the rest
+ * into maRes.mfRest. This weird requirement comes from
+ * ScInterpreter::IterateParameters.
+ */
+class SumElements : public unary_function<void, MatrixImplType::element>
+{
+ ScMatrix::IterateResult maRes;
+ bool mbTextAsZero;
+public:
+ SumElements(bool bTextAsZero) : maRes(0.0, 0.0, 0), mbTextAsZero(bTextAsZero) {}
+
+ ScMatrix::IterateResult getResult() const { return maRes; }
+ void operator() (const MatrixImplType::element& elem)
{
- if (mnValType)
+ switch (elem.m_type)
{
- ScMatValType nType;
- mRes.ResetIsString();
- for ( SCSIZE i = 0; i < nColCount; i++ )
- {
- SCSIZE nStart = i * nRowCount;
- for ( SCSIZE j = 0; j < nRowCount; j++ )
+ case mdds::element_boolean:
+ if (elem.m_boolean)
{
- if (IsNonValueType( (nType = mnValType[nStart+j])))
- mRes.PutStringEntry( pMat[nStart+j].pS, nType, j*mRes.nRowCount+i );
+ if (maRes.mfFirst)
+ maRes.mfFirst = 1.0;
else
- {
- mRes.pMat[j*mRes.nRowCount+i].fVal = pMat[nStart+j].fVal;
- mRes.mnValType[j*mRes.nRowCount+i] = nType;
- }
+ maRes.mfRest += 1.0;
}
- }
- }
- else
- {
- mRes.DeleteIsString();
- for ( SCSIZE i = 0; i < nColCount; i++ )
- {
- SCSIZE nStart = i * nRowCount;
- for ( SCSIZE j = 0; j < nRowCount; j++ )
+ ++maRes.mnCount;
+ break;
+ case mdds::element_numeric:
+ if (elem.m_numeric != 0.0)
{
- mRes.pMat[j*mRes.nRowCount+i].fVal = pMat[nStart+j].fVal;
+ if (maRes.mfFirst)
+ maRes.mfFirst = elem.m_numeric;
+ else
+ maRes.mfRest += elem.m_numeric;
}
- }
+ ++maRes.mnCount;
+ break;
+ case mdds::element_string:
+ if (mbTextAsZero)
+ ++maRes.mnCount;
+ default:
+ ;
}
}
-}
+};
-//UNUSED2009-05 void ScMatrix::MatCopyUpperLeft(ScMatrix& mRes) const
-//UNUSED2009-05 {
-//UNUSED2009-05 if (nColCount < mRes.nColCount || nRowCount < mRes.nRowCount)
-//UNUSED2009-05 {
-//UNUSED2009-05 DBG_ERRORFILE("ScMatrix::MatCopyUpperLeft: dimension error");
-//UNUSED2009-05 }
-//UNUSED2009-05 else
-//UNUSED2009-05 {
-//UNUSED2009-05 if (mnValType)
-//UNUSED2009-05 {
-//UNUSED2009-05 ScMatValType nType;
-//UNUSED2009-05 mRes.ResetIsString();
-//UNUSED2009-05 for ( SCSIZE i = 0; i < mRes.nColCount; i++ )
-//UNUSED2009-05 {
-//UNUSED2009-05 SCSIZE nStart = i * nRowCount;
-//UNUSED2009-05 for ( SCSIZE j = 0; j < mRes.nRowCount; j++ )
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( IsNonValueType( (nType = mnValType[nStart+j]) ))
-//UNUSED2009-05 mRes.PutStringEntry( pMat[nStart+j].pS, nType,
-//UNUSED2009-05 i*mRes.nRowCount+j );
-//UNUSED2009-05 else
-//UNUSED2009-05 {
-//UNUSED2009-05 mRes.pMat[i*mRes.nRowCount+j].fVal = pMat[nStart+j].fVal;
-//UNUSED2009-05 mRes.mnValType[i*mRes.nRowCount+j] = nType;
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 else
-//UNUSED2009-05 {
-//UNUSED2009-05 mRes.DeleteIsString();
-//UNUSED2009-05 for ( SCSIZE i = 0; i < mRes.nColCount; i++ )
-//UNUSED2009-05 {
-//UNUSED2009-05 SCSIZE nStart = i * nRowCount;
-//UNUSED2009-05 for ( SCSIZE j = 0; j < mRes.nRowCount; j++ )
-//UNUSED2009-05 {
-//UNUSED2009-05 mRes.pMat[i*mRes.nRowCount+j].fVal = pMat[nStart+j].fVal;
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 }
+class SumSquareElements : public unary_function<void, MatrixImplType::element>
+{
+ ScMatrix::IterateResult maRes;
+ bool mbTextAsZero;
+public:
+ SumSquareElements(bool bTextAsZero) : maRes(0.0, 0.0, 0), mbTextAsZero(bTextAsZero) {}
+ ScMatrix::IterateResult getResult() const { return maRes; }
+ void operator() (const MatrixImplType::element& elem)
+ {
+ if (elem.m_type == ::mdds::element_empty)
+ return;
-void ScMatrix::FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE nC2, SCSIZE nR2 )
+ if (elem.m_type == ::mdds::element_string)
+ {
+ if (mbTextAsZero)
+ ++maRes.mnCount;
+ return;
+ }
+
+ double val = getNumericValue(elem);
+ maRes.mfRest += val*val;
+ ++maRes.mnCount;
+ }
+};
+
+/**
+ * Multiply all boolean and numeric elements. It skips empty elements, and
+ * optionally string elements if specified. When text as zero option is
+ * specified, it treats string elements as if they have values of zero.
+ */
+class MultiplyElements : public unary_function<void, MatrixImplType::element>
{
- if (ValidColRow( nC1, nR1) && ValidColRow( nC2, nR2))
+ ScMatrix::IterateResult maRes;
+ bool mbTextAsZero;
+public:
+ MultiplyElements(bool bTextAsZero) : maRes(0.0, 1.0, 0), mbTextAsZero(bTextAsZero) {}
+ ScMatrix::IterateResult getResult() const { return maRes; }
+
+ void operator() (const MatrixImplType::element& elem)
{
- if ( nC1 == 0 && nR1 == 0 && nC2 == nColCount-1 && nR2 == nRowCount-1 )
+ if (elem.m_type == ::mdds::element_string)
{
- SCSIZE nEnd = nColCount * nRowCount;
- for ( SCSIZE j=0; j<nEnd; j++ )
- pMat[j].fVal = fVal;
+ ++maRes.mnCount;
+ if (mbTextAsZero)
+ maRes.mfRest = 0.0;
}
- else
+ else if (elem.m_type != ::mdds::element_empty)
{
- for ( SCSIZE i=nC1; i<=nC2; i++ )
- {
- SCSIZE nOff1 = i * nRowCount + nR1;
- SCSIZE nOff2 = nOff1 + nR2 - nR1;
- for ( SCSIZE j=nOff1; j<=nOff2; j++ )
- pMat[j].fVal = fVal;
- }
+ ++maRes.mnCount;
+ maRes.mfRest *= getNumericValue(elem);
}
}
- else
+};
+
+/**
+ * Predicate for counting only boolean, numeric, and optionally string
+ * elements.
+ */
+class CountNonEmptyElements : public unary_function<bool, MatrixImplType::element>
+{
+ const bool mbCountString;
+public:
+ CountNonEmptyElements(bool bCountString) : mbCountString(bCountString) {}
+ bool operator() (const MatrixImplType::element& elem) const
{
- DBG_ERRORFILE("ScMatrix::FillDouble: dimension error");
+ switch (elem.m_type)
+ {
+ case mdds::element_boolean:
+ case mdds::element_numeric:
+ return true;
+ case mdds::element_string:
+ return mbCountString;
+ default:
+ ;
+ }
+ return false;
}
+};
+
+}
+
+ScMatrix::IterateResult ScMatrixImpl::Sum(bool bTextAsZero) const
+{
+ return for_each(maMat.begin(), maMat.end(), SumElements(bTextAsZero)).getResult();
+}
+
+ScMatrix::IterateResult ScMatrixImpl::SumSquare(bool bTextAsZero) const
+{
+ return for_each(maMat.begin(), maMat.end(), SumSquareElements(bTextAsZero)).getResult();
+}
+
+ScMatrix::IterateResult ScMatrixImpl::Product(bool bTextAsZero) const
+{
+ return for_each(maMat.begin(), maMat.end(), MultiplyElements(bTextAsZero)).getResult();
+}
+
+size_t ScMatrixImpl::Count(bool bCountStrings) const
+{
+ return count_if(maMat.begin(), maMat.end(), CountNonEmptyElements(bCountStrings));
+}
+
+void ScMatrixImpl::CalcPosition(SCSIZE nIndex, SCSIZE& rC, SCSIZE& rR) const
+{
+ SCSIZE nRowSize = maMat.size().first;
+ rC = nIndex / nRowSize;
+ rR = nIndex - rC*nRowSize;
+}
+
+// ============================================================================
+
+ScMatrix::ScMatrix( SCSIZE nC, SCSIZE nR, DensityType eType) :
+ pImpl(new ScMatrixImpl(nC, nR, eType)),
+ nRefCnt(0)
+{
+}
+ScMatrix::~ScMatrix()
+{
+ delete pImpl;
+}
+
+ScMatrix* ScMatrix::Clone() const
+{
+ return Clone(GetDensityType());
+}
+
+ScMatrix* ScMatrix::Clone( DensityType eType) const
+{
+ SCSIZE nC, nR;
+ pImpl->GetDimensions(nC, nR);
+ ScMatrix* pScMat = new ScMatrix(nC, nR, eType);
+ MatCopy(*pScMat);
+ pScMat->SetErrorInterpreter(pImpl->GetErrorInterpreter()); // TODO: really?
+ return pScMat;
+}
+
+ScMatrix* ScMatrix::CloneIfConst()
+{
+ return pImpl->IsImmutable() ? Clone() : this;
+}
+
+void ScMatrix::SetImmutable( bool bVal )
+{
+ pImpl->SetImmutable(bVal);
+}
+
+void ScMatrix::Resize( SCSIZE nC, SCSIZE nR)
+{
+ pImpl->Resize(nC, nR);
+}
+
+ScMatrix* ScMatrix::CloneAndExtend( SCSIZE nNewCols, SCSIZE nNewRows, DensityType eType ) const
+{
+ ScMatrix* pScMat = new ScMatrix( nNewCols, nNewRows, eType);
+ MatCopy(*pScMat);
+ pScMat->SetErrorInterpreter(pImpl->GetErrorInterpreter());
+ return pScMat;
+}
+
+ScMatrix::DensityType ScMatrix::GetDensityType() const
+{
+ return pImpl->GetDensityType();
+}
+
+void ScMatrix::SetErrorInterpreter( ScInterpreter* p)
+{
+ pImpl->SetErrorInterpreter(p);
+}
+
+void ScMatrix::GetDimensions( SCSIZE& rC, SCSIZE& rR) const
+{
+ pImpl->GetDimensions(rC, rR);
+}
+
+SCSIZE ScMatrix::GetElementCount() const
+{
+ return pImpl->GetElementCount();
+}
+
+bool ScMatrix::ValidColRow( SCSIZE nC, SCSIZE nR) const
+{
+ return pImpl->ValidColRow(nC, nR);
+}
+
+SCSIZE ScMatrix::CalcOffset( SCSIZE nC, SCSIZE nR) const
+{
+ return pImpl->CalcOffset(nC, nR);
+}
+
+bool ScMatrix::ValidColRowReplicated( SCSIZE & rC, SCSIZE & rR ) const
+{
+ return pImpl->ValidColRowReplicated(rC, rR);
+}
+
+bool ScMatrix::ValidColRowOrReplicated( SCSIZE & rC, SCSIZE & rR ) const
+{
+ return ValidColRow( rC, rR) || ValidColRowReplicated( rC, rR);
+}
+
+void ScMatrix::PutDouble(double fVal, SCSIZE nC, SCSIZE nR)
+{
+ pImpl->PutDouble(fVal, nC, nR);
+}
+
+void ScMatrix::PutDouble( double fVal, SCSIZE nIndex)
+{
+ pImpl->PutDouble(fVal, nIndex);
+}
+
+void ScMatrix::PutString(const String& rStr, SCSIZE nC, SCSIZE nR)
+{
+ pImpl->PutString(rStr, nC, nR);
+}
+
+void ScMatrix::PutString(const String& rStr, SCSIZE nIndex)
+{
+ pImpl->PutString(rStr, nIndex);
+}
+
+void ScMatrix::PutEmpty(SCSIZE nC, SCSIZE nR)
+{
+ pImpl->PutEmpty(nC, nR);
+}
+
+void ScMatrix::PutEmptyPath(SCSIZE nC, SCSIZE nR)
+{
+ pImpl->PutEmptyPath(nC, nR);
+}
+
+void ScMatrix::PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR )
+{
+ pImpl->PutError(nErrorCode, nC, nR);
+}
+
+void ScMatrix::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR)
+{
+ pImpl->PutBoolean(bVal, nC, nR);
+}
+
+sal_uInt16 ScMatrix::GetError( SCSIZE nC, SCSIZE nR) const
+{
+ return pImpl->GetError(nC, nR);
+}
+
+double ScMatrix::GetDouble(SCSIZE nC, SCSIZE nR) const
+{
+ return pImpl->GetDouble(nC, nR);
+}
+
+double ScMatrix::GetDouble( SCSIZE nIndex) const
+{
+ return pImpl->GetDouble(nIndex);
+}
+
+const String& ScMatrix::GetString(SCSIZE nC, SCSIZE nR) const
+{
+ return pImpl->GetString(nC, nR);
+}
+
+const String& ScMatrix::GetString( SCSIZE nIndex) const
+{
+ return pImpl->GetString(nIndex);
+}
+
+String ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const
+{
+ return pImpl->GetString(rFormatter, nC, nR);
+}
+
+ScMatrixValue ScMatrix::Get(SCSIZE nC, SCSIZE nR) const
+{
+ return pImpl->Get(nC, nR);
+}
+
+sal_Bool ScMatrix::IsString( SCSIZE nIndex ) const
+{
+ return pImpl->IsString(nIndex);
+}
+
+sal_Bool ScMatrix::IsString( SCSIZE nC, SCSIZE nR ) const
+{
+ return pImpl->IsString(nC, nR);
+}
+
+sal_Bool ScMatrix::IsEmpty( SCSIZE nC, SCSIZE nR ) const
+{
+ return pImpl->IsEmpty(nC, nR);
+}
+
+sal_Bool ScMatrix::IsEmptyPath( SCSIZE nC, SCSIZE nR ) const
+{
+ return pImpl->IsEmptyPath(nC, nR);
+}
+
+sal_Bool ScMatrix::IsValue( SCSIZE nIndex ) const
+{
+ return pImpl->IsValue(nIndex);
+}
+
+sal_Bool ScMatrix::IsValue( SCSIZE nC, SCSIZE nR ) const
+{
+ return pImpl->IsValue(nC, nR);
+}
+
+sal_Bool ScMatrix::IsValueOrEmpty( SCSIZE nC, SCSIZE nR ) const
+{
+ return pImpl->IsValueOrEmpty(nC, nR);
+}
+
+sal_Bool ScMatrix::IsBoolean( SCSIZE nC, SCSIZE nR ) const
+{
+ return pImpl->IsBoolean(nC, nR);
+}
+
+sal_Bool ScMatrix::IsNumeric() const
+{
+ return pImpl->IsNumeric();
+}
+
+void ScMatrix::MatCopy(ScMatrix& mRes) const
+{
+ pImpl->MatCopy(*mRes.pImpl);
+}
+
+void ScMatrix::MatTrans(ScMatrix& mRes) const
+{
+ pImpl->MatTrans(*mRes.pImpl);
+}
+
+void ScMatrix::FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE nC2, SCSIZE nR2 )
+{
+ pImpl->FillDouble(fVal, nC1, nR1, nC2, nR2);
}
void ScMatrix::CompareEqual()
{
- SCSIZE n = nColCount * nRowCount;
- if ( mnValType )
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( IsValueType( mnValType[j]) ) // else: #WERT!
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal == 0.0);
- }
- else
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal == 0.0);
- }
+ pImpl->CompareEqual();
}
void ScMatrix::CompareNotEqual()
{
- SCSIZE n = nColCount * nRowCount;
- if ( mnValType )
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( IsValueType( mnValType[j]) ) // else: #WERT!
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal != 0.0);
- }
- else
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal != 0.0);
- }
+ pImpl->CompareNotEqual();
}
void ScMatrix::CompareLess()
{
- SCSIZE n = nColCount * nRowCount;
- if ( mnValType )
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( IsValueType( mnValType[j]) ) // else: #WERT!
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal < 0.0);
- }
- else
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal < 0.0);
- }
+ pImpl->CompareLess();
}
void ScMatrix::CompareGreater()
{
- SCSIZE n = nColCount * nRowCount;
- if ( mnValType )
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( IsValueType( mnValType[j]) ) // else: #WERT!
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal > 0.0);
- }
- else
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal > 0.0);
- }
+ pImpl->CompareGreater();
}
void ScMatrix::CompareLessEqual()
{
- SCSIZE n = nColCount * nRowCount;
- if ( mnValType )
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( IsValueType( mnValType[j]) ) // else: #WERT!
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal <= 0.0);
- }
- else
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal <= 0.0);
- }
+ pImpl->CompareLessEqual();
}
void ScMatrix::CompareGreaterEqual()
{
- SCSIZE n = nColCount * nRowCount;
- if ( mnValType )
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( IsValueType( mnValType[j]) ) // else: #WERT!
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal >= 0.0);
- }
- else
- {
- for ( SCSIZE j=0; j<n; j++ )
- if ( ::rtl::math::isFinite( pMat[j].fVal)) // else: DoubleError
- pMat[j].fVal = (pMat[j].fVal >= 0.0);
- }
+ pImpl->CompareGreaterEqual();
}
-double ScMatrix::And()
+double ScMatrix::And() const
{
- SCSIZE n = nColCount * nRowCount;
- bool bAnd = true;
- if ( mnValType )
- {
- for ( SCSIZE j=0; bAnd && j<n; j++ )
- {
- if ( !IsValueType( mnValType[j]) )
- { // assuming a CompareMat this is an error
- return CreateDoubleError( errIllegalArgument );
- }
- else if ( ::rtl::math::isFinite( pMat[j].fVal))
- bAnd = (pMat[j].fVal != 0.0);
- else
- return pMat[j].fVal; // DoubleError
- }
- }
- else
- {
- for ( SCSIZE j=0; bAnd && j<n; j++ )
- {
- if ( ::rtl::math::isFinite( pMat[j].fVal))
- bAnd = (pMat[j].fVal != 0.0);
- else
- return pMat[j].fVal; // DoubleError
- }
- }
- return bAnd;
+ return pImpl->And();
}
-double ScMatrix::Or()
+double ScMatrix::Or() const
{
- SCSIZE n = nColCount * nRowCount;
- bool bOr = false;
- if ( mnValType )
- {
- for ( SCSIZE j=0; !bOr && j<n; j++ )
- if ( !IsValueType( mnValType[j]) )
- { // assuming a CompareMat this is an error
- return CreateDoubleError( errIllegalArgument );
- }
- else if ( ::rtl::math::isFinite( pMat[j].fVal))
- bOr = (pMat[j].fVal != 0.0);
- else
- return pMat[j].fVal; // DoubleError
- }
- else
- {
- for ( SCSIZE j=0; !bOr && j<n; j++ )
- if ( ::rtl::math::isFinite( pMat[j].fVal))
- bOr = (pMat[j].fVal != 0.0);
- else
- return pMat[j].fVal; // DoubleError
- }
- return bOr;
+ return pImpl->Or();
+}
+
+ScMatrix::IterateResult ScMatrix::Sum(bool bTextAsZero) const
+{
+ return pImpl->Sum(bTextAsZero);
+}
+
+ScMatrix::IterateResult ScMatrix::SumSquare(bool bTextAsZero) const
+{
+ return pImpl->SumSquare(bTextAsZero);
+}
+
+ScMatrix::IterateResult ScMatrix::Product(bool bTextAsZero) const
+{
+ return pImpl->Product(bTextAsZero);
+}
+
+size_t ScMatrix::Count(bool bCountStrings) const
+{
+ return pImpl->Count(bCountStrings);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/simplerangelist.cxx b/sc/source/core/tool/simplerangelist.cxx
new file mode 100644
index 000000000000..8c3d93dd0e50
--- /dev/null
+++ b/sc/source/core/tool/simplerangelist.cxx
@@ -0,0 +1,243 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * 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_sc.hxx"
+
+
+//------------------------------------------------------------------------
+
+#include "simplerangelist.hxx"
+#include "rangelst.hxx"
+
+using ::std::list;
+using ::std::pair;
+using ::std::max;
+
+// ============================================================================
+
+ScSimpleRangeList::Range::Range(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) :
+ mnCol1(nCol1), mnRow1(nRow1), mnCol2(nCol2), mnRow2(nRow2) {}
+
+bool ScSimpleRangeList::Range::contains(const Range& r) const
+{
+ return mnCol1 <= r.mnCol1 && mnRow1 <= r.mnRow1 && r.mnCol2 <= mnCol2 && r.mnRow2 <= mnRow2;
+}
+
+// ----------------------------------------------------------------------------
+
+ScSimpleRangeList::ScSimpleRangeList()
+{
+}
+
+namespace {
+
+bool maybeJoin(ScSimpleRangeList::Range& rOld, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
+{
+ if (rOld.mnRow1 == nRow1 && rOld.mnRow2 == nRow2)
+ {
+ // Check their column spans to see if they overlap.
+ if (rOld.mnCol1 == nCol1)
+ {
+ // Their share the start column position.
+ rOld.mnCol2 = max(rOld.mnCol2, nCol2);
+ return true;
+ }
+ else if (rOld.mnCol1 < nCol1)
+ {
+ // Old range sits on the left.
+ if (nCol1 - rOld.mnCol2 <= 1)
+ {
+ rOld.mnCol2 = max(rOld.mnCol2, nCol2);
+ return true;
+ }
+ }
+ else if (nCol1 < rOld.mnCol1)
+ {
+ // New range sits on the left.
+ if (nCol1 - rOld.mnCol2 <= 1)
+ {
+ rOld.mnCol1 = nCol1;
+ rOld.mnCol2 = max(rOld.mnCol2, nCol2);
+ return true;
+ }
+ }
+ }
+
+ if (rOld.mnCol1 == nCol1 && rOld.mnCol2 == nCol2)
+ {
+ if (rOld.mnRow1 == nRow1)
+ {
+ // Their share the start row position.
+ rOld.mnRow2 = max(rOld.mnRow2, nRow2);
+ return true;
+ }
+ else if (rOld.mnRow1 < nRow1)
+ {
+ // Old range sits above.
+ if (nRow1 - rOld.mnRow2 <= 1)
+ {
+ rOld.mnRow2 = max(rOld.mnRow2, nRow2);
+ return true;
+ }
+ }
+ else if (nRow1 < rOld.mnRow1)
+ {
+ // New range sits above.
+ if (nRow1 - rOld.mnRow2 <= 1)
+ {
+ rOld.mnRow1 = nRow1;
+ rOld.mnRow2 = max(rOld.mnRow2, nRow2);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+}
+
+void ScSimpleRangeList::addRange(const ScRange& rRange)
+{
+ SCCOL nCol1 = rRange.aStart.Col();
+ SCROW nRow1 = rRange.aStart.Row();
+ SCTAB nTab1 = rRange.aStart.Tab();
+ SCCOL nCol2 = rRange.aEnd.Col();
+ SCROW nRow2 = rRange.aEnd.Row();
+ SCTAB nTab2 = rRange.aEnd.Tab();
+
+ for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab)
+ {
+ RangeListRef pRef = findTab(nTab);
+ if (!pRef)
+ // This should never happen!
+ return;
+
+ if (pRef->empty() || !maybeJoin(pRef->back(), nCol1, nRow1, nCol2, nRow2))
+ // Not joinable. Append it to the list.
+ pRef->push_back(Range(nCol1, nRow1, nCol2, nRow2));
+ }
+}
+
+void ScSimpleRangeList::insertCol(SCCOL nCol, SCTAB nTab)
+{
+ RangeListRef pRef = findTab(nTab);
+ if (!pRef)
+ // This should never happen!
+ return;
+
+ list<Range>::iterator itr = pRef->begin(), itrEnd = pRef->end();
+ for (; itr != itrEnd; ++itr)
+ {
+ Range& r = *itr;
+ if (r.mnCol2 < nCol)
+ // insertion point to the right of the range.
+ continue;
+
+ if (nCol <= r.mnCol1)
+ {
+ // insertion point to the left of the range.
+ ++r.mnCol1;
+ ++r.mnCol2;
+ }
+ else if (nCol <= r.mnCol2)
+ {
+ // insertion point cuts through the range.
+ ++r.mnCol2;
+ }
+ }
+}
+
+void ScSimpleRangeList::insertRow(SCROW nRow, SCTAB nTab)
+{
+ RangeListRef pRef = findTab(nTab);
+ if (!pRef)
+ // This should never happen!
+ return;
+
+ list<Range>::iterator itr = pRef->begin(), itrEnd = pRef->end();
+ for (; itr != itrEnd; ++itr)
+ {
+ Range& r = *itr;
+ if (r.mnRow2 < nRow)
+ // insertion point is below the range.
+ continue;
+
+ if (nRow <= r.mnRow1)
+ {
+ // insertion point is above the range.
+ ++r.mnRow1;
+ ++r.mnRow2;
+ }
+ else if (nRow <= r.mnRow2)
+ {
+ // insertion point cuts through the range.
+ ++r.mnRow2;
+ }
+ }
+}
+
+void ScSimpleRangeList::getRangeList(list<ScRange>& rList) const
+{
+ list<ScRange> aList;
+ for (TabType::const_iterator itrTab = maTabs.begin(), itrTabEnd = maTabs.end(); itrTab != itrTabEnd; ++itrTab)
+ {
+ SCTAB nTab = itrTab->first;
+ const RangeListRef& pRanges = itrTab->second;
+ list<Range>::const_iterator itr = pRanges->begin(), itrEnd = pRanges->end();
+ for (; itr != itrEnd; ++itr)
+ {
+ const Range& r = *itr;
+ aList.push_back(ScRange(r.mnCol1, r.mnRow1, nTab, r.mnCol2, r.mnRow2, nTab));
+ }
+ }
+ rList.swap(aList);
+}
+
+void ScSimpleRangeList::clear()
+{
+ maTabs.clear();
+}
+
+ScSimpleRangeList::RangeListRef ScSimpleRangeList::findTab(SCTAB nTab)
+{
+ TabType::iterator itr = maTabs.find(nTab);
+ if (itr == maTabs.end())
+ {
+ RangeListRef p(new list<Range>);
+ pair<TabType::iterator, bool> r = maTabs.insert(TabType::value_type(nTab, p));
+ if (!r.second)
+ return RangeListRef();
+ itr = r.first;
+ }
+
+ return itr->second;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 28a4bc6755c2..2a3f4cc62c96 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: table.hxx,v $
- * $Revision: 1.35 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -40,6 +38,15 @@
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
+ScSetStringParam::ScSetStringParam() :
+ mpNumFormatter(NULL),
+ mbDetectNumberFormat(true),
+ mbSetTextCellFormat(false)
+{
+}
+
+// ============================================================================-
+
bool ScStringUtil::parseSimpleNumber(
const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal)
{
@@ -48,14 +55,41 @@ bool ScStringUtil::parseSimpleNumber(
gsep = 0x0020;
OUStringBuffer aBuf;
+
+ sal_Int32 i = 0;
sal_Int32 n = rStr.getLength();
const sal_Unicode* p = rStr.getStr();
+ const sal_Unicode* pLast = p + (n-1);
sal_Int32 nPosDSep = -1, nPosGSep = -1;
sal_uInt32 nDigitCount = 0;
- for (sal_Int32 i = 0; i < n; ++i)
+ // Skip preceding spaces.
+ for (i = 0; i < n; ++i, ++p)
+ {
+ sal_Unicode c = *p;
+ if (c != 0x0020 && c != 0x00A0)
+ // first non-space character. Exit.
+ break;
+ }
+
+ if (i == n)
+ // the whole string is space. Fail.
+ return false;
+
+ n -= i; // Subtract the length of the preceding spaces.
+
+ // Determine the last non-space character.
+ for (; p != pLast; --pLast, --n)
{
- sal_Unicode c = p[i];
+ sal_Unicode c = *pLast;
+ if (c != 0x0020 && c != 0x00A0)
+ // Non space character. Exit.
+ break;
+ }
+
+ for (i = 0; i < n; ++i, ++p)
+ {
+ sal_Unicode c = *p;
if (c == 0x00A0)
// unicode space to ascii space
c = 0x0020;
@@ -129,3 +163,5 @@ bool ScStringUtil::parseSimpleNumber(
return true;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/subtotal.cxx b/sc/source/core/tool/subtotal.cxx
index dbcfc6b24b78..e1c1b607a908 100644
--- a/sc/source/core/tool/subtotal.cxx
+++ b/sc/source/core/tool/subtotal.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,7 @@ sal_Bool SubTotal::SafePlus(double& fVal1, double fVal2)
fVal1 += fVal2;
if (!::rtl::math::isFinite(fVal1))
{
- bOk = sal_False;
+ bOk = false;
if (fVal2 > 0.0)
fVal1 = DBL_MAX;
else
@@ -60,7 +61,7 @@ sal_Bool SubTotal::SafeMult(double& fVal1, double fVal2)
fVal1 *= fVal2;
if (!::rtl::math::isFinite(fVal1))
{
- bOk = sal_False;
+ bOk = false;
fVal1 = DBL_MAX;
}
return bOk;
@@ -74,8 +75,10 @@ sal_Bool SubTotal::SafeDiv(double& fVal1, double fVal2)
fVal1 /= fVal2;
if (!::rtl::math::isFinite(fVal1))
{
- bOk = sal_False;
+ bOk = false;
fVal1 = DBL_MAX;
}
return bOk;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index a270969e100c..9ddb3509ad81 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,11 +33,7 @@
// INCLUDE ---------------------------------------------------------------
-#if STLPORT_VERSION<321
-#include <stddef.h>
-#else
#include <cstddef>
-#endif
#include <cstdio>
#include <string.h>
@@ -108,10 +105,6 @@ namespace
}
//
} // namespace
-//
-// ImpTokenIterator wird je Interpreter angelegt, mehrfache auch durch
-// SubCode via FormulaTokenIterator Push/Pop moeglich
-IMPL_FIXEDMEMPOOL_NEWDEL( ImpTokenIterator, 32, 16 )
// Align MemPools on 4k boundaries - 64 bytes (4k is a MUST for OS/2)
@@ -240,7 +233,7 @@ void ScRawToken::SetName( sal_uInt16 n )
void ScRawToken::SetExternalSingleRef( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef )
{
- eOp = ocExternalRef;
+ eOp = ocPush;
eType = svExternalSingleRef;
nRefCnt = 0;
@@ -255,7 +248,7 @@ void ScRawToken::SetExternalSingleRef( sal_uInt16 nFileId, const String& rTabNam
void ScRawToken::SetExternalDoubleRef( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef )
{
- eOp = ocExternalRef;
+ eOp = ocPush;
eType = svExternalDoubleRef;
nRefCnt = 0;
@@ -269,7 +262,7 @@ void ScRawToken::SetExternalDoubleRef( sal_uInt16 nFileId, const String& rTabNam
void ScRawToken::SetExternalName( sal_uInt16 nFileId, const String& rName )
{
- eOp = ocExternalRef;
+ eOp = ocPush;
eType = svExternalName;
nRefCnt = 0;
@@ -280,35 +273,7 @@ void ScRawToken::SetExternalName( sal_uInt16 nFileId, const String& rName )
extname.cName[n] = 0;
}
-//UNUSED2008-05 void ScRawToken::SetInt(int rVal)
-//UNUSED2008-05 {
-//UNUSED2008-05 eOp = ocPush;
-//UNUSED2008-05 eType = svDouble;
-//UNUSED2008-05 nValue = (double)rVal;
-//UNUSED2008-05 nRefCnt = 0;
-//UNUSED2008-05
-//UNUSED2008-05 }
-//UNUSED2008-05 void ScRawToken::SetMatrix( ScMatrix* p )
-//UNUSED2008-05 {
-//UNUSED2008-05 eOp = ocPush;
-//UNUSED2008-05 eType = svMatrix;
-//UNUSED2008-05 pMat = p;
-//UNUSED2008-05 nRefCnt = 0;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 ScComplexRefData& ScRawToken::GetReference()
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ASSERT( lcl_IsReference( eOp, GetType() ), "GetReference: no Ref" );
-//UNUSED2008-05 return aRef;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void ScRawToken::SetReference( ScComplexRefData& rRef )
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ASSERT( lcl_IsReference( eOp, GetType() ), "SetReference: no Ref" );
-//UNUSED2008-05 aRef = rRef;
-//UNUSED2008-05 if( GetType() == svSingleRef )
-//UNUSED2008-05 aRef.Ref2 = aRef.Ref1;
-//UNUSED2008-05 }
+
void ScRawToken::SetExternal( const sal_Unicode* pStr )
{
@@ -347,44 +312,33 @@ ScRawToken* ScRawToken::Clone() const
static sal_uInt16 nOffset = lcl_ScRawTokenOffset(); // offset of sbyte
sal_uInt16 n = nOffset;
- if (eOp == ocExternalRef)
+ switch( eType )
{
- switch (eType)
- {
- case svExternalSingleRef:
- case svExternalDoubleRef: n += sizeof(extref); break;
- case svExternalName: n += sizeof(extname); break;
- default:
- {
- DBG_ERROR1( "unknown ScRawToken::Clone() external type %d", int(eType));
- }
- }
- }
- else
- {
- switch( eType )
+ case svSep: break;
+ case svByte: n += sizeof(ScRawToken::sbyte); break;
+ case svDouble: n += sizeof(double); break;
+ case svString: n = sal::static_int_cast<sal_uInt16>( n + GetStrLenBytes( cStr ) + GetStrLenBytes( 1 ) ); break;
+ case svSingleRef:
+ case svDoubleRef: n += sizeof(aRef); break;
+ case svMatrix: n += sizeof(ScMatrix*); break;
+ case svIndex: n += sizeof(sal_uInt16); break;
+ case svJump: n += nJump[ 0 ] * 2 + 2; break;
+ case svExternal: n = sal::static_int_cast<sal_uInt16>( n + GetStrLenBytes( cStr+1 ) + GetStrLenBytes( 2 ) ); break;
+
+ // external references
+ case svExternalSingleRef:
+ case svExternalDoubleRef: n += sizeof(extref); break;
+ case svExternalName: n += sizeof(extname); break;
+ default:
{
- case svSep: break;
- case svByte: n += sizeof(ScRawToken::sbyte); break;
- case svDouble: n += sizeof(double); break;
- case svString: n = sal::static_int_cast<sal_uInt16>( n + GetStrLenBytes( cStr ) + GetStrLenBytes( 1 ) ); break;
- case svSingleRef:
- case svDoubleRef: n += sizeof(aRef); break;
- case svMatrix: n += sizeof(ScMatrix*); break;
- case svIndex: n += sizeof(sal_uInt16); break;
- case svJump: n += nJump[ 0 ] * 2 + 2; break;
- case svExternal: n = sal::static_int_cast<sal_uInt16>( n + GetStrLenBytes( cStr+1 ) + GetStrLenBytes( 2 ) ); break;
- default:
- {
- DBG_ERROR1( "unknown ScRawToken::Clone() type %d", int(eType));
- }
+ DBG_ERROR1( "unknown ScRawToken::Clone() type %d", int(eType));
}
}
p = (ScRawToken*) new sal_uInt8[ n ];
memcpy( p, this, n * sizeof(sal_uInt8) );
}
p->nRefCnt = 0;
- p->bRaw = sal_False;
+ p->bRaw = false;
return p;
}
@@ -508,7 +462,7 @@ sal_Bool ScToken::TextEqual( const FormulaToken& _rToken ) const
// in relative Refs only compare relative parts
if ( eType != _rToken.GetType() || GetOpCode() != _rToken.GetOpCode() )
- return sal_False;
+ return false;
const ScToken& rToken = static_cast<const ScToken&>(_rToken);
ScComplexRefData aTemp1;
@@ -566,10 +520,9 @@ sal_Bool ScToken::Is3DRef() const
// added to avoid warnings
}
}
- return sal_False;
+ return false;
}
-// static
FormulaTokenRef ScToken::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2,
const ScAddress & rPos, bool bReuseDoubleRef )
{
@@ -831,8 +784,8 @@ sal_Bool ScRefListToken::operator==( const FormulaToken& r ) const
}
-const ScMatrix* ScMatrixToken::GetMatrix() const { return pMatrix; }
-ScMatrix* ScMatrixToken::GetMatrix() { return pMatrix; }
+const ScMatrix* ScMatrixToken::GetMatrix() const { return pMatrix.get(); }
+ScMatrix* ScMatrixToken::GetMatrix() { return pMatrix.get(); }
sal_Bool ScMatrixToken::operator==( const FormulaToken& r ) const
{
return FormulaToken::operator==( r ) && pMatrix == static_cast<const ScToken&>(r).GetMatrix();
@@ -841,7 +794,7 @@ sal_Bool ScMatrixToken::operator==( const FormulaToken& r ) const
// ============================================================================
ScExternalSingleRefToken::ScExternalSingleRefToken( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& r ) :
- ScToken( svExternalSingleRef, ocExternalRef),
+ ScToken( svExternalSingleRef, ocPush),
mnFileId(nFileId),
maTabName(rTabName),
maSingleRef(r)
@@ -907,7 +860,7 @@ sal_Bool ScExternalSingleRefToken::operator ==( const FormulaToken& r ) const
// ============================================================================
ScExternalDoubleRefToken::ScExternalDoubleRefToken( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& r ) :
- ScToken( svExternalDoubleRef, ocExternalRef),
+ ScToken( svExternalDoubleRef, ocPush),
mnFileId(nFileId),
maTabName(rTabName),
maDoubleRef(r)
@@ -993,7 +946,7 @@ sal_Bool ScExternalDoubleRefToken::operator ==( const FormulaToken& r ) const
// ============================================================================
ScExternalNameToken::ScExternalNameToken( sal_uInt16 nFileId, const String& rName ) :
- ScToken( svExternalName, ocExternalRef),
+ ScToken( svExternalName, ocPush),
mnFileId(nFileId),
maName(rName)
{
@@ -1069,7 +1022,7 @@ sal_Bool ScEmptyCellToken::operator==( const FormulaToken& r ) const
double ScMatrixCellResultToken::GetDouble() const { return xUpperLeft->GetDouble(); }
const String & ScMatrixCellResultToken::GetString() const { return xUpperLeft->GetString(); }
-const ScMatrix* ScMatrixCellResultToken::GetMatrix() const { return xMatrix; }
+const ScMatrix* ScMatrixCellResultToken::GetMatrix() const { return xMatrix.get(); }
// Non-const GetMatrix() is private and unused but must be implemented to
// satisfy vtable linkage.
ScMatrix* ScMatrixCellResultToken::GetMatrix()
@@ -1272,7 +1225,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
}
sal_Bool ScTokenArray::ImplGetReference( ScRange& rRange, sal_Bool bValidOnly ) const
{
- sal_Bool bIs = sal_False;
+ sal_Bool bIs = false;
if ( pCode && nLen == 1 )
{
const FormulaToken* pToken = pCode[0];
@@ -1300,7 +1253,7 @@ sal_Bool ScTokenArray::ImplGetReference( ScRange& rRange, sal_Bool bValidOnly )
sal_Bool ScTokenArray::IsReference( ScRange& rRange ) const
{
- return ImplGetReference( rRange, sal_False );
+ return ImplGetReference( rRange, false );
}
sal_Bool ScTokenArray::IsValidReference( ScRange& rRange ) const
@@ -1516,8 +1469,6 @@ FormulaToken* ScTokenArray::MergeArray( )
if( nCol <= 0 || nRow <= 0 )
return NULL;
- // fprintf (stderr, "Array (cols = %d, rows = %d)\n", nCol, nRow );
-
int nSign = 1;
ScMatrix* pArray = new ScMatrix( nCol, nRow );
for ( i = nStart, nCol = 0, nRow = 0 ; i < nLen ; i++ )
@@ -1593,7 +1544,7 @@ FormulaToken* ScTokenArray::MergeRangeReference( const ScAddress & rPos )
p2->DecRef();
p3->DecRef();
nLen -= 2;
- pCode[ nLen-1 ] = p;
+ pCode[ nLen-1 ] = p.get();
nRefs--;
}
}
@@ -1622,7 +1573,7 @@ FormulaToken* ScTokenArray::AddDoubleReference( const ScComplexRefData& rRef )
return Add( new ScDoubleRefToken( rRef ) );
}
-FormulaToken* ScTokenArray::AddMatrix( ScMatrix* p )
+FormulaToken* ScTokenArray::AddMatrix( const ScMatrixRef& p )
{
return Add( new ScMatrixToken( p ) );
}
@@ -1658,29 +1609,29 @@ sal_Bool ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend,
if ( rPos.Row() < MAXROW )
nRow = (nExtend = rPos.Row()) + 1;
else
- return sal_False;
+ return false;
break;
case DIR_RIGHT :
if ( rPos.Col() < MAXCOL )
nCol = static_cast<SCCOL>(nExtend = rPos.Col()) + 1;
else
- return sal_False;
+ return false;
break;
case DIR_TOP :
if ( rPos.Row() > 0 )
nRow = (nExtend = rPos.Row()) - 1;
else
- return sal_False;
+ return false;
break;
case DIR_LEFT :
if ( rPos.Col() > 0 )
nCol = static_cast<SCCOL>(nExtend = rPos.Col()) - 1;
else
- return sal_False;
+ return false;
break;
default:
DBG_ERRORFILE( "unknown Direction" );
- return sal_False;
+ return false;
}
if ( pRPN && nRPN )
{
@@ -1690,7 +1641,7 @@ sal_Bool ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend,
sal_uInt8 nParamCount = t->GetByte();
if ( nParamCount && nRPN > nParamCount )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
sal_uInt16 nParam = nRPN - nParamCount - 1;
for ( ; nParam < nRPN-1; nParam++ )
{
@@ -1793,7 +1744,7 @@ sal_Bool ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend,
}
}
}
- return sal_False;
+ return false;
}
@@ -1834,3 +1785,4 @@ void ScTokenArray::ReadjustRelative3DReferences( const ScAddress& rOldPos,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/unitconv.cxx b/sc/source/core/tool/unitconv.cxx
index 9b4a7ef772d0..90f30cd6774c 100644
--- a/sc/source/core/tool/unitconv.cxx
+++ b/sc/source/core/tool/unitconv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,9 +39,10 @@
#include "viewopti.hxx" //! move ScLinkConfigItem to separate header!
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
// --------------------------------------------------------------------
const sal_Unicode cDelim = 0x01; // Delimiter zwischen From und To
@@ -74,7 +76,6 @@ ScDataObject* ScUnitConverterData::Clone() const
}
-// static
void ScUnitConverterData::BuildIndexString( String& rStr,
const String& rFromUnit, const String& rToUnit )
{
@@ -103,12 +104,12 @@ void ScUnitConverterData::BuildIndexString( String& rStr,
#define CFGSTR_UNIT_FACTOR "Factor"
ScUnitConverter::ScUnitConverter( sal_uInt16 nInit, sal_uInt16 nDeltaP ) :
- ScStrCollection( nInit, nDeltaP, sal_False )
+ ScStrCollection( nInit, nDeltaP, false )
{
// read from configuration - "convert.ini" is no longer used
//! config item as member to allow change of values
- ScLinkConfigItem aConfigItem( OUString::createFromAscii( CFGPATH_UNIT ) );
+ ScLinkConfigItem aConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_UNIT )) );
// empty node name -> use the config item's path itself
OUString aEmptyString;
@@ -129,11 +130,11 @@ ScUnitConverter::ScUnitConverter( sal_uInt16 nInit, sal_uInt16 nDeltaP ) :
sPrefix += sSlash;
pValNameArray[nIndex] = sPrefix;
- pValNameArray[nIndex++] += OUString::createFromAscii( CFGSTR_UNIT_FROM );
+ pValNameArray[nIndex++] += OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_UNIT_FROM ));
pValNameArray[nIndex] = sPrefix;
- pValNameArray[nIndex++] += OUString::createFromAscii( CFGSTR_UNIT_TO );
+ pValNameArray[nIndex++] += OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_UNIT_TO ));
pValNameArray[nIndex] = sPrefix;
- pValNameArray[nIndex++] += OUString::createFromAscii( CFGSTR_UNIT_FACTOR );
+ pValNameArray[nIndex++] += OUString(RTL_CONSTASCII_USTRINGPARAM( CFGSTR_UNIT_FACTOR ));
}
Sequence<Any> aProperties = aConfigItem.GetProperties(aValNames);
@@ -172,7 +173,8 @@ sal_Bool ScUnitConverter::GetValue( double& fValue, const String& rFromUnit,
return sal_True;
}
fValue = 1.0;
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index a107599a9960..6e96b85ee00c 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,7 +78,7 @@ ScUserListData::ScUserListData(const ScUserListData& rData) :
InitTokens();
}
-__EXPORT ScUserListData::~ScUserListData()
+ScUserListData::~ScUserListData()
{
delete[] pSubStrings;
delete[] pUpperSub;
@@ -116,7 +117,7 @@ sal_Bool ScUserListData::GetSubIndex(const String& rSubStr, sal_uInt16& rIndex)
return sal_True;
}
- return sal_False;
+ return false;
}
String ScUserListData::GetSubStr(sal_uInt16 nIndex) const
@@ -292,6 +293,7 @@ sal_Bool ScUserList::HasEntry( const String& rStr ) const
if ( pMyData->aStr == rStr )
return sal_True;
}
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 29854e1fd549..fdf8c8581d26 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,9 +46,10 @@
#include "miscuno.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
//------------------------------------------------------------------
TYPEINIT1(ScTpViewItem, SfxPoolItem);
@@ -140,7 +142,7 @@ ScViewOptions::ScViewOptions( const ScViewOptions& rCpy )
//------------------------------------------------------------------------
-__EXPORT ScViewOptions::~ScViewOptions()
+ScViewOptions::~ScViewOptions()
{
}
@@ -151,7 +153,7 @@ void ScViewOptions::SetDefaults()
aOptArr[ VOPT_FORMULAS ] =
aOptArr[ VOPT_SYNTAX ] =
aOptArr[ VOPT_HELPLINES ] =
- aOptArr[ VOPT_BIGHANDLES ] = sal_False;
+ aOptArr[ VOPT_BIGHANDLES ] = false;
aOptArr[ VOPT_NOTES ] =
aOptArr[ VOPT_NULLVALS ] =
aOptArr[ VOPT_VSCROLL ] =
@@ -242,10 +244,6 @@ SvxGridItem* ScViewOptions::CreateGridItem( sal_uInt16 nId /* = SID_ATTR_GRID_OP
// ScTpViewItem - Daten fuer die ViewOptions-TabPage
//========================================================================
-//UNUSED2008-05 ScTpViewItem::ScTpViewItem( sal_uInt16 nWhichP ) : SfxPoolItem( nWhichP )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
//------------------------------------------------------------------------
ScTpViewItem::ScTpViewItem( sal_uInt16 nWhichP, const ScViewOptions& rOpt )
@@ -264,20 +262,20 @@ ScTpViewItem::ScTpViewItem( const ScTpViewItem& rItem )
//------------------------------------------------------------------------
-__EXPORT ScTpViewItem::~ScTpViewItem()
+ScTpViewItem::~ScTpViewItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScTpViewItem::GetValueText() const
+String ScTpViewItem::GetValueText() const
{
return String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("ScTpViewItem") );
}
//------------------------------------------------------------------------
-int __EXPORT ScTpViewItem::operator==( const SfxPoolItem& rItem ) const
+int ScTpViewItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -288,7 +286,7 @@ int __EXPORT ScTpViewItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScTpViewItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScTpViewItem::Clone( SfxItemPool * ) const
{
return new ScTpViewItem( *this );
}
@@ -409,10 +407,10 @@ Sequence<OUString> ScViewCfg::GetGridPropertyNames()
// adjust for metric system
if (ScOptionsUtil::IsMetricSystem())
{
- pNames[SCGRIDOPT_RESOLU_X] = OUString::createFromAscii( "Resolution/XAxis/Metric" );
- pNames[SCGRIDOPT_RESOLU_Y] = OUString::createFromAscii( "Resolution/YAxis/Metric" );
- pNames[SCGRIDOPT_OPTION_X] = OUString::createFromAscii( "Option/XAxis/Metric" );
- pNames[SCGRIDOPT_OPTION_Y] = OUString::createFromAscii( "Option/YAxis/Metric" );
+ pNames[SCGRIDOPT_RESOLU_X] = OUString(RTL_CONSTASCII_USTRINGPARAM( "Resolution/XAxis/Metric" ));
+ pNames[SCGRIDOPT_RESOLU_Y] = OUString(RTL_CONSTASCII_USTRINGPARAM( "Resolution/YAxis/Metric" ));
+ pNames[SCGRIDOPT_OPTION_X] = OUString(RTL_CONSTASCII_USTRINGPARAM( "Option/XAxis/Metric" ));
+ pNames[SCGRIDOPT_OPTION_Y] = OUString(RTL_CONSTASCII_USTRINGPARAM( "Option/YAxis/Metric" ));
}
return aNames;
@@ -420,9 +418,9 @@ Sequence<OUString> ScViewCfg::GetGridPropertyNames()
ScViewCfg::ScViewCfg() :
- aLayoutItem( OUString::createFromAscii( CFGPATH_LAYOUT ) ),
- aDisplayItem( OUString::createFromAscii( CFGPATH_DISPLAY ) ),
- aGridItem( OUString::createFromAscii( CFGPATH_GRID ) )
+ aLayoutItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_LAYOUT )) ),
+ aDisplayItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_DISPLAY )) ),
+ aGridItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_GRID )) )
{
sal_Int32 nIntVal = 0;
@@ -752,3 +750,4 @@ void ScViewCfg::SetOptions( const ScViewOptions& rNew )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx
index b751b6ef56db..9fd1b6f9ed36 100644
--- a/sc/source/core/tool/zforauto.cxx
+++ b/sc/source/core/tool/zforauto.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@
#include "zforauto.hxx"
#include "global.hxx"
-static const sal_Char __FAR_DATA pStandardName[] = "Standard";
+static const sal_Char pStandardName[] = "Standard";
//------------------------------------------------------------------------
@@ -89,7 +90,7 @@ void ScNumFormatAbbrev::PutFormatIndex(sal_uLong nFormat,
}
else
{
- DBG_ERROR("SCNumFormatAbbrev:: unbekanntes Zahlformat");
+ OSL_FAIL("SCNumFormatAbbrev:: unbekanntes Zahlformat");
eLnge = LANGUAGE_SYSTEM;
eSysLnge = LANGUAGE_GERMAN; // sonst passt "Standard" nicht
sFormatstring.AssignAscii( RTL_CONSTASCII_STRINGPARAM( pStandardName ) );
@@ -104,3 +105,5 @@ sal_uLong ScNumFormatAbbrev::GetFormatIndex( SvNumberFormatter& rFormatter)
return rFormatter.GetIndexPuttingAndConverting( sFormatstring, eLnge,
eSysLnge, nType, bNewInserted, nCheckPos);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/dif/difexp.cxx b/sc/source/filter/dif/difexp.cxx
index 2b393dd58703..9ebf05f31080 100644
--- a/sc/source/filter/dif/difexp.cxx
+++ b/sc/source/filter/dif/difexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,7 +80,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
rOut.StartWritingUnicodeText();
- bContextOrNotAsciiEncoding = sal_False;
+ bContextOrNotAsciiEncoding = false;
}
else
{
@@ -95,7 +96,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
aStrDelimDecoded = String( aStrDelimEncoded, eCharSet );
}
else
- bContextOrNotAsciiEncoding = sal_False;
+ bContextOrNotAsciiEncoding = false;
}
const sal_Char* p2DoubleQuotes_LF = "\"\"\n";
@@ -315,3 +316,4 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index fc17f1b6dda5..18d0c532fff9 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,23 +29,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-//------------------------------------------------------------------------
+#include <math.h>
-#include "scitems.hxx"
#include <svl/zforlist.hxx>
+#include <tools/debug.hxx>
+#include "attrib.hxx"
+#include "cell.hxx"
#include "dif.hxx"
+#include "docpool.hxx"
+#include "document.hxx"
#include "filter.hxx"
#include "fprogressbar.hxx"
-#include "scerrors.hxx"
-#include "document.hxx"
-#include "cell.hxx"
-#include "patattr.hxx"
-#include "docpool.hxx"
-#include "attrib.hxx"
#include "ftools.hxx"
-
-#include <math.h>
+#include "patattr.hxx"
+#include "scerrors.hxx"
+#include "scitems.hxx"
const sal_Unicode pKeyTABLE[] = { 'T', 'A', 'B', 'L', 'E', 0 };
const sal_Unicode pKeyVECTORS[] = { 'V', 'E', 'C', 'T', 'O', 'R', 'S', 0 };
@@ -70,14 +70,11 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc,
SCTAB nBaseTab = rInsPos.Tab();
TOPIC eTopic = T_UNKNOWN;
- sal_Bool bSyntErrWarn = sal_False;
- sal_Bool bOverflowWarn = sal_False;
+ sal_Bool bSyntErrWarn = false;
+ sal_Bool bOverflowWarn = false;
String& rData = aDifParser.aData;
- sal_Bool bData = sal_False;
-
- SCCOL nNumCols = 0;
- SCROW nNumRows = 0;
+ sal_Bool bData = false;
rIn.Seek( 0 );
@@ -104,21 +101,13 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc,
case T_VECTORS:
{
if( aDifParser.nVector != 0 )
- bSyntErrWarn = sal_True;
- if( aDifParser.nVal > MAXCOL + 1 )
- nNumCols = SCCOL_MAX;
- else
- nNumCols = static_cast<SCCOL>(aDifParser.nVal);
+ bSyntErrWarn = true;
}
break;
case T_TUPLES:
{
if( aDifParser.nVector != 0 )
- bSyntErrWarn = sal_True;
- if( aDifParser.nVal > MAXROW + 1 )
- nNumRows = SCROW_MAX;
- else
- nNumRows = static_cast<SCROW>(aDifParser.nVal);
+ bSyntErrWarn = true;
}
break;
case T_DATA:
@@ -233,7 +222,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc,
case D_SYNT_ERROR:
break;
default:
- DBG_ERROR( "ScImportDif - missing enum" );
+ OSL_FAIL( "ScImportDif - missing enum" );
}
}
@@ -355,14 +344,14 @@ TOPIC DifParser::GetNextTopic( void )
if( aLine == pRef )
{
eRet = pTopics[ nCnt ];
- bSearch = sal_False;
+ bSearch = false;
}
else
{
nCnt++;
pRef = ppKeys[ nCnt ];
if( !*pRef )
- bSearch = sal_False;
+ bSearch = false;
}
}
@@ -658,15 +647,15 @@ const sal_Unicode* DifParser::ScanIntVal( const sal_Unicode* pStart, sal_uInt32&
sal_Bool DifParser::ScanFloatVal( const sal_Unicode* pStart )
{
double fNewVal = 0.0;
- sal_Bool bNeg = sal_False;
+ sal_Bool bNeg = false;
double fFracPos = 1.0;
sal_Int32 nExp = 0;
- sal_Bool bExpNeg = sal_False;
- sal_Bool bExpOverflow = sal_False;
+ sal_Bool bExpNeg = false;
+ sal_Bool bExpOverflow = false;
static const sal_uInt16 nExpLimit = 4096; // ACHTUNG: muss genauer ermittelt werden!
sal_Unicode cAkt;
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
enum STATE { S_FIRST, S_PRE, S_POST, S_EXP_FIRST, S_EXP, S_END, S_FINDEND };
@@ -817,7 +806,7 @@ sal_Bool DifParser::ScanFloatVal( const sal_Unicode* pStart )
if( bRet )
{
if( bExpOverflow )
- return sal_False; // ACHTUNG: hier muss noch differenziert werden
+ return false; // ACHTUNG: hier muss noch differenziert werden
if( bNeg )
fNewVal *= 1.0;
@@ -833,19 +822,11 @@ sal_Bool DifParser::ScanFloatVal( const sal_Unicode* pStart )
return bRet;
}
-
-DifColumn::~DifColumn( void )
+DifColumn::DifColumn ()
+ : pAkt(NULL)
{
- ENTRY* pEntry = ( ENTRY* ) List::First();
-
- while( pEntry )
- {
- delete pEntry;
- pEntry = ( ENTRY* ) List::Next();
- }
}
-
void DifColumn::SetLogical( SCROW nRow )
{
DBG_ASSERT( ValidRow(nRow), "*DifColumn::SetLogical(): Row zu gross!" );
@@ -853,7 +834,9 @@ void DifColumn::SetLogical( SCROW nRow )
if( pAkt )
{
DBG_ASSERT( nRow > 0, "*DifColumn::SetLogical(): weitere koennen nicht 0 sein!" );
+
nRow--;
+
if( pAkt->nEnd == nRow )
pAkt->nEnd++;
else
@@ -863,7 +846,8 @@ void DifColumn::SetLogical( SCROW nRow )
{
pAkt = new ENTRY;
pAkt->nStart = pAkt->nEnd = nRow;
- List::Insert( pAkt, LIST_APPEND );
+
+ aEntries.push_back(pAkt);
}
}
@@ -874,7 +858,7 @@ void DifColumn::SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat )
if( nNumFormat > 0 )
{
- if( pAkt )
+ if(pAkt)
{
DBG_ASSERT( nRow > 0,
"*DifColumn::SetNumFormat(): weitere koennen nicht 0 sein!" );
@@ -885,10 +869,10 @@ void DifColumn::SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat )
pAkt->nEnd = nRow;
else
NewEntry( nRow, nNumFormat );
- }
- else
- NewEntry( nRow, nNumFormat );
}
+ else
+ NewEntry(nRow,nNumFormat );
+ }
else
pAkt = NULL;
}
@@ -899,41 +883,33 @@ void DifColumn::NewEntry( const SCROW nPos, const sal_uInt32 nNumFormat )
pAkt = new ENTRY;
pAkt->nStart = pAkt->nEnd = nPos;
pAkt->nNumFormat = nNumFormat;
- List::Insert( pAkt, LIST_APPEND );
+
+ aEntries.push_back(pAkt);
}
void DifColumn::Apply( ScDocument& rDoc, const SCCOL nCol, const SCTAB nTab, const ScPatternAttr& rPattAttr )
{
- ENTRY* pEntry = ( ENTRY* ) List::First();
-
- while( pEntry )
- {
- rDoc.ApplyPatternAreaTab( nCol, pEntry->nStart, nCol, pEntry->nEnd,
- nTab, rPattAttr );
- pEntry = ( ENTRY* ) List::Next();
- }
+ for (boost::ptr_vector<ENTRY>::const_iterator it = aEntries.begin(); it != aEntries.end(); ++it)
+ rDoc.ApplyPatternAreaTab( nCol, it->nStart, nCol, it->nEnd, nTab, rPattAttr );
}
void DifColumn::Apply( ScDocument& rDoc, const SCCOL nCol, const SCTAB nTab )
{
- ScPatternAttr aAttr( rDoc.GetPool() );
- SfxItemSet& rItemSet = aAttr.GetItemSet();
-
- ENTRY* pEntry = ( ENTRY* ) List::First();
+ ScPatternAttr aAttr( rDoc.GetPool() );
+ SfxItemSet &rItemSet = aAttr.GetItemSet();
- while( pEntry )
- {
- DBG_ASSERT( pEntry->nNumFormat > 0,
+ for (boost::ptr_vector<ENTRY>::const_iterator it = aEntries.begin(); it != aEntries.end(); ++it)
+ {
+ DBG_ASSERT( it->nNumFormat > 0,
"+DifColumn::Apply(): Numberformat darf hier nicht 0 sein!" );
- rItemSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, pEntry->nNumFormat ) );
- rDoc.ApplyPatternAreaTab( nCol, pEntry->nStart, nCol, pEntry->nEnd, nTab, aAttr );
+ rItemSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, it->nNumFormat ) );
- rItemSet.ClearItem();
+ rDoc.ApplyPatternAreaTab( nCol, it->nStart, nCol, it->nEnd, nTab, aAttr );
- pEntry = ( ENTRY* ) List::Next();
+ rItemSet.ClearItem();
}
}
@@ -956,6 +932,16 @@ DifAttrCache::~DifAttrCache()
}
}
+void DifAttrCache::SetLogical( const SCCOL nCol, const SCROW nRow )
+{
+ DBG_ASSERT( ValidCol(nCol), "-DifAttrCache::SetLogical(): Col zu gross!" );
+ DBG_ASSERT( bPlain, "*DifAttrCache::SetLogical(): muss Plain sein!" );
+
+ if( !ppCols[ nCol ] )
+ ppCols[ nCol ] = new DifColumn;
+
+ ppCols[ nCol ]->SetLogical( nRow );
+}
void DifAttrCache::SetNumFormat( const SCCOL nCol, const SCROW nRow, const sal_uInt32 nNumFormat )
{
@@ -1005,3 +991,4 @@ void DifAttrCache::Apply( ScDocument& rDoc, SCTAB nTab )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/dif/makefile.mk b/sc/source/filter/dif/makefile.mk
index c24de4cb4164..495a7ab5edf3 100644
--- a/sc/source/filter/dif/makefile.mk
+++ b/sc/source/filter/dif/makefile.mk
@@ -38,16 +38,18 @@ PROJECTPCHSOURCE=..\pch\filt_pch
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
-SLOFILES = \
+SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
$(SLO)$/difimp.obj \
$(SLO)$/difexp.obj
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx
index 575093f48d2a..17270c14fc00 100644
--- a/sc/source/filter/excel/colrowst.cxx
+++ b/sc/source/filter/excel/colrowst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,8 +59,9 @@ XclImpColRowSettings::XclImpColRowSettings( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot ),
maWidths( MAXCOLCOUNT, 0 ),
maColFlags( MAXCOLCOUNT, 0 ),
- maHeights( MAXROWCOUNT, 0 ),
- maRowFlags( MAXROWCOUNT, 0 ),
+ maRowHeights(0, MAXROWCOUNT, 0),
+ maRowFlags(0, MAXROWCOUNT, 0),
+ maHiddenRows(0, MAXROWCOUNT, false),
mnLastScRow( -1 ),
mnDefWidth( STD_COL_WIDTH ),
mnDefHeight( static_cast< sal_uInt16 >( STD_ROW_HEIGHT ) ),
@@ -134,43 +136,64 @@ void XclImpColRowSettings::SetDefHeight( sal_uInt16 nDefHeight, sal_uInt16 nFlag
void XclImpColRowSettings::SetHeight( SCROW nScRow, sal_uInt16 nHeight )
{
- if( ValidRow( nScRow ) )
- {
- sal_uInt16 nRawHeight = nHeight & EXC_ROW_HEIGHTMASK;
- bool bDefHeight = ::get_flag( nHeight, EXC_ROW_FLAGDEFHEIGHT ) || (nRawHeight == 0);
- maHeights[ nScRow ] = nRawHeight;
- sal_uInt8& rnFlags = maRowFlags[ nScRow ];
- ::set_flag( rnFlags, EXC_COLROW_USED );
- if( !bDefHeight && (nRawHeight == 0) )
- ::set_flag( rnFlags, EXC_COLROW_HIDDEN );
- ::set_flag( rnFlags, EXC_COLROW_DEFAULT, bDefHeight );
- if( nScRow > mnLastScRow )
- mnLastScRow = nScRow;
- }
+ if (!ValidRow(nScRow))
+ return;
+
+ sal_uInt16 nRawHeight = nHeight & EXC_ROW_HEIGHTMASK;
+ bool bDefHeight = ::get_flag( nHeight, EXC_ROW_FLAGDEFHEIGHT ) || (nRawHeight == 0);
+ maRowHeights.insert_back(nScRow, nScRow+1, nRawHeight);
+ sal_uInt8 nFlagVal = 0;
+ if (!maRowFlags.search(nScRow, nFlagVal).second)
+ return;
+
+ ::set_flag(nFlagVal, EXC_COLROW_USED);
+ ::set_flag(nFlagVal, EXC_COLROW_DEFAULT, bDefHeight);
+
+ if (!bDefHeight && nRawHeight == 0)
+ maHiddenRows.insert_back(nScRow, nScRow+1, true);
+
+ maRowFlags.insert_back(nScRow, nScRow+1, nFlagVal);
+
+ if (nScRow > mnLastScRow)
+ mnLastScRow = nScRow;
}
void XclImpColRowSettings::SetRowSettings( SCROW nScRow, sal_uInt16 nHeight, sal_uInt16 nFlags )
{
- if( ValidRow( nScRow ) )
- {
- SetHeight( nScRow, nHeight );
- sal_uInt8& rnFlags = maRowFlags[ nScRow ];
- if( ::get_flag( nFlags, EXC_ROW_UNSYNCED ) )
- ::set_flag( rnFlags, EXC_COLROW_MAN );
- if( ::get_flag( nFlags, EXC_ROW_HIDDEN ) )
- ::set_flag( rnFlags, EXC_COLROW_HIDDEN );
- }
+ if (!ValidRow(nScRow))
+ return;
+
+ SetHeight(nScRow, nHeight);
+
+ sal_uInt8 nFlagVal = 0;
+ if (!maRowFlags.search(nScRow, nFlagVal).second)
+ return;
+
+ if (::get_flag(nFlags, EXC_ROW_UNSYNCED))
+ ::set_flag(nFlagVal, EXC_COLROW_MAN);
+
+ maRowFlags.insert_back(nScRow, nScRow+1, nFlagVal);
+
+ if (::get_flag(nFlags, EXC_ROW_HIDDEN))
+ maHiddenRows.insert_back(nScRow, nScRow+1, true);
}
void XclImpColRowSettings::SetManualRowHeight( SCROW nScRow )
{
- if( ValidRow( nScRow ) )
- ::set_flag( maRowFlags[ nScRow ], EXC_COLROW_MAN );
+ if (!ValidRow(nScRow))
+ return;
+
+ sal_uInt8 nFlagVal = 0;
+ if (!maRowFlags.search(nScRow, nFlagVal).second)
+ return;
+
+ ::set_flag(nFlagVal, EXC_COLROW_MAN);
+ maRowFlags.insert_back(nScRow, nScRow+1, nFlagVal);
}
void XclImpColRowSettings::SetDefaultXF( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nXFIndex )
{
- /* #109555# assign the default column formatting here to ensure that
+ /* assign the default column formatting here to ensure that
explicit cell formatting is not overwritten. */
DBG_ASSERT( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::SetDefaultXF - invalid column index" );
nScCol2 = ::std::min( nScCol2, MAXCOL );
@@ -201,7 +224,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
::set_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN );
nWidth = mnDefWidth;
}
- rDoc.SetColWidth( nScCol, nScTab, nWidth );
+ rDoc.SetColWidthOnly( nScCol, nScTab, nWidth );
}
// row heights ------------------------------------------------------------
@@ -211,64 +234,62 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
if( ::get_flag( mnDefRowFlags, EXC_DEFROW_UNSYNCED ) )
// first access to row flags, do not ask for old flags
rDoc.SetRowFlags( 0, MAXROW, nScTab, CR_MANUALSIZE );
- bool bDefHideRow = ::get_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN );
- SCROW nFirstScRow = -1;
- sal_uInt16 nLastHeight = 0;
- for( SCROW nScRow = 0; nScRow <= mnLastScRow ; ++nScRow )
+ maRowHeights.build_tree();
+ if (!maRowHeights.is_tree_valid())
+ return;
+
+ RowFlagsType::const_iterator itrFlags = maRowFlags.begin(), itrFlagsEnd = maRowFlags.end();
+ SCROW nPrevRow = -1;
+ sal_uInt8 nPrevFlags = 0;
+ for (; itrFlags != itrFlagsEnd; ++itrFlags)
{
- // get height and hidden state from cached data
- sal_uInt8 nFlags = maRowFlags[ nScRow ];
- sal_uInt16 nHeight = 0;
- bool bHideRow = false;
- if( ::get_flag( nFlags, EXC_COLROW_USED ) )
+ SCROW nRow = itrFlags->first;
+ sal_uInt8 nFlags = itrFlags->second;
+ if (nPrevRow >= 0)
{
- if( ::get_flag( nFlags, EXC_COLROW_DEFAULT ) )
- {
- nHeight = mnDefHeight;
- bHideRow = bDefHideRow;
- }
- else
+ sal_uInt16 nHeight = 0;
+
+ if (::get_flag(nPrevFlags, EXC_COLROW_USED))
{
- nHeight = maHeights[ nScRow ];
- if( nHeight == 0 )
+ if (::get_flag(nPrevFlags, EXC_COLROW_DEFAULT))
{
nHeight = mnDefHeight;
- bHideRow = true;
+ rDoc.SetRowHeightOnly(nPrevRow, nRow-1, nScTab, nHeight);
+ }
+ else
+ {
+ for (SCROW i = nPrevRow; i <= nRow - 1; ++i)
+ {
+ SCROW nLast;
+ if (!maRowHeights.search_tree(i, nHeight, NULL, &nLast))
+ {
+ // search failed for some reason
+ return;
+ }
+
+ if (nLast > nRow)
+ nLast = nRow;
+
+ rDoc.SetRowHeightOnly(i, nLast-1, nScTab, nHeight);
+ i = nLast-1;
+ }
}
- }
- if( ::get_flag( nFlags, EXC_COLROW_MAN ) )
- rDoc.SetRowFlags( nScRow, nScTab, rDoc.GetRowFlags( nScRow, nScTab ) | CR_MANUALSIZE );
- }
- else
- {
- nHeight = mnDefHeight;
- bHideRow = bDefHideRow;
+ if (::get_flag(nPrevFlags, EXC_COLROW_MAN))
+ rDoc.SetManualHeight(nPrevRow, nRow-1, nScTab, true);
+ }
+ else
+ {
+ nHeight = mnDefHeight;
+ rDoc.SetRowHeightOnly(nPrevRow, nRow-1, nScTab, nHeight);
+ }
}
- /* Hidden rows: remember hidden state, but do not set hidden state in
- document here. Needed for #i11776#, no HIDDEN flags in the document,
- until filters and outlines are inserted. */
- if( bHideRow )
- ::set_flag( maRowFlags[ nScRow ], EXC_COLROW_HIDDEN );
-
- // set height range
- if( (nLastHeight != nHeight) || (nScRow == 0) )
- {
- DBG_ASSERT( (nScRow == 0) || (nFirstScRow >= 0), "XclImpColRowSettings::Convert - algorithm error" );
- if( nScRow > 0 )
- rDoc.SetRowHeightOnly( nFirstScRow, nScRow - 1, nScTab, nLastHeight );
-
- nFirstScRow = nScRow;
- nLastHeight = nHeight;
- }
+ nPrevRow = nRow;
+ nPrevFlags = nFlags;
}
- // set row height of last portion
- if( mnLastScRow >= 0 )
- rDoc.SetRowHeightOnly( nFirstScRow, mnLastScRow, nScTab, nLastHeight );
-
// ------------------------------------------------------------------------
mbDirty = false;
@@ -282,7 +303,7 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab )
// hide the columns
for( SCCOL nScCol = 0; nScCol <= MAXCOL; ++nScCol )
if( ::get_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN ) )
- rDoc.ShowCol( nScCol, nScTab, sal_False );
+ rDoc.ShowCol( nScCol, nScTab, false );
// #i38093# rows hidden by filter need extra flag
SCROW nFirstFilterScRow = SCROW_MAX;
@@ -298,21 +319,46 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab )
}
}
- // hide the rows
- for( SCROW nScRow = 0; nScRow <= mnLastScRow; ++nScRow )
+ // In case the excel row limit is lower than calc's, use the visibility of
+ // the last row and extend it to calc's last row.
+ SCROW nLastXLRow = GetRoot().GetXclMaxPos().Row();
+ if (nLastXLRow < MAXROW)
{
- if( ::get_flag( maRowFlags[ nScRow ], EXC_COLROW_HIDDEN ) )
+ bool bHidden = false;
+ if (!maHiddenRows.search(nLastXLRow, bHidden).second)
+ return;
+
+ maHiddenRows.insert_back(nLastXLRow, MAXROWCOUNT, bHidden);
+ }
+
+ SCROW nPrevRow = -1;
+ bool bPrevHidden = false;
+ RowHiddenType::const_iterator itr = maHiddenRows.begin(), itrEnd = maHiddenRows.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ SCROW nRow = itr->first;
+ bool bHidden = itr->second;
+ if (nPrevRow >= 0)
{
- // hide the row
- rDoc.ShowRow( nScRow, nScTab, sal_False );
- // #i38093# rows hidden by filter need extra flag
- if( (nFirstFilterScRow <= nScRow) && (nScRow <= nLastFilterScRow) )
- rDoc.SetRowFiltered(nScRow, nScRow, nScTab, true);
+ if (bPrevHidden)
+ {
+ rDoc.ShowRows(nPrevRow, nRow-1, nScTab, false);
+ // #i38093# rows hidden by filter need extra flag
+ if (nFirstFilterScRow <= nPrevRow && nPrevRow <= nLastFilterScRow)
+ {
+ SCROW nLast = ::std::min(nRow-1, nLastFilterScRow);
+ rDoc.SetRowFiltered(nPrevRow, nLast, nScTab, true);
+ }
+ }
}
+
+ nPrevRow = nRow;
+ bPrevHidden = bHidden;
}
// #i47438# if default row format is hidden, hide remaining rows
if( ::get_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN ) && (mnLastScRow < MAXROW) )
- rDoc.ShowRows( mnLastScRow + 1, MAXROW, nScTab, sal_False );
+ rDoc.ShowRows( mnLastScRow + 1, MAXROW, nScTab, false );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 0e99bbb14ead..1b2491ae15dd 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,7 +85,11 @@
#include <math.h>
-using namespace ::oox;
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <oox/core/tokens.hxx>
+#include <boost/shared_ptr.hpp>
+
using ::rtl::OString;
static String lcl_GetVbaTabName( SCTAB n )
@@ -118,11 +123,10 @@ static void lcl_AddCalcPr( XclExpRecordList<>& aRecList, ExcTable& self )
aRecList.AppendNewRecord( new XclExpXmlEndSingleElementRecord() ); // XML_calcPr
}
-#if 0
-// removed during rebase, because scsheetprotection02 is not yet up-stream :-(
static void lcl_AddWorkbookProtection( XclExpRecordList<>& aRecList, ExcTable& self )
{
aRecList.AppendNewRecord( new XclExpXmlStartSingleElementRecord( XML_workbookProtection ) );
+
const ScDocProtection* pProtect = self.GetDoc().GetDocProtection();
if (pProtect && pProtect->isProtected())
{
@@ -131,14 +135,8 @@ static void lcl_AddWorkbookProtection( XclExpRecordList<>& aRecList, ExcTable& s
aRecList.AppendNewRecord( new XclExpPassHash(pProtect->getPasswordHash(PASSHASH_XL)) );
}
- if( self.GetBiff() == EXC_BIFF8 )
- {
- aRecList.AppendNewRecord( new XclExpProt4Rev );
- aRecList.AppendNewRecord( new XclExpProt4RevPass );
- }
aRecList.AppendNewRecord( new XclExpXmlEndSingleElementRecord() ); // XML_workbookProtection
}
-#endif
static void lcl_AddScenariosAndFilters( XclExpRecordList<>& aRecList, const XclExpRoot& rRoot, SCTAB nScTab )
{
@@ -266,30 +264,25 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
}
// document protection options
- const ScDocProtection* pProtect = GetDoc().GetDocProtection();
- if (pProtect && pProtect->isProtected())
+ if( GetOutput() == EXC_OUTPUT_BINARY )
{
- Add( new XclExpWindowProtection(pProtect->isOptionEnabled(ScDocProtection::WINDOWS)) );
- Add( new XclExpProtection(pProtect->isOptionEnabled(ScDocProtection::STRUCTURE)) );
-#if ENABLE_SHEET_PROTECTION
- Add( new XclExpPassHash(pProtect->getPasswordHash(PASSHASH_XL)) );
-#endif
- }
+ lcl_AddWorkbookProtection( aRecList, *this );
- if( GetBiff() == EXC_BIFF8 )
- {
- Add( new XclExpProt4Rev );
- Add( new XclExpProt4RevPass );
- }
+ if( GetBiff() == EXC_BIFF8 )
+ {
+ Add( new XclExpProt4Rev );
+ Add( new XclExpProt4RevPass );
+ }
- // document protection options
- if( GetOutput() == EXC_OUTPUT_BINARY )
- {
- //lcl_AddWorkbookProtection( aRecList, *this );
lcl_AddBookviews( aRecList, *this );
}
Add( new XclExpXmlStartSingleElementRecord( XML_workbookPr ) );
+ if ( GetBiff() == EXC_BIFF8 && GetOutput() != EXC_OUTPUT_BINARY )
+ {
+ Add( new XclExpBoolRecord(0x0040, false, XML_backupFile ) ); // BACKUP
+ Add( new XclExpBoolRecord(0x008D, false, XML_showObjects ) ); // HIDEOBJ
+ }
if ( GetBiff() == EXC_BIFF8 )
{
@@ -373,7 +366,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
if( GetOutput() != EXC_OUTPUT_BINARY )
{
- //lcl_AddWorkbookProtection( aRecList, *this );
+ lcl_AddWorkbookProtection( aRecList, *this );
lcl_AddBookviews( aRecList, *this );
}
@@ -445,7 +438,7 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx )
// WSBOOL needs data from page settings, create it here, add it later
- ScfRef< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
+ boost::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
if( eBiff <= EXC_BIFF5 )
@@ -479,9 +472,7 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx )
Add( new XclExpProtection(true) );
Add( new XclExpBoolRecord(0x00DD, pTabProtect->isOptionEnabled(ScTableProtection::SCENARIOS)) );
Add( new XclExpBoolRecord(0x0063, pTabProtect->isOptionEnabled(ScTableProtection::OBJECTS)) );
-#if ENABLE_SHEET_PROTECTION
Add( new XclExpPassHash(pTabProtect->getPasswordHash(PASSHASH_XL)) );
-#endif
}
// local link table: EXTERNCOUNT, EXTERNSHEET
@@ -554,7 +545,7 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
RootData& rR = GetOldRoot();
// WSBOOL needs data from page settings, create it here, add it later
- ScfRef< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
+ boost::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
Add( new ExcBof8 );
@@ -634,6 +625,9 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
}
}
+ // all MSODRAWING and OBJ stuff of this sheet goes here
+ aRecList.AppendRecord( GetObjectManager().ProcessDrawing( GetSdrPage( mnScTab ) ) );
+
// EOF
Add( new ExcEof );
}
@@ -763,7 +757,7 @@ void ExcDocument::Write( SvStream& rSvStrm )
aHeader.Write( aXclStrm );
- DBG_ASSERT( maTableList.GetSize() == maBoundsheetList.GetSize(),
+ OSL_ENSURE( maTableList.GetSize() == maBoundsheetList.GetSize(),
"ExcDocument::Write - different number of sheets and BOUNDSHEET records" );
for( size_t nTab = 0, nTabCount = maTableList.GetSize(); nTab < nTabCount; ++nTab )
@@ -784,48 +778,49 @@ void ExcDocument::Write( SvStream& rSvStrm )
pExpChangeTrack->Write();
}
-void ExcDocument::WriteXml( SvStream& rStrm )
+void ExcDocument::WriteXml( XclExpXmlStream& rStrm )
{
+ SfxObjectShell* pDocShell = GetDocShell();
+
+ using namespace ::com::sun::star;
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
+
+ rStrm.exportDocumentProperties( xDocProps );
+
+ sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
+ rWorkbook->startElement( XML_workbook,
+ XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ FSEND );
+ rWorkbook->singleElement( XML_fileVersion,
+ XML_appName, "Calc",
+ // OOXTODO: XML_codeName
+ // OOXTODO: XML_lastEdited
+ // OOXTODO: XML_lowestEdited
+ // OOXTODO: XML_rupBuild
+ FSEND );
+
if( !maTableList.IsEmpty() )
{
InitializeSave();
- XclExpXmlStream aStrm( ::comphelper::getProcessComponentContext(), rStrm, GetRoot() );
-
- sax_fastparser::FSHelperPtr& rWorkbook = aStrm.GetCurrentStream();
- rWorkbook->startElement( XML_workbook,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
- FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
- FSEND );
- rWorkbook->singleElement( XML_fileVersion,
- XML_appName, "Calc",
- // OOXTODO: XML_codeName
- // OOXTODO: XML_lastEdited
- // OOXTODO: XML_lowestEdited
- // OOXTODO: XML_rupBuild
- FSEND );
-
- aHeader.WriteXml( aStrm );
+ aHeader.WriteXml( rStrm );
for( size_t nTab = 0, nTabCount = maTableList.GetSize(); nTab < nTabCount; ++nTab )
{
- // set current stream position in BOUNDSHEET record
-#if 0
- ExcBoundsheetRef xBoundsheet = maBoundsheetList.GetRecord( nTab );
- if( xBoundsheet.get() )
- xBoundsheet->SetStreamPos( aXclStrm.GetSvStreamPos() );
-#endif
// write the table
- maTableList.GetRecord( nTab )->WriteXml( aStrm );
+ maTableList.GetRecord( nTab )->WriteXml( rStrm );
}
-
- rWorkbook->endElement( XML_workbook );
- rWorkbook.reset();
- aStrm.commitStorage();
}
-#if 0
+
if( pExpChangeTrack )
- pExpChangeTrack->WriteXml();
-#endif
+ pExpChangeTrack->WriteXml( rStrm );
+
+ rWorkbook->endElement( XML_workbook );
+ rWorkbook.reset();
+
+ rStrm.commitStorage();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index a4c7d42b2b96..4bd3654caa64 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,15 +102,15 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
SfxItemSet* pItemSet = rMedium.GetItemSet();
if( pItemSet )
{
- SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
+ SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, false);
if( pFileNameItem )
aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pFileNameItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, false);
if( pPasswordItem )
aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pPasswordItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, false);
if( pEncryptionDataItem )
aMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] = pEncryptionDataItem->GetValue();
}
@@ -144,7 +145,7 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
SotStorageStreamRef xStrgStrm;
if( SotStorage::IsStorageFile( pMedStrm ) )
{
- xRootStrg = new SotStorage( pMedStrm, sal_False );
+ xRootStrg = new SotStorage( pMedStrm, false );
if( xRootStrg->GetError() )
xRootStrg = 0;
}
@@ -220,7 +221,7 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
SvStream* pMedStrm, sal_Bool bBiff8, CharSet eNach )
{
// try to open an OLE storage
- SotStorageRef xRootStrg = new SotStorage( pMedStrm, sal_False );
+ SotStorageRef xRootStrg = new SotStorage( pMedStrm, false );
if( xRootStrg->GetError() ) return eERR_OPEN;
// create BIFF dependent strings
@@ -270,25 +271,10 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
return eRet;
}
-static FltError lcl_ExportExcel2007Xml( SfxMedium& rMedium, ScDocument *pDocument,
- SvStream* pMedStrm, CharSet eNach )
-{
- SotStorageRef xRootStrg = (SotStorage*) 0;
-
- XclExpRootData aExpData( EXC_BIFF8, rMedium, xRootStrg, *pDocument, eNach );
- aExpData.meOutput = EXC_OUTPUT_XML_2007;
-
- ExportXml2007 aFilter( aExpData, *pMedStrm );
-
- FltError eRet = aFilter.Write();
-
- return eRet;
-}
-
FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument *pDocument,
ExportFormatExcel eFormat, CharSet eNach )
{
- if( eFormat != ExpBiff5 && eFormat != ExpBiff8 && eFormat != Exp2007Xml )
+ if( eFormat != ExpBiff5 && eFormat != ExpBiff8 )
return eERR_NI;
// check the passed Calc document
@@ -303,11 +289,10 @@ FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocumen
FltError eRet = eERR_UNKN_BIFF;
if( eFormat == ExpBiff5 || eFormat == ExpBiff8 )
eRet = lcl_ExportExcelBiff( rMedium, pDocument, pMedStrm, eFormat == ExpBiff8, eNach );
- else if( eFormat == Exp2007Xml )
- eRet = lcl_ExportExcel2007Xml( rMedium, pDocument, pMedStrm, eNach );
return eRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 00862032603c..ff3c3e118f9f 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,7 +57,7 @@ void ImportExcel::Formula25()
XclAddress aXclPos;
sal_uInt16 nXF = 0, nFormLen;
double fCurVal;
- sal_uInt8 nAttr0, nFlag0;
+ sal_uInt8 nFlag0;
sal_Bool bShrFmla;
aIn >> aXclPos;
@@ -71,8 +72,7 @@ void ImportExcel::Formula25()
aIn.Ignore( 1 );
aIn >> nDummy;
nFormLen = nDummy;
- bShrFmla = sal_False;
- nAttr0 = 0x01; // Always calculate
+ bShrFmla = false;
}
else
{// BIFF5
@@ -109,7 +109,7 @@ void ImportExcel::Formula4()
nLastXF = nXF;
- Formula( aXclPos, nXF, nFormLen, fCurVal, sal_False );
+ Formula( aXclPos, nXF, nFormLen, fCurVal, false );
}
@@ -160,12 +160,7 @@ void ImportExcel::Formula( const XclAddress& rXclPos,
{
if( eErr != ConvOK )
ExcelToSc::SetError( *pZelle, eErr );
-#if 0
- else
- ExcelToSc::SetCurVal( *pZelle, rCurVal );
-#else
(void)rCurVal;
-#endif
}
GetXFRangeBuffer().SetXF( aScPos, nXF );
@@ -206,8 +201,8 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
sal_Int16 nINT16;
double fDouble;
String aString;
- sal_Bool bError = sal_False;
- sal_Bool bArrayFormula = sal_False;
+ sal_Bool bError = false;
+ sal_Bool bArrayFormula = false;
TokenId nMerk0;
const sal_Bool bRangeName = eFT == FT_RangeName;
const sal_Bool bSharedFormula = eFT == FT_SharedFormula;
@@ -217,7 +212,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
ScComplexRefData aCRD;
ExtensionTypeVec aExtensions;
- bExternName = sal_False;
+ bExternName = false;
if( eStatus != ConvOK )
{
@@ -239,7 +234,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
{
aIn >> nOp;
- // #98524# always reset flags
+ // always reset flags
aSRD.InitFlags();
aCRD.InitFlags();
@@ -335,7 +330,6 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
case 0x10: // Union [314 265]
// ocSep behelfsweise statt 'ocUnion'
aStack >> nMerk0;
-//#100928# aPool << ocOpen << aStack << ocSep << nMerk0 << ocClose;
aPool << aStack << ocSep << nMerk0;
// doesn't fit exactly, but is more Excel-like
aPool >> aStack;
@@ -426,9 +420,6 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
case 0x1C: // Error Value [314 266]
{
aIn >> nByte;
-#if 0 // erAck
- aPool.StoreError( XclTools::GetScErrorCode( nByte ) );
-#else
DefTokenId eOc;
switch( nByte )
{
@@ -444,7 +435,6 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
aPool << eOc;
if( eOc != ocStop )
aPool << ocOpen << ocClose;
-#endif
aPool >> aStack;
}
break;
@@ -525,7 +515,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
case EXC_BIFF4: aIn.Ignore( 8 ); break;
case EXC_BIFF5: aIn.Ignore( 12 ); break;
default:
- DBG_ERROR(
+ OSL_FAIL(
"-ExcelToSc::Convert(): Ein wenig vergesslich, was?" );
}
const XclImpName* pName = GetNameManager().GetName( nUINT16 );
@@ -704,7 +694,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
aPool << ocDde << ocOpen << nPar1 << ocSep << nPar2 << ocSep
<< nMerk0 << ocClose;
- GetDoc().CreateDdeLink( aAppl, aExtDoc, pExtName->aName, SC_DDE_DEFAULT );
+ GetDoc().CreateDdeLink( aAppl, aExtDoc, pExtName->aName, SC_DDE_DEFAULT, ScMatrixRef() );
}
else
aPool << ocBad;
@@ -749,7 +739,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
{ // in aktuellem Workbook
aSRD.nTab = static_cast<SCTAB>(nTabFirst);
aSRD.SetFlag3D( sal_True );
- aSRD.SetTabRel( sal_False );
+ aSRD.SetTabRel( false );
ExcRelToScRel( nRow, nCol, aSRD, bRangeName );
@@ -819,9 +809,9 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
rR1.nTab = static_cast<SCTAB>(nTabFirst);
rR2.nTab = static_cast<SCTAB>(nTabLast);
rR1.SetFlag3D( sal_True );
- rR1.SetTabRel( sal_False );
+ rR1.SetTabRel( false );
rR2.SetFlag3D( nTabFirst != nTabLast );
- rR2.SetTabRel( sal_False );
+ rR2.SetTabRel( false );
ExcRelToScRel( nRowFirst, nColFirst, aCRD.Ref1, bRangeName );
ExcRelToScRel( nRowLast, nColLast, aCRD.Ref2, bRangeName );
@@ -898,15 +888,16 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
// stream seeks to first byte after <nFormulaLen>
-ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, const FORMULA_TYPE eFT )
+ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen,
+ SCsTAB nTab, const FORMULA_TYPE eFT )
{
RootData& rR = GetOldRoot();
sal_uInt8 nOp, nLen;
sal_Size nIgnore;
sal_uInt16 nUINT16;
sal_uInt8 nByte;
- sal_Bool bError = sal_False;
- sal_Bool bArrayFormula = sal_False;
+ sal_Bool bError = false;
+ sal_Bool bArrayFormula = false;
const sal_Bool bRangeName = eFT == FT_RangeName;
const sal_Bool bSharedFormula = eFT == FT_SharedFormula;
const sal_Bool bRNorSF = bRangeName || bSharedFormula;
@@ -915,7 +906,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
ScComplexRefData aCRD;
aCRD.Ref1.nTab = aCRD.Ref2.nTab = aEingPos.Tab();
- bExternName = sal_False;
+ bExternName = false;
if( eStatus != ConvOK )
{
@@ -933,7 +924,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
aIn >> nOp;
nIgnore = 0;
- // #98524# always reset flags
+ // always reset flags
aSRD.InitFlags();
aCRD.InitFlags();
@@ -1051,7 +1042,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
case EXC_BIFF3:
case EXC_BIFF4: nIgnore = 10; break;
case EXC_BIFF5: nIgnore = 14; break;
- default: DBG_ERROR( "-ExcelToSc::Convert(): Ein wenig vergesslich, was?" );
+ default: OSL_FAIL( "-ExcelToSc::Convert(): Ein wenig vergesslich, was?" );
}
break;
case 0x44:
@@ -1066,7 +1057,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
ExcRelToScRel( nUINT16, nByte, aSRD, bRangeName );
- rRangeList.Append( aSRD );
+ rRangeList.Append( aSRD, nTab );
break;
case 0x45:
case 0x65:
@@ -1093,7 +1084,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
- rRangeList.Append( aCRD );
+ rRangeList.Append( aCRD, nTab );
}
break;
case 0x46:
@@ -1130,7 +1121,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
ExcRelToScRel( nUINT16, nByte, aSRD, bRNorSF );
- rRangeList.Append( aSRD );
+ rRangeList.Append( aSRD, nTab );
}
break;
case 0x4D:
@@ -1156,7 +1147,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
- rRangeList.Append( aCRD );
+ rRangeList.Append( aCRD, nTab );
}
break;
case 0x49:
@@ -1213,7 +1204,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
sal_Bool b3D = ( static_cast<SCTAB>(nTabFirst) != aEingPos.Tab() ) || bRangeName;
aSRD.nTab = static_cast<SCTAB>(nTabFirst);
aSRD.SetFlag3D( b3D );
- aSRD.SetTabRel( sal_False );
+ aSRD.SetTabRel( false );
ExcRelToScRel( nRow, nCol, aSRD, bRangeName );
@@ -1225,11 +1216,11 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
aCRD.Ref2.nTab = static_cast<SCTAB>(nTabLast);
b3D = ( static_cast<SCTAB>(nTabLast) != aEingPos.Tab() );
aCRD.Ref2.SetFlag3D( b3D );
- aCRD.Ref2.SetTabRel( sal_False );
- rRangeList.Append( aCRD );
+ aCRD.Ref2.SetTabRel( false );
+ rRangeList.Append( aCRD, nTab );
}
else
- rRangeList.Append( aSRD );
+ rRangeList.Append( aSRD, nTab );
}
}
@@ -1272,9 +1263,9 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
rR1.nTab = static_cast<SCTAB>(nTabFirst);
rR2.nTab = static_cast<SCTAB>(nTabLast);
rR1.SetFlag3D( ( static_cast<SCTAB>(nTabFirst) != aEingPos.Tab() ) || bRangeName );
- rR1.SetTabRel( sal_False );
+ rR1.SetTabRel( false );
rR2.SetFlag3D( ( static_cast<SCTAB>(nTabLast) != aEingPos.Tab() ) || bRangeName );
- rR2.SetTabRel( sal_False );
+ rR2.SetTabRel( false );
ExcRelToScRel( nRowFirst, nColFirst, aCRD.Ref1, bRangeName );
ExcRelToScRel( nRowLast, nColLast, aCRD.Ref2, bRangeName );
@@ -1284,7 +1275,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
- rRangeList.Append( aCRD );
+ rRangeList.Append( aCRD, nTab );
}//ENDE in aktuellem Workbook
}
break;
@@ -1333,7 +1324,7 @@ sal_Bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sa
{
DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF5 );
if( GetBiff() != EXC_BIFF5 )
- return sal_False;
+ return false;
sal_uInt8 nOp;
sal_uInt16 nRow1, nRow2;
@@ -1398,7 +1389,7 @@ sal_Bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sa
nTab1 = static_cast< SCTAB >( nTabFirst );
nTab2 = static_cast< SCTAB >( nTabLast );
- // #122885# skip references to deleted sheets
+ // skip references to deleted sheets
if( (nRefIdx >= 0) || !ValidTab( nTab1 ) || (nTab1 != nTab2) )
break;
@@ -1531,7 +1522,7 @@ sal_Bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sa
}
rStrm.Seek( nEndPos );
- return rRangeList.Count() != 0;
+ return !rRangeList.empty();
}
void ExcelToSc::DoMulArgs( DefTokenId eId, sal_uInt8 nAnz, sal_uInt8 nMinParamCount )
@@ -1603,7 +1594,7 @@ void ExcelToSc::DoMulArgs( DefTokenId eId, sal_uInt8 nAnz, sal_uInt8 nMinParamCo
// a function table, and pre-call argument normalisation 1st.
sal_Int16 nLastRemovable = nLast - nMinParamCount;
- // #84453# skip missing parameters at end of parameter list
+ // skip missing parameters at end of parameter list
while( nSkipEnd < nLastRemovable &&
aPool.IsSingleOp( eParam[ nSkipEnd + 1 ], ocMissing ) )
nSkipEnd++;
@@ -1640,7 +1631,7 @@ void ExcelToSc::ExcRelToScRel( sal_uInt16 nRow, sal_uInt8 nCol, ScSingleRefData
}
else
{// abs Col
- rSRD.SetColRel( sal_False );
+ rSRD.SetColRel( false );
rSRD.nCol = static_cast<SCCOL>(nCol);
}
@@ -1657,12 +1648,12 @@ void ExcelToSc::ExcRelToScRel( sal_uInt16 nRow, sal_uInt8 nCol, ScSingleRefData
}
else
{// abs Row
- rSRD.SetRowRel( sal_False );
+ rSRD.SetRowRel( false );
rSRD.nRow = static_cast<SCROW>(nRow & nRowMask);
}
// T A B
- // #67965# abs needed if rel in shared formula for ScCompiler UpdateNameReference
+ // abs needed if rel in shared formula for ScCompiler UpdateNameReference
if ( rSRD.IsTabRel() && !rSRD.IsFlag3D() )
rSRD.nTab = GetCurrScTab();
}
@@ -1710,7 +1701,7 @@ const ScTokenArray* ExcelToSc::GetBoolErr( XclBoolError eType )
case xlErrFalse: eOc = ocFalse; nError = 0; break;
case xlErrUnknown: eOc = ocStop; nError = errUnknownState; break;
default:
- DBG_ERROR( "ExcelToSc::GetBoolErr - wrong enum!" );
+ OSL_FAIL( "ExcelToSc::GetBoolErr - wrong enum!" );
eOc = ocNoName;
nError = errUnknownState;
}
@@ -1739,7 +1730,7 @@ sal_Bool ExcelToSc::GetShrFmla( const ScTokenArray*& rpErgebnis, XclImpStream& a
sal_Bool bRet = sal_True;
if( nFormulaLen == 0 )
- bRet = sal_False;
+ bRet = false;
else
{
aIn.PushPosition();
@@ -1758,7 +1749,7 @@ sal_Bool ExcelToSc::GetShrFmla( const ScTokenArray*& rpErgebnis, XclImpStream& a
bRet = sal_True;
}
else
- bRet = sal_False;
+ bRet = false;
aIn.PopPosition();
}
@@ -1775,54 +1766,6 @@ sal_Bool ExcelToSc::GetShrFmla( const ScTokenArray*& rpErgebnis, XclImpStream& a
}
-#if 0
-sal_Bool ExcelToSc::SetCurVal( ScFormulaCell &rCell, double &rfCurVal )
-{
- sal_uInt16 nInd;
- sal_uInt8 nType;
- sal_uInt8 nVal;
- sal_Bool bString = sal_False;
-
-#ifdef OSL_BIGENDIAN
- // Code fuer alle anstaendigen Prozessoren
- nType = *( ( ( sal_uInt8 * ) &rfCurVal ) + 7 );
- nVal = *( ( ( sal_uInt8 * ) &rfCurVal ) + 5 );
- nInd = *( ( sal_uInt16 * ) &rfCurVal );
-#else
- // fuer Schund-Prozessoren
- nType = *( ( sal_uInt8 * ) &rfCurVal );
- nVal = *( ( ( sal_uInt8 * ) &rfCurVal ) + 2 );
- nInd = *( ( ( sal_uInt16 * ) &rfCurVal ) + 3 );
-#endif
-
- if( ( sal_uInt16 ) ~nInd )
- // Wert ist Float
- rCell.SetHybridDouble( rfCurVal );
- else
- {
- switch( nType )
- {
- case 0: // String
- bString = sal_True;
- break;
- case 1: // Bool
- if( nVal )
- rfCurVal = 1.0;
- else
- rfCurVal = 0.0;
- rCell.SetHybridDouble( rfCurVal );
- break;
- case 2: // Error
- rCell.SetErrCode( XclTools::GetScErrorCode( nVal ) );
- break;
- }
- }
-
- return bString;
-}
-#endif
-
-
void ExcelToSc::SetError( ScFormulaCell &rCell, const ConvErr eErr )
{
sal_uInt16 nInd;
@@ -2011,3 +1954,4 @@ void ExcelToSc::ReadExtensions( const ExtensionTypeVec& rExtensions,
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index 77299aff113a..2508e20681f4 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,8 +101,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
sal_uInt16 nUINT16;
double fDouble;
String aString;
- sal_Bool bError = sal_False;
- sal_Bool bArrayFormula = sal_False;
+ sal_Bool bError = false;
+ sal_Bool bArrayFormula = false;
TokenId nMerk0;
const sal_Bool bRangeName = eFT == FT_RangeName;
const sal_Bool bSharedFormula = eFT == FT_SharedFormula;
@@ -131,7 +132,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
{
aIn >> nOp;
- // #98524# always reset flags
+ // always reset flags
aSRD.InitFlags();
aCRD.InitFlags();
@@ -222,7 +223,6 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
case 0x10: // Union [314 265]
// ocSep behelfsweise statt 'ocUnion'
aStack >> nMerk0;
-//#100928# aPool << ocOpen << aStack << ocSep << nMerk0 << ocClose;
aPool << aStack << ocSep << nMerk0;
// doesn't fit exactly, but is more Excel-like
aPool >> aStack;
@@ -347,9 +347,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
case 0x1C: // Error Value [314 266]
{
aIn >> nByte;
-#if 0 // erAck
- aPool.StoreError( XclTools::GetScErrorCode( nByte ) );
-#else
+
DefTokenId eOc;
switch( nByte )
{
@@ -365,7 +363,6 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
aPool << eOc;
if( eOc != ocStop )
aPool << ocOpen << ocClose;
-#endif
aPool >> aStack;
}
break;
@@ -636,7 +633,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
* external name reference can be stored in ODF,
* which remains to be done for #i3740#. Until then
* create a #NAME? token. */
-#if 0
+#if 1
sal_uInt16 nFileId;
if (!GetExternalFileIdFromXti(nXtiIndex, nFileId) || !pExtName->HasFormulaTokens())
{
@@ -717,7 +714,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
aSRD.nTab = nTabFirst;
aSRD.SetFlag3D( sal_True );
- aSRD.SetTabRel( sal_False );
+ aSRD.SetTabRel( false );
ExcRelToScRel8( nRw, nGrbitCol, aSRD, bRangeName );
@@ -790,9 +787,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
rR1.nTab = nTabFirst;
rR2.nTab = nTabLast;
rR1.SetFlag3D( sal_True );
- rR1.SetTabRel( sal_False );
+ rR1.SetTabRel( false );
rR2.SetFlag3D( nTabFirst != nTabLast );
- rR2.SetTabRel( sal_False );
+ rR2.SetTabRel( false );
ExcRelToScRel8( nRw1, nGrbitCol1, aCRD.Ref1, bRangeName );
ExcRelToScRel8( nRw2, nGrbitCol2, aCRD.Ref2, bRangeName );
@@ -871,11 +868,11 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
// stream seeks to first byte after <nFormulaLen>
-ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, const FORMULA_TYPE eFT )
+ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen,
+ SCsTAB nTab, const FORMULA_TYPE eFT )
{
sal_uInt8 nOp, nLen;//, nByte;
- sal_Bool bError = sal_False;
- sal_Bool bArrayFormula = sal_False;
+ sal_Bool bError = false;
const sal_Bool bRangeName = eFT == FT_RangeName;
const sal_Bool bSharedFormula = eFT == FT_SharedFormula;
const sal_Bool bRNorSF = bRangeName || bSharedFormula;
@@ -883,7 +880,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
ScSingleRefData aSRD;
ScComplexRefData aCRD;
- bExternName = sal_False;
+ bExternName = false;
if( eStatus != ConvOK )
{
@@ -900,7 +897,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
{
aIn >> nOp;
- // #98524# always reset flags
+ // always reset flags
aSRD.InitFlags();
aCRD.InitFlags();
@@ -909,8 +906,6 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
case 0x01: // Array Formula [325 ]
// Array Formula or Shared Formula [ 277]
aIn.Ignore( 4 );
-
- bArrayFormula = sal_True;
break;
case 0x02: // Data Table [325 277]
aIn.Ignore( 4 );
@@ -1002,7 +997,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
ExcRelToScRel8( nRow, nCol, aSRD, bRangeName );
- rRangeList.Append( aSRD );
+ rRangeList.Append( aSRD, nTab );
}
break;
case 0x45:
@@ -1030,7 +1025,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
- rRangeList.Append( aCRD );
+ rRangeList.Append( aCRD, nTab );
}
break;
case 0x46:
@@ -1074,7 +1069,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF );
- rRangeList.Append( aSRD );
+ rRangeList.Append( aSRD, nTab );
}
break;
case 0x4D:
@@ -1100,7 +1095,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
- rRangeList.Append( aCRD );
+ rRangeList.Append( aCRD, nTab );
}
break;
case 0x4E:
@@ -1132,7 +1127,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
{
aSRD.nTab = nFirstScTab;
aSRD.SetFlag3D( sal_True );
- aSRD.SetTabRel( sal_False );
+ aSRD.SetTabRel( false );
ExcRelToScRel8( nRw, nGrbitCol, aSRD, bRangeName );
@@ -1142,10 +1137,10 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
aCRD.Ref2.nCol = aSRD.nCol;
aCRD.Ref2.nRow = aSRD.nRow;
aCRD.Ref2.nTab = nLastScTab;
- rRangeList.Append( aCRD );
+ rRangeList.Append( aCRD, nTab );
}
else
- rRangeList.Append( aSRD );
+ rRangeList.Append( aSRD, nTab );
}
}
break;
@@ -1166,9 +1161,9 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
rR1.nTab = nFirstScTab;
rR2.nTab = nLastScTab;
rR1.SetFlag3D( sal_True );
- rR1.SetTabRel( sal_False );
+ rR1.SetTabRel( false );
rR2.SetFlag3D( nFirstScTab != nLastScTab );
- rR2.SetTabRel( sal_False );
+ rR2.SetTabRel( false );
ExcRelToScRel8( nRw1, nGrbitCol1, aCRD.Ref1, bRangeName );
ExcRelToScRel8( nRw2, nGrbitCol2, aCRD.Ref2, bRangeName );
@@ -1178,7 +1173,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
else if( IsComplRowRange( nRw1, nRw2 ) )
SetComplRow( aCRD );
- rRangeList.Append( aCRD );
+ rRangeList.Append( aCRD, nTab );
}
}
break;
@@ -1251,7 +1246,7 @@ ConvErr ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStrea
{
rStrm >> nOp;
- // #98524# always reset flags
+ // always reset flags
aSRD.InitFlags();
aCRD.InitFlags();
@@ -1391,7 +1386,7 @@ void ExcelToSc8::ExcRelToScRel8( sal_uInt16 nRow, sal_uInt16 nC, ScSingleRefData
rSRD.nRow = Min( static_cast<SCROW>(nRow), MAXROW);
// T A B
- // #67965# abs needed if rel in shared formula for ScCompiler UpdateNameReference
+ // abs needed if rel in shared formula for ScCompiler UpdateNameReference
if ( rSRD.IsTabRel() && !rSRD.IsFlag3D() )
rSRD.nTab = GetCurrScTab();
}
@@ -1475,7 +1470,7 @@ sal_Bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLe
aIn >> nIxti >> nRow1 >> nRow2 >> nCol1 >> nCol2;
_3d_common:
- // #122885# skip references to deleted sheets
+ // skip references to deleted sheets
if( !rLinkMan.GetScTabRange( nTab1, nTab2, nIxti ) || !ValidTab( nTab1 ) || !ValidTab( nTab2 ) )
break;
@@ -1587,10 +1582,11 @@ sal_Bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLe
}
aIn.Seek( nEndPos );
- return r.Count() != 0;
+ return !r.empty();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 9e00774e205b..beb64b9b30ca 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,16 +101,106 @@
#include "stlpool.hxx"
#include "stlsheet.hxx"
#include "detfunc.hxx"
+#include "macromgr.hxx"
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
+#include <comphelper/mediadescriptor.hxx>
+#include <cppuhelper/component_context.hxx>
+#include <sfx2/app.hxx>
+#include "xltoolbar.hxx"
+
using namespace com::sun::star;
using namespace ::comphelper;
using ::rtl::OUString;
+//OleNameOverrideContainer
+
+typedef ::cppu::WeakImplHelper1< container::XNameContainer > OleNameOverrideContainer_BASE;
+
+class OleNameOverrideContainer : public OleNameOverrideContainer_BASE
+{
+private:
+ typedef boost::unordered_map< rtl::OUString, uno::Reference< container::XIndexContainer >, ::rtl::OUStringHash,
+ ::std::equal_to< ::rtl::OUString > > NamedIndexToOleName;
+ NamedIndexToOleName IdToOleNameHash;
+ ::osl::Mutex m_aMutex;
+public:
+ // XElementAccess
+ virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return container::XIndexContainer::static_type(0); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return ( IdToOleNameHash.size() > 0 );
+ }
+ // XNameAcess
+ virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !hasByName(aName) )
+ throw container::NoSuchElementException();
+ return uno::makeAny( IdToOleNameHash[ aName ] );
+ }
+ virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ uno::Sequence< ::rtl::OUString > aResult( IdToOleNameHash.size() );
+ NamedIndexToOleName::iterator it = IdToOleNameHash.begin();
+ NamedIndexToOleName::iterator it_end = IdToOleNameHash.end();
+ rtl::OUString* pName = aResult.getArray();
+ for (; it != it_end; ++it, ++pName )
+ *pName = it->first;
+ return aResult;
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return ( IdToOleNameHash.find( aName ) != IdToOleNameHash.end() );
+ }
+
+ // XElementAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return IdToOleNameHash.size();
+ }
+ // XNameContainer
+ virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( hasByName( aName ) )
+ throw container::ElementExistException();
+ uno::Reference< container::XIndexContainer > xElement;
+ if ( ! ( aElement >>= xElement ) )
+ throw lang::IllegalArgumentException();
+ IdToOleNameHash[ aName ] = xElement;
+ }
+ virtual void SAL_CALL removeByName( const ::rtl::OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ IdToOleNameHash.erase( IdToOleNameHash.find( aName ) );
+ }
+ virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ uno::Reference< container::XIndexContainer > xElement;
+ if ( ! ( aElement >>= xElement ) )
+ throw lang::IllegalArgumentException();
+ IdToOleNameHash[ aName ] = xElement;
+ }
+};
+
+// defined in docfunc.cxx ( really this needs a new name )
+script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule );
ImportExcel8::ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm ) :
ImportExcel( rImpData, rStrm )
@@ -178,7 +269,7 @@ void ImportExcel8::Boundsheet( void )
}
if( ( nGrbit & 0x0001 ) || ( nGrbit & 0x0002 ) )
- pD->SetVisible( nScTab, sal_False );
+ pD->SetVisible( nScTab, false );
if( !pD->RenameTab( nScTab, aName ) )
{
@@ -197,13 +288,13 @@ void ImportExcel8::Scenman( void )
aIn.Ignore( 4 );
aIn >> nLastDispl;
- aScenList.SetLast( nLastDispl );
+ aScenList.nLastScenario = nLastDispl;
}
void ImportExcel8::Scenario( void )
{
- aScenList.Append( new ExcScenario( aIn, *pExcRoot ) );
+ aScenList.aEntries.push_back( new ExcScenario( aIn, *pExcRoot ) );
}
@@ -236,37 +327,70 @@ void ImportExcel8::ReadBasic( void )
SotStorageRef xRootStrg = GetRootStorage();
if( pShell && xRootStrg.Is() ) try
{
- uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext(), uno::UNO_SET_THROW );
- uno::Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), uno::UNO_SET_THROW );
- uno::Sequence< beans::NamedValue > aArgSeq( 1 );
- aArgSeq[ 0 ].Name = CREATE_OUSTRING( "ColorPalette" );
- aArgSeq[ 0 ].Value <<= GetPalette().CreateColorSequence();
-
- uno::Sequence< uno::Any > aArgs( 2 );
- // framework calls filter objects with factory as first argument
- aArgs[ 0 ] <<= xFactory;
- aArgs[ 1 ] <<= aArgSeq;
-
- uno::Reference< document::XImporter > xImporter( xFactory->createInstanceWithArgumentsAndContext(
- CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" ), aArgs, xContext ), uno::UNO_QUERY_THROW );
-
- uno::Reference< lang::XComponent > xComponent( pShell->GetModel(), uno::UNO_QUERY_THROW );
- xImporter->setTargetDocument( xComponent );
-
- MediaDescriptor aMediaDesc;
- SfxMedium& rMedium = GetMedium();
- SfxItemSet* pItemSet = rMedium.GetItemSet();
- if( pItemSet )
+ bool bLoadCode = pFilterOpt->IsLoadExcelBasicCode();
+ bool bLoadExecutable = pFilterOpt->IsLoadExcelBasicExecutable();
+ bool bLoadStrg = pFilterOpt->IsLoadExcelBasicStorage();
+ // #FIXME need to get rid of this, we can also do this from within oox
+ // via the "ooo.vba.VBAGlobals" service
+ if( bLoadCode || bLoadStrg )
+ {
+ bool bAsComment = !bLoadExecutable;
+
+ if ( !bAsComment )
+ {
+ // see if we have the XCB stream
+ SvStorageStreamRef xXCB = xRootStrg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "XCB" ) ), STREAM_STD_READ | STREAM_NOCREATE );
+ if ( xXCB.Is()|| SVSTREAM_OK == xXCB->GetError() )
+ {
+ CTBWrapper wrapper;
+ if ( wrapper.Read( xXCB ) )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ wrapper.Print( stderr );
+#endif
+ wrapper.ImportCustomToolBar( *pShell );
+ }
+ }
+ }
+ }
+ try
+ {
+ uno::Reference< lang::XComponent > xComponent( pShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Sequence< beans::NamedValue > aArgSeq( 1 );
+
+ // collect names of embedded form controls, as specified in the VBA project
+ aArgSeq[ 0 ].Name = CREATE_OUSTRING( "OleNameOverrideInfo" );
+ uno::Reference< container::XNameContainer > xOleNameOverrideSink( new OleNameOverrideContainer );
+ aArgSeq[ 0 ].Value <<= xOleNameOverrideSink;
+
+ uno::Sequence< uno::Any > aArgs( 2 );
+ // framework calls filter objects with factory as first argument
+ aArgs[ 0 ] <<= getProcessServiceFactory();
+ aArgs[ 1 ] <<= aArgSeq;
+
+ uno::Reference< document::XImporter > xImporter( ScfApiHelper::CreateInstanceWithArgs( CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelVBAProjectFilter" ), aArgs ), uno::UNO_QUERY_THROW );
+ xImporter->setTargetDocument( xComponent );
+
+ MediaDescriptor aMediaDesc;
+ SfxMedium& rMedium = GetMedium();
+ SfxItemSet* pItemSet = rMedium.GetItemSet();
+ if( pItemSet )
+ {
+ if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) )
+ aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pItem->GetValue() );
+ if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_PASSWORD ) ) )
+ aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pItem->GetValue() );
+ }
+ aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= rMedium.GetInputStream();
+ aMediaDesc[ MediaDescriptor::PROP_INTERACTIONHANDLER() ] <<= rMedium.GetInteractionHandler();
+
+ // call the filter
+ uno::Reference< document::XFilter > xFilter( xImporter, uno::UNO_QUERY_THROW );
+ xFilter->filter( aMediaDesc.getAsConstPropertyValueList() );
+ GetObjectManager().SetOleNameOverrideInfo( xOleNameOverrideSink );
+ }
+ catch( uno::Exception& )
{
- SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
- if( pFileNameItem )
- aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pFileNameItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
- if( pPasswordItem )
- aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pPasswordItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
- if( pEncryptionDataItem )
- aMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] = pEncryptionDataItem->GetValue();
}
aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] <<= rMedium.GetInputStream();
aMediaDesc[ MediaDescriptor::PROP_INTERACTIONHANDLER() ] <<= rMedium.GetInteractionHandler();
@@ -283,8 +407,9 @@ void ImportExcel8::ReadBasic( void )
void ImportExcel8::EndSheet( void )
{
- GetCondFormatManager().Apply();
ImportExcel::EndSheet();
+ GetCondFormatManager().Apply();
+ GetValidationManager().Apply();
}
@@ -304,7 +429,7 @@ void ImportExcel8::PostDocLoad( void )
ImportExcel::PostDocLoad();
// Scenarien bemachen! ACHTUNG: Hier wird Tabellen-Anzahl im Dokument erhoeht!!
- if( !pD->IsClipboard() && aScenList.Count() )
+ if( !pD->IsClipboard() && aScenList.aEntries.size() )
{
pD->UpdateChartListenerCollection(); // references in charts must be updated
@@ -382,10 +507,10 @@ XclImpAutoFilterData::XclImpAutoFilterData( RootData* pRoot, const ScRange& rRan
ExcRoot( pRoot ),
pCurrDBData(NULL),
nFirstEmpty( 0 ),
- bActive( sal_False ),
- bHasConflict( sal_False ),
- bCriteria( sal_False ),
- bAutoOrAdvanced(sal_False),
+ bActive( false ),
+ bHasConflict( false ),
+ bCriteria( false ),
+ bAutoOrAdvanced(false),
aFilterName(rName)
{
aParam.nCol1 = rRange.aStart.Col();
@@ -514,7 +639,7 @@ void XclImpAutoFilterData::ReadAutoFilter( XclImpStream& rStrm )
{
ScQueryEntry& aEntry = aParam.GetEntry( nFirstEmpty );
pQueryEntries[ nE ] = &aEntry;
- bIgnore = sal_False;
+ bIgnore = false;
rStrm >> nType >> nOper;
switch( nOper )
@@ -565,12 +690,12 @@ void XclImpAutoFilterData::ReadAutoFilter( XclImpStream& rStrm )
bIgnore = (sal_Bool) nBoolErr;
break;
case EXC_AFTYPE_EMPTY:
- aEntry.bQueryByString = sal_False;
+ aEntry.bQueryByString = false;
aEntry.nVal = SC_EMPTYFIELDS;
aEntry.eOp = SC_EQUAL;
break;
case EXC_AFTYPE_NOTEMPTY:
- aEntry.bQueryByString = sal_False;
+ aEntry.bQueryByString = false;
aEntry.nVal = SC_NONEMPTYFIELDS;
aEntry.eOp = SC_EQUAL;
break;
@@ -618,7 +743,7 @@ void XclImpAutoFilterData::SetAdvancedRange( const ScRange* pRange )
bCriteria = sal_True;
}
else
- bCriteria = sal_False;
+ bCriteria = false;
}
void XclImpAutoFilterData::SetExtractPos( const ScAddress& rAddr )
@@ -626,7 +751,7 @@ void XclImpAutoFilterData::SetExtractPos( const ScAddress& rAddr )
aParam.nDestCol = rAddr.Col();
aParam.nDestRow = rAddr.Row();
aParam.nDestTab = rAddr.Tab();
- aParam.bInplace = sal_False;
+ aParam.bInplace = false;
aParam.bDestPers = sal_True;
}
@@ -758,3 +883,4 @@ XclImpAutoFilterData* XclImpAutoFilterBuffer::GetByTab( SCTAB nTab )
return NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index d6dcf43fe915..ec4c425c1621 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -152,6 +153,10 @@ void ExcRecord::WriteBody( XclExpStream& rStrm )
SaveCont( rStrm );
}
+void ExcRecord::SaveXml( XclExpXmlStream& /*rStrm*/ )
+{
+}
+
//--------------------------------------------------------- class ExcEmptyRec -
@@ -353,7 +358,8 @@ const sal_uInt8* ExcDummy_041::GetData( void ) const
Exc1904::Exc1904( ScDocument& rDoc )
{
Date* pDate = rDoc.GetFormatTable()->GetNullDate();
- bVal = pDate ? (*pDate == Date( 1, 1, 1904 )) : sal_False;
+ bVal = pDate ? (*pDate == Date( 1, 1, 1904 )) : false;
+ bDateCompatibility = pDate ? !( *pDate == Date( 30, 12, 1899 )) : false;
}
@@ -365,9 +371,21 @@ sal_uInt16 Exc1904::GetNum( void ) const
void Exc1904::SaveXml( XclExpXmlStream& rStrm )
{
- rStrm.WriteAttributes(
+ bool bISOIEC = ( rStrm.getVersion() == oox::core::ISOIEC_29500_2008 );
+
+ if( bISOIEC )
+ {
+ rStrm.WriteAttributes(
+ XML_dateCompatibility, XclXmlUtils::ToPsz( bDateCompatibility ),
+ FSEND );
+ }
+
+ if( !bISOIEC || bDateCompatibility )
+ {
+ rStrm.WriteAttributes(
XML_date1904, XclXmlUtils::ToPsz( bVal ),
FSEND );
+ }
}
@@ -664,7 +682,7 @@ sal_Bool XclExpAutofilter::AddCondition( ScQueryConnect eConn, sal_uInt8 nType,
double fVal, String* pText, sal_Bool bSimple )
{
if( !aCond[ 1 ].IsEmpty() )
- return sal_False;
+ return false;
sal_uInt16 nInd = aCond[ 0 ].IsEmpty() ? 0 : 1;
@@ -682,7 +700,7 @@ sal_Bool XclExpAutofilter::AddCondition( ScQueryConnect eConn, sal_uInt8 nType,
sal_Bool XclExpAutofilter::AddEntry( const ScQueryEntry& rEntry )
{
- sal_Bool bConflict = sal_False;
+ sal_Bool bConflict = false;
String sText;
if( rEntry.pStr )
@@ -836,14 +854,15 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ) :
XclExpRoot( rRoot ),
pFilterMode( NULL ),
pFilterInfo( NULL )
+ , mbAutoFilter (false)
{
ScDBCollection& rDBColl = GetDatabaseRanges();
XclExpNameManager& rNameMgr = GetNameManager();
// search for first DB-range with filter
sal_uInt16 nIndex = 0;
- sal_Bool bFound = sal_False;
- sal_Bool bAdvanced = sal_False;
+ sal_Bool bFound = false;
+ sal_Bool bAdvanced = false;
ScDBData* pData = NULL;
ScRange aAdvRange;
while( (nIndex < rDBColl.GetCount()) && !bFound )
@@ -872,7 +891,7 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ) :
maRef = aRange;
- // #i2394# #100489# built-in defined names must be sorted by containing sheet name
+ // #i2394# built-in defined names must be sorted by containing sheet name
rNameMgr.InsertBuiltInName( EXC_BUILTIN_FILTERDATABASE, aRange );
// advanced filter
@@ -896,9 +915,9 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ) :
// AutoFilter
else
{
- sal_Bool bConflict = sal_False;
+ sal_Bool bConflict = false;
sal_Bool bContLoop = sal_True;
- sal_Bool bHasOr = sal_False;
+ sal_Bool bHasOr = false;
SCCOLROW nFirstField = aParam.GetEntry( 0 ).nField;
// create AUTOFILTER records for filtered columns
@@ -936,6 +955,9 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ) :
if( !maFilterList.IsEmpty() )
pFilterMode = new XclExpFiltermode;
pFilterInfo = new XclExpAutofilterinfo( aRange.aStart, nColCnt );
+
+ if (maFilterList.IsEmpty () && !bConflict)
+ mbAutoFilter = true;
}
}
}
@@ -965,7 +987,7 @@ sal_Bool ExcAutoFilterRecs::IsFiltered( SCCOL nCol )
for( size_t nPos = 0, nSize = maFilterList.GetSize(); nPos < nSize; ++nPos )
if( maFilterList.GetRecord( nPos )->GetCol() == static_cast<sal_uInt16>(nCol) )
return sal_True;
- return sal_False;
+ return false;
}
void ExcAutoFilterRecs::AddObjRecs()
@@ -993,7 +1015,7 @@ void ExcAutoFilterRecs::Save( XclExpStream& rStrm )
void ExcAutoFilterRecs::SaveXml( XclExpXmlStream& rStrm )
{
- if( maFilterList.IsEmpty() )
+ if( maFilterList.IsEmpty() && !mbAutoFilter )
return;
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
@@ -1001,7 +1023,8 @@ void ExcAutoFilterRecs::SaveXml( XclExpXmlStream& rStrm )
XML_ref, XclXmlUtils::ToOString( maRef ).getStr(),
FSEND );
// OOXTODO: XML_extLst, XML_sortState
- maFilterList.SaveXml( rStrm );
+ if( !maFilterList.IsEmpty() )
+ maFilterList.SaveXml( rStrm );
rWorksheet->endElement( XML_autoFilter );
}
@@ -1047,3 +1070,4 @@ bool XclExpFilterManager::HasFilterMode( SCTAB nScTab )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx
index e075a3159b5d..2b442a240bb8 100644
--- a/sc/source/filter/excel/exctools.cxx
+++ b/sc/source/filter/excel/exctools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,7 +60,7 @@
#include "xilink.hxx"
#include "xecontent.hxx"
-// - ALLGEMEINE ----------------------------------------------------------
+#include <vector>
RootData::RootData( void )
{
@@ -91,214 +92,106 @@ RootData::~RootData()
}
-
-
-XclImpOutlineBuffer::XclImpOutlineBuffer( SCSIZE nNewSize )
+XclImpOutlineBuffer::XclImpOutlineBuffer( SCSIZE nNewSize ) :
+ maLevels(0, nNewSize, 0),
+ mpOutlineArray(NULL),
+ mnEndPos(nNewSize),
+ mnMaxLevel(0),
+ mbButtonAfter(true)
{
- DBG_ASSERT( nNewSize > 0, "-OutlineBuffer::Ctor: nNewSize == 0!" );
-
- nSize = nNewSize + 1;
- pLevel = new sal_uInt8[ nSize ];
- pOuted = new sal_Bool[ nSize ];
- pHidden = new sal_Bool[ nSize ];
- pOutlineArray = NULL;
-
- Reset();
}
-
XclImpOutlineBuffer::~XclImpOutlineBuffer()
{
- delete[] pLevel;
- delete[] pOuted;
- delete[] pHidden;
}
-
-void XclImpOutlineBuffer::SetLevel( SCSIZE nIndex, sal_uInt8 nVal, sal_Bool bOuted, sal_Bool bHidden )
+void XclImpOutlineBuffer::SetLevel( SCSIZE nIndex, sal_uInt8 nVal, bool bCollapsed )
{
- if( nIndex < nSize )
- {
- pLevel[ nIndex ] = nVal;
- pOuted[ nIndex ] = bOuted;
- pHidden[ nIndex ] = bHidden;
-
- if( nIndex > nLast )
- nLast = nIndex;
- if( nVal > nMaxLevel )
- nMaxLevel = nVal;
- }
+ maLevels.insert_back(nIndex, nIndex+1, nVal);
+ if (nVal > mnMaxLevel)
+ mnMaxLevel = nVal;
+ if (bCollapsed)
+ maCollapsedPosSet.insert(nIndex);
}
-
void XclImpOutlineBuffer::SetOutlineArray( ScOutlineArray* pOArray )
{
- pOutlineArray = pOArray;
+ mpOutlineArray = pOArray;
}
-
-// transtorm xcl-outline into SC-outline
-void XclImpOutlineBuffer::MakeScOutline( void )
+void XclImpOutlineBuffer::MakeScOutline()
{
- if( !pOutlineArray || !HasOutline() )
+ if (!mpOutlineArray)
return;
- const sal_uInt16 nNumLev = 8;
- sal_Bool bPreOutedLevel = sal_False;
- sal_uInt8 nCurrLevel = 0;
- sal_Bool bMakeHidden[ nNumLev ];
- sal_Bool bMakeVisible[ nNumLev + 1 ];
-
- sal_uInt16 nLevel;
- for( nLevel = 0; nLevel < nNumLev; ++nLevel )
- bMakeHidden[ nLevel ] = sal_False;
- for( nLevel = 0; nLevel <= nNumLev; ++nLevel )
- bMakeVisible[ nLevel ] = sal_True;
- if( nLast < (nSize - 1) )
- nLast++;
-
- // search for hidden attributes at end of level, move them to begin
- if( bButtonNormal )
+ ::std::vector<SCSIZE> aOutlineStack;
+ aOutlineStack.reserve(mnMaxLevel);
+ OutlineLevels::const_iterator itr = maLevels.begin(), itrEnd = maLevels.end();
+ for (; itr != itrEnd; ++itr)
{
- for( sal_uInt8 nWorkLevel = 1; nWorkLevel <= nMaxLevel; nWorkLevel++ )
+ SCSIZE nPos = itr->first;
+ if (nPos >= mnEndPos)
{
- sal_uInt16 nStartPos = 0;
- sal_uInt8 nCurrLevel2 = 0;
- sal_uInt8 nPrevLevel = 0;
-
- for( SCSIZE nC = 0 ; nC <= nLast ; nC++ )
- {
- nPrevLevel = nCurrLevel2;
- nCurrLevel2 = pLevel[ nC ];
- if( (nPrevLevel < nWorkLevel) && (nCurrLevel2 >= nWorkLevel) )
- nStartPos = static_cast< sal_uInt16 >( nC );
- else if( (nPrevLevel >= nWorkLevel) && (nCurrLevel2 < nWorkLevel) )
- {
- if( pOuted[ nC ] && pHidden[ nStartPos ] )
- {
- if( nStartPos )
- pOuted[ nStartPos - 1 ] = sal_True;
- else
- bPreOutedLevel = sal_True;
- pOuted[ nC ] = sal_False;
- }
- }
- }
+ // Don't go beyond the max allowed position.
+ DBG_ASSERT(aOutlineStack.empty(), "XclImpOutlineBuffer::MakeScOutline: outline stack not empty but expected to be.");
+ break;
}
- }
- else
- bPreOutedLevel = pHidden[ 0 ];
-
- // generate SC outlines
- sal_uInt16 nPrevC;
- sal_uInt16 nStart[ nNumLev ];
- sal_Bool bDummy;
- sal_Bool bPrevOuted = bPreOutedLevel;
- sal_Bool bCurrHidden = sal_False;
- sal_Bool bPrevHidden = sal_False;
-
- for( SCSIZE nC = 0; nC <= nLast; nC++ )
- {
- sal_uInt8 nWorkLevel = pLevel[ nC ];
-
- nPrevC = static_cast< sal_uInt16 >( nC ? nC - 1 : 0 );
- bPrevHidden = bCurrHidden;
- bCurrHidden = pHidden[ nC ];
-
- // open new levels
- while( nWorkLevel > nCurrLevel )
+ sal_uInt8 nLevel = itr->second;
+ sal_uInt8 nCurLevel = static_cast<sal_uInt8>(aOutlineStack.size());
+ if (nLevel > nCurLevel)
{
- nCurrLevel++;
- bMakeHidden[ nCurrLevel ] = bPrevOuted;
- bMakeVisible[ nCurrLevel + 1 ] =
- bMakeVisible[ nCurrLevel ] && !bMakeHidden[ nCurrLevel ];
- nStart[ nCurrLevel ] = static_cast< sal_uInt16 >( nC );
+ for (sal_uInt8 i = 0; i < nLevel - nCurLevel; ++i)
+ aOutlineStack.push_back(nPos);
}
- // close levels
- while( nWorkLevel < nCurrLevel )
+ else
{
- sal_Bool bLastLevel = (nWorkLevel == (nCurrLevel - 1));
- sal_Bool bRealHidden = (bMakeHidden[ nCurrLevel ] && bPrevHidden );
- sal_Bool bRealVisible = (bMakeVisible[ nCurrLevel ] ||
- (!bCurrHidden && bLastLevel));
-
- pOutlineArray->Insert( nStart[ nCurrLevel ], nPrevC , bDummy,
- bRealHidden, bRealVisible );
- nCurrLevel--;
+ DBG_ASSERT(nLevel < nCurLevel, "XclImpOutlineBuffer::MakeScOutline: unexpected level!");
+ for (sal_uInt8 i = 0; i < nCurLevel - nLevel; ++i)
+ {
+ if (aOutlineStack.empty())
+ {
+ // Something is wrong.
+ return;
+ }
+ SCSIZE nFirstPos = aOutlineStack.back();
+ aOutlineStack.pop_back();
+ bool bCollapsed = false;
+ if (mbButtonAfter)
+ bCollapsed = maCollapsedPosSet.count(nPos) > 0;
+ else if (nFirstPos > 0)
+ bCollapsed = maCollapsedPosSet.count(nFirstPos-1) > 0;
+
+ sal_Bool bDummy;
+ mpOutlineArray->Insert(nFirstPos, nPos-1, bDummy, bCollapsed);
+ }
}
-
- bPrevOuted = pOuted[ nC ];
}
}
-
-void XclImpOutlineBuffer::SetLevelRange( SCSIZE nF, SCSIZE nL, sal_uInt8 nVal,
- sal_Bool bOuted, sal_Bool bHidden )
+void XclImpOutlineBuffer::SetLevelRange( SCSIZE nF, SCSIZE nL, sal_uInt8 nVal, bool bCollapsed )
{
- DBG_ASSERT( nF <= nL, "+OutlineBuffer::SetLevelRange(): Last < First!" );
-
- if( nL < nSize )
- {
- if( nL > nLast )
- nLast = nL;
-
- sal_uInt8* pLevelCount;
- sal_uInt8* pLast;
- sal_Bool* pOutedCount;
- sal_Bool* pHiddenCount;
-
- pLevelCount = &pLevel[ nF ];
- pLast = &pLevel[ nL ];
- pOutedCount = &pOuted[ nF ];
- pHiddenCount = &pHidden[ nF ];
-
- while( pLevelCount <= pLast )
- {
- *( pLevelCount++ ) = nVal;
- *( pOutedCount++ ) = bOuted;
- *( pHiddenCount++ ) = bHidden;
- }
-
- if( nVal > nMaxLevel )
- nMaxLevel = nVal;
- }
-}
+ if (nF > nL)
+ // invalid range
+ return;
+ maLevels.insert_back(nF, nL+1, nVal);
-void XclImpOutlineBuffer::Reset( void )
-{
- for( SCSIZE nC = 0 ; nC < nSize ; nC++ )
- {
- pLevel[ nC ] = 0;
- pOuted[ nC ] = pHidden[ nC ] = sal_False;
- }
- nLast = 0;
- nMaxLevel = 0;
+ if (bCollapsed)
+ maCollapsedPosSet.insert(nF);
}
-
-//___________________________________________________________________
-
-
-ExcScenarioCell::ExcScenarioCell( const sal_uInt16 nC, const sal_uInt16 nR ) : nCol( nC ), nRow( nR )
+void XclImpOutlineBuffer::SetButtonMode( bool bRightOrUnder )
{
+ mbButtonAfter = bRightOrUnder;
}
-
-void ExcScenarioCell::SetValue( const String& r )
+ExcScenarioCell::ExcScenarioCell( const UINT16 nC, const UINT16 nR )
+ : nCol( nC ), nRow( nR )
{
- aValue = r;
}
-
-
-
-#define EXCSCAPPEND(EXCSCCELL) (List::Insert(EXCSCCELL,LIST_APPEND))
-#define EXCSCFIRST() ((ExcScenarioCell*)List::First())
-#define EXCSCNEXT() ((ExcScenarioCell*)List::Next())
-
-
-ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR ) : nTab( rR.pIR->GetCurrScTab() )
+ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR )
+ : nTab( rR.pIR->GetCurrScTab() )
{
sal_uInt16 nCref;
sal_uInt8 nName, nComment;
@@ -330,32 +223,20 @@ ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR ) : nTab( rR.pIR
{
rIn >> nR >> nC;
- EXCSCAPPEND( new ExcScenarioCell( nC, nR ) );
+ aEntries.push_back(new ExcScenarioCell( nC, nR ));
n--;
}
n = nCref;
- ExcScenarioCell* p = EXCSCFIRST();
- while( p )
- {
- p->SetValue( rIn.ReadUniString() );
- p = EXCSCNEXT();
- }
+ boost::ptr_vector<ExcScenarioCell>::iterator iter;
+ for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
+ iter->SetValue(rIn.ReadUniString());
}
-
ExcScenario::~ExcScenario()
{
- ExcScenarioCell* p = EXCSCFIRST();
-
- while( p )
- {
- delete p;
- p = EXCSCNEXT();
- }
-
if( pName )
delete pName;
if( pComment )
@@ -364,38 +245,35 @@ ExcScenario::~ExcScenario()
delete pUserName;
}
-
void ExcScenario::Apply( const XclImpRoot& rRoot, const sal_Bool bLast )
{
ScDocument& r = rRoot.GetDoc();
- ExcScenarioCell* p = EXCSCFIRST();
String aSzenName( *pName );
sal_uInt16 nNewTab = nTab + 1;
if( !r.InsertTab( nNewTab, aSzenName ) )
return;
- r.SetScenario( nNewTab, sal_True );
- // #112621# do not show scenario frames
+ r.SetScenario( nNewTab, true );
+ // do not show scenario frames
r.SetScenarioData( nNewTab, *pComment, COL_LIGHTGRAY, /*SC_SCENARIO_SHOWFRAME|*/SC_SCENARIO_COPYALL|(nProtected ? SC_SCENARIO_PROTECT : 0) );
- while( p )
+ boost::ptr_vector<ExcScenarioCell>::const_iterator iter;
+ for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
{
- sal_uInt16 nCol = p->nCol;
- sal_uInt16 nRow = p->nRow;
- String aVal = p->GetValue();
+ UINT16 nCol = iter->nCol;
+ UINT16 nRow = iter->nRow;
+ String aVal = iter->GetValue();
r.ApplyFlagsTab( nCol, nRow, nCol, nRow, nNewTab, SC_MF_SCENARIO );
r.SetString( nCol, nRow, nNewTab, aVal );
-
- p = EXCSCNEXT();
}
if( bLast )
r.SetActiveScenario( nNewTab, sal_True );
- // #111896# modify what the Active tab is set to if the new
+ // modify what the Active tab is set to if the new
// scenario tab occurs before the active tab.
ScExtDocSettings& rDocSett = rRoot.GetExtDocOptions().GetDocSettings();
if( (static_cast< SCCOL >( nTab ) < rDocSett.mnDisplTab) && (rDocSett.mnDisplTab < MAXTAB) )
@@ -403,32 +281,16 @@ void ExcScenario::Apply( const XclImpRoot& rRoot, const sal_Bool bLast )
rRoot.GetTabInfo().InsertScTab( nNewTab );
}
-
-
-
-ExcScenarioList::~ExcScenarioList()
-{
- ExcScenario* p = _First();
-
- while( p )
- {
- delete p;
- p = _Next();
- }
-}
-
-
void ExcScenarioList::Apply( const XclImpRoot& rRoot )
{
- ExcScenario* p = _Last();
- sal_uInt16 n = ( sal_uInt16 ) Count();
+ sal_uInt16 n = static_cast<sal_uInt16>(aEntries.size());
- while( p )
+ boost::ptr_vector<ExcScenario>::reverse_iterator iter;
+ for (iter = aEntries.rbegin(); iter != aEntries.rend(); ++iter)
{
n--;
- p->Apply( rRoot, ( sal_Bool ) ( n == nLastScenario ) );
- p = _Prev();
+ iter->Apply(rRoot, n == nLastScenario);
}
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx
index 02c71d9414c8..f52c0d7feec2 100644
--- a/sc/source/filter/excel/expop2.cxx
+++ b/sc/source/filter/excel/expop2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,7 +119,7 @@ FltError ExportBiff5::Write()
if ( SvtFilterOptions::Get()->IsEnableCalcPreview() )
{
::boost::shared_ptr<GDIMetaFile> pMetaFile =
- pDocShell->GetPreviewMetaFile (sal_False);
+ pDocShell->GetPreviewMetaFile (false);
uno::Sequence<sal_uInt8> metaFile(
sfx2::convertMetaFile(pMetaFile.get()));
sfx2::SaveOlePropertySet(xDocProps, xRootStrg, &metaFile);
@@ -147,73 +148,4 @@ ExportBiff8::ExportBiff8( XclExpRootData& rExpData, SvStream& rStrm ) :
ExportBiff8::~ExportBiff8()
{
}
-
-
-ExportXml2007::ExportXml2007( XclExpRootData& rExpData, SvStream& rStrm )
- : ExportTyp( rStrm, &rExpData.mrDoc, rExpData.meTextEnc )
- , XclExpRoot( rExpData )
-{
- pExcRoot = &GetOldRoot();
- pExcRoot->pER = this;
- pExcRoot->eDateiTyp = Biff8;
- pExcDoc = new ExcDocument( *this );
-}
-
-
-ExportXml2007::~ExportXml2007()
-{
- delete pExcDoc;
-}
-
-
-FltError ExportXml2007::Write()
-{
- SfxObjectShell* pDocShell = GetDocShell();
- DBG_ASSERT( pDocShell, "ExportXml2007::Write - no document shell" );
-
- SotStorageRef xRootStrg = GetRootStorage();
- DBG_ASSERT( xRootStrg.Is(), "ExportXml2007::Write - no root storage" );
-
- bool bWriteBasicCode = false;
- bool bWriteBasicStrg = false;
-
- if( SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get() )
- {
- bWriteBasicCode = pFilterOpt->IsLoadExcelBasicCode();
- bWriteBasicStrg = pFilterOpt->IsLoadExcelBasicStorage();
- }
-
- if( pDocShell && xRootStrg.Is() && bWriteBasicStrg )
- {
- SvxImportMSVBasic aBasicImport( *pDocShell, *xRootStrg, bWriteBasicCode, bWriteBasicStrg );
- sal_uLong nErr = aBasicImport.SaveOrDelMSVBAStorage( sal_True, EXC_STORAGE_VBA_PROJECT );
- if( nErr != ERRCODE_NONE )
- pDocShell->SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
- }
-
- pExcDoc->ReadDoc(); // ScDoc -> ExcDoc
- pExcDoc->WriteXml( aOut ); // wechstreamen
-
- if( pDocShell && xRootStrg.Is() )
- {
- using namespace ::com::sun::star;
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- pDocShell->GetModel(), uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentProperties> xDocProps
- = xDPS->getDocumentProperties();
- ::boost::shared_ptr<GDIMetaFile> pMetaFile =
- pDocShell->GetPreviewMetaFile (sal_False);
- uno::Sequence<sal_uInt8> metaFile(
- sfx2::convertMetaFile(pMetaFile.get()));
- sfx2::SaveOlePropertySet(xDocProps, xRootStrg, &metaFile);
- }
-
- //! TODO: separate warnings for columns and sheets
- const XclExpAddressConverter& rAddrConv = GetAddressConverter();
- if( rAddrConv.IsColTruncated() || rAddrConv.IsRowTruncated() || rAddrConv.IsTabTruncated() )
- return SCWARN_EXPORT_MAXROW;
-
- return eERR_OK;
-}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/fontbuff.cxx b/sc/source/filter/excel/fontbuff.cxx
index 9eda8b2ebc39..26db50f0166f 100644
--- a/sc/source/filter/excel/fontbuff.cxx
+++ b/sc/source/filter/excel/fontbuff.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -161,3 +162,4 @@ void LotusFontBuffer::MakeFont( ENTRY* pEntry )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx
index 7c2dccb3659d..0b34736d8c8f 100644
--- a/sc/source/filter/excel/frmbase.cxx
+++ b/sc/source/filter/excel/frmbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,41 +29,20 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
-
#include "formel.hxx"
-
-
-
-_ScRangeList::~_ScRangeList()
-{
- ScRange* p = ( ScRange* ) First();
-
- while( p )
- {
- delete p;
- p = ( ScRange* ) Next();
- }
-}
-
-
-
-
-_ScRangeListTabs::_ScRangeListTabs( void )
+_ScRangeListTabs::_ScRangeListTabs()
{
ppTabLists = new _ScRangeList*[ MAXTAB + 1 ];
for( sal_uInt16 n = 0 ; n <= MAXTAB ; n++ )
ppTabLists[ n ] = NULL;
- bHasRanges = sal_False;
+ bHasRanges = false;
pAct = NULL;
nAct = 0;
}
-
_ScRangeListTabs::~_ScRangeListTabs()
{
if( bHasRanges )
@@ -78,7 +58,7 @@ _ScRangeListTabs::~_ScRangeListTabs()
}
-void _ScRangeListTabs::Append( ScSingleRefData a, const sal_Bool b )
+void _ScRangeListTabs::Append( ScSingleRefData a, SCsTAB nTab, const sal_Bool b )
{
if( b )
{
@@ -98,23 +78,27 @@ void _ScRangeListTabs::Append( ScSingleRefData a, const sal_Bool b )
bHasRanges = sal_True;
- if( a.nTab >= 0 )
+ if( nTab == SCTAB_MAX)
+ return;
+ if( nTab < 0)
+ nTab = a.nTab;
+
+ if( nTab >= 0 && nTab <= MAXTAB)
{
- _ScRangeList* p = ppTabLists[ a.nTab ];
+ _ScRangeList* p = ppTabLists[ nTab ];
if( !p )
- p = ppTabLists[ a.nTab ] = new _ScRangeList;
+ p = ppTabLists[ nTab ] = new _ScRangeList;
- p->Append( a );
+ p->push_back(new ScRange(a.nCol,a.nRow,a.nTab));
}
}
-
-void _ScRangeListTabs::Append( ScComplexRefData a, const sal_Bool b )
+void _ScRangeListTabs::Append( ScComplexRefData a, SCsTAB nTab, const sal_Bool b )
{
if( b )
{
- // #96263# ignore 3D ranges
+ // ignore 3D ranges
if( a.Ref1.nTab != a.Ref2.nTab )
return;
@@ -158,19 +142,25 @@ void _ScRangeListTabs::Append( ScComplexRefData a, const sal_Bool b )
bHasRanges = sal_True;
- if( a.Ref1.nTab >= 0 )
+ if( nTab == SCTAB_MAX)
+ return;
+
+ if( nTab < -1)
+ nTab = a.Ref1.nTab;
+
+ if( nTab >= 0 && nTab <= MAXTAB)
{
- _ScRangeList* p = ppTabLists[ a.Ref1.nTab ];
+ _ScRangeList* p = ppTabLists[ nTab ];
if( !p )
- p = ppTabLists[ a.Ref1.nTab ] = new _ScRangeList;
+ p = ppTabLists[ nTab ] = new _ScRangeList;
- p->Append( a );
+ p->push_back(new ScRange(a.Ref1.nCol,a.Ref1.nRow,a.Ref1.nTab,
+ a.Ref2.nCol,a.Ref2.nRow,a.Ref2.nTab));
}
}
-
-const ScRange* _ScRangeListTabs::First( const sal_uInt16 n )
+const ScRange* _ScRangeListTabs::First( const UINT16 n )
{
DBG_ASSERT( ValidTab(n), "-_ScRangeListTabs::First(): Und tschuessssssss!" );
@@ -178,27 +168,25 @@ const ScRange* _ScRangeListTabs::First( const sal_uInt16 n )
{
pAct = ppTabLists[ n ];
nAct = n;
- return pAct->First();
+ pAct->iterCur = pAct->begin();
+ return &(*(pAct->iterCur));
}
- else
- {
- pAct = NULL;
- nAct = 0;
- return NULL;
- }
-}
+ pAct = NULL;
+ nAct = 0;
+ return NULL;
+}
-const ScRange* _ScRangeListTabs::Next( void )
+const ScRange* _ScRangeListTabs::Next ()
{
if( pAct )
- return pAct->Next();
- else
- return NULL;
-}
-
-
+ {
+ ++pAct->iterCur;
+ return &(*(pAct->iterCur));
+ }
+ return NULL;
+}
ConverterBase::ConverterBase( sal_uInt16 nNewBuffer ) :
aEingPos( 0, 0, 0 ),
@@ -259,20 +247,6 @@ LotusConverterBase::~LotusConverterBase()
{
}
-//UNUSED2008-05 void LotusConverterBase::Reset( sal_Int32 nLen, const ScAddress& rEingPos )
-//UNUSED2008-05 {
-//UNUSED2008-05 ConverterBase::Reset();
-//UNUSED2008-05 nBytesLeft = nLen;
-//UNUSED2008-05 aEingPos = rEingPos;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void LotusConverterBase::Reset( sal_Int32 nLen )
-//UNUSED2008-05 {
-//UNUSED2008-05 ConverterBase::Reset();
-//UNUSED2008-05 nBytesLeft = nLen;
-//UNUSED2008-05 aEingPos.Set( 0, 0, 0 );
-//UNUSED2008-05 }
-
void LotusConverterBase::Reset( const ScAddress& rEingPos )
{
ConverterBase::Reset();
@@ -280,3 +254,4 @@ void LotusConverterBase::Reset( const ScAddress& rEingPos )
aEingPos = rEingPos;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index f55911f3f3fb..7f862721a3b2 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,6 +48,7 @@
#include <svl/zforlist.hxx>
#include <sfx2/objsh.hxx>
+#include "tools/urlobj.hxx"
#include "docuno.hxx"
#include "cell.hxx"
@@ -137,7 +139,7 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
pExcRoot->pShrfmlaBuff = new ShrfmlaBuffer( pExcRoot ); //&aShrfrmlaBuff;
pExcRoot->pExtNameBuff = new ExtNameBuff ( *this );
- pExtNameBuff = new NameBuffer( pExcRoot ); //#94039# prevent empty rootdata
+ pExtNameBuff = new NameBuffer( pExcRoot ); //prevent empty rootdata
pExtNameBuff->SetBase( 1 );
pOutlineListBuffer = new XclImpOutlineListBuffer( );
@@ -145,7 +147,7 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
// ab Biff8
pFormConv = pExcRoot->pFmlaConverter = new ExcelToSc( GetRoot() );
- bTabTruncated = sal_False;
+ bTabTruncated = false;
// Excel-Dokument per Default auf 31.12.1899, entspricht Excel-Einstellungen mit 1.1.1900
ScDocOptions aOpt = pD->GetDocOptions();
@@ -155,8 +157,8 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
ScDocOptions aDocOpt( pD->GetDocOptions() );
aDocOpt.SetIgnoreCase( sal_True ); // always in Excel
- aDocOpt.SetFormulaRegexEnabled( sal_False ); // regular expressions? what's that?
- aDocOpt.SetLookUpColRowNames( sal_False ); // default: no natural language refs
+ aDocOpt.SetFormulaRegexEnabled( false ); // regular expressions? what's that?
+ aDocOpt.SetLookUpColRowNames( false ); // default: no natural language refs
pD->SetDocOptions( aDocOpt );
}
@@ -404,9 +406,7 @@ void ImportExcel::Row25( void )
aIn >> nGrbit;
sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 );
- pRowOutlineBuff->SetLevel( nRow, nLevel,
- ::get_flag( nGrbit, EXC_ROW_COLLAPSED ), ::get_flag( nGrbit, EXC_ROW_HIDDEN ) );
-
+ pRowOutlineBuff->SetLevel( nRow, nLevel, ::get_flag( nGrbit, EXC_ROW_COLLAPSED ) );
pColRowBuff->SetRowSettings( nRow, nRowHeight, nGrbit );
}
}
@@ -553,7 +553,7 @@ void ImportExcel::Externname25( void )
aIn >> nOpt >> nRes;
- String aName( aIn.ReadByteString( sal_False ) );
+ String aName( aIn.ReadByteString( false ) );
if( ( nOpt & 0x0001 ) || ( ( nOpt & 0xFFFE ) == 0x0000 ) )
{// external name
@@ -667,7 +667,7 @@ void ImportExcel::Colinfo( void )
bool bHidden = ::get_flag( nOpt, EXC_COLINFO_HIDDEN );
bool bCollapsed = ::get_flag( nOpt, EXC_COLINFO_COLLAPSED );
sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nOpt, 8, 3 );
- pColOutlineBuff->SetLevelRange( nColFirst, nColLast, nLevel, bCollapsed, bHidden );
+ pColOutlineBuff->SetLevelRange( nColFirst, nColLast, nLevel, bCollapsed );
if( bHidden )
pColRowBuff->HideColRange( nColFirst, nColLast );
@@ -702,7 +702,7 @@ void ImportExcel::Boundsheet( void )
aIn >> nGrbit;
}
- String aName( aIn.ReadByteString( sal_False ) );
+ String aName( aIn.ReadByteString( false ) );
SCTAB nScTab = static_cast< SCTAB >( nBdshtTab );
if( nScTab > 0 )
@@ -712,7 +712,7 @@ void ImportExcel::Boundsheet( void )
}
if( ( nGrbit & 0x0001 ) || ( nGrbit & 0x0002 ) )
- pD->SetVisible( nScTab, sal_False );
+ pD->SetVisible( nScTab, false );
if( !pD->RenameTab( nScTab, aName ) )
{
@@ -942,9 +942,7 @@ void ImportExcel::Row34( void )
aIn >> nGrbit >> nXF;
sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 );
- pRowOutlineBuff->SetLevel( nScRow, nLevel,
- ::get_flag( nGrbit, EXC_ROW_COLLAPSED ), ::get_flag( nGrbit, EXC_ROW_HIDDEN ) );
-
+ pRowOutlineBuff->SetLevel( nScRow, nLevel, ::get_flag( nGrbit, EXC_ROW_COLLAPSED ) );
pColRowBuff->SetRowSettings( nScRow, nRowHeight, nGrbit );
if( nGrbit & EXC_ROW_USEDEFXF )
@@ -1039,42 +1037,42 @@ void ImportExcel::TableOp( void )
case 0: // COL
aTabOpParam.aRefFormulaCell.Set(
static_cast<SCCOL>(nFirstCol),
- static_cast<SCROW>(nFirstRow - 1), nTab, sal_False,
- sal_False, sal_False );
+ static_cast<SCROW>(nFirstRow - 1), nTab, false,
+ false, false );
aTabOpParam.aRefFormulaEnd.Set(
static_cast<SCCOL>(nLastCol),
- static_cast<SCROW>(nFirstRow - 1), nTab, sal_False,
- sal_False, sal_False );
+ static_cast<SCROW>(nFirstRow - 1), nTab, false,
+ false, false );
aTabOpParam.aRefColCell.Set( static_cast<SCCOL>(nInpCol),
- static_cast<SCROW>(nInpRow), nTab, sal_False, sal_False,
- sal_False );
+ static_cast<SCROW>(nInpRow), nTab, false, false,
+ false );
nRow++;
break;
case 1: // ROW
aTabOpParam.aRefFormulaCell.Set(
static_cast<SCCOL>(nFirstCol - 1),
- static_cast<SCROW>(nFirstRow), nTab, sal_False, sal_False,
- sal_False );
+ static_cast<SCROW>(nFirstRow), nTab, false, false,
+ false );
aTabOpParam.aRefFormulaEnd.Set(
static_cast<SCCOL>(nFirstCol - 1),
- static_cast<SCROW>(nLastRow), nTab, sal_False, sal_False,
- sal_False );
+ static_cast<SCROW>(nLastRow), nTab, false, false,
+ false );
aTabOpParam.aRefRowCell.Set( static_cast<SCCOL>(nInpCol),
- static_cast<SCROW>(nInpRow), nTab, sal_False, sal_False,
- sal_False );
+ static_cast<SCROW>(nInpRow), nTab, false, false,
+ false );
nCol++;
break;
case 2: // TWO-INPUT
aTabOpParam.aRefFormulaCell.Set(
static_cast<SCCOL>(nFirstCol - 1),
- static_cast<SCROW>(nFirstRow - 1), nTab, sal_False,
- sal_False, sal_False );
+ static_cast<SCROW>(nFirstRow - 1), nTab, false,
+ false, false );
aTabOpParam.aRefRowCell.Set( static_cast<SCCOL>(nInpCol),
- static_cast<SCROW>(nInpRow), nTab, sal_False, sal_False,
- sal_False );
+ static_cast<SCROW>(nInpRow), nTab, false, false,
+ false );
aTabOpParam.aRefColCell.Set( static_cast<SCCOL>(nInpCol2),
- static_cast<SCROW>(nInpRow2), nTab, sal_False, sal_False,
- sal_False );
+ static_cast<SCROW>(nInpRow2), nTab, false, false,
+ false );
break;
}
@@ -1158,15 +1156,23 @@ void ImportExcel::NeueTabelle( void )
if( nTab > 0 && !pD->HasTable( nTab ) )
pD->MakeTable( nTab );
+ if (nTab == 0 && GetBiff() == EXC_BIFF2)
+ {
+ // For Excel 2.1 Worksheet file, we need to set the file name as the
+ // sheet name.
+ INetURLObject aURL(GetDocUrl());
+ pD->RenameTab(0, aURL.getBase(), false);
+ }
+
pExcRoot->pShrfmlaBuff->Clear();
InitializeTable( nTab );
- pOutlineListBuffer->Append( new XclImpOutlineDataBuffer( GetRoot(), nTab ) );
-
- pExcRoot->pColRowBuff = pColRowBuff = pOutlineListBuffer->Last()->GetColRowBuff();
- pColOutlineBuff = pOutlineListBuffer->Last()->GetColOutline();
- pRowOutlineBuff = pOutlineListBuffer->Last()->GetRowOutline();
+ XclImpOutlineDataBuffer* pNewItem = new XclImpOutlineDataBuffer( GetRoot(), nTab );
+ pOutlineListBuffer->push_back( pNewItem );
+ pExcRoot->pColRowBuff = pColRowBuff = pNewItem->GetColRowBuff();
+ pColOutlineBuff = pNewItem->GetColOutline();
+ pRowOutlineBuff = pNewItem->GetRowOutline();
}
@@ -1178,7 +1184,7 @@ const ScTokenArray* ImportExcel::ErrorToFormula( sal_uInt8 bErrOrVal, sal_uInt8
void ImportExcel::AdjustRowHeight()
{
- /* #93255# Speed up chart import: import all sheets without charts, then
+ /* Speed up chart import: import all sheets without charts, then
update row heights (here), last load all charts -> do not any longer
update inside of ScDocShell::ConvertFrom() (causes update of existing
charts during each and every change of row height). */
@@ -1196,8 +1202,8 @@ void ImportExcel::PostDocLoad( void )
pStyleSheet->GetItemSet().Put( SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 0 ) );
// outlines for all sheets, sets hidden rows and columns (#i11776# after filtered ranges)
- for( XclImpOutlineDataBuffer* pBuffer = pOutlineListBuffer->First(); pBuffer; pBuffer = pOutlineListBuffer->Next() )
- pBuffer->Convert();
+ for (XclImpOutlineListBuffer::iterator itBuffer = pOutlineListBuffer->begin(); itBuffer != pOutlineListBuffer->end(); ++itBuffer)
+ itBuffer->Convert();
// document view settings (before visible OLE area)
GetDocViewSettings().Finalize();
@@ -1236,7 +1242,7 @@ void ImportExcel::PostDocLoad( void )
}
}
- // #111099# open forms in alive mode (has no effect, if no controls in document)
+ // open forms in alive mode (has no effect, if no controls in document)
if( ScModelObj* pDocObj = GetDocModelObj() )
pDocObj->setPropertyValue( CREATE_OUSTRING( SC_UNO_APPLYFMDES ), uno::Any( false ) );
@@ -1256,7 +1262,7 @@ void ImportExcel::PostDocLoad( void )
p = pExcRoot->pPrintRanges->First( static_cast<sal_uInt16>(n) );
if( p )
{
- DBG_ASSERT( pExcRoot->pPrintRanges->GetActList(),
+ DBG_ASSERT( pExcRoot->pPrintRanges->HasActList(),
"-ImportExcel::PostDocLoad(): Imaginaere Tabelle gefunden!" );
pD->ClearPrintRanges( n );
@@ -1282,7 +1288,7 @@ void ImportExcel::PostDocLoad( void )
p = pExcRoot->pPrintTitles->First( static_cast<sal_uInt16>(n) );
if( p )
{
- DBG_ASSERT( pExcRoot->pPrintTitles->GetActList(),
+ DBG_ASSERT( pExcRoot->pPrintTitles->HasActList(),
"-ImportExcel::PostDocLoad(): Imaginaere Tabelle gefunden!" );
sal_Bool bRowVirgin = sal_True;
@@ -1293,13 +1299,13 @@ void ImportExcel::PostDocLoad( void )
if( p->aStart.Col() == 0 && p->aEnd.Col() == MAXCOL && bRowVirgin )
{
pD->SetRepeatRowRange( n, p );
- bRowVirgin = sal_False;
+ bRowVirgin = false;
}
if( p->aStart.Row() == 0 && p->aEnd.Row() == MAXROW && bColVirgin )
{
pD->SetRepeatColRange( n, p );
- bColVirgin = sal_False;
+ bColVirgin = false;
}
p = pExcRoot->pPrintTitles->Next();
@@ -1332,3 +1338,5 @@ void XclImpOutlineDataBuffer::Convert()
mxColRowBuff->ConvertHiddenFlags( mnScTab );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/makefile.mk b/sc/source/filter/excel/makefile.mk
index 04ba76d4a68a..636181c66446 100644
--- a/sc/source/filter/excel/makefile.mk
+++ b/sc/source/filter/excel/makefile.mk
@@ -40,69 +40,12 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/colrowst.obj \
- $(SLO)$/excdoc.obj \
- $(SLO)$/excel.obj \
- $(SLO)$/excform.obj \
- $(SLO)$/excform8.obj \
- $(SLO)$/excimp8.obj \
- $(SLO)$/excrecds.obj \
- $(SLO)$/exctools.obj \
- $(SLO)$/expop2.obj \
- $(SLO)$/fontbuff.obj \
- $(SLO)$/frmbase.obj \
- $(SLO)$/impop.obj \
- $(SLO)$/namebuff.obj \
- $(SLO)$/read.obj \
- $(SLO)$/tokstack.obj \
- $(SLO)$/xechart.obj \
- $(SLO)$/xecontent.obj \
- $(SLO)$/xeescher.obj \
- $(SLO)$/xeformula.obj \
- $(SLO)$/xehelper.obj \
- $(SLO)$/xelink.obj \
- $(SLO)$/xename.obj \
- $(SLO)$/xepage.obj \
- $(SLO)$/xepivot.obj \
- $(SLO)$/xerecord.obj \
- $(SLO)$/xeroot.obj \
- $(SLO)$/xestream.obj \
- $(SLO)$/xestring.obj \
- $(SLO)$/xestyle.obj \
- $(SLO)$/xetable.obj \
- $(SLO)$/xeview.obj \
- $(SLO)$/xichart.obj \
- $(SLO)$/xicontent.obj \
- $(SLO)$/xiescher.obj \
- $(SLO)$/xiformula.obj \
- $(SLO)$/xihelper.obj \
- $(SLO)$/xilink.obj \
- $(SLO)$/xiname.obj \
- $(SLO)$/xipage.obj \
- $(SLO)$/xipivot.obj \
- $(SLO)$/xiroot.obj \
- $(SLO)$/xistream.obj \
- $(SLO)$/xistring.obj \
- $(SLO)$/xistyle.obj \
- $(SLO)$/xiview.obj \
- $(SLO)$/xladdress.obj \
- $(SLO)$/xlchart.obj \
- $(SLO)$/xlescher.obj \
- $(SLO)$/xlformula.obj \
- $(SLO)$/xlpage.obj \
- $(SLO)$/xlpivot.obj \
- $(SLO)$/xlroot.obj \
- $(SLO)$/xlstyle.obj \
- $(SLO)$/xltools.obj \
- $(SLO)$/xltracer.obj \
- $(SLO)$/xlview.obj
+ $(EXCEPTIONSFILES)
.IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCSPARC"
NOOPTFILES = \
@@ -110,48 +53,62 @@ NOOPTFILES = \
.ENDIF
EXCEPTIONSFILES = \
- $(SLO)$/excdoc.obj \
- $(SLO)$/excel.obj \
- $(SLO)$/excform.obj \
+ $(SLO)$/colrowst.obj \
+ $(SLO)$/excdoc.obj \
+ $(SLO)$/excel.obj \
+ $(SLO)$/excform.obj \
$(SLO)$/excform8.obj \
- $(SLO)$/excimp8.obj \
+ $(SLO)$/excimp8.obj \
$(SLO)$/excrecds.obj \
- $(SLO)$/expop2.obj \
- $(SLO)$/impop.obj \
+ $(SLO)$/exctools.obj \
+ $(SLO)$/expop2.obj \
+ $(SLO)$/fontbuff.obj \
+ $(SLO)$/frmbase.obj \
+ $(SLO)$/impop.obj \
$(SLO)$/namebuff.obj \
+ $(SLO)$/read.obj \
$(SLO)$/tokstack.obj \
+ $(SLO)$/xechart.obj \
$(SLO)$/xecontent.obj \
$(SLO)$/xeescher.obj \
$(SLO)$/xeformula.obj \
$(SLO)$/xehelper.obj \
- $(SLO)$/xelink.obj \
- $(SLO)$/xename.obj \
- $(SLO)$/xepage.obj \
- $(SLO)$/xepivot.obj \
- $(SLO)$/xechart.obj \
+ $(SLO)$/xelink.obj \
+ $(SLO)$/xename.obj \
+ $(SLO)$/xepage.obj \
+ $(SLO)$/xepivot.obj \
+ $(SLO)$/xerecord.obj \
+ $(SLO)$/xeroot.obj \
$(SLO)$/xestream.obj \
$(SLO)$/xestring.obj \
- $(SLO)$/xestyle.obj \
- $(SLO)$/xetable.obj \
- $(SLO)$/xeview.obj \
- $(SLO)$/xichart.obj \
+ $(SLO)$/xestyle.obj \
+ $(SLO)$/xetable.obj \
+ $(SLO)$/xeview.obj \
+ $(SLO)$/xichart.obj \
$(SLO)$/xicontent.obj \
$(SLO)$/xiescher.obj \
+ $(SLO)$/xiformula.obj \
$(SLO)$/xihelper.obj \
- $(SLO)$/xilink.obj \
- $(SLO)$/xipage.obj \
- $(SLO)$/xipivot.obj \
+ $(SLO)$/xilink.obj \
+ $(SLO)$/xiname.obj \
+ $(SLO)$/xipage.obj \
+ $(SLO)$/xipivot.obj \
+ $(SLO)$/xiroot.obj \
$(SLO)$/xistream.obj \
$(SLO)$/xistring.obj \
- $(SLO)$/xistyle.obj \
+ $(SLO)$/xistyle.obj \
+ $(SLO)$/xiview.obj \
$(SLO)$/xladdress.obj \
- $(SLO)$/xiescher.obj \
- $(SLO)$/xlchart.obj \
+ $(SLO)$/xlchart.obj \
+ $(SLO)$/xlescher.obj \
$(SLO)$/xlformula.obj \
- $(SLO)$/xlpivot.obj \
- $(SLO)$/xlroot.obj \
- $(SLO)$/xlstyle.obj \
- $(SLO)$/xltools.obj \
+ $(SLO)$/xlpage.obj \
+ $(SLO)$/xlpivot.obj \
+ $(SLO)$/xlroot.obj \
+ $(SLO)$/xlstyle.obj \
+ $(SLO)$/xltoolbar.obj \
+ $(SLO)$/xltools.obj \
+ $(SLO)$/xltracer.obj \
$(SLO)$/xlview.obj
# --- Targets -------------------------------------------------------
diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx
index d46831b739af..fe388a218e95 100644
--- a/sc/source/filter/excel/namebuff.cxx
+++ b/sc/source/filter/excel/namebuff.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,7 +129,7 @@ void ShrfmlaBuffer::Store( const ScRange& rRange, const ScTokenArray& rToken )
pData->SetMaxCol(rMaxPos.Col());
pData->SetMaxRow(rMaxPos.Row());
pData->SetIndex( static_cast< sal_uInt16 >( mnCurrIdx ) );
- pExcRoot->pIR->GetNamedRanges().Insert( pData );
+ pExcRoot->pIR->GetNamedRanges().insert( pData );
index_hash[rRange.aStart] = static_cast< sal_uInt16 >( mnCurrIdx );
index_list.push_front (rRange);
++mnCurrIdx;
@@ -241,7 +242,7 @@ sal_Bool ExtSheetBuffer::GetScTabIndex( sal_uInt16 nExcIndex, sal_uInt16& rScInd
}
}
- return sal_False;
+ return false;
}
@@ -253,7 +254,7 @@ sal_Bool ExtSheetBuffer::IsLink( const sal_uInt16 nExcIndex ) const
if( pRet )
return pRet->bLink;
else
- return sal_False;
+ return false;
}
@@ -269,7 +270,7 @@ sal_Bool ExtSheetBuffer::GetLink( const sal_uInt16 nExcIndex, String& rAppl, Str
return sal_True;
}
else
- return sal_False;
+ return false;
}
@@ -342,3 +343,4 @@ void ExtNameBuff::Reset( void )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 55f1f97ceea0..07a8ba1aaf03 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,9 +90,8 @@ FltError ImportExcel::Read( void )
Zustand eAkt = Z_BiffNull, ePrev = Z_BiffNull;
FltError eLastErr = eERR_OK;
- sal_uInt16 nOpcode;
- sal_uInt16 nBofLevel = 0;
- sal_Bool bBiff4Workbook = sal_False;
+ UINT16 nOpcode;
+ UINT16 nBofLevel = 0;
DBG_ASSERT( &aIn != NULL, "-ImportExcel::Read(): Kein Stream - wie dass?!" );
@@ -124,7 +124,7 @@ FltError ImportExcel::Read( void )
if( !aIn.IsValid() )
{
- // #124240# finalize table if EOF is missing
+ // finalize table if EOF is missing
switch( eAkt )
{
case Z_Biff2:
@@ -187,10 +187,7 @@ FltError ImportExcel::Read( void )
NeueTabelle();
}
else if( pExcRoot->eDateiTyp == Biff4W )
- {
eAkt = Z_Biff4W;
- bBiff4Workbook = sal_True;
- }
break;
case EXC_BIFF5:
Bof5();
@@ -722,7 +719,7 @@ FltError ImportExcel::Read( void )
break;
case Biff5V:
default:
- pD->SetVisible( GetCurrScTab(), sal_False );
+ pD->SetVisible( GetCurrScTab(), false );
ePrev = eAkt;
eAkt = Z_Biffn0;
}
@@ -748,9 +745,9 @@ FltError ImportExcel::Read( void )
break;
// ----------------------------------------------------------------
case Z_Ende: // ----------------------------------- Z_Ende -
- DBG_ERROR( "*ImportExcel::Read(): Not possible state!" );
+ OSL_FAIL( "*ImportExcel::Read(): Not possible state!" );
break;
- default: DBG_ERROR( "-ImportExcel::Read(): Zustand vergessen!" );
+ default: OSL_FAIL( "-ImportExcel::Read(): Zustand vergessen!" );
}
}
@@ -803,6 +800,7 @@ FltError ImportExcel8::Read( void )
XclImpObjectManager& rObjMgr = GetObjectManager();
// call to GetCurrSheetDrawing() cannot be cached (changes in new sheets)
XclImpCondFormatManager& rCondFmtMgr = GetCondFormatManager();
+ XclImpValidationManager& rValidMgr = GetValidationManager();
XclImpPivotTableManager& rPTableMgr = GetPivotTableManager();
XclImpWebQueryBuffer& rWQBfr = GetWebQueryBuffer();
@@ -831,6 +829,12 @@ FltError ImportExcel8::Read( void )
sal_Size nProgressBasePos = 0;
sal_Size nProgressBaseSize = 0;
+ bool bSheetHasCodeName = false;
+
+ std::vector< String > CodeNames;
+
+ std::vector < SCTAB > nTabsWithNoCodeName;
+
while( eAkt != EXC_STATE_END )
{
if( eAkt == EXC_STATE_BEFORE_SHEET )
@@ -850,14 +854,13 @@ FltError ImportExcel8::Read( void )
if( !aIn.IsValid() )
{
- // #124240# #i63591# finalize table if EOF is missing
+ // #i63591# finalize table if EOF is missing
switch( eAkt )
{
case EXC_STATE_SHEET_PRE:
eAkt = EXC_STATE_SHEET;
aIn.SeekGlobalPosition();
continue; // next iteration in while loop
-// break; // unxsols warning: statement unreachable
case EXC_STATE_SHEET:
Eof();
eAkt = EXC_STATE_END;
@@ -912,6 +915,7 @@ FltError ImportExcel8::Read( void )
// #i62752# possible to have BIFF8 sheet without globals
NeueTabelle();
eAkt = EXC_STATE_SHEET_PRE; // Shrfmla Prefetch, Row-Prefetch
+ bSheetHasCodeName = false; // reset
aIn.StoreGlobalPosition();
}
}
@@ -1012,6 +1016,7 @@ FltError ImportExcel8::Read( void )
case EXC_ID_SXIDSTM: rPTableMgr.ReadSxidstm( maStrm ); break;
case EXC_ID_SXVS: rPTableMgr.ReadSxvs( maStrm ); break;
case EXC_ID_DCONREF: rPTableMgr.ReadDconref( maStrm ); break;
+ case EXC_ID_DCONNAME: rPTableMgr.ReadDConName( maStrm ); break;
}
}
@@ -1023,7 +1028,7 @@ FltError ImportExcel8::Read( void )
{
if( nRecId == EXC_ID5_BOF )
{
- // #94191# import only 256 sheets
+ // import only 256 sheets
if( GetCurrScTab() > GetScMaxPos().Tab() )
{
XclTools::SkipSubStream( maStrm );
@@ -1053,7 +1058,7 @@ FltError ImportExcel8::Read( void )
case Biff8V: // VB module
default:
// TODO: do not create a sheet in the Calc document
- pD->SetVisible( GetCurrScTab(), sal_False );
+ pD->SetVisible( GetCurrScTab(), false );
XclTools::SkipSubStream( maStrm );
IncCurrScTab();
}
@@ -1082,12 +1087,32 @@ FltError ImportExcel8::Read( void )
case EXC_ID2_DIMENSIONS:
case EXC_ID3_DIMENSIONS: ReadDimensions(); break;
- case EXC_ID_CODENAME: ReadCodeName( aIn, false ); break;
+ case EXC_ID_CODENAME: ReadCodeName( aIn, false ); bSheetHasCodeName = true; break;
case 0x0A: // EOF [ 2345 ]
+ {
eAkt = EXC_STATE_SHEET;
+ String sName;
+ GetDoc().GetName( GetCurrScTab(), sName );
+ if ( !bSheetHasCodeName )
+ {
+ nTabsWithNoCodeName.push_back( GetCurrScTab() );
+ OSL_TRACE("No Codename for %d", GetCurrScTab() );
+ }
+ else
+ {
+ String sCodeName;
+ GetDoc().GetCodeName( GetCurrScTab(), sCodeName );
+ OSL_TRACE("Have CodeName %s for SheetName %s",
+ rtl::OUStringToOString( sCodeName, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ CodeNames.push_back( sCodeName );
+ }
+
+ bSheetHasCodeName = false; // reset
+
aIn.SeekGlobalPosition(); // und zurueck an alte Position
break;
+ }
case 0x12: SheetProtect(); break;
case 0x13: SheetPassword(); break;
case 0x42: Codepage(); break; // CODEPAGE [ 2345 ]
@@ -1176,8 +1201,8 @@ FltError ImportExcel8::Read( void )
case EXC_ID_CONDFMT: rCondFmtMgr.ReadCondfmt( maStrm ); break;
case EXC_ID_CF: rCondFmtMgr.ReadCF( maStrm ); break;
- case EXC_ID_DVAL: XclImpValidation::ReadDval( maStrm ); break;
- case EXC_ID_DV: XclImpValidation::ReadDV( maStrm ); break;
+ case EXC_ID_DVAL: rValidMgr.ReadDval( maStrm ); break;
+ case EXC_ID_DV: rValidMgr.ReadDV( maStrm ); break;
case EXC_ID_QSI: rWQBfr.ReadQsi( maStrm ); break;
case EXC_ID_WQSTRING: rWQBfr.ReadWqstring( maStrm ); break;
@@ -1206,16 +1231,54 @@ FltError ImportExcel8::Read( void )
if( eLastErr == eERR_OK )
{
+ // In some strange circumstances a the codename might be missing
+ // # Create any missing Sheet CodeNames
+ std::vector < SCTAB >::iterator it_end = nTabsWithNoCodeName.end();
+ for ( std::vector < SCTAB >::iterator it = nTabsWithNoCodeName.begin(); it != it_end; ++it )
+ {
+ SCTAB nTab = 1;
+ OSL_TRACE("Trying to find suitable codename for %d", *it );
+ while ( true )
+ {
+ String sTmpName( RTL_CONSTASCII_USTRINGPARAM("Sheet" ) );
+ sTmpName += String::CreateFromInt32( sal_Int32(nTab++) );
+ std::vector< String >::iterator codeName_It = CodeNames.begin();
+ std::vector< String >::iterator codeName_It_end = CodeNames.end();
+ // search for codename
+ for ( ; codeName_It != codeName_It_end; ++codeName_It )
+ {
+ if ( *codeName_It == sTmpName )
+ break;
+ }
+
+ if ( codeName_It == codeName_It_end ) // generated codename not found
+ {
+ OSL_TRACE("Using generated codename %s", rtl::OUStringToOString( sTmpName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ // Set new codename
+ GetDoc().SetCodeName( *it, sTmpName );
+ // Record newly used codename
+ CodeNames.push_back( sTmpName );
+ // Record those we have created so they can be created in
+ // basic
+ AutoGeneratedCodeNames.push_back( sTmpName );
+ break;
+ }
+ }
+
+ }
// #i45843# Convert pivot tables before calculation, so they are available
// for the GETPIVOTDATA function.
if( GetBiff() == EXC_BIFF8 )
GetPivotTableManager().ConvertPivotTables();
pProgress.reset();
-
+#if 0
+ // Excel documents look much better without this call; better in the
+ // sense that the row heights are identical to the original heights in
+ // Excel.
if (pD->IsAdjustHeightEnabled())
AdjustRowHeight();
-
+#endif
PostDocLoad();
pD->CalcAfterLoad();
@@ -1241,3 +1304,4 @@ FltError ImportExcel8::Read( void )
//___________________________________________________________________
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index d845ae5f6b5b..9c144b3d00e8 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -204,23 +205,6 @@ void TokenPool::GrowDouble( void )
pP_Dbl = pP_DblNew;
}
-
-//UNUSED2009-05 void TokenPool::GrowError( void )
-//UNUSED2009-05 {
-//UNUSED2009-05 sal_uInt16 nP_ErrNew = nP_Err * 2;
-//UNUSED2009-05
-//UNUSED2009-05 sal_uInt16* pP_ErrNew = new sal_uInt16[ nP_ErrNew ];
-//UNUSED2009-05
-//UNUSED2009-05 for( sal_uInt16 nL = 0 ; nL < nP_Err ; nL++ )
-//UNUSED2009-05 pP_ErrNew[ nL ] = pP_Err[ nL ];
-//UNUSED2009-05
-//UNUSED2009-05 nP_Err = nP_ErrNew;
-//UNUSED2009-05
-//UNUSED2009-05 delete[] pP_Err;
-//UNUSED2009-05 pP_Err = pP_ErrNew;
-//UNUSED2009-05 }
-
-
void TokenPool::GrowTripel( void )
{
sal_uInt16 nP_RefTrNew = nP_RefTr * 2;
@@ -338,7 +322,7 @@ void TokenPool::GetElement( const sal_uInt16 nId )
{
#ifdef DBG_UTIL
case T_Id:
- DBG_ERROR( "-TokenPool::GetElement(): hier hast Du nichts zu suchen!" );
+ OSL_FAIL( "-TokenPool::GetElement(): hier hast Du nichts zu suchen!" );
break;
#endif
case T_Str:
@@ -348,9 +332,6 @@ void TokenPool::GetElement( const sal_uInt16 nId )
pScToken->AddDouble( pP_Dbl[ pElement[ nId ] ] );
break;
case T_Err:
-#if 0 // erAck
- pScToken->AddError( pP_Err[ pElement[ nId ] ] );
-#endif
break;
case T_RefC:
pScToken->AddSingleReference( *ppP_RefTr[ pElement[ (sal_uInt16) nId ] ] );
@@ -427,7 +408,7 @@ void TokenPool::GetElement( const sal_uInt16 nId )
}
break;
default:
- DBG_ERROR("-TokenPool::GetElement(): Zustand undefiniert!?");
+ OSL_FAIL("-TokenPool::GetElement(): Zustand undefiniert!?");
}
}
}
@@ -463,9 +444,6 @@ void TokenPool::GetElementRek( const sal_uInt16 nId )
pScToken->AddDouble( pP_Dbl[ pElement[ *pAkt ] ] );
break;
case T_Err:
-#if 0 // erAck
- pScToken->AddError( pP_Err[ pElement[ *pAkt ] ] );
-#endif
break;
case T_RefC:
pScToken->AddSingleReference( *ppP_RefTr[ pElement[ *pAkt ] ] );
@@ -537,7 +515,7 @@ void TokenPool::GetElementRek( const sal_uInt16 nId )
}
break;
default:
- DBG_ERROR("-TokenPool::GetElementRek(): Zustand undefiniert!?");
+ OSL_FAIL("-TokenPool::GetElementRek(): Zustand undefiniert!?");
}
}
else // elementarer SC_Token
@@ -844,10 +822,9 @@ sal_Bool TokenPool::IsSingleOp( const TokenId& rId, const DefTokenId eId ) const
}
}
- return sal_False;
+ return false;
}
-
const String* TokenPool::GetExternal( const TokenId& rId ) const
{
const String* p = NULL;
@@ -862,21 +839,6 @@ const String* TokenPool::GetExternal( const TokenId& rId ) const
return p;
}
-
-//UNUSED2008-05 const String* TokenPool::GetString( const TokenId& r ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 const String* p = NULL;
-//UNUSED2008-05 sal_uInt16 n = (sal_uInt16) r;
-//UNUSED2008-05 if( n && n <= nElementAkt )
-//UNUSED2008-05 {
-//UNUSED2008-05 n--;
-//UNUSED2008-05 if( pType[ n ] == T_Str )
-//UNUSED2008-05 p = ppP_Str[ pElement[ n ] ];
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 return p;
-//UNUSED2008-05 }
-
ScMatrix* TokenPool::GetMatrix( unsigned int n ) const
{
if( n < nP_MatrixAkt )
@@ -886,3 +848,4 @@ ScMatrix* TokenPool::GetMatrix( unsigned int n ) const
return NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 07b4a76a9c82..ebf622b080c5 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/ChartLegendExpansion.hpp>
@@ -137,7 +139,7 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclChRectangle& rRect )
inline void lclSaveRecord( XclExpStream& rStrm, XclExpRecordRef xRec )
{
- if( xRec.is() )
+ if( xRec )
xRec->Save( rStrm );
}
@@ -145,13 +147,23 @@ inline void lclSaveRecord( XclExpStream& rStrm, XclExpRecordRef xRec )
template< typename Type >
void lclSaveRecord( XclExpStream& rStrm, XclExpRecordRef xRec, sal_uInt16 nRecId, Type nValue )
{
- if( xRec.is() )
+ if( xRec )
{
XclExpValueRecord< Type >( nRecId, nValue ).Save( rStrm );
xRec->Save( rStrm );
}
}
+template<typename ValueType, typename KeyType>
+void lclSaveRecord(XclExpStream& rStrm, ValueType* pRec, sal_uInt16 nRecId, KeyType nValue)
+{
+ if (pRec)
+ {
+ XclExpValueRecord<KeyType>(nRecId, nValue).Save(rStrm);
+ pRec->Save(rStrm);
+ }
+}
+
void lclWriteChFrBlockRecord( XclExpStream& rStrm, const XclChFrBlock& rFrBlock, bool bBegin )
{
sal_uInt16 nRecId = bBegin ? EXC_ID_CHFRBLOCKBEGIN : EXC_ID_CHFRBLOCKEND;
@@ -375,16 +387,6 @@ XclChRectangle XclExpChRoot::CalcChartRectFromHmm( const ::com::sun::star::awt::
return aRect;
}
-sal_Int32 XclExpChRoot::CalcChartXFromRelative( double fPosX ) const
-{
- return CalcChartXFromHmm( static_cast< sal_Int32 >( fPosX * mxChData->maChartRect.GetWidth() + 0.5 ) );
-}
-
-sal_Int32 XclExpChRoot::CalcChartYFromRelative( double fPosY ) const
-{
- return CalcChartYFromHmm( static_cast< sal_Int32 >( fPosY * mxChData->maChartRect.GetHeight() + 0.5 ) );
-}
-
void XclExpChRoot::ConvertLineFormat( XclChLineFormat& rLineFmt,
const ScfPropertySet& rPropSet, XclChPropertyMode ePropMode ) const
{
@@ -692,12 +694,12 @@ void XclExpChEscherFormat::Convert( const ScfPropertySet& rPropSet, XclChObjectT
bool XclExpChEscherFormat::IsValid() const
{
- return maData.mxEscherSet.is();
+ return maData.mxEscherSet;
}
void XclExpChEscherFormat::Save( XclExpStream& rStrm )
{
- if( maData.mxEscherSet.is() )
+ if( maData.mxEscherSet )
{
// replace RGB colors with palette indexes in the Escher container
const XclExpPalette& rPal = GetPalette();
@@ -725,7 +727,7 @@ void XclExpChEscherFormat::WriteSubRecords( XclExpStream& rStrm )
sal_uInt32 XclExpChEscherFormat::RegisterColor( sal_uInt16 nPropId )
{
sal_uInt32 nBGRValue;
- if( maData.mxEscherSet.is() && maData.mxEscherSet->GetOpt( nPropId, nBGRValue ) )
+ if( maData.mxEscherSet && maData.mxEscherSet->GetOpt( nPropId, nBGRValue ) )
{
// swap red and blue
Color aColor( RGB_COLORDATA(
@@ -739,7 +741,7 @@ sal_uInt32 XclExpChEscherFormat::RegisterColor( sal_uInt16 nPropId )
void XclExpChEscherFormat::WriteBody( XclExpStream& rStrm )
{
- DBG_ASSERT( maData.mxEscherSet.is(), "XclExpChEscherFormat::WriteBody - missing property container" );
+ DBG_ASSERT( maData.mxEscherSet, "XclExpChEscherFormat::WriteBody - missing property container" );
// write Escher property container via temporary memory stream
SvMemoryStream aMemStrm;
maData.mxEscherSet->Commit( aMemStrm );
@@ -1077,10 +1079,17 @@ void XclExpChSourceLink::ConvertNumFmt( const ScfPropertySet& rPropSet, bool bPe
}
}
+void XclExpChSourceLink::AppendString( const String& rStr )
+{
+ if (!mxString)
+ return;
+ XclExpStringHelper::AppendString( *mxString, GetRoot(), rStr );
+}
+
void XclExpChSourceLink::Save( XclExpStream& rStrm )
{
// CHFORMATRUNS record
- if( mxString.is() && mxString->IsRich() )
+ if( mxString && mxString->IsRich() )
{
sal_Size nRecSize = (1 + mxString->GetFormatsCount()) * ((GetBiff() == EXC_BIFF8) ? 2 : 1);
rStrm.StartRecord( EXC_ID_CHFORMATRUNS, nRecSize );
@@ -1090,7 +1099,7 @@ void XclExpChSourceLink::Save( XclExpStream& rStrm )
// CHSOURCELINK record
XclExpRecord::Save( rStrm );
// CHSTRING record
- if( mxString.is() && !mxString->IsEmpty() )
+ if( mxString && !mxString->IsEmpty() )
{
rStrm.StartRecord( EXC_ID_CHSTRING, 2 + mxString->GetSize() );
rStrm << sal_uInt16( 0 ) << *mxString;
@@ -1206,7 +1215,7 @@ void XclExpChText::SetRotation( sal_uInt16 nRotation )
::insert_value( maData.mnFlags, XclTools::GetXclOrientFromRot( nRotation ), 8, 3 );
}
-void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget )
+void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget, const String* pSubTitle )
{
switch( nTarget )
{
@@ -1228,6 +1237,14 @@ void XclExpChText::ConvertTitle( Reference< XTitle > xTitle, sal_uInt16 nTarget
// string sequence
mxSrcLink.reset( new XclExpChSourceLink( GetChRoot(), EXC_CHSRCLINK_TITLE ) );
sal_uInt16 nFontIdx = mxSrcLink->ConvertStringSequence( xTitle->getText() );
+ if (pSubTitle)
+ {
+ // append subtitle as the 2nd line of the title.
+ String aSubTitle = String::CreateFromAscii("\n");
+ aSubTitle.Append(*pSubTitle);
+ mxSrcLink->AppendString(aSubTitle);
+ }
+
ConvertFontBase( GetChRoot(), nFontIdx );
// rotation
@@ -1436,14 +1453,15 @@ void XclExpChText::WriteBody( XclExpStream& rStrm )
namespace {
/** Creates and returns an Excel text object from the passed title. */
-XclExpChTextRef lclCreateTitle( const XclExpChRoot& rRoot, Reference< XTitled > xTitled, sal_uInt16 nTarget )
+XclExpChTextRef lclCreateTitle( const XclExpChRoot& rRoot, Reference< XTitled > xTitled, sal_uInt16 nTarget,
+ const String* pSubTitle = NULL )
{
Reference< XTitle > xTitle;
if( xTitled.is() )
xTitle = xTitled->getTitleObject();
XclExpChTextRef xText( new XclExpChText( rRoot ) );
- xText->ConvertTitle( xTitle, nTarget );
+ xText->ConvertTitle( xTitle, nTarget, pSubTitle );
/* Do not delete the CHTEXT group for the main title. A missing CHTEXT
will be interpreted as auto-generated title showing the series title in
charts that contain exactly one data series. */
@@ -1904,7 +1922,7 @@ bool XclExpChSeries::ConvertDataSeries(
maData.mnCategCount = mxCategLink->ConvertDataSequence( xXValueSeq, false, maData.mnValueCount );
// size values of bubble charts
- if( mxBubbleLink.is() )
+ if( mxBubbleLink )
mxBubbleLink->ConvertDataSequence( xBubbleSeq, false, maData.mnValueCount );
// series formatting
@@ -2085,7 +2103,7 @@ void XclExpChSeries::CreateTrendLines( XDataSeriesRef xDataSeries )
for( const Reference< XRegressionCurve >* pIt = pBeg; pIt != pEnd; ++pIt )
{
XclExpChSeriesRef xSeries = GetChartData().CreateSeries();
- if( xSeries.is() && !xSeries->ConvertTrendLine( *this, *pIt ) )
+ if( xSeries && !xSeries->ConvertTrendLine( *this, *pIt ) )
GetChartData().RemoveLastSeries();
}
}
@@ -2109,7 +2127,7 @@ void XclExpChSeries::CreateErrorBar( const ScfPropertySet& rPropSet,
if( rPropSet.GetBoolProperty( rShowPropName ) )
{
XclExpChSeriesRef xSeries = GetChartData().CreateSeries();
- if( xSeries.is() && !xSeries->ConvertErrorBar( *this, rPropSet, nBarId ) )
+ if( xSeries && !xSeries->ConvertErrorBar( *this, rPropSet, nBarId ) )
GetChartData().RemoveLastSeries();
}
}
@@ -2479,8 +2497,11 @@ void XclExpChTypeGroup::ConvertSeries(
maType.SetStacked( bPercent );
// connected data points (only in stacked bar charts)
- if( bConnectBars && (maTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR) )
- maChartLines[ EXC_CHCHARTLINE_CONNECT ].reset( new XclExpChLineFormat( GetChRoot() ) );
+ if (bConnectBars && (maTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR))
+ {
+ sal_uInt16 nKey = EXC_CHCHARTLINE_CONNECT;
+ maChartLines.insert(nKey, new XclExpChLineFormat(GetChRoot()));
+ }
}
else
{
@@ -2545,7 +2566,7 @@ void XclExpChTypeGroup::CreateDataSeries(
{
// let chart create series object with correct series index
XclExpChSeriesRef xSeries = GetChartData().CreateSeries();
- if( xSeries.is() )
+ if( xSeries )
{
if( xSeries->ConvertDataSeries( xDiagram, xDataSeries, maTypeInfo, GetGroupIdx(), GetFreeFormatIdx() ) )
maSeries.AppendRecord( xSeries );
@@ -2571,7 +2592,8 @@ void XclExpChTypeGroup::CreateAllStockSeries(
ScfPropertySet aSeriesProp( xDataSeries );
XclExpChLineFormatRef xLineFmt( new XclExpChLineFormat( GetChRoot() ) );
xLineFmt->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE );
- maChartLines[ EXC_CHCHARTLINE_HILO ] = xLineFmt;
+ sal_uInt16 nKey = EXC_CHCHARTLINE_HILO;
+ maChartLines.insert(nKey, new XclExpChLineFormat(GetChRoot()));
}
// dropbars
if( bHasOpen && bHasClose )
@@ -2597,7 +2619,7 @@ bool XclExpChTypeGroup::CreateStockSeries( Reference< XDataSeries > xDataSeries,
bool bOk = false;
// let chart create series object with correct series index
XclExpChSeriesRef xSeries = GetChartData().CreateSeries();
- if( xSeries.is() )
+ if( xSeries )
{
bOk = xSeries->ConvertStockSeries( xDataSeries,
rValueRole, GetGroupIdx(), GetFreeFormatIdx(), bCloseSymbol );
@@ -2950,13 +2972,13 @@ XclExpChAxis::XclExpChAxis( const XclExpChRoot& rRoot, sal_uInt16 nAxisType ) :
void XclExpChAxis::SetFont( XclExpChFontRef xFont, const Color& rColor, sal_uInt32 nColorId )
{
mxFont = xFont;
- if( mxTick.is() )
+ if( mxTick )
mxTick->SetFontColor( rColor, nColorId );
}
void XclExpChAxis::SetRotation( sal_uInt16 nRotation )
{
- if( mxTick.is() )
+ if( mxTick )
mxTick->SetRotation( nRotation );
}
@@ -3146,7 +3168,7 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
chart with existing type groups, insert all series into last
contained chart type group instead of creating a new group. */
XclExpChTypeGroupRef xLastGroup = GetLastTypeGroup();
- if( xLastGroup.is() && !(xTypeGroup->IsCombinable2d() && xLastGroup->IsCombinable2d()) )
+ if( xLastGroup && !(xTypeGroup->IsCombinable2d() && xLastGroup->IsCombinable2d()) )
{
xLastGroup->ConvertSeries( xDiagram, *pIt, nApiAxesSetIdx, bPercent, bConnectBars );
}
@@ -3201,12 +3223,12 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
if( xDiagram.is() && (GetAxesSetId() == EXC_CHAXESSET_PRIMARY) )
{
XclExpChTypeGroupRef xTypeGroup = GetFirstTypeGroup();
- if( xTypeGroup.is() && xTypeGroup->Is3dWallChart() )
+ if( xTypeGroup && xTypeGroup->Is3dWallChart() )
{
// wall/floor formatting (3D charts)
- if( mxXAxis.is() )
+ if( mxXAxis )
mxXAxis->ConvertWall( xDiagram );
- if( mxYAxis.is() )
+ if( mxYAxis )
mxYAxis->ConvertWall( xDiagram );
}
else
@@ -3246,7 +3268,7 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
bool XclExpChAxesSet::Is3dChart() const
{
XclExpChTypeGroupRef xTypeGroup = GetFirstTypeGroup();
- return xTypeGroup.is() && xTypeGroup->Is3dChart();
+ return xTypeGroup && xTypeGroup->Is3dChart();
}
void XclExpChAxesSet::WriteSubRecords( XclExpStream& rStrm )
@@ -3258,7 +3280,7 @@ void XclExpChAxesSet::WriteSubRecords( XclExpStream& rStrm )
lclSaveRecord( rStrm, mxXAxisTitle );
lclSaveRecord( rStrm, mxYAxisTitle );
lclSaveRecord( rStrm, mxZAxisTitle );
- if( mxPlotFrame.is() )
+ if( mxPlotFrame )
{
XclExpEmptyRecord( EXC_ID_CHPLOTFRAME ).Save( rStrm );
mxPlotFrame->Save( rStrm );
@@ -3303,6 +3325,23 @@ void XclExpChAxesSet::WriteBody( XclExpStream& rStrm )
// The chart object ===========================================================
+static void lcl_getChartSubTitle(const Reference<XChartDocument>& xChartDoc,
+ String& rSubTitle)
+{
+ Reference< ::com::sun::star::chart::XChartDocument > xChartDoc1(xChartDoc, UNO_QUERY);
+ if (!xChartDoc1.is())
+ return;
+
+ Reference< XPropertySet > xProp(xChartDoc1->getSubTitle(), UNO_QUERY);
+ if (!xProp.is())
+ return;
+
+ OUString aTitle;
+ Any any = xProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("String")) );
+ if (any >>= aTitle)
+ rSubTitle = aTitle;
+}
+
XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
Reference< XChartDocument > xChartDoc, const Rectangle& rChartRect ) :
XclExpChGroupBase( XclExpChRoot( rRoot, *this ), EXC_CHFRBLOCK_TYPE_CHART, EXC_ID_CHCHART, 16 )
@@ -3340,7 +3379,10 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
// chart title
Reference< XTitled > xTitled( xChartDoc, UNO_QUERY );
- mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE );
+ String aSubTitle;
+ lcl_getChartSubTitle(xChartDoc, aSubTitle);
+ mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE,
+ aSubTitle.Len() ? &aSubTitle : NULL );
// diagrams (axes sets)
sal_uInt16 nFreeGroupIdx = mxPrimAxesSet->Convert( xDiagram, 0 );
@@ -3386,7 +3428,7 @@ void XclExpChChart::RemoveLastSeries()
void XclExpChChart::SetDataLabel( XclExpChTextRef xText )
{
- if( xText.is() )
+ if( xText )
maLabels.AppendRecord( xText );
}
@@ -3459,7 +3501,7 @@ XclExpChartDrawing::~XclExpChartDrawing()
void XclExpChartDrawing::Save( XclExpStream& rStrm )
{
- if( mxObjRecs.is() )
+ if( mxObjRecs )
mxObjRecs->Save( rStrm );
}
@@ -3480,3 +3522,4 @@ XclExpChart::XclExpChart( const XclExpRoot& rRoot, Reference< XModel > xModel, c
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 518feadfbbdb..b25cc7f20b1e 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -262,8 +263,8 @@ void XclExpSstImpl::SaveXml( XclExpXmlStream& rStrm )
return;
sax_fastparser::FSHelperPtr pSst = rStrm.CreateOutputStream(
- OUString::createFromAscii( "xl/sharedStrings.xml" ),
- OUString::createFromAscii( "sharedStrings.xml" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "xl/sharedStrings.xml") ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "sharedStrings.xml" )),
rStrm.GetCurrentStream()->getOutputStream(),
"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" );
@@ -331,12 +332,15 @@ void XclExpMergedcells::AppendRange( const ScRange& rRange, sal_uInt32 nBaseXFId
sal_uInt32 XclExpMergedcells::GetBaseXFId( const ScAddress& rPos ) const
{
- DBG_ASSERT( maBaseXFIds.size() == maMergedRanges.Count(), "XclExpMergedcells::GetBaseXFId - invalid lists" );
+ DBG_ASSERT( maBaseXFIds.size() == maMergedRanges.size(), "XclExpMergedcells::GetBaseXFId - invalid lists" );
ScfUInt32Vec::const_iterator aIt = maBaseXFIds.begin();
ScRangeList& rNCRanges = const_cast< ScRangeList& >( maMergedRanges );
- for( const ScRange* pScRange = rNCRanges.First(); pScRange; pScRange = rNCRanges.Next(), ++aIt )
+ for ( size_t i = 0, nRanges = rNCRanges.size(); i < nRanges; ++i, ++aIt )
+ {
+ const ScRange* pScRange = rNCRanges[ i ];
if( pScRange->In( rPos ) )
return *aIt;
+ }
return EXC_XFID_NOTFOUND;
}
@@ -362,16 +366,16 @@ void XclExpMergedcells::Save( XclExpStream& rStrm )
void XclExpMergedcells::SaveXml( XclExpXmlStream& rStrm )
{
- sal_uLong nCount = maMergedRanges.Count();
+ size_t nCount = maMergedRanges.size();
if( !nCount )
return;
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_mergeCells,
XML_count, OString::valueOf( (sal_Int32) nCount ).getStr(),
FSEND );
- for( sal_uLong i = 0; i < nCount; ++i )
+ for( size_t i = 0; i < nCount; ++i )
{
- if( const ScRange* pRange = maMergedRanges.GetObject( i ) )
+ if( const ScRange* pRange = maMergedRanges[ i ] )
{
rWorksheet->singleElement( XML_mergeCell,
XML_ref, XclXmlUtils::ToOString( *pRange ).getStr(),
@@ -409,12 +413,20 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU
}
// file link or URL
- if( eProtocol == INET_PROT_FILE )
+ if( eProtocol == INET_PROT_FILE || eProtocol == INET_PROT_SMB )
{
sal_uInt16 nLevel;
bool bRel;
String aFileName( BuildFileName( nLevel, bRel, rUrl, rRoot ) );
+ if( eProtocol == INET_PROT_SMB )
+ {
+ // #n382718# (and #n261623#) Convert smb notation to '\\'
+ aFileName = aUrlObj.GetMainURL( INetURLObject::NO_DECODE );
+ aFileName = String( aFileName.GetBuffer() + 4 ); // skip the 'smb:' part
+ aFileName.SearchAndReplaceAll( '/', '\\' );
+ }
+
if( !bRel )
mnFlags |= EXC_HLINK_ABS;
mnFlags |= EXC_HLINK_BODY;
@@ -455,7 +467,16 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU
else if( rUrl.GetChar( 0 ) == '#' ) // hack for #89066#
{
String aTextMark( rUrl.Copy( 1 ) );
- aTextMark.SearchAndReplace( '.', '!' );
+
+ xub_StrLen nSepPos = aTextMark.SearchAndReplace( '.', '!' );
+ String aSheetName( aTextMark.Copy(0, nSepPos));
+
+ if ( aSheetName.Search(' ') != STRING_NOTFOUND && aSheetName.GetChar(0) != '\'')
+ {
+ aTextMark.Insert('\'', nSepPos);
+ aTextMark.Insert('\'', 0);
+ }
+
mxTextMark.reset( new XclExpString( aTextMark, EXC_STR_FORCEUNICODE, 255 ) );
}
@@ -516,24 +537,31 @@ void XclExpHyperlink::WriteBody( XclExpStream& rStrm )
{
sal_uInt16 nXclCol = static_cast< sal_uInt16 >( maScPos.Col() );
sal_uInt16 nXclRow = static_cast< sal_uInt16 >( maScPos.Row() );
- mxVarData->Seek( STREAM_SEEK_TO_BEGIN );
+ rStrm << nXclRow << nXclRow << nXclCol << nXclCol;
+ WriteEmbeddedData( rStrm );
+}
- rStrm << nXclRow << nXclRow << nXclCol << nXclCol
- << XclTools::maGuidStdLink
+void XclExpHyperlink::WriteEmbeddedData( XclExpStream& rStrm )
+{
+ rStrm << XclTools::maGuidStdLink
<< sal_uInt32( 2 )
<< mnFlags;
+
+ mxVarData->Seek( STREAM_SEEK_TO_BEGIN );
rStrm.CopyFromStream( *mxVarData );
}
void XclExpHyperlink::SaveXml( XclExpXmlStream& rStrm )
{
- OUString sId = rStrm.addRelation( rStrm.GetCurrentStream()->getOutputStream(),
+ OUString sId = msTarget.getLength() ? rStrm.addRelation( rStrm.GetCurrentStream()->getOutputStream(),
XclXmlUtils::ToOUString( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" ),
msTarget,
- XclXmlUtils::ToOUString( "External" ) );
+ XclXmlUtils::ToOUString( "External" ) ) : OUString();
rStrm.GetCurrentStream()->singleElement( XML_hyperlink,
XML_ref, XclXmlUtils::ToOString( maScPos ).getStr(),
- FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(),
+ FSNS( XML_r, XML_id ), sId.getLength()
+ ? XclXmlUtils::ToOString( sId ).getStr()
+ : NULL,
XML_location, mxTextMark.get() != NULL
? XclXmlUtils::ToOString( *mxTextMark ).getStr()
: NULL,
@@ -551,9 +579,12 @@ XclExpLabelranges::XclExpLabelranges( const XclExpRoot& rRoot ) :
// row label ranges
FillRangeList( maRowRanges, rRoot.GetDoc().GetRowNameRangesRef(), nScTab );
// row labels only over 1 column (restriction of Excel97/2000/XP)
- for( ScRange* pScRange = maRowRanges.First(); pScRange; pScRange = maRowRanges.Next() )
+ for ( size_t i = 0, nRanges = maRowRanges.size(); i < nRanges; ++i )
+ {
+ ScRange* pScRange = maRowRanges[ i ];
if( pScRange->aStart.Col() != pScRange->aEnd.Col() )
pScRange->aEnd.SetCol( pScRange->aStart.Col() );
+ }
// col label ranges
FillRangeList( maColRanges, rRoot.GetDoc().GetColNameRangesRef(), nScTab );
}
@@ -561,8 +592,9 @@ XclExpLabelranges::XclExpLabelranges( const XclExpRoot& rRoot ) :
void XclExpLabelranges::FillRangeList( ScRangeList& rScRanges,
ScRangePairListRef xLabelRangesRef, SCTAB nScTab )
{
- for( const ScRangePair* pRangePair = xLabelRangesRef->First(); pRangePair; pRangePair = xLabelRangesRef->Next() )
+ for ( size_t i = 0, nPairs = xLabelRangesRef->size(); i < nPairs; ++i )
{
+ ScRangePair* pRangePair = (*xLabelRangesRef)[i];
const ScRange& rScRange = pRangePair->GetRange( 0 );
if( rScRange.aStart.Tab() == nScTab )
rScRanges.Append( rScRange );
@@ -1029,7 +1061,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
case SC_VALERR_WARNING: mnFlags |= EXC_DV_ERROR_WARNING; break;
case SC_VALERR_INFO: mnFlags |= EXC_DV_ERROR_INFO; break;
case SC_VALERR_MACRO:
- // #111781# set INFO for validity with macro call, delete title
+ // set INFO for validity with macro call, delete title
mnFlags |= EXC_DV_ERROR_INFO;
maErrorTitle.Assign( '\0' ); // contains macro name
break;
@@ -1156,7 +1188,8 @@ void XclExpDV::SaveXml( XclExpXmlStream& rStrm )
XML_operator, lcl_GetOperatorType( mnFlags ),
XML_prompt, XESTRING_TO_PSZ( maPromptText ),
XML_promptTitle, XESTRING_TO_PSZ( maPromptTitle ),
- XML_showDropDown, XclXmlUtils::ToPsz( ! ::get_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN ) ),
+ // showDropDown should have been showNoDropDown - check oox/xlsx import for details
+ XML_showDropDown, XclXmlUtils::ToPsz( ::get_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN ) ),
XML_showErrorMessage, XclXmlUtils::ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWERROR ) ),
XML_showInputMessage, XclXmlUtils::ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWPROMPT ) ),
XML_sqref, XclXmlUtils::ToOString( maScRanges ).getStr(),
@@ -1433,7 +1466,7 @@ XclExpWebQueryBuffer::XclExpWebQueryBuffer( const XclExpRoot& rRoot )
String aRangeName;
ScRange aScDestRange;
ScUnoConversion::FillScRange( aScDestRange, aDestRange );
- if( const ScRangeData* pRangeData = rRoot.GetNamedRanges().GetRangeAtBlock( aScDestRange ) )
+ if( const ScRangeData* pRangeData = rRoot.GetNamedRanges().findByRange( aScDestRange ) )
{
aRangeName = pRangeData->GetName();
}
@@ -1460,3 +1493,4 @@ XclExpWebQueryBuffer::XclExpWebQueryBuffer( const XclExpRoot& rRoot )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index e68f4123a945..c7cfe136bff2 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,6 +42,10 @@
#include <com/sun/star/form/binding/XListEntrySink.hpp>
#include <com/sun/star/form/binding/XListEntrySource.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/container/XNamed.hpp>
#include <set>
#include <rtl/ustrbuf.h>
@@ -63,8 +68,28 @@
#include "xelink.hxx"
#include "xename.hxx"
#include "xestyle.hxx"
-
-using namespace ::oox;
+#include "userdat.hxx"
+#include "drwlayer.hxx"
+#include "svx/unoapi.hxx"
+#include "svx/algitem.hxx"
+#include "scitems.hxx"
+#include <editeng/justifyitem.hxx>
+#include "svx/sdtaitm.hxx"
+#include "attrib.hxx"
+#include "document.hxx"
+#include <svx/svdattr.hxx>
+#include "svx/sdr/properties/properties.hxx"
+#include "detfunc.hxx"
+#include "svx/xflclit.hxx"
+#include "svx/xlnstwit.hxx"
+#include "svx/xlnstit.hxx"
+#include "svx/sxmspitm.hxx"
+
+#include <oox/core/tokens.hxx>
+#include <oox/export/drawingml.hxx>
+#include <oox/export/chartexport.hxx>
+#include <oox/export/utils.hxx>
+#include <boost/shared_ptr.hpp>
using ::rtl::OString;
using ::rtl::OUString;
@@ -86,6 +111,111 @@ using ::com::sun::star::form::binding::XListEntrySource;
using ::com::sun::star::script::ScriptEventDescriptor;
using ::com::sun::star::table::CellAddress;
using ::com::sun::star::table::CellRangeAddress;
+using ::com::sun::star::chart2::XChartDocument;
+using ::com::sun::star::container::XNamed;
+using ::oox::drawingml::DrawingML;
+using ::oox::drawingml::ChartExport;
+
+#define HMM2XL(x) ((x)/26.5)+0.5
+
+#ifdef XLSX_OOXML_FUTURE
+// these function are only used within that context
+// Static Function Helpers
+static const char *ToHorizAlign( SdrTextHorzAdjust eAdjust )
+{
+ switch( eAdjust )
+ {
+ case SDRTEXTHORZADJUST_CENTER:
+ return "center";
+ case SDRTEXTHORZADJUST_RIGHT:
+ return "right";
+ case SDRTEXTHORZADJUST_BLOCK:
+ return "justify";
+ case SDRTEXTHORZADJUST_LEFT:
+ default:
+ return "left";
+ }
+ return "unknown";
+}
+
+static const char *ToVertAlign( SdrTextVertAdjust eAdjust )
+{
+ switch( eAdjust )
+ {
+ case SDRTEXTVERTADJUST_CENTER:
+ return "center";
+ case SDRTEXTVERTADJUST_BOTTOM:
+ return "bottom";
+ case SDRTEXTVERTADJUST_BLOCK:
+ return "justify";
+ case SDRTEXTVERTADJUST_TOP:
+ default:
+ return "top";
+ }
+ return "unknown";
+}
+
+static void lcl_WriteAnchorVertex( sax_fastparser::FSHelperPtr rComments, Rectangle &aRect )
+{
+ rComments->startElement( FSNS( XML_xdr, XML_col ), FSEND );
+ rComments->writeEscaped( OUString::valueOf( aRect.Left() ) );
+ rComments->endElement( FSNS( XML_xdr, XML_col ) );
+ rComments->startElement( FSNS( XML_xdr, XML_colOff ), FSEND );
+ rComments->writeEscaped( OUString::valueOf( aRect.Top() ) );
+ rComments->endElement( FSNS( XML_xdr, XML_colOff ) );
+ rComments->startElement( FSNS( XML_xdr, XML_row ), FSEND );
+ rComments->writeEscaped( OUString::valueOf( aRect.Right() ) );
+ rComments->endElement( FSNS( XML_xdr, XML_row ) );
+ rComments->startElement( FSNS( XML_xdr, XML_rowOff ), FSEND );
+ rComments->writeEscaped( OUString::valueOf( aRect.Bottom() ) );
+ rComments->endElement( FSNS( XML_xdr, XML_rowOff ) );
+}
+#endif
+
+static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, INT32 nTab, Rectangle &aFrom, Rectangle &aTo )
+{
+ bool bTo = false;
+ INT32 nCol = 0, nRow = 0;
+ INT32 nColOff = 0, nRowOff= 0;
+
+ while(1)
+ {
+ Rectangle r = rRoot.GetDocPtr()->GetMMRect( nCol,nRow,nCol,nRow,nTab );
+ if( !bTo )
+ {
+ if( r.Left() <= aRect.Left() )
+ {
+ nCol++;
+ nColOff = aRect.Left() - r.Left();
+ }
+ if( r.Top() <= aRect.Top() )
+ {
+ nRow++;
+ nRowOff = aRect.Top() - r.Top();
+ }
+ if( r.Left() > aRect.Left() && r.Top() > aRect.Top() )
+ {
+ aFrom = Rectangle( nCol-1, HMM2XL( nColOff ),
+ nRow-1, HMM2XL( nRowOff ) );
+ bTo=true;
+ }
+ }
+ if( bTo )
+ {
+ if( r.Right() < aRect.Right() )
+ nCol++;
+ if( r.Bottom() < aRect.Bottom() )
+ nRow++;
+ if( r.Right() >= aRect.Right() && r.Bottom() >= aRect.Bottom() )
+ {
+ aTo = Rectangle( nCol, HMM2XL( aRect.Right() - r.Left() ),
+ nRow, HMM2XL( aRect.Bottom() - r.Top() ));
+ break;
+ }
+ }
+ }
+ return;
+}
// Escher client anchor =======================================================
@@ -294,6 +424,17 @@ void XclExpImgData::Save( XclExpStream& rStrm )
}
}
+void XclExpImgData::SaveXml( XclExpXmlStream& rStrm )
+{
+ sax_fastparser::FSHelperPtr pWorksheet = rStrm.GetCurrentStream();
+
+ DrawingML aDML( pWorksheet, &rStrm, DrawingML::DOCUMENT_XLSX );
+ OUString rId = aDML.WriteImage( maGraphic );
+ pWorksheet->singleElement( XML_picture,
+ FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( rId ).getStr(),
+ FSEND );
+}
+
// ============================================================================
XclExpControlHelper::XclExpControlHelper( const XclExpRoot& rRoot ) :
@@ -392,8 +533,8 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc
// OBJ record flags
SetLocked( sal_True );
SetPrintable( aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Printable" ) ) );
- SetAutoFill( sal_False );
- SetAutoLine( sal_False );
+ SetAutoFill( false );
+ SetAutoLine( false );
// fill DFF property set
mrEscherEx.OpenContainer( ESCHER_SpContainer );
@@ -412,7 +553,7 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc
// meta file
//! TODO - needs check
Reference< XPropertySet > xShapePS( xShape, UNO_QUERY );
- if( xShapePS.is() && aPropOpt.CreateGraphicProperties( xShapePS, CREATE_STRING( "MetaFile" ), sal_False ) )
+ if( xShapePS.is() && aPropOpt.CreateGraphicProperties( xShapePS, CREATE_STRING( "MetaFile" ), false ) )
{
sal_uInt32 nBlipId;
if( aPropOpt.GetOpt( ESCHER_Prop_pib, nBlipId ) )
@@ -484,9 +625,9 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
#else
-XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) :
- XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN, true ),
- XclExpControlHelper( rObjMgr.GetRoot() ),
+XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< XShape > xShape , const Rectangle* pChildAnchor ) :
+ XclObj( rRoot, EXC_OBJTYPE_UNKNOWN, true ),
+ XclMacroHelper( rRoot ),
mnHeight( 0 ),
mnState( 0 ),
mnLineCount( 0 ),
@@ -536,8 +677,8 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Referenc
// OBJ record flags
SetLocked( sal_True );
SetPrintable( aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Printable" ) ) );
- SetAutoFill( sal_False );
- SetAutoLine( sal_False );
+ SetAutoFill( false );
+ SetAutoLine( false );
// fill DFF property set
mrEscherEx.OpenContainer( ESCHER_SpContainer );
@@ -735,15 +876,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Referenc
bool XclExpTbxControlObj::SetMacroLink( const ScriptEventDescriptor& rEvent )
{
- String aMacroName = XclControlHelper::ExtractFromMacroDescriptor( rEvent, meEventType );
- if( aMacroName.Len() )
- {
- sal_uInt16 nExtSheet = GetLocalLinkManager().FindExtSheet( EXC_EXTSH_OWNDOC );
- sal_uInt16 nNameIdx = GetNameManager().InsertMacroCall( aMacroName, true, false );
- mxMacroLink = GetFormulaCompiler().CreateNameXFormula( nExtSheet, nNameIdx );
- return true;
- }
- return false;
+ return XclMacroHelper::SetMacroLink( rEvent, meEventType );
}
void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
@@ -882,12 +1015,6 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
}
}
-void XclExpTbxControlObj::WriteMacroSubRec( XclExpStream& rStrm )
-{
- if( mxMacroLink.is() )
- WriteFormulaSubRec( rStrm, EXC_ID_OBJMACRO, *mxMacroLink );
-}
-
void XclExpTbxControlObj::WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId )
{
if( const XclTokenArray* pCellLink = GetCellLinkTokArr() )
@@ -920,7 +1047,7 @@ void XclExpTbxControlObj::WriteSbs( XclExpStream& rStrm )
XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) :
XclObj( rObjMgr, EXC_OBJTYPE_CHART ),
- XclExpRoot( rObjMgr.GetRoot() )
+ XclExpRoot( rObjMgr.GetRoot() ), mxShape( xShape )
{
// create the MSODRAWING record contents for the chart object
mrEscherEx.OpenContainer( ESCHER_SpContainer );
@@ -954,6 +1081,7 @@ XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape
ScfPropertySet aShapeProp( xShape );
Reference< XModel > xModel;
aShapeProp.GetProperty( xModel, CREATE_OUSTRING( "Model" ) );
+ mxChartDoc.set( xModel,UNO_QUERY );
::com::sun::star::awt::Rectangle aBoundRect;
aShapeProp.GetProperty( aBoundRect, CREATE_OUSTRING( "BoundRect" ) );
Rectangle aChartRect( Point( aBoundRect.X, aBoundRect.Y ), Size( aBoundRect.Width, aBoundRect.Height ) );
@@ -972,6 +1100,115 @@ void XclExpChartObj::Save( XclExpStream& rStrm )
mxChart->Save( rStrm );
}
+void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
+{
+ OSL_TRACE("XclExpChartObj::SaveXml -- Entry point to export chart");
+ sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
+
+ // FIXME: two cell? it seems the two cell anchor is incorrect.
+ pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor
+ XML_editAs, "oneCell",
+ FSEND );
+ Reference< XPropertySet > xPropSet( mxShape, UNO_QUERY );
+ if (xPropSet.is())
+ {
+ XclObjAny::WriteFromTo( rStrm, mxShape, GetTab() );
+ Reference< XModel > xModel( mxChartDoc, UNO_QUERY );
+ ChartExport aChartExport( XML_xdr, pDrawing, xModel, &rStrm, DrawingML::DOCUMENT_XLSX );
+ static sal_Int32 nChartCount = 0;
+ nChartCount++;
+ aChartExport.WriteChartObj( mxShape, nChartCount );
+ // TODO: get the correcto chart number
+ }
+
+ pDrawing->singleElement( FSNS( XML_xdr, XML_clientData),
+ // OOXTODO: XML_fLocksWithSheet
+ // OOXTODO: XML_fPrintsWithSheet
+ FSEND );
+ pDrawing->endElement( FSNS( XML_xdr, XML_twoCellAnchor ) );
+}
+
+void XclExpChartObj::WriteChartObj( sax_fastparser::FSHelperPtr pDrawing, XclExpXmlStream& rStrm )
+{
+ pDrawing->startElement( FSNS( XML_xdr, XML_graphicFrame ), FSEND );
+
+ pDrawing->startElement( FSNS( XML_xdr, XML_nvGraphicFramePr ), FSEND );
+
+ // TODO: get the correct chart name chart id
+ OUString sName = CREATE_OUSTRING("Object 1");
+ Reference< XNamed > xNamed( mxShape, UNO_QUERY );
+ if (xNamed.is())
+ {
+ sName = xNamed->getName();
+ }
+ sal_Int32 nID = rStrm.GetUniqueId();
+
+ pDrawing->singleElement( FSNS( XML_xdr, XML_cNvPr ),
+ XML_id, I32S( nID ),
+ XML_name, USS( sName ),
+ FSEND );
+
+ pDrawing->singleElement( FSNS( XML_xdr, XML_cNvGraphicFramePr ),
+ FSEND );
+
+ pDrawing->endElement( FSNS( XML_xdr, XML_nvGraphicFramePr ) );
+
+ // visual chart properties
+ WriteShapeTransformation( pDrawing, mxShape );
+
+ // writer chart object
+ pDrawing->startElement( FSNS( XML_a, XML_graphic ), FSEND );
+ pDrawing->startElement( FSNS( XML_a, XML_graphicData ),
+ XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/chart",
+ FSEND );
+ OUString sId;
+ // TODO:
+ static sal_Int32 nChartCount = 0;
+ nChartCount++;
+ sax_fastparser::FSHelperPtr pChart = rStrm.CreateOutputStream(
+ XclXmlUtils::GetStreamName( "xl/", "charts/chart", nChartCount ),
+ XclXmlUtils::GetStreamName( "../", "charts/chart", nChartCount ),
+ rStrm.GetCurrentStream()->getOutputStream(),
+ "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
+ &sId );
+
+ pDrawing->singleElement( FSNS( XML_c, XML_chart ),
+ FSNS( XML_xmlns, XML_c ), "http://schemas.openxmlformats.org/drawingml/2006/chart",
+ FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(),
+ FSEND );
+
+ rStrm.PushStream( pChart );
+ Reference< XModel > xModel( mxChartDoc, UNO_QUERY );
+ ChartExport aChartExport( XML_xdr, pChart, xModel, &rStrm, DrawingML::DOCUMENT_XLSX );
+ aChartExport.ExportContent();
+
+ rStrm.PopStream();
+
+ pDrawing->endElement( FSNS( XML_a, XML_graphicData ) );
+ pDrawing->endElement( FSNS( XML_a, XML_graphic ) );
+ pDrawing->endElement( FSNS( XML_xdr, XML_graphicFrame ) );
+
+}
+
+void XclExpChartObj::WriteShapeTransformation( sax_fastparser::FSHelperPtr pFS, const XShapeRef& rXShape, sal_Bool bFlipH, sal_Bool bFlipV, sal_Int32 nRotation )
+{
+ ::com::sun::star::awt::Point aPos = rXShape->getPosition();
+ ::com::sun::star::awt::Size aSize = rXShape->getSize();
+
+ pFS->startElementNS( XML_xdr, XML_xfrm,
+ XML_flipH, bFlipH ? "1" : NULL,
+ XML_flipV, bFlipV ? "1" : NULL,
+ XML_rot, nRotation ? I32S( nRotation ) : NULL,
+ FSEND );
+
+ pFS->singleElementNS( XML_a, XML_off, XML_x, IS( MM100toEMU( aPos.X ) ), XML_y, IS( MM100toEMU( aPos.Y ) ), FSEND );
+ pFS->singleElementNS( XML_a, XML_ext, XML_cx, IS( MM100toEMU( aSize.Width ) ), XML_cy, IS( MM100toEMU( aSize.Height ) ), FSEND );
+
+ pFS->endElementNS( XML_xdr, XML_xfrm );
+}
+
// ============================================================================
XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
@@ -984,7 +1221,12 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
// get the main note text
String aNoteText;
if( pScNote )
+ {
aNoteText = pScNote->GetText();
+ const EditTextObject *pEditObj = pScNote->GetEditTextObject();
+ if( pEditObj )
+ mpNoteContents = XclExpStringHelper::CreateString( rRoot, *pEditObj );
+ }
// append additional text
ScGlobal::AddToken( aNoteText, rAddText, '\n', 2 );
maOrigNoteText = aNoteText;
@@ -1001,8 +1243,24 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
// TODO: additional text
if( pScNote )
if( SdrCaptionObj* pCaption = pScNote->GetOrCreateCaption( maScPos ) )
+ {
+ lcl_GetFromTo( rRoot, pCaption->GetLogicRect(), maScPos.Tab(), maCommentFrom, maCommentTo );
if( const OutlinerParaObject* pOPO = pCaption->GetOutlinerParaObject() )
- mnObjId = rRoot.GetObjectManager().AddObj( new XclObjComment( rRoot.GetObjectManager(), pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible ) );
+ mnObjId = rRoot.GetObjectManager().AddObj( new XclObjComment( rRoot.GetObjectManager(), pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible, maScPos, maCommentFrom, maCommentTo ) );
+
+ SfxItemSet aItemSet = pCaption->GetMergedItemSet();
+ meTVA = pCaption->GetTextVerticalAdjust();
+ meTHA = pCaption->GetTextHorizontalAdjust();
+ mbAutoScale = pCaption->GetFitToSize()?true:false;
+ mbLocked = pCaption->IsMoveProtect() | pCaption->IsResizeProtect();
+
+ // AutoFill style would change if Postit.cxx object creation values are changed
+ OUString aCol(((XFillColorItem &)GETITEM(aItemSet, XFillColorItem , XATTR_FILLCOLOR)).GetValue());
+ mbAutoFill = !aCol.getLength() && (GETITEMVALUE(aItemSet, XFillStyleItem, XATTR_FILLSTYLE, sal_uLong) == XFILL_SOLID);
+ mbAutoLine = true;
+ mbRowHidden = (rRoot.GetDoc().RowHidden(maScPos.Row(),maScPos.Tab()));
+ mbColHidden = (rRoot.GetDoc().ColHidden(maScPos.Col(),maScPos.Tab()));
+ }
SetRecSize( 9 + maAuthor.GetSize() );
}
@@ -1086,15 +1344,111 @@ void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm )
FSEND );
rComments->startElement( XML_text, FSEND );
// OOXTODO: phoneticPr, rPh, r
- rComments->startElement( XML_t, FSEND );
- rComments->writeEscaped( XclXmlUtils::ToOUString( maOrigNoteText ) );
- rComments->endElement ( XML_t );
+ if( mpNoteContents )
+ mpNoteContents->WriteXml( rStrm );
rComments->endElement( XML_text );
+
+/*
+ Export of commentPr is disabled, since the current (Oct 2010)
+ version of MSO 2010 doesn't yet support commentPr
+ */
+#ifdef XLSX_OOXML_FUTURE
+ if( rStrm.getVersion() == oox::core::ISOIEC_29500_2008 )
+ {
+ rComments->startElement( XML_commentPr,
+ XML_autoFill, XclXmlUtils::ToPsz( mbAutoFill ),
+ XML_autoScale, XclXmlUtils::ToPsz( mbAutoScale ),
+ XML_colHidden, XclXmlUtils::ToPsz( mbColHidden ),
+ XML_locked, XclXmlUtils::ToPsz( mbLocked ),
+ XML_rowHidden, XclXmlUtils::ToPsz( mbRowHidden ),
+ XML_textHAlign, ToHorizAlign( meTHA ),
+ XML_textVAlign, ToVertAlign( meTVA ) ,
+ FSEND );
+ rComments->startElement( XML_anchor,
+ XML_moveWithCells, "false",
+ XML_sizeWithCells, "false",
+ FSEND );
+ rComments->startElement( FSNS( XML_xdr, XML_from ), FSEND );
+ lcl_WriteAnchorVertex( rComments, maCommentFrom );
+ rComments->endElement( FSNS( XML_xdr, XML_from ) );
+ rComments->startElement( FSNS( XML_xdr, XML_to ), FSEND );
+ lcl_WriteAnchorVertex( rComments, maCommentTo );
+ rComments->endElement( FSNS( XML_xdr, XML_to ) );
+ rComments->endElement( XML_anchor );
+ rComments->endElement( XML_commentPr );
+ }
+#endif
rComments->endElement( XML_comment );
}
// ============================================================================
+XclMacroHelper::XclMacroHelper( const XclExpRoot& rRoot ) :
+ XclExpControlHelper( rRoot )
+{
+}
+
+XclMacroHelper::~XclMacroHelper()
+{
+}
+
+void XclMacroHelper::WriteMacroSubRec( XclExpStream& rStrm )
+{
+ if( mxMacroLink )
+ WriteFormulaSubRec( rStrm, EXC_ID_OBJMACRO, *mxMacroLink );
+}
+
+bool
+XclMacroHelper::SetMacroLink( const ScriptEventDescriptor& rEvent, const XclTbxEventType& nEventType )
+{
+ String aMacroName = XclControlHelper::ExtractFromMacroDescriptor( rEvent, nEventType, GetDocShell() );
+ if( aMacroName.Len() )
+ {
+ return SetMacroLink( aMacroName );
+ }
+ return false;
+}
+
+bool
+XclMacroHelper::SetMacroLink( const String& rMacroName )
+{
+ OSL_TRACE("SetMacroLink( macroname:=%s )", rtl::OUStringToOString( rMacroName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ if( rMacroName.Len() )
+ {
+ sal_uInt16 nExtSheet = GetLocalLinkManager().FindExtSheet( EXC_EXTSH_OWNDOC );
+ sal_uInt16 nNameIdx = GetNameManager().InsertMacroCall( rMacroName, true, false );
+ mxMacroLink = GetFormulaCompiler().CreateNameXFormula( nExtSheet, nNameIdx );
+ return true;
+ }
+ return false;
+}
+
+XclExpShapeObj::XclExpShapeObj( XclExpObjectManager& rRoot, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) :
+ XclObjAny( rRoot, xShape ),
+ XclMacroHelper( rRoot )
+{
+ if( SdrObject* pSdrObj = ::GetSdrObjectFromXShape( xShape ) )
+ {
+ ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pSdrObj );
+ if ( pInfo && pInfo->GetMacro().getLength() )
+// FIXME ooo330-m2: XclControlHelper::GetXclMacroName was removed in upstream sources; they started to call XclTools::GetXclMacroName instead; is this enough? it has only one parameter
+// SetMacroLink( XclControlHelper::GetXclMacroName( pInfo->GetMacro(), rRoot.GetDocShell() ) );
+ SetMacroLink( XclTools::GetXclMacroName( pInfo->GetMacro() ) );
+ }
+}
+
+XclExpShapeObj::~XclExpShapeObj()
+{
+}
+
+void XclExpShapeObj::WriteSubRecs( XclExpStream& rStrm )
+{
+ XclObjAny::WriteSubRecs( rStrm );
+ WriteMacroSubRec( rStrm );
+}
+
+// ============================================================================
+
XclExpComments::XclExpComments( SCTAB nTab, XclExpRecordList< XclExpNote >& rNotes )
: mnTab( nTab ), mrNotes( rNotes )
{
@@ -1104,7 +1458,7 @@ struct OUStringLess : public std::binary_function<OUString, OUString, bool>
{
bool operator()(const OUString& x, const OUString& y) const
{
- return x.compareTo( y ) <= 0;
+ return x.compareTo( y ) < 0;
}
};
@@ -1123,6 +1477,7 @@ void XclExpComments::SaveXml( XclExpXmlStream& rStrm )
rComments->startElement( XML_comments,
XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ FSNS( XML_xmlns, XML_xdr ), "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
FSEND );
rComments->startElement( XML_authors, FSEND );
@@ -1148,7 +1503,7 @@ void XclExpComments::SaveXml( XclExpXmlStream& rStrm )
for( size_t i = 0; i < nNotes; ++i )
{
XclExpNoteList::RecordRefType xNote = mrNotes.GetRecord( i );
- Authors::const_iterator aAuthor = aAuthors.find(
+ Authors::iterator aAuthor = aAuthors.find(
XclXmlUtils::ToOUString( xNote->GetAuthor() ) );
sal_Int32 nAuthorId = distance( aAuthors.begin(), aAuthor );
xNote->WriteXml( nAuthorId, rStrm );
@@ -1185,9 +1540,9 @@ XclExpDffAnchorBase* XclExpObjectManager::CreateDffAnchor() const
return new XclExpDffSheetAnchor( GetRoot() );
}
-ScfRef< XclExpRecordBase > XclExpObjectManager::CreateDrawingGroup()
+boost::shared_ptr< XclExpRecordBase > XclExpObjectManager::CreateDrawingGroup()
{
- return ScfRef< XclExpRecordBase >( new XclExpMsoDrawingGroup( *mxEscherEx ) );
+ return boost::shared_ptr< XclExpRecordBase >( new XclExpMsoDrawingGroup( *mxEscherEx ) );
}
void XclExpObjectManager::StartSheet()
@@ -1195,11 +1550,11 @@ void XclExpObjectManager::StartSheet()
mxObjList.reset( new XclExpObjList( GetRoot(), *mxEscherEx ) );
}
-ScfRef< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( SdrPage* pSdrPage )
+boost::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( SdrPage* pSdrPage )
{
if( pSdrPage )
mxEscherEx->AddSdrPage( *pSdrPage );
- // #106213# the first dummy object may still be open
+ // the first dummy object may still be open
DBG_ASSERT( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
while( mxEscherEx->GetGroupLevel() )
mxEscherEx->LeaveGroup();
@@ -1207,11 +1562,11 @@ ScfRef< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( SdrPage* pSdrPag
return mxObjList;
}
-ScfRef< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const Reference< XShapes >& rxShapes )
+boost::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const Reference< XShapes >& rxShapes )
{
if( rxShapes.is() )
mxEscherEx->AddUnoShapes( rxShapes );
- // #106213# the first dummy object may still be open
+ // the first dummy object may still be open
DBG_ASSERT( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
while( mxEscherEx->GetGroupLevel() )
mxEscherEx->LeaveGroup();
@@ -1282,3 +1637,4 @@ XclExpDffAnchorBase* XclExpEmbeddedObjectManager::CreateDffAnchor() const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 7b3f84c42643..4d40aaf1d206 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116,7 +117,7 @@ void XclExpOperandList::AppendOperand( sal_uInt16 nTokPos, XclFuncParamConv eCon
rConvInfo.mbValType = bValType;
}
-typedef ScfRef< XclExpOperandList > XclExpOperandListRef;
+typedef boost::shared_ptr< XclExpOperandList > XclExpOperandListRef;
typedef ::std::vector< XclExpOperandListRef > XclExpOperandListVector;
// ----------------------------------------------------------------------------
@@ -278,7 +279,7 @@ static const XclExpCompConfig spConfigTable[] =
/** Working data of the formula compiler. Used to push onto a stack for recursive calls. */
struct XclExpCompData
{
- typedef ScfRef< ScTokenArray > ScTokenArrayRef;
+ typedef boost::shared_ptr< ScTokenArray > ScTokenArrayRef;
const XclExpCompConfig& mrCfg; /// Configuration for current formula type.
ScTokenArrayRef mxOwnScTokArr; /// Own clone of a Calc token array.
@@ -379,7 +380,6 @@ private:
void ProcessDouble( const XclExpScToken& rTokData );
void ProcessString( const XclExpScToken& rTokData );
- void ProcessError( const XclExpScToken& rTokData );
void ProcessMissing( const XclExpScToken& rTokData );
void ProcessBad( const XclExpScToken& rTokData );
void ProcessParentheses( const XclExpScToken& rTokData );
@@ -471,14 +471,13 @@ private:
void AppendExt( sal_uInt8 nData );
void AppendExt( sal_uInt8 nData, size_t nCount );
void AppendExt( sal_uInt16 nData );
- void AppendExt( sal_uInt32 nData );
void AppendExt( double fData );
void AppendExt( const String& rString );
// ------------------------------------------------------------------------
private:
typedef ::std::map< XclFormulaType, XclExpCompConfig > XclExpCompConfigMap;
- typedef ScfRef< XclExpCompData > XclExpCompDataRef;
+ typedef boost::shared_ptr< XclExpCompData > XclExpCompDataRef;
typedef ::std::vector< XclExpCompDataRef > XclExpCompDataVector;
XclExpCompConfigMap maCfgMap; /// Compiler configuration map for all formula types.
@@ -634,7 +633,7 @@ void XclExpFmlaCompImpl::Init( XclFormulaType eType, const ScTokenArray& rScTokA
mxData->mpLinkMgr = mxData->mrCfg.mbLocalLinkMgr ? &GetLocalLinkManager() : &GetGlobalLinkManager();
// token array iterator (use cloned token array if present)
- mxData->maTokArrIt.Init( mxData->mxOwnScTokArr.is() ? *mxData->mxOwnScTokArr : rScTokArr, false );
+ mxData->maTokArrIt.Init( mxData->mxOwnScTokArr ? *mxData->mxOwnScTokArr : rScTokArr, false );
mxData->mpRefLog = pRefLog;
}
}
@@ -1170,9 +1169,6 @@ XclExpScToken XclExpFmlaCompImpl::Factor( XclExpScToken aTokData )
case svUnknown: mxData->mbOk = false; break;
case svDouble: ProcessDouble( aTokData ); break;
case svString: ProcessString( aTokData ); break;
-#if 0 // erAck
- case svError: ProcessError( aTokData ); break;
-#endif
case svSingleRef: ProcessCellRef( aTokData ); break;
case svDoubleRef: ProcessRangeRef( aTokData ); break;
case svExternalSingleRef: ProcessExternalCellRef( aTokData ); break;
@@ -1218,15 +1214,6 @@ void XclExpFmlaCompImpl::ProcessString( const XclExpScToken& rTokData )
Append( rTokData.mpScToken->GetString() );
}
-void XclExpFmlaCompImpl::ProcessError( const XclExpScToken& rTokData )
-{
-#if 0 // erAck
- AppendErrorToken( XclTools::GetXclErrorCode( rTokData.mpScToken->GetError() ), rTokData.mnSpaces );
-#else
- (void)rTokData; // compiler warning
-#endif
-}
-
void XclExpFmlaCompImpl::ProcessMissing( const XclExpScToken& rTokData )
{
AppendMissingToken( rTokData.mnSpaces );
@@ -1323,18 +1310,16 @@ void XclExpFmlaCompImpl::ProcessMatrix( const XclExpScToken& rTokData )
{
for( SCSIZE nScCol = 0; nScCol < nScCols; ++nScCol )
{
- ScMatValType nType;
- const ScMatrixValue* pMatVal = pMatrix->Get( nScCol, nScRow, nType );
- DBG_ASSERT( pMatVal, "XclExpFmlaCompImpl::ProcessMatrix - missing matrix value" );
- if( ScMatrix::IsValueType( nType ) ) // value, boolean, or error
+ ScMatrixValue nMatVal = pMatrix->Get( nScCol, nScRow );
+ if( ScMatrix::IsValueType( nMatVal.nType ) ) // value, boolean, or error
{
- if( ScMatrix::IsBooleanType( nType ) )
+ if( ScMatrix::IsBooleanType( nMatVal.nType ) )
{
AppendExt( EXC_CACHEDVAL_BOOL );
- AppendExt( static_cast< sal_uInt8 >( pMatVal->GetBoolean() ? 1 : 0 ) );
+ AppendExt( static_cast< sal_uInt8 >( nMatVal.GetBoolean() ? 1 : 0 ) );
AppendExt( 0, 7 );
}
- else if( sal_uInt16 nErr = pMatVal->GetError() )
+ else if( sal_uInt16 nErr = nMatVal.GetError() )
{
AppendExt( EXC_CACHEDVAL_ERROR );
AppendExt( XclTools::GetXclErrorCode( nErr ) );
@@ -1343,12 +1328,12 @@ void XclExpFmlaCompImpl::ProcessMatrix( const XclExpScToken& rTokData )
else
{
AppendExt( EXC_CACHEDVAL_DOUBLE );
- AppendExt( pMatVal->fVal );
+ AppendExt( nMatVal.fVal );
}
}
else // string or empty
{
- const String& rStr = pMatVal->GetString();
+ const String& rStr = nMatVal.GetString();
if( rStr.Len() == 0 )
{
AppendExt( EXC_CACHEDVAL_EMPTY );
@@ -1674,7 +1659,7 @@ void XclExpFmlaCompImpl::AppendTrailingParam( XclExpFuncData& rFuncData )
case ocIf:
if( nParamCount == 1 )
{
- // #112262# Excel needs at least two parameters in IF function
+ // Excel needs at least two parameters in IF function
PrepareParam( rFuncData );
AppendBoolToken( true );
FinishParam( rFuncData );
@@ -2108,7 +2093,7 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpScToken& rTokData )
{
for( FormulaToken* pScToken = xArray->First(); pScToken; pScToken = xArray->Next() )
{
- if( pScToken->GetOpCode() == ocExternalRef )
+ if( pScToken->IsExternalRef() )
{
switch( pScToken->GetType() )
{
@@ -2519,11 +2504,6 @@ void XclExpFmlaCompImpl::AppendExt( sal_uInt16 nData )
lclAppend( mxData->maExtDataVec, nData );
}
-void XclExpFmlaCompImpl::AppendExt( sal_uInt32 nData )
-{
- lclAppend( mxData->maExtDataVec, nData );
-}
-
void XclExpFmlaCompImpl::AppendExt( double fData )
{
lclAppend( mxData->maExtDataVec, fData );
@@ -2613,18 +2593,18 @@ XclTokenArrayRef XclExpFormulaCompiler::CreateFormula( XclFormulaType eType, con
XclTokenArrayRef XclExpFormulaCompiler::CreateFormula( XclFormulaType eType, const ScRangeList& rScRanges )
{
- sal_uLong nCount = rScRanges.Count();
+ size_t nCount = rScRanges.size();
if( nCount == 0 )
return XclTokenArrayRef();
ScTokenArray aScTokArr;
SCTAB nCurrScTab = GetCurrScTab();
bool b3DRefOnly = mxImpl->Is3DRefOnly( eType );
- for( sal_uLong nIdx = 0; nIdx < nCount; ++nIdx )
+ for( size_t nIdx = 0; nIdx < nCount; ++nIdx )
{
if( nIdx > 0 )
aScTokArr.AddOpCode( ocUnion );
- lclPutRangeToTokenArray( aScTokArr, *rScRanges.GetObject( nIdx ), nCurrScTab, b3DRefOnly );
+ lclPutRangeToTokenArray( aScTokArr, *rScRanges[ nIdx ], nCurrScTab, b3DRefOnly );
}
return mxImpl->CreateFormula( eType, aScTokArr );
}
@@ -2648,3 +2628,4 @@ XclTokenArrayRef XclExpFormulaCompiler::CreateNameXFormula(
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index 2c8434b1d8f7..90743a7ffb28 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -255,33 +256,15 @@ bool XclExpAddressConverter::ConvertRange( XclRange& rXclRange,
return bValidStart;
}
-//UNUSED2008-05 XclRange XclExpAddressConverter::CreateValidRange( const ScRange& rScRange, bool bWarn )
-//UNUSED2008-05 {
-//UNUSED2008-05 return XclRange(
-//UNUSED2008-05 CreateValidAddress( rScRange.aStart, bWarn ),
-//UNUSED2008-05 CreateValidAddress( rScRange.aEnd, bWarn ) );
-//UNUSED2008-05 }
-
// cell range list ------------------------------------------------------------
-//UNUSED2008-05 bool XclExpAddressConverter::CheckRangeList( const ScRangeList& rScRanges, bool bWarn )
-//UNUSED2008-05 {
-//UNUSED2008-05 for( sal_uLong nIdx = 0, nSize = rScRanges.Count(); nIdx < nSize; ++nIdx )
-//UNUSED2008-05 if( const ScRange* pScRange = rScRanges.GetObject( nIdx ) )
-//UNUSED2008-05 if( !CheckRange( *pScRange, bWarn ) )
-//UNUSED2008-05 return false;
-//UNUSED2008-05 return true;
-//UNUSED2008-05 }
-
void XclExpAddressConverter::ValidateRangeList( ScRangeList& rScRanges, bool bWarn )
{
- sal_uLong nIdx = rScRanges.Count();
- while( nIdx )
+ for ( size_t nRange = rScRanges.size(); nRange > 0; )
{
- --nIdx; // backwards to keep nIdx valid
- ScRange* pScRange = rScRanges.GetObject( nIdx );
- if( pScRange && !CheckRange( *pScRange, bWarn ) )
- delete rScRanges.Remove( nIdx );
+ ScRange* pScRange = rScRanges[ --nRange ];
+ if( !CheckRange( *pScRange, bWarn ) )
+ delete rScRanges.Remove(nRange);
}
}
@@ -289,9 +272,9 @@ void XclExpAddressConverter::ConvertRangeList( XclRangeList& rXclRanges,
const ScRangeList& rScRanges, bool bWarn )
{
rXclRanges.clear();
- for( sal_uLong nPos = 0, nCount = rScRanges.Count(); nPos < nCount; ++nPos )
+ for( size_t nPos = 0, nCount = rScRanges.size(); nPos < nCount; ++nPos )
{
- if( const ScRange* pScRange = rScRanges.GetObject( nPos ) )
+ if( const ScRange* pScRange = rScRanges[ nPos ] )
{
XclRange aXclRange( ScAddress::UNINITIALIZED );
if( ConvertRange( aXclRange, *pScRange, bWarn ) )
@@ -333,7 +316,7 @@ String XclExpHyperlinkHelper::ProcessUrlField( const SvxURLField& rUrlField )
if( GetBiff() == EXC_BIFF8 ) // no HLINK records in BIFF2-BIFF7
{
// there was/is already a HLINK record
- mbMultipleUrls = mxLinkRec.is();
+ mbMultipleUrls = mxLinkRec;
mxLinkRec.reset( new XclExpHyperlink( GetRoot(), rUrlField, maScPos ) );
@@ -350,7 +333,7 @@ String XclExpHyperlinkHelper::ProcessUrlField( const SvxURLField& rUrlField )
bool XclExpHyperlinkHelper::HasLinkRecord() const
{
- return !mbMultipleUrls && mxLinkRec.is();
+ return !mbMultipleUrls && mxLinkRec;
}
XclExpHyperlinkHelper::XclExpHyperlinkRef XclExpHyperlinkHelper::GetLinkRecord()
@@ -496,7 +479,7 @@ XclExpStringRef lclCreateFormattedString(
{
// test if the character is a text field
const SfxPoolItem* pItem;
- if( aEditSet.GetItemState( EE_FEATURE_FIELD, sal_False, &pItem ) == SFX_ITEM_SET )
+ if( aEditSet.GetItemState( EE_FEATURE_FIELD, false, &pItem ) == SFX_ITEM_SET )
{
const SvxFieldData* pField = static_cast< const SvxFieldItem* >( pItem )->GetField();
if( const SvxURLField* pUrlField = PTR_CAST( SvxURLField, pField ) )
@@ -849,7 +832,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico
const SfxPoolItem* pItem;
if( (aSel.nStartPos + 1 == aSel.nEndPos) && // fields are single characters
- (aEditSet.GetItemState( EE_FEATURE_FIELD, sal_False, &pItem ) == SFX_ITEM_SET) )
+ (aEditSet.GetItemState( EE_FEATURE_FIELD, false, &pItem ) == SFX_ITEM_SET) )
{
if( const SvxFieldData* pFieldData = static_cast< const SvxFieldItem* >( pItem )->GetField() )
{
@@ -1102,29 +1085,28 @@ void XclExpCachedMatrix::Save( XclExpStream& rStrm ) const
{
for( SCSIZE nCol = 0; nCol < nCols; ++nCol )
{
- ScMatValType nMatValType = SC_MATVAL_VALUE;
- const ScMatrixValue* pMatVal = mrMatrix.Get( nCol, nRow, nMatValType );
+ ScMatrixValue nMatVal = mrMatrix.Get( nCol, nRow );
- if( !pMatVal || SC_MATVAL_EMPTY == nMatValType )
+ if( SC_MATVAL_EMPTY == nMatVal.nType )
{
rStrm.SetSliceSize( 9 );
rStrm << EXC_CACHEDVAL_EMPTY;
rStrm.WriteZeroBytes( 8 );
}
- else if( ScMatrix::IsNonValueType( nMatValType ) )
+ else if( ScMatrix::IsNonValueType( nMatVal.nType ) )
{
- XclExpString aStr( pMatVal->GetString(), EXC_STR_DEFAULT );
+ XclExpString aStr( nMatVal.GetString(), EXC_STR_DEFAULT );
rStrm.SetSliceSize( 6 );
rStrm << EXC_CACHEDVAL_STRING << aStr;
}
- else if( SC_MATVAL_BOOLEAN == nMatValType )
+ else if( SC_MATVAL_BOOLEAN == nMatVal.nType )
{
- sal_Int8 nBool = pMatVal->GetBoolean();
+ sal_Int8 nBool = nMatVal.GetBoolean();
rStrm.SetSliceSize( 9 );
rStrm << EXC_CACHEDVAL_BOOL << nBool;
rStrm.WriteZeroBytes( 7 );
}
- else if( sal_uInt16 nScError = pMatVal->GetError() )
+ else if( sal_uInt16 nScError = nMatVal.GetError() )
{
sal_Int8 nError ( XclTools::GetXclErrorCode( nScError ) );
rStrm.SetSliceSize( 9 );
@@ -1134,7 +1116,7 @@ void XclExpCachedMatrix::Save( XclExpStream& rStrm ) const
else
{
rStrm.SetSliceSize( 9 );
- rStrm << EXC_CACHEDVAL_DOUBLE << pMatVal->fVal;
+ rStrm << EXC_CACHEDVAL_DOUBLE << nMatVal.fVal;
}
}
}
@@ -1142,3 +1124,4 @@ void XclExpCachedMatrix::Save( XclExpStream& rStrm ) const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index c30d862e6df3..43f8342bf815 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,7 +106,7 @@ private:
virtual void WriteAddData( XclExpStream& rStrm );
private:
- typedef ScfRef< XclExpCachedMatrix > XclExpCachedMatRef;
+ typedef boost::shared_ptr< XclExpCachedMatrix > XclExpCachedMatRef;
XclExpCachedMatRef mxMatrix; /// Cached results of the DDE link.
};
@@ -246,7 +247,7 @@ protected:
void WriteExtNameBuffer( XclExpStream& rStrm );
private:
- typedef ScfRef< XclExpExtNameBuffer > XclExpExtNameBfrRef;
+ typedef boost::shared_ptr< XclExpExtNameBuffer > XclExpExtNameBfrRef;
XclExpExtNameBfrRef mxExtNameBfr; /// List of EXTERNNAME records.
};
@@ -712,7 +713,7 @@ XclExpTabInfo::XclExpTabInfo( const XclExpRoot& rRoot ) :
SCTAB nDisplScTab = rDocOpt.GetDocSettings().mnDisplTab;
- // #112908# find first visible exported sheet
+ // find first visible exported sheet
if( (nFirstVisScTab == SCTAB_INVALID) || !IsExportTab( nFirstVisScTab ) )
{
// no exportable visible sheet -> use first exportable sheet
@@ -798,12 +799,6 @@ SCTAB XclExpTabInfo::GetRealScTab( SCTAB nSortedScTab ) const
return (nSortedScTab < mnScCnt) ? maFromSortedVec[ nSortedScTab ] : SCTAB_INVALID;
}
-//UNUSED2009-05 SCTAB XclExpTabInfo::GetSortedScTab( SCTAB nScTab ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 DBG_ASSERT( nScTab < mnScCnt, "XclExpTabInfo::GetSortedScTab - sheet out of range" );
-//UNUSED2009-05 return (nScTab < mnScCnt) ? maToSortedVec[ nScTab ] : SCTAB_INVALID;
-//UNUSED2009-05 }
-
bool XclExpTabInfo::GetFlag( SCTAB nScTab, sal_uInt8 nFlags ) const
{
DBG_ASSERT( nScTab < mnScCnt, "XclExpTabInfo::GetFlag - sheet out of range" );
@@ -941,7 +936,7 @@ XclExpExtNameDde::XclExpExtNameDde( const XclExpRoot& rRoot,
void XclExpExtNameDde::WriteAddData( XclExpStream& rStrm )
{
- if( mxMatrix.is() )
+ if( mxMatrix )
mxMatrix->Save( rStrm );
}
@@ -968,7 +963,7 @@ void XclExpExtName::WriteAddData( XclExpStream& rStrm )
break;
const ScToken* p = static_cast<const ScToken*>(mpArray->First());
- if (p->GetOpCode() != ocExternalRef)
+ if (!p->IsExternalRef())
break;
switch (p->GetType())
@@ -1237,7 +1232,7 @@ public:
bool XclExpCrnList::InsertValue( SCCOL nScCol, SCROW nScRow, const Any& rValue )
{
RecordRefType xLastRec = GetLastRecord();
- if( xLastRec.is() && xLastRec->InsertValue( nScCol, nScRow, rValue ) )
+ if( xLastRec && xLastRec->InsertValue( nScCol, nScRow, rValue ) )
return true;
if( GetSize() == SAL_MAX_UINT16 )
return false;
@@ -1331,7 +1326,7 @@ XclExpExtNameBuffer& XclExpExternSheetBase::GetExtNameBuffer()
void XclExpExternSheetBase::WriteExtNameBuffer( XclExpStream& rStrm )
{
- if( mxExtNameBfr.is() )
+ if( mxExtNameBfr )
mxExtNameBfr->Save( rStrm );
}
@@ -1535,7 +1530,7 @@ void XclExpSupbook::Save( XclExpStream& rStrm )
const XclExpString* XclExpSupbook::GetTabName( sal_uInt16 nSBTab ) const
{
XclExpXctRef xXct = maXctList.GetRecord( nSBTab );
- return xXct.is() ? &xXct->GetTabName() : 0;
+ return xXct ? &xXct->GetTabName() : 0;
}
void XclExpSupbook::WriteBody( XclExpStream& rStrm )
@@ -1616,7 +1611,7 @@ XclExpXti XclExpSupbookBuffer::GetXti( sal_uInt16 nFirstXclTab, sal_uInt16 nLast
pRefLogEntry->mnFirstXclTab = nFirstXclTab;
pRefLogEntry->mnLastXclTab = nLastXclTab;
XclExpSupbookRef xSupbook = maSupbookList.GetRecord( aXti.mnSupbook );
- if( xSupbook.is() )
+ if( xSupbook )
xSupbook->FillRefLogEntry( *pRefLogEntry, aXti.mnFirstSBTab, aXti.mnLastSBTab );
}
}
@@ -1638,8 +1633,8 @@ void XclExpSupbookBuffer::StoreCellRange( const ScRange& rRange )
{
const XclExpSBIndex& rSBIndex = maSBIndexVec[ nXclTab ];
XclExpSupbookRef xSupbook = maSupbookList.GetRecord( rSBIndex.mnSupbook );
- DBG_ASSERT( xSupbook.is(), "XclExpSupbookBuffer::StoreCellRange - missing SUPBOOK record" );
- if( xSupbook.is() )
+ DBG_ASSERT( xSupbook , "XclExpSupbookBuffer::StoreCellRange - missing SUPBOOK record" );
+ if( xSupbook )
xSupbook->StoreCellRange( rRange, rSBIndex.mnSBTab );
}
}
@@ -1780,7 +1775,7 @@ bool XclExpSupbookBuffer::InsertAddIn(
}
else
xSupbook = maSupbookList.GetRecord( mnAddInSB );
- DBG_ASSERT( xSupbook.is(), "XclExpSupbookBuffer::InsertAddin - missing add-in supbook" );
+ DBG_ASSERT( xSupbook, "XclExpSupbookBuffer::InsertAddin - missing add-in supbook" );
rnSupbook = mnAddInSB;
rnExtName = xSupbook->InsertAddIn( rName );
return rnExtName > 0;
@@ -1879,7 +1874,7 @@ XclExpXti XclExpSupbookBuffer::GetXti( sal_uInt16 nFileId, const String& rTabNam
{
pRefLogEntry->mnFirstXclTab = 0;
pRefLogEntry->mnLastXclTab = 0;
- if (xSupbook.is())
+ if (xSupbook)
xSupbook->FillRefLogEntry(*pRefLogEntry, aXti.mnFirstSBTab, aXti.mnLastSBTab);
}
@@ -1994,7 +1989,7 @@ bool XclExpLinkManagerImpl5::InsertAddIn(
sal_uInt16& rnExtSheet, sal_uInt16& rnExtName, const String& rName )
{
XclExpExtSheetRef xExtSheet = FindInternal( rnExtSheet, EXC_EXTSH_ADDIN );
- if( xExtSheet.is() )
+ if( xExtSheet )
{
rnExtName = xExtSheet->InsertAddIn( rName );
return rnExtName > 0;
@@ -2369,3 +2364,4 @@ void XclExpLinkManager::Save( XclExpStream& rStrm )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index 1a0b54b699eb..9bd32dc63fd4 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -293,7 +294,7 @@ void XclExpName::SetSymbol( String sSymbol )
bool XclExpName::IsVolatile() const
{
- return mxTokArr.is() && mxTokArr->IsVolatile();
+ return mxTokArr && mxTokArr->IsVolatile();
}
bool XclExpName::IsHidden() const
@@ -310,9 +311,9 @@ bool XclExpName::IsMacroCall( bool bVBasic, bool bFunc ) const
void XclExpName::Save( XclExpStream& rStrm )
{
- DBG_ASSERT( mxName.is() && (mxName->Len() > 0), "XclExpName::Save - missing name" );
+ DBG_ASSERT( mxName && (mxName->Len() > 0), "XclExpName::Save - missing name" );
DBG_ASSERT( !(IsGlobal() && ::get_flag( mnFlags, EXC_NAME_BUILTIN )), "XclExpName::Save - global built-in name" );
- SetRecSize( 11 + mxName->GetSize() + (mxTokArr.is() ? mxTokArr->GetSize() : 2) );
+ SetRecSize( 11 + mxName->GetSize() + (mxTokArr ? mxTokArr->GetSize() : 2) );
XclExpRecord::Save( rStrm );
}
@@ -346,7 +347,7 @@ void XclExpName::SaveXml( XclExpXmlStream& rStrm )
void XclExpName::WriteBody( XclExpStream& rStrm )
{
- sal_uInt16 nFmlaSize = mxTokArr.is() ? mxTokArr->GetSize() : 0;
+ sal_uInt16 nFmlaSize = mxTokArr ? mxTokArr->GetSize() : 0;
rStrm << mnFlags // flags
<< sal_uInt8( 0 ); // keyboard shortcut
@@ -357,7 +358,7 @@ void XclExpName::WriteBody( XclExpStream& rStrm )
<< sal_uInt32( 0 ); // length of menu/descr/help/status text
mxName->WriteFlagField( rStrm ); // BIFF8 flag field (no-op in <=BIFF7)
mxName->WriteBuffer( rStrm ); // character array of the name
- if( mxTokArr.is() )
+ if( mxTokArr )
mxTokArr->WriteArray( rStrm ); // token array without size
}
@@ -382,7 +383,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertName( sal_uInt16 nScNameIdx )
{
sal_uInt16 nNameIdx = FindNameIdx( maNameMap, nScNameIdx );
if( nNameIdx == 0 )
- if( const ScRangeData* pRangeData = GetNamedRanges().FindIndex( nScNameIdx ) )
+ if( const ScRangeData* pRangeData = GetNamedRanges().findByIndex( nScNameIdx ) )
nNameIdx = CreateName( *pRangeData );
return nNameIdx;
}
@@ -505,7 +506,7 @@ sal_uInt16 XclExpNameManagerImpl::FindBuiltInNameIdx(
if( xName->GetBuiltInName() == cBuiltIn )
{
XclTokenArrayRef xTokArr = xName->GetTokenArray();
- if( xTokArr.is() && (*xTokArr == rTokArr) )
+ if( xTokArr && (*xTokArr == rTokArr) )
return static_cast< sal_uInt16 >( nPos + 1 );
}
}
@@ -563,7 +564,7 @@ sal_uInt16 XclExpNameManagerImpl::CreateName( const ScRangeData& rRangeData )
xName->SetTokenArray( xTokArr );
String sSymbol;
- rRangeData.GetSymbol( sSymbol, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );
+ rRangeData.GetSymbol( sSymbol, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1 );
xName->SetSymbol( sSymbol );
/* Try to replace by existing built-in name - complete token array is
@@ -613,7 +614,7 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
ScDocument& rDoc = GetDoc();
XclExpTabInfo& rTabInfo = GetTabInfo();
- /* #i2394# #100489# built-in defined names must be sorted by the name of the
+ /* #i2394# built-in defined names must be sorted by the name of the
containing sheet. Example: SheetA!Print_Range must be stored *before*
SheetB!Print_Range, regardless of the position of SheetA in the document! */
for( SCTAB nScTabIdx = 0, nScTabCount = rTabInfo.GetScTabCount(); nScTabIdx < nScTabCount; ++nScTabIdx )
@@ -639,7 +640,7 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
}
// create the NAME record (do not warn if ranges are shrunken)
GetAddressConverter().ValidateRangeList( aRangeList, false );
- if( aRangeList.Count() > 0 )
+ if( !aRangeList.empty() )
GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList );
}
@@ -658,7 +659,7 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
GetXclMaxPos().Col(), pRowRange->aEnd.Row(), nScTab ) );
// create the NAME record
GetAddressConverter().ValidateRangeList( aTitleList, false );
- if( aTitleList.Count() > 0 )
+ if( !aTitleList.empty() )
GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTTITLES, aTitleList );
// *** 3) filter ranges *** ---------------------------------------
@@ -672,13 +673,12 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
void XclExpNameManagerImpl::CreateUserNames()
{
const ScRangeName& rNamedRanges = GetNamedRanges();
- for( sal_uInt16 nNameIdx = 0, nNameCount = rNamedRanges.GetCount(); nNameIdx < nNameCount; ++nNameIdx )
+ ScRangeName::const_iterator itr = rNamedRanges.begin(), itrEnd = rNamedRanges.end();
+ for (; itr != itrEnd; ++itr)
{
- const ScRangeData* pRangeData = rNamedRanges[ nNameIdx ];
- DBG_ASSERT( rNamedRanges[ nNameIdx ], "XclExpNameManagerImpl::CreateUserNames - missing defined name" );
// skip definitions of shared formulas
- if( pRangeData && !pRangeData->HasType( RT_SHARED ) && !FindNameIdx( maNameMap, pRangeData->GetIndex() ) )
- CreateName( *pRangeData );
+ if (!itr->HasType(RT_SHARED) && !FindNameIdx(maNameMap, itr->GetIndex()))
+ CreateName(*itr);
}
}
@@ -722,11 +722,6 @@ sal_uInt16 XclExpNameManager::InsertDBRange( sal_uInt16 nScDBRangeIdx )
return mxImpl->InsertDBRange( nScDBRangeIdx );
}
-//UNUSED2009-05 sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab )
-//UNUSED2009-05 {
-//UNUSED2009-05 return mxImpl->InsertBuiltInName( cBuiltIn, xTokArr, nScTab );
-//UNUSED2009-05 }
-
sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScRange& rRange )
{
XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_NAME, rRange );
@@ -736,10 +731,10 @@ sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScR
sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScRangeList& rRangeList )
{
sal_uInt16 nNameIdx = 0;
- if( rRangeList.Count() )
+ if( !rRangeList.empty() )
{
XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_NAME, rRangeList );
- nNameIdx = mxImpl->InsertBuiltInName( cBuiltIn, xTokArr, rRangeList.GetObject( 0 )->aStart.Tab() );
+ nNameIdx = mxImpl->InsertBuiltInName( cBuiltIn, xTokArr, rRangeList.front()->aStart.Tab() );
}
return nNameIdx;
}
@@ -790,3 +785,4 @@ void XclExpNameManager::SaveXml( XclExpXmlStream& rStrm )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 65be5b535d98..47396d620e41 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,25 +97,37 @@ XclExpSetup::XclExpSetup( const XclPageData& rPageData ) :
void XclExpSetup::SaveXml( XclExpXmlStream& rStrm )
{
- rStrm.GetCurrentStream()->singleElement( XML_pageSetup,
- XML_paperSize, OString::valueOf( (sal_Int32) mrData.mnPaperSize ).getStr(),
- XML_scale, OString::valueOf( (sal_Int32) mrData.mnScaling ).getStr(),
- XML_firstPageNumber, OString::valueOf( (sal_Int32) mrData.mnStartPage ).getStr(),
- XML_fitToWidth, OString::valueOf( (sal_Int32) mrData.mnFitToWidth ).getStr(),
- XML_fitToHeight, OString::valueOf( (sal_Int32) mrData.mnFitToHeight ).getStr(),
- XML_pageOrder, mrData.mbPrintInRows ? "overThenDown" : "downThenOver",
- XML_orientation, mrData.mbPortrait ? "portrait" : "landscape", // OOXTODO: "default"?
- XML_usePrinterDefaults, XclXmlUtils::ToPsz( !mrData.mbValid ),
- XML_blackAndWhite, XclXmlUtils::ToPsz( mrData.mbBlackWhite ),
- XML_draft, XclXmlUtils::ToPsz( mrData.mbDraftQuality ),
- XML_cellComments, mrData.mbPrintNotes ? "atEnd" : "none", // OOXTODO: "asDisplayed"?
- XML_useFirstPageNumber, XclXmlUtils::ToPsz( mrData.mbManualStart ),
- // OOXTODO: XML_errors, // == displayed|blank|dash|NA
- XML_horizontalDpi, OString::valueOf( (sal_Int32) mrData.mnHorPrintRes ).getStr(),
- XML_verticalDpi, OString::valueOf( (sal_Int32) mrData.mnVerPrintRes ).getStr(),
- XML_copies, OString::valueOf( (sal_Int32) mrData.mnCopies ).getStr(),
- // OOXTODO: devMode settings part RelationshipId: FSNS( XML_r, XML_id ),
- FSEND );
+ sax_fastparser::FastAttributeList* pAttrList=rStrm.GetCurrentStream()->createAttrList();
+ if( rStrm.getVersion() != oox::core::ISOIEC_29500_2008 ||
+ mrData.mnStrictPaperSize != EXC_PAPERSIZE_USER )
+ {
+ pAttrList->add( XML_paperSize, OString::valueOf( (sal_Int32) mrData.mnPaperSize ).getStr() );
+ }
+ else
+ {
+ pAttrList->add( XML_paperWidth, OString::valueOf( (sal_Int32) mrData.mnPaperWidth ).concat(OString("mm")).getStr() );
+ pAttrList->add( XML_paperHeight, OString::valueOf( (sal_Int32) mrData.mnPaperHeight ).concat(OString("mm")).getStr() );
+ // pAttrList->add( XML_paperUnits, "mm" );
+ }
+ pAttrList->add( XML_scale, OString::valueOf( (sal_Int32) mrData.mnScaling ).getStr() );
+ pAttrList->add( XML_firstPageNumber, OString::valueOf( (sal_Int32) mrData.mnStartPage ).getStr() );
+ pAttrList->add( XML_fitToWidth, OString::valueOf( (sal_Int32) mrData.mnFitToWidth ).getStr() );
+ pAttrList->add( XML_fitToHeight, OString::valueOf( (sal_Int32) mrData.mnFitToHeight ).getStr() );
+ pAttrList->add( XML_pageOrder, mrData.mbPrintInRows ? "overThenDown" : "downThenOver" );
+ pAttrList->add( XML_orientation, mrData.mbPortrait ? "portrait" : "landscape" ); // OOXTODO: "default"?
+ pAttrList->add( XML_usePrinterDefaults, XclXmlUtils::ToPsz( !mrData.mbValid ) );
+ pAttrList->add( XML_blackAndWhite, XclXmlUtils::ToPsz( mrData.mbBlackWhite ) );
+ pAttrList->add( XML_draft, XclXmlUtils::ToPsz( mrData.mbDraftQuality ) );
+ pAttrList->add( XML_cellComments, mrData.mbPrintNotes ? "atEnd" : "none" ); // OOXTODO: "asDisplayed"?
+ pAttrList->add( XML_useFirstPageNumber, XclXmlUtils::ToPsz( mrData.mbManualStart ) );
+ // OOXTODO: XML_errors, // == displayed|blank|dash|NA
+ pAttrList->add( XML_horizontalDpi, OString::valueOf( (sal_Int32) mrData.mnHorPrintRes ).getStr() );
+ pAttrList->add( XML_verticalDpi, OString::valueOf( (sal_Int32) mrData.mnVerPrintRes ).getStr() );
+ pAttrList->add( XML_copies, OString::valueOf( (sal_Int32) mrData.mnCopies ).getStr() );
+ // OOXTODO: devMode settings part RelationshipId: FSNS( XML_r, XML_id ),
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList > aAttrs(pAttrList);
+ rStrm.GetCurrentStream()->singleElement( XML_pageSetup, aAttrs );
}
void XclExpSetup::WriteBody( XclExpStream& rStrm )
@@ -412,3 +425,4 @@ void XclExpChartPageSettings::Save( XclExpStream& rStrm )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index b5eb50f7941b..069c9a7719e6 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,7 +77,7 @@ using ::rtl::OUStringBuffer;
namespace {
-// constants to track occurence of specific data types
+// constants to track occurrence of specific data types
const sal_uInt16 EXC_PCITEM_DATA_STRING = 0x0001; /// String, empty, boolean, error.
const sal_uInt16 EXC_PCITEM_DATA_DOUBLE = 0x0002; /// Double with fraction.
const sal_uInt16 EXC_PCITEM_DATA_INTEGER = 0x0004; /// Integer, double without fraction.
@@ -538,21 +539,19 @@ void XclExpPCField::InsertNumDateGroupItems( const ScDPObject& rDPObj, const ScD
{
// get the string collection with original source elements
ScSheetDPData aDPData( GetDocPtr(), *pSrcDesc );
- // Wang Xu Ming - DataPilot migration
- // 2009-05-08
const std::vector< SCROW > aOrignial = aDPData.GetColumnEntries( static_cast< long >( GetBaseFieldIndex() ) );
// get the string collection with generated grouping elements
ScDPNumGroupDimension aTmpDim( rNumInfo );
if( nDatePart != 0 )
aTmpDim.MakeDateHelper( rNumInfo, nDatePart );
- const std::vector< SCROW > aMemberIds = aTmpDim.GetNumEntries( static_cast< SCCOL >( GetBaseFieldIndex() ), aDPData.GetCacheTable().GetCache(), aOrignial );
+ const std::vector<SCROW>& aMemberIds = aTmpDim.GetNumEntries(
+ static_cast<SCCOL>( GetBaseFieldIndex() ), aDPData.GetCacheTable().getCache(), aOrignial);
for ( size_t nIdx = 0 ; nIdx < aMemberIds.size(); nIdx++ )
{
const ScDPItemData* pData = aDPData.GetMemberById( static_cast< long >( GetBaseFieldIndex() ) , aMemberIds[ nIdx] );
if ( pData )
InsertGroupItem( new XclExpPCItem( pData->GetString() ) );
}
-// End Comments
}
}
@@ -642,7 +641,8 @@ XclExpPivotCache::XclExpPivotCache( const XclExpRoot& rRoot, const ScDPObject& r
maDocSrcRange: Range used to get source data from Calc document.
This range may be shorter than maExpSrcRange to improve export
performance (#i22541#). */
- maOrigSrcRange = maExpSrcRange = maDocSrcRange = pSrcDesc->aSourceRange;
+ maOrigSrcRange = maExpSrcRange = maDocSrcRange = pSrcDesc->GetSourceRange();
+ maSrcRangeName = pSrcDesc->GetRangeName();
// internal sheet data only
SCTAB nScTab = maExpSrcRange.aStart.Tab();
@@ -665,7 +665,7 @@ XclExpPivotCache::XclExpPivotCache( const XclExpRoot& rRoot, const ScDPObject& r
if( 2 * (nDocRow2 - nDocRow1) < (nSrcRow2 - nSrcRow1) )
::set_flag( maPCInfo.mnFlags, EXC_SXDB_SAVEDATA, false );
- // #160184# Excel must refresh tables to make drilldown working
+ // Excel must refresh tables to make drilldown working
::set_flag( maPCInfo.mnFlags, EXC_SXDB_REFRESH_LOAD );
// adjust row indexes, keep one row of empty area to surely have the empty cache item
@@ -707,11 +707,6 @@ const XclExpPCField* XclExpPivotCache::GetField( sal_uInt16 nFieldIdx ) const
return maFieldList.GetRecord( nFieldIdx ).get();
}
-//UNUSED2009-05 const XclExpPCField* XclExpPivotCache::GetField( const String& rFieldName ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 return const_cast< XclExpPivotCache* >( this )->GetFieldAcc( rFieldName );
-//UNUSED2009-05 }
-
bool XclExpPivotCache::HasAddFields() const
{
// pivot cache can be shared, if there are no additional cache fields
@@ -724,7 +719,7 @@ bool XclExpPivotCache::HasEqualDataSource( const ScDPObject& rDPObj ) const
compare the ScSheetSourceDesc. Later, there should be done more complicated
comparisons regarding the source type of rDPObj and this cache. */
if( const ScSheetSourceDesc* pSrcDesc = rDPObj.GetSheetDesc() )
- return pSrcDesc->aSourceRange == maOrigSrcRange;
+ return pSrcDesc->GetSourceRange() == maOrigSrcRange;
return false;
}
@@ -735,15 +730,27 @@ void XclExpPivotCache::Save( XclExpStream& rStrm )
XclExpUInt16Record( EXC_ID_SXIDSTM, maPCInfo.mnStrmId ).Save( rStrm );
// SXVS
XclExpUInt16Record( EXC_ID_SXVS, EXC_SXVS_SHEET ).Save( rStrm );
- // DCONREF
- WriteDconref( rStrm );
+
+ if (maSrcRangeName.getLength())
+ // DCONNAME
+ WriteDConName(rStrm);
+ else
+ // DCONREF
+ WriteDconref(rStrm);
+
// create the pivot cache storage stream
WriteCacheStream();
}
-void XclExpPivotCache::SaveXml( XclExpXmlStream& rStrm )
+void XclExpPivotCache::SaveXml( XclExpXmlStream&
+#ifdef XLSX_PIVOT_CACHE
+ rStrm
+#endif
+)
{
DBG_ASSERT( mbValid, "XclExpPivotCache::Save - invalid pivot cache" );
+#ifdef XLSX_PIVOT_CACHE /* <pivotCache> without xl/pivotCaches/ cacheStream
+ results in a broken .xlsx */
sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
OUString sId = OUStringBuffer()
.appendAscii("rId")
@@ -762,6 +769,7 @@ void XclExpPivotCache::SaveXml( XclExpXmlStream& rStrm )
// create the pivot cache storage stream
// OOXTODO: WriteCacheStream();
rWorkbook->endElement( XML_pivotCache );
+#endif /* XLSX_PIVOT_CACHE */
}
// private --------------------------------------------------------------------
@@ -855,6 +863,14 @@ void XclExpPivotCache::WriteDconref( XclExpStream& rStrm ) const
rStrm.EndRecord();
}
+void XclExpPivotCache::WriteDConName( XclExpStream& rStrm ) const
+{
+ XclExpString aName(maSrcRangeName);
+ rStrm.StartRecord(EXC_ID_DCONNAME, aName.GetSize() + 2);
+ rStrm << aName << sal_uInt16(0);
+ rStrm.EndRecord();
+}
+
void XclExpPivotCache::WriteCacheStream()
{
SotStorageRef xSvStrg = OpenStorage( EXC_STORAGE_PTCACHE );
@@ -1025,11 +1041,6 @@ sal_uInt16 XclExpPTField::GetLastDataInfoIndex() const
return static_cast< sal_uInt16 >( maDataInfoVec.size() - 1 );
}
-//UNUSED2009-05 const XclExpPTItem* XclExpPTField::GetItem( const String& rName ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 return const_cast< XclExpPTField* >( this )->GetItemAcc( rName );
-//UNUSED2009-05 }
-
sal_uInt16 XclExpPTField::GetItemIndex( const String& rName, sal_uInt16 nDefaultIdx ) const
{
for( size_t nPos = 0, nSize = maItemList.GetSize(); nPos < nSize; ++nPos )
@@ -1133,7 +1144,7 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim )
// item properties
const ScDPSaveDimension::MemberList &rMembers = rSaveDim.GetMembers();
- for (ScDPSaveDimension::MemberList::const_iterator i=rMembers.begin(); i != rMembers.end() ; i++)
+ for (ScDPSaveDimension::MemberList::const_iterator i=rMembers.begin(); i != rMembers.end() ; ++i)
if( XclExpPTItem* pItem = GetItemAcc( (*i)->GetName() ) )
pItem->SetPropertiesFromMember( **i );
}
@@ -1280,21 +1291,19 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r
for( sal_uInt16 nFieldIdx = 0, nFieldCount = mrPCache.GetFieldCount(); nFieldIdx < nFieldCount; ++nFieldIdx )
maFieldList.AppendNewRecord( new XclExpPTField( *this, nFieldIdx ) );
- const List& rDimList = pSaveData->GetDimensions();
- sal_uLong nDimIdx, nDimCount = rDimList.Count();
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ const boost::ptr_vector<ScDPSaveDimension>& rDimList = pSaveData->GetDimensions();
/* 2) First process all data dimensions, they are needed for extended
settings of row/column/page fields (sorting/auto show). */
- for( nDimIdx = 0; nDimIdx < nDimCount; ++nDimIdx )
- if( const ScDPSaveDimension* pSaveDim = static_cast< const ScDPSaveDimension* >( rDimList.GetObject( nDimIdx ) ) )
- if( pSaveDim->GetOrientation() == DataPilotFieldOrientation_DATA )
- SetDataFieldPropertiesFromDim( *pSaveDim );
+ for (iter = rDimList.begin(); iter != rDimList.end(); ++iter)
+ if (iter->GetOrientation() == DataPilotFieldOrientation_DATA)
+ SetDataFieldPropertiesFromDim(*iter);
/* 3) Row/column/page/hidden fields. */
- for( nDimIdx = 0; nDimIdx < nDimCount; ++nDimIdx )
- if( const ScDPSaveDimension* pSaveDim = static_cast< const ScDPSaveDimension* >( rDimList.GetObject( nDimIdx ) ) )
- if( pSaveDim->GetOrientation() != DataPilotFieldOrientation_DATA )
- SetFieldPropertiesFromDim( *pSaveDim );
+ for (iter = rDimList.begin(); iter != rDimList.end(); ++iter)
+ if (iter->GetOrientation() != DataPilotFieldOrientation_DATA)
+ SetDataFieldPropertiesFromDim(*iter);
// Finalize -------------------------------------------------------
@@ -1355,6 +1364,146 @@ void XclExpPivotTable::Save( XclExpStream& rStrm )
}
}
+void XclExpPivotTable::SaveXml( XclExpXmlStream& rStrm )
+{
+ if( !mbValid )
+ return;
+ sax_fastparser::FSHelperPtr aPivotTableDefinition = rStrm.CreateOutputStream(
+ XclXmlUtils::GetStreamName( "xl/", "pivotTables/pivotTable", mnOutScTab+1),
+ XclXmlUtils::GetStreamName( "../", "pivotTables/pivotTable", mnOutScTab+1),
+ rStrm.GetCurrentStream()->getOutputStream(),
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable");
+ rStrm.PushStream( aPivotTableDefinition );
+
+ aPivotTableDefinition->startElement( XML_pivotTableDefinition,
+ XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ XML_name, XclXmlUtils::ToOString( maPTInfo.maTableName ).getStr(),
+ XML_cacheId, OString::valueOf( (sal_Int32) maPTInfo.mnCacheIdx ).getStr(),
+ XML_dataOnRows, XclXmlUtils::ToPsz( maPTInfo.mnDataAxis == EXC_SXVD_AXIS_COL ),
+ XML_dataPosition, OString::valueOf( (sal_Int32) maPTInfo.mnDataPos ).getStr(),
+ XML_autoFormatId, OString::valueOf( (sal_Int32) maPTInfo.mnAutoFmtIdx ).getStr(),
+ // OOXTODO: XML_applyNumberFormats, [ SXVIEW fAtrNum (maPTInfo.mnFlags) ]
+ // OOXTODO: XML_applyBorderFormats, [ SXVIEW fAtrBdr (maPTInfo.mnFlags) ]
+ // OOXTODO: XML_applyFontFormats, [ SXVIEW fAtrFnt (maPTInfo.mnFlags) ]
+ // OOXTODO: XML_applyPatternFormats, [ SXVIEW fAtrPat (maPTInfo.mnFlags) ]
+ // OOXTODO: XML_applyAlignmentFormats, [ SXVIEW fAtrAlc (maPTInfo.mnFlags) ]
+ // OOXTODO: XML_applyWidthHeightFormats, [ SXVIEW fAtrProc (maPTInfo.mnFlags) ]
+ XML_dataCaption, XclXmlUtils::ToOString( maPTInfo.maDataName ).getStr(),
+ // OOXTODO: XML_grandTotalCaption, [ SxViewEx9 chGrand ]
+ // OOXTODO: XML_errorCaption, [ SXEx stError ]
+ // OOXTODO: XML_showError, [ SXEx fDisplayErrorString ]
+ // OOXTODO: XML_missingCaption, [ SXEx stDisplayNull ]
+ // OOXTODO: XML_showMissing, [ SXEx fDisplayNullString ]
+ // OOXTODO: XML_pageStyle, [ SXEx stPageFieldStyle ]
+ // OOXTODO: XML_pivotTableStyle, [ SXEx stTableStyle ]
+ // OOXTODO: XML_vacatedStyle, [ SXEx stVacateStyle ]
+ // OOXTODO: XML_tag, [ SXEx stTag ]
+ // OOXTODO: XML_updatedVersion, [ app-dependent ]
+ // OOXTODO: XML_minRefreshableVersion, [ app-dependent ]
+ // OOXTODO: XML_asteriskTotals, [ QsiSXTag/SXView9Save fHideTotAnnotation ]
+ // OOXTODO: XML_showItems, [ ??? ]
+ // OOXTODO: XML_editData, [ ??? ]
+ // OOXTODO: XML_disableFieldList, [ SXEx fEnableFieldDialog? ]
+ // OOXTODO: XML_showCalcMbrs, [ ??? ]
+ // OOXTODO: XML_visualTotals, [ ??? ]
+ // OOXTODO: XML_showMultipleLabel, [ SXEx fMergeLabels? ]
+ // OOXTODO: XML_showDataDropDown, [ SXEx fEnableDrillDown? ]
+ // OOXTODO: XML_showDrill, [ ??? ]
+ // OOXTODO: XML_printDrill, [ ??? ]
+ // OOXTODO: XML_showMemberPropertyTips,
+ // OOXTODO: XML_showDataTips,
+ // OOXTODO: XML_enableWizard,
+ XML_enableDrill, XclXmlUtils::ToPsz( maPTExtInfo.mnFlags & EXC_SXEX_DRILLDOWN ), // ???
+ // OOXTODO: XML_enableFieldProperties, [ SXEx fEnableFieldDialog (maPTExtInfo.mnFlags) ]
+ // OOXTODO: XML_preserveFormatting, [ SXEx fPreserveFormatting (maPTExtInfo.mnFlags) ]
+ // OOXTODO: XML_pageWrap, [ SXEx cWrapPage (maPTExtInfo.mnFlags) ]
+ // OOXTODO: XML_pageOverThenDown, [ SXEx fAcrossPageLay (maPTExtInfo.mnFlags) ]
+ // OOXTODO: XML_subtotalHiddenItems, [ SXEx fSubtotalHiddenPageItems (maPTExtInfo.mnFlags) ]
+ XML_rowGrandTotals, XclXmlUtils::ToPsz( maPTInfo.mnFlags & EXC_SXVIEW_ROWGRAND ),
+ XML_colGrandTotals, XclXmlUtils::ToPsz( maPTInfo.mnFlags & EXC_SXVIEW_COLGRAND ),
+ // OOXTODO: XML_fieldPrintTitles,
+ // OOXTODO: XML_itemPrintTitles,
+ // OOXTODO: XML_mergeItem,
+ // OOXTODO: XML_showDropZones,
+ // OOXTODO: XML_createdVersion,
+ // OOXTODO: XML_indent,
+ // OOXTODO: XML_showEmptyRow,
+ // OOXTODO: XML_showEmptyCol,
+ // OOXTODO: XML_showHeaders,
+ // OOXTODO: XML_compact,
+ // OOXTODO: XML_outline,
+ // OOXTODO: XML_outlineData,
+ // OOXTODO: XML_compactData,
+ // OOXTODO: XML_published,
+ // OOXTODO: XML_gridDropZones,
+ // OOXTODO: XML_immersive,
+ // OOXTODO: XML_multipleFieldFilters,
+ // OOXTODO: XML_chartFormat,
+ // OOXTODO: XML_rowHeaderCaption,
+ // OOXTODO: XML_colHeaderCaption,
+ // OOXTODO: XML_fieldListSortAscending,
+ // OOXTODO: XML_mdxSubqueries,
+ // OOXTODO: XML_customListSort,
+ FSEND );
+
+ aPivotTableDefinition->singleElement( XML_location,
+ XML_ref, XclXmlUtils::ToOString( maPTInfo.maOutXclRange ).getStr(),
+ XML_firstHeaderRow, OString::valueOf( (sal_Int32) maPTInfo.mnFirstHeadRow ).getStr(),
+ XML_firstDataRow, OString::valueOf( (sal_Int32) maPTInfo.maDataXclPos.mnRow ).getStr(),
+ XML_firstDataCol, OString::valueOf( (sal_Int32) maPTInfo.maDataXclPos.mnCol ).getStr(),
+ XML_rowPageCount, OString::valueOf( (sal_Int32) maPTInfo.mnDataRows ).getStr(), // OOXTODO?
+ XML_colPageCount, OString::valueOf( (sal_Int32) maPTInfo.mnDataCols ).getStr(), // OOXTODO?
+ FSEND );
+
+ // OOXTODO: XML_pivotFields
+
+ // maPTInfo.mnFields?
+ if( maPTInfo.mnRowFields )
+ {
+ aPivotTableDefinition->startElement( XML_rowFields,
+ XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnRowFields ).getStr(),
+ FSEND );
+ aPivotTableDefinition->endElement( XML_rowFields );
+ }
+
+ // OOXTODO: XML_rowItems
+
+ if( maPTInfo.mnColFields )
+ {
+ aPivotTableDefinition->startElement( XML_colFields,
+ XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnColFields ).getStr(),
+ FSEND );
+ aPivotTableDefinition->endElement( XML_colFields );
+ }
+
+ // OOXTODO: XML_colItems
+
+ if( maPTInfo.mnPageFields )
+ {
+ aPivotTableDefinition->startElement( XML_pageFields,
+ XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnPageFields ).getStr(),
+ FSEND );
+ aPivotTableDefinition->endElement( XML_pageFields );
+ }
+
+ if( maPTInfo.mnDataFields )
+ {
+ aPivotTableDefinition->startElement( XML_dataFields,
+ XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnDataFields ).getStr(),
+ FSEND );
+ aPivotTableDefinition->endElement( XML_dataFields );
+ }
+
+ // OOXTODO: XML_formats, XML_conditionalFormats, XML_chartFormats,
+ // XML_pivotHierarchies, XML_pivotTableStyleInfo, XML_filters,
+ // XML_rowHierarchiesUsage, XML_colHierarchiesUsage, XML_ext
+
+ aPivotTableDefinition->endElement( XML_pivotTableDefinition );
+
+ rStrm.PopStream();
+}
+
// private --------------------------------------------------------------------
XclExpPTField* XclExpPivotTable::GetFieldAcc( const String& rName )
@@ -1547,7 +1696,7 @@ void XclExpPivotTable::WriteSxpi( XclExpStream& rStrm ) const
for( ScfUInt16Vec::const_iterator aIt = maPageFields.begin(), aEnd = maPageFields.end(); aIt != aEnd; ++aIt )
{
XclExpPTFieldRef xField = maFieldList.GetRecord( *aIt );
- if( xField.is() )
+ if( xField )
xField->WriteSxpiEntry( rStrm );
}
rStrm.EndRecord();
@@ -1559,7 +1708,7 @@ void XclExpPivotTable::WriteSxdiList( XclExpStream& rStrm ) const
for( XclPTDataFieldPosVec::const_iterator aIt = maDataFields.begin(), aEnd = maDataFields.end(); aIt != aEnd; ++aIt )
{
XclExpPTFieldRef xField = maFieldList.GetRecord( aIt->first );
- if( xField.is() )
+ if( xField )
xField->WriteSxdi( rStrm, aIt->second );
}
}
@@ -1571,13 +1720,13 @@ void XclExpPivotTable::WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sa
sal_uInt16 nLineSize = 8 + 2 * nIndexCount;
rStrm.StartRecord( EXC_ID_SXLI, nLineSize * nLineCount );
- /* #158444# Excel expects the records to be filled completely, do not
+ /* Excel expects the records to be filled completely, do not
set a segment size... */
// rStrm.SetSliceSize( nLineSize );
for( sal_uInt16 nLine = 0; nLine < nLineCount; ++nLine )
{
- // #106598# Excel XP needs a partly initialized SXLI record
+ // Excel XP needs a partly initialized SXLI record
rStrm << sal_uInt16( 0 ) // number of equal index entries
<< EXC_SXVI_TYPE_DATA
<< nIndexCount
@@ -1714,7 +1863,7 @@ XclExpPivotTableManager::XclExpPivotTableManager( const XclExpRoot& rRoot ) :
void XclExpPivotTableManager::CreatePivotTables()
{
if( ScDPCollection* pDPColl = GetDoc().GetDPCollection() )
- for( sal_uInt16 nDPObj = 0, nCount = pDPColl->GetCount(); nDPObj < nCount; ++nDPObj )
+ for( size_t nDPObj = 0, nCount = pDPColl->GetCount(); nDPObj < nCount; ++nDPObj )
if( ScDPObject* pDPObj = (*pDPColl)[ nDPObj ] )
if( const XclExpPivotCache* pPCache = CreatePivotCache( *pDPObj ) )
maPTableList.AppendNewRecord( new XclExpPivotTable( GetRoot(), *pDPObj, *pPCache ) );
@@ -1735,14 +1884,21 @@ void XclExpPivotTableManager::WritePivotCaches( XclExpStream& rStrm )
maPCacheList.Save( rStrm );
}
-void XclExpPivotTableManager::WritePivotCachesXml( XclExpXmlStream& rStrm )
+void XclExpPivotTableManager::WritePivotCachesXml( XclExpXmlStream&
+#ifdef XLSX_PIVOT_CACHE
+ rStrm
+#endif
+)
{
+#ifdef XLSX_PIVOT_CACHE /* <pivotCache> without xl/pivotCaches/ cacheStream
+ results in a broken .xlsx */
if( maPCacheList.IsEmpty() )
return;
sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
rWorkbook->startElement( XML_pivotCaches, FSEND );
maPCacheList.SaveXml( rStrm );
rWorkbook->endElement( XML_pivotCaches );
+#endif /* XLSX_PIVOT_CACHE */
}
void XclExpPivotTableManager::WritePivotTables( XclExpStream& rStrm, SCTAB nScTab )
@@ -1808,3 +1964,4 @@ const XclExpPivotCache* XclExpPivotTableManager::CreatePivotCache( const ScDPObj
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx
index b596234fe2e4..f210efd1a4a1 100644
--- a/sc/source/filter/excel/xerecord.cxx
+++ b/sc/source/filter/excel/xerecord.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -300,3 +301,4 @@ void XclExpSubStream::Save( XclExpStream& rStrm )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index 4632a10a088e..d72f9c77d61d 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,91 +81,91 @@ XclExpRoot::XclExpRoot( XclExpRootData& rExpRootData ) :
XclExpTabInfo& XclExpRoot::GetTabInfo() const
{
- DBG_ASSERT( mrExpData.mxTabInfo.is(), "XclExpRoot::GetTabInfo - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxTabInfo, "XclExpRoot::GetTabInfo - missing object (wrong BIFF?)" );
return *mrExpData.mxTabInfo;
}
XclExpAddressConverter& XclExpRoot::GetAddressConverter() const
{
- DBG_ASSERT( mrExpData.mxAddrConv.is(), "XclExpRoot::GetAddressConverter - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxAddrConv, "XclExpRoot::GetAddressConverter - missing object (wrong BIFF?)" );
return *mrExpData.mxAddrConv;
}
XclExpFormulaCompiler& XclExpRoot::GetFormulaCompiler() const
{
- DBG_ASSERT( mrExpData.mxFmlaComp.is(), "XclExpRoot::GetFormulaCompiler - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxFmlaComp, "XclExpRoot::GetFormulaCompiler - missing object (wrong BIFF?)" );
return *mrExpData.mxFmlaComp;
}
XclExpProgressBar& XclExpRoot::GetProgressBar() const
{
- DBG_ASSERT( mrExpData.mxProgress.is(), "XclExpRoot::GetProgressBar - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxProgress, "XclExpRoot::GetProgressBar - missing object (wrong BIFF?)" );
return *mrExpData.mxProgress;
}
XclExpSst& XclExpRoot::GetSst() const
{
- DBG_ASSERT( mrExpData.mxSst.is(), "XclExpRoot::GetSst - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxSst, "XclExpRoot::GetSst - missing object (wrong BIFF?)" );
return *mrExpData.mxSst;
}
XclExpPalette& XclExpRoot::GetPalette() const
{
- DBG_ASSERT( mrExpData.mxPalette.is(), "XclExpRoot::GetPalette - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxPalette, "XclExpRoot::GetPalette - missing object (wrong BIFF?)" );
return *mrExpData.mxPalette;
}
XclExpFontBuffer& XclExpRoot::GetFontBuffer() const
{
- DBG_ASSERT( mrExpData.mxFontBfr.is(), "XclExpRoot::GetFontBuffer - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxFontBfr, "XclExpRoot::GetFontBuffer - missing object (wrong BIFF?)" );
return *mrExpData.mxFontBfr;
}
XclExpNumFmtBuffer& XclExpRoot::GetNumFmtBuffer() const
{
- DBG_ASSERT( mrExpData.mxNumFmtBfr.is(), "XclExpRoot::GetNumFmtBuffer - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxNumFmtBfr, "XclExpRoot::GetNumFmtBuffer - missing object (wrong BIFF?)" );
return *mrExpData.mxNumFmtBfr;
}
XclExpXFBuffer& XclExpRoot::GetXFBuffer() const
{
- DBG_ASSERT( mrExpData.mxXFBfr.is(), "XclExpRoot::GetXFBuffer - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxXFBfr, "XclExpRoot::GetXFBuffer - missing object (wrong BIFF?)" );
return *mrExpData.mxXFBfr;
}
XclExpLinkManager& XclExpRoot::GetGlobalLinkManager() const
{
- DBG_ASSERT( mrExpData.mxGlobLinkMgr.is(), "XclExpRoot::GetGlobalLinkManager - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxGlobLinkMgr, "XclExpRoot::GetGlobalLinkManager - missing object (wrong BIFF?)" );
return *mrExpData.mxGlobLinkMgr;
}
XclExpLinkManager& XclExpRoot::GetLocalLinkManager() const
{
- DBG_ASSERT( GetLocalLinkMgrRef().is(), "XclExpRoot::GetLocalLinkManager - missing object (wrong BIFF?)" );
+ DBG_ASSERT( GetLocalLinkMgrRef(), "XclExpRoot::GetLocalLinkManager - missing object (wrong BIFF?)" );
return *GetLocalLinkMgrRef();
}
XclExpNameManager& XclExpRoot::GetNameManager() const
{
- DBG_ASSERT( mrExpData.mxNameMgr.is(), "XclExpRoot::GetNameManager - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxNameMgr, "XclExpRoot::GetNameManager - missing object (wrong BIFF?)" );
return *mrExpData.mxNameMgr;
}
XclExpObjectManager& XclExpRoot::GetObjectManager() const
{
- DBG_ASSERT( mrExpData.mxObjMgr.is(), "XclExpRoot::GetObjectManager - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxObjMgr, "XclExpRoot::GetObjectManager - missing object (wrong BIFF?)" );
return *mrExpData.mxObjMgr;
}
XclExpFilterManager& XclExpRoot::GetFilterManager() const
{
- DBG_ASSERT( mrExpData.mxFilterMgr.is(), "XclExpRoot::GetFilterManager - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxFilterMgr, "XclExpRoot::GetFilterManager - missing object (wrong BIFF?)" );
return *mrExpData.mxFilterMgr;
}
XclExpPivotTableManager& XclExpRoot::GetPivotTableManager() const
{
- DBG_ASSERT( mrExpData.mxPTableMgr.is(), "XclExpRoot::GetPivotTableManager - missing object (wrong BIFF?)" );
+ DBG_ASSERT( mrExpData.mxPTableMgr, "XclExpRoot::GetPivotTableManager - missing object (wrong BIFF?)" );
return *mrExpData.mxPTableMgr;
}
@@ -235,7 +236,7 @@ XclExpRecordRef XclExpRoot::CreateRecord( sal_uInt16 nRecId ) const
case EXC_ID_EXTERNSHEET: xRec = GetLocalLinkMgrRef(); break;
case EXC_ID_NAME: xRec = mrExpData.mxNameMgr; break;
}
- DBG_ASSERT( xRec.is(), "XclExpRoot::CreateRecord - unknown record ID or missing object" );
+ DBG_ASSERT( xRec, "XclExpRoot::CreateRecord - unknown record ID or missing object" );
return xRec;
}
@@ -285,13 +286,13 @@ uno::Sequence< beans::NamedValue > XclExpRoot::GenerateEncryptionData( const ::r
uno::Sequence< beans::NamedValue > XclExpRoot::GetEncryptionData() const
{
uno::Sequence< beans::NamedValue > aEncryptionData;
- SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, false );
if ( pEncryptionDataItem )
pEncryptionDataItem->GetValue() >>= aEncryptionData;
else
{
// try to get the encryption data from the password
- SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false );
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
aEncryptionData = GenerateEncryptionData( pPasswordItem->GetValue() );
}
@@ -315,3 +316,4 @@ XclExpRootData::XclExpLinkMgrRef XclExpRoot::GetLocalLinkMgrRef() const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 0a4e76a47e86..d8fe4bed9234 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,14 +45,39 @@
#include "xlstring.hxx"
#include "xeroot.hxx"
#include "xestyle.hxx"
+#include "xcl97rec.hxx"
#include "rangelst.hxx"
#include "compiler.hxx"
-#include <oox/xls/excelvbaproject.hxx>
+#include <../../ui/inc/docsh.hxx>
+#include <../../ui/inc/viewdata.hxx>
+#include <excdoc.hxx>
+
+#include <oox/core/tokens.hxx>
#include <formula/grammar.hxx>
+#include <oox/export/drawingml.hxx>
+
+#include <sfx2/docfile.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/app.hxx>
#define DEBUG_XL_ENCRYPTION 0
+using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::embed::XStorage;
+using ::com::sun::star::io::XOutputStream;
+using ::com::sun::star::io::XStream;
+using ::com::sun::star::lang::XComponent;
+using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::lang::XServiceInfo;
+using ::com::sun::star::lang::XSingleServiceFactory;
+using ::com::sun::star::registry::InvalidRegistryException;
+using ::com::sun::star::registry::XRegistryKey;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::XInterface;
using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -296,28 +322,6 @@ sal_Size XclExpStream::CopyFromStream( SvStream& rInStrm, sal_Size nBytes )
return nRet;
}
-//UNUSED2008-05 void XclExpStream::WriteUnicodeBuffer( const sal_uInt16* pBuffer, sal_Size nChars, sal_uInt8 nFlags )
-//UNUSED2008-05 {
-//UNUSED2008-05 SetSliceSize( 0 );
-//UNUSED2008-05 if( pBuffer && (nChars > 0) )
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_uInt16 nCharLen = (nFlags & EXC_STRF_16BIT) ? 2 : 1;
-//UNUSED2008-05 for( sal_Size nIndex = 0; nIndex < nChars; ++nIndex )
-//UNUSED2008-05 {
-//UNUSED2008-05 if( mbInRec && (mnCurrSize + nCharLen > mnCurrMaxSize) )
-//UNUSED2008-05 {
-//UNUSED2008-05 StartContinue();
-//UNUSED2008-05 // repeat only 16bit flag
-//UNUSED2008-05 operator<<( static_cast< sal_uInt8 >( nFlags & EXC_STRF_16BIT ) );
-//UNUSED2008-05 }
-//UNUSED2008-05 if( nCharLen == 2 )
-//UNUSED2008-05 operator<<( pBuffer[ nIndex ] );
-//UNUSED2008-05 else
-//UNUSED2008-05 operator<<( static_cast< sal_uInt8 >( pBuffer[ nIndex ] ) );
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-
void XclExpStream::WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nFlags )
{
SetSliceSize( 0 );
@@ -339,13 +343,7 @@ void XclExpStream::WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nF
}
}
-//UNUSED2008-05 void XclExpStream::WriteByteStringBuffer( const ByteString& rString, sal_uInt16 nMaxLen )
-//UNUSED2008-05 {
-//UNUSED2008-05 SetSliceSize( 0 );
-//UNUSED2008-05 Write( rString.GetBuffer(), ::std::min< sal_Size >( rString.Len(), nMaxLen ) );
-//UNUSED2008-05 }
-
-// ER: #71367# Xcl has an obscure sense of whether starting a new record or not,
+// Xcl has an obscure sense of whether starting a new record or not,
// and crashes if it encounters the string header at the very end of a record.
// Thus we add 1 to give some room, seems like they do it that way but with another count (10?)
void XclExpStream::WriteByteString( const ByteString& rString, sal_uInt16 nMaxLen, bool b16BitCount )
@@ -380,7 +378,7 @@ void XclExpStream::SetEncrypter( XclExpEncrypterRef xEncrypter )
bool XclExpStream::HasValidEncrypter() const
{
- return mxEncrypter.is() && mxEncrypter->IsValid();
+ return mxEncrypter && mxEncrypter->IsValid();
}
void XclExpStream::EnableEncryption( bool bEnable )
@@ -679,7 +677,71 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBy
mnOldPos = nStrmPos;
}
-OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sStream, sal_Int32 nId )
+static const char* lcl_GetErrorString( sal_uInt16 nScErrCode )
+{
+ sal_uInt8 nXclErrCode = XclTools::GetXclErrorCode( nScErrCode );
+ switch( nXclErrCode )
+ {
+ case EXC_ERR_NULL: return "#NULL!";
+ case EXC_ERR_DIV0: return "#DIV/0!";
+ case EXC_ERR_VALUE: return "#VALUE!";
+ case EXC_ERR_REF: return "#REF!";
+ case EXC_ERR_NAME: return "#NAME?";
+ case EXC_ERR_NUM: return "#NUM!";
+ case EXC_ERR_NA:
+ default: return "#N/A";
+ }
+}
+
+void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& rCell, const char*& rsType, OUString& rsValue )
+{
+ switch( rCell.GetFormatType() )
+ {
+ case NUMBERFORMAT_NUMBER:
+ {
+ // either value or error code
+ sal_uInt16 nScErrCode = rCell.GetErrCode();
+ if( nScErrCode )
+ {
+ rsType = "e";
+ rsValue = ToOUString( lcl_GetErrorString( nScErrCode ) );
+ }
+ else
+ {
+ rsType = "n";
+ rsValue = OUString::valueOf( rCell.GetValue() );
+ }
+ }
+ break;
+
+ case NUMBERFORMAT_TEXT:
+ {
+ rsType = "str";
+ String aResult;
+ rCell.GetString( aResult );
+ rsValue = ToOUString( aResult );
+ }
+ break;
+
+ case NUMBERFORMAT_LOGICAL:
+ {
+ rsType = "b";
+ rsValue = ToOUString( rCell.GetValue() == 0.0 ? "0" : "1" );
+ }
+ break;
+
+ default:
+ {
+ rsType = "inlineStr";
+ String aResult;
+ rCell.GetString( aResult );
+ rsValue = ToOUString( aResult );
+ }
+ break;
+ }
+}
+
+rtl::OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sStream, sal_Int32 nId )
{
OUStringBuffer sBuf;
if( sStreamDir )
@@ -687,7 +749,10 @@ OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sStream
sBuf.appendAscii( sStream );
if( nId )
sBuf.append( nId );
- sBuf.appendAscii( ".xml" );
+ if( strstr(sStream, "vml") )
+ sBuf.appendAscii( ".vml" );
+ else
+ sBuf.appendAscii( ".xml" );
return sBuf.makeStringAndClear();
}
@@ -770,7 +835,12 @@ static ScRange lcl_ToRange( const XclRange& rRange )
return aRange;
}
-OString XclXmlUtils::ToOString( const XclRangeList& rRanges )
+rtl::OString XclXmlUtils::ToOString( const XclRange& rRange )
+{
+ return ToOString( lcl_ToRange( rRange ) );
+}
+
+rtl::OString XclXmlUtils::ToOString( const XclRangeList& rRanges )
{
ScRangeList aRanges;
for( XclRangeList::const_iterator i = rRanges.begin(), end = rRanges.end();
@@ -802,7 +872,7 @@ OUString XclXmlUtils::ToOUString( const String& s )
OUString XclXmlUtils::ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray )
{
ScCompiler aCompiler( &rDocument, rAddress, *pTokenArray);
- aCompiler.SetGrammar(FormulaGrammar::GRAM_NATIVE_XL_A1);
+ aCompiler.SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_A1);
String s;
aCompiler.CreateStringFromTokenArray( s );
return ToOUString( s );
@@ -819,89 +889,31 @@ const char* XclXmlUtils::ToPsz( bool b )
return b ? "true" : "false";
}
-// ============================================================================
-
-XclExpXmlStream::XclExpXmlStream( const Reference< XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot )
- : XmlFilterBase( rxContext )
- , mrRoot( rRoot )
-{
- Sequence< PropertyValue > aArgs( 1 );
- const OUString sStream( RTL_CONSTASCII_USTRINGPARAM( "StreamForOutput" ) );
- aArgs[0].Name = sStream;
- aArgs[0].Value <<= Reference< XStream > ( new OStreamWrapper( rStrm ) );
-
- XServiceInfo* pInfo = rRoot.GetDocModelObj();
- Reference< XComponent > aComponent( pInfo, UNO_QUERY );
- setSourceDocument( aComponent );
- filter( aArgs );
-
- PushStream( CreateOutputStream(
- OUString::createFromAscii( "xl/workbook.xml" ),
- OUString::createFromAscii( "xl/workbook.xml" ),
- Reference< XOutputStream >(),
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
- "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ) );
-}
-
-XclExpXmlStream::~XclExpXmlStream()
-{
-}
-
-sax_fastparser::FSHelperPtr& XclExpXmlStream::GetCurrentStream()
-{
- DBG_ASSERT( !maStreams.empty(), "XclExpXmlStream::GetCurrentStream - no current stream" );
- return maStreams.top();
-}
-
-void XclExpXmlStream::PushStream( sax_fastparser::FSHelperPtr aStream )
+sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int32 nValue )
{
- maStreams.push( aStream );
-}
+ pStream->startElement( nElement, FSEND );
+ pStream->write( nValue );
+ pStream->endElement( nElement );
-void XclExpXmlStream::PopStream()
-{
- DBG_ASSERT( !maStreams.empty(), "XclExpXmlStream::PopStream - stack is empty!" );
- maStreams.pop();
+ return pStream;
}
-OUString XclExpXmlStream::GetIdForPath( const OUString& sPath )
+sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int64 nValue )
{
- if( maOpenedStreamMap.find( sPath ) == maOpenedStreamMap.end() )
- return OUString();
- return maOpenedStreamMap[ sPath ].first;
-}
+ pStream->startElement( nElement, FSEND );
+ pStream->write( nValue );
+ pStream->endElement( nElement );
-sax_fastparser::FSHelperPtr XclExpXmlStream::GetStreamForPath( const OUString& sPath )
-{
- if( maOpenedStreamMap.find( sPath ) == maOpenedStreamMap.end() )
- return sax_fastparser::FSHelperPtr();
- return maOpenedStreamMap[ sPath ].second;
+ return pStream;
}
-sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributes( sal_Int32 nAttribute, ... )
+sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const char* sValue )
{
- sax_fastparser::FSHelperPtr& rStream = GetCurrentStream();
-
- va_list args;
- va_start( args, nAttribute );
- do {
- const char* pValue = va_arg( args, const char* );
- if( pValue )
- {
- rStream->write( " " )
- ->writeId( nAttribute )
- ->write( "=\"" )
- ->writeEscaped( pValue )
- ->write( "\"" );
- }
+ pStream->startElement( nElement, FSEND );
+ pStream->write( sValue );
+ pStream->endElement( nElement );
- nAttribute = va_arg( args, sal_Int32 );
- if( nAttribute == FSEND )
- break;
- } while( true );
- va_end( args );
-
- return rStream;
+ return pStream;
}
static void lcl_WriteValue( sax_fastparser::FSHelperPtr& rStream, sal_Int32 nElement, const char* pValue )
@@ -939,39 +951,99 @@ static const char* lcl_ToVerticalAlignmentRun( SvxEscapement eEscapement, bool&
}
}
-sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteFontData( const XclFontData& rFontData, sal_Int32 nFontId )
+sax_fastparser::FSHelperPtr XclXmlUtils::WriteFontData( sax_fastparser::FSHelperPtr pStream, const XclFontData& rFontData, sal_Int32 nFontId )
{
bool bHaveUnderline, bHaveVertAlign;
const char* pUnderline = lcl_GetUnderlineStyle( rFontData.GetScUnderline(), bHaveUnderline );
const char* pVertAlign = lcl_ToVerticalAlignmentRun( rFontData.GetScEscapement(), bHaveVertAlign );
- sax_fastparser::FSHelperPtr& rStream = GetCurrentStream();
-
- lcl_WriteValue( rStream, nFontId, XclXmlUtils::ToOString( rFontData.maName ).getStr() );
- lcl_WriteValue( rStream, XML_charset, rFontData.mnCharSet != 0 ? OString::valueOf( (sal_Int32) rFontData.mnCharSet ).getStr() : NULL );
- lcl_WriteValue( rStream, XML_family, OString::valueOf( (sal_Int32) rFontData.mnFamily ).getStr() );
- lcl_WriteValue( rStream, XML_b, rFontData.mnWeight > 400 ? XclXmlUtils::ToPsz( rFontData.mnWeight > 400 ) : NULL );
- lcl_WriteValue( rStream, XML_i, rFontData.mbItalic ? XclXmlUtils::ToPsz( rFontData.mbItalic ) : NULL );
- lcl_WriteValue( rStream, XML_strike, rFontData.mbStrikeout ? XclXmlUtils::ToPsz( rFontData.mbStrikeout ) : NULL );
- lcl_WriteValue( rStream, XML_outline, rFontData.mbOutline ? XclXmlUtils::ToPsz( rFontData.mbOutline ) : NULL );
- lcl_WriteValue( rStream, XML_shadow, rFontData.mbShadow ? XclXmlUtils::ToPsz( rFontData.mbShadow ) : NULL );
+ lcl_WriteValue( pStream, nFontId, XclXmlUtils::ToOString( rFontData.maName ).getStr() );
+ lcl_WriteValue( pStream, XML_charset, rFontData.mnCharSet != 0 ? OString::valueOf( (sal_Int32) rFontData.mnCharSet ).getStr() : NULL );
+ lcl_WriteValue( pStream, XML_family, OString::valueOf( (sal_Int32) rFontData.mnFamily ).getStr() );
+ lcl_WriteValue( pStream, XML_b, rFontData.mnWeight > 400 ? XclXmlUtils::ToPsz( rFontData.mnWeight > 400 ) : NULL );
+ lcl_WriteValue( pStream, XML_i, rFontData.mbItalic ? XclXmlUtils::ToPsz( rFontData.mbItalic ) : NULL );
+ lcl_WriteValue( pStream, XML_strike, rFontData.mbStrikeout ? XclXmlUtils::ToPsz( rFontData.mbStrikeout ) : NULL );
+ lcl_WriteValue( pStream, XML_outline, rFontData.mbOutline ? XclXmlUtils::ToPsz( rFontData.mbOutline ) : NULL );
+ lcl_WriteValue( pStream, XML_shadow, rFontData.mbShadow ? XclXmlUtils::ToPsz( rFontData.mbShadow ) : NULL );
// OOXTODO: lcl_WriteValue( rStream, XML_condense, ); // mac compatibility setting
// OOXTODO: lcl_WriteValue( rStream, XML_extend, ); // compatibility setting
if( rFontData.maColor != Color( 0xFF, 0xFF, 0xFF, 0xFF ) )
- rStream->singleElement( XML_color,
+ pStream->singleElement( XML_color,
// OOXTODO: XML_auto, bool
// OOXTODO: XML_indexed, uint
XML_rgb, XclXmlUtils::ToOString( rFontData.maColor ).getStr(),
// OOXTODO: XML_theme, index into <clrScheme/>
// OOXTODO: XML_tint, double
FSEND );
- lcl_WriteValue( rStream, XML_sz, OString::valueOf( (double) (rFontData.mnHeight / 20.0) ) ); // Twips->Pt
- lcl_WriteValue( rStream, XML_u, bHaveUnderline ? pUnderline : NULL );
- lcl_WriteValue( rStream, XML_vertAlign, bHaveVertAlign ? pVertAlign : NULL );
+ lcl_WriteValue( pStream, XML_sz, OString::valueOf( (double) (rFontData.mnHeight / 20.0) ) ); // Twips->Pt
+ lcl_WriteValue( pStream, XML_u, bHaveUnderline ? pUnderline : NULL );
+ lcl_WriteValue( pStream, XML_vertAlign, bHaveVertAlign ? pVertAlign : NULL );
- return rStream;
+ return pStream;
+}
+
+
+// ============================================================================
+
+XclExpXmlStream::XclExpXmlStream( const Reference< XMultiServiceFactory >& rSMgr )
+ : XmlFilterBase( rSMgr ),
+ mpRoot( NULL )
+{
+}
+
+XclExpXmlStream::~XclExpXmlStream()
+{
+}
+
+sax_fastparser::FSHelperPtr& XclExpXmlStream::GetCurrentStream()
+{
+ DBG_ASSERT( !maStreams.empty(), "XclExpXmlStream::GetCurrentStream - no current stream" );
+ return maStreams.top();
}
+void XclExpXmlStream::PushStream( sax_fastparser::FSHelperPtr aStream )
+{
+ maStreams.push( aStream );
+}
+
+void XclExpXmlStream::PopStream()
+{
+ DBG_ASSERT( !maStreams.empty(), "XclExpXmlStream::PopStream - stack is empty!" );
+ maStreams.pop();
+}
+
+sax_fastparser::FSHelperPtr XclExpXmlStream::GetStreamForPath( const OUString& sPath )
+{
+ if( maOpenedStreamMap.find( sPath ) == maOpenedStreamMap.end() )
+ return sax_fastparser::FSHelperPtr();
+ return maOpenedStreamMap[ sPath ].second;
+}
+
+sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributes( sal_Int32 nAttribute, ... )
+{
+ sax_fastparser::FSHelperPtr& rStream = GetCurrentStream();
+
+ va_list args;
+ va_start( args, nAttribute );
+ do {
+ const char* pValue = va_arg( args, const char* );
+ if( pValue )
+ {
+ rStream->write( " " )
+ ->writeId( nAttribute )
+ ->write( "=\"" )
+ ->writeEscaped( pValue )
+ ->write( "\"" );
+ }
+
+ nAttribute = va_arg( args, sal_Int32 );
+ if( nAttribute == FSEND )
+ break;
+ } while( true );
+ va_end( args );
+
+ return rStream;
+}
sax_fastparser::FSHelperPtr XclExpXmlStream::CreateOutputStream (
const OUString& sFullStream,
const OUString& sRelativeStream,
@@ -1022,9 +1094,65 @@ oox::drawingml::chart::ChartConverter& XclExpXmlStream::getChartConverter()
return * (oox::drawingml::chart::ChartConverter*) NULL;
}
+ScDocShell* XclExpXmlStream::getDocShell()
+{
+ Reference< XInterface > xModel( getModel(), UNO_QUERY );
+
+ ScModelObj *pObj = dynamic_cast < ScModelObj* >( xModel.get() );
+
+ if ( pObj )
+ return reinterpret_cast < ScDocShell* >( pObj->GetEmbeddedObject() );
+
+ return 0;
+}
+
bool XclExpXmlStream::exportDocument() throw()
{
- return false;
+ ScDocShell* pShell = getDocShell();
+ ScDocument* pDoc = pShell->GetDocument();
+ // NOTE: Don't use SotStorage or SvStream any more, and never call
+ // SfxMedium::GetOutStream() anywhere in the xlsx export filter code!
+ // Instead, write via XOutputStream instance.
+ SotStorageRef rStorage = static_cast<SotStorage*>(NULL);
+ XclExpObjList::ResetCounters();
+
+ XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, *pDoc, RTL_TEXTENCODING_DONTKNOW );
+ aData.meOutput = EXC_OUTPUT_XML_2007;
+ XclExpRoot aRoot( aData );
+
+ mpRoot = &aRoot;
+ aRoot.GetOldRoot().pER = &aRoot;
+ aRoot.GetOldRoot().eDateiTyp = Biff8;
+ // Get the viewsettings before processing
+ if( pShell->GetViewData() )
+ pShell->GetViewData()->WriteExtOptions( mpRoot->GetExtDocOptions() );
+
+ OUString const workbook = CREATE_OUSTRING( "xl/workbook.xml" );
+ PushStream( CreateOutputStream( workbook, workbook,
+ Reference <XOutputStream>(),
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ) );
+
+ // destruct at the end of the block
+ {
+ ExcDocument aDocRoot( aRoot );
+ aDocRoot.ReadDoc();
+ aDocRoot.WriteXml( *this );
+ }
+
+ mpRoot = NULL;
+ return true;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// UNO stuff so that the filter is registered
+//////////////////////////////////////////////////////////////////////////
+
+#define IMPL_NAME "com.sun.star.comp.oox.ExcelFilterExport"
+
+OUString XlsxExport_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME ) );
}
::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const
@@ -1037,11 +1165,83 @@ OUString XclExpXmlStream::implGetImplementationName() const
return CREATE_OUSTRING( "TODO" );
}
-void XclExpXmlStream::Trace( const char* format, ...)
+
+Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw()
+{
+ const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) );
+ const Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+Reference< XInterface > SAL_CALL XlsxExport_createInstance(const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception )
+{
+ return (cppu::OWeakObject*) new XclExpXmlStream( rSMgr );
+}
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
{
- va_list ap;
- va_start( ap, format );
- vfprintf( stderr, format, ap );
- va_end( ap );
+ sal_Bool bRet = false;
+
+ if( pRegistryKey )
+ {
+ try
+ {
+ Reference< XRegistryKey > xNewKey1(
+ static_cast< XRegistryKey* >( pRegistryKey )->createKey(
+ OUString(RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME "/UNO/SERVICES/" )) ) );
+ xNewKey1->createKey( XlsxExport_getSupportedServiceNames().getConstArray()[0] );
+
+ bRet = sal_True;
+ }
+ catch( InvalidRegistryException& )
+ {
+ OSL_ENSURE( false, "### InvalidRegistryException!" );
+ }
+ }
+
+ return bRet;
}
+// ------------------------
+// - component_getFactory -
+// ------------------------
+
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
+{
+ Reference< XSingleServiceFactory > xFactory;
+ void* pRet = 0;
+
+ if ( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
+ {
+ const OUString aServiceName(RTL_CONSTASCII_USTRINGPARAM(IMPL_NAME));
+
+ xFactory = Reference< XSingleServiceFactory >( ::cppu::createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory* >( pServiceManager ),
+ XlsxExport_getImplementationName(),
+ XlsxExport_createInstance,
+ XlsxExport_getSupportedServiceNames() ) );
+ }
+
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+
+ return pRet;
+}
+
+#ifdef __cplusplus
+}
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx
index 1c3270015981..987b25dba294 100644
--- a/sc/source/filter/excel/xestring.cxx
+++ b/sc/source/filter/excel/xestring.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,8 @@
#include <algorithm>
#include <stdio.h>
+#include "xlstyle.hxx"
+#include "xestyle.hxx"
#include "xestream.hxx"
#include "xlstyle.hxx"
#include "xestyle.hxx"
@@ -125,20 +128,6 @@ XclExpString::XclExpString( const OUString& rString, XclStrFlags nFlags, sal_uIn
Assign( rString, nFlags, nMaxLen );
}
-//UNUSED2008-05 XclExpString::XclExpString(
-//UNUSED2008-05 const String& rString, const XclFormatRunVec& rFormats,
-//UNUSED2008-05 XclStrFlags nFlags, sal_uInt16 nMaxLen )
-//UNUSED2008-05 {
-//UNUSED2008-05 Assign( rString, rFormats, nFlags, nMaxLen );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 XclExpString::XclExpString(
-//UNUSED2008-05 const OUString& rString, const XclFormatRunVec& rFormats,
-//UNUSED2008-05 XclStrFlags nFlags, sal_uInt16 nMaxLen )
-//UNUSED2008-05 {
-//UNUSED2008-05 Assign( rString, rFormats, nFlags, nMaxLen );
-//UNUSED2008-05 }
-
// assign ---------------------------------------------------------------------
void XclExpString::Assign( const String& rString, XclStrFlags nFlags, sal_uInt16 nMaxLen )
@@ -146,27 +135,11 @@ void XclExpString::Assign( const String& rString, XclStrFlags nFlags, sal_uInt16
Build( rString.GetBuffer(), rString.Len(), nFlags, nMaxLen );
}
-void XclExpString::Assign(
- const String& rString, const XclFormatRunVec& rFormats,
- XclStrFlags nFlags, sal_uInt16 nMaxLen )
-{
- Assign( rString, nFlags, nMaxLen );
- SetFormats( rFormats );
-}
-
void XclExpString::Assign( const OUString& rString, XclStrFlags nFlags, sal_uInt16 nMaxLen )
{
Build( rString.getStr(), rString.getLength(), nFlags, nMaxLen );
}
-void XclExpString::Assign(
- const OUString& rString, const XclFormatRunVec& rFormats,
- XclStrFlags nFlags, sal_uInt16 nMaxLen )
-{
- Assign( rString, nFlags, nMaxLen );
- SetFormats( rFormats );
-}
-
void XclExpString::Assign( sal_Unicode cChar, XclStrFlags nFlags, sal_uInt16 nMaxLen )
{
Build( &cChar, 1, nFlags, nMaxLen );
@@ -179,20 +152,6 @@ void XclExpString::AssignByte(
Build( aByteStr.GetBuffer(), aByteStr.Len(), nFlags, nMaxLen );
}
-//UNUSED2008-05 void XclExpString::AssignByte( sal_Unicode cChar, rtl_TextEncoding eTextEnc, XclStrFlags nFlags, sal_uInt16 nMaxLen )
-//UNUSED2008-05 {
-//UNUSED2008-05 if( !cChar )
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_Char cByteChar = 0;
-//UNUSED2008-05 Build( &cByteChar, 1, nFlags, nMaxLen );
-//UNUSED2008-05 }
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 ByteString aByteStr( &cChar, 1, eTextEnc ); // length may be >1
-//UNUSED2008-05 Build( aByteStr.GetBuffer(), aByteStr.Len(), nFlags, nMaxLen );
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-
// append ---------------------------------------------------------------------
void XclExpString::Append( const String& rString )
@@ -200,16 +159,6 @@ void XclExpString::Append( const String& rString )
BuildAppend( rString.GetBuffer(), rString.Len() );
}
-//UNUSED2008-05 void XclExpString::Append( const ::rtl::OUString& rString )
-//UNUSED2008-05 {
-//UNUSED2008-05 BuildAppend( rString.getStr(), rString.getLength() );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void XclExpString::Append( sal_Unicode cChar )
-//UNUSED2008-05 {
-//UNUSED2008-05 BuildAppend( &cChar, 1 );
-//UNUSED2008-05 }
-
void XclExpString::AppendByte( const String& rString, rtl_TextEncoding eTextEnc )
{
if( rString.Len() > 0 )
@@ -490,7 +439,7 @@ static sal_uInt16 lcl_WriteRun( XclExpXmlStream& rStrm, const ScfUInt16Vec& rBuf
{
const XclFontData& rFontData = pFont->GetFontData();
rWorksheet->startElement( XML_rPr, FSEND );
- rStrm.WriteFontData( rFontData, XML_rFont );
+ XclXmlUtils::WriteFontData( rWorksheet, rFontData, XML_rFont );
rWorksheet->endElement( XML_rPr );
}
rWorksheet->startElement( XML_t,
@@ -499,7 +448,7 @@ static sal_uInt16 lcl_WriteRun( XclExpXmlStream& rStrm, const ScfUInt16Vec& rBuf
rWorksheet->writeEscaped( XclXmlUtils::ToOUString( rBuffer, nStart, nLength ) );
rWorksheet->endElement( XML_t );
rWorksheet->endElement( XML_r );
- return static_cast<sal_uInt16>(nStart + nLength);
+ return nStart + nLength;
}
void XclExpString::WriteXml( XclExpXmlStream& rStrm ) const
@@ -654,3 +603,4 @@ void XclExpString::PrepareWrite( XclExpStream& rStrm, sal_uInt16 nBytes ) const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index c675cea19b96..79b4d1949507 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,6 +48,7 @@
#include <editeng/frmdiritem.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/escpitem.hxx>
+#include <editeng/justifyitem.hxx>
#include "document.hxx"
#include "stlpool.hxx"
#include "stlsheet.hxx"
@@ -55,7 +57,8 @@
#include "globstr.hrc"
#include "xestring.hxx"
-using namespace ::oox;
+#include <oox/core/tokens.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
using ::rtl::OString;
using ::rtl::OUString;
@@ -311,10 +314,10 @@ private:
const Color& rColor ) const;
private:
- typedef ScfDelList< XclListColor > XclListColorList;
- typedef ScfRef< XclListColorList > XclListColorListRef;
- typedef ::std::vector< XclColorIdData > XclColorIdDataVec;
- typedef ::std::vector< XclPaletteColor > XclPaletteColorVec;
+ typedef boost::ptr_vector< XclListColor > XclListColorList;
+ typedef boost::shared_ptr< XclListColorList > XclListColorListRef;
+ typedef ::std::vector< XclColorIdData > XclColorIdDataVec;
+ typedef ::std::vector< XclPaletteColor > XclPaletteColorVec;
const XclDefaultPalette& mrDefPal; /// The default palette for the current BIFF version.
XclListColorListRef mxColorList; /// Working color list.
@@ -365,28 +368,28 @@ void XclExpPaletteImpl::Finalize()
{
// --- build initial color ID data vector (maColorIdDataVec) ---
- sal_uInt32 nCount = mxColorList->Count();
+ sal_uInt32 nCount = mxColorList->size();
maColorIdDataVec.resize( nCount );
for( sal_uInt32 nIdx = 0; nIdx < nCount; ++nIdx )
{
- XclListColor* pListColor = mxColorList->GetObject( nIdx );
- maColorIdDataVec[ pListColor->GetColorId() ].Set( pListColor->GetColor(), nIdx );
+ const XclListColor& listColor = mxColorList->at( nIdx );
+ maColorIdDataVec[ listColor.GetColorId() ].Set( listColor.GetColor(), nIdx );
}
// --- loop as long as current color count does not fit into palette of current BIFF ---
// phase 1: raw reduction (performance reasons, #i36945#)
sal_uInt32 nPass = 0;
- while( mxColorList->Count() > EXC_PAL_MAXRAWSIZE )
+ while( mxColorList->size() > EXC_PAL_MAXRAWSIZE )
RawReducePalette( nPass++ );
// phase 2: precise reduction using advanced color merging based on color weighting
- while( mxColorList->Count() > mrDefPal.GetColorCount() )
+ while( mxColorList->size() > mrDefPal.GetColorCount() )
ReduceLeastUsedColor();
-// --- #104865# use default palette and replace colors with nearest used colors ---
+// --- use default palette and replace colors with nearest used colors ---
- nCount = mxColorList->Count();
+ nCount = mxColorList->size();
XclRemapVec aRemapVec( nCount );
XclNearestVec aNearestVec( nCount );
@@ -397,7 +400,7 @@ void XclExpPaletteImpl::Finalize()
// find nearest unused default color for each unprocessed list color
for( nIndex = 0; nIndex < nCount; ++nIndex )
aNearestVec[ nIndex ].mnDist = aRemapVec[ nIndex ].mbProcessed ? SAL_MAX_INT32 :
- GetNearestPaletteColor( aNearestVec[ nIndex ].mnPalIndex, mxColorList->GetObject( nIndex )->GetColor(), true );
+ GetNearestPaletteColor( aNearestVec[ nIndex ].mnPalIndex, mxColorList->at( nIndex ).GetColor(), true );
// find the list color which is nearest to a default color
sal_uInt32 nFound = 0;
for( nIndex = 1; nIndex < nCount; ++nIndex )
@@ -405,9 +408,8 @@ void XclExpPaletteImpl::Finalize()
nFound = nIndex;
// replace default color with list color
sal_uInt32 nNearest = aNearestVec[ nFound ].mnPalIndex;
- DBG_ASSERT( mxColorList->GetObject( nFound ), "XclExpPaletteImpl::Finalize - missing a color" );
DBG_ASSERT( nNearest < maPalette.size(), "XclExpPaletteImpl::Finalize - algorithm error" );
- maPalette[ nNearest ].SetColor( mxColorList->GetObject( nFound )->GetColor() );
+ maPalette[ nNearest ].SetColor( mxColorList->at( nFound ).GetColor() );
aRemapVec[ nFound ].SetIndex( nNearest );
}
@@ -526,20 +528,27 @@ const Color& XclExpPaletteImpl::GetOriginalColor( sal_uInt32 nColorId ) const
XclListColor* XclExpPaletteImpl::SearchListEntry( const Color& rColor, sal_uInt32& rnIndex )
{
rnIndex = mnLastIdx;
- XclListColor* pEntry = mxColorList->GetObject( rnIndex );
+ XclListColor* pEntry = NULL;
- // search optimization for equal-colored objects occuring repeatedly
- if( pEntry && (pEntry->GetColor() == rColor) )
- return pEntry;
+ if (mxColorList->empty())
+ return NULL;
+
+ // search optimization for equal-colored objects occurring repeatedly
+ if (rnIndex < mxColorList->size())
+ {
+ pEntry = &(*mxColorList)[rnIndex];
+ if( pEntry->GetColor() == rColor )
+ return pEntry;
+ }
// binary search for color
sal_uInt32 nBegIdx = 0;
- sal_uInt32 nEndIdx = mxColorList->Count();
+ sal_uInt32 nEndIdx = mxColorList->size();
bool bFound = false;
while( !bFound && (nBegIdx < nEndIdx) )
{
rnIndex = (nBegIdx + nEndIdx) / 2;
- pEntry = mxColorList->GetObject( rnIndex );
+ pEntry = &(*mxColorList)[rnIndex];
bFound = pEntry->GetColor() == rColor;
if( !bFound )
{
@@ -549,9 +558,10 @@ XclListColor* XclExpPaletteImpl::SearchListEntry( const Color& rColor, sal_uInt3
nEndIdx = rnIndex;
}
}
+
// not found - use end of range as new insertion position
if( !bFound )
- pEntry = mxColorList->GetObject( rnIndex = nEndIdx );
+ rnIndex = nEndIdx;
mnLastIdx = rnIndex;
return pEntry;
@@ -559,8 +569,10 @@ XclListColor* XclExpPaletteImpl::SearchListEntry( const Color& rColor, sal_uInt3
XclListColor* XclExpPaletteImpl::CreateListEntry( const Color& rColor, sal_uInt32 nIndex )
{
- XclListColor* pEntry = new XclListColor( rColor, mxColorList->Count() );
- mxColorList->Insert( pEntry, nIndex );
+ XclListColor* pEntry = new XclListColor( rColor, mxColorList->size() );
+ XclListColorList::iterator itr = mxColorList->begin();
+ ::std::advance(itr, nIndex);
+ mxColorList->insert(itr, pEntry);
return pEntry;
}
@@ -582,7 +594,7 @@ void XclExpPaletteImpl::RawReducePalette( sal_uInt32 nPass )
// maps old list indexes to new list indexes, used to update maColorIdDataVec
ScfUInt32Vec aListIndexMap;
- aListIndexMap.reserve( xOldList->Count() );
+ aListIndexMap.reserve( xOldList->size() );
// preparations
sal_uInt8 nR, nG, nB;
@@ -596,10 +608,10 @@ void XclExpPaletteImpl::RawReducePalette( sal_uInt32 nPass )
sal_uInt8 nFactor3 = static_cast< sal_uInt8 >( 0x40 >> nPass );
// process each color in the old color list
- for( sal_uInt32 nIdx = 0, nCount = xOldList->Count(); nIdx < nCount; ++nIdx )
+ for( sal_uInt32 nIdx = 0, nCount = xOldList->size(); nIdx < nCount; ++nIdx )
{
// get the old list entry
- const XclListColor* pOldEntry = xOldList->GetObject( nIdx );
+ const XclListColor* pOldEntry = &(xOldList->at( nIdx ));
nR = pOldEntry->GetColor().GetRed();
nG = pOldEntry->GetColor().GetGreen();
nB = pOldEntry->GetColor().GetBlue();
@@ -637,14 +649,16 @@ void XclExpPaletteImpl::ReduceLeastUsedColor()
sal_uInt32 nKeep = GetNearestListColor( nRemove );
// merge both colors to one color, remove one color from list
- XclListColor* pKeepEntry = mxColorList->GetObject( nKeep );
- XclListColor* pRemoveEntry = mxColorList->GetObject( nRemove );
+ XclListColor* pKeepEntry = &mxColorList->at(nKeep);
+ XclListColor* pRemoveEntry = &mxColorList->at(nRemove);
if( pKeepEntry && pRemoveEntry )
{
// merge both colors (if pKeepEntry is a base color, it will not change)
pKeepEntry->Merge( *pRemoveEntry );
// remove the less used color, adjust nKeep index if kept color follows removed color
- mxColorList->Delete( nRemove );
+ XclListColorList::iterator itr = mxColorList->begin();
+ ::std::advance(itr, nRemove);
+ mxColorList->erase(itr);
if( nKeep > nRemove ) --nKeep;
// recalculate color ID data map (maps color IDs to color list indexes)
@@ -663,14 +677,14 @@ sal_uInt32 XclExpPaletteImpl::GetLeastUsedListColor() const
sal_uInt32 nFound = 0;
sal_uInt32 nMinW = SAL_MAX_UINT32;
- for( sal_uInt32 nIdx = 0, nCount = mxColorList->Count(); nIdx < nCount; ++nIdx )
+ for( sal_uInt32 nIdx = 0, nCount = mxColorList->size(); nIdx < nCount; ++nIdx )
{
- XclListColor* pEntry = mxColorList->GetObject( nIdx );
+ XclListColor& pEntry = mxColorList->at( nIdx );
// ignore the base colors
- if( !pEntry->IsBaseColor() && (pEntry->GetWeighting() < nMinW) )
+ if( !pEntry.IsBaseColor() && (pEntry.GetWeighting() < nMinW) )
{
nFound = nIdx;
- nMinW = pEntry->GetWeighting();
+ nMinW = pEntry.GetWeighting();
}
}
return nFound;
@@ -681,11 +695,11 @@ sal_uInt32 XclExpPaletteImpl::GetNearestListColor( const Color& rColor, sal_uInt
sal_uInt32 nFound = 0;
sal_Int32 nMinD = SAL_MAX_INT32;
- for( sal_uInt32 nIdx = 0, nCount = mxColorList->Count(); nIdx < nCount; ++nIdx )
+ for( sal_uInt32 nIdx = 0, nCount = mxColorList->size(); nIdx < nCount; ++nIdx )
{
if( nIdx != nIgnore )
{
- if( XclListColor* pEntry = mxColorList->GetObject( nIdx ) )
+ if( XclListColor* pEntry = &mxColorList->at(nIdx) )
{
sal_Int32 nDist = lclGetColorDistance( rColor, pEntry->GetColor() );
if( nDist < nMinD )
@@ -701,8 +715,10 @@ sal_uInt32 XclExpPaletteImpl::GetNearestListColor( const Color& rColor, sal_uInt
sal_uInt32 XclExpPaletteImpl::GetNearestListColor( sal_uInt32 nIndex ) const
{
- XclListColor* pEntry = mxColorList->GetObject( nIndex );
- return pEntry ? GetNearestListColor( pEntry->GetColor(), nIndex ) : 0;
+ if (nIndex >= mxColorList->size())
+ return 0;
+ XclListColor* pEntry = &mxColorList->at(nIndex);
+ return GetNearestListColor( pEntry->GetColor(), nIndex );
}
sal_Int32 XclExpPaletteImpl::GetNearestPaletteColor(
@@ -834,7 +850,7 @@ sal_Int16 lclCheckFontItems( const SfxItemSet& rItemSet,
} // namespace
-/*static*/ sal_Int16 XclExpFontHelper::GetFirstUsedScript( const XclExpRoot& rRoot, const SfxItemSet& rItemSet )
+sal_Int16 XclExpFontHelper::GetFirstUsedScript( const XclExpRoot& rRoot, const SfxItemSet& rItemSet )
{
namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
@@ -846,7 +862,7 @@ sal_Int16 lclCheckFontItems( const SfxItemSet& rItemSet,
static const WhichAndScript WAS_ASIAN( ATTR_CJK_FONT, ::com::sun::star::i18n::ScriptType::ASIAN );
static const WhichAndScript WAS_CMPLX( ATTR_CTL_FONT, ::com::sun::star::i18n::ScriptType::COMPLEX );
- /* #114008# do not let a font from a parent style override an explicit
+ /* do not let a font from a parent style override an explicit
cell font. */
sal_Int16 nDefScript = rRoot.GetDefApiScript();
@@ -876,7 +892,7 @@ sal_Int16 lclCheckFontItems( const SfxItemSet& rItemSet,
return nScript;
}
-/*static*/ Font XclExpFontHelper::GetFontFromItemSet( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript )
+Font XclExpFontHelper::GetFontFromItemSet( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript )
{
namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
@@ -900,7 +916,7 @@ sal_Int16 lclCheckFontItems( const SfxItemSet& rItemSet,
return aFont;
}
-/*static*/ bool XclExpFontHelper::CheckItems( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep )
+bool XclExpFontHelper::CheckItems( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep )
{
static const sal_uInt16 pnCommonIds[] = {
ATTR_FONT_UNDERLINE, ATTR_FONT_CROSSEDOUT, ATTR_FONT_CONTOUR,
@@ -980,7 +996,7 @@ void XclExpFont::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
rStyleSheet->startElement( XML_font, FSEND );
- rStrm.WriteFontData( maData, XML_name );
+ XclXmlUtils::WriteFontData( rStyleSheet, maData, XML_name );
// OOXTODO: XML_scheme; //scheme/@val values: "major", "minor", "none"
rStyleSheet->endElement( XML_font );
}
@@ -1064,7 +1080,7 @@ sal_uInt16 XclExpFontBuffer::Insert(
{
XclExpFontRef xFont( new XclExpFont( GetRoot(), rFontData, eColorType ) );
maFontList.ReplaceRecord( xFont, EXC_FONT_APP );
- // #108487# set width of '0' character for column width export
+ // set width of '0' character for column width export
SetCharWidth( xFont->GetFontData() );
return EXC_FONT_APP;
}
@@ -1104,7 +1120,7 @@ sal_uInt16 XclExpFontBuffer::Insert(
sal_uInt16 XclExpFontBuffer::Insert( const SfxItemSet& rItemSet,
sal_Int16 nScript, XclExpColorType eColorType, bool bAppFont )
{
- // #i17050# #114008# #115495# script type now provided by caller
+ // #i17050# script type now provided by caller
Font aFont = XclExpFontHelper::GetFontFromItemSet( GetRoot(), rItemSet, nScript );
return Insert( aFont, eColorType, bAppFont );
}
@@ -1351,14 +1367,6 @@ bool XclExpCellProt::FillFromItemSet( const SfxItemSet& rItemSet, bool bStyle )
return ScfTools::CheckItem( rItemSet, ATTR_PROTECTION, bStyle );
}
-#if 0
-void XclExpCellProt::FillToXF2( sal_uInt8& rnNumFmt ) const
-{
- ::set_flag( rnNumFmt, EXC_XF2_LOCKED, mbLocked );
- ::set_flag( rnNumFmt, EXC_XF2_HIDDEN, mbHidden );
-}
-#endif
-
void XclExpCellProt::FillToXF3( sal_uInt16& rnProt ) const
{
::set_flag( rnProt, EXC_XF_LOCKED, mbLocked );
@@ -1379,6 +1387,8 @@ bool XclExpCellAlign::FillFromItemSet(
const SfxItemSet& rItemSet, bool bForceLineBreak, XclBiff eBiff, bool bStyle )
{
bool bUsed = false;
+ SvxCellHorJustify eHorAlign = GETITEMVALUE( rItemSet, SvxHorJustifyItem, ATTR_HOR_JUSTIFY, SvxCellHorJustify );
+ SvxCellVerJustify eVerAlign = GETITEMVALUE( rItemSet, SvxVerJustifyItem, ATTR_VER_JUSTIFY, SvxCellVerJustify );
switch( eBiff )
{
@@ -1405,7 +1415,7 @@ bool XclExpCellAlign::FillFromItemSet(
case EXC_BIFF4: // attributes new in BIFF4
{
// vertical alignment
- SetScVerAlign( GETITEMVALUE( rItemSet, SvxVerJustifyItem, ATTR_VER_JUSTIFY, SvxCellVerJustify ) );
+ SetScVerAlign( eVerAlign );
bUsed |= ScfTools::CheckItem( rItemSet, ATTR_VER_JUSTIFY, bStyle );
// stacked/rotation
@@ -1435,7 +1445,7 @@ bool XclExpCellAlign::FillFromItemSet(
case EXC_BIFF2: // attributes new in BIFF2
{
// horizontal alignment
- SetScHorAlign( GETITEMVALUE( rItemSet, SvxHorJustifyItem, ATTR_HOR_JUSTIFY, SvxCellHorJustify ) );
+ SetScHorAlign( eHorAlign );
bUsed |= ScfTools::CheckItem( rItemSet, ATTR_HOR_JUSTIFY, bStyle );
}
@@ -1443,28 +1453,28 @@ bool XclExpCellAlign::FillFromItemSet(
default: DBG_ERROR_BIFF();
}
- return bUsed;
-}
-
-#if 0
-void XclExpCellAlign::FillToXF2( sal_uInt8& rnFlags ) const
-{
- ::insert_value( rnFlags, mnHorAlign, 0, 3 );
-}
+ if (eBiff == EXC_BIFF8)
+ {
+ // Adjust for distributed alignments.
+ if (eHorAlign == SVX_HOR_JUSTIFY_BLOCK)
+ {
+ SvxCellJustifyMethod eHorJustMethod = GETITEMVALUE(
+ rItemSet, SvxJustifyMethodItem, ATTR_HOR_JUSTIFY_METHOD, SvxCellJustifyMethod);
+ if (eHorJustMethod == SVX_JUSTIFY_METHOD_DISTRIBUTE)
+ mnHorAlign = EXC_XF_HOR_DISTRIB;
+ }
-void XclExpCellAlign::FillToXF3( sal_uInt16& rnAlign ) const
-{
- ::insert_value( rnAlign, mnHorAlign, 0, 3 );
- ::set_flag( rnAlign, EXC_XF_LINEBREAK, mbLineBreak );
-}
+ if (eVerAlign == SVX_VER_JUSTIFY_BLOCK)
+ {
+ SvxCellJustifyMethod eVerJustMethod = GETITEMVALUE(
+ rItemSet, SvxJustifyMethodItem, ATTR_VER_JUSTIFY_METHOD, SvxCellJustifyMethod);
+ if (eVerJustMethod == SVX_JUSTIFY_METHOD_DISTRIBUTE)
+ mnVerAlign = EXC_XF_VER_DISTRIB;
+ }
+ }
-void XclExpCellAlign::FillToXF4( sal_uInt16& rnAlign ) const
-{
- FillToXF3( rnAlign );
- ::insert_value( rnAlign, mnVerAlign, 4, 2 );
- ::insert_value( rnAlign, mnOrient, 6, 2 );
+ return bUsed;
}
-#endif
void XclExpCellAlign::FillToXF5( sal_uInt16& rnAlign ) const
{
@@ -1547,9 +1557,26 @@ void lclGetBorderLine(
else if( nOuterWidth > DEF_LINE_WIDTH_2 )
rnXclLine = EXC_LINE_THICK;
else if( nOuterWidth > DEF_LINE_WIDTH_1 )
+ {
rnXclLine = EXC_LINE_MEDIUM;
+ if ( pLine->GetStyle( ) == DASHED )
+ rnXclLine = EXC_LINE_MEDIUMDASHED;
+ }
else if( nOuterWidth > DEF_LINE_WIDTH_0 )
+ {
rnXclLine = EXC_LINE_THIN;
+ switch ( pLine->GetStyle( ) )
+ {
+ case DASHED:
+ rnXclLine = EXC_LINE_DASHED;
+ break;
+ case DOTTED:
+ rnXclLine = EXC_LINE_DOTTED;
+ break;
+ default:
+ break;
+ }
+ }
else if( nOuterWidth > 0 )
rnXclLine = EXC_LINE_HAIR;
else
@@ -1643,27 +1670,6 @@ void XclExpCellBorder::SetFinalColors( const XclExpPalette& rPalette )
mnDiagColor = rPalette.GetColorIndex( mnDiagColorId );
}
-#if 0
-void XclExpCellBorder::FillToXF2( sal_uInt8& rnFlags ) const
-{
- ::set_flag( rnFlags, EXC_XF2_LEFTLINE, mnLeftLine != EXC_LINE_NONE );
- ::set_flag( rnFlags, EXC_XF2_RIGHTLINE, mnRightLine != EXC_LINE_NONE );
- ::set_flag( rnFlags, EXC_XF2_TOPLINE, mnTopLine != EXC_LINE_NONE );
- ::set_flag( rnFlags, EXC_XF2_BOTTOMLINE, mnBottomLine != EXC_LINE_NONE );
-}
-
-void XclExpCellBorder::FillToXF3( sal_uInt32& rnBorder ) const
-{
- ::insert_value( rnBorder, mnTopLine, 0, 3 );
- ::insert_value( rnBorder, mnLeftLine, 8, 3 );
- ::insert_value( rnBorder, mnBottomLine, 16, 3 );
- ::insert_value( rnBorder, mnRightLine, 24, 3 );
- ::insert_value( rnBorder, mnTopColor, 3, 5 );
- ::insert_value( rnBorder, mnLeftColor, 11, 5 );
- ::insert_value( rnBorder, mnBottomColor, 19, 5 );
- ::insert_value( rnBorder, mnRightColor, 27, 5 );
-}
-#endif
void XclExpCellBorder::FillToXF5( sal_uInt32& rnBorder, sal_uInt32& rnArea ) const
{
@@ -1715,6 +1721,9 @@ static const char* ToLineStyle( sal_uInt8 nLineStyle )
case EXC_LINE_THICK: return "thick";
case EXC_LINE_DOUBLE: return "double";
case EXC_LINE_HAIR: return "hair";
+ case EXC_LINE_DOTTED: return "dotted";
+ case EXC_LINE_DASHED: return "dashed";
+ case EXC_LINE_MEDIUMDASHED: return "mediumdashed";
}
return "*unknown*";
}
@@ -1791,20 +1800,6 @@ void XclExpCellArea::SetFinalColors( const XclExpPalette& rPalette )
rPalette.GetMixedColors( mnForeColor, mnBackColor, mnPattern, mnForeColorId, mnBackColorId );
}
-#if 0
-void XclExpCellArea::FillToXF2( sal_uInt8& rnFlags ) const
-{
- ::set_flag( rnFlags, EXC_XF2_BACKGROUND, mnPattern != EXC_PATT_NONE );
-}
-
-void XclExpCellArea::FillToXF3( sal_uInt16& rnArea ) const
-{
- ::insert_value( rnArea, mnPattern, 0, 6 );
- ::insert_value( rnArea, mnForeColor, 6, 5 );
- ::insert_value( rnArea, mnBackColor, 11, 5 );
-}
-#endif
-
void XclExpCellArea::FillToXF5( sal_uInt32& rnArea ) const
{
::insert_value( rnArea, mnPattern, 16, 6 );
@@ -2113,49 +2108,6 @@ XclExpDefaultXF::XclExpDefaultXF( const XclExpRoot& rRoot, bool bCellXF ) :
{
}
-//UNUSED2008-05 void XclExpDefaultXF::SetParent( sal_uInt32 nParentXFId )
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ASSERT( IsCellXF(), "XclExpDefaultXF::SetParent - not allowed in style XFs" );
-//UNUSED2008-05 if( IsCellXF() )
-//UNUSED2008-05 mnParentXFId = nParentXFId;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void XclExpDefaultXF::SetUsedFlags(
-//UNUSED2008-05 bool bProtUsed, bool bFontUsed, bool bFmtUsed,
-//UNUSED2008-05 bool bAlignUsed, bool bBorderUsed, bool bAreaUsed )
-//UNUSED2008-05 {
-//UNUSED2008-05 mbProtUsed = bProtUsed;
-//UNUSED2008-05 mbFontUsed = bFontUsed;
-//UNUSED2008-05 mbFmtUsed = bFmtUsed;
-//UNUSED2008-05 mbAlignUsed = bAlignUsed;
-//UNUSED2008-05 mbBorderUsed = bBorderUsed;
-//UNUSED2008-05 mbAreaUsed = bAreaUsed;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void XclExpDefaultXF::SetProtection( const XclExpCellProt& rProtection )
-//UNUSED2008-05 {
-//UNUSED2008-05 maProtection = rProtection;
-//UNUSED2008-05 mbProtUsed = true;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void XclExpDefaultXF::SetAlignment( const XclExpCellAlign& rAlignment )
-//UNUSED2008-05 {
-//UNUSED2008-05 maAlignment = rAlignment;
-//UNUSED2008-05 mbAlignUsed = true;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void XclExpDefaultXF::SetBorder( const XclExpCellBorder& rBorder )
-//UNUSED2008-05 {
-//UNUSED2008-05 maBorder = rBorder;
-//UNUSED2008-05 mbBorderUsed = true;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void XclExpDefaultXF::SetArea( const XclExpCellArea& rArea )
-//UNUSED2008-05 {
-//UNUSED2008-05 maArea = rArea;
-//UNUSED2008-05 mbAreaUsed = true;
-//UNUSED2008-05 }
-
void XclExpDefaultXF::SetFont( sal_uInt16 nXclFont )
{
mnXclFont = nXclFont;
@@ -2241,7 +2193,10 @@ void XclExpStyle::SaveXml( XclExpXmlStream& rStrm )
rStrm.GetCurrentStream()->singleElement( XML_cellStyle,
XML_name, sName.getStr(),
XML_xfId, OString::valueOf( nXFId ).getStr(),
- XML_builtinId, OString::valueOf( (sal_Int32) mnStyleId ).getStr(),
+/* mso-excel 2007 complains when it finds builtinId >= 55, it is not
+ * bothered by multiple 54 values. */
+#define CELL_STYLE_MAX_BUILTIN_ID 55
+ XML_builtinId, OString::valueOf( std::min( static_cast<sal_Int32>( CELL_STYLE_MAX_BUILTIN_ID - 1 ), static_cast <sal_Int32>( mnStyleId ) ) ).getStr(),
// OOXTODO: XML_iLevel,
// OOXTODO: XML_hidden,
XML_customBuiltin, XclXmlUtils::ToPsz( ! IsBuiltIn() ),
@@ -2878,8 +2833,8 @@ XclExpXmlStyleSheet::XclExpXmlStyleSheet( const XclExpRoot& rRoot )
void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr aStyleSheet = rStrm.CreateOutputStream(
- OUString::createFromAscii( "xl/styles.xml" ),
- OUString::createFromAscii( "styles.xml" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "xl/styles.xml") ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "styles.xml" )),
rStrm.GetCurrentStream()->getOutputStream(),
"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" );
@@ -2901,3 +2856,4 @@ void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index c268ee9ac62a..ac86a0b065c4 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -648,41 +649,6 @@ void XclExpBooleanCell::WriteContents( XclExpStream& rStrm )
rStrm << sal_uInt16( mbValue ? 1 : 0 ) << EXC_BOOLERR_BOOL;
}
-// ----------------------------------------------------------------------------
-
-//UNUSED2009-05 IMPL_FIXEDMEMPOOL_NEWDEL( XclExpErrorCell, 256, 256 )
-//UNUSED2009-05
-//UNUSED2009-05 XclExpErrorCell::XclExpErrorCell(
-//UNUSED2009-05 const XclExpRoot rRoot, const XclAddress& rXclPos,
-//UNUSED2009-05 const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId, sal_uInt8 nErrCode ) :
-//UNUSED2009-05 // #i41210# always use latin script for error cells
-//UNUSED2009-05 XclExpSingleCellBase( rRoot, EXC_ID3_BOOLERR, 2, rXclPos, pPattern, ApiScriptType::LATIN, nForcedXFId ),
-//UNUSED2009-05 mnErrCode( nErrCode )
-//UNUSED2009-05 {
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 void XclExpErrorCell::SaveXml( XclExpXmlStream& rStrm )
-//UNUSED2009-05 {
-//UNUSED2009-05 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
-//UNUSED2009-05 rWorksheet->startElement( XML_c,
-//UNUSED2009-05 XML_r, XclXmlUtils::ToOString( GetXclPos() ).getStr(),
-//UNUSED2009-05 XML_s, lcl_GetStyleId( rStrm, *this ).getStr(),
-//UNUSED2009-05 XML_t, "e",
-//UNUSED2009-05 // OOXTODO: XML_cm, XML_vm, XML_ph
-//UNUSED2009-05 FSEND );
-//UNUSED2009-05 rWorksheet->startElement( XML_v, FSEND );
-//UNUSED2009-05 rWorksheet->write( (sal_Int32) mnErrCode );
-//UNUSED2009-05 rWorksheet->endElement( XML_v );
-//UNUSED2009-05 rWorksheet->endElement( XML_c );
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 void XclExpErrorCell::WriteContents( XclExpStream& rStrm )
-//UNUSED2009-05 {
-//UNUSED2009-05 rStrm << mnErrCode << EXC_BOOLERR_ERROR;
-//UNUSED2009-05 }
-
-// ----------------------------------------------------------------------------
-
IMPL_FIXEDMEMPOOL_NEWDEL( XclExpLabelCell, 256, 256 )
XclExpLabelCell::XclExpLabelCell(
@@ -714,7 +680,7 @@ bool XclExpLabelCell::IsMultiLineText() const
void XclExpLabelCell::Init( const XclExpRoot& rRoot,
const ScPatternAttr* pPattern, XclExpStringRef xText )
{
- DBG_ASSERT( xText.is() && xText->Len(), "XclExpLabelCell::XclExpLabelCell - empty string passed" );
+ DBG_ASSERT( xText && xText->Len(), "XclExpLabelCell::XclExpLabelCell - empty string passed" );
mxText = xText;
mnSstIndex = 0;
@@ -819,7 +785,7 @@ XclExpFormulaCell::XclExpFormulaCell(
// alternative number format passed to XF buffer
sal_uLong nAltScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND;
- /* #73420# Xcl doesn't know Boolean number formats, we write
+ /* Xcl doesn't know Boolean number formats, we write
"TRUE";"FALSE" (language dependent). Don't do it for automatic
formula formats, because Excel gets them right. */
/* #i8640# Don't set text format, if we have string results. */
@@ -828,7 +794,7 @@ XclExpFormulaCell::XclExpFormulaCell(
(nFormatType != NUMBERFORMAT_LOGICAL) &&
(nFormatType != NUMBERFORMAT_TEXT) )
nAltScNumFmt = mrScFmlaCell.GetStandardFormat( rFormatter, nScNumFmt );
- /* #73420# If cell number format is Boolean and automatic formula
+ /* If cell number format is Boolean and automatic formula
format is Boolean don't write that ugly special format. */
else if( (nFormatType == NUMBERFORMAT_LOGICAL) &&
(rFormatter.GetType( nScNumFmt ) == NUMBERFORMAT_LOGICAL) )
@@ -880,7 +846,7 @@ XclExpFormulaCell::XclExpFormulaCell(
// other formula cell covered by a matrix - find the ARRAY record
mxAddRec = rArrayBfr.FindArray( rScTokArr );
// should always be found, if Calc document is not broken
- DBG_ASSERT( mxAddRec.is(), "XclExpFormulaCell::XclExpFormulaCell - no matrix found" );
+ DBG_ASSERT( mxAddRec, "XclExpFormulaCell::XclExpFormulaCell - no matrix found" );
}
break;
default:;
@@ -898,95 +864,31 @@ XclExpFormulaCell::XclExpFormulaCell(
void XclExpFormulaCell::Save( XclExpStream& rStrm )
{
// create token array for FORMULA cells with additional record
- if( mxAddRec.is() )
+ if( mxAddRec )
mxTokArr = mxAddRec->CreateCellTokenArray( rStrm.GetRoot() );
// FORMULA record itself
- DBG_ASSERT( mxTokArr.is(), "XclExpFormulaCell::Save - missing token array" );
+ DBG_ASSERT( mxTokArr, "XclExpFormulaCell::Save - missing token array" );
if( !mxTokArr )
mxTokArr = rStrm.GetRoot().GetFormulaCompiler().CreateErrorFormula( EXC_ERR_NA );
SetContSize( 16 + mxTokArr->GetSize() );
XclExpSingleCellBase::Save( rStrm );
// additional record (ARRAY, SHRFMLA, or TABLEOP), only for first FORMULA record
- if( mxAddRec.is() && mxAddRec->IsBasePos( GetXclCol(), GetXclRow() ) )
+ if( mxAddRec && mxAddRec->IsBasePos( GetXclCol(), GetXclRow() ) )
mxAddRec->Save( rStrm );
// STRING record for string result
- if( mxStringRec.is() )
+ if( mxStringRec )
mxStringRec->Save( rStrm );
}
-static const char* lcl_GetErrorString( sal_uInt16 nScErrCode )
-{
- sal_uInt8 nXclErrCode = XclTools::GetXclErrorCode( nScErrCode );
- switch( nXclErrCode )
- {
- case EXC_ERR_NULL: return "#NULL!";
- case EXC_ERR_DIV0: return "#DIV/0!";
- case EXC_ERR_VALUE: return "#VALUE!";
- case EXC_ERR_REF: return "#REF!";
- case EXC_ERR_NAME: return "#NAME?";
- case EXC_ERR_NUM: return "#NUM!";
- case EXC_ERR_NA:
- default: return "#N/A";
- }
-}
-
-static void lcl_GetFormulaInfo( ScFormulaCell& rCell, const char** pType, OUString& rValue)
-{
- switch( rCell.GetFormatType() )
- {
- case NUMBERFORMAT_NUMBER:
- {
- // either value or error code
- sal_uInt16 nScErrCode = rCell.GetErrCode();
- if( nScErrCode )
- {
- *pType = "e";
- rValue = XclXmlUtils::ToOUString( lcl_GetErrorString( nScErrCode ) );
- }
- else
- {
- *pType = "n";
- rValue = OUString::valueOf( rCell.GetValue() );
- }
- }
- break;
-
- case NUMBERFORMAT_TEXT:
- {
- *pType = "str";
- String aResult;
- rCell.GetString( aResult );
- rValue = XclXmlUtils::ToOUString( aResult );
- }
- break;
-
- case NUMBERFORMAT_LOGICAL:
- {
- *pType = "b";
- rValue = XclXmlUtils::ToOUString( rCell.GetValue() == 0.0 ? "0" : "1" );
- }
- break;
-
- default:
- {
- *pType = "inlineStr";
- String aResult;
- rCell.GetString( aResult );
- rValue = XclXmlUtils::ToOUString( aResult );
- }
- break;
- }
-}
-
void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm )
{
const char* sType = NULL;
OUString sValue;
- lcl_GetFormulaInfo( mrScFmlaCell, &sType, sValue );
+ XclXmlUtils::GetFormulaTypeAndValue( mrScFmlaCell, sType, sValue );
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_c,
XML_r, XclXmlUtils::ToOString( GetXclPos() ).getStr(),
@@ -997,7 +899,7 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->startElement( XML_f,
// OOXTODO: XML_t, ST_CellFormulaType
- XML_aca, XclXmlUtils::ToPsz( mxTokArr->IsVolatile() || (mxAddRec.is() && mxAddRec->IsVolatile()) ),
+ XML_aca, XclXmlUtils::ToPsz( (mxTokArr && mxTokArr->IsVolatile()) || (mxAddRec && mxAddRec->IsVolatile()) ),
// OOXTODO: XML_ref, ST_Ref
// OOXTODO: XML_dt2D, bool
// OOXTODO: XML_dtr, bool
@@ -1077,8 +979,8 @@ void XclExpFormulaCell::WriteContents( XclExpStream& rStrm )
// flags and formula token array
sal_uInt16 nFlags = EXC_FORMULA_DEFAULTFLAGS;
- ::set_flag( nFlags, EXC_FORMULA_RECALC_ALWAYS, mxTokArr->IsVolatile() || (mxAddRec.is() && mxAddRec->IsVolatile()) );
- ::set_flag( nFlags, EXC_FORMULA_SHARED, mxAddRec.is() && (mxAddRec->GetRecId() == EXC_ID_SHRFMLA) );
+ ::set_flag( nFlags, EXC_FORMULA_RECALC_ALWAYS, mxTokArr->IsVolatile() || (mxAddRec && mxAddRec->IsVolatile()) );
+ ::set_flag( nFlags, EXC_FORMULA_SHARED, mxAddRec && (mxAddRec->GetRecId() == EXC_ID_SHRFMLA) );
rStrm << nFlags << sal_uInt32( 0 ) << *mxTokArr;
}
@@ -1832,13 +1734,10 @@ XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt16 nXclRow,
// *** Row height *** -----------------------------------------------------
- if (bUserHeight)
- mnHeight = GetDoc().GetRowHeight(nScRow, nScTab, false);
- else
- mnHeight = EXC_ROW_DEFAULTHEIGHT;
+ // Always get the actual row height even if the manual size flag is not set,
+ // to correctly export the heights of rows with wrapped texts.
- // #76250# not usable in Applix
-// ::set_flag( mnHeight, EXC_ROW_FLAGDEFHEIGHT, !bUserHeight );
+ mnHeight = GetDoc().GetRowHeight(nScRow, nScTab, false);
// *** Outline data *** ---------------------------------------------------
@@ -2037,9 +1936,9 @@ void XclExpRow::Save( XclExpStream& rStrm )
void XclExpRow::InsertCell( XclExpCellRef xCell, size_t nPos, bool bIsMergedBase )
{
- DBG_ASSERT( xCell.is(), "XclExpRow::InsertCell - missing cell" );
+ DBG_ASSERT( xCell, "XclExpRow::InsertCell - missing cell" );
- /* #109751# If we have a multi-line text in a merged cell, and the resulting
+ /* If we have a multi-line text in a merged cell, and the resulting
row height has not been confirmed, we need to force the EXC_ROW_UNSYNCED
flag to be true to ensure Excel works correctly. */
if( bIsMergedBase && xCell->IsMultiLineText() )
@@ -2047,7 +1946,7 @@ void XclExpRow::InsertCell( XclExpCellRef xCell, size_t nPos, bool bIsMergedBase
// try to merge with previous cell, insert the new cell if not successful
XclExpCellRef xPrevCell = maCellList.GetRecord( nPos - 1 );
- if( xPrevCell.is() && xPrevCell->TryMerge( *xCell ) )
+ if( xPrevCell && xPrevCell->TryMerge( *xCell ) )
xCell = xPrevCell;
else
maCellList.InsertRecord( xCell, nPos++ );
@@ -2055,7 +1954,7 @@ void XclExpRow::InsertCell( XclExpCellRef xCell, size_t nPos, bool bIsMergedBase
// try to merge with following cell, remove it if successful
XclExpCellRef xNextCell = maCellList.GetRecord( nPos );
- if( xNextCell.is() && xCell->TryMerge( *xNextCell ) )
+ if( xNextCell && xCell->TryMerge( *xNextCell ) )
maCellList.RemoveRecord( nPos );
}
@@ -2100,15 +1999,13 @@ void XclExpRow::SaveXml( XclExpXmlStream& rStrm )
XclExpRowBuffer::XclExpRowBuffer( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
maOutlineBfr( rRoot ),
- maDimensions( rRoot ),
- mpLastUsedRow( 0 ),
- mnLastUsedXclRow( 0 )
+ maDimensions( rRoot )
{
}
void XclExpRowBuffer::AppendCell( XclExpCellRef xCell, bool bIsMergedBase )
{
- DBG_ASSERT( xCell.is(), "XclExpRowBuffer::AppendCell - missing cell" );
+ DBG_ASSERT( xCell, "XclExpRowBuffer::AppendCell - missing cell" );
GetOrCreateRow( xCell->GetXclRow(), false ).AppendCell( xCell, bIsMergedBase );
}
@@ -2120,63 +2017,34 @@ void XclExpRowBuffer::CreateRows( SCROW nFirstFreeScRow )
void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt16Vec& rColXFIndexes )
{
- size_t nPos, nSize;
-
// *** Finalize all rows *** ----------------------------------------------
GetProgressBar().ActivateFinalRowsSegment();
- // unused blank cell records will be removed
- for( nPos = 0, nSize = maRowList.GetSize(); nPos < nSize; ++nPos )
- maRowList.GetRecord( nPos )->Finalize( rColXFIndexes );
+ RowMap::iterator itr, itrBeg = maRowMap.begin(), itrEnd = maRowMap.end();
+ for (itr = itrBeg; itr != itrEnd; ++itr)
+ itr->second->Finalize(rColXFIndexes);
// *** Default row format *** ---------------------------------------------
typedef ::std::map< XclExpDefaultRowData, size_t > XclExpDefRowDataMap;
XclExpDefRowDataMap aDefRowMap;
- // find default row format for rows beyond used area
- sal_uInt32 nDefaultXclRow = maRowList.IsEmpty() ? 0 : (maRowList.GetLastRecord()->GetXclRow() + 1);
XclExpDefaultRowData aMaxDefData;
size_t nMaxDefCount = 0;
- /* #i30411# Files saved with SO7/OOo1.x with nonstandard default column
- formatting cause big Excel files, because all rows from row 1 to row
- 32000 are exported. Now, if the used area goes exactly to row 32000,
- ignore all rows >32000.
- #i59220# Tolerance of +-128 rows for inserted/removed rows. */
- if( (nDefaultXclRow < 31872) || (nDefaultXclRow > 32128) )
- {
- sal_uInt16 nLastXclRow = static_cast< sal_uInt16 >( GetMaxPos().Row() );
- if( nDefaultXclRow <= nLastXclRow )
- {
- // create a dummy ROW record and fill aMaxDefData
- XclExpRowOutlineBuffer aOutlineBfr( GetRoot() );
- XclExpRow aRow( GetRoot(), nLastXclRow, aOutlineBfr, true );
- aMaxDefData = XclExpDefaultRowData( aRow );
- aDefRowMap[ aMaxDefData ] = nMaxDefCount =
- static_cast< size_t >( nLastXclRow - nDefaultXclRow + 1 );
- }
- }
-
// only look for default format in existing rows, if there are more than unused
- nSize = maRowList.GetSize();
- if( nMaxDefCount < nSize )
+ for (itr = itrBeg; itr != itrEnd; ++itr)
{
- for( nPos = 0; nPos < nSize; ++nPos )
+ const RowRef& rRow = itr->second;
+ if (rRow->IsDefaultable())
{
- XclExpRowRef xRow = maRowList.GetRecord( nPos );
- /* Collect formats of unused rows (rows without cells), which are able
- to be defaulted (i.e. no explicit format or outline level). */
- if( xRow->IsDefaultable() )
+ XclExpDefaultRowData aDefData( *rRow );
+ size_t& rnDefCount = aDefRowMap[ aDefData ];
+ ++rnDefCount;
+ if( rnDefCount > nMaxDefCount )
{
- XclExpDefaultRowData aDefData( *xRow );
- size_t& rnDefCount = aDefRowMap[ aDefData ];
- ++rnDefCount;
- if( rnDefCount > nMaxDefCount )
- {
- nMaxDefCount = rnDefCount;
- aMaxDefData = aDefData;
- }
+ nMaxDefCount = rnDefCount;
+ aMaxDefData = aDefData;
}
}
}
@@ -2191,24 +2059,23 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt
sal_uInt32 nFirstUsedXclRow = SAL_MAX_UINT32;
sal_uInt32 nFirstFreeXclRow = 0;
- for( nPos = 0, nSize = maRowList.GetSize(); nPos < nSize; ++nPos )
+ for (itr = itrBeg; itr != itrEnd; ++itr)
{
- XclExpRowRef xRow = maRowList.GetRecord( nPos );
-
+ const RowRef& rRow = itr->second;
// disable unused rows
- xRow->DisableIfDefault( aMaxDefData );
+ rRow->DisableIfDefault( aMaxDefData );
// find used column range
- if( !xRow->IsEmpty() ) // empty rows return (0...0) as used range
+ if( !rRow->IsEmpty() ) // empty rows return (0...0) as used range
{
- nFirstUsedXclCol = ::std::min( nFirstUsedXclCol, xRow->GetFirstUsedXclCol() );
- nFirstFreeXclCol = ::std::max( nFirstFreeXclCol, xRow->GetFirstFreeXclCol() );
+ nFirstUsedXclCol = ::std::min( nFirstUsedXclCol, rRow->GetFirstUsedXclCol() );
+ nFirstFreeXclCol = ::std::max( nFirstFreeXclCol, rRow->GetFirstFreeXclCol() );
}
// find used row range
- if( xRow->IsEnabled() )
+ if( rRow->IsEnabled() )
{
- sal_uInt16 nXclRow = xRow->GetXclRow();
+ sal_uInt16 nXclRow = rRow->GetXclRow();
nFirstUsedXclRow = ::std::min< sal_uInt32 >( nFirstUsedXclRow, nXclRow );
nFirstFreeXclRow = ::std::max< sal_uInt32 >( nFirstFreeXclRow, nXclRow + 1 );
}
@@ -2229,27 +2096,28 @@ void XclExpRowBuffer::Save( XclExpStream& rStrm )
maDimensions.Save( rStrm );
// save in blocks of 32 rows, each block contains first all ROWs, then all cells
- size_t nSize = maRowList.GetSize();
- size_t nBlockStart = 0;
- sal_uInt16 nStartXclRow = (nSize == 0) ? 0 : maRowList.GetRecord( 0 )->GetXclRow();
+ size_t nSize = maRowMap.size();
+ RowMap::iterator itr, itrBeg = maRowMap.begin(), itrEnd = maRowMap.end();
+ RowMap::iterator itrBlkStart = maRowMap.begin(), itrBlkEnd = maRowMap.begin();
+ sal_uInt16 nStartXclRow = (nSize == 0) ? 0 : itrBeg->second->GetXclRow();
- while( nBlockStart < nSize )
+
+ for (itr = itrBeg; itr != itrEnd; ++itr)
{
// find end of row block
- size_t nBlockEnd = nBlockStart + 1;
- while( (nBlockEnd < nSize) && (maRowList.GetRecord( nBlockEnd )->GetXclRow() - nStartXclRow < EXC_ROW_ROWBLOCKSIZE) )
- ++nBlockEnd;
+ while( (itrBlkEnd != itrEnd) && (itrBlkEnd->second->GetXclRow() - nStartXclRow < EXC_ROW_ROWBLOCKSIZE) )
+ ++itrBlkEnd;
// write the ROW records
- size_t nPos;
- for( nPos = nBlockStart; nPos < nBlockEnd; ++nPos )
- maRowList.GetRecord( nPos )->Save( rStrm );
+ RowMap::iterator itRow;
+ for( itRow = itrBlkStart; itRow != itrBlkEnd; ++itRow )
+ itRow->second->Save( rStrm );
// write the cell records
- for( nPos = nBlockStart; nPos < nBlockEnd; ++nPos )
- maRowList.GetRecord( nPos )->WriteCellList( rStrm );
+ for( itRow = itrBlkStart; itRow != itrBlkEnd; ++itRow )
+ itRow->second->WriteCellList( rStrm );
- nBlockStart = nBlockEnd;
+ itrBlkStart = (itrBlkEnd == itrEnd) ? itrBlkEnd : itrBlkEnd++;
nStartXclRow += EXC_ROW_ROWBLOCKSIZE;
}
}
@@ -2257,23 +2125,22 @@ void XclExpRowBuffer::Save( XclExpStream& rStrm )
void XclExpRowBuffer::SaveXml( XclExpXmlStream& rStrm )
{
sal_Int32 nNonEmpty = 0;
-
- size_t nRows = maRowList.GetSize();
- for( size_t i = 0; i < nRows; ++i)
- if( maRowList.GetRecord( i )->IsEnabled() )
+ RowMap::iterator itr = maRowMap.begin(), itrEnd = maRowMap.end();
+ for (; itr != itrEnd; ++itr)
+ if (itr->second->IsEnabled())
++nNonEmpty;
- if( nNonEmpty == 0 )
+ if (nNonEmpty == 0)
{
rStrm.GetCurrentStream()->singleElement( XML_sheetData, FSEND );
+ return;
}
- else
- {
- sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
- rWorksheet->startElement( XML_sheetData, FSEND );
- maRowList.SaveXml( rStrm );
- rWorksheet->endElement( XML_sheetData );
- }
+
+ sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
+ rWorksheet->startElement( XML_sheetData, FSEND );
+ for (itr = maRowMap.begin(); itr != itrEnd; ++itr)
+ itr->second->SaveXml(rStrm);
+ rWorksheet->endElement( XML_sheetData );
}
XclExpDimensions* XclExpRowBuffer::GetDimensions()
@@ -2283,18 +2150,14 @@ XclExpDimensions* XclExpRowBuffer::GetDimensions()
XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysEmpty )
{
- if( !mpLastUsedRow || (mnLastUsedXclRow != nXclRow) )
+ RowMap::iterator itr = maRowMap.find(nXclRow);
+ if (itr == maRowMap.end())
{
- // fill up missing ROW records
- // do not use sal_uInt16 for nFirstFreeXclRow, would cause loop in full sheets
- for( size_t nFirstFreeXclRow = maRowList.GetSize(); nFirstFreeXclRow <= nXclRow; ++nFirstFreeXclRow )
- maRowList.AppendNewRecord( new XclExpRow(
- GetRoot(), static_cast< sal_uInt16 >( nFirstFreeXclRow ), maOutlineBfr, bRowAlwaysEmpty ) );
-
- mpLastUsedRow = maRowList.GetRecord( nXclRow ).get();
- mnLastUsedXclRow = nXclRow;
+ RowRef p(new XclExpRow(GetRoot(), nXclRow, maOutlineBfr, bRowAlwaysEmpty));
+ ::std::pair<RowMap::iterator, bool> r = maRowMap.insert(RowMap::value_type(nXclRow, p));
+ itr = r.first;
}
- return *mpLastUsedRow;
+ return *itr->second;
}
// ============================================================================
@@ -2361,7 +2224,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
// range for cell iterator
SCCOL nLastIterScCol = nMaxScCol;
- SCROW nLastIterScRow = ulimit_cast< SCROW >( nLastUsedScRow + 128, nMaxScRow );
+ SCROW nLastIterScRow = ulimit_cast< SCROW >( nLastUsedScRow, nMaxScRow );
ScUsedAreaIterator aIt( &rDoc, nScTab, 0, 0, nLastIterScCol, nLastIterScRow );
// activate the correct segment and sub segment at the progress bar
@@ -2475,7 +2338,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
}
// insert the cell into the current row
- if( xCell.is() )
+ if( xCell )
maRowBfr.AppendCell( xCell, bIsMergedBase );
// notes
@@ -2495,8 +2358,8 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
ScRange aScRange( aScPos );
aScRange.aEnd.IncCol( rMergeItem.GetColMerge() - 1 );
aScRange.aEnd.IncRow( rMergeItem.GetRowMerge() - 1 );
- sal_uInt32 nXFId = xCell.is() ? xCell->GetFirstXFId() : EXC_XFID_NOTFOUND;
- // #120156# blank cells merged vertically may occur repeatedly
+ sal_uInt32 nXFId = xCell ? xCell->GetFirstXFId() : EXC_XFID_NOTFOUND;
+ // blank cells merged vertically may occur repeatedly
DBG_ASSERT( (aScRange.aStart.Col() == aScRange.aEnd.Col()) || (nScCol == nLastScCol),
"XclExpCellTable::XclExpCellTable - invalid repeated blank merged cell" );
for( SCCOL nIndex = nScCol; nIndex <= nLastScCol; ++nIndex )
@@ -2577,3 +2440,4 @@ void XclExpCellTable::SaveXml( XclExpXmlStream& rStrm )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index 2abd807e8872..df69840081cb 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -313,7 +314,6 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
const ScViewOptions& rViewOpt = GetDoc().GetViewOptions();
maData.mbShowFormulas = rViewOpt.GetOption( VOPT_FORMULAS );
- maData.mbShowGrid = rViewOpt.GetOption( VOPT_GRID );
maData.mbShowHeadings = rViewOpt.GetOption( VOPT_HEADER );
maData.mbShowZeros = rViewOpt.GetOption( VOPT_NULLVALS );
maData.mbShowOutline = rViewOpt.GetOption( VOPT_OUTLINER );
@@ -388,6 +388,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
else
maData.maGridColor = rGridColor;
}
+ maData.mbShowGrid = rTabSett.mbShowGrid;
// view mode and zoom
maData.mbPageMode = (GetBiff() == EXC_BIFF8) && rTabSett.mbPageMode;
@@ -536,3 +537,4 @@ void XclExpTabViewSettings::WriteTabBgColor( XclExpStream& rStrm ) const
}
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index dcd9fc5db164..0393ad2d45bf 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -138,6 +139,9 @@ using ::com::sun::star::chart2::data::XLabeledDataSequence;
using ::formula::FormulaToken;
using ::formula::StackVar;
+using ::boost::shared_ptr;
+using ::std::pair;
+using ::std::auto_ptr;
namespace cssc = ::com::sun::star::chart;
namespace cssc2 = ::com::sun::star::chart2;
@@ -465,7 +469,7 @@ void XclImpChLineFormat::ReadChLineFormat( XclImpStream& rStrm )
const XclImpRoot& rRoot = rStrm.GetRoot();
if( rRoot.GetBiff() == EXC_BIFF8 )
- // #116397# BIFF8: index into palette used instead of RGB data
+ // BIFF8: index into palette used instead of RGB data
maData.maColor = rRoot.GetPalette().GetColor( rStrm.ReaduInt16() );
}
@@ -498,7 +502,7 @@ void XclImpChAreaFormat::ReadChAreaFormat( XclImpStream& rStrm )
const XclImpRoot& rRoot = rStrm.GetRoot();
if( rRoot.GetBiff() == EXC_BIFF8 )
{
- // #116397# BIFF8: index into palette used instead of RGB data
+ // BIFF8: index into palette used instead of RGB data
const XclImpPalette& rPal = rRoot.GetPalette();
maData.maPattColor = rPal.GetColor( rStrm.ReaduInt16() );
maData.maBackColor = rPal.GetColor( rStrm.ReaduInt16());
@@ -615,7 +619,7 @@ void XclImpChFrameBase::ReadSubRecord( XclImpStream& rStrm )
void XclImpChFrameBase::ConvertLineBase( const XclImpChRoot& rRoot,
ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
{
- if( mxLineFmt.is() )
+ if( mxLineFmt )
mxLineFmt->Convert( rRoot, rPropSet, eObjType, nFormatIdx );
}
@@ -625,9 +629,9 @@ void XclImpChFrameBase::ConvertAreaBase( const XclImpChRoot& rRoot,
if( rRoot.GetFormatInfo( eObjType ).mbIsFrame )
{
// CHESCHERFORMAT overrides CHAREAFORMAT (even if it is auto)
- if( mxEscherFmt.is() )
+ if( mxEscherFmt )
mxEscherFmt->Convert( rRoot, rPropSet, eObjType );
- else if( mxAreaFmt.is() )
+ else if( mxAreaFmt )
mxAreaFmt->Convert( rRoot, rPropSet, eObjType, nFormatIdx );
}
}
@@ -715,7 +719,7 @@ Reference< XLabeledDataSequence > lclCreateLabeledDataSequence(
{
// create data sequence for values and title
Reference< XDataSequence > xValueSeq;
- if( xValueLink.is() )
+ if( xValueLink )
xValueSeq = xValueLink->CreateDataSequence( rValueRole );
Reference< XDataSequence > xTitleSeq;
if( pTitleLink )
@@ -785,14 +789,14 @@ void XclImpChSourceLink::SetString( const String& rString )
void XclImpChSourceLink::SetTextFormats( const XclFormatRunVec& rFormats )
{
- if( mxString.is() )
+ if( mxString )
mxString->SetFormats( rFormats );
}
sal_uInt16 XclImpChSourceLink::GetCellCount() const
{
sal_uInt32 nCellCount = 0;
- if( mxTokenArray.is() )
+ if( mxTokenArray )
{
mxTokenArray->Reset();
for( const FormulaToken* pToken = mxTokenArray->First(); pToken; pToken = mxTokenArray->Next() )
@@ -840,7 +844,7 @@ Reference< XDataSequence > XclImpChSourceLink::CreateDataSequence( const OUStrin
{
Reference< XDataSequence > xDataSeq;
Reference< XDataProvider > xDataProv = GetDataProvider();
- if( xDataProv.is() && mxTokenArray.is() )
+ if( xDataProv.is() && mxTokenArray )
{
ScCompiler aComp( GetDocPtr(), ScAddress(), *mxTokenArray );
aComp.SetGrammar( ::formula::FormulaGrammar::GRAM_ENGLISH );
@@ -865,7 +869,7 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen
const XclImpChRoot& rRoot, sal_uInt16 nLeadFontIdx, const Color& rLeadFontColor ) const
{
::std::vector< Reference< XFormattedString > > aStringVec;
- if( mxString.is() )
+ if( mxString )
{
for( XclImpStringIterator aIt( *mxString ); aIt.Is(); ++aIt )
{
@@ -893,16 +897,16 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen
return ScfApiHelper::VectorToSequence( aStringVec );
}
-void XclImpChSourceLink::FillSourceLink( ::std::vector< ScSharedTokenRef >& rTokens ) const
+void XclImpChSourceLink::FillSourceLink( ::std::vector< ScTokenRef >& rTokens ) const
{
- if( !mxTokenArray.is() )
+ if( !mxTokenArray )
// no links to fill.
return;
mxTokenArray->Reset();
for (FormulaToken* p = mxTokenArray->First(); p; p = mxTokenArray->Next())
{
- ScSharedTokenRef pToken(static_cast<ScToken*>(p->Clone()));
+ ScTokenRef pToken(static_cast<ScToken*>(p->Clone()));
if (ScRefTokenHelper::isRef(pToken))
// This is a reference token. Store it.
ScRefTokenHelper::join(rTokens, pToken);
@@ -956,7 +960,7 @@ void XclImpChText::ReadHeaderRecord( XclImpStream& rStrm )
if( GetBiff() == EXC_BIFF8 )
{
- // #116397# BIFF8: index into palette used instead of RGB data
+ // BIFF8: index into palette used instead of RGB data
maData.maTextColor = GetPalette().GetColor( rStrm.ReaduInt16() );
// placement and rotation
rStrm >> maData.mnFlags2 >> maData.mnRotation;
@@ -1000,7 +1004,7 @@ void XclImpChText::ReadSubRecord( XclImpStream& rStrm )
ReadChFrLabelProps( rStrm );
break;
case EXC_ID_CHEND:
- if( mxSrcLink.is() && !maFormats.empty() )
+ if( mxSrcLink && !maFormats.empty() )
mxSrcLink->SetTextFormats( maFormats );
break;
}
@@ -1008,7 +1012,7 @@ void XclImpChText::ReadSubRecord( XclImpStream& rStrm )
sal_uInt16 XclImpChText::GetFontIndex() const
{
- return mxFont.is() ? mxFont->GetFontIndex() : EXC_FONT_NOTFOUND;
+ return mxFont ? mxFont->GetFontIndex() : EXC_FONT_NOTFOUND;
}
Color XclImpChText::GetFontColor() const
@@ -1066,24 +1070,24 @@ void XclImpChText::ConvertRotation( ScfPropertySet& rPropSet, bool bSupportsStac
void XclImpChText::ConvertFrame( ScfPropertySet& rPropSet ) const
{
- if( mxFrame.is() )
+ if( mxFrame )
mxFrame->Convert( rPropSet );
}
void XclImpChText::ConvertNumFmt( ScfPropertySet& rPropSet, bool bPercent ) const
{
- if( mxSrcLink.is() )
+ if( mxSrcLink )
mxSrcLink->ConvertNumFmt( rPropSet, bPercent );
}
void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeInfo& rTypeInfo ) const
{
// existing CHFRLABELPROPS record wins over flags from CHTEXT
- sal_uInt16 nShowFlags = mxLabelProps.is() ? mxLabelProps->mnFlags : maData.mnFlags;
- sal_uInt16 SHOWANYCATEG = mxLabelProps.is() ? EXC_CHFRLABELPROPS_SHOWCATEG : (EXC_CHTEXT_SHOWCATEGPERC | EXC_CHTEXT_SHOWCATEG);
- sal_uInt16 SHOWANYVALUE = mxLabelProps.is() ? EXC_CHFRLABELPROPS_SHOWVALUE : EXC_CHTEXT_SHOWVALUE;
- sal_uInt16 SHOWANYPERCENT = mxLabelProps.is() ? EXC_CHFRLABELPROPS_SHOWPERCENT : (EXC_CHTEXT_SHOWPERCENT | EXC_CHTEXT_SHOWCATEGPERC);
- sal_uInt16 SHOWANYBUBBLE = mxLabelProps.is() ? EXC_CHFRLABELPROPS_SHOWBUBBLE : EXC_CHTEXT_SHOWBUBBLE;
+ sal_uInt16 nShowFlags = mxLabelProps ? mxLabelProps->mnFlags : maData.mnFlags;
+ sal_uInt16 SHOWANYCATEG = mxLabelProps ? EXC_CHFRLABELPROPS_SHOWCATEG : (EXC_CHTEXT_SHOWCATEGPERC | EXC_CHTEXT_SHOWCATEG);
+ sal_uInt16 SHOWANYVALUE = mxLabelProps ? EXC_CHFRLABELPROPS_SHOWVALUE : EXC_CHTEXT_SHOWVALUE;
+ sal_uInt16 SHOWANYPERCENT = mxLabelProps ? EXC_CHFRLABELPROPS_SHOWPERCENT : (EXC_CHTEXT_SHOWPERCENT | EXC_CHTEXT_SHOWCATEGPERC);
+ sal_uInt16 SHOWANYBUBBLE = mxLabelProps ? EXC_CHFRLABELPROPS_SHOWBUBBLE : EXC_CHTEXT_SHOWBUBBLE;
// get raw flags for label values
bool bShowNone = IsDeleted();
@@ -1103,7 +1107,7 @@ void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeIn
// create API struct for label values, set API label separator
cssc2::DataPointLabel aPointLabel( bShowValue, bShowPercent, bShowCateg, bShowSymbol );
rPropSet.SetProperty( EXC_CHPROP_LABEL, aPointLabel );
- String aSep = mxLabelProps.is() ? mxLabelProps->maSeparator : String( sal_Unicode( '\n' ) );
+ String aSep = mxLabelProps ? mxLabelProps->maSeparator : String( sal_Unicode( '\n' ) );
if( aSep.Len() == 0 )
aSep = CREATE_STRING( "; " );
rPropSet.SetStringProperty( EXC_CHPROP_LABELSEPARATOR, aSep );
@@ -1139,7 +1143,7 @@ void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeIn
Reference< XTitle > XclImpChText::CreateTitle() const
{
Reference< XTitle > xTitle;
- if( mxSrcLink.is() && mxSrcLink->HasString() )
+ if( mxSrcLink && mxSrcLink->HasString() )
{
// create the formatted strings
Sequence< Reference< XFormattedString > > aStringSeq(
@@ -1233,24 +1237,27 @@ void XclImpChText::ReadChFrLabelProps( XclImpStream& rStrm )
namespace {
-void lclUpdateText( XclImpChTextRef& rxText, XclImpChTextRef xDefText )
+void lclUpdateText( XclImpChTextRef& rxText, const XclImpChText* xDefText )
{
- if( rxText.is() )
- rxText->UpdateText( xDefText.get() );
+ if( rxText )
+ rxText->UpdateText( xDefText );
else
- rxText = xDefText;
+ {
+ XclImpChTextRef xNew(new XclImpChText(*xDefText));
+ rxText = xNew;
+ }
}
-void lclFinalizeTitle( XclImpChTextRef& rxTitle, XclImpChTextRef xDefText, const String& rAutoTitle )
+void lclFinalizeTitle( XclImpChTextRef& rxTitle, const XclImpChText* pDefText, const String& rAutoTitle )
{
/* Do not update a title, if it is not visible (if rxTitle is null).
Existing reference indicates enabled title. */
- if( rxTitle.is() )
+ if( rxTitle )
{
if( !rxTitle->HasString() )
rxTitle->SetString( rAutoTitle );
if( rxTitle->HasString() )
- rxTitle->UpdateText( xDefText.get() );
+ rxTitle->UpdateText(pDefText);
else
rxTitle.reset();
}
@@ -1267,7 +1274,7 @@ void XclImpChMarkerFormat::ReadChMarkerFormat( XclImpStream& rStrm )
const XclImpRoot& rRoot = rStrm.GetRoot();
if( rRoot.GetBiff() == EXC_BIFF8 )
{
- // #116397# BIFF8: index into palette used instead of RGB data
+ // BIFF8: index into palette used instead of RGB data
const XclImpPalette& rPal = rRoot.GetPalette();
maData.maLineColor = rPal.GetColor( rStrm.ReaduInt16() );
maData.maFillColor = rPal.GetColor( rStrm.ReaduInt16() );
@@ -1368,13 +1375,13 @@ void XclImpChAttachedLabel::ReadChAttachedLabel( XclImpStream& rStrm )
rStrm >> mnFlags;
}
-XclImpChTextRef XclImpChAttachedLabel::CreateDataLabel( XclImpChTextRef xParent ) const
+XclImpChTextRef XclImpChAttachedLabel::CreateDataLabel( const XclImpChText* pParent ) const
{
const sal_uInt16 EXC_CHATTLABEL_SHOWANYVALUE = EXC_CHATTLABEL_SHOWVALUE;
const sal_uInt16 EXC_CHATTLABEL_SHOWANYPERCENT = EXC_CHATTLABEL_SHOWPERCENT | EXC_CHATTLABEL_SHOWCATEGPERC;
const sal_uInt16 EXC_CHATTLABEL_SHOWANYCATEG = EXC_CHATTLABEL_SHOWCATEG | EXC_CHATTLABEL_SHOWCATEGPERC;
- XclImpChTextRef xLabel( xParent.is() ? new XclImpChText( *xParent ) : new XclImpChText( GetChRoot() ) );
+ XclImpChTextRef xLabel( pParent ? new XclImpChText( *pParent ) : new XclImpChText( GetChRoot() ) );
xLabel->UpdateDataLabel(
::get_flag( mnFlags, EXC_CHATTLABEL_SHOWANYCATEG ),
::get_flag( mnFlags, EXC_CHATTLABEL_SHOWANYVALUE ),
@@ -1524,18 +1531,18 @@ void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeIn
ConvertFrameBase( GetChRoot(), rPropSet, rTypeInfo.GetSeriesObjectType(), maData.mnFormatIdx );
#if EXC_CHART2_3DBAR_HAIRLINES_ONLY
// #i83151# only hair lines in 3D charts with filled data points
- if( rTypeInfo.mb3dChart && rTypeInfo.IsSeriesFrameFormat() && mxLineFmt.is() && mxLineFmt->HasLine() )
+ if( rTypeInfo.mb3dChart && rTypeInfo.IsSeriesFrameFormat() && mxLineFmt && mxLineFmt->HasLine() )
rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "BorderWidth" ), 0 );
#endif
// other formatting
- if( mxMarkerFmt.is() )
+ if( mxMarkerFmt )
mxMarkerFmt->Convert( GetChRoot(), rPropSet, maData.mnFormatIdx, GetLineWeight() );
- if( mxPieFmt.is() )
+ if( mxPieFmt )
mxPieFmt->Convert( rPropSet );
- if( mx3dDataFmt.is() )
+ if( mx3dDataFmt )
mx3dDataFmt->Convert( rPropSet );
- if( mxLabel.is() )
+ if( mxLabel )
mxLabel->ConvertDataLabel( rPropSet, rTypeInfo );
// 3D settings
@@ -1544,7 +1551,7 @@ void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeIn
/* Special case: set marker color as line color, if series line is not
visible. This makes the color visible in the marker area.
TODO: remove this if OOChart supports own colors in markers. */
- if( !rTypeInfo.IsSeriesFrameFormat() && !HasLine() && mxMarkerFmt.is() )
+ if( !rTypeInfo.IsSeriesFrameFormat() && !HasLine() && mxMarkerFmt )
mxMarkerFmt->ConvertColor( GetChRoot(), rPropSet, maData.mnFormatIdx );
}
@@ -1578,15 +1585,15 @@ void XclImpChDataFormat::UpdateDataLabel( const XclImpChDataFormat* pParentFmt )
group, the contents of the CHATTACHEDLABEL record are used. In this
case a new CHTEXT group is created and filled with the settings from
the CHATTACHEDLABEL record. */
- XclImpChTextRef xDefText;
- if( pParentFmt )
- xDefText = pParentFmt->GetDataLabel();
- if( !xDefText )
- xDefText = GetChartData().GetDefaultText( EXC_CHTEXTTYPE_DATALABEL );
- if( mxLabel.is() )
- mxLabel->UpdateText( xDefText.get() );
- else if( mxAttLabel.is() )
- mxLabel = mxAttLabel->CreateDataLabel( xDefText );
+ const XclImpChText* pDefText = NULL;
+ if (pParentFmt)
+ pDefText = pParentFmt->GetDataLabel();
+ if (!pDefText)
+ pDefText = GetChartData().GetDefaultText( EXC_CHTEXTTYPE_DATALABEL );
+ if (mxLabel)
+ mxLabel->UpdateText(pDefText);
+ else if (mxAttLabel)
+ mxLabel = mxAttLabel->CreateDataLabel( pDefText );
}
// ----------------------------------------------------------------------------
@@ -1633,7 +1640,7 @@ Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() cons
xRegCurve.set( ScfApiHelper::CreateInstance( aService ), UNO_QUERY );
// trend line formatting
- if( xRegCurve.is() && mxDataFmt.is() )
+ if( xRegCurve.is() && mxDataFmt )
{
ScfPropertySet aPropSet( xRegCurve );
mxDataFmt->ConvertLine( aPropSet, EXC_CHOBJTYPE_TRENDLINE );
@@ -1644,7 +1651,7 @@ Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() cons
aLabelProp.SetBoolProperty( EXC_CHPROP_SHOWCORRELATION, maData.mnShowRSquared != 0 );
// #i83100# formatting of the equation text box
- if( const XclImpChText* pLabel = mxDataFmt->GetDataLabel().get() )
+ if (const XclImpChText* pLabel = mxDataFmt->GetDataLabel())
{
pLabel->ConvertFont( aLabelProp );
pLabel->ConvertFrame( aLabelProp );
@@ -1755,7 +1762,7 @@ Reference< XPropertySet > XclImpChSerErrorBar::CreateErrorBar( const XclImpChSer
}
// error bar formatting
- if( pPrimaryBar->mxDataFmt.is() && xErrorBar.is() )
+ if( pPrimaryBar->mxDataFmt && xErrorBar.is() )
pPrimaryBar->mxDataFmt->ConvertLine( aBarProp, EXC_CHOBJTYPE_ERRORBAR );
}
@@ -1806,7 +1813,7 @@ void XclImpChSeries::ReadSubRecord( XclImpStream& rStrm )
void XclImpChSeries::SetDataFormat( XclImpChDataFormatRef xDataFmt )
{
- if( xDataFmt.is() )
+ if( xDataFmt )
{
XclImpChDataFormatRef* pxDataFmt = GetDataFormatRef( xDataFmt->GetPointPos().mnPointIdx );
// do not overwrite existing data format
@@ -1823,7 +1830,7 @@ void XclImpChSeries::SetDataFormat( XclImpChDataFormatRef xDataFmt )
void XclImpChSeries::SetDataLabel( XclImpChTextRef xLabel )
{
- if( xLabel.is() )
+ if( xLabel )
{
XclImpChTextRef* pxLabel = GetDataLabelRef( xLabel->GetPointPos().mnPointIdx );
if( pxLabel && !*pxLabel )
@@ -1852,10 +1859,14 @@ void XclImpChSeries::FinalizeDataFormats()
if( !mxSeriesFmt )
mxSeriesFmt = CreateDataFormat( EXC_CHDATAFORMAT_ALLPOINTS, 0 );
- if( mxSeriesFmt.is() )
+ if( mxSeriesFmt )
{
// #i83100# set text label format, e.g. for trend line equations
- mxSeriesFmt->SetDataLabel( maLabels.get( EXC_CHDATAFORMAT_ALLPOINTS ) );
+ XclImpChTextRef xLabel;
+ XclImpChTextMap::iterator itr = maLabels.find(EXC_CHDATAFORMAT_ALLPOINTS);
+ if (itr != maLabels.end())
+ xLabel = itr->second;
+ mxSeriesFmt->SetDataLabel(xLabel);
// create missing automatic formats
mxSeriesFmt->UpdateTrendLineFormat();
}
@@ -1890,7 +1901,7 @@ void XclImpChSeries::FinalizeDataFormats()
}
// update series format (copy missing formatting from group default format)
- if( mxSeriesFmt.is() )
+ if( mxSeriesFmt )
mxSeriesFmt->UpdateSeriesFormat( pTypeGroup->GetTypeInfo(), pTypeGroup->GetGroupFormat().get() );
// update data point formats (removes unchanged automatic formatting)
@@ -1972,7 +1983,7 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
// series formatting
ScfPropertySet aSeriesProp( xDataSeries );
- if( mxSeriesFmt.is() )
+ if( mxSeriesFmt )
mxSeriesFmt->Convert( aSeriesProp, rTypeInfo );
// trend lines
@@ -1994,7 +2005,7 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
aSeriesProp.SetBoolProperty( EXC_CHPROP_VARYCOLORSBY, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE );
#endif
// #i91271# always set area formatting for every point in pie/doughnut charts
- if( mxSeriesFmt.is() && ((bVarPointFmt && mxSeriesFmt->IsAutoArea()) || (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE)) )
+ if( mxSeriesFmt && ((bVarPointFmt && mxSeriesFmt->IsAutoArea()) || (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE)) )
{
for( sal_uInt16 nPointIdx = 0, nPointCount = mxValueLink->GetCellCount(); nPointIdx < nPointCount; ++nPointIdx )
{
@@ -2013,15 +2024,15 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
return xDataSeries;
}
-void XclImpChSeries::FillAllSourceLinks( ::std::vector< ScSharedTokenRef >& rTokens ) const
+void XclImpChSeries::FillAllSourceLinks( ::std::vector< ScTokenRef >& rTokens ) const
{
- if( mxValueLink.is() )
+ if( mxValueLink )
mxValueLink->FillSourceLink( rTokens );
- if( mxCategLink.is() )
+ if( mxCategLink )
mxCategLink->FillSourceLink( rTokens );
- if( mxTitleLink.is() )
+ if( mxTitleLink )
mxTitleLink->FillSourceLink( rTokens );
- if( mxBubbleLink.is() )
+ if( mxBubbleLink )
mxBubbleLink->FillSourceLink( rTokens );
}
@@ -2063,9 +2074,10 @@ void XclImpChSeries::ReadChSerTrendLine( XclImpStream& rStrm )
void XclImpChSeries::ReadChSerErrorBar( XclImpStream& rStrm )
{
- XclImpChSerErrorBarRef xErrorBar( new XclImpChSerErrorBar( GetChRoot() ) );
- xErrorBar->ReadChSerErrorBar( rStrm );
- maErrorBars[ xErrorBar->GetBarType() ] = xErrorBar;
+ auto_ptr<XclImpChSerErrorBar> pErrorBar(new XclImpChSerErrorBar(GetChRoot()));
+ pErrorBar->ReadChSerErrorBar(rStrm);
+ sal_uInt8 nBarType = pErrorBar->GetBarType();
+ maErrorBars.insert(nBarType, pErrorBar);
}
XclImpChDataFormatRef XclImpChSeries::CreateDataFormat( sal_uInt16 nPointIdx, sal_uInt16 nFormatIdx )
@@ -2079,15 +2091,34 @@ XclImpChDataFormatRef* XclImpChSeries::GetDataFormatRef( sal_uInt16 nPointIdx )
{
if( nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS )
return &mxSeriesFmt;
- if( nPointIdx < EXC_CHDATAFORMAT_MAXPOINTCOUNT )
- return &maPointFmts[ nPointIdx ];
+
+ if (nPointIdx < EXC_CHDATAFORMAT_MAXPOINTCOUNT)
+ {
+ XclImpChDataFormatMap::iterator itr = maPointFmts.lower_bound(nPointIdx);
+ if (itr == maPointFmts.end() || maPointFmts.key_comp()(nPointIdx, itr->first))
+ {
+ // No object exists at this point index position. Insert a new one.
+ XclImpChDataFormatRef p(new XclImpChDataFormat(GetChRoot()));
+ itr = maPointFmts.insert(itr, XclImpChDataFormatMap::value_type(nPointIdx, p));
+ }
+ return &itr->second;
+ }
return 0;
}
XclImpChTextRef* XclImpChSeries::GetDataLabelRef( sal_uInt16 nPointIdx )
{
- if( (nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS) || (nPointIdx < EXC_CHDATAFORMAT_MAXPOINTCOUNT) )
- return &maLabels[ nPointIdx ];
+ if ((nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS) || (nPointIdx < EXC_CHDATAFORMAT_MAXPOINTCOUNT))
+ {
+ XclImpChTextMap::iterator itr = maLabels.lower_bound(nPointIdx);
+ if (itr == maLabels.end() || maLabels.key_comp()(nPointIdx, itr->first))
+ {
+ // No object exists at this point index position. Insert a new one.
+ XclImpChTextRef p(new XclImpChText(GetChRoot()));
+ itr = maLabels.insert(itr, XclImpChTextMap::value_type(nPointIdx, p));
+ }
+ return &itr->second;
+ }
return 0;
}
@@ -2114,7 +2145,13 @@ void XclImpChSeries::ConvertTrendLines( Reference< XDataSeries > xDataSeries ) c
Reference< XPropertySet > XclImpChSeries::CreateErrorBar( sal_uInt8 nPosBarId, sal_uInt8 nNegBarId ) const
{
- return XclImpChSerErrorBar::CreateErrorBar( maErrorBars.get( nPosBarId ).get(), maErrorBars.get( nNegBarId ).get() );
+ XclImpChSerErrorBarMap::const_iterator itrPosBar = maErrorBars.find(nPosBarId);
+ XclImpChSerErrorBarMap::const_iterator itrNegBar = maErrorBars.find(nNegBarId);
+ XclImpChSerErrorBarMap::const_iterator itrEnd = maErrorBars.end();
+ if (itrPosBar == itrEnd || itrNegBar == itrEnd)
+ return Reference<XPropertySet>();
+
+ return XclImpChSerErrorBar::CreateErrorBar(itrPosBar->second, itrNegBar->second);
}
// Chart type groups ==========================================================
@@ -2469,10 +2506,10 @@ Reference< XLegend > XclImpChLegend::CreateLegend() const
aLegendProp.SetBoolProperty( EXC_CHPROP_SHOW, true );
// frame properties
- if( mxFrame.is() )
+ if( mxFrame )
mxFrame->Convert( aLegendProp );
// text properties
- if( mxText.is() )
+ if( mxText )
mxText->ConvertFont( aLegendProp );
/* Legend position and size. Default positions are used only if the
@@ -2506,7 +2543,7 @@ Reference< XLegend > XclImpChLegend::CreateLegend() const
// no automatic position/size: try to find the correct position and size
if( eApiPos == cssc2::LegendPosition_CUSTOM )
{
- const XclChFramePos* pFramePos = mxFramePos.is() ? &mxFramePos->GetFramePosData() : 0;
+ const XclChFramePos* pFramePos = mxFramePos ? &mxFramePos->GetFramePosData() : 0;
/* Legend position. Only the settings from the CHFRAMEPOS record
are used by Excel, the position in the CHLEGEND record will be
@@ -2632,20 +2669,20 @@ void XclImpChTypeGroup::Finalize()
maType.Finalize( bStockChart );
// extended type info
- maTypeInfo.Set( maType.GetTypeInfo(), mxChart3d.is(), false );
+ maTypeInfo.Set( maType.GetTypeInfo(), mxChart3d, false );
// reverse series order for some unstacked 2D chart types
if( maTypeInfo.mbReverseSeries && !Is3dChart() && !maType.IsStacked() && !maType.IsPercent() )
::std::reverse( maSeries.begin(), maSeries.end() );
// update chart type group format, may depend on chart type finalized above
- if( mxGroupFmt.is() )
+ if( mxGroupFmt )
mxGroupFmt->UpdateGroupFormat( maTypeInfo );
}
void XclImpChTypeGroup::AddSeries( XclImpChSeriesRef xSeries )
{
- if( xSeries.is() )
+ if( xSeries )
maSeries.push_back( xSeries );
// store first inserted series separately, series order may be reversed later
if( !mxFirstSeries )
@@ -2676,22 +2713,23 @@ bool XclImpChTypeGroup::HasVarPointFormat() const
bool XclImpChTypeGroup::HasConnectorLines() const
{
// existence of connector lines (only in stacked bar charts)
- bool bAnyStacked = maType.IsStacked() || maType.IsPercent();
- XclImpChLineFormatRef xConnLine = maChartLines.get( EXC_CHCHARTLINE_CONNECT );
- return bAnyStacked && (maTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR) && xConnLine.is() && xConnLine->HasLine();
+ if ( !(maType.IsStacked() || maType.IsPercent()) || (maTypeInfo.meTypeCateg != EXC_CHTYPECATEG_BAR) )
+ return false;
+ XclImpChLineFormatMap::const_iterator xConLine = maChartLines.find( EXC_CHCHARTLINE_CONNECT );
+ return ( xConLine != maChartLines.end() && xConLine->second->HasLine() );
}
const String& XclImpChTypeGroup::GetSingleSeriesTitle() const
{
// no automatic title for series with trendlines or error bars
// pie charts always show an automatic title, even if more series exist
- return (mxFirstSeries.is() && !mxFirstSeries->HasChildSeries() && (maTypeInfo.mbSingleSeriesVis || (maSeries.size() == 1))) ?
+ return (mxFirstSeries && !mxFirstSeries->HasChildSeries() && (maTypeInfo.mbSingleSeriesVis || (maSeries.size() == 1))) ?
mxFirstSeries->GetTitle() : String::EmptyString();
}
void XclImpChTypeGroup::ConvertChart3d( ScfPropertySet& rPropSet ) const
{
- if( mxChart3d.is() )
+ if( mxChart3d )
mxChart3d->Convert( rPropSet, Is3dWallChart() );
}
@@ -2728,24 +2766,24 @@ Reference< XLabeledDataSequence > XclImpChTypeGroup::CreateCategSequence() const
{
Reference< XLabeledDataSequence > xLabeledSeq;
// create category sequence from first visible series
- if( mxFirstSeries.is() )
+ if( mxFirstSeries )
xLabeledSeq = mxFirstSeries->CreateCategSequence( EXC_CHPROP_ROLE_CATEG );
return xLabeledSeq;
}
void XclImpChTypeGroup::ReadChDropBar( XclImpStream& rStrm )
{
- sal_uInt16 nDropBar = EXC_CHDROPBAR_NONE;
- if( !maDropBars.has( EXC_CHDROPBAR_UP ) )
- nDropBar = EXC_CHDROPBAR_UP;
- else if( !maDropBars.has( EXC_CHDROPBAR_DOWN ) )
- nDropBar = EXC_CHDROPBAR_DOWN;
-
- if( nDropBar != EXC_CHDROPBAR_NONE )
+ if (maDropBars.find(EXC_CHDROPBAR_UP) == maDropBars.end())
{
- XclImpChDropBarRef xDropBar( new XclImpChDropBar( nDropBar ) );
- xDropBar->ReadRecordGroup( rStrm );
- maDropBars[ nDropBar ] = xDropBar;
+ auto_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_UP));
+ p->ReadRecordGroup(rStrm);
+ maDropBars.insert(EXC_CHDROPBAR_UP, p);
+ }
+ else if(maDropBars.find(EXC_CHDROPBAR_DOWN) == maDropBars.end())
+ {
+ auto_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_DOWN));
+ p->ReadRecordGroup(rStrm);
+ maDropBars.insert(EXC_CHDROPBAR_DOWN, p);
}
}
@@ -2754,8 +2792,8 @@ void XclImpChTypeGroup::ReadChChartLine( XclImpStream& rStrm )
sal_uInt16 nLineId = rStrm.ReaduInt16();
if( (rStrm.GetNextRecId() == EXC_ID_CHLINEFORMAT) && rStrm.StartNextRecord() )
{
- XclImpChLineFormatRef xLineFmt( new XclImpChLineFormat );
- xLineFmt->ReadChLineFormat( rStrm );
+ XclImpChLineFormat xLineFmt;
+ xLineFmt.ReadChLineFormat( rStrm );
maChartLines[ nLineId ] = xLineFmt;
}
}
@@ -2857,27 +2895,27 @@ void XclImpChTypeGroup::CreateStockSeries( Reference< XChartType > xChartType, s
aTypeProp.SetBoolProperty( EXC_CHPROP_SHOWFIRST, HasDropBars() );
aTypeProp.SetBoolProperty( EXC_CHPROP_SHOWHIGHLOW, true );
// hi-lo line format
- XclImpChLineFormatRef xHiLoLine = maChartLines.get( EXC_CHCHARTLINE_HILO );
- if( xHiLoLine.is() )
+ XclImpChLineFormatMap::const_iterator xHiLoLine = maChartLines.find( EXC_CHCHARTLINE_HILO );
+ if ( xHiLoLine != maChartLines.end() )
{
ScfPropertySet aSeriesProp( xDataSeries );
- xHiLoLine->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE );
+ xHiLoLine->second->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE );
}
// white dropbar format
- XclImpChDropBarRef xUpBar = maDropBars.get( EXC_CHDROPBAR_UP );
- Reference< XPropertySet > xWhitePropSet;
- if( xUpBar.is() && aTypeProp.GetProperty( xWhitePropSet, EXC_CHPROP_WHITEDAY ) )
+ XclImpChDropBarMap::const_iterator itr = maDropBars.find(EXC_CHDROPBAR_UP);
+ Reference<XPropertySet> xWhitePropSet;
+ if (itr != maDropBars.end() && aTypeProp.GetProperty(xWhitePropSet, EXC_CHPROP_WHITEDAY))
{
ScfPropertySet aBarProp( xWhitePropSet );
- xUpBar->Convert( GetChRoot(), aBarProp );
+ itr->second->Convert(GetChRoot(), aBarProp);
}
// black dropbar format
- XclImpChDropBarRef xDownBar = maDropBars.get( EXC_CHDROPBAR_DOWN );
- Reference< XPropertySet > xBlackPropSet;
- if( xDownBar.is() && aTypeProp.GetProperty( xBlackPropSet, EXC_CHPROP_BLACKDAY ) )
+ itr = maDropBars.find(EXC_CHDROPBAR_DOWN);
+ Reference<XPropertySet> xBlackPropSet;
+ if (itr != maDropBars.end() && aTypeProp.GetProperty(xBlackPropSet, EXC_CHPROP_BLACKDAY))
{
ScfPropertySet aBarProp( xBlackPropSet );
- xDownBar->Convert( GetChRoot(), aBarProp );
+ itr->second->Convert(GetChRoot(), aBarProp);
}
// insert the series into the chart type object
@@ -3103,7 +3141,7 @@ void XclImpChTick::ReadChTick( XclImpStream& rStrm )
if( GetBiff() == EXC_BIFF8 )
{
- // #116397# BIFF8: index into palette used instead of RGB data
+ // BIFF8: index into palette used instead of RGB data
maData.maTextColor = GetPalette().GetColor( rStrm.ReaduInt16() );
// rotation
rStrm >> maData.mnRotation;
@@ -3190,9 +3228,9 @@ void XclImpChAxis::Finalize()
if( !mxValueRange )
mxValueRange.reset( new XclImpChValueRange( GetChRoot() ) );
// remove invisible grid lines completely
- if( mxMajorGrid.is() && !mxMajorGrid->HasLine() )
+ if( mxMajorGrid && !mxMajorGrid->HasLine() )
mxMajorGrid.reset();
- if( mxMinorGrid.is() && !mxMinorGrid->HasLine() )
+ if( mxMinorGrid && !mxMinorGrid->HasLine() )
mxMinorGrid.reset();
// default tick settings different in OOChart and Excel
if( !mxTick )
@@ -3212,17 +3250,17 @@ void XclImpChAxis::Finalize()
sal_uInt16 XclImpChAxis::GetFontIndex() const
{
- return mxFont.is() ? mxFont->GetFontIndex() : EXC_FONT_NOTFOUND;
+ return mxFont ? mxFont->GetFontIndex() : EXC_FONT_NOTFOUND;
}
Color XclImpChAxis::GetFontColor() const
{
- return mxTick.is() ? mxTick->GetFontColor() : GetFontAutoColor();
+ return mxTick ? mxTick->GetFontColor() : GetFontAutoColor();
}
sal_uInt16 XclImpChAxis::GetRotation() const
{
- return mxTick.is() ? mxTick->GetRotation() : EXC_CHART_AUTOROTATION;
+ return mxTick ? mxTick->GetRotation() : EXC_CHART_AUTOROTATION;
}
Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup, const XclImpChAxis* pCrossingAxis ) const
@@ -3236,10 +3274,10 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
aAxisProp.SetBoolProperty( EXC_CHPROP_SHOW, IsActivated() );
// axis line properties
- if( mxAxisLine.is() )
+ if( mxAxisLine )
mxAxisLine->Convert( GetChRoot(), aAxisProp, EXC_CHOBJTYPE_AXISLINE );
// axis ticks properties
- if( mxTick.is() )
+ if( mxTick )
mxTick->Convert( aAxisProp );
// axis caption text --------------------------------------------------
@@ -3251,9 +3289,9 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
if( bHasLabels )
{
// font settings from CHFONT record or from default text
- if( mxFont.is() )
+ if( mxFont )
ConvertFontBase( GetChRoot(), aAxisProp );
- else if( const XclImpChText* pDefText = GetChartData().GetDefaultText( EXC_CHTEXTTYPE_AXISLABEL ).get() )
+ else if( const XclImpChText* pDefText = GetChartData().GetDefaultText( EXC_CHTEXTTYPE_AXISLABEL ) )
pDefText->ConvertFont( aAxisProp );
// label text rotation
ConvertRotationBase( GetChRoot(), aAxisProp, true );
@@ -3316,7 +3354,7 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
// main grid
ScfPropertySet aGridProp( xAxis->getGridProperties() );
aGridProp.SetBoolProperty( EXC_CHPROP_SHOW, HasMajorGrid() );
- if( mxMajorGrid.is() )
+ if( mxMajorGrid )
mxMajorGrid->Convert( GetChRoot(), aGridProp, EXC_CHOBJTYPE_GRIDLINE );
// sub grid
Sequence< Reference< XPropertySet > > aSubGridPropSeq = xAxis->getSubGridProperties();
@@ -3324,7 +3362,7 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
{
ScfPropertySet aSubGridProp( aSubGridPropSeq[ 0 ] );
aSubGridProp.SetBoolProperty( EXC_CHPROP_SHOW, HasMinorGrid() );
- if( mxMinorGrid.is() )
+ if( mxMinorGrid )
mxMinorGrid->Convert( GetChRoot(), aSubGridProp, EXC_CHOBJTYPE_GRIDLINE );
}
@@ -3338,7 +3376,7 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
void XclImpChAxis::ConvertWall( ScfPropertySet& rPropSet ) const
{
- if( mxWallFrame.is() )
+ if( mxWallFrame )
mxWallFrame->Convert( rPropSet );
}
@@ -3379,7 +3417,7 @@ void XclImpChAxis::ReadChAxisLine( XclImpStream& rStrm )
pxLineFmt->reset( new XclImpChLineFormat );
(*pxLineFmt)->ReadChLineFormat( rStrm );
}
- else if( bWallFrame && mxWallFrame.is() )
+ else if( bWallFrame && mxWallFrame )
{
mxWallFrame->ReadSubRecord( rStrm );
}
@@ -3449,7 +3487,8 @@ void XclImpChAxesSet::Finalize()
XclImpChTypeGroupRef xTypeGroup = aIt->second;
xTypeGroup->Finalize();
if( xTypeGroup->IsValidGroup() )
- aValidGroups[ aIt->first ] = xTypeGroup;
+ aValidGroups.insert(
+ XclImpChTypeGroupMap::value_type(aIt->first, xTypeGroup));
}
maTypeGroups.swap( aValidGroups );
}
@@ -3466,16 +3505,16 @@ void XclImpChAxesSet::Finalize()
mxZAxis.reset( new XclImpChAxis( GetChRoot(), EXC_CHAXIS_Z ) );
// finalize axes
- if( mxXAxis.is() ) mxXAxis->Finalize();
- if( mxYAxis.is() ) mxYAxis->Finalize();
- if( mxZAxis.is() ) mxZAxis->Finalize();
+ if( mxXAxis ) mxXAxis->Finalize();
+ if( mxYAxis ) mxYAxis->Finalize();
+ if( mxZAxis ) mxZAxis->Finalize();
// finalize axis titles
- XclImpChTextRef xDefText = GetChartData().GetDefaultText( EXC_CHTEXTTYPE_AXISTITLE );
+ const XclImpChText* pDefText = GetChartData().GetDefaultText( EXC_CHTEXTTYPE_AXISTITLE );
String aAutoTitle = CREATE_STRING( "Axis Title" );
- lclFinalizeTitle( mxXAxisTitle, xDefText, aAutoTitle );
- lclFinalizeTitle( mxYAxisTitle, xDefText, aAutoTitle );
- lclFinalizeTitle( mxZAxisTitle, xDefText, aAutoTitle );
+ lclFinalizeTitle( mxXAxisTitle, pDefText, aAutoTitle );
+ lclFinalizeTitle( mxYAxisTitle, pDefText, aAutoTitle );
+ lclFinalizeTitle( mxZAxisTitle, pDefText, aAutoTitle );
// #i47745# missing plot frame -> invisible border and area
if( !mxPlotFrame )
@@ -3483,6 +3522,12 @@ void XclImpChAxesSet::Finalize()
}
}
+XclImpChTypeGroupRef XclImpChAxesSet::GetTypeGroup( sal_uInt16 nGroupIdx ) const
+{
+ XclImpChTypeGroupMap::const_iterator itr = maTypeGroups.find(nGroupIdx);
+ return itr == maTypeGroups.end() ? XclImpChTypeGroupRef() : itr->second;
+}
+
XclImpChTypeGroupRef XclImpChAxesSet::GetFirstTypeGroup() const
{
XclImpChTypeGroupRef xTypeGroup;
@@ -3539,11 +3584,11 @@ void XclImpChAxesSet::Convert( Reference< XDiagram > xDiagram ) const
void XclImpChAxesSet::ConvertTitlePositions() const
{
- if( mxXAxisTitle.is() )
+ if( mxXAxisTitle )
mxXAxisTitle->ConvertTitlePosition( XclChTextKey( EXC_CHTEXTTYPE_AXISTITLE, maData.mnAxesSetId, EXC_CHAXIS_X ) );
- if( mxYAxisTitle.is() )
+ if( mxYAxisTitle )
mxYAxisTitle->ConvertTitlePosition( XclChTextKey( EXC_CHTEXTTYPE_AXISTITLE, maData.mnAxesSetId, EXC_CHAXIS_Y ) );
- if( mxZAxisTitle.is() )
+ if( mxZAxisTitle )
mxZAxisTitle->ConvertTitlePosition( XclChTextKey( EXC_CHTEXTTYPE_AXISTITLE, maData.mnAxesSetId, EXC_CHAXIS_Z ) );
}
@@ -3586,7 +3631,14 @@ void XclImpChAxesSet::ReadChTypeGroup( XclImpStream& rStrm )
{
XclImpChTypeGroupRef xTypeGroup( new XclImpChTypeGroup( GetChRoot() ) );
xTypeGroup->ReadRecordGroup( rStrm );
- maTypeGroups[ xTypeGroup->GetGroupIdx() ] = xTypeGroup;
+ sal_uInt16 nGroupIdx = xTypeGroup->GetGroupIdx();
+ XclImpChTypeGroupMap::iterator itr = maTypeGroups.lower_bound(nGroupIdx);
+ if (itr != maTypeGroups.end() && !maTypeGroups.key_comp()(nGroupIdx, itr->first))
+ // Overwrite the existing element.
+ itr->second = xTypeGroup;
+ else
+ maTypeGroups.insert(
+ itr, XclImpChTypeGroupMap::value_type(nGroupIdx, xTypeGroup));
}
Reference< XCoordinateSystem > XclImpChAxesSet::CreateCoordSystem( Reference< XDiagram > xDiagram ) const
@@ -3609,7 +3661,7 @@ Reference< XCoordinateSystem > XclImpChAxesSet::CreateCoordSystem( Reference< XD
if( !xCoordSystem.is() )
{
XclImpChTypeGroupRef xTypeGroup = GetFirstTypeGroup();
- if( xTypeGroup.is() )
+ if( xTypeGroup )
{
xCoordSystem = xTypeGroup->CreateCoordSystem();
// convert 3d chart settings
@@ -3646,14 +3698,14 @@ void XclImpChAxesSet::ConvertAxis(
XclImpChAxisRef xChAxis, XclImpChTextRef xChAxisTitle,
Reference< XCoordinateSystem > xCoordSystem, const XclImpChAxis* pCrossingAxis ) const
{
- if( xChAxis.is() )
+ if( xChAxis )
{
// create and attach the axis object
Reference< XAxis > xAxis = CreateAxis( *xChAxis, pCrossingAxis );
if( xAxis.is() )
{
// create and attach the axis title
- if( xChAxisTitle.is() ) try
+ if( xChAxisTitle ) try
{
Reference< XTitled > xTitled( xAxis, UNO_QUERY_THROW );
Reference< XTitle > xTitle( xChAxisTitle->CreateTitle(), UNO_SET_THROW );
@@ -3690,21 +3742,21 @@ Reference< XAxis > XclImpChAxesSet::CreateAxis( const XclImpChAxis& rChAxis, con
void XclImpChAxesSet::ConvertBackground( Reference< XDiagram > xDiagram ) const
{
XclImpChTypeGroupRef xTypeGroup = GetFirstTypeGroup();
- if( xTypeGroup.is() && xTypeGroup->Is3dWallChart() )
+ if( xTypeGroup && xTypeGroup->Is3dWallChart() )
{
// wall/floor formatting (3D charts)
- if( mxXAxis.is() )
+ if( mxXAxis )
{
ScfPropertySet aWallProp( xDiagram->getWall() );
mxXAxis->ConvertWall( aWallProp );
}
- if( mxYAxis.is() )
+ if( mxYAxis )
{
ScfPropertySet aFloorProp( xDiagram->getFloor() );
mxYAxis->ConvertWall( aFloorProp );
}
}
- else if( mxPlotFrame.is() )
+ else if( mxPlotFrame )
{
// diagram background formatting
ScfPropertySet aWallProp( xDiagram->getWall() );
@@ -3765,9 +3817,9 @@ void XclImpChChart::ReadChDefaultText( XclImpStream& rStrm )
sal_uInt16 nTextId = rStrm.ReaduInt16();
if( (rStrm.GetNextRecId() == EXC_ID_CHTEXT) && rStrm.StartNextRecord() )
{
- XclImpChTextRef xText( new XclImpChText( GetChRoot() ) );
- xText->ReadRecordGroup( rStrm );
- maDefTexts[ nTextId ] = xText;
+ auto_ptr<XclImpChText> pText(new XclImpChText(GetChRoot()));
+ pText->ReadRecordGroup(rStrm);
+ maDefTexts.insert(nTextId, pText);
}
}
@@ -3777,11 +3829,15 @@ void XclImpChChart::ReadChDataFormat( XclImpStream& rStrm )
xDataFmt->ReadRecordGroup( rStrm );
if( xDataFmt->GetPointPos().mnSeriesIdx <= EXC_CHSERIES_MAXSERIES )
{
- XclImpChDataFormatRef& rxMapFmt = maDataFmts[ xDataFmt->GetPointPos() ];
+ const XclChDataPointPos& rPos = xDataFmt->GetPointPos();
+ XclImpChDataFormatMap::iterator itr = maDataFmts.lower_bound(rPos);
+ if (itr == maDataFmts.end() || maDataFmts.key_comp()(rPos, itr->first))
+ // No element exists for this data point. Insert it.
+ maDataFmts.insert(
+ itr, XclImpChDataFormatMap::value_type(rPos, xDataFmt));
+
/* Do not overwrite existing data format group, Excel always uses the
first data format group occuring in any CHSERIES group. */
- if( !rxMapFmt )
- rxMapFmt = xDataFmt;
}
}
@@ -3800,7 +3856,7 @@ XclImpChTypeGroupRef XclImpChChart::GetTypeGroup( sal_uInt16 nGroupIdx ) const
return xTypeGroup;
}
-XclImpChTextRef XclImpChChart::GetDefaultText( XclChTextType eTextType ) const
+const XclImpChText* XclImpChChart::GetDefaultText( XclChTextType eTextType ) const
{
sal_uInt16 nDefTextId = EXC_CHDEFTEXT_GLOBAL;
bool bBiff8 = GetBiff() == EXC_BIFF8;
@@ -3812,7 +3868,9 @@ XclImpChTextRef XclImpChChart::GetDefaultText( XclChTextType eTextType ) const
case EXC_CHTEXTTYPE_AXISLABEL: nDefTextId = bBiff8 ? EXC_CHDEFTEXT_AXESSET : EXC_CHDEFTEXT_GLOBAL; break;
case EXC_CHTEXTTYPE_DATALABEL: nDefTextId = bBiff8 ? EXC_CHDEFTEXT_AXESSET : EXC_CHDEFTEXT_GLOBAL; break;
}
- return maDefTexts.get( nDefTextId );
+
+ XclImpChTextMap::const_iterator itr = maDefTexts.find(nDefTextId);
+ return itr == maDefTexts.end() ? NULL : itr->second;
}
bool XclImpChChart::IsManualPlotArea() const
@@ -3828,14 +3886,14 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc,
InitConversion( xChartDoc, rChartRect );
// chart frame formatting
- if( mxFrame.is() )
+ if( mxFrame )
{
ScfPropertySet aFrameProp( xChartDoc->getPageBackground() );
mxFrame->Convert( aFrameProp );
}
// chart title
- if( mxTitle.is() ) try
+ if( mxTitle ) try
{
Reference< XTitled > xTitled( xChartDoc, UNO_QUERY_THROW );
Reference< XTitle > xTitle( mxTitle->CreateTitle(), UNO_SET_THROW );
@@ -3855,7 +3913,7 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc,
mxSecnAxesSet->Convert( xDiagram );
// legend
- if( xDiagram.is() && mxLegend.is() )
+ if( xDiagram.is() && mxLegend )
xDiagram->setLegend( mxLegend->CreateLegend() );
/* Following all conversions needing the old Chart1 API that involves full
@@ -3874,7 +3932,7 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc,
// plot area position and size (there is no real automatic mode in BIFF5 charts)
XclImpChFramePosRef xPlotAreaPos = mxPrimAxesSet->GetPlotAreaFramePos();
- if( IsManualPlotArea() && xPlotAreaPos.is() ) try
+ if( IsManualPlotArea() && xPlotAreaPos ) try
{
const XclChFramePos& rFramePos = xPlotAreaPos->GetFramePosData();
if( (rFramePos.mnTLMode == EXC_CHFRAMEPOS_PARENT) && (rFramePos.mnBRMode == EXC_CHFRAMEPOS_PARENT) )
@@ -3896,7 +3954,7 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc,
}
// positions of all title objects
- if( mxTitle.is() )
+ if( mxTitle )
mxTitle->ConvertTitlePosition( XclChTextKey( EXC_CHTEXTTYPE_TITLE ) );
mxPrimAxesSet->ConvertTitlePositions();
mxSecnAxesSet->ConvertTitlePositions();
@@ -3909,7 +3967,7 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc,
ScDocument& rDoc = GetRoot().GetDoc();
if( ScChartListenerCollection* pChartCollection = rDoc.GetChartListenerCollection() )
{
- ::std::auto_ptr< ::std::vector< ScSharedTokenRef > > xRefTokens( new ::std::vector< ScSharedTokenRef > );
+ ::std::auto_ptr< ::std::vector< ScTokenRef > > xRefTokens( new ::std::vector< ScTokenRef > );
for( XclImpChSeriesVec::const_iterator aIt = maSeries.begin(), aEnd = maSeries.end(); aIt != aEnd; ++aIt )
(*aIt)->FillAllSourceLinks( *xRefTokens );
if( !xRefTokens->empty() )
@@ -3973,7 +4031,7 @@ void XclImpChChart::Finalize()
mxLegend = mxPrimAxesSet->GetLegend();
if( !mxLegend )
mxLegend = mxSecnAxesSet->GetLegend();
- if( mxLegend.is() )
+ if( mxLegend )
mxLegend->Finalize();
// axes sets, updates chart type group default formats -> must be called before FinalizeDataFormats()
mxPrimAxesSet->Finalize();
@@ -4041,7 +4099,7 @@ void XclImpChChart::FinalizeTitle()
// automatic title from first series name (if there are no series on secondary axes set)
if( !mxSecnAxesSet->IsValidAxesSet() )
aAutoTitle = mxPrimAxesSet->GetSingleSeriesTitle();
- if( mxTitle.is() || (aAutoTitle.Len() > 0) )
+ if( mxTitle || (aAutoTitle.Len() > 0) )
{
if( !mxTitle )
mxTitle.reset( new XclImpChText( GetChRoot() ) );
@@ -4240,8 +4298,8 @@ void XclImpChart::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjF
sal_Size XclImpChart::GetProgressSize() const
{
return
- (mxChartData.is() ? mxChartData->GetProgressSize() : 0) +
- (mxChartDrawing.is() ? mxChartDrawing->GetProgressSize() : 0);
+ (mxChartData ? mxChartData->GetProgressSize() : 0) +
+ (mxChartDrawing ? mxChartDrawing->GetProgressSize() : 0);
}
void XclImpChart::Convert( Reference< XModel > xModel, XclImpDffConverter& rDffConv, const OUString& rObjName, const Rectangle& rChartRect ) const
@@ -4249,9 +4307,9 @@ void XclImpChart::Convert( Reference< XModel > xModel, XclImpDffConverter& rDffC
Reference< XChartDocument > xChartDoc( xModel, UNO_QUERY );
if( xChartDoc.is() )
{
- if( mxChartData.is() )
+ if( mxChartData )
mxChartData->Convert( xChartDoc, rDffConv, rObjName, rChartRect );
- if( mxChartDrawing.is() )
+ if( mxChartDrawing )
mxChartDrawing->ConvertObjects( rDffConv, xModel, rChartRect );
}
}
@@ -4271,3 +4329,4 @@ void XclImpChart::ReadChChart( XclImpStream& rStrm )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 1e3e847385b6..40a3e7ab9d23 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -212,23 +213,6 @@ void lclInsertUrl( const XclImpRoot& rRoot, const String& rUrl, SCCOL nScCol, SC
}
break;
- // fix for #i31050# disabled, HYPERLINK is not able to return numeric value (#i91351#)
-#if 0
- case CELLTYPE_VALUE:
- {
- // #i31050# replace number with HYPERLINK function
- ScTokenArray aTokenArray;
- aTokenArray.AddOpCode( ocHyperLink );
- aTokenArray.AddOpCode( ocOpen );
- aTokenArray.AddString( rUrl );
- aTokenArray.AddOpCode( ocSep );
- aTokenArray.AddDouble( rDoc.GetValue( aScPos ) );
- aTokenArray.AddOpCode( ocClose );
- rDoc.PutCell( aScPos, new ScFormulaCell( &rDoc, aScPos, &aTokenArray ) );
- }
- break;
-#endif
-
default:;
}
}
@@ -264,7 +248,6 @@ String XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm )
DBG_ASSERT( aGuid == XclTools::maGuidStdLink, "XclImpHyperlink::ReadEmbeddedData - unknown header GUID" );
- sal_uInt16 nLevel = 0; // counter for level to climb down in path
::std::auto_ptr< String > xLongName; // link / file name
::std::auto_ptr< String > xShortName; // 8.3-representation of file name
::std::auto_ptr< String > xTextMark; // text mark
@@ -294,6 +277,7 @@ String XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm )
if( aGuid == XclTools::maGuidFileMoniker )
{
+ sal_uInt16 nLevel = 0; // counter for level to climb down in path
rStrm >> nLevel;
xShortName.reset( new String );
lclAppendString32( *xShortName, rStrm, false );
@@ -454,8 +438,9 @@ void XclImpLabelranges::ReadLabelranges( XclImpStream& rStrm )
ScRangeList aRowScRanges;
rAddrConv.ConvertRangeList( aRowScRanges, aRowXclRanges, nScTab, false );
xLabelRangesRef = rDoc.GetRowNameRangesRef();
- for( pScRange = aRowScRanges.First(); pScRange; pScRange = aRowScRanges.Next() )
+ for ( size_t i = 0, nRanges = aRowScRanges.size(); i < nRanges; ++i )
{
+ pScRange = aRowScRanges[ i ];
ScRange aDataRange( *pScRange );
if( aDataRange.aEnd.Col() < MAXCOL )
{
@@ -474,8 +459,10 @@ void XclImpLabelranges::ReadLabelranges( XclImpStream& rStrm )
ScRangeList aColScRanges;
rAddrConv.ConvertRangeList( aColScRanges, aColXclRanges, nScTab, false );
xLabelRangesRef = rDoc.GetColNameRangesRef();
- for( pScRange = aColScRanges.First(); pScRange; pScRange = aColScRanges.Next() )
+
+ for ( size_t i = 0, nRanges = aColScRanges.size(); i < nRanges; ++i )
{
+ pScRange = aColScRanges[ i ];
ScRange aDataRange( *pScRange );
if( aDataRange.aEnd.Row() < MAXROW )
{
@@ -524,7 +511,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
}
// entire conditional format outside of valid range?
- if( !maRanges.Count() )
+ if( maRanges.empty() )
return;
sal_uInt8 nType, nOperator;
@@ -610,7 +597,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
// *** formulas ***
- const ScAddress& rPos = maRanges.GetObject( 0 )->aStart; // assured above that maRanges is not empty
+ const ScAddress& rPos = maRanges.front()->aStart; // assured above that maRanges is not empty
ExcelToSc& rFmlaConv = GetOldFmlaConverter();
::std::auto_ptr< ScTokenArray > xTokArr1;
@@ -659,8 +646,9 @@ void XclImpCondFormat::Apply()
aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nKey ) );
// maRanges contains only valid cell ranges
- for( const ScRange* pScRange = maRanges.First(); pScRange; pScRange = maRanges.Next() )
+ for ( size_t i = 0, nRanges = maRanges.size(); i < nRanges; ++i )
{
+ const ScRange* pScRange = maRanges[ i ];
rDoc.ApplyPatternAreaTab(
pScRange->aStart.Col(), pScRange->aStart.Row(),
pScRange->aEnd.Col(), pScRange->aEnd.Row(),
@@ -678,28 +666,36 @@ XclImpCondFormatManager::XclImpCondFormatManager( const XclImpRoot& rRoot ) :
void XclImpCondFormatManager::ReadCondfmt( XclImpStream& rStrm )
{
- XclImpCondFormat* pFmt = new XclImpCondFormat( GetRoot(), maCondFmtList.Count() );
+ XclImpCondFormat* pFmt = new XclImpCondFormat( GetRoot(), maCondFmtList.size() );
pFmt->ReadCondfmt( rStrm );
- maCondFmtList.Append( pFmt );
+ maCondFmtList.push_back( pFmt );
}
void XclImpCondFormatManager::ReadCF( XclImpStream& rStrm )
{
- DBG_ASSERT( !maCondFmtList.Empty(), "XclImpCondFormatManager::ReadCF - CF without leading CONDFMT" );
- if( !maCondFmtList.Empty() )
- maCondFmtList.GetObject( maCondFmtList.Count() - 1 )->ReadCF( rStrm );
+ DBG_ASSERT( !maCondFmtList.empty(), "XclImpCondFormatManager::ReadCF - CF without leading CONDFMT" );
+ if( !maCondFmtList.empty() )
+ maCondFmtList.back().ReadCF( rStrm );
}
void XclImpCondFormatManager::Apply()
{
- for( XclImpCondFormat* pFmt = maCondFmtList.First(); pFmt; pFmt = maCondFmtList.Next() )
- pFmt->Apply();
- maCondFmtList.Clear();
+ for( XclImpCondFmtList::iterator itFmt = maCondFmtList.begin(); itFmt != maCondFmtList.end(); ++itFmt )
+ itFmt->Apply();
+ maCondFmtList.clear();
}
// Data Validation ============================================================
-void XclImpValidation::ReadDval( XclImpStream& rStrm )
+XclImpValidationManager::DVItem::DVItem( const ScRangeList& rRanges, const ScValidationData& rValidData ) :
+ maRanges(rRanges), maValidData(rValidData) {}
+
+XclImpValidationManager::XclImpValidationManager( const XclImpRoot& rRoot ) :
+ XclImpRoot( rRoot )
+{
+}
+
+void XclImpValidationManager::ReadDval( XclImpStream& rStrm )
{
const XclImpRoot& rRoot = rStrm.GetRoot();
DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 );
@@ -714,7 +710,7 @@ void XclImpValidation::ReadDval( XclImpStream& rStrm )
}
}
-void XclImpValidation::ReadDV( XclImpStream& rStrm )
+void XclImpValidationManager::ReadDV( XclImpStream& rStrm )
{
const XclImpRoot& rRoot = rStrm.GetRoot();
DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 );
@@ -738,130 +734,148 @@ void XclImpValidation::ReadDV( XclImpStream& rStrm )
rStrm.SetNulSubstChar(); // back to default
// formula(s)
- if( rStrm.GetRecLeft() > 8 )
+ if ( rStrm.GetRecLeft() <= 8 )
+ // Not enough bytes left in the record. Bail out.
+ return;
+
+ sal_uInt16 nLen;
+
+ // first formula
+ // string list is single tStr token with NUL separators -> replace them with LF
+ rStrm.SetNulSubstChar( '\n' );
+ ::std::auto_ptr< ScTokenArray > xTokArr1;
+ rStrm >> nLen;
+ rStrm.Ignore( 2 );
+ if( nLen > 0 )
{
- sal_uInt16 nLen;
+ const ScTokenArray* pTokArr = 0;
+ rFmlaConv.Reset();
+ rFmlaConv.Convert( pTokArr, rStrm, nLen, false, FT_RangeName );
+ // formula converter owns pTokArr -> create a copy of the token array
+ if( pTokArr )
+ xTokArr1.reset( pTokArr->Clone() );
+ }
+ rStrm.SetNulSubstChar(); // back to default
- // first formula
- // string list is single tStr token with NUL separators -> replace them with LF
- rStrm.SetNulSubstChar( '\n' );
- ::std::auto_ptr< ScTokenArray > xTokArr1;
- rStrm >> nLen;
- rStrm.Ignore( 2 );
- if( nLen > 0 )
- {
- const ScTokenArray* pTokArr = 0;
- rFmlaConv.Reset();
- rFmlaConv.Convert( pTokArr, rStrm, nLen, false, FT_RangeName );
- // formula converter owns pTokArr -> create a copy of the token array
- if( pTokArr )
- xTokArr1.reset( pTokArr->Clone() );
- }
- rStrm.SetNulSubstChar(); // back to default
+ // second formula
+ ::std::auto_ptr< ScTokenArray > xTokArr2;
+ rStrm >> nLen;
+ rStrm.Ignore( 2 );
+ if( nLen > 0 )
+ {
+ const ScTokenArray* pTokArr = 0;
+ rFmlaConv.Reset();
+ rFmlaConv.Convert( pTokArr, rStrm, nLen, false, FT_RangeName );
+ // formula converter owns pTokArr -> create a copy of the token array
+ if( pTokArr )
+ xTokArr2.reset( pTokArr->Clone() );
+ }
- // second formula
- ::std::auto_ptr< ScTokenArray > xTokArr2;
- rStrm >> nLen;
- rStrm.Ignore( 2 );
- if( nLen > 0 )
- {
- const ScTokenArray* pTokArr = 0;
- rFmlaConv.Reset();
- rFmlaConv.Convert( pTokArr, rStrm, nLen, false, FT_RangeName );
- // formula converter owns pTokArr -> create a copy of the token array
- if( pTokArr )
- xTokArr2.reset( pTokArr->Clone() );
- }
+ // read all cell ranges
+ XclRangeList aXclRanges;
+ rStrm >> aXclRanges;
- // read all cell ranges
- XclRangeList aXclRanges;
- rStrm >> aXclRanges;
+ // convert to Calc range list
+ ScRangeList aScRanges;
+ rRoot.GetAddressConverter().ConvertRangeList( aScRanges, aXclRanges, nScTab, true );
- // convert to Calc range list
- ScRangeList aScRanges;
- rRoot.GetAddressConverter().ConvertRangeList( aScRanges, aXclRanges, nScTab, true );
+ // only continue if there are valid ranges
+ if ( aScRanges.empty() )
+ return;
- // only continue if there are valid ranges
- if( aScRanges.Count() )
- {
- bool bIsValid = true; // valid settings in flags field
+ bool bIsValid = true; // valid settings in flags field
- ScValidationMode eValMode = SC_VALID_ANY;
- switch( nFlags & EXC_DV_MODE_MASK )
- {
- case EXC_DV_MODE_ANY: eValMode = SC_VALID_ANY; break;
- case EXC_DV_MODE_WHOLE: eValMode = SC_VALID_WHOLE; break;
- case EXC_DV_MODE_DECIMAL: eValMode = SC_VALID_DECIMAL; break;
- case EXC_DV_MODE_LIST: eValMode = SC_VALID_LIST; break;
- case EXC_DV_MODE_DATE: eValMode = SC_VALID_DATE; break;
- case EXC_DV_MODE_TIME: eValMode = SC_VALID_TIME; break;
- case EXC_DV_MODE_TEXTLEN: eValMode = SC_VALID_TEXTLEN; break;
- case EXC_DV_MODE_CUSTOM: eValMode = SC_VALID_CUSTOM; break;
- default: bIsValid = false;
- }
- rRoot.GetTracer().TraceDVType(eValMode == SC_VALID_CUSTOM);
+ ScValidationMode eValMode = SC_VALID_ANY;
+ switch( nFlags & EXC_DV_MODE_MASK )
+ {
+ case EXC_DV_MODE_ANY: eValMode = SC_VALID_ANY; break;
+ case EXC_DV_MODE_WHOLE: eValMode = SC_VALID_WHOLE; break;
+ case EXC_DV_MODE_DECIMAL: eValMode = SC_VALID_DECIMAL; break;
+ case EXC_DV_MODE_LIST: eValMode = SC_VALID_LIST; break;
+ case EXC_DV_MODE_DATE: eValMode = SC_VALID_DATE; break;
+ case EXC_DV_MODE_TIME: eValMode = SC_VALID_TIME; break;
+ case EXC_DV_MODE_TEXTLEN: eValMode = SC_VALID_TEXTLEN; break;
+ case EXC_DV_MODE_CUSTOM: eValMode = SC_VALID_CUSTOM; break;
+ default: bIsValid = false;
+ }
+ rRoot.GetTracer().TraceDVType(eValMode == SC_VALID_CUSTOM);
- ScConditionMode eCondMode = SC_COND_BETWEEN;
- switch( nFlags & EXC_DV_COND_MASK )
- {
- case EXC_DV_COND_BETWEEN: eCondMode = SC_COND_BETWEEN; break;
- case EXC_DV_COND_NOTBETWEEN:eCondMode = SC_COND_NOTBETWEEN; break;
- case EXC_DV_COND_EQUAL: eCondMode = SC_COND_EQUAL; break;
- case EXC_DV_COND_NOTEQUAL: eCondMode = SC_COND_NOTEQUAL; break;
- case EXC_DV_COND_GREATER: eCondMode = SC_COND_GREATER; break;
- case EXC_DV_COND_LESS: eCondMode = SC_COND_LESS; break;
- case EXC_DV_COND_EQGREATER: eCondMode = SC_COND_EQGREATER; break;
- case EXC_DV_COND_EQLESS: eCondMode = SC_COND_EQLESS; break;
- default: bIsValid = false;
- }
+ ScConditionMode eCondMode = SC_COND_BETWEEN;
+ switch( nFlags & EXC_DV_COND_MASK )
+ {
+ case EXC_DV_COND_BETWEEN: eCondMode = SC_COND_BETWEEN; break;
+ case EXC_DV_COND_NOTBETWEEN:eCondMode = SC_COND_NOTBETWEEN; break;
+ case EXC_DV_COND_EQUAL: eCondMode = SC_COND_EQUAL; break;
+ case EXC_DV_COND_NOTEQUAL: eCondMode = SC_COND_NOTEQUAL; break;
+ case EXC_DV_COND_GREATER: eCondMode = SC_COND_GREATER; break;
+ case EXC_DV_COND_LESS: eCondMode = SC_COND_LESS; break;
+ case EXC_DV_COND_EQGREATER: eCondMode = SC_COND_EQGREATER; break;
+ case EXC_DV_COND_EQLESS: eCondMode = SC_COND_EQLESS; break;
+ default: bIsValid = false;
+ }
- if( bIsValid )
- {
- // first range for base address for relative references
- const ScRange& rScRange = *aScRanges.GetObject( 0 ); // aScRanges is not empty
+ if ( !bIsValid )
+ // No valid validation found. Bail out.
+ return;
- // process string list of a list validity (convert to list of string tokens)
- if( xTokArr1.get() && (eValMode == SC_VALID_LIST) && ::get_flag( nFlags, EXC_DV_STRINGLIST ) )
- XclTokenArrayHelper::ConvertStringToList( *xTokArr1, '\n', true );
- ScValidationData aValidData( eValMode, eCondMode, xTokArr1.get(), xTokArr2.get(), &rDoc, rScRange.aStart );
+ // first range for base address for relative references
+ const ScRange& rScRange = *aScRanges.front(); // aScRanges is not empty
- aValidData.SetIgnoreBlank( ::get_flag( nFlags, EXC_DV_IGNOREBLANK ) );
- aValidData.SetListType( ::get_flagvalue( nFlags, EXC_DV_SUPPRESSDROPDOWN, ValidListType::INVISIBLE, ValidListType::UNSORTED ) );
+ // process string list of a list validity (convert to list of string tokens)
+ if( xTokArr1.get() && (eValMode == SC_VALID_LIST) && ::get_flag( nFlags, EXC_DV_STRINGLIST ) )
+ XclTokenArrayHelper::ConvertStringToList( *xTokArr1, '\n', true );
- // *** prompt box ***
- if( aPromptTitle.Len() || aPromptMessage.Len() )
- {
- // set any text stored in the record
- aValidData.SetInput( aPromptTitle, aPromptMessage );
- if( !::get_flag( nFlags, EXC_DV_SHOWPROMPT ) )
- aValidData.ResetInput();
- }
+ maDVItems.push_back(
+ new DVItem(aScRanges, ScValidationData(eValMode, eCondMode, xTokArr1.get(), xTokArr2.get(), &rDoc, rScRange.aStart)));
+ DVItem& rItem = maDVItems.back();
- // *** error box ***
- ScValidErrorStyle eErrStyle = SC_VALERR_STOP;
- switch( nFlags & EXC_DV_ERROR_MASK )
- {
- case EXC_DV_ERROR_WARNING: eErrStyle = SC_VALERR_WARNING; break;
- case EXC_DV_ERROR_INFO: eErrStyle = SC_VALERR_INFO; break;
- }
- // set texts and error style
- aValidData.SetError( aErrorTitle, aErrorMessage, eErrStyle );
- if( !::get_flag( nFlags, EXC_DV_SHOWERROR ) )
- aValidData.ResetError();
-
- // set the handle ID
- sal_uLong nHandle = rDoc.AddValidationEntry( aValidData );
- ScPatternAttr aPattern( rDoc.GetPool() );
- aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_VALIDDATA, nHandle ) );
-
- // apply all ranges
- for( const ScRange* pScRange = aScRanges.First(); pScRange; pScRange = aScRanges.Next() )
- rDoc.ApplyPatternAreaTab( pScRange->aStart.Col(), pScRange->aStart.Row(),
- pScRange->aEnd.Col(), pScRange->aEnd.Row(), nScTab, aPattern );
- }
+ rItem.maValidData.SetIgnoreBlank( ::get_flag( nFlags, EXC_DV_IGNOREBLANK ) );
+ rItem.maValidData.SetListType( ::get_flagvalue( nFlags, EXC_DV_SUPPRESSDROPDOWN, ValidListType::INVISIBLE, ValidListType::UNSORTED ) );
+
+ // *** prompt box ***
+ if( aPromptTitle.Len() || aPromptMessage.Len() )
+ {
+ // set any text stored in the record
+ rItem.maValidData.SetInput( aPromptTitle, aPromptMessage );
+ if( !::get_flag( nFlags, EXC_DV_SHOWPROMPT ) )
+ rItem.maValidData.ResetInput();
+ }
+
+ // *** error box ***
+ ScValidErrorStyle eErrStyle = SC_VALERR_STOP;
+ switch( nFlags & EXC_DV_ERROR_MASK )
+ {
+ case EXC_DV_ERROR_WARNING: eErrStyle = SC_VALERR_WARNING; break;
+ case EXC_DV_ERROR_INFO: eErrStyle = SC_VALERR_INFO; break;
+ }
+ // set texts and error style
+ rItem.maValidData.SetError( aErrorTitle, aErrorMessage, eErrStyle );
+ if( !::get_flag( nFlags, EXC_DV_SHOWERROR ) )
+ rItem.maValidData.ResetError();
+}
+
+void XclImpValidationManager::Apply()
+{
+ ScDocument& rDoc = GetRoot().GetDoc();
+ DVItemList::iterator itr = maDVItems.begin(), itrEnd = maDVItems.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ DVItem& rItem = *itr;
+ // set the handle ID
+ sal_uLong nHandle = rDoc.AddValidationEntry( rItem.maValidData );
+ ScPatternAttr aPattern( rDoc.GetPool() );
+ aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_VALIDDATA, nHandle ) );
+
+ // apply all ranges
+ for ( size_t i = 0, nRanges = rItem.maRanges.size(); i < nRanges; ++i )
+ {
+ const ScRange* pScRange = rItem.maRanges[ i ];
+ rDoc.ApplyPatternAreaTab( pScRange->aStart.Col(), pScRange->aStart.Row(),
+ pScRange->aEnd.Col(), pScRange->aEnd.Row(), pScRange->aStart.Tab(), aPattern );
}
}
+ maDVItems.clear();
}
// Web queries ================================================================
@@ -965,14 +979,14 @@ void XclImpWebQueryBuffer::ReadQsi( XclImpStream& rStrm )
// #i64794# Excel replaces spaces with underscores
aXclName.SearchAndReplaceAll( ' ', '_' );
- // #101529# find the defined name used in Calc
+ // find the defined name used in Calc
if( const XclImpName* pName = GetNameManager().FindName( aXclName, GetCurrScTab() ) )
{
if( const ScRangeData* pRangeData = pName->GetScRangeData() )
{
ScRange aRange;
if( pRangeData->IsReference( aRange ) )
- maWQList.Append( new XclImpWebQuery( aRange ) );
+ maWQList.push_back( new XclImpWebQuery( aRange ) );
}
}
}
@@ -984,34 +998,34 @@ void XclImpWebQueryBuffer::ReadQsi( XclImpStream& rStrm )
void XclImpWebQueryBuffer::ReadParamqry( XclImpStream& rStrm )
{
- if( XclImpWebQuery* pQuery = maWQList.Last() )
- pQuery->ReadParamqry( rStrm );
+ if (!maWQList.empty())
+ maWQList.back().ReadParamqry( rStrm );
}
void XclImpWebQueryBuffer::ReadWqstring( XclImpStream& rStrm )
{
- if( XclImpWebQuery* pQuery = maWQList.Last() )
- pQuery->ReadWqstring( rStrm );
+ if (!maWQList.empty())
+ maWQList.back().ReadWqstring( rStrm );
}
void XclImpWebQueryBuffer::ReadWqsettings( XclImpStream& rStrm )
{
- if( XclImpWebQuery* pQuery = maWQList.Last() )
- pQuery->ReadWqsettings( rStrm );
+ if (!maWQList.empty())
+ maWQList.back().ReadWqsettings( rStrm );
}
void XclImpWebQueryBuffer::ReadWqtables( XclImpStream& rStrm )
{
- if( XclImpWebQuery* pQuery = maWQList.Last() )
- pQuery->ReadWqtables( rStrm );
+ if (!maWQList.empty())
+ maWQList.back().ReadWqtables( rStrm );
}
void XclImpWebQueryBuffer::Apply()
{
ScDocument& rDoc = GetDoc();
String aFilterName( RTL_CONSTASCII_USTRINGPARAM( EXC_WEBQRY_FILTER ) );
- for( XclImpWebQuery* pQuery = maWQList.First(); pQuery; pQuery = maWQList.Next() )
- pQuery->Apply( rDoc, aFilterName );
+ for( XclImpWebQueryList::iterator itQuery = maWQList.begin(); itQuery != maWQList.end(); ++itQuery )
+ itQuery->Apply( rDoc, aFilterName );
}
// Decryption =================================================================
@@ -1116,11 +1130,11 @@ ErrCode XclImpDecryptHelper::ReadFilepass( XclImpStream& rStrm )
rStrm.SetDecrypter( xDecr );
// request and verify a password (decrypter implements IDocPasswordVerifier)
- if( xDecr.is() )
- rStrm.GetRoot().RequestEncryptionData( *xDecr );
+ if( xDecr )
+ rStrm.GetRoot().RequestPassword( *xDecr );
// return error code (success, wrong password, etc.)
- return xDecr.is() ? xDecr->GetError() : EXC_ENCR_ERROR_UNSUPP_CRYPT;
+ return xDecr ? xDecr->GetError() : EXC_ENCR_ERROR_UNSUPP_CRYPT;
}
// Document protection ========================================================
@@ -1159,7 +1173,6 @@ void XclImpDocProtectBuffer::Apply() const
auto_ptr<ScDocProtection> pProtect(new ScDocProtection);
pProtect->setProtected(true);
-#if ENABLE_SHEET_PROTECTION
if (mnPassHash)
{
// 16-bit password pash.
@@ -1168,7 +1181,6 @@ void XclImpDocProtectBuffer::Apply() const
aPass[1] = mnPassHash & 0xFF;
pProtect->setPasswordHash(aPass, PASSHASH_XL);
}
-#endif
// document protection options
pProtect->setOption(ScDocProtection::STRUCTURE, mbDocProtect);
@@ -1264,7 +1276,6 @@ void XclImpSheetProtectBuffer::Apply() const
auto_ptr<ScTableProtection> pProtect(new ScTableProtection);
pProtect->setProtected(true);
-#if ENABLE_SHEET_PROTECTION
// 16-bit hash password
const sal_uInt16 nHash = itr->second.mnPasswordHash;
if (nHash)
@@ -1274,7 +1285,6 @@ void XclImpSheetProtectBuffer::Apply() const
aPass[1] = nHash & 0xFF;
pProtect->setPasswordHash(aPass, PASSHASH_XL);
}
-#endif
// sheet protection options
const sal_uInt16 nOptions = itr->second.mnOptions;
@@ -1316,3 +1326,4 @@ XclImpSheetProtectBuffer::Sheet* XclImpSheetProtectBuffer::GetSheetItem( SCTAB n
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index dcce436aebdb..3039fba3b81e 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,6 +84,7 @@
#include <editeng/eeitem.hxx>
#include <editeng/colritem.hxx>
#include <svx/xflclit.hxx>
+#include <sal/macros.h>
#include <editeng/adjitem.hxx>
#include <svx/xlineit.hxx>
#include <svx/xlinjoit.hxx>
@@ -109,7 +111,10 @@
#include "xipage.hxx"
#include "xichart.hxx"
#include "xicontent.hxx"
+#include "scextopt.hxx"
+
#include "namebuff.hxx"
+#include <boost/shared_ptr.hpp>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -209,7 +214,7 @@ XclImpDrawObjBase::~XclImpDrawObjBase()
{
}
-/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( const XclImpRoot& rRoot, XclImpStream& rStrm )
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
XclImpDrawObjRef xDrawObj;
@@ -236,11 +241,12 @@ XclImpDrawObjBase::~XclImpDrawObjBase()
}
}
+ xDrawObj->mnTab = rRoot.GetCurrScTab();
xDrawObj->ImplReadObj3( rStrm );
return xDrawObj;
}
-/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( const XclImpRoot& rRoot, XclImpStream& rStrm )
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
XclImpDrawObjRef xDrawObj;
@@ -268,11 +274,12 @@ XclImpDrawObjBase::~XclImpDrawObjBase()
}
}
+ xDrawObj->mnTab = rRoot.GetCurrScTab();
xDrawObj->ImplReadObj4( rStrm );
return xDrawObj;
}
-/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( const XclImpRoot& rRoot, XclImpStream& rStrm )
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
XclImpDrawObjRef xDrawObj;
@@ -310,11 +317,12 @@ XclImpDrawObjBase::~XclImpDrawObjBase()
}
}
+ xDrawObj->mnTab = rRoot.GetCurrScTab();
xDrawObj->ImplReadObj5( rStrm );
return xDrawObj;
}
-/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStream& rStrm )
+XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
XclImpDrawObjRef xDrawObj;
@@ -368,6 +376,7 @@ XclImpDrawObjBase::~XclImpDrawObjBase()
}
}
+ xDrawObj->mnTab = rRoot.GetCurrScTab();
xDrawObj->ImplReadObj8( rStrm );
return xDrawObj;
}
@@ -390,7 +399,7 @@ void XclImpDrawObjBase::SetDffData( const DffObjData& rDffObjData, const String&
String XclImpDrawObjBase::GetObjName() const
{
- /* #118053# #i51348# Always return a non-empty name. Create English
+ /* #i51348# Always return a non-empty name. Create English
default names depending on the object type. This is not implemented as
virtual functions in derived classes, as class type and object type may
not match. */
@@ -468,8 +477,9 @@ void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrOb
}
// macro and hyperlink
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- if( mbSimpleMacro && ((maMacroName.Len() > 0) || (maHyperlink.getLength() > 0)) )
+ // removed oracle/sun check for mbSimpleMacro ( no idea what its for )
+ if( (maMacroName.Len() > 0 ) ||
+ (maHyperlink.Len() > 0) )
{
if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, sal_True ) )
{
@@ -477,11 +487,6 @@ void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrOb
pInfo->SetHlink( maHyperlink );
}
}
-#else
- if( mbSimpleMacro && (maMacroName.Len() > 0) )
- if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, sal_True ) )
- pInfo->SetMacro( XclTools::GetSbMacroUrl( maMacroName, GetDocShell() ) );
-#endif
// call virtual function for object type specific processing
DoPreProcessSdrObj( rDffConv, rSdrObj );
@@ -653,7 +658,7 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillDa
{ 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 },
{ 0x80, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00 }
};
- const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, STATIC_TABLE_SIZE( sppnPatterns ) ) ];
+ const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, SAL_N_ELEMENTS( sppnPatterns ) ) ];
// create 2-colored 8x8 DIB
SvMemoryStream aMemStrm;
aMemStrm << sal_uInt32( 12 ) << sal_Int16( 8 ) << sal_Int16( 8 ) << sal_uInt16( 1 ) << sal_uInt16( 1 );
@@ -663,7 +668,7 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillDa
aMemStrm << sal_uInt32( pnPattern[ nIdx ] ); // 32-bit little-endian
aMemStrm.Seek( STREAM_SEEK_TO_BEGIN );
Bitmap aBitmap;
- aBitmap.Read( aMemStrm, sal_False );
+ aBitmap.Read( aMemStrm, false );
XOBitmap aXOBitmap( aBitmap );
aXOBitmap.Bitmap2Array();
aXOBitmap.SetBitmapType( XBITMAP_8X8 );
@@ -1077,13 +1082,13 @@ SdrObject* XclImpLineObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Re
{
xSdrObj->SetMergedItem( XLineStartItem( EMPTY_STRING, aArrowPolyPoly ) );
xSdrObj->SetMergedItem( XLineStartWidthItem( nWidth ) );
- xSdrObj->SetMergedItem( XLineStartCenterItem( sal_False ) );
+ xSdrObj->SetMergedItem( XLineStartCenterItem( false ) );
}
if( bLineEnd )
{
xSdrObj->SetMergedItem( XLineEndItem( EMPTY_STRING, aArrowPolyPoly ) );
xSdrObj->SetMergedItem( XLineEndWidthItem( nWidth ) );
- xSdrObj->SetMergedItem( XLineEndCenterItem( sal_False ) );
+ xSdrObj->SetMergedItem( XLineEndCenterItem( false ) );
}
}
rDffConv.Progress();
@@ -1319,7 +1324,7 @@ void XclImpObjTextData::ReadByteString( XclImpStream& rStrm )
void XclImpObjTextData::ReadFormats( XclImpStream& rStrm )
{
- if( mxString.is() )
+ if( mxString )
mxString->ReadObjFormats( rStrm, maData.mnFormatSize );
else
rStrm.Ignore( maData.mnFormatSize );
@@ -1381,7 +1386,7 @@ void XclImpTextObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject&
// set text data
if( SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( &rSdrObj ) )
{
- if( maTextData.mxString.is() )
+ if( maTextData.mxString )
{
if( maTextData.mxString->IsRich() )
{
@@ -1565,11 +1570,8 @@ void XclImpChartObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
ReadFrameData( rStrm );
rStrm.Ignore( 18 );
ReadMacro3( rStrm, nMacroSize );
-#if 0
- ReadChartSubStream( rStrm );
-#endif
// set frame format from OBJ record, it is used if chart itself is transparent
- if( mxChart.is() )
+ if( mxChart )
mxChart->UpdateObjFrame( maLineData, maFillData );
}
@@ -1579,11 +1581,8 @@ void XclImpChartObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
ReadFrameData( rStrm );
rStrm.Ignore( 18 );
ReadMacro4( rStrm, nMacroSize );
-#if 0
- ReadChartSubStream( rStrm );
-#endif
// set frame format from OBJ record, it is used if chart itself is transparent
- if( mxChart.is() )
+ if( mxChart )
mxChart->UpdateObjFrame( maLineData, maFillData );
}
@@ -1596,7 +1595,7 @@ void XclImpChartObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_u
ReadMacro5( rStrm, nMacroSize );
ReadChartSubStream( rStrm );
// set frame format from OBJ record, it is used if chart itself is transparent
- if( mxChart.is() )
+ if( mxChart )
mxChart->UpdateObjFrame( maLineData, maFillData );
}
@@ -1608,7 +1607,7 @@ void XclImpChartObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId
// enable CONTINUE handling for the entire chart substream
rStrm.ResetRecord( true );
ReadChartSubStream( rStrm );
- /* #90118# disable CONTINUE handling again to be able to read
+ /* disable CONTINUE handling again to be able to read
following CONTINUE records as MSODRAWING records. */
rStrm.ResetRecord( false );
}
@@ -1616,14 +1615,14 @@ void XclImpChartObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId
sal_Size XclImpChartObj::DoGetProgressSize() const
{
- return mxChart.is() ? mxChart->GetProgressSize() : 1;
+ return mxChart ? mxChart->GetProgressSize() : 1;
}
SdrObject* XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
SdrObjectPtr xSdrObj;
SfxObjectShell* pDocShell = GetDocShell();
- if( rDffConv.SupportsOleObjects() && SvtModuleOptions().IsChart() && pDocShell && mxChart.is() && !mxChart->IsPivotChart() )
+ if( rDffConv.SupportsOleObjects() && SvtModuleOptions().IsChart() && pDocShell && mxChart && !mxChart->IsPivotChart() )
{
// create embedded chart object
OUString aEmbObjName;
@@ -1649,7 +1648,7 @@ SdrObject* XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const R
void XclImpChartObj::DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
const SdrOle2Obj* pSdrOleObj = dynamic_cast< const SdrOle2Obj* >( &rSdrObj );
- if( mxChart.is() && pSdrOleObj )
+ if( mxChart && pSdrOleObj )
{
Reference< XEmbeddedObject > xEmbObj = pSdrOleObj->GetObjRef();
if( xEmbObj.is() && ::svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) ) try
@@ -1761,29 +1760,22 @@ SdrObject* XclImpControlHelper::CreateSdrObjectFromShape(
return xSdrObj.release();
}
-void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) const
+void XclImpControlHelper::ApplySheetLinkProps() const
{
+
Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( mxShape );
if( !xCtrlModel.is() )
return;
-
ScfPropertySet aPropSet( xCtrlModel );
- // #118053# #i51348# set object name at control model
- aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() );
-
- // control visible and printable?
- aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() );
- aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() );
-
- // sheet links
+ // sheet links
if( SfxObjectShell* pDocShell = mrRoot.GetDocShell() )
{
Reference< XMultiServiceFactory > xFactory( pDocShell->GetModel(), UNO_QUERY );
if( xFactory.is() )
{
// cell link
- if( mxCellLink.is() ) try
+ if( mxCellLink ) try
{
Reference< XBindableValue > xBindable( xCtrlModel, UNO_QUERY_THROW );
@@ -1814,7 +1806,7 @@ void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) co
}
// source range
- if( mxSrcRange.is() ) try
+ if( mxSrcRange ) try
{
Reference< XListEntrySink > xEntrySink( xCtrlModel, UNO_QUERY_THROW );
@@ -1839,6 +1831,25 @@ void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) co
}
}
}
+}
+
+void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) const
+{
+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( mxShape );
+ if( !xCtrlModel.is() )
+ return;
+
+ ApplySheetLinkProps();
+
+ ScfPropertySet aPropSet( xCtrlModel );
+
+ // #i51348# set object name at control model
+ aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() );
+
+ // control visible and printable?
+ aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() );
+ aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() );
+
// virtual call for type specific processing
DoProcessControl( aPropSet );
@@ -1849,8 +1860,11 @@ void XclImpControlHelper::ReadCellLinkFormula( XclImpStream& rStrm, bool bWithBo
ScRangeList aScRanges;
ReadRangeList( aScRanges, rStrm, bWithBoundSize );
// Use first cell of first range
- if( const ScRange* pScRange = aScRanges.GetObject( 0 ) )
+ if ( !aScRanges.empty() )
+ {
+ const ScRange* pScRange = aScRanges.front();
mxCellLink.reset( new ScAddress( pScRange->aStart ) );
+ }
}
void XclImpControlHelper::ReadSourceRangeFormula( XclImpStream& rStrm, bool bWithBoundSize )
@@ -1858,8 +1872,11 @@ void XclImpControlHelper::ReadSourceRangeFormula( XclImpStream& rStrm, bool bWit
ScRangeList aScRanges;
ReadRangeList( aScRanges, rStrm, bWithBoundSize );
// Use first range
- if( const ScRange* pScRange = aScRanges.GetObject( 0 ) )
+ if ( !aScRanges.empty() )
+ {
+ const ScRange* pScRange = aScRanges.front();
mxSrcRange.reset( new ScRange( *pScRange ) );
+ }
}
void XclImpControlHelper::DoProcessControl( ScfPropertySet& ) const
@@ -1938,7 +1955,7 @@ bool XclImpTbxObjBase::FillMacroDescriptor( ScriptEventDescriptor& rDescriptor )
void XclImpTbxObjBase::ConvertFont( ScfPropertySet& rPropSet ) const
{
- if( maTextData.mxString.is() )
+ if( maTextData.mxString )
{
const XclFormatRunVec& rFormatRuns = maTextData.mxString->GetFormats();
if( rFormatRuns.empty() )
@@ -1950,7 +1967,7 @@ void XclImpTbxObjBase::ConvertFont( ScfPropertySet& rPropSet ) const
void XclImpTbxObjBase::ConvertLabel( ScfPropertySet& rPropSet ) const
{
- if( maTextData.mxString.is() )
+ if( maTextData.mxString )
{
String aLabel = maTextData.mxString->GetText();
if( maTextData.maData.mnShortcut > 0 )
@@ -2170,6 +2187,45 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
{
XclImpCheckBoxObj::DoProcessControl( rPropSet );
// TODO: grouping
+ XclImpOptionButtonObj* pTbxObj = dynamic_cast< XclImpOptionButtonObj* >( GetObjectManager().GetSheetDrawing( GetTab() ).FindDrawObj( mnNextInGroup ).get() );
+ if ( ( pTbxObj && pTbxObj->mnFirstInGroup ) )
+ {
+ // Group has terminated
+ // traverse each RadioButton in group and
+ // a) apply the groupname
+ // b) propagate the linked cell from the lead radiobutton
+ // c) apply the correct Ref value
+ XclImpOptionButtonObj* pLeader = pTbxObj;
+ ;
+ sal_Int32 nRefVal = 1;
+ OSL_TRACE( "0x%x start group ", pLeader->GetObjId()/*.mnObjId */);
+ do
+ {
+
+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( pTbxObj->mxShape );
+ if ( xCtrlModel.is() )
+ {
+ ScfPropertySet aProps( xCtrlModel );
+ rtl::OUString sGroupName = rtl::OUString::valueOf( static_cast< sal_Int32 >( pLeader->GetDffShapeId() ) );
+
+ aProps.SetStringProperty( CREATE_OUSTRING( "GroupName" ), sGroupName );
+ aProps.SetStringProperty( CREATE_OUSTRING( "RefValue" ), rtl::OUString::valueOf( nRefVal++ ) );
+ if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() )
+ {
+ // propagate cell link info
+ pTbxObj->mxCellLink.reset( new ScAddress( *pLeader->mxCellLink.get() ) );
+ pTbxObj->ApplySheetLinkProps();
+ }
+ pTbxObj = dynamic_cast< XclImpOptionButtonObj* >( GetObjectManager().GetSheetDrawing( GetTab() ).FindDrawObj( pTbxObj->mnNextInGroup ).get() );
+ }
+ else
+ pTbxObj = NULL;
+ } while ( pTbxObj && !( pTbxObj->mnFirstInGroup == 1 ) );
+ }
+ else
+ {
+ // not the leader? try and find it
+ }
}
OUString XclImpOptionButtonObj::DoGetServiceName() const
@@ -2329,7 +2385,7 @@ void XclImpEditObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId,
void XclImpEditObj::DoProcessControl( ScfPropertySet& rPropSet ) const
{
- if( maTextData.mxString.is() )
+ if( maTextData.mxString )
{
OUString aText = maTextData.mxString->GetText();
if( IsNumeric() )
@@ -2663,7 +2719,7 @@ void XclImpDropDownObj::DoProcessControl( ScfPropertySet& rPropSet ) const
if( GetDropDownType() == EXC_OBJ_DROPDOWN_COMBOBOX )
{
// text of editable combobox
- if( maTextData.mxString.is() )
+ if( maTextData.mxString )
rPropSet.SetStringProperty( CREATE_OUSTRING( "DefaultText" ), maTextData.mxString->GetText() );
}
else
@@ -2806,6 +2862,17 @@ SdrObject* XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const
return xSdrObj.release();
}
+String XclImpPictureObj::GetObjName() const
+{
+ if( IsOcxControl() )
+ {
+ String sName( GetObjectManager().GetOleNameOverride( GetTab(), GetObjId() ) );
+ if ( sName.Len() > 0 )
+ return sName;
+ }
+ return XclImpDrawObjBase::GetObjName();
+}
+
void XclImpPictureObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
if( IsOcxControl() )
@@ -2841,7 +2908,7 @@ void XclImpPictureObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObje
OUString aNewName;
rEmbObjCont.InsertEmbeddedObject( xEmbObj, aNewName );
if( aOldName != aNewName )
- // #95381# SetPersistName, not SetName
+ // SetPersistName, not SetName
pOleSdrObj->SetPersistName( aNewName );
}
}
@@ -2975,11 +3042,6 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize )
// DFF stream conversion ======================================================
-//UNUSED2009-05 void XclImpSolverContainer::ReadSolverContainer( SvStream& rDffStrm )
-//UNUSED2009-05 {
-//UNUSED2009-05 rDffStrm >> *this;
-//UNUSED2009-05 }
-
void XclImpSolverContainer::InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, sal_uInt32 nDffFlags )
{
if( nDffShapeId > 0 )
@@ -3067,15 +3129,15 @@ XclImpSimpleDffConverter::~XclImpSimpleDffConverter()
{
}
-FASTBOOL XclImpSimpleDffConverter::GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const
+bool XclImpSimpleDffConverter::GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const
{
ColorData nColor = GetPalette().GetColorData( static_cast< sal_uInt16 >( nIndex ) );
if( nColor == COL_AUTO )
- return sal_False;
+ return 0;
rColor.SetColor( nColor );
- return sal_True;
+ return 1;
}
// ----------------------------------------------------------------------------
@@ -3120,6 +3182,24 @@ XclImpDffConverter::~XclImpDffConverter()
{
}
+String XclImpObjectManager::GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId )
+{
+ rtl::OUString sOleName;
+ String sCodeName = GetExtDocOptions().GetCodeName( nTab );
+
+ if ( mxOleCtrlNameOverride->hasByName( sCodeName ) )
+ {
+ Reference< XIndexContainer > xIdToOleName;
+ mxOleCtrlNameOverride->getByName( sCodeName ) >>= xIdToOleName;
+ xIdToOleName->getByIndex( nObjId ) >>= sOleName;
+ }
+ OSL_TRACE("XclImpObjectManager::GetOleNameOverride tab %d, ( module %s ) object id ( %d ) is %s", nTab,
+ rtl::OUStringToOString( sCodeName, RTL_TEXTENCODING_UTF8 ).getStr(), nObjId,
+ rtl::OUStringToOString( sOleName, RTL_TEXTENCODING_UTF8 ).getStr() );
+
+ return sOleName;
+}
+
void XclImpDffConverter::StartProgressBar( sal_Size nProgressSize )
{
mxProgress.reset( new ScfProgressBar( GetDocShell(), STR_PROGRESS_CALCULATING ) );
@@ -3129,7 +3209,7 @@ void XclImpDffConverter::StartProgressBar( sal_Size nProgressSize )
void XclImpDffConverter::Progress( sal_Size nDelta )
{
- DBG_ASSERT( mxProgress.is(), "XclImpDffConverter::Progress - invalid call, no progress bar" );
+ DBG_ASSERT( mxProgress, "XclImpDffConverter::Progress - invalid call, no progress bar" );
mxProgress->Progress( nDelta );
}
@@ -3319,7 +3399,7 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
XclImpDrawObjRef xDrawObj = rConvData.mrDrawing.FindDrawObj( rDffObjData.rSpHd );
const Rectangle& rAnchorRect = rDffObjData.aChildAnchor;
- // #102378# Do not process the global page group shape (flag SP_FPATRIARCH)
+ // Do not process the global page group shape (flag SP_FPATRIARCH)
bool bGlobalPageGroup = ::get_flag< sal_uInt32 >( rDffObjData.nSpFlags, SP_FPATRIARCH );
if( !xDrawObj || !xDrawObj->IsProcessSdrObj() || bGlobalPageGroup )
return 0; // simply return, xSdrObj will be destroyed
@@ -3332,7 +3412,7 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
if( ppTopLevelObj && bIsTopLevel )
*ppTopLevelObj = xDrawObj.get();
- // #119010# connectors don't have to be area objects
+ // connectors don't have to be area objects
if( dynamic_cast< SdrEdgeObj* >( xSdrObj.get() ) )
xDrawObj->SetAreaObj( false );
@@ -3352,7 +3432,7 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
xDrawObj->SetDffData( rDffObjData, aObjName, aHyperlink, bVisible, bAutoMargin );
/* Connect textbox data (string, alignment, text orientation) to object.
- #98132# don't ask for a text-ID, DFF export doesn't set one. */
+ don't ask for a text-ID, DFF export doesn't set one. */
if( XclImpTextObj* pTextObj = dynamic_cast< XclImpTextObj* >( xDrawObj.get() ) )
if( const XclImpObjTextData* pTextData = rConvData.mrDrawing.FindTextData( rDffObjData.rSpHd ) )
pTextObj->SetTextData( *pTextData );
@@ -3440,7 +3520,7 @@ sal_Bool XclImpDffConverter::InsertControl( const Reference< XFormComponent >& r
DBG_ERRORFILE( "XclImpDffConverter::InsertControl - cannot create form control" );
}
- return sal_False;
+ return false;
}
// private --------------------------------------------------------------------
@@ -3624,7 +3704,7 @@ XclImpDrawing::~XclImpDrawing()
{
}
-/*static*/ Graphic XclImpDrawing::ReadImgData( const XclImpRoot& rRoot, XclImpStream& rStrm )
+Graphic XclImpDrawing::ReadImgData( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
Graphic aGraphic;
sal_uInt16 nFormat, nEnv;
@@ -3666,7 +3746,7 @@ void XclImpDrawing::ReadObj( XclImpStream& rStrm )
DBG_ERROR_BIFF();
}
- if( xDrawObj.is() )
+ if( xDrawObj )
{
// insert into maRawObjs or into the last open group object
maRawObjs.InsertGrouped( xDrawObj );
@@ -3762,6 +3842,10 @@ sal_Size XclImpDrawing::GetProgressSize() const
void XclImpDrawing::ImplConvertObjects( XclImpDffConverter& rDffConv, SdrModel& rSdrModel, SdrPage& rSdrPage )
{
+ //rhbz#636521, disable undo during conversion. faster, smaller and stops
+ //temp objects being inserted into the undo list
+ bool bOrigUndoStatus = rSdrModel.IsUndoEnabled();
+ rSdrModel.EnableUndo(false);
// register this drawing manager at the passed (global) DFF manager
rDffConv.InitializeDrawing( *this, rSdrModel, rSdrPage );
// process list of objects to be skipped
@@ -3774,13 +3858,14 @@ void XclImpDrawing::ImplConvertObjects( XclImpDffConverter& rDffConv, SdrModel&
rDffConv.ProcessDrawing( maDffStrm );
// unregister this drawing manager at the passed (global) DFF manager
rDffConv.FinalizeDrawing();
+ rSdrModel.EnableUndo(bOrigUndoStatus);
}
// protected ------------------------------------------------------------------
void XclImpDrawing::AppendRawObject( const XclImpDrawObjRef& rxDrawObj )
{
- DBG_ASSERT( rxDrawObj.is(), "XclImpDrawing::AppendRawObject - unexpected empty reference" );
+ DBG_ASSERT( rxDrawObj, "XclImpDrawing::AppendRawObject - unexpected empty reference" );
maRawObjs.push_back( rxDrawObj );
}
@@ -3832,7 +3917,7 @@ void XclImpDrawing::ReadBmp( Graphic& rGraphic, const XclImpRoot& rRoot, XclImpS
// import the graphic from memory stream
aMemStrm.Seek( STREAM_SEEK_TO_BEGIN );
Bitmap aBitmap;
- if( aBitmap.Read( aMemStrm, sal_False ) ) // read DIB without file header
+ if( aBitmap.Read( aMemStrm, false ) ) // read DIB without file header
rGraphic = aBitmap;
}
@@ -3910,7 +3995,7 @@ void XclImpSheetDrawing::ReadNote( XclImpStream& rStrm )
void XclImpSheetDrawing::ReadTabChart( XclImpStream& rStrm )
{
DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF5 );
- ScfRef< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) );
+ boost::shared_ptr< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) );
xChartObj->ReadChartSubStream( rStrm );
// insert the chart as raw object without connected DFF data
AppendRawObject( xChartObj );
@@ -3990,27 +4075,27 @@ XclImpObjectManager::XclImpObjectManager( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot )
{
maDefObjNames[ EXC_OBJTYPE_GROUP ] = CREATE_STRING( "Group" );
- maDefObjNames[ EXC_OBJTYPE_LINE ] = CREATE_STRING( "Line" );
- maDefObjNames[ EXC_OBJTYPE_RECTANGLE ] = CREATE_STRING( "Rectangle" );
- maDefObjNames[ EXC_OBJTYPE_OVAL ] = CREATE_STRING( "Oval" );
+ maDefObjNames[ EXC_OBJTYPE_LINE ] = ScGlobal::GetRscString( STR_SHAPE_LINE );
+ maDefObjNames[ EXC_OBJTYPE_RECTANGLE ] = ScGlobal::GetRscString( STR_SHAPE_RECTANGLE );
+ maDefObjNames[ EXC_OBJTYPE_OVAL ] = ScGlobal::GetRscString( STR_SHAPE_OVAL );
maDefObjNames[ EXC_OBJTYPE_ARC ] = CREATE_STRING( "Arc" );
maDefObjNames[ EXC_OBJTYPE_CHART ] = CREATE_STRING( "Chart" );
maDefObjNames[ EXC_OBJTYPE_TEXT ] = CREATE_STRING( "Text" );
- maDefObjNames[ EXC_OBJTYPE_BUTTON ] = CREATE_STRING( "Button" );
+ maDefObjNames[ EXC_OBJTYPE_BUTTON ] = ScGlobal::GetRscString( STR_FORM_BUTTON );
maDefObjNames[ EXC_OBJTYPE_PICTURE ] = CREATE_STRING( "Picture" );
maDefObjNames[ EXC_OBJTYPE_POLYGON ] = CREATE_STRING( "Freeform" );
- maDefObjNames[ EXC_OBJTYPE_CHECKBOX ] = CREATE_STRING( "Check Box" );
- maDefObjNames[ EXC_OBJTYPE_OPTIONBUTTON ] = CREATE_STRING( "Option Button" );
+ maDefObjNames[ EXC_OBJTYPE_CHECKBOX ] = ScGlobal::GetRscString( STR_FORM_CHECKBOX );
+ maDefObjNames[ EXC_OBJTYPE_OPTIONBUTTON ] = ScGlobal::GetRscString( STR_FORM_OPTIONBUTTON );
maDefObjNames[ EXC_OBJTYPE_EDIT ] = CREATE_STRING( "Edit Box" );
- maDefObjNames[ EXC_OBJTYPE_LABEL ] = CREATE_STRING( "Label" );
+ maDefObjNames[ EXC_OBJTYPE_LABEL ] = ScGlobal::GetRscString( STR_FORM_LABEL );
maDefObjNames[ EXC_OBJTYPE_DIALOG ] = CREATE_STRING( "Dialog Frame" );
- maDefObjNames[ EXC_OBJTYPE_SPIN ] = CREATE_STRING( "Spinner" );
- maDefObjNames[ EXC_OBJTYPE_SCROLLBAR ] = CREATE_STRING( "Scroll Bar" );
- maDefObjNames[ EXC_OBJTYPE_LISTBOX ] = CREATE_STRING( "List Box" );
- maDefObjNames[ EXC_OBJTYPE_GROUPBOX ] = CREATE_STRING( "Group Box" );
- maDefObjNames[ EXC_OBJTYPE_DROPDOWN ] = CREATE_STRING( "Drop Down" );
+ maDefObjNames[ EXC_OBJTYPE_SPIN ] = ScGlobal::GetRscString( STR_FORM_SPINNER );
+ maDefObjNames[ EXC_OBJTYPE_SCROLLBAR ] = ScGlobal::GetRscString( STR_FORM_SCROLLBAR );
+ maDefObjNames[ EXC_OBJTYPE_LISTBOX ] = ScGlobal::GetRscString( STR_FORM_LISTBOX );
+ maDefObjNames[ EXC_OBJTYPE_GROUPBOX ] = ScGlobal::GetRscString( STR_FORM_GROUPBOX );
+ maDefObjNames[ EXC_OBJTYPE_DROPDOWN ] = ScGlobal::GetRscString( STR_FORM_DROPDOWN );
maDefObjNames[ EXC_OBJTYPE_NOTE ] = CREATE_STRING( "Comment" );
- maDefObjNames[ EXC_OBJTYPE_DRAWING ] = CREATE_STRING( "AutoShape" );
+ maDefObjNames[ EXC_OBJTYPE_DRAWING ] = ScGlobal::GetRscString( STR_SHAPE_AUTOSHAPE );
}
XclImpObjectManager::~XclImpObjectManager()
@@ -4118,3 +4203,4 @@ XclImpStream& operator>>( XclImpStream& rStrm, XclImpDffPropSet& rPropSet )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xiformula.cxx b/sc/source/filter/excel/xiformula.cxx
index 40c6ef9be374..c9927ff570fd 100644
--- a/sc/source/filter/excel/xiformula.cxx
+++ b/sc/source/filter/excel/xiformula.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,3 +126,4 @@ const ScTokenArray* XclImpFormulaCompiler::CreateFormula(
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx
index d1793fc00ec0..34a02e028070 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107,11 +108,6 @@ ScAddress XclImpAddressConverter::CreateValidAddress(
// cell range -----------------------------------------------------------------
-bool XclImpAddressConverter::CheckRange( const XclRange& rXclRange, bool bWarn )
-{
- return CheckAddress( rXclRange.maFirst, bWarn ) && CheckAddress( rXclRange.maLast, bWarn );
-}
-
bool XclImpAddressConverter::ConvertRange( ScRange& rScRange,
const XclRange& rXclRange, SCTAB nScTab1, SCTAB nScTab2, bool bWarn )
{
@@ -134,24 +130,8 @@ bool XclImpAddressConverter::ConvertRange( ScRange& rScRange,
return bValidStart;
}
-//UNUSED2009-05 ScRange XclImpAddressConverter::CreateValidRange(
-//UNUSED2009-05 const XclRange& rXclRange, SCTAB nScTab1, SCTAB nScTab2, bool bWarn )
-//UNUSED2009-05 {
-//UNUSED2009-05 return ScRange(
-//UNUSED2009-05 CreateValidAddress( rXclRange.maFirst, nScTab1, bWarn ),
-//UNUSED2009-05 CreateValidAddress( rXclRange.maLast, nScTab2, bWarn ) );
-//UNUSED2009-05 }
-
// cell range list ------------------------------------------------------------
-//UNUSED2009-05 bool XclImpAddressConverter::CheckRangeList( const XclRangeList& rXclRanges, bool bWarn )
-//UNUSED2009-05 {
-//UNUSED2009-05 for( XclRangeList::const_iterator aIt = rXclRanges.begin(), aEnd = rXclRanges.end(); aIt != aEnd; ++aIt )
-//UNUSED2009-05 if( !CheckRange( *aIt, bWarn ) )
-//UNUSED2009-05 return false;
-//UNUSED2009-05 return true;
-//UNUSED2009-05 }
-
void XclImpAddressConverter::ConvertRangeList( ScRangeList& rScRanges,
const XclRangeList& rXclRanges, SCTAB nScTab, bool bWarn )
{
@@ -251,12 +231,6 @@ EditTextObject* XclImpStringHelper::CreateTextObject(
return lclCreateTextObject( rRoot, rString, EXC_FONTITEM_EDITENG, 0 );
}
-//UNUSED2009-05 EditTextObject* XclImpStringHelper::CreateNoteObject(
-//UNUSED2009-05 const XclImpRoot& rRoot, const XclImpString& rString )
-//UNUSED2009-05 {
-//UNUSED2009-05 return lclCreateTextObject( rRoot, rString, EXC_FONTITEM_NOTE, 0 );
-//UNUSED2009-05 }
-
ScBaseCell* XclImpStringHelper::CreateCell(
const XclImpRoot& rRoot, const XclImpString& rString, sal_uInt16 nXFIndex )
{
@@ -622,7 +596,7 @@ namespace {
void lclAppendUrlChar( String& rUrl, sal_Unicode cChar )
{
- // #126855# encode special characters
+ // encode special characters
switch( cChar )
{
case '#': rUrl.AppendAscii( "%23" ); break;
@@ -866,7 +840,7 @@ XclImpCachedMatrix::XclImpCachedMatrix( XclImpStream& rStrm ) :
for( SCSIZE nScRow = 0; nScRow < mnScRows; ++nScRow )
for( SCSIZE nScCol = 0; nScCol < mnScCols; ++nScCol )
- maValueList.Append( new XclImpCachedValue( rStrm ) );
+ maValueList.push_back( new XclImpCachedValue( rStrm ) );
}
XclImpCachedMatrix::~XclImpCachedMatrix()
@@ -876,38 +850,38 @@ XclImpCachedMatrix::~XclImpCachedMatrix()
ScMatrixRef XclImpCachedMatrix::CreateScMatrix() const
{
ScMatrixRef xScMatrix;
- DBG_ASSERT( mnScCols * mnScRows == maValueList.Count(), "XclImpCachedMatrix::CreateScMatrix - element count mismatch" );
- if( mnScCols && mnScRows && static_cast< sal_uLong >( mnScCols * mnScRows ) <= maValueList.Count() )
+ DBG_ASSERT( mnScCols * mnScRows == maValueList.size(), "XclImpCachedMatrix::CreateScMatrix - element count mismatch" );
+ if( mnScCols && mnScRows && static_cast< sal_uLong >( mnScCols * mnScRows ) <= maValueList.size() )
{
xScMatrix = new ScMatrix( mnScCols, mnScRows );
- const XclImpCachedValue* pValue = maValueList.First();
+ XclImpValueList::const_iterator itValue = maValueList.begin();
for( SCSIZE nScRow = 0; nScRow < mnScRows; ++nScRow )
{
for( SCSIZE nScCol = 0; nScCol < mnScCols; ++nScCol )
{
- switch( pValue->GetType() )
+ switch( itValue->GetType() )
{
case EXC_CACHEDVAL_EMPTY:
// Excel shows 0.0 here, not an empty cell
xScMatrix->PutEmpty( nScCol, nScRow );
break;
case EXC_CACHEDVAL_DOUBLE:
- xScMatrix->PutDouble( pValue->GetValue(), nScCol, nScRow );
+ xScMatrix->PutDouble( itValue->GetValue(), nScCol, nScRow );
break;
case EXC_CACHEDVAL_STRING:
- xScMatrix->PutString( pValue->GetString(), nScCol, nScRow );
+ xScMatrix->PutString( itValue->GetString(), nScCol, nScRow );
break;
case EXC_CACHEDVAL_BOOL:
- xScMatrix->PutBoolean( pValue->GetBool(), nScCol, nScRow );
+ xScMatrix->PutBoolean( itValue->GetBool(), nScCol, nScRow );
break;
case EXC_CACHEDVAL_ERROR:
- xScMatrix->PutError( pValue->GetScError(), nScCol, nScRow );
+ xScMatrix->PutError( itValue->GetScError(), nScCol, nScRow );
break;
default:
DBG_ERRORFILE( "XclImpCachedMatrix::CreateScMatrix - unknown value type" );
xScMatrix->PutEmpty( nScCol, nScRow );
}
- pValue = maValueList.Next();
+ ++itValue;
}
}
}
@@ -916,3 +890,4 @@ ScMatrixRef XclImpCachedMatrix::CreateScMatrix() const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx
index dc2234570ea6..634a723238a6 100644
--- a/sc/source/filter/excel/xilink.cxx
+++ b/sc/source/filter/excel/xilink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,7 @@
#include "externalrefmgr.hxx"
#include <vector>
+#include <boost/ptr_container/ptr_vector.hpp>
using ::std::vector;
@@ -49,7 +51,10 @@ using ::std::vector;
// Cached external cells ======================================================
-/** Contains the address and value of an external referenced cell. */
+/**
+ * Contains the address and value of an external referenced cell.
+ * Note that this is non-copyable, so cannot be used in most stl/boost containers.
+ */
class XclImpCrn : public XclImpCachedValue
{
public:
@@ -81,7 +86,8 @@ public:
void LoadCachedValues(ScExternalRefCache::TableTypeRef pCacheTable);
private:
- typedef ScfDelList< XclImpCrn > XclImpCrnList;
+ typedef boost::shared_ptr< XclImpCrn > XclImpCrnRef;
+ typedef std::vector< XclImpCrnRef > XclImpCrnList;
XclImpCrnList maCrnList; /// List of CRN records (cached cell values).
String maTabName; /// Name of the external sheet.
@@ -128,8 +134,8 @@ public:
void LoadCachedValues();
private:
- typedef ScfDelList< XclImpSupbookTab > XclImpSupbookTabList;
- typedef ScfDelList< XclImpExtName > XclImpExtNameList;
+ typedef boost::ptr_vector< XclImpSupbookTab > XclImpSupbookTabList;
+ typedef boost::ptr_vector< XclImpExtName > XclImpExtNameList;
XclImpSupbookTabList maSupbTabList; /// All sheet names of the document.
XclImpExtNameList maExtNameList; /// All external names of the document.
@@ -206,24 +212,12 @@ private:
const XclImpXti* GetXti( sal_uInt16 nXtiIndex ) const;
/** Returns the specified SUPBOOK (external document). */
const XclImpSupbook* GetSupbook( sal_uInt16 nXtiIndex ) const;
-//UNUSED2009-05 /** Returns the SUPBOOK (external workbook) specified by its URL. */
-//UNUSED2009-05 const XclImpSupbook* GetSupbook( const String& rUrl ) const;
void LoadCachedValues();
-//UNUSED2009-05 /** Finds the largest range of sheet indexes in a SUPBOOK after a start sheet index.
-//UNUSED2009-05 @param rnSBTabFirst (out-param) The first sheet index of the range in SUPBOOK is returned here.
-//UNUSED2009-05 @param rnSBTabLast (out-param) The last sheet index of the range in SUPBOOK is returned here (inclusive).
-//UNUSED2009-05 @param nSupbook The list index of the SUPBOOK.
-//UNUSED2009-05 @param nSBTabStart The first allowed sheet index. Sheet ranges with an earlier start index are ignored.
-//UNUSED2009-05 @return true = the return values are valid; false = nothing found. */
-//UNUSED2009-05 bool FindNextTabRange(
-//UNUSED2009-05 sal_uInt16& rnSBTabFirst, sal_uInt16& rnSBTabLast,
-//UNUSED2009-05 sal_uInt16 nSupbook, sal_uInt16 nSBTabStart ) const;
-
private:
typedef ::std::vector< XclImpXti > XclImpXtiVector;
- typedef ScfDelList< XclImpSupbook > XclImpSupbookList;
+ typedef boost::ptr_vector< XclImpSupbook > XclImpSupbookList;
XclImpXtiVector maXtiList; /// List of all XTI structures.
XclImpSupbookList maSupbookList; /// List of external documents.
@@ -269,7 +263,7 @@ void XclImpTabInfo::ReadTabid( XclImpStream& rStrm )
maTabIdVec.clear();
maTabIdVec.reserve( nReadCount );
for( sal_Size nIndex = 0; rStrm.IsValid() && (nIndex < nReadCount); ++nIndex )
- // #93471# zero index is not allowed in BIFF8, but it seems that it occurs in real life
+ // zero index is not allowed in BIFF8, but it seems that it occurs in real life
maTabIdVec.push_back( rStrm.ReaduInt16() );
}
}
@@ -399,45 +393,47 @@ XclImpSupbookTab::~XclImpSupbookTab()
void XclImpSupbookTab::ReadCrn( XclImpStream& rStrm, const XclAddress& rXclPos )
{
- maCrnList.Append( new XclImpCrn( rStrm, rXclPos ) );
+ XclImpCrnRef crnRef( new XclImpCrn(rStrm, rXclPos) );
+ maCrnList.push_back( crnRef );
}
void XclImpSupbookTab::LoadCachedValues(ScExternalRefCache::TableTypeRef pCacheTable)
{
- if (maCrnList.Empty())
+ if (maCrnList.empty())
return;
- for (XclImpCrn* p = maCrnList.First(); p; p = maCrnList.Next())
+ for (XclImpCrnList::iterator itCrnRef = maCrnList.begin(); itCrnRef != maCrnList.end(); ++itCrnRef)
{
- const XclAddress& rAddr = p->GetAddress();
- switch (p->GetType())
+ const XclImpCrn* const pCrn = itCrnRef->get();
+ const XclAddress& rAddr = pCrn->GetAddress();
+ switch (pCrn->GetType())
{
case EXC_CACHEDVAL_BOOL:
{
- bool b = p->GetBool();
+ bool b = pCrn->GetBool();
ScExternalRefCache::TokenRef pToken(new formula::FormulaDoubleToken(b ? 1.0 : 0.0));
- pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
+ pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
case EXC_CACHEDVAL_DOUBLE:
{
- double f = p->GetValue();
+ double f = pCrn->GetValue();
ScExternalRefCache::TokenRef pToken(new formula::FormulaDoubleToken(f));
- pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
+ pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
case EXC_CACHEDVAL_ERROR:
{
- double fError = XclTools::ErrorToDouble( p->GetXclError() );
+ double fError = XclTools::ErrorToDouble( pCrn->GetXclError() );
ScExternalRefCache::TokenRef pToken(new formula::FormulaDoubleToken(fError));
- pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
+ pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
case EXC_CACHEDVAL_STRING:
{
- const String& rStr = p->GetString();
+ const String& rStr = pCrn->GetString();
ScExternalRefCache::TokenRef pToken(new formula::FormulaStringToken(rStr));
- pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
+ pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
default:
@@ -474,7 +470,7 @@ XclImpSupbook::XclImpSupbook( XclImpStream& rStrm ) :
if( maXclUrl.EqualsIgnoreCaseAscii( "\010EUROTOOL.XLA" ) )
{
meType = EXC_SBTYPE_EUROTOOL;
- maSupbTabList.Append( new XclImpSupbookTab( maXclUrl ) );
+ maSupbTabList.push_back( new XclImpSupbookTab( maXclUrl ) );
}
else if( nSBTabCnt )
{
@@ -482,14 +478,14 @@ XclImpSupbook::XclImpSupbook( XclImpStream& rStrm ) :
for( sal_uInt16 nSBTab = 0; nSBTab < nSBTabCnt; ++nSBTab )
{
String aTabName( rStrm.ReadUniString() );
- maSupbTabList.Append( new XclImpSupbookTab( aTabName ) );
+ maSupbTabList.push_back( new XclImpSupbookTab( aTabName ) );
}
}
else
{
meType = EXC_SBTYPE_SPECIAL;
// create dummy list entry
- maSupbTabList.Append( new XclImpSupbookTab( maXclUrl ) );
+ maSupbTabList.push_back( new XclImpSupbookTab( maXclUrl ) );
}
}
@@ -501,26 +497,28 @@ void XclImpSupbook::ReadXct( XclImpStream& rStrm )
void XclImpSupbook::ReadCrn( XclImpStream& rStrm )
{
- if( XclImpSupbookTab* pSBTab = maSupbTabList.GetObject( mnSBTab ) )
- {
- sal_uInt8 nXclColLast, nXclColFirst;
- sal_uInt16 nXclRow;
- rStrm >> nXclColLast >> nXclColFirst >> nXclRow;
+ if (mnSBTab >= maSupbTabList.size())
+ return;
+ XclImpSupbookTab& rSbTab = maSupbTabList[mnSBTab];
+ sal_uInt8 nXclColLast, nXclColFirst;
+ sal_uInt16 nXclRow;
+ rStrm >> nXclColLast >> nXclColFirst >> nXclRow;
- for( sal_uInt8 nXclCol = nXclColFirst; (nXclCol <= nXclColLast) && (rStrm.GetRecLeft() > 1); ++nXclCol )
- pSBTab->ReadCrn( rStrm, XclAddress( nXclCol, nXclRow ) );
- }
+ for( sal_uInt8 nXclCol = nXclColFirst; (nXclCol <= nXclColLast) && (rStrm.GetRecLeft() > 1); ++nXclCol )
+ rSbTab.ReadCrn( rStrm, XclAddress( nXclCol, nXclRow ) );
}
void XclImpSupbook::ReadExternname( XclImpStream& rStrm, ExcelToSc* pFormulaConv )
{
- maExtNameList.Append( new XclImpExtName( *this, rStrm, meType, pFormulaConv ) );
+ maExtNameList.push_back( new XclImpExtName( *this, rStrm, meType, pFormulaConv ) );
}
const XclImpExtName* XclImpSupbook::GetExternName( sal_uInt16 nXclIndex ) const
{
DBG_ASSERT( nXclIndex > 0, "XclImpSupbook::GetExternName - index must be >0" );
- return (meType == EXC_SBTYPE_SELF) ? 0 : maExtNameList.GetObject( nXclIndex - 1 );
+ if (meType == EXC_SBTYPE_SELF || nXclIndex >= maExtNameList.size())
+ return NULL;
+ return &maExtNameList.at( nXclIndex - 1 );
}
bool XclImpSupbook::GetLinkData( String& rApplic, String& rTopic ) const
@@ -537,22 +535,14 @@ const String& XclImpSupbook::GetMacroName( sal_uInt16 nXclNameIdx ) const
const String& XclImpSupbook::GetTabName( sal_uInt16 nXtiTab ) const
{
- if (maSupbTabList.Empty())
+ if (nXtiTab >= maSupbTabList.size())
return EMPTY_STRING;
-
- sal_uInt16 i = 0;
- for (XclImpSupbookTab* p = maSupbTabList.First(); p; p = maSupbTabList.Next(), ++i)
- {
- if (i == nXtiTab)
- return p->GetTabName();
- }
-
- return EMPTY_STRING;
+ return maSupbTabList[nXtiTab].GetTabName();
}
sal_uInt16 XclImpSupbook::GetTabCount() const
{
- return ulimit_cast<sal_uInt16>(maSupbTabList.Count());
+ return ulimit_cast<sal_uInt16>(maSupbTabList.size());
}
void XclImpSupbook::LoadCachedValues()
@@ -565,16 +555,11 @@ void XclImpSupbook::LoadCachedValues()
ScExternalRefManager* pRefMgr = GetRoot().GetDoc().GetExternalRefManager();
sal_uInt16 nFileId = pRefMgr->getExternalFileId(aAbsUrl);
- sal_uInt16 nCount = static_cast< sal_uInt16 >( maSupbTabList.Count() );
- for (sal_uInt16 i = 0; i < nCount; ++i)
+ for (XclImpSupbookTabList::iterator itTab = maSupbTabList.begin(); itTab != maSupbTabList.end(); ++itTab)
{
- XclImpSupbookTab* pTab = maSupbTabList.GetObject(i);
- if (!pTab)
- return;
-
- const String& rTabName = pTab->GetTabName();
+ const String& rTabName = itTab->GetTabName();
ScExternalRefCache::TableTypeRef pCacheTable = pRefMgr->getCacheTable(nFileId, rTabName, true);
- pTab->LoadCachedValues(pCacheTable);
+ itTab->LoadCachedValues(pCacheTable);
pCacheTable->setWholeTableCached();
}
}
@@ -608,25 +593,25 @@ void XclImpLinkManagerImpl::ReadExternsheet( XclImpStream& rStrm )
void XclImpLinkManagerImpl::ReadSupbook( XclImpStream& rStrm )
{
- maSupbookList.Append( new XclImpSupbook( rStrm ) );
+ maSupbookList.push_back( new XclImpSupbook( rStrm ) );
}
void XclImpLinkManagerImpl::ReadXct( XclImpStream& rStrm )
{
- if( XclImpSupbook* pSupbook = maSupbookList.Last() )
- pSupbook->ReadXct( rStrm );
+ if( !maSupbookList.empty() )
+ maSupbookList.back().ReadXct( rStrm );
}
void XclImpLinkManagerImpl::ReadCrn( XclImpStream& rStrm )
{
- if( XclImpSupbook* pSupbook = maSupbookList.Last() )
- pSupbook->ReadCrn( rStrm );
+ if( !maSupbookList.empty() )
+ maSupbookList.back().ReadCrn( rStrm );
}
void XclImpLinkManagerImpl::ReadExternname( XclImpStream& rStrm, ExcelToSc* pFormulaConv )
{
- if( XclImpSupbook* pSupbook = maSupbookList.Last() )
- pSupbook->ReadExternname( rStrm, pFormulaConv );
+ if( !maSupbookList.empty() )
+ maSupbookList.back().ReadExternname( rStrm, pFormulaConv );
}
bool XclImpLinkManagerImpl::IsSelfRef( sal_uInt16 nXtiIndex ) const
@@ -640,7 +625,7 @@ bool XclImpLinkManagerImpl::GetScTabRange(
{
if( const XclImpXti* pXti = GetXti( nXtiIndex ) )
{
- if (maSupbookList.GetObject(pXti->mnSupbook))
+ if (!maSupbookList.empty() && (pXti->mnSupbook < maSupbookList.size()) )
{
rnFirstScTab = pXti->mnSBTabFirst;
rnLastScTab = pXti->mnSBTabLast;
@@ -689,47 +674,22 @@ const XclImpXti* XclImpLinkManagerImpl::GetXti( sal_uInt16 nXtiIndex ) const
const XclImpSupbook* XclImpLinkManagerImpl::GetSupbook( sal_uInt16 nXtiIndex ) const
{
+ if ( maSupbookList.empty() )
+ return NULL;
const XclImpXti* pXti = GetXti( nXtiIndex );
- return pXti ? maSupbookList.GetObject( pXti->mnSupbook ) : 0;
+ if (!pXti || pXti->mnSupbook >= maSupbookList.size())
+ return NULL;
+ return &(maSupbookList.at( pXti->mnSupbook ));
}
-//UNUSED2009-05 const XclImpSupbook* XclImpLinkManagerImpl::GetSupbook( const String& rUrl ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 for( const XclImpSupbook* pSupbook = maSupbookList.First(); pSupbook; pSupbook = maSupbookList.Next() )
-//UNUSED2009-05 if( pSupbook->GetXclUrl() == rUrl )
-//UNUSED2009-05 return pSupbook;
-//UNUSED2009-05 return 0;
-//UNUSED2009-05 }
-
void XclImpLinkManagerImpl::LoadCachedValues()
{
// Read all CRN records which can be accessed via XclImpSupbook, and store
// the cached values to the external reference manager.
-
- sal_uInt32 nCount = maSupbookList.Count();
- for (sal_uInt16 nSupbook = 0; nSupbook < nCount; ++nSupbook)
- {
- XclImpSupbook* pSupbook = maSupbookList.GetObject(nSupbook);
- pSupbook->LoadCachedValues();
- }
+ for (XclImpSupbookList::iterator itSupbook = maSupbookList.begin(); itSupbook != maSupbookList.end(); ++itSupbook)
+ itSupbook->LoadCachedValues();
}
-//UNUSED2009-05 bool XclImpLinkManagerImpl::FindNextTabRange(
-//UNUSED2009-05 sal_uInt16& rnSBTabFirst, sal_uInt16& rnSBTabLast,
-//UNUSED2009-05 sal_uInt16 nSupbook, sal_uInt16 nSBTabStart ) const
-//UNUSED2009-05 {
-//UNUSED2009-05 rnSBTabFirst = rnSBTabLast = EXC_NOTAB;
-//UNUSED2009-05 for( const XclImpXti* pXti = maXtiList.First(); pXti; pXti = maXtiList.Next() )
-//UNUSED2009-05 {
-//UNUSED2009-05 if( (nSupbook == pXti->mnSupbook) && (nSBTabStart <= pXti->mnSBTabLast) && (pXti->mnSBTabFirst < rnSBTabFirst) )
-//UNUSED2009-05 {
-//UNUSED2009-05 rnSBTabFirst = ::std::max( nSBTabStart, pXti->mnSBTabFirst );
-//UNUSED2009-05 rnSBTabLast = pXti->mnSBTabLast;
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 return rnSBTabFirst != EXC_NOTAB;
-//UNUSED2009-05 }
-
// ============================================================================
XclImpLinkManager::XclImpLinkManager( const XclImpRoot& rRoot ) :
@@ -805,3 +765,4 @@ const String& XclImpLinkManager::GetMacroName( sal_uInt16 nExtSheet, sal_uInt16
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 956cb54f203c..b5eba95c6755 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,8 @@
#include "excform.hxx"
// for filter manager
#include "excimp8.hxx"
-
+#include "scextopt.hxx"
+#include "document.hxx"
// ============================================================================
// *** Implementation ***
// ============================================================================
@@ -129,12 +131,13 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
maScName = maXclName;
ScfTools::ConvertToScDefinedName( maScName );
}
+ rtl::OUString aRealOrigName = maScName;
// add index for local names
if( nXclTab != EXC_NAME_GLOBAL )
{
sal_uInt16 nUsedTab = (GetBiff() == EXC_BIFF8) ? nXclTab : nExtSheet;
- // #163146# do not rename sheet-local names by default, this breaks VBA scripts
+ // do not rename sheet-local names by default, this breaks VBA scripts
// maScName.Append( '_' ).Append( String::CreateFromInt32( nUsedTab ) );
// TODO: may not work for BIFF5, handle skipped sheets (all BIFF)
mnScTab = static_cast< SCTAB >( nUsedTab - 1 );
@@ -143,8 +146,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
// find an unused name
String aOrigName( maScName );
sal_Int32 nCounter = 0;
- sal_uInt16 nDummy;
- while( rRangeNames.SearchName( maScName, nDummy ) )
+ while( rRangeNames.findByName(maScName) )
maScName.Assign( aOrigName ).Append( ' ' ).Append( String::CreateFromInt32( ++nCounter ) );
// 3) *** convert the name definition formula *** -------------------------
@@ -160,16 +162,18 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
}
else if( bBuiltIn )
{
+ SCsTAB const nLocalTab = (nXclTab == EXC_NAME_GLOBAL) ? SCTAB_MAX : (nXclTab - 1);
+
// --- print ranges or title ranges ---
rStrm.PushPosition();
switch( mcBuiltIn )
{
case EXC_BUILTIN_PRINTAREA:
- if( rFmlaConv.Convert( GetPrintAreaBuffer(), rStrm, nFmlaSize, FT_RangeName ) == ConvOK )
+ if( rFmlaConv.Convert( GetPrintAreaBuffer(), rStrm, nFmlaSize, nLocalTab, FT_RangeName ) == ConvOK )
nNameType |= RT_PRINTAREA;
break;
case EXC_BUILTIN_PRINTTITLES:
- if( rFmlaConv.Convert( GetTitleAreaBuffer(), rStrm, nFmlaSize, FT_RangeName ) == ConvOK )
+ if( rFmlaConv.Convert( GetTitleAreaBuffer(), rStrm, nFmlaSize, nLocalTab, FT_RangeName ) == ConvOK )
nNameType |= RT_COLHEADER | RT_ROWHEADER;
break;
}
@@ -211,14 +215,33 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
// 4) *** create a defined name in the Calc document *** ------------------
- // #163146# do not ignore hidden names (may be regular names created by VBA scripts)
+ // do not ignore hidden names (may be regular names created by VBA scripts)
if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbFunction && !mbVBName )
{
// create the Calc name data
ScRangeData* pData = new ScRangeData( GetDocPtr(), maScName, *pTokArr, ScAddress(), nNameType );
pData->GuessPosition(); // calculate base position for relative refs
pData->SetIndex( nXclNameIdx ); // used as unique identifier in formulas
- rRangeNames.Insert( pData ); // takes ownership of pData
+ rRangeNames.insert( pData ); // takes ownership of pData
+ if( nXclTab != EXC_NAME_GLOBAL )
+ {
+ if (GetBiff() == EXC_BIFF8)
+ {
+ ScRange aRange;
+ // discard deleted ranges ( for the moment at least )
+ if ( pData->IsValidReference( aRange ) )
+ {
+ GetExtDocOptions().GetOrCreateTabSettings( nXclTab );
+ // create a mapping between the unmodified localname to
+ // the name in the global name container for named ranges
+ OSL_TRACE(" mapping local name to global name for tab %d which exists? %s", nXclTab, GetDoc().HasTable( mnScTab ) ? "true" : "false" );
+ SCTAB nTab( static_cast< SCTAB >( mnScTab ) );
+ NameToNameMap* pMap = GetDoc().GetLocalNameMap( nTab );
+ if ( pMap )
+ (*pMap)[ aRealOrigName ] = maScName;
+ }
+ }
+ }
mpScData = pData; // cache for later use
}
}
@@ -232,23 +255,23 @@ XclImpNameManager::XclImpNameManager( const XclImpRoot& rRoot ) :
void XclImpNameManager::ReadName( XclImpStream& rStrm )
{
- sal_uLong nCount = maNameList.Count();
+ sal_uLong nCount = maNameList.size();
if( nCount < 0xFFFF )
- maNameList.Append( new XclImpName( rStrm, static_cast< sal_uInt16 >( nCount + 1 ) ) );
+ maNameList.push_back( new XclImpName( rStrm, static_cast< sal_uInt16 >( nCount + 1 ) ) );
}
const XclImpName* XclImpNameManager::FindName( const String& rXclName, SCTAB nScTab ) const
{
const XclImpName* pGlobalName = 0; // a found global name
const XclImpName* pLocalName = 0; // a found local name
- for( const XclImpName* pName = maNameList.First(); pName && !pLocalName; pName = maNameList.Next() )
+ for( XclImpNameList::const_iterator itName = maNameList.begin(); itName != maNameList.end() && !pLocalName; ++itName )
{
- if( pName->GetXclName() == rXclName )
+ if( itName->GetXclName() == rXclName )
{
- if( pName->GetScTab() == nScTab )
- pLocalName = pName;
- else if( pName->IsGlobal() )
- pGlobalName = pName;
+ if( itName->GetScTab() == nScTab )
+ pLocalName = &(*itName);
+ else if( itName->IsGlobal() )
+ pGlobalName = &(*itName);
}
}
return pLocalName ? pLocalName : pGlobalName;
@@ -257,8 +280,9 @@ const XclImpName* XclImpNameManager::FindName( const String& rXclName, SCTAB nSc
const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const
{
DBG_ASSERT( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" );
- return maNameList.GetObject( nXclNameIdx - 1 );
+ return &(maNameList.at( nXclNameIdx - 1 ));
}
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx
index 38cebc2e6ca8..f40743c52146 100644
--- a/sc/source/filter/excel/xipage.cxx
+++ b/sc/source/filter/excel/xipage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -388,3 +389,4 @@ void XclImpPageSettings::Finalize()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 6073e47cc429..b6ba93124e0e 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -215,11 +216,6 @@ const XclImpPCField* XclImpPCField::GetGroupBaseField() const
return IsGroupChildField() ? mrPCache.GetField( maFieldInfo.mnGroupBase ) : 0;
}
-sal_uInt16 XclImpPCField::GetItemCount() const
-{
- return static_cast< sal_uInt16 >( maItems.size() );
-}
-
const XclImpPCItem* XclImpPCField::GetItem( sal_uInt16 nItemIdx ) const
{
return (nItemIdx < maItems.size()) ? maItems[ nItemIdx ].get() : 0;
@@ -423,7 +419,6 @@ void XclImpPCField::ConvertStdGroupField( ScDPSaveData& rSaveData, const ScfStri
if( rBaseFieldName.Len() > 0 )
{
// *** create a ScDPSaveGroupItem for each own item, they collect base item names ***
- typedef ::std::vector< ScDPSaveGroupItem > ScDPSaveGroupItemVec;
ScDPSaveGroupItemVec aGroupItems;
aGroupItems.reserve( maItems.size() );
// initialize with own item names
@@ -503,7 +498,7 @@ ScDPNumGroupInfo XclImpPCField::GetScNumGroupInfo() const
{
ScDPNumGroupInfo aNumInfo;
aNumInfo.Enable = sal_True;
- aNumInfo.DateValues = sal_False;
+ aNumInfo.DateValues = false;
aNumInfo.AutoStart = sal_True;
aNumInfo.AutoEnd = sal_True;
@@ -527,7 +522,7 @@ ScDPNumGroupInfo XclImpPCField::GetScDateGroupInfo() const
{
ScDPNumGroupInfo aDateInfo;
aDateInfo.Enable = sal_True;
- aDateInfo.DateValues = sal_False;
+ aDateInfo.DateValues = false;
aDateInfo.AutoStart = sal_True;
aDateInfo.AutoEnd = sal_True;
@@ -658,6 +653,22 @@ void XclImpPivotCache::ReadDconref( XclImpStream& rStrm )
GetAddressConverter().ConvertRange( maSrcRange, aXclRange, 0, 0, true );
}
+void XclImpPivotCache::ReadDConName( XclImpStream& rStrm )
+{
+ maSrcRangeName = rStrm.ReadUniString();
+
+ // This 2-byte value equals the length of string that follows, or if 0 it
+ // indicates that the name has a workbook scope. For now, we only support
+ // internal defined name with a workbook scope.
+ sal_uInt16 nFlag;
+ rStrm >> nFlag;
+ mbSelfRef = (nFlag == 0);
+
+ if (!mbSelfRef)
+ // External name is not supported yet.
+ maSrcRangeName = OUString();
+}
+
void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm )
{
if( (mnSrcType != EXC_SXVS_SHEET) && (mnSrcType != EXC_SXVS_EXTERN) )
@@ -671,18 +682,21 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm )
if( mbSelfRef )
{
- // try to find internal sheet containing the source data
- nScTab = GetTabInfo().GetScTabFromXclName( maTabName );
- if( rDoc.HasTable( nScTab ) )
- {
- // set sheet index to source range
- maSrcRange.aStart.SetTab( nScTab );
- maSrcRange.aEnd.SetTab( nScTab );
- }
- else
+ if (!maSrcRangeName.getLength())
{
- // create dummy sheet for deleted internal sheet
- bGenerateSource = true;
+ // try to find internal sheet containing the source data
+ nScTab = GetTabInfo().GetScTabFromXclName( maTabName );
+ if( rDoc.HasTable( nScTab ) )
+ {
+ // set sheet index to source range
+ maSrcRange.aStart.SetTab( nScTab );
+ maSrcRange.aEnd.SetTab( nScTab );
+ }
+ else
+ {
+ // create dummy sheet for deleted internal sheet
+ bGenerateSource = true;
+ }
}
}
else
@@ -784,7 +798,7 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm )
case EXC_ID_SXSTRING:
case EXC_ID_SXDATETIME:
case EXC_ID_SXEMPTY:
- if( xCurrField.is() ) // inline items
+ if( xCurrField ) // inline items
{
xCurrField->ReadItem( aPCStrm );
}
@@ -809,12 +823,12 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm )
break;
case EXC_ID_SXNUMGROUP:
- if( xCurrField.is() )
+ if( xCurrField )
xCurrField->ReadSxnumgroup( aPCStrm );
break;
case EXC_ID_SXGROUPINFO:
- if( xCurrField.is() )
+ if( xCurrField )
xCurrField->ReadSxgroupinfo( aPCStrm );
break;
@@ -855,6 +869,14 @@ bool XclImpPivotCache::IsRefreshOnLoad() const
return static_cast<bool>(maPCInfo.mnFlags & 0x0004);
}
+bool XclImpPivotCache::IsValid() const
+{
+ if (maSrcRangeName.getLength())
+ return true;
+
+ return maSrcRange.IsValid();
+}
+
// ============================================================================
// Pivot table
// ============================================================================
@@ -908,7 +930,7 @@ XclImpPTField::XclImpPTField( const XclImpPivotTable& rPTable, sal_uInt16 nCache
const XclImpPCField* XclImpPTField::GetCacheField() const
{
XclImpPivotCacheRef xPCache = mrPTable.GetPivotCache();
- return xPCache.is() ? xPCache->GetField( maFieldInfo.mnCacheIdx ) : 0;
+ return xPCache ? xPCache->GetField( maFieldInfo.mnCacheIdx ) : 0;
}
const String& XclImpPTField::GetFieldName() const
@@ -934,12 +956,6 @@ const String* XclImpPTField::GetItemName( sal_uInt16 nItemIdx ) const
return pItem ? pItem->GetItemName() : 0;
}
-const String* XclImpPTField::GetVisItemName( sal_uInt16 nItemIdx ) const
-{
- const XclImpPTItem* pItem = GetItem( nItemIdx );
- return pItem ? pItem->GetVisItemName() : 0;
-}
-
// records --------------------------------------------------------------------
void XclImpPTField::ReadSxvd( XclImpStream& rStrm )
@@ -982,7 +998,10 @@ void XclImpPTField::ConvertPageField( ScDPSaveData& rSaveData ) const
{
DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_PAGE, "XclImpPTField::ConvertPageField - no page field" );
if( ScDPSaveDimension* pSaveDim = ConvertRCPField( rSaveData ) )
- pSaveDim->SetCurrentPage( GetItemName( maPageInfo.mnSelItem ) );
+ {
+ const rtl::OUString aName = *GetItemName( maPageInfo.mnSelItem );
+ pSaveDim->SetCurrentPage( &aName );
+ }
}
// hidden fields --------------------------------------------------------------
@@ -1201,13 +1220,6 @@ XclImpPTField* XclImpPivotTable::GetFieldAcc( sal_uInt16 nFieldIdx )
return (nFieldIdx < maFields.size()) ? maFields[ nFieldIdx ].get() : 0;
}
-const String& XclImpPivotTable::GetFieldName( sal_uInt16 nFieldIdx ) const
-{
- if( const XclImpPTField* pField = GetField( nFieldIdx ) )
- return pField->GetFieldName();
- return EMPTY_STRING;
-}
-
const XclImpPTField* XclImpPivotTable::GetDataField( sal_uInt16 nDataFieldIdx ) const
{
if( nDataFieldIdx < maOrigDataFields.size() )
@@ -1255,13 +1267,13 @@ void XclImpPivotTable::ReadSxvd( XclImpStream& rStrm )
void XclImpPivotTable::ReadSxvi( XclImpStream& rStrm )
{
- if( mxCurrField.is() )
+ if( mxCurrField )
mxCurrField->ReadSxvi( rStrm );
}
void XclImpPivotTable::ReadSxvdex( XclImpStream& rStrm )
{
- if( mxCurrField.is() )
+ if( mxCurrField )
mxCurrField->ReadSxvdex( rStrm );
}
@@ -1345,7 +1357,7 @@ void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm )
void XclImpPivotTable::Convert()
{
- if( !mxPCache || !mxPCache->GetSourceRange().IsValid() )
+ if( !mxPCache || !mxPCache->IsValid() )
return;
ScDPSaveData aSaveData;
@@ -1354,7 +1366,7 @@ void XclImpPivotTable::Convert()
aSaveData.SetRowGrand( ::get_flag( maPTInfo.mnFlags, EXC_SXVIEW_ROWGRAND ) );
aSaveData.SetColumnGrand( ::get_flag( maPTInfo.mnFlags, EXC_SXVIEW_COLGRAND ) );
- aSaveData.SetFilterButton( sal_False );
+ aSaveData.SetFilterButton( false );
aSaveData.SetDrillDown( ::get_flag( maPTExtInfo.mnFlags, EXC_SXEX_DRILLDOWN ) );
// *** fields ***
@@ -1394,8 +1406,14 @@ void XclImpPivotTable::Convert()
// *** insert into Calc document ***
// create source descriptor
- ScSheetSourceDesc aDesc;
- aDesc.aSourceRange = mxPCache->GetSourceRange();
+ ScSheetSourceDesc aDesc(GetDocPtr());
+ const OUString& rSrcName = mxPCache->GetSourceRangeName();
+ if (rSrcName.getLength())
+ // Range name is the data source.
+ aDesc.SetRangeName(rSrcName);
+ else
+ // Normal cell range.
+ aDesc.SetSourceRange(mxPCache->GetSourceRange());
// adjust output range to include the page fields
ScRange aOutRange( maOutScRange );
@@ -1557,6 +1575,12 @@ void XclImpPivotTableManager::ReadDconref( XclImpStream& rStrm )
maPCaches.back()->ReadDconref( rStrm );
}
+void XclImpPivotTableManager::ReadDConName( XclImpStream& rStrm )
+{
+ if( !maPCaches.empty() )
+ maPCaches.back()->ReadDConName( rStrm );
+}
+
// pivot table records --------------------------------------------------------
void XclImpPivotTableManager::ReadSxview( XclImpStream& rStrm )
@@ -1636,3 +1660,4 @@ void XclImpPivotTableManager::MaybeRefreshPivotTables()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx
index 9f83dacf4ca0..9180ed401b62 100644
--- a/sc/source/filter/excel/xiroot.cxx
+++ b/sc/source/filter/excel/xiroot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,6 +83,7 @@ XclImpRoot::XclImpRoot( XclImpRootData& rImpRootData ) :
mrImpData.mxLinkMgr.reset( new XclImpLinkManager( GetRoot() ) );
mrImpData.mxSst.reset( new XclImpSst( GetRoot() ) );
mrImpData.mxCondFmtMgr.reset( new XclImpCondFormatManager( GetRoot() ) );
+ mrImpData.mxValidMgr.reset( new XclImpValidationManager( GetRoot() ) );
// TODO still in old RootData (deleted by RootData)
GetOldRoot().pAutoFilterBuffer = new XclImpAutoFilterBuffer;
mrImpData.mxWebQueryBfr.reset( new XclImpWebQueryBuffer( GetRoot() ) );
@@ -149,7 +151,7 @@ ExcelToSc& XclImpRoot::GetOldFmlaConverter() const
XclImpSst& XclImpRoot::GetSst() const
{
- DBG_ASSERT( mrImpData.mxSst.is(), "XclImpRoot::GetSst - invalid call, wrong BIFF" );
+ DBG_ASSERT( mrImpData.mxSst, "XclImpRoot::GetSst - invalid call, wrong BIFF" );
return *mrImpData.mxSst;
}
@@ -202,7 +204,7 @@ XclImpNameManager& XclImpRoot::GetNameManager() const
XclImpLinkManager& XclImpRoot::GetLinkManager() const
{
- DBG_ASSERT( mrImpData.mxLinkMgr.is(), "XclImpRoot::GetLinkManager - invalid call, wrong BIFF" );
+ DBG_ASSERT( mrImpData.mxLinkMgr, "XclImpRoot::GetLinkManager - invalid call, wrong BIFF" );
return *mrImpData.mxLinkMgr;
}
@@ -219,10 +221,16 @@ XclImpSheetDrawing& XclImpRoot::GetCurrSheetDrawing() const
XclImpCondFormatManager& XclImpRoot::GetCondFormatManager() const
{
- DBG_ASSERT( mrImpData.mxCondFmtMgr.is(), "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF" );
+ DBG_ASSERT( mrImpData.mxCondFmtMgr, "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF" );
return *mrImpData.mxCondFmtMgr;
}
+XclImpValidationManager& XclImpRoot::GetValidationManager() const
+{
+ DBG_ASSERT( mrImpData.mxValidMgr, "XclImpRoot::GetValidationManager - invalid call, wrong BIFF" );
+ return *mrImpData.mxValidMgr;
+}
+
XclImpAutoFilterBuffer& XclImpRoot::GetFilterManager() const
{
// TODO still in old RootData
@@ -232,25 +240,25 @@ XclImpAutoFilterBuffer& XclImpRoot::GetFilterManager() const
XclImpWebQueryBuffer& XclImpRoot::GetWebQueryBuffer() const
{
- DBG_ASSERT( mrImpData.mxWebQueryBfr.is(), "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF" );
+ DBG_ASSERT( mrImpData.mxWebQueryBfr, "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF" );
return *mrImpData.mxWebQueryBfr;
}
XclImpPivotTableManager& XclImpRoot::GetPivotTableManager() const
{
- DBG_ASSERT( mrImpData.mxPTableMgr.is(), "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF" );
+ DBG_ASSERT( mrImpData.mxPTableMgr, "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF" );
return *mrImpData.mxPTableMgr;
}
XclImpSheetProtectBuffer& XclImpRoot::GetSheetProtectBuffer() const
{
- DBG_ASSERT( mrImpData.mxTabProtect.is(), "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF" );
+ DBG_ASSERT( mrImpData.mxTabProtect, "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF" );
return *mrImpData.mxTabProtect;
}
XclImpDocProtectBuffer& XclImpRoot::GetDocProtectBuffer() const
{
- DBG_ASSERT( mrImpData.mxDocProtect.is(), "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF" );
+ DBG_ASSERT( mrImpData.mxDocProtect, "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF" );
return *mrImpData.mxDocProtect;
}
@@ -299,3 +307,5 @@ void XclImpRoot::ReadCodeName( XclImpStream& rStrm, bool bGlobals )
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index 534d40fa5cd5..9a4bcfb43d10 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -505,14 +506,14 @@ void XclImpStream::SetDecrypter( XclImpDecrypterRef xDecrypter )
void XclImpStream::CopyDecrypterFrom( const XclImpStream& rStrm )
{
XclImpDecrypterRef xNewDecr;
- if( rStrm.mxDecrypter.is() )
+ if( rStrm.mxDecrypter )
xNewDecr = rStrm.mxDecrypter->Clone();
SetDecrypter( xNewDecr );
}
bool XclImpStream::HasValidDecrypter() const
{
- return mxDecrypter.is() && mxDecrypter->IsValid();
+ return mxDecrypter && mxDecrypter->IsValid();
}
void XclImpStream::EnableDecryption( bool bEnable )
@@ -538,13 +539,6 @@ void XclImpStream::PopPosition()
}
}
-//UNUSED2008-05 void XclImpStream::RejectPosition()
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ASSERT( !maPosStack.empty(), "XclImpStream::RejectPosition - stack empty" );
-//UNUSED2008-05 if( !maPosStack.empty() )
-//UNUSED2008-05 maPosStack.pop_back();
-//UNUSED2008-05 }
-
void XclImpStream::StoreGlobalPosition()
{
StorePosition( maGlobPos );
@@ -737,13 +731,6 @@ XclImpStream& XclImpStream::operator>>( double& rfValue )
return *this;
}
-sal_Int8 XclImpStream::ReadInt8()
-{
- sal_Int8 nValue(0);
- operator>>( nValue );
- return nValue;
-}
-
sal_uInt8 XclImpStream::ReaduInt8()
{
sal_uInt8 nValue(0);
@@ -779,13 +766,6 @@ sal_uInt32 XclImpStream::ReaduInt32()
return nValue;
}
-float XclImpStream::ReadFloat()
-{
- float fValue(0.0);
- operator>>( fValue );
- return fValue;
-}
-
double XclImpStream::ReadDouble()
{
double fValue(0.0);
@@ -1022,11 +1002,6 @@ void XclImpStream::IgnoreUniString( sal_uInt16 nChars )
IgnoreUniString( nChars, ReaduInt8() );
}
-void XclImpStream::IgnoreUniString()
-{
- IgnoreUniString( ReaduInt16() );
-}
-
// ----------------------------------------------------------------------------
String XclImpStream::ReadRawByteString( sal_uInt16 nChars )
@@ -1068,7 +1043,7 @@ bool XclImpStream::ReadNextRawRecHeader()
void XclImpStream::SetupDecrypter()
{
- if( mxDecrypter.is() )
+ if( mxDecrypter )
mxDecrypter->Update( mrStrm, mnRawRecSize );
}
@@ -1164,3 +1139,4 @@ sal_uInt16 XclImpStream::ReadRawData( void* pData, sal_uInt16 nBytes )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx
index cb2645bec538..c50b0605e3ee 100644
--- a/sc/source/filter/excel/xistring.cxx
+++ b/sc/source/filter/excel/xistring.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,7 +82,7 @@ void XclImpString::Read( XclImpStream& rStrm, XclStrFlags nFlags )
sal_uInt16 nRunCount;
sal_uInt32 nExtInf;
rStrm.ReadUniStringExtHeader( b16Bit, bRich, bFarEast, nRunCount, nExtInf, nFlagField );
- // #122185# ignore the flags, they may be wrong
+ // ignore the flags, they may be wrong
// --- character array ---
maString = rStrm.ReadRawUniString( nChars, b16Bit );
@@ -211,3 +212,4 @@ XclImpStringIterator& XclImpStringIterator::operator++()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 0a57a5970800..290ce0eebdcf 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,6 +52,8 @@
#include <editeng/frmdiritem.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/flstitem.hxx>
+#include <editeng/justifyitem.hxx>
+#include <sal/macros.h>
#include "document.hxx"
#include "docpool.hxx"
#include "attrib.hxx"
@@ -58,17 +61,83 @@
#include "stlsheet.hxx"
#include "cell.hxx"
#include "globstr.hrc"
+#include "attarray.hxx"
#include "xltracer.hxx"
#include "xistream.hxx"
#include "xicontent.hxx"
#include "root.hxx"
#include "colrowst.hxx"
+#include "svl/poolcach.hxx"
+#include <list>
+
+using ::std::list;
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+using namespace ::com::sun::star;
+
+typedef ::cppu::WeakImplHelper1< container::XIndexAccess > XIndexAccess_BASE;
+typedef ::std::vector< ColorData > ColorDataVec;
+
+class PaletteIndex : public XIndexAccess_BASE
+{
+public:
+ PaletteIndex( const ColorDataVec& rColorDataTable ) : maColorData( rColorDataTable ) {}
+
+ // Methods XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException)
+ {
+ return maColorData.size();
+ }
+
+ virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ //--Index; // apparently the palette is already 1 based
+ return uno::makeAny( sal_Int32( maColorData[ Index ] ) );
+ }
+
+ // Methods XElementAcess
+ virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException)
+ {
+ return ::getCppuType( (sal_Int32*)0 );
+ }
+ virtual ::sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException)
+ {
+ return (maColorData.size() > 0);
+ }
+
+private:
+ ColorDataVec maColorData;
+};
+
+void
+XclImpPalette::ExportPalette()
+{
+ if( SfxObjectShell* pDocShell = mrRoot.GetDocShell() )
+ {
+ // copy values in color palette
+ sal_Int16 nColors = maColorTable.size();
+ ColorDataVec aColors;
+ aColors.resize( nColors );
+ for( sal_uInt16 nIndex = 0; nIndex < nColors; ++nIndex )
+ aColors[ nIndex ] = GetColorData( nIndex );
+
+ uno::Reference< beans::XPropertySet > xProps( pDocShell->GetModel(), uno::UNO_QUERY );
+ if ( xProps.is() )
+ {
+ uno::Reference< container::XIndexAccess > xIndex( new PaletteIndex( aColors ) );
+ xProps->setPropertyValue( CREATE_OUSTRING("ColorPalette"), uno::makeAny( xIndex ) );
+ }
+ }
+
+}
// PALETTE record - color information =========================================
XclImpPalette::XclImpPalette( const XclImpRoot& rRoot ) :
- XclDefaultPalette( rRoot )
+ XclDefaultPalette( rRoot ), mrRoot( rRoot )
{
}
@@ -115,6 +184,7 @@ void XclImpPalette::ReadPalette( XclImpStream& rStrm )
rStrm >> aColor;
maColorTable[ nIndex ] = aColor.GetColor();
}
+ ExportPalette();
}
// FONT record - font information =============================================
@@ -263,7 +333,7 @@ void XclImpFont::FillToItemSet( SfxItemSet& rItemSet, XclFontItemType eType, boo
SvxFontItem aFontItem( maData.GetScFamily( GetTextEncoding() ), maData.maName, EMPTY_STRING,
PITCH_DONTKNOW, eTempTextEnc, ATTR_FONT );
- // #91658# set only for valid script types
+ // set only for valid script types
if( mbHasWstrn )
PUTITEM( aFontItem, ATTR_FONT, EE_CHAR_FONTINFO );
if( mbHasAsian )
@@ -277,7 +347,7 @@ void XclImpFont::FillToItemSet( SfxItemSet& rItemSet, XclFontItemType eType, boo
{
sal_Int32 nHeight = maData.mnHeight;
if( bEE && (eType != EXC_FONTITEM_HF) ) // do not convert header/footer height
- nHeight = (nHeight * 127 + 36) / EXC_POINTS_PER_INCH; // #98527# 1 in == 72 pt
+ nHeight = (nHeight * 127 + 36) / EXC_POINTS_PER_INCH; // 1 in == 72 pt
SvxFontHeightItem aHeightItem( nHeight, 100, ATTR_FONT_HEIGHT );
PUTITEM( aHeightItem, ATTR_FONT_HEIGHT, EE_CHAR_FONTHEIGHT );
@@ -386,7 +456,7 @@ void XclImpFont::GuessScriptType()
mbHasWstrn = true;
mbHasAsian = mbHasCmplx = false;
- // #91658# #113783# find the script types for which the font contains characters
+ // find the script types for which the font contains characters
if( OutputDevice* pPrinter = GetPrinter() )
{
Font aFont( maData.maName, Size( 0, 10 ) );
@@ -395,7 +465,7 @@ void XclImpFont::GuessScriptType()
pPrinter->SetFont( aFont );
if( pPrinter->GetFontCharMap( aCharMap ) )
{
- // #91658# CJK fonts
+ // CJK fonts
mbHasAsian =
aCharMap.HasChar( 0x3041 ) || // 3040-309F: Hiragana
aCharMap.HasChar( 0x30A1 ) || // 30A0-30FF: Katakana
@@ -410,7 +480,7 @@ void XclImpFont::GuessScriptType()
aCharMap.HasChar( 0xCC01 ) || // AC00-D7AF: Hangul Syllables
aCharMap.HasChar( 0xF901 ) || // F900-FAFF: CJK Compatibility Ideographs
aCharMap.HasChar( 0xFF71 ); // FF00-FFEF: Halfwidth/Fullwidth Forms
- // #113783# CTL fonts
+ // CTL fonts
mbHasCmplx =
aCharMap.HasChar( 0x05D1 ) || // 0590-05FF: Hebrew
aCharMap.HasChar( 0x0631 ) || // 0600-06FF: Arabic
@@ -460,7 +530,7 @@ XclImpFontBuffer::XclImpFontBuffer( const XclImpRoot& rRoot ) :
void XclImpFontBuffer::Initialize()
{
- maFontList.Clear();
+ maFontList.clear();
// application font for column width calculation, later filled with first font from font list
XclFontData aAppFontData;
@@ -473,18 +543,25 @@ void XclImpFontBuffer::Initialize()
const XclImpFont* XclImpFontBuffer::GetFont( sal_uInt16 nFontIndex ) const
{
/* Font with index 4 is not stored in an Excel file, but used e.g. by
- BIFF5 form pushbutton objects. It is the bold default font. */
- return (nFontIndex == 4) ? &maFont4 :
- maFontList.GetObject( (nFontIndex < 4) ? nFontIndex : (nFontIndex - 1) );
+ BIFF5 form pushbutton objects. It is the bold default font.
+ This also means that entries above 4 are out by one in the list. */
+
+ if (nFontIndex == 4)
+ return &maFont4;
+
+ if (nFontIndex >= maFontList.size())
+ return NULL;
+
+ return (nFontIndex < 4) ? &(maFontList[nFontIndex]) : &(maFontList[nFontIndex - 1]);
}
void XclImpFontBuffer::ReadFont( XclImpStream& rStrm )
{
XclImpFont* pFont = new XclImpFont( GetRoot() );
pFont->ReadFont( rStrm );
- maFontList.Append( pFont );
+ maFontList.push_back( pFont );
- if( maFontList.Count() == 1 )
+ if( maFontList.size() == 1 )
{
UpdateAppFont( pFont->GetFontData(), pFont->HasCharSet() );
// #i71033# set text encoding from application font, if CODEPAGE is missing
@@ -494,8 +571,8 @@ void XclImpFontBuffer::ReadFont( XclImpStream& rStrm )
void XclImpFontBuffer::ReadEfont( XclImpStream& rStrm )
{
- if( XclImpFont* pFont = maFontList.Last() )
- pFont->ReadEfont( rStrm );
+ if( !maFontList.empty() )
+ maFontList.back().ReadEfont( rStrm );
}
void XclImpFontBuffer::FillToItemSet(
@@ -628,7 +705,7 @@ void XclImpNumFmtBuffer::FillScFmtToItemSet( SfxItemSet& rItemSet, sal_uLong nSc
{
DBG_ASSERT( nScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND, "XclImpNumFmtBuffer::FillScFmtToItemSet - invalid number format" );
ScfTools::PutItem( rItemSet, SfxUInt32Item( ATTR_VALUE_FORMAT, nScNumFmt ), bSkipPoolDefs );
- if( rItemSet.GetItemState( ATTR_VALUE_FORMAT, sal_False ) == SFX_ITEM_SET )
+ if( rItemSet.GetItemState( ATTR_VALUE_FORMAT, false ) == SFX_ITEM_SET )
ScGlobal::AddLanguage( rItemSet, GetFormatter() );
}
@@ -695,6 +772,7 @@ void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFo
{
// horizontal alignment
ScfTools::PutItem( rItemSet, SvxHorJustifyItem( GetScHorAlign(), ATTR_HOR_JUSTIFY ), bSkipPoolDefs );
+ ScfTools::PutItem( rItemSet, SvxJustifyMethodItem( GetScHorJustifyMethod(), ATTR_HOR_JUSTIFY_METHOD ), bSkipPoolDefs );
// text wrap (#i74508# always if vertical alignment is justified or distributed)
bool bLineBreak = mbLineBreak || (mnVerAlign == EXC_XF_VER_JUSTIFY) || (mnVerAlign == EXC_XF_VER_DISTRIB);
@@ -702,6 +780,7 @@ void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFo
// vertical alignment
ScfTools::PutItem( rItemSet, SvxVerJustifyItem( GetScVerAlign(), ATTR_VER_JUSTIFY ), bSkipPoolDefs );
+ ScfTools::PutItem( rItemSet, SvxJustifyMethodItem( GetScVerJustifyMethod(), ATTR_VER_JUSTIFY_METHOD ), bSkipPoolDefs );
// indent
sal_uInt16 nScIndent = mnIndent * 200; // 1 Excel unit == 10 pt == 200 twips
@@ -717,7 +796,7 @@ void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFo
// set an angle in the range from -90 to 90 degrees
sal_Int32 nAngle = XclTools::GetScRotation( nXclRot, 0 );
ScfTools::PutItem( rItemSet, SfxInt32Item( ATTR_ROTATE_VALUE, nAngle ), bSkipPoolDefs );
- // #105933# set "Use asian vertical layout", if cell is stacked and font contains CKJ characters
+ // set "Use asian vertical layout", if cell is stacked and font contains CKJ characters
bool bAsianVert = bStacked && pFont && pFont->HasAsianChars();
ScfTools::PutItem( rItemSet, SfxBoolItem( ATTR_VERTICAL_ASIAN, bAsianVert ), bSkipPoolDefs );
@@ -822,37 +901,45 @@ bool XclImpCellBorder::HasAnyOuterBorder() const
namespace {
+// TODO: These values are approximate; we should probably tweak these values
+// further to better match Excel's border thickness.
+#define XLS_LINE_WIDTH_HAIR 1
+#define XLS_LINE_WIDTH_THIN 6
+#define XLS_LINE_WIDTH_MEDIUM 18
+#define XLS_LINE_WIDTH_THICK 24
+
/** Converts the passed line style to a SvxBorderLine, or returns false, if style is "no line". */
bool lclConvertBorderLine( SvxBorderLine& rLine, const XclImpPalette& rPalette, sal_uInt8 nXclLine, sal_uInt16 nXclColor )
{
- static const sal_uInt16 ppnLineParam[][ 3 ] =
+ static const sal_uInt16 ppnLineParam[][ 4 ] =
{
- // outer width, inner width, distance
- { 0, 0, 0 }, // 0 = none
- { DEF_LINE_WIDTH_1, 0, 0 }, // 1 = thin
- { DEF_LINE_WIDTH_2, 0, 0 }, // 2 = medium
- { DEF_LINE_WIDTH_1, 0, 0 }, // 3 = dashed
- { DEF_LINE_WIDTH_0, 0, 0 }, // 4 = dotted
- { DEF_LINE_WIDTH_3, 0, 0 }, // 5 = thick
- { DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1 }, // 6 = double
- { DEF_LINE_WIDTH_0, 0, 0 }, // 7 = hair
- { DEF_LINE_WIDTH_2, 0, 0 }, // 8 = med dash
- { DEF_LINE_WIDTH_1, 0, 0 }, // 9 = thin dashdot
- { DEF_LINE_WIDTH_2, 0, 0 }, // A = med dashdot
- { DEF_LINE_WIDTH_1, 0, 0 }, // B = thin dashdotdot
- { DEF_LINE_WIDTH_2, 0, 0 }, // C = med dashdotdot
- { DEF_LINE_WIDTH_2, 0, 0 } // D = med slant dashdot
+ // outer width, inner width, distance type
+ { 0, 0, 0, SOLID }, // 0 = none
+ { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // 1 = thin
+ { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // 2 = medium
+ { XLS_LINE_WIDTH_THIN, 0, 0, DASHED }, // 3 = dashed
+ { XLS_LINE_WIDTH_THIN, 0, 0, DOTTED }, // 4 = dotted
+ { XLS_LINE_WIDTH_THICK, 0, 0, SOLID }, // 5 = thick
+ { XLS_LINE_WIDTH_THIN, XLS_LINE_WIDTH_THIN, XLS_LINE_WIDTH_THIN, SOLID }, // 6 = double
+ { XLS_LINE_WIDTH_HAIR, 0, 0, SOLID }, // 7 = hair
+ { XLS_LINE_WIDTH_MEDIUM, 0, 0, DASHED }, // 8 = med dash
+ { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // 9 = thin dashdot
+ { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // A = med dashdot
+ { XLS_LINE_WIDTH_THIN, 0, 0, SOLID }, // B = thin dashdotdot
+ { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID }, // C = med dashdotdot
+ { XLS_LINE_WIDTH_MEDIUM, 0, 0, SOLID } // D = med slant dashdot
};
if( nXclLine == EXC_LINE_NONE )
return false;
- if( nXclLine >= STATIC_TABLE_SIZE( ppnLineParam ) )
+ if( nXclLine >= SAL_N_ELEMENTS( ppnLineParam ) )
nXclLine = EXC_LINE_THIN;
rLine.SetColor( rPalette.GetColor( nXclColor ) );
rLine.SetOutWidth( ppnLineParam[ nXclLine ][ 0 ] );
rLine.SetInWidth( ppnLineParam[ nXclLine ][ 1 ] );
rLine.SetDistance( ppnLineParam[ nXclLine ][ 2 ] );
+ rLine.SetStyle( (SvxBorderStyle)ppnLineParam[ nXclLine ][ 3 ] );
return true;
}
@@ -962,7 +1049,7 @@ void XclImpCellArea::FillToItemSet( SfxItemSet& rItemSet, const XclImpPalette& r
{
SvxBrushItem aBrushItem( ATTR_BACKGROUND );
- // #108935# do not use IsTransparent() - old Calc filter writes tranparency with different color indexes
+ // do not use IsTransparent() - old Calc filter writes tranparency with different color indexes
if( mnPattern == EXC_PATT_NONE )
{
aBrushItem.SetColor( Color( COL_TRANSPARENT ) );
@@ -1122,7 +1209,7 @@ const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs )
/* Enables mb***Used flags, if the formatting attributes differ from
the passed XF record. In cell XFs Excel uses the cell attributes,
if they differ from the parent style XF.
- #109899# ...or if the respective flag is not set in parent style XF. */
+ ...or if the respective flag is not set in parent style XF. */
if( pParentXF )
{
if( !mbProtUsed )
@@ -1191,29 +1278,76 @@ const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs )
ScfTools::PutItem( rItemSet, SvxRotateModeItem( eRotateMode, ATTR_ROTATE_MODE ), bSkipPoolDefs );
}
+ // Excel's cell margins are different from Calc's default margins.
+ SvxMarginItem aItem(40, 40, 40, 40, ATTR_MARGIN);
+ ScfTools::PutItem(rItemSet, aItem, bSkipPoolDefs);
+
return *mpPattern;
}
-void XclImpXF::ApplyPattern(
- SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2,
- SCTAB nScTab, sal_uLong nForceScNumFmt )
+void XclImpXF::ApplyPatternToAttrList(
+ list<ScAttrEntry>& rAttrs, SCROW nRow1, SCROW nRow2, sal_uInt32 nForceScNumFmt)
{
// force creation of cell style and hard formatting, do it here to have mpStyleSheet
- const ScPatternAttr& rPattern = CreatePattern();
+ const ScPatternAttr& rOrigPat = CreatePattern();
+ ScPatternAttr aNewPat = rOrigPat;
+ const ScPatternAttr* pPat = NULL;
// insert into document
ScDocument& rDoc = GetDoc();
- if( IsCellXF() && mpStyleSheet )
- rDoc.ApplyStyleAreaTab( nScCol1, nScRow1, nScCol2, nScRow2, nScTab, *mpStyleSheet );
- if( HasUsedFlags() )
- rDoc.ApplyPatternAreaTab( nScCol1, nScRow1, nScCol2, nScRow2, nScTab, rPattern );
- // #108770# apply special number format
- if( nForceScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND )
+ if (IsCellXF() && mpStyleSheet)
{
- ScPatternAttr aPattern( GetDoc().GetPool() );
- GetNumFmtBuffer().FillScFmtToItemSet( aPattern.GetItemSet(), nForceScNumFmt );
- rDoc.ApplyPatternAreaTab( nScCol1, nScRow1, nScCol2, nScRow2, nScTab, aPattern );
+ // Style sheet exists. Create a copy of the original pattern.
+ aNewPat.SetStyleSheet(mpStyleSheet);
+ pPat = &aNewPat;
+ }
+
+ if (HasUsedFlags())
+ {
+ if (!pPat)
+ pPat = &aNewPat;
+
+ SfxItemPoolCache aCache(rDoc.GetPool(), &rOrigPat.GetItemSet());
+ pPat = static_cast<const ScPatternAttr*>(&aCache.ApplyTo(*pPat, true));
+ }
+
+ if (nForceScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND)
+ {
+ if (!pPat)
+ pPat = &aNewPat;
+
+ ScPatternAttr aNumPat(GetDoc().GetPool());
+ GetNumFmtBuffer().FillScFmtToItemSet(aNumPat.GetItemSet(), nForceScNumFmt);
+ SfxItemPoolCache aCache(rDoc.GetPool(), &aNumPat.GetItemSet());
+ pPat = static_cast<const ScPatternAttr*>(&aCache.ApplyTo(*pPat, true));
+ }
+
+
+ if (pPat)
+ {
+ // Check for a gap between the last entry and this one.
+ bool bHasGap = false;
+ if (rAttrs.empty() && nRow1 > 0)
+ // First attribute range doesn't start at row 0.
+ bHasGap = true;
+
+ if (!rAttrs.empty() && rAttrs.back().nRow + 1 < nRow1)
+ bHasGap = true;
+
+ if (bHasGap)
+ {
+ // Fill this gap with the default pattern.
+ ScAttrEntry aEntry;
+ aEntry.nRow = nRow1 - 1;
+ aEntry.pPattern = rDoc.GetDefPattern();
+ rAttrs.push_back(aEntry);
+ }
+
+ ScAttrEntry aEntry;
+ aEntry.nRow = nRow2;
+ aEntry.pPattern = static_cast<const ScPatternAttr*>(&rDoc.GetPool()->Put(*pPat));
+ rAttrs.push_back(aEntry);
}
}
@@ -1337,9 +1471,9 @@ XclImpXFBuffer::XclImpXFBuffer( const XclImpRoot& rRoot ) :
void XclImpXFBuffer::Initialize()
{
- maXFList.Clear();
- maBuiltinStyles.Clear();
- maUserStyles.Clear();
+ maXFList.clear();
+ maBuiltinStyles.clear();
+ maUserStyles.clear();
maStylesByXf.clear();
}
@@ -1347,14 +1481,14 @@ void XclImpXFBuffer::ReadXF( XclImpStream& rStrm )
{
XclImpXF* pXF = new XclImpXF( GetRoot() );
pXF->ReadXF( rStrm );
- maXFList.Append( pXF );
+ maXFList.push_back( pXF );
}
void XclImpXFBuffer::ReadStyle( XclImpStream& rStrm )
{
XclImpStyle* pStyle = new XclImpStyle( GetRoot() );
pStyle->ReadStyle( rStrm );
- (pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).Append( pStyle );
+ (pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).push_back( pStyle );
DBG_ASSERT( maStylesByXf.count( pStyle->GetXfId() ) == 0, "XclImpXFBuffer::ReadStyle - multiple styles with equal XF identifier" );
maStylesByXf[ pStyle->GetXfId() ] = pStyle;
}
@@ -1408,28 +1542,28 @@ void XclImpXFBuffer::CreateUserStyles()
/* Calculate names of built-in styles. Store styles with reserved names
in the aConflictNameStyles list. */
- for( XclImpStyle* pStyle = maBuiltinStyles.First(); pStyle; pStyle = maBuiltinStyles.Next() )
+ for( XclImpStyleList::iterator itStyle = maBuiltinStyles.begin(); itStyle != maBuiltinStyles.end(); ++itStyle )
{
- String aStyleName = XclTools::GetBuiltInStyleName( pStyle->GetBuiltinId(), pStyle->GetName(), pStyle->GetLevel() );
+ String aStyleName = XclTools::GetBuiltInStyleName( itStyle->GetBuiltinId(), itStyle->GetName(), itStyle->GetLevel() );
DBG_ASSERT( bReserveAll || (aCellStyles.count( aStyleName ) == 0),
"XclImpXFBuffer::CreateUserStyles - multiple styles with equal built-in identifier" );
if( aCellStyles.count( aStyleName ) > 0 )
- aConflictNameStyles.push_back( pStyle );
+ aConflictNameStyles.push_back( &(*itStyle) );
else
- aCellStyles[ aStyleName ] = pStyle;
+ aCellStyles[ aStyleName ] = &(*itStyle);
}
/* Calculate names of user defined styles. Store styles with reserved
names in the aConflictNameStyles list. */
- for( XclImpStyle* pStyle = maUserStyles.First(); pStyle; pStyle = maUserStyles.Next() )
+ for( XclImpStyleList::iterator itStyle = maUserStyles.begin(); itStyle != maUserStyles.end(); ++itStyle )
{
// #i1624# #i1768# ignore unnamed user styles
- if( pStyle->GetName().Len() > 0 )
+ if( itStyle->GetName().Len() > 0 )
{
- if( aCellStyles.count( pStyle->GetName() ) > 0 )
- aConflictNameStyles.push_back( pStyle );
+ if( aCellStyles.count( itStyle->GetName() ) > 0 )
+ aConflictNameStyles.push_back( &(*itStyle) );
else
- aCellStyles[ pStyle->GetName() ] = pStyle;
+ aCellStyles[ itStyle->GetName() ] = &(*itStyle);
}
}
@@ -1459,18 +1593,6 @@ ScStyleSheet* XclImpXFBuffer::CreateStyleSheet( sal_uInt16 nXFIndex )
return (aIt == maStylesByXf.end()) ? 0 : aIt->second->CreateStyleSheet();
}
-void XclImpXFBuffer::ApplyPattern(
- SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2,
- SCTAB nScTab, const XclImpXFIndex& rXFIndex )
-{
- if( XclImpXF* pXF = GetXF( rXFIndex.GetXFIndex() ) )
- {
- // #108770# set 'Standard' number format for all Boolean cells
- sal_uLong nForceScNumFmt = rXFIndex.IsBoolCell() ? GetNumFmtBuffer().GetStdScNumFmt() : NUMBERFORMAT_ENTRY_NOT_FOUND;
- pXF->ApplyPattern( nScCol1, nScRow1, nScCol2, nScRow2, nScTab, nForceScNumFmt );
- }
-}
-
// Buffer for XF indexes in cells =============================================
IMPL_FIXEDMEMPOOL_NEWDEL( XclImpXFRange, 100, 500 )
@@ -1511,10 +1633,10 @@ void XclImpXFRangeColumn::SetDefaultXF( const XclImpXFIndex& rXFIndex )
{
// List should be empty when inserting the default column format.
// Later explicit SetXF() calls will break up this range.
- DBG_ASSERT( maIndexList.Empty(), "XclImpXFRangeColumn::SetDefaultXF - Setting Default Column XF is not empty" );
+ DBG_ASSERT( maIndexList.empty(), "XclImpXFRangeColumn::SetDefaultXF - Setting Default Column XF is not empty" );
// insert a complete row range with one insert.
- maIndexList.Append( new XclImpXFRange( 0, MAXROW, rXFIndex ) );
+ maIndexList.push_back( new XclImpXFRange( 0, MAXROW, rXFIndex ) );
}
// ----------------------------------------------------------------------------
@@ -1540,7 +1662,7 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex )
SCROW nLastScRow = pPrevRange->mnScRow2;
sal_uLong nIndex = nNextIndex - 1;
XclImpXFRange* pThisRange = pPrevRange;
- pPrevRange = nIndex ? maIndexList.GetObject( nIndex - 1 ) : 0;
+ pPrevRange = (nIndex > 0 && nIndex <= maIndexList.size()) ? &(maIndexList[ nIndex - 1 ]) : 0;
if( nFirstScRow == nLastScRow ) // replace solely XF
{
@@ -1553,20 +1675,20 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex )
++(pThisRange->mnScRow1);
// try to concatenate with previous of this
if( !pPrevRange || !pPrevRange->Expand( nScRow, rXFIndex ) )
- maIndexList.Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
+ Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
}
else if( nLastScRow == nScRow ) // replace last XF
{
--(pThisRange->mnScRow2);
if( !pNextRange || !pNextRange->Expand( nScRow, rXFIndex ) )
- maIndexList.Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
+ Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
}
else // insert in the middle of the range
{
pThisRange->mnScRow1 = nScRow + 1;
// List::Insert() moves entries towards end of list, so insert twice at nIndex
- maIndexList.Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
- maIndexList.Insert( new XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex );
+ Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
+ Insert( new XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex );
}
return;
}
@@ -1582,24 +1704,29 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex )
return;
// create new range
- maIndexList.Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
+ Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
+}
+
+void XclImpXFRangeColumn::Insert(XclImpXFRange* pXFRange, sal_uLong nIndex)
+{
+ maIndexList.insert( maIndexList.begin() + nIndex, pXFRange );
}
void XclImpXFRangeColumn::Find(
XclImpXFRange*& rpPrevRange, XclImpXFRange*& rpNextRange,
- sal_uLong& rnNextIndex, SCROW nScRow ) const
+ sal_uLong& rnNextIndex, SCROW nScRow )
{
// test whether list is empty
- if( maIndexList.Empty() )
+ if( maIndexList.empty() )
{
rpPrevRange = rpNextRange = 0;
rnNextIndex = 0;
return;
}
- rpPrevRange = maIndexList.GetObject( 0 );
- rpNextRange = maIndexList.GetObject( maIndexList.Count() - 1 );
+ rpPrevRange = &maIndexList.front();
+ rpNextRange = &maIndexList.back();
// test whether row is at end of list (contained in or behind last range)
// rpPrevRange will contain a possible existing row
@@ -1607,7 +1734,7 @@ void XclImpXFRangeColumn::Find(
{
rpPrevRange = rpNextRange;
rpNextRange = 0;
- rnNextIndex = maIndexList.Count();
+ rnNextIndex = maIndexList.size();
return;
}
@@ -1625,12 +1752,12 @@ void XclImpXFRangeColumn::Find(
// if rpPrevRange contains nScRow (rpNextRange will never contain nScRow)
sal_uLong nPrevIndex = 0;
sal_uLong nMidIndex;
- rnNextIndex = maIndexList.Count() - 1;
+ rnNextIndex = maIndexList.size() - 1;
XclImpXFRange* pMidRange;
while( ((rnNextIndex - nPrevIndex) > 1) && (rpPrevRange->mnScRow2 < nScRow) )
{
nMidIndex = (nPrevIndex + rnNextIndex) / 2;
- pMidRange = maIndexList.GetObject( nMidIndex );
+ pMidRange = &maIndexList[nMidIndex];
DBG_ASSERT( pMidRange, "XclImpXFRangeColumn::Find - missing XF index range" );
if( nScRow < pMidRange->mnScRow1 ) // row is really before pMidRange
{
@@ -1648,22 +1775,20 @@ void XclImpXFRangeColumn::Find(
if( nScRow <= rpPrevRange->mnScRow2 )
{
rnNextIndex = nPrevIndex + 1;
- rpNextRange = maIndexList.GetObject( rnNextIndex );
+ rpNextRange = &maIndexList[rnNextIndex];
}
}
void XclImpXFRangeColumn::TryConcatPrev( sal_uLong nIndex )
{
- if( !nIndex )
+ if( !nIndex || nIndex >= maIndexList.size() )
return;
- XclImpXFRange* pPrevRange = maIndexList.GetObject( nIndex - 1 );
- XclImpXFRange* pNextRange = maIndexList.GetObject( nIndex );
- if( !pPrevRange || !pNextRange )
- return;
+ XclImpXFRange& prevRange = maIndexList[ nIndex - 1 ];
+ XclImpXFRange& nextRange = maIndexList[ nIndex ];
- if( pPrevRange->Expand( *pNextRange ) )
- maIndexList.Delete( nIndex );
+ if( prevRange.Expand( nextRange ) )
+ maIndexList.erase( maIndexList.begin() + nIndex );
}
// ----------------------------------------------------------------------------
@@ -1695,22 +1820,27 @@ void XclImpXFRangeBuffer::SetXF( const ScAddress& rScPos, sal_uInt16 nXFIndex, X
maColumns.resize( nIndex + 1 );
if( !maColumns[ nIndex ] )
maColumns[ nIndex ].reset( new XclImpXFRangeColumn );
- // #108770# remember all Boolean cells, they will get 'Standard' number format
+ // remember all Boolean cells, they will get 'Standard' number format
maColumns[ nIndex ]->SetXF( nScRow, XclImpXFIndex( nXFIndex, eMode == xlXFModeBoolCell ) );
// set "center across selection" and "fill" attribute for all following empty cells
- // #97130# ignore it on row default XFs
+ // ignore it on row default XFs
if( eMode != xlXFModeRow )
{
const XclImpXF* pXF = GetXFBuffer().GetXF( nXFIndex );
if( pXF && ((pXF->GetHorAlign() == EXC_XF_HOR_CENTER_AS) || (pXF->GetHorAlign() == EXC_XF_HOR_FILL)) )
{
// expand last merged range if this attribute is set repeatedly
- ScRange* pRange = maMergeList.Last();
- if( pRange && (pRange->aEnd.Row() == nScRow) && (pRange->aEnd.Col() + 1 == nScCol)
- && (eMode == xlXFModeBlank) )
- pRange->aEnd.IncCol();
- else if( eMode != xlXFModeBlank ) // #108781# do not merge empty cells
+ if ( !maMergeList.empty() )
+ {
+ ScRange* pRange = maMergeList.back();
+ if( (pRange->aEnd.Row() == nScRow)
+ && (pRange->aEnd.Col() + 1 == nScCol)
+ && (eMode == xlXFModeBlank)
+ )
+ pRange->aEnd.IncCol();
+ }
+ else if( eMode != xlXFModeBlank ) // do not merge empty cells
SetMerge( nScCol, nScRow );
}
}
@@ -1790,12 +1920,42 @@ void XclImpXFRangeBuffer::Finalize()
for( XclImpXFRangeColumnVec::const_iterator aVBeg = maColumns.begin(), aVEnd = maColumns.end(), aVIt = aVBeg; aVIt != aVEnd; ++aVIt )
{
// apply all cell styles of an existing column
- if( aVIt->is() )
+ if( aVIt->get() )
{
XclImpXFRangeColumn& rColumn = **aVIt;
SCCOL nScCol = static_cast< SCCOL >( aVIt - aVBeg );
- for( XclImpXFRange* pStyle = rColumn.First(); pStyle; pStyle = rColumn.Next() )
- rXFBuffer.ApplyPattern( nScCol, pStyle->mnScRow1, nScCol, pStyle->mnScRow2, nScTab, pStyle->maXFIndex );
+ list<ScAttrEntry> aAttrs;
+
+ for (XclImpXFRangeColumn::IndexList::iterator itr = rColumn.begin(), itrEnd = rColumn.end();
+ itr != itrEnd; ++itr)
+ {
+ XclImpXFRange& rStyle = *itr;
+ const XclImpXFIndex& rXFIndex = rStyle.maXFIndex;
+ XclImpXF* pXF = rXFBuffer.GetXF( rXFIndex.GetXFIndex() );
+ if (!pXF)
+ continue;
+
+ sal_uInt32 nForceScNumFmt = rXFIndex.IsBoolCell() ?
+ GetNumFmtBuffer().GetStdScNumFmt() : NUMBERFORMAT_ENTRY_NOT_FOUND;
+
+ pXF->ApplyPatternToAttrList(aAttrs, rStyle.mnScRow1, rStyle.mnScRow2, nForceScNumFmt);
+ }
+
+ if (aAttrs.empty() || aAttrs.back().nRow != MAXROW)
+ {
+ ScAttrEntry aEntry;
+ aEntry.nRow = MAXROW;
+ aEntry.pPattern = rDoc.GetDefPattern();
+ aAttrs.push_back(aEntry);
+ }
+
+ size_t nAttrSize = aAttrs.size();
+ ScAttrEntry* pData = new ScAttrEntry[nAttrSize];
+ list<ScAttrEntry>::const_iterator itr = aAttrs.begin(), itrEnd = aAttrs.end();
+ for (size_t i = 0; itr != itrEnd; ++itr, ++i)
+ pData[i] = *itr;
+
+ rDoc.SetAttrEntries(nScCol, nScTab, pData, static_cast<SCSIZE>(nAttrSize));
}
}
@@ -1804,8 +1964,9 @@ void XclImpXFRangeBuffer::Finalize()
XclImpHyperlink::InsertUrl( GetRoot(), aLIt->first, aLIt->second );
// apply cell merging
- for( const ScRange* pRange = maMergeList.First(); pRange; pRange = maMergeList.Next() )
+ for ( size_t i = 0, nRange = maMergeList.size(); i < nRange; ++i )
{
+ const ScRange* pRange = maMergeList[ i ];
const ScAddress& rStart = pRange->aStart;
const ScAddress& rEnd = pRange->aEnd;
bool bMultiCol = rStart.Col() != rEnd.Col();
@@ -1834,3 +1995,4 @@ void XclImpXFRangeBuffer::Finalize()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xiview.cxx b/sc/source/filter/excel/xiview.cxx
index 89f55c9b8d9e..1220b2afa0c6 100644
--- a/sc/source/filter/excel/xiview.cxx
+++ b/sc/source/filter/excel/xiview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -142,7 +143,7 @@ void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart )
sal_uInt16 nFlags;
rStrm >> nFlags >> maData.maFirstXclPos;
- // #i59590# #158194# real life: Excel ignores some view settings in chart sheets
+ // #i59590# real life: Excel ignores some view settings in chart sheets
maData.mbSelected = ::get_flag( nFlags, EXC_WIN2_SELECTED );
maData.mbDisplayed = ::get_flag( nFlags, EXC_WIN2_DISPLAYED );
maData.mbMirrored = !bChart && ::get_flag( nFlags, EXC_WIN2_MIRRORED );
@@ -274,6 +275,9 @@ void XclImpTabViewSettings::Finalize()
else
rTabSett.maGridColor = maData.maGridColor;
+ // show grid option
+ rTabSett.mbShowGrid = maData.mbShowGrid;
+
// view mode and zoom
if( maData.mnCurrentZoom != 0 )
(maData.mbPageMode ? maData.mnPageZoom : maData.mnNormalZoom) = maData.mnCurrentZoom;
@@ -288,7 +292,6 @@ void XclImpTabViewSettings::Finalize()
// set Excel sheet settings globally at Calc document, take settings from displayed sheet
ScViewOptions aViewOpt( rDoc.GetViewOptions() );
aViewOpt.SetOption( VOPT_FORMULAS, maData.mbShowFormulas );
- aViewOpt.SetOption( VOPT_GRID, maData.mbShowGrid );
aViewOpt.SetOption( VOPT_HEADER, maData.mbShowHeadings );
aViewOpt.SetOption( VOPT_NULLVALS, maData.mbShowZeros );
aViewOpt.SetOption( VOPT_OUTLINER, maData.mbShowOutline );
@@ -302,3 +305,4 @@ void XclImpTabViewSettings::Finalize()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx
index d0c1a925f8ab..64cd88908f22 100644
--- a/sc/source/filter/excel/xladdress.cxx
+++ b/sc/source/filter/excel/xladdress.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -159,3 +160,4 @@ bool XclAddressConverterBase::CheckScTab( SCTAB nScTab, bool bWarn )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 584d55021cd8..033468998ea5 100755..100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,6 +47,7 @@
#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
+#include <sal/macros.h>
#include <rtl/math.hxx>
#include <svl/itemset.hxx>
#include <svx/xfillit0.hxx>
@@ -423,7 +425,7 @@ sal_uInt16 XclChartHelper::GetSeriesLineAutoColorIdx( sal_uInt16 nFormatIdx )
17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 63
};
- return spnLineColors[ nFormatIdx % STATIC_TABLE_SIZE( spnLineColors ) ];
+ return spnLineColors[ nFormatIdx % SAL_N_ELEMENTS( spnLineColors ) ];
}
sal_uInt16 XclChartHelper::GetSeriesFillAutoColorIdx( sal_uInt16 nFormatIdx )
@@ -438,13 +440,13 @@ sal_uInt16 XclChartHelper::GetSeriesFillAutoColorIdx( sal_uInt16 nFormatIdx )
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23
};
- return spnFillColors[ nFormatIdx % STATIC_TABLE_SIZE( spnFillColors ) ];
+ return spnFillColors[ nFormatIdx % SAL_N_ELEMENTS( spnFillColors ) ];
}
sal_uInt8 XclChartHelper::GetSeriesFillAutoTransp( sal_uInt16 nFormatIdx )
{
static const sal_uInt8 spnTrans[] = { 0x00, 0x40, 0x20, 0x60, 0x70 };
- return spnTrans[ (nFormatIdx / 56) % STATIC_TABLE_SIZE( spnTrans ) ];
+ return spnTrans[ (nFormatIdx / 56) % SAL_N_ELEMENTS( spnTrans ) ];
}
sal_uInt16 XclChartHelper::GetAutoMarkerType( sal_uInt16 nFormatIdx )
@@ -453,14 +455,14 @@ sal_uInt16 XclChartHelper::GetAutoMarkerType( sal_uInt16 nFormatIdx )
EXC_CHMARKERFORMAT_DIAMOND, EXC_CHMARKERFORMAT_SQUARE, EXC_CHMARKERFORMAT_TRIANGLE,
EXC_CHMARKERFORMAT_CROSS, EXC_CHMARKERFORMAT_STAR, EXC_CHMARKERFORMAT_CIRCLE,
EXC_CHMARKERFORMAT_PLUS, EXC_CHMARKERFORMAT_DOWJ, EXC_CHMARKERFORMAT_STDDEV };
- return spnSymbols[ nFormatIdx % STATIC_TABLE_SIZE( spnSymbols ) ];
+ return spnSymbols[ nFormatIdx % SAL_N_ELEMENTS( spnSymbols ) ];
}
bool XclChartHelper::HasMarkerFillColor( sal_uInt16 nMarkerType )
{
static const bool spbFilled[] = {
false, true, true, true, false, false, false, false, true, false };
- return (nMarkerType < STATIC_TABLE_SIZE( spbFilled )) && spbFilled[ nMarkerType ];
+ return (nMarkerType < SAL_N_ELEMENTS( spbFilled )) && spbFilled[ nMarkerType ];
}
OUString XclChartHelper::GetErrorBarValuesRole( sal_uInt8 nBarType )
@@ -1072,19 +1074,19 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
const XclChEscherFormat& rEscherFmt, const XclChPicFormat& rPicFmt,
XclChPropertyMode ePropMode )
{
- if( rEscherFmt.mxItemSet.is() )
+ if( rEscherFmt.mxItemSet )
{
- if( const XFillStyleItem* pStyleItem = static_cast< const XFillStyleItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLSTYLE, sal_False ) ) )
+ if( const XFillStyleItem* pStyleItem = static_cast< const XFillStyleItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLSTYLE, false ) ) )
{
switch( pStyleItem->GetValue() )
{
case XFILL_SOLID:
// #i84812# Excel 2007 writes Escher properties for solid fill
- if( const XFillColorItem* pColorItem = static_cast< const XFillColorItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLCOLOR, sal_False ) ) )
+ if( const XFillColorItem* pColorItem = static_cast< const XFillColorItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLCOLOR, false ) ) )
{
namespace cssd = ::com::sun::star::drawing;
// get solid transparence too
- const XFillTransparenceItem* pTranspItem = static_cast< const XFillTransparenceItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLTRANSPARENCE, sal_False ) );
+ const XFillTransparenceItem* pTranspItem = static_cast< const XFillTransparenceItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLTRANSPARENCE, false ) );
sal_uInt16 nTransp = pTranspItem ? pTranspItem->GetValue() : 0;
ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
rAreaHlp.InitializeWrite();
@@ -1093,7 +1095,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
}
break;
case XFILL_GRADIENT:
- if( const XFillGradientItem* pGradItem = static_cast< const XFillGradientItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLGRADIENT, sal_False ) ) )
+ if( const XFillGradientItem* pGradItem = static_cast< const XFillGradientItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLGRADIENT, false ) ) )
{
Any aGradientAny;
if( pGradItem->QueryValue( aGradientAny, MID_FILLGRADIENT ) )
@@ -1111,7 +1113,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
}
break;
case XFILL_BITMAP:
- if( const XFillBitmapItem* pBmpItem = static_cast< const XFillBitmapItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLBITMAP, sal_False ) ) )
+ if( const XFillBitmapItem* pBmpItem = static_cast< const XFillBitmapItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLBITMAP, false ) ) )
{
Any aBitmapAny;
if( pBmpItem->QueryValue( aBitmapAny, MID_GRAFURL ) )
@@ -1345,3 +1347,5 @@ Reference< XShape > XclChRootData::GetTitleShape( const XclChTextKey& rTitleKey
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx
index 153a5d5ed3cc..bc693923532f 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,7 +79,7 @@ namespace {
/** Returns the scaling factor to calculate coordinates from twips. */
double lclGetTwipsScale( MapUnit eMapUnit )
{
- /* #111027# We cannot use OutputDevice::LogicToLogic() or the XclTools
+ /* We cannot use OutputDevice::LogicToLogic() or the XclTools
conversion functions to calculate drawing layer coordinates due to
Calc's strange definition of a point (1 inch == 72.27 points, instead
of 72 points). */
@@ -188,7 +189,7 @@ Rectangle XclObjAnchor::GetRect( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMa
lclGetXFromCol( rDoc, nScTab, maLast.mnCol, mnRX + 1, fScale ),
lclGetYFromRow( rDoc, nScTab, maLast.mnRow, mnBY, fScale ) );
- // #106948# adjust coordinates in mirrored sheets
+ // adjust coordinates in mirrored sheets
if( rDoc.IsLayoutRTL( nScTab ) )
lclMirrorRectangle( aRect );
return aRect;
@@ -200,7 +201,7 @@ void XclObjAnchor::SetRect( const XclRoot& rRoot, SCTAB nScTab, const Rectangle&
sal_uInt16 nXclMaxCol = rRoot.GetXclMaxPos().Col();
sal_uInt16 nXclMaxRow = static_cast<sal_uInt16>( rRoot.GetXclMaxPos().Row());
- // #106948# adjust coordinates in mirrored sheets
+ // adjust coordinates in mirrored sheets
Rectangle aRect( rRect );
if( rDoc.IsLayoutRTL( nScTab ) )
lclMirrorRectangle( aRect );
@@ -366,7 +367,7 @@ bool XclControlHelper::FillMacroDescriptor( ScriptEventDescriptor& rDescriptor,
}
String XclControlHelper::ExtractFromMacroDescriptor(
- const ScriptEventDescriptor& rDescriptor, XclTbxEventType eEventType )
+ const ScriptEventDescriptor& rDescriptor, XclTbxEventType eEventType, SfxObjectShell* /*pShell*/ )
{
if( (rDescriptor.ScriptCode.getLength() > 0) &&
rDescriptor.ScriptType.equalsIgnoreAsciiCaseAscii( "Script" ) &&
@@ -377,3 +378,5 @@ String XclControlHelper::ExtractFromMacroDescriptor(
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index e6c23bb63689..336de4ded284 100755
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -562,7 +563,7 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclTokenArray& rTokArr )
XclExpStream& operator<<( XclExpStream& rStrm, const XclTokenArrayRef& rxTokArr )
{
- if( rxTokArr.is() )
+ if( rxTokArr )
rxTokArr->Write( rStrm );
else
rStrm << sal_uInt16( 0 );
@@ -698,7 +699,7 @@ const ScTokenArray* XclTokenArrayHelper::GetSharedFormula( const XclRoot& rRoot,
if( rScTokArr.GetLen() == 1 )
if( const FormulaToken* pScToken = rScTokArr.GetArray()[ 0 ] )
if( pScToken->GetOpCode() == ocName )
- if( ScRangeData* pData = rRoot.GetNamedRanges().FindIndex( pScToken->GetIndex() ) )
+ if( ScRangeData* pData = rRoot.GetNamedRanges().findByIndex( pScToken->GetIndex() ) )
if( pData->HasType( RT_SHARED ) )
return pData->GetCode();
return 0;
@@ -784,3 +785,4 @@ bool XclTokenArrayHelper::GetMultipleOpRefs( XclMultipleOpRefs& rRefs, const ScT
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlpage.cxx b/sc/source/filter/excel/xlpage.cxx
index a59c6f761667..1fd4d155f5c4 100644
--- a/sc/source/filter/excel/xlpage.cxx
+++ b/sc/source/filter/excel/xlpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,10 +33,12 @@
#include <editeng/svxenum.hxx>
#include <editeng/paperinf.hxx>
#include <vcl/svapp.hxx>
+#include <sal/macros.h>
#include "scitems.hxx"
#include <editeng/brshitem.hxx>
#include "global.hxx"
#include "xlconst.hxx"
+#include <oox/core/xmlfilterbase.hxx>
// Paper size =================================================================
@@ -48,6 +51,8 @@ struct XclPaperSize
#define IN2TWIPS( v ) ((long)((v) * EXC_TWIPS_PER_INCH + 0.5))
#define MM2TWIPS( v ) ((long)((v) * EXC_TWIPS_PER_INCH / CM_PER_INCH / 10.0 + 0.5))
+#define TWIPS2MM( v ) ((long)((v - 0.5) / EXC_TWIPS_PER_INCH * CM_PER_INCH * 10.0))
+
static const XclPaperSize pPaperSizeTable[] =
{
@@ -189,6 +194,8 @@ void XclPageData::SetDefaults()
mfHdrLeftMargin = mfHdrRightMargin = XclTools::GetInchFromHmm( EXC_MARGIN_DEFAULT_HLR );
mfFtrLeftMargin = mfFtrRightMargin = XclTools::GetInchFromHmm( EXC_MARGIN_DEFAULT_FLR );
mnPaperSize = EXC_PAPERSIZE_DEFAULT;
+ mnPaperWidth = 0;
+ mnPaperHeight = 0;
mnCopies = 1;
mnStartPage = 0;
mnScaling = 100;
@@ -203,7 +210,7 @@ void XclPageData::SetDefaults()
Size XclPageData::GetScPaperSize() const
{
const XclPaperSize* pEntry = pPaperSizeTable;
- if( mnPaperSize < STATIC_TABLE_SIZE( pPaperSizeTable ) )
+ if( mnPaperSize < SAL_N_ELEMENTS( pPaperSizeTable ) )
pEntry += mnPaperSize;
Size aSize;
@@ -222,7 +229,7 @@ Size XclPageData::GetScPaperSize() const
return aSize;
}
-void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait )
+void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait, bool bStrictSize )
{
mbPortrait = bPortrait;
mnPaperSize = 0;
@@ -230,6 +237,20 @@ void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait )
long nHeight = bPortrait ? rSize.Height() : rSize.Width();
long nMaxWDiff = 80;
long nMaxHDiff = 50;
+
+ mnPaperWidth = TWIPS2MM( nWidth );
+ mnPaperHeight = TWIPS2MM( nHeight );
+ if( bStrictSize )
+ {
+ nMaxWDiff = 5;
+ nMaxHDiff = 5;
+ mnStrictPaperSize = EXC_PAPERSIZE_USER;
+ }
+ else
+ {
+ mnPaperSize = 0;
+ }
+
for( const XclPaperSize* pEntry = pPaperSizeTable; pEntry != STATIC_TABLE_END( pPaperSizeTable ); ++pEntry )
{
long nWDiff = Abs( pEntry->mnWidth - nWidth );
@@ -237,12 +258,20 @@ void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait )
if( ((nWDiff <= nMaxWDiff) && (nHDiff < nMaxHDiff)) ||
((nWDiff < nMaxWDiff) && (nHDiff <= nMaxHDiff)) )
{
- mnPaperSize = static_cast< sal_uInt16 >( pEntry - pPaperSizeTable );
+ sal_uInt16 nIndex = static_cast< sal_uInt16 >( pEntry - pPaperSizeTable );
+ if( !bStrictSize )
+ mnPaperSize = nIndex;
+ else
+ mnStrictPaperSize = mnPaperSize = nIndex;
+
nMaxWDiff = nWDiff;
nMaxHDiff = nHDiff;
}
}
+ if( !bStrictSize )
+ SetScPaperSize( rSize, bPortrait, sal_True );
}
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx
index ed7aadd0a410..68854d39a5c2 100644
--- a/sc/source/filter/excel/xlpivot.cxx
+++ b/sc/source/filter/excel/xlpivot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -293,11 +294,6 @@ bool XclPCField::IsStandardField() const
return meFieldType == EXC_PCFIELD_STANDARD;
}
-//UNUSED2008-05 bool XclPCField::IsCalculatedField() const
-//UNUSED2008-05 {
-//UNUSED2008-05 return meFieldType == EXC_PCFIELD_CALCED;
-//UNUSED2008-05 }
-
bool XclPCField::IsStdGroupField() const
{
return meFieldType == EXC_PCFIELD_STDGROUP;
@@ -1029,3 +1025,4 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo )
<< XclExpString(rInfo.maGrandTotalName, EXC_STR_DEFAULT, EXC_PT_MAXSTRLEN);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 43f98ff7cf03..418ae1d0f689 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -179,8 +180,9 @@ XclRoot::XclRoot( XclRootData& rRootData ) :
// filter tracer
// do not use CREATE_OUSTRING for conditional expression
- mrData.mxTracer.reset( new XclTracer( GetDocUrl(), OUString::createFromAscii(
- IsExport() ? "Office.Tracing/Export/Excel" : "Office.Tracing/Import/Excel" ) ) );
+ mrData.mxTracer.reset( new XclTracer( GetDocUrl(), IsExport() ?
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Tracing/Export/Excel"))
+ : OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Tracing/Import/Excel" )) ) );
}
XclRoot::XclRoot( const XclRoot& rRoot ) :
@@ -242,7 +244,18 @@ sal_Int32 XclRoot::GetHmmFromPixelY( double fPixelY ) const
return static_cast< sal_Int32 >( fPixelY * mrData.mfScreenPixelY + 0.5 );
}
-uno::Sequence< beans::NamedValue > XclRoot::RequestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
+double XclRoot::GetPixelXFromHmm( sal_Int32 nX ) const
+{
+ return static_cast< double >( (nX - 0.5) / mrData.mfScreenPixelX );
+}
+
+double XclRoot::GetPixelYFromHmm( sal_Int32 nY ) const
+{
+ return static_cast< double >( (nY - 0.5) / mrData.mfScreenPixelY );
+}
+
+
+String XclRoot::RequestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( mrData.maDefPassword );
@@ -358,8 +371,8 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const
ScEditEngineDefaulter& rEE = *mrData.mxEditEngine;
rEE.SetRefMapMode( MAP_100TH_MM );
rEE.SetEditTextObjectPool( GetDoc().GetEditPool() );
- rEE.SetUpdateMode( sal_False );
- rEE.EnableUndo( sal_False );
+ rEE.SetUpdateMode( false );
+ rEE.EnableUndo( false );
rEE.SetControlWord( rEE.GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS );
}
return *mrData.mxEditEngine;
@@ -372,8 +385,8 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
mrData.mxHFEditEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool(), sal_True ) );
ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine;
rEE.SetRefMapMode( MAP_TWIP ); // headers/footers use twips as default metric
- rEE.SetUpdateMode( sal_False );
- rEE.EnableUndo( sal_False );
+ rEE.SetUpdateMode( false );
+ rEE.EnableUndo( false );
rEE.SetControlWord( rEE.GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS );
// set Calc header/footer defaults
@@ -396,8 +409,8 @@ EditEngine& XclRoot::GetDrawEditEngine() const
mrData.mxDrawEditEng.reset( new EditEngine( &GetDoc().GetDrawLayer()->GetItemPool() ) );
EditEngine& rEE = *mrData.mxDrawEditEng;
rEE.SetRefMapMode( MAP_100TH_MM );
- rEE.SetUpdateMode( sal_False );
- rEE.EnableUndo( sal_False );
+ rEE.SetUpdateMode( false );
+ rEE.EnableUndo( false );
rEE.SetControlWord( rEE.GetControlWord() & ~EE_CNTRL_ALLOWBIGOBJS );
}
return *mrData.mxDrawEditEng;
@@ -425,3 +438,4 @@ XclTracer& XclRoot::GetTracer() const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index 4a48584da7fa..5062ecfe8f85 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include <com/sun/star/i18n/ScriptType.hpp>
#include <vcl/svapp.hxx>
#include <vcl/font.hxx>
+#include <sal/macros.h>
#include <rtl/tencinfo.h>
#include <toolkit/unohlp.hxx>
#include <editeng/svxfont.hxx>
@@ -111,20 +113,20 @@ XclDefaultPalette::XclDefaultPalette( const XclRoot& rRoot ) :
{
case EXC_BIFF2:
mpnColorTable = spnDefColorTable2;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable2 );
+ mnTableSize = SAL_N_ELEMENTS( spnDefColorTable2 );
break;
case EXC_BIFF3:
case EXC_BIFF4:
mpnColorTable = spnDefColorTable3;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable3 );
+ mnTableSize = SAL_N_ELEMENTS( spnDefColorTable3 );
break;
case EXC_BIFF5:
mpnColorTable = spnDefColorTable5;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable5 );
+ mnTableSize = SAL_N_ELEMENTS( spnDefColorTable5 );
break;
case EXC_BIFF8:
mpnColorTable = spnDefColorTable8;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable8 );
+ mnTableSize = SAL_N_ELEMENTS( spnDefColorTable8 );
break;
default:
DBG_ERROR_BIFF();
@@ -197,7 +199,7 @@ void XclFontData::Clear()
void XclFontData::FillFromVclFont( const Font& rFont )
{
- maName = XclTools::GetXclFontName( rFont.GetName() ); // #106246# substitute with MS fonts
+ maName = XclTools::GetXclFontName( rFont.GetName() ); // substitute with MS fonts
maStyle.Erase();
maColor = rFont.GetColor();
SetScUnderline( rFont.GetUnderline() );
@@ -468,12 +470,6 @@ void XclFontData::SetApiFamily( sal_Int16 nApiFamily )
}
}
-//UNUSED2009-05 void XclFontData::SetApiFontEncoding( sal_Int16 nApiFontEnc )
-//UNUSED2009-05 {
-//UNUSED2009-05 // API constants are equal to rtl_TextEncoding constants
-//UNUSED2009-05 SetFontEncoding( static_cast< rtl_TextEncoding >( nApiFontEnc ) );
-//UNUSED2009-05 }
-
void XclFontData::SetApiPosture( Awt::FontSlant eApiPosture )
{
mbItalic =
@@ -1492,12 +1488,6 @@ void XclNumFmtBuffer::InitializeImport()
maFmtMap.clear();
}
-//UNUSED2008-05 const XclNumFmt* XclNumFmtBuffer::GetFormat( sal_uInt16 nXclNumFmt ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 XclNumFmtMap::const_iterator aIt = maFmtMap.find( nXclNumFmt );
-//UNUSED2008-05 return (aIt != maFmtMap.end()) ? &aIt->second : 0;
-//UNUSED2008-05 }
-
void XclNumFmtBuffer::InsertFormat( sal_uInt16 nXclNumFmt, const String& rFormat )
{
XclNumFmt& rNumFmt = maFmtMap[ nXclNumFmt ];
@@ -1608,6 +1598,11 @@ SvxCellHorJustify XclCellAlign::GetScHorAlign() const
return eHorJust;
}
+SvxCellJustifyMethod XclCellAlign::GetScHorJustifyMethod() const
+{
+ return (mnHorAlign == EXC_XF_HOR_DISTRIB) ? SVX_JUSTIFY_METHOD_DISTRIBUTE : SVX_JUSTIFY_METHOD_AUTO;
+}
+
SvxCellVerJustify XclCellAlign::GetScVerAlign() const
{
SvxCellVerJustify eVerJust = SVX_VER_JUSTIFY_STANDARD;
@@ -1617,12 +1612,17 @@ SvxCellVerJustify XclCellAlign::GetScVerAlign() const
case EXC_XF_VER_CENTER: eVerJust = SVX_VER_JUSTIFY_CENTER; break;
case EXC_XF_VER_BOTTOM: eVerJust = SVX_VER_JUSTIFY_STANDARD; break;
case EXC_XF_VER_JUSTIFY:
- case EXC_XF_VER_DISTRIB: eVerJust = SVX_VER_JUSTIFY_TOP; break;
+ case EXC_XF_VER_DISTRIB: eVerJust = SVX_VER_JUSTIFY_BLOCK; break;
default: DBG_ERRORFILE( "XclCellAlign::GetScVerAlign - unknown vertical alignment" );
}
return eVerJust;
}
+SvxCellJustifyMethod XclCellAlign::GetScVerJustifyMethod() const
+{
+ return (mnVerAlign == EXC_XF_VER_DISTRIB) ? SVX_JUSTIFY_METHOD_DISTRIBUTE : SVX_JUSTIFY_METHOD_AUTO;
+}
+
SvxFrameDirection XclCellAlign::GetScFrameDir() const
{
SvxFrameDirection eFrameDir = FRMDIR_ENVIRONMENT;
@@ -1647,7 +1647,7 @@ void XclCellAlign::SetScHorAlign( SvxCellHorJustify eHorJust )
case SVX_HOR_JUSTIFY_BLOCK: mnHorAlign = EXC_XF_HOR_JUSTIFY; break;
case SVX_HOR_JUSTIFY_REPEAT: mnHorAlign = EXC_XF_HOR_FILL; break;
default: mnHorAlign = EXC_XF_HOR_GENERAL;
- DBG_ERROR( "XclCellAlign::SetScHorAlign - unknown horizontal alignment" );
+ OSL_FAIL( "XclCellAlign::SetScHorAlign - unknown horizontal alignment" );
}
}
@@ -1660,7 +1660,7 @@ void XclCellAlign::SetScVerAlign( SvxCellVerJustify eVerJust )
case SVX_VER_JUSTIFY_CENTER: mnVerAlign = EXC_XF_VER_CENTER; break;
case SVX_VER_JUSTIFY_BOTTOM: mnVerAlign = EXC_XF_VER_BOTTOM; break;
default: mnVerAlign = EXC_XF_VER_BOTTOM;
- DBG_ERROR( "XclCellAlign::SetScVerAlign - unknown vertical alignment" );
+ OSL_FAIL( "XclCellAlign::SetScVerAlign - unknown vertical alignment" );
}
}
@@ -1769,3 +1769,4 @@ bool XclXFBase::Equals( const XclXFBase& rCmp ) const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx
new file mode 100644
index 000000000000..749cb4808fb1
--- /dev/null
+++ b/sc/source/filter/excel/xltoolbar.cxx
@@ -0,0 +1,447 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Noel Power <noel.power@novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Noel Power <noel.power@novell.com>
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "xltoolbar.hxx"
+#include <rtl/ustrbuf.hxx>
+#include <stdarg.h>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XSingleComponentFactory.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+#include <com/sun/star/ui/ItemType.hpp>
+#include <fstream>
+#include <comphelper/processfactory.hxx>
+#include <vcl/graph.hxx>
+#include <map>
+using namespace com::sun::star;
+
+typedef std::map< sal_Int16, rtl::OUString > IdToString;
+
+class MSOExcelCommandConvertor : public MSOCommandConvertor
+{
+ IdToString msoToOOcmd;
+ IdToString tcidToOOcmd;
+public:
+ MSOExcelCommandConvertor();
+ virtual rtl::OUString MSOCommandToOOCommand( sal_Int16 msoCmd );
+ virtual rtl::OUString MSOTCIDToOOCommand( sal_Int16 key );
+};
+
+MSOExcelCommandConvertor::MSOExcelCommandConvertor()
+{
+/*
+ // mso command id to ooo command string
+ // #FIXME and *HUNDREDS* of id's to added here
+ msoToOOcmd[ 0x20b ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc") );
+ msoToOOcmd[ 0x50 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Open") );
+
+ // mso tcid to ooo command string
+ // #FIXME and *HUNDREDS* of id's to added here
+ tcidToOOcmd[ 0x9d9 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Print") );
+*/
+}
+
+rtl::OUString MSOExcelCommandConvertor::MSOCommandToOOCommand( sal_Int16 key )
+{
+ rtl::OUString sResult;
+ IdToString::iterator it = msoToOOcmd.find( key );
+ if ( it != msoToOOcmd.end() )
+ sResult = it->second;
+ return sResult;
+}
+
+rtl::OUString MSOExcelCommandConvertor::MSOTCIDToOOCommand( sal_Int16 key )
+{
+ rtl::OUString sResult;
+ IdToString::iterator it = tcidToOOcmd.find( key );
+ if ( it != tcidToOOcmd.end() )
+ sResult = it->second;
+ return sResult;
+}
+
+
+
+CTBS::CTBS() : bSignature(0), bVersion(0), reserved1(0), reserved2(0), reserved3(0), ctb(0), ctbViews(0), ictbView(0)
+{
+}
+
+CTB::CTB() : nViews( 0 ), ectbid(0)
+{
+}
+
+CTB::CTB(sal_uInt16 nNum ) : nViews( nNum ), ectbid(0)
+{
+}
+
+bool CTB::Read( SvStream *pS )
+{
+ OSL_TRACE("CTB::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ tb.Read( pS );
+ for ( sal_uInt16 index = 0; index < nViews; ++index )
+ {
+ TBVisualData aVisData;
+ aVisData.Read( pS );
+ rVisualData.push_back( aVisData );
+ }
+ *pS >> ectbid;
+
+ for ( sal_Int16 index = 0; index < tb.getcCL(); ++index )
+ {
+ TBC aTBC;
+ aTBC.Read( pS );
+ rTBC.push_back( aTBC );
+ }
+ return true;
+}
+
+void CTB::Print( FILE* fp )
+{
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] CTB -- dump\n", nOffSet );
+ indent_printf( fp, " nViews 0x%x\n", nViews);
+ tb.Print( fp );
+
+ std::vector<TBVisualData>::iterator visData_end = rVisualData.end();
+ sal_Int32 counter = 0;
+ for ( std::vector<TBVisualData>::iterator it = rVisualData.begin(); it != visData_end; ++it )
+ {
+
+ indent_printf( fp, " TBVisualData [%d]\n", counter++ );
+ Indent b;
+ it->Print( fp );
+ }
+ indent_printf( fp, " ectbid 0x%x\n", ectbid);
+ std::vector<TBC>::iterator it_end = rTBC.end();
+ counter = 0;
+ for ( std::vector<TBC>::iterator it = rTBC.begin(); it != it_end; ++it )
+ {
+ indent_printf( fp, " TBC [%d]\n", counter++);
+ Indent c;
+ it->Print( fp );
+ }
+}
+
+bool CTB::IsMenuToolbar()
+{
+ return tb.IsMenuToolbar();
+}
+
+bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xMenuDesc, CustomToolBarImportHelper& helper )
+{
+ sal_Int32 index = 0;
+ for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it, ++index )
+ {
+ if ( !it->ImportToolBarControl( rWrapper, xMenuDesc, helper, IsMenuToolbar() ) )
+ return false;
+ }
+ return true;
+}
+
+bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
+{
+
+ static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) );
+ bool bRes = false;
+ try
+ {
+ if ( !tb.IsEnabled() )
+ return true; // didn't fail, just ignoring
+
+ // Create default setting
+ uno::Reference< container::XIndexContainer > xIndexContainer( helper.getCfgManager()->createSettings(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xIndexAccess( xIndexContainer, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xIndexContainer, uno::UNO_QUERY_THROW );
+ WString& name = tb.getName();
+ // set UI name for toolbar
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ), uno::makeAny( name.getString() ) );
+
+ rtl::OUString sToolBarName = sToolbarPrefix.concat( name.getString() );
+ for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it )
+ {
+ if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, helper, IsMenuToolbar() ) )
+ return false;
+ }
+
+ OSL_TRACE("Name of toolbar :-/ %s", rtl::OUStringToOString( sToolBarName, RTL_TEXTENCODING_UTF8 ).getStr() );
+
+ helper.getCfgManager()->insertSettings( sToolBarName, xIndexAccess );
+ helper.applyIcons();
+
+ uno::Reference< ui::XUIConfigurationPersistence > xPersistence( helper.getCfgManager()->getImageManager(), uno::UNO_QUERY_THROW );
+ xPersistence->store();
+
+ xPersistence.set( helper.getCfgManager(), uno::UNO_QUERY_THROW );
+ xPersistence->store();
+
+ bRes = true;
+ }
+ catch( uno::Exception& )
+ {
+ bRes = false;
+ }
+ return bRes;
+}
+bool CTBS::Read( SvStream *pS )
+{
+ OSL_TRACE("CTBS::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> bSignature >> bVersion >> reserved1 >> reserved2 >> reserved3 >> ctb >> ctbViews >> ictbView;
+ return true;
+}
+
+void CTBS::Print( FILE* fp )
+{
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] CTBS -- dump\n", nOffSet );
+
+ indent_printf( fp, " bSignature 0x%x\n", bSignature);
+ indent_printf( fp, " bVersion 0x%x\n", bVersion);
+
+ indent_printf( fp, " reserved1 0x%x\n", reserved1 );
+ indent_printf( fp, " reserved2 0x%x\n", reserved2 );
+ indent_printf( fp, " reserved3 0x%x\n", reserved3 );
+
+ indent_printf( fp, " ctb 0x%x\n", ctb );
+ indent_printf( fp, " ctbViews 0x%x\n", ctbViews );
+ indent_printf( fp, " ictbView 0x%x\n", ictbView );
+}
+
+TBC::TBC()
+{
+}
+
+bool
+TBC::Read(SvStream *pS)
+{
+ OSL_TRACE("TBC::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ if ( !tbch.Read( pS ) )
+ return false;
+ sal_uInt16 tcid = tbch.getTcID();
+ sal_uInt8 tct = tbch.getTct();
+ if ( ( tcid != 0x0001 && tcid != 0x06CC && tcid != 0x03D8 && tcid != 0x03EC && tcid != 0x1051 ) && ( ( tct > 0 && tct < 0x0B ) || ( ( tct > 0x0B && tct < 0x10 ) || tct == 0x15 ) ) )
+ {
+ tbcCmd.reset( new TBCCmd );
+ if ( ! tbcCmd->Read( pS ) )
+ return false;
+ }
+ if ( tct != 0x16 )
+ {
+ tbcd.reset( new TBCData( tbch ) );
+ if ( !tbcd->Read( pS ) )
+ return false;
+ }
+ return true;
+}
+
+
+void
+TBC::Print(FILE* fp)
+{
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] TBC -- dump\n", nOffSet );
+ tbch.Print( fp );
+ if ( tbcCmd.get() )
+ tbcCmd->Print( fp );
+ if ( tbcd.get() )
+ tbcd->Print( fp );
+}
+
+bool TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuToolbar )
+{
+ // how to identify built-in-command ?
+// bool bBuiltin = false;
+ if ( tbcd.get() )
+ {
+ std::vector< css::beans::PropertyValue > props;
+ bool bBeginGroup = false;
+ if ( ! tbcd->ImportToolBarControl( helper, props, bBeginGroup, bIsMenuToolbar ) )
+ return false;
+ TBCMenuSpecific* pMenu = tbcd->getMenuSpecific();
+ if ( pMenu )
+ {
+ // search for CTB with the appropriate name ( it contains the
+ // menu items, although we cannot import ( or create ) a menu on
+ // a custom toolbar we can import the menu items in a separate
+ // toolbar ( better than nothing )
+ CTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() );
+ if ( pCustTB )
+ {
+ uno::Reference< container::XIndexContainer > xMenuDesc;
+ uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ xMenuDesc.set( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.IndexedPropertyValues" ) ) ), uno::UNO_QUERY_THROW );
+ if ( !pCustTB->ImportMenuTB( rWrapper, xMenuDesc, helper ) )
+ return false;
+ if ( !bIsMenuToolbar )
+ {
+ if ( !helper.createMenu( pMenu->Name(), uno::Reference< container::XIndexAccess >( xMenuDesc, uno::UNO_QUERY ), true ) )
+ return false;
+ }
+ else
+ {
+ beans::PropertyValue aProp;
+ aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ItemDescriptorContainer") );
+ aProp.Value <<= xMenuDesc;
+ props.push_back( aProp );
+ }
+ }
+ }
+
+ if ( bBeginGroup )
+ {
+ // insert spacer
+ uno::Sequence< beans::PropertyValue > sProps( 1 );
+ sProps[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Type") );
+ sProps[ 0 ].Value = uno::makeAny( ui::ItemType::SEPARATOR_LINE );
+ toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) );
+ }
+ uno::Sequence< beans::PropertyValue > sProps( props.size() );
+ beans::PropertyValue* pProp = sProps.getArray();
+
+ for ( std::vector< css::beans::PropertyValue >::iterator it = props.begin(); it != props.end(); ++it, ++pProp )
+ *pProp = *it;
+
+ toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) );
+ }
+ return true;
+}
+
+void
+TBCCmd::Print(FILE* fp)
+{
+ Indent a;
+ indent_printf( fp, " TBCCmd -- dump\n" );
+ indent_printf( fp, " cmdID 0x%x\n", cmdID );
+ indent_printf( fp, " A ( fHideDrawing ) %s\n", A ? "true" : "false" );
+ indent_printf( fp, " B ( reserved - ignored ) %s\n", A ? "true" : "false" );
+ indent_printf( fp, " cmdType 0x%x\n", cmdType );
+ indent_printf( fp, " C ( reserved - ignored ) %s\n", A ? "true" : "false" );
+ indent_printf( fp, " reserved3 0x%x\n", reserved3 );
+}
+
+bool TBCCmd::Read( SvStream *pS )
+{
+ OSL_TRACE("TBCCmd::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> cmdID;
+ sal_uInt16 temp;
+ *pS >> temp;
+ OSL_TRACE("TBCmd temp = 0x%x", temp );
+ A = (temp & 0x8000 ) == 0x8000;
+ B = (temp & 0x4000) == 0x4000;
+ cmdType = ( temp & 0x3E00 ) >> 9;
+ C = ( temp & 0x100 ) == 0x100;
+ reserved3 = ( temp & 0xFF );
+ return true;
+}
+
+CTBWrapper::CTBWrapper()
+{
+}
+
+CTBWrapper::~CTBWrapper()
+{
+}
+
+bool
+CTBWrapper::Read( SvStream *pS)
+{
+ OSL_TRACE("CTBWrapper::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ if ( !ctbSet.Read( pS ) )
+ return false;
+ for ( sal_uInt16 index = 0; index < ctbSet.ctb; ++index )
+ {
+ CTB aCTB( ctbSet.ctbViews );
+ if ( !aCTB.Read( pS ) )
+ return false;
+ rCTB.push_back( aCTB );
+ }
+ return true;
+}
+
+void
+CTBWrapper::Print( FILE* fp )
+{
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] CTBWrapper -- dump\n", nOffSet );
+ ctbSet.Print( fp );
+ std::vector<CTB>::iterator it_end = rCTB.end();
+ for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it )
+ {
+ Indent b;
+ it->Print( fp );
+ }
+}
+
+CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName )
+{
+ CTB* pCTB = NULL;
+ for ( std::vector< CTB >::iterator it = rCTB.begin(); it != rCTB.end(); ++it )
+ {
+ if ( it->GetName().equals( sTBName ) )
+ {
+ pCTB = &(*it);
+ break;
+ }
+ }
+ return pCTB;
+}
+
+bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh )
+{
+ std::vector<CTB>::iterator it_end = rCTB.end();
+ for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it )
+ {
+ // for each customtoolbar
+ uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW );
+ CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument" ) ) ) );
+ helper.setMSOCommandMap( new MSOExcelCommandConvertor() );
+ // Ignore menu toolbars, excel doesn't ( afaics ) store
+ // menu customizations ( but you can have menus in a customtoolbar
+ // such menus will be dealt with when they are encountered
+ // as part of importing the appropriate MenuSpecific toolbar control )
+
+
+ if ( !(*it).IsMenuToolbar() )
+ {
+ if ( !(*it).ImportCustomToolBar( *this, helper ) )
+ return false;
+ }
+ }
+ return true;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xltoolbar.hxx b/sc/source/filter/excel/xltoolbar.hxx
new file mode 100644
index 000000000000..22e2bcd71f41
--- /dev/null
+++ b/sc/source/filter/excel/xltoolbar.hxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Noel Power <noel.power@novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Noel Power <noel.power@novell.com>
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _XLTOOLBAR_HXX
+#define _XLTOOLBAR_HXX
+
+#include <filter/msfilter/mstoolbar.hxx>
+
+namespace css = ::com::sun::star;
+
+class CTBWrapper;
+// hmm I don't normally use these packed structures
+// but.. hey always good to do something different
+class TBCCmd : public TBBase
+{
+public:
+ TBCCmd() : cmdID(0), A(0), B(0), cmdType(0), C(0), reserved3(0) {}
+ sal_uInt16 cmdID;
+ sal_uInt16 A:1;
+ sal_uInt16 B:1;
+ sal_uInt16 cmdType:5;
+ sal_uInt16 C:1;
+ sal_uInt16 reserved3:8;
+ bool Read( SvStream* pS );
+ void Print(FILE* fp);
+};
+
+class TBC : public TBBase
+{
+ TBCHeader tbch;
+ boost::shared_ptr<TBCCmd> tbcCmd; // optional
+ boost::shared_ptr<TBCData> tbcd;
+public:
+ TBC();
+ ~TBC(){}
+ void Print( FILE* );
+ bool Read(SvStream *pS);
+ bool ImportToolBarControl( CTBWrapper&, const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar );
+};
+
+class CTB : public TBBase
+{
+ sal_uInt16 nViews;
+ TB tb;
+ std::vector<TBVisualData> rVisualData;
+ sal_uInt32 ectbid;
+ std::vector< TBC > rTBC;
+ bool ImportCustomToolBar_Impl( CTBWrapper&, CustomToolBarImportHelper& );
+public:
+ CTB();
+ CTB(sal_uInt16);
+ ~CTB(){}
+ void Print( FILE* );
+ bool Read(SvStream *pS);
+ bool IsMenuToolbar();
+ bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
+ bool ImportMenuTB( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
+ rtl::OUString GetName() { return tb.getName().getString(); }
+
+
+};
+
+class CTBS : public TBBase
+{
+public:
+ sal_uInt8 bSignature;
+ sal_uInt8 bVersion;
+ sal_uInt16 reserved1;
+ sal_uInt16 reserved2;
+ sal_uInt16 reserved3;
+ sal_uInt16 ctb;
+ sal_uInt16 ctbViews;
+ sal_uInt16 ictbView;
+ CTBS(const CTBS&);
+ CTBS& operator = ( const CTBS&);
+ CTBS();
+ ~CTBS(){}
+ void Print( FILE* );
+ bool Read(SvStream *pS);
+};
+
+class CTBWrapper : public TBBase
+{
+ CTBS ctbSet;
+
+ std::vector< CTB > rCTB;
+
+public:
+ CTBWrapper();
+ ~CTBWrapper();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ bool ImportCustomToolBar( SfxObjectShell& rDocSh );
+ CTB* GetCustomizationData( const rtl::OUString& name );
+};
+
+
+#endif //_XLTOOLBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx
index d62a51f5388f..0d0b63c0ebc7 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include <sal/mathconf.h>
#include <unotools/fontcvt.hxx>
#include <sfx2/objsh.hxx>
+#include <sal/macros.h>
#include <editeng/editstat.hxx>
#include <filter/msfilter/msvbahelper.hxx>
#include "xestream.hxx"
@@ -357,7 +359,7 @@ Color XclTools::GetPatternColor( const Color& rPattColor, const Color& rBackColo
0x40, 0x40, 0x20, 0x60, 0x60, 0x60, 0x60, 0x48, // 08 - 15
0x50, 0x70, 0x78 // 16 - 18
};
- return (nXclPattern < STATIC_TABLE_SIZE( pnRatioTable )) ?
+ return (nXclPattern < SAL_N_ELEMENTS( pnRatioTable )) ?
ScfTools::GetMixedColor( rPattColor, rBackColor, pnRatioTable[ nXclPattern ] ) : rPattColor;
}
@@ -456,7 +458,7 @@ sal_uInt16 XclTools::GetXclCodePage( rtl_TextEncoding eTextEnc )
String XclTools::GetXclFontName( const String& rFontName )
{
- // #106246# substitute with MS fonts
+ // substitute with MS fonts
String aNewName( GetSubsFontName( rFontName, SUBSFONT_ONLYONE | SUBSFONT_MS ) );
if( aNewName.Len() )
return aNewName;
@@ -487,10 +489,10 @@ static const sal_Char* const ppcDefNames[] =
String XclTools::GetXclBuiltInDefName( sal_Unicode cBuiltIn )
{
- DBG_ASSERT( STATIC_TABLE_SIZE( ppcDefNames ) == EXC_BUILTIN_UNKNOWN,
+ DBG_ASSERT( SAL_N_ELEMENTS( ppcDefNames ) == EXC_BUILTIN_UNKNOWN,
"XclTools::GetXclBuiltInDefName - built-in defined name list modified" );
String aDefName;
- if( cBuiltIn < STATIC_TABLE_SIZE( ppcDefNames ) )
+ if( cBuiltIn < SAL_N_ELEMENTS( ppcDefNames ) )
aDefName.AssignAscii( ppcDefNames[ cBuiltIn ] );
else
aDefName = String::CreateFromInt32( cBuiltIn );
@@ -554,7 +556,7 @@ String XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, const String& rName, s
else
{
aStyleName = maStyleNamePrefix1;
- if( nStyleId < STATIC_TABLE_SIZE( ppcStyleNames ) )
+ if( nStyleId < SAL_N_ELEMENTS( ppcStyleNames ) )
aStyleName.AppendAscii( ppcStyleNames[ nStyleId ] );
else if( rName.Len() > 0 )
aStyleName.Append( rName );
@@ -594,7 +596,7 @@ bool XclTools::IsBuiltInStyleName( const String& rStyleName, sal_uInt8* pnStyleI
if( nPrefixLen > 0 )
{
String aShortName;
- for( sal_uInt8 nId = 0; nId < STATIC_TABLE_SIZE( ppcStyleNames ); ++nId )
+ for( sal_uInt8 nId = 0; nId < SAL_N_ELEMENTS( ppcStyleNames ); ++nId )
{
if( nId != EXC_STYLE_NORMAL )
{
@@ -689,7 +691,7 @@ void XclTools::SkipSubStream( XclImpStream& rStrm )
// Basic macro names ----------------------------------------------------------
-const OUString XclTools::maSbMacroPrefix( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:Standard." ) );
+const OUString XclTools::maSbMacroPrefix( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:" ) );
const OUString XclTools::maSbMacroSuffix( RTL_CONSTASCII_USTRINGPARAM( "?language=Basic&location=document" ) );
OUString XclTools::GetSbMacroUrl( const String& rMacroName, SfxObjectShell* pDocShell )
@@ -714,7 +716,10 @@ String XclTools::GetXclMacroName( const OUString& rSbMacroUrl )
sal_Int32 nMacroNameLen = nSbMacroUrlLen - maSbMacroPrefix.getLength() - maSbMacroSuffix.getLength();
if( (nMacroNameLen > 0) && rSbMacroUrl.matchIgnoreAsciiCase( maSbMacroPrefix, 0 ) &&
rSbMacroUrl.matchIgnoreAsciiCase( maSbMacroSuffix, nSbMacroUrlLen - maSbMacroSuffix.getLength() ) )
- return rSbMacroUrl.copy( maSbMacroPrefix.getLength(), nMacroNameLen );
+ {
+ sal_Int32 nPrjDot = rSbMacroUrl.indexOf( '.', maSbMacroPrefix.getLength() ) + 1;
+ return rSbMacroUrl.copy( nPrjDot, nSbMacroUrlLen - nPrjDot - maSbMacroSuffix.getLength() );
+ }
return String::EmptyString();
}
@@ -734,3 +739,5 @@ XclExpStream& operator<<( XclExpStream& rStrm, const Color& rColor )
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xltracer.cxx b/sc/source/filter/excel/xltracer.cxx
index 7dadbde8198a..a5351a1da9bf 100644
--- a/sc/source/filter/excel/xltracer.cxx
+++ b/sc/source/filter/excel/xltracer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -242,12 +243,6 @@ void XclTracer::TraceChartLegendPosition()
ProcessTraceOnce(eChartLegendPosition);
}
-void XclTracer::TraceChartEmbeddedObj()
-{
- // drawing objects e.g. text boxes etc not supported inside charts
- ProcessTraceOnce(eChartEmbeddedObj);
-}
-
void XclTracer::TraceUnsupportedObjects()
{
// Called from Excel 5.0 - limited Graphical object support.
@@ -268,3 +263,4 @@ void XclTracer::TraceDVType( bool bType)
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xlview.cxx b/sc/source/filter/excel/xlview.cxx
index 8e9df7e0ac1f..63512e4ec2d5 100644
--- a/sc/source/filter/excel/xlview.cxx
+++ b/sc/source/filter/excel/xlview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,3 +114,4 @@ XclSelectionData& XclTabViewData::CreateSelectionData( sal_uInt8 nPane )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 185923b28277..3e96a92d6485 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,12 +129,6 @@ Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
return xInt;
}
-//UNUSED2008-05 Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
-//UNUSED2008-05 SfxObjectShell* pShell, const OUString& rServiceName, const Sequence< Any >& rArgs )
-//UNUSED2008-05 {
-//UNUSED2008-05 return CreateInstanceWithArgs( GetServiceFactory( pShell ), rServiceName, rArgs );
-//UNUSED2008-05 }
-
Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs(
const OUString& rServiceName, const Sequence< Any >& rArgs )
{
@@ -144,12 +139,12 @@ uno::Sequence< beans::NamedValue > ScfApiHelper::QueryEncryptionDataForMedium( S
::comphelper::IDocPasswordVerifier& rVerifier, const ::std::vector< OUString >* pDefaultPasswords )
{
uno::Sequence< beans::NamedValue > aEncryptionData;
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, false);
if ( pEncryptionDataItem )
pEncryptionDataItem->GetValue() >>= aEncryptionData;
::rtl::OUString aPassword;
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false);
if ( pPasswordItem )
aPassword = pPasswordItem->GetValue();
@@ -422,3 +417,4 @@ Any* ScfPropSetHelper::GetNextAny()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/ftools/fprogressbar.cxx b/sc/source/filter/ftools/fprogressbar.cxx
index 9646a2faf7ce..20e227f69f46 100644
--- a/sc/source/filter/ftools/fprogressbar.cxx
+++ b/sc/source/filter/ftools/fprogressbar.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,12 +80,11 @@ void ScfProgressBar::Init( SfxObjectShell* pDocShell )
mbInProgress = false;
}
-ScfProgressBar::ScfProgressSegment* ScfProgressBar::GetSegment( sal_Int32 nSegment ) const
+ScfProgressBar::ScfProgressSegment* ScfProgressBar::GetSegment( sal_Int32 nSegment )
{
if( nSegment < 0 )
return 0;
- DBG_ASSERT( maSegments.GetObject( nSegment ), "ScfProgressBar::GetSegment - invalid segment index" );
- return maSegments.GetObject( nSegment );
+ return &(maSegments.at( nSegment ));
}
void ScfProgressBar::SetCurrSegment( ScfProgressSegment* pSegment )
@@ -154,9 +154,9 @@ sal_Int32 ScfProgressBar::AddSegment( sal_Size nSize )
if( nSize == 0 )
return SCF_INV_SEGMENT;
- maSegments.Append( new ScfProgressSegment( nSize ) );
+ maSegments.push_back( new ScfProgressSegment( nSize ) );
mnTotalSize += nSize;
- return static_cast< sal_Int32 >( maSegments.Count() - 1 );
+ return static_cast< sal_Int32 >( maSegments.size() - 1 );
}
ScfProgressBar& ScfProgressBar::GetSegmentProgressBar( sal_Int32 nSegment )
@@ -226,14 +226,6 @@ void ScfSimpleProgressBar::Init( sal_Size nSize )
maProgress.ActivateSegment( nSegment );
}
-// ============================================================================
-
-//UNUSED2008-05 ScfStreamProgressBar::ScfStreamProgressBar( SvStream& rStrm, SfxObjectShell* pDocShell, const String& rText ) :
-//UNUSED2008-05 mrStrm( rStrm )
-//UNUSED2008-05 {
-//UNUSED2008-05 Init( pDocShell, rText );
-//UNUSED2008-05 }
-
ScfStreamProgressBar::ScfStreamProgressBar( SvStream& rStrm, SfxObjectShell* pDocShell, sal_uInt16 nResId ) :
mrStrm( rStrm )
{
@@ -258,3 +250,4 @@ void ScfStreamProgressBar::Init( SfxObjectShell* pDocShell, const String& rText
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index d3dfee2522f7..dd708ff35ea2 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -404,3 +405,4 @@ ScFormatFilterPlugin * SAL_CALL ScFilterCreate(void)
// implementation class inside the filters
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/ftools/makefile.mk b/sc/source/filter/ftools/makefile.mk
index 27a960efc6b0..39c6984d5198 100644
--- a/sc/source/filter/ftools/makefile.mk
+++ b/sc/source/filter/ftools/makefile.mk
@@ -38,20 +38,18 @@ PROJECTPCHSOURCE=..\pch\filt_pch
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
$(SLO)$/fapihelper.obj \
$(SLO)$/fprogressbar.obj \
$(SLO)$/ftools.obj
-EXCEPTIONSFILES = \
- $(SLO)$/fapihelper.obj
-
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 752333a50e91..05338c3849b1 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,6 +49,7 @@
#include <editeng/postitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/xoutbmp.hxx>
#include <editeng/editeng.hxx>
#include <svtools/htmlcfg.hxx>
@@ -103,12 +105,12 @@
//========================================================================
-const static sal_Char __FAR_DATA sMyBegComment[] = "<!-- ";
-const static sal_Char __FAR_DATA sMyEndComment[] = " -->";
-const static sal_Char __FAR_DATA sFontFamily[] = "font-family:";
-const static sal_Char __FAR_DATA sFontSize[] = "font-size:";
+const static sal_Char sMyBegComment[] = "<!-- ";
+const static sal_Char sMyEndComment[] = " -->";
+const static sal_Char sFontFamily[] = "font-family:";
+const static sal_Char sFontSize[] = "font-size:";
-const sal_uInt16 __FAR_DATA ScHTMLExport::nDefaultFontSize[SC_HTML_FONTSIZES] =
+const sal_uInt16 ScHTMLExport::nDefaultFontSize[SC_HTML_FONTSIZES] =
{
HTMLFONTSZ1_DFLT, HTMLFONTSZ2_DFLT, HTMLFONTSZ3_DFLT, HTMLFONTSZ4_DFLT,
HTMLFONTSZ5_DFLT, HTMLFONTSZ6_DFLT, HTMLFONTSZ7_DFLT
@@ -116,13 +118,13 @@ const sal_uInt16 __FAR_DATA ScHTMLExport::nDefaultFontSize[SC_HTML_FONTSIZES] =
sal_uInt16 ScHTMLExport::nFontSize[SC_HTML_FONTSIZES] = { 0 };
-const char* __FAR_DATA ScHTMLExport::pFontSizeCss[SC_HTML_FONTSIZES] =
+const char* ScHTMLExport::pFontSizeCss[SC_HTML_FONTSIZES] =
{
"xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"
};
const sal_uInt16 ScHTMLExport::nCellSpacing = 0;
-const sal_Char __FAR_DATA ScHTMLExport::sIndentSource[nIndentMax+1] =
+const sal_Char ScHTMLExport::sIndentSource[nIndentMax+1] =
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
//========================================================================
@@ -131,7 +133,7 @@ const sal_Char __FAR_DATA ScHTMLExport::sIndentSource[nIndentMax+1] =
#define OUT_PROLOGUE() (rStrm << sHTML30_Prologue << ScExportBase::sNewLine \
<< ScExportBase::sNewLine)
#define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag )
-#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag, sal_False )
+#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag, false )
#define OUT_STR( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc, &aNonConvertibleChars )
#define OUT_STR_NO_CONV( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc )
#define OUT_LF() rStrm << ScExportBase::sNewLine << GetIndentStr()
@@ -205,33 +207,13 @@ void lcl_AppendHTMLColorTripel( ByteString& rStr, const Color& rColor )
sal_Char* p = buf;
rStr += "\"#";
- p += sprintf( p, "%02X", rColor.GetRed() ); // #100211# - checked
- p += sprintf( p, "%02X", rColor.GetGreen() ); // #100211# - checked
- p += sprintf( p, "%02X", rColor.GetBlue() ); // #100211# - checked
+ p += sprintf( p, "%02X", rColor.GetRed() );
+ p += sprintf( p, "%02X", rColor.GetGreen() );
+ p += sprintf( p, "%02X", rColor.GetBlue() );
rStr += buf;
rStr += '\"';
}
-
-/*void lcl_TagOn( String& rResult, const String& rTag, const String* pStrOpt )
-{
- rResult = '<';
- rResult += rTag;
- if ( pStrOpt )
- {
- rResult += ' ';
- rResult += *pStrOpt;
- }
- rResult += '>';
-}
-*/
-
-/*void lcl_TagOff( String& rResult, const String& rTag )
-{
- rResult = '<'; rResult += rTag; rResult += '>';
-}
-*/
-
//////////////////////////////////////////////////////////////////////////////
ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const String& rBaseURL, ScDocument* pDocP,
@@ -246,12 +228,12 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const String& rBaseURL, ScDocument
nUsedTables( 0 ),
nIndent( 0 ),
bAll( bAllP ),
- bTabHasGraphics( sal_False ),
+ bTabHasGraphics( false ),
bCalcAsShown( pDocP->GetDocOptions().IsCalcAsShown() ),
bTableDataWidth( sal_True ),
bTableDataHeight( sal_True )
{
- strcpy( sIndent, sIndentSource ); // #100211# - checked
+ strcpy( sIndent, sIndentSource );
sIndent[0] = 0;
// set HTML configuration
@@ -291,8 +273,7 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const String& rBaseURL, ScDocument
ScHTMLExport::~ScHTMLExport()
{
- for ( ScHTMLGraphEntry* pE = aGraphList.First(); pE; pE = aGraphList.Next() )
- delete pE;
+ aGraphList.clear();
delete pSrcArr;
delete pDestArr;
}
@@ -380,7 +361,7 @@ void ScHTMLExport::WriteHeader()
OUT_LF();
//----------------------------------------------------------
- if (!xDocProps->getPrintedBy().equalsAscii(""))
+ if (xDocProps->getPrintedBy().getLength())
{
OUT_COMMENT( GLOBSTR( STR_DOC_INFO ) );
String aStrOut( GLOBSTR( STR_DOC_PRINTED ) );
@@ -527,7 +508,14 @@ void ScHTMLExport::BorderToStyle( ByteString& rOut, const char* pBorderName,
// thickness
int nWidth = pLine->GetOutWidth();
int nPxWidth = ( nWidth > 0 )? std::max( int( nWidth / TWIPS_PER_PIXEL ), 1 ): 0;
- (rOut += ByteString::CreateFromInt32( nPxWidth )) += "px solid #";
+ (rOut += ByteString::CreateFromInt32( nPxWidth )) += "px ";
+ switch ( pLine->GetStyle() )
+ {
+ case DOTTED: rOut += "dotted"; break;
+ case DASHED: rOut += "dashed"; break;
+ default: rOut += "solid";
+ }
+ rOut += " #";
// color
char hex[7];
@@ -696,12 +684,11 @@ void ScHTMLExport::WriteTables()
// <TABLE ...>
ByteString aByteStrOut = OOO_STRING_SVTOOLS_HTML_table;
-// aStrOut = OOO_STRING_SVTOOLS_HTML_table;
// FRAME=VOID, we do the styling of the cells in <TD>
(((aByteStrOut += ' ') += OOO_STRING_SVTOOLS_HTML_frame) += '=') += OOO_STRING_SVTOOLS_HTML_TF_void;
- bTabHasGraphics = bTabAlignedLeft = sal_False;
+ bTabHasGraphics = bTabAlignedLeft = false;
if ( bAll && pDrawLayer )
PrepareGraphics( pDrawLayer, nTab, nStartCol, nStartRow,
nEndCol, nEndRow );
@@ -774,9 +761,9 @@ void ScHTMLExport::WriteTables()
if ( nCol2 == nEndCol )
IncIndent(-1);
WriteCell( nCol2, nRow, nTab );
- bTableDataHeight = sal_False;
+ bTableDataHeight = false;
}
- bTableDataWidth = sal_False; // widths only in first row
+ bTableDataWidth = false; // widths only in first row
if ( nRow == nEndRow )
IncIndent(-1);
@@ -789,13 +776,14 @@ void ScHTMLExport::WriteTables()
if ( bTabHasGraphics )
{
// the rest that is not in a cell
- for ( ScHTMLGraphEntry* pE = aGraphList.First(); pE; pE = aGraphList.Next() )
+ size_t ListSize = aGraphList.size();
+ for ( size_t i = 0; i < ListSize; ++i )
{
+ ScHTMLGraphEntry* pE = &aGraphList[ i ];
if ( !pE->bWritten )
WriteGraphEntry( pE );
- delete pE;
}
- aGraphList.Clear();
+ aGraphList.clear();
if ( bTabAlignedLeft )
{ // clear <TABLE ALIGN=LEFT> with <BR CLEAR=LEFT>
aByteStrOut = OOO_STRING_SVTOOLS_HTML_linebreak;
@@ -823,9 +811,10 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
ScHTMLGraphEntry* pGraphEntry = NULL;
if ( bTabHasGraphics )
{
- for ( pGraphEntry = aGraphList.First(); pGraphEntry;
- pGraphEntry = aGraphList.Next() )
+ size_t ListSize = aGraphList.size();
+ for ( size_t i = 0; i < ListSize; ++i )
{
+ pGraphEntry = &aGraphList[ i ];
if ( pGraphEntry->bInCell && pGraphEntry->aRange.In( aPos ) )
{
if ( pGraphEntry->aRange.aStart == aPos )
@@ -847,7 +836,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
}
else
{
- bValueData = sal_False;
+ bValueData = false;
nScriptType = 0;
}
if ( nScriptType == 0 )
@@ -956,19 +945,14 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
Color aBgColor;
if ( rBrushItem.GetColor().GetTransparency() == 255 )
- aBgColor = aHTMLStyle.aBackgroundColor; // #55121# keine ungewollte Hintergrundfarbe
+ aBgColor = aHTMLStyle.aBackgroundColor; // keine ungewollte Hintergrundfarbe
else
aBgColor = rBrushItem.GetColor();
sal_Bool bBold = ( WEIGHT_BOLD <= rWeightItem.GetWeight() );
sal_Bool bItalic = ( ITALIC_NONE != rPostureItem.GetPosture() );
sal_Bool bUnderline = ( UNDERLINE_NONE != rUnderlineItem.GetLineStyle() );
- sal_Bool bSetFontColor = ( COL_AUTO != rColorItem.GetValue().GetColor() ); // #97650# default is AUTO now
-#if 0
-// keine StyleSheet-Fontangaben: hart fuer jede Zelle
- sal_Bool bSetFontName = sal_True;
- sal_uInt16 nSetFontSizeNumber = GetFontSizeNumber( (sal_uInt16)rFontHeightItem.GetHeight() );
-#else
+ sal_Bool bSetFontColor = ( COL_AUTO != rColorItem.GetValue().GetColor() ); // default is AUTO now
sal_Bool bSetFontName = ( aHTMLStyle.aFontFamilyName != rFontItem.GetFamilyName() );
sal_uInt16 nSetFontSizeNumber = 0;
sal_uInt32 nFontHeight = rFontHeightItem.GetHeight();
@@ -978,7 +962,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
if ( nSetFontSizeNumber == aHTMLStyle.nFontSizeNumber )
nSetFontSizeNumber = 0; // no difference, don't set
}
-#endif
+
sal_Bool bSetFont = (bSetFontColor || bSetFontName || nSetFontSizeNumber);
//! TODO: we could entirely use CSS1 here instead, but that would exclude
@@ -992,10 +976,10 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
break;
case SVX_HOR_JUSTIFY_CENTER: pChar = OOO_STRING_SVTOOLS_HTML_AL_center; break;
case SVX_HOR_JUSTIFY_BLOCK: pChar = OOO_STRING_SVTOOLS_HTML_AL_justify; break;
- case SVX_HOR_JUSTIFY_RIGHT: pChar = OOO_STRING_SVTOOLS_HTML_AL_right; break;
+ case SVX_HOR_JUSTIFY_RIGHT: pChar = OOO_STRING_SVTOOLS_HTML_AL_right; break;
case SVX_HOR_JUSTIFY_LEFT:
case SVX_HOR_JUSTIFY_REPEAT:
- default: pChar = OOO_STRING_SVTOOLS_HTML_AL_left; break;
+ default: pChar = OOO_STRING_SVTOOLS_HTML_AL_left; break;
}
(((aStrTD += ' ') += OOO_STRING_SVTOOLS_HTML_O_align) += '=') += pChar;
@@ -1100,7 +1084,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
}
String aStrOut;
- sal_Bool bFieldText = sal_False;
+ sal_Bool bFieldText = false;
if ( pCell )
{ // cell content
Color* pColor;
@@ -1122,7 +1106,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
{
if ( !aStrOut.Len() )
{
- TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // #42573# keine komplett leere Zelle
+ TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // keine komplett leere Zelle
}
else
{
@@ -1161,7 +1145,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
{
- sal_Bool bFields = sal_False;
+ sal_Bool bFields = false;
const EditTextObject* pData;
pCell->GetData( pData );
// text and anchor of URL fields, Doc-Engine is a ScFieldEditEngine
@@ -1172,7 +1156,7 @@ sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
{
ESelection aSel( 0, 0, nParas-1, rEngine.GetTextLen( nParas-1 ) );
SfxItemSet aSet( rEngine.GetAttribs( aSel ) );
- SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, sal_False );
+ SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, false );
if ( eFieldState == SFX_ITEM_DONTCARE || eFieldState == SFX_ITEM_SET )
bFields = sal_True;
}
@@ -1192,13 +1176,13 @@ sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
{
sal_uInt16 nEnd = aPortions.GetObject( nPos );
ESelection aSel( nPar, nStart, nPar, nEnd );
- sal_Bool bUrl = sal_False;
+ sal_Bool bUrl = false;
// fields are single characters
if ( nEnd == nStart+1 )
{
const SfxPoolItem* pItem;
SfxItemSet aSet = rEngine.GetAttribs( aSel );
- if ( aSet.GetItemState( EE_FEATURE_FIELD, sal_False, &pItem ) == SFX_ITEM_ON )
+ if ( aSet.GetItemState( EE_FEATURE_FIELD, false, &pItem ) == SFX_ITEM_ON )
{
const SvxFieldData* pField = ((const SvxFieldItem*)pItem)->GetField();
if ( pField && pField->ISA(SvxURLField) )
@@ -1228,7 +1212,7 @@ sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
sal_Bool ScHTMLExport::CopyLocalFileToINet( String& rFileNm,
const String& rTargetNm, sal_Bool bFileToFile )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
INetURLObject aFileUrl, aTargetUrl;
aFileUrl.SetSmartURL( rFileNm );
aTargetUrl.SetSmartURL( rTargetNm );
@@ -1272,10 +1256,7 @@ sal_Bool ScHTMLExport::CopyLocalFileToINet( String& rFileNm,
else
{
SfxMedium aMedium( *pDest, STREAM_WRITE | STREAM_SHARE_DENYNONE,
- sal_False );
-
- // temp. File anlegen
- // aMedium.DownLoad();
+ false );
{
SvFileStream aCpy( aMedium.GetPhysicalName(), STREAM_WRITE );
@@ -1339,3 +1320,4 @@ void ScHTMLExport::IncIndent( short nVal )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx
index a1c7aa6a8dc8..0100c1d9d258 100644
--- a/sc/source/filter/html/htmlexp2.cxx
+++ b/sc/source/filter/html/htmlexp2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,12 +65,12 @@ void ScHTMLExport::PrepareGraphics( ScDrawLayer* pDrawLayer, SCTAB nTab,
SdrPage* pDrawPage = pDrawLayer->GetPage( static_cast<sal_uInt16>(nTab) );
if ( pDrawPage )
{
- bTabHasGraphics = sal_True;
- FillGraphList( pDrawPage, nTab,
- nStartCol, nStartRow, nEndCol, nEndRow );
- for ( ScHTMLGraphEntry* pE = aGraphList.First(); pE;
- pE = aGraphList.Next() )
+ bTabHasGraphics = true;
+ FillGraphList( pDrawPage, nTab, nStartCol, nStartRow, nEndCol, nEndRow );
+ size_t ListSize = aGraphList.size();
+ for ( size_t i = 0; i < ListSize; ++i )
{
+ ScHTMLGraphEntry* pE = &aGraphList[ i ];
if ( !pE->bInCell )
{ // nicht alle in Zellen: einige neben Tabelle
bTabAlignedLeft = sal_True;
@@ -126,7 +127,7 @@ void ScHTMLExport::FillGraphList( const SdrPage* pPage, SCTAB nTab,
}
ScHTMLGraphEntry* pE = new ScHTMLGraphEntry( pObject,
aR, aSize, bInCell, aSpace );
- aGraphList.Insert( pE, LIST_APPEND );
+ aGraphList.push_back( pE );
}
pObject = aIter.Next();
}
@@ -247,3 +248,4 @@ void ScHTMLExport::WriteImage( String& rLinkName, const Graphic& rGrf,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 4fb922d9a228..5bae367a3f65 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,7 +132,7 @@ void ScHTMLImport::InsertRangeName( ScDocument* pDoc, const String& rName, const
ScTokenArray aTokArray;
aTokArray.AddDoubleReference( aRefData );
ScRangeData* pRangeData = new ScRangeData( pDoc, rName, aTokArray );
- if( !pDoc->GetRangeName()->Insert( pRangeData ) )
+ if( !pDoc->GetRangeName()->insert( pRangeData ) )
delete pRangeData;
}
@@ -149,8 +150,10 @@ void ScHTMLImport::WriteToDocument(
pGlobTable->ApplyCellBorders( mpDoc, maRange.aStart );
// correct cell borders for merged cells
- for ( ScEEParseEntry* pEntry = pParser->First(); pEntry; pEntry = pParser->Next() )
+ size_t ListSize = pParser->ListSize();
+ for ( size_t i = 0; i < ListSize; ++i )
{
+ const ScEEParseEntry* pEntry = pParser->ListEntry( i );
if( (pEntry->nColOverlap > 1) || (pEntry->nRowOverlap > 1) )
{
SCTAB nTab = maRange.aStart.Tab();
@@ -207,8 +210,7 @@ void ScHTMLImport::WriteToDocument(
if( pTable->GetTableName().Len() )
{
String aName( ScfTools::GetNameFromHTMLName( pTable->GetTableName() ) );
- sal_uInt16 nPos;
- if( !mpDoc->GetRangeName()->SearchName( aName, nPos ) )
+ if (!mpDoc->GetRangeName()->findByName(aName))
InsertRangeName( mpDoc, aName, aNewRange );
}
}
@@ -234,22 +236,22 @@ String ScHTMLImport::GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrig
if( pRangeNames && ScfTools::IsHTMLTablesName( aToken ) )
{ // build list with all HTML tables
sal_uLong nIndex = 1;
- sal_uInt16 nPos;
- sal_Bool bLoop = sal_True;
+ bool bLoop = true;
while( bLoop )
{
aToken = ScfTools::GetNameFromHTMLIndex( nIndex++ );
- bLoop = pRangeNames->SearchName( aToken, nPos );
- if( bLoop )
+ const ScRangeData* pRangeData = pRangeNames->findByName(aToken);
+ if (pRangeData)
{
- const ScRangeData* pRangeData = (*pRangeNames)[ nPos ];
ScRange aRange;
- if( pRangeData && pRangeData->IsReference( aRange ) && !aRangeList.In( aRange ) )
+ if( pRangeData->IsReference( aRange ) && !aRangeList.In( aRange ) )
{
ScGlobal::AddToken( aNewName, aToken, ';' );
aRangeList.Append( aRange );
}
}
+ else
+ bLoop = false;
}
}
else
@@ -258,3 +260,4 @@ String ScHTMLImport::GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrig
return aNewName;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 8e9fbc046f02..c1f6cacd7eb6 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,6 +46,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/boxitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <sfx2/objsh.hxx>
#include <svl/eitem.hxx>
#include <svtools/filter.hxx>
@@ -111,10 +113,10 @@ ScHTMLLayoutParser::ScHTMLLayoutParser( EditEngine* pEditP, const String& rBaseU
nColOffsetStart(0),
nMetaCnt(0),
nOffsetTolerance( SC_HTML_OFFSET_TOLERANCE_SMALL ),
- bTabInTabCell( sal_False ),
+ bTabInTabCell( false ),
bFirstRow( sal_True ),
- bInCell( sal_False ),
- bInTitle( sal_False )
+ bInCell( false ),
+ bInTitle( false )
{
MakeColNoRef( pLocalColOffset, 0, 0, 0, 0 );
MakeColNoRef( pColOffset, 0, 0, 0, 0 );
@@ -126,7 +128,16 @@ ScHTMLLayoutParser::~ScHTMLLayoutParser()
ScHTMLTableStackEntry* pS;
while ( (pS = aTableStack.Pop()) != 0 )
{
- if ( pList->GetPos( pS->pCellEntry ) == LIST_ENTRY_NOTFOUND )
+ bool found = false;
+ for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
+ {
+ if ( pS->pCellEntry == maList[ i ] )
+ {
+ found = true;
+ break;
+ }
+ }
+ if ( !found )
delete pS->pCellEntry;
if ( pS->pLocalColOffset != pLocalColOffset )
delete pS->pLocalColOffset;
@@ -242,7 +253,7 @@ void ScHTMLLayoutParser::NextRow( ImportInfo* pInfo )
nRowMax = nRowCnt;
nColCnt = nColCntStart;
nColOffset = nColOffsetStart;
- bFirstRow = sal_False;
+ bFirstRow = false;
}
@@ -257,7 +268,7 @@ sal_Bool ScHTMLLayoutParser::SeekOffset( ScHTMLColOffset* pOffset, sal_uInt16 nO
return sal_True;
sal_uInt16 nCount = pOffset->Count();
if ( !nCount )
- return sal_False;
+ return false;
// nPos ist Einfuegeposition, da liegt der Naechsthoehere (oder auch nicht)
if ( nPos < nCount && (((*pOffset)[nPos] - nOffsetTol) <= nOffset) )
return sal_True;
@@ -267,7 +278,7 @@ sal_Bool ScHTMLLayoutParser::SeekOffset( ScHTMLColOffset* pOffset, sal_uInt16 nO
(*pCol)--;
return sal_True;
}
- return sal_False;
+ return false;
}
@@ -352,15 +363,16 @@ void ScHTMLLayoutParser::SkipLocked( ScEEParseEntry* pE, sal_Bool bJoin )
{
if ( ValidCol(pE->nCol) )
{ // wuerde sonst bei ScAddress falschen Wert erzeugen, evtl. Endlosschleife!
- sal_Bool bBadCol = sal_False;
+ sal_Bool bBadCol = false;
sal_Bool bAgain;
ScRange aRange( pE->nCol, pE->nRow, 0,
pE->nCol + pE->nColOverlap - 1, pE->nRow + pE->nRowOverlap - 1, 0 );
do
{
- bAgain = sal_False;
- for ( ScRange* pR = xLockedList->First(); pR; pR = xLockedList->Next() )
+ bAgain = false;
+ for ( size_t i = 0, nRanges = xLockedList->size(); i < nRanges; ++i )
{
+ ScRange* pR = (*xLockedList)[i];
if ( pR->Intersects( aRange ) )
{
pE->nCol = pR->aEnd.Col() + 1;
@@ -385,9 +397,8 @@ void ScHTMLLayoutParser::SkipLocked( ScEEParseEntry* pE, sal_Bool bJoin )
void ScHTMLLayoutParser::Adjust()
{
- for ( ScRange* pR = xLockedList->First(); pR; pR = xLockedList->Next() )
- delete pR;
- xLockedList->Clear();
+ xLockedList->RemoveAll();
+
ScHTMLAdjustStack aStack;
ScHTMLAdjustStackEntry* pS;
sal_uInt16 nTab = 0;
@@ -396,8 +407,9 @@ void ScHTMLLayoutParser::Adjust()
SCROW nCurRow = 0;
sal_uInt16 nPageWidth = (sal_uInt16) aPageSize.Width();
Table* pTab = NULL;
- for ( ScEEParseEntry* pE = pList->First(); pE; pE = pList->Next() )
+ for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
{
+ ScEEParseEntry* pE = maList[ i ];
if ( pE->nTab < nTab )
{ // Table beendet
if ( (pS = aStack.Pop()) != 0 )
@@ -466,7 +478,7 @@ void ScHTMLLayoutParser::Adjust()
// echte Col
SeekOffset( pColOffset, pE->nOffset, &pE->nCol, nOffsetTolerance );
SCCOL nColBeforeSkip = pE->nCol;
- SkipLocked( pE, sal_False );
+ SkipLocked( pE, false );
if ( pE->nCol != nColBeforeSkip )
{
SCCOL nCount = (SCCOL)pColOffset->Count();
@@ -537,30 +549,29 @@ void ScHTMLLayoutParser::SetWidths()
MakeColNoRef( pLocalColOffset, nOff, 0, 0, 0 );
}
nTableWidth = (sal_uInt16)((*pLocalColOffset)[pLocalColOffset->Count() -1 ] - (*pLocalColOffset)[0]);
- pE = pList->Seek( nFirstTableCell );
- while ( pE )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
+ pE = maList[ i ];
if ( pE->nTab == nTable )
{
pE->nOffset = (sal_uInt16) (*pLocalColOffset)[pE->nCol - nColCntStart];
pE->nWidth = 0; // to be recalculated later
}
- pE = pList->Next();
}
}
else
{ // einige mit einige ohne Width
- pE = pList->Seek( nFirstTableCell );
- // #36350# wieso eigentlich kein pE ?!?
- if ( pE )
+ // wieso eigentlich kein pE ?!?
+ if ( nFirstTableCell < maList.size() )
{
sal_uInt16* pOffsets = new sal_uInt16[ nColsPerRow+1 ];
memset( pOffsets, 0, (nColsPerRow+1) * sizeof(sal_uInt16) );
sal_uInt16* pWidths = new sal_uInt16[ nColsPerRow ];
memset( pWidths, 0, nColsPerRow * sizeof(sal_uInt16) );
pOffsets[0] = nColOffsetStart;
- while ( pE )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
+ pE = maList[ i ];
if ( pE->nTab == nTable && pE->nWidth )
{
nCol = pE->nCol - nColCntStart;
@@ -574,7 +585,7 @@ void ScHTMLLayoutParser::SetWidths()
else
{ // try to find a single undefined width
sal_uInt16 nTotal = 0;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nHere = 0;
SCCOL nStop = Min( static_cast<SCCOL>(nCol + pE->nColOverlap), nColsPerRow );
for ( ; nCol < nStop; nCol++ )
@@ -585,7 +596,7 @@ void ScHTMLLayoutParser::SetWidths()
{
if ( bFound )
{
- bFound = sal_False;
+ bFound = false;
break; // for
}
bFound = sal_True;
@@ -597,7 +608,6 @@ void ScHTMLLayoutParser::SetWidths()
}
}
}
- pE = pList->Next();
}
sal_uInt16 nWidths = 0;
sal_uInt16 nUnknown = 0;
@@ -630,9 +640,9 @@ void ScHTMLLayoutParser::SetWidths()
}
nTableWidth = pOffsets[nColsPerRow] - pOffsets[0];
- pE = pList->Seek( nFirstTableCell );
- while ( pE )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
+ pE = maList[ i ];
if ( pE->nTab == nTable )
{
nCol = pE->nCol - nColCntStart;
@@ -646,7 +656,6 @@ void ScHTMLLayoutParser::SetWidths()
pE->nWidth = pOffsets[nCol] - pE->nOffset;
}
}
- pE = pList->Next();
}
delete [] pWidths;
@@ -659,9 +668,9 @@ void ScHTMLLayoutParser::SetWidths()
if ( aPageSize.Width() < nMax )
aPageSize.Width() = nMax;
}
- pE = pList->Seek( nFirstTableCell );
- while ( pE )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
+ pE = maList[ i ];
if ( pE->nTab == nTable )
{
if ( !pE->nWidth )
@@ -671,7 +680,6 @@ void ScHTMLLayoutParser::SetWidths()
}
MakeCol( pColOffset, pE->nOffset, pE->nWidth, nOffsetTolerance, nOffsetTolerance );
}
- pE = pList->Next();
}
}
@@ -707,13 +715,22 @@ void ScHTMLLayoutParser::Colonize( ScEEParseEntry* pE )
void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo )
{
- bInCell = sal_False;
+ bInCell = false;
if ( bTabInTabCell )
{ // in TableOff vom Stack geholt
- bTabInTabCell = sal_False;
- if ( pList->GetPos( pActEntry ) == LIST_ENTRY_NOTFOUND )
+ bTabInTabCell = false;
+ bool found = false;
+ for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
+ {
+ if ( pActEntry == maList[ i ] )
+ {
+ found = true;
+ break;
+ }
+ }
+ if ( !found )
delete pActEntry;
- NewActEntry( pList->Last() ); // neuer freifliegender pActEntry
+ NewActEntry( maList.back() ); // neuer freifliegender pActEntry
return ;
}
if ( pActEntry->nTab == 0 )
@@ -742,113 +759,14 @@ void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo )
rSel.nEndPara = rSel.nStartPara;
}
if ( rSel.HasRange() )
- pActEntry->aItemSet.Put( SfxBoolItem( ATTR_LINEBREAK, sal_True ) );
- pList->Insert( pActEntry, LIST_APPEND );
+ pActEntry->aItemSet.Put( SfxBoolItem( ATTR_LINEBREAK, true ) );
+ maList.push_back( pActEntry );
NewActEntry( pActEntry ); // neuer freifliegender pActEntry
}
IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo )
{
-#if defined(erDEBUG) //|| 1
- static ESelection aDebugSel;
- static String aDebugStr;
- static SvFileStream* pDebugStrm = NULL;
- static sal_uLong nDebugStrmPos = 0;
- static sal_uLong nDebugCount = 0;
- static sal_uLong nDebugCountAll = 0;
- static const sal_Char* sDebugState[15] = {
- "RTFIMP_START", "RTFIMP_END",
- "RTFIMP_NEXTTOKEN", "RTFIMP_UNKNOWNATTR",
- "RTFIMP_SETATTR",
- "RTFIMP_INSERTTEXT",
- "RTFIMP_INSERTPARA",
- "HTMLIMP_START", "HTMLIMP_END",
- "HTMLIMP_NEXTTOKEN", "HTMLIMP_UNKNOWNATTR",
- "HTMLIMP_SETATTR",
- "HTMLIMP_INSERTTEXT",
- "HTMLIMP_INSERTPARA", "HTMLIMP_INSERTFIELD"
- };
-
- nDebugCountAll++;
- if ( pInfo->eState != HTMLIMP_NEXTTOKEN // not too much
- || pInfo->nToken == HTML_TABLE_ON
- || pInfo->nToken == HTML_TABLE_OFF
- || pInfo->nToken == HTML_TABLEROW_ON
- || pInfo->nToken == HTML_TABLEROW_OFF
- || pInfo->nToken == HTML_TABLEHEADER_ON
- || pInfo->nToken == HTML_TABLEHEADER_OFF
- || pInfo->nToken == HTML_TABLEDATA_ON
- || pInfo->nToken == HTML_TABLEDATA_OFF
- || !aDebugSel.IsEqual( pInfo->aSelection )
- || pInfo->aText.Len() || aDebugStr != pInfo->aText
- )
- {
- aDebugSel = pInfo->aSelection;
- aDebugStr = pInfo->aText;
- nDebugCount++;
- if ( !pDebugStrm )
- {
- pDebugStrm = new SvFileStream( "d:\\erdbghtm.log",
- STREAM_WRITE | STREAM_TRUNC );
- }
- else
- {
- pDebugStrm->ReOpen();
- pDebugStrm->Seek( nDebugStrmPos );
- }
- SvFileStream& rS = *pDebugStrm;
- rS.WriteNumber( nDebugCountAll ); rS << ".: ";
- rS.WriteNumber( nDebugCount ); rS << ". State: ";
- rS.WriteNumber( (sal_uInt16) pInfo->eState );
- rS << ' ' << sDebugState[pInfo->eState] << endl;
- rS << "SPar,SPos EPar,EPos: ";
- rS.WriteNumber( aDebugSel.nStartPara ); rS << ',';
- rS.WriteNumber( aDebugSel.nStartPos ); rS << ' ';
- rS.WriteNumber( aDebugSel.nEndPara ); rS << ',';
- rS.WriteNumber( aDebugSel.nEndPos ); rS << endl;
- if ( aDebugStr.Len() )
- {
- rS << "Text: \"" << aDebugStr << '\"' << endl;
- }
- else
- {
- rS << "Text:" << endl;
- }
- rS << "Token: "; rS.WriteNumber( pInfo->nToken );
- switch ( pInfo->nToken )
- {
- case HTML_TABLE_ON:
- rS << " HTML_TABLE_ON";
- break;
- case HTML_TABLE_OFF:
- rS << " HTML_TABLE_OFF";
- break;
- case HTML_TABLEROW_ON:
- rS << " HTML_TABLEROW_ON";
- break;
- case HTML_TABLEROW_OFF:
- rS << " HTML_TABLEROW_OFF";
- break;
- case HTML_TABLEHEADER_ON:
- rS << " HTML_TABLEHEADER_ON";
- break;
- case HTML_TABLEHEADER_OFF:
- rS << " HTML_TABLEHEADER_OFF";
- break;
- case HTML_TABLEDATA_ON:
- rS << " HTML_TABLEDATA_ON";
- break;
- case HTML_TABLEDATA_OFF:
- rS << " HTML_TABLEDATA_OFF";
- break;
- }
- rS << " Value: "; rS.WriteNumber( pInfo->nTokenValue );
- rS << endl << endl;
- nDebugStrmPos = pDebugStrm->Tell();
- pDebugStrm->Close();
- }
-#endif
switch ( pInfo->eState )
{
case HTMLIMP_NEXTTOKEN:
@@ -863,9 +781,9 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo )
if ( pInfo->aSelection.nEndPos )
{
// If text remains: create paragraph, without calling CloseEntry().
- if( bInCell ) // #108269# ...but only in opened table cells.
+ if( bInCell ) // ...but only in opened table cells.
{
- bInCell = sal_False;
+ bInCell = false;
NextRow( pInfo );
bInCell = sal_True;
}
@@ -927,7 +845,7 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo )
CloseEntry( pInfo );
if ( !nTableLevel )
{
- DBG_ERROR( "Dummbatz-Dok! <TH> oder <TD> ohne vorheriges <TABLE>" );
+ OSL_FAIL( "Dummbatz-Dok! <TH> oder <TD> ohne vorheriges <TABLE>" );
TableOn( pInfo );
}
bInCell = sal_True;
@@ -951,7 +869,7 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo )
break;
case HTML_O_ALIGN:
{
- bHorJustifyCenterTH = sal_False;
+ bHorJustifyCenterTH = false;
SvxCellHorJustify eVal;
const String& rOptVal = pOption->GetString();
if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_AL_right ) == COMPARE_EQUAL )
@@ -1040,7 +958,6 @@ void ScHTMLLayoutParser::TableDataOff( ImportInfo* pInfo )
void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
{
String aTabName;
- bool bBorderOn = false;
if ( ++nTableLevel > 1 )
{ // Table in Table
@@ -1073,7 +990,7 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
}
break;
case HTML_O_BORDER:
- bBorderOn = ((pOption->GetString().Len() == 0) || (pOption->GetNumber() != 0));
+ // Border is: ((pOption->GetString().Len() == 0) || (pOption->GetNumber() != 0));
break;
case HTML_O_ID:
aTabName.Assign( pOption->GetString() );
@@ -1081,21 +998,21 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
}
}
}
- bInCell = sal_False;
+ bInCell = false;
if ( bTabInTabCell && !(nTableWidth < nLastWidth) )
{ // mehrere Tabellen in einer Zelle, untereinander
- bTabInTabCell = sal_False;
+ bTabInTabCell = false;
NextRow( pInfo );
}
else
{ // in dieser Zelle geht's los, oder nebeneinander
- bTabInTabCell = sal_False;
+ bTabInTabCell = false;
nColCntStart = nColCnt;
nColOffset = nTmpColOffset;
nColOffsetStart = nColOffset;
}
- ScEEParseEntry* pE = pList->Last();
+ ScEEParseEntry* pE = maList.back();
NewActEntry( pE ); // neuer freifliegender pActEntry
xLockedList = new ScRangeList;
}
@@ -1131,7 +1048,7 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
}
break;
case HTML_O_BORDER:
- bBorderOn = ((pOption->GetString().Len() == 0) || (pOption->GetNumber() != 0));
+ //BorderOn is: ((pOption->GetString().Len() == 0) || (pOption->GetNumber() != 0));
break;
case HTML_O_ID:
aTabName.Assign( pOption->GetString() );
@@ -1141,8 +1058,8 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
}
}
nTable = ++nMaxTable;
- bFirstRow = sal_True;
- nFirstTableCell = pList->Count();
+ bFirstRow = true;
+ nFirstTableCell = maList.size();
pLocalColOffset = new ScHTMLColOffset;
MakeColNoRef( pLocalColOffset, nColOffsetStart, 0, 0, 0 );
@@ -1157,7 +1074,7 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
TableRowOff( pInfo ); // das optionale TableRowOff war nicht
if ( !nTableLevel )
{
- DBG_ERROR( "Dummbatz-Dok! </TABLE> ohne oeffnendes <TABLE>" );
+ OSL_FAIL( "Dummbatz-Dok! </TABLE> ohne oeffnendes <TABLE>" );
return ;
}
if ( --nTableLevel > 0 )
@@ -1213,9 +1130,9 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
sal_uLong nRowKey = nRow + j;
SCROW nR = (SCROW)(sal_uLong)pTab1->Get( nRowKey );
if ( !nR )
- pTab1->Insert( nRowKey, (void*) nRowsPerRow1 );
+ pTab1->Insert( nRowKey, (void*)(sal_IntPtr)nRowsPerRow1 );
else if ( nRowsPerRow1 > nR )
- pTab1->Replace( nRowKey, (void*) nRowsPerRow1 );
+ pTab1->Replace( nRowKey, (void*)(sal_IntPtr)nRowsPerRow1 );
//2do: wie geht das noch besser?
else if ( nRowsPerRow1 < nR && nRowSpan == 1
&& nTable == nMaxTable )
@@ -1227,8 +1144,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
SCROW nR2 = (SCROW)(sal_uLong)pTab1->Get( nRowKey+1 );
if ( nR2 > nAdd )
{ // nur wenn wirklich Platz
- pTab1->Replace( nRowKey, (void*) nR );
- pTab1->Replace( nRowKey+1, (void*) (nR2 - nAdd) );
+ pTab1->Replace( nRowKey, (void*)(sal_IntPtr)nR );
+ pTab1->Replace( nRowKey+1, (void*)(sal_IntPtr)(nR2 - nAdd) );
nRowsPerRow2 = nR / nRows;
}
}
@@ -1247,9 +1164,9 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
sal_uLong nRowKey = nRow + j;
SCROW nR = (SCROW)(sal_uLong)pTab2->Get( nRowKey );
if ( !nR )
- pTab2->Insert( nRowKey, (void*) nRowsPerRow2 );
+ pTab2->Insert( nRowKey, (void*)(sal_IntPtr)nRowsPerRow2 );
else if ( nRowsPerRow2 > nR )
- pTab2->Replace( nRowKey, (void*) nRowsPerRow2 );
+ pTab2->Replace( nRowKey, (void*)(sal_IntPtr)nRowsPerRow2 );
}
}
}
@@ -1314,11 +1231,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
void ScHTMLLayoutParser::Image( ImportInfo* pInfo )
{
- if ( !pActEntry->pImageList )
- pActEntry->pImageList = new ScHTMLImageList;
- ScHTMLImageList* pIL = pActEntry->pImageList;
ScHTMLImage* pImage = new ScHTMLImage;
- pIL->Insert( pImage, LIST_APPEND );
+ pActEntry->maImageList.push_back( pImage );
const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions();
sal_uInt16 nArrLen = pOptions->Count();
for ( sal_uInt16 i = 0; i < nArrLen; i++ )
@@ -1391,11 +1305,12 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo )
pImage->aSize = pDefaultDev->LogicToPixel( pGraphic->GetPrefSize(),
pGraphic->GetPrefMapMode() );
}
- if ( pIL->Count() > 0 )
+ if ( pActEntry->maImageList.size() > 0 )
{
long nWidth = 0;
- for ( ScHTMLImage* pI = pIL->First(); pI; pI = pIL->Next() )
+ for ( sal_uInt32 i=0; i < pActEntry->maImageList.size(); ++i )
{
+ ScHTMLImage* pI = &pActEntry->maImageList[ i ];
if ( pI->nDir & nHorizontal )
nWidth += pI->aSize.Width() + 2 * pI->aSpace.X();
else
@@ -1404,7 +1319,7 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo )
if ( pActEntry->nWidth
&& (nWidth + pImage->aSize.Width() + 2 * pImage->aSpace.X()
>= pActEntry->nWidth) )
- pIL->Last()->nDir = nVertical;
+ pActEntry->maImageList.back().nDir = nVertical;
}
}
@@ -1442,7 +1357,7 @@ sal_uInt16 ScHTMLLayoutParser::GetWidthPixel( const HTMLOption* pOption )
{
if ( rOptVal.Search('*') != STRING_NOTFOUND )
{ // relativ zu was?!?
-//2do: ColArray aller relativen Werte sammeln und dann MakeCol
+ //todo: ColArray aller relativen Werte sammeln und dann MakeCol
return 0;
}
else
@@ -1566,7 +1481,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo )
uno::UNO_QUERY_THROW);
xDPS->getDocumentProperties()->setTitle(aString);
}
- bInTitle = sal_False;
+ bInTitle = false;
}
break;
case HTML_TABLE_ON:
@@ -1620,8 +1535,8 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo )
break;
case HTML_PARABREAK_OFF:
{ // nach einem Image geht es vertikal weiter
- if ( pActEntry->pImageList && pActEntry->pImageList->Count() > 0 )
- pActEntry->pImageList->Last()->nDir = nVertical;
+ if ( pActEntry->maImageList.size() > 0 )
+ pActEntry->maImageList.back().nDir = nVertical;
}
break;
case HTML_ANCHOR_ON:
@@ -1636,7 +1551,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo )
break;
case HTML_BIGPRINT_ON :
{
-//2do: aktuelle Fontgroesse merken und einen groesser
+ //tpdo: aktuelle Fontgroesse merken und einen groesser
if ( IsAtBeginningOfText( pInfo ) )
pActEntry->aItemSet.Put( SvxFontHeightItem(
maFontHeights[3], 100, ATTR_FONT_HEIGHT ) );
@@ -1644,7 +1559,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo )
break;
case HTML_SMALLPRINT_ON :
{
-//2do: aktuelle Fontgroesse merken und einen kleiner
+ //todo: aktuelle Fontgroesse merken und einen kleiner
if ( IsAtBeginningOfText( pInfo ) )
pActEntry->aItemSet.Put( SvxFontHeightItem(
maFontHeights[0], 100, ATTR_FONT_HEIGHT ) );
@@ -1697,7 +1612,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo )
break;
default:
{ // nLastToken nicht setzen!
- bSetLastToken = sal_False;
+ bSetLastToken = false;
}
}
if ( bSetLastToken )
@@ -1864,7 +1779,8 @@ private:
// ----------------------------------------------------------------------------
ScHTMLTableMap::ScHTMLTableMap( ScHTMLTable& rParentTable ) :
- mrParentTable( rParentTable )
+ mrParentTable(rParentTable),
+ mpCurrTable(NULL)
{
}
@@ -1985,7 +1901,12 @@ ScHTMLTable::ScHTMLTable( ScHTMLTable& rParentTable, const ImportInfo& rInfo, bo
CreateNewEntry( rInfo );
}
-ScHTMLTable::ScHTMLTable( SfxItemPool& rPool, EditEngine& rEditEngine, ScEEParseList& rEEParseList, ScHTMLTableId& rnUnusedId ) :
+ScHTMLTable::ScHTMLTable(
+ SfxItemPool& rPool,
+ EditEngine& rEditEngine,
+ ::std::vector< ScEEParseEntry* >& rEEParseList,
+ ScHTMLTableId& rnUnusedId
+) :
mpParentTable( 0 ),
maTableId( rnUnusedId ),
maTableItemSet( rPool ),
@@ -2018,8 +1939,10 @@ const SfxItemSet& ScHTMLTable::GetCurrItemSet() const
ScHTMLSize ScHTMLTable::GetSpan( const ScHTMLPos& rCellPos ) const
{
ScHTMLSize aSpan( 1, 1 );
- ScRange* pRange = 0;
- if( ((pRange = maVMergedCells.Find( rCellPos.MakeAddr() )) != 0) || ((pRange = maHMergedCells.Find( rCellPos.MakeAddr() )) != 0) )
+ const ScRange* pRange = NULL;
+ if( ( (pRange = maVMergedCells.Find( rCellPos.MakeAddr() ) ) != 0)
+ || ( (pRange = maHMergedCells.Find( rCellPos.MakeAddr() ) ) != 0)
+ )
aSpan.Set( pRange->aEnd.Col() - pRange->aStart.Col() + 1, pRange->aEnd.Row() - pRange->aStart.Row() + 1 );
return aSpan;
}
@@ -2174,7 +2097,7 @@ void ScHTMLTable::BodyOn( const ImportInfo& rInfo )
bool bPushed = PushEntry( rInfo );
if( !mpParentTable )
{
- // #108269# do not start new row, if nothing (no title) precedes the body.
+ // do not start new row, if nothing (no title) precedes the body.
if( bPushed || !mbRowOn )
ImplRowOn();
if( bPushed || !mbDataOn )
@@ -2336,7 +2259,7 @@ void ScHTMLTable::ImplPushEntryToList( ScHTMLEntryList& rEntryList, ScHTMLEntryP
// HTML entry list does not own the entries
rEntryList.push_back( rxEntry.get() );
// mrEEParseList (reference to member of ScEEParser) owns the entries
- mrEEParseList.Insert( rxEntry.release(), LIST_APPEND );
+ mrEEParseList.push_back( rxEntry.release() );
}
bool ScHTMLTable::PushEntry( ScHTMLEntryPtr& rxEntry )
@@ -2601,8 +2524,11 @@ void ScHTMLTable::FillEmptyCells()
aIter->FillEmptyCells();
// insert the final vertically merged ranges into maUsedCells
- for( const ScRange* pRange = maVMergedCells.First(); pRange; pRange = maVMergedCells.Next() )
+ for ( size_t i = 0, nRanges = maVMergedCells.size(); i < nRanges; ++i )
+ {
+ ScRange* pRange = maVMergedCells[ i ];
maUsedCells.Join( *pRange );
+ }
for( ScAddress aAddr; aAddr.Row() < maSize.mnRows; aAddr.IncRow() )
{
@@ -2748,7 +2674,7 @@ void ScHTMLTable::RecalcDocPos( const ScHTMLPos& rBasePos )
}
else
{
- // #111667# fill up incomplete entry lists
+ // fill up incomplete entry lists
SCROW nFirstUnusedRow = aCellDocPos.mnRow + aCellDocSize.mnRows;
while( aEntryDocPos.mnRow < nFirstUnusedRow )
{
@@ -2766,7 +2692,12 @@ void ScHTMLTable::RecalcDocPos( const ScHTMLPos& rBasePos )
// ============================================================================
-ScHTMLGlobalTable::ScHTMLGlobalTable( SfxItemPool& rPool, EditEngine& rEditEngine, ScEEParseList& rEEParseList, ScHTMLTableId& rnUnusedId ) :
+ScHTMLGlobalTable::ScHTMLGlobalTable(
+ SfxItemPool& rPool,
+ EditEngine& rEditEngine,
+ ::std::vector< ScEEParseEntry* >& rEEParseList,
+ ScHTMLTableId& rnUnusedId
+) :
ScHTMLTable( rPool, rEditEngine, rEEParseList, rnUnusedId )
{
}
@@ -2792,7 +2723,7 @@ ScHTMLQueryParser::ScHTMLQueryParser( EditEngine* pEditEngine, ScDocument* pDoc
mnUnusedId( SC_HTML_GLOBAL_TABLE ),
mbTitleOn( false )
{
- mxGlobTable.reset( new ScHTMLGlobalTable( *pPool, *pEdit, *pList, mnUnusedId ) );
+ mxGlobTable.reset( new ScHTMLGlobalTable( *pPool, *pEdit, maList, mnUnusedId ) );
mpCurrTable = mxGlobTable.get();
}
@@ -3067,3 +2998,4 @@ IMPL_LINK( ScHTMLQueryParser, HTMLImportHdl, const ImportInfo*, pInfo )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/html/makefile.mk b/sc/source/filter/html/makefile.mk
index 93e992c67e31..cb6312b3601d 100644
--- a/sc/source/filter/html/makefile.mk
+++ b/sc/source/filter/html/makefile.mk
@@ -40,20 +40,17 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/htmlexp.obj \
- $(SLO)$/htmlexp2.obj \
- $(SLO)$/htmlimp.obj \
- $(SLO)$/htmlpars.obj
+SLOFILES = \
+ $(EXCEPTIONSFILES)
-EXCEPTIONSFILES = \
+EXCEPTIONSFILES = \
$(SLO)$/htmlexp.obj \
+ $(SLO)$/htmlexp2.obj \
+ $(SLO)$/htmlimp.obj \
$(SLO)$/htmlpars.obj
# --- Targets -------------------------------------------------------
diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx b/sc/source/filter/inc/XclExpChangeTrack.hxx
index 9f859168f35a..29799635aa2b 100644
--- a/sc/source/filter/inc/XclExpChangeTrack.hxx
+++ b/sc/source/filter/inc/XclExpChangeTrack.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -238,6 +239,8 @@ public:
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetLen() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -247,6 +250,7 @@ class XclExpChTrInfo : public ExcRecord
{
private:
XclExpString sUsername;
+ sal_Int32 mnLogNumber;
DateTime aDateTime;
sal_uInt8 aGUID[ 16 ];
@@ -256,15 +260,19 @@ public:
inline XclExpChTrInfo(
const String& rUsername,
const DateTime& rDateTime,
- const sal_uInt8* pGUID );
+ const sal_uInt8* pGUID,
+ sal_Int32 nLogNumber );
virtual ~XclExpChTrInfo();
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetLen() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
-inline XclExpChTrInfo::XclExpChTrInfo( const String& rUsername, const DateTime& rDateTime, const sal_uInt8* pGUID ) :
+inline XclExpChTrInfo::XclExpChTrInfo( const String& rUsername, const DateTime& rDateTime, const sal_uInt8* pGUID, sal_Int32 nLogNumber ) :
sUsername( rUsername ),
+ mnLogNumber( nLogNumber ),
aDateTime( rDateTime )
{
memcpy( aGUID, pGUID, 16 );
@@ -322,6 +330,7 @@ class XclExpChTrTabId : public ExcRecord
private:
sal_uInt16* pBuffer;
sal_uInt16 nTabCount;
+ bool mbInRevisionHeaders;
inline void Clear() { if( pBuffer ) delete[] pBuffer; pBuffer = NULL; }
@@ -329,14 +338,16 @@ private:
public:
inline XclExpChTrTabId( sal_uInt16 nCount ) :
- pBuffer( NULL ), nTabCount( nCount ) {}
- XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer );
+ pBuffer( NULL ), nTabCount( nCount ), mbInRevisionHeaders( false ) {}
+ XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer, bool bInRevisionHeaders = false );
virtual ~XclExpChTrTabId();
void Copy( const XclExpChTrTabIdBuffer& rBuffer );
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetLen() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -368,6 +379,7 @@ protected:
inline void Write2DAddress( XclExpStream& rStrm, const ScAddress& rAddress ) const;
inline void Write2DRange( XclExpStream& rStrm, const ScRange& rRange ) const;
+ inline sal_uInt16 GetTabId( SCTAB nTabId ) const;
inline void WriteTabId( XclExpStream& rStrm, SCTAB nTabId ) const;
// save header data, call SaveActionData()
@@ -384,6 +396,9 @@ protected:
// do something after writing the record
virtual void CompleteSaveAction( XclExpStream& rStrm ) const;
+ inline sal_uInt32 GetActionNumber() const { return nIndex; }
+ inline sal_Bool GetAccepted() const { return bAccepted; }
+
public:
XclExpChTrAction(
const ScChangeAction& rAction,
@@ -403,6 +418,8 @@ public:
virtual void Save( XclExpStream& rStrm );
virtual sal_Size GetLen() const;
+
+ inline XclExpChTrAction* GetAddAction() { return pAddAction; }
};
inline void XclExpChTrAction::Write2DAddress( XclExpStream& rStrm, const ScAddress& rAddress ) const
@@ -419,9 +436,14 @@ inline void XclExpChTrAction::Write2DRange( XclExpStream& rStrm, const ScRange&
<< (sal_uInt16) rRange.aEnd.Col();
}
+inline sal_uInt16 XclExpChTrAction::GetTabId( SCTAB nTab ) const
+{
+ return rIdBuffer.GetId( rTabInfo.GetXclTab( nTab ) );
+}
+
inline void XclExpChTrAction::WriteTabId( XclExpStream& rStrm, SCTAB nTab ) const
{
- rStrm << rIdBuffer.GetId( rTabInfo.GetXclTab( nTab ) );
+ rStrm << GetTabId( nTab );
}
//___________________________________________________________________
@@ -430,6 +452,8 @@ inline void XclExpChTrAction::WriteTabId( XclExpStream& rStrm, SCTAB nTab ) cons
struct XclExpChTrData
{
XclExpString* pString;
+ XclExpStringRef mpFormattedString;
+ const ScFormulaCell* mpFormulaCell;
XclTokenArrayRef mxTokArr;
XclExpRefLog maRefLog;
double fValue;
@@ -465,6 +489,7 @@ protected:
ScAddress aPosition;
void GetCellData(
+ const XclExpRoot& rRoot,
const ScBaseCell* pScCell,
XclExpChTrData*& rpData,
sal_uInt32& rXclLength1,
@@ -481,6 +506,8 @@ public:
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetActionByteCount() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -508,6 +535,8 @@ public:
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetActionByteCount() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -530,6 +559,8 @@ public:
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetActionByteCount() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -555,6 +586,8 @@ public:
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetActionByteCount() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -571,6 +604,8 @@ public:
virtual sal_uInt16 GetNum() const;
virtual sal_Size GetActionByteCount() const;
+
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -603,6 +638,7 @@ public:
using List::Count;
void Append( ExcRecord* pNewRec );
void Save( XclExpStream& rStrm );
+ void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
@@ -633,9 +669,11 @@ public:
~XclExpChangeTrack();
void Write();
+ void WriteXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/XclImpChangeTrack.hxx b/sc/source/filter/inc/XclImpChangeTrack.hxx
index 0c48cd78b9cd..029e334d79d2 100644
--- a/sc/source/filter/inc/XclImpChangeTrack.hxx
+++ b/sc/source/filter/inc/XclImpChangeTrack.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,7 +93,6 @@ private:
void ReadDateTime( DateTime& rDateTime );
inline void ReadString( String& rString );
- inline void IgnoreString();
sal_Bool CheckRecord( sal_uInt16 nOpCode );
@@ -166,11 +166,6 @@ inline void XclImpChangeTrack::ReadString( String& rString )
rString = pStrm->ReadUniString();
}
-inline void XclImpChangeTrack::IgnoreString()
-{
- pStrm->IgnoreUniString();
-}
-
//___________________________________________________________________
// derived class for special 3D ref handling
@@ -200,3 +195,4 @@ inline XclImpChTrFmlConverter::XclImpChTrFmlConverter(
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/biff.hxx b/sc/source/filter/inc/biff.hxx
index 479dc0f577f5..d2cba2e8d06a 100644
--- a/sc/source/filter/inc/biff.hxx
+++ b/sc/source/filter/inc/biff.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,3 +63,4 @@ class ScBiffReader
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/colrowst.hxx b/sc/source/filter/inc/colrowst.hxx
index 325d380cc19c..525db195bac1 100644
--- a/sc/source/filter/inc/colrowst.hxx
+++ b/sc/source/filter/inc/colrowst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,10 @@
#define SC_COLROWST_HXX
#include "xiroot.hxx"
+#include <mdds/flat_segment_tree.hpp>
+
+#define XLS_USE_NEW_ROW_CONT 1
+
class XclImpStream;
@@ -59,8 +64,13 @@ public:
private:
ScfUInt16Vec maWidths; /// Column widths in twips.
ScfUInt8Vec maColFlags; /// Flags for all columns.
- ScfUInt16Vec maHeights; /// Row heights in twips.
- ScfUInt8Vec maRowFlags; /// Flags for all rows.
+ ///
+ typedef ::mdds::flat_segment_tree<SCROW, sal_uInt16> RowHeightsType;
+ typedef ::mdds::flat_segment_tree<SCROW, sal_uInt8> RowFlagsType;
+ typedef ::mdds::flat_segment_tree<SCROW, bool> RowHiddenType;
+ RowHeightsType maRowHeights;
+ RowFlagsType maRowFlags;
+ RowHiddenType maHiddenRows;
SCROW mnLastScRow;
@@ -78,3 +88,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/decl.h b/sc/source/filter/inc/decl.h
index 35bcc2ef9ddc..91157cf9a9a8 100644
--- a/sc/source/filter/inc/decl.h
+++ b/sc/source/filter/inc/decl.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,4 @@ typedef sal_uInt16 USHORT4[ 4 ];
//typedef unsigned short USHORT4[ 4 ];
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/dif.hxx b/sc/source/filter/inc/dif.hxx
index a94ef5abe715..374ea301b976 100644
--- a/sc/source/filter/inc/dif.hxx
+++ b/sc/source/filter/inc/dif.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,16 +26,15 @@
*
************************************************************************/
-
#ifndef SC_DIF_HXX
#define SC_DIF_HXX
-#include <tools/debug.hxx>
-#include <tools/list.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include <tools/string.hxx>
-#include "global.hxx"
-#include "address.hxx"
+#include "address.hxx"
+#include "global.hxx"
class SvStream;
class SvNumberFormatter;
@@ -53,7 +53,6 @@ extern const sal_Unicode pKeyNA[];
extern const sal_Unicode pKeyV[];
extern const sal_Unicode pKey1_0[];
-
enum TOPIC
{
T_UNKNOWN,
@@ -65,6 +64,8 @@ enum TOPIC
enum DATASET { D_BOT, D_EOD, D_NUMERIC, D_STRING, D_UNKNOWN, D_SYNT_ERROR };
+class DifAttrCache;
+class ScPatternAttr;
class DifParser
{
@@ -105,7 +106,6 @@ public:
inline sal_Bool IsPlain( void ) const;
};
-
inline sal_Bool DifParser::IsBOT( const sal_Unicode* pRef )
{
return ( pRef[ 0 ] == pKeyBOT[0] &&
@@ -114,7 +114,6 @@ inline sal_Bool DifParser::IsBOT( const sal_Unicode* pRef )
pRef[ 3 ] == pKeyBOT[3] );
}
-
inline sal_Bool DifParser::IsEOD( const sal_Unicode* pRef )
{
return ( pRef[ 0 ] == pKeyEOD[0] &&
@@ -123,7 +122,6 @@ inline sal_Bool DifParser::IsEOD( const sal_Unicode* pRef )
pRef[ 3 ] == pKeyEOD[3] );
}
-
inline sal_Bool DifParser::Is1_0( const sal_Unicode* pRef )
{
return ( pRef[ 0 ] == pKey1_0[0] &&
@@ -132,96 +130,75 @@ inline sal_Bool DifParser::Is1_0( const sal_Unicode* pRef )
pRef[ 3 ] == pKey1_0[3] );
}
-
inline sal_Bool DifParser::IsV( const sal_Unicode* pRef )
{
return ( pRef[ 0 ] == pKeyV[0] &&
pRef[ 1 ] == pKeyV[1] );
}
-
inline sal_Bool DifParser::IsNumber( const sal_Unicode cChar )
{
return ( cChar >= '0' && cChar <= '9' );
}
-
inline sal_Bool DifParser::IsNumberEnding( const sal_Unicode cChar )
{
return ( cChar == 0x00 );
}
-
inline sal_Bool DifParser::IsPlain( void ) const
{
return bPlain;
}
-
-
-
-class DifAttrCache;
-class ScPatternAttr;
-
-
-class DifColumn : private List
+class DifColumn
{
-private:
friend class DifAttrCache;
+
struct ENTRY
{
- sal_uInt32 nNumFormat;
-
- SCROW nStart;
- SCROW nEnd;
+ sal_uInt32 nNumFormat;
+ SCROW nStart;
+ SCROW nEnd;
};
- ENTRY* pAkt;
+ ENTRY *pAkt;
+ boost::ptr_vector<ENTRY> aEntries;
- inline DifColumn( void );
- ~DifColumn();
- void SetLogical( SCROW nRow );
- void SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat );
- void NewEntry( const SCROW nPos, const sal_uInt32 nNumFormat );
- void Apply( ScDocument&, const SCCOL nCol, const SCTAB nTab, const ScPatternAttr& );
- void Apply( ScDocument &rDoc, const SCCOL nCol, const SCTAB nTab );
-public: // geht niemanden etwas an...
-};
+ DifColumn();
+ void SetLogical( SCROW nRow );
-inline DifColumn::DifColumn( void )
-{
- pAkt = NULL;
-}
+ void SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat );
+ void NewEntry( const SCROW nPos, const sal_uInt32 nNumFormat );
+ void Apply( ScDocument&, const SCCOL nCol, const SCTAB nTab, const ScPatternAttr& );
+ void Apply( ScDocument &rDoc, const SCCOL nCol, const SCTAB nTab );
+};
class DifAttrCache
{
-private:
- DifColumn** ppCols;
- sal_Bool bPlain;
public:
- DifAttrCache( const sal_Bool bPlain );
- ~DifAttrCache();
- inline void SetLogical( const SCCOL nCol, const SCROW nRow );
- void SetNumFormat( const SCCOL nCol, const SCROW nRow, const sal_uInt32 nNumFormat );
- void Apply( ScDocument&, SCTAB nTab );
-};
+ DifAttrCache( const sal_Bool bPlain );
-inline void DifAttrCache::SetLogical( const SCCOL nCol, const SCROW nRow )
-{
- DBG_ASSERT( ValidCol(nCol), "-DifAttrCache::SetLogical(): Col zu gross!" );
- DBG_ASSERT( bPlain, "*DifAttrCache::SetLogical(): muss Plain sein!" );
+ ~DifAttrCache();
- if( !ppCols[ nCol ] )
- ppCols[ nCol ] = new DifColumn;
- ppCols[ nCol ]->SetLogical( nRow );
-}
+ void SetLogical( const SCCOL nCol, const SCROW nRow );
+
+ void SetNumFormat( const SCCOL nCol, const SCROW nRow, const sal_uInt32 nNumFormat );
+
+ void Apply( ScDocument&, SCTAB nTab );
+private:
+
+ DifColumn** ppCols;
+ sal_Bool bPlain;
+};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/eeimport.hxx b/sc/source/filter/inc/eeimport.hxx
index 540f0438c2c3..ed74cc22c140 100644
--- a/sc/source/filter/inc/eeimport.hxx
+++ b/sc/source/filter/inc/eeimport.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,10 +60,12 @@ public:
virtual sal_uLong Read( SvStream& rStream, const String& rBaseURL );
virtual ScRange GetRange() { return maRange; }
- virtual void WriteToDocument( sal_Bool bSizeColsRows = sal_False,
+ virtual void WriteToDocument( sal_Bool bSizeColsRows = false,
double nOutputFactor = 1.0,
SvNumberFormatter* pFormatter = NULL,
bool bConvertDate = true );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/eeparser.hxx b/sc/source/filter/inc/eeparser.hxx
index d4081bd83588..0f5e2ddc627e 100644
--- a/sc/source/filter/inc/eeparser.hxx
+++ b/sc/source/filter/inc/eeparser.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,8 @@
#include <svl/itemset.hxx>
#include <editeng/editdata.hxx>
#include <address.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
const sal_Char nHorizontal = 1;
const sal_Char nVertical = 2;
@@ -56,7 +59,6 @@ struct ScHTMLImage
~ScHTMLImage()
{ if ( pGraphic ) delete pGraphic; }
};
-DECLARE_LIST( ScHTMLImageList, ScHTMLImage* )
struct ScEEParseEntry
{
@@ -66,31 +68,31 @@ struct ScEEParseEntry
String* pNumStr; // HTML evtl. SDNUM String
String* pName; // HTML evtl. Anchor/RangeName
String aAltText; // HTML IMG ALT Text
- ScHTMLImageList* pImageList; // Grafiken in dieser Zelle
+ boost::ptr_vector< ScHTMLImage > maImageList; // Grafiken in dieser Zelle
SCCOL nCol; // relativ zum Beginn des Parse
SCROW nRow;
- sal_uInt16 nTab; // HTML TableInTable
- sal_uInt16 nTwips; // RTF ColAdjust etc.
+ sal_uInt16 nTab; // HTML TableInTable
+ sal_uInt16 nTwips; // RTF ColAdjust etc.
SCCOL nColOverlap; // merged cells wenn >1
SCROW nRowOverlap; // merged cells wenn >1
- sal_uInt16 nOffset; // HTML PixelOffset
- sal_uInt16 nWidth; // HTML PixelWidth
- sal_Bool bHasGraphic; // HTML any image loaded
- bool bEntirePara; // sal_True = use entire paragraph, false = use selection
+ sal_uInt16 nOffset; // HTML PixelOffset
+ sal_uInt16 nWidth; // HTML PixelWidth
+ bool bHasGraphic; // HTML any image loaded
+ bool bEntirePara; // TRUE = use entire paragraph, false = use selection
ScEEParseEntry( SfxItemPool* pPool ) :
aItemSet( *pPool ), pValStr( NULL ),
- pNumStr( NULL ), pName( NULL ), pImageList( NULL ),
+ pNumStr( NULL ), pName( NULL ),
nCol(SCCOL_MAX), nRow(SCROW_MAX), nTab(0),
nColOverlap(1), nRowOverlap(1),
- nOffset(0), nWidth(0), bHasGraphic(sal_False), bEntirePara(true)
+ nOffset(0), nWidth(0), bHasGraphic(false), bEntirePara(true)
{}
ScEEParseEntry( const SfxItemSet& rItemSet ) :
aItemSet( rItemSet ), pValStr( NULL ),
- pNumStr( NULL ), pName( NULL ), pImageList( NULL ),
+ pNumStr( NULL ), pName( NULL ),
nCol(SCCOL_MAX), nRow(SCROW_MAX), nTab(0),
nColOverlap(1), nRowOverlap(1),
- nOffset(0), nWidth(0), bHasGraphic(sal_False), bEntirePara(true)
+ nOffset(0), nWidth(0), bHasGraphic(false), bEntirePara(true)
{}
~ScEEParseEntry()
{
@@ -100,18 +102,10 @@ struct ScEEParseEntry
delete pNumStr;
if ( pName )
delete pName;
- if ( pImageList )
- {
- for ( ScHTMLImage* pI = pImageList->First();
- pI; pI = pImageList->Next() )
- {
- delete pI;
- }
- delete pImageList;
- }
+ if ( maImageList.size() )
+ maImageList.clear();
}
};
-DECLARE_LIST( ScEEParseList, ScEEParseEntry* )
class EditEngine;
@@ -122,7 +116,7 @@ protected:
EditEngine* pEdit;
SfxItemPool* pPool;
SfxItemPool* pDocPool;
- ScEEParseList* pList;
+ ::std::vector< ScEEParseEntry* > maList;
ScEEParseEntry* pActEntry;
Table* pColWidths;
int nLastToken;
@@ -137,17 +131,19 @@ public:
ScEEParser( EditEngine* );
virtual ~ScEEParser();
- virtual sal_uLong Read( SvStream&, const String& rBaseURL ) = 0;
+ virtual sal_uLong Read( SvStream&, const String& rBaseURL ) = 0;
- void GetDimensions( SCCOL& nCols, SCROW& nRows ) const
- { nCols = nColMax; nRows = nRowMax; }
- sal_uLong Count() const { return pList->Count(); }
- ScEEParseEntry* First() const { return pList->First(); }
- ScEEParseEntry* Next() const { return pList->Next(); }
- Table* GetColWidths() const { return pColWidths; }
+ Table* GetColWidths() const { return pColWidths; }
+ void GetDimensions( SCCOL& nCols, SCROW& nRows ) const
+ { nCols = nColMax; nRows = nRowMax; }
+
+ inline size_t ListSize() const{ return maList.size(); }
+ ScEEParseEntry* ListEntry( size_t index ) { return maList[ index ]; }
+ const ScEEParseEntry* ListEntry( size_t index ) const { return maList[ index ]; }
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excdefs.hxx b/sc/source/filter/inc/excdefs.hxx
index 2d489af7e427..ae8a1cd4c861 100644
--- a/sc/source/filter/inc/excdefs.hxx
+++ b/sc/source/filter/inc/excdefs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,3 +105,4 @@ const sal_uInt8 EXC_AFOPER_GREATEREQUAL = 0x06;
#endif // _EXCDEFS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excdoc.hxx b/sc/source/filter/inc/excdoc.hxx
index 6cb141fe3d0f..75c0f2433569 100644
--- a/sc/source/filter/inc/excdoc.hxx
+++ b/sc/source/filter/inc/excdoc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "excrecds.hxx"
#include "xeroot.hxx"
#include "root.hxx"
+#include <boost/shared_ptr.hpp>
//------------------------------------------------------------------ Forwards -
@@ -54,7 +56,7 @@ class ExcTable : public XclExpRecordBase, public XclExpRoot
{
private:
typedef XclExpRecordList< ExcBundlesheetBase > ExcBoundsheetList;
- typedef ScfRef< XclExpCellTable > XclExpCellTableRef;
+ typedef boost::shared_ptr< XclExpCellTable > XclExpCellTableRef;
XclExpRecordList<> aRecList;
XclExpCellTableRef mxCellTable;
@@ -110,7 +112,7 @@ public:
void ReadDoc( void );
void Write( SvStream& rSvStrm );
- void WriteXml( SvStream& rSvStrm );
+ void WriteXml( XclExpXmlStream& );
};
@@ -118,3 +120,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excform.hxx b/sc/source/filter/inc/excform.hxx
index a3e70c0563a2..0744bdf52c64 100644
--- a/sc/source/filter/inc/excform.hxx
+++ b/sc/source/filter/inc/excform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@ public:
virtual ConvErr Convert( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen,
bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula );
- virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, const FORMULA_TYPE eFT = FT_CellFormula );
+ virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen,
const String& rUrl, const ::std::vector<String>& rTabNames );
@@ -72,10 +73,6 @@ public:
const ScTokenArray* GetBoolErr( XclBoolError );
sal_Bool GetShrFmla( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen );
-#if 0
- // return = sal_True -> String-Record folgt!
- static sal_Bool SetCurVal( ScFormulaCell& rCell, double& rCurVal );
-#endif
static void SetError( ScFormulaCell& rCell, const ConvErr eErr );
static inline sal_Bool IsComplColRange( const sal_uInt16 nCol1, const sal_uInt16 nCol2 );
@@ -137,7 +134,7 @@ public:
virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula );
- virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, const FORMULA_TYPE eFT = FT_CellFormula );
+ virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen,
const String& rUrl, const ::std::vector<String>& rTabNames );
@@ -158,3 +155,5 @@ inline sal_Bool ExcelToSc8::IsComplRowRange( const sal_uInt16 nRow1, const sal_u
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx
index 6fc43e90b96b..65adb65b16e6 100644
--- a/sc/source/filter/inc/excimp8.hxx
+++ b/sc/source/filter/inc/excimp8.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,6 +58,9 @@ public:
virtual FltError Read( void );
protected:
+ // represents codename ( and associated modules )
+ // not speficied directly in the binary format
+ std::vector< String > AutoGeneratedCodeNames;
ExcScenarioList aScenList;
void Calccount( void ); // 0x0C
@@ -127,7 +131,7 @@ public:
void SetAdvancedRange( const ScRange* pRange );
void SetExtractPos( const ScAddress& rAddr );
inline void SetAutoOrAdvanced() { bAutoOrAdvanced = sal_True; }
- void Apply( const sal_Bool bUseUnNamed = sal_False );
+ void Apply( const sal_Bool bUseUnNamed = false );
void CreateScDBData( const sal_Bool bUseUnNamed );
void EnableRemoveFilter();
};
@@ -163,3 +167,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx
index 73ee9f45dfc0..b579b28e782e 100644
--- a/sc/source/filter/inc/excrecds.hxx
+++ b/sc/source/filter/inc/excrecds.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,6 +47,7 @@
#include "root.hxx"
#include "excdefs.hxx"
#include "cell.hxx"
+#include <boost/shared_ptr.hpp>
//------------------------------------------------------------------ Forwards -
@@ -72,6 +74,7 @@ class ExcRecord : public XclExpRecord
{
public:
virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
virtual sal_uInt16 GetNum() const = 0;
virtual sal_Size GetLen() const = 0;
@@ -142,7 +145,7 @@ private:
protected:
sal_Bool bVal;
- inline ExcBoolRecord() : bVal( sal_False ) {}
+ inline ExcBoolRecord() : bVal( false ) {}
public:
inline ExcBoolRecord( const sal_Bool bDefault ) : bVal( bDefault ) {}
@@ -285,6 +288,8 @@ public:
virtual sal_uInt16 GetNum( void ) const;
virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+ sal_Bool bDateCompatibility;
};
@@ -427,7 +432,7 @@ private:
sal_Bool AddCondition( ScQueryConnect eConn, sal_uInt8 nType,
sal_uInt8 nOp, double fVal, String* pText,
- sal_Bool bSimple = sal_False );
+ sal_Bool bSimple = false );
virtual void WriteBody( XclExpStream& rStrm );
@@ -471,6 +476,7 @@ private:
XclExpFiltermode* pFilterMode;
XclExpAutofilterinfo* pFilterInfo;
ScRange maRef;
+ bool mbAutoFilter;
};
// ----------------------------------------------------------------------------
@@ -495,7 +501,7 @@ public:
private:
using XclExpRoot::CreateRecord;
- typedef ScfRef< ExcAutoFilterRecs > XclExpTabFilterRef;
+ typedef boost::shared_ptr< ExcAutoFilterRecs > XclExpTabFilterRef;
typedef ::std::map< SCTAB, XclExpTabFilterRef > XclExpTabFilterMap;
XclExpTabFilterMap maFilterMap;
@@ -504,3 +510,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excscen.hxx b/sc/source/filter/inc/excscen.hxx
index 1caa82f926c5..b1c671b956e6 100644
--- a/sc/source/filter/inc/excscen.hxx
+++ b/sc/source/filter/inc/excscen.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,16 @@
#ifndef SC_EXCSCEN_HXX
#define SC_EXCSCEN_HXX
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include <tools/solar.h>
-#include <tools/list.hxx>
#include <tools/string.hxx>
-
struct RootData;
class XclImpRoot;
class XclImpStream;
class ScDocument;
-
-
class ExcScenarioCell
{
private:
@@ -48,100 +47,43 @@ public:
const sal_uInt16 nCol;
const sal_uInt16 nRow;
- ExcScenarioCell( const sal_uInt16 nC, const sal_uInt16 nR );
- void SetValue( const String& rVal );
- inline const String& GetValue( void ) const;
-};
-
-
-
-
-class ExcScenario : protected List
-{
-private:
- friend class ExcScenarioList;
-protected:
- String* pName;
- String* pComment;
- String* pUserName;
- sal_uInt8 nProtected;
+ ExcScenarioCell( const UINT16 nC, const UINT16 nR );
- const sal_uInt16 nTab;
+ inline void SetValue( const String& rVal ) { aValue = rVal; }
- void Apply( const XclImpRoot& rRoot, const sal_Bool bLast = sal_False );
-public:
- ExcScenario( XclImpStream& rIn, const RootData& rRoot );
- virtual ~ExcScenario();
+ inline const String& GetValue( void ) const { return aValue; }
};
-
-
-
-class ExcScenarioList : protected List
+class ExcScenario
{
-private:
- sal_uInt16 nLastScenario;
- inline ExcScenario* _First( void ) { return ( ExcScenario* ) List::First(); }
- inline ExcScenario* _Next( void ) { return ( ExcScenario* ) List::Next(); }
- inline ExcScenario* _Last( void ) { return ( ExcScenario* ) List::Last(); }
- inline ExcScenario* _Prev( void ) { return ( ExcScenario* ) List::Prev(); }
-protected:
public:
- ExcScenarioList( void );
- virtual ~ExcScenarioList();
- inline void Append( ExcScenario* pNew );
+ ExcScenario( XclImpStream& rIn, const RootData& rRoot );
- inline void SetLast( const sal_uInt16 nIndex4Last );
+ ~ExcScenario();
- inline const ExcScenario* First( void );
- inline const ExcScenario* Next( void );
+ void Apply( const XclImpRoot& rRoot, const sal_Bool bLast = false );
- using List::Count;
+protected:
- void Apply( const XclImpRoot& rRoot );
+ String* pName;
+ String* pComment;
+ String* pUserName;
+ UINT8 nProtected;
+ const UINT16 nTab;
+ boost::ptr_vector<ExcScenarioCell> aEntries;
};
-
-
-
-inline const String& ExcScenarioCell::GetValue( void ) const
-{
- return aValue;
-}
-
-
-
-
-inline ExcScenarioList::ExcScenarioList( void )
-{
- nLastScenario = 0;
-}
-
-
-inline void ExcScenarioList::Append( ExcScenario* p )
+struct ExcScenarioList
{
- List::Insert( p, LIST_APPEND );
-}
+ ExcScenarioList () : nLastScenario(0) {}
+ void Apply( const XclImpRoot& rRoot );
-inline const ExcScenario* ExcScenarioList::First( void )
-{
- return ( const ExcScenario* ) List::First();
-}
-
-
-inline const ExcScenario* ExcScenarioList::Next( void )
-{
- return ( const ExcScenario* ) List::Next();
-}
-
-
-inline void ExcScenarioList::SetLast( const sal_uInt16 n )
-{
- nLastScenario = n;
-}
-
+ sal_uInt16 nLastScenario;
+ boost::ptr_vector<ExcScenario> aEntries;
+};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/exp_op.hxx b/sc/source/filter/inc/exp_op.hxx
index a818c0912ca0..3dabe04e6070 100644
--- a/sc/source/filter/inc/exp_op.hxx
+++ b/sc/source/filter/inc/exp_op.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -127,21 +128,7 @@ public:
};
-class ExportXml2007 : public ExportTyp, protected XclExpRoot
-{
-private:
- ExcDocument* pExcDoc;
-
-protected:
- RootData* pExcRoot;
-
-public:
- ExportXml2007( XclExpRootData& rExpData, SvStream& rStrm );
- virtual ~ExportXml2007();
- FltError Write();
-};
-
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/expbase.hxx b/sc/source/filter/inc/expbase.hxx
index 25f70ecfce33..fe840674383a 100644
--- a/sc/source/filter/inc/expbase.hxx
+++ b/sc/source/filter/inc/expbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,9 @@ class ScExportBase
{
public:
#if defined UNX
- static const sal_Char __FAR_DATA sNewLine;
+ static const sal_Char sNewLine;
#else
- static const sal_Char __FAR_DATA sNewLine[];
+ static const sal_Char sNewLine[];
#endif
protected:
@@ -80,3 +81,4 @@ public:
#endif // SC_EXPBASE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index 699a4e28720a..36b8c873f213 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,12 +97,6 @@ public:
const ::rtl::OUString& rServiceName,
const UnoAnySequence& rArgs );
-//UNUSED2008-05 /** Creates an instance from the passed service name, using the service factory of the passed object. */
-//UNUSED2008-05 static XInterfaceRef CreateInstanceWithArgs(
-//UNUSED2008-05 SfxObjectShell* pShell,
-//UNUSED2008-05 const ::rtl::OUString& rServiceName,
-//UNUSED2008-05 const UnoAnySequence& rArgs );
-
/** Creates an instance from the passed service name, using the process service factory. */
static XInterfaceRef CreateInstanceWithArgs(
const ::rtl::OUString& rServiceName,
@@ -189,7 +184,7 @@ public:
{ UnoAny aAny; return GetAnyProperty( aAny, rPropName ) && (aAny >>= rValue); }
/** Gets the specified Boolean property from the property set.
- @return true = property contains true; false = property contains false or error occured. */
+ @return true = property contains true; false = property contains false or error occurred. */
bool GetBoolProperty( const ::rtl::OUString& rPropName ) const;
/** Gets the specified Boolean property from the property set.
@@ -329,7 +324,8 @@ bool ScfPropSetHelper::ReadValue( Type& rValue )
template< typename Type >
void ScfPropSetHelper::WriteValue( const Type& rValue )
{
- if( UnoAny* pAny = GetNextAny() )
+ UnoAny* pAny = GetNextAny();
+ if( pAny )
*pAny <<= rValue;
}
@@ -351,3 +347,4 @@ ScfPropSetHelper& operator<<( ScfPropSetHelper& rPropSetHelper, const Type& rVal
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx
index d624b7afeaf8..2943677712bd 100644
--- a/sc/source/filter/inc/filt_pch.hxx
+++ b/sc/source/filter/inc/filt_pch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,6 @@
#define SC_PROGRESS_CXX
-// ab hier automatisch per makepch generiert
-// folgende duerfen nicht aufgenommen werden:
-// ...
-
#include <tools/solar.h>
#include <tools/string.hxx>
#include <rtl/textenc.h>
@@ -53,7 +50,6 @@
#include <rtl/locale.h>
#include <tools/contnr.hxx>
#include <i18npool/lang.h>
-#include <tools/list.hxx>
#include <global.hxx>
#include <tools/stream.hxx>
#include <tools/errinf.hxx>
@@ -136,7 +132,6 @@
#include <svl/intitem.hxx>
#include <svl/cintitem.hxx>
#include <svl/brdcst.hxx>
-#include <sot/sotref.hxx>
#include <tools/globname.hxx>
#include <sot/factory.hxx>
#include <sot/object.hxx>
@@ -159,9 +154,6 @@
#include <tools/shl.hxx>
#include <tools/pstm.hxx>
#include <editeng/fhgtitem.hxx>
-#include <vos/types.hxx>
-#include <vos/object.hxx>
-#include <vos/macros.hxx>
#include <tools/unqid.hxx>
#include <com/sun/star/uno/Sequence.h>
#include <uno/sequence2.h>
@@ -224,9 +216,8 @@
#include <com/sun/star/container/NoSuchElementException.hdl>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <vcl/svapp.hxx>
-#include <vos/thread.hxx>
-#include <vos/runnable.hxx>
-#include <vos/refernce.hxx>
+#include <osl/thread.hxx>
+#include <salhelper/simplereferenceobject.hxx>
#include <vcl/apptypes.hxx>
#include <editeng/editdata.hxx>
#include <editeng/editeng.hxx>
@@ -319,3 +310,4 @@
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/fkttab.h b/sc/source/filter/inc/fkttab.h
index 3d834c5cf04d..5604fff3ac7d 100644
--- a/sc/source/filter/inc/fkttab.h
+++ b/sc/source/filter/inc/fkttab.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,3 +45,4 @@ extern BEARBFKT *pFkt[ 256 ];
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/flttypes.hxx b/sc/source/filter/inc/flttypes.hxx
index 0a78889feb8c..c34fff6c2299 100644
--- a/sc/source/filter/inc/flttypes.hxx
+++ b/sc/source/filter/inc/flttypes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,4 @@ enum Lotus123Typ
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/formel.hxx b/sc/source/filter/inc/formel.hxx
index 5bc88d488e78..9cf88b17ac26 100644
--- a/sc/source/filter/inc/formel.hxx
+++ b/sc/source/filter/inc/formel.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,16 +29,16 @@
#ifndef SC_FORMEL_HXX
#define SC_FORMEL_HXX
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include <tools/solar.h>
-#include <tools/list.hxx>
#include <tools/string.hxx>
-#include "tokstack.hxx"
-#include "root.hxx"
-#include <global.hxx>
-#include <compiler.hxx>
+#include <compiler.hxx>
+#include <global.hxx>
-// ----- forwards --------------------------------------------------------
+#include "root.hxx"
+#include "tokstack.hxx"
class XclImpStream;
class ScTokenArray;
@@ -45,11 +46,6 @@ class ScFormulaCell;
struct ScSingleRefData;
struct ScComplexRefData;
-
-
-
-//------------------------------------------------------------------------
-
enum ConvErr
{
ConvOK = 0,
@@ -59,7 +55,6 @@ enum ConvErr
ConvErrCount // Nicht alle Bytes der Formel 'erwischt'
};
-
enum FORMULA_TYPE
{
FT_CellFormula,
@@ -67,115 +62,34 @@ enum FORMULA_TYPE
FT_SharedFormula
};
-
-
-
-//--------------------------------------------------------- class ScRangeList -
-
-class _ScRangeList : protected List
-{
-private:
-protected:
-public:
- virtual ~_ScRangeList();
- inline void Append( const ScRange& rRange );
- inline void Append( ScRange* pRange );
- inline void Append( const ScSingleRefData& rSRD );
- inline void Append( const ScComplexRefData& rCRD );
-
- using List::Count;
- inline sal_Bool HasRanges( void ) const;
-
- inline const ScRange* First( void );
- inline const ScRange* Next( void );
-};
-
-
-inline void _ScRangeList::Append( const ScRange& r )
-{
- List::Insert( new ScRange( r ), LIST_APPEND );
-}
-
-
-inline void _ScRangeList::Append( ScRange* p )
-{
- List::Insert( p, LIST_APPEND );
-}
-
-
-inline sal_Bool _ScRangeList::HasRanges( void ) const
-{
- return Count() > 0;
-}
-
-
-inline const ScRange* _ScRangeList::First( void )
-{
- return ( const ScRange* ) List::First();
-}
-
-
-inline const ScRange* _ScRangeList::Next( void )
-{
- return ( const ScRange* ) List::Next();
-}
-
-
-inline void _ScRangeList::Append( const ScSingleRefData& r )
-{
- List::Insert( new ScRange( r.nCol, r.nRow, r.nTab ), LIST_APPEND );
-}
-
-
-inline void _ScRangeList::Append( const ScComplexRefData& r )
-{
- List::Insert( new ScRange( r.Ref1.nCol, r.Ref1.nRow, r.Ref1.nTab,
- r.Ref2.nCol, r.Ref2.nRow, r.Ref2.nTab ),
- LIST_APPEND );
-}
-
-
-
-
-//----------------------------------------------------- class ScRangeListTabs -
-
class _ScRangeListTabs
{
-private:
-protected:
+ struct _ScRangeList : public boost::ptr_vector<ScRange>
+ {
+ iterator iterCur;
+ };
+
sal_Bool bHasRanges;
_ScRangeList** ppTabLists;
_ScRangeList* pAct;
- sal_uInt16 nAct;
-public:
- _ScRangeListTabs( void );
- virtual ~_ScRangeListTabs();
-
- void Append( ScSingleRefData aSRD, const sal_Bool bLimit = sal_True );
- void Append( ScComplexRefData aCRD, const sal_Bool bLimit = sal_True );
-
- inline sal_Bool HasRanges( void ) const;
-
- const ScRange* First( const sal_uInt16 nTab = 0 );
- const ScRange* Next( void );
-// const ScRange* NextContinue( void );
- inline const _ScRangeList* GetActList( void ) const;
-};
+ UINT16 nAct;
+public:
-inline sal_Bool _ScRangeListTabs::HasRanges( void ) const
-{
- return bHasRanges;
-}
+ _ScRangeListTabs ();
+ ~_ScRangeListTabs();
-inline const _ScRangeList* _ScRangeListTabs::GetActList( void ) const
-{
- return pAct;
-}
+ void Append( ScSingleRefData aSRD, SCsTAB nTab, const sal_Bool bLimit = true );
+ void Append( ScComplexRefData aCRD, SCsTAB nTab, const sal_Bool bLimit = true );
+ const ScRange* First ( const UINT16 nTab = 0 );
+ const ScRange* Next ();
+ inline bool HasRanges () const { return bHasRanges; }
+ inline bool HasActList () const { return pAct != NULL; }
+};
class ConverterBase
{
@@ -213,7 +127,7 @@ public:
virtual ConvErr Convert( const ScTokenArray*& rpErg, XclImpStream& rStrm, sal_Size nFormulaLen,
bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) = 0;
- virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen,
+ virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab,
const FORMULA_TYPE eFT = FT_CellFormula ) = 0;
};
@@ -237,8 +151,6 @@ protected:
virtual ~LotusConverterBase();
public:
-//UNUSED2008-05 void Reset( sal_Int32 nLen );
-//UNUSED2008-05 void Reset( sal_Int32 nLen, const ScAddress& rEingPos );
void Reset( const ScAddress& rEingPos );
virtual ConvErr Convert( const ScTokenArray*& rpErg, sal_Int32& nRest,
@@ -294,3 +206,4 @@ inline void LotusConverterBase::Read( sal_uInt32& nUINT32 )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/fprogressbar.hxx b/sc/source/filter/inc/fprogressbar.hxx
index 5b005c5fbcf9..cfcd872eff89 100644
--- a/sc/source/filter/inc/fprogressbar.hxx
+++ b/sc/source/filter/inc/fprogressbar.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,8 @@
#ifndef SC_FPROGRESSBAR_HXX
#define SC_FPROGRESSBAR_HXX
+#include <boost/noncopyable.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
#include "globstr.hrc"
#include "ftools.hxx"
#include "scdllapi.h"
@@ -110,7 +113,7 @@ const sal_Int32 SCF_INV_SEGMENT = -1;
// not allowed (second segment active): aProgress.Progress();
// not allowed (first segment not empty): aProgress.GetSegmentProgressBar( nSeg1 );
*/
-class ScfProgressBar : ScfNoCopy
+class ScfProgressBar : private boost::noncopyable
{
public:
explicit ScfProgressBar( SfxObjectShell* pDocShell, const String& rText );
@@ -152,7 +155,7 @@ private:
void Init( SfxObjectShell* pDocShell );
/** Returns the segment specified by list index. */
- ScfProgressSegment* GetSegment( sal_Int32 nSegment ) const;
+ ScfProgressSegment* GetSegment( sal_Int32 nSegment );
/** Activates progress bar and sets current segment. */
void SetCurrSegment( ScfProgressSegment* pSegment );
/** Increases mnTotalPos and calls the system progress bar. */
@@ -172,8 +175,8 @@ private:
~ScfProgressSegment();
};
- typedef ::std::auto_ptr< ScProgress > ScProgressPtr;
- typedef ScfDelList< ScfProgressSegment > ScfSegmentList;
+ typedef ::std::auto_ptr< ScProgress > ScProgressPtr;
+ typedef boost::ptr_vector< ScfProgressSegment > ScfSegmentList;
ScfSegmentList maSegments; /// List of progress segments.
String maText; /// UI string for system progress.
@@ -220,7 +223,6 @@ private:
class ScfStreamProgressBar
{
public:
-//UNUSED2008-05 explicit ScfStreamProgressBar( SvStream& rStrm, SfxObjectShell* pDocShell, const String& rText );
explicit ScfStreamProgressBar( SvStream& rStrm, SfxObjectShell* pDocShell, sal_uInt16 nResId = STR_LOAD_DOC );
/** Sets the progress bar to the current stream position. */
@@ -241,3 +243,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index 2860290cc169..cf15e543e0ee 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,18 +34,18 @@
#include <limits>
#include <memory>
#include <tools/string.hxx>
-#include <tools/list.hxx>
#include <tools/debug.hxx>
+#include <sal/macros.h>
#include <oox/helper/helper.hxx>
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
#include "filter.hxx"
#include "scdllapi.h"
// Common macros ==============================================================
-/** Expands to the size of a STATIC data array. */
-#define STATIC_TABLE_SIZE( array ) (sizeof(array)/sizeof(*(array)))
/** Expands to a pointer behind the last element of a STATIC data array (like STL end()). */
-#define STATIC_TABLE_END( array ) ((array)+STATIC_TABLE_SIZE(array))
+#define STATIC_TABLE_END( array ) ((array)+SAL_N_ELEMENTS(array))
/** Expands to a temporary String, created from an ASCII character array. */
#define CREATE_STRING( ascii ) String( RTL_CONSTASCII_USTRINGPARAM( ascii ) )
@@ -137,126 +138,6 @@ void insert_value( Type& rnBitField, InsertType nValue, sal_uInt8 nStartBit, sal
// ============================================================================
-/** Deriving from this class prevents copy construction. */
-class ScfNoCopy
-{
-private:
- ScfNoCopy( const ScfNoCopy& );
- ScfNoCopy& operator=( const ScfNoCopy& );
-protected:
- inline ScfNoCopy() {}
-};
-
-// ----------------------------------------------------------------------------
-
-/** Deriving from this class prevents construction in general. */
-class ScfNoInstance : private ScfNoCopy {};
-
-// ============================================================================
-
-/** Simple shared pointer (NOT thread-save, but faster than boost::shared_ptr). */
-template< typename Type >
-class ScfRef
-{
- template< typename > friend class ScfRef;
-
-public:
- typedef Type element_type;
- typedef ScfRef this_type;
-
- inline explicit ScfRef( element_type* pObj = 0 ) { eat( pObj ); }
- inline /*implicit*/ ScfRef( const this_type& rRef ) { eat( rRef.mpObj, rRef.mpnCount ); }
- template< typename Type2 >
- inline /*implicit*/ ScfRef( const ScfRef< Type2 >& rRef ) { eat( rRef.mpObj, rRef.mpnCount ); }
- inline ~ScfRef() { rel(); }
-
- inline void reset( element_type* pObj = 0 ) { rel(); eat( pObj ); }
- inline this_type& operator=( const this_type& rRef ) { if( this != &rRef ) { rel(); eat( rRef.mpObj, rRef.mpnCount ); } return *this; }
- template< typename Type2 >
- inline this_type& operator=( const ScfRef< Type2 >& rRef ) { rel(); eat( rRef.mpObj, rRef.mpnCount ); return *this; }
-
- inline element_type* get() const { return mpObj; }
- inline bool is() const { return mpObj != 0; }
-
- inline element_type* operator->() const { return mpObj; }
- inline element_type& operator*() const { return *mpObj; }
-
- inline bool operator!() const { return mpObj == 0; }
-
-private:
- inline void eat( element_type* pObj, size_t* pnCount = 0 ) { mpObj = pObj; mpnCount = mpObj ? (pnCount ? pnCount : new size_t( 0 )) : 0; if( mpnCount ) ++*mpnCount; }
- inline void rel() { if( mpnCount && !--*mpnCount ) { DELETEZ( mpObj ); DELETEZ( mpnCount ); } }
-
-private:
- Type* mpObj;
- size_t* mpnCount;
-};
-
-template< typename Type >
-inline bool operator==( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
-{
- return rxRef1.get() == rxRef2.get();
-}
-
-template< typename Type >
-inline bool operator!=( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
-{
- return rxRef1.get() != rxRef2.get();
-}
-
-template< typename Type >
-inline bool operator<( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
-{
- return rxRef1.get() < rxRef2.get();
-}
-
-template< typename Type >
-inline bool operator>( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
-{
- return rxRef1.get() > rxRef2.get();
-}
-
-template< typename Type >
-inline bool operator<=( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
-{
- return rxRef1.get() <= rxRef2.get();
-}
-
-template< typename Type >
-inline bool operator>=( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
-{
- return rxRef1.get() >= rxRef2.get();
-}
-
-// ----------------------------------------------------------------------------
-
-/** Template for a map of ref-counted objects with additional accessor functions. */
-template< typename KeyType, typename ObjType >
-class ScfRefMap : public ::std::map< KeyType, ScfRef< ObjType > >
-{
-public:
- typedef KeyType key_type;
- typedef ScfRef< ObjType > ref_type;
- typedef ::std::map< key_type, ref_type > map_type;
-
- /** Returns true, if the object accossiated to the passed key exists. */
- inline bool has( key_type nKey ) const
- {
- typename map_type::const_iterator aIt = find( nKey );
- return (aIt != this->end()) && aIt->second.is();
- }
-
- /** Returns a reference to the object accossiated to the passed key, or 0 on error. */
- inline ref_type get( key_type nKey ) const
- {
- typename map_type::const_iterator aIt = find( nKey );
- if( aIt != this->end() ) return aIt->second;
- return ref_type();
- }
-};
-
-// ============================================================================
-
class Color;
class SfxPoolItem;
class SfxItemSet;
@@ -268,7 +149,7 @@ class SotStorageStreamRef;
class SvStream;
/** Contains static methods used anywhere in the filters. */
-class ScfTools : ScfNoInstance
+class ScfTools : boost::noncopyable
{
public:
@@ -399,6 +280,10 @@ private:
static const String& GetHTMLIndexPrefix();
/** Returns the prefix for table names. */
static const String& GetHTMLNamePrefix();
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static items. To enforce this, the default constructor
+ is made private */
+ ScfTools();
};
// Containers =================================================================
@@ -408,100 +293,10 @@ typedef ::std::vector< sal_Int16 > ScfInt16Vec;
typedef ::std::vector< sal_uInt16 > ScfUInt16Vec;
typedef ::std::vector< sal_Int32 > ScfInt32Vec;
typedef ::std::vector< sal_uInt32 > ScfUInt32Vec;
-typedef ::std::vector< sal_Int64 > ScfInt64Vec;
-typedef ::std::vector< sal_uInt64 > ScfUInt64Vec;
-typedef ::std::vector< String > ScfStringVec;
+typedef ::std::vector< ::rtl::OUString > ScfStringVec;
// ----------------------------------------------------------------------------
-/** Template for a list that owns the contained objects.
- @descr This list stores pointers to objects and deletes the objects itself
- on destruction. The Clear() method deletes all objects too. */
-template< typename Type > class ScfDelList
-{
-public:
- inline explicit ScfDelList( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 ) :
- maList( nInitSize, nResize ) {}
- /** Creates a deep copy of the passed list (copy-constructs all contained objects). */
- inline explicit ScfDelList( const ScfDelList& rSrc ) { *this = rSrc; }
- virtual ~ScfDelList();
-
- /** Creates a deep copy of the passed list (copy-constructs all contained objects). */
- ScfDelList& operator=( const ScfDelList& rSrc );
-
- inline void Insert( Type* pObj, sal_uLong nIndex ) { if( pObj ) maList.Insert( pObj, nIndex ); }
- inline void Append( Type* pObj ) { if( pObj ) maList.Insert( pObj, LIST_APPEND ); }
- /** Removes the object without deletion. */
- inline Type* Remove( sal_uLong nIndex ) { return static_cast< Type* >( maList.Remove( nIndex ) ); }
- /** Removes and deletes the object. */
- inline void Delete( sal_uLong nIndex ) { delete Remove( nIndex ); }
- /** Exchanges the contained object with the passed, returns the old. */
- inline Type* Exchange( Type* pObj, sal_uLong nIndex ) { return static_cast< Type* >( maList.Replace( pObj, nIndex ) ); }
- /** Replaces (deletes) the contained object. */
- inline void Replace( Type* pObj, sal_uLong nIndex ) { delete Exchange( pObj, nIndex ); }
-
- void Clear();
- inline sal_uLong Count() const { return maList.Count(); }
- inline bool Empty() const { return maList.Count() == 0; }
-
- inline Type* GetCurObject() const { return static_cast< Type* >( maList.GetCurObject() ); }
- inline sal_uLong GetCurPos() const { return maList.GetCurPos(); }
- inline Type* GetObject( sal_uInt32 nIndex ) const { return static_cast< Type* >( maList.GetObject( nIndex ) ); }
-
- inline Type* First() const { return static_cast< Type* >( maList.First() ); }
- inline Type* Last() const { return static_cast< Type* >( maList.Last() ); }
- inline Type* Next() const { return static_cast< Type* >( maList.Next() ); }
- inline Type* Prev() const { return static_cast< Type* >( maList.Prev() ); }
-
-private:
- mutable List maList; /// The base container object.
-};
-
-template< typename Type > ScfDelList< Type >& ScfDelList< Type >::operator=( const ScfDelList& rSrc )
-{
- Clear();
- for( const Type* pObj = rSrc.First(); pObj; pObj = rSrc.Next() )
- Append( new Type( *pObj ) );
- return *this;
-}
-
-template< typename Type > ScfDelList< Type >::~ScfDelList()
-{
- Clear();
-}
-
-template< typename Type > void ScfDelList< Type >::Clear()
-{
- for( Type* pObj = First(); pObj; pObj = Next() )
- delete pObj;
- maList.Clear();
-}
-
-// ----------------------------------------------------------------------------
-
-/** Template for a stack that owns the contained objects.
- @descr This stack stores pointers to objects and deletes the objects
- itself on destruction. The Clear() method deletes all objects too.
- The Pop() method removes the top object from stack without deletion. */
-template< typename Type >
-class ScfDelStack : private ScfDelList< Type >
-{
-public:
- inline ScfDelStack( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 ) :
- ScfDelList< Type >( nInitSize, nResize ) {}
-
- inline void Push( Type* pObj ) { Append( pObj ); }
- /** Removes the top object without deletion. */
- inline Type* Pop() { return Remove( Count() - 1 ); }
-
- inline Type* Top() const { return GetObject( Count() - 1 ); }
-
- using ScfDelList< Type >::Clear;
- using ScfDelList< Type >::Count;
- using ScfDelList< Type >::Empty;
-};
-
-// ----------------------------------------------------------------------------
class ScFormatFilterPluginImpl : public ScFormatFilterPlugin {
public:
ScFormatFilterPluginImpl();
@@ -518,7 +313,7 @@ class ScFormatFilterPluginImpl : public ScFormatFilterPlugin {
const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, sal_uInt32 nDifOption = SC_DIFOPT_EXCEL );
virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange );
virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange,
- double nOutputFactor = 1.0, sal_Bool bCalcWidthHeight = sal_True,
+ double nOutputFactor = 1.0, sal_Bool bCalcWidthHeight = true,
SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange );
@@ -542,3 +337,5 @@ class ScFormatFilterPluginImpl : public ScFormatFilterPlugin {
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/funktion.h b/sc/source/filter/inc/funktion.h
index ef8ecabc256a..2377fbe16bf1 100644
--- a/sc/source/filter/inc/funktion.h
+++ b/sc/source/filter/inc/funktion.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,4 @@ void ConstString( void ); // 6
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx
index 8f9e153fed51..705d118178cf 100644
--- a/sc/source/filter/inc/htmlexp.hxx
+++ b/sc/source/filter/inc/htmlexp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include <rtl/textenc.h>
#include <tools/gen.hxx>
#include <tools/color.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
#include "expbase.hxx"
@@ -83,10 +85,9 @@ struct ScHTMLGraphEntry
ScHTMLGraphEntry( SdrObject* pObj, const ScRange& rRange,
const Size& rSize, sal_Bool bIn, const Size& rSpace ) :
aRange( rRange ), aSize( rSize ), aSpace( rSpace ),
- pObject( pObj ), bInCell( bIn ), bWritten( sal_False ) {}
+ pObject( pObj ), bInCell( bIn ), bWritten( false ) {}
};
-DECLARE_LIST( ScHTMLGraphList, ScHTMLGraphEntry* )
#define SC_HTML_FONTSIZES 7
const short nIndentMax = 23;
@@ -99,9 +100,9 @@ class ScHTMLExport : public ScExportBase
static sal_uInt16 nFontSize[SC_HTML_FONTSIZES];
static const char* pFontSizeCss[SC_HTML_FONTSIZES];
static const sal_uInt16 nCellSpacing;
- static const sal_Char __FAR_DATA sIndentSource[];
+ static const sal_Char sIndentSource[];
- ScHTMLGraphList aGraphList;
+ boost::ptr_vector< ScHTMLGraphEntry > aGraphList;
ScHTMLStyle aHTMLStyle;
String aBaseURL;
String aStreamPath;
@@ -140,7 +141,7 @@ class ScHTMLExport : public ScExportBase
// kopiere ggfs. eine lokale Datei ins Internet
sal_Bool CopyLocalFileToINet( String& rFileNm,
- const String& rTargetNm, sal_Bool bFileToFile = sal_False );
+ const String& rTargetNm, sal_Bool bFileToFile = false );
sal_Bool HasCId() { return aCId.Len() > 0; }
void MakeCIdURL( String& rURL );
@@ -172,3 +173,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/htmlimp.hxx b/sc/source/filter/inc/htmlimp.hxx
index 68a7faab444d..c79bf6d4f1e2 100644
--- a/sc/source/filter/inc/htmlimp.hxx
+++ b/sc/source/filter/inc/htmlimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,7 @@ public:
virtual ~ScHTMLImport();
const ScHTMLParser* GetParser() const { return (ScHTMLParser*)mpParser; }
- virtual void WriteToDocument( sal_Bool bSizeColsRows = sal_False, double nOutputFactor = 1.0,
+ virtual void WriteToDocument( sal_Bool bSizeColsRows = false, double nOutputFactor = 1.0,
SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
static String GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrigName );
@@ -50,3 +51,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx
index 6d200c6e3bdf..5548338e82f3 100644
--- a/sc/source/filter/inc/htmlpars.hxx
+++ b/sc/source/filter/inc/htmlpars.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -441,7 +442,7 @@ protected:
explicit ScHTMLTable(
SfxItemPool& rPool,
EditEngine& rEditEngine,
- ScEEParseList& rEEParseList,
+ ::std::vector< ScEEParseEntry* >& rEEParseList,
ScHTMLTableId& rnUnusedId );
/** Fills all empty cells in this and nested tables with dummy parse entries. */
@@ -541,7 +542,7 @@ private:
ScRangeList maVMergedCells; /// List of all vertically merged cells.
ScRangeList maUsedCells; /// List of all used cells.
EditEngine& mrEditEngine; /// Edit engine (from ScEEParser).
- ScEEParseList& mrEEParseList; /// List that owns the parse entries (from ScEEParser).
+ ::std::vector< ScEEParseEntry* >& mrEEParseList; /// List that owns the parse entries (from ScEEParser).
ScHTMLEntryMap maEntryMap; /// List of entries for each cell.
ScHTMLEntryList* mpCurrEntryList; /// Current entry list from map for faster access.
ScHTMLEntryPtr mxCurrEntry; /// Working entry, not yet inserted in a list.
@@ -565,7 +566,7 @@ public:
explicit ScHTMLGlobalTable(
SfxItemPool& rPool,
EditEngine& rEditEngine,
- ScEEParseList& rEEParseList,
+ ::std::vector< ScEEParseEntry* >& rEEParseList,
ScHTMLTableId& rnUnusedId );
virtual ~ScHTMLGlobalTable();
@@ -636,3 +637,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 046c338c042d..57a3374762a1 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,6 +39,8 @@
#include "otlnbuff.hxx"
#include "colrowst.hxx"
#include "excdefs.hxx"
+#include <boost/shared_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
class SfxItemSet;
@@ -77,8 +80,8 @@ public:
void Convert();
private:
- typedef ScfRef< XclImpOutlineBuffer > XclImpOutlineBfrRef;
- typedef ScfRef< XclImpColRowSettings > XclImpColRowSettRef;
+ typedef boost::shared_ptr< XclImpOutlineBuffer > XclImpOutlineBfrRef;
+ typedef boost::shared_ptr< XclImpColRowSettings > XclImpColRowSettRef;
XclImpOutlineBfrRef mxColOutlineBuff;
XclImpOutlineBfrRef mxRowOutlineBuff;
@@ -106,7 +109,7 @@ protected:
XclImpOutlineBuffer* pRowOutlineBuff;
XclImpColRowSettings* pColRowBuff; // Col/Row-Einstellungen 1 Tabelle
- typedef ScfDelList< XclImpOutlineDataBuffer > XclImpOutlineListBuffer;
+ typedef boost::ptr_vector< XclImpOutlineDataBuffer > XclImpOutlineListBuffer;
XclImpOutlineListBuffer* pOutlineListBuffer;
sal_Int16 mnLastRefIdx;
@@ -203,3 +206,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/lotattr.hxx b/sc/source/filter/inc/lotattr.hxx
index 4105b40cce60..eecd4c11916f 100644
--- a/sc/source/filter/inc/lotattr.hxx
+++ b/sc/source/filter/inc/lotattr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,50 +29,52 @@
#ifndef SC_LOTATTR_HXX
#define SC_LOTATTR_HXX
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include <tools/solar.h>
-#include <tools/list.hxx>
-#include "patattr.hxx"
-#include "scitems.hxx"
+
#include "address.hxx"
+#include "scitems.hxx"
-// ----- forwards --------------------------------------------------------
class ScDocument;
class ScDocumentPool;
+class ScPatternAttr;
class SvxBorderLine;
class SvxColorItem;
class Color;
-
class LotAttrTable;
-
struct LotAttrWK3
{
- sal_uInt8 nFont;
- sal_uInt8 nLineStyle;
- sal_uInt8 nFontCol;
- sal_uInt8 nBack;
+ UINT8 nFont;
+ UINT8 nLineStyle;
+ UINT8 nFontCol;
+ UINT8 nBack;
- inline sal_Bool HasStyles( void );
- inline sal_Bool IsCentered( void );
-};
+ inline bool HasStyles () const
+ {
+ return ( nFont || nLineStyle || nFontCol || ( nBack & 0x7F ) );
+ // !! ohne Center-Bit!!
+ }
+ inline bool IsCentered () const
+ {
+ return ( nBack & 0x80 );
+ }
+};
-inline sal_Bool LotAttrWK3::HasStyles( void )
+class LotAttrCache
{
- return ( nFont || nLineStyle || nFontCol || ( nBack & 0x7F ) );
- // !! ohne Center-Bit!!
-}
+public:
+ LotAttrCache ();
-inline sal_Bool LotAttrWK3::IsCentered( void )
-{
- return ( nBack & 0x80 );
-}
+ ~LotAttrCache();
+ const ScPatternAttr& GetPattAttr( const LotAttrWK3& );
-class LotAttrCache : private List
-{
private:
+
friend class LotAttrTable;
struct ENTRY
@@ -79,75 +82,77 @@ private:
ScPatternAttr* pPattAttr;
sal_uInt32 nHash0;
- inline ENTRY( const ScPatternAttr& r ) { pPattAttr = new ScPatternAttr( r ); }
+ ENTRY (const ScPatternAttr &r);
- inline ENTRY( ScPatternAttr* p ) { pPattAttr = p; }
+ ENTRY (ScPatternAttr* p);
- inline ~ENTRY() { delete pPattAttr; }
+ ~ENTRY ();
- inline sal_Bool operator ==( const ENTRY& r ) const { return nHash0 == r.nHash0; }
+ inline bool operator == (const ENTRY &r) const { return nHash0 == r.nHash0; }
- inline sal_Bool operator ==( const sal_uInt32& r ) const { return nHash0 == r; }
+ inline bool operator == (const sal_uInt32 &r) const { return nHash0 == r; }
};
+ inline static void MakeHash( const LotAttrWK3& rAttr, sal_uInt32& rOut )
+ {
+ ( ( UINT8* ) &rOut )[ 0 ] = rAttr.nFont & 0x7F;
+ ( ( UINT8* ) &rOut )[ 1 ] = rAttr.nLineStyle;
+ ( ( UINT8* ) &rOut )[ 2 ] = rAttr.nFontCol;
+ ( ( UINT8* ) &rOut )[ 3 ] = rAttr.nBack;
+ }
+
+ static void LotusToScBorderLine( UINT8 nLine, SvxBorderLine& );
+
+ const SvxColorItem& GetColorItem( const UINT8 nLotIndex ) const;
+
+ const Color& GetColor( const UINT8 nLotIndex ) const;
+
ScDocumentPool* pDocPool;
- SvxColorItem* ppColorItems[ 6 ]; // 0 und 7 fehlen!
+ SvxColorItem* ppColorItems[6]; // 0 und 7 fehlen!
SvxColorItem* pBlack;
SvxColorItem* pWhite;
Color* pColTab;
+ boost::ptr_vector<ENTRY> aEntries;
+};
- inline static void MakeHash( const LotAttrWK3& rAttr, sal_uInt32& rOut )
- {
- ( ( sal_uInt8* ) &rOut )[ 0 ] = rAttr.nFont & 0x7F;
- ( ( sal_uInt8* ) &rOut )[ 1 ] = rAttr.nLineStyle;
- ( ( sal_uInt8* ) &rOut )[ 2 ] = rAttr.nFontCol;
- ( ( sal_uInt8* ) &rOut )[ 3 ] = rAttr.nBack;
- }
- static void LotusToScBorderLine( sal_uInt8 nLine, SvxBorderLine& );
- const SvxColorItem& GetColorItem( const sal_uInt8 nLotIndex ) const;
- const Color& GetColor( const sal_uInt8 nLotIndex ) const;
+
+class LotAttrCol
+{
public:
- LotAttrCache( void );
- ~LotAttrCache();
- const ScPatternAttr& GetPattAttr( const LotAttrWK3& );
-};
+ void SetAttr (const SCROW nRow, const ScPatternAttr&);
+ void Apply (const SCCOL nCol, const SCTAB nTab, const sal_Bool bClear = true);
+
+ void Clear ();
-class LotAttrCol : private List
-{
private:
+
struct ENTRY
{
- const ScPatternAttr* pPattAttr;
- SCROW nFirstRow;
- SCROW nLastRow;
+ const ScPatternAttr* pPattAttr;
+ SCROW nFirstRow;
+ SCROW nLastRow;
};
-public:
- ~LotAttrCol( void );
- void SetAttr( const SCROW nRow, const ScPatternAttr& );
- void Apply( const SCCOL nCol, const SCTAB nTab, const sal_Bool bClear = sal_True );
- void Clear( void );
+ boost::ptr_vector<ENTRY> aEntries;
};
class LotAttrTable
{
-private:
- LotAttrCol pCols[ MAXCOLCOUNT ];
- LotAttrCache aAttrCache;
public:
- LotAttrTable( void );
- ~LotAttrTable();
-
- void SetAttr( const SCCOL nColFirst, const SCCOL nColLast, const SCROW nRow, const LotAttrWK3& );
- void Apply( const SCTAB nTabNum );
-};
+ void SetAttr( const SCCOL nColFirst, const SCCOL nColLast, const SCROW nRow, const LotAttrWK3& );
+ void Apply( const SCTAB nTabNum );
+private:
+ LotAttrCol pCols[ MAXCOLCOUNT ];
+ LotAttrCache aAttrCache;
+};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/lotfntbf.hxx b/sc/source/filter/inc/lotfntbf.hxx
index 10bf93023344..cb90efc3fc3d 100644
--- a/sc/source/filter/inc/lotfntbf.hxx
+++ b/sc/source/filter/inc/lotfntbf.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/lotform.hxx b/sc/source/filter/inc/lotform.hxx
index 1521cb66377b..9d23abfaf887 100644
--- a/sc/source/filter/inc/lotform.hxx
+++ b/sc/source/filter/inc/lotform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -130,3 +131,4 @@ inline void LotusToSc::SetWK3( void )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/lotimpop.hxx b/sc/source/filter/inc/lotimpop.hxx
index 37257cfdaa77..8856f45cb4a9 100644
--- a/sc/source/filter/inc/lotimpop.hxx
+++ b/sc/source/filter/inc/lotimpop.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -167,3 +168,5 @@ inline void ImportLotus::Skip( const sal_uInt16 n )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/lotrange.hxx b/sc/source/filter/inc/lotrange.hxx
index 7ddde41490d4..2456a28f3a8b 100644
--- a/sc/source/filter/inc/lotrange.hxx
+++ b/sc/source/filter/inc/lotrange.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -165,3 +166,4 @@ inline void LotusRangeList::SetEing( const SCCOL nCol, const SCROW nRow )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx
index 4e7e9239db07..1a6619c73f9f 100644
--- a/sc/source/filter/inc/namebuff.hxx
+++ b/sc/source/filter/inc/namebuff.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@
#include "xiroot.hxx"
#include "rangenam.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <list>
class ScDocument;
@@ -107,7 +108,7 @@ class NameBuffer : private List, public ExcRoot
private:
sal_uInt16 nBase; // Index-Basis
public:
-// inline NameBuffer( void ); //#94039# prevent empty rootdata
+// inline NameBuffer( void ); //prevent empty rootdata
inline NameBuffer( RootData* );
inline NameBuffer( RootData*, sal_uInt16 nNewBase );
@@ -118,7 +119,7 @@ public:
void operator <<( const String& rNewString );
};
-//#94039# prevent empty rootdata
+//prevent empty rootdata
//inline NameBuffer::NameBuffer( void )
//{
// nBase = 0;
@@ -175,7 +176,7 @@ class ShrfmlaBuffer : public ExcRoot
{
size_t operator() (const ScAddress &addr) const;
};
- typedef std::hash_map <ScAddress, sal_uInt16, ScAddressHashFunc> ShrfmlaHash;
+ typedef boost::unordered_map <ScAddress, sal_uInt16, ScAddressHashFunc> ShrfmlaHash;
typedef std::list <ScRange> ShrfmlaList;
ShrfmlaHash index_hash;
@@ -242,9 +243,9 @@ inline void RangeNameBufferWK3::Add( const String& rName, const ScRange& aScRang
pSRD->nTab = pScAddr->Tab();
// zunaechst ALLE Refs nur absolut
- pSRD->SetColRel( sal_False );
- pSRD->SetRowRel( sal_False );
- pSRD->SetTabRel( sal_False );
+ pSRD->SetColRel( false );
+ pSRD->SetRowRel( false );
+ pSRD->SetTabRel( false );
pSRD = &aCRD.Ref2;
pScAddr = &aScRange.aEnd;
@@ -254,9 +255,9 @@ inline void RangeNameBufferWK3::Add( const String& rName, const ScRange& aScRang
pSRD->nTab = pScAddr->Tab();
// zunaechst ALLE Refs nur absolut
- pSRD->SetColRel( sal_False );
- pSRD->SetRowRel( sal_False );
- pSRD->SetTabRel( sal_False );
+ pSRD->SetColRel( false );
+ pSRD->SetRowRel( false );
+ pSRD->SetTabRel( false );
Add( rName, aCRD );
}
@@ -281,7 +282,7 @@ private:
aTab( rTabName )
{
nTabNum = 0xFFFF; // -> Tabelle noch nicht erzeugt
- bSWB = bLink = sal_False;
+ bSWB = bLink = false;
}
Cont( const String& rFilePathAndName, const String& rTabName,
const sal_Bool bSameWB ) :
@@ -290,7 +291,7 @@ private:
{
nTabNum = 0xFFFF; // -> Tabelle noch nicht erzeugt
bSWB = bSameWB;
- bLink = sal_False;
+ bLink = false;
}
};
public:
@@ -298,7 +299,7 @@ public:
virtual ~ExtSheetBuffer();
sal_Int16 Add( const String& rFilePathAndName,
- const String& rTabName, const sal_Bool bSameWorkbook = sal_False );
+ const String& rTabName, const sal_Bool bSameWorkbook = false );
sal_Bool GetScTabIndex( sal_uInt16 nExcSheetIndex, sal_uInt16& rIn_LastTab_Out_ScIndex );
sal_Bool IsLink( const sal_uInt16 nExcSheetIndex ) const;
@@ -354,3 +355,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/op.h b/sc/source/filter/inc/op.h
index aea7e847344f..42d3d747153d 100644
--- a/sc/source/filter/inc/op.h
+++ b/sc/source/filter/inc/op.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@ void OP_EOF( SvStream &aStream, sal_uInt16 nLaenge );
void OP_Integer( SvStream &aStream, sal_uInt16 nLaenge );
void OP_Number( SvStream &aStream, sal_uInt16 nLaenge );
void OP_Label( SvStream &aStream, sal_uInt16 nLaenge );
-//UNUSED2009-05 void OP_Text( SvStream &aStream, sal_uInt16 nLaenge ); // WK3
void OP_Integer3( SvStream &aStream, sal_uInt16 nLaenge ); // WK3
void OP_Number3( SvStream &aStream, sal_uInt16 nLaenge ); // WK3
void OP_Formula( SvStream &aStream, sal_uInt16 nLaenge );
@@ -68,3 +68,5 @@ void OP_VerAlign123(sal_uInt8 nAlignPattern, SfxItemSet& rPattern /* const ScPa
void OP_ApplyPatternArea123(SvStream& r);
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/optab.h b/sc/source/filter/inc/optab.h
index 8f038d7f75d9..f40065214270 100644
--- a/sc/source/filter/inc/optab.h
+++ b/sc/source/filter/inc/optab.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,4 @@ typedef void ( *OPCODE_FKT )( SvStream &aStream, sal_uInt16 nLaenge );
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/otlnbuff.hxx b/sc/source/filter/inc/otlnbuff.hxx
index b6addd85bf99..9ed84056f182 100644
--- a/sc/source/filter/inc/otlnbuff.hxx
+++ b/sc/source/filter/inc/otlnbuff.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,50 +30,33 @@
#define SC_OTLNBUFF_HXX
#include <tools/solar.h>
+#include <mdds/flat_segment_tree.hpp>
+#include <set>
class ScOutlineArray;
class XclImpOutlineBuffer
{
- // -> exctools.cxx
- private:
- sal_uInt8* pLevel;
- sal_Bool* pOuted;
- sal_Bool* pHidden;
- SCSIZE nSize;
- SCSIZE nLast;
- sal_uInt8 nMaxLevel;
- ScOutlineArray* pOutlineArray;
- sal_Bool bButtonNormal; // sal_True -> right / under
- public:
- XclImpOutlineBuffer( SCSIZE nNewSize );
- ~XclImpOutlineBuffer();
- void SetLevel( SCSIZE nIndex, sal_uInt8 nVal, sal_Bool bOuted, sal_Bool bHidden );
- void SetOutlineArray( ScOutlineArray* pOArray );
- void Reset( void );
- void MakeScOutline( void );
- void SetLevelRange( SCSIZE nF, SCSIZE nL, sal_uInt8 nVal,
- sal_Bool bOuted, sal_Bool bHidden );
-
- inline sal_Bool HasOutline( void ) const;
-
- inline void SetButtonMode( const sal_Bool bRightOrUnder );
+public:
+ XclImpOutlineBuffer( SCSIZE nNewSize );
+ ~XclImpOutlineBuffer();
+
+ void SetLevel( SCSIZE nIndex, sal_uInt8 nVal, bool bCollapsed );
+ void SetOutlineArray( ScOutlineArray* pOArray );
+ void MakeScOutline();
+ void SetLevelRange( SCSIZE nF, SCSIZE nL, sal_uInt8 nVal, bool bCollapsed );
+ void SetButtonMode( bool bRightOrUnder );
+
+private:
+ typedef ::mdds::flat_segment_tree<SCSIZE, sal_uInt8> OutlineLevels;
+ OutlineLevels maLevels;
+ ::std::set<SCSIZE> maCollapsedPosSet;
+ ScOutlineArray* mpOutlineArray;
+ SCSIZE mnEndPos;
+ sal_uInt8 mnMaxLevel;
+ bool mbButtonAfter:1;
};
-
-
-
-inline sal_Bool XclImpOutlineBuffer::HasOutline( void ) const
-{
- return nMaxLevel > 0;
-}
-
-
-inline void XclImpOutlineBuffer::SetButtonMode( const sal_Bool b )
-{
- bButtonNormal = b;
-}
-
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/qpro.hxx b/sc/source/filter/inc/qpro.hxx
index f631da120373..460e0a83ba8c 100644
--- a/sc/source/filter/inc/qpro.hxx
+++ b/sc/source/filter/inc/qpro.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,4 @@ class ScQProReader : public ScBiffReader
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/qproform.hxx b/sc/source/filter/inc/qproform.hxx
index 18327cd141df..6e06827ad958 100644
--- a/sc/source/filter/inc/qproform.hxx
+++ b/sc/source/filter/inc/qproform.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,5 @@ class QProToSc : public ConverterBase
const sal_Char* getString( sal_uInt8 nIndex );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/qprostyle.hxx b/sc/source/filter/inc/qprostyle.hxx
index ffce2630b310..f52ce655d4bf 100644
--- a/sc/source/filter/inc/qprostyle.hxx
+++ b/sc/source/filter/inc/qprostyle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ class ScQProStyle
{ if (nIndex < maxsize) maFont[ nIndex ] = nData; }
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/root.hxx b/sc/source/filter/inc/root.hxx
index facc8b1b2fa0..4c9800216a0f 100644
--- a/sc/source/filter/inc/root.hxx
+++ b/sc/source/filter/inc/root.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117,3 +118,4 @@ extern LOTUS_ROOT* pLotusRoot; // -> Inkarn. in filter.cxx
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 44c2d5fa43c3..e058afea4586 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,4 @@ public:
#endif // SC_RTFEXP_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/rtfimp.hxx b/sc/source/filter/inc/rtfimp.hxx
index 13ade86b7cd5..8278c497f6af 100644
--- a/sc/source/filter/inc/rtfimp.hxx
+++ b/sc/source/filter/inc/rtfimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/rtfparse.hxx b/sc/source/filter/inc/rtfparse.hxx
index e896cd754a34..021a0b585262 100644
--- a/sc/source/filter/inc/rtfparse.hxx
+++ b/sc/source/filter/inc/rtfparse.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,7 @@
#include "eeparser.hxx"
#ifdef SC_RTFPARSE_CXX
+#include <boost/ptr_container/ptr_vector.hpp>
struct ScRTFCellDefault
{
@@ -42,10 +44,9 @@ struct ScRTFCellDefault
ScRTFCellDefault( SfxItemPool* pPool ) :
aItemSet( *pPool ), nColOverlap(1) {}
};
+typedef boost::ptr_vector< ScRTFCellDefault > ScRTFDefaultList;
-DECLARE_LIST( ScRTFDefaultList, ScRTFCellDefault* )
-// Remove: (const unsigned short &) not sufficiently different from (unsigned short)
-// deswegen sal_uLong, typedef bringt's auch nicht :-(
+// deswegen ULONG, typedef bringt's auch nicht :-(
SV_DECL_VARARR_SORT( ScRTFColTwips, sal_uLong, 16, 4)
#else // SC_RTFPARSE_CXX
@@ -87,3 +88,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/scflt.hxx b/sc/source/filter/inc/scflt.hxx
index ea9f11504551..e66ba12e0c00 100644
--- a/sc/source/filter/inc/scflt.hxx
+++ b/sc/source/filter/inc/scflt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -762,3 +763,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/scfobj.hxx b/sc/source/filter/inc/scfobj.hxx
index 7749d67de1b8..c31106f16ebc 100644
--- a/sc/source/filter/inc/scfobj.hxx
+++ b/sc/source/filter/inc/scfobj.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/scmem.h b/sc/source/filter/inc/scmem.h
index 2bda5a2b8e8f..99222707b64d 100644
--- a/sc/source/filter/inc/scmem.h
+++ b/sc/source/filter/inc/scmem.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,3 +36,4 @@ void MemDelete( void );
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/tokstack.hxx b/sc/source/filter/inc/tokstack.hxx
index cf4a4a065076..8e84e6da647d 100644
--- a/sc/source/filter/inc/tokstack.hxx
+++ b/sc/source/filter/inc/tokstack.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -176,7 +177,6 @@ class TokenPool
void GrowString( void );
void GrowDouble( void );
-//UNUSED2009-05 void GrowError( void );
void GrowTripel( void );
void GrowId( void );
void GrowElement( void );
@@ -195,7 +195,6 @@ class TokenPool
inline void operator >>( TokenStack& rStack );
inline const TokenId Store( void );
const TokenId Store( const double& rDouble );
-//UNUSED2008-05 const TokenId StoreError( sal_uInt16 nError );
// nur fuer Range-Names
const TokenId Store( const sal_uInt16 nIndex );
@@ -218,7 +217,6 @@ class TokenPool
inline E_TYPE GetType( const TokenId& nId ) const;
sal_Bool IsSingleOp( const TokenId& nId, const DefTokenId eId ) const;
const String* GetExternal( const TokenId& nId ) const;
-//UNUSED2008-05 const String* GetString( const TokenId& nId ) const;
ScMatrix* GetMatrix( unsigned int n ) const;
};
@@ -406,3 +404,4 @@ inline E_TYPE TokenPool::GetType( const TokenId& rId ) const
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/tool.h b/sc/source/filter/inc/tool.h
index e12a2fbd043f..8b0aac6a05d8 100644
--- a/sc/source/filter/inc/tool.h
+++ b/sc/source/filter/inc/tool.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -162,3 +163,4 @@ inline const SfxUInt32Item* FormCache::GetAttr( sal_uInt8 nFormat, sal_uInt8 nSt
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xcl97dum.hxx b/sc/source/filter/inc/xcl97dum.hxx
index dd046389b1c4..cc7acd23bd8a 100644
--- a/sc/source/filter/inc/xcl97dum.hxx
+++ b/sc/source/filter/inc/xcl97dum.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -88,3 +89,5 @@ public:
#endif // _XCL97DUM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index 92225db4bcb9..55f33b6033e4 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <filter/msfilter/escherex.hxx>
#include "xlescher.hxx"
#include "xeroot.hxx"
+#include <vector>
// 0 = Export TBX form controls, 1 = Export OCX form controls.
#define EXC_EXP_OCX_CTRL 0
@@ -70,6 +72,15 @@ class XclExpOcxControlObj;
#else
class XclExpTbxControlObj;
#endif
+class XclExpShapeObj;
+class EscherExHostAppData;
+class ShapeInteractionHelper
+{
+public:
+ static XclExpShapeObj* CreateShapeObj( XclExpObjectManager& rObjMgr, const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape >& xShape );
+ static void PopulateShapeInteractionInfo( XclExpObjectManager& rObjMgr, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, EscherExHostAppData& rHostAppData );
+};
class XclEscherEx : public EscherEx, protected XclExpRoot
{
@@ -154,7 +165,7 @@ private:
sal_Bool bStackedGroup;
public:
- XclEscherHostAppData() : bStackedGroup( sal_False )
+ XclEscherHostAppData() : bStackedGroup( false )
{}
inline void SetStackedGroup( sal_Bool b ) { bStackedGroup = b; }
inline sal_Bool IsStackedGroup() const { return bStackedGroup; }
@@ -199,3 +210,5 @@ public:
#endif // _XCL97ESC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 5d346624526a..b60e9ea4f178 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,7 @@
class XclObj;
class XclExpMsoDrawing;
+class SdrCaptionObj;
class XclExpObjList : public List, public ExcEmptyRec, protected XclExpRoot
{
@@ -56,8 +58,14 @@ public:
void EndSheet();
virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+
+ static void ResetCounters();
private:
+ static sal_Int32 mnDrawingMLCount, mnVmlCount;
+ SCTAB mnScTab;
+
XclEscherEx& mrEscherEx;
XclExpMsoDrawing* pMsodrawingPerSheet;
XclExpMsoDrawing* pSolverContainer;
@@ -77,8 +85,9 @@ protected:
XclExpMsoDrawing* pClientTextbox;
XclTxo* pTxo;
sal_uInt16 mnObjType;
- sal_uInt16 nObjId;
- sal_uInt16 nGrbit;
+ UINT16 nObjId;
+ UINT16 nGrbit;
+ SCTAB mnScTab;
sal_Bool bFirstOnSheet;
bool mbOwnEscher; /// true = Escher part created on the fly.
@@ -99,7 +108,11 @@ public:
inline sal_uInt16 GetObjType() const { return mnObjType; }
- inline void SetId( sal_uInt16 nId ) { nObjId = nId; }
+ inline void SetId( UINT16 nId ) { nObjId = nId; }
+ inline sal_uInt16 GetId() const { return nObjId; }
+
+ inline void SetTab( SCTAB nScTab ) { mnScTab = nScTab; }
+ inline SCTAB GetTab() const { return mnScTab; }
inline void SetLocked( sal_Bool b )
{ b ? nGrbit |= 0x0001 : nGrbit &= ~0x0001; }
@@ -136,9 +149,16 @@ public:
class XclObjComment : public XclObj
{
+ ScAddress maScPos;
+ std::auto_ptr< SdrCaptionObj >
+ mpCaption;
+ bool mbVisible;
+ Rectangle maFrom;
+ Rectangle maTo;
+
public:
XclObjComment( XclExpObjectManager& rObjMgr,
- const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible );
+ const Rectangle& rRect, const EditTextObject& rEditObj, SdrCaptionObj* pCaption, bool bVisible, const ScAddress& rAddress, Rectangle &rFrom, Rectangle &To );
virtual ~XclObjComment();
/** c'tor process for formatted text objects above .
@@ -148,6 +168,7 @@ public:
virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
};
@@ -220,14 +241,26 @@ public:
class XclObjAny : public XclObj
{
-private:
+protected:
virtual void WriteSubRecs( XclExpStream& rStrm );
public:
- XclObjAny( XclExpObjectManager& rObjMgr );
+ XclObjAny( XclExpObjectManager& rObjMgr,
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape );
virtual ~XclObjAny();
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape >
+ GetShape() const { return mxShape; }
+
+
virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+ static void WriteFromTo( XclExpXmlStream& rStrm, const XclObjAny& rObj );
+ static void WriteFromTo( XclExpXmlStream& rStrm, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape, SCTAB nTab );
+
+private:
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape >
+ mxShape;
};
@@ -590,3 +623,5 @@ public:
#endif // _XCL97REC_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx
index 206392ea6890..373181f6c321 100644
--- a/sc/source/filter/inc/xechart.hxx
+++ b/sc/source/filter/inc/xechart.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,8 @@
#include "xlstyle.hxx"
#include "xeroot.hxx"
#include "xestring.hxx"
+#include <boost/shared_ptr.hpp>
+#include <boost/ptr_container/ptr_map.hpp>
class Size;
@@ -122,11 +125,6 @@ public:
/** Converts the passed rectangle from 1/100 mm to Excel chart units. */
XclChRectangle CalcChartRectFromHmm( const ::com::sun::star::awt::Rectangle& rRect ) const;
- /** Converts the passed horizontal coordinate from a relative position to Excel chart units. */
- sal_Int32 CalcChartXFromRelative( double fPosX ) const;
- /** Converts the passed vertical coordinate from a relative position to Excel chart units. */
- sal_Int32 CalcChartYFromRelative( double fPosY ) const;
-
/** Reads all line properties from the passed property set. */
void ConvertLineFormat(
XclChLineFormat& rLineFmt,
@@ -161,7 +159,7 @@ protected:
void FinalizeFutureRecBlock( XclExpStream& rStrm );
private:
- typedef ScfRef< XclExpChRootData > XclExpChRootDataRef;
+ typedef boost::shared_ptr< XclExpChRootData > XclExpChRootDataRef;
XclExpChRootDataRef mxChData; /// Reference to the root data object.
};
@@ -228,7 +226,7 @@ private:
XclChFramePos maData; /// Position of the frame.
};
-typedef ScfRef< XclExpChFramePos > XclExpChFramePosRef;
+typedef boost::shared_ptr< XclExpChFramePos > XclExpChFramePosRef;
// ----------------------------------------------------------------------------
@@ -263,7 +261,7 @@ private:
sal_uInt32 mnColorId; /// Line color identifier.
};
-typedef ScfRef< XclExpChLineFormat > XclExpChLineFormatRef;
+typedef boost::shared_ptr< XclExpChLineFormat > XclExpChLineFormatRef;
// ----------------------------------------------------------------------------
@@ -297,7 +295,7 @@ private:
sal_uInt32 mnBackColorId; /// Pattern background color identifier.
};
-typedef ScfRef< XclExpChAreaFormat > XclExpChAreaFormatRef;
+typedef boost::shared_ptr< XclExpChAreaFormat > XclExpChAreaFormatRef;
// ----------------------------------------------------------------------------
@@ -332,7 +330,7 @@ private:
sal_uInt32 mnColor2Id; /// Second fill color identifier.
};
-typedef ScfRef< XclExpChEscherFormat > XclExpChEscherFormatRef;
+typedef boost::shared_ptr< XclExpChEscherFormat > XclExpChEscherFormatRef;
// ----------------------------------------------------------------------------
@@ -403,7 +401,7 @@ private:
XclChObjectType meObjType; /// Type of the represented object.
};
-typedef ScfRef< XclExpChFrame > XclExpChFrameRef;
+typedef boost::shared_ptr< XclExpChFrame > XclExpChFrameRef;
// Source links ===============================================================
@@ -424,8 +422,10 @@ public:
/** Converts the number format from the passed property set. */
void ConvertNumFmt( const ScfPropertySet& rPropSet, bool bPercent );
+ void AppendString( const String& rStr );
+
/** Returns true, if this source link contains explicit string data. */
- inline bool HasString() const { return mxString.is() && !mxString->IsEmpty(); }
+ inline bool HasString() const { return mxString && !mxString->IsEmpty(); }
/** Writes the CHSOURCELINK record and optionally a CHSTRING record with explicit string data. */
virtual void Save( XclExpStream& rStrm );
@@ -439,7 +439,7 @@ private:
XclExpStringRef mxString; /// Text data (CHSTRING record).
};
-typedef ScfRef< XclExpChSourceLink > XclExpChSourceLinkRef;
+typedef boost::shared_ptr< XclExpChSourceLink > XclExpChSourceLinkRef;
// Text =======================================================================
@@ -450,7 +450,7 @@ public:
explicit XclExpChFont( sal_uInt16 nFontIdx );
};
-typedef ScfRef< XclExpChFont > XclExpChFontRef;
+typedef boost::shared_ptr< XclExpChFont > XclExpChFontRef;
// ----------------------------------------------------------------------------
@@ -467,7 +467,7 @@ private:
XclChObjectLink maData; /// Contents of the CHOBJECTLINK record.
};
-typedef ScfRef< XclExpChObjectLink > XclExpChObjectLinkRef;
+typedef boost::shared_ptr< XclExpChObjectLink > XclExpChObjectLinkRef;
// ----------------------------------------------------------------------------
@@ -490,7 +490,7 @@ private:
XclChFrLabelProps maData; /// Contents of the CHFRLABELPROPS record.
};
-typedef ScfRef< XclExpChFrLabelProps > XclExpChFrLabelPropsRef;
+typedef boost::shared_ptr< XclExpChFrLabelProps > XclExpChFrLabelPropsRef;
// ----------------------------------------------------------------------------
@@ -535,7 +535,7 @@ public:
virtual void SetRotation( sal_uInt16 nRotation );
/** Converts all text settings of the passed title text object. */
- void ConvertTitle( XTitleRef xTitle, sal_uInt16 nTarget );
+ void ConvertTitle( XTitleRef xTitle, sal_uInt16 nTarget, const String* pSubTitle = NULL );
/** Converts all text settings of the passed legend. */
void ConvertLegend( const ScfPropertySet& rPropSet );
/** Converts all settings of the passed data point caption text object. */
@@ -545,7 +545,7 @@ public:
void ConvertTrendLineEquation( const ScfPropertySet& rPropSet, const XclChDataPointPos& rPointPos );
/** Returns true, if the string object does not contain any text data. */
- inline bool HasString() const { return mxSrcLink.is() && mxSrcLink->HasString(); }
+ inline bool HasString() const { return mxSrcLink && mxSrcLink->HasString(); }
/** Returns the flags needed for the CHATTACHEDLABEL record. */
sal_uInt16 GetAttLabelFlags() const;
@@ -566,7 +566,7 @@ private:
sal_uInt32 mnTextColorId; /// Text color identifier.
};
-typedef ScfRef< XclExpChText > XclExpChTextRef;
+typedef boost::shared_ptr< XclExpChText > XclExpChTextRef;
// Data series ================================================================
@@ -602,7 +602,7 @@ private:
sal_uInt32 mnFillColorId; /// Fill color identifier.
};
-typedef ScfRef< XclExpChMarkerFormat > XclExpChMarkerFormatRef;
+typedef boost::shared_ptr< XclExpChMarkerFormat > XclExpChMarkerFormatRef;
// ----------------------------------------------------------------------------
@@ -616,7 +616,7 @@ public:
void Convert( const ScfPropertySet& rPropSet );
};
-typedef ScfRef< XclExpChPieFormat > XclExpChPieFormatRef;
+typedef boost::shared_ptr< XclExpChPieFormat > XclExpChPieFormatRef;
// ----------------------------------------------------------------------------
@@ -636,7 +636,7 @@ private:
XclCh3dDataFormat maData; /// Contents of the CH3DDATAFORMAT record.
};
-typedef ScfRef< XclExpCh3dDataFormat > XclExpCh3dDataFormatRef;
+typedef boost::shared_ptr< XclExpCh3dDataFormat > XclExpCh3dDataFormatRef;
// ----------------------------------------------------------------------------
@@ -647,7 +647,7 @@ public:
explicit XclExpChAttachedLabel( sal_uInt16 nFlags );
};
-typedef ScfRef< XclExpChAttachedLabel > XclExpChAttLabelRef;
+typedef boost::shared_ptr< XclExpChAttachedLabel > XclExpChAttLabelRef;
// ----------------------------------------------------------------------------
@@ -688,7 +688,7 @@ private:
XclExpChAttLabelRef mxAttLabel; /// Data point label type (CHATTACHEDLABEL record).
};
-typedef ScfRef< XclExpChDataFormat > XclExpChDataFormatRef;
+typedef boost::shared_ptr< XclExpChDataFormat > XclExpChDataFormatRef;
// ----------------------------------------------------------------------------
@@ -718,7 +718,7 @@ private:
XclExpChTextRef mxLabel; /// Formatting of the equation text box.
};
-typedef ScfRef< XclExpChSerTrendLine > XclExpChSerTrendLineRef;
+typedef boost::shared_ptr< XclExpChSerTrendLine > XclExpChSerTrendLineRef;
// ----------------------------------------------------------------------------
@@ -738,7 +738,7 @@ private:
XclChSerErrorBar maData; /// Contents of the CHSERERRORBAR record.
};
-typedef ScfRef< XclExpChSerErrorBar > XclExpChSerErrorBarRef;
+typedef boost::shared_ptr< XclExpChSerErrorBar > XclExpChSerErrorBarRef;
// ----------------------------------------------------------------------------
@@ -812,7 +812,7 @@ private:
sal_uInt16 mnParentIdx; /// 0-based index of parent series (trend lines and error bars).
};
-typedef ScfRef< XclExpChSeries > XclExpChSeriesRef;
+typedef boost::shared_ptr< XclExpChSeries > XclExpChSeriesRef;
// Chart type groups ==========================================================
@@ -868,7 +868,7 @@ private:
XclChChart3d maData; /// Contents of the CHCHART3D record.
};
-typedef ScfRef< XclExpChChart3d > XclExpChChart3dRef;
+typedef boost::shared_ptr< XclExpChChart3d > XclExpChChart3dRef;
// ----------------------------------------------------------------------------
@@ -898,7 +898,7 @@ private:
XclExpChFrameRef mxFrame; /// Legend frame format (CHFRAME group).
};
-typedef ScfRef< XclExpChLegend > XclExpChLegendRef;
+typedef boost::shared_ptr< XclExpChLegend > XclExpChLegendRef;
// ----------------------------------------------------------------------------
@@ -926,7 +926,7 @@ private:
sal_uInt16 mnBarDist; /// Distance between bars (CHDROPBAR record).
};
-typedef ScfRef< XclExpChDropBar > XclExpChDropBarRef;
+typedef boost::shared_ptr< XclExpChDropBar > XclExpChDropBarRef;
// ----------------------------------------------------------------------------
@@ -970,7 +970,7 @@ public:
/** Returns true, if chart type supports wall and floor format. */
inline bool Is3dWallChart() const { return Is3dChart() && (maTypeInfo.meTypeCateg != EXC_CHTYPECATEG_PIE); }
/** Returns true, if the series in this chart type group are ordered on the Z axis. */
- inline bool Is3dDeepChart() const { return Is3dWallChart() && mxChart3d.is() && !mxChart3d->IsClustered(); }
+ inline bool Is3dDeepChart() const { return Is3dWallChart() && mxChart3d && !mxChart3d->IsClustered(); }
/** Returns true, if this chart type can be combined with other types. */
inline bool IsCombinable2d() const { return !Is3dChart() && maTypeInfo.mbCombinable2d; }
@@ -994,7 +994,7 @@ private:
private:
typedef XclExpRecordList< XclExpChSeries > XclExpChSeriesList;
- typedef ScfRefMap< sal_uInt16, XclExpChLineFormat > XclExpChLineFormatMap;
+ typedef ::boost::ptr_map<sal_uInt16, XclExpChLineFormat> XclExpChLineFormatMap;
XclChTypeGroup maData; /// Contents of the CHTYPEGROUP record.
XclExpChType maType; /// Chart type (e.g. CHBAR, CHLINE, ...).
@@ -1007,7 +1007,7 @@ private:
XclExpChLineFormatMap maChartLines; /// Global line formats (CHCHARTLINE group).
};
-typedef ScfRef< XclExpChTypeGroup > XclExpChTypeGroupRef;
+typedef boost::shared_ptr< XclExpChTypeGroup > XclExpChTypeGroupRef;
// Axes =======================================================================
@@ -1034,7 +1034,7 @@ private:
XclChDateRange maDateData; /// Contents of the CHDATERANGE record.
};
-typedef ScfRef< XclExpChLabelRange > XclExpChLabelRangeRef;
+typedef boost::shared_ptr< XclExpChLabelRange > XclExpChLabelRangeRef;
// ----------------------------------------------------------------------------
@@ -1055,7 +1055,7 @@ private:
XclChValueRange maData; /// Contents of the CHVALUERANGE record.
};
-typedef ScfRef< XclExpChValueRange > XclExpChValueRangeRef;
+typedef boost::shared_ptr< XclExpChValueRange > XclExpChValueRangeRef;
// ----------------------------------------------------------------------------
@@ -1079,7 +1079,7 @@ private:
sal_uInt32 mnTextColorId; /// Axis labels text color identifier.
};
-typedef ScfRef< XclExpChTick > XclExpChTickRef;
+typedef boost::shared_ptr< XclExpChTick > XclExpChTickRef;
// ----------------------------------------------------------------------------
@@ -1134,7 +1134,7 @@ private:
sal_uInt16 mnNumFmtIdx; /// Index into number format buffer (CHFORMAT record).
};
-typedef ScfRef< XclExpChAxis > XclExpChAxisRef;
+typedef boost::shared_ptr< XclExpChAxis > XclExpChAxisRef;
// ----------------------------------------------------------------------------
@@ -1198,7 +1198,7 @@ private:
XclExpChTypeGroupList maTypeGroups; /// Chart type groups (CHTYPEGROUP group).
};
-typedef ScfRef< XclExpChAxesSet > XclExpChAxesSetRef;
+typedef boost::shared_ptr< XclExpChAxesSet > XclExpChAxesSetRef;
// The chart object ===========================================================
@@ -1263,8 +1263,8 @@ public:
virtual void Save( XclExpStream& rStrm );
private:
- ScfRef< XclExpObjectManager > mxObjMgr;
- ScfRef< XclExpRecordBase > mxObjRecs;
+ boost::shared_ptr< XclExpObjectManager > mxObjMgr;
+ boost::shared_ptr< XclExpRecordBase > mxObjRecs;
};
// ----------------------------------------------------------------------------
@@ -1284,3 +1284,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx
index 3708bb2c20d4..1e1b9f39b4a1 100644
--- a/sc/source/filter/inc/xecontent.hxx
+++ b/sc/source/filter/inc/xecontent.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,6 +114,8 @@ public:
inline const String* GetRepr() const { return mxRepr.get(); }
virtual void SaveXml( XclExpXmlStream& rStrm );
+
+ virtual void WriteEmbeddedData( XclExpStream& rStrm );
private:
/** Builds file name from the passed file URL. Tries to convert to relative file name.
@param rnLevel (out-param) The parent directory level.
@@ -350,3 +353,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx
index d227db184f1a..34c80c4021ea 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,10 @@
#include <filter/msfilter/escherex.hxx>
#include "xcl97rec.hxx"
#include "xlescher.hxx"
+#include <com/sun/star/chart/XChartDocument.hpp>
+#include "svx/sdtaitm.hxx"
+#include <boost/shared_ptr.hpp>
+
namespace com { namespace sun { namespace star {
namespace script { struct ScriptEventDescriptor; }
@@ -168,6 +173,7 @@ public:
/** Writes the BITMAP record. */
virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
private:
Graphic maGraphic; /// The VCL graphic.
@@ -207,6 +213,34 @@ private:
sal_uInt16 mnEntryCount; /// Number of entries in source range.
};
+class XclMacroHelper : public XclExpControlHelper
+{
+protected:
+ XclTokenArrayRef mxMacroLink; /// Token array containing a link to an attached macro.
+
+public:
+ explicit XclMacroHelper( const XclExpRoot& rRoot );
+ virtual ~XclMacroHelper();
+ /** Writes an ftMacro subrecord containing a macro link, or nothing, if no macro present. */
+ void WriteMacroSubRec( XclExpStream& rStrm );
+ /** Sets the name of a macro for object of passed type
+ @return true = The passed event descriptor was valid, macro name has been found. */
+ bool SetMacroLink( const ::com::sun::star::script::ScriptEventDescriptor& rEvent, const XclTbxEventType& nEventType );
+
+ /** Sets the name of a macro
+ @return true = The passed macro name has been found. */
+ bool SetMacroLink( const String& rMacro );
+};
+
+class XclExpShapeObj : public XclObjAny, public XclMacroHelper
+{
+public:
+ explicit XclExpShapeObj( XclExpObjectManager& rRoot, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual ~XclExpShapeObj();
+private:
+ virtual void WriteSubRecs( XclExpStream& rStrm );
+};
+
// ----------------------------------------------------------------------------
#if EXC_EXP_OCX_CTRL
@@ -234,7 +268,7 @@ private:
#else
/** Represents an OBJ record for an TBX form control. */
-class XclExpTbxControlObj : public XclObj, public XclExpControlHelper
+class XclExpTbxControlObj : public XclObj, public XclMacroHelper
{
public:
explicit XclExpTbxControlObj(
@@ -249,8 +283,6 @@ public:
private:
virtual void WriteSubRecs( XclExpStream& rStrm );
- /** Writes an ftMacro subrecord containing a macro link, or nothing, if no macro present. */
- void WriteMacroSubRec( XclExpStream& rStrm );
/** Writes a subrecord containing a cell link, or nothing, if no link present. */
void WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId );
/** Writes the ftSbs sub structure containing scrollbar data. */
@@ -258,7 +290,6 @@ private:
private:
ScfInt16Vec maMultiSel; /// Indexes of all selected entries in a multi selection.
- XclTokenArrayRef mxMacroLink; /// Token array containing a link to an attached macro.
XclTbxEventType meEventType; /// Type of supported macro event.
sal_Int32 mnHeight; /// Height of the control.
sal_uInt16 mnState; /// Checked/unchecked state.
@@ -285,6 +316,8 @@ class XclExpChart;
class XclExpChartObj : public XclObj, protected XclExpRoot
{
public:
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDocument > XChartDocRef;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > XShapeRef;
explicit XclExpChartObj(
XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
@@ -293,10 +326,15 @@ public:
/** Writes the OBJ record and the entire chart substream. */
virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+ virtual void WriteChartObj( sax_fastparser::FSHelperPtr pDrawing, XclExpXmlStream& rStrm );
+ void WriteShapeTransformation( sax_fastparser::FSHelperPtr pFS, const XShapeRef& rXShape, sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Int32 nRotation = 0 );
private:
- typedef ScfRef< XclExpChart > XclExpChartRef;
+ typedef boost::shared_ptr< XclExpChart > XclExpChartRef;
XclExpChartRef mxChart; /// The chart itself (BOF/EOF substream data).
+ XShapeRef mxShape;
+ XChartDocRef mxChartDoc;
};
// ============================================================================
@@ -339,9 +377,20 @@ private:
XclExpString maAuthor; /// Name of the author.
String maOrigNoteText; /// Original main text of the note.
ByteString maNoteText; /// Main text of the note (<=BIFF7).
+ XclExpStringRef mpNoteContents; /// Text and formatting data (OOXML)
ScAddress maScPos; /// Calc cell address of the note.
sal_uInt16 mnObjId; /// Escher object ID (BIFF8).
bool mbVisible; /// true = permanently visible.
+ SdrTextHorzAdjust meTHA; /// text horizontal adjust
+ SdrTextVertAdjust meTVA; /// text vertical adjust
+ bool mbAutoScale; /// Auto scale text
+ bool mbLocked; /// Position & Size locked
+ bool mbAutoFill; /// Auto Fill Style
+ bool mbAutoLine; /// Auto Line Style
+ bool mbColHidden; /// Column containing the comment is hidden
+ bool mbRowHidden; /// Row containing the comment is hidden
+ Rectangle maCommentFrom; /// From and From Offset
+ Rectangle maCommentTo; /// To and To Offsets
};
// ============================================================================
@@ -375,17 +424,17 @@ public:
/** Creates and returns the MSODRAWINGGROUP record containing global DFF
data in the DGGCONTAINER. */
- ScfRef< XclExpRecordBase > CreateDrawingGroup();
+ boost::shared_ptr< XclExpRecordBase > CreateDrawingGroup();
/** Initializes the object manager for a new sheet. */
void StartSheet();
/** Processes a drawing page and returns the record block containing all
related records (MSODRAWING, OBJ, TXO, charts, etc.). */
- ScfRef< XclExpRecordBase > ProcessDrawing( SdrPage* pSdrPage );
+ boost::shared_ptr< XclExpRecordBase > ProcessDrawing( SdrPage* pSdrPage );
/** Processes a collection of UNO shapes and returns the record block
containing all related records (MSODRAWING, OBJ, TXO, charts, etc.). */
- ScfRef< XclExpRecordBase > ProcessDrawing( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+ boost::shared_ptr< XclExpRecordBase > ProcessDrawing( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
/** Finalizes the object manager after conversion of all sheets. */
void EndDocument();
@@ -403,10 +452,10 @@ private:
void InitStream( bool bTempFile );
private:
- ScfRef< ::utl::TempFile > mxTempFile;
- ScfRef< SvStream > mxDffStrm;
- ScfRef< XclEscherEx > mxEscherEx;
- ScfRef< XclExpObjList > mxObjList;
+ boost::shared_ptr< ::utl::TempFile > mxTempFile;
+ boost::shared_ptr< SvStream > mxDffStrm;
+ boost::shared_ptr< XclEscherEx > mxEscherEx;
+ boost::shared_ptr< XclExpObjList > mxObjList;
};
// ----------------------------------------------------------------------------
@@ -433,3 +482,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xeformula.hxx b/sc/source/filter/inc/xeformula.hxx
index 258070f0791e..698ca9b0f494 100644
--- a/sc/source/filter/inc/xeformula.hxx
+++ b/sc/source/filter/inc/xeformula.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include "xlformula.hxx"
#include "xeroot.hxx"
+#include <boost/shared_ptr.hpp>
// External reference log =====================================================
@@ -87,7 +89,7 @@ public:
XclTokenArrayRef CreateNameXFormula( sal_uInt16 nExtSheet, sal_uInt16 nExtName );
private:
- typedef ScfRef< XclExpFmlaCompImpl > XclExpFmlaCompImplRef;
+ typedef boost::shared_ptr< XclExpFmlaCompImpl > XclExpFmlaCompImplRef;
XclExpFmlaCompImplRef mxImpl;
};
@@ -95,3 +97,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx
index 606ce51c889b..f02e8ad12bc1 100644
--- a/sc/source/filter/inc/xehelper.hxx
+++ b/sc/source/filter/inc/xehelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,8 @@
#ifndef SC_XEHELPER_HXX
#define SC_XEHELPER_HXX
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
#include "xladdress.hxx"
#include "xeroot.hxx"
#include "xestring.hxx"
@@ -139,24 +142,8 @@ public:
@return true = Cell range returned in rXclRange is valid (original or cropped). */
bool ConvertRange( XclRange& rXclRange, const ScRange& rScRange, bool bWarn );
-//UNUSED2008-05 /** Returns a valid cell range by moving it into allowed dimensions.
-//UNUSED2008-05 @descr The start and/or end position of the range may be modified.
-//UNUSED2008-05 @param rScRange The Calc cell range to convert.
-//UNUSED2008-05 @param bWarn true = Sets the internal flag that produces a warning box
-//UNUSED2008-05 after loading/saving the file, if the cell range contains invalid cells.
-//UNUSED2008-05 @return The converted Excel cell range. */
-//UNUSED2008-05 XclRange CreateValidRange( const ScRange& rScRange, bool bWarn );
-
// cell range list --------------------------------------------------------
-//UNUSED2008-05 /** Checks if the passed cell range list is valid.
-//UNUSED2008-05 @param rScRanges The Calc cell range list to check.
-//UNUSED2008-05 @param bWarn true = Sets the internal flag that produces a warning box
-//UNUSED2008-05 after loading/saving the file, if the cell range list contains at
-//UNUSED2008-05 least one invalid range.
-//UNUSED2008-05 @return true = Cell range list in rScRanges is completly valid. */
-//UNUSED2008-05 bool CheckRangeList( const ScRangeList& rScRanges, bool bWarn );
-
/** Checks and eventually crops the cell ranges to valid dimensions.
@descr The start position of the ranges will not be modified. Cell
ranges that fit partly into valid dimensions are cropped
@@ -190,14 +177,14 @@ class XclExpHyperlink;
/** Helper to create HLINK records during creation of formatted cell strings.
In Excel it is not possible to have more than one hyperlink in a cell. This
- helper detects multiple occurences of hyperlinks and fills a string which
+ helper detects multiple occurrences of hyperlinks and fills a string which
is used to create a cell note containing all URLs. Only cells containing
one hyperlink are exported as hyperlink cells.
*/
class XclExpHyperlinkHelper : protected XclExpRoot
{
public:
- typedef ScfRef< XclExpHyperlink > XclExpHyperlinkRef;
+ typedef boost::shared_ptr< XclExpHyperlink > XclExpHyperlinkRef;
explicit XclExpHyperlinkHelper( const XclExpRoot& rRoot, const ScAddress& rScPos );
~XclExpHyperlinkHelper();
@@ -234,7 +221,7 @@ class ScPatternAttr;
/** This class provides methods to create an XclExpString.
@descr The string can be created from an edit engine text object or
directly from a Calc edit cell. */
-class XclExpStringHelper : ScfNoInstance
+class XclExpStringHelper : boost::noncopyable
{
public:
/** Creates a new unformatted string from the passed string.
@@ -344,6 +331,12 @@ public:
/** Returns the script type first text portion different to WEAK, or the system
default script type, if there is only weak script in the passed string. */
static sal_Int16 GetLeadingScriptType( const XclExpRoot& rRoot, const String& rString );
+
+private:
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static methods. To enforce this, the default constructor
+ is made private */
+ XclExpStringHelper();
};
// Header/footer conversion ===================================================
@@ -379,7 +372,7 @@ class EditEngine;
Known but unsupported control sequences:
&G picture
*/
-class XclExpHFConverter : protected XclExpRoot, ScfNoCopy
+class XclExpHFConverter : protected XclExpRoot, private boost::noncopyable
{
public:
explicit XclExpHFConverter( const XclExpRoot& rRoot );
@@ -412,7 +405,7 @@ private:
/** This class contains static methods to encode a file URL.
@descr Excel stores URLs in a format that contains special control characters,
i.e. for directory separators or volume names. */
-class XclExpUrlHelper : ScfNoInstance
+class XclExpUrlHelper : boost::noncopyable
{
public:
/** Encodes and returns the URL passed in rAbsUrl to an Excel like URL.
@@ -420,6 +413,12 @@ public:
static String EncodeUrl( const XclExpRoot& rRoot, const String& rAbsUrl, const String* pTableName = 0 );
/** Encodes and returns the passed DDE link to an Excel like DDE link. */
static String EncodeDde( const String& rApplic, const String rTopic );
+
+private:
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static methods. To enforce this, the default constructor
+ is made private */
+ XclExpUrlHelper();
};
// ----------------------------------------------------------------------------
@@ -449,3 +448,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xelink.hxx b/sc/source/filter/inc/xelink.hxx
index c70e496400a4..866151df28f5 100644
--- a/sc/source/filter/inc/xelink.hxx
+++ b/sc/source/filter/inc/xelink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include "xehelper.hxx"
#include "xeformula.hxx"
#include "externalrefmgr.hxx"
+#include <boost/shared_ptr.hpp>
class ScRange;
struct ScSingleRefData;
@@ -81,8 +83,6 @@ public:
/** Returns the Calc sheet index of the nSortedTab-th entry in the sorted sheet names list. */
SCTAB GetRealScTab( SCTAB nSortedScTab ) const;
-//UNUSED2009-05 /** Returns the index of the passed Calc sheet in the sorted sheet names list. */
-//UNUSED2009-05 SCTAB GetSortedScTab( SCTAB nScTab ) const;
/** Returns the number of Calc sheets. */
inline SCTAB GetScTabCount() const { return mnScCnt; }
@@ -211,7 +211,7 @@ public:
virtual void Save( XclExpStream& rStrm );
private:
- typedef ScfRef< XclExpLinkManagerImpl > XclExpLinkMgrImplPtr;
+ typedef boost::shared_ptr< XclExpLinkManagerImpl > XclExpLinkMgrImplPtr;
XclExpLinkMgrImplPtr mxImpl;
};
@@ -219,3 +219,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xename.hxx b/sc/source/filter/inc/xename.hxx
index 58bc0e982584..f896d4bf48a2 100644
--- a/sc/source/filter/inc/xename.hxx
+++ b/sc/source/filter/inc/xename.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "xlname.hxx"
#include "xlformula.hxx"
#include "xeroot.hxx"
+#include <boost/shared_ptr.hpp>
// ============================================================================
@@ -53,8 +55,6 @@ public:
/** Inserts the Calc database range with the passed index and returns the Excel NAME index. */
sal_uInt16 InsertDBRange( sal_uInt16 nScDBRangeIdx );
-//UNUSED2009-05 /** Inserts a new built-in defined name. */
-//UNUSED2009-05 sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab );
/** Inserts a new built-in defined name, referring to the passed sheet range. */
sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, const ScRange& rRange );
/** Inserts a new built-in defined name, referring to the passed sheet range list. */
@@ -81,7 +81,7 @@ public:
virtual void SaveXml( XclExpXmlStream& rStrm );
private:
- typedef ScfRef< XclExpNameManagerImpl > XclExpNameMgrImplRef;
+ typedef boost::shared_ptr< XclExpNameManagerImpl > XclExpNameMgrImplRef;
XclExpNameMgrImplRef mxImpl;
};
@@ -89,3 +89,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xepage.hxx b/sc/source/filter/inc/xepage.hxx
index b9454a3cdb3c..be8d1a1ac08c 100644
--- a/sc/source/filter/inc/xepage.hxx
+++ b/sc/source/filter/inc/xepage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -135,3 +136,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx
index 0c730952e69e..3279aa4ff290 100644
--- a/sc/source/filter/inc/xepivot.hxx
+++ b/sc/source/filter/inc/xepivot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -195,8 +196,6 @@ public:
sal_uInt16 GetFieldCount() const;
/** Returns the specified pivot cache field. */
const XclExpPCField* GetField( sal_uInt16 nFieldIdx ) const;
-//UNUSED2009-05 /** Returns a pivot cache field by its name. */
-//UNUSED2009-05 const XclExpPCField* GetField( const String& rFieldName ) const;
/** Returns true, if this pivot cache contains non-standard fields (e.g. grouping fields). */
bool HasAddFields() const;
@@ -225,6 +224,8 @@ private:
/** Writes the DCONREF record containing the source range. */
void WriteDconref( XclExpStream& rStrm ) const;
+ /** DCONNAME record contains range name source. */
+ void WriteDConName( XclExpStream& rStrm ) const;
/** Creates the pivot cache storage stream and writes the cache. */
void WriteCacheStream();
@@ -242,6 +243,7 @@ private:
XclPCInfo maPCInfo; /// Pivot cache settings (SXDB record).
XclExpPCFieldList maFieldList; /// List of all pivot cache fields.
String maTabName; /// Name of source data sheet.
+ ::rtl::OUString maSrcRangeName; /// Range name for source data.
ScRange maOrigSrcRange; /// The original sheet source range.
ScRange maExpSrcRange; /// The exported sheet source range.
ScRange maDocSrcRange; /// The range used to build the cache fields and items.
@@ -298,8 +300,6 @@ public:
/** Returns the index of the last inserted data info struct. */
sal_uInt16 GetLastDataInfoIndex() const;
-//UNUSED2009-05 /** Returns an item by its name. */
-//UNUSED2009-05 const XclExpPTItem* GetItem( const String& rName ) const;
/** Returns the list index of an item by its name.
@param nDefaultIdx This value will be returned, if the item could not be found. */
sal_uInt16 GetItemIndex( const String& rName, sal_uInt16 nDefaultIdx ) const;
@@ -375,6 +375,7 @@ public:
/** Writes the entire pivot table. */
virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
// ------------------------------------------------------------------------
private:
@@ -484,3 +485,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xerecord.hxx b/sc/source/filter/inc/xerecord.hxx
index d451c7367f5b..4bfa6dbb0d0d 100644
--- a/sc/source/filter/inc/xerecord.hxx
+++ b/sc/source/filter/inc/xerecord.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include "xlconst.hxx"
#include "xestream.hxx"
+#include <boost/shared_ptr.hpp>
// Base classes to export Excel records =======================================
@@ -332,7 +334,7 @@ template< typename RecType = XclExpRecordBase >
class XclExpRecordList : public XclExpRecordBase
{
public:
- typedef ScfRef< RecType > RecordRefType;
+ typedef boost::shared_ptr< RecType > RecordRefType;
/** Returns pointer to an existing record or 0 on error. */
inline bool IsEmpty() const { return maRecs.empty(); }
@@ -417,3 +419,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xeroot.hxx b/sc/source/filter/inc/xeroot.hxx
index ba51abdef1a2..f27546eb219e 100644
--- a/sc/source/filter/inc/xeroot.hxx
+++ b/sc/source/filter/inc/xeroot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include "xlroot.hxx"
+#include <boost/shared_ptr.hpp>
// Forward declarations of objects in public use ==============================
@@ -38,8 +40,8 @@ class XclExpStream;
class XclExpRecordBase;
class XclExpString;
-typedef ScfRef< XclExpRecordBase > XclExpRecordRef;
-typedef ScfRef< XclExpString > XclExpStringRef;
+typedef boost::shared_ptr< XclExpRecordBase > XclExpRecordRef;
+typedef boost::shared_ptr< XclExpString > XclExpStringRef;
// Global data ================================================================
@@ -61,21 +63,21 @@ class XclExpPivotTableManager;
/** Stores global buffers and data needed for Excel export filter. */
struct XclExpRootData : public XclRootData
{
- typedef ScfRef< XclExpTabInfo > XclExpTabInfoRef;
- typedef ScfRef< XclExpAddressConverter > XclExpAddrConvRef;
- typedef ScfRef< XclExpFormulaCompiler > XclExpFmlaCompRef;
- typedef ScfRef< XclExpProgressBar > XclExpProgressRef;
-
- typedef ScfRef< XclExpSst > XclExpSstRef;
- typedef ScfRef< XclExpPalette > XclExpPaletteRef;
- typedef ScfRef< XclExpFontBuffer > XclExpFontBfrRef;
- typedef ScfRef< XclExpNumFmtBuffer > XclExpNumFmtBfrRef;
- typedef ScfRef< XclExpXFBuffer > XclExpXFBfrRef;
- typedef ScfRef< XclExpNameManager > XclExpNameMgrRef;
- typedef ScfRef< XclExpLinkManager > XclExpLinkMgrRef;
- typedef ScfRef< XclExpObjectManager > XclExpObjectMgrRef;
- typedef ScfRef< XclExpFilterManager > XclExpFilterMgrRef;
- typedef ScfRef< XclExpPivotTableManager > XclExpPTableMgrRef;
+ typedef boost::shared_ptr< XclExpTabInfo > XclExpTabInfoRef;
+ typedef boost::shared_ptr< XclExpAddressConverter > XclExpAddrConvRef;
+ typedef boost::shared_ptr< XclExpFormulaCompiler > XclExpFmlaCompRef;
+ typedef boost::shared_ptr< XclExpProgressBar > XclExpProgressRef;
+
+ typedef boost::shared_ptr< XclExpSst > XclExpSstRef;
+ typedef boost::shared_ptr< XclExpPalette > XclExpPaletteRef;
+ typedef boost::shared_ptr< XclExpFontBuffer > XclExpFontBfrRef;
+ typedef boost::shared_ptr< XclExpNumFmtBuffer > XclExpNumFmtBfrRef;
+ typedef boost::shared_ptr< XclExpXFBuffer > XclExpXFBfrRef;
+ typedef boost::shared_ptr< XclExpNameManager > XclExpNameMgrRef;
+ typedef boost::shared_ptr< XclExpLinkManager > XclExpLinkMgrRef;
+ typedef boost::shared_ptr< XclExpObjectManager > XclExpObjectMgrRef;
+ typedef boost::shared_ptr< XclExpFilterManager > XclExpFilterMgrRef;
+ typedef boost::shared_ptr< XclExpPivotTableManager > XclExpPTableMgrRef;
XclExpTabInfoRef mxTabInfo; /// Calc->Excel sheet index conversion.
XclExpAddrConvRef mxAddrConv; /// The address converter.
@@ -170,10 +172,11 @@ private:
XclExpRootData::XclExpLinkMgrRef GetLocalLinkMgrRef() const;
private:
- mutable XclExpRootData& mrExpData; /// Reference to the global export data struct.
+ XclExpRootData& mrExpData; /// Reference to the global export data struct.
};
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index b1cc596ad75e..8e18bf6e3644 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,7 @@ Output stream class for Excel export
class XclExpRoot;
class XclExpBiff8Encrypter;
-typedef ScfRef< XclExpBiff8Encrypter > XclExpEncrypterRef;
+typedef boost::shared_ptr< XclExpBiff8Encrypter > XclExpEncrypterRef;
/** This class is used to export Excel record streams.
@descr An instance is constructed with an SvStream and the maximum size of Excel
@@ -136,20 +137,12 @@ public:
// *** unicode string export is realized with helper class XclExpString ***
// (slice length setting has no effect here -> disabled automatically)
-//UNUSED2008-05 /** Writes Unicode buffer as 8/16 bit, repeats nFlags at start of a CONTINUE record. */
-//UNUSED2008-05 void WriteUnicodeBuffer( const sal_uInt16* pBuffer, sal_Size nChars, sal_uInt8 nFlags );
-
/** Writes Unicode buffer as 8/16 bit, repeats nFlags at start of a CONTINUE record. */
void WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nFlags );
// *** write 8-bit-strings ***
// (slice length setting has no effect here -> disabled automatically)
-//UNUSED2008-05 /** Writes ByteString buffer (without string length field). */
-//UNUSED2008-05 void WriteByteStringBuffer(
-//UNUSED2008-05 const ByteString& rString,
-//UNUSED2008-05 sal_uInt16 nMaxLen = 0x00FF );
-
/** Writes string length field and ByteString buffer. */
void WriteByteString(
const ByteString& rString,
@@ -268,12 +261,15 @@ private:
(s.Len() && s.GetChar( 0 ) != 0 ? XclXmlUtils::ToOString( s ).getStr() : NULL)
class ScAddress;
+class ScDocShell;
class ScDocument;
+class ScFormulaCell;
class ScRange;
class ScRangeList;
class ScTokenArray;
struct XclAddress;
struct XclFontData;
+struct XclRange;
class XclRangeList;
class XclXmlUtils
@@ -283,6 +279,7 @@ class XclXmlUtils
XclXmlUtils(const XclXmlUtils&);
XclXmlUtils& operator=(const XclXmlUtils&);
public:
+ static void GetFormulaTypeAndValue( ScFormulaCell& rCell, const char*& sType, ::rtl::OUString& rValue);
static ::rtl::OUString GetStreamName( const char* sStreamDir, const char* sStream, sal_Int32 nId );
static ::rtl::OString ToOString( const Color& rColor );
@@ -294,6 +291,7 @@ public:
static ::rtl::OString ToOString( const ScRangeList& rRangeList );
static ::rtl::OString ToOString( const XclAddress& rAddress );
static ::rtl::OString ToOString( const XclExpString& s );
+ static ::rtl::OString ToOString( const XclRange& rRange );
static ::rtl::OString ToOString( const XclRangeList& rRangeList );
static ::rtl::OUString ToOUString( const char* s );
@@ -302,26 +300,29 @@ public:
static ::rtl::OUString ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray );
static ::rtl::OUString ToOUString( const XclExpString& s );
static const char* ToPsz( bool b );
+
+ static sax_fastparser::FSHelperPtr WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int32 nValue );
+ static sax_fastparser::FSHelperPtr WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int64 nValue );
+ static sax_fastparser::FSHelperPtr WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const char* sValue );
+ static sax_fastparser::FSHelperPtr WriteFontData( sax_fastparser::FSHelperPtr pStream, const XclFontData& rFontData, sal_Int32 nNameId );
};
class XclExpXmlStream : public oox::core::XmlFilterBase
{
public:
- XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot );
+ XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr );
virtual ~XclExpXmlStream();
/** Returns the filter root data. */
- inline const XclExpRoot& GetRoot() const { return mrRoot; }
+ inline const XclExpRoot& GetRoot() const { return *mpRoot; }
sax_fastparser::FSHelperPtr& GetCurrentStream();
void PushStream( sax_fastparser::FSHelperPtr aStream );
void PopStream();
- ::rtl::OUString GetIdForPath( const ::rtl::OUString& rPath );
sax_fastparser::FSHelperPtr GetStreamForPath( const ::rtl::OUString& rPath );
sax_fastparser::FSHelperPtr& WriteAttributes( sal_Int32 nAttribute, ... );
- sax_fastparser::FSHelperPtr& WriteFontData( const XclFontData& rFontData, sal_Int32 nNameId );
sax_fastparser::FSHelperPtr CreateOutputStream (
const ::rtl::OUString& sFullStream,
@@ -341,19 +342,20 @@ public:
virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
virtual oox::drawingml::chart::ChartConverter& getChartConverter();
- void Trace( const char* format, ...);
private:
virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
+ ScDocShell *getDocShell();
typedef std::map< ::rtl::OUString,
std::pair< ::rtl::OUString,
sax_fastparser::FSHelperPtr > > XclExpXmlPathToStateMap;
- const XclExpRoot& mrRoot; /// Filter root data.
+ const XclExpRoot* mpRoot;
std::stack< sax_fastparser::FSHelperPtr > maStreams;
XclExpXmlPathToStateMap maOpenedStreamMap;
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xestring.hxx b/sc/source/filter/inc/xestring.hxx
index b468696cb3ff..abc6f331aa1b 100644
--- a/sc/source/filter/inc/xestring.hxx
+++ b/sc/source/filter/inc/xestring.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,25 +80,6 @@ public:
const ::rtl::OUString& rString,
XclStrFlags nFlags = EXC_STR_DEFAULT,
sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
-//UNUSED2008-05 /** Constructs a formatted BIFF8 Unicode string.
-//UNUSED2008-05 @param rFormats The formatting runs.
-//UNUSED2008-05 @param nFlags Modifiers for string export.
-//UNUSED2008-05 @param nMaxLen The maximum number of characters to store in this string. */
-//UNUSED2008-05 explicit XclExpString(
-//UNUSED2008-05 const String& rString,
-//UNUSED2008-05 const XclFormatRunVec& rFormats,
-//UNUSED2008-05 XclStrFlags nFlags = EXC_STR_DEFAULT,
-//UNUSED2008-05 sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
-//UNUSED2008-05
-//UNUSED2008-05 /** Constructs a formatted BIFF8 Unicode string.
-//UNUSED2008-05 @param rFormats The formatting runs.
-//UNUSED2008-05 @param nFlags Modifiers for string export.
-//UNUSED2008-05 @param nMaxLen The maximum number of characters to store in this string. */
-//UNUSED2008-05 explicit XclExpString(
-//UNUSED2008-05 const ::rtl::OUString& rString,
-//UNUSED2008-05 const XclFormatRunVec& rFormats,
-//UNUSED2008-05 XclStrFlags nFlags = EXC_STR_DEFAULT,
-//UNUSED2008-05 sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
// assign -----------------------------------------------------------------
@@ -108,15 +90,7 @@ public:
const String& rString,
XclStrFlags nFlags = EXC_STR_DEFAULT,
sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
- /** Assigns a formatted string, converts this object to a BIFF8 Unicode string.
- @param rFormats The formatting runs.
- @param nFlags Modifiers for string export.
- @param nMaxLen The maximum number of characters to store in this string. */
- void Assign(
- const String& rString,
- const XclFormatRunVec& rFormats,
- XclStrFlags nFlags = EXC_STR_DEFAULT,
- sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
+
/** Assigns an unformatted string, converts this object to a BIFF8 Unicode string.
@param nFlags Modifiers for string export.
@param nMaxLen The maximum number of characters to store in this string. */
@@ -124,15 +98,7 @@ public:
const ::rtl::OUString& rString,
XclStrFlags nFlags = EXC_STR_DEFAULT,
sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
- /** Assigns a formatted string, converts this object to a BIFF8 Unicode string.
- @param rFormats The formatting runs.
- @param nFlags Modifiers for string export.
- @param nMaxLen The maximum number of characters to store in this string. */
- void Assign(
- const ::rtl::OUString& rString,
- const XclFormatRunVec& rFormats,
- XclStrFlags nFlags = EXC_STR_DEFAULT,
- sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
+
/** Assigns a Unicode character, converts this object to a BIFF8 Unicode string.
@param nFlags Modifiers for string export.
@param nMaxLen The maximum number of characters to store in this string (for appending). */
@@ -150,28 +116,12 @@ public:
XclStrFlags nFlags = EXC_STR_DEFAULT,
sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
-//UNUSED2008-05 /** Assigns a character, converts this object to a BIFF2-BIFF7 byte string.
-//UNUSED2008-05 @param nFlags Modifiers for string export.
-//UNUSED2008-05 @param nMaxLen The maximum number of characters to store in this string (for appending). */
-//UNUSED2008-05 void AssignByte(
-//UNUSED2008-05 sal_Unicode cChar,
-//UNUSED2008-05 rtl_TextEncoding eTextEnc,
-//UNUSED2008-05 XclStrFlags nFlags = EXC_STR_DEFAULT,
-//UNUSED2008-05 sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
-
// append -----------------------------------------------------------------
/** Appends a string. Uses the string flags used in constructor or last Assign().
@descr This object must be a BIFF8 Unicode string. */
void Append( const String& rString );
-//UNUSED2008-05 /** Appends a string. Uses the string flags used in constructor or last Assign().
-//UNUSED2008-05 @descr This object must be a BIFF8 Unicode string. */
-//UNUSED2008-05 void Append( const ::rtl::OUString& rString );
-//UNUSED2008-05 /** Appends a character. Uses the string flags used in constructor or last Assign().
-//UNUSED2008-05 @descr This object must be a BIFF8 Unicode string. */
-//UNUSED2008-05 void Append( sal_Unicode cChar );
-
/** Appends a string. Uses the string flags used in constructor or last Assign().
@descr This object must be a BIFF2-BIFF7 byte string. */
void AppendByte( const String& rString, rtl_TextEncoding eTextEnc );
@@ -348,3 +298,4 @@ inline XclExpStream& operator<<( XclExpStream& rStrm, const XclExpString& rStrin
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx
index 5ad896bd0d1a..8f38b6f13352 100644
--- a/sc/source/filter/inc/xestyle.hxx
+++ b/sc/source/filter/inc/xestyle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,7 @@
#include "xerecord.hxx"
#include "xlstyle.hxx"
#include "xeroot.hxx"
+#include <boost/shared_ptr.hpp>
/* ============================================================================
- Buffers for style records (PALETTE, FONT, FORMAT, XF, STYLE).
@@ -124,7 +126,7 @@ private:
virtual void WriteBody( XclExpStream& rStrm );
private:
- typedef ScfRef< XclExpPaletteImpl > XclExpPaletteImplRef;
+ typedef boost::shared_ptr< XclExpPaletteImpl > XclExpPaletteImplRef;
XclExpPaletteImplRef mxImpl;
};
@@ -316,11 +318,10 @@ private:
private:
typedef ::std::auto_ptr< SvNumberFormatter > SvNumberFormatterPtr;
typedef ::std::vector< XclExpNumFmt > XclExpNumFmtVec;
- typedef NfKeywordTable* NfKeywordTablePtr;
SvNumberFormatterPtr mxFormatter; /// Special number formatter for conversion.
XclExpNumFmtVec maFormatMap; /// Maps core formats to Excel indexes.
- NfKeywordTablePtr mpKeywordTable; /// Replacement table.
+ NfKeywordTable* mpKeywordTable; /// Replacement table.
sal_uLong mnStdFmt; /// Key for standard number format.
sal_uInt16 mnXclOffset; /// Offset to first user defined format.
};
@@ -335,10 +336,6 @@ struct XclExpCellProt : public XclCellProt
@return true = At least one protection item is set. */
bool FillFromItemSet( const SfxItemSet& rItemSet, bool bStyle = false );
-#if 0
- /** Fills the data to the passed fields of a BIFF2 XF record. */
- void FillToXF2( sal_uInt8& rnNumFmt ) const;
-#endif
/** Fills the data to the passed fields of a BIFF3-BIFF8 XF record. */
void FillToXF3( sal_uInt16& rnProt ) const;
@@ -358,14 +355,6 @@ struct XclExpCellAlign : public XclCellAlign
bool FillFromItemSet( const SfxItemSet& rItemSet,
bool bForceLineBreak, XclBiff eBiff, bool bStyle = false );
-#if 0
- /** Fills the data to the passed fields of a BIFF2 XF record. */
- void FillToXF2( sal_uInt8& rnFlags ) const;
- /** Fills the data to the passed fields of a BIFF3 XF record. */
- void FillToXF3( sal_uInt16& rnAlign ) const;
- /** Fills the data to the passed fields of a BIFF4 XF record. */
- void FillToXF4( sal_uInt16& rnAlign ) const;
-#endif
/** Fills the data to the passed fields of a BIFF5/BIFF7 XF record. */
void FillToXF5( sal_uInt16& rnAlign ) const;
/** Fills the data to the passed fields of a BIFF8 XF record. */
@@ -396,12 +385,6 @@ struct XclExpCellBorder : public XclCellBorder
/** Fills the mn***Color base members from the mn***ColorId members. */
void SetFinalColors( const XclExpPalette& rPalette );
-#if 0
- /** Fills the data to the passed fields of a BIFF2 XF record. */
- void FillToXF2( sal_uInt8& rnFlags ) const;
- /** Fills the data to the passed fields of a BIFF3/BIFF4 XF record. */
- void FillToXF3( sal_uInt32& rnBorder ) const;
-#endif
/** Fills the data to the passed fields of a BIFF5/BIFF7 XF record. */
void FillToXF5( sal_uInt32& rnBorder, sal_uInt32& rnArea ) const;
/** Fills the data to the passed fields of a BIFF8 XF record. */
@@ -432,12 +415,6 @@ struct XclExpCellArea : public XclCellArea
/** Fills the mn***Color base members from the mn***ColorId members. */
void SetFinalColors( const XclExpPalette& rPalette );
-#if 0
- /** Fills the data to the passed fields of a BIFF2 XF record. */
- void FillToXF2( sal_uInt8& rnFlags ) const;
- /** Fills the data to the passed fields of a BIFF3/BIFF4 XF record. */
- void FillToXF3( sal_uInt16& rnArea ) const;
-#endif
/** Fills the data to the passed fields of a BIFF5/BIFF7 XF record. */
void FillToXF5( sal_uInt32& rnArea ) const;
/** Fills the data to the passed fields of a BIFF8 XF record. */
@@ -569,23 +546,6 @@ class XclExpDefaultXF : public XclExpXF
public:
explicit XclExpDefaultXF( const XclExpRoot& rRoot, bool bCellXF );
-//UNUSED2008-05 /** Sets the parent XF ID. Only allowed for cell XFs. */
-//UNUSED2008-05 void SetParent( sal_uInt32 nParentXFId );
-//UNUSED2008-05
-//UNUSED2008-05 /** Sets all "attribute used" flags explicitely.
-//UNUSED2008-05 @descr The following Set***() functions set the appropriate flag too. */
-//UNUSED2008-05 void SetUsedFlags(
-//UNUSED2008-05 bool bProtUsed, bool bFontUsed, bool bFmtUsed,
-//UNUSED2008-05 bool bAlignUsed, bool bBorderUsed, bool bAreaUsed );
-//UNUSED2008-05 /** Sets the cell protection flags. */
-//UNUSED2008-05 void SetProtection( const XclExpCellProt& rProtection );
-//UNUSED2008-05 /** Sets cell alignment attributes. */
-//UNUSED2008-05 void SetAlignment( const XclExpCellAlign& rAlignment );
-//UNUSED2008-05 /** Sets a cell border style. */
-//UNUSED2008-05 void SetBorder( const XclExpCellBorder& rBorder );
-//UNUSED2008-05 /** Sets a cell area style. */
-//UNUSED2008-05 void SetArea( const XclExpCellArea& rArea );
-
/** Sets the Excel font index. */
void SetFont( sal_uInt16 nXclFont );
/** Sets the Excel number format index. */
@@ -779,3 +739,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 723f9dde09e0..bb3f182768f6 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,6 +39,9 @@
#include "xeformula.hxx"
#include "xestyle.hxx"
+#include <boost/shared_ptr.hpp>
+#include <map>
+
/* ============================================================================
Export of cell tables including row and column description.
- Managing all used and formatted cells in a sheet.
@@ -96,7 +100,7 @@ protected:
XclAddress maBaseXclPos; /// Address of base cell (first FORMULA record).
};
-typedef ScfRef< XclExpRangeFmlaBase > XclExpRangeFmlaRef;
+typedef boost::shared_ptr< XclExpRangeFmlaBase > XclExpRangeFmlaRef;
// Array formulas =============================================================
@@ -126,7 +130,7 @@ private:
XclTokenArrayRef mxTokArr; /// The token array of a matrix formula.
};
-typedef ScfRef< XclExpArray > XclExpArrayRef;
+typedef boost::shared_ptr< XclExpArray > XclExpArrayRef;
// ----------------------------------------------------------------------------
@@ -177,7 +181,7 @@ private:
sal_uInt8 mnUsedCount; /// Number of FORMULA records referring to this record.
};
-typedef ScfRef< XclExpShrfmla > XclExpShrfmlaRef;
+typedef boost::shared_ptr< XclExpShrfmla > XclExpShrfmlaRef;
// ----------------------------------------------------------------------------
@@ -244,7 +248,7 @@ private:
bool mbValid; /// true = Contains valid references.
};
-typedef ScfRef< XclExpTableop > XclExpTableopRef;
+typedef boost::shared_ptr< XclExpTableop > XclExpTableopRef;
// ----------------------------------------------------------------------------
@@ -320,7 +324,7 @@ private:
XclAddress maXclPos; /// Address of the cell.
};
-typedef ScfRef< XclExpCellBase > XclExpCellRef;
+typedef boost::shared_ptr< XclExpCellBase > XclExpCellRef;
// Single cell records ========================================================
@@ -404,28 +408,6 @@ private:
bool mbValue; /// The cell value.
};
-// ----------------------------------------------------------------------------
-
-//UNUSED2009-05 /** Represents a BOOLERR record that describes a cell with an error code. */
-//UNUSED2009-05 class XclExpErrorCell : public XclExpSingleCellBase
-//UNUSED2009-05 {
-//UNUSED2009-05 DECL_FIXEDMEMPOOL_NEWDEL( XclExpErrorCell )
-//UNUSED2009-05
-//UNUSED2009-05 public:
-//UNUSED2009-05 explicit XclExpErrorCell( const XclExpRoot rRoot, const XclAddress& rXclPos,
-//UNUSED2009-05 const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
-//UNUSED2009-05 sal_uInt8 nErrCode );
-//UNUSED2009-05
-//UNUSED2009-05 virtual void SaveXml( XclExpXmlStream& rStrm );
-//UNUSED2009-05 private:
-//UNUSED2009-05 virtual void WriteContents( XclExpStream& rStrm );
-//UNUSED2009-05
-//UNUSED2009-05 private:
-//UNUSED2009-05 sal_uInt8 mnErrCode; /// The error code.
-//UNUSED2009-05 };
-
-// ----------------------------------------------------------------------------
-
class ScStringCell;
class ScEditCell;
class XclExpHyperlinkHelper;
@@ -1002,14 +984,12 @@ private:
XclExpRow& GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysEmpty );
private:
- typedef XclExpRecordList< XclExpRow > XclExpRowList;
- typedef XclExpRowList::RecordRefType XclExpRowRef;
+ typedef ::boost::shared_ptr<XclExpRow> RowRef;
+ typedef ::std::map<sal_uInt32, RowRef> RowMap;
- XclExpRowList maRowList; /// List of all ROW records.
+ RowMap maRowMap;
XclExpRowOutlineBuffer maOutlineBfr; /// Buffer for row outline groups.
XclExpDimensions maDimensions; /// DIMENSIONS record for used area.
- XclExpRow* mpLastUsedRow; /// Last used row for faster access.
- sal_uInt16 mnLastUsedXclRow; /// Last used row for faster access.
};
// ============================================================================
@@ -1066,11 +1046,11 @@ private:
typedef XclExpRecordList< XclExpNote > XclExpNoteList;
typedef XclExpRecordList< XclExpHyperlink > XclExpHyperlinkList;
- typedef ScfRef< XclExpDefrowheight > XclExpDefrowhRef;
- typedef ScfRef< XclExpNoteList > XclExpNoteListRef;
- typedef ScfRef< XclExpMergedcells > XclExpMergedcellsRef;
- typedef ScfRef< XclExpHyperlinkList > XclExpHyperlinkRef;
- typedef ScfRef< XclExpDval > XclExpDvalRef;
+ typedef boost::shared_ptr< XclExpDefrowheight > XclExpDefrowhRef;
+ typedef boost::shared_ptr< XclExpNoteList > XclExpNoteListRef;
+ typedef boost::shared_ptr< XclExpMergedcells > XclExpMergedcellsRef;
+ typedef boost::shared_ptr< XclExpHyperlinkList > XclExpHyperlinkRef;
+ typedef boost::shared_ptr< XclExpDval > XclExpDvalRef;
XclExpColinfoBuffer maColInfoBfr; /// Buffer for column formatting.
XclExpRowBuffer maRowBfr; /// Rows and cell records.
@@ -1087,3 +1067,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xeview.hxx b/sc/source/filter/inc/xeview.hxx
index 61e349ab1e86..eb1bf5c403f8 100644
--- a/sc/source/filter/inc/xeview.hxx
+++ b/sc/source/filter/inc/xeview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -178,3 +179,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 097ce1801896..a9440ee6d8ea 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,6 +42,8 @@
#include "xlstyle.hxx"
#include "xiescher.hxx"
#include "xistring.hxx"
+#include <boost/shared_ptr.hpp>
+#include <boost/ptr_container/ptr_map.hpp>
namespace com { namespace sun { namespace star {
namespace awt
@@ -172,7 +175,7 @@ public:
sal_uInt16 nAngle );
private:
- typedef ScfRef< XclImpChRootData > XclImpChRootDataRef;
+ typedef boost::shared_ptr< XclImpChRootData > XclImpChRootDataRef;
XclImpChRootDataRef mxChData; /// Reference to the root data object.
};
@@ -219,7 +222,7 @@ private:
XclChFramePos maData; /// Position of the frame.
};
-typedef ScfRef< XclImpChFramePos > XclImpChFramePosRef;
+typedef boost::shared_ptr< XclImpChFramePos > XclImpChFramePosRef;
// ----------------------------------------------------------------------------
@@ -253,7 +256,7 @@ private:
XclChLineFormat maData; /// Contents of the CHLINEFORMAT record.
};
-typedef ScfRef< XclImpChLineFormat > XclImpChLineFormatRef;
+typedef boost::shared_ptr< XclImpChLineFormat > XclImpChLineFormatRef;
// ----------------------------------------------------------------------------
@@ -283,7 +286,7 @@ private:
XclChAreaFormat maData; /// Contents of the CHAREAFORMAT record.
};
-typedef ScfRef< XclImpChAreaFormat > XclImpChAreaFormatRef;
+typedef boost::shared_ptr< XclImpChAreaFormat > XclImpChAreaFormatRef;
// ----------------------------------------------------------------------------
@@ -307,7 +310,7 @@ private:
XclChPicFormat maPicFmt; /// Image options, e.g. stretched, stacked (CHPICFORMAT record).
};
-typedef ScfRef< XclImpChEscherFormat > XclImpChEscherFormatRef;
+typedef boost::shared_ptr< XclImpChEscherFormat > XclImpChEscherFormatRef;
// ----------------------------------------------------------------------------
@@ -333,12 +336,12 @@ public:
/** Returns true, if the line style is set to something visible. */
inline bool HasLine() const { return IsAutoLine() || mxLineFmt->HasLine(); }
/** Returns the line weight used for this frame. */
- inline sal_Int16 GetLineWeight() const { return mxLineFmt.is() ? mxLineFmt->GetWeight() : EXC_CHLINEFORMAT_SINGLE; }
+ inline sal_Int16 GetLineWeight() const { return mxLineFmt ? mxLineFmt->GetWeight() : EXC_CHLINEFORMAT_SINGLE; }
/** Returns true, if the area format is set to automatic. */
inline bool IsAutoArea() const { return !mxEscherFmt && (!mxAreaFmt || mxAreaFmt->IsAuto()); }
/** Returns true, if the area style is set to something visible. */
- inline bool HasArea() const { return mxEscherFmt.is() || IsAutoArea() || mxAreaFmt->HasArea(); }
+ inline bool HasArea() const { return mxEscherFmt || IsAutoArea() || mxAreaFmt->HasArea(); }
protected:
/** Converts and writes the contained line formatting to the passed property set. */
@@ -389,7 +392,7 @@ private:
XclChObjectType meObjType; /// Type of the represented object.
};
-typedef ScfRef< XclImpChFrame > XclImpChFrameRef;
+typedef boost::shared_ptr< XclImpChFrame > XclImpChFrameRef;
// Source links ===============================================================
@@ -417,9 +420,9 @@ public:
inline sal_uInt8 GetLinkType() const { return maData.mnLinkType; }
/** Returns true, if the source link contains explicit string data. */
- inline bool HasString() const { return mxString.is() && !mxString->IsEmpty(); }
+ inline bool HasString() const { return mxString && !mxString->IsEmpty(); }
/** Returns explicit string data or an empty string. */
- inline const String& GetString() const { return mxString.is() ? mxString->GetText() : String::EmptyString(); }
+ inline const String& GetString() const { return mxString ? mxString->GetText() : String::EmptyString(); }
/** Returns the number of data points of this source link. */
sal_uInt16 GetCellCount() const;
@@ -432,15 +435,15 @@ public:
XFormattedStringSeq CreateStringSequence( const XclImpChRoot& rRoot,
sal_uInt16 nLeadFontIdx, const Color& rLeadFontColor ) const;
- void FillSourceLink(::std::vector<ScSharedTokenRef>& rTokens) const;
+ void FillSourceLink(::std::vector<ScTokenRef>& rTokens) const;
private:
XclChSourceLink maData; /// Contents of the CHSOURCELINK record.
XclImpStringRef mxString; /// Text data (CHSTRING record).
- ScfRef< ScTokenArray> mxTokenArray; /// Token array representing the data ranges.
+ boost::shared_ptr< ScTokenArray> mxTokenArray; /// Token array representing the data ranges.
};
-typedef ScfRef< XclImpChSourceLink > XclImpChSourceLinkRef;
+typedef boost::shared_ptr< XclImpChSourceLink > XclImpChSourceLinkRef;
// Text =======================================================================
@@ -480,7 +483,7 @@ private:
sal_uInt16 mnFontIdx; /// Index into font buffer.
};
-typedef ScfRef< XclImpChFont > XclImpChFontRef;
+typedef boost::shared_ptr< XclImpChFont > XclImpChFontRef;
// ----------------------------------------------------------------------------
@@ -521,7 +524,7 @@ public:
/** Returns the position of the data point label this text is linked to. */
inline const XclChDataPointPos& GetPointPos() const { return maObjLink.maPointPos; }
/** Returns true, if this text group contains string data. */
- inline bool HasString() const { return mxSrcLink.is() && mxSrcLink->HasString(); }
+ inline bool HasString() const { return mxSrcLink && mxSrcLink->HasString(); }
/** Returns true, if the text object is marked as deleted. */
inline bool IsDeleted() const { return ::get_flag( maData.mnFlags, EXC_CHTEXT_DELETED ); }
@@ -547,7 +550,7 @@ private:
void ReadChFrLabelProps( XclImpStream& rStrm );
private:
- typedef ScfRef< XclChFrLabelProps > XclChFrLabelPropsRef;
+ typedef boost::shared_ptr< XclChFrLabelProps > XclChFrLabelPropsRef;
XclChText maData; /// Contents of the CHTEXT record.
XclChObjectLink maObjLink; /// Link target for this text object.
@@ -559,7 +562,7 @@ private:
XclChFrLabelPropsRef mxLabelProps; /// Extended data label properties (CHFRLABELPROPS record).
};
-typedef ScfRef< XclImpChText > XclImpChTextRef;
+typedef boost::shared_ptr< XclImpChText > XclImpChTextRef;
// Data series ================================================================
@@ -584,7 +587,7 @@ private:
XclChMarkerFormat maData; /// Contents of the CHMARKERFORMAT record.
};
-typedef ScfRef< XclImpChMarkerFormat > XclImpChMarkerFormatRef;
+typedef boost::shared_ptr< XclImpChMarkerFormat > XclImpChMarkerFormatRef;
// ----------------------------------------------------------------------------
@@ -602,7 +605,7 @@ private:
sal_uInt16 mnPieDist; /// Pie distance to diagram center.
};
-typedef ScfRef< XclImpChPieFormat > XclImpChPieFormatRef;
+typedef boost::shared_ptr< XclImpChPieFormat > XclImpChPieFormatRef;
// ----------------------------------------------------------------------------
@@ -620,7 +623,7 @@ private:
sal_uInt16 mnFlags; /// Additional flags.
};
-typedef ScfRef< XclImpChSeriesFormat > XclImpChSeriesFormatRef;
+typedef boost::shared_ptr< XclImpChSeriesFormat > XclImpChSeriesFormatRef;
// ----------------------------------------------------------------------------
@@ -637,7 +640,7 @@ private:
XclCh3dDataFormat maData; /// Contents of the CH3DDATAFORMAT record.
};
-typedef ScfRef< XclImpCh3dDataFormat > XclImpCh3dDataFormatRef;
+typedef boost::shared_ptr< XclImpCh3dDataFormat > XclImpCh3dDataFormatRef;
// ----------------------------------------------------------------------------
@@ -649,13 +652,13 @@ public:
/** Reads the CHATTACHEDLABEL record (data series/point labels). */
void ReadChAttachedLabel( XclImpStream& rStrm );
/** Creates a CHTEXT group for the label. Clones xParentText and sets additional label settings */
- XclImpChTextRef CreateDataLabel( XclImpChTextRef xParent ) const;
+ XclImpChTextRef CreateDataLabel( const XclImpChText* pParent ) const;
private:
sal_uInt16 mnFlags; /// Additional flags.
};
-typedef ScfRef< XclImpChAttachedLabel > XclImpChAttLabelRef;
+typedef boost::shared_ptr< XclImpChAttachedLabel > XclImpChAttLabelRef;
// ----------------------------------------------------------------------------
@@ -696,9 +699,9 @@ public:
/** Returns true, if markers are set to automatic format. */
inline bool IsAutoMarker() const { return !mxMarkerFmt || mxMarkerFmt->IsAuto(); }
/** Returns true, if the series line is smoothed. */
- inline bool HasSpline() const { return mxSeriesFmt.is() && mxSeriesFmt->HasSpline(); }
+ inline bool HasSpline() const { return mxSeriesFmt && mxSeriesFmt->HasSpline(); }
/** Returns the data label text object. */
- inline XclImpChTextRef GetDataLabel() const { return mxLabel; }
+ inline const XclImpChText* GetDataLabel() const { return mxLabel.get(); }
/** Converts and writes the contained data to the passed property set. */
void Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo ) const;
@@ -723,7 +726,7 @@ private:
XclImpChTextRef mxLabel; /// Data point label formatting (CHTEXT group).
};
-typedef ScfRef< XclImpChDataFormat > XclImpChDataFormatRef;
+typedef boost::shared_ptr< XclImpChDataFormat > XclImpChDataFormatRef;
// ----------------------------------------------------------------------------
@@ -749,7 +752,7 @@ private:
XclImpChDataFormatRef mxDataFmt; /// Formatting settings of the trend line.
};
-typedef ScfRef< XclImpChSerTrendLine > XclImpChSerTrendLineRef;
+typedef boost::shared_ptr< XclImpChSerTrendLine > XclImpChSerTrendLineRef;
// ----------------------------------------------------------------------------
@@ -786,7 +789,7 @@ private:
XclImpChDataFormatRef mxDataFmt; /// Formatting settings of the error bars.
};
-typedef ScfRef< XclImpChSerErrorBar > XclImpChSerErrorBarRef;
+typedef boost::shared_ptr< XclImpChSerErrorBar > XclImpChSerErrorBarRef;
// ----------------------------------------------------------------------------
@@ -827,16 +830,16 @@ public:
/** Returns the 0-based index of the parent series (e.g. of a trend line). */
inline sal_uInt16 GetParentIdx() const { return mnParentIdx; }
/** Returns the format index of the series used for automatic line and area colors. */
- inline sal_uInt16 GetFormatIdx() const { return mxSeriesFmt.is() ? mxSeriesFmt->GetFormatIdx() : EXC_CHDATAFORMAT_DEFAULT; }
+ inline sal_uInt16 GetFormatIdx() const { return mxSeriesFmt ? mxSeriesFmt->GetFormatIdx() : EXC_CHDATAFORMAT_DEFAULT; }
/** Returns true, if the series is child of another series (e.g. trend line). */
inline bool HasParentSeries() const { return mnParentIdx != EXC_CHSERIES_INVALID; }
/** Returns true, if the series contains child series (e.g. trend lines). */
inline bool HasChildSeries() const { return !maTrendLines.empty() || !maErrorBars.empty(); }
/** Returns series title or an empty string, if the series does not contain a title. */
- inline const String& GetTitle() const { return mxTitleLink.is() ? mxTitleLink->GetString() : String::EmptyString(); }
+ inline const String& GetTitle() const { return mxTitleLink ? mxTitleLink->GetString() : String::EmptyString(); }
/** Returns true, if the series line is smoothed. */
- inline bool HasSpline() const { return mxSeriesFmt.is() && mxSeriesFmt->HasSpline(); }
+ inline bool HasSpline() const { return mxSeriesFmt && mxSeriesFmt->HasSpline(); }
/** Creates a labeled data sequence object from value data link. */
XLabeledDataSeqRef CreateValueSequence( const ::rtl::OUString& rValueRole ) const;
@@ -845,7 +848,7 @@ public:
/** Creates a data series object with initialized source links. */
XDataSeriesRef CreateDataSeries() const;
- void FillAllSourceLinks(::std::vector<ScSharedTokenRef>& rTokens) const;
+ void FillAllSourceLinks(::std::vector<ScTokenRef>& rTokens) const;
private:
/** Reads a CHSOURCELINK record. */
@@ -872,10 +875,10 @@ private:
XPropertySetRef CreateErrorBar( sal_uInt8 nPosBarId, sal_uInt8 nNegBarId ) const;
private:
- typedef ScfRefMap< sal_uInt16, XclImpChDataFormat > XclImpChDataFormatMap;
- typedef ScfRefMap< sal_uInt16, XclImpChText > XclImpChTextMap;
- typedef ::std::list< XclImpChSerTrendLineRef > XclImpChSerTrendLineList;
- typedef ScfRefMap< sal_uInt8, XclImpChSerErrorBar > XclImpChSerErrorBarMap;
+ typedef ::std::map<sal_uInt16, XclImpChDataFormatRef> XclImpChDataFormatMap;
+ typedef ::std::map<sal_uInt16, XclImpChTextRef> XclImpChTextMap;
+ typedef ::std::list< XclImpChSerTrendLineRef > XclImpChSerTrendLineList;
+ typedef ::boost::ptr_map<sal_uInt8, XclImpChSerErrorBar> XclImpChSerErrorBarMap;
XclChSeries maData; /// Contents of the CHSERIES record.
XclImpChSourceLinkRef mxValueLink; /// Link data for series values.
@@ -892,7 +895,7 @@ private:
sal_uInt16 mnParentIdx; /// 0-based index of parent series (trend lines and error bars).
};
-typedef ScfRef< XclImpChSeries > XclImpChSeriesRef;
+typedef boost::shared_ptr< XclImpChSeries > XclImpChSeriesRef;
// Chart type groups ==========================================================
@@ -950,7 +953,7 @@ private:
XclChChart3d maData; /// Contents of the CHCHART3D record.
};
-typedef ScfRef< XclImpChChart3d > XclImpChChart3dRef;
+typedef boost::shared_ptr< XclImpChChart3d > XclImpChChart3dRef;
// ----------------------------------------------------------------------------
@@ -984,7 +987,7 @@ private:
XclImpChFrameRef mxFrame; /// Legend frame format (CHFRAME group).
};
-typedef ScfRef< XclImpChLegend > XclImpChLegendRef;
+typedef boost::shared_ptr< XclImpChLegend > XclImpChLegendRef;
// ----------------------------------------------------------------------------
@@ -1009,7 +1012,7 @@ private:
sal_uInt16 mnBarDist; /// Distance between bars (CHDROPBAR record).
};
-typedef ScfRef< XclImpChDropBar > XclImpChDropBarRef;
+typedef boost::shared_ptr< XclImpChDropBar > XclImpChDropBarRef;
// ----------------------------------------------------------------------------
@@ -1058,11 +1061,11 @@ public:
/** Returns true, if the series in this chart type group are stacked on each other as percentage. */
inline bool IsPercent() const { return maType.IsPercent(); }
/** Returns true, if the chart is three-dimensional. */
- inline bool Is3dChart() const { return mxChart3d.is() && maTypeInfo.mbSupports3d; }
+ inline bool Is3dChart() const { return mxChart3d && maTypeInfo.mbSupports3d; }
/** Returns true, if chart type supports wall and floor format in 3d mode. */
inline bool Is3dWallChart() const { return Is3dChart() && (maTypeInfo.meTypeCateg != EXC_CHTYPECATEG_PIE); }
/** Returns true, if the series in this chart type group are ordered on the Z axis. */
- inline bool Is3dDeepChart() const { return Is3dWallChart() && mxChart3d.is() && !mxChart3d->IsClustered(); }
+ inline bool Is3dDeepChart() const { return Is3dWallChart() && mxChart3d && !mxChart3d->IsClustered(); }
/** Returns true, if category (X axis) labels are enabled (may be disabled in radar charts). */
inline bool HasCategoryLabels() const { return maType.HasCategoryLabels(); }
/** Returns true, if points of a series show varying automatic area format. */
@@ -1095,7 +1098,7 @@ private:
void ReadChDataFormat( XclImpStream& rStrm );
/** Returns true, if the chart type group contains a hi-lo line format. */
- inline bool HasHiLoLine() const { return maChartLines.has( EXC_CHCHARTLINE_HILO ); }
+ inline bool HasHiLoLine() const { return maChartLines.find( EXC_CHCHARTLINE_HILO ) != maChartLines.end(); }
/** Returns true, if the chart type group contains drop bar formats. */
inline bool HasDropBars() const { return !maDropBars.empty(); }
@@ -1108,10 +1111,10 @@ private:
void CreateStockSeries( XChartTypeRef xChartType, sal_Int32 nApiAxesSetIdx ) const;
private:
- typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec;
- typedef ScfRefMap< sal_uInt16, XclImpChDropBar > XclImpChDropBarMap;
- typedef ScfRefMap< sal_uInt16, XclImpChLineFormat > XclImpChLineFormatMap;
- typedef ::std::set< sal_uInt16 > UInt16Set;
+ typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec;
+ typedef boost::ptr_map<sal_uInt16, XclImpChDropBar> XclImpChDropBarMap;
+ typedef boost::ptr_map<sal_uInt16, XclImpChLineFormat> XclImpChLineFormatMap;
+ typedef ::std::set< sal_uInt16 > UInt16Set;
XclChTypeGroup maData; /// Contents of the CHTYPEGROUP record.
XclImpChType maType; /// Chart type (e.g. CHBAR, CHLINE, ...).
@@ -1126,7 +1129,7 @@ private:
UInt16Set maUnusedFormats; /// Contains unused format indexes for automatic colors.
};
-typedef ScfRef< XclImpChTypeGroup > XclImpChTypeGroupRef;
+typedef boost::shared_ptr< XclImpChTypeGroup > XclImpChTypeGroupRef;
// Axes =======================================================================
@@ -1151,7 +1154,7 @@ private:
XclChDateRange maDateData; /// Contents of the CHDATERANGE record.
};
-typedef ScfRef< XclImpChLabelRange > XclImpChLabelRangeRef;
+typedef boost::shared_ptr< XclImpChLabelRange > XclImpChLabelRangeRef;
// ----------------------------------------------------------------------------
@@ -1173,7 +1176,7 @@ private:
XclChValueRange maData; /// Contents of the CHVALUERANGE record.
};
-typedef ScfRef< XclImpChValueRange > XclImpChValueRangeRef;
+typedef boost::shared_ptr< XclImpChValueRange > XclImpChValueRangeRef;
// ----------------------------------------------------------------------------
@@ -1198,7 +1201,7 @@ private:
XclChTick maData; /// Contents of the CHTICK record.
};
-typedef ScfRef< XclImpChTick > XclImpChTickRef;
+typedef boost::shared_ptr< XclImpChTick > XclImpChTickRef;
// ----------------------------------------------------------------------------
@@ -1239,9 +1242,9 @@ public:
/** Returns true, if the axis contains caption labels. */
inline bool HasLabels() const { return !mxTick || mxTick->HasLabels(); }
/** Returns true, if the axis shows its major grid lines. */
- inline bool HasMajorGrid() const { return mxMajorGrid.is(); }
+ inline bool HasMajorGrid() const { return mxMajorGrid; }
/** Returns true, if the axis shows its minor grid lines. */
- inline bool HasMinorGrid() const { return mxMinorGrid.is(); }
+ inline bool HasMinorGrid() const { return mxMinorGrid; }
/** Creates an API axis object. */
XAxisRef CreateAxis( const XclImpChTypeGroup& rTypeGroup, const XclImpChAxis* pCrossingAxis ) const;
@@ -1269,7 +1272,7 @@ private:
sal_uInt16 mnNumFmtIdx; /// Index into number format buffer (CHFORMAT record).
};
-typedef ScfRef< XclImpChAxis > XclImpChAxisRef;
+typedef boost::shared_ptr< XclImpChAxis > XclImpChAxisRef;
// ----------------------------------------------------------------------------
@@ -1306,7 +1309,7 @@ public:
/** Returns the outer plot area position, if existing. */
inline XclImpChFramePosRef GetPlotAreaFramePos() const { return mxFramePos; }
/** Returns the specified chart type group. */
- inline XclImpChTypeGroupRef GetTypeGroup( sal_uInt16 nGroupIdx ) const { return maTypeGroups.get( nGroupIdx ); }
+ XclImpChTypeGroupRef GetTypeGroup( sal_uInt16 nGroupIdx ) const;
/** Returns the first chart type group. */
XclImpChTypeGroupRef GetFirstTypeGroup() const;
/** Looks for a legend in all chart type groups and returns it. */
@@ -1343,7 +1346,7 @@ private:
void ConvertBackground( XDiagramRef xDiagram ) const;
private:
- typedef ScfRefMap< sal_uInt16, XclImpChTypeGroup > XclImpChTypeGroupMap;
+ typedef ::std::map<sal_uInt16, XclImpChTypeGroupRef> XclImpChTypeGroupMap;
XclChAxesSet maData; /// Contents of the CHAXESSET record.
XclImpChFramePosRef mxFramePos; /// Outer plot area position (CHFRAMEPOS record).
@@ -1357,7 +1360,7 @@ private:
XclImpChTypeGroupMap maTypeGroups; /// Chart type groups (CHTYPEGROUP group).
};
-typedef ScfRef< XclImpChAxesSet > XclImpChAxesSetRef;
+typedef boost::shared_ptr< XclImpChAxesSet > XclImpChAxesSetRef;
// The chart object ===========================================================
@@ -1392,7 +1395,7 @@ public:
/** Returns the specified chart type group. */
XclImpChTypeGroupRef GetTypeGroup( sal_uInt16 nGroupIdx ) const;
/** Returns the specified default text. */
- XclImpChTextRef GetDefaultText( XclChTextType eTextType ) const;
+ const XclImpChText* GetDefaultText( XclChTextType eTextType ) const;
/** Returns true, if the plot area has benn moved and/or resized manually. */
bool IsManualPlotArea() const;
/** Returns the number of units on the progress bar needed for the chart. */
@@ -1427,9 +1430,9 @@ private:
XDiagramRef CreateDiagram() const;
private:
- typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec;
- typedef ScfRefMap< XclChDataPointPos, XclImpChDataFormat > XclImpChDataFormatMap;
- typedef ScfRefMap< sal_uInt16, XclImpChText > XclImpChTextMap;
+ typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec;
+ typedef ::std::map<XclChDataPointPos, XclImpChDataFormatRef> XclImpChDataFormatMap;
+ typedef ::boost::ptr_map<sal_uInt16, XclImpChText> XclImpChTextMap;
XclChRectangle maRect; /// Position of the chart on the sheet (CHCHART record).
XclImpChSeriesVec maSeries; /// List of series data (CHSERIES groups).
@@ -1443,7 +1446,7 @@ private:
XclImpChLegendRef mxLegend; /// Chart legend (CHLEGEND group).
};
-typedef ScfRef< XclImpChChart > XclImpChChartRef;
+typedef boost::shared_ptr< XclImpChChart > XclImpChChartRef;
// ----------------------------------------------------------------------------
@@ -1508,7 +1511,7 @@ private:
void ReadChChart( XclImpStream& rStrm );
private:
- typedef ScfRef< XclImpChartDrawing > XclImpChartDrawingRef;
+ typedef boost::shared_ptr< XclImpChartDrawing > XclImpChartDrawingRef;
XclImpChChartRef mxChartData; /// The chart data (CHCHART group).
XclImpChartDrawingRef mxChartDrawing; /// Drawing container for embedded shapes.
@@ -1520,3 +1523,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx
index 810c435d34bf..31a62aba7aa5 100644
--- a/sc/source/filter/inc/xicontent.hxx
+++ b/sc/source/filter/inc/xicontent.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,8 +34,11 @@
#include "xlcontent.hxx"
#include "xistring.hxx"
#include "xiroot.hxx"
+#include "validat.hxx"
#include <map>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/noncopyable.hpp>
/* ============================================================================
Classes to import the big Excel document contents (related to several cells or
@@ -81,7 +85,7 @@ private:
// Hyperlinks =================================================================
/** Provides importing hyperlinks and inserting them into a document. */
-class XclImpHyperlink : ScfNoInstance
+class XclImpHyperlink : private boost::noncopyable
{
public:
/** Reads a HLINK record and inserts it into the document.
@@ -97,17 +101,29 @@ public:
/** Convert the sheet name with invalid character(s) in URL when the URL is
to a location within the same document (e.g. #'Sheet&Name'.A1). */
static void ConvertToValidTabName(String& rName);
+
+private:
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static methods. To enforce this, the default constructor
+ is made private */
+ XclImpHyperlink();
};
// Label ranges ===============================================================
/** Provides importing label ranges and inserting them into a document. */
-class XclImpLabelranges : ScfNoInstance
+class XclImpLabelranges : private boost::noncopyable
{
public:
/** Reads a LABELRANGES record and inserts the label ranges into the document.
@descr Import stream must be located at start of a LABELRANGES record. */
static void ReadLabelranges( XclImpStream& rStrm );
+
+private:
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static methods. To enforce this, the default constructor
+ is made private */
+ XclImpLabelranges();
};
// Conditional formatting =====================================================
@@ -156,26 +172,41 @@ public:
void Apply();
private:
- typedef ScfDelList< XclImpCondFormat > XclImpCondFmtList;
+ typedef boost::ptr_vector< XclImpCondFormat > XclImpCondFmtList;
XclImpCondFmtList maCondFmtList; /// List with all conditional formattings.
};
// Data Validation ============================================================
-/** Provides importing validation data and inserting it into a document. */
-class XclImpValidation : ScfNoInstance
+/** Imports validation data. */
+class XclImpValidationManager : protected XclImpRoot
{
public:
+ explicit XclImpValidationManager( const XclImpRoot& rRoot );
+
/** Reads a DVAL record and sets marks the dropdown arrow control to be ignored. */
- static void ReadDval( XclImpStream& rStrm );
+ void ReadDval( XclImpStream& rStrm );
/** Reads a DV record and inserts validation data into the document. */
- static void ReadDV( XclImpStream& rStrm );
+ void ReadDV( XclImpStream& rStrm );
+
+ void Apply();
+private:
+ struct DVItem
+ {
+ ScRangeList maRanges;
+ ScValidationData maValidData;
+
+ explicit DVItem ( const ScRangeList& rRanges, const ScValidationData& rValidData );
+ };
+ typedef ::boost::ptr_vector<DVItem> DVItemList;
+
+ DVItemList maDVItems;
};
// Web queries ================================================================
/** Stores the data of one web query. */
-class XclImpWebQuery : ScfNoCopy
+class XclImpWebQuery : private boost::noncopyable
{
public:
explicit XclImpWebQuery( const ScRange& rDestRange );
@@ -231,19 +262,25 @@ public:
void Apply();
private:
- typedef ScfDelList< XclImpWebQuery > XclImpWebQueryList;
+ typedef boost::ptr_vector< XclImpWebQuery > XclImpWebQueryList;
XclImpWebQueryList maWQList; /// List of the web query objects.
};
// Decryption =================================================================
/** Provides static functions to import stream decryption settings. */
-class XclImpDecryptHelper : ScfNoInstance
+class XclImpDecryptHelper : private boost::noncopyable
{
public:
/** Reads the FILEPASS record, queries a password and sets decryption algorihm.
@return Error code that may cause an error message after import. */
static ErrCode ReadFilepass( XclImpStream& rStrm );
+
+private:
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static methods. To enforce this, the default constructor
+ is made private */
+ XclImpDecryptHelper();
};
// ============================================================================
@@ -304,8 +341,8 @@ private:
ProtectedSheetMap maProtectedSheets;
};
-
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index aa5979ac5e68..be6a48f317bc 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,7 @@
#include "xlescher.hxx"
#include "xiroot.hxx"
#include "xistring.hxx"
+#include <boost/shared_ptr.hpp>
namespace com { namespace sun { namespace star {
namespace drawing { class XShape; }
@@ -52,7 +54,7 @@ class XclImpDrawing;
// Drawing objects ============================================================
class XclImpDrawObjBase;
-typedef ScfRef< XclImpDrawObjBase > XclImpDrawObjRef;
+typedef boost::shared_ptr< XclImpDrawObjBase > XclImpDrawObjRef;
/** Base class for drawing objects (OBJ records). */
class XclImpDrawObjBase : protected XclImpRoot
@@ -92,7 +94,7 @@ public:
/** Returns the Excel object type from OBJ record. */
inline sal_uInt16 GetObjType() const { return mnObjType; }
/** Returns the name of this object, may generate a default name. */
- String GetObjName() const;
+ virtual String GetObjName() const;
/** Returns associated macro name, if set, otherwise zero length string. */
inline const String& GetMacroName() const { return maMacroName; }
@@ -172,7 +174,7 @@ protected:
virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
/** Derived classes may perform additional processing for the passed SdrObject after insertion. */
virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
-
+ SCTAB GetTab() const { return mnTab; }
private:
/** Reads the contents of a BIFF3 OBJ record. */
void ImplReadObj3( XclImpStream& rStrm );
@@ -186,6 +188,7 @@ private:
private:
XclObjAnchor maAnchor; /// The position of the object in its parent.
sal_uInt16 mnObjId; /// The object identifier (unique per drawing).
+ SCTAB mnTab; /// Location of object
sal_uInt16 mnObjType; /// The Excel object type from OBJ record.
sal_uInt32 mnDffShapeId; /// Shape ID from DFF stream.
sal_uInt32 mnDffFlags; /// Shape flags from DFF stream.
@@ -445,7 +448,7 @@ private:
void FinalizeTabChart();
private:
- typedef ScfRef< XclImpChart > XclImpChartRef;
+ typedef boost::shared_ptr< XclImpChart > XclImpChartRef;
XclImpChartRef mxChart; /// The chart itself (BOF/EOF substream data).
bool mbOwnTab; /// true = own sheet; false = embedded object.
@@ -481,9 +484,9 @@ public:
virtual ~XclImpControlHelper();
/** Returns true, if a linked cell address is present. */
- inline bool HasCellLink() const { return mxCellLink.is(); }
+ inline bool HasCellLink() const { return mxCellLink != 0; }
/** Returns true, if a linked source cell range is present. */
- inline bool HasSourceRange() const { return mxSrcRange.is(); }
+ inline bool HasSourceRange() const { return mxSrcRange != 0; }
/** Returns the SdrObject from the passed control shape and sets the bounding rectangle. */
SdrObject* CreateSdrObjectFromShape(
@@ -502,6 +505,10 @@ protected:
/** Derived classes will set additional properties for the current form control. */
virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
+ void ApplySheetLinkProps() const;
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ mxShape; /// The UNO wrapper of the control shape.
+ boost::shared_ptr< ScAddress > mxCellLink; /// Linked cell in the Calc document.
private:
/** Reads a list of cell ranges from a formula at the current stream position. */
void ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm );
@@ -509,12 +516,9 @@ private:
void ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm, bool bWithBoundSize );
private:
- const XclImpRoot& mrRoot; /// Not derived from XclImpRoot to allow multiple inheritance.
- mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
- mxShape; /// The UNO wrapper of the control shape.
- ScfRef< ScAddress > mxCellLink; /// Linked cell in the Calc document.
- ScfRef< ScRange > mxSrcRange; /// Source data range in the Calc document.
- XclCtrlBindMode meBindMode; /// Value binding mode.
+ const XclImpRoot& mrRoot; /// Not derived from XclImpRoot to allow multiple inheritance.
+ boost::shared_ptr< ScRange > mxSrcRange; /// Source data range in the Calc document.
+ XclCtrlBindMode meBindMode; /// Value binding mode.
};
// ----------------------------------------------------------------------------
@@ -614,6 +618,7 @@ protected:
virtual XclTbxEventType DoGetEventType() const;
protected:
+ void ApplyGrouping( XclImpOptionButtonObj& rLeader, sal_Int32 nRefVal );
sal_uInt16 mnNextInGroup; /// Next option button in a group.
sal_uInt16 mnFirstInGroup; /// 1 = Button is the first in a group.
};
@@ -862,7 +867,8 @@ class XclImpPictureObj : public XclImpRectObj, public XclImpControlHelper
{
public:
explicit XclImpPictureObj( const XclImpRoot& rRoot );
-
+ /** Returns the ObjectName - can use non-obvious lookup for override in the associated vba document module stream**/
+ virtual String GetObjName() const;
/** Returns the graphic imported from the IMGDATA record. */
inline const Graphic& GetGraphic() const { return maGraphic; }
/** Returns the visible area of the imported graphic. */
@@ -922,8 +928,6 @@ private:
class XclImpSolverContainer : public SvxMSDffSolverContainer
{
public:
-//UNUSED2009-05 /** Reads the entire solver container. Stream must point to begin of container header. */
-//UNUSED2009-05 void ReadSolverContainer( SvStream& rDffStrm );
/** Inserts information about a new SdrObject. */
void InsertSdrObjectInfo( SdrObject& rSdrObj, sal_uInt32 nDffShapeId, sal_uInt32 nDffFlags );
@@ -973,7 +977,7 @@ public:
protected:
/** Returns a color from the Excel color palette. */
- virtual FASTBOOL GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const;
+ virtual bool GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const;
};
// ----------------------------------------------------------------------------
@@ -1087,8 +1091,8 @@ private:
void InitControlForm();
private:
- typedef ScfRef< ScfProgressBar > ScfProgressBarRef;
- typedef ScfRef< XclImpDffConvData > XclImpDffConvDataRef;
+ typedef boost::shared_ptr< ScfProgressBar > ScfProgressBarRef;
+ typedef boost::shared_ptr< XclImpDffConvData > XclImpDffConvDataRef;
typedef ::std::vector< XclImpDffConvDataRef > XclImpDffConvDataStack;
const ::rtl::OUString maStdFormName; /// Standard name of control forms.
@@ -1158,7 +1162,7 @@ private:
private:
typedef ::std::map< sal_Size, XclImpDrawObjRef > XclImpObjMap;
typedef ::std::map< sal_uInt16, XclImpDrawObjRef > XclImpObjMapById;
- typedef ScfRef< XclImpObjTextData > XclImpObjTextRef;
+ typedef boost::shared_ptr< XclImpObjTextData > XclImpObjTextRef;
typedef ::std::map< sal_Size, XclImpObjTextRef > XclImpObjTextMap;
XclImpDrawObjVector maRawObjs; /// BIFF5 objects without DFF data.
@@ -1225,13 +1229,48 @@ public:
String GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const;
/** Returns the used area in the sheet with the passed index. */
ScRange GetUsedArea( SCTAB nScTab ) const;
+ /** Sets the container to receive overridden shape/ctrl names from
+ the filter. */
+ void SetOleNameOverrideInfo( const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& rxOverrideInfo ) { mxOleCtrlNameOverride = rxOverrideInfo; }
+ /** Returns the name of overridden name ( or zero length string ) for
+ associated object id. */
+ String GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId );
+ // ------------------------------------------------------------------------
+private:
+
+ /** Reads and returns a bitmap from WMF/PICT format. */
+ static void ReadWmf( Graphic& rGraphic, XclImpStream& rStrm );
+ /** Reads and returns a bitmap from BMP format. */
+ static void ReadBmp( Graphic& rGraphic, XclImpStream& rStrm );
+
+ /** Reads contents of an DFF record and append data to internal DFF stream. */
+ void ReadDffRecord( XclImpStream& rStrm );
+ /** Reads a BIFF8 OBJ record following an MSODRAWING record. */
+ void ReadObj8( XclImpStream& rStrm );
+ /** Reads the TXO record and following CONTINUE records containing string and formatting. */
+ void ReadTxo( XclImpStream& rStrm );
+
+ /** Reads a BIFF3-BIFF5 NOTE record. */
+ void ReadNote3( XclImpStream& rStrm );
+ /** Reads a BIFF8 NOTE record. */
+ void ReadNote8( XclImpStream& rStrm );
+
+ /** Returns the size of the progress bar shown while processing all objects. */
+ sal_Size GetProgressSize() const;
// ------------------------------------------------------------------------
private:
+ typedef ::std::map< sal_Size, XclImpDrawObjRef > XclImpObjMap;
+ typedef ::std::map< XclObjId, XclImpDrawObjRef > XclImpObjMapById;
+ typedef boost::shared_ptr< XclImpObjTextData > XclImpObjTextRef;
+ typedef ::std::map< sal_Size, XclImpObjTextRef > XclImpObjTextMap;
+ typedef ::std::vector< XclObjId > XclObjIdVec;
+
typedef ::std::map< sal_uInt16, String > DefObjNameMap;
- typedef ScfRef< XclImpSheetDrawing > XclImpSheetDrawingRef;
+ typedef boost::shared_ptr< XclImpSheetDrawing > XclImpSheetDrawingRef;
typedef ::std::map< SCTAB, XclImpSheetDrawingRef > XclImpSheetDrawingMap;
+ com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxOleCtrlNameOverride;
DefObjNameMap maDefObjNames; /// Default base names for all object types.
SvMemoryStream maDggStrm; /// Copy of global DFF data (DGG container) in memory.
XclImpSheetDrawingMap maSheetDrawings; /// Drawing managers of all sheets.
@@ -1273,3 +1312,4 @@ XclImpStream& operator>>( XclImpStream& rStrm, XclImpDffPropSet& rPropSet );
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xiformula.hxx b/sc/source/filter/inc/xiformula.hxx
index 6151222746cd..b245fe92cee1 100644
--- a/sc/source/filter/inc/xiformula.hxx
+++ b/sc/source/filter/inc/xiformula.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include "xlformula.hxx"
#include "xiroot.hxx"
+#include <boost/shared_ptr.hpp>
// Formula compiler ===========================================================
@@ -58,7 +60,7 @@ public:
const ScTokenArray* CreateFormula( XclFormulaType eType, const XclTokenArray& rXclTokArr );
private:
- typedef ScfRef< XclImpFmlaCompImpl > XclImpFmlaCompImplRef;
+ typedef boost::shared_ptr< XclImpFmlaCompImpl > XclImpFmlaCompImplRef;
XclImpFmlaCompImplRef mxImpl;
};
@@ -66,3 +68,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx
index 6b638762502d..90b9d8c88c50 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,9 @@
#define SC_XIHELPER_HXX
#include <editeng/editdata.hxx>
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
#include "scmatrix.hxx"
#include "xladdress.hxx"
#include "xiroot.hxx"
@@ -70,13 +74,6 @@ public:
// cell range -------------------------------------------------------------
- /** Checks if the passed cell range is valid (checks start and end position).
- @param rXclRange The Excel cell range to check.
- @param bWarn true = Sets the internal flag that produces a warning box
- after loading/saving the file, if the cell range is not valid.
- @return true = Cell range in rXclRange is valid. */
- bool CheckRange( const XclRange& rXclRange, bool bWarn );
-
/** Converts the passed Excel cell range to a Calc cell range.
@param rScRange (Out) The converted Calc cell range, if valid.
@param rXclRange The Excel cell range to convert.
@@ -86,25 +83,8 @@ public:
bool ConvertRange( ScRange& rScRange, const XclRange& rXclRange,
SCTAB nScTab1, SCTAB nScTab2, bool bWarn );
-//UNUSED2009-05 /** Returns a valid cell range by moving it into allowed dimensions.
-//UNUSED2009-05 @descr The start and/or end position of the range may be modified.
-//UNUSED2009-05 @param rXclRange The Excel cell range to convert.
-//UNUSED2009-05 @param bWarn true = Sets the internal flag that produces a warning box
-//UNUSED2009-05 after loading/saving the file, if the cell range contains invalid cells.
-//UNUSED2009-05 @return The converted Calc cell range. */
-//UNUSED2009-05 ScRange CreateValidRange( const XclRange& rXclRange,
-//UNUSED2009-05 SCTAB nScTab1, SCTAB nScTab2, bool bWarn );
-
// cell range list --------------------------------------------------------
-//UNUSED2009-05 /** Checks if the passed cell range list is valid.
-//UNUSED2009-05 @param rXclRanges The Excel cell range list to check.
-//UNUSED2009-05 @param bWarn true = Sets the internal flag that produces a warning box
-//UNUSED2009-05 after loading/saving the file, if the cell range list contains at
-//UNUSED2009-05 least one invalid range.
-//UNUSED2009-05 @return true = Cell range list in rScRanges is completly valid. */
-//UNUSED2009-05 bool CheckRangeList( const XclRangeList& rXclRanges, bool bWarn );
-
/** Converts the passed Excel cell range list to a Calc cell range list.
@descr The start position of the ranges will not be modified. Cell
ranges that fit partly into valid dimensions are cropped
@@ -127,7 +107,7 @@ class EditTextObject;
/** This class provides methods to convert an XclImpString.
@The string can be converted to an edit engine text object or directly
to a Calc edit cell. */
-class XclImpStringHelper : ScfNoInstance
+class XclImpStringHelper : boost::noncopyable
{
public:
/** Returns a new edit engine text object.
@@ -136,18 +116,17 @@ public:
const XclImpRoot& rRoot,
const XclImpString& rString );
-//UNUSED2009-05 /** Returns a new edit engine text object for a cell note.
-//UNUSED2009-05 @param nXFIndex Index to XF for first text portion (for escapement). */
-//UNUSED2009-05 static EditTextObject* CreateNoteObject(
-//UNUSED2009-05 const XclImpRoot& rRoot,
-//UNUSED2009-05 const XclImpString& rString );
-
/** Creates a new text cell or edit cell for a Calc document.
@param nXFIndex Index to XF for first text portion (for escapement). */
static ScBaseCell* CreateCell(
const XclImpRoot& rRoot,
const XclImpString& rString,
sal_uInt16 nXFIndex = 0 );
+private:
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static methods. To enforce this, the default constructor
+ is made private */
+ XclImpStringHelper();
};
// Header/footer conversion ===================================================
@@ -187,7 +166,7 @@ struct XclFontData;
Known but unsupported control sequences:
&G picture
*/
-class XclImpHFConverter : protected XclImpRoot, ScfNoCopy
+class XclImpHFConverter : protected XclImpRoot, private boost::noncopyable
{
public:
explicit XclImpHFConverter( const XclImpRoot& rRoot );
@@ -210,7 +189,7 @@ private: // types
/** Contains all information about a header/footer portion. */
struct XclImpHFPortionInfo
{
- typedef ScfRef< EditTextObject > EditTextObjectRef;
+ typedef boost::shared_ptr< EditTextObject > EditTextObjectRef;
EditTextObjectRef mxObj; /// Edit engine text object.
ESelection maSel; /// Edit engine selection.
sal_Int32 mnHeight; /// Height of previous lines in twips.
@@ -272,7 +251,7 @@ private:
/** This class contains static methods to decode an URL stored in an Excel file.
@descr Excel URLs can contain a sheet name, for instance: path\[test.xls]Sheet1
This sheet name will be extracted automatically. */
-class XclImpUrlHelper : ScfNoInstance
+class XclImpUrlHelper : boost::noncopyable
{
public:
/** Decodes an encoded external document URL with optional sheet name.
@@ -302,6 +281,12 @@ public:
For OLE object links: Decodes to class name and document URL.
@return true = decoding was successful, returned strings are valid (not empty). */
static bool DecodeLink( String& rApplic, String& rTopic, const String rEncUrl );
+
+private:
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static methods. To enforce this, the default constructor
+ is made private */
+ XclImpUrlHelper();
};
// Cached values ==============================================================
@@ -310,7 +295,7 @@ class ScTokenArray;
/** This class stores one cached value of a cached value list (used for instance in
CRN, EXTERNNAME, tArray). */
-class XclImpCachedValue : ScfNoCopy
+class XclImpCachedValue : boost::noncopyable
{
public:
/** Creates a cached value and reads contents from stream and stores it with its array address. */
@@ -356,7 +341,7 @@ public:
ScMatrixRef CreateScMatrix() const;
private:
- typedef ScfDelList< XclImpCachedValue > XclImpValueList;
+ typedef boost::ptr_vector< XclImpCachedValue > XclImpValueList;
XclImpValueList maValueList; /// List of cached cell values.
SCSIZE mnScCols; /// Number of cached columns.
@@ -367,3 +352,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xilink.hxx b/sc/source/filter/inc/xilink.hxx
index dbbb4606114e..2f06ddb2f7b0 100644
--- a/sc/source/filter/inc/xilink.hxx
+++ b/sc/source/filter/inc/xilink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -208,3 +209,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xiname.hxx b/sc/source/filter/inc/xiname.hxx
index b5d9ca642d4f..8d05d680d690 100644
--- a/sc/source/filter/inc/xiname.hxx
+++ b/sc/source/filter/inc/xiname.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
#ifndef SC_XINAME_HXX
#define SC_XINAME_HXX
-#include <map>
+#include <boost/ptr_container/ptr_vector.hpp>
#include "xlname.hxx"
#include "xiroot.hxx"
@@ -90,7 +91,7 @@ public:
const XclImpName* GetName( sal_uInt16 nXclNameIdx ) const;
private:
- typedef ScfDelList< XclImpName > XclImpNameList;
+ typedef boost::ptr_vector< XclImpName > XclImpNameList;
XclImpNameList maNameList;
};
@@ -98,3 +99,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xipage.hxx b/sc/source/filter/inc/xipage.hxx
index 0571e10e7046..5f8e7c6b3f70 100644
--- a/sc/source/filter/inc/xipage.hxx
+++ b/sc/source/filter/inc/xipage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,3 +81,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xipivot.hxx b/sc/source/filter/inc/xipivot.hxx
index edac8a0fd99f..86fc881d04e7 100644
--- a/sc/source/filter/inc/xipivot.hxx
+++ b/sc/source/filter/inc/xipivot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,7 @@
#include <list>
#include "xlpivot.hxx"
#include "xiroot.hxx"
+#include <boost/shared_ptr.hpp>
class ScDPSaveData;
class ScDPSaveDimension;
@@ -65,7 +67,7 @@ private:
void ReadSxempty( XclImpStream& rStrm );
};
-typedef ScfRef< XclImpPCItem > XclImpPCItemRef;
+typedef boost::shared_ptr< XclImpPCItem > XclImpPCItemRef;
// ============================================================================
@@ -89,8 +91,6 @@ public:
/** Returns the base field if this is a grouping field. */
const XclImpPCField* GetGroupBaseField() const;
- /** Returns the number of items of this field. */
- sal_uInt16 GetItemCount() const;
/** Returns the item at the specified position or 0 on error. */
const XclImpPCItem* GetItem( sal_uInt16 nItemIdx ) const;
/** Returns the item representing a limit value in numeric/date/time grouping fields.
@@ -152,7 +152,7 @@ private:
bool mbNumGroupInfoRead; /// true = Numeric grouping info read (SXNUMGROUP record).
};
-typedef ScfRef< XclImpPCField > XclImpPCFieldRef;
+typedef boost::shared_ptr< XclImpPCField > XclImpPCFieldRef;
// ============================================================================
@@ -167,6 +167,8 @@ public:
/** Returns the data source range read from the DCONREF record. */
inline const ScRange& GetSourceRange() const { return maSrcRange; }
+ const ::rtl::OUString& GetSourceRangeName() const { return maSrcRangeName; }
+
/** Returns the number of pivot cache fields. */
sal_uInt16 GetFieldCount() const;
/** Returns read-only access to a pivot cache field. */
@@ -180,10 +182,16 @@ public:
void ReadSxvs( XclImpStream& rStrm );
/** Reads a DCONREF record containing the source range of the pivot cache. */
void ReadDconref( XclImpStream& rStrm );
+ /**
+ * Read DECONNAME record which contains the defined name of the source
+ * range.
+ */
+ void ReadDConName( XclImpStream& rStrm );
/** Reads the entire pivot cache stream. Uses decrypter from passed stream. */
void ReadPivotCacheStream( XclImpStream& rStrm );
bool IsRefreshOnLoad() const;
+ bool IsValid() const;
private:
typedef ::std::vector< XclImpPCFieldRef > XclImpPCFieldVec;
@@ -193,12 +201,13 @@ private:
ScRange maSrcRange; /// Source range in the spreadsheet.
String maUrl; /// URL of the source data.
String maTabName; /// Sheet name of the source data.
+ ::rtl::OUString maSrcRangeName; /// Name of the source data range.
sal_uInt16 mnStrmId; /// Pivot cache stream identifier.
sal_uInt16 mnSrcType; /// Source data type.
bool mbSelfRef; /// true = Source data from own document.
};
-typedef ScfRef< XclImpPivotCache > XclImpPivotCacheRef;
+typedef boost::shared_ptr< XclImpPivotCache > XclImpPivotCacheRef;
// ============================================================================
// Pivot table
@@ -229,7 +238,7 @@ private:
const XclImpPCField* mpCacheField; /// Corresponding pivot cache field.
};
-typedef ScfRef< XclImpPTItem > XclImpPTItemRef;
+typedef boost::shared_ptr< XclImpPTItem > XclImpPTItemRef;
// ============================================================================
@@ -251,8 +260,6 @@ public:
const XclImpPTItem* GetItem( sal_uInt16 nItemIdx ) const;
/** Returns the internal name of the specified item. */
const String* GetItemName( sal_uInt16 nItemIdx ) const;
- /** Returns the displayed name of the specified item. */
- const String* GetVisItemName( sal_uInt16 nItemIdx ) const;
/** Returns the flags of the axes this field is part of. */
inline sal_uInt16 GetAxes() const { return maFieldInfo.mnAxes; }
@@ -308,7 +315,7 @@ private:
XclImpPTItemVec maItems; /// List of all items of this field.
};
-typedef ScfRef< XclImpPTField > XclImpPTFieldRef;
+typedef boost::shared_ptr< XclImpPTField > XclImpPTFieldRef;
// ============================================================================
@@ -384,7 +391,7 @@ private:
ScDPObject* mpDPObj;
};
-typedef ScfRef< XclImpPivotTable > XclImpPivotTableRef;
+typedef boost::shared_ptr< XclImpPivotTable > XclImpPivotTableRef;
// ============================================================================
// ============================================================================
@@ -411,6 +418,7 @@ public:
void ReadSxvs( XclImpStream& rStrm );
/** Reads a DCONREF record containing the source range of a pivot cache. */
void ReadDconref( XclImpStream& rStrm );
+ void ReadDConName( XclImpStream& rStrm );
// pivot table records ----------------------------------------------------
@@ -455,3 +463,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xiroot.hxx b/sc/source/filter/inc/xiroot.hxx
index c5cf284d2d2e..653d39c7e1d0 100644
--- a/sc/source/filter/inc/xiroot.hxx
+++ b/sc/source/filter/inc/xiroot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,14 @@
#define SC_XIROOT_HXX
#include "xlroot.hxx"
+#include <boost/shared_ptr.hpp>
// Forward declarations of objects in public use ==============================
class XclImpStream;
class XclImpString;
-typedef ScfRef< XclImpString > XclImpStringRef;
+typedef boost::shared_ptr< XclImpString > XclImpStringRef;
// Global data ================================================================
@@ -53,6 +55,7 @@ class XclImpLinkManager;
class XclImpObjectManager;
class XclImpSheetDrawing;
class XclImpCondFormatManager;
+class XclImpValidationManager;
class XclImpAutoFilterBuffer;
class XclImpWebQueryBuffer;
class XclImpPivotTableManager;
@@ -68,27 +71,28 @@ class ExcelToSc;
/** Stores global buffers and data needed for Excel import filter. */
struct XclImpRootData : public XclRootData
{
- typedef ScfRef< XclImpAddressConverter > XclImpAddrConvRef;
- typedef ScfRef< XclImpFormulaCompiler > XclImpFmlaCompRef;
-
- typedef ScfRef< XclImpSst > XclImpSstRef;
- typedef ScfRef< XclImpPalette > XclImpPaletteRef;
- typedef ScfRef< XclImpFontBuffer > XclImpFontBfrRef;
- typedef ScfRef< XclImpNumFmtBuffer > XclImpNumFmtBfrRef;
- typedef ScfRef< XclImpXFBuffer > XclImpXFBfrRef;
- typedef ScfRef< XclImpXFRangeBuffer > XclImpXFRangeBfrRef;
- typedef ScfRef< XclImpTabInfo > XclImpTabInfoRef;
- typedef ScfRef< XclImpNameManager > XclImpNameMgrRef;
- typedef ScfRef< XclImpLinkManager > XclImpLinkMgrRef;
- typedef ScfRef< XclImpObjectManager > XclImpObjectMgrRef;
- typedef ScfRef< XclImpCondFormatManager > XclImpCondFmtMgrRef;
- typedef ScfRef< XclImpWebQueryBuffer > XclImpWebQueryBfrRef;
- typedef ScfRef< XclImpPivotTableManager > XclImpPTableMgrRef;
- typedef ScfRef< XclImpPageSettings > XclImpPageSettRef;
- typedef ScfRef< XclImpDocViewSettings > XclImpDocViewSettRef;
- typedef ScfRef< XclImpTabViewSettings > XclImpTabViewSettRef;
- typedef ScfRef< XclImpSheetProtectBuffer > XclImpTabProtectRef;
- typedef ScfRef< XclImpDocProtectBuffer > XclImpDocProtectRef;
+ typedef boost::shared_ptr< XclImpAddressConverter > XclImpAddrConvRef;
+ typedef boost::shared_ptr< XclImpFormulaCompiler > XclImpFmlaCompRef;
+
+ typedef boost::shared_ptr< XclImpSst > XclImpSstRef;
+ typedef boost::shared_ptr< XclImpPalette > XclImpPaletteRef;
+ typedef boost::shared_ptr< XclImpFontBuffer > XclImpFontBfrRef;
+ typedef boost::shared_ptr< XclImpNumFmtBuffer > XclImpNumFmtBfrRef;
+ typedef boost::shared_ptr< XclImpXFBuffer > XclImpXFBfrRef;
+ typedef boost::shared_ptr< XclImpXFRangeBuffer > XclImpXFRangeBfrRef;
+ typedef boost::shared_ptr< XclImpTabInfo > XclImpTabInfoRef;
+ typedef boost::shared_ptr< XclImpNameManager > XclImpNameMgrRef;
+ typedef boost::shared_ptr< XclImpLinkManager > XclImpLinkMgrRef;
+ typedef boost::shared_ptr< XclImpObjectManager > XclImpObjectMgrRef;
+ typedef boost::shared_ptr< XclImpCondFormatManager > XclImpCondFmtMgrRef;
+ typedef boost::shared_ptr< XclImpValidationManager > XclImpValidationMgrRef;
+ typedef boost::shared_ptr< XclImpWebQueryBuffer > XclImpWebQueryBfrRef;
+ typedef boost::shared_ptr< XclImpPivotTableManager > XclImpPTableMgrRef;
+ typedef boost::shared_ptr< XclImpPageSettings > XclImpPageSettRef;
+ typedef boost::shared_ptr< XclImpDocViewSettings > XclImpDocViewSettRef;
+ typedef boost::shared_ptr< XclImpTabViewSettings > XclImpTabViewSettRef;
+ typedef boost::shared_ptr< XclImpSheetProtectBuffer > XclImpTabProtectRef;
+ typedef boost::shared_ptr< XclImpDocProtectBuffer > XclImpDocProtectRef;
XclImpAddrConvRef mxAddrConv; /// The address converter.
XclImpFmlaCompRef mxFmlaComp; /// The formula compiler.
@@ -106,6 +110,7 @@ struct XclImpRootData : public XclRootData
XclImpObjectMgrRef mxObjMgr; /// All drawing objects.
XclImpCondFmtMgrRef mxCondFmtMgr; /// Conditional formattings.
+ XclImpValidationMgrRef mxValidMgr; /// Data validation
XclImpWebQueryBfrRef mxWebQueryBfr; /// All web queries.
XclImpPTableMgrRef mxPTableMgr; /// All pivot tables and pivot caches.
@@ -182,6 +187,8 @@ public:
XclImpSheetDrawing& GetCurrSheetDrawing() const;
/** Returns the conditional formattings manager. */
XclImpCondFormatManager& GetCondFormatManager() const;
+
+ XclImpValidationManager& GetValidationManager() const;
/** Returns the filter manager. */
XclImpAutoFilterBuffer& GetFilterManager() const;
/** Returns the web query buffer. */
@@ -211,9 +218,11 @@ public:
void ReadCodeName( XclImpStream& rStrm, bool bGlobals );
private:
- mutable XclImpRootData& mrImpData; /// Reference to the global import data struct.
+ XclImpRootData& mrImpData; /// Reference to the global import data struct.
};
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx
index 4aec7c337a32..238997e7a000 100644
--- a/sc/source/filter/inc/xistream.hxx
+++ b/sc/source/filter/inc/xistream.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include <comphelper/docpasswordhelper.hxx>
#include <filter/msfilter/mscodec.hxx>
+#include <boost/shared_ptr.hpp>
#include "xlstream.hxx"
#include "xlconst.hxx"
@@ -47,7 +49,7 @@ Input stream class for Excel import
// ============================================================================
class XclImpDecrypter;
-typedef ScfRef< XclImpDecrypter > XclImpDecrypterRef;
+typedef boost::shared_ptr< XclImpDecrypter > XclImpDecrypterRef;
/** Base class for BIFF stream decryption. */
class XclImpDecrypter : public ::comphelper::IDocPasswordVerifier
@@ -310,8 +312,6 @@ public:
/** Seeks to last position from user position stack.
@descr This position will be removed from the stack. */
void PopPosition();
-//UNUSED2008-05 /** Removes last position from user position stack, but does not seek to it. */
-//UNUSED2008-05 void RejectPosition();
/** Stores current position. This position keeps valid in all records. */
void StoreGlobalPosition();
@@ -342,13 +342,11 @@ public:
XclImpStream& operator>>( float& rfValue );
XclImpStream& operator>>( double& rfValue );
- sal_Int8 ReadInt8();
sal_uInt8 ReaduInt8();
sal_Int16 ReadInt16();
sal_uInt16 ReaduInt16();
sal_Int32 ReadInt32();
sal_uInt32 ReaduInt32();
- float ReadFloat();
double ReadDouble();
/** Reads nBytes bytes to the existing(!) buffer pData.
@@ -422,8 +420,6 @@ public:
void IgnoreUniString( sal_uInt16 nChars, sal_uInt8 nFlags );
/** Ignores 8 bit flags, ext. header, nChar characters, ext. data. */
void IgnoreUniString( sal_uInt16 nChars );
- /** Ignores 16 bit character count, 8 bit flags, ext. header, character array, ext. data. */
- void IgnoreUniString();
// *** read/ignore 8-bit-strings, store in String *** ---------------------
@@ -533,3 +529,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xistring.hxx b/sc/source/filter/inc/xistring.hxx
index a6f00d26d2e2..f76e3af4321c 100644
--- a/sc/source/filter/inc/xistring.hxx
+++ b/sc/source/filter/inc/xistring.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index abe08c9eb945..5c74d82ee295 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,9 @@
#include <list>
#include <tools/mempool.hxx>
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
#include "rangelst.hxx"
#include "patattr.hxx"
#include "xladdress.hxx"
@@ -37,6 +41,7 @@
#include "xiroot.hxx"
class ScDocumentPool;
+struct ScAttrEntry;
/* ============================================================================
- Buffers for style records (PALETTE, FONT, FORMAT, XF)
@@ -72,8 +77,10 @@ public:
void ReadPalette( XclImpStream& rStrm );
private:
+ void ExportPalette();
typedef ::std::vector< ColorData > ColorDataVec;
ColorDataVec maColorTable; /// Colors read from file.
+ const XclImpRoot& mrRoot;
};
// FONT record - font information =============================================
@@ -167,7 +174,7 @@ private:
// ----------------------------------------------------------------------------
/** Stores the data of all fonts occurred in an Excel file. */
-class XclImpFontBuffer : protected XclImpRoot, ScfNoCopy
+class XclImpFontBuffer : protected XclImpRoot, private boost::noncopyable
{
public:
explicit XclImpFontBuffer( const XclImpRoot& rRoot );
@@ -205,15 +212,15 @@ private:
void UpdateAppFont( const XclFontData& rFontData, bool bHasCharSet );
private:
- ScfDelList< XclImpFont > maFontList; /// List of all FONT records in the Excel file.
- XclFontData maAppFont; /// Application font (for column width).
- XclImpFont maFont4; /// Built-in font with index 4.
- XclImpFont maCtrlFont; /// BIFF5 default form controls font (Helv,8pt,bold).
+ boost::ptr_vector< XclImpFont > maFontList; /// List of all FONT records in the Excel file.
+ XclFontData maAppFont; /// Application font (for column width).
+ XclImpFont maFont4; /// Built-in font with index 4.
+ XclImpFont maCtrlFont; /// BIFF5 default form controls font (Helv,8pt,bold).
};
// FORMAT record - number formats =============================================
-/** Stores all user defined number formats occured in the file. */
+/** Stores all user defined number formats occurred in the file. */
class XclImpNumFmtBuffer : public XclNumFmtBuffer, protected XclImpRoot
{
public:
@@ -391,7 +398,7 @@ inline bool operator!=( const XclImpXFIndex& rLeft, const XclImpXFIndex& rRight
// ----------------------------------------------------------------------------
/** Contains all data of a XF record and a Calc item set. */
-class XclImpXF : public XclXFBase, protected XclImpRoot, ScfNoCopy
+class XclImpXF : public XclXFBase, protected XclImpRoot, private boost::noncopyable
{
public:
explicit XclImpXF( const XclImpRoot& rRoot );
@@ -409,14 +416,9 @@ public:
@return A read-only reference to the item set stored internally. */
const ScPatternAttr& CreatePattern( bool bSkipPoolDefs = false );
- /** Inserts all formatting attributes to the specified area in the Calc document.
- @param nForcedNumFmt If not set to NUMBERFORMAT_ENTRY_NOT_FOUND, it will overwrite
- the number format of the XF. */
- void ApplyPattern(
- SCCOL nScCol1, SCROW nScRow1,
- SCCOL nScCol2, SCROW nScRow2,
- SCTAB nScTab,
- sal_uLong nForceScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND );
+ void ApplyPatternToAttrList(
+ ::std::list<ScAttrEntry>& rAttrs, SCROW nRow1, SCROW nRow2,
+ sal_uInt32 nForceScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND);
private:
void ReadXF2( XclImpStream& rStrm );
@@ -482,9 +484,9 @@ private:
// ----------------------------------------------------------------------------
-/** Contains all XF records occured in the file.
+/** Contains all XF records occurred in the file.
@descr This class is able to read XF records (BIFF2 - BIFF8) and STYLE records (BIFF8). */
-class XclImpXFBuffer : protected XclImpRoot, ScfNoCopy
+class XclImpXFBuffer : protected XclImpRoot, private boost::noncopyable
{
public:
explicit XclImpXFBuffer( const XclImpRoot& rRoot );
@@ -498,8 +500,11 @@ public:
void ReadStyle( XclImpStream& rStrm );
/** Returns the object that stores all contents of an XF record. */
- inline XclImpXF* GetXF( sal_uInt16 nXFIndex ) const
- { return maXFList.GetObject( nXFIndex ); }
+ inline XclImpXF* GetXF( sal_uInt16 nXFIndex )
+ { return (nXFIndex >= maXFList.size()) ? NULL : &maXFList.at(nXFIndex); }
+
+ inline const XclImpXF* GetXF( sal_uInt16 nXFIndex ) const
+ { return (nXFIndex >= maXFList.size()) ? NULL : &maXFList.at(nXFIndex); }
/** Returns the index to the Excel font used in the specified XF record. */
sal_uInt16 GetFontIndex( sal_uInt16 nXFIndex ) const;
@@ -512,19 +517,11 @@ public:
@return The pointer to the cell style sheet, or 0, if there is no style sheet. */
ScStyleSheet* CreateStyleSheet( sal_uInt16 nXFIndex );
- /** Inserts formatting attributes from an XF to the specified area in the Calc document.
- @param nForcedNumFmt If not set to NUMBERFORMAT_ENTRY_NOT_FOUND, it will overwrite
- the number format of the XF. */
- void ApplyPattern(
- SCCOL nScCol1, SCROW nScRow1,
- SCCOL nScCol2, SCROW nScRow2,
- SCTAB nScTab, const XclImpXFIndex& rXFIndex );
-
private:
- typedef ScfDelList< XclImpStyle > XclImpStyleList;
+ typedef boost::ptr_vector< XclImpStyle > XclImpStyleList;
typedef ::std::map< sal_uInt16, XclImpStyle* > XclImpStyleMap;
- ScfDelList< XclImpXF > maXFList; /// List of contents of all XF record.
+ boost::ptr_vector< XclImpXF > maXFList; /// List of contents of all XF record.
XclImpStyleList maBuiltinStyles; /// List of built-in cell styles.
XclImpStyleList maUserStyles; /// List of user defined cell styles.
XclImpStyleMap maStylesByXf; /// Maps XF records to cell styles.
@@ -576,15 +573,15 @@ inline bool XclImpXFRange::Contains( SCROW nScRow ) const
// ----------------------------------------------------------------------------
/** Contains the XF indexes for every used cell in a column. */
-class XclImpXFRangeColumn : ScfNoCopy
+class XclImpXFRangeColumn : private boost::noncopyable
{
public:
+ typedef ::boost::ptr_vector<XclImpXFRange> IndexList;
+
inline explicit XclImpXFRangeColumn() {}
- /** Returns the first formatted cell range in this column. */
- inline XclImpXFRange* First() { return maIndexList.First(); }
- /** Returns the next formatted cell range in this column. */
- inline XclImpXFRange* Next() { return maIndexList.Next(); }
+ IndexList::iterator begin() { return maIndexList.begin(); }
+ IndexList::iterator end() { return maIndexList.end(); }
/** Inserts a single row range into the list. */
void SetDefaultXF( const XclImpXFIndex& rXFIndex );
@@ -599,21 +596,24 @@ private:
XclImpXFRange*& rpPrevRange,
XclImpXFRange*& rpNextRange,
sal_uLong& rnNextIndex,
- SCROW nScRow ) const;
+ SCROW nScRow );
/** Tries to concatenate a range with its predecessor.
@descr The ranges must have the same XF index and must not have a gap.
The resulting range has the index nIndex-1. */
void TryConcatPrev( sal_uLong nIndex );
+ /** Insert a range into the list at the specified index. */
+ void Insert(XclImpXFRange* pXFRange, sal_uLong nIndex);
+
private:
- ScfDelList< XclImpXFRange > maIndexList; /// The list of XF index range.
+ IndexList maIndexList; /// The list of XF index range.
};
// ----------------------------------------------------------------------------
/** Contains the XF indexes for every used cell in a single sheet. */
-class XclImpXFRangeBuffer : protected XclImpRoot, ScfNoCopy
+class XclImpXFRangeBuffer : protected XclImpRoot, private boost::noncopyable
{
public:
explicit XclImpXFRangeBuffer( const XclImpRoot& rRoot );
@@ -666,10 +666,10 @@ private:
void SetBorderLine( const ScRange& rRange, SCTAB nScTab, sal_uInt16 nLine );
private:
- typedef ScfRef< XclImpXFRangeColumn > XclImpXFRangeColumnRef;
- typedef ::std::vector< XclImpXFRangeColumnRef > XclImpXFRangeColumnVec;
- typedef ::std::pair< XclRange, String > XclImpHyperlinkRange;
- typedef ::std::list< XclImpHyperlinkRange > XclImpHyperlinkList;
+ typedef boost::shared_ptr< XclImpXFRangeColumn > XclImpXFRangeColumnRef;
+ typedef ::std::vector< XclImpXFRangeColumnRef > XclImpXFRangeColumnVec;
+ typedef ::std::pair< XclRange, String > XclImpHyperlinkRange;
+ typedef ::std::list< XclImpHyperlinkRange > XclImpHyperlinkList;
XclImpXFRangeColumnVec maColumns; /// Array of column XF index buffers.
XclImpHyperlinkList maHyperlinks; /// Maps URLs to hyperlink cells.
@@ -680,3 +680,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xiview.hxx b/sc/source/filter/inc/xiview.hxx
index 2451d69ee01c..29c3f98bbb04 100644
--- a/sc/source/filter/inc/xiview.hxx
+++ b/sc/source/filter/inc/xiview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xladdress.hxx b/sc/source/filter/inc/xladdress.hxx
index 0ac5ca3031a4..2152c19913c2 100644
--- a/sc/source/filter/inc/xladdress.hxx
+++ b/sc/source/filter/inc/xladdress.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -195,3 +196,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 925b1d14e805..51fe688a857e 100755..100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,7 @@
#include <map>
#include <tools/gen.hxx>
#include "fapihelper.hxx"
+#include <boost/shared_ptr.hpp>
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
@@ -841,8 +843,8 @@ class EscherPropertyContainer;
struct XclChEscherFormat
{
- typedef ScfRef< SfxItemSet > SfxItemSetRef;
- typedef ScfRef< EscherPropertyContainer > EscherPropSetRef;
+ typedef boost::shared_ptr< SfxItemSet > SfxItemSetRef;
+ typedef boost::shared_ptr< EscherPropertyContainer > EscherPropSetRef;
SfxItemSetRef mxItemSet; /// Item set for Escher properties import.
EscherPropSetRef mxEscherSet; /// Container for Escher properties export.
@@ -1480,9 +1482,9 @@ private:
/** Base struct for internal root data structs for import and export. */
struct XclChRootData
{
- typedef ScfRef< XclChTypeInfoProvider > XclChTypeProvRef;
- typedef ScfRef< XclChFormatInfoProvider > XclChFmtInfoProvRef;
- typedef ScfRef< XclChObjectTable > XclChObjectTableRef;
+ typedef boost::shared_ptr< XclChTypeInfoProvider > XclChTypeProvRef;
+ typedef boost::shared_ptr< XclChFormatInfoProvider > XclChFmtInfoProvRef;
+ typedef boost::shared_ptr< XclChObjectTable > XclChObjectTableRef;
typedef ::std::map< XclChTextKey, XclChGetShapeFunc > XclChGetShapeFuncMap;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
@@ -1520,3 +1522,4 @@ struct XclChRootData
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlconst.hxx b/sc/source/filter/inc/xlconst.hxx
index ac0e42496b63..207d8cb392b8 100644
--- a/sc/source/filter/inc/xlconst.hxx
+++ b/sc/source/filter/inc/xlconst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -175,27 +176,21 @@ const sal_uInt16 EXC_BOF_WORKSPACE = 0x0100; /// Workspace.
const sal_uInt16 EXC_BOF_UNKNOWN = 0xFFFF; /// Internal use only.
// (0x000A) EOF ---------------------------------------------------------------
-
const sal_uInt16 EXC_ID_EOF = 0x000A;
// (0x0012) PROTECT -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_PROTECT = 0x0012;
// (0x0013) PASSWORD ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_PASSWORD = 0x0013;
// (0x0019) WINDOWPROTECT -----------------------------------------------------
-
const sal_uInt16 EXC_ID_WINDOWPROTECT = 0x0019;
// (0x0042) CODEPAGE ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_CODEPAGE = 0x0042;
// (0x0081) WSBOOL ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_WSBOOL = 0x0081;
const sal_uInt16 EXC_WSBOOL_ROWBELOW = 0x0040;
@@ -205,59 +200,46 @@ const sal_uInt16 EXC_WSBOOL_FITTOPAGE = 0x0100;
const sal_uInt16 EXC_WSBOOL_DEFAULTFLAGS = 0x04C1;
// (0x0086) WRITEPROT ---------------------------------------------------------
-
const sal_uInt16 EXC_ID_WRITEPROT = 0x0086;
// (0x008C) COUNTRY -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_COUNTRY = 0x008C;
// (0x009B) FILTERMODE --------------------------------------------------------
-
const sal_uInt16 EXC_ID_FILTERMODE = 0x009B;
// (0x009C) FNGROUPCOUNT ------------------------------------------------------
-
const sal_uInt16 EXC_ID_FNGROUPCOUNT = 0x009C;
// (0x009D) AUTOFILTERINFO ----------------------------------------------------
-
const sal_uInt16 EXC_ID_AUTOFILTERINFO = 0x009D;
// (0x009E) AUTOFILTER --------------------------------------------------------
-
const sal_uInt16 EXC_ID_AUTOFILTER = 0x009E;
// (0x00BF, 0x00C0, 0x00C1) TOOLBARHDR, TOOLBAREND, MMS -----------------------
-
const sal_uInt16 EXC_ID_TOOLBARHDR = 0x00BF;
const sal_uInt16 EXC_ID_TOOLBAREND = 0x00C0;
const sal_uInt16 EXC_ID_MMS = 0x00C1;
// (0x00E1, 0x00E2) INTERFACEHDR, INTERFACEEND --------------------------------
-
const sal_uInt16 EXC_ID_INTERFACEHDR = 0x00E1;
const sal_uInt16 EXC_ID_INTERFACEEND = 0x00E2;
// (0x0160) USESELFS ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_USESELFS = 0x0160;
// (0x0161) DSF ---------------------------------------------------------------
-
const sal_uInt16 EXC_ID_DSF = 0x0161;
// (0x01AA,0x01AB) USERSVIEWBEGIN, USERSVIEWEND -------------------------------
-
const sal_uInt16 EXC_ID_USERSVIEWBEGIN = 0x01AA;
const sal_uInt16 EXC_ID_USERSVIEWEND = 0x01AB;
// (0x01BA) CODENAME ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_CODENAME = 0x01BA;
// (0x01C0) XL9FILE -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_XL9FILE = 0x01C0;
// (0x8xx) Future records -----------------------------------------------------
@@ -277,3 +259,4 @@ const sal_uInt16 EXC_FUTUREREC_ALERT = 0x0002;
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx
index 41e916472e70..ae8f5c7dc7fd 100644
--- a/sc/source/filter/inc/xlcontent.hxx
+++ b/sc/source/filter/inc/xlcontent.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -192,3 +193,4 @@ const sal_uInt16 EXC_ID_WQTABLES = 0x0804;
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index cba56eeccc9e..b0c41ff320ee 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -441,10 +442,11 @@ public:
/** Tries to extract an Excel macro name from the passed macro descriptor. */
static String ExtractFromMacroDescriptor(
const ::com::sun::star::script::ScriptEventDescriptor& rDescriptor,
- XclTbxEventType eEventType );
+ XclTbxEventType eEventType, SfxObjectShell* pShell = NULL );
};
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlformula.hxx b/sc/source/filter/inc/xlformula.hxx
index 974265d00985..1f9cf30909e9 100644
--- a/sc/source/filter/inc/xlformula.hxx
+++ b/sc/source/filter/inc/xlformula.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include <formula/opcode.hxx>
#include "address.hxx"
#include "ftools.hxx"
+#include <boost/shared_ptr.hpp>
// Constants ==================================================================
@@ -408,7 +410,7 @@ private:
bool mbVolatile; /// True = Formula contains volatile function.
};
-typedef ScfRef< XclTokenArray > XclTokenArrayRef;
+typedef boost::shared_ptr< XclTokenArray > XclTokenArrayRef;
/** Calls the Read() function at the passed token array. */
XclImpStream& operator>>( XclImpStream& rStrm, XclTokenArray& rTokArr );
@@ -567,3 +569,4 @@ inline void XclTokenArrayHelper::ChangeTokenClass( sal_uInt8& rnTokenId, sal_uIn
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xllink.hxx b/sc/source/filter/inc/xllink.hxx
index 3e41fb350acb..760df8173055 100644
--- a/sc/source/filter/inc/xllink.hxx
+++ b/sc/source/filter/inc/xllink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,3 +92,4 @@ enum XclSupbookType
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlname.hxx b/sc/source/filter/inc/xlname.hxx
index 5bfcf9164892..4fbafb280f03 100644
--- a/sc/source/filter/inc/xlname.hxx
+++ b/sc/source/filter/inc/xlname.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,3 +74,4 @@ const sal_Unicode EXC_BUILTIN_UNKNOWN = '\x0E';
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlpage.hxx b/sc/source/filter/inc/xlpage.hxx
index f6860595cd20..4c7412ab9171 100644
--- a/sc/source/filter/inc/xlpage.hxx
+++ b/sc/source/filter/inc/xlpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#define SC_XLPAGE_HXX
#include <tools/gen.hxx>
+#include <boost/noncopyable.hpp>
#include "xltools.hxx"
// Constants and Enumerations =================================================
@@ -89,6 +91,7 @@ const sal_uInt16 EXC_SETUP_STARTPAGE = 0x0080;
const sal_uInt16 EXC_SETUP_NOTES_END = 0x0200;
const sal_uInt16 EXC_PAPERSIZE_DEFAULT = 0;
+const sal_uInt16 EXC_PAPERSIZE_USER = 0xFFFF;
// ============================================================================
@@ -98,7 +101,7 @@ class SvxBrushItem;
class SfxPrinter;
/** Contains all page (print) settings for a single sheet. */
-struct XclPageData : ScfNoCopy
+struct XclPageData : private boost::noncopyable
{
typedef ::std::auto_ptr< SvxBrushItem > SvxBrushItemPtr;
@@ -118,6 +121,9 @@ struct XclPageData : ScfNoCopy
double mfFtrLeftMargin; /// Left margin to footer.
double mfFtrRightMargin; /// Right margin to footer.
sal_uInt16 mnPaperSize; /// Index into paper size table.
+ sal_uInt16 mnStrictPaperSize; /// Same as papersize - but for ooxml (considering stricter dimensions)
+ sal_uInt16 mnPaperWidth; /// Paper Width in mm
+ sal_uInt16 mnPaperHeight; /// Paper Height in mm
sal_uInt16 mnCopies; /// Number of copies.
sal_uInt16 mnStartPage; /// Start page number.
sal_uInt16 mnScaling; /// Scaling in percent.
@@ -147,10 +153,11 @@ struct XclPageData : ScfNoCopy
/** Returns the real paper size (twips) from the paper size index and paper orientation. */
Size GetScPaperSize() const;
/** Sets the Excel paper size index and paper orientation from Calc paper size (twips). */
- void SetScPaperSize( const Size& rSize, bool bPortrait );
+ void SetScPaperSize( const Size& rSize, bool bPortrait, bool bStrict = false );
};
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlpivot.hxx b/sc/source/filter/inc/xlpivot.hxx
index 61218f51307c..560e18a19a2b 100644
--- a/sc/source/filter/inc/xlpivot.hxx
+++ b/sc/source/filter/inc/xlpivot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,7 +120,6 @@ const sal_uInt16 EXC_SXVIEW_DATALAST = 0xFFFF;
const sal_uInt16 EXC_SXVIEW_AUTOFMT = 0x0001;
// (0x00B1) SXVD --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXVD = 0x00B1;
const sal_uInt16 EXC_SXVD_AXIS_NONE = 0x0000;
@@ -147,7 +147,6 @@ const sal_uInt16 EXC_SXVD_SUBT_VARP = 0x0800;
const sal_uInt16 EXC_SXVD_DEFAULT_CACHE = EXC_PC_NOFIELD;
// (0x00B2) SXVI --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXVI = 0x00B2;
const sal_uInt16 EXC_SXVI_TYPE_PAGE = 0x00FE;
@@ -176,22 +175,18 @@ const sal_uInt16 EXC_SXVI_MISSING = 0x0008;
const sal_uInt16 EXC_SXVI_DEFAULT_CACHE = EXC_PC_NOFIELD;
// (0x00B4) SXIVD -------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXIVD = 0x00B4;
const sal_uInt16 EXC_SXIVD_DATA = 0xFFFE;
// (0x00B5) SXLI --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXLI = 0x00B5;
const sal_uInt16 EXC_SXLI_DEFAULTFLAGS = 0x0000;
// (0x00B6) SXPI --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXPI = 0x00B6;
const sal_uInt16 EXC_SXPI_ALLITEMS = 0x7FFD;
// (0x00C5) SXDI --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXDI = 0x00C5;
const sal_uInt16 EXC_SXDI_FUNC_SUM = 0x0000;
@@ -220,7 +215,6 @@ const sal_uInt16 EXC_SXDI_PREVITEM = 0x7FFB;
const sal_uInt16 EXC_SXDI_NEXTITEM = 0x7FFC;
// (0x00C6) SXDB --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXDB = 0x00C6;
const sal_uInt16 EXC_SXDB_SAVEDATA = 0x0001;
@@ -239,7 +233,6 @@ const sal_uInt16 EXC_SXDB_SRC_CONSOLID = 0x0004;
const sal_uInt16 EXC_SXDB_SRC_SCENARIO = 0x0008;
// (0x00C7) SXFIELD -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXFIELD = 0x00C7;
const sal_uInt16 EXC_SXFIELD_HASITEMS = 0x0001;
@@ -267,43 +260,33 @@ const sal_uInt16 EXC_SXFIELD_INDEX_MAX = 1; /// List index for maxim
const sal_uInt16 EXC_SXFIELD_INDEX_STEP = 2; /// List index for step item in groupings.
// (0x00C8) SXINDEXLIST -------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXINDEXLIST = 0x00C8;
// (0x00C9) SXDOUBLE ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXDOUBLE = 0x00C9;
// (0x00CA) SXBOOLEAN ---------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXBOOLEAN = 0x00CA;
// (0x00CB) SXERROR -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXERROR = 0x00CB;
// (0x00CC) SXINTEGER ---------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXINTEGER = 0x00CC;
// (0x00CD) SXSTRING ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXSTRING = 0x00CD;
// (0x00CE) SXDATETIME --------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXDATETIME = 0x00CE;
// (0x00CF) SXEMPTY -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXEMPTY = 0x00CF;
// (0x00D5) SXIDSTM -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXIDSTM = 0x00D5;
// (0x00D8) SXNUMGROUP --------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXNUMGROUP = 0x00D8;
const sal_uInt16 EXC_SXNUMGROUP_AUTOMIN = 0x0001;
@@ -319,15 +302,12 @@ const sal_uInt16 EXC_SXNUMGROUP_TYPE_YEAR = 7;
const sal_uInt16 EXC_SXNUMGROUP_TYPE_NUM = 8;
// (0x00D9) SXGROUPINFO -------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXGROUPINFO = 0x00D9;
// (0x00DC) SXEXT -------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXEXT = 0x00DC;
// (0x00E3) SXVS --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXVS = 0x00E3;
const sal_uInt16 EXC_SXVS_UNKNOWN = 0x0000;
@@ -338,38 +318,30 @@ const sal_uInt16 EXC_SXVS_PIVOTTAB = 0x0008;
const sal_uInt16 EXC_SXVS_SCENARIO = 0x0010;
// (0x00F0) SXRULE ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXRULE = 0x00F0;
// (0x00F1) SXEX --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXEX = 0x00F1;
const sal_uInt32 EXC_SXEX_DRILLDOWN = 0x00020000;
const sal_uInt32 EXC_SXEX_DEFAULTFLAGS = 0x004F0200;
// (0x00F2) SXFILT ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXFILT = 0x00F2;
// (0x00F5) -------------------------------------------------------------------
-
const sal_uInt16 EXC_ID_00F5 = 0x00F5; /// Unknown record
// (0x00F6) SXNAME ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXNAME = 0x00F6;
// (0x00F8) SXPAIR ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXPAIR = 0x00F8;
// (0x00F9) SXFMLA ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXFMLA = 0x00F9;
// (0x0100) SXVDEX ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXVDEX = 0x0100;
const sal_uInt32 EXC_SXVDEX_SHOWALL = 0x00000001;
@@ -387,16 +359,13 @@ const sal_uInt16 EXC_SXVDEX_SHOW_NONE = 0xFFFF;
const sal_uInt16 EXC_SXVDEX_FORMAT_NONE = 0x0000;
// (0x0103) SXFORMULA ---------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXFORMULA = 0x0103;
// (0x0122) SXDBEX ------------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXDBEX = 0x0122;
const double EXC_SXDBEX_CREATION_DATE = 51901.029652778;
// (0x01BB) SXFDBTYPE ---------------------------------------------------------
-
const sal_uInt16 EXC_ID_SXFDBTYPE = 0x01BB;
const sal_uInt16 EXC_SXFDBTYPE_DEFAULT = 0x0000;
@@ -527,9 +496,6 @@ public:
/** Returns true, if this is a standard field build directly from source data. */
bool IsStandardField() const;
-//UNUSED2008-05 /** Returns true, if the items of the field are calculated from a formula. */
-//UNUSED2008-05 bool IsCalculatedField() const;
-
/** Returns true, if this field is a grouping field. */
bool IsStdGroupField() const;
/** Returns true, if this field is a numeric grouping field. */
@@ -815,3 +781,4 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo );
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index af42efcdb426..53d9535c87b7 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <sot/storage.hxx>
#include "xlconst.hxx"
#include "xltools.hxx"
+#include <boost/shared_ptr.hpp>
namespace comphelper { class IDocPasswordVerifier; }
@@ -77,14 +79,14 @@ struct XclRootData
: public XclDebugObjCounter
#endif
{
- typedef ScfRef< ScEditEngineDefaulter > ScEEDefaulterRef;
- typedef ScfRef< ScHeaderEditEngine > ScHeaderEERef;
- typedef ScfRef< EditEngine > EditEngineRef;
- typedef ScfRef< XclFontPropSetHelper > XclFontPropSetHlpRef;
- typedef ScfRef< XclChPropSetHelper > XclChPropSetHlpRef;
- typedef ScfRef< ScExtDocOptions > ScExtDocOptRef;
- typedef ScfRef< XclTracer > XclTracerRef;
- typedef ScfRef< RootData > RootDataRef;
+ typedef boost::shared_ptr< ScEditEngineDefaulter > ScEEDefaulterRef;
+ typedef boost::shared_ptr< ScHeaderEditEngine > ScHeaderEERef;
+ typedef boost::shared_ptr< EditEngine > EditEngineRef;
+ typedef boost::shared_ptr< XclFontPropSetHelper > XclFontPropSetHlpRef;
+ typedef boost::shared_ptr< XclChPropSetHelper > XclChPropSetHlpRef;
+ typedef boost::shared_ptr< ScExtDocOptions > ScExtDocOptRef;
+ typedef boost::shared_ptr< XclTracer > XclTracerRef;
+ typedef boost::shared_ptr< RootData > RootDataRef;
XclBiff meBiff; /// Current BIFF version.
XclOutput meOutput; /// Current Output format.
@@ -186,6 +188,9 @@ public:
/** Calculates the height of the passed number of pixels in 1/100 mm. */
sal_Int32 GetHmmFromPixelY( double fPixelY ) const;
+ double GetPixelXFromHmm( sal_Int32 nX ) const;
+ double GetPixelYFromHmm( sal_Int32 nY ) const;
+
/** Returns the medium to import from. */
inline SfxMedium& GetMedium() const { return mrData.mrMedium; }
/** Returns the document URL of the imported/exported file. */
@@ -285,10 +290,11 @@ public:
inline void IncCurrScTab() { ++mrData.mnScTab; }
private:
- mutable XclRootData& mrData; /// Reference to the global data struct.
+ XclRootData& mrData; /// Reference to the global data struct.
};
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlstream.hxx b/sc/source/filter/inc/xlstream.hxx
index 0a9074371c33..e83b1068fc09 100644
--- a/sc/source/filter/inc/xlstream.hxx
+++ b/sc/source/filter/inc/xlstream.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ const sal_uInt16 EXC_ID_CONT = 0x003C;
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlstring.hxx b/sc/source/filter/inc/xlstring.hxx
index 5ee505e25024..15adf3f919d9 100644
--- a/sc/source/filter/inc/xlstring.hxx
+++ b/sc/source/filter/inc/xlstring.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,3 +96,4 @@ typedef ::std::vector< XclFormatRun > XclFormatRunVec;
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx
index abbcc921cc64..793576339c2f 100644
--- a/sc/source/filter/inc/xlstyle.hxx
+++ b/sc/source/filter/inc/xlstyle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,9 +49,12 @@ class XclRoot;
const sal_uInt8 EXC_LINE_NONE = 0x00;
const sal_uInt8 EXC_LINE_THIN = 0x01;
const sal_uInt8 EXC_LINE_MEDIUM = 0x02;
+const sal_uInt8 EXC_LINE_DASHED = 0x03;
+const sal_uInt8 EXC_LINE_DOTTED = 0x04;
const sal_uInt8 EXC_LINE_THICK = 0x05;
const sal_uInt8 EXC_LINE_DOUBLE = 0x06;
const sal_uInt8 EXC_LINE_HAIR = 0x07;
+const sal_uInt8 EXC_LINE_MEDIUMDASHED = 0x08;
// Background patterns --------------------------------------------------------
@@ -377,8 +381,6 @@ struct XclFontData
void SetApiHeight( float fPoint );
/** Sets the API font family. */
void SetApiFamily( sal_Int16 nApiFamily );
-//UNUSED2009-05 /** Sets the API font text encoding. */
-//UNUSED2009-05 void SetApiFontEncoding( sal_Int16 nApiFontEnc );
/** Sets the API font posture. */
void SetApiPosture( ::com::sun::star::awt::FontSlant eApiPosture );
/** Sets the API font weight. */
@@ -475,9 +477,6 @@ protected:
/** Returns the current number format map. */
inline const XclNumFmtMap& GetFormatMap() const { return maFmtMap; }
-//UNUSED2008-05 /** Returns the number format with the specified Excel format index. */
-//UNUSED2008-05 const XclNumFmt* GetFormat( sal_uInt16 nXclNumFmt ) const;
-
/** Inserts a new number format for the specified Excel format index. */
void InsertFormat( sal_uInt16 nXclNumFmt, const String& rFormat );
@@ -521,8 +520,12 @@ struct XclCellAlign
/** Returns the Calc horizontal alignment. */
SvxCellHorJustify GetScHorAlign() const;
+ /** Returns horizontal justification method as Calc's attribute. */
+ SvxCellJustifyMethod GetScHorJustifyMethod() const;
/** Returns the Calc vertical alignment. */
SvxCellVerJustify GetScVerAlign() const;
+ /** Returns vertical justification method as Calc's attribute. */
+ SvxCellJustifyMethod GetScVerJustifyMethod() const;
/** Returns the Calc frame direction. */
SvxFrameDirection GetScFrameDir() const;
@@ -617,3 +620,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xltable.hxx b/sc/source/filter/inc/xltable.hxx
index 6b8f650568a9..a671d8f25329 100644
--- a/sc/source/filter/inc/xltable.hxx
+++ b/sc/source/filter/inc/xltable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,33 +39,27 @@ const sal_uInt8 EXC_OUTLINE_MAX = 7;
const sal_uInt8 EXC_OUTLINE_COUNT = EXC_OUTLINE_MAX + 1;
// (0x0000, 0x0200) DIMENSIONS ------------------------------------------------
-
const sal_uInt16 EXC_ID2_DIMENSIONS = 0x0000;
const sal_uInt16 EXC_ID3_DIMENSIONS = 0x0200;
// (0x0001, 0x0201) BLANK -----------------------------------------------------
-
const sal_uInt16 EXC_ID2_BLANK = 0x0001;
const sal_uInt16 EXC_ID3_BLANK = 0x0201;
// (0x0002) INTEGER -----------------------------------------------------------
-
const sal_uInt16 EXC_ID2_INTEGER = 0x0002;
// (0x0003, 0x0203) NUMBER ----------------------------------------------------
-
const sal_uInt16 EXC_ID2_NUMBER = 0x0003;
const sal_uInt16 EXC_ID3_NUMBER = 0x0203;
// (0x0004, 0x0204) LABEL -----------------------------------------------------
-
const sal_uInt16 EXC_ID2_LABEL = 0x0004;
const sal_uInt16 EXC_ID3_LABEL = 0x0204;
const sal_uInt8 EXC_LABEL_MAXLEN = 0xFF;
// (0x0005, 0x0205) BOOLERR ---------------------------------------------------
-
const sal_uInt16 EXC_ID2_BOOLERR = 0x0005;
const sal_uInt16 EXC_ID3_BOOLERR = 0x0205;
@@ -72,7 +67,6 @@ const sal_uInt8 EXC_BOOLERR_BOOL = 0x00;
const sal_uInt8 EXC_BOOLERR_ERROR = 0x01;
// (0x0006, 0x0206, 0x0406) FORMULA -------------------------------------------
-
const sal_uInt16 EXC_ID2_FORMULA = 0x0006;
const sal_uInt16 EXC_ID3_FORMULA = 0x0206;
const sal_uInt16 EXC_ID4_FORMULA = 0x0406;
@@ -88,12 +82,10 @@ const sal_uInt8 EXC_FORMULA_RES_ERROR = 0x02; /// Result is error code
const sal_uInt8 EXC_FORMULA_RES_EMPTY = 0x03; /// Result is empty cell (BIFF8 only).
// (0x0007, 0x0207) STRING ----------------------------------------------------
-
const sal_uInt16 EXC_ID2_STRING = 0x0007;
const sal_uInt16 EXC_ID3_STRING = 0x0207;
// (0x0008, 0x0208) ROW -------------------------------------------------------
-
const sal_uInt16 EXC_ID2_ROW = 0x0008;
const sal_uInt16 EXC_ID3_ROW = 0x0208;
@@ -112,11 +104,9 @@ const sal_uInt16 EXC_ROW_HEIGHTMASK = 0x7FFF;
const sal_uInt16 EXC_ROW_ROWBLOCKSIZE = 32; /// Number of rows in a row block.
// (0x0020) COLUMNDEFAULT -----------------------------------------------------
-
const sal_uInt16 EXC_ID_COLUMNDEFAULT = 0x0020;
// (0x0021, 0x0221) ARRAY -----------------------------------------------------
-
const sal_uInt16 EXC_ID2_ARRAY = 0x0021;
const sal_uInt16 EXC_ID3_ARRAY = 0x0221;
@@ -125,11 +115,9 @@ const sal_uInt16 EXC_ARRAY_RECALC_ONLOAD = 0x0002;
const sal_uInt16 EXC_ARRAY_DEFAULTFLAGS = EXC_ARRAY_RECALC_ONLOAD;
// (0x0024) COLWIDTH ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_COLWIDTH = 0x0024;
// (0x0025, 0x0225) DEFAULTROWHEIGHT ------------------------------------------
-
const sal_uInt16 EXC_ID2_DEFROWHEIGHT = 0x0025;
const sal_uInt16 EXC_ID3_DEFROWHEIGHT = 0x0225;
@@ -142,7 +130,6 @@ const sal_uInt16 EXC_DEFROW_DEFAULTFLAGS = 0x0000;
const sal_uInt16 EXC_DEFROW_DEFAULTHEIGHT = 255;
// (0x0036, 0x0236) TABLEOP ---------------------------------------------------
-
const sal_uInt16 EXC_ID2_TABLEOP = 0x0036;
const sal_uInt16 EXC_ID3_TABLEOP = 0x0236;
@@ -153,50 +140,41 @@ const sal_uInt16 EXC_TABLEOP_BOTH = 0x0008;
const sal_uInt16 EXC_TABLEOP_DEFAULTFLAGS = EXC_TABLEOP_RECALC_ONLOAD;
// (0x0037) TABLEOP2 ----------------------------------------------------------
-
const sal_uInt16 EXC_ID2_TABLEOP2 = 0x0037;
// (0x0055) DEFCOLWIDTH -------------------------------------------------------
-
const sal_uInt16 EXC_ID_DEFCOLWIDTH = 0x0055;
const sal_uInt16 EXC_DEFCOLWIDTH_DEF = 10;
// (0x007D) COLINFO -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_COLINFO = 0x007D;
const sal_uInt16 EXC_COLINFO_HIDDEN = 0x0001;
const sal_uInt16 EXC_COLINFO_COLLAPSED = 0x1000;
// (0x0080) GUTS --------------------------------------------------------------
-
const sal_uInt16 EXC_ID_GUTS = 0x0080;
// (0x00BD) MULRK -------------------------------------------------------------
-
const sal_uInt16 EXC_ID_MULRK = 0x00BD;
// (0x00BE) MULBLANK ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_MULBLANK = 0x00BE;
// (0x00D6) RSTRING -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_RSTRING = 0x00D6;
// (0x00FD) LABELSST ----------------------------------------------------------
-
const sal_uInt16 EXC_ID_LABELSST = 0x00FD;
// (0x027E) RK ----------------------------------------------------------------
-
const sal_uInt16 EXC_ID_RK = 0x027E;
// (0x04BC) SHRFMLA -----------------------------------------------------------
-
const sal_uInt16 EXC_ID_SHRFMLA = 0x04BC;
// ============================================================================
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx
index f97bf1f68259..bfe284f198da 100644
--- a/sc/source/filter/inc/xltools.hxx
+++ b/sc/source/filter/inc/xltools.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include "address.hxx"
#include "ftools.hxx"
+#include <boost/noncopyable.hpp>
class SfxObjectShell;
@@ -88,7 +90,7 @@ class SvStream;
class ScDocument;
/** This class contains static helper methods for the Excel import and export filters. */
-class XclTools : ScfNoInstance
+class XclTools : boost::noncopyable
{
public:
// GUID's -----------------------------------------------------------------
@@ -249,6 +251,11 @@ private:
static const String maCFStyleNamePrefix2; /// Prefix for cond. formatting style names from OOX filter.
static const ::rtl::OUString maSbMacroPrefix; /// Prefix for StarBasic macros.
static const ::rtl::OUString maSbMacroSuffix; /// Suffix for StarBasic macros.
+
+ /** We don't want anybody to instantiate this class, since it is just a
+ collection of static items. To enforce this, the default constructor
+ is made private */
+ XclTools();
};
// read/write colors ----------------------------------------------------------
@@ -265,3 +272,4 @@ XclExpStream& operator<<( XclExpStream& rStrm, const Color& rColor );
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xltracer.hxx b/sc/source/filter/inc/xltracer.hxx
index 73ed3d0502c3..ba177fd3706f 100644
--- a/sc/source/filter/inc/xltracer.hxx
+++ b/sc/source/filter/inc/xltracer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -124,7 +125,6 @@ public:
void TraceChartOnlySheet();
void TraceChartDataTable();
void TraceChartLegendPosition();
- void TraceChartEmbeddedObj();
void TraceUnsupportedObjects();
void TraceObjectNotPrintable();
void TraceDVType(bool bType);
@@ -146,3 +146,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xlview.hxx b/sc/source/filter/inc/xlview.hxx
index 98661ca41331..f05a21594c45 100644
--- a/sc/source/filter/inc/xlview.hxx
+++ b/sc/source/filter/inc/xlview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include <tools/color.hxx>
#include "ftools.hxx"
#include "xladdress.hxx"
+#include <boost/shared_ptr.hpp>
// Constants and enumerations =================================================
@@ -121,7 +123,7 @@ struct XclSelectionData
inline explicit XclSelectionData() : mnCursorIdx( 0 ) {}
};
-typedef ScfRef< XclSelectionData > XclSelectionDataRef;
+typedef boost::shared_ptr< XclSelectionData > XclSelectionDataRef;
// ----------------------------------------------------------------------------
@@ -152,7 +154,7 @@ struct XclTabViewData
bool mbShowZeros; /// true = Show zero value zells.
bool mbShowOutline; /// true = Show outlines.
Color maTabBgColor; /// Tab Color default = (COL_AUTO )
- bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? sal_True : sal_False; };
+ bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? sal_True : false; };
sal_uInt32 mnTabBgColorId; /// pallette color id
explicit XclTabViewData();
@@ -176,3 +178,4 @@ struct XclTabViewData
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/expop.cxx b/sc/source/filter/lotus/expop.cxx
index 9b21fc8be8fc..e1bd599c29cd 100644
--- a/sc/source/filter/lotus/expop.cxx
+++ b/sc/source/filter/lotus/expop.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -398,7 +399,7 @@ FltError ExportWK1::Write()
case CELLTYPE_NONE:
break;
default:
- DBG_ASSERT( sal_False, "ExportWK1::Write(): unbekannter Celltype!" );
+ DBG_ASSERT( false, "ExportWK1::Write(): unbekannter Celltype!" );
}
}
while( aIter.GetNext() );
@@ -410,3 +411,4 @@ FltError ExportWK1::Write()
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/export.cxx b/sc/source/filter/lotus/export.cxx
index a9be45e24f23..5ca8cc7c6f49 100644
--- a/sc/source/filter/lotus/export.cxx
+++ b/sc/source/filter/lotus/export.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,4 @@ FltError ScFormatFilterPluginImpl::ScExportLotus123( SvStream& aStream, ScDocume
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx
index 802cdd627189..c3f53b5eb615 100644
--- a/sc/source/filter/lotus/filter.cxx
+++ b/sc/source/filter/lotus/filter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -224,7 +225,7 @@ FltError ScImportLotus123old( SvStream& aStream, ScDocument* pDocument, CharSet
// Zeiger auf Dokument global machen
pDoc = pDocument;
- bEOF = sal_False;
+ bEOF = false;
eCharVon = eSrc;
@@ -246,3 +247,4 @@ FltError ScImportLotus123old( SvStream& aStream, ScDocument* pDocument, CharSet
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx
index 809ac336a371..928b06fe0378 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,65 +29,39 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include "lotattr.hxx"
+#include <boost/bind.hpp>
-//------------------------------------------------------------------------
-
-#include "scitems.hxx"
-#include <svx/algitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brshitem.hxx>
+#include <editeng/justifyitem.hxx>
+#include <svx/algitem.hxx>
-#include "document.hxx"
-#include "patattr.hxx"
-#include "docpool.hxx"
#include "attrib.hxx"
-
-#include "lotattr.hxx"
+#include "docpool.hxx"
+#include "document.hxx"
#include "lotfntbf.hxx"
+#include "patattr.hxx"
#include "root.hxx"
+#include "scitems.hxx"
-
-
-void LotAttrCache::LotusToScBorderLine( sal_uInt8 nLine, SvxBorderLine& aBL )
+LotAttrCache::ENTRY::ENTRY (const ScPatternAttr &r)
+ : pPattAttr(new ScPatternAttr(r))
{
- static const sal_uInt16 pPara[ 4 ][ 3 ] =
- {
- { 0,0,0 },
- { DEF_LINE_WIDTH_1, 0, 0 },
- { DEF_LINE_WIDTH_2, 0, 0 },
- { DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1 }
- };
-
- nLine &= 0x03;
-
- if( nLine )
- {
- aBL.SetOutWidth( pPara[ nLine ][ 0 ] );
- aBL.SetInWidth( pPara[ nLine ][ 1 ] );
- aBL.SetDistance( pPara[ nLine ][ 2 ] );
- }
}
-
-const SvxColorItem& LotAttrCache::GetColorItem( const sal_uInt8 nLotIndex ) const
+LotAttrCache::ENTRY::ENTRY (ScPatternAttr* p)
+ : pPattAttr(p)
{
- DBG_ASSERT( nLotIndex > 0 && nLotIndex < 7,
- "-LotAttrCache::GetColorItem(): so nicht!" );
-
- return *ppColorItems[ nLotIndex - 1 ];
}
-
-const Color& LotAttrCache::GetColor( const sal_uInt8 nLotIndex ) const
+LotAttrCache::ENTRY::~ENTRY ()
{
- // Farbe <-> Index passt fuer Background, nicht aber fuer Fonts (0 <-> 7)!
- DBG_ASSERT( nLotIndex < 8, "*LotAttrCache::GetColor(): Index > 7!" );
- return pColTab[ nLotIndex ];
+ delete pPattAttr;
}
-
-LotAttrCache::LotAttrCache( void )
+LotAttrCache::LotAttrCache ()
{
pDocPool = pLotusRoot->pDoc->GetPool();
@@ -114,15 +89,7 @@ LotAttrCache::LotAttrCache( void )
LotAttrCache::~LotAttrCache()
{
- ENTRY* pAkt = ( ENTRY* ) List::First();
-
- while( pAkt )
- {
- delete pAkt;
- pAkt = ( ENTRY* ) List::Next();
- }
-
- for( sal_uInt16 nCnt = 0 ; nCnt < 6 ; nCnt++ )
+ for( UINT16 nCnt = 0 ; nCnt < 6 ; nCnt++ )
delete ppColorItems[ nCnt ];
delete pBlack;
@@ -135,22 +102,19 @@ LotAttrCache::~LotAttrCache()
const ScPatternAttr& LotAttrCache::GetPattAttr( const LotAttrWK3& rAttr )
{
sal_uInt32 nRefHash;
- ENTRY* pAkt = ( ENTRY* ) List::First();
-
MakeHash( rAttr, nRefHash );
- while( pAkt )
- {
- if( *pAkt == nRefHash )
- return *pAkt->pPattAttr;
+ boost::ptr_vector<ENTRY>::const_iterator iter = std::find_if(aEntries.begin(),aEntries.end(),
+ boost::bind(&ENTRY::nHash0,_1) == nRefHash);
- pAkt = ( ENTRY* ) List::Next();
- }
+ if (iter != aEntries.end())
+ return *(iter->pPattAttr);
// neues PatternAttribute erzeugen
- ScPatternAttr* pNewPatt = new ScPatternAttr( pDocPool );
+ ScPatternAttr* pNewPatt = new ScPatternAttr(pDocPool);
+
SfxItemSet& rItemSet = pNewPatt->GetItemSet();
- pAkt = new ENTRY( pNewPatt );
+ ENTRY *pAkt = new ENTRY( pNewPatt );
pAkt->nHash0 = nRefHash;
@@ -198,43 +162,75 @@ const ScPatternAttr& LotAttrCache::GetPattAttr( const LotAttrWK3& rAttr )
rItemSet.Put( aHorJustify );
}
- List::Insert( pAkt, LIST_APPEND );
+ aEntries.push_back(pAkt);
return *pNewPatt;
- }
+}
+
+
+void LotAttrCache::LotusToScBorderLine( UINT8 nLine, SvxBorderLine& aBL )
+{
+ static const UINT16 pPara[ 4 ][ 3 ] =
+ {
+ { 0,0,0 },
+ { DEF_LINE_WIDTH_1, 0, 0 },
+ { DEF_LINE_WIDTH_2, 0, 0 },
+ { DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_1 }
+ };
+
+ nLine &= 0x03;
+ if( nLine )
+ {
+ aBL.SetOutWidth( pPara[ nLine ][ 0 ] );
+ aBL.SetInWidth( pPara[ nLine ][ 1 ] );
+ aBL.SetDistance( pPara[ nLine ][ 2 ] );
+ }
+}
-LotAttrCol::~LotAttrCol()
+const SvxColorItem& LotAttrCache::GetColorItem( const UINT8 nLotIndex ) const
{
- Clear();
+ DBG_ASSERT( nLotIndex > 0 && nLotIndex < 7,
+ "-LotAttrCache::GetColorItem(): so nicht!" );
+
+ return *ppColorItems[ nLotIndex - 1 ];
}
+const Color& LotAttrCache::GetColor( const UINT8 nLotIndex ) const
+{
+ // Farbe <-> Index passt fuer Background, nicht aber fuer Fonts (0 <-> 7)!
+ DBG_ASSERT( nLotIndex < 8, "*LotAttrCache::GetColor(): Index > 7!" );
+
+ return pColTab[ nLotIndex ];
+}
void LotAttrCol::SetAttr( const SCROW nRow, const ScPatternAttr& rAttr )
{
DBG_ASSERT( ValidRow(nRow), "*LotAttrCol::SetAttr(): ... und rums?!" );
- ENTRY* pAkt = ( ENTRY* ) List::Last();
+ boost::ptr_vector<ENTRY>::reverse_iterator iterLast = aEntries.rbegin();
- if( pAkt )
+ if(iterLast != aEntries.rend())
{
- if( ( pAkt->nLastRow == nRow - 1 ) && ( &rAttr == pAkt->pPattAttr ) )
- pAkt->nLastRow = nRow;
+ if( ( iterLast->nLastRow == nRow - 1 ) && ( &rAttr == iterLast->pPattAttr ) )
+ iterLast->nLastRow = nRow;
else
{
- pAkt = new ENTRY;
+ ENTRY *pAkt = new ENTRY;
pAkt->pPattAttr = &rAttr;
pAkt->nFirstRow = pAkt->nLastRow = nRow;
- List::Insert( pAkt, LIST_APPEND );
+
+ aEntries.push_back(pAkt);
}
}
else
{ // erster Eintrag
- pAkt = new ENTRY;
+ ENTRY *pAkt = new ENTRY;
pAkt->pPattAttr = &rAttr;
pAkt->nFirstRow = pAkt->nLastRow = nRow;
- List::Insert( pAkt, LIST_APPEND );
+
+ aEntries.push_back(pAkt);
}
}
@@ -242,45 +238,26 @@ void LotAttrCol::SetAttr( const SCROW nRow, const ScPatternAttr& rAttr )
void LotAttrCol::Apply( const SCCOL nColNum, const SCTAB nTabNum, const sal_Bool /*bClear*/ )
{
ScDocument* pDoc = pLotusRoot->pDoc;
- ENTRY* pAkt = ( ENTRY* ) List::First();
-
- while( pAkt )
- {
- pDoc->ApplyPatternAreaTab( nColNum, pAkt->nFirstRow, nColNum, pAkt->nLastRow,
- nTabNum, *pAkt->pPattAttr );
-
- pAkt = ( ENTRY* ) List::Next();
- }
-}
-
-
-void LotAttrCol::Clear( void )
-{
- ENTRY* pAkt = ( ENTRY* ) List::First();
- while( pAkt )
+ boost::ptr_vector<ENTRY>::iterator iter;
+ for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
{
- delete pAkt;
- pAkt = ( ENTRY* ) List::Next();
+ pDoc->ApplyPatternAreaTab(nColNum,iter->nFirstRow,nColNum,iter->nLastRow,
+ nTabNum, *(iter->pPattAttr));
}
}
-LotAttrTable::LotAttrTable( void )
-{
-}
-
-
-LotAttrTable::~LotAttrTable()
+void LotAttrCol::Clear ()
{
+ aEntries.clear();
}
-
void LotAttrTable::SetAttr( const SCCOL nColFirst, const SCCOL nColLast, const SCROW nRow,
const LotAttrWK3& rAttr )
{
- const ScPatternAttr& rPattAttr = aAttrCache.GetPattAttr( rAttr );
- SCCOL nColCnt;
+ const ScPatternAttr &rPattAttr = aAttrCache.GetPattAttr( rAttr );
+ SCCOL nColCnt;
for( nColCnt = nColFirst ; nColCnt <= nColLast ; nColCnt++ )
pCols[ nColCnt ].SetAttr( nRow, rPattAttr );
@@ -289,11 +266,9 @@ void LotAttrTable::SetAttr( const SCCOL nColFirst, const SCCOL nColLast, const S
void LotAttrTable::Apply( const SCTAB nTabNum )
{
- SCCOL nColCnt;
+ SCCOL nColCnt;
for( nColCnt = 0 ; nColCnt <= MAXCOL ; nColCnt++ )
pCols[ nColCnt ].Apply( nColCnt, nTabNum ); // macht auch gleich ein Clear() am Ende
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index ecb7eece8b2d..4284ac68b4c6 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,8 +59,8 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
sal_Int32 nLauf;
TokenId nMerk0, nMerk1;
- sal_Bool bAddIn = sal_False;
- sal_Bool bNeg = sal_False;
+ sal_Bool bAddIn = false;
+ sal_Bool bNeg = false;
DBG_ASSERT( nAnz < 128, "-LotusToSc::DoFunc(): Neee! -so viel kann ich nicht!" );
@@ -165,7 +166,6 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
if( nAnz > 0 )
{
- sal_Int16 nNull = -1; // gibt einen auszulassenden Parameter an
// ACHTUNG: 0 ist der letzte Parameter, nAnz-1 der erste
sal_Int16 nLast = nAnz - 1;
@@ -183,6 +183,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
// [Parameter{;Parameter}]
aPool << eParam[ nLast ];
+ INT16 nNull = -1; // gibt einen auszulassenden Parameter an
for( nLauf = nLast - 1 ; nLauf >= 0 ; nLauf-- )
{
if( nLauf != nNull )
@@ -237,7 +238,7 @@ void LotusToSc::LotusRelToScRel( sal_uInt16 nCol, sal_uInt16 nRow, ScSingleRefDa
}
else
{
- rSRD.SetColRel( sal_False );
+ rSRD.SetColRel( false );
rSRD.nCol = static_cast< SCsCOL >( nCol & 0x00FF );
}
@@ -266,12 +267,12 @@ void LotusToSc::LotusRelToScRel( sal_uInt16 nCol, sal_uInt16 nRow, ScSingleRefDa
nRow &= 0x1FFF;
break;
default:
- DBG_ERROR( "*LotusToSc::LotusRelToScRel(): etwas vergessen...?" );
+ OSL_FAIL( "*LotusToSc::LotusRelToScRel(): etwas vergessen...?" );
}
}
else
{
- rSRD.SetRowRel( sal_False );
+ rSRD.SetRowRel( false );
switch( eTyp )
{
// 5432 1098 7654 3210
@@ -286,7 +287,7 @@ void LotusToSc::LotusRelToScRel( sal_uInt16 nCol, sal_uInt16 nRow, ScSingleRefDa
nRow &= 0x3FFF;
break;
default:
- DBG_ERROR( "*LotusToSc::LotusRelToScRel(): etwas vergessen...?" );
+ OSL_FAIL( "*LotusToSc::LotusRelToScRel(): etwas vergessen...?" );
}
}
@@ -368,7 +369,7 @@ LotusToSc::LotusToSc( SvStream &rStream, CharSet e, sal_Bool b ) :
LotusConverterBase( rStream, 128 )
{
eSrcChar = e;
- bWK3 = sal_False;
+ bWK3 = false;
bWK123 = b;
}
@@ -421,7 +422,7 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
rR.SetTabRel( sal_True );
rR.nTab = aEingPos.Tab();
rR.nRelTab = 0;
- rR.SetFlag3D( sal_False );
+ rR.SetFlag3D( false );
}
aCRD.Ref2 = rR;
@@ -647,7 +648,7 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
}
break;
default:
- DBG_ERROR( "*LotusToSc::Convert(): unbekannter enum!" );
+ OSL_FAIL( "*LotusToSc::Convert(): unbekannter enum!" );
}
}
@@ -2072,3 +2073,4 @@ DefTokenId lcl_KnownAddIn( const ByteString& sTest )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 75ac3bedb585..150fee171646 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
#include "lotimpop.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include "attrib.hxx"
#include "document.hxx"
@@ -48,13 +49,13 @@
#include "lotattr.hxx"
-static vos:: OMutex aLotImpSemaphore;
+static osl::Mutex aLotImpSemaphore;
ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, CharSet eQ ) :
ImportTyp( pDoc, eQ ),
pIn( &aStream ),
- aConv( *pIn, eQ, sal_False )
+ aConv( *pIn, eQ, false )
{
// good point to start locking of import lotus
aLotImpSemaphore.acquire();
@@ -409,7 +410,7 @@ void ImportLotus::_Row( const sal_uInt16 nRecLen )
sal_uInt8 nRepeats;
LotAttrWK3 aAttr;
- sal_Bool bCenter = sal_False;
+ sal_Bool bCenter = false;
SCCOL nCenterStart = 0, nCenterEnd = 0;
Read( nRow );
@@ -455,7 +456,7 @@ void ImportLotus::_Row( const sal_uInt16 nRecLen )
if( bCenter )
{// evtl. alte Center bemachen
pD->DoMerge( static_cast<SCTAB> (nExtTab), nCenterStart, static_cast<SCROW> (nRow), nCenterEnd, static_cast<SCROW> (nRow) );
- bCenter = sal_False;
+ bCenter = false;
}
}
@@ -471,3 +472,4 @@ void ImportLotus::_Row( const sal_uInt16 nRecLen )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index 4e98ab610378..84cb8df148ba 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -196,7 +197,7 @@ FltError ImportLotus::Read()
// -----------------------------------------------------------
#ifdef DBG_UTIL
default:
- DBG_ERROR( "*ImportLotus::Read(): State unbekannt!" );
+ OSL_FAIL( "*ImportLotus::Read(): State unbekannt!" );
eAkt = S_END;
#endif
}
@@ -264,7 +265,7 @@ FltError ImportLotus::Read( SvStream& rIn )
*pIn >> nOp >> nRecLen;
if( pIn->IsEof() )
- bRead = sal_False;
+ bRead = false;
else
{
nNextRec += nRecLen + 4;
@@ -274,13 +275,13 @@ FltError ImportLotus::Read( SvStream& rIn )
case 0x0000: // BOF
if( nRecLen != 26 || !BofFm3() )
{
- bRead = sal_False;
+ bRead = false;
eRet = eERR_FORMAT;
}
break;
case 0x0001: // EOF
- bRead = sal_False;
+ bRead = false;
DBG_ASSERT( nTab == 0,
"-ImportLotus::Read( SvStream& ): Zweimal EOF nicht erlaubt" );
nTab++;
@@ -322,3 +323,4 @@ FltError ImportLotus::Read( SvStream& rIn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx
index 1d48e9b4e63e..050ede83ff1f 100644
--- a/sc/source/filter/lotus/lotus.cxx
+++ b/sc/source/filter/lotus/lotus.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,3 +101,4 @@ FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocum
return eRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/makefile.mk b/sc/source/filter/lotus/makefile.mk
index 8fb2360ea2ca..96e0133af309 100644
--- a/sc/source/filter/lotus/makefile.mk
+++ b/sc/source/filter/lotus/makefile.mk
@@ -40,28 +40,26 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
-SLOFILES = \
+SLOFILES = \
+ $(EXCEPTIONSFILES) \
+ $(SLO)$/optab.obj
+
+EXCEPTIONSFILES = \
+ $(SLO)$/expop.obj \
+ $(SLO)$/export.obj \
$(SLO)$/filter.obj \
- $(SLO)$/lotus.obj \
- $(SLO)$/lotimpop.obj \
- $(SLO)$/lotread.obj \
+ $(SLO)$/lotattr.obj \
$(SLO)$/lotform.obj \
+ $(SLO)$/lotimpop.obj \
+ $(SLO)$/lotread.obj \
+ $(SLO)$/lotus.obj \
$(SLO)$/memory.obj \
$(SLO)$/op.obj \
- $(SLO)$/optab.obj \
- $(SLO)$/tool.obj \
- $(SLO)$/expop.obj \
- $(SLO)$/export.obj \
- $(SLO)$/lotattr.obj
-
-EXCEPTIONSFILES = \
- $(SLO)$/op.obj
+ $(SLO)$/tool.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/filter/lotus/memory.cxx b/sc/source/filter/lotus/memory.cxx
index c2a288819da0..439d2d010521 100644
--- a/sc/source/filter/lotus/memory.cxx
+++ b/sc/source/filter/lotus/memory.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include "scitems.hxx"
#include <svx/algitem.hxx>
+#include <editeng/justifyitem.hxx>
#include "attrib.hxx"
@@ -137,3 +139,4 @@ void MemDelete( void )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 62a171137d14..e5e780355eeb 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,6 +49,7 @@
#include <editeng/postitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include "cell.hxx"
#include "rangenam.hxx"
@@ -57,7 +59,6 @@
#include "op.h"
#include "optab.h"
#include "tool.h"
-//#include "math.h"
#include "decl.h"
#include "lotform.hxx"
#include "lotrange.hxx"
@@ -167,24 +168,7 @@ void OP_Label( SvStream& r, sal_uInt16 n )
delete [] pText;
}
-
-//UNUSED2009-05 void OP_Text( SvStream& r, sal_uInt16 n ) // WK3
-//UNUSED2009-05 {
-//UNUSED2009-05 sal_uInt16 nRow;
-//UNUSED2009-05 sal_uInt8 nCol, nTab;
-//UNUSED2009-05 sal_Char pText[ 256 ];
-//UNUSED2009-05
-//UNUSED2009-05 r >> nRow >> nTab >> nCol;
-//UNUSED2009-05 n -= 4;
-//UNUSED2009-05
-//UNUSED2009-05 r.Read( pText, n );
-//UNUSED2009-05 pText[ n ] = 0; // zur Sicherheit Nullterminator anhaengen
-//UNUSED2009-05
-//UNUSED2009-05 PutFormString( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), static_cast<SCTAB> (nTab), pText );
-//UNUSED2009-05 }
-
-
-void OP_Formula( SvStream& r, sal_uInt16 /*n*/ )
+void OP_Formula( SvStream& r, UINT16 /*n*/ )
{
sal_uInt8 nFormat;
sal_uInt16 nCol, nRow, nFormulaSize;
@@ -198,7 +182,7 @@ void OP_Formula( SvStream& r, sal_uInt16 /*n*/ )
sal_Int32 nBytesLeft = nFormulaSize;
ScAddress aAddress( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab );
- LotusToSc aConv( r, pLotusRoot->eCharsetQ, sal_False );
+ LotusToSc aConv( r, pLotusRoot->eCharsetQ, false );
aConv.Reset( aAddress );
aConv.Convert( pErg, nBytesLeft );
@@ -254,10 +238,10 @@ void OP_NamedRange( SvStream& r, sal_uInt16 /*n*/ )
if( isdigit( *cPuffer ) )
{ // erstes Zeichen im Namen eine Zahl -> 'A' vor Namen setzen
*pAnsi = 'A';
- strcpy( pAnsi + 1, cPuffer ); // #100211# - checked
+ strcpy( pAnsi + 1, cPuffer );
}
else
- strcpy( pAnsi, cPuffer ); // #100211# - checked
+ strcpy( pAnsi, cPuffer );
String aTmp( pAnsi, pLotusRoot->eCharsetQ );
@@ -270,14 +254,12 @@ void OP_NamedRange( SvStream& r, sal_uInt16 /*n*/ )
void OP_SymphNamedRange( SvStream& r, sal_uInt16 /*n*/ )
{
// POST: waren Koordinaten ungueltig, wird nicht gespeichert
- sal_uInt16 nColSt, nRowSt, nColEnd, nRowEnd;
+ UINT16 nColSt, nRowSt, nColEnd, nRowEnd;
sal_uInt8 nType;
- sal_Char* pName;
sal_Char cPuffer[ 32 ];
r.Read( cPuffer, 16 );
cPuffer[ 16 ] = 0;
- pName = cPuffer;
r >> nColSt >> nRowSt >> nColEnd >> nRowEnd >> nType;
@@ -291,10 +273,10 @@ void OP_SymphNamedRange( SvStream& r, sal_uInt16 /*n*/ )
if( isdigit( *cPuffer ) )
{ // erstes Zeichen im Namen eine Zahl -> 'A' vor Namen setzen
*pAnsi = 'A';
- strcpy( pAnsi + 1, cPuffer ); // #100211# - checked
+ strcpy( pAnsi + 1, cPuffer );
}
else
- strcpy( pAnsi, cPuffer ); // #100211# - checked
+ strcpy( pAnsi, cPuffer );
String aTmp( pAnsi, pLotusRoot->eCharsetQ );
ScfTools::ConvertToScDefinedName( aTmp );
@@ -664,7 +646,7 @@ void OP_ApplyPatternArea123( SvStream& rStream )
{
std::map<sal_uInt16, ScPatternAttr>::iterator loc = aLotusPatternPool.find( nData );
- // #126338# apparently, files with invalid index occur in the wild -> don't crash then
+ // apparently, files with invalid index occur in the wild -> don't crash then
DBG_ASSERT( loc != aLotusPatternPool.end(), "invalid format index" );
if ( loc != aLotusPatternPool.end() )
pDoc->ApplyPatternAreaTab( nCol, nRow, nCol + nColCount - 1, nRow + nRowCount - 1, static_cast< SCTAB >( nTab + i ), loc->second );
@@ -682,3 +664,5 @@ void OP_ApplyPatternArea123( SvStream& rStream )
aLotusPatternPool.clear();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/optab.cxx b/sc/source/filter/lotus/optab.cxx
index 503d271a5b74..bf880614d48d 100644
--- a/sc/source/filter/lotus/optab.cxx
+++ b/sc/source/filter/lotus/optab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -246,3 +247,5 @@ OPCODE_FKT pOpFkt123[ FKT_LIMIT123 ] =
NI // 100
};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index 4891447624b6..3688066fcb6a 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include "scitems.hxx"
#include <svx/algitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/zforlist.hxx>
#include <tools/solar.h>
@@ -196,7 +198,7 @@ FormCache::FormCache( ScDocument* pDoc1, sal_uInt8 nNewDefaultFormat )
nDefaultFormat = nNewDefaultFormat;
pFormTable = pDoc1->GetFormatTable();
for( sal_uInt16 nC = 0 ; nC < __nSize ; nC++ )
- bValid[ nC ] = sal_False;
+ bValid[ nC ] = false;
eLanguage = ScGlobal::eLnge;
}
@@ -218,7 +220,7 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
sal_Int16 eType = NUMBERFORMAT_ALL;
sal_uInt32 nIndex1;
sal_uInt32 nHandle;
- sal_Bool bDefault = sal_False;
+ sal_Bool bDefault = false;
//void GenerateFormat( aFormString, eType, COUNTRY_SYSTEM, LANGUAGE_SYSTEM,
// sal_Bool bThousand, sal_Bool IsRed, sal_uInt16 nPrecision, sal_uInt16 nAnzLeading );
@@ -237,49 +239,49 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_NUMBER, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nL, 1 );
+ eLanguage, false, false, nL, 1 );
break;
case 0x01: // Exponentdarstellung (scientific notation)
//fExponent;nL;
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_SCIENTIFIC, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nL, 1 );
+ eLanguage, false, false, nL, 1 );
break;
case 0x02: // Waehrungsdarstellung (currency)
//fMoney;nL;
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_CURRENCY, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nL, 1 );
+ eLanguage, false, false, nL, 1 );
break;
case 0x03: // Prozent
//fPercent;nL;
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_PERCENT, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nL, 1 );
+ eLanguage, false, false, nL, 1 );
break;
case 0x04: // Komma
//fStandard;nL;
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_NUMBER, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_True, sal_False, nL, 1 );
+ eLanguage, sal_True, false, nL, 1 );
break;
case 0x05: // frei
//fStandard;nL;
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_NUMBER, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nL, 1 );
+ eLanguage, false, false, nL, 1 );
break;
case 0x06: // frei
//fStandard;nL;
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_NUMBER, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nL, 1 );
+ eLanguage, false, false, nL, 1 );
nIndex1 = 0;
break;
case 0x07: // Spezialformat
@@ -290,14 +292,14 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_NUMBER, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_True, nSt, 1 );
+ eLanguage, false, sal_True, nSt, 1 );
break;
case 0x01: // generelles Format
//fStandard;nSt;
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_NUMBER, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nSt, 1 );
+ eLanguage, false, false, nSt, 1 );
break;
case 0x02: // Datum: Tag, Monat, Jahr
//fDate;dfDayMonthYearLong;
@@ -369,7 +371,7 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
nIndex1 = pFormTable->GetStandardFormat(
NUMBERFORMAT_NUMBER, eLanguage );
pFormTable->GenerateFormat( aFormString, nIndex1,
- eLanguage, sal_False, sal_False, nL, 1 );
+ eLanguage, false, false, nL, 1 );
nIndex1 = 0;
break;
}
@@ -445,17 +447,17 @@ LotusRangeList::LotusRangeList( void )
pSingRef = &aComplRef.Ref1;
pSingRef->nTab = pSingRef->nRelTab = 0;
- pSingRef->SetColRel( sal_False );
- pSingRef->SetRowRel( sal_False );
+ pSingRef->SetColRel( false );
+ pSingRef->SetRowRel( false );
pSingRef->SetTabRel( sal_True );
- pSingRef->SetFlag3D( sal_False );
+ pSingRef->SetFlag3D( false );
pSingRef = &aComplRef.Ref2;
pSingRef->nTab = pSingRef->nRelTab = 0;
- pSingRef->SetColRel( sal_False );
- pSingRef->SetRowRel( sal_False );
+ pSingRef->SetColRel( false );
+ pSingRef->SetRowRel( false );
pSingRef->SetTabRel( sal_True );
- pSingRef->SetFlag3D( sal_False );
+ pSingRef->SetFlag3D( false );
}
@@ -511,7 +513,7 @@ void LotusRangeList::Append( LotusRange* pLR, const String& rName )
ScRangeData* pData = new ScRangeData(
pLotusRoot->pDoc, rName, aTokArray );
- pLotusRoot->pScRangeName->Insert( pData );
+ pLotusRoot->pScRangeName->insert( pData );
pLR->SetId( nIdCnt );
@@ -564,7 +566,7 @@ void RangeNameBufferWK3::Add( const String& rOrgName, const ScComplexRefData& rC
else
{
pScTokenArray->AddDoubleReference( rCRD );
- pInsert->bSingleRef = sal_False;
+ pInsert->bSingleRef = false;
}
ScRangeData* pData = new ScRangeData( pLotusRoot->pDoc, aScName, *pScTokenArray );
@@ -573,7 +575,7 @@ void RangeNameBufferWK3::Add( const String& rOrgName, const ScComplexRefData& rC
pData->SetIndex( nIntCount );
nIntCount++;
- pLotusRoot->pScRangeName->Insert( pData );
+ pLotusRoot->pScRangeName->insert( pData );
}
@@ -593,7 +595,7 @@ sal_Bool RangeNameBufferWK3::FindRel( const String& rRef, sal_uInt16& rIndex )
pFind = ( ENTRY* ) List::Next();
}
- return sal_False;
+ return false;
}
@@ -616,8 +618,8 @@ sal_Bool RangeNameBufferWK3::FindAbs( const String& rRef, sal_uInt16& rIndex )
ScSingleRefData* pRef = &pFind->aScComplexRefDataRel.Ref1;
pScTokenArray->Clear();
- pRef->SetColRel( sal_False );
- pRef->SetRowRel( sal_False );
+ pRef->SetColRel( false );
+ pRef->SetRowRel( false );
pRef->SetTabRel( sal_True );
if( pFind->bSingleRef )
@@ -625,8 +627,8 @@ sal_Bool RangeNameBufferWK3::FindAbs( const String& rRef, sal_uInt16& rIndex )
else
{
pRef = &pFind->aScComplexRefDataRel.Ref2;
- pRef->SetColRel( sal_False );
- pRef->SetRowRel( sal_False );
+ pRef->SetColRel( false );
+ pRef->SetRowRel( false );
pRef->SetTabRel( sal_True );
pScTokenArray->AddDoubleReference( pFind->aScComplexRefDataRel );
}
@@ -637,7 +639,7 @@ sal_Bool RangeNameBufferWK3::FindAbs( const String& rRef, sal_uInt16& rIndex )
pData->SetIndex( rIndex );
nIntCount++;
- pLotusRoot->pScRangeName->Insert( pData );
+ pLotusRoot->pScRangeName->insert( pData );
}
return sal_True;
@@ -645,7 +647,8 @@ sal_Bool RangeNameBufferWK3::FindAbs( const String& rRef, sal_uInt16& rIndex )
pFind = ( ENTRY* ) List::Next();
}
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/qpro/biff.cxx b/sc/source/filter/qpro/biff.cxx
index 1d490358d315..8aa59a986b99 100644
--- a/sc/source/filter/qpro/biff.cxx
+++ b/sc/source/filter/qpro/biff.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,7 +77,7 @@ bool ScBiffReader::nextRecord()
*mpStream >> mnId >> mnLength;
mnOffset = mpStream->Tell();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "Read record 0x%x length 0x%x at offset 0x%x\n",
(unsigned)mnId, (unsigned)mnLength, (unsigned)mnOffset );
@@ -102,3 +103,4 @@ bool ScBiffReader::nextRecord()
return true;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/qpro/makefile.mk b/sc/source/filter/qpro/makefile.mk
index fa8b018f23b7..f5e66ea0e514 100644
--- a/sc/source/filter/qpro/makefile.mk
+++ b/sc/source/filter/qpro/makefile.mk
@@ -39,17 +39,18 @@ AUTOSEG=true
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/qpro.obj \
+SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
+ $(SLO)$/biff.obj \
+ $(SLO)$/qpro.obj \
$(SLO)$/qproform.obj \
- $(SLO)$/qprostyle.obj \
- $(SLO)$/biff.obj
+ $(SLO)$/qprostyle.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 9a01e1af7e02..9f170d1bf7ec 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,7 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
sal_uInt16 nStyle;
bool bEndOfSheet = false;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "Read sheet (%d)\n", nTab );
#endif
@@ -145,7 +146,7 @@ FltError ScQProReader::import( ScDocument *pDoc )
sal_uInt16 nVersion;
sal_uInt16 i = 1, j = 1;
SCTAB nTab = 0;
- SetEof( sal_False );
+ SetEof( false );
if( !recordsLeft() )
return eERR_OPEN;
@@ -168,7 +169,7 @@ FltError ScQProReader::import( ScDocument *pDoc )
String aName;
aName.Append( sal_Unicode( 'A' + nTab ) );
if (!nTab)
- pDoc->RenameTab( nTab, aName, sal_False, sal_False);
+ pDoc->RenameTab( nTab, aName, false, false);
else
pDoc->InsertTab( nTab, aName );
}
@@ -228,3 +229,5 @@ void ScQProReader::readString( String &rString, sal_uInt16 nLength )
rString = String( pText, mpStream->GetStreamCharSet() );
delete [] pText;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 913abb27510e..7495199fb704 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#include "precompiled_sc.hxx"
#include <sal/config.h>
+#include <sal/macros.h>
#include "qpro.hxx"
#include "qproform.hxx"
@@ -49,7 +51,7 @@ void QProToSc::ReadSRD( ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sa
else
{
rSRD.nCol = nCol;
- rSRD.SetColRel( sal_False );
+ rSRD.SetColRel( false );
}
if( nRelBit & 0x2000 )
{
@@ -61,7 +63,7 @@ void QProToSc::ReadSRD( ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sa
else
{
rSRD.nRow = nTmp;
- rSRD.SetRowRel( sal_False );
+ rSRD.SetRowRel( false );
}
if( nRelBit & 0x8000 )
{
@@ -73,7 +75,7 @@ void QProToSc::ReadSRD( ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sa
else
{
rSRD.nTab = nPage;
- rSRD.SetTabRel( sal_False );
+ rSRD.SetTabRel( false );
}
if (rSRD.nTab != aEingPos.Tab())
rSRD.SetFlag3D( sal_True);
@@ -92,8 +94,8 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const sal_Char* pExtStr
sal_Int32 nCount;
TokenId nPush, nPush1;
- sal_Bool bAddIn = sal_False;
- sal_Bool bNeg = sal_False;
+ sal_Bool bAddIn = false;
+ sal_Bool bNeg = false;
if( eOc == ocNoName )
{
@@ -150,8 +152,7 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const sal_Char* pExtStr
if( nArgs> 0 )
{
- sal_Int16 nNull = -1;
- sal_Int16 nLast = nArgs- 1;
+ INT16 nLast = nArgs- 1;
if( eOc == ocZGZ )
aPool << eParam[ 2 ] << ocSep << eParam[ 1 ] << ocSep << eParam[ 0 ];
@@ -159,6 +160,7 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const sal_Char* pExtStr
aPool << eParam[ 3 ] << ocSep << eParam[ 2 ] << ocSep << eParam[ 1 ] << ocSep << eParam[ 0 ];
else
{
+ INT16 nNull = -1;
aPool << eParam[ nLast ];
for( nCount = nLast - 1 ; nCount >= 0 ; nCount-- )
{
@@ -325,7 +327,7 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray, sal_uInt16 /*nLen*/, con
// Sheet name of second corner is not displayed if identical
if (aCRD.Ref1.IsFlag3D() && aCRD.Ref1.nTab == aCRD.Ref2.nTab &&
aCRD.Ref1.IsTabRel() == aCRD.Ref2.IsTabRel())
- aCRD.Ref2.SetFlag3D( sal_False);
+ aCRD.Ref2.SetFlag3D( false);
aStack << aPool.Store( aCRD );
break;
@@ -556,7 +558,7 @@ static const struct
{ ocNoName, FT_NotImpl } // gives properties of DOS menus
};
-const int nIndexCount = sizeof( aFuncMap ) / sizeof( aFuncMap[ 0 ] );
+const int nIndexCount = SAL_N_ELEMENTS(aFuncMap);
DefTokenId QProToSc::IndexToToken( sal_uInt16 nIndex )
{
@@ -743,3 +745,5 @@ const sal_Char* QProToSc::getString( sal_uInt8 nIndex )
}
return pExtString;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/qpro/qprostyle.cxx b/sc/source/filter/qpro/qprostyle.cxx
index aaa27f46f3f7..364fabdb436c 100644
--- a/sc/source/filter/qpro/qprostyle.cxx
+++ b/sc/source/filter/qpro/qprostyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,6 +47,7 @@
#include <editeng/crsditem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/fontitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <map>
#include "global.hxx"
@@ -143,12 +145,12 @@ void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow,
// Font Attributes
sal_uInt16 nTmpFnt = maFontRecord[ maFont[ nStyle ] ];
- sal_Bool bIsBold, bIsItalic, bIsUnderLine, bIsStrikeThrough;
+ sal_Bool bIsBold, bIsItalic, bIsUnderLine;
bIsBold = ( nTmpFnt & 0x0001 ) != 0;
bIsItalic = ( nTmpFnt & 0x0002 ) != 0;
bIsUnderLine = ( nTmpFnt & 0x0004 ) != 0;
- bIsStrikeThrough = (nTmpFnt & 0x0020 ) != 0;
+ //(nTmpFnt & 0x0020 ) for StrikeThrough
if( bIsBold )
rItemSet.Put( SvxWeightItem( WEIGHT_BOLD,ATTR_FONT_WEIGHT) );
@@ -165,3 +167,5 @@ void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow,
pDoc->ApplyPattern( nCol, nRow, nTab, aPattern );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 58c0fac79a78..ec01c82efce1 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,6 +67,7 @@
#include "drwlayer.hxx"
#include "rangenam.hxx"
#include "progress.hxx"
+#include "stringutil.hxx"
#include "globstr.hrc"
@@ -83,8 +85,8 @@ ScEEImport::ScEEImport( ScDocument* pDocP, const ScRange& rRange ) :
const ScPatternAttr* pPattern = mpDoc->GetPattern(
maRange.aStart.Col(), maRange.aStart.Row(), maRange.aStart.Tab() );
mpEngine = new ScTabEditEngine( *pPattern, mpDoc->GetEditPool() );
- mpEngine->SetUpdateMode( sal_False );
- mpEngine->EnableUndo( sal_False );
+ mpEngine->SetUpdateMode( false );
+ mpEngine->EnableUndo( false );
}
@@ -129,7 +131,7 @@ sal_uLong ScEEImport::Read( SvStream& rStream, const String& rBaseURL )
void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter, bool bConvertDate )
{
ScProgress* pProgress = new ScProgress( mpDoc->GetDocumentShell(),
- ScGlobal::GetRscString( STR_LOAD_DOC ), mpParser->Count() );
+ ScGlobal::GetRscString( STR_LOAD_DOC ), mpParser->ListSize() );
sal_uLong nProgress = 0;
SCCOL nStartCol, nEndCol;
@@ -145,7 +147,7 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
nOverlapRowMax = 0;
nMergeColAdd = 0;
nLastMergedRow = SCROW_MAX;
- sal_Bool bHasGraphics = sal_False;
+ sal_Bool bHasGraphics = false;
ScEEParseEntry* pE;
if (!pFormatter)
pFormatter = mpDoc->GetFormatTable();
@@ -158,8 +160,9 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
}
ScDocumentPool* pDocPool = mpDoc->GetPool();
ScRangeName* pRangeNames = mpDoc->GetRangeName();
- for ( pE = mpParser->First(); pE; pE = mpParser->Next() )
+ for ( size_t i = 0, nListSize = mpParser->ListSize(); i < nListSize; ++i )
{
+ pE = mpParser->ListEntry( i );
SCROW nRow = nStartRow + pE->nRow;
if ( nRow != nLastMergedRow )
nMergeColAdd = 0;
@@ -196,22 +199,22 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
const SfxPoolItem* pItem = 0;
SfxItemState eState = aSet.GetItemState( nId, sal_True, &pItem );
if (eState == SFX_ITEM_DONTCARE)
- bSimple = sal_False;
+ bSimple = false;
else if (eState == SFX_ITEM_SET)
{
if ( nId == EE_CHAR_ESCAPEMENT ) // Hoch-/Tiefstellen immer ueber EE
{
if ( (SvxEscapement)((const SvxEscapementItem*)pItem)->GetEnumValue()
!= SVX_ESCAPEMENT_OFF )
- bSimple = sal_False;
+ bSimple = false;
}
}
}
if ( bSimple )
{ // Feldbefehle enthalten?
- SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, sal_False );
+ SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, false );
if ( eFieldState == SFX_ITEM_DONTCARE || eFieldState == SFX_ITEM_SET )
- bSimple = sal_False;
+ bSimple = false;
}
// HTML
@@ -241,35 +244,35 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
if ( rESet.Count() )
{
const SfxPoolItem* pItem;
- if ( rESet.GetItemState( ATTR_BACKGROUND, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_BACKGROUND, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
- if ( rESet.GetItemState( ATTR_BORDER, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_BORDER, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
- if ( rESet.GetItemState( ATTR_SHADOW, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_SHADOW, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
// HTML
- if ( rESet.GetItemState( ATTR_HOR_JUSTIFY, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_HOR_JUSTIFY, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
- if ( rESet.GetItemState( ATTR_VER_JUSTIFY, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_VER_JUSTIFY, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
- if ( rESet.GetItemState( ATTR_LINEBREAK, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_LINEBREAK, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
- if ( rESet.GetItemState( ATTR_FONT_COLOR, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_FONT_COLOR, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
- if ( rESet.GetItemState( ATTR_FONT_UNDERLINE, sal_False, &pItem) == SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_FONT_UNDERLINE, false, &pItem) == SFX_ITEM_SET )
rSet.Put( *pItem );
// HTML LATIN/CJK/CTL script type dependent
const SfxPoolItem* pFont;
- if ( rESet.GetItemState( ATTR_FONT, sal_False, &pFont) != SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_FONT, false, &pFont) != SFX_ITEM_SET )
pFont = 0;
const SfxPoolItem* pHeight;
- if ( rESet.GetItemState( ATTR_FONT_HEIGHT, sal_False, &pHeight) != SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_FONT_HEIGHT, false, &pHeight) != SFX_ITEM_SET )
pHeight = 0;
const SfxPoolItem* pWeight;
- if ( rESet.GetItemState( ATTR_FONT_WEIGHT, sal_False, &pWeight) != SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_FONT_WEIGHT, false, &pWeight) != SFX_ITEM_SET )
pWeight = 0;
const SfxPoolItem* pPosture;
- if ( rESet.GetItemState( ATTR_FONT_POSTURE, sal_False, &pPosture) != SFX_ITEM_SET )
+ if ( rESet.GetItemState( ATTR_FONT_POSTURE, false, &pPosture) != SFX_ITEM_SET )
pPosture = 0;
if ( pFont || pHeight || pWeight || pPosture )
{
@@ -277,22 +280,22 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
sal_uInt8 nScriptType = mpDoc->GetStringScriptType( aStr );
const sal_uInt8 nScripts[3] = { SCRIPTTYPE_LATIN,
SCRIPTTYPE_ASIAN, SCRIPTTYPE_COMPLEX };
- for ( sal_uInt8 i=0; i<3; ++i )
+ for ( sal_uInt8 j=0; j<3; ++j )
{
- if ( nScriptType & nScripts[i] )
+ if ( nScriptType & nScripts[j] )
{
if ( pFont )
rSet.Put( *pFont, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT ));
+ nScripts[j], ATTR_FONT ));
if ( pHeight )
rSet.Put( *pHeight, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT_HEIGHT ));
+ nScripts[j], ATTR_FONT_HEIGHT ));
if ( pWeight )
rSet.Put( *pWeight, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT_WEIGHT ));
+ nScripts[j], ATTR_FONT_WEIGHT ));
if ( pPosture )
rSet.Put( *pPosture, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT_POSTURE ));
+ nScripts[j], ATTR_FONT_POSTURE ));
}
}
}
@@ -329,12 +332,17 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
// Daten eintragen
if (bSimple)
{
+ ScSetStringParam aParam;
+ aParam.mpNumFormatter = pFormatter;
+ aParam.mbDetectNumberFormat = true;
+ aParam.mbSetTextCellFormat = true;
+
if ( aValStr.Len() )
mpDoc->SetValue( nCol, nRow, nTab, fVal );
else if ( !pE->aSel.HasRange() )
{
// maybe ALT text of IMG or similar
- mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, pFormatter );
+ mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, &aParam );
// wenn SelRange komplett leer kann nachfolgender Text im gleichen Absatz liegen!
}
else
@@ -379,7 +387,10 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
if (bNumbersEnglishUS && !bEnUsRecognized)
mpDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aStr));
else
- mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter, bConvertDate );
+ {
+ aParam.mbDetectNumberFormat = bConvertDate;
+ mpDoc->SetString( nCol, nRow, nTab, aStr, &aParam );
+ }
}
}
else
@@ -389,16 +400,15 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
mpDoc, mpEngine->GetEditTextObjectPool() ) );
delete pObject;
}
- if ( pE->pImageList )
+ if ( pE->maImageList.size() )
bHasGraphics |= GraphicSize( nCol, nRow, nTab, pE );
if ( pE->pName )
{ // Anchor Name => RangeName
- sal_uInt16 nIndex;
- if ( !pRangeNames->SearchName( *pE->pName, nIndex ) )
+ if (!pRangeNames->findByName(*pE->pName))
{
ScRangeData* pData = new ScRangeData( mpDoc, *pE->pName,
ScAddress( nCol, nRow, nTab ) );
- pRangeNames->Insert( pData );
+ pRangeNames->insert( pData );
}
}
}
@@ -429,7 +439,7 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
VirtualDevice aVirtDev;
mpDoc->SetOptimalHeight( 0, nEndRow, 0,
static_cast< sal_uInt16 >( ScGlobal::nLastRowHeightExtra ), &aVirtDev,
- nPPTX, nPPTY, aZoom, aZoom, sal_False );
+ nPPTX, nPPTY, aZoom, aZoom, false );
if ( mpRowHeights->Count() )
{
for ( SCROW nRow = nStartRow; nRow <= nEndRow; nRow++ )
@@ -441,10 +451,12 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
}
}
if ( bHasGraphics )
- { // Grafiken einfuegen
- for ( pE = mpParser->First(); pE; pE = mpParser->Next() )
+ {
+ // Grafiken einfuegen
+ for ( size_t i = 0, nListSize = mpParser->ListSize(); i < nListSize; ++i )
{
- if ( pE->pImageList )
+ pE = mpParser->ListEntry( i );
+ if ( !pE->maImageList.empty() )
{
SCCOL nCol = pE->nCol;
SCROW nRow = pE->nRow;
@@ -458,19 +470,18 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor,
}
-sal_Bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/,
- ScEEParseEntry* pE )
+sal_Bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/, ScEEParseEntry* pE )
{
- ScHTMLImageList* pIL = pE->pImageList;
- if ( !pIL || !pIL->Count() )
- return sal_False;
- sal_Bool bHasGraphics = sal_False;
+ if ( !pE->maImageList.size() )
+ return false;
+ sal_Bool bHasGraphics = false;
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
long nWidth, nHeight;
nWidth = nHeight = 0;
sal_Char nDir = nHorizontal;
- for ( ScHTMLImage* pI = pIL->First(); pI; pI = pIL->Next() )
+ for ( sal_uInt32 i = 0; i < pE->maImageList.size() ; ++i )
{
+ ScHTMLImage* pI = &pE->maImageList[ i ];
if ( pI->pGraphic )
bHasGraphics = sal_True;
Size aSizePix = pI->aSize;
@@ -526,8 +537,7 @@ sal_Bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/,
void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
ScEEParseEntry* pE )
{
- ScHTMLImageList* pIL = pE->pImageList;
- if ( !pIL || !pIL->Count() )
+ if ( !pE->maImageList.size() )
return ;
ScDrawLayer* pModel = mpDoc->GetDrawLayer();
if (!pModel)
@@ -546,8 +556,9 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
Point aSpace;
Size aLogicSize;
sal_Char nDir = nHorizontal;
- for ( ScHTMLImage* pI = pIL->First(); pI; pI = pIL->Next() )
+ for ( sal_uInt32 i = 0; i < pE->maImageList.size(); ++i )
{
+ ScHTMLImage* pI = &pE->maImageList[ i ];
if ( nDir & nHorizontal )
{ // horizontal
aInsertPos.X() += aLogicSize.Width();
@@ -573,12 +584,12 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
{
Rectangle aRect ( aInsertPos, aLogicSize );
SdrGrafObj* pObj = new SdrGrafObj( *pI->pGraphic, aRect );
- // #118522# calling SetGraphicLink here doesn't work
+ // calling SetGraphicLink here doesn't work
pObj->SetName( pI->aURL );
pPage->InsertObject( pObj );
- // #118522# SetGraphicLink has to be used after inserting the object,
+ // SetGraphicLink has to be used after inserting the object,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
// See #i37444#.
pObj->SetGraphicLink( pI->aURL, pI->aFilterName );
@@ -594,7 +605,6 @@ ScEEParser::ScEEParser( EditEngine* pEditP ) :
pEdit( pEditP ),
pPool( EditEngine::CreatePool() ),
pDocPool( new ScDocumentPool ),
- pList( new ScEEParseList ),
pColWidths( new Table ),
nLastToken(0),
nColCnt(0),
@@ -613,9 +623,7 @@ ScEEParser::~ScEEParser()
{
delete pActEntry;
delete pColWidths;
- for ( ScEEParseEntry* pE = pList->First(); pE; pE = pList->Next() )
- delete pE;
- delete pList;
+ if ( !maList.empty() ) maList.clear();
// Pool erst loeschen nachdem die Listen geloescht wurden
pPool->SetSecondaryPool( NULL );
@@ -634,3 +642,4 @@ void ScEEParser::NewActEntry( ScEEParseEntry* pE )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/rtf/expbase.cxx b/sc/source/filter/rtf/expbase.cxx
index edff03ff7bd4..ee90ff1b4ec7 100644
--- a/sc/source/filter/rtf/expbase.cxx
+++ b/sc/source/filter/rtf/expbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,9 +40,9 @@
//------------------------------------------------------------------
#if defined(UNX)
-const sal_Char __FAR_DATA ScExportBase::sNewLine = '\012';
+const sal_Char ScExportBase::sNewLine = '\012';
#else
-const sal_Char __FAR_DATA ScExportBase::sNewLine[] = "\015\012";
+const sal_Char ScExportBase::sNewLine[] = "\015\012";
#endif
@@ -75,10 +76,9 @@ sal_Bool ScExportBase::GetDataArea( SCTAB nTab, SCCOL& nStartCol,
sal_Bool ScExportBase::TrimDataArea( SCTAB nTab, SCCOL& nStartCol,
SCROW& nStartRow, SCCOL& nEndCol, SCROW& nEndRow ) const
{
- SCCOL nLastCol;
- while ( nStartCol <= nEndCol && pDoc->ColHidden(nStartCol, nTab, nLastCol))
+ while ( nStartCol <= nEndCol && pDoc->ColHidden(nStartCol, nTab))
++nStartCol;
- while ( nStartCol <= nEndCol && pDoc->ColHidden(nEndCol, nTab, nLastCol))
+ while ( nStartCol <= nEndCol && pDoc->ColHidden(nEndCol, nTab))
--nEndCol;
nStartRow = pDoc->FirstVisibleRow(nStartRow, nEndRow, nTab);
nEndRow = pDoc->LastVisibleRow(nStartRow, nEndRow, nTab);
@@ -105,3 +105,4 @@ ScFieldEditEngine& ScExportBase::GetEditEngine() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/rtf/makefile.mk b/sc/source/filter/rtf/makefile.mk
index a680751de620..3aa6dbe8ad8d 100644
--- a/sc/source/filter/rtf/makefile.mk
+++ b/sc/source/filter/rtf/makefile.mk
@@ -40,14 +40,15 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/eeimpars.obj \
+SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
+ $(SLO)$/eeimpars.obj \
$(SLO)$/expbase.obj \
$(SLO)$/rtfexp.obj \
$(SLO)$/rtfimp.obj \
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 74b07b4bccc9..8a81b6c97660 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/style.hxx>
#include <svtools/rtfout.hxx>
#include <svtools/rtfkeywd.hxx>
@@ -84,37 +86,6 @@ sal_uLong ScRTFExport::Write()
rStrm << '{' << OOO_STRING_SVTOOLS_RTF_RTF;
rStrm << OOO_STRING_SVTOOLS_RTF_ANSI << sNewLine;
-#if 0
-// das ist noch nicht ausgegoren
-/*
- SfxStyleSheetBasePool* pStylePool = pDoc->GetStyleSheetPool();
- SfxStyleSheetBase* pStyleSheet = NULL;
- DBG_ASSERT( pStylePool, "StylePool not found! :-(" );
- pStylePool->SetSearchMask( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL );
- pStyleSheet = pStylePool->Find( STRING_STANDARD, SFX_STYLE_FAMILY_PARA );
- DBG_ASSERT( pStyleSheet, "ParaStyle not found! :-(" );
- const SfxItemSet& rSetPara = pStyleSheet->GetItemSet();
-
- // fonttbl
- String aFontFamilyName(
- ((const SvxFontItem&)(rSetPara.Get( ATTR_FONT ))).GetFamilyName() );
- rStrm << OOO_STRING_SVTOOLS_RTF_DEFF << '0'
- << '{' << OOO_STRING_SVTOOLS_RTF_FONTTBL
- << '{' << OOO_STRING_SVTOOLS_RTF_F << '0' << OOO_STRING_SVTOOLS_RTF_FNIL << ' ' << aFontFamilyName.GetStr() << ";}"
- << '}' << sNewLine;
-
- // hier kaeme die colortbl
-
- // stylesheet
- sal_uInt32 nFontHeight =
- ((const SvxFontHeightItem&)(rSetPara.Get( ATTR_FONT_HEIGHT ))).GetHeight();
- rStrm << '{' << OOO_STRING_SVTOOLS_RTF_STYLESHEET
- << '{' << OOO_STRING_SVTOOLS_RTF_FS << String( sal_uInt32(nFontHeight / TWIPS_PER_POINT) ).GetStr()
- << ' ' << pStyleSheet->GetName().GetStr() << ";}"
- << '}' << sNewLine;
-*/
-#endif
-
// Daten
for ( SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); nTab++ )
{
@@ -225,11 +196,11 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
switch ( pCell->GetCellType() )
{
case CELLTYPE_NOTE :
- bValueData = sal_False;
+ bValueData = false;
break; // nix
case CELLTYPE_EDIT :
{
- bValueData = sal_False;
+ bValueData = false;
EditEngine& rEngine = GetEditEngine();
const EditTextObject* pObj;
((const ScEditCell*)pCell)->GetData( pObj );
@@ -250,10 +221,10 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
}
}
else
- bValueData = sal_False;
+ bValueData = false;
sal_Bool bResetPar, bResetAttr;
- bResetPar = bResetAttr = sal_False;
+ bResetPar = bResetAttr = false;
const SvxHorJustifyItem& rHorJustifyItem = (const SvxHorJustifyItem&)pAttr->GetItem( ATTR_HOR_JUSTIFY );
const SvxWeightItem& rWeightItem = (const SvxWeightItem&) pAttr->GetItem( ATTR_FONT_WEIGHT );
@@ -303,3 +274,4 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/rtf/rtfimp.cxx b/sc/source/filter/rtf/rtfimp.cxx
index 83b48b1fa2b1..acf14f5620cc 100644
--- a/sc/source/filter/rtf/rtfimp.cxx
+++ b/sc/source/filter/rtf/rtfimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,3 +74,4 @@ ScRTFImport::~ScRTFImport()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index 6452f7f9b8b7..39044ba2b201 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,7 +65,7 @@ ScRTFParser::ScRTFParser( EditEngine* pEditP ) :
pDefMerge( NULL ),
nStartAdjust( (sal_uLong)~0 ),
nLastWidth(0),
- bNewDef( sal_False )
+ bNewDef( false )
{
// RTF default FontSize 12Pt
long nMM = OutputDevice::LogicToLogic( 12, MAP_POINT, MAP_100TH_MM );
@@ -78,8 +79,7 @@ ScRTFParser::~ScRTFParser()
{
delete pInsDefault;
delete pColTwips;
- for ( ScRTFCellDefault* pD = pDefaultList->First(); pD; pD = pDefaultList->Next() )
- delete pD;
+ pDefaultList->clear();
delete pDefaultList;
}
@@ -91,18 +91,23 @@ sal_uLong ScRTFParser::Read( SvStream& rStream, const String& rBaseURL )
sal_uLong nErr = pEdit->Read( rStream, rBaseURL, EE_FORMAT_RTF );
if ( nLastToken == RTF_PAR )
{
- ScEEParseEntry* pE = pList->Last();
- if ( pE
- // komplett leer
- && (( pE->aSel.nStartPara == pE->aSel.nEndPara
- && pE->aSel.nStartPos == pE->aSel.nEndPos)
- // leerer Paragraph
- || ( pE->aSel.nStartPara + 1 == pE->aSel.nEndPara
- && pE->aSel.nStartPos == pEdit->GetTextLen( pE->aSel.nStartPara )
- && pE->aSel.nEndPos == 0 )) )
- { // den letzten leeren Absatz nicht uebernehmen
- pList->Remove();
- delete pE;
+ if ( !maList.empty() )
+ {
+ ScEEParseEntry* pE = maList.back();
+ if ( // komplett leer
+ ( ( pE->aSel.nStartPara == pE->aSel.nEndPara
+ && pE->aSel.nStartPos == pE->aSel.nEndPos
+ )
+ || // leerer Paragraph
+ ( pE->aSel.nStartPara + 1 == pE->aSel.nEndPara
+ && pE->aSel.nStartPos == pEdit->GetTextLen( pE->aSel.nStartPara )
+ && pE->aSel.nEndPos == 0
+ )
+ )
+ )
+ { // den letzten leeren Absatz nicht uebernehmen
+ maList.pop_back();
+ }
}
}
ColAdjust();
@@ -136,7 +141,7 @@ sal_Bool ScRTFParser::SeekTwips( sal_uInt16 nTwips, SCCOL* pCol )
return sal_True;
sal_uInt16 nCount = pColTwips->Count();
if ( !nCount )
- return sal_False;
+ return false;
SCCOL nCol = *pCol;
// nCol ist Einfuegeposition, da liegt der Naechsthoehere (oder auch nicht)
if ( nCol < static_cast<SCCOL>(nCount) && (((*pColTwips)[nCol] - SC_RTFTWIPTOL) <= nTwips) )
@@ -147,7 +152,7 @@ sal_Bool ScRTFParser::SeekTwips( sal_uInt16 nTwips, SCCOL* pCol )
(*pCol)--;
return sal_True;
}
- return sal_False;
+ return false;
}
@@ -157,9 +162,9 @@ void ScRTFParser::ColAdjust()
{
SCCOL nCol = 0;
ScEEParseEntry* pE;
- pE = pList->Seek( nStartAdjust );
- while ( pE )
+ for ( size_t i = nStartAdjust, nListSize = maList.size(); i < nListSize; ++ i )
{
+ pE = maList[ i ];
if ( pE->nCol == 0 )
nCol = 0;
pE->nCol = nCol;
@@ -174,7 +179,6 @@ void ScRTFParser::ColAdjust()
}
if ( nCol > nColMax )
nColMax = nCol;
- pE = pList->Next();
}
nStartAdjust = (sal_uLong)~0;
pColTwips->Remove( (sal_uInt16)0, pColTwips->Count() );
@@ -233,10 +237,12 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
if ( bNewDef )
{
ScRTFCellDefault* pD;
- bNewDef = sal_False;
+ bNewDef = false;
// rechts nicht buendig? => neue Tabelle
- if ( nLastWidth
- && ((pD = pDefaultList->Last()) != 0) && pD->nTwips != nLastWidth )
+ if ( nLastWidth
+ && ( (pD = &(pDefaultList->back())) != 0 )
+ && pD->nTwips != nLastWidth
+ )
{
SCCOL n1, n2;
if ( !( SeekTwips( nLastWidth, &n1 )
@@ -244,15 +250,16 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
ColAdjust();
}
// TwipCols aufbauen, erst nach nLastWidth Vergleich!
- for ( pD = pDefaultList->First(); pD; pD = pDefaultList->Next() )
+ for ( size_t i = 0, nListSize = pDefaultList->size(); i < nListSize; ++i )
{
+ pD = &( pDefaultList->at( i ) );
SCCOL n;
if ( !SeekTwips( pD->nTwips, &n ) )
pColTwips->Insert( pD->nTwips );
}
}
pDefMerge = NULL;
- pActDefault = pDefaultList->First();
+ pActDefault = &(pDefaultList->front());
DBG_ASSERT( pActDefault, "NewCellRow: pActDefault==0" );
}
@@ -292,12 +299,10 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
{
case RTF_TROWD: // denotes table row defauls, before RTF_CELLX
{
- if ( (pD = pDefaultList->Last()) != 0 )
+ if ( (pD = &(pDefaultList->back())) != 0 )
nLastWidth = pD->nTwips;
nColCnt = 0;
- for ( pD = pDefaultList->First(); pD; pD = pDefaultList->Next() )
- delete pD;
- pDefaultList->Clear();
+ pDefaultList->clear();
pDefMerge = NULL;
nLastToken = pInfo->nToken;
}
@@ -310,8 +315,10 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
break;
case RTF_CLMRG: // A cell to be merged with the preceding cell
{
- if ( !pDefMerge )
- pDefMerge = pDefaultList->Last();
+ if ( !pDefMerge
+ && !(pDefaultList->empty())
+ )
+ pDefMerge = &( pDefaultList->back() );
DBG_ASSERT( pDefMerge, "RTF_CLMRG: pDefMerge==0" );
if ( pDefMerge ) // sonst rottes RTF
pDefMerge->nColOverlap++; // mehrere nacheinander moeglich
@@ -324,7 +331,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
bNewDef = sal_True;
pInsDefault->nCol = nColCnt;
pInsDefault->nTwips = pInfo->nTokenValue; // rechter Zellenrand
- pDefaultList->Insert( pInsDefault, LIST_APPEND );
+ pDefaultList->push_back( pInsDefault );
// neuer freifliegender pInsDefault
pInsDefault = new ScRTFCellDefault( pPool );
if ( ++nColCnt > nColMax )
@@ -361,19 +368,25 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
EntryEnd( pActEntry, pInfo->aSelection );
if ( nStartAdjust == (sal_uLong)~0 )
- nStartAdjust = pList->Count();
- pList->Insert( pActEntry, LIST_APPEND );
+ nStartAdjust = maList.size();
+ maList.push_back( pActEntry );
NewActEntry( pActEntry ); // neuer freifliegender pActEntry
}
else
{ // aktuelle Twips der MergeCell zuweisen
- if ( (pE = pList->Last()) != 0 )
+ if ( !maList.empty() )
+ {
+ pE = maList.back();
pE->nTwips = pActDefault->nTwips;
+ }
// Selection des freifliegenden pActEntry anpassen
// Paragraph -1 wg. Textaufbruch in EditEngine waehrend Parse
pActEntry->aSel.nStartPara = pInfo->aSelection.nEndPara - 1;
}
- pActDefault = pDefaultList->Next();
+ if ( pDefaultList->empty() )
+ pActDefault = NULL;
+ else
+ pActDefault = &( pDefaultList->back() );
nLastToken = pInfo->nToken;
}
break;
@@ -391,7 +404,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
pActEntry->nCol = 0;
pActEntry->nRow = nRowCnt;
EntryEnd( pActEntry, pInfo->aSelection );
- pList->Insert( pActEntry, LIST_APPEND );
+ maList.push_back( pActEntry );
NewActEntry( pActEntry ); // new pActEntry
NextRow();
}
@@ -418,3 +431,4 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/starcalc/makefile.mk b/sc/source/filter/starcalc/makefile.mk
index 836f6b0d3621..a9c06eb14a4d 100644
--- a/sc/source/filter/starcalc/makefile.mk
+++ b/sc/source/filter/starcalc/makefile.mk
@@ -40,14 +40,15 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/scflt.obj \
+SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
+ $(SLO)$/scflt.obj \
$(SLO)$/scfobj.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index a7d0150ee220..fbb81b220ae0 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
-
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
@@ -52,6 +50,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/wghtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/zforlist.hxx>
#include <svl/PasswordHelper.hxx>
#include <stdio.h>
@@ -326,27 +325,10 @@ void lcl_ReadChartTypeData(SvStream& rStream, Sc10ChartTypeData& rTypeData)
rStream.Read(&rTypeData.LabelText[i], sizeof(Sc10ChartText));
rStream.Read(&rTypeData.LeftTitle, sizeof(rTypeData.LeftTitle));
rStream.Read(&rTypeData.Reserved, sizeof(rTypeData.Reserved));
- //rStream.Read(&rTypeData, sizeof(rTypeData));
}
double lcl_PascalToDouble(sal_Char* tp6)
{
-// #i68483# bah! this was broken forever...
-// struct
-// {
-// sal_uInt8 be ; /* biased exponent */
-// sal_uInt16 v1 ; /* lower 16 bits of mantissa */
-// sal_uInt16 v2 ; /* next 16 bits of mantissa */
-// sal_uInt8 v3:7; /* upper 7 bits of mantissa */
-// sal_uInt8 s :1; /* sign bit */
-// } real;
-//
-// memcpy (&real, tp6, 6);
-// if (real.be == 0)
-// return 0.0;
-// return (((((128 +real.v3) * 65536.0) + real.v2) * 65536.0 + real.v1) *
-// ldexp ((real.s? -1.0: 1.0), real.be - (129+39)));
-
sal_uInt8* pnUnsigned = reinterpret_cast< sal_uInt8* >( tp6 );
// biased exponent
sal_uInt8 be = pnUnsigned[ 0 ];
@@ -406,7 +388,6 @@ String lcl_MakeOldPageStyleFormatName( sal_uInt16 i )
// Font
//--------------------------------------------
-
Sc10FontData::Sc10FontData(SvStream& rStream)
{
rStream >> Height;
@@ -436,17 +417,15 @@ Sc10FontCollection::Sc10FontCollection(SvStream& rStream) :
}
else
{
- DBG_ERROR( "FontID" );
+ OSL_FAIL( "FontID" );
nError = errUnknownID;
}
}
-
//--------------------------------------------
// Benannte-Bereiche
//--------------------------------------------
-
Sc10NameData::Sc10NameData(SvStream& rStream)
{
sal_uInt8 nLen;
@@ -479,7 +458,7 @@ Sc10NameCollection::Sc10NameCollection(SvStream& rStream) :
}
else
{
- DBG_ERROR( "NameID" );
+ OSL_FAIL( "NameID" );
nError = errUnknownID;
}
}
@@ -488,12 +467,9 @@ Sc10NameCollection::Sc10NameCollection(SvStream& rStream) :
// Vorlagen
//--------------------------------------------
-
Sc10PatternData::Sc10PatternData(SvStream& rStream)
{
rStream.Read(Name, sizeof(Name));
- //rStream.Read(&ValueFormat, sizeof(ValueFormat));
- //rStream.Read(&LogFont, sizeof(LogFont));
lcl_ReadValueFormat(rStream, ValueFormat);
lcl_ReadLogFont(rStream, LogFont);
@@ -527,20 +503,17 @@ Sc10PatternCollection::Sc10PatternCollection(SvStream& rStream) :
}
else
{
- DBG_ERROR( "PatternID" );
+ OSL_FAIL( "PatternID" );
nError = errUnknownID;
}
}
-
//--------------------------------------------
// Datenbank
//--------------------------------------------
-
Sc10DataBaseData::Sc10DataBaseData(SvStream& rStream)
{
- //rStream.Read(&DataBaseRec, sizeof(DataBaseRec));
rStream.Read(&DataBaseRec.Name, sizeof(DataBaseRec.Name));
rStream >> DataBaseRec.Tab;
lcl_ReadBlockRect(rStream, DataBaseRec.Block);
@@ -594,7 +567,7 @@ Sc10DataBaseCollection::Sc10DataBaseCollection(SvStream& rStream) :
}
else
{
- DBG_ERROR( "DataBaseID" );
+ OSL_FAIL( "DataBaseID" );
nError = errUnknownID;
}
}
@@ -806,7 +779,7 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
Color aRColor( nColor.Red, nColor.Green, nColor.Blue );
sal_uInt16 nFact;
- sal_Bool bSwapCol = sal_False;
+ sal_Bool bSwapCol = false;
switch (pHeadFootLine->Raster)
{
case raNone: nFact = 0xffff; bSwapCol = sal_True; break;
@@ -885,7 +858,7 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
aSetItemItemSet.Put( SvxSizeItem( ATTR_PAGE_SIZE, Size( 0, pPage->Bottom - pPage->Foot ) ) );
aSetItemItemSet.Put(SfxBoolItem( ATTR_PAGE_ON, sal_True ));
- aSetItemItemSet.Put(SfxBoolItem( ATTR_PAGE_DYNAMIC, sal_False ));
+ aSetItemItemSet.Put(SfxBoolItem( ATTR_PAGE_DYNAMIC, false ));
aSetItemItemSet.Put(SfxBoolItem( ATTR_PAGE_SHARED, sal_True ));
pSet->Put( SvxSetItem( nHeadFoot ? ATTR_PAGE_FOOTERSET : ATTR_PAGE_HEADERSET,
@@ -1039,14 +1012,13 @@ sal_uLong Sc10Import::Import()
void Sc10Import::LoadFileHeader()
{
Sc10FileHeader FileHeader;
- //rStream.Read(&FileHeader, sizeof(FileHeader));
lcl_ReadFileHeader(rStream, FileHeader);
nError = rStream.GetError();
if ( nError == 0 )
{
sal_Char Sc10CopyRight[32];
- strcpy(Sc10CopyRight, "Blaise-Tabelle"); // #100211# - checked
+ strcpy(Sc10CopyRight, "Blaise-Tabelle");
Sc10CopyRight[14] = 10;
Sc10CopyRight[15] = 13;
Sc10CopyRight[16] = 0;
@@ -1082,7 +1054,6 @@ void Sc10Import::LoadEditStateInfo()
void Sc10Import::LoadProtect()
{
- //rStream.Read(&SheetProtect, sizeof(SheetProtect));
lcl_ReadSheetProtect(rStream, SheetProtect);
nError = rStream.GetError();
@@ -1113,10 +1084,6 @@ void Sc10Import::LoadScrZoom()
void Sc10Import::LoadPalette()
{
- //rStream.Read(TextPalette, sizeof(TextPalette));
- //rStream.Read(BackPalette, sizeof(BackPalette));
- //rStream.Read(RasterPalette, sizeof(RasterPalette));
- //rStream.Read(FramePalette, sizeof(FramePalette));
lcl_ReadPalette(rStream, TextPalette);
lcl_ReadPalette(rStream, BackPalette);
lcl_ReadPalette(rStream, RasterPalette);
@@ -1145,9 +1112,9 @@ void Sc10Import::ImportNameCollection()
for (sal_uInt16 i = 0; i < pNameCollection->GetCount(); i++)
{
Sc10NameData* pName = pNameCollection->At( i );
- pRN->Insert( new ScRangeData( pDoc,
- SC10TOSTRING( pName->Name ),
- SC10TOSTRING( pName->Reference ) ) );
+ pRN->insert(
+ new ScRangeData(
+ pDoc, SC10TOSTRING(pName->Name), SC10TOSTRING(pName->Reference)));
}
}
@@ -1166,7 +1133,7 @@ void Sc10Import::LoadPatternCollection()
else
{
pPattern->Name[ 27 ] = 0;
- strcat( pPattern->Name, "_Old" ); // #100211# - checked
+ strcat( pPattern->Name, "_Old" );
aName = SC10TOSTRING( pPattern->Name );
pStylePool->Make( aName, SFX_STYLE_FAMILY_PARA );
}
@@ -1245,10 +1212,7 @@ void Sc10Import::LoadPatternCollection()
else if( ( OJustify & ojTopBottom ) == ojTopBottom )
rItemSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 27000 ) );
- sal_Int16 Margin = Max( ( sal_uInt16 ) 20, ( sal_uInt16 ) ( EJustify * 20 ) );
-// if( ( ( OJustify & ojBottomTop ) == ojBottomTop ) ||
-// ( ( OJustify & ojBottomTop ) == ojBottomTop ) )
-// vielleicht so?
+ INT16 Margin = Max( ( sal_uInt16 ) 20, ( sal_uInt16 ) ( EJustify * 20 ) );
if( ( ( OJustify & ojBottomTop ) == ojBottomTop ) )
rItemSet.Put( SvxMarginItem( 20, Margin, 20, Margin, ATTR_MARGIN ) );
else
@@ -1341,7 +1305,7 @@ void Sc10Import::LoadPatternCollection()
Color aRColor( COL_BLACK );
lcl_ChangeColor( nRColor, aRColor );
sal_uInt16 nFact;
- sal_Bool bSwapCol = sal_False;
+ sal_Bool bSwapCol = false;
sal_Bool bSetItem = sal_True;
switch (pPattern->Raster)
{
@@ -1429,7 +1393,6 @@ void Sc10Import::LoadTables()
String aStr; // Universal-Konvertierungs-String
- //rStream.Read(&PageFormat, sizeof(PageFormat));
lcl_ReadPageFormat(rStream, PageFormat);
sal_uInt16 nAt = aPageCollection.InsertFormat(PageFormat);
@@ -1439,7 +1402,6 @@ void Sc10Import::LoadTables()
rStream >> DataBaseIndex;
- //rStream.Read(&TabProtect, sizeof(TabProtect));
lcl_ReadTabProtect(rStream, TabProtect);
ScTableProtection aProtection;
@@ -1485,18 +1447,6 @@ void Sc10Import::LoadTables()
aSc30ViewOpt.SetObjMode( VOBJ_TYPE_DRAW, eObjMode );
}
- /* wofuer wird das benoetigt? Da in SC 1.0 die Anzeigeflags pro Tabelle gelten und nicht pro View
- Dieses Flag in die ViewOptions eintragen bei Gelegenheit, Sollte der Stephan Olk machen
- sal_uInt16 nDisplayMask = 0xFFFF;
- sal_uInt16 nDisplayValue = 0;
- if (Tab == 0)
- nDisplayValue = Display;
- else
- {
- sal_uInt16 nDiff = Display ^ nDisplayValue;
- nDisplayMask &= ~nDiff;
- }
- */
//--------------------------------------------------------------------
rStream >> Visible;
@@ -1504,19 +1454,19 @@ void Sc10Import::LoadTables()
if (nError != 0) return;
if (TabNo == 0)
- pDoc->RenameTab(static_cast<SCTAB> (TabNo), SC10TOSTRING( TabName ), sal_False);
+ pDoc->RenameTab(static_cast<SCTAB> (TabNo), SC10TOSTRING( TabName ), false);
else
pDoc->InsertTab(SC_TAB_APPEND, SC10TOSTRING( TabName ) );
pDoc->SetPageStyle( static_cast<SCTAB>(Tab), aPageName );
- if (Visible == 0) pDoc->SetVisible(static_cast<SCTAB> (TabNo), sal_False);
+ if (Visible == 0) pDoc->SetVisible(static_cast<SCTAB> (TabNo), false);
// ColWidth
rStream >> ID;
if (ID != ColWidthID)
{
- DBG_ERROR( "ColWidthID" );
+ OSL_FAIL( "ColWidthID" );
nError = errUnknownID;
return;
}
@@ -1535,7 +1485,7 @@ void Sc10Import::LoadTables()
rStream >> ID;
if (ID != ColAttrID)
{
- DBG_ERROR( "ColAttrID" );
+ OSL_FAIL( "ColAttrID" );
nError = errUnknownID;
return;
}
@@ -1565,7 +1515,7 @@ void Sc10Import::LoadTables()
rStream >> ID;
if (ID != RowHeightID)
{
- DBG_ERROR( "RowHeightID" );
+ OSL_FAIL( "RowHeightID" );
nError = errUnknownID;
return;
}
@@ -1585,7 +1535,7 @@ void Sc10Import::LoadTables()
rStream >> ID;
if (ID != RowAttrID)
{
- DBG_ERROR( "RowAttrID" );
+ OSL_FAIL( "RowAttrID" );
nError = errUnknownID;
return;
}
@@ -1615,7 +1565,7 @@ void Sc10Import::LoadTables()
rStream >> ID;
if (ID != TableID)
{
- DBG_ERROR( "TableID" );
+ OSL_FAIL( "TableID" );
nError = errUnknownID;
return;
}
@@ -1685,7 +1635,6 @@ void Sc10Import::LoadCol(SCCOL Col, SCTAB Tab)
/*double Value =*/ ScfTools::ReadLongDouble(rStream);
sal_uInt8 Len;
sal_Char s[256];
- //rStream.Read(&Value, sizeof(Value));
rStream >> Len;
rStream.Read(&s[1], Len);
s[0] = '=';
@@ -1759,13 +1708,10 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
pColData = aFont.pData;
for( i = 0 ; i < nLimit ; i++, pColData++ )
{
- //nEnd = aFont.pData[i].Row;
nEnd = static_cast<SCROW>(pColData->Row);
- //if ((nStart <= nEnd) && (aFont.pData[i].Value != 0))
if ((nStart <= nEnd) && (pColData->Value))
{
FontFamily eFam = FAMILY_DONTKNOW;
- //Sc10FontData* pFont = pFontCollection->At(aFont.pData[i].Value);
Sc10FontData* pFont = pFontCollection->At(pColData->Value);
switch (pFont->PitchAndFamily & 0xF0)
{
@@ -1793,9 +1739,7 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
pColData = aColor.pData;
for( i = 0 ; i < nLimit ; i++, pColData++ )
{
- //nEnd = aColor.pData[i].Row;
nEnd = static_cast<SCROW>(pColData->Row);
- //if ((nStart <= nEnd) && (aColor.pData[i].Value != 0))
if ((nStart <= nEnd) && (pColData->Value))
{
Color TextColor(COL_BLACK);
@@ -1892,7 +1836,7 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
nStart = nEnd + 1;
}
// Umrandung
- sal_Bool bEnd = sal_False;
+ sal_Bool bEnd = false;
sal_uInt16 nColorIndex = 0;
sal_uInt16 nFrameIndex = 0;
@@ -2019,7 +1963,7 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
// Hintergrund (Farbe, Raster)
sal_uInt16 nRasterIndex = 0;
- bEnd = sal_False;
+ bEnd = false;
nColorIndex = 0;
nEnd = 0;
nStart = 0;
@@ -2048,7 +1992,7 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
ScPatternAttr aScPattern( pDoc->GetPool() );
sal_uInt16 nFact;
- sal_Bool bSwapCol = sal_False;
+ sal_Bool bSwapCol = false;
sal_Bool bSetItem = sal_True;
switch ( aRaster.pData[ nRasterIndex ].Value )
{
@@ -2194,7 +2138,6 @@ void Sc10Import::LoadAttr(Sc10ColAttr& rAttr)
rStream >> rAttr.pData[i].Row;
rStream >> rAttr.pData[i].Value;
}
- //rStream.Read(rAttr.pData, rAttr.Count * sizeof(Sc10ColData));
nError = rStream.GetError();
}
else
@@ -2352,25 +2295,6 @@ void Sc10Import::LoadObjects()
if (rStream.IsEof()) return;
if (ID == ObjectID)
{
-#ifdef SC10_SHOW_OBJECTS
- // Achtung nur zu Debugzwecken
- //-----------------------------------
- pDoc->InsertTab(SC_TAB_APPEND, "GraphObjects");
- SCCOL nCol = 0;
- SCROW nRow = 0;
- SCTAB nTab = 0;
- pDoc->GetTable("GraphObjects", nTab);
- pDoc->SetString(nCol++, nRow, nTab, "ObjectTyp");
- pDoc->SetString(nCol++, nRow, nTab, "Col");
- pDoc->SetString(nCol++, nRow, nTab, "Row");
- pDoc->SetString(nCol++, nRow, nTab, "Tab");
- pDoc->SetString(nCol++, nRow, nTab, "X");
- pDoc->SetString(nCol++, nRow, nTab, "Y");
- pDoc->SetString(nCol++, nRow, nTab, "W");
- pDoc->SetString(nCol++, nRow, nTab, "H");
- //-----------------------------------
-#endif
-
sal_uInt16 nAnz;
rStream >> nAnz;
sal_Char Reserved[32];
@@ -2380,11 +2304,10 @@ void Sc10Import::LoadObjects()
{
sal_uInt8 ObjectType;
Sc10GraphHeader GraphHeader;
- sal_Bool IsOleObject = sal_False; // Achtung dies ist nur ein Notnagel
+ sal_Bool IsOleObject = false; // Achtung dies ist nur ein Notnagel
for (sal_uInt16 i = 0; (i < nAnz) && (nError == 0) && !rStream.IsEof() && !IsOleObject; i++)
{
rStream >> ObjectType;
- //rStream.Read(&GraphHeader, sizeof(GraphHeader));
lcl_ReadGraphHeader(rStream, GraphHeader);
double nPPTX = ScGlobal::nScreenPPTX;
@@ -2403,36 +2326,6 @@ void Sc10Import::LoadObjects()
nStartY += (long) ( GraphHeader.y / nPPTY * HMM_PER_TWIPS );
long nSizeY = (long) ( GraphHeader.h / nPPTY * HMM_PER_TWIPS );
-#ifdef SC10_SHOW_OBJECTS
- // Achtung nur zu Debugzwecken
- //-----------------------------------
- nCol = 0;
- nRow++;
- switch (ObjectType)
- {
- case otOle :
- pDoc->SetString(nCol++, nRow, nTab, "Ole-Object");
- break;
- case otImage :
- pDoc->SetString(nCol++, nRow, nTab, "Image-Object");
- break;
- case otChart :
- pDoc->SetString(nCol++, nRow, nTab, "Chart-Object");
- break;
- default :
- pDoc->SetString(nCol++, nRow, nTab, "ERROR");
- break;
- }
- pDoc->SetValue(nCol++, nRow, nTab, GraphHeader.CarretX);
- pDoc->SetValue(nCol++, nRow, nTab, GraphHeader.CarretY);
- pDoc->SetValue(nCol++, nRow, nTab, GraphHeader.CarretZ);
- pDoc->SetValue(nCol++, nRow, nTab, GraphHeader.x);
- pDoc->SetValue(nCol++, nRow, nTab, GraphHeader.y);
- pDoc->SetValue(nCol++, nRow, nTab, GraphHeader.w);
- pDoc->SetValue(nCol++, nRow, nTab, GraphHeader.h);
- //-----------------------------------
-#endif
-
switch (ObjectType)
{
case otOle :
@@ -2442,7 +2335,6 @@ void Sc10Import::LoadObjects()
case otImage :
{
Sc10ImageHeader ImageHeader;
- //rStream.Read(&ImageHeader, sizeof(ImageHeader));
lcl_ReadImageHeaer(rStream, ImageHeader);
// Achtung nun kommen die Daten (Bitmap oder Metafile)
@@ -2459,16 +2351,12 @@ void Sc10Import::LoadObjects()
Sc10ChartHeader ChartHeader;
Sc10ChartSheetData ChartSheetData;
Sc10ChartTypeData* pTypeData = new Sc10ChartTypeData;
- //rStream.Read(&ChartHeader, sizeof(ChartHeader));
lcl_ReadChartHeader(rStream, ChartHeader);
//! altes Metafile verwenden ??
rStream.SeekRel(ChartHeader.Size);
- //rStream.Read(&ChartSheetData, sizeof(ChartSheetData));
lcl_ReadChartSheetData(rStream, ChartSheetData);
-
- //rStream.Read(pTypeData, sizeof(Sc10ChartTypeData));
lcl_ReadChartTypeData(rStream, *pTypeData);
Rectangle aRect( Point(nStartX,nStartY), Size(nSizeX,nSizeY) );
@@ -2490,14 +2378,11 @@ void Sc10Import::LoadObjects()
}
else
{
- DBG_ERROR( "ObjectID" );
+ OSL_FAIL( "ObjectID" );
nError = errUnknownID;
}
}
-
-
-
//-----------------------------------------------------------------------------------------------
FltError ScFormatFilterPluginImpl::ScImportStarCalc10( SvStream& rStream, ScDocument* pDocument )
@@ -2509,3 +2394,4 @@ FltError ScFormatFilterPluginImpl::ScImportStarCalc10( SvStream& rStream, ScDocu
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/starcalc/scfobj.cxx b/sc/source/filter/starcalc/scfobj.cxx
index 137f545eee7d..e1fc11a68719 100644
--- a/sc/source/filter/starcalc/scfobj.cxx
+++ b/sc/source/filter/starcalc/scfobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,3 +103,4 @@ void Sc10InsertObject::InsertChart( ScDocument* pDoc, SCTAB nDestTab, const Rect
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index db6a491c44ef..7168e46dd995 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,41 @@
//___________________________________________________________________
+#include <stdio.h>
#include <sot/storage.hxx>
#include "XclExpChangeTrack.hxx"
#include "xeformula.hxx"
#include "cell.hxx"
#include "xcl97rec.hxx"
+#include <oox/core/tokens.hxx>
+#include <rtl/strbuf.hxx>
+
+using ::rtl::OUString;
+using ::rtl::OString;
+using ::rtl::OStringBuffer;
+
+static OString lcl_GuidToOString( sal_uInt8 aGuid[ 16 ] )
+{
+ char sBuf[ 40 ];
+ snprintf( sBuf, sizeof( sBuf ),
+ "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+ aGuid[ 0 ], aGuid[ 1 ], aGuid[ 2 ], aGuid[ 3 ], aGuid[ 4 ], aGuid[ 5 ], aGuid[ 6 ], aGuid[ 7 ],
+ aGuid[ 8 ], aGuid[ 9 ], aGuid[ 10 ], aGuid[ 11 ], aGuid[ 12 ], aGuid[ 13 ], aGuid[ 14 ], aGuid[ 15 ] );
+ return OString( sBuf );
+}
+
+static OString lcl_DateTimeToOString( const DateTime& rDateTime )
+{
+ char sBuf[ 200 ];
+ snprintf( sBuf, sizeof( sBuf ),
+ "%d-%02d-%02dT%02d:%02d:%02d.%02dZ",
+ rDateTime.GetYear(), rDateTime.GetMonth(), rDateTime.GetDay(),
+ rDateTime.GetHour(), rDateTime.GetMin(), rDateTime.GetSec(),
+ rDateTime.Get100Sec() );
+ return OString( sBuf );
+}
+
//___________________________________________________________________
// local functions
@@ -66,7 +96,7 @@ void lcl_WriteFixedString( XclExpStream& rStrm, const XclExpString& rString, sal
inline void lcl_GenerateGUID( sal_uInt8* pGUID, sal_Bool& rValidGUID )
{
- rtl_createUuid( pGUID, rValidGUID ? pGUID : NULL, sal_False );
+ rtl_createUuid( pGUID, rValidGUID ? pGUID : NULL, false );
rValidGUID = sal_True;
}
@@ -118,7 +148,7 @@ sal_Size XclExpUserBView::GetLen() const
XclExpUserBViewList::XclExpUserBViewList( const ScChangeTrack& rChangeTrack )
{
sal_uInt8 aGUID[ 16 ];
- sal_Bool bValidGUID = sal_False;
+ sal_Bool bValidGUID = false;
const ScStrCollection& rStrColl = rChangeTrack.GetUserCollection();
for( sal_uInt16 nIndex = 0; nIndex < rStrColl.GetCount(); nIndex++ )
{
@@ -354,6 +384,26 @@ sal_Size XclExpChTrHeader::GetLen() const
return 50;
}
+void XclExpChTrHeader::SaveXml( XclExpXmlStream& rRevisionHeadersStrm )
+{
+ sax_fastparser::FSHelperPtr pHeaders = rRevisionHeadersStrm.GetCurrentStream();
+ rRevisionHeadersStrm.WriteAttributes(
+ XML_guid, lcl_GuidToOString( aGUID ).getStr(),
+ XML_lastGuid, NULL, // OOXTODO
+ XML_shared, NULL, // OOXTODO
+ XML_diskRevisions, NULL, // OOXTODO
+ XML_history, NULL, // OOXTODO
+ XML_trackRevisions, NULL, // OOXTODO
+ XML_exclusive, NULL, // OOXTODO
+ XML_revisionId, NULL, // OOXTODO
+ XML_version, NULL, // OOXTODO
+ XML_keepChangeHistory, NULL, // OOXTODO
+ XML_protected, NULL, // OOXTODO
+ XML_preserveHistory, NULL, // OOXTODO
+ FSEND );
+ pHeaders->write( ">" );
+}
+
//___________________________________________________________________
XclExpChTrInfo::~XclExpChTrInfo()
@@ -384,6 +434,33 @@ sal_Size XclExpChTrInfo::GetLen() const
return 158;
}
+void XclExpChTrInfo::SaveXml( XclExpXmlStream& rRevisionHeadersStrm )
+{
+ sax_fastparser::FSHelperPtr pHeader = rRevisionHeadersStrm.GetCurrentStream();
+
+ OUString sRelationshipId;
+ sax_fastparser::FSHelperPtr pRevisionLog = rRevisionHeadersStrm.CreateOutputStream(
+ XclXmlUtils::GetStreamName( "xl/revisions/", "revisionLog", mnLogNumber ),
+ XclXmlUtils::GetStreamName( NULL, "revisionLog", mnLogNumber ),
+ rRevisionHeadersStrm.GetCurrentStream()->getOutputStream(),
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionLog",
+ &sRelationshipId );
+
+ rRevisionHeadersStrm.WriteAttributes(
+ XML_guid, lcl_GuidToOString( aGUID ).getStr(),
+ XML_dateTime, lcl_DateTimeToOString( aDateTime ).getStr(),
+ XML_maxSheetId, NULL, // OOXTODO
+ XML_userName, XclXmlUtils::ToOString( sUsername ).getStr(),
+ FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sRelationshipId ).getStr(),
+ XML_minRId, NULL, // OOXTODO
+ XML_maxRId, NULL, // OOXTODO
+ FSEND );
+ pHeader->write( ">" );
+
+ rRevisionHeadersStrm.PushStream( pRevisionLog );
+}
+
//___________________________________________________________________
XclExpChTrTabIdBuffer::XclExpChTrTabIdBuffer( sal_uInt16 nCount ) :
@@ -466,8 +543,9 @@ XclExpChTrTabIdBufferList::~XclExpChTrTabIdBufferList()
//___________________________________________________________________
-XclExpChTrTabId::XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer ) :
- nTabCount( rBuffer.GetBufferCount() )
+XclExpChTrTabId::XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer, bool bInRevisionHeaders )
+ : nTabCount( rBuffer.GetBufferCount() )
+ , mbInRevisionHeaders( bInRevisionHeaders )
{
pBuffer = new sal_uInt16[ nTabCount ];
rBuffer.GetBufferCopy( pBuffer );
@@ -507,6 +585,29 @@ sal_Size XclExpChTrTabId::GetLen() const
return nTabCount << 1;
}
+void XclExpChTrTabId::SaveXml( XclExpXmlStream& rRevisionLogStrm )
+{
+ if( !mbInRevisionHeaders )
+ return;
+
+ sax_fastparser::FSHelperPtr pRevisionLog = rRevisionLogStrm.GetCurrentStream();
+ rRevisionLogStrm.PopStream();
+
+ sax_fastparser::FSHelperPtr pHeader = rRevisionLogStrm.GetCurrentStream();
+ pHeader->startElement( XML_sheetIdMap,
+ XML_count, OString::valueOf( sal_Int32( nTabCount ) ).getStr(),
+ FSEND );
+ for( int i = 0; i < nTabCount; ++i )
+ {
+ pHeader->singleElement( XML_sheetId,
+ XML_val, OString::valueOf( sal_Int32( pBuffer[ i ] ) ).getStr(),
+ FSEND );
+ }
+ pHeader->endElement( XML_sheetIdMap );
+
+ rRevisionLogStrm.PushStream( pRevisionLog );
+}
+
//___________________________________________________________________
// ! does not copy additional actions
@@ -539,7 +640,7 @@ XclExpChTrAction::XclExpChTrAction(
rIdBuffer( rTabIdBuffer ),
nLength( 0 ),
nOpCode( nNewOpCode ),
- bForceInfo( sal_False )
+ bForceInfo( false )
{
aDateTime.SetSec( 0 );
aDateTime.Set100Sec( 0 );
@@ -613,6 +714,7 @@ sal_Size XclExpChTrAction::GetLen() const
XclExpChTrData::XclExpChTrData() :
pString( NULL ),
+ mpFormulaCell( NULL ),
fValue( 0.0 ),
nRKValue( 0 ),
nType( EXC_CHTR_TYPE_EMPTY ),
@@ -628,6 +730,7 @@ XclExpChTrData::~XclExpChTrData()
void XclExpChTrData::Clear()
{
DELETEZ( pString );
+ mpFormulaCell = NULL;
mxTokArr.reset();
maRefLog.clear();
fValue = 0.0;
@@ -638,7 +741,7 @@ void XclExpChTrData::Clear()
void XclExpChTrData::WriteFormula( XclExpStream& rStrm, const XclExpChTrTabIdBuffer& rTabIdBuffer )
{
- DBG_ASSERT( mxTokArr.is() && !mxTokArr->Empty(), "XclExpChTrData::Write - no formula" );
+ DBG_ASSERT( mxTokArr && !mxTokArr->Empty(), "XclExpChTrData::Write - no formula" );
rStrm << *mxTokArr;
for( XclExpRefLog::const_iterator aIt = maRefLog.begin(), aEnd = maRefLog.end(); aIt != aEnd; ++aIt )
@@ -697,8 +800,8 @@ XclExpChTrCellContent::XclExpChTrCellContent(
{
sal_uInt32 nDummy32;
sal_uInt16 nDummy16;
- GetCellData( rAction.GetOldCell(), pOldData, nDummy32, nOldLength );
- GetCellData( rAction.GetNewCell(), pNewData, nLength, nDummy16 );
+ GetCellData( rRoot, rAction.GetOldCell(), pOldData, nDummy32, nOldLength );
+ GetCellData( rRoot, rAction.GetNewCell(), pNewData, nLength, nDummy16 );
}
XclExpChTrCellContent::~XclExpChTrCellContent()
@@ -718,6 +821,7 @@ void XclExpChTrCellContent::MakeEmptyChTrData( XclExpChTrData*& rpData )
}
void XclExpChTrCellContent::GetCellData(
+ const XclExpRoot& rRoot,
const ScBaseCell* pScCell,
XclExpChTrData*& rpData,
sal_uInt32& rXclLength1,
@@ -760,9 +864,20 @@ void XclExpChTrCellContent::GetCellData(
{
String sCellStr;
if( pScCell->GetCellType() == CELLTYPE_STRING )
- ((const ScStringCell*) pScCell)->GetString( sCellStr );
+ {
+ const ScStringCell* pStrCell = static_cast< const ScStringCell* >( pScCell );
+ pStrCell->GetString( sCellStr );
+ rpData->mpFormattedString = XclExpStringHelper::CreateCellString( rRoot,
+ *pStrCell, NULL );
+ }
else
- ((const ScEditCell*) pScCell)->GetString( sCellStr );
+ {
+ const ScEditCell* pEditCell = static_cast< const ScEditCell* >( pScCell );
+ pEditCell->GetString( sCellStr );
+ XclExpHyperlinkHelper aLinkHelper( rRoot, aPosition );
+ rpData->mpFormattedString = XclExpStringHelper::CreateCellString( rRoot,
+ *pEditCell, NULL, aLinkHelper );
+ }
rpData->pString = new XclExpString( sCellStr, EXC_STR_DEFAULT, 32766 );
rpData->nType = EXC_CHTR_TYPE_STRING;
rpData->nSize = 3 + rpData->pString->GetSize();
@@ -773,6 +888,8 @@ void XclExpChTrCellContent::GetCellData(
case CELLTYPE_FORMULA:
{
const ScFormulaCell* pFmlCell = (const ScFormulaCell*) pScCell;
+ rpData->mpFormulaCell = pFmlCell;
+
const ScTokenArray* pTokenArray = pFmlCell->GetCode();
if( pTokenArray )
{
@@ -828,6 +945,107 @@ sal_Size XclExpChTrCellContent::GetActionByteCount() const
return nLen;
}
+static const char* lcl_GetType( XclExpChTrData* pData )
+{
+ switch( pData->nType )
+ {
+ case EXC_CHTR_TYPE_RK:
+ case EXC_CHTR_TYPE_DOUBLE:
+ return "n";
+ break;
+ case EXC_CHTR_TYPE_FORMULA:
+ {
+ ScFormulaCell* pFormulaCell = const_cast< ScFormulaCell* >( pData->mpFormulaCell );
+ const char* sType;
+ OUString sValue;
+ XclXmlUtils::GetFormulaTypeAndValue( *pFormulaCell, sType, sValue );
+ return sType;
+ }
+ break;
+ case EXC_CHTR_TYPE_STRING:
+ return "inlineStr";
+ break;
+ default:
+ break;
+ }
+ return "*unknown*";
+}
+
+static void lcl_WriteCell( XclExpXmlStream& rStrm, sal_Int32 nElement, const ScAddress& rPosition, XclExpChTrData* pData )
+{
+ sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream();
+
+ pStream->startElement( nElement,
+ XML_r, XclXmlUtils::ToOString( rPosition ).getStr(),
+ XML_s, NULL, // OOXTODO: not supported
+ XML_t, lcl_GetType( pData ),
+ XML_cm, NULL, // OOXTODO: not supported
+ XML_vm, NULL, // OOXTODO: not supported
+ XML_ph, NULL, // OOXTODO: not supported
+ FSEND );
+ switch( pData->nType )
+ {
+ case EXC_CHTR_TYPE_RK:
+ case EXC_CHTR_TYPE_DOUBLE:
+ pStream->startElement( XML_v, FSEND );
+ pStream->write( pData->fValue );
+ pStream->endElement( XML_v );
+ break;
+ case EXC_CHTR_TYPE_FORMULA:
+ pStream->startElement( XML_f,
+ // OOXTODO: other attributes? see XclExpFormulaCell::SaveXml()
+ FSEND );
+ pStream->writeEscaped( XclXmlUtils::ToOUString(
+ *pData->mpFormulaCell->GetDocument(),
+ pData->mpFormulaCell->aPos, pData->mpFormulaCell->GetCode() ) );
+ pStream->endElement( XML_f );
+ break;
+ case EXC_CHTR_TYPE_STRING:
+ pStream->startElement( XML_is, FSEND );
+ if( pData->mpFormattedString )
+ pData->mpFormattedString->WriteXml( rStrm );
+ else
+ pData->pString->WriteXml( rStrm );
+ pStream->endElement( XML_is );
+ break;
+ default:
+ // ignore
+ break;
+ }
+ pStream->endElement( nElement );
+}
+
+void XclExpChTrCellContent::SaveXml( XclExpXmlStream& rRevisionLogStrm )
+{
+ sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream();
+ pStream->startElement( XML_rcc,
+ XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(),
+ XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure.
+ XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted?
+ XML_sId, OString::valueOf( (sal_Int32) GetTabId( aPosition.Tab() ) ).getStr(),
+ XML_odxf, NULL, // OOXTODO: not supported
+ XML_xfDxf, NULL, // OOXTODO: not supported
+ XML_s, NULL, // OOXTODO: not supported
+ XML_dxf, NULL, // OOXTODO: not supported
+ XML_numFmtId, NULL, // OOXTODO: not supported
+ XML_quotePrefix, NULL, // OOXTODO: not supported
+ XML_oldQuotePrefix, NULL, // OOXTODO: not supported
+ XML_ph, NULL, // OOXTODO: not supported
+ XML_oldPh, NULL, // OOXTODO: not supported
+ XML_endOfListFormulaUpdate, NULL, // OOXTODO: not supported
+ FSEND );
+ if( pOldData )
+ {
+ lcl_WriteCell( rRevisionLogStrm, XML_oc, aPosition, pOldData );
+ }
+ if( pNewData )
+ {
+ lcl_WriteCell( rRevisionLogStrm, XML_nc, aPosition, pNewData );
+ }
+ // OOXTODO: XML_odxf, XML_ndxf, XML_extLst elements
+ pStream->endElement( XML_rcc );
+}
+
//___________________________________________________________________
XclExpChTrInsert::XclExpChTrInsert(
@@ -846,7 +1064,7 @@ XclExpChTrInsert::XclExpChTrInsert(
case SC_CAT_DELETE_COLS: nOpCode = EXC_CHTR_OP_DELCOL; break;
case SC_CAT_DELETE_ROWS: nOpCode = EXC_CHTR_OP_DELROW; break;
default:
- DBG_ERROR( "XclExpChTrInsert::XclExpChTrInsert - unknown action" );
+ OSL_FAIL( "XclExpChTrInsert::XclExpChTrInsert - unknown action" );
}
if( nOpCode & EXC_CHTR_OP_COLFLAG )
@@ -901,6 +1119,41 @@ sal_Size XclExpChTrInsert::GetActionByteCount() const
return 16;
}
+static const char* lcl_GetAction( sal_uInt16 nOpCode )
+{
+ switch( nOpCode )
+ {
+ case EXC_CHTR_OP_INSCOL: return "insertCol";
+ case EXC_CHTR_OP_INSROW: return "insertRow";
+ case EXC_CHTR_OP_DELCOL: return "deleteCol";
+ case EXC_CHTR_OP_DELROW: return "deleteRow";
+ default: return "*unknown*";
+ }
+}
+
+void XclExpChTrInsert::SaveXml( XclExpXmlStream& rRevisionLogStrm )
+{
+ sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream();
+ pStream->startElement( XML_rrc,
+ XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(),
+ XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure.
+ XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted?
+ XML_sId, OString::valueOf( (sal_Int32) GetTabId( aRange.aStart.Tab() ) ).getStr(),
+ XML_eol, NULL, // OOXTODO: not supported?
+ XML_ref, XclXmlUtils::ToOString( aRange ).getStr(),
+ XML_action, lcl_GetAction( nOpCode ),
+ XML_edge, NULL, // OOXTODO: ???
+ FSEND );
+ // OOXTODO: does this handle XML_rfmt, XML_undo?
+ XclExpChTrAction* pAction = GetAddAction();
+ while( pAction != NULL )
+ {
+ pAction->SaveXml( rRevisionLogStrm );
+ pAction = pAction->GetAddAction();
+ }
+ pStream->endElement( XML_rrc );
+}
+
//___________________________________________________________________
XclExpChTrInsertTab::XclExpChTrInsertTab(
@@ -938,6 +1191,19 @@ sal_Size XclExpChTrInsertTab::GetActionByteCount() const
return 276;
}
+void XclExpChTrInsertTab::SaveXml( XclExpXmlStream& rStrm )
+{
+ sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream();
+ pStream->singleElement( XML_ris,
+ XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(),
+ XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure.
+ XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted?
+ XML_sheetId, OString::valueOf( (sal_Int32) GetTabId( nTab ) ).getStr(),
+ XML_name, XclXmlUtils::ToOString( GetTabInfo().GetScTabName( nTab ) ).getStr(),
+ XML_sheetPosition, OString::valueOf( (sal_Int32) nTab ).getStr(),
+ FSEND );
+}
+
//___________________________________________________________________
XclExpChTrMoveRange::XclExpChTrMoveRange(
@@ -994,6 +1260,29 @@ sal_Size XclExpChTrMoveRange::GetActionByteCount() const
return 24;
}
+void XclExpChTrMoveRange::SaveXml( XclExpXmlStream& rRevisionLogStrm )
+{
+ sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream();
+
+ pStream->startElement( XML_rm,
+ XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(),
+ XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure.
+ XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted?
+ XML_sheetId, OString::valueOf( (sal_Int32) GetTabId( aDestRange.aStart.Tab() ) ).getStr(),
+ XML_source, XclXmlUtils::ToOString( aSourceRange ).getStr(),
+ XML_destination, XclXmlUtils::ToOString( aDestRange ).getStr(),
+ XML_sourceSheetId, OString::valueOf( (sal_Int32) GetTabId( aSourceRange.aStart.Tab() ) ).getStr(),
+ FSEND );
+ // OOXTODO: does this handle XML_rfmt, XML_undo?
+ XclExpChTrAction* pAction = GetAddAction();
+ while( pAction != NULL )
+ {
+ pAction->SaveXml( rRevisionLogStrm );
+ pAction = pAction->GetAddAction();
+ }
+ pStream->endElement( XML_rm );
+}
+
//___________________________________________________________________
XclExpChTr0x014A::XclExpChTr0x014A( const XclExpChTrInsert& rAction ) :
@@ -1025,6 +1314,23 @@ sal_Size XclExpChTr0x014A::GetActionByteCount() const
return 14;
}
+void XclExpChTr0x014A::SaveXml( XclExpXmlStream& rStrm )
+{
+ sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream();
+
+ pStream->startElement( XML_rfmt,
+ XML_sheetId, OString::valueOf( (sal_Int32) GetTabId( aRange.aStart.Tab() ) ).getStr(),
+ XML_xfDxf, NULL, // OOXTODO: not supported
+ XML_s, NULL, // OOXTODO: style
+ XML_sqref, XclXmlUtils::ToOString( aRange ).getStr(),
+ XML_start, NULL, // OOXTODO: for string changes
+ XML_length, NULL, // OOXTODO: for string changes
+ FSEND );
+ // OOXTODO: XML_dxf, XML_extLst
+
+ pStream->endElement( XML_rfmt );
+}
+
//___________________________________________________________________
XclExpChTrActionStack::~XclExpChTrActionStack()
@@ -1061,8 +1367,99 @@ void XclExpChTrRecordList::Save( XclExpStream& rStrm )
pRec->Save( rStrm );
}
+void XclExpChTrRecordList::SaveXml( XclExpXmlStream& rStrm )
+{
+ for( ExcRecord* pRec = First(); pRec; pRec = Next() )
+ pRec->SaveXml( rStrm );
+}
+
//___________________________________________________________________
+class ExcXmlRecord : public ExcRecord
+{
+public:
+ virtual sal_Size GetLen() const;
+ virtual UINT16 GetNum() const;
+ virtual void Save( XclExpStream& rStrm );
+ virtual void SaveXml( XclExpXmlStream& rStrm ) = 0;
+};
+
+sal_Size ExcXmlRecord::GetLen() const
+{
+ return 0;
+}
+
+UINT16 ExcXmlRecord::GetNum() const
+{
+ return 0;
+}
+
+void ExcXmlRecord::Save( XclExpStream& )
+{
+ // Do nothing; ignored for BIFF output.
+}
+
+class StartXmlElement : public ExcXmlRecord
+{
+public:
+ enum Behavior {
+ CLOSE_ELEMENT = 0x1,
+ WRITE_NAMESPACES = 0x2,
+ };
+ StartXmlElement( sal_Int32 nElement, sal_Int32 eBehavior )
+ : mnElement( nElement ), meBehavior( (Behavior) eBehavior ) {}
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+ sal_Int32 mnElement;
+ Behavior meBehavior;
+};
+
+void StartXmlElement::SaveXml( XclExpXmlStream& rStrm )
+{
+ sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream();
+ pStream->write( "<" )
+ ->writeId( mnElement );
+ if( meBehavior & WRITE_NAMESPACES )
+ {
+ rStrm.WriteAttributes(
+ XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ FSEND );
+ }
+ if( meBehavior & CLOSE_ELEMENT )
+ {
+ pStream->write( ">" );
+ }
+}
+
+class EndXmlElement : public ExcXmlRecord
+{
+ sal_Int32 mnElement;
+public:
+ EndXmlElement( sal_Int32 nElement ) : mnElement( nElement) {}
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+};
+
+void EndXmlElement::SaveXml( XclExpXmlStream& rStrm )
+{
+ rStrm.GetCurrentStream()->endElement( mnElement );
+}
+
+class EndHeaderElement : public EndXmlElement
+{
+public:
+ EndHeaderElement() : EndXmlElement( XML_header ) {}
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+};
+
+void EndHeaderElement::SaveXml( XclExpXmlStream& rStrm )
+{
+ // Remove the `xl/revisions/revisionLogX.xml' file from the stack
+ rStrm.PopStream();
+
+ EndXmlElement::SaveXml( rStrm );
+}
+
XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) :
XclExpRoot( rRoot ),
aRecList(),
@@ -1072,7 +1469,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) :
pTempDoc( NULL ),
nNewAction( 1 ),
pHeader( NULL ),
- bValidGUID( sal_False )
+ bValidGUID( false )
{
DBG_ASSERT( GetOldRoot().pTabId, "XclExpChangeTrack::XclExpChangeTrack - root data incomplete" );
if( !GetOldRoot().pTabId )
@@ -1110,6 +1507,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) :
// build record list
pHeader = new XclExpChTrHeader;
+ aRecList.Append( new StartXmlElement( XML_headers, StartXmlElement::WRITE_NAMESPACES ) );
aRecList.Append( pHeader );
aRecList.Append( new XclExpChTr0x0195 );
aRecList.Append( new XclExpChTr0x0194( *pTempChangeTrack ) );
@@ -1117,17 +1515,27 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) :
String sLastUsername;
DateTime aLastDateTime;
sal_uInt32 nIndex = 1;
+ sal_Int32 nLogNumber = 1;
while( XclExpChTrAction* pAction = aActionStack.Pop() )
{
if( (nIndex == 1) || pAction->ForceInfoRecord() ||
(pAction->GetUsername() != sLastUsername) ||
(pAction->GetDateTime() != aLastDateTime) )
{
+ if( nIndex != 1 )
+ {
+ aRecList.Append( new EndXmlElement( XML_revisions ) );
+ aRecList.Append( new EndHeaderElement() );
+ }
+
lcl_GenerateGUID( aGUID, bValidGUID );
sLastUsername = pAction->GetUsername();
aLastDateTime = pAction->GetDateTime();
- aRecList.Append( new XclExpChTrInfo( sLastUsername, aLastDateTime, aGUID ) );
- aRecList.Append( new XclExpChTrTabId( pAction->GetTabIdBuffer() ) );
+
+ aRecList.Append( new StartXmlElement( XML_header, 0 ) );
+ aRecList.Append( new XclExpChTrInfo( sLastUsername, aLastDateTime, aGUID, nLogNumber++ ) );
+ aRecList.Append( new XclExpChTrTabId( pAction->GetTabIdBuffer(), true ) );
+ aRecList.Append( new StartXmlElement( XML_revisions, StartXmlElement::WRITE_NAMESPACES | StartXmlElement::CLOSE_ELEMENT ) );
pHeader->SetGUID( aGUID );
}
pAction->SetIndex( nIndex );
@@ -1136,6 +1544,12 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) :
pHeader->SetGUID( aGUID );
pHeader->SetCount( nIndex - 1 );
+ if( nLogNumber > 1 )
+ {
+ aRecList.Append( new EndXmlElement( XML_revisions ) );
+ aRecList.Append( new EndHeaderElement() );
+ }
+ aRecList.Append( new EndXmlElement( XML_headers ) );
aRecList.Append( new ExcEof );
}
@@ -1170,7 +1584,7 @@ ScChangeTrack* XclExpChangeTrack::CreateTempChangeTrack()
DBG_ASSERT( nOrigCount == pTempDoc->GetTableCount(),
"XclExpChangeTrack::CreateTempChangeTrack - table count mismatch" );
if( nOrigCount != pTempDoc->GetTableCount() )
- return sal_False;
+ return false;
return pOrigChangeTrack->Clone(pTempDoc);
}
@@ -1212,7 +1626,7 @@ void XclExpChangeTrack::PushActionRecord( const ScChangeAction& rAction )
sal_Bool XclExpChangeTrack::WriteUserNamesStream()
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
SotStorageStreamRef xSvStrm = OpenStream( EXC_STREAM_USERNAMES );
DBG_ASSERT( xSvStrm.Is(), "XclExpChangeTrack::WriteUserNamesStream - no stream" );
if( xSvStrm.Is() )
@@ -1246,3 +1660,46 @@ void XclExpChangeTrack::Write()
}
}
+static void lcl_WriteUserNamesXml( XclExpXmlStream& rWorkbookStrm )
+{
+ sax_fastparser::FSHelperPtr pUserNames = rWorkbookStrm.CreateOutputStream(
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "xl/revisions/userNames.xml" )),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "revisions/userNames.xml" )),
+ rWorkbookStrm.GetCurrentStream()->getOutputStream(),
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/usernames" );
+ pUserNames->startElement( XML_users,
+ XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ XML_count, "0",
+ FSEND );
+ // OOXTODO: XML_userinfo elements for each user editing the file
+ // Doesn't seem to be supported by .xls output either (based on
+ // contents of XclExpChangeTrack::WriteUserNamesStream()).
+ pUserNames->endElement( XML_users );
+}
+
+void XclExpChangeTrack::WriteXml( XclExpXmlStream& rWorkbookStrm )
+{
+ if( !aRecList.Count() )
+ return;
+
+ lcl_WriteUserNamesXml( rWorkbookStrm );
+
+ sax_fastparser::FSHelperPtr pRevisionHeaders = rWorkbookStrm.CreateOutputStream(
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "xl/revisions/revisionHeaders.xml" )),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "revisions/revisionHeaders.xml" )),
+ rWorkbookStrm.GetCurrentStream()->getOutputStream(),
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionHeaders" );
+ // OOXTODO: XML_userinfo elements for each user editing the file
+ // Doesn't seem to be supported by .xls output either (based on
+ // contents of XclExpChangeTrack::WriteUserNamesStream()).
+ rWorkbookStrm.PushStream( pRevisionHeaders );
+
+ aRecList.SaveXml( rWorkbookStrm );
+
+ rWorkbookStrm.PopStream();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
index 0de711b888e5..7cf584f317b0 100644
--- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,7 +50,7 @@ XclImpChangeTrack::XclImpChangeTrack( const XclImpRoot& rRoot, const XclImpStrea
pChangeTrack( NULL ),
pStrm( NULL ),
nTabIdCount( 0 ),
- bGlobExit( sal_False ),
+ bGlobExit( false ),
eNestedMode( nmBase )
{
// Verify that the User Names stream exists before going any further. Excel adds both
@@ -145,8 +146,8 @@ sal_Bool XclImpChangeTrack::CheckRecord( sal_uInt16 nOpCode )
{
if( (nOpCode != EXC_CHTR_OP_UNKNOWN) && (aRecHeader.nOpCode != nOpCode) )
{
- DBG_ERROR( "XclImpChangeTrack::CheckRecord - unknown action" );
- return sal_False;
+ OSL_FAIL( "XclImpChangeTrack::CheckRecord - unknown action" );
+ return false;
}
return aRecHeader.nIndex != 0;
}
@@ -265,7 +266,7 @@ void XclImpChangeTrack::ReadCell(
}
break;
default:
- DBG_ERROR( "XclImpChangeTrack::ReadCell - unknown data type" );
+ OSL_FAIL( "XclImpChangeTrack::ReadCell - unknown data type" );
}
}
@@ -279,7 +280,7 @@ void XclImpChangeTrack::ReadChTrInsert()
(aRecHeader.nOpCode != EXC_CHTR_OP_DELROW) &&
(aRecHeader.nOpCode != EXC_CHTR_OP_DELCOL) )
{
- DBG_ERROR( "XclImpChangeTrack::ReadChTrInsert - unknown action" );
+ OSL_FAIL( "XclImpChangeTrack::ReadChTrInsert - unknown action" );
return;
}
@@ -350,7 +351,7 @@ void XclImpChangeTrack::ReadChTrCellContent()
case 0x0000: break;
case 0x1100: pStrm->Ignore( 16 ); break;
case 0x1300: pStrm->Ignore( 8 ); break;
- default: DBG_ERROR( "XclImpChangeTrack::ReadChTrCellContent - unknown format info" );
+ default: OSL_FAIL( "XclImpChangeTrack::ReadChTrCellContent - unknown format info" );
}
ScBaseCell* pOldCell;
@@ -361,7 +362,7 @@ void XclImpChangeTrack::ReadChTrCellContent()
ReadCell( pNewCell, nNewFormat, nNewValueType, aPosition );
if( !pStrm->IsValid() || (pStrm->GetRecLeft() > 0) )
{
- DBG_ERROR( "XclImpChangeTrack::ReadChTrCellContent - bytes left, action ignored" );
+ OSL_FAIL( "XclImpChangeTrack::ReadChTrCellContent - bytes left, action ignored" );
if( pOldCell )
pOldCell->Delete();
if( pNewCell )
@@ -449,7 +450,7 @@ sal_Bool XclImpChangeTrack::EndNestedMode()
void XclImpChangeTrack::ReadRecords()
{
- sal_Bool bExitLoop = sal_False;
+ sal_Bool bExitLoop = false;
while( !bExitLoop && !bGlobExit && pStrm->StartNextRecord() )
{
@@ -475,7 +476,7 @@ void XclImpChangeTrack::Apply()
if( pChangeTrack )
{
pChangeTrack->SetUser( sOldUsername );
- pChangeTrack->SetUseFixDateTime( sal_False );
+ pChangeTrack->SetUseFixDateTime( false );
GetDoc().SetChangeTrack( pChangeTrack );
pChangeTrack = NULL;
@@ -500,3 +501,4 @@ bool XclImpChTrFmlConverter::Read3DTabReference( sal_uInt16 /*nIxti*/, SCTAB& rF
return rChangeTrack.Read3DTabRefInfo( rFirstTab, rLastTab, rExtInfo );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xcl97/makefile.mk b/sc/source/filter/xcl97/makefile.mk
index 3ce71ba142df..0ce4670875b2 100644
--- a/sc/source/filter/xcl97/makefile.mk
+++ b/sc/source/filter/xcl97/makefile.mk
@@ -40,20 +40,17 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/xcl97esc.obj \
- $(SLO)$/xcl97rec.obj \
- $(SLO)$/XclImpChangeTrack.obj \
- $(SLO)$/XclExpChangeTrack.obj
+SLOFILES = \
+ $(EXCEPTIONSFILES)
-EXCEPTIONSFILES = \
- $(SLO)$/xcl97esc.obj \
+EXCEPTIONSFILES = \
+ $(SLO)$/XclImpChangeTrack.obj \
+ $(SLO)$/XclExpChangeTrack.obj \
+ $(SLO)$/xcl97esc.obj \
$(SLO)$/xcl97rec.obj
# --- Targets -------------------------------------------------------
diff --git a/sc/source/filter/xcl97/xcl97dum.cxx b/sc/source/filter/xcl97/xcl97dum.cxx
index 50525bad8ff0..1eafabf2fb73 100644
--- a/sc/source/filter/xcl97/xcl97dum.cxx
+++ b/sc/source/filter/xcl97/xcl97dum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -161,3 +162,4 @@ const sal_uInt8* ExcDummy8_02::GetData() const
return pMyData;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 834a417ca329..75bb0335f9d6 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,6 +55,9 @@
#include "global.hxx"
#include "document.hxx"
#include "drwlayer.hxx"
+#include "xecontent.hxx"
+#include <editeng/flditem.hxx>
+#include "userdat.hxx"
#include "xcl97rec.hxx"
#include "xehelper.hxx"
#include "xechart.hxx"
@@ -210,7 +214,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
pCurrAppData = new XclEscherHostAppData;
SdrObject* pObj = GetSdrObjectFromXShape( rxShape );
if ( !pObj )
- pCurrXclObj = new XclObjAny( mrObjMgr ); // just what is it?!?
+ pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); // just what is it?!?
else
{
pCurrXclObj = NULL;
@@ -235,10 +239,10 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
pCurrXclObj = new XclObjOle( mrObjMgr, *pObj );
}
else // just a metafile
- pCurrXclObj = new XclObjAny( mrObjMgr );
+ pCurrXclObj = new XclObjAny( mrObjMgr, rxShape );
}
else
- pCurrXclObj = new XclObjAny( mrObjMgr );
+ pCurrXclObj = new XclObjAny( mrObjMgr, rxShape );
}
else if( nObjType == OBJ_UNO )
{
@@ -250,13 +254,14 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor );
#endif
if( !pCurrXclObj )
- pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile
+ pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); // just a metafile
}
else if( !ScDrawLayer::IsNoteCaption( pObj ) )
{
- // #107540# ignore permanent note shapes
+ // ignore permanent note shapes
// #i12190# do not ignore callouts (do not filter by object type ID)
- pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile
+ pCurrXclObj = ShapeInteractionHelper::CreateShapeObj( mrObjMgr, rxShape );
+ ShapeInteractionHelper::PopulateShapeInteractionInfo( mrObjMgr, rxShape, *pCurrAppData );
}
}
if ( pCurrXclObj )
@@ -359,7 +364,6 @@ EscherExHostAppData* XclEscherEx::EnterAdditionalTextGroup()
return pCurrAppData;
}
-
void XclEscherEx::EndDocument()
{
if( mbIsRootDff )
@@ -478,6 +482,7 @@ void XclEscherEx::DeleteCurrAppData()
delete pCurrAppData->GetClientAnchor();
// delete pCurrAppData->GetClientData();
delete pCurrAppData->GetClientTextbox();
+ delete pCurrAppData->GetInteractionInfo();
delete pCurrAppData;
}
}
@@ -509,4 +514,41 @@ void XclEscherClientTextbox::WriteData( EscherEx& /*rEx*/ ) const
pXclObj->SetText( GetRoot(), rTextObj );
}
+XclExpShapeObj*
+ShapeInteractionHelper::CreateShapeObj( XclExpObjectManager& rObjMgr, const Reference< XShape >& xShape )
+{
+ return new XclExpShapeObj( rObjMgr, xShape );
+}
+
+void
+ShapeInteractionHelper::PopulateShapeInteractionInfo( XclExpObjectManager& rObjMgr, const Reference< XShape >& xShape, EscherExHostAppData& rHostAppData )
+{
+ try
+ {
+ SvMemoryStream* pMemStrm = NULL;
+ rtl::OUString sHyperLink;
+ rtl::OUString sMacro;
+ if ( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( ::GetSdrObjectFromXShape( xShape ) ) )
+ {
+ sHyperLink = pInfo->GetHlink();
+ sMacro = pInfo->GetMacro();
+ }
+ if ( sHyperLink.getLength() > 0 )
+ {
+ pMemStrm = new SvMemoryStream();
+ XclExpStream tmpStream( *pMemStrm, rObjMgr.GetRoot() );
+ ScAddress dummyAddress;
+ SvxURLField aUrlField;
+ aUrlField.SetURL( sHyperLink );
+ XclExpHyperlink hExpHlink( rObjMgr.GetRoot(), aUrlField, dummyAddress );
+ hExpHlink.WriteEmbeddedData( tmpStream );
+ }
+ if ( ( sHyperLink.getLength() > 0 ) || ( sMacro.getLength() > 0 ) )
+ rHostAppData.SetInteractionInfo( new InteractionInfo( pMemStrm, true ) );
+ }
+ catch( Exception& )
+ {
+ }
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 8a5ddb619b7c..69ae4eadbaa9 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,20 +78,32 @@
#include "patattr.hxx"
#include "tabprotection.hxx"
-using namespace ::oox;
+#include <com/sun/star/sheet/XCellAddressable.hpp>
+#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <oox/core/tokens.hxx>
+#include <oox/export/shapes.hxx>
+#include <oox/export/utils.hxx>
+#include <oox/export/vmlexport.hxx>
using ::rtl::OString;
using ::rtl::OUString;
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
+using ::oox::drawingml::DrawingML;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::drawing::XShape;
+using ::oox::drawingml::ShapeExport;
+using ::oox::vml::VMLExport;
// ============================================================================
+sal_Int32 XclExpObjList::mnDrawingMLCount;
+sal_Int32 XclExpObjList::mnVmlCount;
+
XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx ) :
XclExpRoot( rRoot ),
+ mnScTab( rRoot.GetCurrScTab() ),
mrEscherEx( rEscherEx ),
pSolverContainer( 0 )
{
@@ -118,6 +131,7 @@ sal_uInt16 XclExpObjList::Add( XclObj* pObj )
Insert( pObj, LIST_APPEND );
sal_uInt16 nCnt = (sal_uInt16) Count();
pObj->SetId( nCnt );
+ pObj->SetTab( mnScTab );
return nCnt;
}
else
@@ -149,6 +163,128 @@ void XclExpObjList::Save( XclExpStream& rStrm )
pSolverContainer->Save( rStrm );
}
+static bool IsVmlObject( const XclObj& rObj )
+{
+ switch( rObj.GetObjType() )
+ {
+ case EXC_OBJTYPE_NOTE:
+ return true;
+ default:
+ return false;
+ }
+}
+
+
+static sal_Int32 GetVmlObjectCount( XclExpObjList& rList )
+{
+ sal_Int32 nNumVml = 0;
+
+ for ( XclObj* p = rList.First(); p; p = rList.Next() )
+ if( IsVmlObject( *p ) )
+ ++nNumVml;
+
+ return nNumVml;
+}
+
+
+static void SaveDrawingMLObjects( XclExpObjList& rList, XclExpXmlStream& rStrm, sal_Int32& nDrawingMLCount )
+{
+ sal_Int32 nVmlObjects = GetVmlObjectCount( rList );
+ if( (rList.Count() - nVmlObjects) == 0 )
+ return;
+
+ sal_Int32 nDrawing = ++nDrawingMLCount;
+ OUString sId;
+ sax_fastparser::FSHelperPtr pDrawing = rStrm.CreateOutputStream(
+ XclXmlUtils::GetStreamName( "xl/", "drawings/drawing", nDrawing ),
+ XclXmlUtils::GetStreamName( "../", "drawings/drawing", nDrawing ),
+ rStrm.GetCurrentStream()->getOutputStream(),
+ "application/vnd.openxmlformats-officedocument.drawing+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
+ &sId );
+
+ rStrm.GetCurrentStream()->singleElement( XML_drawing,
+ FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(),
+ FSEND );
+
+ rStrm.PushStream( pDrawing );
+ pDrawing->startElement( FSNS( XML_xdr, XML_wsDr ),
+ FSNS( XML_xmlns, XML_xdr ), "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
+ FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main",
+ FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ FSEND );
+
+ for ( XclObj* p = rList.First(); p; p = rList.Next() )
+ {
+ if( IsVmlObject( *p ) )
+ continue;
+ p->SaveXml( rStrm );
+ }
+
+ pDrawing->endElement( FSNS( XML_xdr, XML_wsDr ) );
+
+ rStrm.PopStream();
+}
+
+
+static void SaveVmlObjects( XclExpObjList& rList, XclExpXmlStream& rStrm, sal_Int32& nVmlCount )
+{
+ if( GetVmlObjectCount( rList ) == 0 )
+ return;
+
+ sal_Int32 nDrawing = ++nVmlCount;
+ OUString sId;
+ sax_fastparser::FSHelperPtr pVmlDrawing = rStrm.CreateOutputStream(
+ XclXmlUtils::GetStreamName( "xl/", "drawings/vmlDrawing", nDrawing ),
+ XclXmlUtils::GetStreamName( "../", "drawings/vmlDrawing", nDrawing ),
+ rStrm.GetCurrentStream()->getOutputStream(),
+ "application/vnd.openxmlformats-officedocument.vmlDrawing",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
+ &sId );
+
+ rStrm.GetCurrentStream()->singleElement( XML_legacyDrawing,
+ FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(),
+ FSEND );
+
+ rStrm.PushStream( pVmlDrawing );
+ pVmlDrawing->startElement( XML_xml,
+ FSNS( XML_xmlns, XML_v ), "urn:schemas-microsoft-com:vml",
+ FSNS( XML_xmlns, XML_o ), "urn:schemas-microsoft-com:office:office",
+ FSNS( XML_xmlns, XML_x ), "urn:schemas-microsoft-com:office:excel",
+ FSEND );
+
+ for ( XclObj* p = rList.First(); p; p = rList.Next() )
+ {
+ if( !IsVmlObject( *p ) )
+ continue;
+ p->SaveXml( rStrm );
+ }
+
+ pVmlDrawing->endElement( XML_xml );
+
+ rStrm.PopStream();
+}
+
+
+void XclExpObjList::SaveXml( XclExpXmlStream& rStrm )
+{
+ if( pSolverContainer )
+ pSolverContainer->SaveXml( rStrm );
+
+ if( Count() == 0 )
+ return;
+
+ SaveDrawingMLObjects( *this, rStrm, mnDrawingMLCount );
+ SaveVmlObjects( *this, rStrm, mnVmlCount );
+}
+
+
+void XclExpObjList::ResetCounters()
+{
+ mnDrawingMLCount = 0;
+ mnVmlCount = 0;
+}
+
// --- class XclObj --------------------------------------------------
XclObj::XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher ) :
@@ -286,69 +422,80 @@ void XclObj::SaveTextRecs( XclExpStream& rStrm )
pTxo->Save( rStrm );
}
-// --- class XclObjComment -------------------------------------------
+ // --- class XclObjComment ------------------------------------------
-XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ) :
+XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const Rectangle& rRect, const EditTextObject& rEditObj, SdrCaptionObj* pCaption, bool bVisible, const ScAddress& rAddress, Rectangle &rFrom, Rectangle &rTo ) :
XclObj( rObjMgr, EXC_OBJTYPE_NOTE, true )
+ , maScPos( rAddress )
+ , mpCaption( static_cast< SdrCaptionObj* >( pCaption->Clone() ) )
+ , mbVisible( bVisible )
+ , maFrom ( rFrom )
+ , maTo ( rTo )
{
ProcessEscherObj( rObjMgr.GetRoot(), rRect, pCaption, bVisible);
// TXO
pTxo = new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption );
}
-void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle& rRect, SdrObject* pCaption, const bool bVisible )
+static void lcl_FillProps( EscherPropertyContainer& rPropOpt, SdrObject* pCaption, bool bVisible )
{
- Reference<XShape> aXShape;
- EscherPropertyContainer aPropOpt;
-
- if(pCaption)
+ if( pCaption )
{
- aXShape = GetXShapeForSdrObject(pCaption);
+ Reference< XShape > aXShape = GetXShapeForSdrObject( pCaption );
Reference< XPropertySet > aXPropSet( aXShape, UNO_QUERY );
if( aXPropSet.is() )
{
- aPropOpt.CreateFillProperties( aXPropSet, sal_True);
+ rPropOpt.CreateFillProperties( aXPropSet, sal_True);
- aPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // undocumented
- aPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented
+ rPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // undocumented
+ rPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented
sal_uInt32 nValue = 0;
- if(!aPropOpt.GetOpt( ESCHER_Prop_FitTextToShape, nValue ))
- aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
+ if( !rPropOpt.GetOpt( ESCHER_Prop_FitTextToShape, nValue ) )
+ rPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
- if(aPropOpt.GetOpt( ESCHER_Prop_fillColor, nValue ))
+ if( rPropOpt.GetOpt( ESCHER_Prop_fillColor, nValue ) )
{
// If the Colour is the same as the 'ToolTip' System colour then
// use the default rather than the explicit colour value. This will
// be incorrect where user has chosen to use this colour explicity.
Color aColor = Color( (sal_uInt8)nValue, (sal_uInt8)( nValue >> 8 ), (sal_uInt8)( nValue >> 16 ) );
const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
- if(aColor == rSett.GetHelpColor().GetColor())
+ if( aColor == rSett.GetHelpColor().GetColor() )
{
- aPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 );
- aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 );
+ rPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 );
+ rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 );
}
}
else
- aPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 );
-
- if(!aPropOpt.GetOpt( ESCHER_Prop_fillBackColor, nValue ))
- aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 );
- if(!aPropOpt.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ))
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 ); // bool field
- if(!aPropOpt.GetOpt( ESCHER_Prop_shadowColor, nValue ))
- aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x00000000 );
- if(!aPropOpt.GetOpt( ESCHER_Prop_fshadowObscured, nValue )) // bool field
- aPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // bool field
+ rPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 );
+
+ if( !rPropOpt.GetOpt( ESCHER_Prop_fillBackColor, nValue ) )
+ rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 );
+ if( !rPropOpt.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) )
+ rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 ); // bool field
+ if( !rPropOpt.GetOpt( ESCHER_Prop_shadowColor, nValue ) )
+ rPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x00000000 );
+ if( !rPropOpt.GetOpt( ESCHER_Prop_fshadowObscured, nValue ) ) // bool field
+ rPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // bool field
}
}
+ sal_uInt32 nFlags = 0x000A0000;
+ ::set_flag( nFlags, sal_uInt32(2), !bVisible );
+ rPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
+}
+
+void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle& rRect, SdrObject* pCaption, const bool bVisible )
+{
+ EscherPropertyContainer aPropOpt;
+
+
+ lcl_FillProps( aPropOpt, pCaption, bVisible );
+
nGrbit = 0; // all off: AutoLine, AutoFill, Printable, Locked
mrEscherEx.OpenContainer( ESCHER_SpContainer );
mrEscherEx.AddShape( ESCHER_ShpInst_TextBox, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
- sal_uInt32 nFlags = 0x000A0000;
- ::set_flag( nFlags, sal_uInt32(2), !bVisible );
- aPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
aPropOpt.Commit( mrEscherEx.GetStream() );
XclExpDffNoteAnchor( rRoot, rRect ).WriteDffData( mrEscherEx );
@@ -374,6 +521,82 @@ void XclObjComment::Save( XclExpStream& rStrm )
XclObj::Save( rStrm );
}
+class VmlCommentExporter : public VMLExport
+{
+ ScAddress maScPos;
+ SdrCaptionObj* mpCaption;
+ bool mbVisible;
+ Rectangle maFrom;
+ Rectangle maTo;
+
+public:
+ VmlCommentExporter ( sax_fastparser::FSHelperPtr p, ScAddress aScPos, SdrCaptionObj* pCaption, bool bVisible, Rectangle &aFrom, Rectangle &aTo );
+protected:
+ virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+ virtual sal_Int32 StartShape();
+ virtual void EndShape( sal_Int32 nShapeElement );
+};
+
+
+VmlCommentExporter::VmlCommentExporter( sax_fastparser::FSHelperPtr p, ScAddress aScPos, SdrCaptionObj* pCaption,
+ bool bVisible, Rectangle &aFrom, Rectangle &aTo )
+ : VMLExport( p )
+ , maScPos( aScPos )
+ , mpCaption( pCaption )
+ , mbVisible( bVisible )
+ , maFrom ( aFrom )
+ , maTo ( aTo )
+{
+}
+
+void VmlCommentExporter::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect )
+{
+ lcl_FillProps( rProps, mpCaption, mbVisible );
+ rProps.AddOpt( ESCHER_Prop_fHidden, 1 ); // bool field
+
+ VMLExport::Commit( rProps, rRect );
+}
+
+sal_Int32 VmlCommentExporter::StartShape()
+{
+ AddShapeAttribute( XML_type, OString( "#_x0000_t202") );
+
+ sal_Int32 nId = VMLExport::StartShape();
+
+ return nId;
+}
+
+void VmlCommentExporter::EndShape( sal_Int32 nShapeElement )
+{
+ char pAnchor[100];
+ sax_fastparser::FSHelperPtr pVmlDrawing = GetFS();
+ snprintf( pAnchor, 100, "%ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld",
+ maFrom.Left(), maFrom.Top(), maFrom.Right(), maFrom.Bottom(),
+ maTo.Left(), maTo.Top(), maTo.Right(), maTo.Bottom() );
+
+ pVmlDrawing->startElement( FSNS( XML_x, XML_ClientData ),
+ XML_ObjectType, "Note",
+ FSEND );
+ pVmlDrawing->singleElement( FSNS( XML_x, XML_MoveWithCells ),
+ FSEND );
+ pVmlDrawing->singleElement( FSNS( XML_x, XML_SizeWithCells ),
+ FSEND );
+ XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Anchor ), pAnchor );
+ XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_AutoFill ), "False" );
+ XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Row ), maScPos.Row() );
+ XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Column ), sal_Int32( maScPos.Col() ) );
+ pVmlDrawing->endElement( FSNS( XML_x, XML_ClientData ) );
+
+ VMLExport::EndShape( nShapeElement );
+}
+
+void XclObjComment::SaveXml( XclExpXmlStream& rStrm )
+{
+ VmlCommentExporter aCommentExporter( rStrm.GetCurrentStream(), maScPos, mpCaption.get(), mbVisible, maFrom, maTo );
+ aCommentExporter.AddSdrObject( *mpCaption );
+}
+
+
// --- class XclObjDropDown ------------------------------------------
XclObjDropDown::XclObjDropDown( XclExpObjectManager& rObjMgr, const ScAddress& rPos, sal_Bool bFilt ) :
@@ -381,9 +604,9 @@ XclObjDropDown::XclObjDropDown( XclExpObjectManager& rObjMgr, const ScAddress& r
bIsFiltered( bFilt )
{
SetLocked( sal_True );
- SetPrintable( sal_False );
+ SetPrintable( false );
SetAutoFill( sal_True );
- SetAutoLine( sal_False );
+ SetAutoLine( false );
nGrbit |= 0x0100; // undocumented
mrEscherEx.OpenContainer( ESCHER_SpContainer );
mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
@@ -602,7 +825,7 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
sal_Char aBuf[ sizeof(sal_uInt32) * 2 + 1 ];
// FIXME Eeek! Is this just a way to get a unique id?
sal_uInt32 nPictureId = sal_uInt32(sal_uIntPtr(this) >> 2);
- sprintf( aBuf, "%08X", static_cast< unsigned int >( nPictureId ) ); // #100211# - checked
+ sprintf( aBuf, "%08X", static_cast< unsigned int >( nPictureId ) );
aStorageName.AppendAscii( aBuf );
SotStorageRef xOleStg = pRootStorage->OpenSotStorage( aStorageName,
STREAM_READWRITE| STREAM_SHARE_DENYALL );
@@ -672,8 +895,9 @@ void XclObjOle::Save( XclExpStream& rStrm )
// --- class XclObjAny -------------------------------------------
-XclObjAny::XclObjAny( XclExpObjectManager& rObjMgr ) :
- XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN )
+XclObjAny::XclObjAny( XclExpObjectManager& rObjMgr, const Reference< XShape >& rShape )
+ : XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN )
+ , mxShape( rShape )
{
}
@@ -709,6 +933,87 @@ ExcBof8_Base::ExcBof8_Base()
nFileHistory = 0x00000000;
nLowestBiffVer = 0x00000006; // Biff8
}
+void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >& rShape, SCTAB nTab )
+{
+ sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
+
+ awt::Point aTopLeft = rShape->getPosition();
+ awt::Size aSize = rShape->getSize();
+ Rectangle aLocation( aTopLeft.X, aTopLeft.Y, aTopLeft.X + aSize.Width, aTopLeft.Y + aSize.Height );
+ ScRange aRange = rStrm.GetRoot().GetDoc().GetRange( nTab, aLocation );
+ Rectangle aRangeRect = rStrm.GetRoot().GetDoc().GetMMRect( aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col()-1, aRange.aEnd.Row()-1,
+ nTab );
+
+
+ pDrawing->startElement( FSNS( XML_xdr, XML_from ),
+ FSEND );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aStart.Col() );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
+ MM100toEMU( aLocation.Left() - aRangeRect.Left() ) );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aStart.Row() );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
+ MM100toEMU( aLocation.Top() - aRangeRect.Top() ) );
+ pDrawing->endElement( FSNS( XML_xdr, XML_from ) );
+
+ pDrawing->startElement( FSNS( XML_xdr, XML_to ),
+ FSEND );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aEnd.Col() );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ),
+ MM100toEMU( aLocation.Right() - aRangeRect.Right() ) );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aEnd.Row() );
+ XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ),
+ MM100toEMU( aLocation.Bottom() - aRangeRect.Bottom() ) );
+ pDrawing->endElement( FSNS( XML_xdr, XML_to ) );
+}
+
+void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const XclObjAny& rObj )
+{
+ WriteFromTo( rStrm, rObj.GetShape(), rObj.GetTab() );
+}
+
+static const char*
+GetEditAs( XclObjAny& rObj )
+{
+ if( const SdrObject* pShape = EscherEx::GetSdrObject( rObj.GetShape() ) )
+ {
+ // OOXTODO: returning "twoCell"
+ switch( ScDrawLayer::GetAnchorType( *pShape ) )
+ {
+ case SCA_CELL: return "oneCell";
+ default: break;
+ }
+ }
+ return "absolute";
+}
+
+
+void XclObjAny::SaveXml( XclExpXmlStream& rStrm )
+{
+ if( !mxShape.is() )
+ return;
+
+ sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
+
+ ShapeExport aDML( XML_xdr, pDrawing, NULL, &rStrm, DrawingML::DOCUMENT_XLSX );
+
+ pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor
+ XML_editAs, GetEditAs( *this ),
+ FSEND );
+ Reference< XPropertySet > xPropSet( mxShape, UNO_QUERY );
+ if (xPropSet.is())
+ {
+ WriteFromTo( rStrm, *this );
+ aDML.WriteShape( mxShape );
+ }
+
+ pDrawing->singleElement( FSNS( XML_xdr, XML_clientData),
+ // OOXTODO: XML_fLocksWithSheet
+ // OOXTODO: XML_fPrintsWithSheet
+ FSEND );
+ pDrawing->endElement( FSNS( XML_xdr, XML_twoCellAnchor ) );
+}
+
void ExcBof8_Base::SaveCont( XclExpStream& rStrm )
@@ -911,9 +1216,9 @@ ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab )
String sText;
double fVal;
- for( sal_uInt32 nRange = 0; (nRange < pRList->Count()) && bContLoop; nRange++ )
+ for( size_t nRange = 0; (nRange < pRList->size()) && bContLoop; nRange++ )
{
- const ScRange* pRange = pRList->GetObject( nRange );
+ const ScRange* pRange = (*pRList)[nRange];
for( nRow = pRange->aStart.Row(); (nRow <= pRange->aEnd.Row()) && bContLoop; nRow++ )
for( nCol = pRange->aStart.Col(); (nCol <= pRange->aEnd.Col()) && bContLoop; nCol++ )
{
@@ -943,7 +1248,7 @@ ExcEScenario::~ExcEScenario()
sal_Bool ExcEScenario::Append( sal_uInt16 nCol, sal_uInt16 nRow, const String& rTxt )
{
if( List::Count() == EXC_SCEN_MAXCELL )
- return sal_False;
+ return false;
ExcEScenarioCell* pCell = new ExcEScenarioCell( nCol, nRow, rTxt );
List::Insert( pCell, LIST_APPEND );
@@ -1441,3 +1746,4 @@ void XclRefmode::SaveXml( XclExpXmlStream& rStrm )
FSEND );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
index 3d1c02fc2c11..ac636249cf68 100644
--- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
+++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,9 +58,9 @@ ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r
fIterationEpsilon(0.001),
nIterationCount(100),
nYear2000(1930),
- bIsIterationEnabled(sal_False),
- bCalcAsShown(sal_False),
- bIgnoreCase(sal_False),
+ bIsIterationEnabled(false),
+ bCalcAsShown(false),
+ bIgnoreCase(false),
bLookUpLabels(sal_True),
bMatchWholeCell(sal_True),
bUseRegularExpressions(sal_True)
@@ -91,12 +92,12 @@ ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r
else if (IsXMLToken(aLocalName, XML_SEARCH_CRITERIA_MUST_APPLY_TO_WHOLE_CELL))
{
if (IsXMLToken(sValue, XML_FALSE))
- bMatchWholeCell = sal_False;
+ bMatchWholeCell = false;
}
else if (IsXMLToken(aLocalName, XML_AUTOMATIC_FIND_LABELS))
{
if (IsXMLToken(sValue, XML_FALSE))
- bLookUpLabels = sal_False;
+ bLookUpLabels = false;
}
else if (IsXMLToken(aLocalName, XML_NULL_YEAR))
{
@@ -107,7 +108,7 @@ ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r
else if (IsXMLToken(aLocalName, XML_USE_REGULAR_EXPRESSIONS))
{
if (IsXMLToken(sValue, XML_FALSE))
- bUseRegularExpressions = sal_False;
+ bUseRegularExpressions = false;
}
}
}
@@ -156,11 +157,10 @@ void ScXMLCalculationSettingsContext::EndElement()
xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_NULLDATE)), uno::makeAny(aNullDate) );
if (GetScImport().GetDocument())
{
- GetScImport().LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(GetScImport());
ScDocOptions aDocOptions (GetScImport().GetDocument()->GetDocOptions());
aDocOptions.SetYear2000(nYear2000);
GetScImport().GetDocument()->SetDocOptions(aDocOptions);
- GetScImport().UnlockSolarMutex();
}
}
}
@@ -271,3 +271,5 @@ SvXMLImportContext *ScXMLIterationContext::CreateChildContext( sal_uInt16 nPrefi
void ScXMLIterationContext::EndElement()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.hxx b/sc/source/filter/xml/XMLCalculationSettingsContext.hxx
index 4b5fa4a1114b..fb023bc0c740 100644
--- a/sc/source/filter/xml/XMLCalculationSettingsContext.hxx
+++ b/sc/source/filter/xml/XMLCalculationSettingsContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
index d02c5c52bba0..b7a05b59053e 100644
--- a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
+++ b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,3 +132,4 @@ void ScXMLCellRangeSourceContext::EndElement()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLCellRangeSourceContext.hxx b/sc/source/filter/xml/XMLCellRangeSourceContext.hxx
index 34645007f0f9..58b9c7d10e95 100644
--- a/sc/source/filter/xml/XMLCellRangeSourceContext.hxx
+++ b/sc/source/filter/xml/XMLCellRangeSourceContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,3 +79,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx
index 5cd97e0714a9..7db33e2c51fa 100644
--- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -127,7 +128,7 @@ void ScChangeTrackingExportHelper::WriteChangeInfo(const ScChangeAction* pAction
{
SvXMLElementExport aCreatorElem( rExport, XML_NAMESPACE_DC,
XML_CREATOR, sal_True,
- sal_False );
+ false );
rtl::OUString sAuthor(pAction->GetUser());
rExport.Characters(sAuthor);
}
@@ -137,14 +138,14 @@ void ScChangeTrackingExportHelper::WriteChangeInfo(const ScChangeAction* pAction
ScXMLConverter::ConvertDateTimeToString(pAction->GetDateTimeUTC(), sDate);
SvXMLElementExport aDateElem( rExport, XML_NAMESPACE_DC,
XML_DATE, sal_True,
- sal_False );
+ false );
rExport.Characters(sDate.makeStringAndClear());
}
rtl::OUString sComment(pAction->GetComment());
if (sComment.getLength())
{
- SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, false);
sal_Bool bPrevCharWasSpace(sal_True);
rExport.GetTextParagraphExport()->exportText(sComment, bPrevCharWasSpace);
}
@@ -227,50 +228,9 @@ void ScChangeTrackingExportHelper::WriteDependings(ScChangeAction* pAction)
WriteDeleted(pEntry->GetAction());
pEntry = pEntry->GetNext();
}
- /*if (pAction->IsDeleteType())
- {
- ScChangeActionDel* pDelAction = static_cast<ScChangeActionDel*> (pAction);
- if (pDelAction)
- {
- const ScChangeActionCellListEntry* pCellEntry = pDelAction->GetFirstCellEntry();
- while (pCellEntry)
- {
- WriteGenerated(pCellEntry->GetContent());
- pCellEntry = pCellEntry->GetNext();
- }
- }
- }
- else if (pAction->GetType() == SC_CAT_MOVE)
- {
- ScChangeActionMove* pMoveAction = static_cast<ScChangeActionMove*> (pAction);
- if (pMoveAction)
- {
- const ScChangeActionCellListEntry* pCellEntry = pMoveAction->GetFirstCellEntry();
- while (pCellEntry)
- {
- WriteGenerated(pCellEntry->GetContent());
- pCellEntry = pCellEntry->GetNext();
- }
- }
- }*/
}
}
-/*void ScChangeTrackingExportHelper::WriteDependings(ScChangeAction* pAction)
-{
- pChangeTrack->GetDependents(pAction, *pDependings);
- if (pDependings->Count())
- {
- SvXMLElementExport aDependingsElem (rExport, XML_NAMESPACE_TABLE, XML_DEPENDENCIES, sal_True, sal_True);
- ScChangeAction* pDependAction = pDependings->First();
- while (pDependAction != NULL)
- {
- WriteDepending(pDependAction);
- pDependAction = pDependings->Next();
- }
- }
-}*/
-
void ScChangeTrackingExportHelper::WriteEmptyCell()
{
SvXMLElementExport aElemEmptyCell(rExport, XML_NAMESPACE_TABLE, XML_CHANGE_TRACK_TABLE_CELL, sal_True, sal_True);
@@ -278,7 +238,7 @@ void ScChangeTrackingExportHelper::WriteEmptyCell()
void ScChangeTrackingExportHelper::SetValueAttributes(const double& fValue, const String& sValue)
{
- sal_Bool bSetAttributes(sal_False);
+ sal_Bool bSetAttributes(false);
if (sValue.Len())
{
sal_uInt32 nIndex;
@@ -333,12 +293,6 @@ void ScChangeTrackingExportHelper::WriteValueCell(const ScBaseCell* pCell, const
{
SetValueAttributes(pValueCell->GetValue(), sValue);
SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TABLE, XML_CHANGE_TRACK_TABLE_CELL, sal_True, sal_True);
-/* if (sValue.Len())
- {
- SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
- sal_Bool bPrevCharWasSpace(sal_True);
- rExport.GetTextParagraphExport()->exportText(sValue, bPrevCharWasSpace);
- }*/
}
}
@@ -354,7 +308,7 @@ void ScChangeTrackingExportHelper::WriteStringCell(const ScBaseCell* pCell)
SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TABLE, XML_CHANGE_TRACK_TABLE_CELL, sal_True, sal_True);
if (sOUString.getLength())
{
- SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, false);
sal_Bool bPrevCharWasSpace(sal_True);
rExport.GetTextParagraphExport()->exportText(sOUString, bPrevCharWasSpace);
}
@@ -379,7 +333,7 @@ void ScChangeTrackingExportHelper::WriteEditCell(const ScBaseCell* pCell)
}
pEditTextObj->SetText(*(pEditCell->GetData()));
if (xText.is())
- rExport.GetTextParagraphExport()->exportText(xText, sal_False, sal_False);
+ rExport.GetTextParagraphExport()->exportText(xText, false, false);
}
}
}
@@ -419,12 +373,12 @@ void ScChangeTrackingExportHelper::WriteFormulaCell(const ScBaseCell* pCell, con
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MATRIX_COVERED, XML_TRUE);
}
rtl::OUString sMatrixFormula = sOUFormula.copy(1, sOUFormula.getLength() - 2);
- rtl::OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sMatrixFormula, sal_False );
+ rtl::OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sMatrixFormula, false );
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_FORMULA, sQValue);
}
else
{
- rtl::OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sFormula, sal_False );
+ rtl::OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sFormula, false );
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_FORMULA, sQValue);
}
if (pFormulaCell->IsValue())
@@ -441,7 +395,7 @@ void ScChangeTrackingExportHelper::WriteFormulaCell(const ScBaseCell* pCell, con
SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TABLE, XML_CHANGE_TRACK_TABLE_CELL, sal_True, sal_True);
if (sOUValue.getLength())
{
- SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, false);
sal_Bool bPrevCharWasSpace(sal_True);
rExport.GetTextParagraphExport()->exportText(sOUValue, bPrevCharWasSpace);
}
@@ -538,7 +492,7 @@ void ScChangeTrackingExportHelper::AddInsertionAttributes(const ScChangeAction*
break;
default :
{
- DBG_ERROR("wrong insertion type");
+ OSL_FAIL("wrong insertion type");
}
break;
}
@@ -598,12 +552,11 @@ void ScChangeTrackingExportHelper::AddDeletionAttributes(const ScChangeActionDel
{
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TYPE, XML_TABLE);
nPosition = nStartSheet;
- //DBG_ERROR("not implemented feature");
}
break;
default :
{
- DBG_ERROR("wrong deletion type");
+ OSL_FAIL("wrong deletion type");
}
break;
}
@@ -617,7 +570,7 @@ void ScChangeTrackingExportHelper::AddDeletionAttributes(const ScChangeActionDel
if (pDelAction->IsMultiDelete() && !pDelAction->GetDx() && !pDelAction->GetDy())
{
const ScChangeAction* p = pDelAction->GetNext();
- sal_Bool bAll(sal_False);
+ sal_Bool bAll(false);
sal_Int32 nSlavesCount (1);
while (!bAll && p)
{
@@ -720,7 +673,7 @@ void ScChangeTrackingExportHelper::CollectCellAutoStyles(const ScBaseCell* pBase
}
pEditTextObj->SetText(*(pEditCell->GetData()));
if (xText.is())
- rExport.GetTextParagraphExport()->collectTextAutoStyles(xText, sal_False, sal_False);
+ rExport.GetTextParagraphExport()->collectTextAutoStyles(xText, false, false);
}
}
}
@@ -758,7 +711,7 @@ void ScChangeTrackingExportHelper::WorkWithChangeAction(ScChangeAction* pAction)
WriteRejection(pAction);
else
{
- DBG_ERROR("not a writeable type");
+ OSL_FAIL("not a writeable type");
}
rExport.CheckAttrList();
}
@@ -792,13 +745,6 @@ void ScChangeTrackingExportHelper::CollectAndWriteChanges()
{
if (pChangeTrack)
{
-/* if (pChangeTrack->IsProtected())
- {
- rtl::OUStringBuffer aBuffer;
- SvXMLUnitConverter::encodeBase64(aBuffer, pChangeTrack->GetProtection());
- if (aBuffer.getLength())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
- }*/
SvXMLElementExport aCangeListElem(rExport, XML_NAMESPACE_TABLE, XML_TRACKED_CHANGES, sal_True, sal_True);
{
ScChangeAction* pAction = pChangeTrack->GetFirst();
@@ -815,3 +761,5 @@ void ScChangeTrackingExportHelper::CollectAndWriteChanges()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
index f07f0ed905a0..cfb518e58b29 100644
--- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
+++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,3 +97,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index 828f32de82da..246e3eed3f20 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -211,7 +212,7 @@ ScXMLChangeTrackingImportHelper::ScXMLChangeTrackingImportHelper()
sIDPrefix(RTL_CONSTASCII_USTRINGPARAM(SC_CHANGE_ID_PREFIX)),
nMultiSpanned(0),
nMultiSpannedSlaveCount(0),
- bChangeTrack(sal_False)
+ bChangeTrack(false)
{
nPrefixLength = sIDPrefix.getLength();
}
@@ -277,7 +278,7 @@ sal_uInt32 ScXMLChangeTrackingImportHelper::GetIDFromString(const rtl::OUString&
}
else
{
- DBG_ERROR("wrong change action ID");
+ OSL_FAIL("wrong change action ID");
}
}
return nResult;
@@ -372,7 +373,7 @@ void ScXMLChangeTrackingImportHelper::SetInsertionCutOff(const sal_uInt32 nID, c
}
else
{
- DBG_ERROR("wrong action type");
+ OSL_FAIL("wrong action type");
}
}
@@ -385,7 +386,7 @@ void ScXMLChangeTrackingImportHelper::AddMoveCutOff(const sal_uInt32 nID, const
}
else
{
- DBG_ERROR("wrong action type");
+ OSL_FAIL("wrong action type");
}
}
@@ -397,7 +398,7 @@ void ScXMLChangeTrackingImportHelper::SetMoveRanges(const ScBigRange& aSourceRan
}
else
{
- DBG_ERROR("wrong action type");
+ OSL_FAIL("wrong action type");
}
}
@@ -419,7 +420,7 @@ void ScXMLChangeTrackingImportHelper::GetMultiSpannedRange()
}
else
{
- DBG_ERROR("wrong action type");
+ OSL_FAIL("wrong action type");
}
}
@@ -437,7 +438,7 @@ void ScXMLChangeTrackingImportHelper::AddGenerated(ScMyCellInfo* pCellInfo, cons
}
else
{
- DBG_ERROR("try to insert a generated action to a wrong action");
+ OSL_FAIL("try to insert a generated action to a wrong action");
}
}
@@ -450,7 +451,7 @@ void ScXMLChangeTrackingImportHelper::EndChangeAction()
aActions.push_back(pCurrentAction);
else
{
- DBG_ERROR("no current action");
+ OSL_FAIL("no current action");
}
pCurrentAction = NULL;
}
@@ -462,7 +463,7 @@ void ScXMLChangeTrackingImportHelper::ConvertInfo(const ScMyActionInfo& aInfo, S
aDateTime.SetDate( aDate.GetDate() );
aDateTime.SetTime( aTime.GetTime() );
- // #97286# old files didn't store 100th seconds, enable again
+ // old files didn't store 100th seconds, enable again
if ( aInfo.aDateTime.HundredthSeconds )
pTrack->SetTime100thSeconds( sal_True );
@@ -614,7 +615,7 @@ void ScXMLChangeTrackingImportHelper::SetDeletionDependencies(ScMyDelAction* pAc
}
else
{
- DBG_ERROR("no cut off insert action");
+ OSL_FAIL("no cut off insert action");
}
}
if (!pAction->aMoveCutOffs.empty())
@@ -636,7 +637,7 @@ void ScXMLChangeTrackingImportHelper::SetDeletionDependencies(ScMyDelAction* pAc
}
else
{
- DBG_ERROR("no cut off move action");
+ OSL_FAIL("no cut off move action");
}
aItr = pAction->aMoveCutOffs.erase(aItr);
}
@@ -746,7 +747,7 @@ void ScXMLChangeTrackingImportHelper::SetDependencies(ScMyBaseAction* pAction)
}
else
{
- DBG_ERROR("could not find the action");
+ OSL_FAIL("could not find the action");
}
}
@@ -821,7 +822,7 @@ void ScXMLChangeTrackingImportHelper::SetNewCell(ScMyContentAction* pAction)
}
else
{
- DBG_ERROR("wrong cell position");
+ OSL_FAIL("wrong cell position");
}
}
}
@@ -834,8 +835,8 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc)
if (pDoc)
{
pTrack = new ScChangeTrack(pDoc, aUsers);
- // #97286# old files didn't store 100th seconds, disable until encountered
- pTrack->SetTime100thSeconds( sal_False );
+ // old files didn't store 100th seconds, disable until encountered
+ pTrack->SetTime100thSeconds( false );
ScMyActions::iterator aItr(aActions.begin());
ScMyActions::iterator aEndItr(aActions.end());
@@ -888,7 +889,7 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc)
pTrack->AppendLoaded(pAction);
else
{
- DBG_ERROR("no action");
+ OSL_FAIL("no action");
}
++aItr;
@@ -933,3 +934,5 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc)
pDoc->SetChangeTrack(pTrack);
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
index 9857683b13ac..5a98df08a2c7 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -247,3 +248,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx
index 646d245c13f1..0a0a825ceb31 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,14 +34,15 @@
#include "XMLCodeNameProvider.hxx"
#include "document.hxx"
-using namespace rtl;
using namespace com::sun::star;
+using ::rtl::OUString;
+
sal_Bool XMLCodeNameProvider::_getCodeName( const uno::Any& aAny, String& rCodeName )
{
uno::Sequence<beans::PropertyValue> aProps;
if( !(aAny >>= aProps) )
- return sal_False;
+ return false;
OUString sCodeNameProp( RTL_CONSTASCII_USTRINGPARAM("CodeName") );
sal_Int32 nPropCount = aProps.getLength();
@@ -57,7 +59,7 @@ sal_Bool XMLCodeNameProvider::_getCodeName( const uno::Any& aAny, String& rCodeN
}
}
- return sal_False;
+ return false;
}
@@ -90,7 +92,7 @@ XMLCodeNameProvider::~XMLCodeNameProvider()
}
}
- return sal_False;
+ return false;
}
uno::Any SAL_CALL XMLCodeNameProvider::getByName( const OUString& aName )
@@ -130,7 +132,7 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( )
throw (uno::RuntimeException)
{
SCTAB nCount = mpDoc->GetTableCount() + 1;
- uno::Sequence< rtl::OUString > aNames( nCount );
+ uno::Sequence< OUString > aNames( nCount );
sal_Int32 nRealCount = 0;
if( mpDoc->GetCodeName().Len() )
@@ -156,7 +158,7 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( )
uno::Type SAL_CALL XMLCodeNameProvider::getElementType( )
throw (uno::RuntimeException)
{
- return getCppuType( static_cast< uno::Sequence< beans::PropertyValue >* >( 0 ) );
+ return getCppuType(static_cast<uno::Sequence<beans::PropertyValue>*>(0));
}
::sal_Bool SAL_CALL XMLCodeNameProvider::hasElements()
@@ -174,7 +176,7 @@ uno::Type SAL_CALL XMLCodeNameProvider::getElementType( )
return sal_True;
}
- return sal_False;
+ return false;
}
void XMLCodeNameProvider::set( const uno::Reference< container::XNameAccess>& xNameAccess, ScDocument *pDoc )
@@ -202,3 +204,5 @@ void XMLCodeNameProvider::set( const uno::Reference< container::XNameAccess>& xN
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.hxx b/sc/source/filter/xml/XMLCodeNameProvider.hxx
index 39d84409c555..81a5b5e3ebdc 100755..100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.hxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLColumnRowGroupExport.cxx b/sc/source/filter/xml/XMLColumnRowGroupExport.cxx
index 4c2929de02e3..858adcffeb6f 100644
--- a/sc/source/filter/xml/XMLColumnRowGroupExport.cxx
+++ b/sc/source/filter/xml/XMLColumnRowGroupExport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,7 +54,7 @@ sal_Bool ScMyColumnRowGroup::operator<(const ScMyColumnRowGroup& rGroup) const
if (rGroup.nField == nField && rGroup.nLevel > nLevel)
return sal_True;
else
- return sal_False;
+ return false;
}
ScMyOpenCloseColumnRowGroup::ScMyOpenCloseColumnRowGroup(ScXMLExport& rTempExport, sal_uInt32 nToken)
@@ -82,14 +83,14 @@ void ScMyOpenCloseColumnRowGroup::AddGroup(const ScMyColumnRowGroup& aGroup, con
sal_Bool ScMyOpenCloseColumnRowGroup::IsGroupStart(const sal_Int32 nField)
{
- sal_Bool bGroupStart(sal_False);
+ sal_Bool bGroupStart(false);
if (!aTableStart.empty())
{
ScMyColumnRowGroupVec::iterator aItr(aTableStart.begin());
sal_Int32 nItrField = aItr->nField;
if ( nItrField < nField )
{
- // #103327# when used to find repeated rows at the beginning of a group,
+ // when used to find repeated rows at the beginning of a group,
// aTableStart may contain entries before nField. They must be skipped here
// (they will be used for OpenGroups later in the right order).
@@ -119,7 +120,7 @@ void ScMyOpenCloseColumnRowGroup::OpenGroups(const sal_Int32 nField)
{
ScMyColumnRowGroupVec::iterator aItr(aTableStart.begin());
ScMyColumnRowGroupVec::iterator aEndItr(aTableStart.end());
- sal_Bool bReady(sal_False);
+ sal_Bool bReady(false);
while(!bReady && aItr != aEndItr)
{
if (aItr->nField == nField)
@@ -134,7 +135,7 @@ void ScMyOpenCloseColumnRowGroup::OpenGroups(const sal_Int32 nField)
sal_Bool ScMyOpenCloseColumnRowGroup::IsGroupEnd(const sal_Int32 nField)
{
- sal_Bool bGroupEnd(sal_False);
+ sal_Bool bGroupEnd(false);
if (!aTableEnd.empty())
{
if (*(aTableEnd.begin()) == nField)
@@ -152,7 +153,7 @@ void ScMyOpenCloseColumnRowGroup::CloseGroups(const sal_Int32 nField)
{
ScMyFieldGroupVec::iterator aItr(aTableEnd.begin());
ScMyFieldGroupVec::iterator aEndItr(aTableEnd.end());
- sal_Bool bReady(sal_False);
+ sal_Bool bReady(false);
while(!bReady && aItr != aEndItr)
{
if (*aItr == nField)
@@ -185,3 +186,4 @@ void ScMyOpenCloseColumnRowGroup::Sort()
aTableEnd.sort();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLColumnRowGroupExport.hxx b/sc/source/filter/xml/XMLColumnRowGroupExport.hxx
index 51a93445ccfb..37608b737f5e 100644
--- a/sc/source/filter/xml/XMLColumnRowGroupExport.hxx
+++ b/sc/source/filter/xml/XMLColumnRowGroupExport.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLConsolidationContext.cxx b/sc/source/filter/xml/XMLConsolidationContext.cxx
index 1f03d566ff18..5f96bad52719 100644
--- a/sc/source/filter/xml/XMLConsolidationContext.cxx
+++ b/sc/source/filter/xml/XMLConsolidationContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,10 +54,10 @@ ScXMLConsolidationContext::ScXMLConsolidationContext(
const uno::Reference< xml::sax::XAttributeList >& xAttrList ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
eFunction( SUBTOTAL_FUNC_NONE ),
- bLinkToSource( sal_False ),
- bTargetAddr(sal_False)
+ bLinkToSource( false ),
+ bTargetAddr(false)
{
- rImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(GetScImport());
if( !xAttrList.is() ) return;
sal_Int16 nAttrCount = xAttrList->getLength();
@@ -116,7 +117,6 @@ void ScXMLConsolidationContext::EndElement()
aConsParam.nTab = aTargetAddr.Tab();
aConsParam.eFunction = eFunction;
- sal_Bool bError = sal_False;
sal_uInt16 nCount = (sal_uInt16) Min( ScRangeStringConverter::GetTokenCount( sSourceList ), (sal_Int32)0xFFFF );
ScArea** ppAreas = nCount ? new ScArea*[ nCount ] : NULL;
if( ppAreas )
@@ -129,7 +129,7 @@ void ScXMLConsolidationContext::EndElement()
if ( !ScRangeStringConverter::GetAreaFromString(
*ppAreas[ nIndex ], sSourceList, GetScImport().GetDocument(), ::formula::FormulaGrammar::CONV_OOO, nOffset ) )
{
- bError = sal_True; //! handle error
+ //! handle error
}
}
@@ -141,7 +141,7 @@ void ScXMLConsolidationContext::EndElement()
delete[] ppAreas;
}
- aConsParam.bByCol = aConsParam.bByRow = sal_False;
+ aConsParam.bByCol = aConsParam.bByRow = false;
if( IsXMLToken(sUseLabel, XML_COLUMN ) )
aConsParam.bByCol = sal_True;
else if( IsXMLToken( sUseLabel, XML_ROW ) )
@@ -158,3 +158,4 @@ void ScXMLConsolidationContext::EndElement()
GetScImport().UnlockSolarMutex();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLConsolidationContext.hxx b/sc/source/filter/xml/XMLConsolidationContext.hxx
index 76249bf4cfab..eabf35031dbf 100644
--- a/sc/source/filter/xml/XMLConsolidationContext.hxx
+++ b/sc/source/filter/xml/XMLConsolidationContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx
index 4de6246f4f28..5fafe505398a 100644
--- a/sc/source/filter/xml/XMLConverter.cxx
+++ b/sc/source/filter/xml/XMLConverter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -250,7 +251,7 @@ sal_Bool ScXMLConverter::GetDetOpTypeFromString( ScDetOpType& rDetOpType, const
else if( IsXMLToken(rString, XML_REMOVE_PRECEDENTS ) )
rDetOpType = SCDETOP_DELPRED;
else
- return sal_False;
+ return false;
return sal_True;
}
@@ -315,8 +316,8 @@ void ScXMLConverter::GetStringFromDetOpType(
void ScXMLConverter::ParseFormula(OUString& sFormula, const sal_Bool bIsFormula)
{
OUStringBuffer sBuffer(sFormula.getLength());
- sal_Bool bInQuotationMarks(sal_False);
- sal_Bool bInDoubleQuotationMarks(sal_False);
+ sal_Bool bInQuotationMarks(false);
+ sal_Bool bInDoubleQuotationMarks(false);
sal_Int16 nCountBraces(0);
sal_Unicode chPrevious('=');
for (sal_Int32 i = 0; i < sFormula.getLength(); ++i)
@@ -353,13 +354,6 @@ void ScXMLConverter::ConvertDateTimeToString(const DateTime& aDateTime, rtl::OUS
SvXMLUnitConverter::convertDateTime(sDate, aAPIDateTime);
}
-//UNUSED2008-05 void ScXMLConverter::ConvertStringToDateTime(const rtl::OUString& sDate, DateTime& aDateTime, SvXMLUnitConverter* /* pUnitConverter */)
-//UNUSED2008-05 {
-//UNUSED2008-05 com::sun::star::util::DateTime aAPIDateTime;
-//UNUSED2008-05 SvXMLUnitConverter::convertDateTime(aAPIDateTime, sDate);
-//UNUSED2008-05 ConvertAPIToCoreDateTime(aAPIDateTime, aDateTime);
-//UNUSED2008-05 }
-
void ScXMLConverter::ConvertCoreToAPIDateTime(const DateTime& aDateTime, util::DateTime& rDateTime)
{
rDateTime.Year = aDateTime.GetYear();
@@ -591,7 +585,7 @@ bool lclSkipEmptyParentheses( const sal_Unicode*& rpcString, const sal_Unicode*
// ----------------------------------------------------------------------------
-/*static*/ void ScXMLConditionHelper::parseCondition(
+void ScXMLConditionHelper::parseCondition(
ScXMLConditionParseResult& rParseResult, const OUString& rAttribute, sal_Int32 nStartIndex )
{
rParseResult.meToken = XML_COND_INVALID;
@@ -668,3 +662,4 @@ bool lclSkipEmptyParentheses( const sal_Unicode*& rpcString, const sal_Unicode*
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLConverter.hxx b/sc/source/filter/xml/XMLConverter.hxx
index 94766ebe08ff..a661bc532d01 100644
--- a/sc/source/filter/xml/XMLConverter.hxx
+++ b/sc/source/filter/xml/XMLConverter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,11 +68,11 @@ public:
static void GetStringFromFunction(
::rtl::OUString& rString,
const ::com::sun::star::sheet::GeneralFunction eFunction,
- sal_Bool bAppendStr = sal_False );
+ sal_Bool bAppendStr = false );
static void GetStringFromFunction(
::rtl::OUString& rString,
const ScSubTotalFunc eFunction,
- sal_Bool bAppendStr = sal_False );
+ sal_Bool bAppendStr = false );
// IMPORT: DataPilotFieldOrientation
static ::com::sun::star::sheet::DataPilotFieldOrientation
@@ -82,7 +83,7 @@ public:
static void GetStringFromOrientation(
::rtl::OUString& rString,
const ::com::sun::star::sheet::DataPilotFieldOrientation eOrientation,
- sal_Bool bAppendStr = sal_False );
+ sal_Bool bAppendStr = false );
// IMPORT: Detective
static ScDetectiveObjType
@@ -96,11 +97,11 @@ public:
static void GetStringFromDetObjType(
::rtl::OUString& rString,
const ScDetectiveObjType eObjType,
- sal_Bool bAppendStr = sal_False );
+ sal_Bool bAppendStr = false );
static void GetStringFromDetOpType(
::rtl::OUString& rString,
const ScDetOpType eOpType,
- sal_Bool bAppendStr = sal_False );
+ sal_Bool bAppendStr = false );
// IMPORT: Formulas
static void ParseFormula(
@@ -108,9 +109,6 @@ public:
const sal_Bool bIsFormula = sal_True);
// EXPORT: Core Date Time
static void ConvertDateTimeToString(const DateTime& aDateTime, rtl::OUStringBuffer& sDate);
-//UNUSED2008-05 // IMPORT: Core Date Time
-//UNUSED2008-05 static void ConvertStringToDateTime(const rtl::OUString& sDate, DateTime& aDateTime, SvXMLUnitConverter* pUnitConverter);
-
static void ConvertCoreToAPIDateTime(const DateTime& aDateTime, com::sun::star::util::DateTime& rDateTime);
static void ConvertAPIToCoreDateTime(const com::sun::star::util::DateTime& aDateTime, DateTime& rDateTime);
@@ -175,3 +173,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx
index 29f4cb7b7594..94cf98d39849 100644
--- a/sc/source/filter/xml/XMLDDELinksContext.cxx
+++ b/sc/source/filter/xml/XMLDDELinksContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,6 +46,8 @@ using namespace com::sun::star;
using namespace xmloff::token;
using ::rtl::OUString;
+using rtl::OUString;
+
//------------------------------------------------------------------
ScXMLDDELinksContext::ScXMLDDELinksContext( ScXMLImport& rImport,
@@ -134,7 +137,7 @@ void ScXMLDDELinkContext::CreateDDELink()
String sAppl(sApplication);
String sTop(sTopic);
String sIt(sItem);
- GetScImport().GetDocument()->CreateDdeLink(sAppl, sTop, sIt, nMode);
+ GetScImport().GetDocument()->CreateDdeLink(sAppl, sTop, sIt, nMode, ScMatrixRef());
sal_uInt16 nPos;
if(GetScImport().GetDocument()->FindDdeLink(sAppl, sTop, sIt, nMode, nPos))
nPosition = nPos;
@@ -440,19 +443,19 @@ ScXMLDDECellContext::ScXMLDDECellContext( ScXMLImport& rImport,
if (IsXMLToken(sTempValue, XML_STRING))
bString = sal_True;
else
- bString = sal_False;
+ bString = false;
}
else if (IsXMLToken(aLocalName, XML_STRING_VALUE))
{
sValue = sTempValue;
- bEmpty = sal_False;
+ bEmpty = false;
bString2 = sal_True;
}
else if (IsXMLToken(aLocalName, XML_VALUE))
{
GetScImport().GetMM100UnitConverter().convertDouble(fValue, sTempValue);
- bEmpty = sal_False;
- bString2 = sal_False;
+ bEmpty = false;
+ bString2 = false;
}
}
else if (nPrefix == XML_NAMESPACE_TABLE)
@@ -488,3 +491,5 @@ void ScXMLDDECellContext::EndElement()
for(sal_Int32 i = 0; i < nCells; ++i)
pDDELink->AddCellToRow(aCell);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLDDELinksContext.hxx b/sc/source/filter/xml/XMLDDELinksContext.hxx
index 077515a07a4a..2af8015d6476 100644
--- a/sc/source/filter/xml/XMLDDELinksContext.hxx
+++ b/sc/source/filter/xml/XMLDDELinksContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -228,3 +229,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLDetectiveContext.cxx b/sc/source/filter/xml/XMLDetectiveContext.cxx
index 109cb21abe04..812b66b345f5 100644
--- a/sc/source/filter/xml/XMLDetectiveContext.cxx
+++ b/sc/source/filter/xml/XMLDetectiveContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@ using namespace xmloff::token;
ScMyImpDetectiveObj::ScMyImpDetectiveObj() :
aSourceRange(),
eObjType( SC_DETOBJ_NONE ),
- bHasError( sal_False )
+ bHasError( false )
{
}
@@ -71,7 +72,7 @@ void ScMyImpDetectiveOpArray::Sort()
sal_Bool ScMyImpDetectiveOpArray::GetFirstOp( ScMyImpDetectiveOp& rDetOp )
{
if( aDetectiveOpList.empty() )
- return sal_False;
+ return false;
ScMyImpDetectiveOpList::iterator aItr = aDetectiveOpList.begin();
rDetOp = *aItr;
aDetectiveOpList.erase( aItr );
@@ -134,7 +135,7 @@ ScXMLDetectiveHighlightedContext::ScXMLDetectiveHighlightedContext(
SvXMLImportContext( rImport, nPrfx, rLName ),
pDetectiveObjVec( pNewDetectiveObjVec ),
aDetectiveObj(),
- bValid( sal_False )
+ bValid( false )
{
if( !xAttrList.is() ) return;
@@ -153,9 +154,8 @@ ScXMLDetectiveHighlightedContext::ScXMLDetectiveHighlightedContext(
case XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_CELL_RANGE:
{
sal_Int32 nOffset(0);
- GetScImport().LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(GetScImport());
bValid = ScRangeStringConverter::GetRangeFromString( aDetectiveObj.aSourceRange, sValue, GetScImport().GetDocument(), ::formula::FormulaGrammar::CONV_OOO, nOffset );
- GetScImport().UnlockSolarMutex();
}
break;
case XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_DIRECTION:
@@ -198,7 +198,7 @@ void ScXMLDetectiveHighlightedContext::EndElement()
bValid = sal_True;
break;
default:
- bValid = sal_False;
+ bValid = false;
}
if( bValid )
pDetectiveObjVec->push_back( aDetectiveObj );
@@ -214,7 +214,7 @@ ScXMLDetectiveOperationContext::ScXMLDetectiveOperationContext(
const uno::Reference< xml::sax::XAttributeList >& xAttrList ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
aDetectiveOp(),
- bHasType( sal_False )
+ bHasType( false )
{
if( !xAttrList.is() ) return;
@@ -263,3 +263,4 @@ void ScXMLDetectiveOperationContext::EndElement()
GetScImport().GetDetectiveOpArray()->AddDetectiveOp( aDetectiveOp );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLDetectiveContext.hxx b/sc/source/filter/xml/XMLDetectiveContext.hxx
index c0b00384f91a..0e7c8c5a957f 100644
--- a/sc/source/filter/xml/XMLDetectiveContext.hxx
+++ b/sc/source/filter/xml/XMLDetectiveContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -173,3 +174,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLEmptyContext.cxx b/sc/source/filter/xml/XMLEmptyContext.cxx
index 42750bbc8e4f..0c38adc344d6 100644
--- a/sc/source/filter/xml/XMLEmptyContext.cxx
+++ b/sc/source/filter/xml/XMLEmptyContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ SvXMLImportContext *ScXMLEmptyContext::CreateChildContext( sal_uInt16 nPrefix,
void ScXMLEmptyContext::EndElement()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLEmptyContext.hxx b/sc/source/filter/xml/XMLEmptyContext.hxx
index e2a0303311b8..8c836d0aec96 100644
--- a/sc/source/filter/xml/XMLEmptyContext.hxx
+++ b/sc/source/filter/xml/XMLEmptyContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportDDELinks.cxx b/sc/source/filter/xml/XMLExportDDELinks.cxx
index a738f93add19..70e83b284008 100644
--- a/sc/source/filter/xml/XMLExportDDELinks.cxx
+++ b/sc/source/filter/xml/XMLExportDDELinks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include "XMLExportDDELinks.hxx"
#include <xmloff/xmltoken.hxx>
@@ -46,6 +45,7 @@ class ScMatrix;
using namespace com::sun::star;
using namespace xmloff::token;
+using ::rtl::OUStringBuffer;
ScXMLExportDDELinks::ScXMLExportDDELinks(ScXMLExport& rTempExport)
: rExport(rTempExport)
@@ -57,7 +57,7 @@ ScXMLExportDDELinks::~ScXMLExportDDELinks()
}
sal_Bool ScXMLExportDDELinks::CellsEqual(const sal_Bool bPrevEmpty, const sal_Bool bPrevString, const String& sPrevValue, const double& fPrevValue,
- const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue)
+ const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue) const
{
if (bEmpty == bPrevEmpty)
if (bEmpty)
@@ -68,108 +68,83 @@ sal_Bool ScXMLExportDDELinks::CellsEqual(const sal_Bool bPrevEmpty, const sal_Bo
else
return (fPrevValue == fValue);
else
- return sal_False;
+ return false;
else
- return sal_False;
+ return false;
}
-void ScXMLExportDDELinks::WriteCell(const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue, const sal_Int32 nRepeat)
+void ScXMLExportDDELinks::WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat)
{
- rtl::OUStringBuffer sBuffer;
+ bool bString = ScMatrix::IsNonValueType(aVal.nType);
+ bool bEmpty = ScMatrix::IsEmptyType(aVal.nType);
+
if (!bEmpty)
{
if (bString)
{
rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING);
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_STRING_VALUE, rtl::OUString(sValue));
+ rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_STRING_VALUE, aVal.GetString());
}
else
{
+ OUStringBuffer aBuf;
rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT);
- rExport.GetMM100UnitConverter().convertDouble(sBuffer, fValue);
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, sBuffer.makeStringAndClear());
+ rExport.GetMM100UnitConverter().convertDouble(aBuf, aVal.fVal);
+ rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, aBuf.makeStringAndClear());
}
}
+
if (nRepeat > 1)
{
- rExport.GetMM100UnitConverter().convertNumber(sBuffer, nRepeat);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, sBuffer.makeStringAndClear());
+ OUStringBuffer aBuf;
+ rExport.GetMM100UnitConverter().convertNumber(aBuf, nRepeat);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear());
}
SvXMLElementExport(rExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True);
}
void ScXMLExportDDELinks::WriteTable(const sal_Int32 nPos)
{
- const ScMatrix* pMatrix(NULL);
- if (rExport.GetDocument())
- pMatrix = rExport.GetDocument()->GetDdeLinkResultMatrix( static_cast<sal_uInt16>(nPos) );
- if (pMatrix)
+ ScDocument* pDoc = rExport.GetDocument();
+ if (!pDoc)
+ return;
+
+ const ScMatrix* pMatrix = pDoc->GetDdeLinkResultMatrix(static_cast<sal_uInt16>(nPos));
+ if (!pMatrix)
+ return;
+
+ SCSIZE nCols, nRows;
+ pMatrix->GetDimensions(nCols, nRows);
+
+ SvXMLElementExport aTableElem(rExport, XML_NAMESPACE_TABLE, XML_TABLE, sal_True, sal_True);
+ if (nCols > 1)
{
- SCSIZE nuCol;
- SCSIZE nuRow;
- pMatrix->GetDimensions( nuCol, nuRow );
- sal_Int32 nRowCount = static_cast<sal_Int32>(nuRow);
- sal_Int32 nColCount = static_cast<sal_Int32>(nuCol);
- SvXMLElementExport aTableElem(rExport, XML_NAMESPACE_TABLE, XML_TABLE, sal_True, sal_True);
- rtl::OUStringBuffer sBuffer;
- if (nColCount > 1)
- {
- rExport.GetMM100UnitConverter().convertNumber(sBuffer, nColCount);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, sBuffer.makeStringAndClear());
- }
- {
- SvXMLElementExport aElemCol(rExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True);
- }
- sal_Bool bPrevString(sal_True);
- sal_Bool bPrevEmpty(sal_True);
- double fPrevValue;
- String sPrevValue;
- sal_Int32 nRepeatColsCount(1);
- for(sal_Int32 nRow = 0; nRow < nRowCount; ++nRow)
+ OUStringBuffer aBuf;
+ rExport.GetMM100UnitConverter().convertNumber(aBuf, static_cast<sal_Int32>(nCols));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear());
+ }
+ {
+ SvXMLElementExport aElemCol(rExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True);
+ }
+
+ for (SCSIZE nRow = 0; nRow < nRows; ++nRow)
+ {
+ sal_Int32 nRepeat = 0;
+ ScMatrixValue aPrevVal;
+ SvXMLElementExport aElemRow(rExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True);
+ for (SCSIZE nCol = 0; nCol < nCols; ++nCol, ++nRepeat)
{
- SvXMLElementExport aElemRow(rExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True);
- for(sal_Int32 nColumn = 0; nColumn < nColCount; ++nColumn)
+ ScMatrixValue aVal = pMatrix->Get(nCol, nRow);
+ if (nCol > 0 && aVal != aPrevVal)
{
- ScMatValType nType = SC_MATVAL_VALUE;
- const ScMatrixValue* pMatVal = pMatrix->Get( static_cast<SCSIZE>(nColumn), static_cast<SCSIZE>(nRow), nType );
- sal_Bool bIsString = ScMatrix::IsNonValueType( nType);
-
- if (nColumn == 0)
- {
- bPrevEmpty = !pMatVal;
- bPrevString = bIsString;
- if( bIsString )
- sPrevValue = pMatVal->GetString();
- else
- fPrevValue = pMatVal->fVal;
- }
- else
- {
- double fValue;
- String sValue;
- sal_Bool bEmpty(!pMatVal);
- sal_Bool bString(bIsString);
- if( bIsString )
- sValue = pMatVal->GetString();
- else
- fValue = pMatVal->fVal;
-
- if (CellsEqual(bPrevEmpty, bPrevString, sPrevValue, fPrevValue,
- bEmpty, bString, sValue, fValue))
- ++nRepeatColsCount;
- else
- {
- WriteCell(bPrevEmpty, bPrevString, sPrevValue, fPrevValue, nRepeatColsCount);
- nRepeatColsCount = 1;
- bPrevEmpty = bEmpty;
- fPrevValue = fValue;
- sPrevValue = sValue;
- }
- }
+ // Cell value differs. Flush the cell content.
+ WriteCell(aPrevVal, nRepeat);
+ nRepeat = 0;
}
- WriteCell(bPrevEmpty, bPrevString, sPrevValue, fPrevValue, nRepeatColsCount);
- nRepeatColsCount = 1;
+ aPrevVal = aVal;
}
+
+ WriteCell(aPrevVal, nRepeat);
}
}
@@ -219,3 +194,5 @@ void ScXMLExportDDELinks::WriteDDELinks(uno::Reference<sheet::XSpreadsheetDocume
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportDDELinks.hxx b/sc/source/filter/xml/XMLExportDDELinks.hxx
index 245a95934449..7edb3e8ed8dc 100644
--- a/sc/source/filter/xml/XMLExportDDELinks.hxx
+++ b/sc/source/filter/xml/XMLExportDDELinks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,14 +33,15 @@
class String;
class ScXMLExport;
+class ScMatrixValue;
class ScXMLExportDDELinks
{
ScXMLExport& rExport;
sal_Bool CellsEqual(const sal_Bool bPrevEmpty, const sal_Bool bPrevString, const String& sPrevValue, const double& fPrevValue,
- const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue);
- void WriteCell(const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue, const sal_Int32 nRepeat);
+ const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue) const;
+ void WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat);
void WriteTable(const sal_Int32 nPos);
public:
ScXMLExportDDELinks(ScXMLExport& rExport);
@@ -50,3 +52,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx
index f8cba5ecf6c3..968c37f0e1b5 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include "XMLExportDataPilot.hxx"
#include <xmloff/xmltoken.hxx>
@@ -124,7 +123,7 @@ rtl::OUString ScXMLExportDataPilot::getDPOperatorXML(const ScQueryOp aFilterOper
case SC_TOPVAL :
return GetXMLToken(XML_TOP_VALUES);
default:
- DBG_ERROR("This FilterOperator is not supported.");
+ OSL_FAIL("This FilterOperator is not supported.");
}
return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("="));
}
@@ -153,8 +152,8 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam)
SCSIZE nQueryEntryCount = aQueryParam.GetEntryCount();
if (nQueryEntryCount > 0)
{
- sal_Bool bAnd(sal_False);
- sal_Bool bOr(sal_False);
+ sal_Bool bAnd(false);
+ sal_Bool bOr(false);
sal_Bool bHasEntries(sal_True);
SCSIZE nEntries(0);
SCSIZE j;
@@ -174,19 +173,11 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam)
++nEntries;
}
else
- bHasEntries = sal_False;
+ bHasEntries = false;
}
nQueryEntryCount = nEntries;
if (nQueryEntryCount)
{
- // There is never a target range in a data pilot.
-/* if (!aQueryParam.bInplace)
- {
- ScAddress aTargetAddress(aQueryParam.nDestCol, aQueryParam.nDestRow, aQueryParam.nDestTab);
- rtl::OUString sAddress;
- ScXMLConverter::GetStringFromAddress( sAddress, aTargetAddress, pDoc );
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, sAddress);
- }*/
if(!((aQueryParam.nCol1 == aQueryParam.nCol2) && (aQueryParam.nRow1 == aQueryParam.nRow2) &&
(static_cast<SCCOLROW>(aQueryParam.nCol1) == static_cast<SCCOLROW>(aQueryParam.nRow1)) &&
(aQueryParam.nCol1 == 0) && (aQueryParam.nTab == SCTAB_MAX)))
@@ -234,7 +225,7 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam)
bOpenAndElement = sal_True;
}
else
- bOpenAndElement = sal_False;
+ bOpenAndElement = false;
for (j = 1; j < nQueryEntryCount; ++j)
{
if (aConnection != aQueryParam.GetEntry(j).eConnect)
@@ -250,7 +241,7 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam)
{
WriteDPCondition(aPrevFilterField, aQueryParam.bCaseSens, aQueryParam.bRegExp);
rExport.EndElement(aName, sal_True);
- bOpenAndElement = sal_False;
+ bOpenAndElement = false;
}
}
else
@@ -260,7 +251,7 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam)
if (bOpenAndElement)
{
rExport.EndElement(aName, sal_True);
- bOpenAndElement = sal_False;
+ bOpenAndElement = false;
}
if (j == nQueryEntryCount - 1)
{
@@ -478,7 +469,7 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim)
{
SvXMLElementExport aElemDPMs(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_MEMBERS, sal_True, sal_True);
rExport.CheckAttrList();
- for (ScDPSaveDimension::MemberList::const_iterator i=rMembers.begin(); i != rMembers.end() ; i++)
+ for (ScDPSaveDimension::MemberList::const_iterator i=rMembers.begin(); i != rMembers.end() ; ++i)
{
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString((*i)->GetName()));
@@ -728,12 +719,10 @@ void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDim
void ScXMLExportDataPilot::WriteDimensions(ScDPSaveData* pDPSave)
{
- List aDimensions = pDPSave->GetDimensions();
- sal_Int32 nDimCount = aDimensions.Count();
- for (sal_Int32 nDim = 0; nDim < nDimCount; nDim++)
- {
- WriteDimension((ScDPSaveDimension*)aDimensions.GetObject(nDim), pDPSave->GetExistingDimensionData());
- }
+ const boost::ptr_vector<ScDPSaveDimension> &rDimensions = pDPSave->GetDimensions();
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator iter;
+ for (iter = rDimensions.begin(); iter != rDimensions.end(); ++iter)
+ WriteDimension(const_cast<ScDPSaveDimension*>(&(*iter)), pDPSave->GetExistingDimensionData());
}
void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const OUString* pGrandTotal)
@@ -749,150 +738,166 @@ void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient
void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreadsheetDocument>& /* xSpreadDoc */)
{
pDoc = rExport.GetDocument();
- if (pDoc)
+ if (!pDoc)
+ return;
+
+ ScDPCollection* pDPs = pDoc->GetDPCollection();
+ if (!pDPs)
+ return;
+
+ size_t nDPCount = pDPs->GetCount();
+ if (!nDPCount)
+ return;
+
+ SvXMLElementExport aElemDPs(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLES, sal_True, sal_True);
+ rExport.CheckAttrList();
+ for (size_t i = 0; i < nDPCount; ++i)
{
- ScDPCollection* pDPs = pDoc->GetDPCollection();
- if (pDPs)
+ ScDPSaveData* pDPSave = (*pDPs)[i]->GetSaveData();
+ if (!pDPSave)
+ continue;
+
+ ScRange aOutRange((*pDPs)[i]->GetOutRange());
+ rtl::OUString sTargetRangeAddress;
+ ScRangeStringConverter::GetStringFromRange( sTargetRangeAddress, aOutRange, pDoc, ::formula::FormulaGrammar::CONV_OOO );
+ ScDocAttrIterator aAttrItr(pDoc, aOutRange.aStart.Tab(),
+ aOutRange.aStart.Col(), aOutRange.aStart.Row(),
+ aOutRange.aEnd.Col(), aOutRange.aEnd.Row());
+ SCCOL nCol;
+ SCROW nRow1, nRow2;
+ rtl::OUString sOUButtonList;
+ const ScPatternAttr* pAttr = aAttrItr.GetNext(nCol, nRow1, nRow2);
+ while (pAttr)
{
- sal_Int16 nDPCount = pDPs->GetCount();
- if (nDPCount > 0)
+ ScMergeFlagAttr& rItem = (ScMergeFlagAttr&)pAttr->GetItem(ATTR_MERGE_FLAG);
+ if (rItem.HasButton())
{
- SvXMLElementExport aElemDPs(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLES, sal_True, sal_True);
- rExport.CheckAttrList();
- for (sal_Int16 i = 0; i < nDPCount; ++i)
+ for (SCROW nButtonRow = nRow1; nButtonRow <= nRow2; ++nButtonRow)
{
- ScDPSaveData* pDPSave = (*pDPs)[i]->GetSaveData();
- if (pDPSave)
- {
- ScRange aOutRange((*pDPs)[i]->GetOutRange());
- rtl::OUString sTargetRangeAddress;
- ScRangeStringConverter::GetStringFromRange( sTargetRangeAddress, aOutRange, pDoc, ::formula::FormulaGrammar::CONV_OOO );
- ScDocAttrIterator aAttrItr(pDoc, aOutRange.aStart.Tab(),
- aOutRange.aStart.Col(), aOutRange.aStart.Row(),
- aOutRange.aEnd.Col(), aOutRange.aEnd.Row());
- SCCOL nCol;
- SCROW nRow1, nRow2;
- rtl::OUString sOUButtonList;
- const ScPatternAttr* pAttr = aAttrItr.GetNext(nCol, nRow1, nRow2);
- while (pAttr)
- {
- ScMergeFlagAttr& rItem = (ScMergeFlagAttr&)pAttr->GetItem(ATTR_MERGE_FLAG);
- if (rItem.HasButton())
- {
- for (SCROW nButtonRow = nRow1; nButtonRow <= nRow2; ++nButtonRow)
- {
- ScAddress aButtonAddr(nCol, nButtonRow, aOutRange.aStart.Tab());
- ScRangeStringConverter::GetStringFromAddress(
- sOUButtonList, aButtonAddr, pDoc, ::formula::FormulaGrammar::CONV_OOO, ' ', sal_True );
- }
- }
- pAttr = aAttrItr.GetNext(nCol, nRow1, nRow2);
- }
- rtl::OUString sName((*pDPs)[i]->GetName());
- rtl::OUString sApplicationData((*pDPs)[i]->GetTag());
- sal_Bool bRowGrand = pDPSave->GetRowGrand();
- sal_Bool bColumnGrand = pDPSave->GetColumnGrand();
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, sName);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_APPLICATION_DATA, sApplicationData);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, sTargetRangeAddress);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_BUTTONS, sOUButtonList);
- if (!(bRowGrand && bColumnGrand))
- {
- if (bRowGrand)
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_ROW);
- else if (bColumnGrand)
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_COLUMN);
- else
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_NONE);
- }
- if (pDPSave->GetIgnoreEmptyRows())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IGNORE_EMPTY_ROWS, XML_TRUE);
- if (pDPSave->GetRepeatIfEmpty())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IDENTIFY_CATEGORIES, XML_TRUE);
- if (!pDPSave->GetFilterButton())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_FALSE);
- if (!pDPSave->GetDrillDown())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE);
- SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True);
-
- // grand total elements.
-
- const OUString* pGrandTotalName = pDPSave->GetGrandTotalName();
- if (pGrandTotalName && rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST)
- {
- // Use the new data-pilot-grand-total element.
- if (bRowGrand && bColumnGrand)
- {
- WriteGrandTotal(XML_BOTH, true, pGrandTotalName);
- }
- else
- {
- WriteGrandTotal(XML_ROW, bRowGrand, pGrandTotalName);
- WriteGrandTotal(XML_COLUMN, bColumnGrand, pGrandTotalName);
- }
- }
+ ScAddress aButtonAddr(nCol, nButtonRow, aOutRange.aStart.Tab());
+ ScRangeStringConverter::GetStringFromAddress(
+ sOUButtonList, aButtonAddr, pDoc, ::formula::FormulaGrammar::CONV_OOO, ' ', sal_True );
+ }
+ }
+ pAttr = aAttrItr.GetNext(nCol, nRow1, nRow2);
+ }
+ rtl::OUString sName((*pDPs)[i]->GetName());
+ rtl::OUString sApplicationData((*pDPs)[i]->GetTag());
+ sal_Bool bRowGrand = pDPSave->GetRowGrand();
+ sal_Bool bColumnGrand = pDPSave->GetColumnGrand();
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, sName);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_APPLICATION_DATA, sApplicationData);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, sTargetRangeAddress);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_BUTTONS, sOUButtonList);
+ if (!(bRowGrand && bColumnGrand))
+ {
+ if (bRowGrand)
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_ROW);
+ else if (bColumnGrand)
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_COLUMN);
+ else
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_NONE);
+ }
+ if (pDPSave->GetIgnoreEmptyRows())
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IGNORE_EMPTY_ROWS, XML_TRUE);
+ if (pDPSave->GetRepeatIfEmpty())
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IDENTIFY_CATEGORIES, XML_TRUE);
+ if (!pDPSave->GetFilterButton())
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_FALSE);
+ if (!pDPSave->GetDrillDown())
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE);
+ if ((*pDPs)[i]->GetHeaderLayout())
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TRUE);
+
+ SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True);
+
+ // grand total elements.
+
+ const OUString* pGrandTotalName = pDPSave->GetGrandTotalName();
+ if (pGrandTotalName && rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST)
+ {
+ // Use the new data-pilot-grand-total element.
+ if (bRowGrand && bColumnGrand)
+ {
+ WriteGrandTotal(XML_BOTH, true, pGrandTotalName);
+ }
+ else
+ {
+ WriteGrandTotal(XML_ROW, bRowGrand, pGrandTotalName);
+ WriteGrandTotal(XML_COLUMN, bColumnGrand, pGrandTotalName);
+ }
+ }
- rExport.CheckAttrList();
- if ((*pDPs)[i]->IsSheetData())
- {
- const ScSheetSourceDesc* pSheetSource = (*pDPs)[i]->GetSheetDesc();
- rtl::OUString sCellRangeAddress;
- ScRangeStringConverter::GetStringFromRange( sCellRangeAddress, pSheetSource->aSourceRange, pDoc, ::formula::FormulaGrammar::CONV_OOO );
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, sCellRangeAddress);
- SvXMLElementExport aElemSCR(rExport, XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, sal_True, sal_True);
- rExport.CheckAttrList();
- WriteDPFilter(pSheetSource->aQueryParam);
- }
- else if ((*pDPs)[i]->IsImportData())
- {
- const ScImportSourceDesc* pImpSource = (*pDPs)[i]->GetImportSourceDesc();
- switch (pImpSource->nType)
- {
- case sheet::DataImportMode_NONE : break;
- case sheet::DataImportMode_QUERY :
- {
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_QUERY_NAME, rtl::OUString(pImpSource->aObject));
- SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_QUERY, sal_True, sal_True);
- rExport.CheckAttrList();
- }
- break;
- case sheet::DataImportMode_TABLE :
- {
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE_NAME, rtl::OUString(pImpSource->aObject));
- SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, sal_True, sal_True);
- rExport.CheckAttrList();
- }
- break;
- case sheet::DataImportMode_SQL :
- {
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SQL_STATEMENT, rtl::OUString(pImpSource->aObject));
- if (!pImpSource->bNative)
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PARSE_SQL_STATEMENT, XML_TRUE);
- SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, sal_True, sal_True);
- rExport.CheckAttrList();
- }
- break;
- }
- }
- else if ((*pDPs)[i]->IsServiceData())
- {
- const ScDPServiceDesc* pServSource = (*pDPs)[i]->GetDPServiceDesc();
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString(pServSource->aServiceName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_NAME, rtl::OUString(pServSource->aParSource));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_OBJECT_NAME, rtl::OUString(pServSource->aParName));
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_USER_NAME, rtl::OUString(pServSource->aParUser));
- // #i111754# leave out password attribute as long as DataPilotSource doesn't specify the content
- // rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PASSWORD, rtl::OUString(pServSource->aParPass));
- SvXMLElementExport aElemSD(rExport, XML_NAMESPACE_TABLE, XML_SOURCE_SERVICE, sal_True, sal_True);
- rExport.CheckAttrList();
- }
- WriteDimensions(pDPSave);
- }
+ rExport.CheckAttrList();
+ if ((*pDPs)[i]->IsSheetData())
+ {
+ const ScSheetSourceDesc* pSheetSource = (*pDPs)[i]->GetSheetDesc();
+
+ if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST)
+ {
+ if (pSheetSource->HasRangeName())
+ rExport.AddAttribute(
+ XML_NAMESPACE_TABLE, XML_NAME, pSheetSource->GetRangeName());
+ }
+
+ OUString sCellRangeAddress;
+ ScRangeStringConverter::GetStringFromRange(
+ sCellRangeAddress, pSheetSource->GetSourceRange(), pDoc,
+ ::formula::FormulaGrammar::CONV_OOO);
+
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, sCellRangeAddress);
+ SvXMLElementExport aElemSCR(rExport, XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, sal_True, sal_True);
+ rExport.CheckAttrList();
+ WriteDPFilter(pSheetSource->GetQueryParam());
+ }
+ else if ((*pDPs)[i]->IsImportData())
+ {
+ const ScImportSourceDesc* pImpSource = (*pDPs)[i]->GetImportSourceDesc();
+ switch (pImpSource->nType)
+ {
+ case sheet::DataImportMode_NONE : break;
+ case sheet::DataImportMode_QUERY :
+ {
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_QUERY_NAME, rtl::OUString(pImpSource->aObject));
+ SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_QUERY, sal_True, sal_True);
+ rExport.CheckAttrList();
+ }
+ break;
+ case sheet::DataImportMode_TABLE :
+ {
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE_NAME, rtl::OUString(pImpSource->aObject));
+ SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, sal_True, sal_True);
+ rExport.CheckAttrList();
}
+ break;
+ case sheet::DataImportMode_SQL :
+ {
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATABASE_NAME, rtl::OUString(pImpSource->aDBName));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SQL_STATEMENT, rtl::OUString(pImpSource->aObject));
+ if (!pImpSource->bNative)
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PARSE_SQL_STATEMENT, XML_TRUE);
+ SvXMLElementExport aElemID(rExport, XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, sal_True, sal_True);
+ rExport.CheckAttrList();
+ }
+ break;
}
}
+ else if ((*pDPs)[i]->IsServiceData())
+ {
+ const ScDPServiceDesc* pServSource = (*pDPs)[i]->GetDPServiceDesc();
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString(pServSource->aServiceName));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_NAME, rtl::OUString(pServSource->aParSource));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_OBJECT_NAME, rtl::OUString(pServSource->aParName));
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_USER_NAME, rtl::OUString(pServSource->aParUser));
+ // #i111754# leave out password attribute as long as DataPilotSource doesn't specify the content
+ // rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PASSWORD, rtl::OUString(pServSource->aParPass));
+ SvXMLElementExport aElemSD(rExport, XML_NAMESPACE_TABLE, XML_SOURCE_SERVICE, sal_True, sal_True);
+ rExport.CheckAttrList();
+ }
+ WriteDimensions(pDPSave);
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportDataPilot.hxx b/sc/source/filter/xml/XMLExportDataPilot.hxx
index 600d96aa1d73..c1b9426f552d 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.hxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,3 +79,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index 3c7ee76c41e8..3e0ca1857bff 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,7 +80,6 @@ ScMyEmptyDatabaseRangesContainer ScXMLExportDatabaseRanges::GetEmptyDatabaseRang
ScMyEmptyDatabaseRangesContainer aSkipRanges;
if (rExport.GetModel().is())
{
- sal_Int32 nSkipRangesCount = 0;
uno::Reference <beans::XPropertySet> xPropertySet (rExport.GetModel(), uno::UNO_QUERY);
if (xPropertySet.is())
{
@@ -117,8 +117,6 @@ ScMyEmptyDatabaseRangesContainer ScXMLExportDatabaseRanges::GetEmptyDatabaseRang
}
}
}
- if (nSkipRangesCount > 1)
- aSkipRanges.Sort();
}
}
}
@@ -132,7 +130,7 @@ void ScXMLExportDatabaseRanges::WriteImportDescriptor(const uno::Sequence <beans
rtl::OUString sConRes;
rtl::OUString sSourceObject;
sheet::DataImportMode nSourceType = sheet::DataImportMode_NONE;
- sal_Bool bNative = sal_False;
+ sal_Bool bNative = false;
for (sal_Int16 i = 0; i < nProperties; ++i)
{
if (aImportDescriptor[i].Name == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_DBNAME)))
@@ -313,8 +311,8 @@ void ScXMLExportDatabaseRanges::WriteFilterDescriptor(const uno::Reference <shee
rExport.CheckAttrList();
sal_Bool bIsCaseSensitive = ::cppu::any2bool(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ISCASE))));
sal_Bool bUseRegularExpressions = ::cppu::any2bool(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_USEREGEX))));
- sal_Bool bAnd = sal_False;
- sal_Bool bOr = sal_False;
+ sal_Bool bAnd = false;
+ sal_Bool bOr = false;
for (sal_Int32 i = 1; i < nTableFilterFields; ++i)
{
if (aTableFilterFields[i].Connection == sheet::FilterConnection_AND)
@@ -355,7 +353,7 @@ void ScXMLExportDatabaseRanges::WriteFilterDescriptor(const uno::Reference <shee
bOpenAndElement = sal_True;
}
else
- bOpenAndElement = sal_False;
+ bOpenAndElement = false;
for (sal_Int32 i = 1; i < nTableFilterFields; ++i)
{
if (aConnection != aTableFilterFields[i].Connection)
@@ -371,7 +369,7 @@ void ScXMLExportDatabaseRanges::WriteFilterDescriptor(const uno::Reference <shee
{
WriteCondition(aPrevFilterField, bIsCaseSensitive, bUseRegularExpressions);
rExport.EndElement(aName, sal_True);
- bOpenAndElement = sal_False;
+ bOpenAndElement = false;
}
}
else
@@ -381,7 +379,7 @@ void ScXMLExportDatabaseRanges::WriteFilterDescriptor(const uno::Reference <shee
if (bOpenAndElement)
{
rExport.EndElement(aName, sal_True);
- bOpenAndElement = sal_False;
+ bOpenAndElement = false;
}
if (i == nTableFilterFields - 1)
{
@@ -408,9 +406,8 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans::
{
uno::Sequence <table::TableSortField> aSortFields;
sal_Bool bBindFormatsToContent (sal_True);
- sal_Bool bCopyOutputData (sal_False);
-// sal_Bool bIsCaseSensitive (sal_False);
- sal_Bool bIsUserListEnabled (sal_False);
+ sal_Bool bCopyOutputData (false);
+ sal_Bool bIsUserListEnabled (false);
table::CellAddress aOutputPosition;
sal_Int32 nUserListIndex = 0;
sal_Int32 nProperties = aSortProperties.getLength();
@@ -421,9 +418,6 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans::
bBindFormatsToContent = ::cppu::any2bool(aSortProperties[i].Value);
else if (aSortProperties[i].Name.compareToAscii(SC_UNONAME_COPYOUT) == 0)
bCopyOutputData = ::cppu::any2bool(aSortProperties[i].Value);
-// no longer supported
-/* else if (aSortProperties[i].Name.compareToAscii(SC_UNONAME_ISCASE) == 0)
- bIsCaseSensitive = ::cppu::any2bool(aSortProperties[i].Value);*/
else if (aSortProperties[i].Name.compareToAscii(SC_UNONAME_ISULIST) == 0)
bIsUserListEnabled = ::cppu::any2bool(aSortProperties[i].Value);
else if (aSortProperties[i].Name.compareToAscii(SC_UNONAME_OUTPOS) == 0)
@@ -432,11 +426,6 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans::
aSortProperties[i].Value >>= nUserListIndex;
else if (aSortProperties[i].Name.compareToAscii(SC_UNONAME_SORTFLD) == 0)
aSortProperties[i].Value >>= aSortFields;
-// no longer supported
-/* else if (aSortProperties[i].Name.compareToAscii(SC_UNONAME_COLLLOC) == 0)
- aSortProperties[i].Value >>= aCollatorLocale;
- else if (aSortProperties[i].Name.compareToAscii(SC_UNONAME_COLLALG) == 0)
- aSortProperties[i].Value >>= sCollatorAlgorithm;*/
}
sal_Int32 nSortFields = aSortFields.getLength();
if (nSortFields > 0)
@@ -449,9 +438,6 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans::
ScRangeStringConverter::GetStringFromAddress( sOUCellAddress, aOutputPosition, pDoc, ::formula::FormulaGrammar::CONV_OOO );
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, sOUCellAddress);
}
-// no longer supported
-// if (bIsCaseSensitive)
-// rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CASE_SENSITIVE, XML_TRUE);
if (aSortFields[0].IsCaseSensitive)
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CASE_SENSITIVE, XML_TRUE);
@@ -462,13 +448,6 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans::
DBG_ASSERT(bCaseSensitive == aSortFields[i].IsCaseSensitive, "seems that it is now possible to have every field case sensitive");
}
#endif
-// no longer supported
-/* if (aCollatorLocale.Language.getLength())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_LANGUAGE, aCollatorLocale.Language);
- if (aCollatorLocale.Country.getLength())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COUNTRY, aCollatorLocale.Country);
- if (sCollatorAlgorithm.getLength())
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ALGORITHM, sCollatorAlgorithm);*/
if (aSortFields[0].CollatorLocale.Language.getLength())
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_LANGUAGE, aSortFields[0].CollatorLocale.Language);
if (aSortFields[0].CollatorLocale.Country.getLength())
@@ -529,9 +508,6 @@ void ScXMLExportDatabaseRanges::WriteSubTotalDescriptor(const com::sun::star::un
if (nSubTotalFields > 0)
{
uno::Reference <beans::XPropertySet> xPropertySet (xSubTotalDescriptor, uno::UNO_QUERY);
-// sal_Bool bEnableUserSortList = sal_False;
-// sal_Bool bSortAscending = sal_True;
-// sal_Int32 nUserSortListIndex = 0;
if (xPropertySet.is())
{
if (!::cppu::any2bool(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_BINDFMT)))))
@@ -540,9 +516,6 @@ void ScXMLExportDatabaseRanges::WriteSubTotalDescriptor(const com::sun::star::un
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PAGE_BREAKS_ON_GROUP_CHANGE, XML_TRUE);
if (::cppu::any2bool(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ISCASE)))))
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CASE_SENSITIVE, XML_TRUE);
-// bSortAscending = ::cppu::any2bool(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_SORTASCENDING))));
-// if (::cppu::any2bool(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ENABLEUSERSORTLIST)))))
-// xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_USERSORTLISTINDEX))) >>= nUserSortListIndex;
}
SvXMLElementExport aElemSTRs(rExport, XML_NAMESPACE_TABLE, XML_SUBTOTAL_RULES, sal_True, sal_True);
rExport.CheckAttrList();
@@ -653,13 +626,8 @@ void ScXMLExportDatabaseRanges::WriteDatabaseRanges(const com::sun::star::uno::R
if (!::cppu::any2bool(xFilterProperties->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CONTHDR)))))
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONTAINS_HEADER, XML_FALSE);
- // #98317#; there is no orientation on the filter
-/* table::TableOrientation eFilterOrient(table::TableOrientation_ROWS);
- if (::cppu::any2bool(xFilterProperties->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ORIENT)))))
- eFilterOrient = table::TableOrientation_ROWS;*/
-
sal_Bool bSortColumns(sal_True);
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
sal_Int32 nProperty(0);
while (!bFound && (nProperty < aSortProperties.getLength()))
{
@@ -697,3 +665,5 @@ void ScXMLExportDatabaseRanges::WriteDatabaseRanges(const com::sun::star::uno::R
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.hxx b/sc/source/filter/xml/XMLExportDatabaseRanges.hxx
index a581eb1271f1..31b27c4c87d2 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.hxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx
index 154fdebed95e..d990bf035038 100644
--- a/sc/source/filter/xml/XMLExportIterator.cxx
+++ b/sc/source/filter/xml/XMLExportIterator.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,7 +109,7 @@ sal_Bool ScMyShapesContainer::GetFirstAddress( table::CellAddress& rCellAddress
ScUnoConversion::FillApiAddress( rCellAddress, aShapeList.begin()->aAddress );
return (nTable == rCellAddress.Sheet);
}
- return sal_False;
+ return false;
}
void ScMyShapesContainer::SetCellData( ScMyCell& rMyCell )
@@ -171,7 +172,7 @@ sal_Bool ScMyNoteShapesContainer::GetFirstAddress( table::CellAddress& rCellAddr
ScUnoConversion::FillApiAddress( rCellAddress, aNoteShapeList.begin()->aPos );
return (nTable == rCellAddress.Sheet);
}
- return sal_False;
+ return false;
}
void ScMyNoteShapesContainer::SetCellData( ScMyCell& rMyCell )
@@ -234,7 +235,7 @@ void ScMyMergedRangesContainer::AddRange(const table::CellRangeAddress aMergedRa
aRange.nRows = nEndRow - nStartRow + 1;
aRangeList.push_back( aRange );
- aRange.bIsFirst = sal_False;
+ aRange.bIsFirst = false;
aRange.nRows = 0;
for( sal_Int32 nRow = nStartRow + 1; nRow <= nEndRow; ++nRow )
{
@@ -251,12 +252,12 @@ sal_Bool ScMyMergedRangesContainer::GetFirstAddress( table::CellAddress& rCellAd
ScUnoConversion::FillApiStartAddress( rCellAddress, aRangeList.begin()->aCellRange );
return (nTable == rCellAddress.Sheet);
}
- return sal_False;
+ return false;
}
void ScMyMergedRangesContainer::SetCellData( ScMyCell& rMyCell )
{
- rMyCell.bIsMergedBase = rMyCell.bIsCovered = sal_False;
+ rMyCell.bIsMergedBase = rMyCell.bIsCovered = false;
ScMyMergedRangeList::iterator aItr(aRangeList.begin());
if( aItr != aRangeList.end() )
{
@@ -272,7 +273,7 @@ void ScMyMergedRangesContainer::SetCellData( ScMyCell& rMyCell )
if( aItr->aCellRange.StartColumn < aItr->aCellRange.EndColumn )
{
++(aItr->aCellRange.StartColumn);
- aItr->bIsFirst = sal_False;
+ aItr->bIsFirst = false;
}
else
aRangeList.erase(aItr);
@@ -330,12 +331,12 @@ sal_Bool ScMyAreaLinksContainer::GetFirstAddress( table::CellAddress& rCellAddre
ScUnoConversion::FillApiStartAddress( rCellAddress, aAreaLinkList.begin()->aDestRange );
return (nTable == rCellAddress.Sheet);
}
- return sal_False;
+ return false;
}
void ScMyAreaLinksContainer::SetCellData( ScMyCell& rMyCell )
{
- rMyCell.bHasAreaLink = sal_False;
+ rMyCell.bHasAreaLink = false;
ScMyAreaLinkList::iterator aItr(aAreaLinkList.begin());
if( aItr != aAreaLinkList.end() )
{
@@ -352,11 +353,11 @@ void ScMyAreaLinksContainer::SetCellData( ScMyCell& rMyCell )
ScUnoConversion::FillApiStartAddress( aAddress, aItr->aDestRange );
if (aAddress == rMyCell.aCellAddress)
{
- DBG_ERROR("more than one linked range on one cell");
+ OSL_FAIL("more than one linked range on one cell");
aItr = aAreaLinkList.erase( aItr );
}
else
- bFound = sal_False;
+ bFound = false;
}
}
}
@@ -420,12 +421,12 @@ sal_Bool ScMyEmptyDatabaseRangesContainer::GetFirstAddress( table::CellAddress&
ScUnoConversion::FillApiStartAddress( rCellAddress, *(aDatabaseList.begin()) );
return (nTable == rCellAddress.Sheet);
}
- return sal_False;
+ return false;
}
void ScMyEmptyDatabaseRangesContainer::SetCellData( ScMyCell& rMyCell )
{
- rMyCell.bHasEmptyDatabase = sal_False;
+ rMyCell.bHasEmptyDatabase = false;
ScMyEmptyDatabaseRangeList::iterator aItr(aDatabaseList.begin());
if( aItr != aDatabaseList.end() )
{
@@ -514,7 +515,7 @@ sal_Bool ScMyDetectiveObjContainer::GetFirstAddress( table::CellAddress& rCellAd
rCellAddress = aDetectiveObjList.begin()->aPosition;
return (nTable == rCellAddress.Sheet);
}
- return sal_False;
+ return false;
}
void ScMyDetectiveObjContainer::SetCellData( ScMyCell& rMyCell )
@@ -580,7 +581,7 @@ sal_Bool ScMyDetectiveOpContainer::GetFirstAddress( table::CellAddress& rCellAdd
rCellAddress = aDetectiveOpList.begin()->aPosition;
return (nTable == rCellAddress.Sheet);
}
- return sal_False;
+ return false;
}
void ScMyDetectiveOpContainer::SetCellData( ScMyCell& rMyCell )
@@ -613,24 +614,25 @@ void ScMyDetectiveOpContainer::Sort()
ScMyCell::ScMyCell() :
aShapeList(),
aDetectiveObjVec(),
+ fValue(0.0),
nValidationIndex(-1),
pBaseCell(NULL),
- bIsAutoStyle( sal_False ),
- bHasShape( sal_False ),
- bIsMergedBase( sal_False ),
- bIsCovered( sal_False ),
- bHasAreaLink( sal_False ),
- bHasEmptyDatabase( sal_False ),
- bHasDetectiveObj( sal_False ),
- bHasDetectiveOp( sal_False ),
- bIsEditCell( sal_False ),
- bKnowWhetherIsEditCell( sal_False ),
- bHasStringValue( sal_False ),
- bHasDoubleValue( sal_False ),
- bHasXText( sal_False ),
- bIsMatrixBase( sal_False ),
- bIsMatrixCovered( sal_False ),
- bHasAnnotation( sal_False )
+ bIsAutoStyle( false ),
+ bHasShape( false ),
+ bIsMergedBase( false ),
+ bIsCovered( false ),
+ bHasAreaLink( false ),
+ bHasEmptyDatabase( false ),
+ bHasDetectiveObj( false ),
+ bHasDetectiveOp( false ),
+ bIsEditCell( false ),
+ bKnowWhetherIsEditCell( false ),
+ bHasStringValue( false ),
+ bHasDoubleValue( false ),
+ bHasXText( false ),
+ bIsMatrixBase( false ),
+ bIsMatrixCovered( false ),
+ bHasAnnotation( false )
{
}
@@ -674,7 +676,7 @@ void ScMyNotEmptyCellsIterator::Clear()
delete pCellItr;
if (!aAnnotations.empty())
{
- DBG_ERROR("not all Annotations saved");
+ OSL_FAIL("not all Annotations saved");
aAnnotations.clear();
}
pCellItr = NULL;
@@ -700,21 +702,21 @@ void ScMyNotEmptyCellsIterator::UpdateAddress( table::CellAddress& rAddress )
void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell& rMyCell, table::CellAddress& rAddress )
{
rMyCell.aCellAddress = rAddress;
- rMyCell.bHasStringValue = sal_False;
- rMyCell.bHasDoubleValue = sal_False;
- rMyCell.bHasXText = sal_False;
- rMyCell.bKnowWhetherIsEditCell = sal_False;
- rMyCell.bIsEditCell = sal_False;
+ rMyCell.bHasStringValue = false;
+ rMyCell.bHasDoubleValue = false;
+ rMyCell.bHasXText = false;
+ rMyCell.bKnowWhetherIsEditCell = false;
+ rMyCell.bIsEditCell = false;
if( (nCellCol == rAddress.Column) && (nCellRow == rAddress.Row) )
pCellItr->GetNext( nCellCol, nCellRow );
}
void ScMyNotEmptyCellsIterator::SetMatrixCellData( ScMyCell& rMyCell )
{
- rMyCell.bIsMatrixCovered = sal_False;
- rMyCell.bIsMatrixBase = sal_False;
+ rMyCell.bIsMatrixCovered = false;
+ rMyCell.bIsMatrixBase = false;
- sal_Bool bIsMatrixBase(sal_False);
+ sal_Bool bIsMatrixBase(false);
ScAddress aScAddress;
ScUnoConversion::FillScAddress( aScAddress, rMyCell.aCellAddress );
@@ -745,7 +747,7 @@ void ScMyNotEmptyCellsIterator::SetMatrixCellData( ScMyCell& rMyCell )
void ScMyNotEmptyCellsIterator::HasAnnotation(ScMyCell& aCell)
{
- aCell.bHasAnnotation = sal_False;
+ aCell.bHasAnnotation = false;
if (!aAnnotations.empty())
{
ScMyExportAnnotationList::iterator aItr(aAnnotations.begin());
@@ -890,3 +892,4 @@ sal_Bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell& aCell, ScFormatRangeStyles
return bFoundCell;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx
index dfd3a4d59ac1..faa3e9bf75c2 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,6 +71,8 @@ struct ScMyShape
{
ScAddress aAddress;
ScAddress aEndAddress;
+ sal_Int32 nEndX;
+ sal_Int32 nEndY;
com::sun::star::uno::Reference<com::sun::star::drawing::XShape> xShape;
sal_Bool operator<(const ScMyShape& aShape) const;
@@ -90,7 +93,7 @@ public:
using ScMyIteratorBase::UpdateAddress;
void AddNewShape(const ScMyShape& aShape);
sal_Bool HasShapes() { return !aShapeList.empty(); }
- const ScMyShapeList* GetShapes() { return &aShapeList; }
+ const ScMyShapeList* GetShapes() const { return &aShapeList; }
virtual void SetCellData( ScMyCell& rMyCell );
virtual void Sort();
void SkipTable(SCTAB nSkip);
@@ -119,7 +122,7 @@ public:
using ScMyIteratorBase::UpdateAddress;
void AddNewNote(const ScMyNoteShape& aNote);
sal_Bool HasNotes() { return !aNoteShapeList.empty(); }
- const ScMyNoteShapeList* GetNotes() { return &aNoteShapeList; }
+ const ScMyNoteShapeList* GetNotes() const { return &aNoteShapeList; }
virtual void SetCellData( ScMyCell& rMyCell );
virtual void Sort();
void SkipTable(SCTAB nSkip);
@@ -411,3 +414,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportSharedData.cxx b/sc/source/filter/xml/XMLExportSharedData.cxx
index eede3aa73499..7849b64efe9c 100644
--- a/sc/source/filter/xml/XMLExportSharedData.cxx
+++ b/sc/source/filter/xml/XMLExportSharedData.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,7 +69,7 @@ void ScMySharedData::SetLastColumn(const sal_Int32 nTable, const sal_Int32 nCol)
if(nCol > nLastColumns[nTable]) nLastColumns[nTable] = nCol;
}
-sal_Int32 ScMySharedData::GetLastColumn(const sal_Int32 nTable)
+sal_Int32 ScMySharedData::GetLastColumn(const sal_Int32 nTable) const
{
return nLastColumns[nTable];
}
@@ -78,7 +79,7 @@ void ScMySharedData::SetLastRow(const sal_Int32 nTable, const sal_Int32 nRow)
if(nRow > nLastRows[nTable]) nLastRows[nTable] = nRow;
}
-sal_Int32 ScMySharedData::GetLastRow(const sal_Int32 nTable)
+sal_Int32 ScMySharedData::GetLastRow(const sal_Int32 nTable) const
{
return nLastRows[nTable];
}
@@ -108,7 +109,7 @@ uno::Reference<drawing::XDrawPage> ScMySharedData::GetDrawPage(const sal_Int32 n
sal_Bool ScMySharedData::HasForm(const sal_Int32 nTable, uno::Reference<drawing::XDrawPage>& xDrawPage)
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (pDrawPages)
{
if ((*pDrawPages)[nTable].bHasForms)
@@ -161,3 +162,5 @@ void ScMySharedData::SortNoteShapes()
if (pNoteShapes)
pNoteShapes->Sort();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportSharedData.hxx b/sc/source/filter/xml/XMLExportSharedData.hxx
index e808101805fd..3c131f5925fe 100644
--- a/sc/source/filter/xml/XMLExportSharedData.hxx
+++ b/sc/source/filter/xml/XMLExportSharedData.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@ struct ScMyDrawPage
com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> xDrawPage;
sal_Bool bHasForms;
- ScMyDrawPage() : bHasForms(sal_False) {}
+ ScMyDrawPage() : bHasForms(false) {}
};
typedef std::list< com::sun::star::uno::Reference<com::sun::star::drawing::XShape> > ScMyTableXShapes;
@@ -67,12 +68,12 @@ public:
void SetLastColumn(const sal_Int32 nTable, const sal_Int32 nCol);
void SetLastRow(const sal_Int32 nTable, const sal_Int32 nRow);
- sal_Int32 GetLastColumn(const sal_Int32 nTable);
- sal_Int32 GetLastRow(const sal_Int32 nTable);
+ sal_Int32 GetLastColumn(const sal_Int32 nTable) const;
+ sal_Int32 GetLastRow(const sal_Int32 nTable) const;
void AddDrawPage(const ScMyDrawPage& aDrawPage, const sal_Int32 nTable);
void SetDrawPageHasForms(const sal_Int32 nTable, sal_Bool bHasForms);
com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> GetDrawPage(const sal_Int32 nTable);
- sal_Bool HasDrawPage() { return pDrawPages != NULL; }
+ sal_Bool HasDrawPage() const { return pDrawPages != NULL; }
sal_Bool HasForm(const sal_Int32 nTable, com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage>& xDrawPage);
void AddNewShape(const ScMyShape& aMyShape);
void SortShapesContainer();
@@ -88,3 +89,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 66f3ea613a3a..c3685941c736 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,9 +63,9 @@ ScMyValidation::ScMyValidation()
sImputTitle(),
sFormula1(),
sFormula2(),
- bShowErrorMessage(sal_False),
- bShowImputMessage(sal_False),
- bIgnoreBlanks(sal_False)
+ bShowErrorMessage(false),
+ bShowImputMessage(false),
+ bIgnoreBlanks(false)
{
}
@@ -91,7 +92,7 @@ sal_Bool ScMyValidation::IsEqual(const ScMyValidation& aVal) const
aVal.sFormula2 == sFormula2)
return sal_True;
else
- return sal_False;
+ return false;
}
ScMyValidationsContainer::ScMyValidationsContainer()
@@ -123,7 +124,7 @@ ScMyValidationsContainer::~ScMyValidationsContainer()
sal_Bool ScMyValidationsContainer::AddValidation(const uno::Any& aTempAny,
sal_Int32& nValidationIndex)
{
- sal_Bool bAdded(sal_False);
+ sal_Bool bAdded(false);
uno::Reference<beans::XPropertySet> xPropertySet(aTempAny, uno::UNO_QUERY);
if (xPropertySet.is())
{
@@ -162,7 +163,7 @@ sal_Bool ScMyValidationsContainer::AddValidation(const uno::Any& aTempAny,
aValidation.aBaseCell = xCondition->getSourcePosition();
}
//ScMyValidationRange aValidationRange;
- sal_Bool bEqualFound(sal_False);
+ sal_Bool bEqualFound(false);
sal_Int32 i(0);
sal_Int32 nCount(aValidationVec.size());
while (i < nCount && !bEqualFound)
@@ -298,7 +299,7 @@ rtl::OUString ScMyValidationsContainer::GetCondition(ScXMLExport& rExport, const
{
const formula::FormulaGrammar::Grammar eGrammar = rExport.GetDocument()->GetStorageGrammar();
sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC);
- sCondition = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sCondition, sal_False );
+ sCondition = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sCondition, false );
}
return sCondition;
@@ -337,7 +338,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport,
{
if ((sText[i] == '\n'))
{
- SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, false);
rExport.GetTextParagraphExport()->exportText(sTemp.makeStringAndClear(), bPrevCharWasSpace);
}
else
@@ -346,7 +347,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport,
}
if (sTemp.getLength())
{
- SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, false);
rExport.GetTextParagraphExport()->exportText(sTemp.makeStringAndClear(), bPrevCharWasSpace);
}
}
@@ -386,7 +387,7 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport)
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_LIST, XML_SORTED_ASCENDING);
break;
default:
- DBG_ERROR("unknown ListType");
+ OSL_FAIL("unknown ListType");
}
}
}
@@ -403,19 +404,19 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport)
case sheet::ValidationAlertStyle_INFO :
{
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MESSAGE_TYPE, XML_INFORMATION);
- WriteMessage(rExport, aItr->sErrorTitle, aItr->sErrorMessage, aItr->bShowErrorMessage, sal_False);
+ WriteMessage(rExport, aItr->sErrorTitle, aItr->sErrorMessage, aItr->bShowErrorMessage, false);
}
break;
case sheet::ValidationAlertStyle_WARNING :
{
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MESSAGE_TYPE, XML_WARNING);
- WriteMessage(rExport, aItr->sErrorTitle, aItr->sErrorMessage, aItr->bShowErrorMessage, sal_False);
+ WriteMessage(rExport, aItr->sErrorTitle, aItr->sErrorMessage, aItr->bShowErrorMessage, false);
}
break;
case sheet::ValidationAlertStyle_STOP :
{
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MESSAGE_TYPE, XML_STOP);
- WriteMessage(rExport, aItr->sErrorTitle, aItr->sErrorMessage, aItr->bShowErrorMessage, sal_False);
+ WriteMessage(rExport, aItr->sErrorTitle, aItr->sErrorMessage, aItr->bShowErrorMessage, false);
}
break;
case sheet::ValidationAlertStyle_MACRO :
@@ -500,7 +501,7 @@ void ScMyDefaultStyles::FillDefaultStyles(const sal_Int32 nTable,
pDefaults = pColDefaults;
nLast = nLastCol;
}
- sal_Bool bPrevAutoStyle(sal_False);
+ sal_Bool bPrevAutoStyle(false);
sal_Bool bIsAutoStyle;
sal_Bool bResult;
sal_Int32 nPrevIndex(0);
@@ -583,7 +584,7 @@ void ScMyDefaultStyles::FillDefaultStyles(const sal_Int32 nTable,
if (pColDefaults)
delete pColDefaults;
pColDefaults = new ScMyDefaultStyleList(nLastCol + 1);
- FillDefaultStyles(nTable, nLastRow, nLastCol, pCellStyles, pDoc, sal_False);
+ FillDefaultStyles(nTable, nLastRow, nLastCol, pCellStyles, pDoc, false);
}
ScMyDefaultStyles::~ScMyDefaultStyles()
@@ -643,7 +644,7 @@ void ScRowFormatRanges::AddRange(const sal_Int32 nPrevStartCol, const sal_Int32
(bPrevAutoStyle != rFormatRange.bIsAutoStyle))
nIndex = rFormatRange.nIndex;
- sal_Bool bInserted(sal_False);
+ sal_Bool bInserted(false);
if (!aRowFormatRanges.empty())
{
ScMyRowFormatRange* pRange(&aRowFormatRanges.back());
@@ -684,7 +685,7 @@ void ScRowFormatRanges::AddRange(ScMyRowFormatRange& rFormatRange,
sal_Int32 nPrevIndex((*pRowDefaults)[nRow].nIndex);
sal_Bool bPrevAutoStyle((*pRowDefaults)[nRow].bIsAutoStyle);
sal_uInt32 i(nRow + 1);
- sal_Bool bReady(sal_False);
+ sal_Bool bReady(false);
while ((i < nEnd) && !bReady && (i < pRowDefaults->size()))
{
if ((nPrevIndex != (*pRowDefaults)[i].nIndex) ||
@@ -742,29 +743,31 @@ sal_Bool ScRowFormatRanges::GetNext(ScMyRowFormatRange& aFormatRange)
--nSize;
return sal_True;
}
- return sal_False;
+ return false;
}
-sal_Int32 ScRowFormatRanges::GetMaxRows()
+sal_Int32 ScRowFormatRanges::GetMaxRows() const
{
- ScMyRowFormatRangesList::iterator aItr(aRowFormatRanges.begin());
- ScMyRowFormatRangesList::iterator aEndItr(aRowFormatRanges.end());
+ ScMyRowFormatRangesList::const_iterator aItr(aRowFormatRanges.begin());
+ ScMyRowFormatRangesList::const_iterator aEndItr(aRowFormatRanges.end());
sal_Int32 nMaxRows = MAXROW + 1;
if (aItr != aEndItr)
+ {
while (aItr != aEndItr)
{
if ((*aItr).nRepeatRows < nMaxRows)
nMaxRows = (*aItr).nRepeatRows;
++aItr;
}
+ }
else
{
- DBG_ERROR("no ranges found");
+ OSL_FAIL("no ranges found");
}
return nMaxRows;
}
-sal_Int32 ScRowFormatRanges::GetSize()
+sal_Int32 ScRowFormatRanges::GetSize() const
{
return nSize;
}
@@ -790,7 +793,7 @@ sal_Bool ScMyFormatRange::operator<(const ScMyFormatRange& rRange) const
if (aRangeAddress.StartRow == rRange.aRangeAddress.StartRow)
return (aRangeAddress.StartColumn < rRange.aRangeAddress.StartColumn);
else
- return sal_False;
+ return false;
}
ScFormatRangeStyles::ScFormatRangeStyles()
@@ -847,7 +850,7 @@ sal_Bool ScFormatRangeStyles::AddStyleName(rtl::OUString* rpString, sal_Int32& r
else
{
sal_Int32 nCount(aStyleNames.size());
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
sal_Int32 i(nCount - 1);
while ((i >= 0) && (!bFound))
{
@@ -859,7 +862,7 @@ sal_Bool ScFormatRangeStyles::AddStyleName(rtl::OUString* rpString, sal_Int32& r
if (bFound)
{
rIndex = i;
- return sal_False;
+ return false;
}
else
{
@@ -883,7 +886,7 @@ sal_Int32 ScFormatRangeStyles::GetIndexOfStyleName(const rtl::OUString& rString,
else
{
sal_Int32 i(0);
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while (!bFound && static_cast<size_t>(i) < aStyleNames.size())
{
if (aStyleNames[i]->equals(rString))
@@ -893,7 +896,7 @@ sal_Int32 ScFormatRangeStyles::GetIndexOfStyleName(const rtl::OUString& rString,
}
if (bFound)
{
- bIsAutoStyle = sal_False;
+ bIsAutoStyle = false;
return i;
}
else
@@ -1113,7 +1116,7 @@ sal_Int32 ScColumnRowStylesBase::GetIndexOfStyleName(const rtl::OUString& rStrin
else
{
sal_Int32 i(0);
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while (!bFound && static_cast<size_t>(i) < aStyleNames.size())
{
if (aStyleNames.at(i)->equals(rString))
@@ -1132,7 +1135,7 @@ rtl::OUString* ScColumnRowStylesBase::GetStyleNameByIndex(const sal_Int32 nIndex
{
if ( nIndex < 0 || nIndex >= sal::static_int_cast<sal_Int32>( aStyleNames.size() ) )
{
- // #123981# should no longer happen, use first style then
+ // should no longer happen, use first style then
DBG_ERRORFILE("GetStyleNameByIndex: invalid index");
return aStyleNames[0];
}
@@ -1200,9 +1203,16 @@ rtl::OUString* ScColumnStyles::GetStyleName(const sal_Int32 nTable, const sal_In
//===========================================================================
+ScRowStyles::Cache::Cache() :
+ mnTable(-1), mnStart(-1), mnEnd(-1), mnStyle(-1) {}
+
+bool ScRowStyles::Cache::hasCache(sal_Int32 nTable, sal_Int32 nField) const
+{
+ return mnTable == nTable && mnStart <= nField && nField < mnEnd;
+}
+
ScRowStyles::ScRowStyles()
- : ScColumnRowStylesBase(),
- aTables()
+ : ScColumnRowStylesBase()
{
}
@@ -1216,29 +1226,41 @@ void ScRowStyles::AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields)
if (nTable > nSize)
for (sal_Int32 i = nSize; i < nTable; ++i)
{
- ScMysalInt32Vec aFieldsVec(nFields + 1, -1);
- aTables.push_back(aFieldsVec);
+ aTables.push_back(new StylesType(0, nFields+1, -1));
}
}
sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nField)
{
DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
- if (static_cast<size_t>(nField) < aTables[nTable].size())
- return aTables[nTable][nField];
- else
- return aTables[nTable][aTables[nTable].size() - 1];
+ if (maCache.hasCache(nTable, nField))
+ // Cache hit !
+ return maCache.mnStyle;
+
+ StylesType& r = aTables[nTable];
+ if (!r.is_tree_valid())
+ r.build_tree();
+ sal_Int32 nStyle;
+ sal_Int32 nStart, nEnd;
+ if (r.search_tree(nField, nStyle, &nStart, &nEnd))
+ {
+ // Cache this value for better performance.
+ maCache.mnTable = nTable;
+ maCache.mnStart = nStart;
+ maCache.mnEnd = nEnd;
+ maCache.mnStyle = nStyle;
+ return nStyle;
+ }
+
+ return -1;
}
void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nField,
const sal_Int32 nStringIndex)
{
DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
- DBG_ASSERT(aTables[nTable].size() >= static_cast<size_t>(nField), "wrong field");
- if (aTables[nTable].size() == static_cast<size_t>(nField))
- aTables[nTable].push_back(nStringIndex);
- else
- aTables[nTable][nField] = nStringIndex;
+ StylesType& r = aTables[nTable];
+ r.insert_back(nField, nField+1, nStringIndex);
}
void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nStartField,
@@ -1246,22 +1268,13 @@ void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nSta
{
DBG_ASSERT( nStartField <= nEndField, "bad field range");
DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
- DBG_ASSERT(aTables[nTable].size() >= static_cast<size_t>(nStartField), "wrong field");
- ScMysalInt32Vec& rTable = aTables[nTable];
- size_t nSize = rTable.size();
- if (nSize == static_cast<size_t>(nStartField))
- rTable.insert( rTable.end(), static_cast<size_t>(nEndField - nStartField + 1), nStringIndex);
- else
- {
- size_t nField = static_cast<size_t>(nStartField);
- for ( ; nField < nSize && nField <= static_cast<size_t>(nEndField); ++nField)
- rTable[nField] = nStringIndex;
- if (nField <= static_cast<size_t>(nEndField))
- rTable.insert( rTable.end(), static_cast<size_t>(nEndField - nField + 1), nStringIndex);
- }
+ StylesType& r = aTables[nTable];
+ r.insert_back(nStartField, nEndField+1, nStringIndex);
}
rtl::OUString* ScRowStyles::GetStyleName(const sal_Int32 nTable, const sal_Int32 nField)
{
return GetStyleNameByIndex(GetStyleNameIndex(nTable, nField));
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index 79b19b7ce9ab..e3baa64cb68c 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,9 @@
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <mdds/flat_segment_tree.hpp>
+
class ScDocument;
class ScXMLExport;
@@ -138,8 +142,8 @@ public:
const sal_Int32 nLastRow, const sal_Int32 nLastCol,
const ScFormatRangeStyles* pCellStyles, ScDocument* pDoc);
- const ScMyDefaultStyleList* GetRowDefaults() { return pRowDefaults; }
- const ScMyDefaultStyleList* GetColDefaults() { return pColDefaults; }
+ const ScMyDefaultStyleList* GetRowDefaults() const { return pRowDefaults; }
+ const ScMyDefaultStyleList* GetColDefaults() const { return pColDefaults; }
};
struct ScMyRowFormatRange
@@ -155,10 +159,9 @@ struct ScMyRowFormatRange
sal_Bool operator<(const ScMyRowFormatRange& rRange) const;
};
-typedef std::list<ScMyRowFormatRange> ScMyRowFormatRangesList;
-
class ScRowFormatRanges
{
+ typedef std::list<ScMyRowFormatRange> ScMyRowFormatRangesList;
ScMyRowFormatRangesList aRowFormatRanges;
const ScMyDefaultStyleList* pRowDefaults;
const ScMyDefaultStyleList* pColDefaults;
@@ -177,8 +180,8 @@ public:
void Clear();
void AddRange(ScMyRowFormatRange& rFormatRange, const sal_Int32 nStartRow);
sal_Bool GetNext(ScMyRowFormatRange& rFormatRange);
- sal_Int32 GetMaxRows();
- sal_Int32 GetSize();
+ sal_Int32 GetMaxRows() const;
+ sal_Int32 GetSize() const;
void Sort();
};
@@ -196,11 +199,11 @@ struct ScMyFormatRange
sal_Bool operator< (const ScMyFormatRange& rRange) const;
};
-typedef std::list<ScMyFormatRange> ScMyFormatRangeAddresses;
-typedef std::vector<ScMyFormatRangeAddresses*> ScMyFormatRangeListVec;
-
class ScFormatRangeStyles
{
+ typedef std::list<ScMyFormatRange> ScMyFormatRangeAddresses;
+ typedef std::vector<ScMyFormatRangeAddresses*> ScMyFormatRangeListVec;
+
ScMyFormatRangeListVec aTables;
ScMyOUStringVec aStyleNames;
ScMyOUStringVec aAutoStyleNames;
@@ -253,12 +256,10 @@ struct ScColumnStyle
ScColumnStyle() : nIndex(-1), bIsVisible(sal_True) {}
};
-
-typedef std::vector<ScColumnStyle> ScMyColumnStyleVec;
-typedef std::vector<ScMyColumnStyleVec> ScMyColumnVectorVec;
-
class ScColumnStyles : public ScColumnRowStylesBase
{
+ typedef std::vector<ScColumnStyle> ScMyColumnStyleVec;
+ typedef std::vector<ScMyColumnStyleVec> ScMyColumnVectorVec;
ScMyColumnVectorVec aTables;
public:
@@ -272,12 +273,21 @@ public:
virtual rtl::OUString* GetStyleName(const sal_Int32 nTable, const sal_Int32 nField);
};
-typedef std::vector<sal_Int32> ScMysalInt32Vec;
-typedef std::vector<ScMysalInt32Vec> ScMyRowVectorVec;
-
class ScRowStyles : public ScColumnRowStylesBase
{
- ScMyRowVectorVec aTables;
+ typedef ::mdds::flat_segment_tree<sal_Int32, sal_Int32> StylesType;
+ ::boost::ptr_vector<StylesType> aTables;
+ struct Cache
+ {
+ sal_Int32 mnTable;
+ sal_Int32 mnStart;
+ sal_Int32 mnEnd;
+ sal_Int32 mnStyle;
+ Cache();
+
+ bool hasCache(sal_Int32 nTable, sal_Int32 nField) const;
+ };
+ Cache maCache;
public:
ScRowStyles();
@@ -292,3 +302,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLStylesImportHelper.cxx b/sc/source/filter/xml/XMLStylesImportHelper.cxx
index 492c7a63ee30..1087a6840e8d 100644
--- a/sc/source/filter/xml/XMLStylesImportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesImportHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,7 @@
#include <com/sun/star/util/NumberFormat.hpp>
using namespace com::sun::star;
+using ::std::list;
void ScMyStyleNumberFormats::AddStyleNumberFormat(const rtl::OUString& rStyleName, const sal_Int32 nNumberFormat)
{
@@ -53,153 +55,82 @@ sal_Int32 ScMyStyleNumberFormats::GetStyleNumberFormat(const rtl::OUString& rSty
return aItr->nNumberFormat;
}
-ScMyStyleRanges::ScMyStyleRanges()
- :
- pTextList(NULL),
- pNumberList(NULL),
- pTimeList(NULL),
- pDateTimeList(NULL),
- pPercentList(NULL),
- pLogicalList(NULL),
- pUndefinedList(NULL),
+ScMyStyleRanges::ScMyStyleRanges() :
pCurrencyList(NULL)
{
}
ScMyStyleRanges::~ScMyStyleRanges()
{
- if (pTextList)
- delete pTextList;
- if (pNumberList)
- delete pNumberList;
- if (pTimeList)
- delete pTimeList;
- if (pDateTimeList)
- delete pDateTimeList;
- if (pPercentList)
- delete pPercentList;
- if (pLogicalList)
- delete pLogicalList;
- if (pUndefinedList)
- delete pUndefinedList;
- if (pCurrencyList)
- delete pCurrencyList;
-}
-
-void ScMyStyleRanges::AddRange(const ScRange& rRange, ScRangeList* pList,
- const rtl::OUString* pStyleName, const sal_Int16 nType,
- ScXMLImport& rImport, const sal_uInt32 nMaxRanges)
-{
- pList->Join(rRange);
- DBG_ASSERT(nMaxRanges > 0, "MaxRanges to less");
- if (pList->Count() > nMaxRanges)
- {
- sal_Int32 nCount(pList->Count());
- ScRange* pRange(NULL);
- for (sal_Int32 i = 0; i < nCount; ++i)
- {
- pRange = pList->GetObject(i);
- if (pRange && (pRange->aEnd.Row() + 1 < rRange.aStart.Row()))
- {
- rImport.SetStyleToRange(*pRange, pStyleName, nType, NULL);
- delete pRange;
- pRange = NULL;
- pList->Remove(i);
- }
- }
- }
-}
-
-void ScMyStyleRanges::AddCurrencyRange(const ScRange& rRange, ScRangeListRef xList,
- const rtl::OUString* pStyleName, const rtl::OUString* pCurrency,
- ScXMLImport& rImport, const sal_uInt32 nMaxRanges)
-{
- xList->Join(rRange);
- DBG_ASSERT(nMaxRanges > 0, "MaxRanges to less");
- if (xList->Count() > nMaxRanges)
- {
- sal_Int32 nCount(xList->Count());
- ScRange* pRange(NULL);
- for (sal_Int32 i = 0; i < nCount; ++i)
- {
- pRange = xList->GetObject(i);
- if (pRange && (pRange->aEnd.Row() + 1 < rRange.aStart.Row()))
- {
- rImport.SetStyleToRange(*pRange, pStyleName, util::NumberFormat::CURRENCY, pCurrency);
- delete pRange;
- pRange = NULL;
- xList->Remove(i);
- }
- }
- }
+ delete pCurrencyList;
}
void ScMyStyleRanges::AddRange(const ScRange& rRange,
- const rtl::OUString* pStyleName, const sal_Int16 nType,
- ScXMLImport& rImport, const sal_uInt32 nMaxRanges)
+ const rtl::OUString* /*pStyleName*/, const sal_Int16 nType,
+ ScXMLImport& /*rImport*/, const sal_uInt32 /*nMaxRanges*/)
{
switch (nType)
{
case util::NumberFormat::NUMBER:
{
- if (!pNumberList)
- pNumberList = new ScRangeList();
- AddRange(rRange, pNumberList, pStyleName, nType, rImport, nMaxRanges);
+ if (!mpNumberList)
+ mpNumberList.reset(new ScSimpleRangeList);
+ mpNumberList->addRange(rRange);
}
break;
case util::NumberFormat::TEXT:
{
- if (!pTextList)
- pTextList = new ScRangeList();
- AddRange(rRange, pTextList, pStyleName, nType, rImport, nMaxRanges);
+ if (!mpTextList)
+ mpTextList.reset(new ScSimpleRangeList);
+ mpTextList->addRange(rRange);
}
break;
case util::NumberFormat::TIME:
{
- if (!pTimeList)
- pTimeList = new ScRangeList();
- AddRange(rRange, pTimeList, pStyleName, nType, rImport, nMaxRanges);
+ if (!mpTimeList)
+ mpTimeList.reset(new ScSimpleRangeList);
+ mpTimeList->addRange(rRange);
}
break;
case util::NumberFormat::DATETIME:
{
- if (!pDateTimeList)
- pDateTimeList = new ScRangeList();
- AddRange(rRange, pDateTimeList, pStyleName, nType, rImport, nMaxRanges);
+ if (!mpDateTimeList)
+ mpDateTimeList.reset(new ScSimpleRangeList);
+ mpDateTimeList->addRange(rRange);
}
break;
case util::NumberFormat::PERCENT:
{
- if (!pPercentList)
- pPercentList = new ScRangeList();
- AddRange(rRange, pPercentList, pStyleName, nType, rImport, nMaxRanges);
+ if (!mpPercentList)
+ mpPercentList.reset(new ScSimpleRangeList);
+ mpPercentList->addRange(rRange);
}
break;
case util::NumberFormat::LOGICAL:
{
- if (!pLogicalList)
- pLogicalList = new ScRangeList();
- AddRange(rRange, pLogicalList, pStyleName, nType, rImport, nMaxRanges);
+ if (!mpLogicalList)
+ mpLogicalList.reset(new ScSimpleRangeList);
+ mpLogicalList->addRange(rRange);
}
break;
case util::NumberFormat::UNDEFINED:
{
- if (!pUndefinedList)
- pUndefinedList = new ScRangeList();
- AddRange(rRange, pUndefinedList, pStyleName, nType, rImport, nMaxRanges);
+ if (!mpUndefinedList)
+ mpUndefinedList.reset(new ScSimpleRangeList);
+ mpUndefinedList->addRange(rRange);
}
break;
default:
{
- DBG_ERROR("wrong type");
+ OSL_FAIL("wrong type");
}
break;
}
}
void ScMyStyleRanges::AddCurrencyRange(const ScRange& rRange,
- const rtl::OUString* pStyleName, const rtl::OUString* pCurrency,
- ScXMLImport& rImport, const sal_uInt32 nMaxRanges)
+ const rtl::OUString* /*pStyleName*/, const rtl::OUString* pCurrency,
+ ScXMLImport& /*rImport*/, const sal_uInt32 /*nMaxRanges*/)
{
if (!pCurrencyList)
pCurrencyList = new ScMyCurrencyStylesSet();
@@ -213,96 +144,156 @@ void ScMyStyleRanges::AddCurrencyRange(const ScRange& rRange,
if (aPair.second)
{
aItr = aPair.first;
- AddCurrencyRange(rRange, aItr->xRanges, pStyleName, pCurrency, rImport, nMaxRanges);
+ aItr->mpRanges->addRange(rRange);
}
}
else
- aItr->xRanges->Join(rRange);
+ aItr->mpRanges->addRange(rRange);
}
-void ScMyStyleRanges::InsertColRow(const ScRange& rRange, const SCsCOL nDx, const SCsROW nDy,
- const SCsTAB nDz, ScDocument* pDoc)
+void ScMyStyleRanges::InsertRow(const sal_Int32 nRow, const sal_Int32 nTab, ScDocument* /*pDoc*/)
{
- UpdateRefMode aRefMode(URM_INSDEL);
- if (pNumberList)
- pNumberList->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
- if (pTextList)
- pTextList->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
- if (pTimeList)
- pTimeList->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
- if (pDateTimeList)
- pDateTimeList->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
- if (pPercentList)
- pPercentList->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
- if (pLogicalList)
- pLogicalList->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
- if (pUndefinedList)
- pUndefinedList->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
+ if (mpTextList)
+ mpTextList->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
+ if (mpNumberList)
+ mpNumberList->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
+ if (mpTimeList)
+ mpTimeList->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
+ if (mpDateTimeList)
+ mpDateTimeList->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
+ if (mpPercentList)
+ mpPercentList->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
+ if (mpLogicalList)
+ mpLogicalList->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
+ if (mpUndefinedList)
+ mpUndefinedList->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
+
if (pCurrencyList)
{
ScMyCurrencyStylesSet::iterator aItr(pCurrencyList->begin());
ScMyCurrencyStylesSet::iterator aEndItr(pCurrencyList->end());
while (aItr != aEndItr)
{
- aItr->xRanges->UpdateReference(aRefMode, pDoc, rRange, nDx, nDy, nDz);
+ aItr->mpRanges->insertRow(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab));
++aItr;
}
}
}
-void ScMyStyleRanges::InsertRow(const sal_Int32 nRow, const sal_Int32 nTab, ScDocument* pDoc)
+void ScMyStyleRanges::InsertCol(const sal_Int32 nCol, const sal_Int32 nTab, ScDocument* /*pDoc*/)
{
- InsertColRow(ScRange(0, static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab),
- MAXCOL, MAXROW, static_cast<SCTAB>(nTab)), 0, 1, 0, pDoc);
+ if (mpTextList)
+ mpTextList->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+ if (mpNumberList)
+ mpNumberList->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+ if (mpTimeList)
+ mpTimeList->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+ if (mpDateTimeList)
+ mpDateTimeList->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+ if (mpPercentList)
+ mpPercentList->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+ if (mpLogicalList)
+ mpLogicalList->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+ if (mpUndefinedList)
+ mpUndefinedList->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+
+ if (pCurrencyList)
+ {
+ ScMyCurrencyStylesSet::iterator aItr(pCurrencyList->begin());
+ ScMyCurrencyStylesSet::iterator aEndItr(pCurrencyList->end());
+ while (aItr != aEndItr)
+ {
+ aItr->mpRanges->insertCol(static_cast<SCCOL>(nCol), static_cast<SCTAB>(nTab));
+ ++aItr;
+ }
+ }
}
-void ScMyStyleRanges::InsertCol(const sal_Int32 nCol, const sal_Int32 nTab, ScDocument* pDoc)
+void ScMyStyleRanges::SetStylesToRanges(const list<ScRange>& rRanges,
+ const rtl::OUString* pStyleName, const sal_Int16 nCellType,
+ const rtl::OUString* pCurrency, ScXMLImport& rImport)
{
- InsertColRow(ScRange(static_cast<SCCOL>(nCol), 0, static_cast<SCTAB>(nTab),
- MAXCOL, MAXROW, static_cast<SCTAB>(nTab)), 1, 0, 0, pDoc);
+ list<ScRange>::const_iterator itr = rRanges.begin(), itrEnd = rRanges.end();
+ for (; itr != itrEnd; ++itr)
+ rImport.SetStyleToRange(*itr, pStyleName, nCellType, pCurrency);
}
void ScMyStyleRanges::SetStylesToRanges(ScRangeList* pList,
const rtl::OUString* pStyleName, const sal_Int16 nCellType,
const rtl::OUString* pCurrency, ScXMLImport& rImport)
{
- sal_Int32 nCount(pList->Count());
- for (sal_Int32 i = 0; i < nCount; ++i)
- rImport.SetStyleToRange(*pList->GetObject(i), pStyleName, nCellType, pCurrency);
+ for ( size_t i = 0, nCount = pList->size(); i < nCount; ++i)
+ rImport.SetStyleToRange( *(*pList)[i], pStyleName, nCellType, pCurrency );
}
void ScMyStyleRanges::SetStylesToRanges(ScRangeListRef xList,
const rtl::OUString* pStyleName, const sal_Int16 nCellType,
const rtl::OUString* pCurrency, ScXMLImport& rImport)
{
- sal_Int32 nCount(xList->Count());
- for (sal_Int32 i = 0; i < nCount; ++i)
- rImport.SetStyleToRange(*xList->GetObject(i), pStyleName, nCellType, pCurrency);
+ for (size_t i = 0, nCount = xList->size(); i < nCount; ++i)
+ rImport.SetStyleToRange( *(*xList)[i], pStyleName, nCellType, pCurrency );
}
void ScMyStyleRanges::SetStylesToRanges(const rtl::OUString* pStyleName, ScXMLImport& rImport)
{
- if (pNumberList)
- SetStylesToRanges(pNumberList, pStyleName, util::NumberFormat::NUMBER, NULL, rImport);
- if (pTextList)
- SetStylesToRanges(pTextList, pStyleName, util::NumberFormat::TEXT, NULL, rImport);
- if (pTimeList)
- SetStylesToRanges(pTimeList, pStyleName, util::NumberFormat::TIME, NULL, rImport);
- if (pDateTimeList)
- SetStylesToRanges(pDateTimeList, pStyleName, util::NumberFormat::DATETIME, NULL, rImport);
- if (pPercentList)
- SetStylesToRanges(pPercentList, pStyleName, util::NumberFormat::PERCENT, NULL, rImport);
- if (pLogicalList)
- SetStylesToRanges(pLogicalList, pStyleName, util::NumberFormat::LOGICAL, NULL, rImport);
- if (pUndefinedList)
- SetStylesToRanges(pUndefinedList, pStyleName, util::NumberFormat::UNDEFINED, NULL, rImport);
+ if (mpNumberList)
+ {
+ list<ScRange> aList;
+ mpNumberList->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::NUMBER, NULL, rImport);
+ mpNumberList->clear();
+ }
+ if (mpTextList)
+ {
+ list<ScRange> aList;
+ mpTextList->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::TEXT, NULL, rImport);
+ mpTextList->clear();
+ }
+ if (mpTimeList)
+ {
+ list<ScRange> aList;
+ mpTimeList->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::TIME, NULL, rImport);
+ mpTimeList->clear();
+ }
+ if (mpDateTimeList)
+ {
+ list<ScRange> aList;
+ mpDateTimeList->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::DATETIME, NULL, rImport);
+ mpDateTimeList->clear();
+ }
+ if (mpPercentList)
+ {
+ list<ScRange> aList;
+ mpPercentList->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::PERCENT, NULL, rImport);
+ mpPercentList->clear();
+ }
+ if (mpLogicalList)
+ {
+ list<ScRange> aList;
+ mpLogicalList->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::LOGICAL, NULL, rImport);
+ mpLogicalList->clear();
+ }
+ if (mpUndefinedList)
+ {
+ list<ScRange> aList;
+ mpUndefinedList->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::UNDEFINED, NULL, rImport);
+ mpUndefinedList->clear();
+ }
if (pCurrencyList)
{
ScMyCurrencyStylesSet::iterator aItr(pCurrencyList->begin());
ScMyCurrencyStylesSet::iterator aEndItr(pCurrencyList->end());
while (aItr != aEndItr)
{
- SetStylesToRanges(aItr->xRanges, pStyleName, util::NumberFormat::CURRENCY, &aItr->sCurrency, rImport);
+ list<ScRange> aList;
+ aItr->mpRanges->getRangeList(aList);
+ SetStylesToRanges(aList, pStyleName, util::NumberFormat::CURRENCY, &aItr->sCurrency, rImport);
++aItr;
}
}
@@ -356,7 +347,7 @@ ScMyStylesSet::iterator ScMyStylesImportHelper::GetIterator(const rtl::OUString*
aStyle.sStyleName = *pStyleNameP;
else
{
- DBG_ERROR("here is no stylename given");
+ OSL_FAIL("here is no stylename given");
}
ScMyStylesSet::iterator aItr(aCellStyles.find(aStyle));
if (aItr == aCellStyles.end())
@@ -366,7 +357,7 @@ ScMyStylesSet::iterator ScMyStylesImportHelper::GetIterator(const rtl::OUString*
aItr = aPair.first;
else
{
- DBG_ERROR("not possible to insert style");
+ OSL_FAIL("not possible to insert style");
return aCellStyles.end();
}
}
@@ -485,7 +476,7 @@ void ScMyStylesImportHelper::AddRange(const ScRange& rRange)
{
if (!bPrevRangeAdded)
{
- sal_Bool bAddRange(sal_False);
+ sal_Bool bAddRange(false);
if (nCellType == nPrevCellType &&
IsEqual(pStyleName, pPrevStyleName) &&
IsEqual(pCurrency, pPrevCurrency))
@@ -524,7 +515,7 @@ void ScMyStylesImportHelper::AddRange(const ScRange& rRange)
{
aPrevRange = rRange;
ResetAttributes();
- bPrevRangeAdded = sal_False;
+ bPrevRangeAdded = false;
}
}
@@ -537,7 +528,7 @@ void ScMyStylesImportHelper::AddCell(const com::sun::star::table::CellAddress& r
void ScMyStylesImportHelper::InsertRow(const sal_Int32 nRow, const sal_Int32 nTab, ScDocument* pDoc)
{
- rImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(rImport);
ScMyStylesSet::iterator aItr(aCellStyles.begin());
ScMyStylesSet::iterator aEndItr(aCellStyles.end());
while (aItr != aEndItr)
@@ -545,12 +536,11 @@ void ScMyStylesImportHelper::InsertRow(const sal_Int32 nRow, const sal_Int32 nTa
aItr->xRanges->InsertRow(nRow, nTab, pDoc);
++aItr;
}
- rImport.UnlockSolarMutex();
}
void ScMyStylesImportHelper::InsertCol(const sal_Int32 nCol, const sal_Int32 nTab, ScDocument* pDoc)
{
- rImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(rImport);
ScMyStylesSet::iterator aItr(aCellStyles.begin());
ScMyStylesSet::iterator aEndItr(aCellStyles.end());
while (aItr != aEndItr)
@@ -558,7 +548,6 @@ void ScMyStylesImportHelper::InsertCol(const sal_Int32 nCol, const sal_Int32 nTa
aItr->xRanges->InsertCol(nCol, nTab, pDoc);
++aItr;
}
- rImport.UnlockSolarMutex();
}
void ScMyStylesImportHelper::EndTable()
@@ -585,3 +574,4 @@ void ScMyStylesImportHelper::SetStylesToRanges()
nMaxRanges = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLStylesImportHelper.hxx b/sc/source/filter/xml/XMLStylesImportHelper.hxx
index 3a15dbeff52a..b7f3e18906aa 100644
--- a/sc/source/filter/xml/XMLStylesImportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesImportHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,12 +30,15 @@
#define SC_XMLSTYLESIMPORTHELPER_HXX
#include "rangelst.hxx"
+#include "simplerangelist.hxx"
#include <rtl/ustring.hxx>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <set>
#include <vector>
+#include <list>
+#include <boost/shared_ptr.hpp>
class ScXMLImport;
@@ -72,9 +76,11 @@ public:
struct ScMyCurrencyStyle
{
rtl::OUString sCurrency;
- ScRangeListRef xRanges;
+ ::boost::shared_ptr<ScSimpleRangeList> mpRanges;
- ScMyCurrencyStyle() : xRanges(new ScRangeList()) {}
+ ScMyCurrencyStyle() :
+ mpRanges(new ScSimpleRangeList)
+ {}
~ScMyCurrencyStyle() {}
};
@@ -90,23 +96,18 @@ typedef std::set<ScMyCurrencyStyle, LessCurrencyStyle> ScMyCurrencyStylesSet;
class ScMyStyleRanges : public SvRefBase
{
- ScRangeList* pTextList;
- ScRangeList* pNumberList;
- ScRangeList* pTimeList;
- ScRangeList* pDateTimeList;
- ScRangeList* pPercentList;
- ScRangeList* pLogicalList;
- ScRangeList* pUndefinedList;
+ ::boost::shared_ptr<ScSimpleRangeList> mpTextList;
+ ::boost::shared_ptr<ScSimpleRangeList> mpNumberList;
+ ::boost::shared_ptr<ScSimpleRangeList> mpTimeList;
+ ::boost::shared_ptr<ScSimpleRangeList> mpDateTimeList;
+ ::boost::shared_ptr<ScSimpleRangeList> mpPercentList;
+ ::boost::shared_ptr<ScSimpleRangeList> mpLogicalList;
+ ::boost::shared_ptr<ScSimpleRangeList> mpUndefinedList;
ScMyCurrencyStylesSet* pCurrencyList;
- void AddRange(const ScRange& rRange, ScRangeList* pList,
- const rtl::OUString* pStyleName, const sal_Int16 nType,
- ScXMLImport& rImport, const sal_uInt32 nMaxRanges);
- void AddCurrencyRange(const ScRange& rRange, ScRangeListRef xList,
- const rtl::OUString* pStyleName, const rtl::OUString* pCurrency,
- ScXMLImport& rImport, const sal_uInt32 nMaxRanges);
- void InsertColRow(const ScRange& rRange, const SCsCOL nDx, const SCsROW nDy,
- const SCsTAB nDz, ScDocument* pDoc);
+ void SetStylesToRanges(const ::std::list<ScRange>& rList,
+ const rtl::OUString* pStyleName, const sal_Int16 nCellType,
+ const rtl::OUString* pCurrency, ScXMLImport& rImport);
void SetStylesToRanges(ScRangeList* pList,
const rtl::OUString* pStyleName, const sal_Int16 nCellType,
const rtl::OUString* pCurrency, ScXMLImport& rImport);
@@ -193,3 +194,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index fb0b1235007e..7e21651685e1 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,6 +45,7 @@ using namespace ::com::sun::star::text;
using namespace ::com::sun::star::beans;
using namespace xmloff::token;
+using rtl::OUString;
TYPEINIT1( XMLTableHeaderFooterContext, SvXMLImportContext );
@@ -55,16 +57,16 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport,
sal_Bool bFooter, sal_Bool bLft ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
xPropSet( rPageStylePropSet ),
- sOn( OUString::createFromAscii( bFooter ? SC_UNO_PAGE_FTRON : SC_UNO_PAGE_HDRON ) ),
- sShareContent( OUString::createFromAscii( bFooter ? SC_UNO_PAGE_FTRSHARED : SC_UNO_PAGE_HDRSHARED ) ),
- sContent( OUString::createFromAscii( bFooter ? SC_UNO_PAGE_RIGHTFTRCON : SC_UNO_PAGE_RIGHTHDRCON ) ),
- sContentLeft( OUString::createFromAscii( bFooter ? SC_UNO_PAGE_LEFTFTRCONT : SC_UNO_PAGE_LEFTHDRCONT ) ),
+ sOn( bFooter ? OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_FTRON)) : OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_HDRON)) ),
+ sShareContent( bFooter ? OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_FTRSHARED)) : OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_HDRSHARED)) ),
+ sContent( bFooter ? OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_RIGHTFTRCON)) : OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_RIGHTHDRCON)) ),
+ sContentLeft( bFooter ? OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_LEFTFTRCONT)) : OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_PAGE_LEFTHDRCONT)) ),
bDisplay( sal_True ),
bInsertContent( sal_True ),
bLeft( bLft ),
- bContainsLeft(sal_False),
- bContainsRight(sal_False),
- bContainsCenter(sal_False)
+ bContainsLeft(false),
+ bContainsRight(false),
+ bContainsCenter(false)
{
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
for( sal_Int16 i=0; i < nAttrCount; ++i )
@@ -89,7 +91,7 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport,
{
if( ::cppu::any2bool(xPropSet->getPropertyValue( sShareContent )) )
// Don't share headers any longer
- xPropSet->setPropertyValue( sShareContent, uno::makeAny(sal_False) );
+ xPropSet->setPropertyValue( sShareContent, uno::makeAny(false) );
}
else
{
@@ -266,3 +268,5 @@ void XMLHeaderFooterRegionContext::EndElement()
if (xOldTextCursor.is())
GetImport().GetTextImport()->SetCursor(xOldTextCursor);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
index a3ce9c4c970d..eecedc746b3e 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,3 +113,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index 91f27ab646a7..4b145b9df1d3 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,11 +63,11 @@ void XMLTableMasterPageExport::exportHeaderFooterContent(
if( bAutoStyles )
GetExport().GetTextParagraphExport()
- ->collectTextAutoStyles( rText, bProgress, sal_False );
+ ->collectTextAutoStyles( rText, bProgress, false );
else
{
GetExport().GetTextParagraphExport()->exportTextDeclarations( rText );
- GetExport().GetTextParagraphExport()->exportText( rText, bProgress, sal_False );
+ GetExport().GetTextParagraphExport()->exportText( rText, bProgress, false );
}
}
@@ -91,26 +92,26 @@ void XMLTableMasterPageExport::exportHeaderFooter(const com::sun::star::uno::Ref
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
aName, sal_True, sal_True );
if (sCenter.getLength() && !sLeft.getLength() && !sRight.getLength())
- exportHeaderFooterContent( xCenter, sal_False, sal_False );
+ exportHeaderFooterContent( xCenter, false, false );
else
{
if (sLeft.getLength())
{
SvXMLElementExport aSubElem( GetExport(), XML_NAMESPACE_STYLE,
XML_REGION_LEFT, sal_True, sal_True );
- exportHeaderFooterContent( xLeft, sal_False, sal_False );
+ exportHeaderFooterContent( xLeft, false, false );
}
if (sCenter.getLength())
{
SvXMLElementExport aSubElem( GetExport(), XML_NAMESPACE_STYLE,
XML_REGION_CENTER, sal_True, sal_True );
- exportHeaderFooterContent( xCenter, sal_False, sal_False );
+ exportHeaderFooterContent( xCenter, false, false );
}
if (sRight.getLength())
{
SvXMLElementExport aSubElem( GetExport(), XML_NAMESPACE_STYLE,
XML_REGION_RIGHT, sal_True, sal_True );
- exportHeaderFooterContent( xRight, sal_False, sal_False );
+ exportHeaderFooterContent( xRight, false, false );
}
}
}
@@ -133,27 +134,27 @@ void XMLTableMasterPageExport::exportMasterPageContent(
{
if( xHeader.is() )
{
- exportHeaderFooterContent( xHeader->getCenterText(), sal_True, sal_False );
- exportHeaderFooterContent( xHeader->getLeftText(), sal_True, sal_False );
- exportHeaderFooterContent( xHeader->getRightText(), sal_True, sal_False );
+ exportHeaderFooterContent( xHeader->getCenterText(), sal_True, false );
+ exportHeaderFooterContent( xHeader->getLeftText(), sal_True, false );
+ exportHeaderFooterContent( xHeader->getRightText(), sal_True, false );
}
if( xHeaderLeft.is())
{
- exportHeaderFooterContent( xHeaderLeft->getCenterText(), sal_True, sal_False );
- exportHeaderFooterContent( xHeaderLeft->getLeftText(), sal_True, sal_False );
- exportHeaderFooterContent( xHeaderLeft->getRightText(), sal_True, sal_False );
+ exportHeaderFooterContent( xHeaderLeft->getCenterText(), sal_True, false );
+ exportHeaderFooterContent( xHeaderLeft->getLeftText(), sal_True, false );
+ exportHeaderFooterContent( xHeaderLeft->getRightText(), sal_True, false );
}
if( xFooter.is() )
{
- exportHeaderFooterContent( xFooter->getCenterText(), sal_True, sal_False );
- exportHeaderFooterContent( xFooter->getLeftText(), sal_True, sal_False );
- exportHeaderFooterContent( xFooter->getRightText(), sal_True, sal_False );
+ exportHeaderFooterContent( xFooter->getCenterText(), sal_True, false );
+ exportHeaderFooterContent( xFooter->getLeftText(), sal_True, false );
+ exportHeaderFooterContent( xFooter->getRightText(), sal_True, false );
}
if( xFooterLeft.is())
{
- exportHeaderFooterContent( xFooterLeft->getCenterText(), sal_True, sal_False );
- exportHeaderFooterContent( xFooterLeft->getLeftText(), sal_True, sal_False );
- exportHeaderFooterContent( xFooterLeft->getRightText(), sal_True, sal_False );
+ exportHeaderFooterContent( xFooterLeft->getCenterText(), sal_True, false );
+ exportHeaderFooterContent( xFooterLeft->getLeftText(), sal_True, false );
+ exportHeaderFooterContent( xFooterLeft->getRightText(), sal_True, false );
}
}
else
@@ -176,3 +177,4 @@ void XMLTableMasterPageExport::exportMasterPageContent(
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.hxx b/sc/source/filter/xml/XMLTableMasterPageExport.hxx
index 0a277bec0bb9..33327ee3b90d 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.hxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,4 @@ public:
#endif // _XMLOFF_XMLTABLEMASTERPAGEEXPORT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index cc425e0f4d65..27c9cb701a27 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include "drwlayer.hxx"
#include "xmlannoi.hxx"
#include "rangeutl.hxx"
+#include "userdat.hxx"
#include "docuno.hxx"
#include "sheetdata.hxx"
#include <xmloff/nmspmap.hxx>
@@ -50,11 +52,13 @@ using namespace ::com::sun::star;
using namespace xmloff::token;
using ::rtl::OUString;
+using rtl::OUString;
+
XMLTableShapeImportHelper::XMLTableShapeImportHelper(
ScXMLImport& rImp, SvXMLImportPropertyMapper *pImpMapper ) :
XMLShapeImportHelper(rImp, rImp.GetModel(), pImpMapper ),
pAnnotationContext(NULL),
- bOnTable(sal_False)
+ bOnTable(false)
{
}
@@ -87,6 +91,11 @@ void XMLTableShapeImportHelper::finishShape(
{
if (!pAnnotationContext)
{
+ ScDrawObjData aAnchor;
+ aAnchor.maStart = ScAddress(aStartCell.Column, aStartCell.Row, aStartCell.Sheet);
+ awt::Point aStartPoint(rShape->getPosition());
+ aAnchor.maStartOffset = Point(aStartPoint.X, aStartPoint.Y);
+
sal_Int32 nEndX(-1);
sal_Int32 nEndY(-1);
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -108,11 +117,18 @@ void XMLTableShapeImportHelper::finishShape(
{
sal_Int32 nOffset(0);
ScRangeStringConverter::GetAddressFromString(aEndCell, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), ::formula::FormulaGrammar::CONV_OOO, nOffset);
+ aAnchor.maEnd = ScAddress(aEndCell.Column, aEndCell.Row, aEndCell.Sheet);
}
else if (IsXMLToken(aLocalName, XML_END_X))
+ {
static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndX, rValue);
+ aAnchor.maEndOffset.X() = nEndX;
+ }
else if (IsXMLToken(aLocalName, XML_END_Y))
+ {
static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndY, rValue);
+ aAnchor.maEndOffset.Y() = nEndY;
+ }
else if (IsXMLToken(aLocalName, XML_TABLE_BACKGROUND))
if (IsXMLToken(rValue, XML_TRUE))
nLayerID = SC_LAYER_BACK;
@@ -125,39 +141,28 @@ void XMLTableShapeImportHelper::finishShape(
}
SetLayer(rShape, nLayerID, rShape->getShapeType());
- if (!bOnTable)
+ if (SvxShape* pShapeImp = SvxShape::getImplementation(rShape))
{
- rTables.AddShape(rShape,
- pRangeList, aStartCell, aEndCell, nEndX, nEndY);
- SvxShape* pShapeImp = SvxShape::getImplementation(rShape);
- if (pShapeImp)
+ if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
{
- SdrObject *pSdrObj = pShapeImp->GetSdrObject();
- if (pSdrObj)
- ScDrawLayer::SetAnchor(pSdrObj, SCA_CELL);
+ if (!bOnTable)
+ ScDrawLayer::SetCellAnchored(*pSdrObj, aAnchor);
+ else
+ ScDrawLayer::SetPageAnchored(*pSdrObj);
}
}
- else
- {
- if ( pRangeList )
- {
- // #i78086# If there are notification ranges, the ChartListener must be created
- // also when anchored to the sheet
- // -> call AddShape with invalid cell position (checked in ScMyShapeResizer::ResizeShapes)
- table::CellAddress aInvalidPos( -1, -1, -1 );
- rTables.AddShape(rShape,
- pRangeList, aInvalidPos, aInvalidPos, 0, 0);
- }
+ if ( bOnTable && pRangeList )
+ {
+ // #i78086# If there are notification ranges, the ChartListener must be created
+ // also when anchored to the sheet
+ // -> call AddOLE with invalid cell position (checked in ScMyShapeResizer::ResizeShapes)
- SvxShape* pShapeImp = SvxShape::getImplementation(rShape);
- if (pShapeImp)
- {
- SdrObject *pSdrObj = pShapeImp->GetSdrObject();
- if (pSdrObj)
- ScDrawLayer::SetAnchor(pSdrObj, SCA_PAGE);
- }
+ if (rTables.IsOLE(rShape))
+ rTables.AddOLE(rShape, *pRangeList);
}
+
+ delete pRangeList;
}
else // shape is annotation
{
@@ -183,7 +188,7 @@ void XMLTableShapeImportHelper::finishShape(
bNote = true;
}
}
- else //#99532# this are grouped shapes which should also get the layerid
+ else //this are grouped shapes which should also get the layerid
{
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
sal_Int16 nLayerID(-1);
@@ -213,3 +218,5 @@ void XMLTableShapeImportHelper::finishShape(
static_cast<ScXMLImport&>(mrImporter).UnlockSolarMutex();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.hxx b/sc/source/filter/xml/XMLTableShapeImportHelper.hxx
index 94a64312c8ed..fb40daa82756 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.hxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index 6e70d4d53c0f..e5281f43cb88 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,38 +49,38 @@ using ::std::auto_ptr;
using ::std::vector;
using ::rtl::OUString;
-ScMyShapeResizer::ScMyShapeResizer(ScXMLImport& rTempImport)
+ScMyOLEFixer::ScMyOLEFixer(ScXMLImport& rTempImport)
: rImport(rTempImport),
aShapes(),
pCollection(NULL)
{
}
-ScMyShapeResizer::~ScMyShapeResizer()
+ScMyOLEFixer::~ScMyOLEFixer()
{
}
-sal_Bool ScMyShapeResizer::IsOLE(uno::Reference< drawing::XShape >& rShape) const
+sal_Bool ScMyOLEFixer::IsOLE(uno::Reference< drawing::XShape >& rShape)
{
- return rShape->getShapeType().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")));
+ return rShape->getShapeType().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OLE2Shape"));
}
-void ScMyShapeResizer::CreateChartListener(ScDocument* pDoc,
+void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
const rtl::OUString& rName,
- const rtl::OUString* pRangeList)
+ const rtl::OUString& rRangeList)
{
- if (!pDoc || !pRangeList)
- // These are minimum required.
+ // This is the minimum required.
+ if (!pDoc)
return;
- if (!pRangeList->getLength())
+ if (!rRangeList.getLength())
{
pDoc->AddOLEObjectToCollection(rName);
return;
}
OUString aRangeStr;
- ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, *pRangeList, pDoc);
+ ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, rRangeList, pDoc);
if (!aRangeStr.getLength())
{
pDoc->AddOLEObjectToCollection(rName);
@@ -92,7 +93,7 @@ void ScMyShapeResizer::CreateChartListener(ScDocument* pDoc,
if (!pCollection)
return;
- auto_ptr< vector<ScSharedTokenRef> > pRefTokens(new vector<ScSharedTokenRef>);
+ auto_ptr< vector<ScTokenRef> > pRefTokens(new vector<ScTokenRef>);
ScRefTokenHelper::compileRangeRepresentation(*pRefTokens, aRangeStr, pDoc);
if (!pRefTokens->empty())
{
@@ -115,271 +116,45 @@ void ScMyShapeResizer::CreateChartListener(ScDocument* pDoc,
}
}
-void ScMyShapeResizer::AddShape(uno::Reference <drawing::XShape>& rShape,
- rtl::OUString* pRangeList,
- table::CellAddress& rStartAddress, table::CellAddress& rEndAddress,
- sal_Int32 nEndX, sal_Int32 nEndY)
+void ScMyOLEFixer::AddOLE(uno::Reference <drawing::XShape>& rShape,
+ const rtl::OUString &rRangeList)
{
- ScMyToResizeShape aShape;
+ ScMyToFixupOLE aShape;
aShape.xShape.set(rShape);
- aShape.pRangeList = pRangeList;
- aShape.aEndCell = rEndAddress;
- aShape.aStartCell = rStartAddress;
- aShape.nEndY = nEndY;
- aShape.nEndX = nEndX;
+ aShape.sRangeList = rRangeList;
aShapes.push_back(aShape);
}
-void ScMyShapeResizer::GetNewShapeSizePos(ScDocument* pDoc, const Rectangle& rStartRect,
- const table::CellAddress& rEndCell,
- awt::Point& rPoint, awt::Size& rSize,
- sal_Int32& rEndX, sal_Int32& rEndY) const
-{
- awt::Point aRefPoint;
- sal_Bool bNegativePage(pDoc->IsNegativePage(rEndCell.Sheet));
- if (bNegativePage)
- aRefPoint.X = rStartRect.Right();
- else
- aRefPoint.X = rStartRect.Left();
- aRefPoint.Y = rStartRect.Top();
- Rectangle aRect(pDoc->GetMMRect(
- static_cast<SCCOL>(rEndCell.Column), static_cast<SCROW>(rEndCell.Row),
- static_cast<SCCOL>(rEndCell.Column), static_cast<SCROW>(rEndCell.Row), rEndCell.Sheet ));
- if (bNegativePage)
- rEndX = -rEndX + aRect.Right();
- else
- rEndX += aRect.Left();
- rEndY += aRect.Top();
- rPoint.X += aRefPoint.X;
- if (bNegativePage)
- {
- if (rPoint.X < rStartRect.Left())
- rPoint.X = rStartRect.Left() + 2; // increment by 2 100th_mm because the cellwidth is internal in twips
- }
- else
- {
- if (rPoint.X > rStartRect.Right())
- rPoint.X = rStartRect.Right() - 2; // decrement by 2 100th_mm because the cellwidth is internal in twips
- }
- rPoint.Y += aRefPoint.Y;
- if (rPoint.Y > rStartRect.Bottom())
- rPoint.Y = rStartRect.Bottom() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
- if (bNegativePage)
- {
- rSize.Width = -(rEndX - rPoint.X);
- }
- else
- rSize.Width = rEndX - rPoint.X;
- rSize.Height = rEndY - rPoint.Y;
-}
-
-void ScMyShapeResizer::ResizeShapes()
+void ScMyOLEFixer::FixupOLEs()
{
if (!aShapes.empty() && rImport.GetModel().is())
{
- rtl::OUString sRowHeight(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CELLHGT));
rtl::OUString sPersistName (RTL_CONSTASCII_USTRINGPARAM("PersistName"));
- rtl::OUString sCaptionPoint( RTL_CONSTASCII_USTRINGPARAM( "CaptionPoint" ));
- rtl::OUString sConnectorShape( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ConnectorShape") );
- rtl::OUString sCaptionShape( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape") );
- rtl::OUString sStartShape(RTL_CONSTASCII_USTRINGPARAM("StartShape"));
- rtl::OUString sEndShape(RTL_CONSTASCII_USTRINGPARAM("EndShape"));
- rtl::OUString sStartPosition(RTL_CONSTASCII_USTRINGPARAM("StartPosition"));
- rtl::OUString sEndPosition(RTL_CONSTASCII_USTRINGPARAM("EndPosition"));
- uno::Reference<table::XCellRange> xTableRow;
- uno::Reference<sheet::XSpreadsheet> xSheet;
- uno::Reference<table::XTableRows> xTableRows;
- sal_Int32 nOldRow(-1);
- sal_Int32 nOldSheet(-1);
- ScMyToResizeShapes::iterator aItr(aShapes.begin());
- ScMyToResizeShapes::iterator aEndItr(aShapes.end());
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( rImport.GetModel(), uno::UNO_QUERY );
- if ( xSpreadDoc.is() )
- {
- uno::Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
- ScDocument* pDoc(rImport.GetDocument());
- if ( pDoc && xIndex.is() )
- {
- rImport.LockSolarMutex();
- while (aItr != aEndItr)
- {
- // #i78086# invalid cell position is used to call CreateChartListener only
- if ( aItr->aEndCell.Sheet >= 0 )
- {
- if ((nOldSheet != aItr->aEndCell.Sheet) || !xSheet.is())
- {
- nOldSheet = aItr->aEndCell.Sheet;
- xSheet.set(xIndex->getByIndex(nOldSheet), uno::UNO_QUERY);
- if (xSheet.is())
- {
- uno::Reference<table::XColumnRowRange> xColumnRowRange (xSheet, uno::UNO_QUERY);
- if (xColumnRowRange.is())
- xTableRows = xColumnRowRange->getRows();
- }
- }
- if (xTableRows.is())
- {
- if (nOldRow != aItr->aEndCell.Row || !xTableRow.is())
- {
- nOldRow = aItr->aEndCell.Row;
- xTableRows->getByIndex(nOldRow) >>= xTableRow;
- }
- if (xTableRow.is())
- {
- uno::Reference <beans::XPropertySet> xRowProperties(xTableRow, uno::UNO_QUERY);
- if (xRowProperties.is())
- {
- sal_Int32 nHeight;
- if (xRowProperties->getPropertyValue(sRowHeight) >>= nHeight)
- {
- Rectangle aRec = pDoc->GetMMRect(static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row),
- static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row), aItr->aStartCell.Sheet);
- awt::Point aPoint(aItr->xShape->getPosition());
- awt::Size aSize(aItr->xShape->getSize());
- if (pDoc->IsNegativePage(static_cast<SCTAB>(nOldSheet)))
- aPoint.X += aSize.Width;
- if (aItr->nEndY >= 0 && aItr->nEndX >= 0)
- {
- if (aItr->xShape->getShapeType().equals(sConnectorShape))
- {
- //#103122#; handle connected Connectorshapes
- uno::Reference<beans::XPropertySet> xShapeProps (aItr->xShape, uno::UNO_QUERY);
- if(xShapeProps.is())
- {
- uno::Reference<drawing::XShape> xStartShape(xShapeProps->getPropertyValue( sStartShape ), uno::UNO_QUERY);
- uno::Reference<drawing::XShape> xEndShape(xShapeProps->getPropertyValue( sEndShape ), uno::UNO_QUERY);
- if (!xStartShape.is() && !xEndShape.is())
- {
- awt::Size aOldSize(aSize);
- GetNewShapeSizePos(pDoc, aRec, aItr->aEndCell, aPoint, aSize, aItr->nEndX, aItr->nEndY);
- aItr->xShape->setPosition(aPoint);
- if( (aSize.Width != aOldSize.Width) ||
- (aSize.Height != aOldSize.Height) )
- aItr->xShape->setSize(aSize);
- }
- else if (xStartShape.is() && xEndShape.is())
- {
- // do nothing, because they are connected
- }
- else
- {
- // only one point is connected, the other should be moved
-
- rtl::OUString sProperty;
- if (xStartShape.is())
- {
- awt::Point aEndPoint;
- xShapeProps->getPropertyValue(sEndPosition) >>= aEndPoint;
- aPoint.X = aRec.Left() + aEndPoint.X;
- aPoint.Y = aRec.Top() + aEndPoint.Y;
- sProperty = sEndPosition;
- }
- else
- {
- awt::Point aStartPoint;
- xShapeProps->getPropertyValue(sStartPosition) >>= aStartPoint;
- aPoint.X = aRec.Left() + aStartPoint.X;
- aPoint.Y = aRec.Top() + aStartPoint.Y;
- sProperty = sStartPosition;
- }
- xShapeProps->setPropertyValue(sProperty, uno::makeAny(aPoint));
- }
- }
- }
- else
- {
- awt::Size aOldSize(aSize);
- GetNewShapeSizePos(pDoc, aRec, aItr->aEndCell, aPoint, aSize, aItr->nEndX, aItr->nEndY);
- if (pDoc->IsNegativePage(static_cast<SCTAB>(nOldSheet)))
- aPoint.X -= aSize.Width;
- aItr->xShape->setPosition(aPoint);
- if( (aSize.Width != aOldSize.Width) ||
- (aSize.Height != aOldSize.Height) )
- aItr->xShape->setSize(aSize);
- }
- }
- else
- {
- if (aItr->xShape->getShapeType().equals(sCaptionShape))
- {
- Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
+ ScMyToFixupOLEs::iterator aItr(aShapes.begin());
+ ScMyToFixupOLEs::iterator aEndItr(aShapes.end());
+ ScDocument* pDoc(rImport.GetDocument());
- awt::Point aCaptionPoint;
- uno::Reference< beans::XPropertySet > xShapeProps(aItr->xShape, uno::UNO_QUERY);
- if (xShapeProps.is())
- {
- try
- {
- xShapeProps->getPropertyValue( sCaptionPoint ) >>= aCaptionPoint;
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR("This Captionshape has no CaptionPoint property.");
- }
- }
- Point aCorePoint(aPoint.X, aPoint.Y);
- Point aCoreCaptionPoint(aCaptionPoint.X, aCaptionPoint.Y);
- aCoreCaptionPoint += aCorePoint;
- aRectangle.Union(Rectangle(aCoreCaptionPoint, aCoreCaptionPoint));
+ ScXMLImport::MutexGuard aGuard(rImport);
- Point aBeforeRightBottomPoint(aRectangle.BottomRight());
-
- aRectangle += aRec.TopLeft();
- if (aRectangle.Left() > aRec.Right())
- aRectangle -= (Point(aRectangle.Left() - aRec.Right() + 2, 0));
- if (aRectangle.Top() > aRec.Bottom())
- aRectangle -= (Point(0, aRectangle.Top() - aRec.Bottom() + 2));
+ while (aItr != aEndItr)
+ {
+ // #i78086# also call CreateChartListener for invalid position (anchored to sheet)
+ if (!IsOLE(aItr->xShape))
+ OSL_FAIL("Only OLEs should be in here now");
- Point aDifferencePoint(aRectangle.BottomRight() - aBeforeRightBottomPoint);
- aPoint.X += aDifferencePoint.X();
- aPoint.Y += aDifferencePoint.Y();
+ if (IsOLE(aItr->xShape))
+ {
+ uno::Reference < beans::XPropertySet > xShapeProps ( aItr->xShape, uno::UNO_QUERY );
+ uno::Reference < beans::XPropertySetInfo > xShapeInfo(xShapeProps->getPropertySetInfo());
- aItr->xShape->setPosition(aPoint);
- }
- else
- {
- // #96159# it is possible, that shapes have a negative position
- // this is now handled here
- DBG_ERROR("no or negative end address of this shape");
- awt::Point aRefPoint;
- aRefPoint.X = aRec.Left();
- aRefPoint.Y = aRec.Top();
- aPoint.X += aRefPoint.X;
- if (aPoint.X > aRec.Right())
- aPoint.X = aRec.Right() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
- aPoint.Y += aRefPoint.Y;
- if (aPoint.Y > aRec.Bottom())
- aPoint.Y = aRec.Bottom() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
- aItr->xShape->setPosition(aPoint);
- }
- }
- }
- }
- }
- }
- else
- {
- DBG_ERROR("something wents wrong");
- }
- }
- // #i78086# call CreateChartListener also for invalid position (anchored to sheet)
- if (IsOLE(aItr->xShape))
- {
- uno::Reference < beans::XPropertySet > xShapeProps ( aItr->xShape, uno::UNO_QUERY );
- uno::Reference < beans::XPropertySetInfo > xShapeInfo(xShapeProps->getPropertySetInfo());
- rtl::OUString sName;
- if (xShapeProps.is() && xShapeInfo.is() && xShapeInfo->hasPropertyByName(sPersistName) &&
- (xShapeProps->getPropertyValue(sPersistName) >>= sName))
- CreateChartListener(pDoc, sName, aItr->pRangeList);
- }
- if (aItr->pRangeList)
- delete aItr->pRangeList;
- aItr = aShapes.erase(aItr);
- }
- rImport.UnlockSolarMutex();
-// if (pCollection)
-// pDoc->SetChartListenerCollection(pCollection);
+ rtl::OUString sName;
+ if (pDoc && xShapeProps.is() && xShapeInfo.is() && xShapeInfo->hasPropertyByName(sPersistName) &&
+ (xShapeProps->getPropertyValue(sPersistName) >>= sName))
+ CreateChartListener(pDoc, sName, aItr->sRangeList);
}
+ aItr = aShapes.erase(aItr);
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.hxx b/sc/source/filter/xml/XMLTableShapeResizer.hxx
index 9ece92995101..fde729ef2e7c 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.hxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,44 +39,33 @@ class ScChartListenerCollection;
class ScDocument;
class Rectangle;
-struct ScMyToResizeShape
+struct ScMyToFixupOLE
{
com::sun::star::uno::Reference <com::sun::star::drawing::XShape> xShape;
- rtl::OUString* pRangeList;
- com::sun::star::table::CellAddress aEndCell;
- com::sun::star::table::CellAddress aStartCell;
- sal_Int32 nEndX;
- sal_Int32 nEndY;
-
- ScMyToResizeShape() : pRangeList(NULL) {}
+ rtl::OUString sRangeList;
};
-typedef std::list<ScMyToResizeShape> ScMyToResizeShapes;
+typedef std::list<ScMyToFixupOLE> ScMyToFixupOLEs;
-class ScMyShapeResizer
+class ScMyOLEFixer
{
ScXMLImport& rImport;
- ScMyToResizeShapes aShapes;
+ ScMyToFixupOLEs aShapes;
ScChartListenerCollection* pCollection;
- sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const;
void CreateChartListener(ScDocument* pDoc,
const rtl::OUString& rName,
- const rtl::OUString* pRangeList);
- void GetNewShapeSizePos(ScDocument* pDoc, const Rectangle& rStartRect,
- const com::sun::star::table::CellAddress& rEndCell,
- com::sun::star::awt::Point& rPoint, com::sun::star::awt::Size& rSize,
- sal_Int32& rEndX, sal_Int32& rEndY) const;
+ const rtl::OUString& rRangeList);
public:
- ScMyShapeResizer(ScXMLImport& rImport);
- ~ScMyShapeResizer();
+ ScMyOLEFixer(ScXMLImport& rImport);
+ ~ScMyOLEFixer();
- void AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
- rtl::OUString* pRangeList,
- com::sun::star::table::CellAddress& rStartAddress,
- com::sun::star::table::CellAddress& rEndAddress,
- sal_Int32 nEndX, sal_Int32 nEndY);
- void ResizeShapes();
+ static sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape);
+ void AddOLE(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
+ const rtl::OUString &rRangeList);
+ void FixupOLEs();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableShapesContext.cxx b/sc/source/filter/xml/XMLTableShapesContext.cxx
index 9d9bfc2a1a13..6a995fe9f052 100644
--- a/sc/source/filter/xml/XMLTableShapesContext.cxx
+++ b/sc/source/filter/xml/XMLTableShapesContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,3 +86,4 @@ void ScXMLTableShapesContext::EndElement()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableShapesContext.hxx b/sc/source/filter/xml/XMLTableShapesContext.hxx
index ff38af0f9a2d..ba92335aae26 100644
--- a/sc/source/filter/xml/XMLTableShapesContext.hxx
+++ b/sc/source/filter/xml/XMLTableShapesContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx
index 5abbe4c0ea26..303b4eb684c2 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.cxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116,9 +117,9 @@ void ScXMLTableSourceContext::EndElement()
ScDocument* pDoc(GetScImport().GetDocument());
if (xLinkable.is() && pDoc)
{
- GetScImport().LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(GetScImport());
if (pDoc->RenameTab( static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet()),
- GetScImport().GetTables().GetCurrentSheetName(), sal_False, sal_True))
+ GetScImport().GetTables().GetCurrentSheetName(), false, sal_True))
{
String aFileString(sLink);
String aFilterString(sFilterName);
@@ -127,7 +128,7 @@ void ScXMLTableSourceContext::EndElement()
aFileString = ScGlobal::GetAbsDocName( aFileString, pDoc->GetDocumentShell() );
if ( !aFilterString.Len() )
- ScDocumentLoader::GetFilterName( aFileString, aFilterString, aOptString, sal_False, sal_False );
+ ScDocumentLoader::GetFilterName( aFileString, aFilterString, aOptString, false, false );
sal_uInt8 nLinkMode = SC_LINK_NONE;
if ( nMode == sheet::SheetLinkMode_NORMAL )
@@ -139,8 +140,8 @@ void ScXMLTableSourceContext::EndElement()
nLinkMode, aFileString, aFilterString, aOptString,
aSheetString, nRefresh );
}
- GetScImport().UnlockSolarMutex();
}
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTableSourceContext.hxx b/sc/source/filter/xml/XMLTableSourceContext.hxx
index 456c81baf636..8edc8551b121 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.hxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTextPContext.cxx b/sc/source/filter/xml/XMLTextPContext.cxx
index c95c881b4283..8251da5dfa0b 100644
--- a/sc/source/filter/xml/XMLTextPContext.cxx
+++ b/sc/source/filter/xml/XMLTextPContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -222,3 +223,4 @@ void ScXMLTextPContext::EndElement()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTextPContext.hxx b/sc/source/filter/xml/XMLTextPContext.hxx
index 7df19470454f..20dda85322c3 100644
--- a/sc/source/filter/xml/XMLTextPContext.hxx
+++ b/sc/source/filter/xml/XMLTextPContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index c084d83faeff..be365f4b1041 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,6 +48,8 @@ using rtl::OUString;
using namespace com::sun::star;
using namespace xmloff::token;
+using rtl::OUString;
+
//-----------------------------------------------------------------------------
class ScXMLChangeInfoContext : public SvXMLImportContext
@@ -282,8 +285,6 @@ class ScXMLChangeCellContext : public SvXMLImportContext
double& rDateTimeValue;
double fValue;
sal_uInt16& rType;
-// sal_Bool bIsMatrix;
-// sal_Bool bIsCoveredMatrix;
sal_Bool bEmpty;
sal_Bool bFirstParagraph;
sal_Bool bString;
@@ -703,9 +704,9 @@ ScXMLBigRangeContext::ScXMLBigRangeContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
rBigRange(rTempBigRange)
{
- sal_Bool bColumn(sal_False);
- sal_Bool bRow(sal_False);
- sal_Bool bTable(sal_False);
+ sal_Bool bColumn(false);
+ sal_Bool bRow(false);
+ sal_Bool bTable(false);
sal_Int32 nColumn(0);
sal_Int32 nRow(0);
sal_Int32 nTable(0);
@@ -794,8 +795,8 @@ ScXMLCellContentDeletionContext::ScXMLCellContentDeletionContext( ScXMLImport&
nMatrixRows(0),
nType(NUMBERFORMAT_ALL),
nMatrixFlag(MM_NONE),
- bBigRange(sal_False),
- bContainsCell(sal_False)
+ bBigRange(false),
+ bContainsCell(false)
{
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
for( sal_Int16 i=0; i < nAttrCount; ++i )
@@ -1075,11 +1076,11 @@ SvXMLImportContext *ScXMLChangeTextPContext::CreateChildContext( sal_uInt16 nTem
else
{
if (!pChangeCellContext->IsEditCell())
- pChangeCellContext->CreateTextPContext(sal_False);
+ pChangeCellContext->CreateTextPContext(false);
sal_Bool bWasContext (sal_True);
if (!pTextPContext)
{
- bWasContext = sal_False;
+ bWasContext = false;
pTextPContext = GetScImport().GetTextImport()->CreateTextChildContext(
GetScImport(), nPrefix, sLName, xAttrList);
}
@@ -1129,10 +1130,10 @@ ScXMLChangeCellContext::ScXMLChangeCellContext( ScXMLImport& rImport,
bEmpty(sal_True),
bFirstParagraph(sal_True),
bString(sal_True),
- bFormula(sal_False)
+ bFormula(false)
{
- sal_Bool bIsMatrix(sal_False);
- sal_Bool bIsCoveredMatrix(sal_False);
+ sal_Bool bIsMatrix(false);
+ sal_Bool bIsCoveredMatrix(false);
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
for( sal_Int16 i=0; i < nAttrCount; ++i )
{
@@ -1146,7 +1147,7 @@ ScXMLChangeCellContext::ScXMLChangeCellContext( ScXMLImport& rImport,
{
if (IsXMLToken(aLocalName, XML_FORMULA))
{
- bEmpty = sal_False;
+ bEmpty = false;
GetScImport().ExtractFormulaNamespaceGrammar( rFormula, rFormulaNmsp, rGrammar, sValue );
bFormula = sal_True;
}
@@ -1174,33 +1175,33 @@ ScXMLChangeCellContext::ScXMLChangeCellContext( ScXMLImport& rImport,
if (IsXMLToken(aLocalName, XML_VALUE_TYPE))
{
if (IsXMLToken(sValue, XML_FLOAT))
- bString = sal_False;
+ bString = false;
else if (IsXMLToken(sValue, XML_DATE))
{
rType = NUMBERFORMAT_DATE;
- bString = sal_False;
+ bString = false;
}
else if (IsXMLToken(sValue, XML_TIME))
{
rType = NUMBERFORMAT_TIME;
- bString = sal_False;
+ bString = false;
}
}
else if (IsXMLToken(aLocalName, XML_VALUE))
{
SvXMLUnitConverter::convertDouble(fValue, sValue);
- bEmpty = sal_False;
+ bEmpty = false;
}
else if (IsXMLToken(aLocalName, XML_DATE_VALUE))
{
- bEmpty = sal_False;
+ bEmpty = false;
if (GetScImport().GetMM100UnitConverter().setNullDate(GetScImport().GetModel()))
GetScImport().GetMM100UnitConverter().convertDateTime(rDateTimeValue, sValue);
fValue = rDateTimeValue;
}
else if (IsXMLToken(aLocalName, XML_TIME_VALUE))
{
- bEmpty = sal_False;
+ bEmpty = false;
GetScImport().GetMM100UnitConverter().convertTime(rDateTimeValue, sValue);
fValue = rDateTimeValue;
}
@@ -1225,11 +1226,11 @@ SvXMLImportContext *ScXMLChangeCellContext::CreateChildContext( sal_uInt16 nPref
if ((nPrefix == XML_NAMESPACE_TEXT) && (IsXMLToken(rLocalName, XML_P)))
{
- bEmpty = sal_False;
+ bEmpty = false;
if (bFirstParagraph)
{
pContext = new ScXMLChangeTextPContext(GetScImport(), nPrefix, rLocalName, xAttrList, this);
- bFirstParagraph = sal_False;
+ bFirstParagraph = false;
}
else
{
@@ -1260,10 +1261,10 @@ void ScXMLChangeCellContext::CreateTextPContext(sal_Bool bIsNewParagraph)
if (bIsNewParagraph)
{
xText->setString(sText);
- xTextCursor->gotoEnd(sal_False);
+ xTextCursor->gotoEnd(false);
uno::Reference < text::XTextRange > xTextRange (xTextCursor, uno::UNO_QUERY);
if (xTextRange.is())
- xText->insertControlCharacter(xTextRange, text::ControlCharacter::PARAGRAPH_BREAK, sal_False);
+ xText->insertControlCharacter(xTextRange, text::ControlCharacter::PARAGRAPH_BREAK, false);
}
GetScImport().GetTextImport()->SetCursor(xTextCursor);
}
@@ -1290,7 +1291,6 @@ void ScXMLChangeCellContext::EndElement()
if (GetScImport().GetDocument())
rOldCell = new ScEditCell(pEditTextObj->CreateTextObject(), GetScImport().GetDocument(), GetScImport().GetDocument()->GetEditPool());
GetScImport().GetTextImport()->ResetCursor();
- // delete pEditTextObj;
pEditTextObj->release();
}
else
@@ -1304,24 +1304,6 @@ void ScXMLChangeCellContext::EndElement()
if (rType == NUMBERFORMAT_DATE || rType == NUMBERFORMAT_TIME)
rInputString = sText;
}
- else
- {
- // do nothing, this has to do later (on another place)
- /*ScAddress aCellPos;
- rOldCell = new ScFormulaCell(GetScImport().GetDocument(), aCellPos, sFormula);
- if (bString)
- static_cast<ScFormulaCell*>(rOldCell)->SetString(sValue);
- else
- static_cast<ScFormulaCell*>(rOldCell)->SetDouble(fValue);
- static_cast<ScFormulaCell*>(rOldCell)->SetInChangeTrack(sal_True);
- if (bIsCoveredMatrix)
- static_cast<ScFormulaCell*>(rOldCell)->SetMatrixFlag(MM_REFERENCE);
- else if (bIsMatrix && nMatrixRows && nMatrixCols)
- {
- static_cast<ScFormulaCell*>(rOldCell)->SetMatrixFlag(MM_FORMULA);
- static_cast<ScFormulaCell*>(rOldCell)->SetMatColsRows(static_cast<SCCOL>(nMatrixCols), static_cast<SCROW>(nMatrixRows));
- }*/
- }
}
}
else
@@ -1646,7 +1628,7 @@ ScXMLMovementCutOffContext::ScXMLMovementCutOffContext( ScXMLImport& rImport,
sal_Int32 nPosition(0);
sal_Int32 nStartPosition(0);
sal_Int32 nEndPosition(0);
- sal_Bool bPosition(sal_False);
+ sal_Bool bPosition(false);
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
for( sal_Int16 i=0; i < nAttrCount; ++i )
{
@@ -1839,7 +1821,7 @@ SvXMLImportContext *ScXMLDeletionContext::CreateChildContext( sal_uInt16 nPrefix
pContext = new ScXMLCutOffsContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
else
{
- DBG_ERROR("don't know this");
+ OSL_FAIL("don't know this");
}
}
@@ -2023,3 +2005,4 @@ void ScXMLRejectionContext::EndElement()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.hxx b/sc/source/filter/xml/XMLTrackedChangesContext.hxx
index 299c835f49a9..853f7a1484c6 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.hxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/cachedattraccess.cxx b/sc/source/filter/xml/cachedattraccess.cxx
new file mode 100644
index 000000000000..31a0f215dad2
--- /dev/null
+++ b/sc/source/filter/xml/cachedattraccess.cxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Kohei Yoshida <kyoshida@novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+#include "cachedattraccess.hxx"
+#include "document.hxx"
+
+ScXMLCachedRowAttrAccess::Cache::Cache() :
+ mnTab(-1), mnRow1(-1), mnRow2(-1), mbValue(false) {}
+
+bool ScXMLCachedRowAttrAccess::Cache::hasCache(sal_Int32 nTab, sal_Int32 nRow) const
+{
+ return mnTab == nTab && mnRow1 <= nRow && nRow <= mnRow2;
+}
+
+ScXMLCachedRowAttrAccess::ScXMLCachedRowAttrAccess(ScDocument* pDoc) :
+ mpDoc(pDoc) {}
+
+bool ScXMLCachedRowAttrAccess::rowHidden(sal_Int32 nTab, sal_Int32 nRow)
+{
+ if (!maHidden.hasCache(nTab, nRow))
+ {
+ SCROW nRow1, nRow2;
+ maHidden.mbValue = mpDoc->RowHidden(
+ static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab), &nRow1, &nRow2);
+ maHidden.mnRow1 = static_cast<sal_Int32>(nRow1);
+ maHidden.mnRow2 = static_cast<sal_Int32>(nRow2);
+ }
+ return maHidden.mbValue;
+}
+
+bool ScXMLCachedRowAttrAccess::rowFiltered(sal_Int32 nTab, sal_Int32 nRow)
+{
+ if (!maFiltered.hasCache(nTab, nRow))
+ {
+ SCROW nRow1, nRow2;
+ maFiltered.mbValue = mpDoc->RowFiltered(
+ static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab), &nRow1, &nRow2);
+ maFiltered.mnRow1 = static_cast<sal_Int32>(nRow1);
+ maFiltered.mnRow2 = static_cast<sal_Int32>(nRow2);
+ }
+ return maFiltered.mbValue;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/cachedattraccess.hxx b/sc/source/filter/xml/cachedattraccess.hxx
new file mode 100644
index 000000000000..2c31d36ed596
--- /dev/null
+++ b/sc/source/filter/xml/cachedattraccess.hxx
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Kohei Yoshida <kyoshida@novell.com> ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SC_FILTER_XML_CACHEDATTRACCESS_HXX__
+#define __SC_FILTER_XML_CACHEDATTRACCESS_HXX__
+
+#include "sal/types.h"
+
+class ScDocument;
+
+/**
+ * Wrapper for accessing hidden and filtered row attributes. It caches last
+ * accessed values for a current range, to avoid fetching values for every
+ * single row.
+ */
+class ScXMLCachedRowAttrAccess
+{
+ struct Cache
+ {
+ sal_Int32 mnTab;
+ sal_Int32 mnRow1;
+ sal_Int32 mnRow2;
+ bool mbValue;
+ Cache();
+ bool hasCache(sal_Int32 nTab, sal_Int32 nRow) const;
+ };
+
+public:
+ ScXMLCachedRowAttrAccess(ScDocument* pDoc);
+
+ bool rowHidden(sal_Int32 nTab, sal_Int32 nRow);
+ bool rowFiltered(sal_Int32 nTab, sal_Int32 nRow);
+private:
+ Cache maHidden;
+ Cache maFiltered;
+ ScDocument* mpDoc;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/makefile.mk b/sc/source/filter/xml/makefile.mk
index 7f9f2d529a90..777d68c086bf 100644
--- a/sc/source/filter/xml/makefile.mk
+++ b/sc/source/filter/xml/makefile.mk
@@ -40,15 +40,14 @@ PROJECTPCHSOURCE=..\pch\filt_pch
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
$(SLO)$/sheetdata.obj \
+ $(SLO)$/cachedattraccess.obj \
$(SLO)$/xmlwrap.obj \
$(SLO)$/xmlimprt.obj \
$(SLO)$/xmlexprt.obj \
diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx
index 947c1370fa4b..226d145508b5 100644
--- a/sc/source/filter/xml/sheetdata.cxx
+++ b/sc/source/filter/xml/sheetdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -186,7 +187,7 @@ void ScSheetSaveData::UseSaveEntries()
void ScSheetSaveData::StoreInitialNamespaces( const SvXMLNamespaceMap& rNamespaces )
{
// the initial namespaces are just removed from the list of loaded namespaces,
- // so only a hash_set of the prefixes is needed.
+ // so only a boost::unordered_map of the prefixes is needed.
const NameSpaceHash& rNameHash = rNamespaces.GetAllEntries();
NameSpaceHash::const_iterator aIter = rNameHash.begin(), aEnd = rNameHash.end();
@@ -208,7 +209,7 @@ void ScSheetSaveData::StoreLoadedNamespaces( const SvXMLNamespaceMap& rNamespace
// ignore the initial namespaces
if ( maInitialPrefixes.find( aIter->first ) == maInitialPrefixes.end() )
{
- const NameSpaceEntry& rEntry = aIter->second.getBody();
+ const NameSpaceEntry& rEntry = *(aIter->second);
maLoadedNamespaces.push_back( ScLoadedNamespaceEntry( rEntry.sPrefix, rEntry.sName, rEntry.nKey ) );
}
++aIter;
@@ -281,3 +282,4 @@ void ScSheetSaveData::SetInSupportedSave( bool bSet )
mbInSupportedSave = bSet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx
index a6c76b830517..f38f442ef8bb 100644
--- a/sc/source/filter/xml/xmlannoi.cxx
+++ b/sc/source/filter/xml/xmlannoi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,7 +67,7 @@ ScXMLAnnotationContext::ScXMLAnnotationContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
mrAnnotationData( rAnnotationData ),
nParagraphCount(0),
- bHasTextP(sal_False),
+ bHasTextP(false),
pCellContext(pTempCellContext),
pShapeContext(NULL)
{
@@ -158,18 +159,6 @@ SvXMLImportContext *ScXMLAnnotationContext::CreateChildContext( sal_uInt16 nPref
pContext = new ScXMLContentContext(GetScImport(), nPrefix,
rLName, xAttrList, maCreateDateStringBuffer);
}
-/* else if ((nPrefix == XML_NAMESPACE_TEXT) && IsXMLToken(rLName, XML_P) )
- {
- if (!bHasTextP)
- {
- bHasTextP = sal_True;
- maTextBuffer.setLength(0);
- }
- if(nParagraphCount)
- maTextBuffer.append(static_cast<sal_Unicode>('\n'));
- ++nParagraphCount;
- pContext = new ScXMLContentContext( GetScImport(), nPrefix, rLName, xAttrList, maTextBuffer);
- }*/
if( !pContext && pShapeContext )
pContext = pShapeContext->CreateChildContext(nPrefix, rLName, xAttrList);
@@ -192,6 +181,7 @@ void ScXMLAnnotationContext::EndElement()
{
pShapeContext->EndElement();
delete pShapeContext;
+ pShapeContext = NULL;
}
mrAnnotationData.maAuthor = maAuthorBuffer.makeStringAndClear();
@@ -218,3 +208,4 @@ void ScXMLAnnotationContext::AddContentStyle( sal_uInt16 nFamily, const rtl::OUS
mrAnnotationData.maContentStyles.push_back( ScXMLAnnotationStyleEntry( nFamily, rName, rSelection ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlannoi.hxx b/sc/source/filter/xml/xmlannoi.hxx
index 2c39118dca1f..d343a715955c 100644
--- a/sc/source/filter/xml/xmlannoi.hxx
+++ b/sc/source/filter/xml/xmlannoi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120,3 +121,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx
index f80540bafa55..a24b232fb1f9 100644
--- a/sc/source/filter/xml/xmlbodyi.cxx
+++ b/sc/source/filter/xml/xmlbodyi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,8 +78,10 @@ ScXMLBodyContext::ScXMLBodyContext( ScXMLImport& rImport,
const uno::Reference<xml::sax::XAttributeList>& xAttrList ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
sPassword(),
- bProtected(sal_False),
- bHadCalculationSettings(sal_False),
+ meHash1(PASSHASH_SHA1),
+ meHash2(PASSHASH_UNSPECIFIED),
+ bProtected(false),
+ bHadCalculationSettings(false),
pChangeTrackingImportHelper(NULL)
{
ScDocument* pDoc = GetScImport().GetDocument();
@@ -122,6 +125,10 @@ ScXMLBodyContext::ScXMLBodyContext( ScXMLImport& rImport,
bProtected = IsXMLToken(sValue, XML_TRUE);
else if (IsXMLToken(aLocalName, XML_PROTECTION_KEY))
sPassword = sValue;
+ else if (IsXMLToken(aLocalName, XML_PROTECTION_KEY_DIGEST_ALGORITHM))
+ meHash1 = ScPassHashHelper::getHashTypeFromURI(sValue);
+ else if (IsXMLToken(aLocalName, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2))
+ meHash2 = ScPassHashHelper::getHashTypeFromURI(sValue);
}
}
}
@@ -261,7 +268,9 @@ void ScXMLBodyContext::EndElement()
SvXMLImportContext *pContext = new ScXMLCalculationSettingsContext( GetScImport(), XML_NAMESPACE_TABLE, GetXMLToken(XML_CALCULATION_SETTINGS), NULL );
pContext->EndElement();
}
- GetScImport().LockSolarMutex();
+
+ ScXMLImport::MutexGuard aGuard(GetScImport());
+
ScMyImpDetectiveOpArray* pDetOpArray = GetScImport().GetDetectiveOpArray();
ScDocument* pDoc = GetScImport().GetDocument();
ScMyImpDetectiveOp aDetOp;
@@ -281,42 +290,6 @@ void ScXMLBodyContext::EndElement()
if (pChangeTrackingImportHelper)
pChangeTrackingImportHelper->CreateChangeTrack(GetScImport().GetDocument());
-#if 0
- // #i57869# table styles are applied before the contents now
-
- std::vector<rtl::OUString> aTableStyleNames(GetScImport().GetTableStyle());
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( GetScImport().GetModel(), uno::UNO_QUERY );
- if ( xSpreadDoc.is() && !aTableStyleNames.empty())
- {
- uno::Reference <container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
- if ( xIndex.is() )
- {
- sal_Int32 nTableCount = xIndex->getCount();
- sal_Int32 nSize(aTableStyleNames.size());
- DBG_ASSERT(nTableCount == nSize, "every table should have a style name");
- for(sal_uInt32 i = 0; i < nTableCount; i++)
- {
- if (i < nSize)
- {
- uno::Reference <beans::XPropertySet> xProperties(xIndex->getByIndex(i), uno::UNO_QUERY);
- if (xProperties.is())
- {
- rtl::OUString sTableStyleName(aTableStyleNames[i]);
- XMLTableStylesContext *pStyles = (XMLTableStylesContext *)GetScImport().GetAutoStyles();
- if ( pStyles && sTableStyleName.getLength() )
- {
- XMLTableStyleContext* pStyle = (XMLTableStyleContext *)pStyles->FindStyleChildContext(
- XML_STYLE_FAMILY_TABLE_TABLE, sTableStyleName, sal_True);
- if (pStyle)
- pStyle->FillPropertySet(xProperties);
- }
- }
- }
- }
- }
- }
-#endif
-
// #i37959# handle document protection after the sheet settings
if (bProtected)
{
@@ -327,12 +300,12 @@ void ScXMLBodyContext::EndElement()
if (sPassword.getLength())
{
SvXMLUnitConverter::decodeBase64(aPass, sPassword);
- pProtection->setPasswordHash(aPass, PASSHASH_OOO);
+ pProtection->setPasswordHash(aPass, meHash1, meHash2);
}
pDoc->SetDocProtection(pProtection.get());
}
}
- GetScImport().UnlockSolarMutex();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlbodyi.hxx b/sc/source/filter/xml/xmlbodyi.hxx
index 3a5c401c254f..61db1ae58924 100644
--- a/sc/source/filter/xml/xmlbodyi.hxx
+++ b/sc/source/filter/xml/xmlbodyi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,16 @@
#include <xmloff/xmlictxt.hxx>
#include <xmloff/xmlimp.hxx>
+#include "tabprotection.hxx"
+
class ScXMLImport;
class ScXMLChangeTrackingImportHelper;
class ScXMLBodyContext : public SvXMLImportContext
{
rtl::OUString sPassword;
+ ScPasswordHash meHash1;
+ ScPasswordHash meHash2;
sal_Bool bProtected;
sal_Bool bHadCalculationSettings;
@@ -59,3 +64,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 6028d70bb56a..06214774a91e 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,6 +97,8 @@
using namespace com::sun::star;
using namespace xmloff::token;
+using rtl::OUString;
+
//------------------------------------------------------------------
ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
@@ -117,17 +120,17 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
rXMLImport((ScXMLImport&)rImport),
eGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT),
nCellType(util::NumberFormat::TEXT),
- bIsMerged(sal_False),
- bIsMatrix(sal_False),
- bHasSubTable(sal_False),
+ bIsMerged(false),
+ bIsMatrix(false),
+ bHasSubTable(false),
bIsCovered(bTempIsCovered),
bIsEmpty(sal_True),
- bHasTextImport(sal_False),
- bIsFirstTextImport(sal_False),
- bSolarMutexLocked(sal_False),
- bFormulaTextResult(sal_False)
+ bHasTextImport(false),
+ bIsFirstTextImport(false),
+ bSolarMutexLocked(false),
+ bFormulaTextResult(false)
{
- rXMLImport.SetRemoveLastChar(sal_False);
+ rXMLImport.SetRemoveLastChar(false);
rXMLImport.GetTables().AddColumn(bTempIsCovered);
const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
rtl::OUString aLocalName;
@@ -171,14 +174,14 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
break;
case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE:
nCellType = GetScImport().GetCellType(sValue);
- bIsEmpty = sal_False;
+ bIsEmpty = false;
break;
case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE:
{
if (sValue.getLength())
{
rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue);
- bIsEmpty = sal_False;
+ bIsEmpty = false;
}
}
break;
@@ -187,7 +190,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
if (sValue.getLength() && rXMLImport.SetNullDateOnUnitConverter())
{
rXMLImport.GetMM100UnitConverter().convertDateTime(fValue, sValue);
- bIsEmpty = sal_False;
+ bIsEmpty = false;
}
}
break;
@@ -196,7 +199,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
if (sValue.getLength())
{
rXMLImport.GetMM100UnitConverter().convertTime(fValue, sValue);
- bIsEmpty = sal_False;
+ bIsEmpty = false;
}
}
break;
@@ -206,7 +209,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
{
DBG_ASSERT(!pOUTextValue, "here should be only one string value");
pOUTextValue.reset(sValue);
- bIsEmpty = sal_False;
+ bIsEmpty = false;
}
}
break;
@@ -220,7 +223,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
fValue = 0.0;
else
rXMLImport.GetMM100UnitConverter().convertDouble(fValue, sValue);
- bIsEmpty = sal_False;
+ bIsEmpty = false;
}
}
break;
@@ -275,7 +278,7 @@ void ScXMLTableRowCellContext::UnlockSolarMutex()
if (bSolarMutexLocked)
{
GetScImport().UnlockSolarMutex();
- bSolarMutexLocked = sal_False;
+ bSolarMutexLocked = false;
}
}
@@ -300,7 +303,7 @@ void ScXMLTableRowCellContext::SetCursorOnTextImport(const rtl::OUString& rOUTem
if (xTextCursor.is())
{
xTextCursor->setString(rOUTempText);
- xTextCursor->gotoEnd(sal_False);
+ xTextCursor->gotoEnd(false);
rXMLImport.GetTextImport()->SetCursor(xTextCursor);
}
}
@@ -321,12 +324,12 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
SvXMLImportContext *pContext = 0;
const SvXMLTokenMap& rTokenMap = rXMLImport.GetTableRowCellElemTokenMap();
- sal_Bool bTextP(sal_False);
+ sal_Bool bTextP(false);
switch( rTokenMap.Get( nPrefix, rLName ) )
{
case XML_TOK_TABLE_ROW_CELL_P:
{
- bIsEmpty = sal_False;
+ bIsEmpty = false;
bTextP = sal_True;
com::sun::star::table::CellAddress aCellPos = rXMLImport.GetTables().GetRealCellPos();
if (((nCellType == util::NumberFormat::TEXT) || bFormulaTextResult) &&
@@ -359,12 +362,12 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
uno::Reference < text::XText > xText (xTextCursor->getText());
uno::Reference < text::XTextRange > xTextRange (xTextCursor, uno::UNO_QUERY);
if (xText.is() && xTextRange.is())
- xText->insertControlCharacter(xTextRange, text::ControlCharacter::PARAGRAPH_BREAK, sal_False);
+ xText->insertControlCharacter(xTextRange, text::ControlCharacter::PARAGRAPH_BREAK, false);
}
}
pContext = rXMLImport.GetTextImport()->CreateTextChildContext(
rXMLImport, nPrefix, rLName, xAttrList);
- bIsFirstTextImport = sal_False;
+ bIsFirstTextImport = false;
}
}
}
@@ -389,12 +392,12 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
rLName, xAttrList,
sal_True, nMergedCols);
nMergedCols = 1;
- bIsMerged = sal_False;
+ bIsMerged = false;
}
break;
case XML_TOK_TABLE_ROW_CELL_ANNOTATION:
{
- bIsEmpty = sal_False;
+ bIsEmpty = false;
DBG_ASSERT( !mxAnnotationData.get(), "ScXMLTableRowCellContext::CreateChildContext - multiple annotations in one cell" );
mxAnnotationData.reset( new ScXMLAnnotationData );
pContext = new ScXMLAnnotationContext( rXMLImport, nPrefix, rLName,
@@ -403,7 +406,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
break;
case XML_TOK_TABLE_ROW_CELL_DETECTIVE:
{
- bIsEmpty = sal_False;
+ bIsEmpty = false;
if (!pDetectiveObjVec)
pDetectiveObjVec = new ScMyImpDetectiveObjVec();
pContext = new ScXMLDetectiveContext(
@@ -412,7 +415,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
break;
case XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE:
{
- bIsEmpty = sal_False;
+ bIsEmpty = false;
if (!pCellRangeSource)
pCellRangeSource = new ScMyImpCellRangeSource();
pContext = new ScXMLCellRangeSourceContext(
@@ -432,14 +435,14 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
if (aCellPos.Row > MAXROW)
aCellPos.Row = MAXROW;
XMLTableShapeImportHelper* pTableShapeImport = (XMLTableShapeImportHelper*)rXMLImport.GetShapeImport().get();
- pTableShapeImport->SetOnTable(sal_False);
+ pTableShapeImport->SetOnTable(false);
pTableShapeImport->SetCell(aCellPos);
pContext = rXMLImport.GetShapeImport()->CreateGroupChildContext(
rXMLImport, nPrefix, rLName, xAttrList, xShapes);
if (pContext)
{
- bIsEmpty = sal_False;
- rXMLImport.ProgressBarIncrement(sal_False);
+ bIsEmpty = false;
+ rXMLImport.ProgressBarIncrement(false);
}
}
}
@@ -470,13 +473,13 @@ sal_Bool ScXMLTableRowCellContext::IsMerged (const uno::Reference <table::XCellR
aCellAddress = xMergeCellAddress->getRangeAddress();
if (aCellAddress.StartColumn == nCol && aCellAddress.EndColumn == nCol &&
aCellAddress.StartRow == nRow && aCellAddress.EndRow == nRow)
- return sal_False;
+ return false;
else
return sal_True;
}
}
}
- return sal_False;
+ return false;
}
void ScXMLTableRowCellContext::DoMerge(const com::sun::star::table::CellAddress& aCellPos,
@@ -499,7 +502,7 @@ void ScXMLTableRowCellContext::DoMerge(const com::sun::star::table::CellAddress&
uno::Reference <util::XMergeable> xMergeable (xCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
aCellAddress.EndColumn, aCellAddress.EndRow), uno::UNO_QUERY);
if (xMergeable.is())
- xMergeable->merge(sal_False);
+ xMergeable->merge(false);
}
//merge
@@ -547,7 +550,7 @@ void ScXMLTableRowCellContext::SetContentValidation(com::sun::star::uno::Referen
xCondition->setFormula1(aValidation.sFormula1);
xCondition->setFormula2(aValidation.sFormula2);
xCondition->setOperator(aValidation.aOperator);
- // #b4974740# source position must be set as string, because it may
+ // source position must be set as string, because it may
// refer to a sheet that hasn't been loaded yet.
xPropertySet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_SOURCESTR)), uno::makeAny(aValidation.sBaseCellAddress));
// Transport grammar and formula namespace
@@ -828,14 +831,14 @@ void ScXMLTableRowCellContext::EndElement()
table::CellAddress aCurrentPos( aCellPos );
if ((pContentValidationName && pContentValidationName->getLength()) ||
mxAnnotationData.get() || pDetectiveObjVec || pCellRangeSource)
- bIsEmpty = sal_False;
+ bIsEmpty = false;
ScMyTables& rTables = rXMLImport.GetTables();
for (sal_Int32 i = 0; i < nCellsRepeated; ++i)
{
aCurrentPos.Column = aCellPos.Column + i;
if (i > 0)
- rTables.AddColumn(sal_False);
+ rTables.AddColumn(false);
if (!bIsEmpty)
{
for (sal_Int32 j = 0; j < nRepeatedRows; ++j)
@@ -844,7 +847,7 @@ void ScXMLTableRowCellContext::EndElement()
if ((aCurrentPos.Column == 0) && (j > 0))
{
rTables.AddRow();
- rTables.AddColumn(sal_False);
+ rTables.AddColumn(false);
}
if (CellExists(aCurrentPos))
{
@@ -906,7 +909,7 @@ void ScXMLTableRowCellContext::EndElement()
else if ( i > 0 && pOUText && pOUText->getLength() )
pFCell->SetHybridString( *pOUText );
else
- bDoIncrement = sal_False;
+ bDoIncrement = false;
}
}
else
@@ -949,7 +952,7 @@ void ScXMLTableRowCellContext::EndElement()
// Formatted text that is put into the cell by the child context
// is handled below (bIsEmpty is sal_True then).
if (bDoIncrement || bHasTextImport)
- rXMLImport.ProgressBarIncrement(sal_False);
+ rXMLImport.ProgressBarIncrement(false);
}
break;
case util::NumberFormat::NUMBER:
@@ -992,12 +995,12 @@ void ScXMLTableRowCellContext::EndElement()
sal::static_int_cast<SCTAB>( aCurrentPos.Sheet ),
pNewCell );
}
- rXMLImport.ProgressBarIncrement(sal_False);
+ rXMLImport.ProgressBarIncrement(false);
}
break;
default:
{
- DBG_ERROR("no cell type given");
+ OSL_FAIL("no cell type given");
}
break;
}
@@ -1030,7 +1033,7 @@ void ScXMLTableRowCellContext::EndElement()
for (sal_Int32 j = 1; j < nRepeatedRows; ++j)
{
rTables.AddRow();
- rTables.AddColumn(sal_False);
+ rTables.AddColumn(false);
}
}
}
@@ -1104,7 +1107,7 @@ void ScXMLTableRowCellContext::EndElement()
SetAnnotation( aCellPos );
SetDetectiveObj( aCellPos );
SetCellRangeSource( aCellPos );
- rXMLImport.ProgressBarIncrement(sal_False);
+ rXMLImport.ProgressBarIncrement(false);
}
}
else
@@ -1119,9 +1122,11 @@ void ScXMLTableRowCellContext::EndElement()
}
UnlockSolarMutex();
}
- bIsMerged = sal_False;
- bHasSubTable = sal_False;
+ bIsMerged = false;
+ bHasSubTable = false;
nMergedCols = 1;
nMergedRows = 1;
nCellsRepeated = 1;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx
index a6091f87e485..53387ebc5c14 100644
--- a/sc/source/filter/xml/xmlcelli.hxx
+++ b/sc/source/filter/xml/xmlcelli.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,3 +129,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index bdeaf39a3eb9..9029d5a63a0d 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
-
#include "xmlcoli.hxx"
#include "xmlimprt.hxx"
#include "global.hxx"
@@ -113,26 +111,6 @@ SvXMLImportContext *ScXMLTableColContext::CreateChildContext( sal_uInt16 nPrefix
::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
{
SvXMLImportContext *pContext = 0;
-/*
- const SvXMLTokenMap& rTokenMap = GetScImport().GetTableRowElemTokenMap();
- sal_Bool bHeader = sal_False;
- switch( rTokenMap.Get( nPrefix, rLName ) )
- {
- case XML_TOK_TABLE_ROW_CELL:
-// if( IsInsertCellPossible() )
- pContext = new ScXMLTableRowCellContext( GetScImport(), nPrefix,
- rLName, xAttrList//,
- //this
- );
- break;
- case XML_TOK_TABLE_ROW_COVERED_CELL:
-// if( IsInsertCellPossible() )
- pContext = new ScXMLTableRowCellContext( GetScImport(), nPrefix,
- rLName, xAttrList//,
- //this
- );
- break;
- }*/
if( !pContext )
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
@@ -182,7 +160,7 @@ void ScXMLTableColContext::EndElement()
rtl::OUString sVisible(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CELLVIS));
sal_Bool bValue(sal_True);
if (!IsXMLToken(sVisibility, XML_VISIBLE))
- bValue = sal_False;
+ bValue = false;
xColumnProperties->setPropertyValue(sVisible, uno::makeAny(bValue));
}
}
@@ -230,7 +208,7 @@ ScXMLTableColsContext::ScXMLTableColsContext( ScXMLImport& rImport,
if (nPrefix == XML_NAMESPACE_TABLE && IsXMLToken(aLocalName, XML_DISPLAY))
{
if (IsXMLToken(sValue, XML_FALSE))
- bGroupDisplay = sal_False;
+ bGroupDisplay = false;
}
}
}
@@ -253,17 +231,17 @@ SvXMLImportContext *ScXMLTableColsContext::CreateChildContext( sal_uInt16 nPrefi
case XML_TOK_TABLE_COLS_COL_GROUP:
pContext = new ScXMLTableColsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_True );
+ false, sal_True );
break;
case XML_TOK_TABLE_COLS_HEADER_COLS:
pContext = new ScXMLTableColsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_True, sal_False );
+ sal_True, false );
break;
case XML_TOK_TABLE_COLS_COLS:
pContext = new ScXMLTableColsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_False );
+ false, false );
break;
case XML_TOK_TABLE_COLS_COL:
pContext = new ScXMLTableColContext( GetScImport(), nPrefix,
@@ -318,7 +296,7 @@ void ScXMLTableColsContext::EndElement()
ScDocument* pDoc = GetScImport().GetDocument();
if (pDoc)
{
- rXMLImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(GetScImport());
ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(static_cast<SCTAB>(nSheet), sal_True);
ScOutlineArray* pColArray = pOutlineTable ? pOutlineTable->GetColArray() : NULL;
if (pColArray)
@@ -326,8 +304,9 @@ void ScXMLTableColsContext::EndElement()
sal_Bool bResized;
pColArray->Insert(static_cast<SCCOL>(nGroupStartCol), static_cast<SCCOL>(nGroupEndCol), bResized, !bGroupDisplay, sal_True);
}
- rXMLImport.UnlockSolarMutex();
}
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlcoli.hxx b/sc/source/filter/xml/xmlcoli.hxx
index 7778192a337a..6c958bc673bd 100644
--- a/sc/source/filter/xml/xmlcoli.hxx
+++ b/sc/source/filter/xml/xmlcoli.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,3 +92,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlconti.cxx b/sc/source/filter/xml/xmlconti.cxx
index 4c32f1859a8a..2b752f7aec83 100644
--- a/sc/source/filter/xml/xmlconti.cxx
+++ b/sc/source/filter/xml/xmlconti.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,3 +106,5 @@ void ScXMLContentContext::EndElement()
{
sValue.append(sOUText);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlconti.hxx b/sc/source/filter/xml/xmlconti.hxx
index c7d8521d71af..d350f0f2f89e 100644
--- a/sc/source/filter/xml/xmlconti.hxx
+++ b/sc/source/filter/xml/xmlconti.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlcvali.cxx b/sc/source/filter/xml/xmlcvali.cxx
index 0fd9887ea57e..25d16d999fb0 100644
--- a/sc/source/filter/xml/xmlcvali.cxx
+++ b/sc/source/filter/xml/xmlcvali.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -234,8 +235,8 @@ ScXMLContentValidationContext::ScXMLContentValidationContext( ScXMLImport& rImpo
SvXMLImportContext( rImport, nPrfx, rLName ),
nShowList(sheet::TableValidationVisibility::UNSORTED),
bAllowEmptyCell(sal_True),
- bDisplayHelp(sal_False),
- bDisplayError(sal_False)
+ bDisplayHelp(false),
+ bDisplayError(false)
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetContentValidationAttrTokenMap();
@@ -260,7 +261,7 @@ ScXMLContentValidationContext::ScXMLContentValidationContext( ScXMLImport& rImpo
break;
case XML_TOK_CONTENT_VALIDATION_ALLOW_EMPTY_CELL:
if (IsXMLToken(sValue, XML_FALSE))
- bAllowEmptyCell = sal_False;
+ bAllowEmptyCell = false;
break;
case XML_TOK_CONTENT_VALIDATION_DISPLAY_LIST:
{
@@ -353,7 +354,7 @@ void ScXMLContentValidationContext::SetFormula( OUString& rFormula, OUString& rF
void ScXMLContentValidationContext::GetCondition( ScMyImportValidation& rValidation ) const
{
- rValidation.aValidationType = sheet::ValidationType_ANY; // #b6343997# default if no condition is given
+ rValidation.aValidationType = sheet::ValidationType_ANY; // default if no condition is given
rValidation.aOperator = sheet::ConditionOperator_NONE;
if( sCondition.getLength() > 0 )
@@ -502,7 +503,7 @@ ScXMLHelpMessageContext::ScXMLHelpMessageContext( ScXMLImport& rImport,
sTitle(),
sMessage(),
nParagraphCount(0),
- bDisplay(sal_False)
+ bDisplay(false)
{
pValidationContext = pTempValidationContext;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -573,7 +574,7 @@ ScXMLErrorMessageContext::ScXMLErrorMessageContext( ScXMLImport& rImport,
sMessage(),
sMessageType(),
nParagraphCount(0),
- bDisplay(sal_False)
+ bDisplay(false)
{
pValidationContext = pTempValidationContext;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -644,7 +645,7 @@ ScXMLErrorMacroContext::ScXMLErrorMacroContext( ScXMLImport& rImport,
ScXMLContentValidationContext* pTempValidationContext) :
SvXMLImportContext( rImport, nPrfx, rLName ),
sName(),
- bExecute(sal_False)
+ bExecute(false)
{
pValidationContext = pTempValidationContext;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -694,3 +695,5 @@ void ScXMLErrorMacroContext::EndElement()
{
pValidationContext->SetErrorMacro( bExecute );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlcvali.hxx b/sc/source/filter/xml/xmlcvali.hxx
index b8d75cf5c7c3..b2c433c4696e 100644
--- a/sc/source/filter/xml/xmlcvali.hxx
+++ b/sc/source/filter/xml/xmlcvali.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 09d8a25fa86d..210a6f5dc7ee 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,14 +60,14 @@
#include <com/sun/star/sheet/DataPilotFieldLayoutMode.hpp>
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
-//#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
-
using namespace com::sun::star;
using namespace xmloff::token;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::xml::sax::XAttributeList;
using ::rtl::OUString;
+using rtl::OUString;
+
//------------------------------------------------------------------
ScXMLDataPilotTablesContext::ScXMLDataPilotTablesContext( ScXMLImport& rImport,
@@ -134,12 +135,13 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
mnPageFieldCount(0),
mnDataFieldCount(0),
bIsNative(sal_True),
- bIgnoreEmptyRows(sal_False),
- bIdentifyCategories(sal_False),
- bTargetRangeAddress(sal_False),
- bSourceCellRange(sal_False),
+ bIgnoreEmptyRows(false),
+ bIdentifyCategories(false),
+ bTargetRangeAddress(false),
+ bSourceCellRange(false),
bShowFilter(sal_True),
- bDrillDown(sal_True)
+ bDrillDown(sal_True),
+ bHeaderGridLayout(false)
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotTableAttrTokenMap();
@@ -219,6 +221,11 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
bDrillDown = IsXMLToken(sValue, XML_TRUE);
}
break;
+ case XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT :
+ {
+ bHeaderGridLayout = IsXMLToken(sValue, XML_TRUE);
+ }
+ break;
}
}
@@ -333,7 +340,7 @@ void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim, bool bHas
{
if (pDPSave)
{
- // #91045# if a dimension with that name has already been inserted,
+ // if a dimension with that name has already been inserted,
// mark the new one as duplicate
if ( !pDim->IsDataLayout() &&
pDPSave->GetExistingDimensionByName(pDim->GetName()) )
@@ -391,89 +398,94 @@ void ScXMLDataPilotTableContext::AddGroupDim(const ScDPSaveGroupDimension& aGrou
void ScXMLDataPilotTableContext::EndElement()
{
- if (bTargetRangeAddress)
+ if (!bTargetRangeAddress)
+ return;
+
+ pDPObject->SetName(sDataPilotTableName);
+ pDPObject->SetTag(sApplicationData);
+ pDPObject->SetOutRange(aTargetRangeAddress);
+ pDPObject->SetHeaderLayout(bHeaderGridLayout);
+ switch (nSourceType)
{
- pDPObject->SetName(sDataPilotTableName);
- pDPObject->SetTag(sApplicationData);
- pDPObject->SetOutRange(aTargetRangeAddress);
- switch (nSourceType)
+ case SQL :
{
- case SQL :
- {
- ScImportSourceDesc aImportDesc;
- aImportDesc.aDBName = sDatabaseName;
- aImportDesc.aObject = sSourceObject;
- aImportDesc.nType = sheet::DataImportMode_SQL;
- aImportDesc.bNative = bIsNative;
- pDPObject->SetImportDesc(aImportDesc);
- }
- break;
- case TABLE :
- {
- ScImportSourceDesc aImportDesc;
- aImportDesc.aDBName = sDatabaseName;
- aImportDesc.aObject = sSourceObject;
- aImportDesc.nType = sheet::DataImportMode_TABLE;
- pDPObject->SetImportDesc(aImportDesc);
- }
- break;
- case QUERY :
- {
- ScImportSourceDesc aImportDesc;
- aImportDesc.aDBName = sDatabaseName;
- aImportDesc.aObject = sSourceObject;
- aImportDesc.nType = sheet::DataImportMode_QUERY;
- pDPObject->SetImportDesc(aImportDesc);
- }
- break;
- case SERVICE :
- {
- ScDPServiceDesc aServiceDesk(sServiceName, sServiceSourceName, sServiceSourceObject,
- sServiceUsername, sServicePassword);
- pDPObject->SetServiceData(aServiceDesk);
- }
- break;
- case CELLRANGE :
+ ScImportSourceDesc aImportDesc(pDoc);
+ aImportDesc.aDBName = sDatabaseName;
+ aImportDesc.aObject = sSourceObject;
+ aImportDesc.nType = sheet::DataImportMode_SQL;
+ aImportDesc.bNative = bIsNative;
+ pDPObject->SetImportDesc(aImportDesc);
+ }
+ break;
+ case TABLE :
+ {
+ ScImportSourceDesc aImportDesc(pDoc);
+ aImportDesc.aDBName = sDatabaseName;
+ aImportDesc.aObject = sSourceObject;
+ aImportDesc.nType = sheet::DataImportMode_TABLE;
+ pDPObject->SetImportDesc(aImportDesc);
+ }
+ break;
+ case QUERY :
+ {
+ ScImportSourceDesc aImportDesc(pDoc);
+ aImportDesc.aDBName = sDatabaseName;
+ aImportDesc.aObject = sSourceObject;
+ aImportDesc.nType = sheet::DataImportMode_QUERY;
+ pDPObject->SetImportDesc(aImportDesc);
+ }
+ break;
+ case SERVICE :
+ {
+ ScDPServiceDesc aServiceDesk(sServiceName, sServiceSourceName, sServiceSourceObject,
+ sServiceUsername, sServicePassword);
+ pDPObject->SetServiceData(aServiceDesk);
+ }
+ break;
+ case CELLRANGE :
+ {
+ if (bSourceCellRange)
{
- if (bSourceCellRange)
- {
- ScSheetSourceDesc aSheetDesc;
- aSheetDesc.aSourceRange = aSourceCellRangeAddress;
- aSheetDesc.aQueryParam = aSourceQueryParam;
- pDPObject->SetSheetDesc(aSheetDesc);
- }
+ ScSheetSourceDesc aSheetDesc(pDoc);
+ if (sSourceRangeName.getLength())
+ // Range name takes precedence.
+ aSheetDesc.SetRangeName(sSourceRangeName);
+ else
+ aSheetDesc.SetSourceRange(aSourceCellRangeAddress);
+ aSheetDesc.SetQueryParam(aSourceQueryParam);
+ pDPObject->SetSheetDesc(aSheetDesc);
}
- break;
}
+ break;
+ }
- pDPSave->SetRowGrand(maRowGrandTotal.mbVisible);
- pDPSave->SetColumnGrand(maColGrandTotal.mbVisible);
- if (maRowGrandTotal.maDisplayName.getLength())
- // TODO: Right now, we only support one grand total name for both
- // column and row totals. Take the value from the row total for
- // now.
- pDPSave->SetGrandTotalName(maRowGrandTotal.maDisplayName);
-
- pDPSave->SetIgnoreEmptyRows(bIgnoreEmptyRows);
- pDPSave->SetRepeatIfEmpty(bIdentifyCategories);
- pDPSave->SetFilterButton(bShowFilter);
- pDPSave->SetDrillDown(bDrillDown);
- if (pDPDimSaveData)
- pDPSave->SetDimensionData(pDPDimSaveData);
- pDPObject->SetSaveData(*pDPSave);
- if (pDoc)
- {
- ScDPCollection* pDPCollection = pDoc->GetDPCollection();
+ pDPSave->SetRowGrand(maRowGrandTotal.mbVisible);
+ pDPSave->SetColumnGrand(maColGrandTotal.mbVisible);
+ if (maRowGrandTotal.maDisplayName.getLength())
+ // TODO: Right now, we only support one grand total name for both
+ // column and row totals. Take the value from the row total for
+ // now.
+ pDPSave->SetGrandTotalName(maRowGrandTotal.maDisplayName);
+
+ pDPSave->SetIgnoreEmptyRows(bIgnoreEmptyRows);
+ pDPSave->SetRepeatIfEmpty(bIdentifyCategories);
+ pDPSave->SetFilterButton(bShowFilter);
+ pDPSave->SetDrillDown(bDrillDown);
+ if (pDPDimSaveData)
+ pDPSave->SetDimensionData(pDPDimSaveData);
+ pDPObject->SetSaveData(*pDPSave);
+ if (pDoc)
+ {
+ ScDPCollection* pDPCollection = pDoc->GetDPCollection();
- // #i94570# Names have to be unique, or the tables can't be accessed by API.
- if ( pDPCollection->GetByName(pDPObject->GetName()) )
- pDPObject->SetName( String() ); // ignore the invalid name, create a new name in AfterXMLLoading
+ // #i94570# Names have to be unique, or the tables can't be accessed by API.
+ if ( pDPCollection->GetByName(pDPObject->GetName()) )
+ pDPObject->SetName( String() ); // ignore the invalid name, create a new name in AfterXMLLoading
- pDPObject->SetAlive(sal_True);
- pDPCollection->InsertNewTable(pDPObject);
- }
- SetButtons();
+ pDPObject->SetAlive(sal_True);
+ pDPCollection->InsertNewTable(pDPObject);
}
+ SetButtons();
}
void ScXMLDataPilotTableContext::SetGrandTotal(
@@ -848,6 +860,9 @@ ScXMLSourceCellRangeContext::ScXMLSourceCellRangeContext( ScXMLImport& rImport,
pDataPilotTable->SetSourceCellRangeAddress(aSourceRangeAddress);
}
break;
+ case XML_TOK_SOURCE_CELL_RANGE_ATTR_NAME:
+ pDataPilotTable->SetSourceRangeName(sValue);
+ break;
}
}
}
@@ -895,15 +910,15 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport,
fStep(0.0),
nUsedHierarchy(1),
nGroupPart(0),
- bSelectedPage(sal_False),
- bIsGroupField(sal_False),
- bDateValue(sal_False),
- bAutoStart(sal_False),
- bAutoEnd(sal_False),
+ bSelectedPage(false),
+ bIsGroupField(false),
+ bDateValue(false),
+ bAutoStart(false),
+ bAutoEnd(false),
mbHasHiddenMember(false)
{
- sal_Bool bHasName(sal_False);
- sal_Bool bDataLayout(sal_False);
+ sal_Bool bHasName(false);
+ sal_Bool bDataLayout(false);
OUString aDisplayName;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotFieldAttrTokenMap();
@@ -1029,8 +1044,7 @@ void ScXMLDataPilotFieldContext::EndElement()
pDim->SetOrientation(nOrientation);
if (bSelectedPage)
{
- String sPage(sSelectedPage);
- pDim->SetCurrentPage(&sPage);
+ pDim->SetCurrentPage(&sSelectedPage);
}
pDataPilotTable->AddDimension(pDim, mbHasHiddenMember);
if (bIsGroupField)
@@ -1241,7 +1255,7 @@ ScXMLDataPilotDisplayInfoContext::ScXMLDataPilotDisplayInfoContext( ScXMLImport&
if (IsXMLToken(sValue, XML_TRUE))
aInfo.IsEnabled = sal_True;
else
- aInfo.IsEnabled = sal_False;
+ aInfo.IsEnabled = false;
}
else if (IsXMLToken(aLocalName, XML_DISPLAY_MEMBER_MODE))
{
@@ -1292,7 +1306,7 @@ ScXMLDataPilotSortInfoContext::ScXMLDataPilotSortInfoContext( ScXMLImport& rImpo
if (IsXMLToken(sValue, XML_ASCENDING))
aInfo.IsAscending = sal_True;
else if (IsXMLToken(sValue, XML_DESCENDING))
- aInfo.IsAscending = sal_False;
+ aInfo.IsAscending = false;
}
else if (IsXMLToken(aLocalName, XML_SORT_MODE))
{
@@ -1341,7 +1355,7 @@ ScXMLDataPilotLayoutInfoContext::ScXMLDataPilotLayoutInfoContext( ScXMLImport& r
if (IsXMLToken(sValue, XML_TRUE))
aInfo.AddEmptyLines = sal_True;
else
- aInfo.AddEmptyLines = sal_False;
+ aInfo.AddEmptyLines = false;
}
else if (IsXMLToken(aLocalName, XML_LAYOUT_MODE))
{
@@ -1539,7 +1553,7 @@ ScXMLDataPilotMemberContext::ScXMLDataPilotMemberContext( ScXMLImport& rImport,
pDataPilotField(pTempDataPilotField),
bDisplay( sal_True ),
bDisplayDetails( sal_True ),
- bHasName( sal_False )
+ bHasName( false )
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotMemberAttrTokenMap();
@@ -1622,7 +1636,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport,
double fEnd(0.0);
double fStep(0.0);
sal_Int32 nGroupPart(0);
- sal_Bool bDateValue(sal_False);
+ sal_Bool bDateValue(false);
sal_Bool bAutoStart(sal_True);
sal_Bool bAutoEnd(sal_True);
@@ -1647,7 +1661,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport,
else
{
GetScImport().GetMM100UnitConverter().convertDateTime(fStart, sValue);
- bAutoStart = sal_False;
+ bAutoStart = false;
}
}
else if (IsXMLToken(aLocalName, XML_DATE_END))
@@ -1658,7 +1672,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport,
else
{
GetScImport().GetMM100UnitConverter().convertDateTime(fEnd, sValue);
- bAutoEnd = sal_False;
+ bAutoEnd = false;
}
}
else if (IsXMLToken(aLocalName, XML_START))
@@ -1668,7 +1682,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport,
else
{
GetScImport().GetMM100UnitConverter().convertDouble(fStart, sValue);
- bAutoStart = sal_False;
+ bAutoStart = false;
}
}
else if (IsXMLToken(aLocalName, XML_END))
@@ -1678,7 +1692,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport,
else
{
GetScImport().GetMM100UnitConverter().convertDouble(fEnd, sValue);
- bAutoEnd = sal_False;
+ bAutoEnd = false;
}
}
else if (IsXMLToken(aLocalName, XML_STEP))
@@ -1833,3 +1847,5 @@ void ScXMLDataPilotGroupMemberContext::EndElement()
if (sName.getLength())
pDataPilotGroup->AddMember(sName);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx
index 5ff84c587b54..3ea89be0b68c 100644
--- a/sc/source/filter/xml/xmldpimp.hxx
+++ b/sc/source/filter/xml/xmldpimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
#include "dpsave.hxx"
#include "queryparam.hxx"
-#include <hash_set>
+#include <boost/unordered_set.hpp>
class ScXMLImport;
class ScDPSaveNumGroupDimension;
@@ -79,7 +80,7 @@ public:
class ScXMLDataPilotTableContext : public SvXMLImportContext
{
- typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash > StringSet;
+ typedef ::boost::unordered_set< ::rtl::OUString, ::rtl::OUStringHash > StringSet;
StringSet maHiddenMemberFields;
struct GrandTotalItem
@@ -105,6 +106,7 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext
rtl::OUString sServiceUsername;
rtl::OUString sServicePassword;
rtl::OUString sButtons;
+ rtl::OUString sSourceRangeName;
ScRange aSourceCellRangeAddress;
ScRange aTargetRangeAddress;
ScRange aFilterSourceRange;
@@ -126,6 +128,7 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext
sal_Bool bSourceCellRange;
sal_Bool bShowFilter;
sal_Bool bDrillDown;
+ sal_Bool bHeaderGridLayout;
const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
@@ -155,6 +158,7 @@ public:
void SetServiceSourceObject(const rtl::OUString& sValue) { sServiceSourceObject = sValue; }
void SetServiceUsername(const rtl::OUString& sValue) { sServiceUsername = sValue; }
void SetServicePassword(const rtl::OUString& sValue) { sServicePassword = sValue; }
+ void SetSourceRangeName(const rtl::OUString& sValue) { sSourceRangeName = sValue; bSourceCellRange = true; }
void SetSourceCellRangeAddress(const ScRange& aValue) { aSourceCellRangeAddress = aValue; bSourceCellRange = sal_True; }
void SetSourceQueryParam(const ScQueryParam& aValue) { aSourceQueryParam = aValue; }
// void SetFilterUseRegularExpressions(const sal_Bool bValue) { aSourceQueryParam.bRegExp = bValue; }
@@ -691,3 +695,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index c91602d7e568..1a791879d0c6 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,26 +126,26 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport,
eOrientation(table::TableOrientation_ROWS),
nRefresh(0),
nSubTotalsUserListIndex(0),
- bContainsSort(sal_False),
- bContainsSubTotal(sal_False),
+ bContainsSort(false),
+ bContainsSubTotal(false),
bNative(sal_True),
- bIsSelection(sal_False),
- bKeepFormats(sal_False),
- bMoveCells(sal_False),
- bStripData(sal_False),
+ bIsSelection(false),
+ bKeepFormats(false),
+ bMoveCells(false),
+ bStripData(false),
bContainsHeader(sal_True),
- bAutoFilter(sal_False),
- bSubTotalsBindFormatsToContent(sal_False),
- bSubTotalsIsCaseSensitive(sal_False),
- bSubTotalsInsertPageBreaks(sal_False),
- bSubTotalsSortGroups(sal_False),
- bSubTotalsEnabledUserList(sal_False),
+ bAutoFilter(false),
+ bSubTotalsBindFormatsToContent(false),
+ bSubTotalsIsCaseSensitive(false),
+ bSubTotalsInsertPageBreaks(false),
+ bSubTotalsSortGroups(false),
+ bSubTotalsEnabledUserList(false),
bSubTotalsAscending(sal_True),
- bFilterCopyOutputData(sal_False),
- bFilterIsCaseSensitive(sal_False),
- bFilterSkipDuplicates(sal_False),
- bFilterUseRegularExpressions(sal_False),
- bFilterConditionSourceRange(sal_False)
+ bFilterCopyOutputData(false),
+ bFilterIsCaseSensitive(false),
+ bFilterSkipDuplicates(false),
+ bFilterUseRegularExpressions(false),
+ bFilterConditionSourceRange(false)
{
nSourceType = sheet::DataImportMode_NONE;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -298,7 +299,7 @@ void ScXMLDatabaseRangeContext::EndElement()
}
catch ( uno::RuntimeException& rRuntimeException )
{
- bInsert = sal_False;
+ bInsert = false;
rtl::OUString sErrorMessage(RTL_CONSTASCII_USTRINGPARAM("DatabaseRange "));
sErrorMessage += sDatabaseRangeName;
sErrorMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" could not be created with the range "));
@@ -837,7 +838,7 @@ ScXMLSortGroupsContext::ScXMLSortGroupsContext( ScXMLImport& rImport,
if (IsXMLToken(sValue, XML_ASCENDING))
pDatabaseRangeContext->SetSubTotalsAscending(sal_True);
else
- pDatabaseRangeContext->SetSubTotalsAscending(sal_False);
+ pDatabaseRangeContext->SetSubTotalsAscending(false);
}
break;
}
@@ -989,3 +990,4 @@ void ScXMLSubTotalFieldContext::EndElement()
pSubTotalRuleContext->AddSubTotalColumn(aSubTotalColumn);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx
index 1191925c2bcc..07268e2aa5dc 100644
--- a/sc/source/filter/xml/xmldrani.hxx
+++ b/sc/source/filter/xml/xmldrani.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -360,3 +361,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index f8769cc95ffb..4cb9915ac186 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,6 @@
#include "docuno.hxx"
#include "textuno.hxx"
#include "chartlis.hxx"
-#include "unoguard.hxx"
#include "scitems.hxx"
#include "docpool.hxx"
#include "userdat.hxx"
@@ -69,6 +69,7 @@
#include "externalrefmgr.hxx"
#include "editutil.hxx"
#include "tabprotection.hxx"
+#include "cachedattraccess.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnmspe.hxx>
@@ -161,11 +162,13 @@
#define SC_SHOW_CHANGES_BY_RANGES 11
#define SC_SHOW_CHANGES_BY_RANGES_LIST 12
-using namespace rtl;
using namespace formula;
using namespace com::sun::star;
using namespace xmloff::token;
using ::std::vector;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
//----------------------------------------------------------------------------
@@ -237,8 +240,6 @@ uno::Sequence< rtl::OUString > SAL_CALL ScXMLOOoExport_getSupportedServiceNames(
uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
{
- // #110680#
- // return (cppu::OWeakObject*)new ScXMLExport(EXPORT_ALL);
return (cppu::OWeakObject*)new ScXMLExport( rSMgr, EXPORT_ALL );
}
@@ -256,8 +257,6 @@ uno::Sequence< rtl::OUString > SAL_CALL ScXMLOOoExport_Meta_getSupportedServiceN
uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Meta_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
{
- // #110680#
- // return (cppu::OWeakObject*)new ScXMLExport(EXPORT_META);
return (cppu::OWeakObject*)new ScXMLExport( rSMgr, EXPORT_META );
}
@@ -275,8 +274,6 @@ uno::Sequence< rtl::OUString > SAL_CALL ScXMLOOoExport_Styles_getSupportedServic
uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Styles_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
{
- // #110680#
- // return (cppu::OWeakObject*)new ScXMLExport(EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS);
return (cppu::OWeakObject*)new ScXMLExport( rSMgr, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS);
}
@@ -294,8 +291,6 @@ uno::Sequence< rtl::OUString > SAL_CALL ScXMLOOoExport_Content_getSupportedServi
uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Content_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
{
- // #110680#
- // return (cppu::OWeakObject*)new ScXMLExport(EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS);
return (cppu::OWeakObject*)new ScXMLExport( rSMgr, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS);
}
@@ -313,8 +308,6 @@ uno::Sequence< rtl::OUString > SAL_CALL ScXMLOOoExport_Settings_getSupportedServ
uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Settings_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
{
- // #110680#
- // return (cppu::OWeakObject*)new ScXMLExport(EXPORT_SETTINGS);
return (cppu::OWeakObject*)new ScXMLExport( rSMgr, EXPORT_SETTINGS );
}
@@ -482,9 +475,9 @@ ScXMLExport::ScXMLExport(
nOpenRow(-1),
nProgressCount(0),
nCurrentTable(0),
- bHasRowHeader(sal_False),
- bRowHeaderOpen(sal_False),
- mbShowProgress( sal_False )
+ bHasRowHeader(false),
+ bRowHeaderOpen(false),
+ mbShowProgress( false )
{
if (getExportFlags() & EXPORT_CONTENT)
{
@@ -527,7 +520,7 @@ ScXMLExport::ScXMLExport(
// This name is reserved for the external ref cache tables. This
// should not conflict with user-defined styles since this name is
// used for a table style which is not available in the UI.
- sExternalRefTabStyleName = rtl::OUString::createFromAscii("ta_extref");
+ sExternalRefTabStyleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ta_extref"));
GetAutoStylePool()->RegisterName(XML_STYLE_FAMILY_TABLE_TABLE, sExternalRefTabStyleName);
sAttrName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_NAME));
@@ -656,7 +649,7 @@ void ScXMLExport::CollectSharedData(sal_Int32& nTableCount, sal_Int32& nShapesCo
{
uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage());
ScMyDrawPage aDrawPage;
- aDrawPage.bHasForms = sal_False;
+ aDrawPage.bHasForms = false;
aDrawPage.xDrawPage.set(xDrawPage);
pSharedData->AddDrawPage(aDrawPage, nTable);
uno::Reference<container::XIndexAccess> xShapesIndex (xDrawPage, uno::UNO_QUERY);
@@ -679,39 +672,21 @@ void ScXMLExport::CollectSharedData(sal_Int32& nTableCount, sal_Int32& nShapesCo
else
{
++nShapesCount;
- SvxShape* pShapeImp(SvxShape::getImplementation(xShape));
- if (pShapeImp)
+ if (SvxShape* pShapeImp = SvxShape::getImplementation(xShape))
{
- SdrObject *pSdrObj(pShapeImp->GetSdrObject());
- if (pSdrObj)
+ if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
{
- if (ScDrawLayer::GetAnchor(pSdrObj) == SCA_CELL)
+ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData( pSdrObj ))
{
- if (pDoc)
- {
-
- awt::Point aPoint(xShape->getPosition());
- awt::Size aSize(xShape->getSize());
- rtl::OUString sType(xShape->getShapeType());
- Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
- if ( sType.equals(sCaptionShape) )
- {
- awt::Point aRelativeCaptionPoint;
- xShapeProp->getPropertyValue( sCaptionPoint ) >>= aRelativeCaptionPoint;
- Point aCoreRelativeCaptionPoint(aRelativeCaptionPoint.X, aRelativeCaptionPoint.Y);
- Point aCoreAbsoluteCaptionPoint(aPoint.X, aPoint.Y);
- aCoreAbsoluteCaptionPoint += aCoreRelativeCaptionPoint;
- aRectangle.Union(Rectangle(aCoreAbsoluteCaptionPoint, aCoreAbsoluteCaptionPoint));
- }
- ScRange aRange(pDoc->GetRange(static_cast<SCTAB>(nTable), aRectangle));
- ScMyShape aMyShape;
- aMyShape.aAddress = aRange.aStart;
- aMyShape.aEndAddress = aRange.aEnd;
- aMyShape.xShape = xShape;
- pSharedData->AddNewShape(aMyShape);
- pSharedData->SetLastColumn(nTable, aRange.aStart.Col());
- pSharedData->SetLastRow(nTable, aRange.aStart.Row());
- }
+ ScMyShape aMyShape;
+ aMyShape.aAddress = pAnchor->maStart;
+ aMyShape.aEndAddress = pAnchor->maEnd;
+ aMyShape.nEndX = pAnchor->maEndOffset.X();
+ aMyShape.nEndY = pAnchor->maEndOffset.Y();
+ aMyShape.xShape = xShape;
+ pSharedData->AddNewShape(aMyShape);
+ pSharedData->SetLastColumn(nTable, pAnchor->maStart.Col());
+ pSharedData->SetLastRow(nTable, pAnchor->maStart.Row());
}
else
pSharedData->AddTableShape(nTable, xShape);
@@ -775,7 +750,7 @@ void ScXMLExport::CollectShapesAutoStyles(const sal_Int32 nTableCount)
while (aItr != aEndItr)
{
GetShapeExport()->collectShapeAutoStyles(*aItr);
- IncrementProgressBar(sal_False);
+ IncrementProgressBar(false);
++aItr;
}
}
@@ -785,7 +760,7 @@ void ScXMLExport::CollectShapesAutoStyles(const sal_Int32 nTableCount)
while (aShapeItr != aEndItr && (static_cast<sal_Int32>(aShapeItr->aAddress.Tab()) == nTable))
{
GetShapeExport()->collectShapeAutoStyles(aShapeItr->xShape);
- IncrementProgressBar(sal_False);
+ IncrementProgressBar(false);
++aShapeItr;
}
}
@@ -825,11 +800,11 @@ void ScXMLExport::_ExportMeta()
CollectSharedData(nTableCount, nShapesCount, nCellCount);
uno::Sequence<beans::NamedValue> stats(3);
- stats[0] = beans::NamedValue(::rtl::OUString::createFromAscii("TableCount"),
+ stats[0] = beans::NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableCount")),
uno::makeAny(nTableCount));
- stats[1] = beans::NamedValue(::rtl::OUString::createFromAscii("CellCount"),
+ stats[1] = beans::NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellCount")),
uno::makeAny(nCellCount));
- stats[2] = beans::NamedValue(::rtl::OUString::createFromAscii("ObjectCount"),
+ stats[2] = beans::NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ObjectCount")),
uno::makeAny(nShapesCount));
// update document statistics at the model
@@ -923,7 +898,7 @@ void ScXMLExport::GetDetectiveOpList( ScMyDetectiveOpContainer& rDetOp )
{
rDetOp.AddOperation( pDetData->GetOperation(), rDetPos, nIndex );
- // #123981# cells with detective operations are written even if empty
+ // cells with detective operations are written even if empty
pSharedData->SetLastColumn( nTab, rDetPos.Col() );
pSharedData->SetLastRow( nTab, rDetPos.Row() );
}
@@ -990,10 +965,9 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const table::CellRangeAd
sal_Int32 nIndex;
sal_Int32 nPrevColumn(0);
sal_Bool bPrevIsVisible (sal_True);
- sal_Bool bWasHeader (sal_False);
- sal_Bool bIsHeader (sal_False);
+ sal_Bool bWasHeader (false);
+ sal_Bool bIsHeader (false);
sal_Bool bIsClosed (sal_True);
- sal_Bool bIsFirst (sal_False);
sal_Int32 nPrevIndex (-1);
sal_Int32 nColumn;
for (nColumn = 0; nColumn <= pSharedData->GetLastColumn(nTable); ++nColumn)
@@ -1007,7 +981,6 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const table::CellRangeAd
{
if (bIsHeader)
{
- bIsFirst = sal_False;
if (nColumn > 0)
{
WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
@@ -1018,12 +991,11 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const table::CellRangeAd
nPrevIndex = nIndex;
nPrevColumn = nColumn;
nColsRepeated = 1;
- bIsFirst = sal_True;
if(pGroupColumns->IsGroupStart(nColumn))
pGroupColumns->OpenGroups(nColumn);
OpenHeaderColumn();
bWasHeader = sal_True;
- bIsClosed = sal_False;
+ bIsClosed = false;
}
else
{
@@ -1037,7 +1009,7 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const table::CellRangeAd
nPrevIndex = nIndex;
nPrevColumn = nColumn;
nColsRepeated = 1;
- bWasHeader = sal_False;
+ bWasHeader = false;
bIsClosed = sal_True;
}
}
@@ -1047,14 +1019,12 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const table::CellRangeAd
pGroupColumns->OpenGroups(nColumn);
bPrevIsVisible = bIsVisible;
nPrevIndex = nIndex;
- bIsFirst = sal_True;
}
else if ((bIsVisible == bPrevIsVisible) && (nIndex == nPrevIndex) &&
!pGroupColumns->IsGroupStart(nColumn) && !pGroupColumns->IsGroupEnd(nColumn - 1))
++nColsRepeated;
else
{
- bIsFirst = sal_False;
WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
if (pGroupColumns->IsGroupEnd(nColumn - 1))
{
@@ -1078,8 +1048,7 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const table::CellRangeAd
nColsRepeated = 1;
}
}
- //if (nColsRepeated > 1 || bIsFirst)
- WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
+ WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
if (!bIsClosed)
CloseHeaderColumn();
if (pGroupColumns->IsGroupEnd(nColumn - 1))
@@ -1089,7 +1058,7 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const table::CellRangeAd
void ScXMLExport::ExportExternalRefCacheStyles()
{
sal_Int32 nEntryIndex = GetCellStylesPropertySetMapper()->FindEntryIndex(
- "NumberFormat", XML_NAMESPACE_STYLE, OUString::createFromAscii("data-style-name"));
+ "NumberFormat", XML_NAMESPACE_STYLE, OUString(RTL_CONSTASCII_USTRINGPARAM("data-style-name")));
if (nEntryIndex < 0)
// No entry index for the number format is found.
@@ -1103,7 +1072,7 @@ void ScXMLExport::ExportExternalRefCacheStyles()
// Export each unique number format used in the external ref cache.
vector<sal_uInt32> aNumFmts;
pRefMgr->getAllCachedNumberFormats(aNumFmts);
- const OUString aDefaultStyle = OUString::createFromAscii("Default").intern();
+ const OUString aDefaultStyle = OUString(RTL_CONSTASCII_USTRINGPARAM("Default")).intern();
for (vector<sal_uInt32>::const_iterator itr = aNumFmts.begin(), itrEnd = aNumFmts.end();
itr != itrEnd; ++itr)
{
@@ -1130,7 +1099,7 @@ void ScXMLExport::ExportExternalRefCacheStyles()
{
sal_Bool bIsAuto;
nIndex = pCellStyles->GetIndexOfStyleName(
- aName, OUString::createFromAscii(XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX), bIsAuto);
+ aName, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX)), bIsAuto);
}
// store the number format to index mapping for later use.
@@ -1160,7 +1129,7 @@ void ScXMLExport::WriteRowContent()
nPrevValidationIndex = aRange.nValidationIndex;
bIsAutoStyle = aRange.bIsAutoStyle;
nCols = aRange.nRepeatColumns;
- bIsFirst = sal_False;
+ bIsFirst = false;
#ifdef DBG_UTIL
nPrevCol = aRange.nStartColumn;
#endif
@@ -1211,18 +1180,18 @@ void ScXMLExport::WriteRowContent()
}
}
-void ScXMLExport::WriteRowStartTag(sal_Int32 nRow, const sal_Int32 nIndex,
- const sal_Int8 nFlag, const sal_Int32 nEqualRows)
+void ScXMLExport::WriteRowStartTag(
+ sal_Int32 nRow, const sal_Int32 nIndex, const sal_Int32 nEqualRows,
+ bool bHidden, bool bFiltered)
{
AddAttribute(sAttrStyleName, *pRowStyles->GetStyleNameByIndex(nIndex));
- if (nFlag)
- if (nFlag & CR_HIDDEN)
- {
- if (nFlag & CR_FILTERED)
- AddAttribute(XML_NAMESPACE_TABLE, XML_VISIBILITY, XML_FILTER);
- else
- AddAttribute(XML_NAMESPACE_TABLE, XML_VISIBILITY, XML_COLLAPSE);
- }
+ if (bHidden)
+ {
+ if (bFiltered)
+ AddAttribute(XML_NAMESPACE_TABLE, XML_VISIBILITY, XML_FILTER);
+ else
+ AddAttribute(XML_NAMESPACE_TABLE, XML_VISIBILITY, XML_COLLAPSE);
+ }
if (nEqualRows > 1)
{
rtl::OUStringBuffer aBuf;
@@ -1233,7 +1202,7 @@ void ScXMLExport::WriteRowStartTag(sal_Int32 nRow, const sal_Int32 nIndex,
const ScMyDefaultStyleList& rRowDefaults = *pDefaults->GetRowDefaults();
if ( nRow >= sal::static_int_cast<sal_Int32>( rRowDefaults.size() ) )
{
- // #123981# used to happen with detective operations - if there are more cases, use the last row's style
+ // used to happen with detective operations - if there are more cases, use the last row's style
DBG_ERRORFILE("WriteRowStartTag: not enough defaults");
nRow = rRowDefaults.size() - 1;
}
@@ -1256,7 +1225,9 @@ void ScXMLExport::CloseHeaderRows()
EndElement(XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, sal_True);
}
-void ScXMLExport::OpenNewRow(const sal_Int32 nIndex, const sal_Int8 nFlag, const sal_Int32 nStartRow, const sal_Int32 nEqualRows)
+void ScXMLExport::OpenNewRow(
+ const sal_Int32 nIndex, const sal_Int32 nStartRow, const sal_Int32 nEqualRows,
+ bool bHidden, bool bFiltered)
{
nOpenRow = nStartRow;
if (pGroupRows->IsGroupStart(nStartRow))
@@ -1276,35 +1247,38 @@ void ScXMLExport::OpenNewRow(const sal_Int32 nIndex, const sal_Int8 nFlag, const
nEquals = aRowHeaderRange.EndRow - nStartRow + 1;
else
nEquals = nEqualRows;
- WriteRowStartTag(nStartRow, nIndex, nFlag, nEquals);
+ WriteRowStartTag(nStartRow, nIndex, nEquals, bHidden, bFiltered);
nOpenRow = nStartRow + nEquals - 1;
if (nEquals < nEqualRows)
{
CloseRow(nStartRow + nEquals - 1);
- WriteRowStartTag(nStartRow, nIndex, nFlag, nEqualRows - nEquals);
+ WriteRowStartTag(nStartRow, nIndex, nEqualRows - nEquals, bHidden, bFiltered);
nOpenRow = nStartRow + nEqualRows - 1;
}
}
else
- WriteRowStartTag(nStartRow, nIndex, nFlag, nEqualRows);
+ WriteRowStartTag(nStartRow, nIndex, nEqualRows, bHidden, bFiltered);
}
-void ScXMLExport::OpenAndCloseRow(const sal_Int32 nIndex, const sal_Int8 nFlag,
- const sal_Int32 nStartRow, const sal_Int32 nEqualRows)
+void ScXMLExport::OpenAndCloseRow(
+ const sal_Int32 nIndex, const sal_Int32 nStartRow, const sal_Int32 nEqualRows,
+ bool bHidden, bool bFiltered)
{
- OpenNewRow(nIndex, nFlag, nStartRow, nEqualRows);
+ OpenNewRow(nIndex, nStartRow, nEqualRows, bHidden, bFiltered);
WriteRowContent();
CloseRow(nStartRow + nEqualRows - 1);
pRowFormatRanges->Clear();
}
-void ScXMLExport::OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, const sal_Int32 nRepeatRow)
+void ScXMLExport::OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, const sal_Int32 nRepeatRow, ScXMLCachedRowAttrAccess& rRowAttr)
{
if (nRepeatRow > 1)
{
sal_Int32 nPrevIndex(0), nIndex;
- sal_Int8 nPrevFlag(0);
- sal_Int8 nFlag(0);
+ bool bPrevHidden = false;
+ bool bPrevFiltered = false;
+ bool bHidden = false;
+ bool bFiltered = false;
sal_Int32 nEqualRows(1);
sal_Int32 nEndRow(nStartRow + nRepeatRow);
sal_Int32 nRow;
@@ -1314,14 +1288,20 @@ void ScXMLExport::OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, con
{
nPrevIndex = pRowStyles->GetStyleNameIndex(nTable, nRow);
if (pDoc)
- nPrevFlag = (pDoc->GetRowFlags(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTable))) & (CR_HIDDEN | CR_FILTERED);
+ {
+ bPrevHidden = rRowAttr.rowHidden(nTable, nRow);
+ bPrevFiltered = rRowAttr.rowFiltered(nTable, nRow);
+ }
}
else
{
nIndex = pRowStyles->GetStyleNameIndex(nTable, nRow);
if (pDoc)
- nFlag = (pDoc->GetRowFlags(static_cast<SCROW>(nRow), static_cast<SCTAB>(nTable))) & (CR_HIDDEN | CR_FILTERED);
- if (nIndex == nPrevIndex && nFlag == nPrevFlag &&
+ {
+ bHidden = rRowAttr.rowHidden(nTable, nRow);
+ bFiltered = rRowAttr.rowFiltered(nTable, nRow);
+ }
+ if (nIndex == nPrevIndex && bHidden == bPrevHidden && bFiltered == bPrevFiltered &&
!(bHasRowHeader && ((nRow == aRowHeaderRange.StartRow) || (nRow - 1 == aRowHeaderRange.EndRow))) &&
!(pGroupRows->IsGroupStart(nRow)) &&
!(pGroupRows->IsGroupEnd(nRow - 1)))
@@ -1331,27 +1311,32 @@ void ScXMLExport::OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, con
if (nRow < nEndRow)
{
ScRowFormatRanges* pTempRowFormatRanges = new ScRowFormatRanges(pRowFormatRanges);
- OpenAndCloseRow(nPrevIndex, nPrevFlag, nRow - nEqualRows, nEqualRows);
+ OpenAndCloseRow(nPrevIndex, nRow - nEqualRows, nEqualRows, bPrevHidden, bPrevFiltered);
delete pRowFormatRanges;
pRowFormatRanges = pTempRowFormatRanges;
}
else
- OpenAndCloseRow(nPrevIndex, nPrevFlag, nRow - nEqualRows, nEqualRows);
+ OpenAndCloseRow(nPrevIndex, nRow - nEqualRows, nEqualRows, bPrevHidden, bPrevFiltered);
nEqualRows = 1;
nPrevIndex = nIndex;
- nPrevFlag = nFlag;
+ bPrevHidden = bHidden;
+ bPrevFiltered = bFiltered;
}
}
}
- OpenNewRow(nPrevIndex, nPrevFlag, nRow - nEqualRows, nEqualRows);
+ OpenNewRow(nPrevIndex, nRow - nEqualRows, nEqualRows, bPrevHidden, bPrevFiltered);
}
else
{
sal_Int32 nIndex = pRowStyles->GetStyleNameIndex(nTable, nStartRow);
- sal_Int8 nFlag(0);
+ bool bHidden = false;
+ bool bFiltered = false;
if (pDoc)
- nFlag = (pDoc->GetRowFlags(static_cast<SCROW>(nStartRow), static_cast<SCTAB>(nTable))) & (CR_HIDDEN | CR_FILTERED);
- OpenNewRow(nIndex, nFlag, nStartRow, 1);
+ {
+ bHidden = rRowAttr.rowHidden(nTable, nStartRow);
+ bFiltered = rRowAttr.rowFiltered(nTable, nStartRow);
+ }
+ OpenNewRow(nIndex, nStartRow, 1, bHidden, bFiltered);
}
nOpenRow = nStartRow + nRepeatRow - 1;
}
@@ -1364,7 +1349,7 @@ void ScXMLExport::CloseRow(const sal_Int32 nRow)
if (bHasRowHeader && nRow == aRowHeaderRange.EndRow)
{
CloseHeaderRows();
- bRowHeaderOpen = sal_False;
+ bRowHeaderOpen = false;
}
if (pGroupRows->IsGroupEnd(nRow))
{
@@ -1382,11 +1367,12 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32
const sal_Int32 nEndCol, const sal_Int32 nEndRow, const sal_Int32 nSheet)
{
pRowFormatRanges->Clear();
+ ScXMLCachedRowAttrAccess aRowAttr(pDoc);
if (nStartRow == nEndRow)
{
pCellStyles->GetFormatRanges(nStartCol, nEndCol, nStartRow, nSheet, pRowFormatRanges);
if (nOpenRow == - 1)
- OpenRow(nSheet, nStartRow, 1);
+ OpenRow(nSheet, nStartRow, 1, aRowAttr);
WriteRowContent();
pRowFormatRanges->Clear();
}
@@ -1407,12 +1393,12 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32
DBG_ASSERT(nMaxRows, "something wents wrong");
if (nMaxRows >= nTotalRows - nRows)
{
- OpenRow(nSheet, nStartRow + nRows, nTotalRows - nRows);
+ OpenRow(nSheet, nStartRow + nRows, nTotalRows - nRows, aRowAttr);
nRows += nTotalRows - nRows;
}
else
{
- OpenRow(nSheet, nStartRow + nRows, nMaxRows);
+ OpenRow(nSheet, nStartRow + nRows, nMaxRows, aRowAttr);
nRows += nMaxRows;
}
if (!pRowFormatRanges->GetSize())
@@ -1422,7 +1408,7 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32
}
if (nTotalRows == 1)
CloseRow(nStartRow);
- OpenRow(nSheet, nEndRow, 1);
+ OpenRow(nSheet, nEndRow, 1, aRowAttr);
pRowFormatRanges->Clear();
pCellStyles->GetFormatRanges(0, nEndCol, nEndRow, nSheet, pRowFormatRanges);
WriteRowContent();
@@ -1437,12 +1423,12 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32
sal_Int32 nMaxRows = pRowFormatRanges->GetMaxRows();
if (nMaxRows >= nTotalRows - nRows)
{
- OpenRow(nSheet, nStartRow + nRows, nTotalRows - nRows);
+ OpenRow(nSheet, nStartRow + nRows, nTotalRows - nRows, aRowAttr);
nRows += nTotalRows - nRows;
}
else
{
- OpenRow(nSheet, nStartRow + nRows, nMaxRows);
+ OpenRow(nSheet, nStartRow + nRows, nMaxRows, aRowAttr);
nRows += nMaxRows;
}
if (!pRowFormatRanges->GetSize())
@@ -1450,7 +1436,7 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32
WriteRowContent();
CloseRow(nStartRow + nRows - 1);
}
- OpenRow(nSheet, nEndRow, 1);
+ OpenRow(nSheet, nEndRow, 1, aRowAttr);
pRowFormatRanges->Clear();
pCellStyles->GetFormatRanges(0, nEndCol, nEndRow, nSheet, pRowFormatRanges);
WriteRowContent();
@@ -1498,7 +1484,7 @@ void ScXMLExport::FillColumnRowGroups()
{
if (pDoc)
{
- ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable( static_cast<SCTAB>(nCurrentTable), sal_False );
+ ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable( static_cast<SCTAB>(nCurrentTable), false );
if(pOutlineTable)
{
ScOutlineArray* pCols(pOutlineTable->GetColArray());
@@ -1520,12 +1506,36 @@ void ScXMLExport::SetBodyAttributes()
AddAttribute(XML_NAMESPACE_TABLE, XML_STRUCTURE_PROTECTED, XML_TRUE);
rtl::OUStringBuffer aBuffer;
uno::Sequence<sal_Int8> aPassHash;
+ ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED;
const ScDocProtection* p = pDoc->GetDocProtection();
if (p)
- aPassHash = p->getPasswordHash(PASSHASH_OOO);
+ {
+ if (p->hasPasswordHash(PASSHASH_SHA1))
+ {
+ aPassHash = p->getPasswordHash(PASSHASH_SHA1);
+ eHashUsed = PASSHASH_SHA1;
+ }
+ else if (p->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1))
+ {
+ aPassHash = p->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1);
+ eHashUsed = PASSHASH_XL;
+ }
+ }
SvXMLUnitConverter::encodeBase64(aBuffer, aPassHash);
if (aBuffer.getLength())
+ {
AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
+ if (eHashUsed == PASSHASH_XL)
+ {
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
+ ScPassHashHelper::getHashURI(PASSHASH_XL));
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2,
+ ScPassHashHelper::getHashURI(PASSHASH_SHA1));
+ }
+ else if (eHashUsed == PASSHASH_SHA1)
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
+ ScPassHashHelper::getHashURI(PASSHASH_SHA1));
+ }
}
}
@@ -1647,7 +1657,7 @@ void ScXMLExport::_ExportContent()
sal_Int32 nShapesCount(0);
sal_Int32 nCellCount(pDoc ? pDoc->GetCellCount() : 0);
CollectSharedData(nTableCount, nShapesCount, nCellCount);
- DBG_ERROR("no shared data setted");
+ OSL_FAIL("no shared data setted");
}
ScXMLExportDatabaseRanges aExportDatabaseRanges(*this);
if (!GetModel().is())
@@ -1725,18 +1735,45 @@ void ScXMLExport::_ExportContent()
AddAttribute(sAttrStyleName, aTableStyles[nTable]);
uno::Reference<util::XProtectable> xProtectable (xTable, uno::UNO_QUERY);
+ ScTableProtection* pProtect = NULL;
if (xProtectable.is() && xProtectable->isProtected())
{
AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE);
- rtl::OUStringBuffer aBuffer;
if (pDoc)
{
- ScTableProtection* pProtect = pDoc->GetTabProtection(static_cast<SCTAB>(nTable));
+ pProtect = pDoc->GetTabProtection(static_cast<SCTAB>(nTable));
if (pProtect)
- SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_OOO));
+ {
+ rtl::OUStringBuffer aBuffer;
+ ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED;
+ if (pProtect->hasPasswordHash(PASSHASH_SHA1))
+ {
+ SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_SHA1));
+ eHashUsed = PASSHASH_SHA1;
+ }
+ else if (pProtect->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1))
+ {
+ // Double-hash this by SHA1 on top of the legacy xls hash.
+ uno::Sequence<sal_Int8> aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1);
+ SvXMLUnitConverter::encodeBase64(aBuffer, aHash);
+ eHashUsed = PASSHASH_XL;
+ }
+ if (aBuffer.getLength())
+ {
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
+ if (eHashUsed == PASSHASH_XL)
+ {
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
+ ScPassHashHelper::getHashURI(PASSHASH_XL));
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2,
+ ScPassHashHelper::getHashURI(PASSHASH_SHA1));
+ }
+ else if (eHashUsed == PASSHASH_SHA1)
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
+ ScPassHashHelper::getHashURI(PASSHASH_SHA1));
+ }
+ }
}
- if (aBuffer.getLength())
- AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
}
rtl::OUString sPrintRanges;
table::CellRangeAddress aColumnHeaderRange;
@@ -1747,6 +1784,20 @@ void ScXMLExport::_ExportContent()
else if (!pDoc->IsPrintEntireSheet(static_cast<SCTAB>(nTable)))
AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE);
SvXMLElementExport aElemT(*this, sElemTab, sal_True, sal_True);
+
+ if (pProtect && pProtect->isProtected())
+ {
+ if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS))
+ AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
+ if (pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS))
+ AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE);
+
+ rtl::OUString aElemName = GetNamespaceMap().GetQNameByKey(
+ XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_PROTECTION));
+
+ SvXMLElementExport aElemProtected(*this, aElemName, true, true);
+ }
+
CheckAttrList();
if ( pDoc && pDoc->GetSheetEvents( static_cast<SCTAB>(nTable) ) &&
@@ -1783,7 +1834,7 @@ void ScXMLExport::_ExportContent()
FillColumnRowGroups();
if (bHasColumnHeader)
pSharedData->SetLastColumn(nTable, aColumnHeaderRange.EndColumn);
- bRowHeaderOpen = sal_False;
+ bRowHeaderOpen = false;
if (bHasRowHeader)
pSharedData->SetLastRow(nTable, aRowHeaderRange.EndRow);
pDefaults->FillDefaultStyles(nTable, pSharedData->GetLastRow(nTable),
@@ -1803,7 +1854,7 @@ void ScXMLExport::_ExportContent()
{
ExportFormatRanges(0, 0, aCell.aCellAddress.Column - 1, aCell.aCellAddress.Row, nTable);
aPrevCell = aCell;
- bIsFirst = sal_False;
+ bIsFirst = false;
}
else
{
@@ -1845,7 +1896,7 @@ void ScXMLExport::_ExportContent()
}
}
}
- IncrementProgressBar(sal_False);
+ IncrementProgressBar(false);
}
}
WriteExternalRefCaches();
@@ -1868,7 +1919,6 @@ void ScXMLExport::_ExportStyles( sal_Bool bUsed )
sal_Int32 nShapesCount(0);
sal_Int32 nCellCount(pDoc ? pDoc->GetCellCount() : 0);
CollectSharedData(nTableCount, nShapesCount, nCellCount);
- //DBG_ERROR("no shared data setted");
}
ScXMLStyleExport aStylesExp(*this, rtl::OUString(), GetAutoStylePool().get());
if (GetModel().is())
@@ -1882,10 +1932,6 @@ void ScXMLExport::_ExportStyles( sal_Bool bUsed )
if (pSharedData->HasShapes())
{
GetShapeExport()->ExportGraphicDefaults();
-/* xInterface = xMultiServiceFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults")));
- uno::Reference <beans::XPropertySet> xDrawProperties(xInterface, uno::UNO_QUERY);
- if (xDrawProperties.is())
- aStylesExp.exportDefaultStyle(xDrawProperties, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), GetShapeExport()->CreateShapePropMapper(*this));*/
}
}
uno::Reference <style::XStyleFamiliesSupplier> xStyleFamiliesSupplier (GetModel(), uno::UNO_QUERY);
@@ -1916,7 +1962,7 @@ void ScXMLExport::_ExportStyles( sal_Bool bUsed )
exportDataStyles();
aStylesExp.exportStyleFamily(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellStyles")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME)), xCellStylesExportPropertySetMapper, sal_False, XML_STYLE_FAMILY_TABLE_CELL);
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME)), xCellStylesExportPropertySetMapper, false, XML_STYLE_FAMILY_TABLE_CELL);
SvXMLExport::_ExportStyles(bUsed);
}
@@ -1952,7 +1998,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
// so in the worst case only one property has to be copied, but in the best case no
// property has to be copied
aItr = xPropStates.erase(aItr);
- aEndItr = xPropStates.end(); // #120346# old aEndItr is invalidated!
+ aEndItr = xPropStates.end(); // old aEndItr is invalidated!
}
break;
case CTF_SC_CELLSTYLE :
@@ -2035,7 +2081,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
{
rtl::OUString* pTemp(new rtl::OUString(EncodeStyleName(sStyleName)));
sal_Int32 nIndex(0);
- if (!pCellStyles->AddStyleName(pTemp, nIndex, sal_False))
+ if (!pCellStyles->AddStyleName(pTemp, nIndex, false))
{
delete pTemp;
pTemp = NULL;
@@ -2049,7 +2095,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
{
if (bGetMerge)
bGetMerge = GetMerged(pAddresses, xTable);
- pCellStyles->AddRangeStyleName(*pAddresses, nIndex, sal_False, nValidationIndex, nNumberFormat);
+ pCellStyles->AddRangeStyleName(*pAddresses, nIndex, false, nValidationIndex, nNumberFormat);
if (!sStyleName.equalsAsciiL("Default", 7) || nValidationIndex != -1)
{
pSharedData->SetLastColumn(nTable, pAddresses->EndColumn);
@@ -2165,11 +2211,11 @@ void ScXMLExport::_ExportAutoStyles()
if (!GetModel().is())
return;
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( GetModel(), uno::UNO_QUERY );
+ Reference <sheet::XSpreadsheetDocument> xSpreadDoc( GetModel(), uno::UNO_QUERY );
if (!xSpreadDoc.is())
return;
- uno::Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
+ Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
if (!xIndex.is())
return;
@@ -2206,8 +2252,8 @@ void ScXMLExport::_ExportAutoStyles()
bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
if (bCopySheet)
{
- uno::Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference <beans::XPropertySet> xProperties(
+ Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ Reference <beans::XPropertySet> xProperties(
xTable->getCellByPosition( aPos.Col(), aPos.Row() ), uno::UNO_QUERY );
AddStyleFromCells(xProperties, xTable, nTable, &aCellIter->maName);
@@ -2226,9 +2272,9 @@ void ScXMLExport::_ExportAutoStyles()
bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
if (bCopySheet)
{
- uno::Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
- uno::Reference<beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex( aPos.Col() ), uno::UNO_QUERY);
+ Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
+ Reference<beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex( aPos.Col() ), uno::UNO_QUERY);
sal_Int32 nIndex(-1);
sal_Bool bIsVisible(sal_True);
@@ -2248,9 +2294,9 @@ void ScXMLExport::_ExportAutoStyles()
bool bCopySheet = pDoc->IsStreamValid( static_cast<SCTAB>(nTable) );
if (bCopySheet)
{
- uno::Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
- uno::Reference<beans::XPropertySet> xRowProperties(xTableRows->getByIndex( aPos.Row() ), uno::UNO_QUERY);
+ Reference<table::XColumnRowRange> xColumnRowRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
+ Reference<beans::XPropertySet> xRowProperties(xTableRows->getByIndex( aPos.Row() ), uno::UNO_QUERY);
sal_Int32 nIndex(-1);
AddStyleFromRow( xRowProperties, &aRowIter->maName, nIndex );
@@ -2270,7 +2316,7 @@ void ScXMLExport::_ExportAutoStyles()
if (bCopySheet)
{
//! separate method AddStyleFromTable needed?
- uno::Reference<beans::XPropertySet> xTableProperties(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ Reference<beans::XPropertySet> xTableProperties(xIndex->getByIndex(nTable), uno::UNO_QUERY);
if (xTableProperties.is())
{
std::vector<XMLPropertyState> xPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
@@ -2306,7 +2352,7 @@ void ScXMLExport::_ExportAutoStyles()
{
SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
// all uno shapes are created anyway in CollectSharedData
- uno::Reference<beans::XPropertySet> xShapeProperties( pDrawObj->getUnoShape(), uno::UNO_QUERY );
+ Reference<beans::XPropertySet> xShapeProperties( pDrawObj->getUnoShape(), uno::UNO_QUERY );
if (xShapeProperties.is())
{
if ( aNoteIter->maStyleName.getLength() )
@@ -2334,7 +2380,6 @@ void ScXMLExport::_ExportAutoStyles()
// note paragraph styles
- //UniReference<SvXMLExportPropertyMapper> xParaPropMapper = XMLTextParagraphExport::CreateParaExtPropMapper( *this );
UniReference<SvXMLExportPropertyMapper> xParaPropMapper = GetTextParagraphExport()->GetParagraphPropertyMapper();
const std::vector<ScTextStyleEntry>& rNoteParaEntries = pSheetData->GetNoteParaStyles();
@@ -2352,8 +2397,8 @@ void ScXMLExport::_ExportAutoStyles()
if (pNote)
{
SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
- uno::Reference<container::XEnumerationAccess> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xParaProp(
+ Reference<container::XEnumerationAccess> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
+ Reference<beans::XPropertySet> xParaProp(
lcl_GetEnumerated( xCellText, aNoteParaIter->maSelection.nStartPara ), uno::UNO_QUERY );
if ( xParaProp.is() )
{
@@ -2387,8 +2432,8 @@ void ScXMLExport::_ExportAutoStyles()
if (pNote)
{
SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos );
- uno::Reference<text::XSimpleText> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
+ Reference<text::XSimpleText> xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
+ Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
ScDrawTextCursor* pCursor = ScDrawTextCursor::getImplementation( xCursorProp );
if (pCursor)
{
@@ -2407,8 +2452,6 @@ void ScXMLExport::_ExportAutoStyles()
// stored text styles
- //UniReference<SvXMLExportPropertyMapper> xTextPropMapper = XMLTextParagraphExport::CreateCharExtPropMapper( *this );
-
const std::vector<ScTextStyleEntry>& rTextEntries = pSheetData->GetTextStyles();
std::vector<ScTextStyleEntry>::const_iterator aTextIter = rTextEntries.begin();
std::vector<ScTextStyleEntry>::const_iterator aTextEnd = rTextEntries.end();
@@ -2422,9 +2465,9 @@ void ScXMLExport::_ExportAutoStyles()
//! separate method AddStyleFromText needed?
//! cache sheet object
- uno::Reference<table::XCellRange> xCellRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference<text::XSimpleText> xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
+ Reference<table::XCellRange> xCellRange(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ Reference<text::XSimpleText> xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), uno::UNO_QUERY);
+ Reference<beans::XPropertySet> xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
ScCellTextCursor* pCursor = ScCellTextCursor::getImplementation( xCursorProp );
if (pCursor)
{
@@ -2449,176 +2492,169 @@ void ScXMLExport::_ExportAutoStyles()
sal_Int32 nShapesCount(0);
sal_Int32 nCellCount(pDoc ? pDoc->GetCellCount() : 0);
CollectSharedData(nTableCount, nShapesCount, nCellCount);
- //DBG_ERROR("no shared data setted");
}
sal_Int32 nTableCount(xIndex->getCount());
pCellStyles->AddNewTable(nTableCount - 1);
CollectShapesAutoStyles(nTableCount);
- for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable)
+ for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable, IncrementProgressBar(false))
{
bool bUseStream = pSheetData && pDoc && pDoc->IsStreamValid((SCTAB)nTable) &&
pSheetData->HasStreamPos(nTable) && xSourceStream.is();
- uno::Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- if (xTable.is())
+ Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
+ if (!xTable.is())
+ continue;
+
+ // table styles array must be complete, including copied tables - Add should find the stored style
+ Reference<beans::XPropertySet> xTableProperties(xTable, uno::UNO_QUERY);
+ if (xTableProperties.is())
{
- // table styles array must be complete, including copied tables - Add should find the stored style
- uno::Reference<beans::XPropertySet> xTableProperties(xTable, uno::UNO_QUERY);
- if (xTableProperties.is())
+ std::vector<XMLPropertyState> xPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
+ if(xPropStates.size())
{
- std::vector<XMLPropertyState> xPropStates(xTableStylesExportPropertySetMapper->Filter(xTableProperties));
- if(xPropStates.size())
- {
- rtl::OUString sParent;
- rtl::OUString sName;
- GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_TABLE, sParent, xPropStates);
- aTableStyles.push_back(sName);
- }
+ rtl::OUString sParent;
+ rtl::OUString sName;
+ GetAutoStylePool()->Add(sName, XML_STYLE_FAMILY_TABLE_TABLE, sParent, xPropStates);
+ aTableStyles.push_back(sName);
}
}
+
+ if (bUseStream)
+ continue;
+
// collect other auto-styles only for non-copied sheets
- if (xTable.is() && !bUseStream)
+ Reference<sheet::XUniqueCellFormatRangesSupplier> xCellFormatRanges ( xTable, uno::UNO_QUERY );
+ if ( xCellFormatRanges.is() )
{
- uno::Reference<sheet::XUniqueCellFormatRangesSupplier> xCellFormatRanges ( xTable, uno::UNO_QUERY );
- if ( xCellFormatRanges.is() )
+ Reference<container::XIndexAccess> xFormatRangesIndex(xCellFormatRanges->getUniqueCellFormatRanges());
+ if (xFormatRangesIndex.is())
{
- uno::Reference<container::XIndexAccess> xFormatRangesIndex(xCellFormatRanges->getUniqueCellFormatRanges());
- if (xFormatRangesIndex.is())
+ sal_Int32 nFormatRangesCount(xFormatRangesIndex->getCount());
+ GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nFormatRangesCount);
+ for (sal_Int32 nFormatRange = 0; nFormatRange < nFormatRangesCount; ++nFormatRange)
{
- sal_Int32 nFormatRangesCount(xFormatRangesIndex->getCount());
- GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nFormatRangesCount);
- for (sal_Int32 nFormatRange = 0; nFormatRange < nFormatRangesCount; ++nFormatRange)
+ Reference< sheet::XSheetCellRanges> xCellRanges(xFormatRangesIndex->getByIndex(nFormatRange), uno::UNO_QUERY);
+ if (xCellRanges.is())
{
- uno::Reference< sheet::XSheetCellRanges> xCellRanges(xFormatRangesIndex->getByIndex(nFormatRange), uno::UNO_QUERY);
- if (xCellRanges.is())
+ Reference <beans::XPropertySet> xProperties (xCellRanges, uno::UNO_QUERY);
+ if (xProperties.is())
{
- uno::Reference <beans::XPropertySet> xProperties (xCellRanges, uno::UNO_QUERY);
- if (xProperties.is())
- {
- AddStyleFromCells(xProperties, xTable, nTable, NULL);
- IncrementProgressBar(sal_False);
- }
+ AddStyleFromCells(xProperties, xTable, nTable, NULL);
+ IncrementProgressBar(false);
}
}
}
}
- uno::Reference<table::XColumnRowRange> xColumnRowRange (xTable, uno::UNO_QUERY);
- if (xColumnRowRange.is())
+ }
+ Reference<table::XColumnRowRange> xColumnRowRange (xTable, uno::UNO_QUERY);
+ if (xColumnRowRange.is())
+ {
+ if (pDoc)
{
- if (pDoc)
+ pDoc->SyncColRowFlags();
+ Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
+ if (xTableColumns.is())
{
- pDoc->SyncColRowFlags();
- uno::Reference<table::XTableColumns> xTableColumns(xColumnRowRange->getColumns());
- if (xTableColumns.is())
+ sal_Int32 nColumns(pDoc->GetLastChangedCol(sal::static_int_cast<SCTAB>(nTable)));
+ pSharedData->SetLastColumn(nTable, nColumns);
+ table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
+ if (aCellAddress.EndColumn > nColumns)
{
- sal_Int32 nColumns(pDoc->GetLastChangedCol(sal::static_int_cast<SCTAB>(nTable)));
- pSharedData->SetLastColumn(nTable, nColumns);
- table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
- if (aCellAddress.EndColumn > nColumns)
- {
- ++nColumns;
- pColumnStyles->AddNewTable(nTable, aCellAddress.EndColumn);
- }
-// else if (nColumns < MAXCOL)
-// pColumnStyles->AddNewTable(nTable, ++nColumns);
- else
- pColumnStyles->AddNewTable(nTable, nColumns);
- sal_Int32 nColumn = 0;
- while (/*nColumn <= nColumns && */nColumn <= MAXCOL)
- {
- sal_Int32 nIndex(-1);
- sal_Bool bIsVisible(sal_True);
- uno::Reference <beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex(nColumn), uno::UNO_QUERY);
- if (xColumnProperties.is())
- {
- AddStyleFromColumn( xColumnProperties, NULL, nIndex, bIsVisible );
- //if(xPropStates.size())
- pColumnStyles->AddFieldStyleName(nTable, nColumn, nIndex, bIsVisible);
- }
- sal_Int32 nOld(nColumn);
- nColumn = pDoc->GetNextDifferentChangedCol(sal::static_int_cast<SCTAB>(nTable), static_cast<SCCOL>(nColumn));
- for (sal_Int32 i = nOld + 1; i < nColumn; ++i)
- pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
- }
- if (aCellAddress.EndColumn > nColumns)
- {
- sal_Bool bIsVisible(sal_True);
- sal_Int32 nIndex(pColumnStyles->GetStyleNameIndex(nTable, nColumns, bIsVisible));
- for (sal_Int32 i = nColumns + 1; i <= aCellAddress.EndColumn; ++i)
- pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
- }
+ ++nColumns;
+ pColumnStyles->AddNewTable(nTable, aCellAddress.EndColumn);
}
- uno::Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
- if (xTableRows.is())
+ else
+ pColumnStyles->AddNewTable(nTable, nColumns);
+ sal_Int32 nColumn = 0;
+ while (nColumn <= MAXCOL)
{
- sal_Int32 nRows(pDoc->GetLastChangedRow(sal::static_int_cast<SCTAB>(nTable)));
- pSharedData->SetLastRow(nTable, nRows);
- table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
- if (aCellAddress.EndRow > nRows)
+ sal_Int32 nIndex(-1);
+ sal_Bool bIsVisible(sal_True);
+ Reference <beans::XPropertySet> xColumnProperties(xTableColumns->getByIndex(nColumn), uno::UNO_QUERY);
+ if (xColumnProperties.is())
{
- ++nRows;
- pRowStyles->AddNewTable(nTable, aCellAddress.EndRow);
+ AddStyleFromColumn( xColumnProperties, NULL, nIndex, bIsVisible );
+ pColumnStyles->AddFieldStyleName(nTable, nColumn, nIndex, bIsVisible);
}
-// else if (nRows < MAXROW)
-// pRowStyles->AddNewTable(nTable, ++nRows);
- else
- pRowStyles->AddNewTable(nTable, nRows);
- sal_Int32 nRow = 0;
- while (nRow <= nRows && nRow <= MAXROW)
- {
- sal_Int32 nIndex = 0;
- uno::Reference <beans::XPropertySet> xRowProperties(xTableRows->getByIndex(nRow), uno::UNO_QUERY);
- if(xRowProperties.is())
- {
- AddStyleFromRow( xRowProperties, NULL, nIndex );
- //if(xPropStates.size())
- pRowStyles->AddFieldStyleName(nTable, nRow, nIndex);
- }
- sal_Int32 nOld(nRow);
- nRow = pDoc->GetNextDifferentChangedRow(sal::static_int_cast<SCTAB>(nTable), static_cast<SCROW>(nRow), false);
- if (nRow > nOld + 1)
- pRowStyles->AddFieldStyleName(nTable, nOld + 1, nIndex, nRow - 1);
- }
- if (aCellAddress.EndRow > nRows)
+ sal_Int32 nOld(nColumn);
+ nColumn = pDoc->GetNextDifferentChangedCol(sal::static_int_cast<SCTAB>(nTable), static_cast<SCCOL>(nColumn));
+ for (sal_Int32 i = nOld + 1; i < nColumn; ++i)
+ pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
+ }
+ if (aCellAddress.EndColumn > nColumns)
+ {
+ sal_Bool bIsVisible(sal_True);
+ sal_Int32 nIndex(pColumnStyles->GetStyleNameIndex(nTable, nColumns, bIsVisible));
+ for (sal_Int32 i = nColumns + 1; i <= aCellAddress.EndColumn; ++i)
+ pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
+ }
+ }
+ Reference<table::XTableRows> xTableRows(xColumnRowRange->getRows());
+ if (xTableRows.is())
+ {
+ sal_Int32 nRows(pDoc->GetLastChangedRow(sal::static_int_cast<SCTAB>(nTable)));
+ pSharedData->SetLastRow(nTable, nRows);
+ table::CellRangeAddress aCellAddress(GetEndAddress(xTable, nTable));
+ if (aCellAddress.EndRow > nRows)
+ {
+ ++nRows;
+ pRowStyles->AddNewTable(nTable, aCellAddress.EndRow);
+ }
+ else
+ pRowStyles->AddNewTable(nTable, nRows);
+ sal_Int32 nRow = 0;
+ while (nRow <= nRows && nRow <= MAXROW)
+ {
+ sal_Int32 nIndex = 0;
+ Reference <beans::XPropertySet> xRowProperties(xTableRows->getByIndex(nRow), uno::UNO_QUERY);
+ if(xRowProperties.is())
{
- sal_Int32 nIndex(pRowStyles->GetStyleNameIndex(nTable, nRows));
- pRowStyles->AddFieldStyleName(nTable, nRows + 1, nIndex, aCellAddress.EndRow);
+ AddStyleFromRow( xRowProperties, NULL, nIndex );
+ pRowStyles->AddFieldStyleName(nTable, nRow, nIndex);
}
+ sal_Int32 nOld(nRow);
+ nRow = pDoc->GetNextDifferentChangedRow(sal::static_int_cast<SCTAB>(nTable), static_cast<SCROW>(nRow), false);
+ if (nRow > nOld + 1)
+ pRowStyles->AddFieldStyleName(nTable, nOld + 1, nIndex, nRow - 1);
+ }
+ if (aCellAddress.EndRow > nRows)
+ {
+ sal_Int32 nIndex(pRowStyles->GetStyleNameIndex(nTable, nRows));
+ pRowStyles->AddFieldStyleName(nTable, nRows + 1, nIndex, aCellAddress.EndRow);
}
}
}
- uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery (xTable, uno::UNO_QUERY);
- if (xCellRangesQuery.is())
+ }
+ Reference<sheet::XCellRangesQuery> xCellRangesQuery (xTable, uno::UNO_QUERY);
+ if (xCellRangesQuery.is())
+ {
+ Reference<sheet::XSheetCellRanges> xSheetCellRanges(xCellRangesQuery->queryContentCells(sheet::CellFlags::FORMATTED));
+ Reference<sheet::XSheetOperation> xSheetOperation(xSheetCellRanges, uno::UNO_QUERY);
+ if (xSheetCellRanges.is() && xSheetOperation.is())
{
- uno::Reference<sheet::XSheetCellRanges> xSheetCellRanges(xCellRangesQuery->queryContentCells(sheet::CellFlags::FORMATTED));
- uno::Reference<sheet::XSheetOperation> xSheetOperation(xSheetCellRanges, uno::UNO_QUERY);
- if (xSheetCellRanges.is() && xSheetOperation.is())
+ sal_uInt32 nCount(sal_uInt32(xSheetOperation->computeFunction(sheet::GeneralFunction_COUNT)));
+ Reference<container::XEnumerationAccess> xCellsAccess(xSheetCellRanges->getCells());
+ if (xCellsAccess.is())
{
- sal_uInt32 nCount(sal_uInt32(xSheetOperation->computeFunction(sheet::GeneralFunction_COUNT)));
- uno::Reference<container::XEnumerationAccess> xCellsAccess(xSheetCellRanges->getCells());
- if (xCellsAccess.is())
+ GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nCount);
+ Reference<container::XEnumeration> xCells(xCellsAccess->createEnumeration());
+ if (xCells.is())
{
- GetProgressBarHelper()->ChangeReference(GetProgressBarHelper()->GetReference() + nCount);
- uno::Reference<container::XEnumeration> xCells(xCellsAccess->createEnumeration());
- if (xCells.is())
+ sal_uInt32 nCount2(0);
+ while (xCells->hasMoreElements())
{
- sal_uInt32 nCount2(0);
- while (xCells->hasMoreElements())
- {
- uno::Reference<text::XText> xText(xCells->nextElement(), uno::UNO_QUERY);
- if (xText.is())
- GetTextParagraphExport()->collectTextAutoStyles(xText, sal_False, sal_False);
- ++nCount2;
- IncrementProgressBar(sal_False);
- }
- if(nCount2 > nCount)
- GetProgressBarHelper()->SetReference(GetProgressBarHelper()->GetReference() + nCount2 - nCount);
+ Reference<text::XText> xText(xCells->nextElement(), uno::UNO_QUERY);
+ if (xText.is())
+ GetTextParagraphExport()->collectTextAutoStyles(xText, false, false);
+ ++nCount2;
+ IncrementProgressBar(false);
}
+ if(nCount2 > nCount)
+ GetProgressBarHelper()->SetReference(GetProgressBarHelper()->GetReference() + nCount2 - nCount);
}
}
}
}
- IncrementProgressBar(sal_False);
}
pChangeTrackingExportHelper->CollectAutoStyles();
@@ -2702,29 +2738,10 @@ void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > xShape
}
}
-//UNUSED2008-05 sal_Bool ScXMLExport::GetMerge (const uno::Reference <sheet::XSpreadsheet>& xTable,
-//UNUSED2008-05 const sal_Int32 nCol, const sal_Int32 nRow,
-//UNUSED2008-05 table::CellRangeAddress& aCellAddress)
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<sheet::XSheetCellRange> xSheetCellRange(xTable->getCellRangeByPosition(nCol, nRow, nCol, nRow), uno::UNO_QUERY);
-//UNUSED2008-05 if (xSheetCellRange.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<sheet::XSheetCellCursor> xCursor(xTable->createCursorByRange(xSheetCellRange));
-//UNUSED2008-05 if (xCursor.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<sheet::XCellRangeAddressable> xCellAddress (xCursor, uno::UNO_QUERY);
-//UNUSED2008-05 xCursor->collapseToMergedArea();
-//UNUSED2008-05 aCellAddress = xCellAddress->getRangeAddress();
-//UNUSED2008-05 return sal_True;
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 }
-
sal_Bool ScXMLExport::GetMerged (const table::CellRangeAddress* pCellAddress,
const uno::Reference <sheet::XSpreadsheet>& xTable)
{
- sal_Bool bReady(sal_False);
+ sal_Bool bReady(false);
sal_Int32 nRow(pCellAddress->StartRow);
sal_Int32 nCol(pCellAddress->StartColumn);
sal_Int32 nEndRow(pCellAddress->EndRow);
@@ -2766,55 +2783,10 @@ sal_Bool ScXMLExport::GetMerged (const table::CellRangeAddress* pCellAddress,
return !bReady;
}
-//UNUSED2008-05 sal_Bool ScXMLExport::IsMatrix (const uno::Reference <table::XCellRange>& xCellRange,
-//UNUSED2008-05 const uno::Reference <sheet::XSpreadsheet>& xTable,
-//UNUSED2008-05 const sal_Int32 nCol, const sal_Int32 nRow,
-//UNUSED2008-05 table::CellRangeAddress& aCellAddress, sal_Bool& bIsFirst) const
-//UNUSED2008-05 {
-//UNUSED2008-05 bIsFirst = sal_False;
-//UNUSED2008-05 uno::Reference <sheet::XArrayFormulaRange> xArrayFormulaRange (xCellRange->getCellRangeByPosition(nCol,nRow,nCol,nRow), uno::UNO_QUERY);
-//UNUSED2008-05 if (xArrayFormulaRange.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 rtl::OUString sArrayFormula(xArrayFormulaRange->getArrayFormula());
-//UNUSED2008-05 if (sArrayFormula.getLength())
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<sheet::XSheetCellRange> xMatrixSheetCellRange (xArrayFormulaRange, uno::UNO_QUERY);
-//UNUSED2008-05 if (xMatrixSheetCellRange.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<sheet::XSheetCellCursor> xMatrixSheetCursor(xTable->createCursorByRange(xMatrixSheetCellRange));
-//UNUSED2008-05 if (xMatrixSheetCursor.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 xMatrixSheetCursor->collapseToCurrentArray();
-//UNUSED2008-05 uno::Reference<sheet::XCellRangeAddressable> xMatrixCellAddress (xMatrixSheetCursor, uno::UNO_QUERY);
-//UNUSED2008-05 if (xMatrixCellAddress.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 aCellAddress = xMatrixCellAddress->getRangeAddress();
-//UNUSED2008-05 if ((aCellAddress.StartColumn == nCol && aCellAddress.StartRow == nRow) &&
-//UNUSED2008-05 (aCellAddress.EndColumn > nCol || aCellAddress.EndRow > nRow))
-//UNUSED2008-05 {
-//UNUSED2008-05 bIsFirst = sal_True;
-//UNUSED2008-05 return sal_True;
-//UNUSED2008-05 }
-//UNUSED2008-05 else if (aCellAddress.StartColumn != nCol || aCellAddress.StartRow != nRow ||
-//UNUSED2008-05 aCellAddress.EndColumn != nCol || aCellAddress.EndRow != nRow)
-//UNUSED2008-05 return sal_True;
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 bIsFirst = sal_True;
-//UNUSED2008-05 return sal_True;
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 }
-
sal_Bool ScXMLExport::IsMatrix (const ScAddress& aCell,
table::CellRangeAddress& aCellAddress, sal_Bool& bIsFirst) const
{
- bIsFirst = sal_False;
+ bIsFirst = false;
ScRange aMatrixRange;
@@ -2837,45 +2809,7 @@ sal_Bool ScXMLExport::IsMatrix (const ScAddress& aCell,
}
}
- return sal_False;
-
-/* uno::Reference <sheet::XArrayFormulaRange> xArrayFormulaRange (xCell, uno::UNO_QUERY);
- if (xArrayFormulaRange.is())
- {
- rtl::OUString sArrayFormula(xArrayFormulaRange->getArrayFormula());
- if (sArrayFormula.getLength())
- {
- uno::Reference<sheet::XSheetCellRange> xMatrixSheetCellRange (xCell, uno::UNO_QUERY);
- if (xMatrixSheetCellRange.is())
- {
- uno::Reference<sheet::XSheetCellCursor> xMatrixSheetCursor(xTable->createCursorByRange(xMatrixSheetCellRange));
- if (xMatrixSheetCursor.is())
- {
- xMatrixSheetCursor->collapseToCurrentArray();
- uno::Reference<sheet::XCellRangeAddressable> xMatrixCellAddress (xMatrixSheetCursor, uno::UNO_QUERY);
- if (xMatrixCellAddress.is())
- {
- aCellAddress = xMatrixCellAddress->getRangeAddress();
- if ((aCellAddress.StartColumn == nCol && aCellAddress.StartRow == nRow) &&
- (aCellAddress.EndColumn > nCol || aCellAddress.EndRow > nRow))
- {
- bIsFirst = sal_True;
- return sal_True;
- }
- else if (aCellAddress.StartColumn != nCol || aCellAddress.StartRow != nRow ||
- aCellAddress.EndColumn != nCol || aCellAddress.EndRow != nRow)
- return sal_True;
- else
- {
- bIsFirst = sal_True;
- return sal_True;
- }
- }
- }
- }
- }
- }
- return sal_False;*/
+ return false;
}
sal_Bool ScXMLExport::GetCellText (ScMyCell& rMyCell, const ScAddress& aPos) const
@@ -2884,17 +2818,9 @@ sal_Bool ScXMLExport::GetCellText (ScMyCell& rMyCell, const ScAddress& aPos) con
return sal_True;
else
{
-/* if (!rMyCell.bHasXText)
- {
- rMyCell.xText.set(xCurrentTableCellRange->getCellByPosition(rMyCell.aCellAddress.Column, rMyCell.aCellAddress.Row), uno::UNO_QUERY);
- rMyCell.bHasXText = sal_True;
- }*/
-// if (rMyCell.xText.is())
-// {
rMyCell.sStringValue = ScCellObj::GetOutputString_Impl(pDoc, aPos);
rMyCell.bHasStringValue = sal_True;
return sal_True;
-// }
}
}
@@ -2919,7 +2845,7 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_COLUMNS_SPANNED, sColumns.makeStringAndClear());
AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_MATRIX_ROWS_SPANNED, sRows.makeStringAndClear());
}
- sal_Bool bIsEmpty(sal_False);
+ sal_Bool bIsEmpty(false);
switch (aCell.nType)
{
case table::CellContentType_EMPTY :
@@ -2963,11 +2889,11 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
rtl::OUString sOUFormula(sFormula.makeStringAndClear());
if (!bIsMatrix)
{
- AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula, sal_False ));
+ AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula, false ));
}
else
{
- AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula.copy(1, sOUFormula.getLength() - 2), sal_False ));
+ AddAttribute(sAttrFormula, GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sOUFormula.copy(1, sOUFormula.getLength() - 2), false ));
}
}
if (pFormulaCell->IsValue())
@@ -2983,8 +2909,11 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
pDoc->GetValue( aCellPos ));
}
else
- GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
+ {
+ if (pDoc)
+ GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
aCell.nNumberFormat, pDoc->GetValue( aCellPos ));
+ }
}
else
{
@@ -3028,7 +2957,7 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
WriteAnnotation(aCell);
WriteDetective(aCell);
- sal_Bool bEditCell = sal_False;
+ sal_Bool bEditCell = false;
if (!bIsEmpty)
{
@@ -3038,11 +2967,11 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
bEditCell = sal_True;
uno::Reference<text::XText> xText(xCurrentTableCellRange->getCellByPosition(aCell.aCellAddress.Column, aCell.aCellAddress.Row), uno::UNO_QUERY);
if ( xText.is())
- GetTextParagraphExport()->exportText(xText, sal_False, sal_False);
+ GetTextParagraphExport()->exportText(xText, false, false);
}
else
{
- SvXMLElementExport aElemP(*this, sElemP, sal_True, sal_False);
+ SvXMLElementExport aElemP(*this, sElemP, sal_True, false);
sal_Bool bPrevCharWasSpace(sal_True);
if (GetCellText(aCell, aCellPos))
GetTextParagraphExport()->exportText(aCell.sStringValue, bPrevCharWasSpace);
@@ -3056,7 +2985,6 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, awt::Point* pPoint)
{
uno::Reference < beans::XPropertySet > xShapeProps ( xShape, uno::UNO_QUERY );
-//BM sal_Bool bMemChart(sal_False); // das muss man jetzt umbenennen :-)
bool bIsChart( false );
rtl::OUString sPropCLSID (RTL_CONSTASCII_USTRINGPARAM("CLSID"));
rtl::OUString sPropModel (RTL_CONSTASCII_USTRINGPARAM("Model"));
@@ -3144,66 +3072,40 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
}
}
}
-
-//BM rtl::OUString sOUName;
-//BM xShapeProps->getPropertyValue(sPersistName) >>= sOUName;
-//BM String sName(sOUName);
-//BM if (!pChartListener)
-//BM {
-//BM String aEmptyString;
-//BM ScRange aRange;
-//BM pChartListener = new ScChartListener ( aEmptyString, GetDocument(), aRange );
-//BM }
-//BM if(pChartListener)
-//BM {
-//BM sal_uInt16 nIndex(0);
-//BM pChartListener->SetString( sName );
-//BM if ( GetDocument() && GetDocument()->GetChartListenerCollection()->Search( pChartListener, nIndex ) )
-//BM {
-//BM const ScRangeListRef& rRangeListRef(((ScChartListener*)
-//BM (GetDocument()->GetChartListenerCollection()->
-//BM At( nIndex )))->GetRangeList());
-//BM if (rRangeListRef.Is())
-//BM {
-//BM bMemChart = sal_True;
-//BM rtl::OUString sRanges;
-//BM ScRangeStringConverter::GetStringFromRangeList(sRanges, rRangeListRef, GetDocument());
-//BM SvXMLAttributeList* pAttrList = NULL;
-//BM if (sRanges.getLength())
-//BM {
-//BM pAttrList = new SvXMLAttributeList();
-//BM pAttrList->AddAttribute(
-//BM GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), sRanges );
-//BM }
-//BM GetShapeExport()->exportShape(xShape, SEF_EXPORT_NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList);
-//BM }
-//BM }
-//BM else
-//BM {
-//BM bMemChart = sal_True;
-//BM SvXMLAttributeList* pAttrList = new SvXMLAttributeList();
-//BM pAttrList->AddAttribute(
-//BM GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), rtl::OUString() );
-//BM GetShapeExport()->exportShape(xShape, SEF_EXPORT_NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList);
-//BM }
-//BM }
-
-/* SchMemChart* pMemChart = pDoc->FindChartData(sName);
- if (pMemChart && pMemChart->GetSeriesAddresses().getLength())
- {
- bMemChart = sal_True;
- rtl::OUString sRanges(pMemChart->getXMLStringForChartRange());
- if (sRanges.getLength())
- AddAttribute(XML_NAMESPACE_DRAW, XML_NOTIFY_ON_UPDATE_OF_RANGES, sRanges);
- GetShapeExport()->exportShape(xShape, SEF_EXPORT_NO_CHART_DATA | SEF_DEFAULT, pPoint);
- }*/
}
}
}
}
if (!bIsChart)
+ {
+ // #i66550 HLINK_FOR_SHAPES
+ rtl::OUString sHlink;
+ uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
+ if ( xProps.is() )
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink;
+
+ std::auto_ptr< SvXMLElementExport > pDrawA;
+ // enlose shapes with <draw:a> element only if sHlink contains something
+ if ( sHlink.getLength() > 0 )
+ {
+ // need to get delete the attributes that are pre-loaded
+ // for the shape export ( otherwise they will become
+ // attributes of the draw:a element ) This *shouldn't*
+ // affect performance adversely as there are only a
+ // couple of attributes involved
+ uno::Reference< xml::sax::XAttributeList > xSaveAttribs( new SvXMLAttributeList( GetAttrList() ) );
+ ClearAttrList();
+ // Add Hlink
+ AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
+ AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sHlink);
+ pDrawA.reset( new SvXMLElementExport( *this, XML_NAMESPACE_DRAW, XML_A, false, false ) );
+ // Attribute list has been cleared by previous operation
+ // re-add pre-loaded attributes
+ AddAttributeList( xSaveAttribs );
+ }
GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint);
- IncrementProgressBar(sal_False);
+ }
+ IncrementProgressBar(false);
}
void ScXMLExport::WriteShapes(const ScMyCell& rMyCell)
@@ -3229,29 +3131,15 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell)
aPoint.X = 2 * aItr->xShape->getPosition().X + aItr->xShape->getSize().Width - aPoint.X;
if ( !aItr->xShape->getShapeType().equals(sCaptionShape) )
{
- awt::Point aEndPoint;
Rectangle aEndRec(pDoc->GetMMRect(aItr->aEndAddress.Col(), aItr->aEndAddress.Row(),
aItr->aEndAddress.Col(), aItr->aEndAddress.Row(), aItr->aEndAddress.Tab()));
rtl::OUString sEndAddress;
ScRangeStringConverter::GetStringFromAddress(sEndAddress, aItr->aEndAddress, pDoc, FormulaGrammar::CONV_OOO);
AddAttribute(XML_NAMESPACE_TABLE, XML_END_CELL_ADDRESS, sEndAddress);
- if (bNegativePage)
- aEndPoint.X = -aEndRec.Right();
- else
- aEndPoint.X = aEndRec.Left();
- aEndPoint.Y = aEndRec.Top();
- awt::Point aStartPoint(aItr->xShape->getPosition());
- awt::Size aSize(aItr->xShape->getSize());
- sal_Int32 nEndX;
- if (bNegativePage)
- nEndX = -aStartPoint.X - aEndPoint.X;
- else
- nEndX = aStartPoint.X + aSize.Width - aEndPoint.X;
- sal_Int32 nEndY(aStartPoint.Y + aSize.Height - aEndPoint.Y);
rtl::OUStringBuffer sBuffer;
- GetMM100UnitConverter().convertMeasure(sBuffer, nEndX);
+ GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndX);
AddAttribute(XML_NAMESPACE_TABLE, XML_END_X, sBuffer.makeStringAndClear());
- GetMM100UnitConverter().convertMeasure(sBuffer, nEndY);
+ GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndY);
AddAttribute(XML_NAMESPACE_TABLE, XML_END_Y, sBuffer.makeStringAndClear());
}
ExportShape(aItr->xShape, &aPoint);
@@ -3267,7 +3155,7 @@ void ScXMLExport::WriteTableShapes()
if (pTableShapes && !(*pTableShapes)[nCurrentTable].empty())
{
DBG_ASSERT(pTableShapes->size() > static_cast<size_t>(nCurrentTable), "wrong Table");
- SvXMLElementExport aShapesElem(*this, XML_NAMESPACE_TABLE, XML_SHAPES, sal_True, sal_False);
+ SvXMLElementExport aShapesElem(*this, XML_NAMESPACE_TABLE, XML_SHAPES, sal_True, false);
ScMyTableXShapes::iterator aItr((*pTableShapes)[nCurrentTable].begin());
ScMyTableXShapes::iterator aEndItr((*pTableShapes)[nCurrentTable].end());
while (aItr != aEndItr)
@@ -3324,7 +3212,7 @@ void ScXMLExport::exportAnnotationMeta( const uno::Reference < drawing::XShape >
{
SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC,
XML_CREATOR, sal_True,
- sal_False );
+ false );
Characters(sAuthor);
}
@@ -3340,14 +3228,14 @@ void ScXMLExport::exportAnnotationMeta( const uno::Reference < drawing::XShape >
GetMM100UnitConverter().convertDateTime(sBuf, fDate,sal_True);
SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC,
XML_DATE, sal_True,
- sal_False );
+ false );
Characters(sBuf.makeStringAndClear());
}
else
{
SvXMLElementExport aDateElem( *this, XML_NAMESPACE_META,
XML_DATE_STRING, sal_True,
- sal_False );
+ false );
Characters(rtl::OUString(aDate));
}
}
@@ -3355,7 +3243,7 @@ void ScXMLExport::exportAnnotationMeta( const uno::Reference < drawing::XShape >
{
SvXMLElementExport aDateElem( *this, XML_NAMESPACE_META,
XML_DATE_STRING, sal_True,
- sal_False );
+ false );
Characters(rtl::OUString(aDate));
}
}
@@ -3365,46 +3253,6 @@ void ScXMLExport::WriteAnnotation(ScMyCell& rMyCell)
{
if( rMyCell.bHasAnnotation && rMyCell.xAnnotation.is())
{
-/* rtl::OUString sAuthor(rMyCell.xAnnotation->getAuthor());
- if (sAuthor.getLength())
- {
- SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC,
- XML_CREATOR, sal_True,
- sal_False );
- rtl::OUString sAuthor(sAuthor);
- Characters(sAuthor);
- }
-
- String aDate(rMyCell.xAnnotation->getDate());
- if (pDoc)
- {
- SvNumberFormatter* pNumForm(pDoc->GetFormatTable());
- double fDate;
- sal_uInt32 nfIndex = pNumForm->GetFormatIndex(NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM);
- if (pNumForm->IsNumberFormat(aDate, nfIndex, fDate))
- {
- rtl::OUStringBuffer sBuf;
- GetMM100UnitConverter().convertDateTime(sBuf, fDate);
- SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC,
- XML_DATE, sal_True,
- sal_False );
- Characters(sBuf.makeStringAndClear());
- }
- else
- {
- SvXMLElementExport aDateElem( *this, XML_NAMESPACE_META,
- XML_DATE_STRING, sal_True,
- sal_False );
- Characters(rtl::OUString(aDate));
- }
- }
- else
- {
- SvXMLElementExport aDateElem( *this, XML_NAMESPACE_META,
- XML_DATE_STRING, sal_True,
- sal_False );
- Characters(rtl::OUString(aDate));
- }*/
if (rMyCell.xAnnotation->getIsVisible())
AddAttribute(XML_NAMESPACE_OFFICE, XML_DISPLAY, XML_TRUE);
@@ -3477,7 +3325,7 @@ void ScXMLExport::SetRepeatAttribute (const sal_Int32 nEqualCellCount)
sal_Int32 nTemp(nEqualCellCount + 1);
OUString sOUEqualCellCount(OUString::valueOf(nTemp));
AddAttribute(sAttrColumnsRepeated, sOUEqualCellCount);
- IncrementProgressBar(sal_False, nEqualCellCount);
+ IncrementProgressBar(false, nEqualCellCount);
}
}
@@ -3497,17 +3345,9 @@ sal_Bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddr
if (pBaseCell)
return (pBaseCell->GetCellType() == CELLTYPE_EDIT);
- return sal_False;
+ return false;
}
-//UNUSED2008-05 sal_Bool ScXMLExport::IsEditCell(const com::sun::star::uno::Reference <com::sun::star::table::XCell>& xCell) const
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<sheet::XCellAddressable> xAddressable (xCell, uno::UNO_QUERY);
-//UNUSED2008-05 if ( xAddressable.is() )
-//UNUSED2008-05 return IsEditCell(xAddressable->getCellAddress());
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 }
-
sal_Bool ScXMLExport::IsEditCell(ScMyCell& rCell) const
{
if (rCell.bKnowWhetherIsEditCell)
@@ -3544,51 +3384,13 @@ sal_Bool ScXMLExport::IsMultiLineFormulaCell(ScMyCell& rCell) const
return static_cast<ScFormulaCell*>(rCell.pBaseCell)->IsMultilineResult();
}
-//UNUSED2008-05 sal_Bool ScXMLExport::IsAnnotationEqual(const uno::Reference<table::XCell>& /* xCell1 */,
-//UNUSED2008-05 const uno::Reference<table::XCell>& /* xCell2 */)
-//UNUSED2008-05 {
-//UNUSED2008-05 // no longer compareable, because the position and size and other attributes can also differ
-//UNUSED2008-05
-//UNUSED2008-05 /* uno::Reference<sheet::XSheetAnnotationAnchor> xSheetAnnotationAnchor1(xCell1, uno::UNO_QUERY);
-//UNUSED2008-05 uno::Reference<sheet::XSheetAnnotationAnchor> xSheetAnnotationAnchor2(xCell2, uno::UNO_QUERY);
-//UNUSED2008-05 if (xSheetAnnotationAnchor1.is() && xSheetAnnotationAnchor2.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference <sheet::XSheetAnnotation> xSheetAnnotation1(xSheetAnnotationAnchor1->getAnnotation());
-//UNUSED2008-05 uno::Reference <sheet::XSheetAnnotation> xSheetAnnotation2(xSheetAnnotationAnchor2->getAnnotation());
-//UNUSED2008-05 uno::Reference<text::XSimpleText> xSimpleText1(xSheetAnnotation1, uno::UNO_QUERY);
-//UNUSED2008-05 uno::Reference<text::XSimpleText> xSimpleText2(xSheetAnnotation2, uno::UNO_QUERY);
-//UNUSED2008-05 if (xSheetAnnotation1.is() && xSimpleText1.is() &&
-//UNUSED2008-05 xSheetAnnotation2.is() && xSimpleText2.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 rtl::OUString sText1(xSimpleText1->getString());
-//UNUSED2008-05 rtl::OUString sText2(xSimpleText2->getString());
-//UNUSED2008-05 sal_Int32 nLength1(sText1.getLength());
-//UNUSED2008-05 sal_Int32 nLength2(sText2.getLength());
-//UNUSED2008-05 if (nLength1 && nLength2)
-//UNUSED2008-05 if (sText1 == sText2 &&
-//UNUSED2008-05 xSheetAnnotation1->getAuthor() == xSheetAnnotation2->getAuthor() &&
-//UNUSED2008-05 xSheetAnnotation1->getDate() == xSheetAnnotation2->getDate() &&
-//UNUSED2008-05 xSheetAnnotation1->getIsVisible() == xSheetAnnotation2->getIsVisible())
-//UNUSED2008-05 return sal_True;
-//UNUSED2008-05 else
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 else
-//UNUSED2008-05 if (nLength1 || nLength2)
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 else
-//UNUSED2008-05 return sal_True;
-//UNUSED2008-05 }
-//UNUSED2008-05 }*/
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 }
-
sal_Bool ScXMLExport::IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2)
{
ScAddress aCellPos1;
ScUnoConversion::FillScAddress( aCellPos1, aCell1.aCellAddress );
ScAddress aCellPos2;
ScUnoConversion::FillScAddress( aCellPos2, aCell2.aCellAddress );
- sal_Bool bIsEqual = sal_False;
+ sal_Bool bIsEqual = false;
if( !aCell1.bIsMergedBase && !aCell2.bIsMergedBase &&
aCell1.bIsCovered == aCell2.bIsCovered &&
!aCell1.bIsMatrixBase && !aCell2.bIsMatrixBase &&
@@ -3604,7 +3406,7 @@ sal_Bool ScXMLExport::IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2)
aCell1.aAreaLink.Compare( aCell2.aAreaLink ) ) ||
!aCell1.bHasAreaLink )
{
- if (!aCell1.bHasAnnotation || (aCell1.bHasAnnotation && sal_False/*IsAnnotationEqual(aCell1.xCell, aCell2.xCell)*/)) // no longer compareable
+ if (!aCell1.bHasAnnotation || (aCell1.bHasAnnotation && false/*IsAnnotationEqual(aCell1.xCell, aCell2.xCell)*/)) // no longer compareable
{
if ((((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.bIsAutoStyle == aCell2.bIsAutoStyle)) ||
((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.nStyleIndex == -1))) &&
@@ -3639,7 +3441,7 @@ sal_Bool ScXMLExport::IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2)
case table::CellContentType_TEXT :
{
if (IsEditCell(aCell1) || IsEditCell(aCell2))
- bIsEqual = sal_False;
+ bIsEqual = false;
else
{
if (GetCellText(aCell1, aCellPos1) && GetCellText(aCell2, aCellPos2))
@@ -3648,18 +3450,18 @@ sal_Bool ScXMLExport::IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2)
(lcl_GetRawString(pDoc, aCellPos1) == lcl_GetRawString(pDoc, aCellPos2));
}
else
- bIsEqual = sal_False;
+ bIsEqual = false;
}
}
break;
case table::CellContentType_FORMULA :
{
- bIsEqual = sal_False;
+ bIsEqual = false;
}
break;
default :
{
- bIsEqual = sal_False;
+ bIsEqual = false;
}
break;
}
@@ -3757,7 +3559,7 @@ void ScXMLExport::WriteTableSource()
sal_Int32 nCount(xIndex->getCount());
if (nCount)
{
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
uno::Reference <beans::XPropertySet> xLinkProps;
for (sal_Int32 i = 0; (i < nCount) && !bFound; ++i)
{
@@ -3858,7 +3660,7 @@ void ScXMLExport::WriteTheLabelRanges( const uno::Reference< sheet::XSpreadsheet
{
SvXMLElementExport aElem( *this, XML_NAMESPACE_TABLE, XML_LABEL_RANGES, sal_True, sal_True );
WriteLabelRanges( xColRangesIAccess, sal_True );
- WriteLabelRanges( xRowRangesIAccess, sal_False );
+ WriteLabelRanges( xRowRangesIAccess, false );
}
}
@@ -3918,13 +3720,10 @@ void ScXMLExport::WriteNamedExpressions(const com::sun::star::uno::Reference <co
OUString sOUBaseCellAddress;
ScRangeStringConverter::GetStringFromAddress( sOUBaseCellAddress,
- xNamedRange->getReferencePosition(), pDoc, FormulaGrammar::CONV_OOO, ' ', sal_False, SCA_ABS_3D );
+ xNamedRange->getReferencePosition(), pDoc, FormulaGrammar::CONV_OOO, ' ', false, SCA_ABS_3D );
AddAttribute(XML_NAMESPACE_TABLE, XML_BASE_CELL_ADDRESS, sOUBaseCellAddress);
- sal_uInt16 nRangeIndex;
- String sName(sOUName);
- pNamedRanges->SearchName(sName, nRangeIndex);
- ScRangeData* pNamedRange((*pNamedRanges)[nRangeIndex]); //should get directly and not with ScDocument
+ const ScRangeData* pNamedRange = pNamedRanges->findByName(sOUName);
String sContent;
pNamedRange->GetSymbol(sContent, pDoc->GetStorageGrammar());
rtl::OUString sOUTempContent(sContent);
@@ -3988,12 +3787,12 @@ void ScXMLExport::WriteExternalRefCaches()
if (!pUrl)
continue;
- vector<String> aTabNames;
+ vector<OUString> aTabNames;
pRefMgr->getAllCachedTableNames(nFileId, aTabNames);
if (aTabNames.empty())
continue;
- for (vector<String>::const_iterator itr = aTabNames.begin(), itrEnd = aTabNames.end();
+ for (vector<OUString>::const_iterator itr = aTabNames.begin(), itrEnd = aTabNames.end();
itr != itrEnd; ++itr)
{
ScExternalRefCache::TableTypeRef pTable = pRefMgr->getCacheTable(nFileId, *itr, false);
@@ -4172,7 +3971,7 @@ void ScXMLExport::WriteExternalRefCaches()
}
}
SvXMLElementExport aElemCell(*this, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True);
- SvXMLElementExport aElemText(*this, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemText(*this, XML_NAMESPACE_TEXT, XML_P, sal_True, false);
Characters(aStrVal);
nLastCol = nCol;
@@ -4487,7 +4286,7 @@ sal_uInt32 ScXMLExport::exportDoc( enum XMLTokenEnum eClass )
void SAL_CALL ScXMLExport::setSourceDocument( const uno::Reference<lang::XComponent>& xComponent )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SvXMLExport::setSourceDocument( xComponent );
pDoc = ScXMLConverter::GetScDocument( GetModel() );
@@ -4517,21 +4316,21 @@ void SAL_CALL ScXMLExport::setSourceDocument( const uno::Reference<lang::XCompon
sal_Bool SAL_CALL ScXMLExport::filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDoc)
pDoc->DisableIdle(sal_True);
sal_Bool bReturn(SvXMLExport::filter(aDescriptor));
if (pDoc)
- pDoc->DisableIdle(sal_False);
+ pDoc->DisableIdle(false);
return bReturn;
}
void SAL_CALL ScXMLExport::cancel()
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDoc)
- pDoc->DisableIdle(sal_False);
+ pDoc->DisableIdle(false);
SvXMLExport::cancel();
}
@@ -4539,7 +4338,7 @@ void SAL_CALL ScXMLExport::cancel()
void SAL_CALL ScXMLExport::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SvXMLExport::initialize(aArguments);
}
@@ -4547,7 +4346,7 @@ void SAL_CALL ScXMLExport::initialize( const ::com::sun::star::uno::Sequence< ::
::rtl::OUString SAL_CALL ScXMLExport::getImplementationName( )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nFlags = getExportFlags();
if (nFlags & EXPORT_OASIS)
@@ -4595,14 +4394,14 @@ void SAL_CALL ScXMLExport::initialize( const ::com::sun::star::uno::Sequence< ::
sal_Bool SAL_CALL ScXMLExport::supportsService( const ::rtl::OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return SvXMLExport::supportsService( ServiceName );
}
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL ScXMLExport::getSupportedServiceNames( )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return SvXMLExport::getSupportedServiceNames();
}
@@ -4610,7 +4409,7 @@ sal_Bool SAL_CALL ScXMLExport::supportsService( const ::rtl::OUString& ServiceNa
sal_Int64 SAL_CALL ScXMLExport::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return SvXMLExport::getSomething(aIdentifier);
}
@@ -4621,3 +4420,4 @@ void ScXMLExport::DisposingModel()
xCurrentTable = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index e024fc6a0de0..f18fa026d5d1 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@ namespace com { namespace sun { namespace star {
namespace beans { class XPropertySet; }
} } }
-#include <hash_map>
+#include <boost/unordered_map.hpp>
class ScOutlineArray;
class SvXMLExportPropertyMapper;
@@ -64,6 +65,7 @@ class ScChartListener;
class SfxItemPool;
class ScAddress;
class ScBaseCell;
+class ScXMLCachedRowAttrAccess;
typedef std::vector< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > > ScMyXShapesVec;
@@ -86,7 +88,7 @@ class ScXMLExport : public SvXMLExport
UniReference < SvXMLExportPropertyMapper > xRowStylesExportPropertySetMapper;
UniReference < SvXMLExportPropertyMapper > xTableStylesExportPropertySetMapper;
XMLNumberFormatAttributesExportHelper* pNumberFormatAttributesExportHelper;
- typedef ::std::hash_map<sal_Int32, sal_Int32> NumberFormatIndexMap;
+ typedef ::boost::unordered_map<sal_Int32, sal_Int32> NumberFormatIndexMap;
NumberFormatIndexMap aNumFmtIndexMap;
ScMySharedData* pSharedData;
ScColumnStyles* pColumnStyles;
@@ -159,13 +161,14 @@ class ScXMLExport : public SvXMLExport
void ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32 nStartRow,
const sal_Int32 nEndCol, const sal_Int32 nEndRow, const sal_Int32 nSheet);
void WriteRowContent();
- void WriteRowStartTag(sal_Int32 nRow, const sal_Int32 nIndex, const sal_Int8 nFlag, const sal_Int32 nEmptyRows);
+ void WriteRowStartTag(sal_Int32 nRow, const sal_Int32 nIndex, const sal_Int32 nEmptyRows, bool bHidden, bool bFiltered);
void OpenHeaderRows();
void CloseHeaderRows();
- void OpenNewRow(const sal_Int32 nIndex, const sal_Int8 nFlag, const sal_Int32 nStartRow, const sal_Int32 nEmptyRows);
- void OpenAndCloseRow(const sal_Int32 nIndex, const sal_Int8 nFlag,
- const sal_Int32 nStartRow, const sal_Int32 nEmptyRows);
- void OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, const sal_Int32 nRepeatRow);
+ void OpenNewRow(const sal_Int32 nIndex, const sal_Int32 nStartRow, const sal_Int32 nEmptyRows,
+ bool bHidden, bool bFiltered);
+ void OpenAndCloseRow(const sal_Int32 nIndex, const sal_Int32 nStartRow, const sal_Int32 nEmptyRows,
+ bool bHidden, bool bFiltered);
+ void OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, const sal_Int32 nRepeatRow, ScXMLCachedRowAttrAccess& rRowAttr);
void CloseRow(const sal_Int32 nRow);
void GetColumnRowHeader(sal_Bool& bHasColumnHeader, com::sun::star::table::CellRangeAddress& aColumnHeaderRange,
sal_Bool& bHasRowHeader, com::sun::star::table::CellRangeAddress& aRowHeaderRange,
@@ -173,10 +176,6 @@ class ScXMLExport : public SvXMLExport
void FillFieldGroup(ScOutlineArray* pFields, ScMyOpenCloseColumnRowGroup* pGroups);
void FillColumnRowGroups();
-//UNUSED2008-05 sal_Bool GetMerge (const com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheet>& xTable,
-//UNUSED2008-05 sal_Int32 nCol, sal_Int32 nRow,
-//UNUSED2008-05 com::sun::star::table::CellRangeAddress& aCellAddress);
-
sal_Bool GetMerged (const com::sun::star::table::CellRangeAddress* pCellRange,
const com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheet>& xTable);
@@ -193,11 +192,8 @@ class ScXMLExport : public SvXMLExport
sal_Bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) const;
sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell = NULL) const;
-//UNUSED2008-05 sal_Bool IsEditCell(const com::sun::star::uno::Reference <com::sun::star::table::XCell>& xCell) const;
sal_Bool IsEditCell(ScMyCell& rCell) const;
sal_Bool IsMultiLineFormulaCell(ScMyCell& rCell) const;
-//UNUSED2008-05 sal_Bool IsAnnotationEqual(const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell1,
-//UNUSED2008-05 const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell2);
sal_Bool IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2);
void WriteCalculationSettings(const com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheetDocument>& xSpreadDoc);
@@ -242,10 +238,6 @@ public:
static sal_Int16 GetFieldUnit();
inline ScDocument* GetDocument() { return pDoc; }
inline const ScDocument* GetDocument() const { return pDoc; }
-//UNUSED2008-05 sal_Bool IsMatrix (const com::sun::star::uno::Reference <com::sun::star::table::XCellRange>& xCellRange,
-//UNUSED2008-05 const com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheet>& xTable,
-//UNUSED2008-05 const sal_Int32 nCol, const sal_Int32 nRow,
-//UNUSED2008-05 com::sun::star::table::CellRangeAddress& aCellAddress, sal_Bool& bIsFirst) const;
sal_Bool IsMatrix (const ScAddress& aCell,
com::sun::star::table::CellRangeAddress& aCellAddress, sal_Bool& bIsFirst) const;
@@ -291,3 +283,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx
index fb33b5e9a450..1e2277465c2a 100644
--- a/sc/source/filter/xml/xmlexternaltabi.cxx
+++ b/sc/source/filter/xml/xmlexternaltabi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -435,3 +436,5 @@ void ScXMLExternalRefCellTextContext::EndElement()
{
mrParent.SetCellString(maCellStrBuf.makeStringAndClear());
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlexternaltabi.hxx b/sc/source/filter/xml/xmlexternaltabi.hxx
index 8382e681c439..1d3d1c836fe7 100644
--- a/sc/source/filter/xml/xmlexternaltabi.hxx
+++ b/sc/source/filter/xml/xmlexternaltabi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -174,3 +175,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx
index 760a21a8c106..c350916ad898 100644
--- a/sc/source/filter/xml/xmlfilti.cxx
+++ b/sc/source/filter/xml/xmlfilti.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,12 +57,12 @@ ScXMLFilterContext::ScXMLFilterContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
pDatabaseRangeContext(pTempDatabaseRangeContext),
aFilterFields(),
- bSkipDuplicates(sal_False),
- bCopyOutputData(sal_False),
- bUseRegularExpressions(sal_False),
+ bSkipDuplicates(false),
+ bCopyOutputData(false),
+ bUseRegularExpressions(false),
bConnectionOr(sal_True),
bNextConnectionOr(sal_True),
- bConditionSourceRange(sal_False)
+ bConditionSourceRange(false)
{
ScDocument* pDoc(GetScImport().GetDocument());
@@ -158,7 +159,7 @@ void ScXMLFilterContext::EndElement()
pDatabaseRangeContext->SetFilterCopyOutputData(bCopyOutputData);
}
else
- pDatabaseRangeContext->SetFilterCopyOutputData(sal_False);
+ pDatabaseRangeContext->SetFilterCopyOutputData(false);
pDatabaseRangeContext->SetFilterIsCaseSensitive(bIsCaseSensitive);
pDatabaseRangeContext->SetFilterSkipDuplicates(bSkipDuplicates);
pDatabaseRangeContext->SetFilterFields(aFilterFields);
@@ -175,7 +176,7 @@ ScXMLAndContext::ScXMLAndContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
pFilterContext(pTempFilterContext)
{
- pFilterContext->OpenConnection(sal_False);
+ pFilterContext->OpenConnection(false);
}
ScXMLAndContext::~ScXMLAndContext()
@@ -275,7 +276,7 @@ ScXMLConditionContext::ScXMLConditionContext( ScXMLImport& rImport,
ScXMLFilterContext* pTempFilterContext) :
SvXMLImportContext( rImport, nPrfx, rLName ),
pFilterContext(pTempFilterContext),
- bIsCaseSensitive(sal_False)
+ bIsCaseSensitive(false)
{
sDataType = GetXMLToken(XML_TEXT);
@@ -334,7 +335,7 @@ SvXMLImportContext *ScXMLConditionContext::CreateChildContext( sal_uInt16 nPrefi
void ScXMLConditionContext::getOperatorXML(const rtl::OUString sTempOperator, sal_Int32& aFilterOperator, sal_Bool& bUseRegularExpressions) const
{
- bUseRegularExpressions = sal_False;
+ bUseRegularExpressions = false;
if (IsXMLToken(sTempOperator, XML_MATCH))
{
bUseRegularExpressions = sal_True;
@@ -403,7 +404,7 @@ void ScXMLConditionContext::EndElement()
else
{
aFilterField.StringValue = sConditionValue;
- aFilterField.IsNumeric = sal_False;
+ aFilterField.IsNumeric = false;
}
pFilterContext->AddFilterField(aFilterField);
}
@@ -420,12 +421,12 @@ ScXMLDPFilterContext::ScXMLDPFilterContext( ScXMLImport& rImport,
pDataPilotTable(pTempDataPilotTableContext),
aFilterFields(),
nFilterFieldCount(0),
- bSkipDuplicates(sal_False),
- bCopyOutputData(sal_False),
- bUseRegularExpressions(sal_False),
+ bSkipDuplicates(false),
+ bCopyOutputData(false),
+ bUseRegularExpressions(false),
bConnectionOr(sal_True),
bNextConnectionOr(sal_True),
- bConditionSourceRange(sal_False)
+ bConditionSourceRange(false)
{
ScDocument* pDoc(GetScImport().GetDocument());
@@ -525,7 +526,7 @@ void ScXMLDPFilterContext::EndElement()
pDataPilotTable->SetFilterCopyOutputData(bCopyOutputData);
}
else
- pDataPilotTable->SetFilterCopyOutputData(sal_False);
+ pDataPilotTable->SetFilterCopyOutputData(false);
// pDataPilotTable->SetFilterIsCaseSensitive(bIsCaseSensitive);
// pDataPilotTable->SetFilterSkipDuplicates(bSkipDuplicates);
pDataPilotTable->SetSourceQueryParam(aFilterFields);
@@ -551,7 +552,7 @@ ScXMLDPAndContext::ScXMLDPAndContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName )
{
pFilterContext = pTempFilterContext;
- pFilterContext->OpenConnection(sal_False);
+ pFilterContext->OpenConnection(false);
}
ScXMLDPAndContext::~ScXMLDPAndContext()
@@ -652,7 +653,7 @@ ScXMLDPConditionContext::ScXMLDPConditionContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
pFilterContext(pTempFilterContext),
sDataType(GetXMLToken(XML_TEXT)),
- bIsCaseSensitive(sal_False)
+ bIsCaseSensitive(false)
{
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
@@ -711,7 +712,7 @@ SvXMLImportContext *ScXMLDPConditionContext::CreateChildContext( sal_uInt16 nPre
void ScXMLDPConditionContext::getOperatorXML(const rtl::OUString sTempOperator, ScQueryOp& aFilterOperator, sal_Bool& bUseRegularExpressions,
double& dVal) const
{
- bUseRegularExpressions = sal_False;
+ bUseRegularExpressions = false;
if (IsXMLToken(sTempOperator, XML_MATCH))
{
bUseRegularExpressions = sal_True;
@@ -765,7 +766,7 @@ void ScXMLDPConditionContext::EndElement()
{
aFilterField.nVal = sConditionValue.toDouble();
*aFilterField.pStr = sConditionValue;
- aFilterField.bQueryByString = sal_False;
+ aFilterField.bQueryByString = false;
if (dVal != 0.0)
{
aFilterField.nVal = dVal;
@@ -783,3 +784,4 @@ void ScXMLDPConditionContext::EndElement()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlfilti.hxx b/sc/source/filter/xml/xmlfilti.hxx
index f00b7b00cfdf..4d0495ba341f 100644
--- a/sc/source/filter/xml/xmlfilti.hxx
+++ b/sc/source/filter/xml/xmlfilti.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -308,3 +309,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx
index 50fe06e9629c..388952a75701 100644
--- a/sc/source/filter/xml/xmlfonte.cxx
+++ b/sc/source/filter/xml/xmlfonte.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,7 +100,7 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(
const SfxItemPool* pItemPool(rExportP.GetDocument() ? rExportP.GetDocument()->GetPool() : NULL);
AddFontItems(aWhichIds, 3, pItemPool, sal_True);
const SfxItemPool* pEditPool(rExportP.GetDocument()->GetEditPool());
- AddFontItems(aEditWhichIds, 3, pEditPool, sal_False);
+ AddFontItems(aEditWhichIds, 3, pEditPool, false);
SfxStyleSheetIterator* pItr(rExportP.GetDocument() ? rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SFX_STYLE_FAMILY_PAGE, 0xFFFF) : NULL);
if(pItr)
@@ -123,19 +124,19 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(
if (pLeftArea)
{
aEditEngine.SetText(*pLeftArea);
- AddFontItems(aEditWhichIds, 3, pPageEditPool, sal_False);
+ AddFontItems(aEditWhichIds, 3, pPageEditPool, false);
}
const EditTextObject* pCenterArea(pPageItem->GetCenterArea());
if (pCenterArea)
{
aEditEngine.SetText(*pCenterArea);
- AddFontItems(aEditWhichIds, 3, pPageEditPool, sal_False);
+ AddFontItems(aEditWhichIds, 3, pPageEditPool, false);
}
const EditTextObject* pRightArea(pPageItem->GetRightArea());
if (pRightArea)
{
aEditEngine.SetText(*pRightArea);
- AddFontItems(aEditWhichIds, 3, pPageEditPool, sal_False);
+ AddFontItems(aEditWhichIds, 3, pPageEditPool, false);
}
}
}
@@ -150,3 +151,5 @@ XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool()
{
return new ScXMLFontAutoStylePool_Impl( *this );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index d840c39f5939..929b4acd83a0 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,7 @@
// INCLUDE ---------------------------------------------------------------
#include <svl/zforlist.hxx>
+#include <sal/macros.h>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlnmspe.hxx>
@@ -58,7 +60,6 @@
#include "nameuno.hxx"
#include "xmlbodyi.hxx"
#include "xmlstyli.hxx"
-#include "unoguard.hxx"
#include "ViewSettingsSequenceDefines.hxx"
#include "patattr.hxx"
@@ -92,6 +93,7 @@
#include <com/sun/star/sheet/XNamedRange.hpp>
#include <com/sun/star/sheet/XLabelRanges.hpp>
#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#define SC_LOCALE "Locale"
#define SC_STANDARDFORMAT "StandardFormat"
@@ -105,7 +107,10 @@
using namespace com::sun::star;
using namespace ::xmloff::token;
using namespace ::formula;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::UNO_QUERY;
using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
OUString SAL_CALL ScXMLImport_getImplementationName() throw()
{
@@ -204,7 +209,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLImport_Settings_createInstance(
const SvXMLTokenMap& ScXMLImport::GetTableRowCellAttrTokenMap()
{
- static __FAR_DATA SvXMLTokenMapEntry aTableRowCellAttrTokenMap[] =
+ static SvXMLTokenMapEntry aTableRowCellAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_STYLE_NAME, XML_TOK_TABLE_ROW_CELL_ATTR_STYLE_NAME },
{ XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME, XML_TOK_TABLE_ROW_CELL_ATTR_CONTENT_VALIDATION_NAME },
@@ -384,7 +389,7 @@ SvXMLImportContext *ScXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPrefix
break;
case XML_TOK_DOC_STYLES:
if (GetScImport().getImportFlags() & IMPORT_STYLES)
- pContext = GetScImport().CreateStylesContext( rLocalName, xAttrList, sal_False);
+ pContext = GetScImport().CreateStylesContext( rLocalName, xAttrList, false);
break;
case XML_TOK_DOC_AUTOSTYLES:
if (GetScImport().getImportFlags() & IMPORT_AUTOSTYLES)
@@ -423,7 +428,7 @@ const SvXMLTokenMap& ScXMLImport::GetDocElemTokenMap()
{
if( !pDocElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDocTokenMap[] =
+ static SvXMLTokenMapEntry aDocTokenMap[] =
{
{ XML_NAMESPACE_OFFICE, XML_FONT_FACE_DECLS, XML_TOK_DOC_FONTDECLS },
{ XML_NAMESPACE_OFFICE, XML_STYLES, XML_TOK_DOC_STYLES },
@@ -448,7 +453,7 @@ const SvXMLTokenMap& ScXMLImport::GetBodyElemTokenMap()
{
if( !pBodyElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aBodyTokenMap[] =
+ static SvXMLTokenMapEntry aBodyTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TRACKED_CHANGES, XML_TOK_BODY_TRACKED_CHANGES },
{ XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, XML_TOK_BODY_CALCULATION_SETTINGS },
@@ -474,7 +479,7 @@ const SvXMLTokenMap& ScXMLImport::GetContentValidationsElemTokenMap()
{
if( !pContentValidationsElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aContentValidationsElemTokenMap[] =
+ static SvXMLTokenMapEntry aContentValidationsElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION, XML_TOK_CONTENT_VALIDATION },
XML_TOKEN_MAP_END
@@ -490,7 +495,7 @@ const SvXMLTokenMap& ScXMLImport::GetContentValidationElemTokenMap()
{
if( !pContentValidationElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aContentValidationElemTokenMap[] =
+ static SvXMLTokenMapEntry aContentValidationElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_HELP_MESSAGE, XML_TOK_CONTENT_VALIDATION_ELEM_HELP_MESSAGE },
{ XML_NAMESPACE_TABLE, XML_ERROR_MESSAGE, XML_TOK_CONTENT_VALIDATION_ELEM_ERROR_MESSAGE },
@@ -509,7 +514,7 @@ const SvXMLTokenMap& ScXMLImport::GetContentValidationAttrTokenMap()
{
if( !pContentValidationAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aContentValidationAttrTokenMap[] =
+ static SvXMLTokenMapEntry aContentValidationAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_CONTENT_VALIDATION_NAME },
{ XML_NAMESPACE_TABLE, XML_CONDITION, XML_TOK_CONTENT_VALIDATION_CONDITION },
@@ -529,7 +534,7 @@ const SvXMLTokenMap& ScXMLImport::GetContentValidationMessageElemTokenMap()
{
if( !pContentValidationMessageElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aContentValidationMessageElemTokenMap[] =
+ static SvXMLTokenMapEntry aContentValidationMessageElemTokenMap[] =
{
{ XML_NAMESPACE_TEXT, XML_P, XML_TOK_P },
XML_TOKEN_MAP_END
@@ -545,7 +550,7 @@ const SvXMLTokenMap& ScXMLImport::GetContentValidationHelpMessageAttrTokenMap()
{
if( !pContentValidationHelpMessageAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aContentValidationHelpMessageAttrTokenMap[] =
+ static SvXMLTokenMapEntry aContentValidationHelpMessageAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TITLE, XML_TOK_HELP_MESSAGE_ATTR_TITLE },
{ XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_HELP_MESSAGE_ATTR_DISPLAY },
@@ -562,7 +567,7 @@ const SvXMLTokenMap& ScXMLImport::GetContentValidationErrorMessageAttrTokenMap()
{
if( !pContentValidationErrorMessageAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aContentValidationErrorMessageAttrTokenMap[] =
+ static SvXMLTokenMapEntry aContentValidationErrorMessageAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TITLE, XML_TOK_ERROR_MESSAGE_ATTR_TITLE },
{ XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_ERROR_MESSAGE_ATTR_DISPLAY },
@@ -580,7 +585,7 @@ const SvXMLTokenMap& ScXMLImport::GetContentValidationErrorMacroAttrTokenMap()
{
if( !pContentValidationErrorMacroAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aContentValidationErrorMacroAttrTokenMap[] =
+ static SvXMLTokenMapEntry aContentValidationErrorMacroAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_ERROR_MACRO_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_EXECUTE, XML_TOK_ERROR_MACRO_ATTR_EXECUTE },
@@ -597,7 +602,7 @@ const SvXMLTokenMap& ScXMLImport::GetLabelRangesElemTokenMap()
{
if( !pLabelRangesElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aLabelRangesElemTokenMap[] =
+ static SvXMLTokenMapEntry aLabelRangesElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_LABEL_RANGE, XML_TOK_LABEL_RANGE_ELEM },
XML_TOKEN_MAP_END
@@ -613,7 +618,7 @@ const SvXMLTokenMap& ScXMLImport::GetLabelRangeAttrTokenMap()
{
if( !pLabelRangeAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aLabelRangeAttrTokenMap[] =
+ static SvXMLTokenMapEntry aLabelRangeAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_LABEL_CELL_RANGE_ADDRESS, XML_TOK_LABEL_RANGE_ATTR_LABEL_RANGE },
{ XML_NAMESPACE_TABLE, XML_DATA_CELL_RANGE_ADDRESS, XML_TOK_LABEL_RANGE_ATTR_DATA_RANGE },
@@ -631,12 +636,13 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap()
{
if( !pTableElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableTokenMap[] =
+ static SvXMLTokenMapEntry aTableTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMN_GROUP, XML_TOK_TABLE_COL_GROUP },
{ XML_NAMESPACE_TABLE, XML_TABLE_HEADER_COLUMNS, XML_TOK_TABLE_HEADER_COLS },
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, XML_TOK_TABLE_COLS },
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, XML_TOK_TABLE_COL },
+ { XML_NAMESPACE_TABLE, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION },
{ XML_NAMESPACE_TABLE, XML_TABLE_ROW_GROUP, XML_TOK_TABLE_ROW_GROUP },
{ XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, XML_TOK_TABLE_HEADER_ROWS },
{ XML_NAMESPACE_TABLE, XML_TABLE_ROWS, XML_TOK_TABLE_ROWS },
@@ -656,11 +662,27 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap()
return *pTableElemTokenMap;
}
+const SvXMLTokenMap& ScXMLImport::GetTableProtectionAttrTokenMap()
+{
+ if (!pTableProtectionElemTokenMap)
+ {
+ static SvXMLTokenMapEntry aTableProtectionTokenMap[] =
+ {
+ { XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS },
+ { XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS },
+ XML_TOKEN_MAP_END
+ };
+ pTableProtectionElemTokenMap = new SvXMLTokenMap(aTableProtectionTokenMap);
+ }
+
+ return *pTableProtectionElemTokenMap;
+}
+
const SvXMLTokenMap& ScXMLImport::GetTableRowsElemTokenMap()
{
if( !pTableRowsElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableRowsElemTokenMap[] =
+ static SvXMLTokenMapEntry aTableRowsElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TABLE_ROW_GROUP, XML_TOK_TABLE_ROWS_ROW_GROUP },
{ XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, XML_TOK_TABLE_ROWS_HEADER_ROWS },
@@ -679,7 +701,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableColsElemTokenMap()
{
if( !pTableColsElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableColsElemTokenMap[] =
+ static SvXMLTokenMapEntry aTableColsElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMN_GROUP, XML_TOK_TABLE_COLS_COL_GROUP },
{ XML_NAMESPACE_TABLE, XML_TABLE_HEADER_COLUMNS, XML_TOK_TABLE_COLS_HEADER_COLS },
@@ -698,13 +720,15 @@ const SvXMLTokenMap& ScXMLImport::GetTableAttrTokenMap()
{
if( !pTableAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableAttrTokenMap[] =
+ static SvXMLTokenMapEntry aTableAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_TABLE_NAME },
{ XML_NAMESPACE_TABLE, XML_STYLE_NAME, XML_TOK_TABLE_STYLE_NAME },
- { XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TOK_TABLE_PROTECTION },
+ { XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TOK_TABLE_PROTECTED },
{ XML_NAMESPACE_TABLE, XML_PRINT_RANGES, XML_TOK_TABLE_PRINT_RANGES },
{ XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, XML_TOK_TABLE_PASSWORD },
+ { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, XML_TOK_TABLE_PASSHASH },
+ { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, XML_TOK_TABLE_PASSHASH_2 },
{ XML_NAMESPACE_TABLE, XML_PRINT, XML_TOK_TABLE_PRINT },
XML_TOKEN_MAP_END
};
@@ -719,7 +743,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableScenarioAttrTokenMap()
{
if( !pTableScenarioAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableScenarioAttrTokenMap[] =
+ static SvXMLTokenMapEntry aTableScenarioAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DISPLAY_BORDER, XML_TOK_TABLE_SCENARIO_ATTR_DISPLAY_BORDER },
{ XML_NAMESPACE_TABLE, XML_BORDER_COLOR, XML_TOK_TABLE_SCENARIO_ATTR_BORDER_COLOR },
@@ -743,7 +767,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableColAttrTokenMap()
{
if( !pTableColAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableColAttrTokenMap[] =
+ static SvXMLTokenMapEntry aTableColAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_STYLE_NAME, XML_TOK_TABLE_COL_ATTR_STYLE_NAME },
{ XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, XML_TOK_TABLE_COL_ATTR_REPEATED },
@@ -762,7 +786,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableRowElemTokenMap()
{
if( !pTableRowElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableRowTokenMap[] =
+ static SvXMLTokenMapEntry aTableRowTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TABLE_CELL, XML_TOK_TABLE_ROW_CELL },
{ XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, XML_TOK_TABLE_ROW_COVERED_CELL },
@@ -779,7 +803,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableRowAttrTokenMap()
{
if( !pTableRowAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableRowAttrTokenMap[] =
+ static SvXMLTokenMapEntry aTableRowAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_STYLE_NAME, XML_TOK_TABLE_ROW_ATTR_STYLE_NAME },
{ XML_NAMESPACE_TABLE, XML_VISIBILITY, XML_TOK_TABLE_ROW_ATTR_VISIBILITY },
@@ -799,7 +823,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableRowCellElemTokenMap()
{
if( !pTableRowCellElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableRowCellTokenMap[] =
+ static SvXMLTokenMapEntry aTableRowCellTokenMap[] =
{
{ XML_NAMESPACE_TEXT, XML_P, XML_TOK_TABLE_ROW_CELL_P },
{ XML_NAMESPACE_TABLE, XML_SUB_TABLE, XML_TOK_TABLE_ROW_CELL_TABLE },
@@ -819,7 +843,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableAnnotationAttrTokenMap()
{
if( !pTableAnnotationAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableAnnotationAttrTokenMap[] =
+ static SvXMLTokenMapEntry aTableAnnotationAttrTokenMap[] =
{
{ XML_NAMESPACE_OFFICE, XML_AUTHOR, XML_TOK_TABLE_ANNOTATION_ATTR_AUTHOR },
{ XML_NAMESPACE_OFFICE, XML_CREATE_DATE, XML_TOK_TABLE_ANNOTATION_ATTR_CREATE_DATE },
@@ -840,7 +864,7 @@ const SvXMLTokenMap& ScXMLImport::GetDetectiveElemTokenMap()
{
if( !pDetectiveElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDetectiveElemTokenMap[]=
+ static SvXMLTokenMapEntry aDetectiveElemTokenMap[]=
{
{ XML_NAMESPACE_TABLE, XML_HIGHLIGHTED_RANGE, XML_TOK_DETECTIVE_ELEM_HIGHLIGHTED },
{ XML_NAMESPACE_TABLE, XML_OPERATION, XML_TOK_DETECTIVE_ELEM_OPERATION },
@@ -857,7 +881,7 @@ const SvXMLTokenMap& ScXMLImport::GetDetectiveHighlightedAttrTokenMap()
{
if( !pDetectiveHighlightedAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDetectiveHighlightedAttrTokenMap[]=
+ static SvXMLTokenMapEntry aDetectiveHighlightedAttrTokenMap[]=
{
{ XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_CELL_RANGE },
{ XML_NAMESPACE_TABLE, XML_DIRECTION, XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_DIRECTION },
@@ -876,7 +900,7 @@ const SvXMLTokenMap& ScXMLImport::GetDetectiveOperationAttrTokenMap()
{
if( !pDetectiveOperationAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDetectiveOperationAttrTokenMap[]=
+ static SvXMLTokenMapEntry aDetectiveOperationAttrTokenMap[]=
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DETECTIVE_OPERATION_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_INDEX, XML_TOK_DETECTIVE_OPERATION_ATTR_INDEX },
@@ -893,7 +917,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableCellRangeSourceAttrTokenMap()
{
if( !pTableCellRangeSourceAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aTableCellRangeSourceAttrTokenMap[] =
+ static SvXMLTokenMapEntry aTableCellRangeSourceAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_NAME },
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_HREF },
@@ -915,7 +939,7 @@ const SvXMLTokenMap& ScXMLImport::GetNamedExpressionsElemTokenMap()
{
if( !pNamedExpressionsElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aNamedExpressionsTokenMap[] =
+ static SvXMLTokenMapEntry aNamedExpressionsTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAMED_RANGE, XML_TOK_NAMED_EXPRESSIONS_NAMED_RANGE },
{ XML_NAMESPACE_TABLE, XML_NAMED_EXPRESSION, XML_TOK_NAMED_EXPRESSIONS_NAMED_EXPRESSION },
@@ -932,7 +956,7 @@ const SvXMLTokenMap& ScXMLImport::GetNamedRangeAttrTokenMap()
{
if( !pNamedRangeAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aNamedRangeAttrTokenMap[] =
+ static SvXMLTokenMapEntry aNamedRangeAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_NAMED_RANGE_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, XML_TOK_NAMED_RANGE_ATTR_CELL_RANGE_ADDRESS },
@@ -951,7 +975,7 @@ const SvXMLTokenMap& ScXMLImport::GetNamedExpressionAttrTokenMap()
{
if( !pNamedExpressionAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aNamedExpressionAttrTokenMap[] =
+ static SvXMLTokenMapEntry aNamedExpressionAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_NAMED_EXPRESSION_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_BASE_CELL_ADDRESS, XML_TOK_NAMED_EXPRESSION_ATTR_BASE_CELL_ADDRESS },
@@ -969,7 +993,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangesElemTokenMap()
{
if( !pDatabaseRangesElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangesTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangesTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATABASE_RANGE, XML_TOK_DATABASE_RANGE },
XML_TOKEN_MAP_END
@@ -985,7 +1009,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangeElemTokenMap()
{
if( !pDatabaseRangeElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangeTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangeTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, XML_TOK_DATABASE_RANGE_SOURCE_SQL },
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, XML_TOK_DATABASE_RANGE_SOURCE_TABLE },
@@ -1006,7 +1030,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangeAttrTokenMap()
{
if( !pDatabaseRangeAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangeAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangeAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DATABASE_RANGE_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_IS_SELECTION, XML_TOK_DATABASE_RANGE_ATTR_IS_SELECTION },
@@ -1031,7 +1055,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangeSourceSQLAttrTokenMap()
{
if( !pDatabaseRangeSourceSQLAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangeSourceSQLAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangeSourceSQLAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATABASE_NAME, XML_TOK_SOURCE_SQL_ATTR_DATABASE_NAME },
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_SOURCE_SQL_ATTR_HREF },
@@ -1051,7 +1075,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangeSourceTableAttrTokenMap()
{
if( !pDatabaseRangeSourceTableAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangeSourceTableAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangeSourceTableAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATABASE_NAME, XML_TOK_SOURCE_TABLE_ATTR_DATABASE_NAME },
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_SOURCE_TABLE_ATTR_HREF },
@@ -1070,7 +1094,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangeSourceQueryAttrTokenMap()
{
if( !pDatabaseRangeSourceQueryAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangeSourceQueryAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangeSourceQueryAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATABASE_NAME, XML_TOK_SOURCE_QUERY_ATTR_DATABASE_NAME },
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_SOURCE_QUERY_ATTR_HREF },
@@ -1089,7 +1113,7 @@ const SvXMLTokenMap& ScXMLImport::GetFilterElemTokenMap()
{
if( !pFilterElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aFilterTokenMap[] =
+ static SvXMLTokenMapEntry aFilterTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_FILTER_AND, XML_TOK_FILTER_AND },
{ XML_NAMESPACE_TABLE, XML_FILTER_OR, XML_TOK_FILTER_OR },
@@ -1107,7 +1131,7 @@ const SvXMLTokenMap& ScXMLImport::GetFilterAttrTokenMap()
{
if( !pFilterAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aFilterAttrTokenMap[] =
+ static SvXMLTokenMapEntry aFilterAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, XML_TOK_FILTER_ATTR_TARGET_RANGE_ADDRESS },
{ XML_NAMESPACE_TABLE, XML_CONDITION_SOURCE_RANGE_ADDRESS, XML_TOK_FILTER_ATTR_CONDITION_SOURCE_RANGE_ADDRESS },
@@ -1126,7 +1150,7 @@ const SvXMLTokenMap& ScXMLImport::GetFilterConditionAttrTokenMap()
{
if( !pFilterConditionAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aFilterConditionAttrTokenMap[] =
+ static SvXMLTokenMapEntry aFilterConditionAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_FIELD_NUMBER, XML_TOK_CONDITION_ATTR_FIELD_NUMBER },
{ XML_NAMESPACE_TABLE, XML_CASE_SENSITIVE, XML_TOK_CONDITION_ATTR_CASE_SENSITIVE },
@@ -1146,7 +1170,7 @@ const SvXMLTokenMap& ScXMLImport::GetSortElemTokenMap()
{
if( !pSortElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aSortTokenMap[] =
+ static SvXMLTokenMapEntry aSortTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_SORT_BY, XML_TOK_SORT_SORT_BY },
XML_TOKEN_MAP_END
@@ -1162,7 +1186,7 @@ const SvXMLTokenMap& ScXMLImport::GetSortAttrTokenMap()
{
if( !pSortAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aSortAttrTokenMap[] =
+ static SvXMLTokenMapEntry aSortAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_BIND_STYLES_TO_CONTENT, XML_TOK_SORT_ATTR_BIND_STYLES_TO_CONTENT },
{ XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, XML_TOK_SORT_ATTR_TARGET_RANGE_ADDRESS },
@@ -1183,7 +1207,7 @@ const SvXMLTokenMap& ScXMLImport::GetSortSortByAttrTokenMap()
{
if( !pSortSortByAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aSortSortByAttrTokenMap[] =
+ static SvXMLTokenMapEntry aSortSortByAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_FIELD_NUMBER, XML_TOK_SORT_BY_ATTR_FIELD_NUMBER },
{ XML_NAMESPACE_TABLE, XML_DATA_TYPE, XML_TOK_SORT_BY_ATTR_DATA_TYPE },
@@ -1201,7 +1225,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangeSubTotalRulesElemTokenMap()
{
if( !pDatabaseRangeSubTotalRulesElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangeSubTotalRulesTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangeSubTotalRulesTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_SORT_GROUPS, XML_TOK_SUBTOTAL_RULES_SORT_GROUPS },
{ XML_NAMESPACE_TABLE, XML_SUBTOTAL_RULE, XML_TOK_SUBTOTAL_RULES_SUBTOTAL_RULE },
@@ -1218,7 +1242,7 @@ const SvXMLTokenMap& ScXMLImport::GetDatabaseRangeSubTotalRulesAttrTokenMap()
{
if( !pDatabaseRangeSubTotalRulesAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDatabaseRangeSubTotalRulesAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDatabaseRangeSubTotalRulesAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_BIND_STYLES_TO_CONTENT, XML_TOK_SUBTOTAL_RULES_ATTR_BIND_STYLES_TO_CONTENT },
{ XML_NAMESPACE_TABLE, XML_CASE_SENSITIVE, XML_TOK_SUBTOTAL_RULES_ATTR_CASE_SENSITIVE },
@@ -1236,7 +1260,7 @@ const SvXMLTokenMap& ScXMLImport::GetSubTotalRulesSortGroupsAttrTokenMap()
{
if( !pSubTotalRulesSortGroupsAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aSubTotalRulesSortGroupsAttrTokenMap[] =
+ static SvXMLTokenMapEntry aSubTotalRulesSortGroupsAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATA_TYPE, XML_TOK_SORT_GROUPS_ATTR_DATA_TYPE },
{ XML_NAMESPACE_TABLE, XML_ORDER, XML_TOK_SORT_GROUPS_ATTR_ORDER },
@@ -1253,7 +1277,7 @@ const SvXMLTokenMap& ScXMLImport::GetSubTotalRulesSubTotalRuleElemTokenMap()
{
if( !pSubTotalRulesSubTotalRuleElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aSubTotalRulesSubTotalRuleTokenMap[] =
+ static SvXMLTokenMapEntry aSubTotalRulesSubTotalRuleTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_SUBTOTAL_FIELD, XML_TOK_SUBTOTAL_RULE_SUBTOTAL_FIELD },
XML_TOKEN_MAP_END
@@ -1269,7 +1293,7 @@ const SvXMLTokenMap& ScXMLImport::GetSubTotalRulesSubTotalRuleAttrTokenMap()
{
if( !pSubTotalRulesSubTotalRuleAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aSubTotalRulesSubTotalRuleAttrTokenMap[] =
+ static SvXMLTokenMapEntry aSubTotalRulesSubTotalRuleAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_GROUP_BY_FIELD_NUMBER, XML_TOK_SUBTOTAL_RULE_ATTR_GROUP_BY_FIELD_NUMBER },
XML_TOKEN_MAP_END
@@ -1285,7 +1309,7 @@ const SvXMLTokenMap& ScXMLImport::GetSubTotalRuleSubTotalFieldAttrTokenMap()
{
if( !pSubTotalRuleSubTotalFieldAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aSubTotalRuleSubTotalFieldAttrTokenMap[] =
+ static SvXMLTokenMapEntry aSubTotalRuleSubTotalFieldAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_FIELD_NUMBER, XML_TOK_SUBTOTAL_FIELD_ATTR_FIELD_NUMBER },
{ XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_SUBTOTAL_FIELD_ATTR_FUNCTION },
@@ -1302,7 +1326,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTablesElemTokenMap()
{
if( !pDataPilotTablesElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotTablesElemTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotTablesElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, XML_TOK_DATA_PILOT_TABLE },
XML_TOKEN_MAP_END
@@ -1318,7 +1342,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableAttrTokenMap()
{
if( !pDataPilotTableAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotTableAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotTableAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DATA_PILOT_TABLE_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_APPLICATION_DATA, XML_TOK_DATA_PILOT_TABLE_ATTR_APPLICATION_DATA },
@@ -1329,6 +1353,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableAttrTokenMap()
{ XML_NAMESPACE_TABLE, XML_BUTTONS, XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS },
{ XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON },
{ XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN },
+ { XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT },
XML_TOKEN_MAP_END
};
@@ -1342,7 +1367,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableElemTokenMap()
{
if( !pDataPilotTableElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotTableElemTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotTableElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL },
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE },
@@ -1364,7 +1389,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceServiceAttrTokenMap()
{
if( !pDataPilotTableSourceServiceAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotTableSourceServiceAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotTableSourceServiceAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_SOURCE_SERVICE_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_SOURCE_NAME, XML_TOK_SOURCE_SERVICE_ATTR_SOURCE_NAME },
@@ -1384,7 +1409,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotGrandTotalAttrTokenMap()
{
if (!pDataPilotGrandTotalAttrTokenMap)
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotGrandTotalAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotGrandTotalAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY },
{ XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION },
@@ -1403,9 +1428,10 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceCellRangeAttrTokenMap()
{
if( !pDataPilotTableSourceCellRangeAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotTableSourceCellRangeAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotTableSourceCellRangeAttrTokenMap[] =
{
- { XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS},
+ { XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS },
+ { XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_SOURCE_CELL_RANGE_ATTR_NAME },
XML_TOKEN_MAP_END
};
@@ -1419,7 +1445,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceCellRangeElemTokenMap()
{
if( !pDataPilotTableSourceCellRangeElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotTableSourceCellRangeElemTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotTableSourceCellRangeElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_FILTER, XML_TOK_SOURCE_CELL_RANGE_ELEM_FILTER},
XML_TOKEN_MAP_END
@@ -1435,7 +1461,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotFieldAttrTokenMap()
{
if( !pDataPilotFieldAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotFieldAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotFieldAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME },
{ XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME },
@@ -1458,7 +1484,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotFieldElemTokenMap()
{
if( !pDataPilotFieldElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotFieldElemTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotFieldElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_LEVEL, XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_LEVEL },
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_FIELD_REFERENCE, XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_REFERENCE },
@@ -1476,7 +1502,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotLevelAttrTokenMap()
{
if( !pDataPilotLevelAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotLevelAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotLevelAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, XML_TOK_DATA_PILOT_LEVEL_ATTR_SHOW_EMPTY },
XML_TOKEN_MAP_END
@@ -1492,7 +1518,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotLevelElemTokenMap()
{
if( !pDataPilotLevelElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotLevelElemTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotLevelElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTALS, XML_TOK_DATA_PILOT_LEVEL_ELEM_DATA_PILOT_SUBTOTALS },
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_MEMBERS, XML_TOK_DATA_PILOT_LEVEL_ELEM_DATA_PILOT_MEMBERS },
@@ -1512,7 +1538,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotSubTotalsElemTokenMap()
{
if( !pDataPilotSubTotalsElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotSubTotalsElemTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotSubTotalsElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTAL, XML_TOK_DATA_PILOT_SUBTOTALS_ELEM_DATA_PILOT_SUBTOTAL },
XML_TOKEN_MAP_END
@@ -1528,7 +1554,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotSubTotalAttrTokenMap()
{
if( !pDataPilotSubTotalAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotSubTotalAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotSubTotalAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION },
{ XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME },
@@ -1546,7 +1572,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotMembersElemTokenMap()
{
if( !pDataPilotMembersElemTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotMembersElemTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotMembersElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_MEMBER, XML_TOK_DATA_PILOT_MEMBERS_ELEM_DATA_PILOT_MEMBER },
XML_TOKEN_MAP_END
@@ -1562,7 +1588,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotMemberAttrTokenMap()
{
if( !pDataPilotMemberAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aDataPilotMemberAttrTokenMap[] =
+ static SvXMLTokenMapEntry aDataPilotMemberAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME },
{ XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME },
@@ -1582,7 +1608,7 @@ const SvXMLTokenMap& ScXMLImport::GetConsolidationAttrTokenMap()
{
if( !pConsolidationAttrTokenMap )
{
- static __FAR_DATA SvXMLTokenMapEntry aConsolidationAttrTokenMap[] =
+ static SvXMLTokenMapEntry aConsolidationAttrTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_CONSOLIDATION_ATTR_FUNCTION },
{ XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE_ADDRESSES, XML_TOK_CONSOLIDATION_ATTR_SOURCE_RANGES },
@@ -1617,8 +1643,8 @@ SvXMLImportContext *ScXMLImport::CreateContext( sal_uInt16 nPrefix,
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
( IsXMLToken(rLocalName, XML_DOCUMENT)) ) {
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
- mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
- "com.sun.star.xml.dom.SAXDocumentBuilder")),
+ mxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.xml.dom.SAXDocumentBuilder"))),
uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY_THROW);
@@ -1663,6 +1689,7 @@ ScXMLImport::ScXMLImport(
pLabelRangesElemTokenMap( 0 ),
pLabelRangeAttrTokenMap( 0 ),
pTableElemTokenMap( 0 ),
+ pTableProtectionElemTokenMap(NULL),
pTableRowsElemTokenMap( 0 ),
pTableColsElemTokenMap( 0 ),
pTableScenarioAttrTokenMap( 0 ),
@@ -1719,7 +1746,7 @@ ScXMLImport::ScXMLImport(
pMyLabelRanges(NULL),
pValidations(NULL),
pDetectiveOpArray(NULL),
- pScUnoGuard(NULL),
+ pSolarMutexGuard(NULL),
pNumberFormatAttributesExportHelper(NULL),
pStyleNumberFormats(NULL),
sPrevStyleName(),
@@ -1729,11 +1756,11 @@ ScXMLImport::ScXMLImport(
nStyleFamilyMask( 0 ),
nPrevCellType(0),
bLoadDoc( sal_True ),
- bRemoveLastChar(sal_False),
- bNullDateSetted(sal_False),
- bSelfImportingXMLSet(sal_False),
- bLatinDefaultStyle(sal_False),
- bFromWrapper(sal_False)
+ bRemoveLastChar(false),
+ bNullDateSetted(false),
+ bSelfImportingXMLSet(false),
+ bLatinDefaultStyle(false),
+ bFromWrapper(false)
{
pStylesImportHelper = new ScMyStylesImportHelper(*this);
@@ -1760,7 +1787,7 @@ ScXMLImport::ScXMLImport(
{ XML_CURRENCY, util::NumberFormat::CURRENCY },
{ XML_BOOLEAN, util::NumberFormat::LOGICAL }
};
- size_t n = sizeof(aCellTypePairs)/sizeof(aCellTypePairs[0]);
+ size_t n = SAL_N_ELEMENTS(aCellTypePairs);
for (size_t i = 0; i < n; ++i)
{
aCellTypeMap.insert(
@@ -1787,6 +1814,7 @@ ScXMLImport::~ScXMLImport() throw()
delete pLabelRangesElemTokenMap;
delete pLabelRangeAttrTokenMap;
delete pTableElemTokenMap;
+ delete pTableProtectionElemTokenMap;
delete pTableRowsElemTokenMap;
delete pTableColsElemTokenMap;
delete pTableAttrTokenMap;
@@ -1849,8 +1877,8 @@ ScXMLImport::~ScXMLImport() throw()
if (pStylesImportHelper)
delete pStylesImportHelper;
- if (pScUnoGuard)
- delete pScUnoGuard;
+ if (pSolarMutexGuard)
+ delete pSolarMutexGuard;
if (pMyNamedExpressions)
delete pMyNamedExpressions;
@@ -1867,55 +1895,43 @@ ScXMLImport::~ScXMLImport() throw()
SvXMLImportContext *ScXMLImport::CreateFontDeclsContext(const sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
const uno::Reference<xml::sax::XAttributeList>& xAttrList)
{
- SvXMLImportContext *pContext = NULL;
- if (!pContext)
- {
- XMLFontStylesContext *pFSContext(
- new XMLFontStylesContext( *this, nPrefix,
- rLocalName, xAttrList,
- gsl_getSystemTextEncoding() ));
- SetFontDecls( pFSContext );
- pContext = pFSContext;
- }
+ XMLFontStylesContext *pFSContext = new XMLFontStylesContext(
+ *this, nPrefix, rLocalName, xAttrList, gsl_getSystemTextEncoding());
+ SetFontDecls(pFSContext);
+ SvXMLImportContext* pContext = pFSContext;
return pContext;
}
SvXMLImportContext *ScXMLImport::CreateStylesContext(const ::rtl::OUString& rLocalName,
const uno::Reference<xml::sax::XAttributeList>& xAttrList, sal_Bool bIsAutoStyle )
{
- SvXMLImportContext *pContext(NULL);
- if (!pContext)
- {
- pContext = new XMLTableStylesContext(*this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, bIsAutoStyle);
- if (bIsAutoStyle)
- //xAutoStyles = pContext;
- SetAutoStyles((SvXMLStylesContext*)pContext);
- else
- //xStyles = pContext;
- SetStyles((SvXMLStylesContext*)pContext);
- }
+ SvXMLImportContext* pContext = new XMLTableStylesContext(
+ *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, bIsAutoStyle);
+
+ if (bIsAutoStyle)
+ SetAutoStyles((SvXMLStylesContext*)pContext);
+ else
+ SetStyles((SvXMLStylesContext*)pContext);
+
return pContext;
}
SvXMLImportContext *ScXMLImport::CreateBodyContext(const ::rtl::OUString& rLocalName,
const uno::Reference<xml::sax::XAttributeList>& xAttrList)
{
- //GetShapeImport()->SetAutoStylesContext((XMLTableStylesContext *)&xAutoStyles);
- //GetChartImport()->SetAutoStylesContext(GetAutoStyles()/*(XMLTableStylesContext *)&xAutoStyles*/);
-
return new ScXMLBodyContext(*this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList);
}
SvXMLImportContext *ScXMLImport::CreateMetaContext(
const OUString& rLocalName )
{
- SvXMLImportContext *pContext(0);
+ SvXMLImportContext* pContext = NULL;
if( !IsStylesOnlyMode() && (getImportFlags() & IMPORT_META))
{
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
- mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
- "com.sun.star.xml.dom.SAXDocumentBuilder")),
+ mxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.xml.dom.SAXDocumentBuilder"))),
uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY_THROW);
@@ -1934,7 +1950,7 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
SvXMLImportContext *ScXMLImport::CreateScriptContext(
const OUString& rLocalName )
{
- SvXMLImportContext *pContext(0);
+ SvXMLImportContext* pContext = NULL;
if( !(IsStylesOnlyMode()) )
{
@@ -1966,7 +1982,7 @@ void ScXMLImport::SetStatistics(
if (i_rStats[i].Value >>= val) {
nCount += val;
} else {
- DBG_ERROR("ScXMLImport::SetStatistics: invalid entry");
+ OSL_FAIL("ScXMLImport::SetStatistics: invalid entry");
}
}
}
@@ -1990,24 +2006,21 @@ sal_Int16 ScXMLImport::GetCellType(const OUString& rStrValue) const
XMLShapeImportHelper* ScXMLImport::CreateShapeImport()
{
- /*UniReference < XMLPropertySetMapper > xShapeStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScShapeStylesProperties, xScPropHdlFactory);
- SvXMLImportPropertyMapper *pShapeStylesImportPropertySetMapper = new SvXMLImportPropertyMapper( xShapeStylesPropertySetMapper );*/
-
- return new XMLTableShapeImportHelper( *this/*, pShapeStylesImportPropertySetMapper*/ );
+ return new XMLTableShapeImportHelper(*this);
}
sal_Bool ScXMLImport::GetValidation(const rtl::OUString& sName, ScMyImportValidation& aValidation)
{
if (pValidations)
{
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
ScMyImportValidations::iterator aItr(pValidations->begin());
ScMyImportValidations::iterator aEndItr(pValidations->end());
while(aItr != aEndItr && !bFound)
{
if (aItr->sName == sName)
{
- // #b4974740# source position must be set as string,
+ // source position must be set as string,
// so sBaseCellAddress no longer has to be converted here
bFound = sal_True;
@@ -2019,7 +2032,7 @@ sal_Bool ScXMLImport::GetValidation(const rtl::OUString& sName, ScMyImportValida
aValidation = *aItr;
return bFound;
}
- return sal_False;
+ return false;
}
ScXMLChangeTrackingImportHelper* ScXMLImport::GetChangeTrackingImportHelper()
@@ -2082,7 +2095,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque
sal_Int32 nCount(rChangeProps.getLength());
if (nCount)
{
- LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(*this);
sal_Int16 nTemp16(0);
ScChangeViewSettings* pViewSettings(new ScChangeViewSettings());
for (sal_Int32 i = 0; i < nCount; ++i)
@@ -2158,7 +2171,6 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque
}
}
pDoc->SetChangeViewSettings(*pViewSettings);
- UnlockSolarMutex();
}
}
}
@@ -2281,18 +2293,19 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, const rtl::OUStri
lang::Locale aLocale;
if (GetDocument() && (xProperties->getPropertyValue(sLocale) >>= aLocale))
{
- LockSolarMutex();
- LocaleDataWrapper aLocaleData( GetDocument()->GetServiceManager(), aLocale );
- rtl::OUStringBuffer aBuffer(15);
- aBuffer.appendAscii("#");
- aBuffer.append( aLocaleData.getNumThousandSep() );
- aBuffer.appendAscii("##0");
- aBuffer.append( aLocaleData.getNumDecimalSep() );
- aBuffer.appendAscii("00 [$");
- aBuffer.append(rCurrency);
- aBuffer.appendAscii("]");
- UnlockSolarMutex();
- sFormatString = aBuffer.makeStringAndClear();
+ {
+ ScXMLImport::MutexGuard aGuard(*this);
+ LocaleDataWrapper aLocaleData( GetDocument()->GetServiceManager(), aLocale );
+ rtl::OUStringBuffer aBuffer(15);
+ aBuffer.appendAscii("#");
+ aBuffer.append( aLocaleData.getNumThousandSep() );
+ aBuffer.appendAscii("##0");
+ aBuffer.append( aLocaleData.getNumDecimalSep() );
+ aBuffer.appendAscii("00 [$");
+ aBuffer.append(rCurrency);
+ aBuffer.appendAscii("]");
+ sFormatString = aBuffer.makeStringAndClear();
+ }
sal_Int32 nNewKey = xLocalNumberFormats->queryKey(sFormatString, aLocale, sal_True);
if (nNewKey == -1)
nNewKey = xLocalNumberFormats->addNew(sFormatString, aLocale);
@@ -2352,11 +2365,11 @@ sal_Bool ScXMLImport::IsCurrencySymbol(const sal_Int32 nNumberFormat, const rtl:
}
catch ( uno::Exception& )
{
- DBG_ERROR("Numberformat not found");
+ OSL_FAIL("Numberformat not found");
}
}
}
- return sal_False;
+ return false;
}
void ScXMLImport::SetType(uno::Reference <beans::XPropertySet>& rProperties,
@@ -2416,7 +2429,7 @@ void ScXMLImport::SetType(uno::Reference <beans::XPropertySet>& rProperties,
}
catch ( uno::Exception& )
{
- DBG_ERROR("Numberformat not found");
+ OSL_FAIL("Numberformat not found");
}
}
}
@@ -2439,7 +2452,7 @@ void ScXMLImport::AddStyleRange(const table::CellRangeAddress& rCellRange)
DBG_ASSERT(xSheetCellRanges.is(), "didn't get SheetCellRanges");
}
- xSheetCellRanges->addRangeAddress(rCellRange, sal_False);
+ xSheetCellRanges->addRangeAddress(rCellRange, false);
}
void ScXMLImport::SetStyleToRanges()
@@ -2566,7 +2579,7 @@ void ScXMLImport::SetStylesToRangesFinished()
void SAL_CALL ScXMLImport::setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(*this);
SvXMLImport::setTargetDocument( xDoc );
uno::Reference<frame::XModel> xModel(xDoc, uno::UNO_QUERY);
@@ -2580,7 +2593,6 @@ throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::R
uno::Reference<document::XActionLockable> xActionLockable(xDoc, uno::UNO_QUERY);
if (xActionLockable.is())
xActionLockable->addActionLock();
- UnlockSolarMutex();
}
// XServiceInfo
@@ -2610,7 +2622,7 @@ throw(::com::sun::star::uno::RuntimeException)
void SAL_CALL ScXMLImport::startDocument(void)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException )
{
- LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(*this);
SvXMLImport::startDocument();
if (pDoc && !pDoc->IsImportingXML())
{
@@ -2634,8 +2646,6 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE
pSheetData->StoreInitialNamespaces(rNamespaces);
}
}
-
- UnlockSolarMutex();
}
sal_Int32 ScXMLImport::GetRangeType(const rtl::OUString sRangeType) const
@@ -2707,96 +2717,143 @@ void ScXMLImport::SetLabelRanges()
}
}
+namespace {
+
+/**
+ * Used to switch off document modify and broadcast while populating named
+ * ranges during import.
+ */
+class NamedRangesSwitch
+{
+public:
+ NamedRangesSwitch(Reference<beans::XPropertySet>& xPropSet) :
+ mxPropSet(xPropSet), maPropName(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_MODIFY_BROADCAST))
+ {
+ uno::Any any;
+ any <<= false;
+ mxPropSet->setPropertyValue(maPropName, any);
+ }
+
+ ~NamedRangesSwitch()
+ {
+ uno::Any any;
+ any <<= sal_True;
+ mxPropSet->setPropertyValue(maPropName, any);
+ }
+
+private:
+ Reference<beans::XPropertySet>& mxPropSet;
+ OUString maPropName;
+};
+
+}
+
void ScXMLImport::SetNamedRanges()
{
- ScMyNamedExpressions* pNamedExpressions(GetNamedExpressions());
- if (pNamedExpressions)
+ ScMyNamedExpressions* pNamedExpressions = GetNamedExpressions();
+ if (!pNamedExpressions)
+ return;
+
+ Reference <beans::XPropertySet> xPropertySet (GetModel(), UNO_QUERY);
+ if (!xPropertySet.is())
+ return;
+
+ Reference <sheet::XNamedRanges> xNamedRanges(
+ xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_NAMEDRANGES))), UNO_QUERY);
+
+ if (!xNamedRanges.is())
+ return;
+
+ Reference<beans::XPropertySet> xPropSet(xNamedRanges, UNO_QUERY);
+ if (!xPropSet.is())
+ return;
+
+ // Turn off broadcasting while adding imported range names.
+ NamedRangesSwitch aSwitch(xPropSet);
+
+ ScMyNamedExpressions::iterator aItr(pNamedExpressions->begin());
+ ScMyNamedExpressions::const_iterator aEndItr(pNamedExpressions->end());
+ table::CellAddress aCellAddress;
+ OUString sTempContent(RTL_CONSTASCII_USTRINGPARAM("0"));
+
+ for (; aItr != aEndItr; ++aItr)
{
- uno::Reference <beans::XPropertySet> xPropertySet (GetModel(), uno::UNO_QUERY);
- if (xPropertySet.is())
+ sal_Int32 nOffset = 0;
+ bool bSuccess = ScRangeStringConverter::GetAddressFromString(
+ aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), FormulaGrammar::CONV_OOO, nOffset);
+
+ if (!bSuccess)
+ // Conversion of base cell address failed. Skip this.
+ continue;
+
+ try
+ {
+ xNamedRanges->addNewByName(
+ (*aItr)->sName, sTempContent, aCellAddress, GetRangeType((*aItr)->sRangeType));
+ }
+ catch( uno::RuntimeException& )
{
- uno::Reference <sheet::XNamedRanges> xNamedRanges(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_NAMEDRANGES))), uno::UNO_QUERY);
- if (xNamedRanges.is())
+ OSL_FAIL("here are some Named Ranges with the same name");
+ uno::Reference < container::XIndexAccess > xIndex(xNamedRanges, uno::UNO_QUERY);
+ if (xIndex.is())
{
- ScMyNamedExpressions::iterator aItr(pNamedExpressions->begin());
- ScMyNamedExpressions::const_iterator aEndItr(pNamedExpressions->end());
- table::CellAddress aCellAddress;
- rtl::OUString sTempContent(RTL_CONSTASCII_USTRINGPARAM("0"));
- while (aItr != aEndItr)
+ sal_Int32 nMax = xIndex->getCount();
+ bool bInserted = false;
+ sal_Int32 nCount = 1;
+ OUStringBuffer sName((*aItr)->sName);
+ sName.append(sal_Unicode('_'));
+ while (!bInserted && nCount <= nMax)
{
- sal_Int32 nOffset(0);
- if (ScRangeStringConverter::GetAddressFromString(
- aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), FormulaGrammar::CONV_OOO, nOffset ))
+ OUStringBuffer sTemp(sName);
+ sTemp.append(OUString::valueOf(nCount));
+ try
{
- try
- {
- xNamedRanges->addNewByName((*aItr)->sName, sTempContent, aCellAddress, GetRangeType((*aItr)->sRangeType));
- }
- catch( uno::RuntimeException& )
- {
- DBG_ERROR("here are some Named Ranges with the same name");
- uno::Reference < container::XIndexAccess > xIndex(xNamedRanges, uno::UNO_QUERY);
- if (xIndex.is())
- {
- sal_Int32 nMax(xIndex->getCount());
- sal_Bool bInserted(sal_False);
- sal_Int32 nCount(1);
- rtl::OUStringBuffer sName((*aItr)->sName);
- sName.append(sal_Unicode('_'));
- while (!bInserted && nCount <= nMax)
- {
- rtl::OUStringBuffer sTemp(sName);
- sTemp.append(rtl::OUString::valueOf(nCount));
- try
- {
- xNamedRanges->addNewByName(sTemp.makeStringAndClear(), sTempContent, aCellAddress, GetRangeType((*aItr)->sRangeType));
- bInserted = sal_True;
- }
- catch( uno::RuntimeException& )
- {
- ++nCount;
- }
- }
- }
- }
+ xNamedRanges->addNewByName(
+ sTemp.makeStringAndClear(), sTempContent, aCellAddress,
+ GetRangeType((*aItr)->sRangeType));
+ bInserted = true;
}
- ++aItr;
- }
- aItr = pNamedExpressions->begin();
- while (aItr != aEndItr)
- {
- sal_Int32 nOffset(0);
- if (ScRangeStringConverter::GetAddressFromString(
- aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), FormulaGrammar::CONV_OOO, nOffset ))
+ catch( uno::RuntimeException& )
{
- uno::Reference <sheet::XNamedRange> xNamedRange(xNamedRanges->getByName((*aItr)->sName), uno::UNO_QUERY);
- if (xNamedRange.is())
- {
- LockSolarMutex();
- ScNamedRangeObj* pNamedRangeObj = ScNamedRangeObj::getImplementation( xNamedRange);
- if (pNamedRangeObj)
- {
- sTempContent = (*aItr)->sContent;
- // Get rid of leading sheet dots in simple ranges.
- if (!(*aItr)->bIsExpression)
- ScXMLConverter::ParseFormula( sTempContent, false);
- pNamedRangeObj->SetContentWithGrammar( sTempContent, (*aItr)->eGrammar);
- }
- UnlockSolarMutex();
- }
+ ++nCount;
}
- delete *aItr;
- aItr = pNamedExpressions->erase(aItr);
+ }
+ UnlockSolarMutex();
+ }
+ }
+ }
+
+ aItr = pNamedExpressions->begin();
+ while (aItr != aEndItr)
+ {
+ sal_Int32 nOffset(0);
+ if (ScRangeStringConverter::GetAddressFromString(
+ aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), FormulaGrammar::CONV_OOO, nOffset ))
+ {
+ uno::Reference <sheet::XNamedRange> xNamedRange(xNamedRanges->getByName((*aItr)->sName), uno::UNO_QUERY);
+ if (xNamedRange.is())
+ {
+ ScXMLImport::MutexGuard aGuard(*this);
+ ScNamedRangeObj* pNamedRangeObj = ScNamedRangeObj::getImplementation( xNamedRange);
+ if (pNamedRangeObj)
+ {
+ sTempContent = (*aItr)->sContent;
+ // Get rid of leading sheet dots in simple ranges.
+ if (!(*aItr)->bIsExpression)
+ ScXMLConverter::ParseFormula( sTempContent, false);
+ pNamedRangeObj->SetContentWithGrammar( sTempContent, (*aItr)->eGrammar);
}
}
}
+ delete *aItr;
+ aItr = pNamedExpressions->erase(aItr);
}
}
void SAL_CALL ScXMLImport::endDocument(void)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException )
{
- LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(*this);
if (getImportFlags() & IMPORT_CONTENT)
{
if (GetModel().is())
@@ -2852,7 +2909,7 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE
}
aTables.UpdateRowHeights();
- aTables.ResizeShapes();
+ aTables.FixupOLEs();
}
if (GetModel().is())
{
@@ -2866,8 +2923,6 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE
{
ScModelObj::getImplementation(GetModel())->AfterXMLLoading(sal_True);
}
-
- UnlockSolarMutex();
}
// XEventListener
@@ -2877,10 +2932,21 @@ void ScXMLImport::DisposingModel()
pDoc = NULL;
}
+ScXMLImport::MutexGuard::MutexGuard(ScXMLImport& rImport) :
+ mrImport(rImport)
+{
+ mrImport.LockSolarMutex();
+}
+
+ScXMLImport::MutexGuard::~MutexGuard()
+{
+ mrImport.UnlockSolarMutex();
+}
+
void ScXMLImport::LockSolarMutex()
{
// #i62677# When called from DocShell/Wrapper, the SolarMutex is already locked,
- // so there's no need to allocate (and later delete) the ScUnoGuard.
+ // so there's no need to allocate (and later delete) the SolarMutexGuard.
if (bFromWrapper)
{
DBG_TESTSOLARMUTEX();
@@ -2889,8 +2955,8 @@ void ScXMLImport::LockSolarMutex()
if (nSolarMutexLocked == 0)
{
- DBG_ASSERT(!pScUnoGuard, "Solar Mutex is locked");
- pScUnoGuard = new ScUnoGuard();
+ DBG_ASSERT(!pSolarMutexGuard, "Solar Mutex is locked");
+ pSolarMutexGuard = new SolarMutexGuard();
}
++nSolarMutexLocked;
}
@@ -2903,9 +2969,9 @@ void ScXMLImport::UnlockSolarMutex()
nSolarMutexLocked--;
if (nSolarMutexLocked == 0)
{
- DBG_ASSERT(pScUnoGuard, "Solar Mutex is always unlocked");
- delete pScUnoGuard;
- pScUnoGuard = NULL;
+ DBG_ASSERT(pSolarMutexGuard, "Solar Mutex is always unlocked");
+ delete pSolarMutexGuard;
+ pSolarMutexGuard = NULL;
}
}
}
@@ -2983,7 +3049,7 @@ void ScXMLImport::ExtractFormulaNamespaceGrammar(
{
// parse the attribute value, extract namespace ID, literal namespace, and formula string
rFormulaNmsp = OUString();
- sal_uInt16 nNsId = GetNamespaceMap()._GetKeyByAttrName( rAttrValue, 0, &rFormula, &rFormulaNmsp, sal_False );
+ sal_uInt16 nNsId = GetNamespaceMap()._GetKeyByAttrName( rAttrValue, 0, &rFormula, &rFormulaNmsp, false );
// check if we have an ODF formula namespace
if( !bRestrictToExternalNmsp ) switch( nNsId )
@@ -3036,3 +3102,4 @@ void ScXMLImport::ExtractFormulaNamespaceGrammar(
reGrammar = eDefaultGrammar;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index d11a5bc0e76a..5198f72c8b36 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@
#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
#include <vector>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
class ScRangeList;
class ScMyStyleNumberFormats;
@@ -169,6 +170,7 @@ enum ScXMLTableTokens
XML_TOK_TABLE_COL,
XML_TOK_TABLE_ROW_GROUP,
XML_TOK_TABLE_HEADER_ROWS,
+ XML_TOK_TABLE_PROTECTION,
XML_TOK_TABLE_ROWS,
XML_TOK_TABLE_ROW,
XML_TOK_TABLE_SOURCE,
@@ -179,6 +181,12 @@ enum ScXMLTableTokens
XML_TOK_TABLE_EVENT_LISTENERS_EXT
};
+enum ScXMLTokenProtectionTokens
+{
+ XML_TOK_TABLE_SELECT_PROTECTED_CELLS,
+ XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS
+};
+
enum ScXMLTableRowsTokens
{
XML_TOK_TABLE_ROWS_ROW_GROUP,
@@ -199,9 +207,11 @@ enum ScXMLTableAttrTokens
{
XML_TOK_TABLE_NAME,
XML_TOK_TABLE_STYLE_NAME,
- XML_TOK_TABLE_PROTECTION,
+ XML_TOK_TABLE_PROTECTED,
XML_TOK_TABLE_PRINT_RANGES,
XML_TOK_TABLE_PASSWORD,
+ XML_TOK_TABLE_PASSHASH,
+ XML_TOK_TABLE_PASSHASH_2,
XML_TOK_TABLE_PRINT
};
@@ -481,7 +491,8 @@ enum ScXMLDataPilotTableAttrTokens
XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS,
XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS,
XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON,
- XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN
+ XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN,
+ XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT
};
enum ScXMLDataPilotTableElemTokens
@@ -519,7 +530,8 @@ enum ScXMLDataPilotTableSourceCellRangeElemTokens
enum ScXMLDataPilotTableSourceCellRangeAttrTokens
{
- XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS
+ XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS,
+ XML_TOK_SOURCE_CELL_RANGE_ATTR_NAME
};
enum ScXMLDataPilotFieldAttrTokens
@@ -599,7 +611,7 @@ class SfxItemSet;
class SvXMLNumFmtHelper;
class XMLShapeImportHelper;
class ScXMLChangeTrackingImportHelper;
-class ScUnoGuard;
+class SolarMutexGuard;
struct tScMyCellRange
{
@@ -641,7 +653,7 @@ struct ScMyImportValidation
rtl::OUString sFormula2;
rtl::OUString sFormulaNmsp1;
rtl::OUString sFormulaNmsp2;
- rtl::OUString sBaseCellAddress; // #b4974740# string is used directly
+ rtl::OUString sBaseCellAddress; // string is used directly
com::sun::star::sheet::ValidationAlertStyle aAlertStyle;
com::sun::star::sheet::ValidationType aValidationType;
com::sun::star::sheet::ConditionOperator aOperator;
@@ -659,7 +671,7 @@ class ScMyStylesImportHelper;
class ScXMLImport: public SvXMLImport
{
- typedef ::std::hash_map< ::rtl::OUString, sal_Int16, ::rtl::OUStringHash > CellTypeMap;
+ typedef ::boost::unordered_map< ::rtl::OUString, sal_Int16, ::rtl::OUStringHash > CellTypeMap;
CellTypeMap aCellTypeMap;
ScDocument* pDoc;
@@ -672,17 +684,12 @@ class ScXMLImport: public SvXMLImport
rtl::OUString sStandardFormat;
rtl::OUString sType;
-// SvXMLAutoStylePoolP *pScAutoStylePool;
UniReference < XMLPropertyHandlerFactory > xScPropHdlFactory;
UniReference < XMLPropertySetMapper > xCellStylesPropertySetMapper;
UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper;
UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper;
UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper;
-// SvXMLImportContextRef xStyles;
-// SvXMLImportContextRef xAutoStyles;
-// SvXMLImportItemMapper *pParaItemMapper;// paragraph item import
-// SvI18NMap *pI18NMap; // name mapping for I18N
SvXMLTokenMap *pDocElemTokenMap;
SvXMLTokenMap *pStylesElemTokenMap;
SvXMLTokenMap *pStylesAttrTokenMap;
@@ -698,6 +705,7 @@ class ScXMLImport: public SvXMLImport
SvXMLTokenMap *pLabelRangesElemTokenMap;
SvXMLTokenMap *pLabelRangeAttrTokenMap;
SvXMLTokenMap *pTableElemTokenMap;
+ SvXMLTokenMap *pTableProtectionElemTokenMap;
SvXMLTokenMap *pTableRowsElemTokenMap;
SvXMLTokenMap *pTableColsElemTokenMap;
SvXMLTokenMap *pTableScenarioAttrTokenMap;
@@ -756,7 +764,7 @@ class ScXMLImport: public SvXMLImport
ScMyLabelRanges* pMyLabelRanges;
ScMyImportValidations* pValidations;
ScMyImpDetectiveOpArray* pDetectiveOpArray;
- ScUnoGuard* pScUnoGuard;
+ SolarMutexGuard* pSolarMutexGuard;
std::vector<rtl::OUString> aTableStyles;
XMLNumberFormatAttributesExportHelper* pNumberFormatAttributesExportHelper;
@@ -810,8 +818,6 @@ public:
const ::rtl::OUString& rLocalName );
SvXMLImportContext *CreateStylesContext(const ::rtl::OUString& rLocalName,
const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList, sal_Bool bAutoStyles );
-// SvXMLImportContext *CreateUseStylesContext(const ::rtl::OUString& rLocalName ,
-// const ::com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList);
SvXMLImportContext *CreateBodyContext(
const ::rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList );
@@ -831,26 +837,12 @@ public:
sal_Int16 GetCellType(const ::rtl::OUString& rStrValue) const;
-// SvI18NMap& GetI18NMap() { return *pI18NMap; }
-
-// inline const SvXMLImportItemMapper& GetParaItemMapper() const;
-// SvXMLImportContext *CreateParaItemImportContext( sal_uInt16 nPrefix,
-// const ::rtl::OUString& rLocalName,
-// const ::com::sun::star::uno::Reference<
-// ::com::sun::star::xml::sax::XAttributeList& xAttrList,
-// SfxItemSet& rItemSet );
-
UniReference < XMLPropertySetMapper > GetCellStylesPropertySetMapper() const { return xCellStylesPropertySetMapper; }
UniReference < XMLPropertySetMapper > GetColumnStylesPropertySetMapper() const { return xColumnStylesPropertySetMapper; }
UniReference < XMLPropertySetMapper > GetRowStylesPropertySetMapper() const { return xRowStylesPropertySetMapper; }
UniReference < XMLPropertySetMapper > GetTableStylesPropertySetMapper() const { return xTableStylesPropertySetMapper; }
-// SvXMLImportContextRef GetAutoStyles() const { return xAutoStyles; }
-// SvXMLImportContextRef GetStyles() const { return xStyles; }
const SvXMLTokenMap& GetDocElemTokenMap();
-//UNUSED2008-05 const SvXMLTokenMap& GetStylesElemTokenMap();
-//UNUSED2008-05 const SvXMLTokenMap& GetStylesAttrTokenMap();
-//UNUSED2008-05 const SvXMLTokenMap& GetStyleElemTokenMap();
const SvXMLTokenMap& GetBodyElemTokenMap();
const SvXMLTokenMap& GetContentValidationsElemTokenMap();
const SvXMLTokenMap& GetContentValidationElemTokenMap();
@@ -862,6 +854,7 @@ public:
const SvXMLTokenMap& GetLabelRangesElemTokenMap();
const SvXMLTokenMap& GetLabelRangeAttrTokenMap();
const SvXMLTokenMap& GetTableElemTokenMap();
+ const SvXMLTokenMap& GetTableProtectionAttrTokenMap();
const SvXMLTokenMap& GetTableRowsElemTokenMap();
const SvXMLTokenMap& GetTableColsElemTokenMap();
const SvXMLTokenMap& GetTableAttrTokenMap();
@@ -913,11 +906,6 @@ public:
const SvXMLTokenMap& GetDataPilotMembersElemTokenMap();
const SvXMLTokenMap& GetDataPilotMemberAttrTokenMap();
const SvXMLTokenMap& GetConsolidationAttrTokenMap();
-// const SvXMLTokenMap& GetTextPElemTokenMap();
-// const SvXMLTokenMap& GetTextPAttrTokenMap();
-// const SvXMLTokenMap& GetStyleStylesElemTokenMap();
-// const SvXMLTokenMap& GetTextListBlockAttrTokenMap();
-// const SvXMLTokenMap& GetTextListBlockElemTokenMap();
void AddNamedExpression(const ScMyNamedExpression* pMyNamedExpression) {
if (!pMyNamedExpressions)
@@ -985,7 +973,6 @@ public:
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::xml::sax::XDocumentHandler
virtual void SAL_CALL startDocument(void)
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL endDocument(void)
@@ -993,6 +980,18 @@ public:
virtual void DisposingModel();
+ /**
+ * Use this class to manage solar mutex locking instead of calling
+ * LockSolarMutex() and UnlockSolarMutex() directly.
+ */
+ class MutexGuard
+ {
+ public:
+ explicit MutexGuard(ScXMLImport& rImport);
+ ~MutexGuard();
+ private:
+ ScXMLImport& mrImport;
+ };
void LockSolarMutex();
void UnlockSolarMutex();
@@ -1046,3 +1045,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmllabri.cxx b/sc/source/filter/xml/xmllabri.cxx
index 6c1c2cb55508..e0aadfc9a384 100644
--- a/sc/source/filter/xml/xmllabri.cxx
+++ b/sc/source/filter/xml/xmllabri.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,7 +91,7 @@ ScXMLLabelRangeContext::ScXMLLabelRangeContext(
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList ) :
SvXMLImportContext( rImport, nPrfx, rLName ),
- bColumnOrientation( sal_False )
+ bColumnOrientation( false )
{
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
const SvXMLTokenMap& rAttrTokenMap(GetScImport().GetLabelRangeAttrTokenMap());
@@ -131,7 +132,7 @@ SvXMLImportContext* ScXMLLabelRangeContext::CreateChildContext(
void ScXMLLabelRangeContext::EndElement()
{
- // #b5071088# Label ranges must be stored as strings until all sheets are loaded
+ // Label ranges must be stored as strings until all sheets are loaded
// (like named expressions).
ScMyLabelRange* pLabelRange = new ScMyLabelRange;
@@ -143,3 +144,4 @@ void ScXMLLabelRangeContext::EndElement()
GetScImport().AddLabelRange(pLabelRange);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmllabri.hxx b/sc/source/filter/xml/xmllabri.hxx
index 9d7bbff1aa18..7e325b93eb3c 100644
--- a/sc/source/filter/xml/xmllabri.hxx
+++ b/sc/source/filter/xml/xmllabri.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -88,3 +89,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlnexpi.cxx b/sc/source/filter/xml/xmlnexpi.cxx
index 13f7e4090a58..d3b2f5ace852 100644
--- a/sc/source/filter/xml/xmlnexpi.cxx
+++ b/sc/source/filter/xml/xmlnexpi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include <rtl/ustrbuf.hxx>
@@ -55,21 +54,6 @@ ScXMLNamedExpressionsContext::ScXMLNamedExpressionsContext( ScXMLImport& rImport
::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ ) :
SvXMLImportContext( rImport, nPrfx, rLName )
{
-/* sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; ++i )
- {
- const rtl::OUString& sAttrName(xAttrList->getNameByIndex( i ));
- rtl::OUString aLocalName;
- sal_uInt16 nPrefix = GetScImport().GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- const rtl::OUString& sValue(xAttrList->getValueByIndex( i ));
-
- const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetNamedRangeAttrTokenMap();
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ) )
- {
- }
- }*/
rImport.LockSolarMutex();
}
@@ -161,7 +145,7 @@ ScXMLNamedRangeContext::ScXMLNamedRangeContext( ScXMLImport& rImport,
break;
}
}
- pNamedExpression->bIsExpression = sal_False;
+ pNamedExpression->bIsExpression = false;
GetScImport().AddNamedExpression(pNamedExpression);
}
@@ -174,10 +158,6 @@ SvXMLImportContext *ScXMLNamedRangeContext::CreateChildContext( sal_uInt16 nPref
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
{
-/* const SvXMLTokenMap& rTokenMap = GetScImport().GetTableElemTokenMap();
- switch( rTokenMap.Get( nPrefix, rLName ) )
- {
- }*/
return new SvXMLImportContext( GetImport(), nPrefix, rLName );
}
@@ -237,10 +217,6 @@ SvXMLImportContext *ScXMLNamedExpressionContext::CreateChildContext( sal_uInt16
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
{
-/* const SvXMLTokenMap& rTokenMap = GetScImport().GetTableElemTokenMap();
- switch( rTokenMap.Get( nPrefix, rLName ) )
- {
- }*/
return new SvXMLImportContext( GetImport(), nPrefix, rLName );;
}
@@ -248,3 +224,4 @@ void ScXMLNamedExpressionContext::EndElement()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlnexpi.hxx b/sc/source/filter/xml/xmlnexpi.hxx
index 251407920bd9..4f0a68e321e1 100644
--- a/sc/source/filter/xml/xmlnexpi.hxx
+++ b/sc/source/filter/xml/xmlnexpi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index cb302f5d5e0e..b36b2f812d46 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,7 +72,7 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
sVisibility(GetXMLToken(XML_VISIBLE)),
nRepeatedRows(1),
- bHasCell(sal_False)
+ bHasCell(false)
{
rtl::OUString sCellStyleName;
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
@@ -136,7 +137,7 @@ SvXMLImportContext *ScXMLTableRowContext::CreateChildContext( sal_uInt16 nPrefix
{
bHasCell = sal_True;
pContext = new ScXMLTableRowCellContext( GetScImport(), nPrefix,
- rLName, xAttrList, sal_False, nRepeatedRows
+ rLName, xAttrList, false, nRepeatedRows
//this
);
}
@@ -171,7 +172,6 @@ void ScXMLTableRowContext::EndElement()
sal_Int32 nSheet = rXMLImport.GetTables().GetCurrentSheet();
sal_Int32 nCurrentRow(rXMLImport.GetTables().GetCurrentRow());
uno::Reference<sheet::XSpreadsheet> xSheet(rXMLImport.GetTables().GetCurrentXSheet());
- ScDocument* pDoc = rXMLImport.GetDocument();
if(xSheet.is())
{
sal_Int32 nFirstRow(nCurrentRow - nRepeatedRows + 1);
@@ -209,28 +209,20 @@ void ScXMLTableRowContext::EndElement()
}
}
sal_Bool bVisible (sal_True);
- sal_Bool bFiltered (sal_False);
+ sal_Bool bFiltered (false);
if (IsXMLToken(sVisibility, XML_COLLAPSE))
{
- bVisible = sal_False;
+ bVisible = false;
}
else if (IsXMLToken(sVisibility, XML_FILTER))
{
- bVisible = sal_False;
+ bVisible = false;
bFiltered = sal_True;
}
-
- // #i116164# call SetRowHidden/SetRowFiltered directly, so the tree doesn't have to be rebuilt
- // to compare with existing hidden flags.
- if (!bVisible && pDoc)
- pDoc->SetRowHidden((SCROW)nFirstRow, (SCROW)nCurrentRow, (SCTAB)nSheet, true);
- if (bFiltered && pDoc)
- pDoc->SetRowFiltered((SCROW)nFirstRow, (SCROW)nCurrentRow, (SCTAB)nSheet, true);
-
- //if (!bVisible)
- // xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)), uno::makeAny(bVisible));
- //if (bFiltered)
- // xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)), uno::makeAny(bFiltered));
+ if (!bVisible)
+ xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)), uno::makeAny(bVisible));
+ if (bFiltered)
+ xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)), uno::makeAny(bFiltered));
}
}
}
@@ -294,17 +286,17 @@ SvXMLImportContext *ScXMLTableRowsContext::CreateChildContext( sal_uInt16 nPrefi
case XML_TOK_TABLE_ROWS_ROW_GROUP:
pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_True );
+ false, sal_True );
break;
case XML_TOK_TABLE_ROWS_HEADER_ROWS:
pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_True, sal_False );
+ sal_True, false );
break;
case XML_TOK_TABLE_ROWS_ROWS:
pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_False );
+ false, false );
break;
case XML_TOK_TABLE_ROWS_ROW:
pContext = new ScXMLTableRowContext( GetScImport(), nPrefix,
@@ -357,13 +349,14 @@ void ScXMLTableRowsContext::EndElement()
ScDocument* pDoc(GetScImport().GetDocument());
if (pDoc)
{
- GetScImport().LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(GetScImport());
ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(static_cast<SCTAB>(nSheet), sal_True));
ScOutlineArray* pRowArray(pOutlineTable->GetRowArray());
sal_Bool bResized;
pRowArray->Insert(static_cast<SCROW>(nGroupStartRow), static_cast<SCROW>(nGroupEndRow), bResized, !bGroupDisplay, sal_True);
- GetScImport().UnlockSolarMutex();
}
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlrowi.hxx b/sc/source/filter/xml/xmlrowi.hxx
index 707ebbea90f8..c41644bcf041 100644
--- a/sc/source/filter/xml/xmlrowi.hxx
+++ b/sc/source/filter/xml/xmlrowi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,3 +92,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlsceni.cxx b/sc/source/filter/xml/xmlsceni.cxx
index 963c567804bc..b20d60bc74f5 100644
--- a/sc/source/filter/xml/xmlsceni.cxx
+++ b/sc/source/filter/xml/xmlsceni.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,8 @@ using namespace com::sun::star;
using namespace xmloff::token;
using ::rtl::OUString;
+using rtl::OUString;
+
//------------------------------------------------------------------
ScXMLTableScenarioContext::ScXMLTableScenarioContext(
@@ -62,8 +65,8 @@ ScXMLTableScenarioContext::ScXMLTableScenarioContext(
bCopyBack( sal_True ),
bCopyStyles( sal_True ),
bCopyFormulas( sal_True ),
- bIsActive( sal_False ),
- bProtected( sal_False )
+ bIsActive( false ),
+ bProtected( false )
{
rImport.LockSolarMutex();
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
@@ -160,9 +163,9 @@ void ScXMLTableScenarioContext::EndElement()
if( bProtected )
nFlags |= SC_SCENARIO_PROTECT;
pDoc->SetScenarioData( nCurrTable, String( sComment ), aBorderColor, nFlags );
- for( sal_Int32 i = 0; i < static_cast<sal_Int32>(aScenarioRanges.Count()); ++i )
+ for( size_t i = 0; i < aScenarioRanges.size(); ++i )
{
- ScRange* pRange(aScenarioRanges.GetObject( i ));
+ ScRange* pRange(aScenarioRanges[ i ]);
if( pRange )
pDoc->ApplyFlagsTab( pRange->aStart.Col(), pRange->aStart.Row(),
pRange->aEnd.Col(), pRange->aEnd.Row(), nCurrTable, SC_MF_SCENARIO );
@@ -171,3 +174,4 @@ void ScXMLTableScenarioContext::EndElement()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlsceni.hxx b/sc/source/filter/xml/xmlsceni.hxx
index 8c9030cbce0b..f6dd8d74b09b 100644
--- a/sc/source/filter/xml/xmlsceni.hxx
+++ b/sc/source/filter/xml/xmlsceni.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlsorti.cxx b/sc/source/filter/xml/xmlsorti.cxx
index 71e4a62e4a4f..0826b58313b1 100644
--- a/sc/source/filter/xml/xmlsorti.cxx
+++ b/sc/source/filter/xml/xmlsorti.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,10 +65,10 @@ ScXMLSortContext::ScXMLSortContext( ScXMLImport& rImport,
sLanguage(),
sAlgorithm(),
nUserListIndex(0),
- bCopyOutputData(sal_False),
+ bCopyOutputData(false),
bBindFormatsToContent(sal_True),
- bIsCaseSensitive(sal_False),
- bEnabledUserList(sal_False)
+ bIsCaseSensitive(false),
+ bEnabledUserList(false)
{
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
const SvXMLTokenMap& rAttrTokenMap(GetScImport().GetSortAttrTokenMap());
@@ -154,19 +155,19 @@ void ScXMLSortContext::EndElement()
if (nAlgoLength)
++i;
uno::Sequence <beans::PropertyValue> aSortDescriptor(7 + i);
- aSortDescriptor[0].Name = rtl::OUString::createFromAscii(SC_UNONAME_BINDFMT);
+ aSortDescriptor[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_BINDFMT));
aSortDescriptor[0].Value = ::cppu::bool2any(bBindFormatsToContent);
- aSortDescriptor[1].Name = rtl::OUString::createFromAscii(SC_UNONAME_COPYOUT);
+ aSortDescriptor[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_COPYOUT));
aSortDescriptor[1].Value = ::cppu::bool2any(bCopyOutputData);
- aSortDescriptor[2].Name = rtl::OUString::createFromAscii(SC_UNONAME_ISCASE);
+ aSortDescriptor[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ISCASE));
aSortDescriptor[2].Value = ::cppu::bool2any(bIsCaseSensitive);
- aSortDescriptor[3].Name = rtl::OUString::createFromAscii(SC_UNONAME_ISULIST);
+ aSortDescriptor[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ISULIST));
aSortDescriptor[3].Value = ::cppu::bool2any(bEnabledUserList);
- aSortDescriptor[4].Name = rtl::OUString::createFromAscii(SC_UNONAME_OUTPOS);
+ aSortDescriptor[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_OUTPOS));
aSortDescriptor[4].Value <<= aOutputPosition;
- aSortDescriptor[5].Name = rtl::OUString::createFromAscii(SC_UNONAME_UINDEX);
+ aSortDescriptor[5].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_UINDEX));
aSortDescriptor[5].Value <<= nUserListIndex;
- aSortDescriptor[6].Name = rtl::OUString::createFromAscii(SC_UNONAME_SORTFLD);
+ aSortDescriptor[6].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_SORTFLD));
aSortDescriptor[6].Value <<= aSortFields;
if (nLangLength || nCountryLength)
{
@@ -191,7 +192,7 @@ void ScXMLSortContext::AddSortField(const rtl::OUString& sFieldNumber, const rtl
if (IsXMLToken(sOrder, XML_ASCENDING))
aSortField.SortAscending = sal_True;
else
- aSortField.SortAscending = sal_False;
+ aSortField.SortAscending = false;
if (sDataType.getLength() > 8)
{
rtl::OUString sTemp = sDataType.copy(0, 8);
@@ -277,3 +278,4 @@ void ScXMLSortByContext::EndElement()
pSortContext->AddSortField(sFieldNumber, sDataType, sOrder);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlsorti.hxx b/sc/source/filter/xml/xmlsorti.hxx
index 630f66d3bd06..7ccc82053905 100644
--- a/sc/source/filter/xml/xmlsorti.hxx
+++ b/sc/source/filter/xml/xmlsorti.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,3 +105,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index d061ea24b194..57ab9747228a 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include "XMLConverter.hxx"
#include "rangeutl.hxx"
+#include "unonames.hxx"
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmluconv.hxx>
@@ -49,9 +51,11 @@
#include <tools/debug.hxx>
#include <com/sun/star/util/CellProtection.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
#include <com/sun/star/table/CellHoriJustify.hpp>
+#include <com/sun/star/table/CellJustifyMethod.hpp>
#include <com/sun/star/table/TableBorder.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
#include <com/sun/star/sheet/XSheetConditionalEntry.hpp>
#include <com/sun/star/sheet/XSheetCondition.hpp>
@@ -89,6 +93,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
MAP( "HoriJustify", XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY|MID_FLAG_MERGE_PROPERTY, 0 ),
MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_TEXT_ALIGN_SOURCE, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYSOURCE|MID_FLAG_MERGE_PROPERTY, 0 ),
MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_REPEAT_CONTENT, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYREPEAT|MID_FLAG_MERGE_PROPERTY, 0 ),
+ MAP( SC_UNONAME_CELLHJUS_METHOD, XML_NAMESPACE_CSS3TEXT, XML_TEXT_JUSTIFY, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY_METHOD, 0 ),
MAP( "IsCellBackgroundTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_ISTRANSPARENT|MID_FLAG_MULTI_PROPERTY|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
MAP( "IsTextWrapped", XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_TYPE_PROP_TABLE_CELL|XML_SC_ISTEXTWRAPPED, 0 ),
MAP( "LeftBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BORDER, CTF_SC_ALLBORDER ),
@@ -100,7 +105,6 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
MAP( "ParaBottomMargin", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_MEASURE, CTF_SC_ALLPADDING ),
MAP( "ParaBottomMargin", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_MEASURE, CTF_SC_BOTTOMPADDING ),
MAP( "ParaIndent", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_PROP_PARAGRAPH|XML_TYPE_MEASURE16, 0 ),
-// MAP( "ParaIsHyphenation", XML_NAMESPACE_FO, XML_HYPHENATE, XML_TYPE_PROP_TEXT|XML_TYPE_BOOL, 0 ),
MAP( "ParaLeftMargin", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_MEASURE, CTF_SC_LEFTPADDING ),
MAP( "ParaRightMargin", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_MEASURE, CTF_SC_RIGHTPADDING ),
MAP( "ParaTopMargin", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_MEASURE, CTF_SC_TOPPADDING ),
@@ -116,7 +120,8 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
MAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
MAP( "ValidationXML", XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BUILDIN_CMP_ONLY, CTF_SC_VALIDATION ),
MAP( "VertJustify", XML_NAMESPACE_STYLE, XML_VERTICAL_ALIGN, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY, 0),
-// MAP( "WritingMode", XML_NAMESPACE_STYLE, XML_WRITING_MODE, XML_TYPE_PROP_PARAGRAPH|XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT, 0 ),
+ MAP( SC_UNONAME_CELLVJUS_METHOD, XML_NAMESPACE_STYLE, XML_VERTICAL_JUSTIFY, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY_METHOD, 0 ),
+
MAP_END()
};
@@ -125,7 +130,6 @@ const XMLPropertyMapEntry aXMLScColumnStylesProperties[] =
MAP( "IsManualPageBreak", XML_NAMESPACE_FO, XML_BREAK_BEFORE, XML_TYPE_PROP_TABLE_COLUMN|XML_SC_TYPE_BREAKBEFORE, 0),
MAP( "IsVisible", XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TYPE_PROP_TABLE_COLUMN|XML_SC_TYPE_EQUAL|MID_FLAG_SPECIAL_ITEM, CTF_SC_ISVISIBLE ),
MAP( "Width", XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH, XML_TYPE_PROP_TABLE_COLUMN|XML_TYPE_MEASURE, 0 ),
-// MAP( "OptimalWidth", XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_COLUMN_WIDTH, XML_TYPE_PROP_TABLE_COLUMN|XML_TYPE_BOOL, 0),
MAP_END()
};
@@ -208,8 +212,6 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
XMLPropertyState* pSWBorder_Left = NULL;
XMLPropertyState* pSWBorder_Right = NULL;
XMLPropertyState* pSWBorder_Top = NULL;
- XMLPropertyState* pDiagonalTLBR = NULL;
- XMLPropertyState* pDiagonalBLTR = NULL;
XMLPropertyState* pAllBorderWidthState = NULL;
XMLPropertyState* pLeftBorderWidthState = NULL;
@@ -270,9 +272,9 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
case CTF_RIGHTBORDERWIDTH: pSWRightBorderWidthState = propertie; break;
case CTF_TOPBORDERWIDTH: pSWTopBorderWidthState = propertie; break;
case CTF_BOTTOMBORDERWIDTH: pSWBottomBorderWidthState = propertie; break;
- case CTF_SC_DIAGONALTLBR: pDiagonalTLBR = propertie; break;
+ case CTF_SC_DIAGONALTLBR: break; //old diagonal line attribute names without "s" are only read, not written
case CTF_SC_DIAGONALTLBRWIDTH: pDiagonalTLBRWidthState = propertie; break;
- case CTF_SC_DIAGONALBLTR: pDiagonalBLTR = propertie; break;
+ case CTF_SC_DIAGONALBLTR: break; //old diagonal line attribute names without "s" are only read, not written
case CTF_SC_DIAGONALBLTRWIDTH: pDiagonalBLTRWidthState = propertie; break;
case CTF_SD_SHAPE_PARA_ADJUST: pParaAdjust = propertie; break;
case CTF_PARA_ADJUSTLAST: pParaAdjustLast = propertie; break;
@@ -318,7 +320,7 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
{
if( pBorder_Left && pBorder_Right && pBorder_Top && pBorder_Bottom )
{
- table::BorderLine aLeft, aRight, aTop, aBottom;
+ table::BorderLine2 aLeft, aRight, aTop, aBottom;
pBorder_Left->maValue >>= aLeft;
pBorder_Right->maValue >>= aRight;
@@ -329,7 +331,9 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
- aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance )
+ aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance &&
+ aLeft.LineStyle == aRight.LineStyle && aLeft.LineStyle == aTop.LineStyle &&
+ aLeft.LineStyle == aBottom.LineStyle )
{
pBorder_Left->mnIndex = -1;
pBorder_Left->maValue.clear();
@@ -356,7 +360,7 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
{
if( pLeftBorderWidthState && pRightBorderWidthState && pTopBorderWidthState && pBottomBorderWidthState )
{
- table::BorderLine aLeft, aRight, aTop, aBottom;
+ table::BorderLine2 aLeft, aRight, aTop, aBottom;
pLeftBorderWidthState->maValue >>= aLeft;
pRightBorderWidthState->maValue >>= aRight;
@@ -536,31 +540,6 @@ void ScXMLRowExportPropertyMapper::ContextFilter(
uno::Reference< beans::XPropertySet > /* rPropSet */ ) const
{
//#108550#; don't filter the height, so other applications know the calculated height
-
-/* XMLPropertyState* pHeight = NULL;
- XMLPropertyState* pOptimalHeight = NULL;
-
- for( ::std::vector< XMLPropertyState >::iterator propertie = rProperties.begin();
- propertie != rProperties.end();
- ++propertie )
- {
- switch( getPropertySetMapper()->GetEntryContextId( propertie->mnIndex ) )
- {
- case CTF_SC_ROWHEIGHT: pHeight = propertie; break;
- case CTF_SC_ROWOPTIMALHEIGHT: pOptimalHeight = propertie; break;
- }
- }
- if ((pHeight && pOptimalHeight && ::cppu::any2bool( pOptimalHeight->maValue )) ||
- (pHeight && !pOptimalHeight))
- {
- pHeight->mnIndex = -1;
- pHeight->maValue.clear();
- }
- if (pOptimalHeight)
- {
- pOptimalHeight->mnIndex = -1;
- pOptimalHeight->maValue.clear();
- }*/
}
ScXMLColumnExportPropertyMapper::ScXMLColumnExportPropertyMapper(
@@ -877,6 +856,12 @@ const XMLPropertyHandler* XMLScPropHdlFactory::GetPropertyHandler( sal_Int32 nTy
pHdl = new XmlScPropHdl_PrintContent;
}
break;
+ case XML_SC_TYPE_HORIJUSTIFY_METHOD:
+ case XML_SC_TYPE_VERTJUSTIFY_METHOD:
+ {
+ pHdl = new XmlScPropHdl_JustifyMethod;
+ }
+ break;
case XML_SC_TYPE_HORIJUSTIFY :
{
pHdl = new XmlScPropHdl_HoriJustify;
@@ -957,7 +942,7 @@ bool XmlScPropHdl_CellProtection::equals(
(aCellProtection1.IsLocked == aCellProtection2.IsLocked) &&
(aCellProtection1.IsFormulaHidden == aCellProtection2.IsFormulaHidden));
}
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_CellProtection::importXML(
@@ -965,16 +950,16 @@ sal_Bool XmlScPropHdl_CellProtection::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
util::CellProtection aCellProtection;
- sal_Bool bDefault(sal_False);
+ sal_Bool bDefault(false);
if (!rValue.hasValue())
{
- aCellProtection.IsHidden = sal_False;
+ aCellProtection.IsHidden = false;
aCellProtection.IsLocked = sal_True;
- aCellProtection.IsFormulaHidden = sal_False;
- aCellProtection.IsPrintHidden = sal_False;
+ aCellProtection.IsFormulaHidden = false;
+ aCellProtection.IsPrintHidden = false;
bDefault = sal_True;
}
if ((rValue >>= aCellProtection) || bDefault)
@@ -992,9 +977,9 @@ sal_Bool XmlScPropHdl_CellProtection::importXML(
++i;
rtl::OUString sFirst(rStrImpValue.copy(0, i));
rtl::OUString sSecond(rStrImpValue.copy(i + 1));
- aCellProtection.IsFormulaHidden = sal_False;
- aCellProtection.IsHidden = sal_False;
- aCellProtection.IsLocked = sal_False;
+ aCellProtection.IsFormulaHidden = false;
+ aCellProtection.IsHidden = false;
+ aCellProtection.IsLocked = false;
if ((IsXMLToken(sFirst, XML_PROTECTED)) || (IsXMLToken(sSecond, XML_PROTECTED)))
aCellProtection.IsLocked = sal_True;
if ((IsXMLToken(sFirst, XML_FORMULA_HIDDEN)) || (IsXMLToken(sSecond, XML_FORMULA_HIDDEN)))
@@ -1005,16 +990,16 @@ sal_Bool XmlScPropHdl_CellProtection::importXML(
else
{
aCellProtection.IsFormulaHidden = sal_True;
- aCellProtection.IsHidden = sal_False;
- aCellProtection.IsLocked = sal_False;
+ aCellProtection.IsHidden = false;
+ aCellProtection.IsLocked = false;
rValue <<= aCellProtection;
bRetval = sal_True;
}
}
else
{
- aCellProtection.IsFormulaHidden = sal_False;
- aCellProtection.IsHidden = sal_False;
+ aCellProtection.IsFormulaHidden = false;
+ aCellProtection.IsHidden = false;
aCellProtection.IsLocked = sal_True;
rValue <<= aCellProtection;
bRetval = sal_True;
@@ -1031,9 +1016,9 @@ sal_Bool XmlScPropHdl_CellProtection::importXML(
}
else
{
- aCellProtection.IsFormulaHidden = sal_False;
- aCellProtection.IsHidden = sal_False;
- aCellProtection.IsLocked = sal_False;
+ aCellProtection.IsFormulaHidden = false;
+ aCellProtection.IsHidden = false;
+ aCellProtection.IsLocked = false;
rValue <<= aCellProtection;
bRetval = sal_True;
}
@@ -1047,7 +1032,7 @@ sal_Bool XmlScPropHdl_CellProtection::exportXML(
const ::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
util::CellProtection aCellProtection;
if(rValue >>= aCellProtection)
@@ -1100,7 +1085,7 @@ bool XmlScPropHdl_PrintContent::equals(
{
return (aCellProtection1.IsPrintHidden == aCellProtection2.IsPrintHidden);
}
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_PrintContent::importXML(
@@ -1108,20 +1093,20 @@ sal_Bool XmlScPropHdl_PrintContent::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
util::CellProtection aCellProtection;
- sal_Bool bDefault(sal_False);
+ sal_Bool bDefault(false);
if (!rValue.hasValue())
{
- aCellProtection.IsHidden = sal_False;
+ aCellProtection.IsHidden = false;
aCellProtection.IsLocked = sal_True;
- aCellProtection.IsFormulaHidden = sal_False;
- aCellProtection.IsPrintHidden = sal_False;
+ aCellProtection.IsFormulaHidden = false;
+ aCellProtection.IsPrintHidden = false;
bDefault = sal_True;
}
if ((rValue >>= aCellProtection) || bDefault)
{
- sal_Bool bValue;
+ bool bValue;
if (SvXMLUnitConverter::convertBool(bValue, rStrImpValue))
{
aCellProtection.IsPrintHidden = !bValue;
@@ -1138,7 +1123,7 @@ sal_Bool XmlScPropHdl_PrintContent::exportXML(
const ::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
util::CellProtection aCellProtection;
if(rValue >>= aCellProtection)
@@ -1152,6 +1137,81 @@ sal_Bool XmlScPropHdl_PrintContent::exportXML(
return bRetval;
}
+
+XmlScPropHdl_JustifyMethod::~XmlScPropHdl_JustifyMethod()
+{
+}
+
+bool XmlScPropHdl_JustifyMethod::equals(
+ const ::com::sun::star::uno::Any& r1,
+ const ::com::sun::star::uno::Any& r2 ) const
+{
+ sal_Int32 nVal1(0), nVal2(0);
+
+ if((r1 >>= nVal1) && (r2 >>= nVal2))
+ return (nVal1 == nVal2);
+ return false;
+}
+
+sal_Bool XmlScPropHdl_JustifyMethod::importXML(
+ const ::rtl::OUString& rStrImpValue,
+ ::com::sun::star::uno::Any& rValue,
+ const SvXMLUnitConverter& /* rUnitConverter */ ) const
+{
+ bool bRetval = false;
+
+ sal_Int32 nValue = table::CellJustifyMethod::AUTO;
+ if (IsXMLToken(rStrImpValue, XML_AUTO))
+ {
+ nValue = table::CellJustifyMethod::AUTO;
+ rValue <<= nValue;
+ bRetval = true;
+ }
+ else if (IsXMLToken(rStrImpValue, XML_DISTRIBUTE))
+ {
+ nValue = table::CellJustifyMethod::DISTRIBUTE;
+ rValue <<= nValue;
+ bRetval = true;
+ }
+ else
+ bRetval = true;
+
+ return bRetval;
+}
+
+sal_Bool XmlScPropHdl_JustifyMethod::exportXML(
+ ::rtl::OUString& rStrExpValue,
+ const ::com::sun::star::uno::Any& rValue,
+ const SvXMLUnitConverter& /* rUnitConverter */ ) const
+{
+ sal_Int32 nVal(0);
+ bool bRetval = false;
+
+ if (rValue >>= nVal)
+ {
+ switch (nVal)
+ {
+ case table::CellJustifyMethod::AUTO:
+ {
+ rStrExpValue = GetXMLToken(XML_AUTO);
+ bRetval = true;
+ }
+ break;
+ case table::CellJustifyMethod::DISTRIBUTE:
+ {
+ rStrExpValue = GetXMLToken(XML_DISTRIBUTE);
+ bRetval = true;
+ }
+ break;
+ default:
+ {
+ // added to avoid warnings
+ }
+ }
+ }
+ return bRetval;
+}
+
XmlScPropHdl_HoriJustify::~XmlScPropHdl_HoriJustify()
{
}
@@ -1164,7 +1224,7 @@ bool XmlScPropHdl_HoriJustify::equals(
if((r1 >>= aHoriJustify1) && (r2 >>= aHoriJustify2))
return (aHoriJustify1 == aHoriJustify2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_HoriJustify::importXML(
@@ -1172,7 +1232,7 @@ sal_Bool XmlScPropHdl_HoriJustify::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
table::CellHoriJustify nValue = table::CellHoriJustify_LEFT;
rValue >>= nValue;
@@ -1215,7 +1275,7 @@ sal_Bool XmlScPropHdl_HoriJustify::exportXML(
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
table::CellHoriJustify nVal;
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if(rValue >>= nVal)
{
@@ -1268,7 +1328,7 @@ bool XmlScPropHdl_HoriJustifySource::equals(
if((r1 >>= aHoriJustify1) && (r2 >>= aHoriJustify2))
return (aHoriJustify1 == aHoriJustify2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_HoriJustifySource::importXML(
@@ -1276,7 +1336,7 @@ sal_Bool XmlScPropHdl_HoriJustifySource::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if (IsXMLToken(rStrImpValue, XML_FIX))
{
@@ -1298,7 +1358,7 @@ sal_Bool XmlScPropHdl_HoriJustifySource::exportXML(
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
table::CellHoriJustify nVal;
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if(rValue >>= nVal)
{
@@ -1329,7 +1389,7 @@ bool XmlScPropHdl_HoriJustifyRepeat::equals(
if((r1 >>= aHoriJustify1) && (r2 >>= aHoriJustify2))
return (aHoriJustify1 == aHoriJustify2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_HoriJustifyRepeat::importXML(
@@ -1337,7 +1397,7 @@ sal_Bool XmlScPropHdl_HoriJustifyRepeat::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if (IsXMLToken(rStrImpValue, XML_FALSE))
{
@@ -1359,7 +1419,7 @@ sal_Bool XmlScPropHdl_HoriJustifyRepeat::exportXML(
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
table::CellHoriJustify nVal;
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if(rValue >>= nVal)
{
@@ -1390,7 +1450,7 @@ bool XmlScPropHdl_Orientation::equals(
if((r1 >>= aOrientation1) && (r2 >>= aOrientation2))
return (aOrientation1 == aOrientation2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_Orientation::importXML(
@@ -1398,7 +1458,7 @@ sal_Bool XmlScPropHdl_Orientation::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
table::CellOrientation nValue;
if (IsXMLToken(rStrImpValue, XML_LTR))
@@ -1423,7 +1483,7 @@ sal_Bool XmlScPropHdl_Orientation::exportXML(
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
table::CellOrientation nVal;
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if(rValue >>= nVal)
{
@@ -1459,7 +1519,7 @@ bool XmlScPropHdl_RotateAngle::equals(
if((r1 >>= aAngle1) && (r2 >>= aAngle2))
return (aAngle1 == aAngle2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_RotateAngle::importXML(
@@ -1467,7 +1527,7 @@ sal_Bool XmlScPropHdl_RotateAngle::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
sal_Int32 nValue;
if (SvXMLUnitConverter::convertNumber(nValue, rStrImpValue))
@@ -1486,7 +1546,7 @@ sal_Bool XmlScPropHdl_RotateAngle::exportXML(
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
sal_Int32 nVal = 0;
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if(rValue >>= nVal)
{
@@ -1507,11 +1567,11 @@ bool XmlScPropHdl_RotateReference::equals(
const ::com::sun::star::uno::Any& r1,
const ::com::sun::star::uno::Any& r2 ) const
{
- table::CellVertJustify aReference1, aReference2;
+ sal_Int32 aReference1(0), aReference2(0);
if((r1 >>= aReference1) && (r2 >>= aReference2))
return (aReference1 == aReference2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_RotateReference::importXML(
@@ -1519,30 +1579,30 @@ sal_Bool XmlScPropHdl_RotateReference::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
- table::CellVertJustify nValue;
+ sal_Int32 nValue;
if (IsXMLToken(rStrImpValue, XML_NONE))
{
- nValue = table::CellVertJustify_STANDARD;
+ nValue = table::CellVertJustify2::STANDARD;
rValue <<= nValue;
bRetval = sal_True;
}
else if (IsXMLToken(rStrImpValue, XML_BOTTOM))
{
- nValue = table::CellVertJustify_BOTTOM;
+ nValue = table::CellVertJustify2::BOTTOM;
rValue <<= nValue;
bRetval = sal_True;
}
else if (IsXMLToken(rStrImpValue, XML_TOP))
{
- nValue = table::CellVertJustify_TOP;
+ nValue = table::CellVertJustify2::TOP;
rValue <<= nValue;
bRetval = sal_True;
}
else if (IsXMLToken(rStrImpValue, XML_CENTER))
{
- nValue = table::CellVertJustify_CENTER;
+ nValue = table::CellVertJustify2::CENTER;
rValue <<= nValue;
bRetval = sal_True;
}
@@ -1555,32 +1615,32 @@ sal_Bool XmlScPropHdl_RotateReference::exportXML(
const ::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- table::CellVertJustify nVal;
- sal_Bool bRetval(sal_False);
+ sal_Int32 nVal(0);
+ sal_Bool bRetval(false);
if(rValue >>= nVal)
{
switch (nVal)
{
- case table::CellVertJustify_BOTTOM :
+ case table::CellVertJustify2::BOTTOM :
{
rStrExpValue = GetXMLToken(XML_BOTTOM);
bRetval = sal_True;
}
break;
- case table::CellVertJustify_CENTER :
+ case table::CellVertJustify2::CENTER :
{
rStrExpValue = GetXMLToken(XML_CENTER);
bRetval = sal_True;
}
break;
- case table::CellVertJustify_STANDARD :
+ case table::CellVertJustify2::STANDARD :
{
rStrExpValue = GetXMLToken(XML_NONE);
bRetval = sal_True;
}
break;
- case table::CellVertJustify_TOP :
+ case table::CellVertJustify2::TOP :
{
rStrExpValue = GetXMLToken(XML_TOP);
bRetval = sal_True;
@@ -1604,11 +1664,11 @@ bool XmlScPropHdl_VertJustify::equals(
const ::com::sun::star::uno::Any& r1,
const ::com::sun::star::uno::Any& r2 ) const
{
- table::CellVertJustify aReference1, aReference2;
+ sal_Int32 aReference1(0), aReference2(0);
if((r1 >>= aReference1) && (r2 >>= aReference2))
return (aReference1 == aReference2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_VertJustify::importXML(
@@ -1616,30 +1676,36 @@ sal_Bool XmlScPropHdl_VertJustify::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
- table::CellVertJustify nValue;
+ sal_Int32 nValue;
if (IsXMLToken(rStrImpValue, XML_AUTOMATIC))
{
- nValue = table::CellVertJustify_STANDARD;
+ nValue = table::CellVertJustify2::STANDARD;
rValue <<= nValue;
bRetval = sal_True;
}
else if (IsXMLToken(rStrImpValue, XML_BOTTOM))
{
- nValue = table::CellVertJustify_BOTTOM;
+ nValue = table::CellVertJustify2::BOTTOM;
rValue <<= nValue;
bRetval = sal_True;
}
else if (IsXMLToken(rStrImpValue, XML_TOP))
{
- nValue = table::CellVertJustify_TOP;
+ nValue = table::CellVertJustify2::TOP;
rValue <<= nValue;
bRetval = sal_True;
}
else if (IsXMLToken(rStrImpValue, XML_MIDDLE))
{
- nValue = table::CellVertJustify_CENTER;
+ nValue = table::CellVertJustify2::CENTER;
+ rValue <<= nValue;
+ bRetval = sal_True;
+ }
+ else if (IsXMLToken(rStrImpValue, XML_JUSTIFY))
+ {
+ nValue = table::CellVertJustify2::BLOCK;
rValue <<= nValue;
bRetval = sal_True;
}
@@ -1652,37 +1718,43 @@ sal_Bool XmlScPropHdl_VertJustify::exportXML(
const ::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- table::CellVertJustify nVal;
- sal_Bool bRetval(sal_False);
+ sal_Int32 nVal(0);
+ sal_Bool bRetval(false);
if(rValue >>= nVal)
{
switch (nVal)
{
- case table::CellVertJustify_BOTTOM :
+ case table::CellVertJustify2::BOTTOM :
{
rStrExpValue = GetXMLToken(XML_BOTTOM);
bRetval = sal_True;
}
break;
- case table::CellVertJustify_CENTER :
+ case table::CellVertJustify2::CENTER :
{
rStrExpValue = GetXMLToken(XML_MIDDLE);
bRetval = sal_True;
}
break;
- case table::CellVertJustify_STANDARD :
+ case table::CellVertJustify2::STANDARD :
{
rStrExpValue = GetXMLToken(XML_AUTOMATIC);
bRetval = sal_True;
}
break;
- case table::CellVertJustify_TOP :
+ case table::CellVertJustify2::TOP :
{
rStrExpValue = GetXMLToken(XML_TOP);
bRetval = sal_True;
}
break;
+ case table::CellVertJustify2::BLOCK :
+ {
+ rStrExpValue = GetXMLToken(XML_JUSTIFY);
+ bRetval = sal_True;
+ }
+ break;
default:
{
// added to avoid warnings
@@ -1705,7 +1777,7 @@ bool XmlScPropHdl_BreakBefore::equals(
if((r1 >>= aBreak1) && (r2 >>= aBreak2))
return (aBreak1 == aBreak2);
- return sal_False;
+ return false;
}
sal_Bool XmlScPropHdl_BreakBefore::importXML(
@@ -1713,12 +1785,12 @@ sal_Bool XmlScPropHdl_BreakBefore::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
sal_Bool bValue;
if (IsXMLToken(rStrImpValue, XML_AUTO))
{
- bValue = sal_False;
+ bValue = false;
rValue = ::cppu::bool2any(bValue);
bRetval = sal_True;
}
@@ -1737,7 +1809,7 @@ sal_Bool XmlScPropHdl_BreakBefore::exportXML(
const ::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if(::cppu::any2bool(rValue))
{
@@ -1769,7 +1841,7 @@ sal_Bool XmlScPropHdl_IsTextWrapped::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if (IsXMLToken(rStrImpValue, XML_WRAP))
{
@@ -1778,7 +1850,7 @@ sal_Bool XmlScPropHdl_IsTextWrapped::importXML(
}
else if (IsXMLToken(rStrImpValue, XML_NO_WRAP))
{
- rValue = ::cppu::bool2any(sal_False);
+ rValue = ::cppu::bool2any(false);
bRetval = sal_True;
}
@@ -1790,7 +1862,7 @@ sal_Bool XmlScPropHdl_IsTextWrapped::exportXML(
const ::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if (::cppu::any2bool(rValue))
{
@@ -1810,16 +1882,16 @@ sal_Bool XmlScPropHdl_IsEqual::importXML( const ::rtl::OUString& /* rStrImpValue
::com::sun::star::uno::Any& /* rValue */,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- DBG_ERROR("should never be called");
- return sal_False;
+ OSL_FAIL("should never be called");
+ return false;
}
sal_Bool XmlScPropHdl_IsEqual::exportXML( ::rtl::OUString& /* rStrExpValue */,
const ::com::sun::star::uno::Any& /* rValue */,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- DBG_ERROR("should never be called");
- return sal_False;
+ OSL_FAIL("should never be called");
+ return false;
}
XmlScPropHdl_Vertical::~XmlScPropHdl_Vertical()
@@ -1838,7 +1910,7 @@ sal_Bool XmlScPropHdl_Vertical::importXML(
::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if (IsXMLToken(rStrImpValue, XML_AUTO))
{
@@ -1847,7 +1919,7 @@ sal_Bool XmlScPropHdl_Vertical::importXML(
}
else if (IsXMLToken(rStrImpValue, XML_0))
{
- rValue = ::cppu::bool2any(sal_False);
+ rValue = ::cppu::bool2any(false);
bRetval = sal_True;
}
@@ -1859,7 +1931,7 @@ sal_Bool XmlScPropHdl_Vertical::exportXML(
const ::com::sun::star::uno::Any& rValue,
const SvXMLUnitConverter& /* rUnitConverter */ ) const
{
- sal_Bool bRetval(sal_False);
+ sal_Bool bRetval(false);
if (::cppu::any2bool(rValue))
{
@@ -1874,3 +1946,5 @@ sal_Bool XmlScPropHdl_Vertical::exportXML(
return bRetval;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlstyle.hxx b/sc/source/filter/xml/xmlstyle.hxx
index f8abf5e6443d..07a4d307a2c3 100644
--- a/sc/source/filter/xml/xmlstyle.hxx
+++ b/sc/source/filter/xml/xmlstyle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,19 +49,21 @@ extern const XMLPropertyMapEntry aXMLScTableStylesImportProperties[];
#define XML_SC_TYPE_CELLPROTECTION (XML_SC_TYPES_START + 1)
#define XML_SC_TYPE_PRINTCONTENT (XML_SC_TYPES_START + 2)
#define XML_SC_TYPE_HORIJUSTIFY (XML_SC_TYPES_START + 3)
-#define XML_SC_TYPE_HORIJUSTIFYSOURCE (XML_SC_TYPES_START + 4)
-#define XML_SC_TYPE_HORIJUSTIFYREPEAT (XML_SC_TYPES_START + 5)
-#define XML_SC_TYPE_ORIENTATION (XML_SC_TYPES_START + 6)
-#define XML_SC_TYPE_ROTATEANGLE (XML_SC_TYPES_START + 7)
-#define XML_SC_TYPE_ROTATEREFERENCE (XML_SC_TYPES_START + 8)
-#define XML_SC_TYPE_BORDERLEFT (XML_SC_TYPES_START + 9)
-#define XML_SC_TYPE_BORDERRIGHT (XML_SC_TYPES_START + 10)
-#define XML_SC_TYPE_BORDERTOP (XML_SC_TYPES_START + 11)
-#define XML_SC_TYPE_BORDERBOTTOM (XML_SC_TYPES_START + 12)
-#define XML_SC_TYPE_VERTJUSTIFY (XML_SC_TYPES_START + 13)
-#define XML_SC_ISTEXTWRAPPED (XML_SC_TYPES_START + 14)
-#define XML_SC_TYPE_EQUAL (XML_SC_TYPES_START + 15)
-#define XML_SC_TYPE_VERTICAL (XML_SC_TYPES_START + 16)
+#define XML_SC_TYPE_HORIJUSTIFY_METHOD (XML_SC_TYPES_START + 4)
+#define XML_SC_TYPE_HORIJUSTIFYSOURCE (XML_SC_TYPES_START + 5)
+#define XML_SC_TYPE_HORIJUSTIFYREPEAT (XML_SC_TYPES_START + 6)
+#define XML_SC_TYPE_ORIENTATION (XML_SC_TYPES_START + 7)
+#define XML_SC_TYPE_ROTATEANGLE (XML_SC_TYPES_START + 8)
+#define XML_SC_TYPE_ROTATEREFERENCE (XML_SC_TYPES_START + 9)
+#define XML_SC_TYPE_BORDERLEFT (XML_SC_TYPES_START + 10)
+#define XML_SC_TYPE_BORDERRIGHT (XML_SC_TYPES_START + 11)
+#define XML_SC_TYPE_BORDERTOP (XML_SC_TYPES_START + 12)
+#define XML_SC_TYPE_BORDERBOTTOM (XML_SC_TYPES_START + 13)
+#define XML_SC_TYPE_VERTJUSTIFY (XML_SC_TYPES_START + 14)
+#define XML_SC_TYPE_VERTJUSTIFY_METHOD (XML_SC_TYPES_START + 15)
+#define XML_SC_ISTEXTWRAPPED (XML_SC_TYPES_START + 16)
+#define XML_SC_TYPE_EQUAL (XML_SC_TYPES_START + 17)
+#define XML_SC_TYPE_VERTICAL (XML_SC_TYPES_START + 18)
#define CTF_SC_HORIJUSTIFY (XML_SC_CTF_START + 1)
#define CTF_SC_HORIJUSTIFY_SOURCE (XML_SC_CTF_START + 2)
@@ -247,6 +250,15 @@ public:
virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
};
+class XmlScPropHdl_JustifyMethod : public XMLPropertyHandler
+{
+public:
+ virtual ~XmlScPropHdl_JustifyMethod();
+ virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
+ virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+ virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
+};
+
class XmlScPropHdl_HoriJustify : public XMLPropertyHandler
{
public:
@@ -347,3 +359,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 3866bba63239..2c7b753afc15 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
-#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
#include <comphelper/extract.hxx>
#include <xmloff/xmlprcon.hxx>
#include <xmloff/xmluconv.hxx>
@@ -65,18 +66,19 @@
#define XML_LINE_TLBR 0
#define XML_LINE_BLTR 1
-using ::rtl::OUString;
using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::style;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace xmloff::token;
-//using namespace ::com::sun::star::text;
using namespace ::formula;
+using rtl::OUString;
+using com::sun::star::uno::Reference;
+using com::sun::star::uno::UNO_QUERY;
+
ScXMLCellImportPropertyMapper::ScXMLCellImportPropertyMapper(
const UniReference< XMLPropertySetMapper >& rMapper,
SvXMLImport& rImportP) :
@@ -167,15 +169,16 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
pBorderWidths[i]->mnIndex = -1;
if( pBorders[i] )
{
- table::BorderLine aBorderLine;
+ table::BorderLine2 aBorderLine;
pBorders[i]->maValue >>= aBorderLine;
if( pBorderWidths[i] )
{
- table::BorderLine aBorderLineWidth;
+ table::BorderLine2 aBorderLineWidth;
pBorderWidths[i]->maValue >>= aBorderLineWidth;
aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
+ aBorderLine.LineStyle = aBorderLineWidth.LineStyle;
pBorders[i]->maValue <<= aBorderLine;
}
}
@@ -184,9 +187,9 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
{
if( pDiagBorders[i] && ( pDiagBorderWidths[i] || pOldDiagBorderWidths[i] ) )
{
- table::BorderLine aBorderLine;
+ table::BorderLine2 aBorderLine;
pDiagBorders[i]->maValue >>= aBorderLine;
- table::BorderLine aBorderLineWidth;
+ table::BorderLine2 aBorderLineWidth;
if (pDiagBorderWidths[i])
pDiagBorderWidths[i]->maValue >>= aBorderLineWidth; // prefer new attribute
else
@@ -194,6 +197,7 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
+ aBorderLine.LineStyle = aBorderLineWidth.LineStyle;
pDiagBorders[i]->maValue <<= aBorderLine;
if (pDiagBorderWidths[i])
pDiagBorderWidths[i]->mnIndex = -1;
@@ -272,7 +276,7 @@ void ScXMLRowImportPropertyMapper::finished(::std::vector< XMLPropertyState >& r
}
else if (pHeight)
{
- rProperties.push_back(XMLPropertyState(maPropMapper->FindEntryIndex(CTF_SC_ROWOPTIMALHEIGHT), ::cppu::bool2any( sal_False )));
+ rProperties.push_back(XMLPropertyState(maPropMapper->FindEntryIndex(CTF_SC_ROWOPTIMALHEIGHT), ::cppu::bool2any( false )));
}
// don't access pointers to rProperties elements after push_back!
}
@@ -344,7 +348,7 @@ void XMLTableStyleContext::SetOperator( uno::Sequence< beans::PropertyValue >& r
void XMLTableStyleContext::SetBaseCellAddress( uno::Sequence< beans::PropertyValue >& rProps, const OUString& rBaseCell ) const
{
- /* #b4974740# Source position must be set as string, because it may refer
+ /* Source position must be set as string, because it may refer
to a sheet that hasn't been loaded yet. */
lclAppendProperty( rProps, OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SOURCESTR ) ), rBaseCell );
}
@@ -473,8 +477,8 @@ XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport,
pStyles(&rStyles),
nNumberFormat(-1),
nLastSheet(-1),
- bConditionalFormatCreated(sal_False),
- bParentSet(sal_False)
+ bConditionalFormatCreated(false),
+ bParentSet(false)
{
}
@@ -613,7 +617,7 @@ sal_Int32 XMLTableStyleContext::GetNumberFormat()
pMyStyles->FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, sDataStyleName, sal_True));
else
{
- DBG_ERROR("not possible to get style");
+ OSL_FAIL("not possible to get style");
}
}
if (pStyle)
@@ -965,8 +969,8 @@ ScMasterPageContext::ScMasterPageContext( SvXMLImport& rImport,
const uno::Reference< XAttributeList > & xAttrList,
sal_Bool bOverwrite ) :
XMLTextMasterPageContext( rImport, nPrfx, rLName, xAttrList, bOverwrite ),
- bContainsRightHeader(sal_False),
- bContainsRightFooter(sal_False)
+ bContainsRightHeader(false),
+ bContainsRightFooter(false)
{
}
@@ -1085,3 +1089,4 @@ void ScCellTextStyleContext::FillPropertySet( const uno::Reference<beans::XPrope
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx
index b2a8589f5524..9f69acca9d51 100644
--- a/sc/source/filter/xml/xmlstyli.hxx
+++ b/sc/source/filter/xml/xmlstyli.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -141,7 +142,7 @@ public:
XMLTableStyleContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- SvXMLStylesContext& rStyles, sal_uInt16 nFamily, sal_Bool bDefaultStyle = sal_False );
+ SvXMLStylesContext& rStyles, sal_uInt16 nFamily, sal_Bool bDefaultStyle = false );
virtual ~XMLTableStyleContext();
virtual SvXMLImportContext *CreateChildContext(
@@ -315,7 +316,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList > & xAttrList,
SvXMLStylesContext& rStyles, sal_uInt16 nFamily,
- sal_Bool bDefaultStyle = sal_False );
+ sal_Bool bDefaultStyle = false );
virtual ~ScCellTextStyleContext();
// overload FillPropertySet to store style information
@@ -327,3 +328,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index e6cc7b853764..0e7f7b221152 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
// INCLUDE ---------------------------------------------------------------
#include "xmlsubti.hxx"
#include "global.hxx"
@@ -148,49 +148,40 @@ void ScMyTableData::SetChangedCols(const sal_Int32 nValue)
/*******************************************************************************************************************************/
+ScXMLTabProtectionData::ScXMLTabProtectionData() :
+ meHash1(PASSHASH_SHA1),
+ meHash2(PASSHASH_UNSPECIFIED),
+ mbProtected(false),
+ mbSelectProtectedCells(true),
+ mbSelectUnprotectedCells(true)
+{
+}
+
ScMyTables::ScMyTables(ScXMLImport& rTempImport)
: rImport(rTempImport),
- aResizeShapes(rTempImport),
+ aFixupOLEs(rTempImport),
nCurrentColStylePos(0),
nCurrentDrawPage( -1 ),
nCurrentXShapes( -1 ),
- nTableCount( 0 ),
nCurrentSheet( -1 )
{
- aTableVec.resize(nDefaultTabCount, NULL);
}
ScMyTables::~ScMyTables()
{
- ScMyTableData* pTable;
- while (nTableCount > 0)
- {
- pTable = aTableVec[nTableCount - 1];
- delete pTable;
- aTableVec[nTableCount - 1] = NULL;
- --nTableCount;
- }
}
void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString& sStyleName,
- const sal_Bool bTempProtection, const rtl::OUString& sTempPassword)
+ const ScXMLTabProtectionData& rProtectData)
{
if (rImport.GetModel().is())
{
nCurrentColStylePos = 0;
sCurrentSheetName = sTableName;
- ScMyTableData* aTable;
- while (nTableCount > 0)
- {
- aTable = aTableVec[nTableCount - 1];
- delete aTable;
- aTableVec[nTableCount - 1] = NULL;
- --nTableCount;
- }
+ maTables.clear();
++nCurrentSheet;
- bProtection = bTempProtection;
- sPassword = sTempPassword;
+ maProtectionData = rProtectData;
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( rImport.GetModel(), uno::UNO_QUERY );
if ( xSpreadDoc.is() )
{
@@ -208,12 +199,11 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString&
ScDocument *pDoc = ScXMLConverter::GetScDocument(rImport.GetModel());
if (pDoc)
{
- rImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(rImport);
String sTabName(String::CreateFromAscii("Table"));
pDoc->CreateValidTabName(sTabName);
rtl::OUString sOUTabName(sTabName);
xSheets->insertNewByName(sOUTabName, sal::static_int_cast<sal_Int16>(nCurrentSheet));
- rImport.UnlockSolarMutex();
}
}
}
@@ -237,12 +227,11 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString&
ScDocument *pDoc = ScXMLConverter::GetScDocument(rImport.GetModel());
if (pDoc)
{
- rImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(rImport);
String sTabName(String::CreateFromAscii("Table"));
pDoc->CreateValidTabName(sTabName);
rtl::OUString sOUTabName(sTabName);
xNamed->setName(sOUTabName);
- rImport.UnlockSolarMutex();
}
}
}
@@ -304,13 +293,13 @@ sal_Bool ScMyTables::IsMerged (const uno::Reference <table::XCellRange>& xCellRa
aCellAddress = xMergeCellAddress->getRangeAddress();
if (aCellAddress.StartColumn == nCol && aCellAddress.EndColumn == nCol &&
aCellAddress.StartRow == nRow && aCellAddress.EndRow == nRow)
- return sal_False;
+ return false;
else
return sal_True;
}
}
}
- return sal_False;
+ return false;
}
void ScMyTables::UnMerge()
@@ -324,7 +313,7 @@ void ScMyTables::UnMerge()
uno::Reference <util::XMergeable> xMergeable (xCurrentCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
aCellAddress.EndColumn, aCellAddress.EndRow), uno::UNO_QUERY);
if (xMergeable.is())
- xMergeable->merge(sal_False);
+ xMergeable->merge(false);
}
}
}
@@ -340,22 +329,27 @@ void ScMyTables::DoMerge(sal_Int32 nCount)
uno::Reference <util::XMergeable> xMergeable (xCurrentCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
aCellAddress.EndColumn, aCellAddress.EndRow), uno::UNO_QUERY);
if (xMergeable.is())
- xMergeable->merge(sal_False);
+ xMergeable->merge(false);
}
//merge
uno::Reference <table::XCellRange> xMergeCellRange;
if (nCount == -1)
- xMergeCellRange.set(xCurrentCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
- aCellAddress.EndColumn
- + aTableVec[nTableCount - 1]->GetColsPerCol(aTableVec[nTableCount - 1]->GetColumn()) - 1,
- aCellAddress.EndRow
- + aTableVec[nTableCount - 1]->GetRowsPerRow(aTableVec[nTableCount - 1]->GetRow()) - 1));
+ {
+ const ScMyTableData& r = maTables.back();
+ xMergeCellRange.set(
+ xCurrentCellRange->getCellRangeByPosition(
+ aCellAddress.StartColumn, aCellAddress.StartRow,
+ aCellAddress.EndColumn + r.GetColsPerCol(r.GetColumn()) - 1,
+ aCellAddress.EndRow + r.GetRowsPerRow(r.GetRow()) - 1));
+ }
else
- xMergeCellRange.set(xCurrentCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
- aCellAddress.StartColumn
- + nCount - 1,
- aCellAddress.EndRow));
+ xMergeCellRange.set(
+ xCurrentCellRange->getCellRangeByPosition(
+ aCellAddress.StartColumn, aCellAddress.StartRow,
+ aCellAddress.StartColumn + nCount - 1,
+ aCellAddress.EndRow));
+
uno::Reference <util::XMergeable> xMergeable (xMergeCellRange, uno::UNO_QUERY);
if (xMergeable.is())
xMergeable->merge(sal_True);
@@ -368,7 +362,8 @@ void ScMyTables::InsertRow()
{
table::CellRangeAddress aCellAddress;
sal_Int32 nRow(GetRealCellPos().Row);
- for (sal_Int32 j = 0; j < GetRealCellPos().Column - aTableVec[nTableCount - 1]->GetColumn() - 1; ++j)
+ const ScMyTableData& rTab = maTables.back();
+ for (sal_Int32 j = 0; j < GetRealCellPos().Column - rTab.GetColumn() - 1; ++j)
{
if (IsMerged(xCurrentCellRange, j, nRow - 1, aCellAddress))
{
@@ -376,7 +371,7 @@ void ScMyTables::InsertRow()
uno::Reference <util::XMergeable> xMergeable (xCurrentCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
aCellAddress.EndColumn, aCellAddress.EndRow), uno::UNO_QUERY);
if (xMergeable.is())
- xMergeable->merge(sal_False);
+ xMergeable->merge(false);
}
//merge
@@ -392,34 +387,41 @@ void ScMyTables::InsertRow()
void ScMyTables::NewRow()
{
- if (nTableCount > 1)
- if (aTableVec[nTableCount - 1]->GetRealRows(aTableVec[nTableCount - 1]->GetRow()) >
- aTableVec[nTableCount - 2]->GetRowsPerRow(aTableVec[nTableCount - 2]->GetRow()) - 1)
+ size_t n = maTables.size();
+ if (n <= 1)
+ return;
+
+ if (maTables[n-1].GetRealRows(maTables[n-1].GetRow()) >
+ maTables[n-2].GetRowsPerRow(maTables[n-2].GetRow()) - 1)
+ {
+ if (GetRealCellPos().Column > 0)
+ InsertRow();
+
+ for (size_t i = n - 1; i > 0; --i)
{
- if (GetRealCellPos().Column > 0)
- InsertRow();
- for (sal_Int16 i = sal::static_int_cast<sal_Int16>(nTableCount - 1); i > 0; i--)
- {
- sal_Int32 nRow = aTableVec[i - 1]->GetRow();
- aTableVec[i - 1]->SetRowsPerRow(nRow,
- aTableVec[i - 1]->GetRowsPerRow(nRow) + 1);
- aTableVec[i - 1]->SetRealRows(nRow + 1,
- aTableVec[i - 1]->GetRealRows(nRow)
- + aTableVec[i - 1]->GetRowsPerRow(nRow));
- }
+ sal_Int32 nRow = maTables[i-1].GetRow();
+ maTables[i-1].SetRowsPerRow(
+ nRow,
+ maTables[i-1].GetRowsPerRow(nRow) + 1);
+
+ maTables[i-1].SetRealRows(
+ nRow + 1,
+ maTables[i-1].GetRealRows(nRow) + maTables[i-1].GetRowsPerRow(nRow));
}
+ }
}
void ScMyTables::AddRow()
{
- aTableVec[nTableCount - 1]->AddRow();
- aTableVec[nTableCount - 1]->SetFirstColumn();
- sal_Int32 nRow = aTableVec[nTableCount - 1]->GetRow();
+ ScMyTableData& rTab = maTables.back();
+ rTab.AddRow();
+ rTab.SetFirstColumn();
+ sal_Int32 nRow = rTab.GetRow();
if (nRow > 0)
NewRow();
- aTableVec[nTableCount - 1]->SetRealRows(nRow + 1,
- aTableVec[nTableCount - 1]->GetRealRows(nRow)
- + aTableVec[nTableCount - 1]->GetRowsPerRow(nRow));
+
+ rTab.SetRealRows(
+ nRow + 1, rTab.GetRealRows(nRow) + rTab.GetRowsPerRow(nRow));
}
void ScMyTables::SetRowStyle(const rtl::OUString& rCellStyleName)
@@ -433,7 +435,8 @@ void ScMyTables::InsertColumn()
{
table::CellRangeAddress aCellAddress;
sal_Int32 nCol(GetRealCellPos().Column);
- for (sal_Int32 j = 0; j <= GetRealCellPos().Row - aTableVec[nTableCount - 1]->GetRow() - 1; ++j)
+ sal_Int32 n = GetRealCellPos().Row - maTables.back().GetRow() - 1;
+ for (sal_Int32 j = 0; j <= n; ++j)
{
table::CellRangeAddress aTempCellAddress;
if (IsMerged(xCurrentCellRange, nCol - 1, j, aCellAddress))
@@ -442,7 +445,7 @@ void ScMyTables::InsertColumn()
uno::Reference <util::XMergeable> xMergeable (xCurrentCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
aCellAddress.EndColumn, aCellAddress.EndRow), uno::UNO_QUERY);
if (xMergeable.is())
- xMergeable->merge(sal_False);
+ xMergeable->merge(false);
aTempCellAddress = aCellAddress;
aTempCellAddress.StartColumn = aTempCellAddress.EndColumn + 1;
aTempCellAddress.EndColumn = aTempCellAddress.StartColumn;
@@ -472,49 +475,51 @@ void ScMyTables::InsertColumn()
void ScMyTables::NewColumn(sal_Bool bIsCovered)
{
- if (!bIsCovered)
+ if (bIsCovered)
+ return;
+
+ ScMyTableData& rLastTab = maTables.back();
+ sal_Int32 nColCount = rLastTab.GetColCount();
+ sal_Int32 nSpannedCols = rLastTab.GetSpannedCols();
+ if ( (nSpannedCols > nColCount) &&
+ (rLastTab.GetRow() == 0) &&
+ (rLastTab.GetColumn() == 0) )
{
- sal_Int32 nColCount(aTableVec[nTableCount - 1]->GetColCount());
- sal_Int32 nSpannedCols(aTableVec[nTableCount - 1]->GetSpannedCols());
- if ( (nSpannedCols > nColCount) &&
- (aTableVec[nTableCount - 1]->GetRow() == 0) &&
- (aTableVec[nTableCount - 1]->GetColumn() == 0) )
+ if (nColCount > 0)
{
- if (nColCount > 0)
+ sal_Int32 FirstColsSpanned(nSpannedCols / nColCount);
+ sal_Int32 LastColSpanned(FirstColsSpanned
+ + (nSpannedCols % nColCount));
+ for (sal_Int32 i = 0; i < nColCount - 1; ++i)
{
- sal_Int32 FirstColsSpanned(nSpannedCols / nColCount);
- sal_Int32 LastColSpanned(FirstColsSpanned
- + (nSpannedCols % nColCount));
- for (sal_Int32 i = 0; i < nColCount - 1; ++i)
- {
- aTableVec[nTableCount - 1]->SetColsPerCol(i, FirstColsSpanned);
- aTableVec[nTableCount - 1]->SetRealCols(i + 1,
- aTableVec[nTableCount - 1]->GetRealCols(i)
- + FirstColsSpanned);
- }
- aTableVec[nTableCount - 1]->SetColsPerCol(nColCount - 1, LastColSpanned);
- aTableVec[nTableCount - 1]->SetRealCols(nColCount - 1 + 1,
- aTableVec[nTableCount - 1]->GetRealCols(nColCount - 1)
- + LastColSpanned);
+ rLastTab.SetColsPerCol(i, FirstColsSpanned);
+ rLastTab.SetRealCols(i + 1, rLastTab.GetRealCols(i) + FirstColsSpanned);
}
+ rLastTab.SetColsPerCol(nColCount - 1, LastColSpanned);
+ rLastTab.SetRealCols(
+ nColCount, rLastTab.GetRealCols(nColCount - 1) + LastColSpanned);
}
- if (aTableVec[nTableCount - 1]->GetRealCols(aTableVec[nTableCount - 1]->GetColumn()) > nSpannedCols - 1)
+ }
+ if (rLastTab.GetRealCols(rLastTab.GetColumn()) > nSpannedCols - 1)
+ {
+ if (rLastTab.GetRow() == 0)
{
- if ( aTableVec[nTableCount - 1]->GetRow() == 0)
+ InsertColumn();
+ size_t n = maTables.size();
+ for (size_t i = n - 1; i > 0; --i)
{
- InsertColumn();
- for (sal_Int16 i = sal::static_int_cast<sal_Int16>(nTableCount - 1); i > 0; i--)
- {
- sal_Int32 nColPos = aTableVec[i - 1]->GetColumn() +
- aTableVec[i]->GetSpannedCols() - 1;
- aTableVec[i - 1]->SetColsPerCol(nColPos,
- aTableVec[i - 1]->GetColsPerCol(nColPos) +
- aTableVec[nTableCount - 1]->GetColsPerCol(aTableVec[nTableCount - 1]->GetColumn()));
- aTableVec[i - 1]->SetRealCols(nColPos + 1,
- aTableVec[i - 1]->GetRealCols(nColPos)
- + aTableVec[i - 1]->GetColsPerCol(nColPos));
- aTableVec[i - 1]->SetChangedCols(nColPos);
- }
+ sal_Int32 nColPos =
+ maTables[i-1].GetColumn() + maTables[i].GetSpannedCols() - 1;
+
+ maTables[i-1].SetColsPerCol(nColPos,
+ maTables[i-1].GetColsPerCol(nColPos) +
+ rLastTab.GetColsPerCol(rLastTab.GetColumn()));
+
+ maTables[i-1].SetRealCols(
+ nColPos + 1,
+ maTables[i-1].GetRealCols(nColPos) + maTables[i-1].GetColsPerCol(nColPos));
+
+ maTables[i-1].SetChangedCols(nColPos);
}
}
}
@@ -522,21 +527,21 @@ void ScMyTables::NewColumn(sal_Bool bIsCovered)
void ScMyTables::AddColumn(sal_Bool bIsCovered)
{
- aTableVec[nTableCount - 1]->AddColumn();
- if (aTableVec[nTableCount - 1]->GetSubTableSpanned() > 1)
- aTableVec[nTableCount - 1]->SetSubTableSpanned(aTableVec[nTableCount - 1]->GetSubTableSpanned() - 1);
+ ScMyTableData& rLastTab = maTables.back();
+ rLastTab.AddColumn();
+ if (rLastTab.GetSubTableSpanned() > 1)
+ rLastTab.SetSubTableSpanned(rLastTab.GetSubTableSpanned() - 1);
else
{
NewColumn(bIsCovered);
- // if (!bIsCovered)
- aTableVec[nTableCount - 1]->SetRealCols(aTableVec[nTableCount - 1]->GetColumn() + 1,
- aTableVec[nTableCount - 1]->GetRealCols(aTableVec[nTableCount - 1]->GetColumn())
- + aTableVec[nTableCount - 1]->GetColsPerCol(aTableVec[nTableCount - 1]->GetColumn()));
- if ((!bIsCovered) || (bIsCovered &&
- (aTableVec[nTableCount - 1]->GetColsPerCol(aTableVec[nTableCount - 1]->GetColumn()) > 1)))
+ sal_Int32 nCol = rLastTab.GetColumn();
+ sal_Int32 nRow = rLastTab.GetRow();
+ rLastTab.SetRealCols(
+ nCol + 1, rLastTab.GetRealCols(nCol) + rLastTab.GetColsPerCol(nCol));
+
+ if ((!bIsCovered) || (bIsCovered && (rLastTab.GetColsPerCol(nCol) > 1)))
{
- if ((aTableVec[nTableCount - 1]->GetRowsPerRow(aTableVec[nTableCount - 1]->GetRow()) > 1) ||
- (aTableVec[nTableCount - 1]->GetColsPerCol(aTableVec[nTableCount - 1]->GetColumn()) > 1))
+ if ((rLastTab.GetRowsPerRow(nRow) > 1) || (rLastTab.GetColsPerCol(nCol) > 1))
DoMerge();
}
}
@@ -544,38 +549,41 @@ void ScMyTables::AddColumn(sal_Bool bIsCovered)
void ScMyTables::NewTable(sal_Int32 nTempSpannedCols)
{
- ++nTableCount;
- if (static_cast<sal_uInt32>(nTableCount) >= aTableVec.size())
- aTableVec.resize(aTableVec.size() + nDefaultTabCount);
- ScMyTableData* aTable(new ScMyTableData(nCurrentSheet));
- if (nTableCount > 1)
+ maTables.push_back(new ScMyTableData(nCurrentSheet));
+
+ if (maTables.size() > 1)
{
- ScMyTableData* pTableData = aTableVec[nTableCount - 2];
- const sal_Int32 nCol(pTableData->GetColumn());
- const sal_Int32 nColCount(pTableData->GetColCount());
- const sal_Int32 nColsPerCol(pTableData->GetColsPerCol(nCol));
- sal_Int32 nSpannedCols(pTableData->GetSpannedCols());
- sal_Int32 nTemp(nSpannedCols - nColCount);
- sal_Int32 nTemp2(nCol - (nColCount - 1));
+ ScMyTableData& rFirstTab = maTables.front();
+
+ const sal_Int32 nCol = rFirstTab.GetColumn();
+ const sal_Int32 nColCount = rFirstTab.GetColCount();
+ const sal_Int32 nColsPerCol = rFirstTab.GetColsPerCol(nCol);
+
+ sal_Int32 nSpannedCols = rFirstTab.GetSpannedCols();
+ sal_Int32 nTemp = nSpannedCols - nColCount;
+ sal_Int32 nTemp2 = nCol - nColCount + 1;
if ((nTemp > 0) && (nTemp2 == 0))
- nTempSpannedCols *= (nTemp + 1);
+ nTempSpannedCols *= nTemp + 1;
else
if (nColsPerCol > 1)
nTempSpannedCols *= nColsPerCol;
sal_Int32 nToMerge;
if (nSpannedCols > nColCount)
- nToMerge = pTableData->GetChangedCols(nCol, nCol + nColsPerCol + nSpannedCols - nColCount);
+ nToMerge = rFirstTab.GetChangedCols(nCol, nCol + nColsPerCol + nSpannedCols - nColCount);
else
- nToMerge = pTableData->GetChangedCols(nCol, nCol + nColsPerCol);
+ nToMerge = rFirstTab.GetChangedCols(nCol, nCol + nColsPerCol);
if (nToMerge > nCol)
nTempSpannedCols += nToMerge;
}
- aTable->SetSpannedCols(nTempSpannedCols);
- aTableVec[nTableCount - 1] = aTable;
- if (nTableCount > 1)
+
+ ScMyTableData& rNewTab = maTables.back();
+ rNewTab.SetSpannedCols(nTempSpannedCols);
+
+ size_t n = maTables.size();
+ if (n > 1)
{
- aTableVec[nTableCount - 2]->SetSubTableSpanned(aTable->GetSpannedCols());
+ maTables[n-2].SetSubTableSpanned(rNewTab.GetSpannedCols());
UnMerge();
}
}
@@ -584,7 +592,8 @@ void ScMyTables::UpdateRowHeights()
{
if (rImport.GetModel().is())
{
- rImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(rImport);
+
// update automatic row heights
// For sheets with any kind of shapes (including notes),
@@ -618,24 +627,18 @@ void ScMyTables::UpdateRowHeights()
pDoc->LockStreamValid( false );
}
}
-
- rImport.UnlockSolarMutex();
}
}
void ScMyTables::DeleteTable()
{
- rImport.LockSolarMutex();
+ ScXMLImport::MutexGuard aGuard(rImport);
nCurrentColStylePos = 0;
- if (nTableCount > 0)
- {
- ScMyTableData* aTable = aTableVec[nTableCount - 1];
- delete aTable;
- aTableVec[nTableCount - 1] = NULL;
- nTableCount--;
- }
- if (nTableCount == 0) // only set the styles if all subtables are importet and the table is finished
+ if (!maTables.empty())
+ maTables.pop_back();
+
+ if (maTables.empty()) // only set the styles if all subtables are importet and the table is finished
{
rImport.GetStylesImportHelper()->SetStylesToRanges();
rImport.SetStylesToRangesFinished();
@@ -654,18 +657,19 @@ void ScMyTables::DeleteTable()
aMatrixRangeList.clear();
}
- if (rImport.GetDocument() && bProtection)
+ if (rImport.GetDocument() && maProtectionData.mbProtected)
{
- uno::Sequence<sal_Int8> aPass;
- SvXMLUnitConverter::decodeBase64(aPass, sPassword);
+ uno::Sequence<sal_Int8> aHash;
+ SvXMLUnitConverter::decodeBase64(aHash, maProtectionData.maPassword);
+
auto_ptr<ScTableProtection> pProtect(new ScTableProtection);
- pProtect->setProtected(bProtection);
- pProtect->setPasswordHash(aPass, PASSHASH_OOO);
+ pProtect->setProtected(maProtectionData.mbProtected);
+ pProtect->setPasswordHash(aHash, maProtectionData.meHash1, maProtectionData.meHash2);
+ pProtect->setOption(ScTableProtection::SELECT_LOCKED_CELLS, maProtectionData.mbSelectProtectedCells);
+ pProtect->setOption(ScTableProtection::SELECT_UNLOCKED_CELLS, maProtectionData.mbSelectUnprotectedCells);
rImport.GetDocument()->SetTabProtection(static_cast<SCTAB>(nCurrentSheet), pProtect.get());
}
- rImport.UnlockSolarMutex();
-
//#95582#; find out whether it was possible to set the sheet name
// test it here, because if it is a linked table the name is changed by importing
// the linking informations
@@ -676,30 +680,23 @@ void ScMyTables::DeleteTable()
if (sCurrentName != sCurrentSheetName && rImport.GetDocument())
{
rImport.GetDocument()->RenameTab( static_cast<SCTAB>(nCurrentSheet),
- sCurrentSheetName, sal_False, sal_True);
-
-/* rtl::OUString sErrorMessage(RTL_CONSTASCII_USTRINGPARAM("Could not create a table with the name "));
- sErrorMessage += sCurrentSheetName;
- sErrorMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(". The new name is "));
- sErrorMessage += sCurrentName;
- uno::Sequence<rtl::OUString> aSeq(1);
- aSeq[0] = sErrorMessage;
- uno::Reference<xml::sax::XLocator> xLocator;
- rImport.SetError(XMLERROR_API | XMLERROR_FLAG_ERROR, aSeq, rtl::OUString(), xLocator);*/
+ sCurrentSheetName, false, sal_True);
}
}
}
table::CellAddress ScMyTables::GetRealCellPos()
{
- sal_Int32 nRow(0);
- sal_Int32 nCol(0);
- for (sal_Int32 i = 0; i < nTableCount; ++i)
+ sal_Int32 nRow = 0;
+ sal_Int32 nCol = 0;
+ size_t n = maTables.size();
+ for (size_t i = 0; i < n; ++i)
{
- ScMyTableData* pTableData = aTableVec[i];
- nCol += pTableData->GetRealCols(pTableData->GetColumn());
- nRow += pTableData->GetRealRows(pTableData->GetRow());
+ const ScMyTableData& rTab = maTables[i];
+ nCol += rTab.GetRealCols(rTab.GetColumn());
+ nRow += rTab.GetRealRows(rTab.GetRow());
}
+
aRealCellPos.Row = nRow;
aRealCellPos.Column = nCol;
aRealCellPos.Sheet = sal::static_int_cast<sal_Int16>(nCurrentSheet);
@@ -708,12 +705,13 @@ table::CellAddress ScMyTables::GetRealCellPos()
void ScMyTables::AddColCount(sal_Int32 nTempColCount)
{
- aTableVec[nTableCount - 1]->SetColCount(aTableVec[nTableCount - 1]->GetColCount() + nTempColCount);
+ ScMyTableData& rLastTab = maTables.back();
+ rLastTab.SetColCount(rLastTab.GetColCount() + nTempColCount);
}
void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCellStyleName)
{
- DBG_ASSERT(nTableCount == 1, "not possible to use default styles on columns in subtables");
+ DBG_ASSERT(maTables.size() == 1, "not possible to use default styles on columns in subtables");
rImport.GetStylesImportHelper()->AddColumnStyle(rCellStyleName, nCurrentColStylePos, nRepeat);
nCurrentColStylePos += nRepeat;
}
@@ -754,12 +752,10 @@ sal_Bool ScMyTables::HasXShapes()
return !((nCurrentSheet != nCurrentXShapes) || !xShapes.is());
}
-void ScMyTables::AddShape(uno::Reference <drawing::XShape>& rShape,
- rtl::OUString* pRangeList,
- table::CellAddress& rStartAddress, table::CellAddress& rEndAddress,
- sal_Int32 nEndX, sal_Int32 nEndY)
+void ScMyTables::AddOLE(uno::Reference <drawing::XShape>& rShape,
+ const rtl::OUString &rRangeList)
{
- aResizeShapes.AddShape(rShape, pRangeList, rStartAddress, rEndAddress, nEndX, nEndY);
+ aFixupOLEs.AddOLE(rShape, rRangeList);
}
void ScMyTables::AddMatrixRange(
@@ -780,17 +776,17 @@ void ScMyTables::AddMatrixRange(
sal_Bool ScMyTables::IsPartOfMatrix(sal_Int32 nColumn, sal_Int32 nRow)
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (!aMatrixRangeList.empty())
{
ScMyMatrixRangeList::iterator aItr(aMatrixRangeList.begin());
ScMyMatrixRangeList::iterator aEndItr(aMatrixRangeList.end());
- sal_Bool bReady(sal_False);
+ sal_Bool bReady(false);
while(!bReady && aItr != aEndItr)
{
if (nCurrentSheet > aItr->aRange.Sheet)
{
- DBG_ERROR("should never hapen, because the list should be cleared in DeleteTable");
+ OSL_FAIL("should never hapen, because the list should be cleared in DeleteTable");
aItr = aMatrixRangeList.erase(aItr);
}
else if ((nRow > aItr->aRange.EndRow) && (nColumn > aItr->aRange.EndColumn))
@@ -831,3 +827,5 @@ void ScMyTables::SetMatrix(const table::CellRangeAddress& rRange, const rtl::OUS
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx
index 6e39844b5b8f..32b02080a900 100644
--- a/sc/source/filter/xml/xmlsubti.hxx
+++ b/sc/source/filter/xml/xmlsubti.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,10 +37,13 @@
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/frame/XModel.hpp>
-#include <vector>
-#include <list>
#include "XMLTableShapeResizer.hxx"
#include "formula/grammar.hxx"
+#include "tabprotection.hxx"
+
+#include <vector>
+#include <list>
+#include <boost/ptr_container/ptr_vector.hpp>
class ScXMLImport;
@@ -89,7 +93,6 @@ public:
void SetChangedCols(const sal_Int32 nValue);
};
-//*******************************************************************************************************************************
struct ScMatrixRange
{
@@ -106,6 +109,18 @@ struct ScMatrixRange
}
};
+struct ScXMLTabProtectionData
+{
+ ::rtl::OUString maPassword;
+ ScPasswordHash meHash1;
+ ScPasswordHash meHash2;
+ bool mbProtected;
+ bool mbSelectProtectedCells;
+ bool mbSelectUnprotectedCells;
+
+ ScXMLTabProtectionData();
+};
+
class ScMyTables
{
private:
@@ -113,23 +128,21 @@ private:
ScXMLImport& rImport;
- ScMyShapeResizer aResizeShapes;
+ ScMyOLEFixer aFixupOLEs;
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > xCurrentSheet;
::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > xCurrentCellRange;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage;
::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShapes > xShapes;
rtl::OUString sCurrentSheetName;
- rtl::OUString sPassword;
- std::vector<ScMyTableData*> aTableVec;
+ ::boost::ptr_vector<ScMyTableData> maTables;
+ ScXMLTabProtectionData maProtectionData;
ScMyMatrixRangeList aMatrixRangeList;
com::sun::star::table::CellAddress aRealCellPos;
sal_Int32 nCurrentColStylePos;
sal_Int16 nCurrentDrawPage;
sal_Int16 nCurrentXShapes;
- sal_Int32 nTableCount;
sal_Int32 nCurrentSheet;
- sal_Bool bProtection;
sal_Bool IsMerged (const com::sun::star::uno::Reference <com::sun::star::table::XCellRange>& xCellRange,
const sal_Int32 nCol, const sal_Int32 nRow,
@@ -144,36 +157,36 @@ public:
ScMyTables(ScXMLImport& rImport);
~ScMyTables();
void NewSheet(const rtl::OUString& sTableName, const rtl::OUString& sStyleName,
- const sal_Bool bProtection, const rtl::OUString& sPassword);
+ const ScXMLTabProtectionData& rProtectData);
void AddRow();
void SetRowStyle(const rtl::OUString& rCellStyleName);
void AddColumn(sal_Bool bIsCovered);
void NewTable(sal_Int32 nTempSpannedCols);
void UpdateRowHeights();
- void ResizeShapes() { aResizeShapes.ResizeShapes(); }
+ void FixupOLEs() { aFixupOLEs.FixupOLEs(); }
+ sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const
+ { return ScMyOLEFixer::IsOLE(rShape); }
void DeleteTable();
com::sun::star::table::CellAddress GetRealCellPos();
void AddColCount(sal_Int32 nTempColCount);
void AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCellStyleName);
+ ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; }
rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; }
sal_Int32 GetCurrentSheet() const { return nCurrentSheet; }
- sal_Int32 GetCurrentColumn() const { return aTableVec[nTableCount - 1]->GetColCount(); }
- sal_Int32 GetCurrentRow() const { return aTableVec[nTableCount - 1]->GetRow(); }
+ sal_Int32 GetCurrentColumn() const { return maTables.back().GetColCount(); }
+ sal_Int32 GetCurrentRow() const { return maTables.back().GetRow(); }
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
- GetCurrentXSheet() { return xCurrentSheet; }
+ GetCurrentXSheet() const { return xCurrentSheet; }
::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange >
- GetCurrentXCellRange() { return xCurrentCellRange; }
+ GetCurrentXCellRange() const { return xCurrentCellRange; }
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
GetCurrentXDrawPage();
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
GetCurrentXShapes();
sal_Bool HasDrawPage();
sal_Bool HasXShapes();
- void AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
- rtl::OUString* pRangeList,
- com::sun::star::table::CellAddress& rStartAddress,
- com::sun::star::table::CellAddress& rEndAddress,
- sal_Int32 nEndX, sal_Int32 nEndY);
+ void AddOLE(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
+ const rtl::OUString &rRangeList);
void AddMatrixRange( sal_Int32 nStartColumn,
sal_Int32 nStartRow,
@@ -191,3 +204,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index 1644ad7e7ffe..cd78b8733d36 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,6 +64,11 @@
using namespace com::sun::star;
using namespace xmloff::token;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::xml::sax::XAttributeList;
+using ::rtl::OUString;
/**
* Determine whether this table is an external reference cache from its
@@ -153,7 +159,7 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
pExternalRefInfo(NULL),
nStartOffset(-1),
- bStartFormPage(sal_False),
+ bStartFormPage(false),
bPrintEntireSheet(sal_True)
{
// get start offset in file (if available)
@@ -161,10 +167,9 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport,
if (!bTempIsSubTable)
{
- sal_Bool bProtection(sal_False);
+ ScXMLTabProtectionData aProtectData;
rtl::OUString sName;
rtl::OUString sStyleName;
- rtl::OUString sPassword;
sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableAttrTokenMap();
for( sal_Int16 i=0; i < nAttrCount; ++i )
@@ -183,19 +188,25 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport,
case XML_TOK_TABLE_STYLE_NAME:
sStyleName = sValue;
break;
- case XML_TOK_TABLE_PROTECTION:
- bProtection = IsXMLToken(sValue, XML_TRUE);
- break;
+ case XML_TOK_TABLE_PROTECTED:
+ aProtectData.mbProtected = IsXMLToken(sValue, XML_TRUE);
+ break;
case XML_TOK_TABLE_PRINT_RANGES:
sPrintRanges = sValue;
break;
case XML_TOK_TABLE_PASSWORD:
- sPassword = sValue;
- break;
+ aProtectData.maPassword = sValue;
+ break;
+ case XML_TOK_TABLE_PASSHASH:
+ aProtectData.meHash1 = ScPassHashHelper::getHashTypeFromURI(sValue);
+ break;
+ case XML_TOK_TABLE_PASSHASH_2:
+ aProtectData.meHash2 = ScPassHashHelper::getHashTypeFromURI(sValue);
+ break;
case XML_TOK_TABLE_PRINT:
{
if (IsXMLToken(sValue, XML_FALSE))
- bPrintEntireSheet = sal_False;
+ bPrintEntireSheet = false;
}
break;
}
@@ -219,7 +230,7 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport,
else
{
// This is a regular table.
- GetScImport().GetTables().NewSheet(sName, sStyleName, bProtection, sPassword);
+ GetScImport().GetTables().NewSheet(sName, sStyleName, aProtectData);
}
}
else
@@ -271,36 +282,39 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
case XML_TOK_TABLE_COL_GROUP:
pContext = new ScXMLTableColsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_True );
+ false, sal_True );
break;
case XML_TOK_TABLE_HEADER_COLS:
pContext = new ScXMLTableColsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_True, sal_False );
+ sal_True, false );
break;
case XML_TOK_TABLE_COLS:
pContext = new ScXMLTableColsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_False );
+ false, false );
break;
case XML_TOK_TABLE_COL:
pContext = new ScXMLTableColContext( GetScImport(), nPrefix,
rLName, xAttrList );
break;
+ case XML_TOK_TABLE_PROTECTION:
+ pContext = new ScXMLTableProtectionContext( GetScImport(), nPrefix, rLName, xAttrList );
+ break;
case XML_TOK_TABLE_ROW_GROUP:
pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_True );
+ false, sal_True );
break;
case XML_TOK_TABLE_HEADER_ROWS:
pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_True, sal_False );
+ sal_True, false );
break;
case XML_TOK_TABLE_ROWS:
pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix,
rLName, xAttrList,
- sal_False, sal_False );
+ false, false );
break;
case XML_TOK_TABLE_ROW:
pContext = new ScXMLTableRowContext( GetScImport(), nPrefix,
@@ -344,79 +358,140 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
void ScXMLTableContext::EndElement()
{
- // get end offset in file (if available)
-// sal_Int32 nEndOffset = GetScImport().GetByteOffset();
-
- GetScImport().LockSolarMutex();
+ ScXMLImport::MutexGuard aMutexGuard(GetScImport());
GetScImport().GetStylesImportHelper()->EndTable();
ScDocument* pDoc(GetScImport().GetDocument());
- if (pDoc)
+ if (!pDoc)
+ return;
+
+ SCTAB nCurTab = static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet());
+ if (sPrintRanges.getLength())
{
- if (sPrintRanges.getLength())
+ Reference< sheet::XPrintAreas > xPrintAreas(
+ GetScImport().GetTables().GetCurrentXSheet(), UNO_QUERY);
+
+ if( xPrintAreas.is() )
{
- uno::Reference< sheet::XPrintAreas > xPrintAreas( GetScImport().GetTables().GetCurrentXSheet(), uno::UNO_QUERY );
- if( xPrintAreas.is() )
- {
- uno::Sequence< table::CellRangeAddress > aRangeList;
- ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO );
- xPrintAreas->setPrintAreas( aRangeList );
- }
+ Sequence< table::CellRangeAddress > aRangeList;
+ ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO );
+ xPrintAreas->setPrintAreas( aRangeList );
}
- else if (bPrintEntireSheet) pDoc->SetPrintEntireSheet(static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet()));
+ }
+ else if (!bPrintEntireSheet)
+ // Sheet has "print entire sheet" option by default. Remove it.
+ pDoc->ClearPrintRanges(nCurTab);
- ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet()), sal_False));
- if (pOutlineTable)
+ ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(nCurTab, false));
+ if (pOutlineTable)
+ {
+ ScOutlineArray* pColArray(pOutlineTable->GetColArray());
+ sal_Int32 nDepth(pColArray->GetDepth());
+ sal_Int32 i;
+ for (i = 0; i < nDepth; ++i)
{
- ScOutlineArray* pColArray(pOutlineTable->GetColArray());
- sal_Int32 nDepth(pColArray->GetDepth());
- sal_Int32 i;
- for (i = 0; i < nDepth; ++i)
- {
- sal_Int32 nCount(pColArray->GetCount(static_cast<sal_uInt16>(i)));
- for (sal_Int32 j = 0; j < nCount; ++j)
- {
- ScOutlineEntry* pEntry(pColArray->GetEntry(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j)));
- if (pEntry->IsHidden())
- pColArray->SetVisibleBelow(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j), sal_False);
- }
- }
- ScOutlineArray* pRowArray(pOutlineTable->GetRowArray());
- nDepth = pRowArray->GetDepth();
- for (i = 0; i < nDepth; ++i)
+ sal_Int32 nCount(pColArray->GetCount(static_cast<sal_uInt16>(i)));
+ for (sal_Int32 j = 0; j < nCount; ++j)
{
- sal_Int32 nCount(pRowArray->GetCount(static_cast<sal_uInt16>(i)));
- for (sal_Int32 j = 0; j < nCount; ++j)
- {
- ScOutlineEntry* pEntry(pRowArray->GetEntry(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j)));
- if (pEntry->IsHidden())
- pRowArray->SetVisibleBelow(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j), sal_False);
- }
+ ScOutlineEntry* pEntry(pColArray->GetEntry(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j)));
+ if (pEntry->IsHidden())
+ pColArray->SetVisibleBelow(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j), false);
}
}
- if (GetScImport().GetTables().HasDrawPage())
+ ScOutlineArray* pRowArray(pOutlineTable->GetRowArray());
+ nDepth = pRowArray->GetDepth();
+ for (i = 0; i < nDepth; ++i)
{
- if (GetScImport().GetTables().HasXShapes())
+ sal_Int32 nCount(pRowArray->GetCount(static_cast<sal_uInt16>(i)));
+ for (sal_Int32 j = 0; j < nCount; ++j)
{
- GetScImport().GetShapeImport()->popGroupAndSort();
- uno::Reference < drawing::XShapes > xTempShapes(GetScImport().GetTables().GetCurrentXShapes());
- GetScImport().GetShapeImport()->endPage(xTempShapes);
+ ScOutlineEntry* pEntry(pRowArray->GetEntry(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j)));
+ if (pEntry->IsHidden())
+ pRowArray->SetVisibleBelow(static_cast<sal_uInt16>(i), static_cast<sal_uInt16>(j), false);
}
- if (bStartFormPage)
- GetScImport().GetFormImport()->endPage();
}
+ }
+ if (GetScImport().GetTables().HasDrawPage())
+ {
+ if (GetScImport().GetTables().HasXShapes())
+ {
+ GetScImport().GetShapeImport()->popGroupAndSort();
+ uno::Reference < drawing::XShapes > xTempShapes(GetScImport().GetTables().GetCurrentXShapes());
+ GetScImport().GetShapeImport()->endPage(xTempShapes);
+ }
+ if (bStartFormPage)
+ GetScImport().GetFormImport()->endPage();
+ }
+
+ GetScImport().GetTables().DeleteTable();
+ GetScImport().ProgressBarIncrement(false);
+
+ // store stream positions
+ if (!pExternalRefInfo.get() && nStartOffset >= 0 /* && nEndOffset >= 0 */)
+ {
+ ScSheetSaveData* pSheetData = ScModelObj::getImplementation(GetScImport().GetModel())->GetSheetSaveData();
+ sal_Int32 nTab = GetScImport().GetTables().GetCurrentSheet();
+ // pSheetData->AddStreamPos( nTab, nStartOffset, nEndOffset );
+ pSheetData->StartStreamPos( nTab, nStartOffset );
+ }
+}
- GetScImport().GetTables().DeleteTable();
- GetScImport().ProgressBarIncrement(sal_False);
+// ============================================================================
- // store stream positions
- if (!pExternalRefInfo.get() && nStartOffset >= 0 /* && nEndOffset >= 0 */)
+ScXMLImport& ScXMLTableProtectionContext::GetScImport()
+{
+ return static_cast<ScXMLImport&>(GetImport());
+}
+
+ScXMLTableProtectionContext::ScXMLTableProtectionContext(
+ ScXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLName,
+ const Reference<XAttributeList>& xAttrList ) :
+ SvXMLImportContext( rImport, nPrefix, rLName )
+{
+ const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableProtectionAttrTokenMap();
+ bool bSelectProtectedCells = false;
+ bool bSelectUnprotectedCells = false;
+
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+
+ for (sal_Int16 i = 0; i < nAttrCount; ++i)
+ {
+ const OUString& aAttrName = xAttrList->getNameByIndex(i);
+ const OUString aValue = xAttrList->getValueByIndex(i);
+
+ OUString aLocalName;
+ sal_uInt16 nLocalPrefix = GetScImport().GetNamespaceMap().GetKeyByAttrName(
+ aAttrName, &aLocalName);
+
+ switch (rAttrTokenMap.Get(nLocalPrefix, aLocalName))
{
- ScSheetSaveData* pSheetData = ScModelObj::getImplementation(GetScImport().GetModel())->GetSheetSaveData();
- sal_Int32 nTab = GetScImport().GetTables().GetCurrentSheet();
- // pSheetData->AddStreamPos( nTab, nStartOffset, nEndOffset );
- pSheetData->StartStreamPos( nTab, nStartOffset );
+ case XML_TOK_TABLE_SELECT_PROTECTED_CELLS:
+ bSelectProtectedCells = IsXMLToken(aValue, XML_TRUE);
+ break;
+ case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS:
+ bSelectUnprotectedCells = IsXMLToken(aValue, XML_TRUE);
+ break;
+ default:
+ ;
}
}
- GetScImport().UnlockSolarMutex();
+
+ ScXMLTabProtectionData& rProtectData = GetScImport().GetTables().GetCurrentProtectionData();
+ rProtectData.mbSelectProtectedCells = bSelectProtectedCells;
+ rProtectData.mbSelectUnprotectedCells = bSelectUnprotectedCells;
+}
+
+ScXMLTableProtectionContext::~ScXMLTableProtectionContext()
+{
+}
+
+SvXMLImportContext* ScXMLTableProtectionContext::CreateChildContext(
+ sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, const Reference<XAttributeList>& /*xAttrList*/ )
+{
+ return NULL;
+}
+
+void ScXMLTableProtectionContext::EndElement()
+{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmltabi.hxx b/sc/source/filter/xml/xmltabi.hxx
index 9a60f4fcc170..d3d7303d3203 100644
--- a/sc/source/filter/xml/xmltabi.hxx
+++ b/sc/source/filter/xml/xmltabi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ public:
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- const sal_Bool bTempIsSubTable = sal_False,
+ const sal_Bool bTempIsSubTable = false,
const sal_Int32 nSpannedCols = 0);
virtual ~ScXMLTableContext();
@@ -75,4 +76,28 @@ public:
virtual void EndElement();
};
+// ============================================================================
+
+class ScXMLTableProtectionContext : public SvXMLImportContext
+{
+ ScXMLImport& GetScImport();
+
+public:
+ ScXMLTableProtectionContext( ScXMLImport& rImport, sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
+
+ virtual ~ScXMLTableProtectionContext();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
+
+ virtual void EndElement();
+};
+
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 9e721b7e9b1a..2bed48ed5d81 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
-
#include <rsc/rscsfx.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
#include <tools/debug.hxx>
-#include <vos/xception.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/streamwrap.hxx>
#include <svx/xmlgrhlp.hxx>
@@ -88,6 +85,8 @@
using namespace com::sun::star;
using ::rtl::OUString;
+using rtl::OUString;
+
// -----------------------------------------------------------------------
ScXMLImportWrapper::ScXMLImportWrapper(ScDocument& rD, SfxMedium* pM, const uno::Reference < embed::XStorage >& xStor ) :
@@ -98,35 +97,6 @@ ScXMLImportWrapper::ScXMLImportWrapper(ScDocument& rD, SfxMedium* pM, const uno:
DBG_ASSERT( pMedium || xStorage.is(), "ScXMLImportWrapper: Medium or Storage must be set" );
}
-//UNUSED2008-05 uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator(
-//UNUSED2008-05 uno::Reference < frame::XModel> & rModel)
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ERROR( "The status indicator from medium must be used!" );
-//UNUSED2008-05
-//UNUSED2008-05 uno::Reference<task::XStatusIndicator> xStatusIndicator;
-//UNUSED2008-05
-//UNUSED2008-05 if (rModel.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<frame::XController> xController( rModel->getCurrentController());
-//UNUSED2008-05 if ( xController.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 uno::Reference<task::XStatusIndicatorFactory> xFactory( xController->getFrame(), uno::UNO_QUERY );
-//UNUSED2008-05 if ( xFactory.is())
-//UNUSED2008-05 {
-//UNUSED2008-05 try
-//UNUSED2008-05 {
-//UNUSED2008-05 xStatusIndicator.set(xFactory->createStatusIndicator());
-//UNUSED2008-05 }
-//UNUSED2008-05 catch ( lang::DisposedException e )
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ERROR("Exception while trying to get a Status Indicator");
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 return xStatusIndicator;
-//UNUSED2008-05 }
-
uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator()
{
uno::Reference<task::XStatusIndicator> xStatusIndicator;
@@ -154,12 +124,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
if ( !xStorage.is() && pMedium )
xStorage = pMedium->GetStorage();
- // Get data source ...
-
-// uno::Reference< uno::XInterface > xPipe;
-// uno::Reference< io::XActiveDataSource > xSource;
-
- sal_Bool bEncrypted = sal_False;
+ sal_Bool bEncrypted = false;
rtl::OUString sStream(sDocName);
if( xStorage.is() )
{
@@ -174,7 +139,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
sStream = sOldDocName;
}
else
- return sal_False;
+ return false;
aParserInput.aInputStream = xDocStream->getInputStream();
uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY );
@@ -195,32 +160,6 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
return SCERR_IMPORT_UNKNOWN;
}
}
- // #99667#; no longer necessary
-/* else if ( pMedium )
- {
- // if there is a medium and if this medium has a load environment,
- // we get an active data source from the medium.
- pMedium->GetInStream()->Seek( 0 );
- xSource = pMedium->GetDataSource();
- DBG_ASSERT( xSource.is(), "got no data source from medium" );
- if( !xSource.is() )
- return sal_False;
-
- // get a pipe for connecting the data source to the parser
- xPipe = xServiceFactory->createInstance(
- OUString::createFromAscii("com.sun.star.io.Pipe") );
- DBG_ASSERT( xPipe.is(),
- "XMLReader::Read: com.sun.star.io.Pipe service missing" );
- if( !xPipe.is() )
- return sal_False;
-
- // connect pipe's output stream to the data source
- uno::Reference<io::XOutputStream> xPipeOutput( xPipe, uno::UNO_QUERY );
- xSource->setOutputStream( xPipeOutput );
-
- aParserInput.aInputStream =
- uno::Reference< io::XInputStream >( xPipe, uno::UNO_QUERY );
- }*/
else
return SCERR_IMPORT_UNKNOWN;
@@ -252,14 +191,6 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
uno::Reference<xml::sax::XParser> xParser( xXMLParser, uno::UNO_QUERY );
xParser->setDocumentHandler( xDocHandler );
- // parse
-/* if( xSource.is() )
- {
- uno::Reference<io::XActiveDataControl> xSourceControl( xSource, uno::UNO_QUERY );
- if( xSourceControl.is() )
- xSourceControl->start();
- }*/
-
try
{
xParser->parseStream( aParserInput );
@@ -277,7 +208,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
if ( aSaxEx.WrappedException >>= aTmp )
aSaxEx = aTmp;
else
- bTryChild = sal_False;
+ bTryChild = false;
}
packages::zip::ZipIOException aBrokenPackage;
@@ -391,7 +322,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
comphelper::getProcessServiceFactory();
DBG_ASSERT( xServiceFactory.is(), "got no service manager" );
if( !xServiceFactory.is() )
- return sal_False;
+ return false;
xml::sax::InputSource aParserInput;
if (pMedium)
@@ -406,7 +337,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser" )) ));
DBG_ASSERT( xXMLParser.is(), "com.sun.star.xml.sax.Parser service missing" );
if( !xXMLParser.is() )
- return sal_False;
+ return false;
// get filter
SfxObjectShell* pObjSh = rDoc.GetDocumentShell();
@@ -479,7 +410,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
aName = pDocHierarchItem->GetValue();
}
else
- aName = ::rtl::OUString::createFromAscii( "dummyObjectName" );
+ aName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "dummyObjectName" ));
if( aName.getLength() )
{
@@ -504,7 +435,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
: rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaImporter")),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml")),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Meta.xml")), aMetaArgs,
- sal_False);
+ false);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import end" );
}
@@ -522,7 +453,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
if( pObjSh )
{
- pObjectHelper = SvXMLEmbeddedObjectHelper::Create(xStorage, *pObjSh, EMBEDDEDOBJECTHELPER_MODE_READ, sal_False );
+ pObjectHelper = SvXMLEmbeddedObjectHelper::Create(xStorage, *pObjSh, EMBEDDEDOBJECTHELPER_MODE_READ, false );
xObjectResolver = pObjectHelper;
}
}
@@ -549,7 +480,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
bOasis ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisSettingsImporter"))
: rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLSettingsImporter")),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("settings.xml")),
- sEmpty, aSettingsArgs, sal_False);
+ sEmpty, aSettingsArgs, false);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "settings import end" );
}
@@ -597,7 +528,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
if (xStatusIndicator.is())
xStatusIndicator->end();
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
if (bStylesOnly)
{
if (nStylesRetval)
@@ -668,7 +599,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
// Don't test bStylesRetval and bMetaRetval, because it could be an older file which not contain such streams
return bRet;//!bStylesOnly ? bDocRetval : bStylesRetval;
}
- return sal_False;
+ return false;
}
bool lcl_HasValidStream(ScDocument& rDoc)
@@ -696,7 +627,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
const rtl::OUString& sMediaType, const rtl::OUString& sComponentName,
const sal_Bool bPlainText, uno::Sequence<uno::Any>& aArgs, ScMySharedData*& pSharedData)
{
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
uno::Reference<io::XOutputStream> xOut;
uno::Reference<io::XStream> xStream;
@@ -716,7 +647,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
xSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny(sMediaType));
OUString aUseCommonPassPropName( RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") );
if (bPlainText)
- xSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), uno::makeAny(sal_False));
+ xSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), uno::makeAny(false));
// even plain stream should be encrypted in encrypted documents
xSet->setPropertyValue( aUseCommonPassPropName, uno::makeAny(sal_True) );
@@ -724,11 +655,6 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
xOut = xStream->getOutputStream();
}
- // #99667#; no longer necessary
-/* else if ( pMedium )
- {
- xOut = pMedium->GetDataSink();
- }*/
// set Base URL
uno::Reference< beans::XPropertySet > xInfoSet;
@@ -759,7 +685,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
pExport->SetSharedData(pSharedData);
// if there are sheets to copy, get the source stream
- if ( sName.equalsAscii("content.xml") && lcl_HasValidStream(rDoc) &&
+ if ( sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("content.xml")) && lcl_HasValidStream(rDoc) &&
( pExport->getExportFlags() & EXPORT_OASIS ) )
{
// old stream is still in this file's storage - open read-only
@@ -800,18 +726,15 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (rDoc.IsStreamValid(nTab))
- rDoc.SetStreamValid(nTab, sal_False);
+ rDoc.SetStreamValid(nTab, false);
}
}
else
bRet = xFilter->filter( aDescriptor );
pSharedData = pExport->GetSharedData();
-
- //stream is closed by SAX parser
- //if (xOut.is())
- // xOut->closeOutput();
}
+
return bRet;
}
@@ -822,13 +745,13 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
uno::Reference<lang::XMultiServiceFactory> xServiceFactory(comphelper::getProcessServiceFactory());
DBG_ASSERT( xServiceFactory.is(), "got no service manager" );
if( !xServiceFactory.is() )
- return sal_False;
+ return false;
uno::Reference<uno::XInterface> xWriter(xServiceFactory->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" )) ));
DBG_ASSERT( xWriter.is(), "com.sun.star.xml.sax.Writer service missing" );
if(!xWriter.is())
- return sal_False;
+ return false;
if ( !xStorage.is() && pMedium )
xStorage = pMedium->GetOutputStorage();
@@ -889,7 +812,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
// TODO/LATER: do not do it for embedded links
if( SFX_CREATE_MODE_EMBEDDED == pObjSh->GetCreateMode() )
{
- OUString aName = ::rtl::OUString::createFromAscii( "dummyObjectName" );
+ OUString aName(RTL_CONSTASCII_USTRINGPARAM("dummyObjectName"));
if ( pMedium && pMedium->GetItemSet() )
{
const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
@@ -906,9 +829,9 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
}
sal_Bool bMetaRet(pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED);
- sal_Bool bStylesRet (sal_False);
- sal_Bool bDocRet(sal_False);
- sal_Bool bSettingsRet(sal_False);
+ sal_Bool bStylesRet (false);
+ sal_Bool bDocRet(false);
+ sal_Bool bSettingsRet(false);
ScMySharedData* pSharedData = NULL;
sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
@@ -942,13 +865,13 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
if( xStorage.is() )
{
- pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE, sal_False );
+ pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE, false );
xGrfContainer = pGraphicHelper;
}
if( pObjSh )
{
- pObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *pObjSh, EMBEDDEDOBJECTHELPER_MODE_WRITE, sal_False );
+ pObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *pObjSh, EMBEDDEDOBJECTHELPER_MODE_WRITE, false );
xObjectResolver = pObjectHelper;
}
@@ -970,7 +893,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sTextMediaType,
bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisStylesExporter"))
: rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLStylesExporter")),
- sal_False, aStylesArgs, pSharedData);
+ false, aStylesArgs, pSharedData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "styles export end" );
}
@@ -994,7 +917,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sTextMediaType,
bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisContentExporter"))
: rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLContentExporter")),
- sal_False, aDocArgs, pSharedData);
+ false, aDocArgs, pSharedData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "content export end" );
}
@@ -1022,7 +945,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sTextMediaType,
bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisSettingsExporter"))
: rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLSettingsExporter")),
- sal_False, aSettingsArgs, pSharedData);
+ false, aSettingsArgs, pSharedData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "settings export end" );
}
@@ -1037,8 +960,8 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
// later: give string descriptor as parameter for doc type
- return sal_False;
+ return false;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibilityHints.cxx b/sc/source/ui/Accessibility/AccessibilityHints.cxx
index 6c276b806e88..d0b9d3192da6 100644
--- a/sc/source/ui/Accessibility/AccessibilityHints.cxx
+++ b/sc/source/ui/Accessibility/AccessibilityHints.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110,3 +111,5 @@ ScAccGridWinFocusGotHint::ScAccGridWinFocusGotHint(ScSplitPos eNew,
ScAccGridWinFocusGotHint::~ScAccGridWinFocusGotHint()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 5621453ae006..e3ee6d51b165 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,20 +41,13 @@
#include "document.hxx"
#include "attrib.hxx"
#include "miscuno.hxx"
-#include "unoguard.hxx"
#include "editsrc.hxx"
#include "dociter.hxx"
#include "cell.hxx"
-#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX
#include <unotools/accessiblestatesethelper.hxx>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
#include <rtl/uuid.h>
@@ -61,6 +55,7 @@
#include <editeng/brshitem.hxx>
#include <comphelper/sequence.hxx>
#include <float.h>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -105,8 +100,8 @@ void ScAccessibleCell::Init()
void SAL_CALL ScAccessibleCell::disposing()
{
- ScUnoGuard aGuard;
- // #100593# dispose in AccessibleStaticTextBase
+ SolarMutexGuard aGuard;
+ // dispose in AccessibleStaticTextBase
Dispose();
if (mpViewShell)
@@ -139,7 +134,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleCell::getAccessibleAtPoint(
void SAL_CALL ScAccessibleCell::grabFocus( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (getAccessibleParent().is() && mpViewShell)
{
@@ -232,7 +227,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
ScAccessibleCell::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -270,7 +265,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL
ScAccessibleCell::getAccessibleRelationSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
utl::AccessibleRelationSetHelper* pRelationSet = NULL;
if (mpAccDoc)
@@ -348,7 +343,7 @@ sal_Bool ScAccessibleCell::IsOpaque(
sal_Bool ScAccessibleCell::IsSelected()
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (mpViewShell && mpViewShell->GetViewData())
{
const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
@@ -384,7 +379,7 @@ void ScAccessibleCell::FillDependends(utl::AccessibleRelationSetHelper* pRelatio
{
if (pCell->GetCellType() == CELLTYPE_FORMULA)
{
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
ScDetectiveRefIter aIter( (ScFormulaCell*) pCell );
ScRange aRef;
while ( !bFound && aIter.GetNextRef( aRef ) )
@@ -457,3 +452,5 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange,
pRelationSet->AddRelation(aRelation);
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
index 4bd8a64434e6..1428756f1ff4 100644
--- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,19 +37,12 @@
#include "document.hxx"
#include "docfunc.hxx"
#include "cell.hxx"
-#include "unoguard.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
#include "unonames.hxx"
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <tools/debug.hxx>
@@ -56,6 +50,7 @@
#include <rtl/uuid.h>
#include <comphelper/sequence.hxx>
#include <sfx2/objsh.hxx>
+#include <vcl/svapp.hxx>
#include <float.h>
@@ -86,7 +81,7 @@ ScAccessibleCellBase::~ScAccessibleCellBase()
sal_Bool SAL_CALL ScAccessibleCellBase::isVisible( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
// test whether the cell is hidden (column/row - hidden/filtered)
sal_Bool bVisible(sal_True);
@@ -98,7 +93,7 @@ sal_Bool SAL_CALL ScAccessibleCellBase::isVisible( )
bool bRowFiltered = mpDoc->RowFiltered(maCellAddress.Row(), maCellAddress.Tab());
if (bColHidden || bColFiltered || bRowHidden || bRowFiltered)
- bVisible = sal_False;
+ bVisible = false;
}
return bVisible;
}
@@ -106,7 +101,7 @@ sal_Bool SAL_CALL ScAccessibleCellBase::isVisible( )
sal_Int32 SAL_CALL ScAccessibleCellBase::getForeground()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
if (mpDoc)
@@ -146,7 +141,7 @@ sal_Int32 SAL_CALL ScAccessibleCellBase::getForeground()
sal_Int32 SAL_CALL ScAccessibleCellBase::getBackground()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
@@ -212,7 +207,7 @@ sal_Int32
ScAccessibleCellBase::getAccessibleIndexInParent(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return mnIndex;
}
@@ -249,7 +244,7 @@ uno::Any SAL_CALL
ScAccessibleCellBase::getCurrentValue( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Any aAny;
if (mpDoc)
@@ -262,10 +257,10 @@ sal_Bool SAL_CALL
ScAccessibleCellBase::setCurrentValue( const uno::Any& aNumber )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
double fValue = 0;
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if((aNumber >>= fValue) && mpDoc && mpDoc->GetDocumentShell())
{
uno::Reference<XAccessibleStateSet> xParentStates;
@@ -324,7 +319,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleCellBase::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -338,8 +333,10 @@ uno::Sequence<sal_Int8> SAL_CALL
sal_Bool ScAccessibleCellBase::IsEditable(
const uno::Reference<XAccessibleStateSet>& rxParentStates)
{
- sal_Bool bEditable(sal_False);
+ sal_Bool bEditable(false);
if (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::EDITABLE))
bEditable = sal_True;
return bEditable;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index 0f1fcfa337a5..314fddb334c7 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,19 +31,14 @@
#include "AccessibleContextBase.hxx"
-#include "unoguard.hxx"
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <rtl/uuid.h>
#include <tools/debug.hxx>
#include <tools/gen.hxx>
-#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX
#include <unotools/accessiblestatesethelper.hxx>
-#endif
#include <toolkit/helper/convert.hxx>
#include <svl/smplhint.hxx>
#include <comphelper/sequence.hxx>
@@ -50,6 +46,7 @@
#include <vcl/unohelp.hxx>
#include <tools/color.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
+#include <vcl/svapp.hxx>
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -102,7 +99,7 @@ void ScAccessibleContextBase::Init()
void SAL_CALL ScAccessibleContextBase::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// CommitDefunc(); not necessary and should not be send, because it cost a lot of time
// hold reference to make sure that the destructor is not called
@@ -176,7 +173,7 @@ uno::Reference< XAccessibleContext> SAL_CALL
sal_Bool SAL_CALL ScAccessibleContextBase::containsPoint(const awt::Point& rPoint )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return Rectangle (Point(), GetBoundingBox().GetSize()).IsInside(VCLPoint(rPoint));
}
@@ -185,14 +182,14 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleContextBase::getAccessibleAtP
const awt::Point& /* rPoint */ )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
return uno::Reference<XAccessible>();
}
awt::Rectangle SAL_CALL ScAccessibleContextBase::getBounds( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return AWTRectangle(GetBoundingBox());
}
@@ -200,7 +197,7 @@ awt::Rectangle SAL_CALL ScAccessibleContextBase::getBounds( )
awt::Point SAL_CALL ScAccessibleContextBase::getLocation( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return AWTPoint(GetBoundingBox().TopLeft());
}
@@ -208,7 +205,7 @@ awt::Point SAL_CALL ScAccessibleContextBase::getLocation( )
awt::Point SAL_CALL ScAccessibleContextBase::getLocationOnScreen( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return AWTPoint(GetBoundingBoxOnScreen().TopLeft());
}
@@ -216,7 +213,7 @@ awt::Point SAL_CALL ScAccessibleContextBase::getLocationOnScreen( )
awt::Size SAL_CALL ScAccessibleContextBase::getSize( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return AWTSize(GetBoundingBox().GetSize());
}
@@ -224,9 +221,9 @@ awt::Size SAL_CALL ScAccessibleContextBase::getSize( )
sal_Bool SAL_CALL ScAccessibleContextBase::isShowing( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
- sal_Bool bShowing(sal_False);
+ sal_Bool bShowing(false);
if (mxParent.is())
{
uno::Reference<XAccessibleComponent> xParentComponent (mxParent->getAccessibleContext(), uno::UNO_QUERY);
@@ -249,7 +246,7 @@ sal_Bool SAL_CALL ScAccessibleContextBase::isVisible( )
void SAL_CALL ScAccessibleContextBase::grabFocus( )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
sal_Int32 SAL_CALL ScAccessibleContextBase::getForeground( )
@@ -270,7 +267,7 @@ sal_Int32 SAL_CALL
ScAccessibleContextBase::getAccessibleChildCount(void)
throw (uno::RuntimeException)
{
- DBG_ERROR("should be implemented in the abrevated class");
+ OSL_FAIL("should be implemented in the abrevated class");
return 0;
}
@@ -278,7 +275,7 @@ uno::Reference<XAccessible> SAL_CALL
ScAccessibleContextBase::getAccessibleChild(sal_Int32 /* nIndex */)
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- DBG_ERROR("should be implemented in the abrevated class");
+ OSL_FAIL("should be implemented in the abrevated class");
return uno::Reference<XAccessible>();
}
@@ -293,7 +290,7 @@ sal_Int32 SAL_CALL
ScAccessibleContextBase::getAccessibleIndexInParent(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
// Use a simple but slow solution for now. Optimize later.
// Return -1 to indicate that this object's parent does not know about the
@@ -334,12 +331,11 @@ sal_Int16 SAL_CALL
ScAccessibleContextBase::getAccessibleDescription(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!msDescription.getLength())
{
OUString sDescription(createAccessibleDescription());
-// DBG_ASSERT(sDescription.getLength(), "We should give always a descripition.");
if (msDescription != sDescription)
{
@@ -361,7 +357,7 @@ OUString SAL_CALL
ScAccessibleContextBase::getAccessibleName(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!msName.getLength())
{
@@ -403,7 +399,7 @@ lang::Locale SAL_CALL
throw (IllegalAccessibleComponentStateException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mxParent.is())
{
@@ -427,7 +423,7 @@ void SAL_CALL
{
if (xListener.is())
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!IsDefunc())
{
@@ -445,7 +441,7 @@ void SAL_CALL
{
if (xListener.is())
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!IsDefunc() && mnClientId)
{
sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, xListener );
@@ -468,7 +464,7 @@ void SAL_CALL ScAccessibleContextBase::disposing(
const lang::EventObject& rSource )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (rSource.Source == mxParent)
dispose();
}
@@ -501,7 +497,7 @@ sal_Bool SAL_CALL
for (int i=0; i<nLength; ++i, ++pServiceNames)
if (sServiceName == *pServiceNames)
return sal_True;
- return sal_False;
+ return false;
}
uno::Sequence< ::rtl::OUString> SAL_CALL
@@ -531,7 +527,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleContextBase::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -548,7 +544,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleContextBase::createAccessibleDescription(void)
throw (uno::RuntimeException)
{
- DBG_ERROR("should be implemented in the abrevated class");
+ OSL_FAIL("should be implemented in the abrevated class");
return rtl::OUString();
}
@@ -556,7 +552,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleContextBase::createAccessibleName(void)
throw (uno::RuntimeException)
{
- DBG_ERROR("should be implemented in the abrevated class");
+ OSL_FAIL("should be implemented in the abrevated class");
return rtl::OUString();
}
@@ -608,14 +604,14 @@ void ScAccessibleContextBase::CommitFocusLost() const
Rectangle ScAccessibleContextBase::GetBoundingBoxOnScreen(void) const
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
return Rectangle();
}
Rectangle ScAccessibleContextBase::GetBoundingBox(void) const
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
return Rectangle();
}
@@ -626,3 +622,4 @@ void ScAccessibleContextBase::IsObjectValid() const
throw lang::DisposedException();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index e99bd1971e4c..b85aca92fa41 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,8 @@
// ============================================================================
#include "AccessibleCsvControl.hxx"
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLERELATIONTYPE_HPP_
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleTextType.hpp>
#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
@@ -45,9 +42,7 @@
#include <rtl/uuid.h>
#include <toolkit/helper/convert.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
-#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX
#include <unotools/accessiblestatesethelper.hxx>
-#endif
#include <comphelper/sequence.hxx>
#include "scitems.hxx"
#include <editeng/fontitem.hxx>
@@ -58,11 +53,11 @@
#include "csvgrid.hxx"
#include "AccessibleText.hxx"
#include "editsrc.hxx"
-#include "unoguard.hxx"
#include "scresid.hxx"
#include "sc.hrc"
#include "scmod.hxx"
#include <svtools/colorcfg.hxx>
+#include <vcl/svapp.hxx>
// ause
#include "editutil.hxx"
@@ -124,7 +119,7 @@ ScAccessibleCsvControl::~ScAccessibleCsvControl()
void SAL_CALL ScAccessibleCsvControl::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
mpControl = NULL;
ScAccessibleContextBase::disposing();
}
@@ -141,14 +136,14 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvControl::getAccessibleAtPoint(
sal_Bool SAL_CALL ScAccessibleCsvControl::isVisible() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetControl().IsVisible();
}
void SAL_CALL ScAccessibleCsvControl::grabFocus() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
implGetControl().GrabFocus();
}
@@ -205,21 +200,21 @@ void ScAccessibleCsvControl::SendRemoveColumnEvent( sal_uInt32 /* nFirstColumn *
Rectangle ScAccessibleCsvControl::GetBoundingBoxOnScreen() const throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetControl().GetWindowExtentsRelative( NULL );
}
Rectangle ScAccessibleCsvControl::GetBoundingBox() const throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetControl().GetWindowExtentsRelative( implGetControl().GetAccessibleParentWindow() );
}
void ScAccessibleCsvControl::getUuid( Sequence< sal_Int8 >& rSeq )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
if( !rSeq.hasElements() )
{
@@ -269,7 +264,7 @@ Reference< XAccessible > ScAccessibleCsvControl::implGetChildByRole(
AccessibleStateSetHelper* ScAccessibleCsvControl::implCreateStateSet()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
AccessibleStateSetHelper* pStateSet = new AccessibleStateSetHelper();
if( implIsAlive() )
{
@@ -395,7 +390,7 @@ ScAccessibleCsvRuler::~ScAccessibleCsvRuler()
sal_Int32 SAL_CALL ScAccessibleCsvRuler::getForeground( )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetRuler().GetSettings().GetStyleSettings().GetLabelTextColor().GetColor();
}
@@ -403,7 +398,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvRuler::getForeground( )
sal_Int32 SAL_CALL ScAccessibleCsvRuler::getBackground( )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetRuler().GetSettings().GetStyleSettings().GetFaceColor().GetColor();
}
@@ -426,7 +421,7 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvRuler::getAccessibleChild( sal_
Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvRuler::getAccessibleRelationSet()
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
AccessibleRelationSetHelper* pRelationSet = new AccessibleRelationSetHelper();
Reference< XAccessible > xAccObj = implGetChildByRole( getAccessibleParent(), nGridRole );
@@ -442,7 +437,7 @@ Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvRuler::getAccessible
Reference< XAccessibleStateSet > SAL_CALL ScAccessibleCsvRuler::getAccessibleStateSet()
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
AccessibleStateSetHelper* pStateSet = implCreateStateSet();
if( implIsAlive() )
{
@@ -459,7 +454,7 @@ Reference< XAccessibleStateSet > SAL_CALL ScAccessibleCsvRuler::getAccessibleSta
sal_Int32 SAL_CALL ScAccessibleCsvRuler::getCaretPosition() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return lcl_GetApiPos( implGetRuler().GetRulerCursorPos() );
}
@@ -467,7 +462,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvRuler::getCaretPosition() throw( RuntimeExcept
sal_Bool SAL_CALL ScAccessibleCsvRuler::setCaretPosition( sal_Int32 nIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nIndex );
ScCsvRuler& rRuler = implGetRuler();
@@ -479,7 +474,7 @@ sal_Bool SAL_CALL ScAccessibleCsvRuler::setCaretPosition( sal_Int32 nIndex )
sal_Unicode SAL_CALL ScAccessibleCsvRuler::getCharacter( sal_Int32 nIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nIndex );
return maBuffer.charAt( nIndex );
@@ -489,31 +484,24 @@ Sequence< PropertyValue > SAL_CALL ScAccessibleCsvRuler::getCharacterAttributes(
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& /* aRequestedAttributes */ )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndexWithEnd( nIndex );
Sequence< PropertyValue > aSeq;
lcl_FillFontAttributes( aSeq, implGetRuler().GetFont() );
-//! TODO split attribute: waiting for #102221#
-// if( implHasSplit( nIndex ) )
-// {
-// sal_Int32 nIndex = lcl_ExpandSequence( aSeq, 1 );
-// aSeq[ nIndex ].Name = CREATE_OUSTRING( "..." );
-// aSeq[ nIndex ].Value <<= ...;
-// }
return aSeq;
}
ScAccessibleCsvRuler::AwtRectangle SAL_CALL ScAccessibleCsvRuler::getCharacterBounds( sal_Int32 nIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndexWithEnd( nIndex );
ScCsvRuler& rRuler = implGetRuler();
Point aPos( rRuler.GetX( lcl_GetRulerPos( nIndex ) ) - rRuler.GetCharWidth() / 2, 0 );
AwtRectangle aRect( aPos.X(), aPos.Y(), rRuler.GetCharWidth(), rRuler.GetSizePixel().Height() );
- // #107054# do not return rectangle out of window
+ // do not return rectangle out of window
sal_Int32 nWidth = rRuler.GetOutputSizePixel().Width();
if( aRect.X >= nWidth )
throw IndexOutOfBoundsException();
@@ -524,7 +512,7 @@ ScAccessibleCsvRuler::AwtRectangle SAL_CALL ScAccessibleCsvRuler::getCharacterBo
sal_Int32 SAL_CALL ScAccessibleCsvRuler::getCharacterCount() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetTextLength();
}
@@ -532,10 +520,10 @@ sal_Int32 SAL_CALL ScAccessibleCsvRuler::getCharacterCount() throw( RuntimeExcep
sal_Int32 SAL_CALL ScAccessibleCsvRuler::getIndexAtPoint( const AwtPoint& rPoint )
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ScCsvRuler& rRuler = implGetRuler();
- // #107054# use object's coordinate system, convert to API position
+ // use object's coordinate system, convert to API position
return lcl_GetApiPos( ::std::min( ::std::max( rRuler.GetPosFromX( rPoint.X ), static_cast<sal_Int32>(0) ), rRuler.GetPosCount() ) );
}
@@ -561,12 +549,12 @@ sal_Bool SAL_CALL ScAccessibleCsvRuler::setSelection( sal_Int32 /* nStartIndex *
throw( IndexOutOfBoundsException, RuntimeException )
{
ensureAlive();
- return sal_False;
+ return false;
}
OUString SAL_CALL ScAccessibleCsvRuler::getText() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return OUString( maBuffer.getStr(), implGetTextLength() );
}
@@ -574,7 +562,7 @@ OUString SAL_CALL ScAccessibleCsvRuler::getText() throw( RuntimeException )
OUString SAL_CALL ScAccessibleCsvRuler::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidRange( nStartIndex, nEndIndex );
return OUString( maBuffer.getStr() + nStartIndex, nEndIndex - nStartIndex );
@@ -583,7 +571,7 @@ OUString SAL_CALL ScAccessibleCsvRuler::getTextRange( sal_Int32 nStartIndex, sal
TextSegment SAL_CALL ScAccessibleCsvRuler::getTextAtIndex( sal_Int32 nIndex, sal_Int16 nTextType )
throw( IndexOutOfBoundsException, IllegalArgumentException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
TextSegment aResult;
@@ -648,7 +636,7 @@ TextSegment SAL_CALL ScAccessibleCsvRuler::getTextAtIndex( sal_Int32 nIndex, sal
TextSegment SAL_CALL ScAccessibleCsvRuler::getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 nTextType )
throw( IndexOutOfBoundsException, IllegalArgumentException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndexWithEnd( nIndex );
@@ -701,7 +689,7 @@ TextSegment SAL_CALL ScAccessibleCsvRuler::getTextBeforeIndex( sal_Int32 nIndex,
TextSegment SAL_CALL ScAccessibleCsvRuler::getTextBehindIndex( sal_Int32 nIndex, sal_Int16 nTextType )
throw( IndexOutOfBoundsException, IllegalArgumentException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndexWithEnd( nIndex );
@@ -756,7 +744,7 @@ sal_Bool SAL_CALL ScAccessibleCsvRuler::copyText( sal_Int32 /* nStartIndex */, s
throw( IndexOutOfBoundsException, RuntimeException )
{
ensureAlive();
- return sal_False;
+ return false;
}
@@ -863,7 +851,7 @@ ScCsvRuler& ScAccessibleCsvRuler::implGetRuler() const
void ScAccessibleCsvRuler::constructStringBuffer() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
// extend existing string buffer to new ruler size
sal_Int32 nRulerCount = implGetRuler().GetPosCount();
@@ -948,7 +936,7 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleAtPoint( con
Reference< XAccessible > xRet;
if( containsPoint( rPoint ) )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
const ScCsvGrid& rGrid = implGetGrid();
@@ -965,7 +953,7 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleAtPoint( con
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getForeground( )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetGrid().GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
}
@@ -973,7 +961,7 @@ throw (RuntimeException)
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getBackground( )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
}
@@ -982,7 +970,7 @@ throw (RuntimeException)
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleChildCount() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetCellCount();
}
@@ -990,7 +978,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleChildCount() throw( Runtime
Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleChild( sal_Int32 nIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nIndex );
return implCreateCellObj( implGetRow( nIndex ), implGetColumn( nIndex ) );
@@ -999,7 +987,7 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleChild( sal_I
Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvGrid::getAccessibleRelationSet()
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
AccessibleRelationSetHelper* pRelationSet = new AccessibleRelationSetHelper();
Reference< XAccessible > xAccObj = implGetChildByRole( getAccessibleParent(), nRulerRole );
@@ -1015,7 +1003,7 @@ Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvGrid::getAccessibleR
Reference< XAccessibleStateSet > SAL_CALL ScAccessibleCsvGrid::getAccessibleStateSet()
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
AccessibleStateSetHelper* pStateSet = implCreateStateSet();
if( implIsAlive() )
{
@@ -1035,14 +1023,14 @@ Reference< XAccessibleStateSet > SAL_CALL ScAccessibleCsvGrid::getAccessibleStat
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleRowCount() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetRowCount();
}
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleColumnCount() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetColumnCount();
}
@@ -1050,7 +1038,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleColumnCount() throw( Runtim
OUString SAL_CALL ScAccessibleCsvGrid::getAccessibleRowDescription( sal_Int32 nRow )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidPosition( nRow, 0 );
return implGetCellText( nRow, 0 );
@@ -1059,7 +1047,7 @@ OUString SAL_CALL ScAccessibleCsvGrid::getAccessibleRowDescription( sal_Int32 nR
OUString SAL_CALL ScAccessibleCsvGrid::getAccessibleColumnDescription( sal_Int32 nColumn )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidPosition( 0, nColumn );
return implGetCellText( 0, nColumn );
@@ -1105,7 +1093,7 @@ Sequence< sal_Int32 > SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleRows()
Sequence< sal_Int32 > SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleColumns()
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ScCsvGrid& rGrid = implGetGrid();
@@ -1124,13 +1112,13 @@ sal_Bool SAL_CALL ScAccessibleCsvGrid::isAccessibleRowSelected( sal_Int32 /* nRo
throw( IndexOutOfBoundsException, RuntimeException )
{
ensureAlive();
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScAccessibleCsvGrid::isAccessibleColumnSelected( sal_Int32 nColumn )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nColumn );
return implIsColumnSelected( nColumn );
@@ -1139,7 +1127,7 @@ sal_Bool SAL_CALL ScAccessibleCsvGrid::isAccessibleColumnSelected( sal_Int32 nCo
Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidPosition( nRow, nColumn );
return implCreateCellObj( nRow, nColumn );
@@ -1168,7 +1156,7 @@ sal_Bool SAL_CALL ScAccessibleCsvGrid::isAccessibleSelected( sal_Int32 /* nRow *
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidPosition( nRow, nColumn );
return implGetIndex( nRow, nColumn );
@@ -1177,7 +1165,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleIndex( sal_Int32 nRow, sal_
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleRow( sal_Int32 nChildIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nChildIndex );
return implGetRow( nChildIndex );
@@ -1186,7 +1174,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleRow( sal_Int32 nChildIndex
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleColumn( sal_Int32 nChildIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nChildIndex );
return implGetColumn( nChildIndex );
@@ -1198,7 +1186,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvGrid::getAccessibleColumn( sal_Int32 nChildInd
void SAL_CALL ScAccessibleCsvGrid::selectAccessibleChild( sal_Int32 nChildIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nChildIndex );
sal_Int32 nColumn = implGetColumn( nChildIndex );
@@ -1211,7 +1199,7 @@ void SAL_CALL ScAccessibleCsvGrid::selectAccessibleChild( sal_Int32 nChildIndex
sal_Bool SAL_CALL ScAccessibleCsvGrid::isAccessibleChildSelected( sal_Int32 nChildIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ensureValidIndex( nChildIndex );
sal_Int32 nColumn = implGetColumn( nChildIndex );
@@ -1220,7 +1208,7 @@ sal_Bool SAL_CALL ScAccessibleCsvGrid::isAccessibleChildSelected( sal_Int32 nChi
void SAL_CALL ScAccessibleCsvGrid::clearAccessibleSelection() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
implGetGrid().SelectAll( false );
}
@@ -1232,7 +1220,7 @@ void SAL_CALL ScAccessibleCsvGrid::selectAllAccessibleChildren() throw( RuntimeE
sal_Int32 SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleChildCount() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetRowCount() * implGetSelColumnCount();
}
@@ -1240,7 +1228,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleChildCount() throw(
Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
sal_Int32 nColumns = implGetSelColumnCount();
if( nColumns == 0 )
@@ -1254,7 +1242,7 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleChil
void SAL_CALL ScAccessibleCsvGrid::deselectAccessibleChild( sal_Int32 nSelectedChildIndex )
throw( IndexOutOfBoundsException, RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
sal_Int32 nColumns = implGetSelColumnCount();
if( nColumns == 0 )
@@ -1494,7 +1482,7 @@ ScAccessibleCsvCell::~ScAccessibleCsvCell()
void SAL_CALL ScAccessibleCsvCell::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SetEditSource( SvxEditSourcePtr( NULL ) );
ScAccessibleCsvControl::disposing();
}
@@ -1504,7 +1492,7 @@ void SAL_CALL ScAccessibleCsvCell::disposing()
void SAL_CALL ScAccessibleCsvCell::grabFocus() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
ScCsvGrid& rGrid = implGetGrid();
rGrid.Execute( CSVCMD_MOVEGRIDCURSOR, rGrid.GetColumnPos( mnColumn ) );
@@ -1513,7 +1501,7 @@ void SAL_CALL ScAccessibleCsvCell::grabFocus() throw( RuntimeException )
sal_Int32 SAL_CALL ScAccessibleCsvCell::getForeground( )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetGrid().GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
}
@@ -1521,7 +1509,7 @@ throw (RuntimeException)
sal_Int32 SAL_CALL ScAccessibleCsvCell::getBackground( )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
}
@@ -1541,7 +1529,7 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvCell::getAccessibleChild( sal_I
sal_Int32 SAL_CALL ScAccessibleCsvCell::getAccessibleIndexInParent() throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return mnIndex;
}
@@ -1549,7 +1537,7 @@ sal_Int32 SAL_CALL ScAccessibleCsvCell::getAccessibleIndexInParent() throw( Runt
Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvCell::getAccessibleRelationSet()
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return new AccessibleRelationSetHelper();
}
@@ -1557,7 +1545,7 @@ Reference< XAccessibleRelationSet > SAL_CALL ScAccessibleCsvCell::getAccessibleR
Reference< XAccessibleStateSet > SAL_CALL ScAccessibleCsvCell::getAccessibleStateSet()
throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
AccessibleStateSetHelper* pStateSet = implCreateStateSet();
if( implIsAlive() )
{
@@ -1592,7 +1580,7 @@ OUString SAL_CALL ScAccessibleCsvCell::getImplementationName() throw( RuntimeExc
Rectangle ScAccessibleCsvCell::GetBoundingBoxOnScreen() const throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
Rectangle aRect( implGetBoundingBox() );
aRect.SetPos( implGetAbsPos( aRect.TopLeft() ) );
@@ -1601,7 +1589,7 @@ Rectangle ScAccessibleCsvCell::GetBoundingBoxOnScreen() const throw( RuntimeExce
Rectangle ScAccessibleCsvCell::GetBoundingBox() const throw( RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ensureAlive();
return implGetBoundingBox();
}
@@ -1678,3 +1666,4 @@ Rectangle ScAccessibleCsvCell::implGetBoundingBox() const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
index 6873116ee2d8..36db896458c9 100644
--- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
#include "AccessibleDataPilotControl.hxx"
-#include "unoguard.hxx"
#include "fieldwnd.hxx"
#include <com/sun/star/accessibility/AccessibleRole.hpp>
@@ -40,6 +40,7 @@
#include <tools/gen.hxx>
#include <toolkit/helper/convert.hxx>
#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -52,7 +53,7 @@ public:
ScAccessibleDataPilotButton(
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>& rxParent,
- ScPivotFieldWindow* pFieldWindow,
+ ScDPFieldControlBase* pDPFieldWindow,
sal_Int32 nIndex);
virtual void Init();
@@ -145,14 +146,14 @@ protected:
throw (::com::sun::star::uno::RuntimeException);
private:
- ScPivotFieldWindow* mpFieldWindow;
+ ScDPFieldControlBase* mpDPFieldWindow;
sal_Int32 mnIndex;
};
//===== internal ========================================================
ScAccessibleDataPilotControl::ScAccessibleDataPilotControl(
const uno::Reference<XAccessible>& rxParent,
- ScPivotFieldWindow* pFieldWindow)
+ ScDPFieldControlBase* pDPFieldWindow)
:
ScAccessibleContextBase(rxParent, AccessibleRole::GROUP_BOX),
mpFieldWindow(pFieldWindow)
@@ -178,15 +179,15 @@ void ScAccessibleDataPilotControl::Init()
void SAL_CALL ScAccessibleDataPilotControl::disposing()
{
- ScUnoGuard aGuard;
- mpFieldWindow = NULL;
+ SolarMutexGuard aGuard;
+ mpDPFieldWindow = NULL;
ScAccessibleContextBase::disposing();
}
void ScAccessibleDataPilotControl::AddField(sal_Int32 nNewIndex)
{
- sal_Bool bAdded(sal_False);
+ sal_Bool bAdded(false);
if (static_cast<size_t>(nNewIndex) == maChildren.size())
{
maChildren.push_back(AccessibleWeak());
@@ -229,7 +230,7 @@ void ScAccessibleDataPilotControl::AddField(sal_Int32 nNewIndex)
void ScAccessibleDataPilotControl::RemoveField(sal_Int32 nOldIndex)
{
- sal_Bool bRemoved(sal_False);
+ sal_Bool bRemoved(false);
uno::Reference< XAccessible > xTempAcc;
ScAccessibleDataPilotButton* pField = NULL;
if (static_cast<size_t>(nOldIndex) < maChildren.size())
@@ -329,7 +330,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDataPilotControl::getAccessib
uno::Reference<XAccessible> xAcc;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpFieldWindow)
{
@@ -353,7 +354,7 @@ sal_Bool SAL_CALL ScAccessibleDataPilotControl::isVisible( )
void SAL_CALL ScAccessibleDataPilotControl::grabFocus( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpFieldWindow)
mpFieldWindow->GrabFocus();
@@ -362,7 +363,7 @@ void SAL_CALL ScAccessibleDataPilotControl::grabFocus( )
sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getForeground( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
if (mpFieldWindow)
@@ -375,13 +376,19 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getForeground( )
sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getBackground( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
if (mpFieldWindow)
{
- const StyleSettings& rStyleSett = mpFieldWindow->GetSettings().GetStyleSettings();
- nColor = (mpFieldWindow->GetType() == PIVOTFIELDTYPE_SELECT) ? rStyleSett.GetFaceColor().GetColor() : rStyleSett.GetWindowColor().GetColor();
+ if (mpDPFieldWindow->GetFieldType() == TYPE_SELECT)
+ {
+ nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetFaceColor().GetColor();
+ }
+ else
+ {
+ nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetWindowColor().GetColor();
+ }
}
return nColor;
}
@@ -391,7 +398,7 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getBackground( )
sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getAccessibleChildCount(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpFieldWindow)
return mpFieldWindow->GetFieldCount();
@@ -402,7 +409,7 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getAccessibleChildCount(void)
uno::Reference< XAccessible> SAL_CALL ScAccessibleDataPilotControl::getAccessibleChild(sal_Int32 nIndex)
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference<XAccessible> xAcc;
if (mpFieldWindow)
@@ -428,7 +435,7 @@ uno::Reference< XAccessible> SAL_CALL ScAccessibleDataPilotControl::getAccessibl
uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotControl::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
utl::AccessibleStateSetHelper* pStateSet = new utl::AccessibleStateSetHelper();
@@ -461,7 +468,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotControl::getAc
uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -477,7 +484,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
::rtl::OUString SAL_CALL ScAccessibleDataPilotControl::createAccessibleDescription(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpFieldWindow)
return mpFieldWindow->GetDescription();
@@ -488,7 +495,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
::rtl::OUString SAL_CALL ScAccessibleDataPilotControl::createAccessibleName(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpFieldWindow)
return mpFieldWindow->GetName();
@@ -520,7 +527,7 @@ Rectangle ScAccessibleDataPilotControl::GetBoundingBox(void) const
ScAccessibleDataPilotButton::ScAccessibleDataPilotButton(
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>& rxParent,
- ScPivotFieldWindow* pFieldWindow,
+ ScDPFieldControlBase* pDPFieldWindow,
sal_Int32 nIndex)
: ScAccessibleContextBase(rxParent, AccessibleRole::PUSH_BUTTON),
mpFieldWindow(pFieldWindow),
@@ -545,8 +552,8 @@ void ScAccessibleDataPilotButton::Init()
void SAL_CALL ScAccessibleDataPilotButton::disposing()
{
- ScUnoGuard aGuard;
- mpFieldWindow = NULL;
+ SolarMutexGuard aGuard;
+ mpDPFieldWindow = NULL;
ScAccessibleContextBase::disposing();
}
@@ -579,7 +586,7 @@ sal_Bool SAL_CALL ScAccessibleDataPilotButton::isVisible( )
void SAL_CALL ScAccessibleDataPilotButton::grabFocus( )
throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpFieldWindow)
{
@@ -590,7 +597,7 @@ void SAL_CALL ScAccessibleDataPilotButton::grabFocus( )
sal_Int32 SAL_CALL ScAccessibleDataPilotButton::getForeground( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
if (mpFieldWindow)
@@ -603,7 +610,7 @@ throw (uno::RuntimeException)
sal_Int32 SAL_CALL ScAccessibleDataPilotButton::getBackground( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
if (mpFieldWindow)
@@ -631,7 +638,7 @@ uno::Reference< XAccessible> SAL_CALL ScAccessibleDataPilotButton::getAccessible
sal_Int32 SAL_CALL ScAccessibleDataPilotButton::getAccessibleIndexInParent(void)
throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return mnIndex;
}
@@ -639,7 +646,7 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotButton::getAccessibleIndexInParent(void)
uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotButton::getAccessibleStateSet(void)
throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
utl::AccessibleStateSetHelper* pStateSet = new utl::AccessibleStateSetHelper();
@@ -675,7 +682,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotButton::getAcc
uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotButton::getImplementationId(void)
throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -695,7 +702,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotButton::getImplementationI
::rtl::OUString SAL_CALL ScAccessibleDataPilotButton::createAccessibleName(void)
throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpFieldWindow)
return mpFieldWindow->GetFieldText(getAccessibleIndexInParent());
@@ -725,3 +732,5 @@ Rectangle ScAccessibleDataPilotButton::GetBoundingBox(void) const
else
return Rectangle();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 2bc7dba9c392..fe8ef7b9decf 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,30 +36,22 @@
#include "AccessibilityHints.hxx"
#include "document.hxx"
#include "drwlayer.hxx"
-#include "unoguard.hxx"
#include "shapeuno.hxx"
#include "DrawModelBroadcaster.hxx"
#include "drawview.hxx"
#include "gridwin.hxx"
#include "AccessibleEditObject.hxx"
+#include "userdat.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLERELATIONTYPE_HPP_
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
-#endif
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
-#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX
#include <unotools/accessiblestatesethelper.hxx>
-#endif
#include <tools/debug.hxx>
#include <tools/gen.hxx>
#include <svx/svdpage.hxx>
@@ -73,6 +66,7 @@
#include <svx/unoshape.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <toolkit/helper/convert.hxx>
+#include <vcl/svapp.hxx>
#include <list>
#include <algorithm>
@@ -85,11 +79,10 @@ using ::std::for_each;
struct ScAccessibleShapeData
{
- ScAccessibleShapeData() : pAccShape(NULL), pRelationCell(NULL), bSelected(sal_False), bSelectable(sal_True) {}
+ ScAccessibleShapeData() : pAccShape(NULL), pRelationCell(NULL), bSelected(false), bSelectable(sal_True) {}
~ScAccessibleShapeData();
mutable ::accessibility::AccessibleShape* pAccShape;
mutable ScAddress* pRelationCell; // if it is NULL this shape is anchored on the table
-// SdrObject* pShape;
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape;
mutable sal_Bool bSelected;
sal_Bool bSelectable;
@@ -133,7 +126,7 @@ struct ScShapeDataLess
}
sal_Bool LessThanSheet(const ScAccessibleShapeData* pData) const
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
uno::Reference< beans::XPropertySet> xProps(pData->xShape, uno::UNO_QUERY);
if (xProps.is())
{
@@ -149,7 +142,7 @@ struct ScShapeDataLess
}
sal_Bool operator()(const ScAccessibleShapeData* pData1, const ScAccessibleShapeData* pData2) const
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (pData1 && pData2)
{
uno::Reference< beans::XPropertySet> xProps1(pData1->xShape, uno::UNO_QUERY);
@@ -185,7 +178,7 @@ struct ScShapeDataLess
else if (!pData1 && pData2)
bResult = !LessThanSheet(pData2);
else
- bResult = sal_False;
+ bResult = false;
return bResult;
}
};
@@ -196,7 +189,7 @@ struct DeselectShape
{
if (pAccShapeData)
{
- pAccShapeData->bSelected = sal_False;
+ pAccShapeData->bSelected = false;
if (pAccShapeData->pAccShape)
pAccShapeData->pAccShape->ResetState(AccessibleStateType::SELECTED);
}
@@ -326,7 +319,7 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc
uno::Reference<drawing::XShapes> xShapes(xSelectionSupplier->getSelection(), uno::UNO_QUERY);
if (xShapes.is())
- FindSelectedShapesChanges(xShapes, sal_False);
+ FindSelectedShapesChanges(xShapes, false);
}
if (pViewShell)
{
@@ -382,7 +375,7 @@ void ScChildrenShapes::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject());
if (pObj && /*(pObj->GetLayer() != SC_LAYER_INTERN) && */(pObj->GetPage() == GetDrawPage()) &&
- (pObj->GetPage() == pObj->GetObjList()) ) //#108480# only do something if the object lies direct on the page
+ (pObj->GetPage() == pObj->GetObjList()) ) //only do something if the object lies direct on the page
{
switch (pSdrHint->GetKind())
{
@@ -436,7 +429,7 @@ sal_Bool ScChildrenShapes::ReplaceChild (::accessibility::AccessibleShape* pCurr
if ( pReplacement )
pReplacement->Init();
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (pCurrentChild && pReplacement)
{
DBG_ASSERT(pCurrentChild->GetXShape().get() == pReplacement->GetXShape().get(), "XShape changes and should be inserted sorted");
@@ -482,7 +475,7 @@ sal_Int32 ScChildrenShapes::GetCount() const
if (pObj/* && (pObj->GetLayer() != SC_LAYER_INTERN)*/)
{
uno::Reference< drawing::XShape > xShape (pObj->getUnoShape(), uno::UNO_QUERY);
- AddShape(xShape, sal_False); //inserts in the correct order
+ AddShape(xShape, false); //inserts in the correct order
}
}
}
@@ -531,7 +524,7 @@ uno::Reference< XAccessible > ScChildrenShapes::GetAt(const awt::Point& rPoint)
if(mpViewShell)
{
sal_Int32 i(maZOrderedShapes.size() - 1);
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while (!bFound && i >= 0)
{
ScAccessibleShapeData* pShape = maZOrderedShapes[i];
@@ -567,7 +560,7 @@ uno::Reference< XAccessible > ScChildrenShapes::GetAt(const awt::Point& rPoint)
sal_Bool ScChildrenShapes::IsSelected(sal_Int32 nIndex,
uno::Reference<drawing::XShape>& rShape) const
{
- sal_Bool bResult (sal_False);
+ sal_Bool bResult (false);
if (maZOrderedShapes.size() <= 1)
GetCount(); // fill list with filtered shapes (no internal shapes)
@@ -575,14 +568,14 @@ sal_Bool ScChildrenShapes::IsSelected(sal_Int32 nIndex,
throw uno::RuntimeException();
if (!maZOrderedShapes[nIndex])
- return sal_False;
+ return false;
bResult = maZOrderedShapes[nIndex]->bSelected;
rShape = maZOrderedShapes[nIndex]->xShape;
#ifdef DBG_UTIL // test whether it is truly selected by a slower method
uno::Reference< drawing::XShape > xReturnShape;
- sal_Bool bDebugResult(sal_False);
+ sal_Bool bDebugResult(false);
uno::Reference<container::XIndexAccess> xIndexAccess;
xSelectionSupplier->getSelection() >>= xIndexAccess;
@@ -615,7 +608,7 @@ sal_Bool ScChildrenShapes::IsSelected(sal_Int32 nIndex,
sal_Bool ScChildrenShapes::SelectionChanged()
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (!xSelectionSupplier.is())
throw uno::RuntimeException();
@@ -674,7 +667,7 @@ void ScChildrenShapes::DeselectAll()
catch (lang::IllegalArgumentException&)
{
DBG_ERRORFILE("nothing selected before");
- bSomethingSelected = sal_False;
+ bSomethingSelected = false;
}
if (bSomethingSelected)
@@ -755,7 +748,7 @@ uno::Reference< XAccessible > ScChildrenShapes::GetSelected(sal_Int32 nSelectedC
{
SortedShapes::iterator aItr = maZOrderedShapes.begin();
SortedShapes::iterator aEndItr = maZOrderedShapes.end();
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while(!bFound && aItr != aEndItr)
{
if (*aItr)
@@ -806,7 +799,7 @@ void ScChildrenShapes::Deselect(sal_Int32 nChildIndex)
DBG_ERRORFILE("something not selectable");
}
- maZOrderedShapes[nChildIndex]->bSelected = sal_False;
+ maZOrderedShapes[nChildIndex]->bSelected = false;
if (maZOrderedShapes[nChildIndex]->pAccShape)
maZOrderedShapes[nChildIndex]->pAccShape->ResetState(AccessibleStateType::SELECTED);
}
@@ -871,7 +864,7 @@ utl::AccessibleRelationSetHelper* ScChildrenShapes::GetRelationSet(const ScAddre
sal_Bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::XShapes>& xShapes, sal_Bool /* bCommitChange */) const
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
SortedShapes aShapesList;
uno::Reference<container::XIndexAccess> xIndexAcc(xShapes, uno::UNO_QUERY);
if (xIndexAcc.is())
@@ -928,7 +921,7 @@ sal_Bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawin
{
if ((*aDataItr)->bSelected)
{
- (*aDataItr)->bSelected = sal_False;
+ (*aDataItr)->bSelected = false;
if ((*aDataItr)->pAccShape)
{
(*aDataItr)->pAccShape->ResetState(AccessibleStateType::SELECTED);
@@ -985,35 +978,10 @@ ScAddress* ScChildrenShapes::GetAnchor(const uno::Reference<drawing::XShape>& xS
uno::Reference<beans::XPropertySet> xShapeProp(xShape, uno::UNO_QUERY);
if (pShapeImp && xShapeProp.is())
{
- SdrObject *pSdrObj = pShapeImp->GetSdrObject();
- if (pSdrObj)
+ if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
{
- if (ScDrawLayer::GetAnchor(pSdrObj) == SCA_CELL)
- {
- ScDocument* pDoc = mpViewShell->GetViewData()->GetDocument();
- if (pDoc)
- {
- rtl::OUString sCaptionShape(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape"));
- awt::Point aPoint(xShape->getPosition());
- awt::Size aSize(xShape->getSize());
- rtl::OUString sType(xShape->getShapeType());
- Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
- if ( sType.equals(sCaptionShape) )
- {
- awt::Point aRelativeCaptionPoint;
- rtl::OUString sCaptionPoint( RTL_CONSTASCII_USTRINGPARAM( "CaptionPoint" ));
- xShapeProp->getPropertyValue( sCaptionPoint ) >>= aRelativeCaptionPoint;
- Point aCoreRelativeCaptionPoint(aRelativeCaptionPoint.X, aRelativeCaptionPoint.Y);
- Point aCoreAbsoluteCaptionPoint(aPoint.X, aPoint.Y);
- aCoreAbsoluteCaptionPoint += aCoreRelativeCaptionPoint;
- aRectangle.Union(Rectangle(aCoreAbsoluteCaptionPoint, aCoreAbsoluteCaptionPoint));
- }
- ScRange aRange = pDoc->GetRange(mpAccessibleDocument->getVisibleTable(), aRectangle);
- pAddress = new ScAddress(aRange.aStart);
- }
- }
-// else
-// do nothing, because it is always a NULL Pointer
+ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pSdrObj))
+ return new ScAddress(pAnchor->maStart);
}
}
}
@@ -1086,7 +1054,7 @@ void ScChildrenShapes::AddShape(const uno::Reference<drawing::XShape>& xShape, s
if( aPropAny >>= nLayerID )
{
if( (nLayerID == SC_LAYER_INTERN) || (nLayerID == SC_LAYER_HIDDEN) )
- pShape->bSelectable = sal_False;
+ pShape->bSelectable = false;
else
pShape->bSelectable = sal_True;
}
@@ -1103,7 +1071,7 @@ void ScChildrenShapes::AddShape(const uno::Reference<drawing::XShape>& xShape, s
if (xEnum.is())
{
uno::Reference<drawing::XShape> xSelectedShape;
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while (!bFound && xEnum->hasMoreElements())
{
xEnum->nextElement() >>= xSelectedShape;
@@ -1164,7 +1132,7 @@ void ScChildrenShapes::RemoveShape(const uno::Reference<drawing::XShape>& xShape
sal_Bool ScChildrenShapes::FindShape(const uno::Reference<drawing::XShape>& xShape, ScChildrenShapes::SortedShapes::iterator& rItr) const
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
ScAccessibleShapeData aShape;
aShape.xShape = xShape;
ScShapeDataLess aLess;
@@ -1175,7 +1143,7 @@ sal_Bool ScChildrenShapes::FindShape(const uno::Reference<drawing::XShape>& xSha
#ifdef DBG_UTIL // test whether it finds truly the correct shape (perhaps it is not really sorted)
SortedShapes::iterator aDebugItr = maZOrderedShapes.begin();
SortedShapes::iterator aEndItr = maZOrderedShapes.end();
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while (!bFound && aDebugItr != aEndItr)
{
if (*aDebugItr && ((*aDebugItr)->xShape.get() == xShape.get()))
@@ -1237,7 +1205,7 @@ ScAccessibleDocument::ScAccessibleDocument(
mpAccessibleSpreadsheet(NULL),
mpChildrenShapes(NULL),
mpTempAccEdit(NULL),
- mbCompleteSheetSelected(sal_False)
+ mbCompleteSheetSelected(false)
{
if (pViewShell)
{
@@ -1252,7 +1220,7 @@ ScAccessibleDocument::ScAccessibleDocument(
Window *pChildWin = pWin->GetChild( i );
if( pChildWin &&
AccessibleRole::EMBEDDED_OBJECT == pChildWin->GetAccessibleRole() )
- AddChild( pChildWin->GetAccessible(), sal_False );
+ AddChild( pChildWin->GetAccessible(), false );
}
}
if (pViewShell->GetViewData()->HasEditView( eSplitPos ))
@@ -1260,7 +1228,7 @@ ScAccessibleDocument::ScAccessibleDocument(
uno::Reference<XAccessible> xAcc = new ScAccessibleEditObject(this, pViewShell->GetViewData()->GetEditView(eSplitPos),
pViewShell->GetWindowByPos(eSplitPos), GetCurrentCellName(), GetCurrentCellDescription(),
CellInEditMode);
- AddChild(xAcc, sal_False);
+ AddChild(xAcc, false);
}
}
maVisArea = GetVisibleArea_Impl();
@@ -1284,7 +1252,7 @@ ScAccessibleDocument::~ScAccessibleDocument(void)
void SAL_CALL ScAccessibleDocument::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
FreeAccessibleSpreadsheet();
if (mpViewShell)
{
@@ -1380,7 +1348,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if (mpChildrenShapes)
DELETEZ(mpChildrenShapes);
- // #124567# Accessibility: Shapes / form controls after reload not accessible
+ // Accessibility: Shapes / form controls after reload not accessible
if ( !mpChildrenShapes )
{
mpChildrenShapes = new ScChildrenShapes( this, mpViewShell, meSplitPos );
@@ -1465,7 +1433,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
void SAL_CALL ScAccessibleDocument::selectionChanged( const lang::EventObject& /* aEvent */ )
throw (uno::RuntimeException)
{
- sal_Bool bSelectionChanged(sal_False);
+ sal_Bool bSelectionChanged(false);
if (mpAccessibleSpreadsheet)
{
sal_Bool bOldSelected(mbCompleteSheetSelected);
@@ -1520,7 +1488,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAtPoin
uno::Reference<XAccessible> xAccessible = NULL;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpChildrenShapes)
xAccessible = mpChildrenShapes->GetAt(rPoint);
@@ -1547,7 +1515,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAtPoin
void SAL_CALL ScAccessibleDocument::grabFocus( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (getAccessibleParent().is())
{
@@ -1573,7 +1541,7 @@ sal_Int32 SAL_CALL
ScAccessibleDocument::getAccessibleChildCount(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nCount(1);
if (mpChildrenShapes)
@@ -1591,7 +1559,7 @@ uno::Reference<XAccessible> SAL_CALL
throw (uno::RuntimeException,
lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference<XAccessible> xAccessible;
if (nIndex >= 0)
@@ -1622,7 +1590,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
ScAccessibleDocument::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -1652,7 +1620,7 @@ void SAL_CALL
ScAccessibleDocument::selectAccessibleChild( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpChildrenShapes)
@@ -1686,9 +1654,9 @@ sal_Bool SAL_CALL
ScAccessibleDocument::isAccessibleChildSelected( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (mpChildrenShapes)
{
@@ -1719,7 +1687,7 @@ void SAL_CALL
ScAccessibleDocument::clearAccessibleSelection( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpChildrenShapes)
@@ -1730,7 +1698,7 @@ void SAL_CALL
ScAccessibleDocument::selectAllAccessibleChildren( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpChildrenShapes)
@@ -1747,7 +1715,7 @@ sal_Int32 SAL_CALL
ScAccessibleDocument::getSelectedAccessibleChildCount( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nCount(0);
@@ -1767,7 +1735,7 @@ uno::Reference<XAccessible > SAL_CALL
ScAccessibleDocument::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference<XAccessible> xAccessible;
if (mpChildrenShapes)
@@ -1795,7 +1763,7 @@ void SAL_CALL
ScAccessibleDocument::deselectAccessibleChild( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpChildrenShapes)
@@ -1857,7 +1825,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleDocument::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -1872,7 +1840,7 @@ uno::Sequence<sal_Int8> SAL_CALL
sal_Bool ScAccessibleDocument::IsValid (void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return (!ScAccessibleContextBase::IsDefunc() && !rBHelper.bInDispose);
}
@@ -1895,14 +1863,14 @@ Rectangle ScAccessibleDocument::GetVisibleArea_Impl() const
Rectangle ScAccessibleDocument::GetVisibleArea() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return maVisArea;
}
Point ScAccessibleDocument::LogicToPixel (const Point& rPoint) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
Point aPoint;
ScGridWindow* pWin = static_cast<ScGridWindow*>(mpViewShell->GetWindowByPos(meSplitPos));
@@ -1916,7 +1884,7 @@ Point ScAccessibleDocument::LogicToPixel (const Point& rPoint) const
Size ScAccessibleDocument::LogicToPixel (const Size& rSize) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
Size aSize;
ScGridWindow* pWin = static_cast<ScGridWindow*>(mpViewShell->GetWindowByPos(meSplitPos));
@@ -1927,7 +1895,7 @@ Size ScAccessibleDocument::LogicToPixel (const Size& rSize) const
Point ScAccessibleDocument::PixelToLogic (const Point& rPoint) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
Point aPoint;
ScGridWindow* pWin = static_cast<ScGridWindow*>(mpViewShell->GetWindowByPos(meSplitPos));
@@ -1941,7 +1909,7 @@ Point ScAccessibleDocument::PixelToLogic (const Point& rPoint) const
Size ScAccessibleDocument::PixelToLogic (const Size& rSize) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
Size aSize;
ScGridWindow* pWin = static_cast<ScGridWindow*>(mpViewShell->GetWindowByPos(meSplitPos));
@@ -1972,7 +1940,7 @@ utl::AccessibleRelationSetHelper* ScAccessibleDocument::GetRelationSet(const ScA
ScAccessibleDocument::createAccessibleName(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
rtl::OUString sName = String(ScResId(STR_ACC_DOC_NAME));
sal_Int32 nNumber(sal_Int32(meSplitPos) + 1);
@@ -2039,7 +2007,7 @@ void ScAccessibleDocument::FreeAccessibleSpreadsheet()
sal_Bool ScAccessibleDocument::IsTableSelected() const
{
- sal_Bool bResult (sal_False);
+ sal_Bool bResult (false);
if(mpViewShell)
{
SCTAB nTab(getVisibleTable());
@@ -2118,3 +2086,5 @@ rtl::OUString ScAccessibleDocument::GetCurrentCellDescription() const
{
return rtl::OUString();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx b/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx
index 76be8e67aa07..6c48fbffb388 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include "AccessibleDocumentBase.hxx"
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -49,3 +48,5 @@ ScAccessibleDocumentBase::ScAccessibleDocumentBase(
ScAccessibleDocumentBase::~ScAccessibleDocumentBase(void)
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index cccdd729c0b1..9535e84e0da3 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,6 @@
#include "document.hxx"
#include "prevwsh.hxx"
#include "prevloc.hxx"
-#include "unoguard.hxx"
#include "drwlayer.hxx"
#include "editsrc.hxx"
#include "scresid.hxx"
@@ -62,6 +62,7 @@
#include <toolkit/helper/convert.hxx>
#include <svx/unoshape.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
+#include <vcl/svapp.hxx>
#include <vector>
#include <list>
@@ -100,7 +101,7 @@ public:
uno::Reference<XAccessible> GetAt(const awt::Point& rPoint) const;
void DataChanged(const Rectangle& rVisRect);
- void SetOffset(sal_Int32 nNewOffset);
+
private:
ScPreviewShell* mpViewShell;
ScAccessibleDocumentPagePreview* mpAccDoc;
@@ -211,7 +212,7 @@ void ScNotesChilds::Init(const Rectangle& rVisRect, sal_Int32 nOffset)
mnOffset = nOffset;
const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
- mnParagraphs = AddNotes(rData, rVisRect, sal_False, maMarks);
+ mnParagraphs = AddNotes(rData, rVisRect, false, maMarks);
mnParagraphs += AddNotes(rData, rVisRect, sal_True, maNotes);
}
}
@@ -227,7 +228,7 @@ struct ScParaFound
ScParaFound(sal_Int32 nIndex) : mnIndex(nIndex) {}
sal_Bool operator() (const ScAccNote& rNote)
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (rNote.mnParaCount > mnIndex)
bResult = sal_True;
else
@@ -284,7 +285,7 @@ struct ScPointFound
ScPointFound(const Point& rPoint) : maPoint(rPoint, Size(0, 0)), mnParagraphs(0) {}
sal_Bool operator() (const ScAccNote& rNote)
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (maPoint.IsInside(rNote.maRect))
bResult = sal_True;
else
@@ -355,7 +356,7 @@ sal_Int32 ScNotesChilds::CheckChanges(const ScPreviewLocationData& rData,
aNote.mnParaCount = 1;
ScAccNotes::iterator aItr = rOldNotes.begin();
ScAccNotes::iterator aEndItr = rOldNotes.end();
- sal_Bool bAddNote(sal_False);
+ sal_Bool bAddNote(false);
for (sal_Int32 nIndex = 0; nIndex < nCount; ++nIndex)
{
if (rData.GetNoteInRange(rVisRect, nIndex, bMark, aNote.maNoteCell, aNote.maRect))
@@ -427,7 +428,7 @@ sal_Int32 ScNotesChilds::CheckChanges(const ScPreviewLocationData& rData,
{
nParagraphs += aNote.mnParaCount;
rNewNotes.push_back(aNote);
- bAddNote = sal_False;
+ bAddNote = false;
}
}
}
@@ -481,7 +482,7 @@ void ScNotesChilds::DataChanged(const Rectangle& rVisRect)
mnParagraphs = CheckChanges(mpViewShell->GetLocationData(), rVisRect, sal_True, maMarks, aNewMarks, aOldParas, aNewParas);
maMarks = aNewMarks;
ScAccNotes aNewNotes;
- mnParagraphs += CheckChanges(mpViewShell->GetLocationData(), rVisRect, sal_False, maNotes, aNewNotes, aOldParas, aNewParas);
+ mnParagraphs += CheckChanges(mpViewShell->GetLocationData(), rVisRect, false, maNotes, aNewNotes, aOldParas, aNewParas);
maNotes = aNewNotes;
std::for_each(aOldParas.begin(), aOldParas.end(), ScChildGone(mpAccDoc));
@@ -500,17 +501,6 @@ struct ScChangeOffset
}
};
-void ScNotesChilds::SetOffset(sal_Int32 nNewOffset)
-{
- sal_Int32 nDiff(nNewOffset - mnOffset);
- if (nDiff != 0)
- {
- std::for_each(maMarks.begin(), maMarks.end(), ScChangeOffset(nDiff));
- std::for_each(maNotes.begin(), maNotes.end(), ScChangeOffset(nDiff));
- mnOffset = nNewOffset;
- }
-}
-
inline ScDocument* ScNotesChilds::GetDocument() const
{
ScDocument* pDoc = NULL;
@@ -545,7 +535,7 @@ private:
};
ScIAccessibleViewForwarder::ScIAccessibleViewForwarder()
- : mbValid(sal_False)
+ : mbValid(false)
{
}
@@ -567,13 +557,13 @@ ScIAccessibleViewForwarder::~ScIAccessibleViewForwarder()
sal_Bool ScIAccessibleViewForwarder::IsValid (void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return mbValid;
}
Rectangle ScIAccessibleViewForwarder::GetVisibleArea() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Rectangle aVisRect;
Window* pWin = mpViewShell->GetWindow();
if (pWin)
@@ -589,7 +579,7 @@ Rectangle ScIAccessibleViewForwarder::GetVisibleArea() const
Point ScIAccessibleViewForwarder::LogicToPixel (const Point& rPoint) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Point aPoint;
Window* pWin = mpViewShell->GetWindow();
if (pWin && mpAccDoc)
@@ -603,7 +593,7 @@ Point ScIAccessibleViewForwarder::LogicToPixel (const Point& rPoint) const
Size ScIAccessibleViewForwarder::LogicToPixel (const Size& rSize) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Size aSize;
Window* pWin = mpViewShell->GetWindow();
if (pWin)
@@ -613,7 +603,7 @@ Size ScIAccessibleViewForwarder::LogicToPixel (const Size& rSize) const
Point ScIAccessibleViewForwarder::PixelToLogic (const Point& rPoint) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Point aPoint;
Window* pWin = mpViewShell->GetWindow();
if (pWin && mpAccDoc)
@@ -626,7 +616,7 @@ Point ScIAccessibleViewForwarder::PixelToLogic (const Point& rPoint) const
Size ScIAccessibleViewForwarder::PixelToLogic (const Size& rSize) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Size aSize;
Window* pWin = mpViewShell->GetWindow();
if (pWin)
@@ -667,7 +657,7 @@ struct ScShapeChildLess
{
sal_Bool operator()(const ScShapeChild& rChild1, const ScShapeChild& rChild2) const
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (rChild1.mxShape.is() && rChild2.mxShape.is())
bResult = (rChild1.mxShape.get() < rChild2.mxShape.get());
return bResult;
@@ -735,7 +725,6 @@ private:
::accessibility::AccessibleShape* GetAccShape(const ScShapeChild& rShape) const;
::accessibility::AccessibleShape* GetAccShape(const ScShapeChildVec& rShapes, sal_Int32 nIndex) const;
void FillShapes(const Rectangle& aPixelPaintRect, const MapMode& aMapMode, sal_uInt8 nRangeId);
-//UNUSED2008-05 sal_Bool FindShape(ScShapeChildVec& rShapes, const uno::Reference <drawing::XShape>& xShape, ScShapeChildVec::iterator& rItr) const;
// void AddShape(const uno::Reference<drawing::XShape>& xShape, SdrLayerID aLayerID);
// void RemoveShape(const uno::Reference<drawing::XShape>& xShape, SdrLayerID aLayerID);
@@ -792,21 +781,6 @@ void ScShapeChilds::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
}
break;
- // no longer necessary
-/* case HINT_OBJINSERTED : // Neues Zeichenobjekt eingefuegt
- {
- uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
- if (xShape.is())
- AddShape(xShape, pObj->GetLayer());
- }
- break;
- case HINT_OBJREMOVED : // Zeichenobjekt aus Liste entfernt
- {
- uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
- if (xShape.is())
- RemoveShape(xShape, pObj->GetLayer());
- }
- break;*/
default :
{
// other events are not interesting
@@ -929,7 +903,7 @@ sal_Bool ScShapeChilds::ReplaceChild (::accessibility::AccessibleShape* /* pCurr
throw (uno::RuntimeException)
{
DBG_ERRORFILE("should not be called in the page preview");
- return sal_False;
+ return false;
}
///===== Internal ========================================================
@@ -1047,7 +1021,7 @@ struct ScShapePointFound
ScShapePointFound(const awt::Point& rPoint) : maPoint(VCLPoint(rPoint)) {}
sal_Bool operator() (const ScShapeChild& rShape)
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if ((VCLRectangle(rShape.mpAccShape->getBounds())).IsInside(maPoint))
bResult = sal_True;
return bResult;
@@ -1133,9 +1107,9 @@ void ScShapeChilds::FillShapes(const Rectangle& aPixelPaintRect, const MapMode&
Window* pWin = mpViewShell->GetWindow();
if (pPage && pWin)
{
- sal_Bool bForeAdded(sal_False);
- sal_Bool bBackAdded(sal_False);
- sal_Bool bControlAdded(sal_False);
+ sal_Bool bForeAdded(false);
+ sal_Bool bBackAdded(false);
+ sal_Bool bControlAdded(false);
Rectangle aClippedPixelPaintRect(aPixelPaintRect);
if (mpAccDoc)
{
@@ -1201,159 +1175,6 @@ void ScShapeChilds::FillShapes(const Rectangle& aPixelPaintRect, const MapMode&
}
}
-//UNUSED2008-05 sal_Bool ScShapeChilds::FindShape(ScShapeChildVec& rShapes, const uno::Reference <drawing::XShape>& xShape, ScShapeChildVec::iterator& rItr) const
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_Bool bResult(sal_False);
-//UNUSED2008-05 ScShapeChild aShape;
-//UNUSED2008-05 aShape.mxShape = xShape;
-//UNUSED2008-05 rItr = std::lower_bound(rShapes.begin(), rShapes.end(), aShape, ScShapeChildLess());
-//UNUSED2008-05 if (rItr->mxShape.get() == xShape.get())
-//UNUSED2008-05 bResult = sal_True; // if the shape is found
-//UNUSED2008-05
-//UNUSED2008-05 /*#ifdef DBG_UTIL // test whether it finds truly the correct shape (perhaps it is not really sorted)
-//UNUSED2008-05 ScShapeChildVec::iterator aDebugItr = std::find(rShapes.begin(), rShapes.end(), aShape);
-//UNUSED2008-05 DBG_ASSERT(rItr == aDebugItr, "wrong Shape found");
-//UNUSED2008-05 #endif*/
-//UNUSED2008-05 return bResult;
-//UNUSED2008-05 }
-
-/*void ScShapeChilds::AddShape(const uno::Reference<drawing::XShape>& xShape, SdrLayerID aLayerID)
-{
- uno::Reference < XAccessible > xNew;
- Window* pWin = mpViewShell->GetWindow();
- if (pWin)
- {
- ScShapeRangeVec::iterator aEndItr = maShapeRanges.end();
- ScShapeRangeVec::iterator aItr = maShapeRanges.begin();
- sal_Bool bNotify(sal_False);
- uno::Reference <XAccessible> xAcc;
- while (aItr != aEndItr)
- {
- Rectangle aLogicPaintRect(pWin->PixelToLogic(aItr->maPixelRect, aItr->maMapMode));
- Rectangle aRect(VCLPoint(xShape->getPosition()), VCLSize(xShape->getSize()));
- if(!aRect.GetIntersection(aLogicPaintRect).IsEmpty())
- {
- ScShapeChild aShape;
- aShape.mxShape = xShape;
- switch (aLayerID)
- {
- case SC_LAYER_INTERN:
- case SC_LAYER_FRONT:
- {
- SetAnchor(aShape);
- aItr->maForeShapes.push_back(aShape);
- std::sort(aItr->maForeShapes.begin(), aItr->maForeShapes.end(),ScShapeChildLess());
-
- }
- break;
- case SC_LAYER_BACK:
- {
- aItr->maBackShapes.push_back(aShape);
- std::sort(aItr->maBackShapes.begin(), aItr->maBackShapes.end(),ScShapeChildLess());
- }
- break;
- case SC_LAYER_CONTROLS:
- {
- SetAnchor(aShape);
- aItr->maControls.push_back(aShape);
- std::sort(aItr->maControls.begin(), aItr->maControls.end(),ScShapeChildLess());
- }
- break;
- default:
- {
- DBG_ERRORFILE("I don't know this layer.");
- }
- break;
- }
- if (bNotify)
- {
- xAcc = GetAccShape(aShape);
- AccessibleEventObject aEvent;
- aEvent.Source = uno::Reference<XAccessibleContext> (mpAccDoc);
- aEvent.EventId = AccessibleEventId::CHILD;
- aEvent.NewValue <<= xAcc;
- mpAccDoc->CommitChange(aEvent);
- bNotify = sal_False;
- }
- xAcc = NULL;
- }
- ++aItr;
- }
- }
-}*/
-
-/*sal_Bool HaveToNotify(uno::Reference<XAccessible>& xAcc, ScShapeChildVec::iterator aItr)
-{
- sal_Bool bResult(sal_False);
- if (aItr->mpAccShape)
- {
- bResult = sal_True;
- xAcc = aItr->mpAccShape;
- }
- else
- DBG_ERRORFILE("No Accessible object found. Don't know how to notify.");
- return bResult;
-}*/
-
-/*void ScShapeChilds::RemoveShape(const uno::Reference<drawing::XShape>& xShape, SdrLayerID aLayerID)
-{
- ScShapeRangeVec::iterator aEndItr = maShapeRanges.end();
- ScShapeRangeVec::iterator aItr = maShapeRanges.begin();
- ScShapeChildVec::iterator aEraseItr;
- sal_Bool bNotify(sal_False);
- uno::Reference <XAccessible> xAcc;
- while (aItr != aEndItr)
- {
- switch (aLayerID)
- {
- case SC_LAYER_INTERN:
- case SC_LAYER_FRONT:
- {
- if (FindShape(aItr->maForeShapes, xShape, aEraseItr))
- {
- bNotify = HaveToNotify(xAcc, aEraseItr);
- aItr->maForeShapes.erase(aEraseItr);
- }
- }
- break;
- case SC_LAYER_BACK:
- {
- if (FindShape(aItr->maBackShapes, xShape, aEraseItr))
- {
- bNotify = HaveToNotify(xAcc, aEraseItr);
- aItr->maBackShapes.erase(aEraseItr);
- }
- }
- break;
- case SC_LAYER_CONTROLS:
- {
- if (FindShape(aItr->maControls, xShape, aEraseItr))
- {
- bNotify = HaveToNotify(xAcc, aEraseItr);
- aItr->maControls.erase(aEraseItr);
- }
- }
- break;
- default:
- {
- DBG_ERRORFILE("I don't know this layer.");
- }
- break;
- }
- if (bNotify)
- {
- AccessibleEventObject aEvent;
- aEvent.Source = uno::Reference<XAccessibleContext> (mpAccDoc);
- aEvent.EventId = AccessibleEventId::CHILD;
- aEvent.OldValue <<= xAcc;
- mpAccDoc->CommitChange(aEvent);
- bNotify = sal_False;
- }
- xAcc = NULL;
- ++aItr;
- }
-}*/
-
SdrPage* ScShapeChilds::GetDrawPage() const
{
SCTAB nTab( mpViewShell->GetLocationData().GetPrintTab() );
@@ -1446,8 +1267,6 @@ ScAccessibleDocumentPagePreview::ScAccessibleDocumentPagePreview(
if (pViewShell)
pViewShell->AddAccessibilityObject(*this);
-// GetNotesChilds(); not neccessary and reduces the creation performance
-// GetShapeChilds();
}
ScAccessibleDocumentPagePreview::~ScAccessibleDocumentPagePreview(void)
@@ -1463,7 +1282,7 @@ ScAccessibleDocumentPagePreview::~ScAccessibleDocumentPagePreview(void)
void SAL_CALL ScAccessibleDocumentPagePreview::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpTable)
{
mpTable->release();
@@ -1486,7 +1305,7 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing()
mpViewShell = NULL;
}
- // #100593# no need to Dispose the AccessibleTextHelper,
+ // no need to Dispose the AccessibleTextHelper,
// as long as mpNotesChilds are destructed here
if (mpNotesChilds)
DELETEZ(mpNotesChilds);
@@ -1596,7 +1415,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
uno::Reference<XAccessible> xAccessible;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if ( mpViewShell )
@@ -1607,19 +1426,6 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
-/* if ( rData.HasCellsInRange( Rectangle( rPoint, rPoint ) ) )
- {
- if ( !mpTable && (aCount.nTables > 0) )
- {
- //! order is background shapes, header, table or notes, footer, foreground shapes, controls
- sal_Int32 nIndex (aCount.nBackShapes + aCount.nHeaders);
-
- mpTable = new ScAccessiblePreviewTable( this, mpViewShell, nIndex );
- mpTable->acquire();
- mpTable->Init();
- }
- xAccessible = mpTable;
- }*/
if ( !mpTable && (aCount.nTables > 0) )
{
//! order is background shapes, header, table or notes, footer, foreground shapes, controls
@@ -1648,7 +1454,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
}
if (!mpFooter)
{
- mpFooter = new ScAccessiblePageHeader( this, mpViewShell, sal_False, aCount.nBackShapes + aCount.nHeaders + aCount.nTables + aCount.nNoteParagraphs + aCount.nFooters - 1 );
+ mpFooter = new ScAccessiblePageHeader( this, mpViewShell, false, aCount.nBackShapes + aCount.nHeaders + aCount.nTables + aCount.nNoteParagraphs + aCount.nFooters - 1 );
mpFooter->acquire();
}
}
@@ -1670,7 +1476,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
void SAL_CALL ScAccessibleDocumentPagePreview::grabFocus() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (getAccessibleParent().is())
{
@@ -1687,7 +1493,7 @@ void SAL_CALL ScAccessibleDocumentPagePreview::grabFocus() throw (uno::RuntimeEx
sal_Int32 SAL_CALL ScAccessibleDocumentPagePreview::getAccessibleChildCount(void) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
long nRet = 0;
@@ -1703,7 +1509,7 @@ sal_Int32 SAL_CALL ScAccessibleDocumentPagePreview::getAccessibleChildCount(void
uno::Reference<XAccessible> SAL_CALL ScAccessibleDocumentPagePreview::getAccessibleChild(sal_Int32 nIndex)
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference<XAccessible> xAccessible;
@@ -1744,7 +1550,7 @@ uno::Reference<XAccessible> SAL_CALL ScAccessibleDocumentPagePreview::getAccessi
{
if ( !mpFooter )
{
- mpFooter = new ScAccessiblePageHeader( this, mpViewShell, sal_False, nIndex );
+ mpFooter = new ScAccessiblePageHeader( this, mpViewShell, false, nIndex );
mpFooter->acquire();
}
xAccessible = mpFooter;
@@ -1769,7 +1575,7 @@ uno::Reference<XAccessible> SAL_CALL ScAccessibleDocumentPagePreview::getAccessi
uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDocumentPagePreview::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -1819,7 +1625,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleDocumentPagePreview::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -1903,40 +1709,4 @@ ScShapeChilds* ScAccessibleDocumentPagePreview::GetShapeChilds()
return mpShapeChilds;
}
-//UNUSED2009-05 uno::Reference < XAccessible > ScAccessibleDocumentPagePreview::GetCurrentAccessibleTable()
-//UNUSED2009-05 {
-//UNUSED2009-05 if (!mpTable)
-//UNUSED2009-05 {
-//UNUSED2009-05 if ( mpViewShell )
-//UNUSED2009-05 {
-//UNUSED2009-05 const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
-//UNUSED2009-05 ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
-//UNUSED2009-05 //! order is background shapes, header, table or notes, footer, foreground shapes, controls
-//UNUSED2009-05 sal_Int32 nIndex (aCount.nBackShapes + aCount.nHeaders);
-//UNUSED2009-05
-//UNUSED2009-05 mpTable = new ScAccessiblePreviewTable( this, mpViewShell, nIndex );
-//UNUSED2009-05 mpTable->acquire();
-//UNUSED2009-05 mpTable->Init();
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 return mpTable;
-//UNUSED2009-05 }
-
-//UNUSED2009-05 void ScAccessibleDocumentPagePreview::ChildCountChanged()
-//UNUSED2009-05 {
-//UNUSED2009-05 if (mpViewShell)
-//UNUSED2009-05 {
-//UNUSED2009-05 const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
-//UNUSED2009-05 ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
-//UNUSED2009-05 //! order is background shapes, header, table or notes, footer, foreground shapes, controls
-//UNUSED2009-05 if(mpHeader)
-//UNUSED2009-05 mpHeader->SetCurrentIndexInParent(aCount.nBackShapes);
-//UNUSED2009-05 if (mpTable)
-//UNUSED2009-05 mpTable->SetCurrentIndexInParent(aCount.nBackShapes + aCount.nHeaders);
-//UNUSED2009-05 if (mpFooter)
-//UNUSED2009-05 mpFooter->SetCurrentIndexInParent(aCount.nBackShapes + aCount.nHeaders + aCount.nTables + aCount.nNoteParagraphs);
-//UNUSED2009-05
-//UNUSED2009-05 if (mpNotesChilds)
-//UNUSED2009-05 mpNotesChilds->SetOffset(aCount.nBackShapes + aCount.nHeaders);
-//UNUSED2009-05 }
-//UNUSED2009-05 }
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
index fd7cbaf454c1..d30cd246857e 100644
--- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx
+++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,27 +31,21 @@
#include "AccessibleEditObject.hxx"
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
-#include "unoguard.hxx"
#include "AccessibleText.hxx"
#include "editsrc.hxx"
#include "scmod.hxx"
#include "inputhdl.hxx"
-#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX
#include <unotools/accessiblestatesethelper.hxx>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <rtl/uuid.h>
#include <tools/debug.hxx>
#include <svx/AccessibleTextHelper.hxx>
#include <editeng/editview.hxx>
#include <editeng/editeng.hxx>
#include <svx/svdmodel.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -67,7 +62,7 @@ ScAccessibleEditObject::ScAccessibleEditObject(
mpEditView(pEditView),
mpWindow(pWin),
meObjectType(eObjectType),
- mbHasFocus(sal_False)
+ mbHasFocus(false)
{
CreateTextHelper();
SetName(rName);
@@ -87,7 +82,7 @@ ScAccessibleEditObject::~ScAccessibleEditObject()
void SAL_CALL ScAccessibleEditObject::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpTextHelper)
DELETEZ(mpTextHelper);
@@ -96,9 +91,9 @@ void SAL_CALL ScAccessibleEditObject::disposing()
void ScAccessibleEditObject::LostFocus()
{
- mbHasFocus = sal_False;
+ mbHasFocus = false;
if (mpTextHelper)
- mpTextHelper->SetFocus(sal_False);
+ mpTextHelper->SetFocus(false);
CommitFocusLost();
}
@@ -119,7 +114,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleEditObject::getAccessibleAtPo
uno::Reference<XAccessible> xRet;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if(!mpTextHelper)
@@ -198,7 +193,7 @@ sal_Int32 SAL_CALL
ScAccessibleEditObject::getAccessibleChildCount(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -210,7 +205,7 @@ uno::Reference< XAccessible > SAL_CALL
throw (uno::RuntimeException,
lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -221,7 +216,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
ScAccessibleEditObject::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -301,7 +296,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleEditObject::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -356,3 +351,4 @@ void ScAccessibleEditObject::CreateTextHelper()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
index 02fb5c12463e..ce7e7d4de919 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,6 @@
#include "AccessibleGlobal.hxx"
#include "AccessibleFilterMenu.hxx"
#include "AccessibleFilterMenuItem.hxx"
-#include "unoguard.hxx"
#include "global.hxx"
#include "document.hxx"
#include "docpool.hxx"
@@ -173,7 +173,7 @@ Reference<XAccessibleStateSet> ScAccessibleFilterMenu::getAccessibleStateSet()
OUString ScAccessibleFilterMenu::getImplementationName()
throw (RuntimeException)
{
- return OUString::createFromAscii("ScAccessibleFilterMenu");
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("ScAccessibleFilterMenu"));
}
// XAccessibleEventBroadcaster
@@ -396,3 +396,5 @@ void ScAccessibleFilterMenu::updateStates()
if (isSelected())
p->insert(SELECTED);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
index 0da1e6858a75..bff9ad5bd88e 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,7 +90,7 @@ Reference<XAccessibleStateSet> ScAccessibleFilterMenuItem::getAccessibleStateSet
OUString ScAccessibleFilterMenuItem::getImplementationName()
throw (RuntimeException)
{
- return OUString::createFromAscii("ScAccessibleFilterMenuItem");
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("ScAccessibleFilterMenuItem"));
}
// XAccessibleAction
@@ -109,7 +110,7 @@ sal_Bool ScAccessibleFilterMenuItem::doAccessibleAction(sal_Int32 /*nIndex*/)
OUString ScAccessibleFilterMenuItem::getAccessibleActionDescription(sal_Int32 /*nIndex*/)
throw (IndexOutOfBoundsException, RuntimeException)
{
- return OUString::createFromAscii("click");
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("click"));
}
Reference<XAccessibleKeyBinding> ScAccessibleFilterMenuItem::getAccessibleActionKeyBinding(
@@ -203,3 +204,4 @@ void ScAccessibleFilterMenuItem::updateStateSet()
p->insert(SELECTED);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
index 2af69faa33c8..4e28e8bbb7cf 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,7 +97,7 @@ Reference<XAccessible> ScAccessibleFilterTopWindow::getAccessibleChild(
OUString ScAccessibleFilterTopWindow::getImplementationName() throw (RuntimeException)
{
- return OUString::createFromAscii("ScAccessibleFilterTopWindow");
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("ScAccessibleFilterTopWindow"));
}
void ScAccessibleFilterTopWindow::setAccessibleChild(
@@ -125,3 +126,4 @@ void ScAccessibleFilterTopWindow::setAccessibleChild(
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleGlobal.cxx b/sc/source/ui/Accessibility/AccessibleGlobal.cxx
index ac2562fa9bd5..2ddc53694c89 100644
--- a/sc/source/ui/Accessibility/AccessibleGlobal.cxx
+++ b/sc/source/ui/Accessibility/AccessibleGlobal.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ void ScAccessibleStateSet::clear()
maStates.clear();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index 6c28d22b0236..20e50119d680 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include "AccessiblePageHeaderArea.hxx"
#include "AccessibilityHints.hxx"
#include "prevwsh.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "prevloc.hxx"
#include "document.hxx"
@@ -40,9 +40,7 @@
#include "scitems.hxx"
#include "attrib.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -50,6 +48,7 @@
#include <vcl/window.hxx>
#include <svl/smplhint.hxx>
+#include <vcl/svapp.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <svl/style.hxx>
#include <svl/itempool.hxx>
@@ -121,7 +120,7 @@ ScAccessiblePageHeader::~ScAccessiblePageHeader()
void SAL_CALL ScAccessiblePageHeader::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpViewShell)
{
mpViewShell->RemoveAccessibilityObject(*this);
@@ -195,7 +194,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePageHeader::getAccessibleAtPo
if (containsPoint(aPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nCount(getAccessibleChildCount()); // fill the areas
@@ -219,7 +218,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePageHeader::getAccessibleAtPo
void SAL_CALL ScAccessiblePageHeader::grabFocus() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (getAccessibleParent().is())
{
@@ -233,7 +232,7 @@ void SAL_CALL ScAccessiblePageHeader::grabFocus() throw (uno::RuntimeException)
sal_Int32 SAL_CALL ScAccessiblePageHeader::getAccessibleChildCount() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if((mnChildCount < 0) && mpViewShell)
@@ -267,7 +266,7 @@ sal_Int32 SAL_CALL ScAccessiblePageHeader::getAccessibleChildCount() throw (uno:
uno::Reference< XAccessible > SAL_CALL ScAccessiblePageHeader::getAccessibleChild( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference<XAccessible> xRet;
@@ -304,7 +303,7 @@ sal_Int32 SAL_CALL ScAccessiblePageHeader::getAccessibleIndexInParent() throw (u
uno::Reference< XAccessibleStateSet > SAL_CALL ScAccessiblePageHeader::getAccessibleStateSet()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -439,3 +438,5 @@ void ScAccessiblePageHeader::AddChild(const EditTextObject* pArea, sal_uInt32 nI
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index 10c6a9eff13f..37eac80cec14 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,21 +32,14 @@
#include "AccessiblePageHeaderArea.hxx"
#include "AccessibleText.hxx"
#include "AccessibilityHints.hxx"
-#include "unoguard.hxx"
#include "editsrc.hxx"
#include "prevwsh.hxx"
#include "prevloc.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <editeng/editobj.hxx>
#include <svx/AccessibleTextHelper.hxx>
@@ -53,6 +47,7 @@
#include <unotools/accessiblestatesethelper.hxx>
#include <rtl/ustrbuf.hxx>
#include <toolkit/helper/convert.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -88,7 +83,7 @@ ScAccessiblePageHeaderArea::~ScAccessiblePageHeaderArea(void)
void SAL_CALL ScAccessiblePageHeaderArea::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpViewShell)
{
mpViewShell->RemoveAccessibilityObject(*this);
@@ -132,7 +127,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePageHeaderArea::getAccessible
uno::Reference<XAccessible> xRet;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if(!mpTextHelper)
@@ -150,7 +145,7 @@ sal_Int32 SAL_CALL
ScAccessiblePageHeaderArea::getAccessibleChildCount(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -162,7 +157,7 @@ uno::Reference< XAccessible > SAL_CALL
throw (uno::RuntimeException,
lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -173,7 +168,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
ScAccessiblePageHeaderArea::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -224,7 +219,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessiblePageHeaderArea::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -328,3 +323,5 @@ void ScAccessiblePageHeaderArea::CreateTextHelper()
mpTextHelper->SetEventSource(this);
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index c07eb0844b7f..e1c2d5ea6544 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,13 +36,13 @@
#include "AccessiblePreviewCell.hxx"
#include "AccessibilityHints.hxx"
#include "prevwsh.hxx"
-#include "unoguard.hxx"
#include "prevloc.hxx"
#include "document.hxx"
#include <svx/AccessibleTextHelper.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <editeng/brshitem.hxx>
#include <vcl/window.hxx>
+#include <vcl/svapp.hxx>
#include <toolkit/helper/convert.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -76,7 +77,7 @@ ScAccessiblePreviewCell::~ScAccessiblePreviewCell()
void SAL_CALL ScAccessiblePreviewCell::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpViewShell)
{
mpViewShell->RemoveAccessibilityObject(*this);
@@ -112,7 +113,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewCell::getAccessibleAtP
uno::Reference<XAccessible> xRet;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if(!mpTextHelper)
@@ -126,7 +127,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewCell::getAccessibleAtP
void SAL_CALL ScAccessiblePreviewCell::grabFocus() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (getAccessibleParent().is())
{
@@ -140,7 +141,7 @@ void SAL_CALL ScAccessiblePreviewCell::grabFocus() throw (uno::RuntimeException)
sal_Int32 SAL_CALL ScAccessiblePreviewCell::getAccessibleChildCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -150,7 +151,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewCell::getAccessibleChildCount() throw(uno:
uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewCell::getAccessibleChild(sal_Int32 nIndex)
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -160,7 +161,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewCell::getAccessibleChi
uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessiblePreviewCell::getAccessibleStateSet()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
@@ -182,7 +183,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessiblePreviewCell::getAccessi
pStateSet->AddState(AccessibleStateType::TRANSIENT);
if (isVisible())
pStateSet->AddState(AccessibleStateType::VISIBLE);
- // #111635# MANAGES_DESCENDANTS (for paragraphs)
+ // MANAGES_DESCENDANTS (for paragraphs)
pStateSet->AddState(AccessibleStateType::MANAGES_DESCENDANTS);
}
return pStateSet;
@@ -214,7 +215,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessiblePreviewCell::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -276,7 +277,7 @@ sal_Bool ScAccessiblePreviewCell::IsDefunc(
sal_Bool ScAccessiblePreviewCell::IsEditable(
const uno::Reference<XAccessibleStateSet>& /* rxParentStates */)
{
- return sal_False;
+ return false;
}
sal_Bool ScAccessiblePreviewCell::IsOpaque(
@@ -307,10 +308,11 @@ void ScAccessiblePreviewCell::CreateTextHelper()
mpTextHelper = new ::accessibility::AccessibleTextHelper( pEditSource );
mpTextHelper->SetEventSource( this );
- // #111635# paragraphs in preview are transient
+ // paragraphs in preview are transient
::accessibility::AccessibleTextHelper::VectorOfStates aChildStates;
aChildStates.push_back( AccessibleStateType::TRANSIENT );
mpTextHelper->SetAdditionalChildStates( aChildStates );
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 1085c232538c..465566216edf 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,18 +37,16 @@
#include "AccessiblePreviewHeaderCell.hxx"
#include "AccessibilityHints.hxx"
#include "prevwsh.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "prevloc.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <vcl/window.hxx>
+#include <vcl/svapp.hxx>
#include <svl/smplhint.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/sequence.hxx>
@@ -84,7 +83,7 @@ ScAccessiblePreviewHeaderCell::~ScAccessiblePreviewHeaderCell()
void SAL_CALL ScAccessiblePreviewHeaderCell::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpViewShell)
{
mpViewShell->RemoveAccessibilityObject(*this);
@@ -146,7 +145,7 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::release()
uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getCurrentValue() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
double fValue(0.0);
@@ -164,12 +163,12 @@ sal_Bool SAL_CALL ScAccessiblePreviewHeaderCell::setCurrentValue( const uno::Any
throw (uno::RuntimeException)
{
// it is not possible to set a value
- return sal_False;
+ return false;
}
uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getMaximumValue() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
double fValue(0.0);
@@ -198,7 +197,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewHeaderCell::getAccessi
uno::Reference<XAccessible> xRet;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if(!mpTextHelper)
@@ -212,7 +211,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewHeaderCell::getAccessi
void SAL_CALL ScAccessiblePreviewHeaderCell::grabFocus() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (getAccessibleParent().is())
{
@@ -226,7 +225,7 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::grabFocus() throw (uno::RuntimeExce
sal_Int32 SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleChildCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -236,7 +235,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleChildCount() thro
uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleChild(sal_Int32 nIndex)
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (!mpTextHelper)
CreateTextHelper();
@@ -251,7 +250,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleIndexInParent() t
uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessiblePreviewHeaderCell::getAccessibleStateSet()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
@@ -307,7 +306,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessiblePreviewHeaderCell::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -441,3 +440,5 @@ void ScAccessiblePreviewHeaderCell::FillTableInfo() const
mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index c60a0b93b75a..12b64837dc00 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,21 +35,19 @@
#include "AccessiblePreviewHeaderCell.hxx"
#include "AccessibilityHints.hxx"
#include "prevwsh.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "prevloc.hxx"
#include "attrib.hxx"
#include "document.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <vcl/window.hxx>
+#include <vcl/svapp.hxx>
#include <svl/smplhint.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/sequence.hxx>
@@ -82,7 +81,7 @@ ScAccessiblePreviewTable::~ScAccessiblePreviewTable()
void SAL_CALL ScAccessiblePreviewTable::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpViewShell)
{
mpViewShell->RemoveAccessibilityObject(*this);
@@ -146,7 +145,7 @@ void SAL_CALL ScAccessiblePreviewTable::release()
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRowCount() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -159,7 +158,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRowCount() throw (uno:
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnCount() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -173,32 +172,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnCount() throw (u
rtl::OUString SAL_CALL ScAccessiblePreviewTable::getAccessibleRowDescription( sal_Int32 nRow )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- // is not supported or specified so not implemented
-/* ScUnoGuard aGuard;
- IsObjectValid();
-
- FillTableInfo();
-
- rtl::OUString sName;
- if ( mpTableInfo && nRow >= 0 && nRow < mpTableInfo->GetRows() )
- {
- const ScPreviewColRowInfo& rInfo = mpTableInfo->GetRowInfo()[nRow];
- if ( rInfo.bIsHeader )
- {
- //! name of column headers row?
-
- sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Column Headers"));
- }
- else
- {
- // normal row name
- sName = rtl::OUString::valueOf( (sal_Int32) ( rInfo.nDocIndex + 1 ) );
- }
- }
- else
- throw lang::IndexOutOfBoundsException();*/
-
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
FillTableInfo();
if ( nRow < 0 || (mpTableInfo && nRow >= mpTableInfo->GetRows()) )
throw lang::IndexOutOfBoundsException();
@@ -209,32 +183,7 @@ rtl::OUString SAL_CALL ScAccessiblePreviewTable::getAccessibleRowDescription( sa
rtl::OUString SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnDescription( sal_Int32 nColumn )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- // is not supported or specified so not implemented
-/* ScUnoGuard aGuard;
- IsObjectValid();
-
- FillTableInfo();
-
- rtl::OUString sName;
- if ( mpTableInfo && nColumn >= 0 && nColumn < mpTableInfo->GetCols() )
- {
- const ScPreviewColRowInfo& rInfo = mpTableInfo->GetColInfo()[nColumn];
- if ( rInfo.bIsHeader )
- {
- //! name of row headers column?
-
- sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Row Headers"));
- }
- else
- {
- // normal column name
- sName = ScColToAlpha( rInfo.nDocIndex );
- }
- }
- else
- throw lang::IndexOutOfBoundsException();*/
-
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
FillTableInfo();
if ( nColumn < 0 || (mpTableInfo && nColumn >= mpTableInfo->GetCols()) )
throw lang::IndexOutOfBoundsException();
@@ -245,7 +194,7 @@ rtl::OUString SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnDescription(
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -279,7 +228,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRowExtentAt( sal_Int32
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -339,12 +288,12 @@ sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleRowSelected( sal_Int32 n
{
// in the page preview, there is no selection
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
FillTableInfo();
if ( nRow < 0 || (mpTableInfo && nRow >= mpTableInfo->GetRows()) )
throw lang::IndexOutOfBoundsException();
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleColumnSelected( sal_Int32 nColumn )
@@ -352,18 +301,18 @@ sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleColumnSelected( sal_Int3
{
// in the page preview, there is no selection
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
FillTableInfo();
if ( nColumn < 0 || (mpTableInfo && nColumn >= mpTableInfo->GetCols()) )
throw lang::IndexOutOfBoundsException();
- return sal_False;
+ return false;
}
uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -415,7 +364,7 @@ sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleSelected( sal_Int32 nRow
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
// in the page preview, there is no selection
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -427,13 +376,13 @@ sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleSelected( sal_Int32 nRow
else
throw lang::IndexOutOfBoundsException();
- return sal_False;
+ return false;
}
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -453,7 +402,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleIndex( sal_Int32 nRow,
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRow( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -472,7 +421,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRow( sal_Int32 nChildI
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleColumn( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -496,7 +445,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleAt
uno::Reference<XAccessible> xRet;
if (containsPoint(aPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -541,7 +490,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleAt
void SAL_CALL ScAccessiblePreviewTable::grabFocus() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (getAccessibleParent().is())
{
@@ -555,7 +504,7 @@ void SAL_CALL ScAccessiblePreviewTable::grabFocus() throw (uno::RuntimeException
sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleChildCount() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -569,7 +518,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleChildCount() throw (un
uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleChild( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
FillTableInfo();
@@ -602,7 +551,7 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleIndexInParent() throw
uno::Reference< XAccessibleStateSet > SAL_CALL ScAccessiblePreviewTable::getAccessibleStateSet()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -671,18 +620,6 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessiblePreviewTable::getImplementationId()
throw (uno::RuntimeException)
{
String sDesc(ScResId(STR_ACC_TABLE_DESCR));
-/* if (mpViewShell && mpViewShell->GetDocument())
- {
- FillTableInfo();
-
- if ( mpTableInfo )
- {
- String sCoreName;
- if (mpViewShell->GetDocument()->GetName( mpTableInfo->GetTab(), sCoreName ))
- sDesc.SearchAndReplaceAscii("%1", sCoreName);
- }
- }
- sDesc.SearchAndReplaceAscii("%2", String(ScResId(SCSTR_UNKNOWN)));*/
return rtl::OUString(sDesc);
}
@@ -767,3 +704,4 @@ void ScAccessiblePreviewTable::FillTableInfo() const
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index f85fb22531aa..94f051df2d59 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,25 +36,19 @@
#include "AccessibleDocument.hxx"
#include "tabvwsh.hxx"
#include "document.hxx"
-#include "unoguard.hxx"
#include "hints.hxx"
#include "scmod.hxx"
-#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX
#include <unotools/accessiblestatesethelper.hxx>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
#include <rtl/uuid.h>
#include <tools/debug.hxx>
#include <tools/gen.hxx>
#include <svtools/colorcfg.hxx>
+#include <vcl/svapp.hxx>
#include <algorithm>
@@ -78,7 +73,7 @@ ScAccessibleSpreadsheet::ScAccessibleSpreadsheet(
ScAccessibleSpreadsheet::ScAccessibleSpreadsheet(
ScAccessibleSpreadsheet& rParent, const ScRange& rRange ) :
ScAccessibleTableBase( rParent.mpAccDoc, rParent.mpDoc, rRange),
- mbIsSpreadsheet( sal_False )
+ mbIsSpreadsheet( false )
{
ConstructScAccessibleSpreadsheet( rParent.mpAccDoc, rParent.mpViewShell, rParent.mnTab, rParent.meSplitPos );
}
@@ -106,9 +101,9 @@ void ScAccessibleSpreadsheet::ConstructScAccessibleSpreadsheet(
mpAccCell = 0;
meSplitPos = eSplitPos;
mnTab = nTab;
- mbHasSelection = sal_False;
- mbDelIns = sal_False;
- mbIsFocusSend = sal_False;
+ mbHasSelection = false;
+ mbDelIns = false;
+ mbIsFocusSend = false;
maVisCells = GetVisCells(GetVisArea(mpViewShell, meSplitPos));
if (mpViewShell)
{
@@ -127,7 +122,7 @@ void ScAccessibleSpreadsheet::ConstructScAccessibleSpreadsheet(
void SAL_CALL ScAccessibleSpreadsheet::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpViewShell)
{
mpViewShell->RemoveAccessibilityObject(*this);
@@ -273,16 +268,8 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
if (!mbDelIns)
CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
else
- mbDelIns = sal_False;
+ mbDelIns = false;
}
- // no longer needed, because the document calls the VisAreaChanged method
-/* else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
- {
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
-
- CommitChange(aEvent);*/
// commented out, because to use a ModelChangeEvent is not the right way
// at the moment there is no way, but the Java/Gnome Api should be extended sometime
/* if (mpViewShell)
@@ -301,20 +288,11 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
CommitTableModelChange(aNewPos.Top(), aNewPos.Left(), aNewPos.Bottom(), aNewPos.Right(), AccessibleTableModelChangeType::UPDATE);
}
}*/
- // no longer needed, because the document calls the BoundingBoxChanged method
-/* else if (rRef.GetId() == SC_HINT_ACC_WINDOWRESIZED)
- {
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::BOUNDRECT_CHANGED;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
-
- CommitChange(aEvent);
- }*/
}
else if (rHint.ISA( ScUpdateRefHint ))
{
const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //#107250# test whether table is inserted or deleted
+ if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //test whether table is inserted or deleted
{
if (((rRef.GetRange().aStart.Col() == maRange.aStart.Col()) &&
(rRef.GetRange().aEnd.Col() == maRange.aEnd.Col())) ||
@@ -354,7 +332,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
else
{
- DBG_ERROR("is it a deletion or a insertion?");
+ OSL_FAIL("is it a deletion or a insertion?");
}
CommitTableModelChange(rRef.GetRange().aStart.Row(),
@@ -381,7 +359,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessibleRowHeaders( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference< XAccessibleTable > xAccessibleTable;
if( mpDoc && mbIsSpreadsheet )
@@ -400,7 +378,7 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessib
uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessibleColumnHeaders( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference< XAccessibleTable > xAccessibleTable;
if( mpDoc && mbIsSpreadsheet )
@@ -419,7 +397,7 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessib
uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessibleRows( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Sequence<sal_Int32> aSequence;
if (mpViewShell && mpViewShell->GetViewData())
@@ -446,7 +424,7 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessib
uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessibleColumns( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Sequence<sal_Int32> aSequence;
if (mpViewShell && mpViewShell->GetViewData())
@@ -473,13 +451,13 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessib
sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleRowSelected( sal_Int32 nRow )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if ((nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
throw lang::IndexOutOfBoundsException();
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (mpViewShell && mpViewShell->GetViewData())
{
const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
@@ -491,13 +469,13 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleRowSelected( sal_Int32 nR
sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleColumnSelected( sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0))
throw lang::IndexOutOfBoundsException();
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (mpViewShell && mpViewShell->GetViewData())
{
const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
@@ -524,7 +502,7 @@ ScAccessibleCell* ScAccessibleSpreadsheet::GetAccessibleCellAt(sal_Int32 nRow, s
uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (nRow > (maRange.aEnd.Row() - maRange.aStart.Row()) ||
nRow < 0 ||
@@ -542,14 +520,14 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleCel
sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0) ||
(nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
throw lang::IndexOutOfBoundsException();
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (mpViewShell)
{
const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
@@ -567,7 +545,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleAtP
uno::Reference< XAccessible > xAccessible;
if (containsPoint(rPoint))
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpViewShell)
{
@@ -600,7 +578,7 @@ sal_Int32 SAL_CALL ScAccessibleSpreadsheet::getForeground( )
sal_Int32 SAL_CALL ScAccessibleSpreadsheet::getBackground( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
}
@@ -622,7 +600,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
ScAccessibleSpreadsheet::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<XAccessibleStateSet> xParentStates;
if (getAccessibleParent().is())
{
@@ -660,7 +638,7 @@ void SAL_CALL
ScAccessibleSpreadsheet::selectAccessibleChild( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
throw lang::IndexOutOfBoundsException();
@@ -670,7 +648,7 @@ void SAL_CALL
sal_Int32 nCol(getAccessibleColumn(nChildIndex));
sal_Int32 nRow(getAccessibleRow(nChildIndex));
- SelectCell(nRow, nCol, sal_False);
+ SelectCell(nRow, nCol, false);
}
}
@@ -678,7 +656,7 @@ void SAL_CALL
ScAccessibleSpreadsheet::clearAccessibleSelection( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpViewShell)
{
@@ -690,7 +668,7 @@ void SAL_CALL
ScAccessibleSpreadsheet::selectAllAccessibleChildren( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (mpViewShell)
{
@@ -702,7 +680,7 @@ sal_Int32 SAL_CALL
ScAccessibleSpreadsheet::getSelectedAccessibleChildCount( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
sal_Int32 nResult(0);
if (mpViewShell)
@@ -712,7 +690,7 @@ sal_Int32 SAL_CALL
mpMarkedRanges = new ScRangeList();
ScMarkData aMarkData(mpViewShell->GetViewData()->GetMarkData());
aMarkData.MarkToMulti();
- aMarkData.FillRangeListWithMarks(mpMarkedRanges, sal_False);
+ aMarkData.FillRangeListWithMarks(mpMarkedRanges, false);
}
// is possible, because there shouldn't be overlapped ranges in it
if (mpMarkedRanges)
@@ -725,7 +703,7 @@ uno::Reference<XAccessible > SAL_CALL
ScAccessibleSpreadsheet::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
uno::Reference < XAccessible > xAccessible;
if (mpViewShell)
@@ -733,7 +711,7 @@ uno::Reference<XAccessible > SAL_CALL
if (!mpMarkedRanges)
{
mpMarkedRanges = new ScRangeList();
- mpViewShell->GetViewData()->GetMarkData().FillRangeListWithMarks(mpMarkedRanges, sal_False);
+ mpViewShell->GetViewData()->GetMarkData().FillRangeListWithMarks(mpMarkedRanges, false);
}
if (mpMarkedRanges)
{
@@ -756,7 +734,7 @@ void SAL_CALL
ScAccessibleSpreadsheet::deselectAccessibleChild( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
@@ -777,7 +755,7 @@ void ScAccessibleSpreadsheet::SelectCell(sal_Int32 nRow, sal_Int32 nCol, sal_Boo
mpViewShell->SetTabNo( maRange.aStart.Tab() );
mpViewShell->DoneBlockMode( sal_True ); // continue selecting
- mpViewShell->InitBlockMode( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), maRange.aStart.Tab(), bDeselect, sal_False, sal_False );
+ mpViewShell->InitBlockMode( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), maRange.aStart.Tab(), bDeselect, false, false );
mpViewShell->SelectionChanged();
}
@@ -786,9 +764,9 @@ void ScAccessibleSpreadsheet::CreateSortedMarkedCells()
{
mpSortedMarkedCells = new std::vector<ScMyAddress>();
mpSortedMarkedCells->reserve(mpMarkedRanges->GetCellCount());
- ScRange* pRange = mpMarkedRanges->First();
- while (pRange)
+ for ( size_t i = 0, ListSize = mpMarkedRanges->size(); i < ListSize; ++i )
{
+ ScRange* pRange = (*mpMarkedRanges)[i];
if (pRange->aStart.Tab() != pRange->aEnd.Tab())
{
if ((maActiveCell.Tab() >= pRange->aStart.Tab()) ||
@@ -801,16 +779,15 @@ void ScAccessibleSpreadsheet::CreateSortedMarkedCells()
}
else
{
- DBG_ERROR("Range of wrong table");
+ OSL_FAIL("Range of wrong table");
}
}
else if(pRange->aStart.Tab() == maActiveCell.Tab())
AddMarkedRange(*pRange);
else
{
- DBG_ERROR("Range of wrong table");
+ OSL_FAIL("Range of wrong table");
}
- pRange = mpMarkedRanges->Next();
}
std::sort(mpSortedMarkedCells->begin(), mpSortedMarkedCells->end());
}
@@ -855,7 +832,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleSpreadsheet::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -871,7 +848,7 @@ uno::Sequence<sal_Int8> SAL_CALL
void SAL_CALL ScAccessibleSpreadsheet::addEventListener(const uno::Reference<XAccessibleEventListener>& xListener)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
ScAccessibleTableBase::addEventListener(xListener);
@@ -928,7 +905,7 @@ sal_Bool ScAccessibleSpreadsheet::IsDefunc(
sal_Bool ScAccessibleSpreadsheet::IsEditable(
const uno::Reference<XAccessibleStateSet>& /* rxParentStates */)
{
- sal_Bool bProtected(sal_False);
+ sal_Bool bProtected(false);
if (mpDoc && mpDoc->IsTabProtected(maRange.aStart.Tab()))
bProtected = sal_True;
return !bProtected;
@@ -936,7 +913,7 @@ sal_Bool ScAccessibleSpreadsheet::IsEditable(
sal_Bool ScAccessibleSpreadsheet::IsFocused()
{
- sal_Bool bFocused(sal_False);
+ sal_Bool bFocused(false);
if (mpViewShell)
{
if (mpViewShell->GetViewData()->GetActivePart() == meSplitPos)
@@ -947,7 +924,7 @@ sal_Bool ScAccessibleSpreadsheet::IsFocused()
sal_Bool ScAccessibleSpreadsheet::IsCompleteSheetSelected()
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if(mpViewShell)
{
//#103800#; use a copy of MarkData
@@ -997,3 +974,5 @@ Rectangle ScAccessibleSpreadsheet::GetVisCells(const Rectangle& rVisArea)
else
return Rectangle();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index 2d46d3eb776b..26b188e065ab 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,20 +33,16 @@
#include "AccessibleTableBase.hxx"
#include "miscuno.hxx"
#include "document.hxx"
-#include "unoguard.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <rtl/uuid.h>
#include <tools/debug.hxx>
#include <comphelper/sequence.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -70,7 +67,7 @@ ScAccessibleTableBase::~ScAccessibleTableBase()
void SAL_CALL ScAccessibleTableBase::disposing()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
mpDoc = NULL;
ScAccessibleContextBase::disposing();
@@ -102,7 +99,7 @@ void SAL_CALL ScAccessibleTableBase::release()
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowCount( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return maRange.aEnd.Row() - maRange.aStart.Row() + 1;
}
@@ -110,7 +107,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowCount( )
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return maRange.aEnd.Col() - maRange.aStart.Col() + 1;
}
@@ -118,7 +115,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( )
::rtl::OUString SAL_CALL ScAccessibleTableBase::getAccessibleRowDescription( sal_Int32 nRow )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- DBG_ERROR("Here should be a implementation to fill the description");
+ OSL_FAIL("Here should be a implementation to fill the description");
if ((nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
throw lang::IndexOutOfBoundsException();
@@ -130,7 +127,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( )
::rtl::OUString SAL_CALL ScAccessibleTableBase::getAccessibleColumnDescription( sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- DBG_ERROR("Here should be a implementation to fill the description");
+ OSL_FAIL("Here should be a implementation to fill the description");
if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0))
throw lang::IndexOutOfBoundsException();
@@ -142,7 +139,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( )
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0) ||
@@ -171,7 +168,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowExtentAt( sal_Int32 nR
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0) ||
@@ -201,7 +198,7 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleTableBase::getAccessible
throw (uno::RuntimeException)
{
uno::Reference< XAccessibleTable > xAccessibleTable;
- DBG_ERROR("Here should be a implementation to fill the row headers");
+ OSL_FAIL("Here should be a implementation to fill the row headers");
//CommitChange
return xAccessibleTable;
@@ -211,7 +208,7 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleTableBase::getAccessible
throw (uno::RuntimeException)
{
uno::Reference< XAccessibleTable > xAccessibleTable;
- DBG_ERROR("Here should be a implementation to fill the column headers");
+ OSL_FAIL("Here should be a implementation to fill the column headers");
//CommitChange
return xAccessibleTable;
@@ -220,7 +217,7 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleTableBase::getAccessible
uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleTableBase::getSelectedAccessibleRows( )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented yet");
+ OSL_FAIL("not implemented yet");
uno::Sequence< sal_Int32 > aSequence;
return aSequence;
}
@@ -228,7 +225,7 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleTableBase::getSelectedAccessible
uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleTableBase::getSelectedAccessibleColumns( )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented yet");
+ OSL_FAIL("not implemented yet");
uno::Sequence< sal_Int32 > aSequence;
return aSequence;
}
@@ -236,21 +233,21 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleTableBase::getSelectedAccessible
sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleRowSelected( sal_Int32 /* nRow */ )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- DBG_ERROR("not implemented yet");
- return sal_False;
+ OSL_FAIL("not implemented yet");
+ return false;
}
sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleColumnSelected( sal_Int32 /* nColumn */ )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- DBG_ERROR("not implemented yet");
- return sal_False;
+ OSL_FAIL("not implemented yet");
+ return false;
}
uno::Reference< XAccessible > SAL_CALL ScAccessibleTableBase::getAccessibleCellAt( sal_Int32 /* nRow */, sal_Int32 /* nColumn */ )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- DBG_ERROR("not implemented yet");
+ OSL_FAIL("not implemented yet");
uno::Reference< XAccessible > xAccessible;
return xAccessible;
}
@@ -258,7 +255,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleTableBase::getAccessibleCellA
uno::Reference< XAccessible > SAL_CALL ScAccessibleTableBase::getAccessibleCaption( )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented yet");
+ OSL_FAIL("not implemented yet");
uno::Reference< XAccessible > xAccessible;
return xAccessible;
}
@@ -266,7 +263,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleTableBase::getAccessibleCapti
uno::Reference< XAccessible > SAL_CALL ScAccessibleTableBase::getAccessibleSummary( )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented yet");
+ OSL_FAIL("not implemented yet");
uno::Reference< XAccessible > xAccessible;
return xAccessible;
}
@@ -274,8 +271,8 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleTableBase::getAccessibleSumma
sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleSelected( sal_Int32 /* nRow */, sal_Int32 /* nColumn */ )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- DBG_ERROR("not implemented yet");
- return sal_False;
+ OSL_FAIL("not implemented yet");
+ return false;
}
//===== XAccessibleExtendedTable ========================================
@@ -283,7 +280,7 @@ sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleSelected( sal_Int32 /* nRow
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (nRow > (maRange.aEnd.Row() - maRange.aStart.Row()) ||
@@ -300,7 +297,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleIndex( sal_Int32 nRow, sa
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRow( sal_Int32 nChildIndex )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (nChildIndex >= getAccessibleChildCount() || nChildIndex < 0)
@@ -312,7 +309,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRow( sal_Int32 nChildInde
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumn( sal_Int32 nChildIndex )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (nChildIndex >= getAccessibleChildCount() || nChildIndex < 0)
@@ -327,7 +324,7 @@ sal_Int32 SAL_CALL
ScAccessibleTableBase::getAccessibleChildCount(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
return static_cast<sal_Int32>(maRange.aEnd.Row() - maRange.aStart.Row() + 1) *
(maRange.aEnd.Col() - maRange.aStart.Col() + 1);
@@ -339,7 +336,7 @@ uno::Reference< XAccessible > SAL_CALL
throw (uno::RuntimeException,
lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
if (nIndex >= getAccessibleChildCount() || nIndex < 0)
@@ -358,10 +355,6 @@ uno::Reference< XAccessible > SAL_CALL
throw (uno::RuntimeException)
{
String sDesc(ScResId(STR_ACC_TABLE_DESCR));
-/* String sCoreName;
- if (mpDoc && mpDoc->GetName( maRange.aStart.Tab(), sCoreName ))
- sDesc.SearchAndReplaceAscii("%1", sCoreName);
- sDesc.SearchAndReplaceAscii("%2", String(ScResId(SCSTR_UNKNOWN)));*/
return rtl::OUString(sDesc);
}
@@ -380,7 +373,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL
ScAccessibleTableBase::getAccessibleRelationSet(void)
throw (uno::RuntimeException)
{
- DBG_ERROR("should be implemented in the abrevated class");
+ OSL_FAIL("should be implemented in the abrevated class");
return uno::Reference<XAccessibleRelationSet>();
}
@@ -388,7 +381,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
ScAccessibleTableBase::getAccessibleStateSet(void)
throw (uno::RuntimeException)
{
- DBG_ERROR("should be implemented in the abrevated class");
+ OSL_FAIL("should be implemented in the abrevated class");
uno::Reference< XAccessibleStateSet > xAccessibleStateSet;
return xAccessibleStateSet;
}
@@ -405,8 +398,7 @@ sal_Bool SAL_CALL
ScAccessibleTableBase::isAccessibleChildSelected( sal_Int32 nChildIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- // I don't need to guard, because the called funtions have a guard
-// ScUnoGuard aGuard;
+ // I don't need to guard, because the called functions have a guard
if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
throw lang::IndexOutOfBoundsException();
return isAccessibleSelected(getAccessibleRow(nChildIndex), getAccessibleColumn(nChildIndex));
@@ -466,7 +458,7 @@ uno::Sequence<sal_Int8> SAL_CALL
ScAccessibleTableBase::getImplementationId(void)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
IsObjectValid();
static uno::Sequence<sal_Int8> aId;
if (aId.getLength() == 0)
@@ -493,3 +485,5 @@ void ScAccessibleTableBase::CommitTableModelChange(sal_Int32 nStartRow, sal_Int3
CommitChange(aEvent);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index a1dde515099d..2dbbd15c2f12 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,6 @@
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
-
#include <memory>
#include "AccessibleText.hxx"
#include "AccessibleCell.hxx"
@@ -42,7 +42,6 @@
#include "prevwsh.hxx"
#include "docsh.hxx"
#include "prevloc.hxx"
-#include "unoguard.hxx"
#include "patattr.hxx"
#include "inputwin.hxx"
#include <editeng/unofored.hxx>
@@ -51,8 +50,10 @@
#include <vcl/virdev.hxx>
#include <editeng/editobj.hxx>
#include <editeng/adjitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/svdmodel.hxx>
#include <svx/algitem.hxx>
+#include <vcl/svapp.hxx>
// ============================================================================
@@ -114,7 +115,7 @@ Rectangle ScViewForwarder::GetVisArea() const
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return aVisArea;
}
@@ -129,7 +130,7 @@ Point ScViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMod
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
@@ -144,7 +145,7 @@ Point ScViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMod
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
@@ -159,15 +160,11 @@ void ScViewForwarder::SetInvalid()
class ScEditObjectViewForwarder : public SvxViewForwarder
{
Window* mpWindow;
- // --> OD 2005-12-21 #i49561#
- // - EditView needed for access to its visible area.
+ // #i49561# EditView needed for access to its visible area.
const EditView* mpEditView;
- // <--
public:
- // --> OD 2005-12-21 #i49561#
ScEditObjectViewForwarder( Window* pWindow,
const EditView* _pEditView);
- // <--
virtual ~ScEditObjectViewForwarder();
virtual sal_Bool IsValid() const;
@@ -178,7 +175,6 @@ public:
void SetInvalid();
};
-// --> OD 2005-12-21 #i49561#
ScEditObjectViewForwarder::ScEditObjectViewForwarder( Window* pWindow,
const EditView* _pEditView )
:
@@ -186,7 +182,6 @@ ScEditObjectViewForwarder::ScEditObjectViewForwarder( Window* pWindow,
mpEditView( _pEditView )
{
}
-// <--
ScEditObjectViewForwarder::~ScEditObjectViewForwarder()
{
@@ -210,7 +205,7 @@ Rectangle ScEditObjectViewForwarder::GetVisArea() const
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return aVisArea;
}
@@ -219,7 +214,7 @@ Point ScEditObjectViewForwarder::LogicToPixel( const Point& rPoint, const MapMod
{
if (mpWindow)
{
- // --> OD 2005-12-21 #i49561# - consider offset of the visible area
+ // #i49561# - consider offset of the visible area
// of the EditView before converting point to pixel.
Point aPoint( rPoint );
if ( mpEditView )
@@ -228,11 +223,10 @@ Point ScEditObjectViewForwarder::LogicToPixel( const Point& rPoint, const MapMod
aPoint += aEditViewVisArea.TopLeft();
}
return mpWindow->LogicToPixel( aPoint, rMapMode );
- // <--
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
@@ -241,7 +235,7 @@ Point ScEditObjectViewForwarder::PixelToLogic( const Point& rPoint, const MapMod
{
if (mpWindow)
{
- // --> OD 2005-12-21 #i49561# - consider offset of the visible area
+ // #i49561# - consider offset of the visible area
// of the EditView after converting point to logic.
Point aPoint( mpWindow->PixelToLogic( rPoint, rMapMode ) );
if ( mpEditView )
@@ -250,11 +244,10 @@ Point ScEditObjectViewForwarder::PixelToLogic( const Point& rPoint, const MapMod
aPoint -= aEditViewVisArea.TopLeft();
}
return aPoint;
- // <--
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
@@ -264,8 +257,6 @@ void ScEditObjectViewForwarder::SetInvalid()
mpWindow = NULL;
}
-// ============================================================================
-
class ScPreviewViewForwarder : public SvxViewForwarder
{
protected:
@@ -308,7 +299,7 @@ sal_Bool ScPreviewViewForwarder::IsValid() const
Rectangle ScPreviewViewForwarder::GetVisArea() const
{
Rectangle aVisArea;
- DBG_ERROR("should be implemented in an abrevated class");
+ OSL_FAIL("should be implemented in an abrevated class");
return aVisArea;
}
@@ -326,7 +317,7 @@ Point ScPreviewViewForwarder::LogicToPixel( const Point& rPoint, const MapMode&
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
@@ -349,7 +340,7 @@ Point ScPreviewViewForwarder::PixelToLogic( const Point& rPoint, const MapMode&
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
@@ -399,8 +390,6 @@ Rectangle ScPreviewViewForwarder::CorrectVisArea(const Rectangle& rVisArea) cons
return aVisArea;
}
-// ============================================================================
-
class ScPreviewHeaderFooterViewForwarder : public ScPreviewViewForwarder
{
sal_Bool mbHeader;
@@ -437,13 +426,11 @@ Rectangle ScPreviewHeaderFooterViewForwarder::GetVisArea() const
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return aVisArea;
}
-// ============================================================================
-
class ScPreviewCellViewForwarder : public ScPreviewViewForwarder
{
ScAddress maCellPos;
@@ -479,13 +466,11 @@ Rectangle ScPreviewCellViewForwarder::GetVisArea() const
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return aVisArea;
}
-// ============================================================================
-
class ScPreviewHeaderCellViewForwarder : public ScPreviewViewForwarder
{
ScAddress maCellPos;
@@ -527,13 +512,11 @@ Rectangle ScPreviewHeaderCellViewForwarder::GetVisArea() const
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return aVisArea;
}
-// ============================================================================
-
class ScPreviewNoteViewForwarder : public ScPreviewViewForwarder
{
ScAddress maCellPos;
@@ -573,13 +556,11 @@ Rectangle ScPreviewNoteViewForwarder::GetVisArea() const
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return aVisArea;
}
-// ============================================================================
-
class ScEditViewForwarder : public SvxEditViewForwarder
{
EditView* mpEditView;
@@ -616,7 +597,7 @@ ScEditViewForwarder::~ScEditViewForwarder()
sal_Bool ScEditViewForwarder::IsValid() const
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (mpWindow && mpEditView)
{
bResult = sal_True;
@@ -635,7 +616,7 @@ Rectangle ScEditViewForwarder::GetVisArea() const
}
else
{
- DBG_ERROR("this EditViewForwarder is no longer valid");
+ OSL_FAIL("this EditViewForwarder is no longer valid");
}
return aVisArea;
}
@@ -646,7 +627,7 @@ Point ScEditViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMa
return mpWindow->LogicToPixel( rPoint, rMapMode );
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
@@ -657,14 +638,14 @@ Point ScEditViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMa
return mpWindow->PixelToLogic( rPoint, rMapMode );
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return Point();
}
sal_Bool ScEditViewForwarder::GetSelection( ESelection& rSelection ) const
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (IsValid())
{
rSelection = mpEditView->GetSelection();
@@ -672,14 +653,14 @@ sal_Bool ScEditViewForwarder::GetSelection( ESelection& rSelection ) const
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return bResult;
}
sal_Bool ScEditViewForwarder::SetSelection( const ESelection& rSelection )
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (IsValid())
{
mpEditView->SetSelection(rSelection);
@@ -687,14 +668,14 @@ sal_Bool ScEditViewForwarder::SetSelection( const ESelection& rSelection )
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return bResult;
}
sal_Bool ScEditViewForwarder::Copy()
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (IsValid())
{
mpEditView->Copy();
@@ -702,14 +683,14 @@ sal_Bool ScEditViewForwarder::Copy()
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return bResult;
}
sal_Bool ScEditViewForwarder::Cut()
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (IsValid())
{
mpEditView->Cut();
@@ -717,14 +698,14 @@ sal_Bool ScEditViewForwarder::Cut()
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return bResult;
}
sal_Bool ScEditViewForwarder::Paste()
{
- sal_Bool bResult(sal_False);
+ sal_Bool bResult(false);
if (IsValid())
{
mpEditView->Paste();
@@ -732,7 +713,7 @@ sal_Bool ScEditViewForwarder::Paste()
}
else
{
- DBG_ERROR("this ViewForwarder is not valid");
+ OSL_FAIL("this ViewForwarder is not valid");
}
return bResult;
}
@@ -747,8 +728,6 @@ void ScEditViewForwarder::SetInvalid()
mpEditView = NULL;
}
-// ============================================================================
-
// ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object
ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell,
@@ -758,7 +737,7 @@ ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell,
mpEditViewForwarder(NULL),
mpViewShell(pViewShell),
meSplitPos(eSplitPos),
- mbViewEditEngine(sal_False),
+ mbViewEditEngine(false),
mpAccessibleCell( pAccCell )
{
}
@@ -824,47 +803,7 @@ void ScAccessibleCellTextData::GetCellText(const ScAddress& rCellPos, String& rT
SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
{
-/* sal_Bool bHasForwarder(sal_False);
- if (mpViewShell && mpViewShell->GetViewData() &&
- (mpViewShell->GetViewData()->GetCurPos() == aCellPos) &&
- (mpViewShell->GetViewData()->HasEditView(meSplitPos)) &&
- (mpViewShell->GetViewData()->GetEditViewCol() == aCellPos.Col()) &&
- (mpViewShell->GetViewData()->GetEditViewRow() == aCellPos.Row()))
- {
- if (!mbViewEditEngine)
- {
- if (pForwarder)
- DELETEZ( pForwarder );
- if (pEditEngine)
- DELETEZ( pEditEngine );
-
- SCCOL nCol;
- SCROW nRow;
- EditView* pEditView;
- mpViewShell->GetViewData()->GetEditView( meSplitPos, pEditView, nCol, nRow );
- if (pEditView)
- {
- pEditEngine = (ScFieldEditEngine*)pEditView->GetEditEngine();
- pForwarder = new SvxEditEngineForwarder(*pEditEngine);
- bHasForwarder = sal_True;
- }
- }
- else
- bHasForwarder = sal_True;
- }
- else if (mbViewEditEngine)
- {
- // remove Forwarder created with EditEngine from EditView
- if (pForwarder)
- DELETEZ( pForwarder );
- pEditEngine->SetNotifyHdl(Link());
- // don't delete, because it is the EditEngine of the EditView
- pEditEngine = NULL;
- mbViewEditEngine = sal_False;
- }
-
- if (!bHasForwarder)*/
- ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine
+ ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine
ScDocument* pDoc = ( pDocShell ? pDocShell->GetDocument() : NULL );
if ( pDoc && pEditEngine && mpViewShell )
@@ -1024,18 +963,6 @@ SvxViewForwarder* ScAccessibleCellTextData::GetViewForwarder()
SvxEditViewForwarder* ScAccessibleCellTextData::GetEditViewForwarder( sal_Bool /* bCreate */ )
{
//#102219#; there should no EditViewForwarder be, because the cell is now readonly in this interface
-/* if (!mpEditViewForwarder)
- {
- SCCOL nCol;
- SCROW nRow;
- EditView* pEditView;
- mpViewShell->GetViewData()->GetEditView( meSplitPos, pEditView, nCol, nRow );
-
- mpEditViewForwarder = new ScEditViewForwarder(pEditView, mpViewShell->GetWindowByPos(meSplitPos));
- }
- else if (bCreate)
- mpEditViewForwarder->GrabFocus();
- return mpEditViewForwarder;*/
return NULL;
}
@@ -1061,8 +988,6 @@ ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell)
}
-// ============================================================================
-
ScAccessibleEditObjectTextData::ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin)
:
mpViewForwarder(NULL),
@@ -1131,9 +1056,8 @@ SvxViewForwarder* ScAccessibleEditObjectTextData::GetViewForwarder()
{
if (!mpViewForwarder)
{
- // --> OD 2005-12-21 #i49561#
+ // i#49561 Get right-aligned cell content to be read by screenreader.
mpViewForwarder = new ScEditObjectViewForwarder( mpWindow, mpEditView );
- // <--
}
return mpViewForwarder;
}
@@ -1167,13 +1091,10 @@ IMPL_LINK(ScAccessibleEditObjectTextData, NotifyHdl, EENotify*, aNotify)
return 0;
}
-
-// ============================================================================
-
ScAccessibleEditLineTextData::ScAccessibleEditLineTextData(EditView* pEditView, Window* pWin)
:
ScAccessibleEditObjectTextData(pEditView, pWin),
- mbEditEngineCreated(sal_False)
+ mbEditEngineCreated(false)
{
ScTextWnd* pTxtWnd = (ScTextWnd*)pWin;
@@ -1191,11 +1112,11 @@ ScAccessibleEditLineTextData::~ScAccessibleEditLineTextData()
if (mbEditEngineCreated && mpEditEngine)
{
delete mpEditEngine;
- mpEditEngine = NULL; // #103346# don't access in ScAccessibleEditObjectTextData dtor!
+ mpEditEngine = NULL; // don't access in ScAccessibleEditObjectTextData dtor!
}
else if (pTxtWnd && pTxtWnd->GetEditView() && pTxtWnd->GetEditView()->GetEditEngine())
{
- // #103346# the NotifyHdl also has to be removed from the ScTextWnd's EditEngine
+ // the NotifyHdl also has to be removed from the ScTextWnd's EditEngine
// (it's set in ScAccessibleEditLineTextData::GetTextForwarder, and mpEditEngine
// is reset there)
pTxtWnd->GetEditView()->GetEditEngine()->SetNotifyHdl(Link());
@@ -1229,7 +1150,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder()
{
if (mbEditEngineCreated && mpEditEngine)
ResetEditMode();
- mbEditEngineCreated = sal_False;
+ mbEditEngineCreated = false;
mpEditView = pTxtWnd->GetEditView();
ScAccessibleEditObjectTextData::GetTextForwarder(); // fill the mpForwarder
@@ -1245,10 +1166,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder()
pEnginePool->FreezeIdRanges();
mpEditEngine = new ScFieldEditEngine( pEnginePool, NULL, sal_True );
mbEditEngineCreated = sal_True;
- // currently, GetPortions doesn't work if UpdateMode is sal_False,
- // this will be fixed (in EditEngine) by src600
- // pEditEngine->SetUpdateMode( sal_False );
- mpEditEngine->EnableUndo( sal_False );
+ mpEditEngine->EnableUndo( false );
mpEditEngine->SetRefMapMode( MAP_100TH_MM );
mpForwarder = new SvxEditEngineForwarder(*mpEditEngine);
@@ -1280,8 +1198,6 @@ SvxEditViewForwarder* ScAccessibleEditLineTextData::GetEditViewForwarder( sal_Bo
{
pTxtWnd->StartEditEngine();
pTxtWnd->GrabFocus();
-// pTxtWnd->SetTextString( rText );
-// pTxtWnd->GetEditView()->SetSelection( rSel );
mpEditView = pTxtWnd->GetEditView();
}
@@ -1304,7 +1220,7 @@ void ScAccessibleEditLineTextData::ResetEditMode()
DELETEZ(mpForwarder);
DELETEZ(mpEditViewForwarder);
DELETEZ(mpViewForwarder);
- mbEditEngineCreated = sal_False;
+ mbEditEngineCreated = false;
}
void ScAccessibleEditLineTextData::TextChanged()
@@ -1339,8 +1255,6 @@ void ScAccessibleEditLineTextData::EndEdit()
}
-// ============================================================================
-
// ScAccessiblePreviewCellTextData: shared data between sub objects of a accessible cell text object
ScAccessiblePreviewCellTextData::ScAccessiblePreviewCellTextData(ScPreviewShell* pViewShell,
@@ -1407,19 +1321,6 @@ SvxViewForwarder* ScAccessiblePreviewCellTextData::GetViewForwarder()
return mpViewForwarder;
}
-//UNUSED2008-05 IMPL_LINK(ScAccessiblePreviewCellTextData, NotifyHdl, EENotify*, aNotify)
-//UNUSED2008-05 {
-//UNUSED2008-05 if( aNotify )
-//UNUSED2008-05 {
-//UNUSED2008-05 ::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify);
-//UNUSED2008-05
-//UNUSED2008-05 if( aHint.get() )
-//UNUSED2008-05 GetBroadcaster().Broadcast( *aHint.get() );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 return 0;
-//UNUSED2008-05 }
-
ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewShell)
{
ScDocShell* pDocSh = NULL;
@@ -1429,8 +1330,6 @@ ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewSh
}
-// ============================================================================
-
// ScAccessiblePreviewHeaderCellTextData: shared data between sub objects of a accessible cell text object
ScAccessiblePreviewHeaderCellTextData::ScAccessiblePreviewHeaderCellTextData(ScPreviewShell* pViewShell,
@@ -1487,10 +1386,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
pEnginePool->FreezeIdRanges();
pEditEngine = new ScFieldEditEngine( pEnginePool, NULL, sal_True );
}
- // currently, GetPortions doesn't work if UpdateMode is sal_False,
- // this will be fixed (in EditEngine) by src600
-// pEditEngine->SetUpdateMode( sal_False );
- pEditEngine->EnableUndo( sal_False );
+ pEditEngine->EnableUndo( false );
if (pDocShell)
pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
else
@@ -1535,19 +1431,6 @@ SvxViewForwarder* ScAccessiblePreviewHeaderCellTextData::GetViewForwarder()
return mpViewForwarder;
}
-//UNUSED2008-05 IMPL_LINK(ScAccessiblePreviewHeaderCellTextData, NotifyHdl, EENotify*, aNotify)
-//UNUSED2008-05 {
-//UNUSED2008-05 if( aNotify )
-//UNUSED2008-05 {
-//UNUSED2008-05 ::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify);
-//UNUSED2008-05
-//UNUSED2008-05 if( aHint.get() )
-//UNUSED2008-05 GetBroadcaster().Broadcast( *aHint.get() );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 return 0;
-//UNUSED2008-05 }
-
ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* pViewShell)
{
ScDocShell* pDocSh = NULL;
@@ -1556,9 +1439,6 @@ ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* p
return pDocSh;
}
-
-// ============================================================================
-
ScAccessibleHeaderTextData::ScAccessibleHeaderTextData(ScPreviewShell* pViewShell,
const EditTextObject* pEditObj, sal_Bool bHeader, SvxAdjust eAdjust)
:
@@ -1569,7 +1449,7 @@ ScAccessibleHeaderTextData::ScAccessibleHeaderTextData(ScPreviewShell* pViewShel
mpDocSh(NULL),
mpEditObj(pEditObj),
mbHeader(bHeader),
- mbDataValid(sal_False),
+ mbDataValid(false),
meAdjust(eAdjust)
{
if (pViewShell && pViewShell->GetDocument())
@@ -1580,7 +1460,7 @@ ScAccessibleHeaderTextData::ScAccessibleHeaderTextData(ScPreviewShell* pViewShel
ScAccessibleHeaderTextData::~ScAccessibleHeaderTextData()
{
- ScUnoGuard aGuard; // needed for EditEngine dtor
+ SolarMutexGuard aGuard; // needed for EditEngine dtor
if (mpDocSh)
mpDocSh->GetDocument()->RemoveUnoObject(*this);
@@ -1618,7 +1498,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
pEnginePool->FreezeIdRanges();
ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool, sal_True );
- pHdrEngine->EnableUndo( sal_False );
+ pHdrEngine->EnableUndo( false );
pHdrEngine->SetRefMapMode( MAP_TWIP );
// default font must be set, independently of document
@@ -1673,9 +1553,6 @@ SvxViewForwarder* ScAccessibleHeaderTextData::GetViewForwarder()
return mpViewForwarder;
}
-
-// ============================================================================
-
ScAccessibleNoteTextData::ScAccessibleNoteTextData(ScPreviewShell* pViewShell,
const String& sText, const ScAddress& aCellPos, sal_Bool bMarkNote)
:
@@ -1687,7 +1564,7 @@ ScAccessibleNoteTextData::ScAccessibleNoteTextData(ScPreviewShell* pViewShell,
msText(sText),
maCellPos(aCellPos),
mbMarkNote(bMarkNote),
- mbDataValid(sal_False)
+ mbDataValid(false)
{
if (pViewShell && pViewShell->GetDocument())
mpDocSh = (ScDocShell*) pViewShell->GetDocument()->GetDocumentShell();
@@ -1697,7 +1574,7 @@ ScAccessibleNoteTextData::ScAccessibleNoteTextData(ScPreviewShell* pViewShell,
ScAccessibleNoteTextData::~ScAccessibleNoteTextData()
{
- ScUnoGuard aGuard; // needed for EditEngine dtor
+ SolarMutexGuard aGuard; // needed for EditEngine dtor
if (mpDocSh)
mpDocSh->GetDocument()->RemoveUnoObject(*this);
@@ -1742,10 +1619,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
pEnginePool->FreezeIdRanges();
mpEditEngine = new ScFieldEditEngine( pEnginePool, NULL, sal_True );
}
- // currently, GetPortions doesn't work if UpdateMode is sal_False,
- // this will be fixed (in EditEngine) by src600
-// pEditEngine->SetUpdateMode( sal_False );
- mpEditEngine->EnableUndo( sal_False );
+ mpEditEngine->EnableUndo( false );
if (mpDocSh)
mpEditEngine->SetRefDevice(mpDocSh->GetRefDevice());
else
@@ -1842,8 +1716,6 @@ void ScCsvViewForwarder::SetInvalid()
mpWindow = NULL;
}
-// ----------------------------------------------------------------------------
-
ScAccessibleCsvTextData::ScAccessibleCsvTextData(
Window* pWindow, EditEngine* pEditEngine,
const String& rCellText, const Rectangle& rBoundBox, const Size& rCellSize ) :
@@ -1906,6 +1778,4 @@ SvxEditViewForwarder* ScAccessibleCsvTextData::GetEditViewForwarder( sal_Bool /*
return NULL;
}
-
-// ============================================================================
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
index 31bf438772d0..053d0c11dd94 100644
--- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
+++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,3 +91,5 @@ void ScDrawModelBroadcaster::Notify( SfxBroadcaster&,
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/makefile.mk b/sc/source/ui/Accessibility/makefile.mk
index 32df95750f85..49f3fb1fb39c 100644
--- a/sc/source/ui/Accessibility/makefile.mk
+++ b/sc/source/ui/Accessibility/makefile.mk
@@ -32,60 +32,38 @@ TARGET=accessibility
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
-SLOFILES = \
+SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES= \
+ $(SLO)$/AccessibleCell.obj \
+ $(SLO)$/AccessibleCellBase.obj \
$(SLO)$/AccessibleContextBase.obj \
- $(SLO)$/AccessibleTableBase.obj \
+ $(SLO)$/AccessibleCsvControl.obj \
+ $(SLO)$/AccessibleDataPilotControl.obj \
$(SLO)$/AccessibleDocument.obj \
- $(SLO)$/AccessibleGlobal.obj \
- $(SLO)$/AccessibleSpreadsheet.obj \
- $(SLO)$/AccessibleCell.obj \
- $(SLO)$/AccessibilityHints.obj \
$(SLO)$/AccessibleDocumentBase.obj \
- $(SLO)$/AccessibleCellBase.obj \
- $(SLO)$/AccessibleDocumentPagePreview.obj \
- $(SLO)$/AccessibleFilterMenu.obj \
- $(SLO)$/AccessibleFilterMenuItem.obj \
- $(SLO)$/AccessibleFilterTopWindow.obj \
- $(SLO)$/AccessiblePreviewTable.obj \
- $(SLO)$/AccessiblePreviewCell.obj \
- $(SLO)$/AccessiblePreviewHeaderCell.obj \
- $(SLO)$/AccessiblePageHeader.obj \
- $(SLO)$/AccessibleText.obj \
- $(SLO)$/AccessiblePageHeaderArea.obj \
- $(SLO)$/DrawModelBroadcaster.obj \
+ $(SLO)$/AccessibleDocumentPagePreview.obj \
$(SLO)$/AccessibleEditObject.obj \
- $(SLO)$/AccessibleDataPilotControl.obj \
- $(SLO)$/AccessibleCsvControl.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/AccessibleContextBase.obj \
- $(SLO)$/AccessibleTableBase.obj \
- $(SLO)$/AccessibleDocument.obj \
+ $(SLO)$/AccessibleFilterMenu.obj \
+ $(SLO)$/AccessibleFilterMenuItem.obj \
+ $(SLO)$/AccessibleFilterTopWindow.obj \
$(SLO)$/AccessibleGlobal.obj \
- $(SLO)$/AccessibleSpreadsheet.obj \
- $(SLO)$/AccessibleCell.obj \
- $(SLO)$/AccessibleDocumentBase.obj \
- $(SLO)$/AccessibleCellBase.obj \
- $(SLO)$/AccessibleDocumentPagePreview.obj \
- $(SLO)$/AccessibleFilterMenu.obj \
- $(SLO)$/AccessibleFilterMenuItem.obj \
- $(SLO)$/AccessibleFilterTopWindow.obj \
- $(SLO)$/AccessiblePreviewTable.obj \
- $(SLO)$/AccessiblePreviewCell.obj \
- $(SLO)$/AccessiblePreviewHeaderCell.obj \
+ $(SLO)$/AccessibilityHints.obj \
$(SLO)$/AccessiblePageHeader.obj \
- $(SLO)$/AccessiblePageHeaderArea.obj \
+ $(SLO)$/AccessiblePageHeaderArea.obj \
+ $(SLO)$/AccessiblePreviewCell.obj \
+ $(SLO)$/AccessiblePreviewHeaderCell.obj \
+ $(SLO)$/AccessiblePreviewTable.obj \
+ $(SLO)$/AccessibleSpreadsheet.obj \
+ $(SLO)$/AccessibleTableBase.obj \
+ $(SLO)$/AccessibleText.obj \
$(SLO)$/DrawModelBroadcaster.obj \
- $(SLO)$/AccessibleEditObject.obj \
- $(SLO)$/AccessibleDataPilotControl.obj \
- $(SLO)$/AccessibleCsvControl.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 9dac737372ae..bd7eeaf37aa0 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,6 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
-#include <sot/sotref.hxx>
#include <svx/svditer.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdmodel.hxx>
@@ -63,7 +63,7 @@ ScClient::ScClient( ScTabViewShell* pViewShell, Window* pDraw, SdrModel* pSdrMod
SetObject( pObj->GetObjRef() );
}
-__EXPORT ScClient::~ScClient()
+ScClient::~ScClient()
{
}
@@ -93,13 +93,13 @@ SdrOle2Obj* ScClient::GetDrawObj()
return pOle2Obj;
}
-void __EXPORT ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
+void ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
{
SfxViewShell* pSfxViewSh = GetViewShell();
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
if (!pViewSh)
{
- DBG_ERROR("Wrong ViewShell");
+ OSL_FAIL("Wrong ViewShell");
return;
}
@@ -155,13 +155,13 @@ void __EXPORT ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
}
}
-void __EXPORT ScClient::ObjectAreaChanged()
+void ScClient::ObjectAreaChanged()
{
SfxViewShell* pSfxViewSh = GetViewShell();
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
if (!pViewSh)
{
- DBG_ERROR("Wrong ViewShell");
+ OSL_FAIL("Wrong ViewShell");
return;
}
@@ -183,7 +183,7 @@ void __EXPORT ScClient::ObjectAreaChanged()
pViewSh->ScrollToObject( pDrawObj );
}
-void __EXPORT ScClient::ViewChanged()
+void ScClient::ViewChanged()
{
if ( GetAspect() == embed::Aspects::MSOLE_ICON )
{
@@ -202,7 +202,7 @@ void __EXPORT ScClient::ViewChanged()
aSz = xObj->getVisualAreaSize( GetAspect() );
} catch ( embed::NoVisualAreaSizeException& )
{
- DBG_ERROR("The visual area size must be available!\n");
+ OSL_FAIL("The visual area size must be available!\n");
}
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( GetAspect() ) );
@@ -242,7 +242,7 @@ void __EXPORT ScClient::ViewChanged()
}
}
-void __EXPORT ScClient::MakeVisible()
+void ScClient::MakeVisible()
{
SdrOle2Obj* pDrawObj = GetDrawObj();
if (pDrawObj)
@@ -254,3 +254,4 @@ void __EXPORT ScClient::MakeVisible()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index eb7e2a0fbf83..dbfe52654470 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,7 +61,7 @@
#include <svl/itempool.hxx>
#include <svl/urlbmk.hxx>
#include <tools/urlobj.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include "drwtrans.hxx"
#include "docsh.hxx"
@@ -100,12 +101,12 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
pModel( pClipModel ),
aObjDesc( rDesc ),
pBookmark( NULL ),
- bGraphic( sal_False ),
- bGrIsBit( sal_False ),
- bOleObj( sal_False ),
+ bGraphic( false ),
+ bGrIsBit( false ),
+ bOleObj( false ),
pDragSourceView( NULL ),
nDragSourceFlags( 0 ),
- bDragWasInternal( sal_False ),
+ bDragWasInternal( false ),
nSourceDocID( 0 )
{
//
@@ -163,9 +164,9 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
- rtl::OUString sPropButtonType = rtl::OUString::createFromAscii( "ButtonType" );
- rtl::OUString sPropTargetURL = rtl::OUString::createFromAscii( "TargetURL" );
- rtl::OUString sPropLabel = rtl::OUString::createFromAscii( "Label" );
+ rtl::OUString sPropButtonType(RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ));
+ rtl::OUString sPropTargetURL(RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ));
+ rtl::OUString sPropLabel(RTL_CONSTASCII_USTRINGPARAM( "Label" ));
if(xInfo->hasPropertyByName( sPropButtonType ))
{
@@ -253,17 +254,17 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
ScDrawTransferObj::~ScDrawTransferObj()
{
- Application::GetSolarMutex().acquire(); //! ???
+ SolarMutexGuard aSolarGuard;
ScModule* pScMod = SC_MOD();
if ( pScMod->GetClipData().pDrawClipboard == this )
{
- DBG_ERROR("ScDrawTransferObj wasn't released");
+ OSL_FAIL("ScDrawTransferObj wasn't released");
pScMod->SetClipObject( NULL, NULL );
}
if ( pScMod->GetDragData().pDrawTransfer == this )
{
- DBG_ERROR("ScDrawTransferObj wasn't released");
+ OSL_FAIL("ScDrawTransferObj wasn't released");
pScMod->ResetDragObject();
}
@@ -275,11 +276,8 @@ ScDrawTransferObj::~ScDrawTransferObj()
delete pBookmark;
delete pDragSourceView;
-
- Application::GetSolarMutex().release(); //! ???
}
-// static
ScDrawTransferObj* ScDrawTransferObj::GetOwnClipboard( Window* )
{
ScDrawTransferObj* pObj = SC_MOD()->GetClipData().pDrawClipboard;
@@ -288,7 +286,7 @@ ScDrawTransferObj* ScDrawTransferObj::GetOwnClipboard( Window* )
sal_Bool lcl_HasOnlyControls( SdrModel* pModel )
{
- sal_Bool bOnlyControls = sal_False; // default if there are no objects
+ sal_Bool bOnlyControls = false; // default if there are no objects
if ( pModel )
{
@@ -304,7 +302,7 @@ sal_Bool lcl_HasOnlyControls( SdrModel* pModel )
{
if (!pObj->ISA(SdrUnoObj))
{
- bOnlyControls = sal_False;
+ bOnlyControls = false;
break;
}
pObj = aIter.Next();
@@ -375,7 +373,7 @@ void ScDrawTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_DRAWING );
- // #103556# leave out bitmap and metafile if there are only controls
+ // leave out bitmap and metafile if there are only controls
if ( !lcl_HasOnlyControls( pModel ) )
{
AddFormat( SOT_FORMAT_BITMAP );
@@ -389,7 +387,7 @@ void ScDrawTransferObj::AddSupportedFormats()
sal_Bool ScDrawTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
{
- sal_Bool bOK = sal_False;
+ sal_Bool bOK = false;
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
if ( bOleObj && nFormat != SOT_FORMAT_GDIMETAFILE )
@@ -491,7 +489,7 @@ sal_Bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUse
{
// called from SetObject, put data into stream
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
switch (nUserObjectId)
{
case SCDRAWTRANS_TYPE_DRAWMODEL:
@@ -551,7 +549,7 @@ sal_Bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUse
try
{
uno::Sequence < beans::PropertyValue > aSeq;
- ::rtl::OUString aDummyName = ::rtl::OUString::createFromAscii("Dummy");
+ ::rtl::OUString aDummyName(RTL_CONSTASCII_USTRINGPARAM("Dummy"));
xPers->storeToEntry( xWorkStore, aDummyName, aSeq, aSeq );
if ( xWorkStore->isStreamElement( aDummyName ) )
{
@@ -592,11 +590,11 @@ sal_Bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUse
::comphelper::OStorageHelper::GetStorageFromURL( aTempFile.GetURL(), embed::ElementModes::READWRITE );
// write document storage
- pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, sal_False );
+ pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, false );
// mba: no relative ULRs for clipboard!
SfxMedium aMedium( xWorkStore, String() );
- bRet = pEmbObj->DoSaveObjectAs( aMedium, sal_False );
+ bRet = pEmbObj->DoSaveObjectAs( aMedium, false );
pEmbObj->DoSaveCompleted();
uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY );
@@ -625,7 +623,7 @@ sal_Bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUse
break;
default:
- DBG_ERROR("unknown object id");
+ OSL_FAIL("unknown object id");
}
return bRet;
}
@@ -773,7 +771,7 @@ void ScDrawTransferObj::InitDocShell()
pDocSh->SetVisArea( aDestArea );
ScViewOptions aViewOpt( pDestDoc->GetViewOptions() );
- aViewOpt.SetOption( VOPT_GRID, sal_False );
+ aViewOpt.SetOption( VOPT_GRID, false );
pDestDoc->SetViewOptions( aViewOpt );
ScViewData aViewData( pDocSh, NULL );
@@ -812,3 +810,4 @@ sal_Int64 SAL_CALL ScDrawTransferObj::getSomething( const com::sun::star::uno::S
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index fac3b1bb1a0f..e821dc0b773b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,7 @@
#include <editeng/svxacorr.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/wghtitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
@@ -97,14 +99,14 @@ using namespace formula;
// STATIC DATA -----------------------------------------------------------
-sal_Bool ScInputHandler::bOptLoaded = sal_False; // App-Optionen ausgewertet
-sal_Bool ScInputHandler::bAutoComplete = sal_False; // wird in KeyInput gesetzt
+sal_Bool ScInputHandler::bOptLoaded = false; // App-Optionen ausgewertet
+sal_Bool ScInputHandler::bAutoComplete = false; // wird in KeyInput gesetzt
// delimiters (in addition to ScEditUtil) needed for range finder:
// only characters that are allowed in formulas next to references
// and the quotation mark (so string constants can be skipped)
-static const sal_Char __FAR_DATA pMinDelimiters[] = " !\"";
+static const sal_Char pMinDelimiters[] = " !\"";
extern sal_uInt16 nEditAdjust; //! Member an ViewData
@@ -127,7 +129,6 @@ void ScInputHandler::InitRangeFinder( const String& rFormula )
if ( !pActiveViewSh || !SC_MOD()->GetInputOptions().GetRangeFinder() )
return;
-// String aDelimiters = pEngine->GetWordDelimiters();
String aDelimiters = ScEditUtil::ModifyDelimiters(
String::CreateFromAscii( pMinDelimiters ) );
@@ -199,7 +200,7 @@ handle_r1c1:
if (!nCount)
{
- pEngine->SetUpdateMode( sal_False );
+ pEngine->SetUpdateMode( false );
pRangeFindList = new ScRangeFindList( pDocSh->GetTitle() );
}
@@ -240,7 +241,7 @@ void lcl_Replace( EditView* pView, const String& rNewStr, const ESelection& rOld
// Dummy-InsertText fuer Update und Paint
// dafuer muss oben die Selektion aufgehoben werden (vor QuickInsertText)
- pView->InsertText( EMPTY_STRING, sal_False );
+ pView->InsertText( EMPTY_STRING, false );
xub_StrLen nLen = pEngine->GetTextLen(0);
ESelection aSel( 0, nLen, 0, nLen );
@@ -272,7 +273,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
bInRangeUpdate = sal_True;
DataChanged();
- bInRangeUpdate = sal_False;
+ bInRangeUpdate = false;
long nDiff = aNewStr.Len() - (long)(nOldEnd-nOldStart);
@@ -289,7 +290,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
}
else
{
- DBG_ERROR("UpdateRange: da fehlt was");
+ OSL_FAIL("UpdateRange: da fehlt was");
}
}
@@ -434,23 +435,23 @@ ScInputHandler::ScInputHandler()
pTipVisibleSecParent( NULL ),
nTipVisibleSec( 0 ),
nAutoPos( SCPOS_INVALID ),
- bUseTab( sal_False ),
+ bUseTab( false ),
bTextValid( sal_True ),
nFormSelStart( 0 ),
nFormSelEnd( 0 ),
nAutoPar( 0 ),
eMode( SC_INPUT_NONE ),
- bModified( sal_False ),
- bSelIsRef( sal_False ),
- bFormulaMode( sal_False ),
- bInRangeUpdate( sal_False ),
- bParenthesisShown( sal_False ),
- bCreatingFuncView( sal_False ),
- bInEnterHandler( sal_False ),
- bCommandErrorShown( sal_False ),
- bInOwnChange( sal_False ),
- bProtected( sal_False ),
- bCellHasPercentFormat( sal_False ),
+ bModified( false ),
+ bSelIsRef( false ),
+ bFormulaMode( false ),
+ bInRangeUpdate( false ),
+ bParenthesisShown( false ),
+ bCreatingFuncView( false ),
+ bInEnterHandler( false ),
+ bCommandErrorShown( false ),
+ bInOwnChange( false ),
+ bProtected( false ),
+ bCellHasPercentFormat( false ),
nValidation( 0 ),
eAttrAdjust( SVX_HOR_JUSTIFY_STANDARD ),
aScaleX( 1,1 ),
@@ -458,7 +459,7 @@ ScInputHandler::ScInputHandler()
pRefViewSh( NULL ),
pLastPattern( NULL ),
pEditDefaults( NULL ),
- bLastIsSymbol( sal_False ),
+ bLastIsSymbol( false ),
pLastState( NULL ),
pDelayTimer( NULL ),
pRangeFindList( NULL )
@@ -470,7 +471,7 @@ ScInputHandler::ScInputHandler()
// Bindings (nur noch fuer Invalidate benutzt) werden bei Bedarf aktuell geholt
}
-__EXPORT ScInputHandler::~ScInputHandler()
+ScInputHandler::~ScInputHandler()
{
// Wenn dies der Applikations-InputHandler ist, wird der dtor erst nach SfxApplication::Main
// gerufen, darf sich also auf keine Sfx-Funktionen mehr verlassen
@@ -606,7 +607,7 @@ void ScInputHandler::UpdateSpellSettings( sal_Bool bFromStartTab )
pEngine->SetKernAsianPunctuation( pDoc->GetAsianKerning() );
pEngine->SetDefaultHorizontalTextDirection(
(EEHorizontalTextDirection)pDoc->GetEditTextDirection( pViewData->GetTabNo() ) );
- pEngine->SetFirstWordCapitalization( sal_False );
+ pEngine->SetFirstWordCapitalization( false );
}
// language is set separately, so the speller is needed only if online
@@ -682,7 +683,7 @@ void ScInputHandler::GetFormulaData()
if ( pDesc->pFuncName )
{
pDesc->initArgumentInfo();
- String aEntry = pDesc->GetSignature();
+ String aEntry = pDesc->getSignature();
TypedStrData* pData = new TypedStrData( aEntry, 0.0, SC_STRTYPE_FUNCTIONS );
if (!pFormulaDataPara->Insert(pData))
delete pData;
@@ -746,7 +747,6 @@ void ScInputHandler::ShowTipCursor()
String aFormula = pEngine->GetText( (sal_uInt16) 0 );
ESelection aSel = pActiveView->GetSelection();
aSel.Adjust();
- xub_StrLen nLeftParentPos = 0;
if( aSel.nEndPos )
{
if ( aFormula.Len() < aSel.nEndPos )
@@ -759,37 +759,32 @@ void ScInputHandler::ShowTipCursor()
const IFunctionDescription* ppFDesc;
::std::vector< ::rtl::OUString> aArgs;
sal_uInt16 nArgs;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr());
while( !bFound )
{
aSelText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ")" ) );
- nLeftParentPos = lcl_MatchParenthesis( aSelText, aSelText.Len()-1 );
+ xub_StrLen nLeftParentPos = lcl_MatchParenthesis( aSelText, aSelText.Len()-1 );
if( nLeftParentPos != STRING_NOTFOUND )
{
sal_Unicode c = ( nLeftParentPos > 0 ) ? aSelText.GetChar( nLeftParentPos-1 ) : 0;
if( !((c >= 'A' && c<= 'Z') || (c>= 'a' && c<= 'z' )) )
continue;
nNextFStart = aHelper.GetFunctionStart( aSelText, nLeftParentPos, sal_True);
- if( aHelper.GetNextFunc( aSelText, sal_False, nNextFStart, &nNextFEnd, &ppFDesc, &aArgs ) )
+ if( aHelper.GetNextFunc( aSelText, false, nNextFStart, &nNextFEnd, &ppFDesc, &aArgs ) )
{
if( ppFDesc->getFunctionName().getLength() )
{
nArgPos = aHelper.GetArgStart( aSelText, nNextFStart, 0 );
nArgs = static_cast<sal_uInt16>(ppFDesc->getParameterCount());
- sal_uInt16 nActive = 0;
- sal_uInt16 nCount = 0;
- sal_uInt16 nCountSemicolon = 0;
- sal_uInt16 nCountDot = 0;
- sal_uInt16 nStartPosition = 0;
- sal_uInt16 nEndPosition = 0;
- sal_Bool bFlag = sal_False;
+ sal_Bool bFlag = false;
String aNew;
sal_uInt16 nParAutoPos = SCPOS_INVALID;
- if( pFormulaDataPara->FindText( ppFDesc->getFunctionName(), aNew, nParAutoPos, sal_False ) )
+ if( pFormulaDataPara->FindText( ppFDesc->getFunctionName(), aNew, nParAutoPos, false ) )
{
+ sal_uInt16 nActive = 0;
for( sal_uInt16 i=0; i < nArgs; i++ )
{
xub_StrLen nLength = static_cast<xub_StrLen>(aArgs[i].getLength());
@@ -802,8 +797,10 @@ void ScInputHandler::ShowTipCursor()
}
if( bFlag )
{
- nCountSemicolon = aNew.GetTokenCount(cSep)-1;
- nCountDot = aNew.GetTokenCount(cSheetSep)-1;
+ sal_uInt16 nCountSemicolon = aNew.GetTokenCount(cSep)-1;
+ sal_uInt16 nCountDot = aNew.GetTokenCount(cSheetSep)-1;
+ sal_uInt16 nStartPosition = 0;
+ sal_uInt16 nEndPosition = 0;
if( !nCountSemicolon )
{
@@ -818,6 +815,7 @@ void ScInputHandler::ShowTipCursor()
}
else if( !nCountDot )
{
+ sal_uInt16 nCount = 0;
for( sal_uInt16 i = 0; i < aNew.Len(); i++ )
{
sal_Unicode cNext = aNew.GetChar( i );
@@ -839,6 +837,7 @@ void ScInputHandler::ShowTipCursor()
}
else
{
+ sal_uInt16 nCount = 0;
for( sal_uInt16 i = 0; i < aNew.Len(); i++ )
{
sal_Unicode cNext = aNew.GetChar( i );
@@ -890,7 +889,7 @@ void ScInputHandler::ShowTipCursor()
String aNew;
sal_uInt16 nParAutoPos = SCPOS_INVALID;
nPosition = aText.Len()+1;
- if( pFormulaDataPara->FindText( aText, aNew, nParAutoPos, sal_False ) )
+ if( pFormulaDataPara->FindText( aText, aNew, nParAutoPos, false ) )
{
if( aFormula.GetChar( nPosition ) =='(' )
{
@@ -970,7 +969,7 @@ void ScInputHandler::UseFormulaData()
ESelection aSel = pActiveView->GetSelection();
aSel.Adjust();
- // #59348# Durch Differenzen zwischen Tabelle und Eingabezeile
+ // Durch Differenzen zwischen Tabelle und Eingabezeile
// (z.B. Clipboard mit Zeilenumbruechen) kann es sein, dass die Selektion
// nicht mehr zur EditEngine passt. Dann halt kommentarlos abbrechen:
@@ -990,14 +989,14 @@ void ScInputHandler::UseFormulaData()
const IFunctionDescription* ppFDesc;
::std::vector< ::rtl::OUString> aArgs;
sal_uInt16 nArgs;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
String aText = pEngine->GetWord( 0, aSel.nEndPos-1 );
if ( aText.Len() )
{
String aNew;
nAutoPos = SCPOS_INVALID;
- if ( pFormulaData->FindText( aText, aNew, nAutoPos, sal_False ) )
+ if ( pFormulaData->FindText( aText, aNew, nAutoPos, false ) )
{
ShowTip( aNew );
aAutoSearch = aText;
@@ -1012,29 +1011,24 @@ void ScInputHandler::UseFormulaData()
if( nLeftParentPos == STRING_NOTFOUND )
break;
- // #160063# nLeftParentPos can be 0 if a parenthesis is inserted before the formula
+ // nLeftParentPos can be 0 if a parenthesis is inserted before the formula
sal_Unicode c = ( nLeftParentPos > 0 ) ? aFormula.GetChar( nLeftParentPos-1 ) : 0;
if( !((c >= 'A' && c<= 'Z') || (c>= 'a' && c<= 'z') ) )
continue;
nNextFStart = aHelper.GetFunctionStart( aFormula, nLeftParentPos, sal_True);
- if( aHelper.GetNextFunc( aFormula, sal_False, nNextFStart, &nNextFEnd, &ppFDesc, &aArgs ) )
+ if( aHelper.GetNextFunc( aFormula, false, nNextFStart, &nNextFEnd, &ppFDesc, &aArgs ) )
{
if( ppFDesc->getFunctionName().getLength() )
{
nArgPos = aHelper.GetArgStart( aFormula, nNextFStart, 0 );
nArgs = static_cast<sal_uInt16>(ppFDesc->getParameterCount());
- sal_uInt16 nActive = 0;
- sal_uInt16 nCount = 0;
- sal_uInt16 nCountSemicolon = 0;
- sal_uInt16 nCountDot = 0;
- sal_uInt16 nStartPosition = 0;
- sal_uInt16 nEndPosition = 0;
- sal_Bool bFlag = sal_False;
+ sal_Bool bFlag = false;
String aNew;
sal_uInt16 nParAutoPos = SCPOS_INVALID;
- if( pFormulaDataPara->FindText( ppFDesc->getFunctionName(), aNew, nParAutoPos, sal_False ) )
+ if( pFormulaDataPara->FindText( ppFDesc->getFunctionName(), aNew, nParAutoPos, false ) )
{
+ sal_uInt16 nActive = 0;
for( sal_uInt16 i=0; i < nArgs; i++ )
{
xub_StrLen nLength = static_cast<xub_StrLen>(aArgs[i].getLength());
@@ -1047,8 +1041,10 @@ void ScInputHandler::UseFormulaData()
}
if( bFlag )
{
- nCountSemicolon = aNew.GetTokenCount(cSep)-1;
- nCountDot = aNew.GetTokenCount(cSheetSep)-1;
+ sal_uInt16 nCountSemicolon = aNew.GetTokenCount(cSep)-1;
+ sal_uInt16 nCountDot = aNew.GetTokenCount(cSheetSep)-1;
+ sal_uInt16 nStartPosition = 0;
+ sal_uInt16 nEndPosition = 0;
if( !nCountSemicolon )
{
@@ -1063,6 +1059,7 @@ void ScInputHandler::UseFormulaData()
}
else if( !nCountDot )
{
+ sal_uInt16 nCount = 0;
for( sal_uInt16 i = 0; i < aNew.Len(); i++ )
{
sal_Unicode cNext = aNew.GetChar( i );
@@ -1084,6 +1081,7 @@ void ScInputHandler::UseFormulaData()
}
else
{
+ sal_uInt16 nCount = 0;
for( sal_uInt16 i = 0; i < aNew.Len(); i++ )
{
sal_Unicode cNext = aNew.GetChar( i );
@@ -1161,20 +1159,19 @@ void lcl_CompleteFunction( EditView* pView, const String& rInsert, sal_Bool& rPa
if ( bDoParen )
{
// Klammern hinter Funktionsnamen nicht einfuegen, wenn direkt dahinter
- // schon eine Klammer steht (z.B. wenn der Funktionsname geaendert wurde,
- // #39393#).
+ // schon eine Klammer steht (z.B. wenn der Funktionsname geaendert wurde).
ESelection aWordSel = pView->GetSelection();
String aOld = pView->GetEditEngine()->GetText((sal_uInt16)0);
sal_Unicode cNext = aOld.GetChar(aWordSel.nEndPos);
if ( cNext == '(' )
{
- bDoParen = sal_False;
+ bDoParen = false;
aInsStr.Erase( nInsLen - 2 ); // Klammern weglassen
}
}
- pView->InsertText( aInsStr, sal_False );
+ pView->InsertText( aInsStr, false );
if ( bDoParen ) // Cursor zwischen die Klammern setzen
{
@@ -1196,7 +1193,7 @@ void ScInputHandler::PasteFunctionData()
if (pData)
{
String aInsert = pData->GetString();
- sal_Bool bParInserted = sal_False;
+ sal_Bool bParInserted = false;
DataChanging(); // kann nicht neu sein
lcl_CompleteFunction( pTopView, aInsert, bParInserted );
@@ -1231,7 +1228,7 @@ String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScAddress
{
ScFormulaCell* pCell = new ScFormulaCell( pDoc, rPos, rFormula );
- // #35521# HACK! um bei ColRowNames kein #REF! zu bekommen,
+ // HACK! um bei ColRowNames kein #REF! zu bekommen,
// wenn ein Name eigentlich als Bereich in die Gesamt-Formel
// eingefuegt wird, bei der Einzeldarstellung aber als
// single-Zellbezug interpretiert wird
@@ -1249,7 +1246,7 @@ String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScAddress
pCell = new ScFormulaCell( pDoc, rPos, aBraced );
}
else
- bColRowName = sal_False;
+ bColRowName = false;
}
sal_uInt16 nErrCode = pCell->GetErrCode();
@@ -1397,7 +1394,7 @@ sal_Bool ScInputHandler::CursorAtClosingPar()
if ( nPos < aFormula.Len() && aFormula.GetChar(nPos) == ')' )
return sal_True;
}
- return sal_False;
+ return false;
}
void ScInputHandler::SkipClosingPar()
@@ -1469,9 +1466,9 @@ void ScInputHandler::UseColData() // beim Tippen
{
String aNew;
nAutoPos = SCPOS_INVALID; // nix
- if ( pColumnData->FindText( aText, aNew, nAutoPos, sal_False ) )
+ if ( pColumnData->FindText( aText, aNew, nAutoPos, false ) )
{
- // #45434# durch dBase Import etc. koennen Umbrueche im String sein,
+ // durch dBase Import etc. koennen Umbrueche im String sein,
// das wuerde hier mehrere Absaetze ergeben -> nicht gut
//! GetExactMatch funktioniert dann auch nicht
lcl_RemoveLineEnd( aNew );
@@ -1491,12 +1488,12 @@ void ScInputHandler::UseColData() // beim Tippen
// when editing in input line, apply to both edit views
if ( pTableView )
{
- pTableView->InsertText( aIns, sal_False );
+ pTableView->InsertText( aIns, false );
pTableView->SetSelection( aSelection );
}
if ( pTopView )
{
- pTopView->InsertText( aIns, sal_False );
+ pTopView->InsertText( aIns, false );
pTopView->SetSelection( aSelection );
}
@@ -1509,7 +1506,7 @@ void ScInputHandler::UseColData() // beim Tippen
String aDummy;
sal_uInt16 nNextPos = nAutoPos;
- bUseTab = pColumnData->FindText( aText, aDummy, nNextPos, sal_False );
+ bUseTab = pColumnData->FindText( aText, aDummy, nNextPos, false );
}
else
bUseTab = sal_True;
@@ -1551,7 +1548,7 @@ void ScInputHandler::NextAutoEntry( sal_Bool bBack )
if ( pTableView )
{
pTableView->DeleteSelected();
- pTableView->InsertText( aIns, sal_False );
+ pTableView->InsertText( aIns, false );
pTableView->SetSelection( ESelection(
aSel.nEndPara, aSel.nStartPos + aIns.Len(),
aSel.nEndPara, aSel.nStartPos ) );
@@ -1559,13 +1556,13 @@ void ScInputHandler::NextAutoEntry( sal_Bool bBack )
if ( pTopView )
{
pTopView->DeleteSelected();
- pTopView->InsertText( aIns, sal_False );
+ pTopView->InsertText( aIns, false );
pTopView->SetSelection( ESelection(
aSel.nEndPara, aSel.nStartPos + aIns.Len(),
aSel.nEndPara, aSel.nStartPos ) );
}
- bInOwnChange = sal_False;
+ bInOwnChange = false;
}
else
{
@@ -1594,7 +1591,7 @@ void ScInputHandler::UpdateParenthesis()
//! Klammer-Hervorhebung einzeln abschaltbar ????
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if ( bFormulaMode && eMode != SC_INPUT_TOP )
{
if ( pTableView && !pTableView->HasSelection() ) // Selektion ist immer unten
@@ -1630,7 +1627,7 @@ void ScInputHandler::UpdateParenthesis()
pEngine->QuickSetAttribs( aSet, aSelOther );
// Dummy-InsertText fuer Update und Paint (Selektion ist leer)
- pTableView->InsertText( EMPTY_STRING, sal_False );
+ pTableView->InsertText( EMPTY_STRING, false );
bFound = sal_True;
}
@@ -1669,12 +1666,12 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // wird synchron
// Trotzdem wird immerhin der Editmodus beendet
EnterHandler();
- bFormulaMode = sal_False;
+ bFormulaMode = false;
pRefViewSh = NULL;
SFX_APP()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
SC_MOD()->SetRefInputHdl(NULL);
if (pInputWin)
- pInputWin->SetFormulaMode(sal_False);
+ pInputWin->SetFormulaMode(false);
UpdateAutoCorrFlag();
}
@@ -1682,7 +1679,7 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // wird synchron
if ( pActiveViewSh && pActiveViewSh == pViewSh )
{
- DBG_ERROR("pActiveViewSh weg");
+ OSL_FAIL("pActiveViewSh weg");
pActiveViewSh = NULL;
}
@@ -1754,7 +1751,7 @@ void ScInputHandler::UpdateAdjust( sal_Unicode cTyped )
{
case SVX_HOR_JUSTIFY_STANDARD:
{
- sal_Bool bNumber = sal_False;
+ sal_Bool bNumber = false;
if (cTyped) // neu angefangen
bNumber = (cTyped>='0' && cTyped<='9'); // nur Ziffern sind Zahlen
else if ( pActiveViewSh )
@@ -1802,219 +1799,204 @@ void ScInputHandler::RemoveAdjust()
sal_Bool bUndo = pEngine->IsUndoEnabled();
if ( bUndo )
- pEngine->EnableUndo( sal_False );
+ pEngine->EnableUndo( false );
- // RemoveParaAttribs removes all paragraph attributes, including EE_PARA_JUST
-#if 0
- sal_Bool bChange = sal_False;
- sal_uInt16 nCount = pEngine->GetParagraphCount();
- for (sal_uInt16 i=0; i<nCount; i++)
- {
- const SfxItemSet& rOld = pEngine->GetParaAttribs( i );
- if ( rOld.GetItemState( EE_PARA_JUST ) == SFX_ITEM_SET )
- {
- SfxItemSet aNew( rOld );
- aNew.ClearItem( EE_PARA_JUST );
- pEngine->SetParaAttribs( i, aNew );
- bChange = sal_True;
- }
- }
-#endif
-
- // #89403# non-default paragraph attributes (e.g. from clipboard)
+ // non-default paragraph attributes (e.g. from clipboard)
// must be turned into character attributes
pEngine->RemoveParaAttribs();
if ( bUndo )
pEngine->EnableUndo( sal_True );
- // ER 31.08.00 Only called in EnterHandler, don't change view anymore.
-#if 0
- if (bChange)
- {
- EditView* pActiveView = pTopView ? pTopView : pTableView;
- pActiveView->ShowCursor( sal_False, sal_True );
- }
-#endif
}
void ScInputHandler::RemoveRangeFinder()
{
// pRangeFindList und Farben loeschen
- pEngine->SetUpdateMode(sal_False);
+ pEngine->SetUpdateMode(false);
sal_uInt16 nCount = pEngine->GetParagraphCount(); // koennte gerade neu eingefuegt worden sein
for (sal_uInt16 i=0; i<nCount; i++)
pEngine->QuickRemoveCharAttribs( i, EE_CHAR_COLOR );
pEngine->SetUpdateMode(sal_True);
EditView* pActiveView = pTopView ? pTopView : pTableView;
- pActiveView->ShowCursor( sal_False, sal_True );
+ pActiveView->ShowCursor( false, sal_True );
DeleteRangeFinder(); // loescht die Liste und die Markierungen auf der Tabelle
}
-sal_Bool ScInputHandler::StartTable( sal_Unicode cTyped, sal_Bool bFromCommand )
+bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bInputActivated )
{
- // returns sal_True if a new edit mode was started
+ bool bNewTable = false;
- sal_Bool bNewTable = sal_False;
+ if (bModified || !ValidCol(aCursorPos.Col()))
+ return false;
- if (!bModified && ValidCol(aCursorPos.Col()))
+ if (pActiveViewSh)
{
- if (pActiveViewSh)
- {
- ImplCreateEditEngine();
- UpdateActiveView();
- SyncViews();
+ ImplCreateEditEngine();
+ UpdateActiveView();
+ SyncViews();
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
+ ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
- const ScMarkData& rMark = pActiveViewSh->GetViewData()->GetMarkData();
- ScEditableTester aTester;
- if ( rMark.IsMarked() || rMark.IsMultiMarked() )
- aTester.TestSelection( pDoc, rMark );
- else
- aTester.TestSelectedBlock( pDoc, aCursorPos.Col(),aCursorPos.Row(),
- aCursorPos.Col(),aCursorPos.Row(), rMark );
- if ( aTester.IsEditable() )
- {
- // UpdateMode is enabled again in ScViewData::SetEditEngine (and not needed otherwise)
- pEngine->SetUpdateMode( sal_False );
+ const ScMarkData& rMark = pActiveViewSh->GetViewData()->GetMarkData();
+ ScEditableTester aTester;
+ if ( rMark.IsMarked() || rMark.IsMultiMarked() )
+ aTester.TestSelection( pDoc, rMark );
+ else
+ aTester.TestSelectedBlock(
+ pDoc, aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Col(), aCursorPos.Row(), rMark );
- // Attribute in EditEngine uebernehmen
+ bool bStartInputMode = true;
- const ScPatternAttr* pPattern = pDoc->GetPattern( aCursorPos.Col(),
- aCursorPos.Row(),
- aCursorPos.Tab() );
- if (pPattern != pLastPattern)
+ if (!aTester.IsEditable())
+ {
+ bProtected = true;
+ // We allow read-only input mode activation when explicit cell
+ // activation is requested (double-click or F2) and if it's not
+ // part of an array.
+ bool bShowError = !bInputActivated || aTester.GetMessageId() != STR_PROTECTIONERR;
+ if (bShowError)
+ {
+ eMode = SC_INPUT_NONE;
+ StopInputWinEngine( true );
+ UpdateFormulaMode();
+ if ( pActiveViewSh && ( !bFromCommand || !bCommandErrorShown ) )
{
- // Prozent-Format?
-
- const SfxItemSet& rAttrSet = pPattern->GetItemSet();
- const SfxPoolItem* pItem;
+ // Prevent repeated error messages for the same cell from command events
+ // (for keyboard events, multiple messages are wanted).
+ // Set the flag before showing the error message because the command handler
+ // for the next IME command may be called when showing the dialog.
+ if ( bFromCommand )
+ bCommandErrorShown = true;
- if ( SFX_ITEM_SET == rAttrSet.GetItemState( ATTR_VALUE_FORMAT, sal_True, &pItem ) )
- {
- sal_uLong nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
- bCellHasPercentFormat = ( NUMBERFORMAT_PERCENT ==
- pDoc->GetFormatTable()->GetType( nFormat ) );
- }
- else
- bCellHasPercentFormat = sal_False; // Default: kein Prozent
+ pActiveViewSh->GetActiveWin()->GrabFocus();
+ pActiveViewSh->ErrorMessage(aTester.GetMessageId());
+ }
+ bStartInputMode = false;
+ }
+ }
- // Gueltigkeit angegeben?
+ if (bStartInputMode)
+ {
+ // UpdateMode is enabled again in ScViewData::SetEditEngine (and not needed otherwise)
+ pEngine->SetUpdateMode( false );
- if ( SFX_ITEM_SET == rAttrSet.GetItemState( ATTR_VALIDDATA, sal_True, &pItem ) )
- nValidation = ((const SfxUInt32Item*)pItem)->GetValue();
- else
- nValidation = 0;
+ // Attribute in EditEngine uebernehmen
- // EditEngine Defaults
+ const ScPatternAttr* pPattern = pDoc->GetPattern( aCursorPos.Col(),
+ aCursorPos.Row(),
+ aCursorPos.Tab() );
+ if (pPattern != pLastPattern)
+ {
+ // Prozent-Format?
- // Hier auf keinen Fall SetParaAttribs, weil die EditEngine evtl.
- // schon gefuellt ist (bei Edit-Zellen).
- // SetParaAttribs wuerde dann den Inhalt aendern
+ const SfxItemSet& rAttrSet = pPattern->GetItemSet();
+ const SfxPoolItem* pItem;
- //! ER 30.08.00 The SetDefaults is now (since MUST/src602
- //! EditEngine changes) implemented as a SetParaAttribs.
- //! Any problems?
+ if ( SFX_ITEM_SET == rAttrSet.GetItemState( ATTR_VALUE_FORMAT, true, &pItem ) )
+ {
+ sal_uLong nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
+ bCellHasPercentFormat = ( NUMBERFORMAT_PERCENT ==
+ pDoc->GetFormatTable()->GetType( nFormat ) );
+ }
+ else
+ bCellHasPercentFormat = false; // Default: kein Prozent
- pPattern->FillEditItemSet( pEditDefaults );
- pEngine->SetDefaults( *pEditDefaults );
- pLastPattern = pPattern;
- bLastIsSymbol = pPattern->IsSymbolFont();
+ // Gueltigkeit angegeben?
- // Background color must be known for automatic font color.
- // For transparent cell background, the document background color must be used.
+ if ( SFX_ITEM_SET == rAttrSet.GetItemState( ATTR_VALIDDATA, true, &pItem ) )
+ nValidation = ((const SfxUInt32Item*)pItem)->GetValue();
+ else
+ nValidation = 0;
- Color aBackCol = ((const SvxBrushItem&)
- pPattern->GetItem( ATTR_BACKGROUND )).GetColor();
- ScModule* pScMod = SC_MOD();
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
- if ( aBackCol.GetTransparency() > 0 ||
- Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
- aBackCol.SetColor( pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
- pEngine->SetBackgroundColor( aBackCol );
+ // EditEngine Defaults
- // Ausrichtung
+ // Hier auf keinen Fall SetParaAttribs, weil die EditEngine evtl.
+ // schon gefuellt ist (bei Edit-Zellen).
+ // SetParaAttribs wuerde dann den Inhalt aendern
- eAttrAdjust = (SvxCellHorJustify)((const SvxHorJustifyItem&)pPattern->
- GetItem(ATTR_HOR_JUSTIFY)).GetValue();
- if ( eAttrAdjust == SVX_HOR_JUSTIFY_REPEAT &&
- static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() )
- {
- // #i31843# "repeat" with "line breaks" is treated as default alignment
- eAttrAdjust = SVX_HOR_JUSTIFY_STANDARD;
- }
- }
+ //! The SetDefaults is now (since MUST/src602
+ //! EditEngine changes) implemented as a SetParaAttribs.
+ //! Any problems?
- // UpdateSpellSettings enables online spelling if needed
- // -> also call if attributes are unchanged
+ pPattern->FillEditItemSet( pEditDefaults );
+ pEngine->SetDefaults( *pEditDefaults );
+ pLastPattern = pPattern;
+ bLastIsSymbol = pPattern->IsSymbolFont();
- UpdateSpellSettings( sal_True ); // uses pLastPattern
+ // Background color must be known for automatic font color.
+ // For transparent cell background, the document background color must be used.
- // Edit-Engine fuellen
+ Color aBackCol = ((const SvxBrushItem&)
+ pPattern->GetItem( ATTR_BACKGROUND )).GetColor();
+ ScModule* pScMod = SC_MOD();
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
+ if ( aBackCol.GetTransparency() > 0 ||
+ Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ aBackCol.SetColor( pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
+ pEngine->SetBackgroundColor( aBackCol );
- String aStr;
- if (bTextValid)
- {
- pEngine->SetText(aCurrentText);
- aStr = aCurrentText;
- bTextValid = sal_False;
- aCurrentText.Erase();
- }
- else
- aStr = GetEditText(pEngine);
+ // Ausrichtung
- if (aStr.Len() > 3 && // Matrix-Formel ?
- aStr.GetChar(0) == '{' &&
- aStr.GetChar(1) == '=' &&
- aStr.GetChar(aStr.Len()-1) == '}')
+ eAttrAdjust = (SvxCellHorJustify)((const SvxHorJustifyItem&)pPattern->
+ GetItem(ATTR_HOR_JUSTIFY)).GetValue();
+ if ( eAttrAdjust == SVX_HOR_JUSTIFY_REPEAT &&
+ static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() )
{
- aStr.Erase(0,1);
- aStr.Erase(aStr.Len()-1,1);
- pEngine->SetText(aStr);
- if ( pInputWin )
- pInputWin->SetTextString(aStr);
+ // #i31843# "repeat" with "line breaks" is treated as default alignment
+ eAttrAdjust = SVX_HOR_JUSTIFY_STANDARD;
}
+ }
- UpdateAdjust( cTyped );
+ // UpdateSpellSettings enables online spelling if needed
+ // -> also call if attributes are unchanged
- if ( bAutoComplete )
- GetColData();
+ UpdateSpellSettings( true ); // uses pLastPattern
- if ( ( aStr.GetChar(0) == '=' || aStr.GetChar(0) == '+' || aStr.GetChar(0) == '-' ) &&
- !cTyped && !bCreatingFuncView )
- InitRangeFinder(aStr); // Formel wird editiert -> RangeFinder
+ // Edit-Engine fuellen
- bNewTable = sal_True; // -> PostEditView-Aufruf
+ String aStr;
+ if (bTextValid)
+ {
+ pEngine->SetText(aCurrentText);
+ aStr = aCurrentText;
+ bTextValid = false;
+ aCurrentText.Erase();
}
else
- {
- bProtected = sal_True;
- eMode = SC_INPUT_NONE;
- StopInputWinEngine( sal_True );
- UpdateFormulaMode();
- if ( pActiveViewSh && ( !bFromCommand || !bCommandErrorShown ) )
- {
- // #97673# Prevent repeated error messages for the same cell from command events
- // (for keyboard events, multiple messages are wanted).
- // Set the flag before showing the error message because the command handler
- // for the next IME command may be called when showing the dialog.
- if ( bFromCommand )
- bCommandErrorShown = sal_True;
+ aStr = GetEditText(pEngine);
- pActiveViewSh->GetActiveWin()->GrabFocus();
- pActiveViewSh->ErrorMessage(aTester.GetMessageId());
- }
+ if (aStr.Len() > 3 && // Matrix-Formel ?
+ aStr.GetChar(0) == '{' &&
+ aStr.GetChar(1) == '=' &&
+ aStr.GetChar(aStr.Len()-1) == '}')
+ {
+ aStr.Erase(0,1);
+ aStr.Erase(aStr.Len()-1,1);
+ pEngine->SetText(aStr);
+ if ( pInputWin )
+ pInputWin->SetTextString(aStr);
}
- }
- if (!bProtected && pInputWin)
- pInputWin->SetOkCancelMode();
+ UpdateAdjust( cTyped );
+
+ if ( bAutoComplete )
+ GetColData();
+
+ if ( ( aStr.GetChar(0) == '=' || aStr.GetChar(0) == '+' || aStr.GetChar(0) == '-' ) &&
+ !cTyped && !bCreatingFuncView )
+ InitRangeFinder(aStr); // Formel wird editiert -> RangeFinder
+
+ bNewTable = true; // -> PostEditView-Aufruf
+ }
}
+ if (!bProtected && pInputWin)
+ pInputWin->SetOkCancelMode();
+
return bNewTable;
}
@@ -2072,7 +2054,7 @@ IMPL_LINK( ScInputHandler, ModifyHdl, void *, EMPTYARG )
if ( !bInOwnChange && ( eMode==SC_INPUT_TYPE || eMode==SC_INPUT_TABLE ) &&
pEngine && pEngine->GetUpdateMode() && pInputWin )
{
- // #102745# update input line from ModifyHdl for changes that are not
+ // update input line from ModifyHdl for changes that are not
// wrapped by DataChanging/DataChanged calls (like Drag&Drop)
String aText = GetEditText(pEngine);
@@ -2084,12 +2066,13 @@ IMPL_LINK( ScInputHandler, ModifyHdl, void *, EMPTYARG )
sal_Bool ScInputHandler::DataChanging( sal_Unicode cTyped, sal_Bool bFromCommand ) // return sal_True = new view created
{
- bInOwnChange = sal_True; // disable ModifyHdl (reset in DataChanged)
+ pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
+ bInOwnChange = true; // disable ModifyHdl (reset in DataChanged)
if ( eMode == SC_INPUT_NONE )
- return StartTable( cTyped, bFromCommand );
+ return StartTable( cTyped, bFromCommand, false );
else
- return sal_False;
+ return false;
}
void ScInputHandler::DataChanged( sal_Bool bFromTopNotify )
@@ -2112,16 +2095,13 @@ void ScInputHandler::DataChanged( sal_Bool bFromTopNotify )
}
bModified = sal_True;
- bSelIsRef = sal_False;
+ bSelIsRef = false;
if ( pRangeFindList && !bInRangeUpdate )
RemoveRangeFinder(); // Attribute und Markierung loeschen
UpdateParenthesis(); // Hervorhebung der Klammern neu
- // ER 31.08.00 New SetDefaults sets ParaAttribs, don't clear them away ...
-// RemoveAdjust(); // #40255# harte Ausrichtungs-Attribute loeschen
-
if (eMode==SC_INPUT_TYPE || eMode==SC_INPUT_TABLE)
{
String aText = GetEditText(pEngine);
@@ -2135,7 +2115,7 @@ void ScInputHandler::DataChanged( sal_Bool bFromTopNotify )
// (unabhaengig von eMode) -> View anpassen!
// wenn der Cursor am Ende steht, reicht der Status-Handler an der ViewData
- // #93767# first make sure the status handler is called now if the cursor
+ // first make sure the status handler is called now if the cursor
// is outside the visible area
pEngine->QuickFormatDoc();
@@ -2165,8 +2145,8 @@ void ScInputHandler::DataChanged( sal_Bool bFromTopNotify )
}
UpdateFormulaMode();
- bTextValid = sal_False; // Aenderungen sind nur in der Edit-Engine
- bInOwnChange = sal_False;
+ bTextValid = false; // Aenderungen sind nur in der Edit-Engine
+ bInOwnChange = false;
}
void ScInputHandler::UpdateFormulaMode()
@@ -2200,12 +2180,12 @@ void ScInputHandler::UpdateFormulaMode()
if (bFormulaMode)
{
ShowRefFrame();
- bFormulaMode = sal_False;
+ bFormulaMode = false;
pRefViewSh = NULL;
pSfxApp->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
SC_MOD()->SetRefInputHdl(NULL);
if (pInputWin)
- pInputWin->SetFormulaMode(sal_False);
+ pInputWin->SetFormulaMode(false);
UpdateAutoCorrFlag();
}
}
@@ -2213,13 +2193,13 @@ void ScInputHandler::UpdateFormulaMode()
void ScInputHandler::ShowRefFrame()
{
- // #123169# Modifying pActiveViewSh here would interfere with the bInEnterHandler / bRepeat
+ // Modifying pActiveViewSh here would interfere with the bInEnterHandler / bRepeat
// checks in NotifyChange, and lead to keeping the wrong value in pActiveViewSh.
// A local variable is used instead.
ScTabViewShell* pVisibleSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
if ( pRefViewSh && pRefViewSh != pVisibleSh )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SfxViewFrame* pRefFrame = pRefViewSh->GetViewFrame();
SfxViewFrame* pOneFrame = SfxViewFrame::GetFirst();
while ( pOneFrame && !bFound )
@@ -2240,7 +2220,7 @@ void ScInputHandler::ShowRefFrame()
}
else
{
- DBG_ERROR("ViewFrame fuer Referenzeingabe ist nicht mehr da");
+ OSL_FAIL("ViewFrame fuer Referenzeingabe ist nicht mehr da");
}
}
}
@@ -2283,7 +2263,6 @@ void ScInputHandler::InvalidateAttribs()
}
}
-
//
// --------------- public Methoden --------------------------------------------
//
@@ -2304,18 +2283,22 @@ void ScInputHandler::SetMode( ScInputMode eNewMode )
return;
}
- bInOwnChange = sal_True; // disable ModifyHdl (reset below)
+ if (eNewMode != SC_INPUT_NONE)
+ // Disable paste mode when edit mode starts.
+ pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
+
+ bInOwnChange = true; // disable ModifyHdl (reset below)
ScInputMode eOldMode = eMode;
eMode = eNewMode;
if (eOldMode == SC_INPUT_TOP && eNewMode != eOldMode)
- StopInputWinEngine( sal_False );
+ StopInputWinEngine( false );
if (eMode==SC_INPUT_TOP || eMode==SC_INPUT_TABLE)
{
if (eOldMode == SC_INPUT_NONE) // not when switching between modes
{
- if (StartTable(0, sal_False)) // 0 = look at existing document content for text or number
+ if (StartTable(0, false, eMode == SC_INPUT_TABLE))
{
if (pActiveViewSh)
pActiveViewSh->GetViewData()->GetDocShell()->PostEditView( pEngine, aCursorPos );
@@ -2337,7 +2320,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode )
pEngine->GetView(i)->
SetSelection( ESelection( nPara, nLen, nPara, nLen ) );
}
- pEngine->GetView(i)->ShowCursor(sal_False);
+ pEngine->GetView(i)->ShowCursor(false);
}
}
@@ -2356,7 +2339,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode )
if (eNewMode != eOldMode)
UpdateFormulaMode();
- bInOwnChange = sal_False;
+ bInOwnChange = false;
}
//----------------------------------------------------------------------------------------
@@ -2370,7 +2353,7 @@ sal_Bool lcl_IsNumber(const String& rString)
{
sal_Unicode c = rString.GetChar(i);
if ( c < '0' || c > '9' )
- return sal_False;
+ return false;
}
return sal_True;
}
@@ -2390,7 +2373,7 @@ void lcl_SelectionToEnd( EditView* pView )
void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
{
- // #62806# Bei Makro-Aufrufen fuer Gueltigkeit kann Tod und Teufel passieren,
+ // Bei Makro-Aufrufen fuer Gueltigkeit kann Tod und Teufel passieren,
// darum dafuer sorgen, dass EnterHandler nicht verschachtelt gerufen wird:
if (bInEnterHandler) return;
@@ -2404,8 +2387,8 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
SfxApplication* pSfxApp = SFX_APP();
EditTextObject* pObject = NULL;
ScPatternAttr* pCellAttrs = NULL;
- sal_Bool bAttrib = sal_False; // Formatierung vorhanden ?
- sal_Bool bForget = sal_False; // wegen Gueltigkeit streichen ?
+ sal_Bool bAttrib = false; // Formatierung vorhanden ?
+ sal_Bool bForget = false; // wegen Gueltigkeit streichen ?
String aString = GetEditText(pEngine);
EditView* pActiveView = pTopView ? pTopView : pTableView;
@@ -2420,10 +2403,12 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
lcl_SelectionToEnd(pTableView);
}
+ Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : NULL;
+
if (pTopView)
- pTopView->CompleteAutoCorrect(); // #59759# CompleteAutoCorrect fuer beide Views
+ pTopView->CompleteAutoCorrect(); // CompleteAutoCorrect fuer beide Views
if (pTableView)
- pTableView->CompleteAutoCorrect();
+ pTableView->CompleteAutoCorrect(pFrameWin);
aString = GetEditText(pEngine);
}
lcl_RemoveTabs(aString);
@@ -2489,7 +2474,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
double nVal;
if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
{
- bSpellErrors = sal_False; // ignore the spelling errors
+ bSpellErrors = false; // ignore the spelling errors
}
}
}
@@ -2497,25 +2482,39 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
// After RemoveAdjust, the EditView must not be repainted (has wrong font size etc).
// SetUpdateMode must come after CompleteOnlineSpelling.
// The view is hidden in any case below (Broadcast).
- pEngine->SetUpdateMode( sal_False );
+ pEngine->SetUpdateMode( false );
if ( bModified && !bForget ) // was wird eingeben (Text/Objekt) ?
{
sal_uInt16 nParCnt = pEngine->GetParagraphCount();
if ( nParCnt == 0 )
nParCnt = 1;
+
+ bool bUniformAttribs = true;
+ SfxItemSet aPara1Attribs = pEngine->GetAttribs(0, 0, pEngine->GetTextLen(0));
+ for (sal_uInt16 nPara = 1; nPara < nParCnt; ++nPara)
+ {
+ SfxItemSet aPara2Attribs = pEngine->GetAttribs(nPara, 0, pEngine->GetTextLen(nPara));
+ if (!(aPara1Attribs == aPara2Attribs))
+ {
+ // paragraph format different from that of the 1st paragraph.
+ bUniformAttribs = false;
+ break;
+ }
+ }
+
ESelection aSel( 0, 0, nParCnt-1, pEngine->GetTextLen(nParCnt-1) );
SfxItemSet aOldAttribs = pEngine->GetAttribs( aSel );
const SfxPoolItem* pItem = NULL;
// find common (cell) attributes before RemoveAdjust
- if ( pActiveViewSh )
+ if ( pActiveViewSh && bUniformAttribs )
{
SfxItemSet* pCommonAttrs = NULL;
for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END; nId++)
{
- SfxItemState eState = aOldAttribs.GetItemState( nId, sal_False, &pItem );
+ SfxItemState eState = aOldAttribs.GetItemState( nId, false, &pItem );
if ( eState == SFX_ITEM_SET &&
nId != EE_CHAR_ESCAPEMENT && nId != EE_CHAR_PAIRKERNING &&
nId != EE_CHAR_KERNING && nId != EE_CHAR_XMLATTRIBS &&
@@ -2548,7 +2547,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
{
for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END && !bAttrib; nId++)
{
- SfxItemState eState = aOldAttribs.GetItemState( nId, sal_False, &pItem );
+ SfxItemState eState = aOldAttribs.GetItemState( nId, false, &pItem );
if (eState == SFX_ITEM_DONTCARE)
bAttrib = sal_True;
else if (eState == SFX_ITEM_SET)
@@ -2565,13 +2564,13 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
// Feldbefehle enthalten?
- SfxItemState eFieldState = aOldAttribs.GetItemState( EE_FEATURE_FIELD, sal_False );
+ SfxItemState eFieldState = aOldAttribs.GetItemState( EE_FEATURE_FIELD, false );
if ( eFieldState == SFX_ITEM_DONTCARE || eFieldState == SFX_ITEM_SET )
bAttrib = sal_True;
// not converted characters?
- SfxItemState eConvState = aOldAttribs.GetItemState( EE_FEATURE_NOTCONV, sal_False );
+ SfxItemState eConvState = aOldAttribs.GetItemState( EE_FEATURE_NOTCONV, false );
if ( eConvState == SFX_ITEM_DONTCARE || eConvState == SFX_ITEM_SET )
bAttrib = sal_True;
@@ -2580,7 +2579,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
}
if (bMatrix)
- bAttrib = sal_False;
+ bAttrib = false;
if (bAttrib)
{
@@ -2592,15 +2591,9 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
}
else if (bAutoComplete) // Gross-/Kleinschreibung anpassen
{
- if (pColumnData)
- pColumnData->GetExactMatch( aString );
-
- //! effizienter in der Liste suchen (ScUserList, nur einmal ToUpper)
-
- sal_uInt16 nIndex;
- ScUserListData* pData = ScGlobal::GetUserList()->GetData(aString);
- if ( pData && pData->GetSubIndex( aString, nIndex ) )
- aString = pData->GetSubStr( nIndex );
+ // Perform case-matching only when the typed text is partial.
+ if (pColumnData && aAutoSearch.Len() < aString.Len())
+ pColumnData->GetExactMatch(aString);
}
}
@@ -2619,11 +2612,11 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
pExecuteSh->ActiveGrabFocus();
}
- bFormulaMode = sal_False;
+ bFormulaMode = false;
pSfxApp->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
SC_MOD()->SetRefInputHdl(NULL);
if (pInputWin)
- pInputWin->SetFormulaMode(sal_False);
+ pInputWin->SetFormulaMode(false);
UpdateAutoCorrFlag();
}
pRefViewSh = NULL; // auch ohne FormulaMode wegen Funktions-AP
@@ -2632,12 +2625,12 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
sal_Bool bOldMod = bModified;
- bModified = sal_False;
- bSelIsRef = sal_False;
+ bModified = false;
+ bSelIsRef = false;
eMode = SC_INPUT_NONE;
StopInputWinEngine( sal_True );
- // #123344# Text input (through number formats) or ApplySelectionPattern modify
+ // Text input (through number formats) or ApplySelectionPattern modify
// the cell's attributes, so pLastPattern is no longer valid
pLastPattern = NULL;
@@ -2719,8 +2712,8 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
nFormSelStart = nFormSelEnd = 0;
aFormText.Erase();
- bInOwnChange = sal_False;
- bInEnterHandler = sal_False;
+ bInOwnChange = false;
+ bInEnterHandler = false;
}
void ScInputHandler::CancelHandler()
@@ -2729,7 +2722,7 @@ void ScInputHandler::CancelHandler()
ImplCreateEditEngine();
- bModified = sal_False;
+ bModified = false;
// don't rely on ShowRefFrame switching the active view synchronously
// execute the function directly on the correct view's bindings instead
@@ -2744,11 +2737,11 @@ void ScInputHandler::CancelHandler()
pExecuteSh->SetTabNo(aCursorPos.Tab());
pExecuteSh->ActiveGrabFocus();
}
- bFormulaMode = sal_False;
+ bFormulaMode = false;
SFX_APP()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
SC_MOD()->SetRefInputHdl(NULL);
if (pInputWin)
- pInputWin->SetFormulaMode(sal_False);
+ pInputWin->SetFormulaMode(false);
UpdateAutoCorrFlag();
}
pRefViewSh = NULL; // auch ohne FormulaMode wegen Funktions-AP
@@ -2771,7 +2764,7 @@ void ScInputHandler::CancelHandler()
nFormSelStart = nFormSelEnd = 0;
aFormText.Erase();
- bInOwnChange = sal_False;
+ bInOwnChange = false;
}
sal_Bool ScInputHandler::IsModalMode( SfxObjectShell* pDocSh )
@@ -2794,9 +2787,9 @@ void ScInputHandler::AddRefEntry()
RemoveSelection();
if (pTableView)
- pTableView->InsertText( cSep, sal_False );
+ pTableView->InsertText( cSep, false );
if (pTopView)
- pTopView->InsertText( cSep, sal_False );
+ pTopView->InsertText( cSep, false );
DataChanged();
}
@@ -2865,7 +2858,6 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
// #i75893# convert escaped URL of the document to something user friendly
-// String aFileName = pObjSh->GetMedium()->GetName();
String aFileName = pObjSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
aRefStr = '\'';
@@ -2899,7 +2891,7 @@ void ScInputHandler::InsertFunction( const String& rFuncName, sal_Bool bAddPar )
{
if ( eMode == SC_INPUT_NONE )
{
- DBG_ERROR("InsertFunction, nicht im Eingabemodus");
+ OSL_FAIL("InsertFunction, nicht im Eingabemodus");
return;
}
@@ -2915,7 +2907,7 @@ void ScInputHandler::InsertFunction( const String& rFuncName, sal_Bool bAddPar )
if (pTableView)
{
- pTableView->InsertText( aText, sal_False );
+ pTableView->InsertText( aText, false );
if (bAddPar)
{
ESelection aSel = pTableView->GetSelection();
@@ -2926,7 +2918,7 @@ void ScInputHandler::InsertFunction( const String& rFuncName, sal_Bool bAddPar )
}
if (pTopView)
{
- pTopView->InsertText( aText, sal_False );
+ pTopView->InsertText( aText, false );
if (bAddPar)
{
ESelection aSel = pTopView->GetSelection();
@@ -2946,7 +2938,7 @@ void ScInputHandler::ClearText()
{
if ( eMode == SC_INPUT_NONE )
{
- DBG_ERROR("ClearText, nicht im Eingabemodus");
+ OSL_FAIL("ClearText, nicht im Eingabemodus");
return;
}
@@ -2987,16 +2979,25 @@ sal_Bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit /*
sal_uInt16 nCode = aCode.GetCode();
sal_Unicode nChar = rKEvt.GetCharCode();
- // Alt-Return is accepted, everything else with ALT, or CTRL-TAB are not:
- if (( bAlt && !bControl && nCode != KEY_RETURN ) ||
- ( bControl && aCode.GetCode() == KEY_TAB ))
- return sal_False;
+ if (bAlt && !bControl && nCode != KEY_RETURN)
+ // Alt-Return and Alt-Ctrl-* are accepted. Everything else with ALT are not.
+ return false;
+
+ if (!bControl && nCode == KEY_TAB)
+ {
+ // Normal TAB moves the cursor right.
+ EnterHandler();
+
+ if (pActiveViewSh)
+ pActiveViewSh->FindNextUnprot( bShift );
+ return true;
+ }
sal_Bool bInputLine = ( eMode==SC_INPUT_TOP );
- sal_Bool bUsed = sal_False;
- sal_Bool bSkip = sal_False;
- sal_Bool bDoEnter = sal_False;
+ sal_Bool bUsed = false;
+ sal_Bool bSkip = false;
+ sal_Bool bDoEnter = false;
switch ( nCode )
{
@@ -3029,30 +3030,22 @@ sal_Bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit /*
}
break;
case KEY_TAB:
- if (!bControl && !bAlt)
+ if (bControl && !bAlt)
{
if ( pFormulaData && nTipVisible && nAutoPos != SCPOS_INVALID )
{
// blaettern
NextFormulaEntry( bShift );
+ bUsed = true;
}
else if ( pColumnData && bUseTab && nAutoPos != SCPOS_INVALID )
{
// in den Eintraegen der AutoEingabe blaettern
NextAutoEntry( bShift );
+ bUsed = true;
}
- else
- {
- EnterHandler();
-
- // TabKeyInput gibt auf manchen Rechnern unter W95 Stackueberlaeufe,
- // darum direkter Aufruf:
- if (pActiveViewSh)
- pActiveViewSh->FindNextUnprot( bShift );
- }
- bUsed = sal_True;
}
break;
case KEY_ESCAPE:
@@ -3097,7 +3090,7 @@ sal_Bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit /*
if (bSelIsRef)
{
RemoveSelection();
- bSelIsRef = sal_False;
+ bSelIsRef = false;
}
UpdateActiveView();
@@ -3141,8 +3134,6 @@ sal_Bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit /*
if (pTableView || pTopView)
{
-// pActiveView->SetEditEngineUpdateMode(sal_True); //! gibt Muell !!!!
-
if (bDoEnter)
{
if (pTableView)
@@ -3160,8 +3151,11 @@ sal_Bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit /*
else
{
if (pTableView)
- if ( pTableView->PostKeyEvent( rKEvt ) )
- bUsed = sal_True;
+ {
+ Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() : NULL;
+ if ( pTableView->PostKeyEvent( rKEvt, pFrameWin ) )
+ bUsed = true;
+ }
if (pTopView)
if ( pTopView->PostKeyEvent( rKEvt ) )
bUsed = sal_True;
@@ -3171,7 +3165,7 @@ sal_Bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit /*
if ( bUsed && bAutoComplete )
{
- bUseTab = sal_False;
+ bUseTab = false;
nAutoPos = SCPOS_INVALID; // do not search further
KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
@@ -3215,11 +3209,11 @@ sal_Bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit /*
sal_Bool ScInputHandler::InputCommand( const CommandEvent& rCEvt, sal_Bool bForce )
{
- sal_Bool bUsed = sal_False;
+ sal_Bool bUsed = false;
if ( rCEvt.GetCommand() == COMMAND_CURSORPOS )
{
- // #90346# for COMMAND_CURSORPOS, do as little as possible, because
+ // for COMMAND_CURSORPOS, do as little as possible, because
// with remote VCL, even a ShowCursor will generate another event.
if ( eMode != SC_INPUT_NONE )
{
@@ -3250,7 +3244,7 @@ sal_Bool ScInputHandler::InputCommand( const CommandEvent& rCEvt, sal_Bool bForc
if ( bSelIsRef )
{
RemoveSelection();
- bSelIsRef = sal_False;
+ bSelIsRef = false;
}
UpdateActiveView();
@@ -3320,7 +3314,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
sal_Bool bForce, ScTabViewShell* pSourceSh,
sal_Bool bStopEditing)
{
- // #62806# Wenn der Aufruf aus einem Makro-Aufruf im EnterHandler kommt,
+ // Wenn der Aufruf aus einem Makro-Aufruf im EnterHandler kommt,
// gleich abbrechen und nicht den Status durcheinander bringen
if (bInEnterHandler)
return;
@@ -3358,7 +3352,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
if ( pState )
{
- sal_Bool bIgnore = sal_False;
+ sal_Bool bIgnore = false;
// hier auch fremde Referenzeingabe beruecksichtigen (z.B. Funktions-AP),
// FormEditData falls gerade von der Hilfe auf Calc umgeschaltet wird:
@@ -3376,20 +3370,20 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
bIgnore = sal_True;
}
- if ( !bIgnore /* || bRepeat */ )
+ if ( !bIgnore )
{
const ScAddress& rSPos = pState->GetStartPos();
const ScAddress& rEPos = pState->GetEndPos();
const EditTextObject* pData = pState->GetEditData();
String aString = pState->GetString();
- sal_Bool bTxtMod = sal_False;
+ sal_Bool bTxtMod = false;
ScDocShell* pDocSh = pActiveViewSh->GetViewData()->GetDocShell();
ScDocument* pDoc = pDocSh->GetDocument();
aCursorPos = pState->GetPos();
- if ( pData /* || bRepeat */ )
- bTxtMod = sal_True;
+ if ( pData )
+ bTxtMod = true;
else if ( bHadObject )
bTxtMod = sal_True;
else if ( bTextValid )
@@ -3404,7 +3398,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
pEngine->SetText( *pData );
aString = GetEditText(pEngine);
lcl_RemoveTabs(aString);
- bTextValid = sal_False;
+ bTextValid = false;
aCurrentText.Erase();
}
else
@@ -3445,7 +3439,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
}
//IAccessibility2 Implementation 2009-----
// Disable the accessible VALUE_CHANGE event
- sal_Bool bIsSuppressed = pInputWin->IsAccessibilityEventsSuppressed(sal_False);
+ sal_Bool bIsSuppressed = pInputWin->IsAccessibilityEventsSuppressed(false);
pInputWin->SetAccessibilityEventsSuppressed(sal_True);
pInputWin->SetPosString(aPosStr);
pInputWin->SetAccessibilityEventsSuppressed(bIsSuppressed);
@@ -3464,16 +3458,14 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
if ( nCntrl & EE_CNTRL_ONLINESPELLING )
pEngine->SetControlWord( nCntrl & ~EE_CNTRL_ONLINESPELLING );
- bModified = sal_False;
- bSelIsRef = sal_False;
- bProtected = sal_False;
- bCommandErrorShown = sal_False;
+ bModified = false;
+ bSelIsRef = false;
+ bProtected = false;
+ bCommandErrorShown = false;
}
}
}
-// bProtected = sal_False;
-
if ( pInputWin)
{
if(!pScMod->IsFormulaMode()&& !pScMod->IsRefDialogOpen()) //BugID 54702
@@ -3512,7 +3504,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
HideTip();
HideTipBelow();
- bInOwnChange = sal_False;
+ bInOwnChange = false;
}
void ScInputHandler::UpdateCellAdjust( SvxCellHorJustify eJust )
@@ -3549,11 +3541,11 @@ IMPL_LINK( ScInputHandler, DelayTimer, Timer*, pTimer )
{
if ( pInputWin)
{
- pInputWin->EnableButtons( sal_False );
+ pInputWin->EnableButtons( false );
pInputWin->Disable();
}
}
- else if ( !bFormulaMode ) // #39210# Formel auch z.B. bei Hilfe behalten
+ else if ( !bFormulaMode ) // Formel auch z.B. bei Hilfe behalten
{
bInOwnChange = sal_True; // disable ModifyHdl (reset below)
@@ -3566,7 +3558,7 @@ IMPL_LINK( ScInputHandler, DelayTimer, Timer*, pTimer )
pInputWin->Disable();
}
- bInOwnChange = sal_False;
+ bInOwnChange = false;
}
}
}
@@ -3633,14 +3625,14 @@ Size ScInputHandler::GetTextSize()
sal_Bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
if (pEngine)
{
// Feldbefehle enthalten?
sal_uInt16 nParCnt = pEngine->GetParagraphCount();
SfxItemSet aSet = pEngine->GetAttribs( ESelection(0,0,nParCnt,0) );
- SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, sal_False );
+ SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, false );
if ( eFieldState == SFX_ITEM_DONTCARE || eFieldState == SFX_ITEM_SET )
{
// Inhalt kopieren
@@ -3670,7 +3662,6 @@ sal_Bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine )
return bRet;
}
-
//------------------------------------------------------------------------
// Methoden fuer FunktionsAutopiloten:
// InputGetSelection, InputSetSelection, InputReplaceSelection, InputGetFormulaStr
@@ -3700,7 +3691,7 @@ EditView* ScInputHandler::GetFuncEditView()
{
bCreatingFuncView = sal_True; // RangeFinder nicht anzeigen
SetMode( SC_INPUT_TABLE );
- bCreatingFuncView = sal_False;
+ bCreatingFuncView = false;
if ( pTableView )
pTableView->GetEditEngine()->SetText( EMPTY_STRING );
}
@@ -3752,8 +3743,7 @@ void ScInputHandler::InputReplaceSelection( const String& rStr )
EditView* pView = GetFuncEditView();
if (pView)
{
- pView->SetEditEngineUpdateMode( sal_False );
-// pView->InsertText( rStr, sal_True );
+ pView->SetEditEngineUpdateMode( false );
pView->GetEditEngine()->SetText( aFormText );
pView->SetSelection( ESelection(0,nFormSelStart, 0,nFormSelEnd) );
pView->SetEditEngineUpdateMode( sal_True );
@@ -3826,6 +3816,4 @@ ScInputHdlState& ScInputHdlState::operator=( const ScInputHdlState& r )
return *this;
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2da1ed83bf08..6a93fc130e02 100755
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,7 +119,7 @@ ScInputWindowWrapper::ScInputWindowWrapper( Window* pParentP,
// GetInfo fliegt wieder raus, wenn es ein SFX_IMPL_TOOLBOX gibt !!!!
-SfxChildWinInfo __EXPORT ScInputWindowWrapper::GetInfo() const
+SfxChildWinInfo ScInputWindowWrapper::GetInfo() const
{
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
return aInfo;
@@ -126,7 +127,7 @@ SfxChildWinInfo __EXPORT ScInputWindowWrapper::GetInfo() const
//==================================================================
-#define IMAGE(id) pImgMgr->SeekImage(id, bHC)
+#define IMAGE(id) pImgMgr->SeekImage(id)
//==================================================================
// class ScInputWindow
@@ -134,7 +135,7 @@ SfxChildWinInfo __EXPORT ScInputWindowWrapper::GetInfo() const
ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
#ifdef OS2
-// #37192# ohne WB_CLIPCHILDREN wg. os/2 Paintproblem
+// ohne WB_CLIPCHILDREN wg. os/2 Paintproblem
ToolBox ( pParent, WinBits(WB_BORDER|WB_3DLOOK) ),
#else
// mit WB_CLIPCHILDREN, sonst Flicker
@@ -148,7 +149,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
aTextCancel ( ScResId( SCSTR_QHELP_BTNCANCEL ) ),
aTextSum ( ScResId( SCSTR_QHELP_BTNSUM ) ),
aTextEqual ( ScResId( SCSTR_QHELP_BTNEQUAL ) ),
- bIsOkCancelMode ( sal_False )
+ bIsOkCancelMode ( false )
{
ScModule* pScMod = SC_MOD();
SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod );
@@ -165,8 +166,6 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
}
DBG_ASSERT( pViewSh, "no view shell for input window" );
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
-
// Positionsfenster, 3 Buttons, Eingabefenster
InsertWindow ( 1, &aWndPos, 0, 0 );
InsertSeparator ( 1 );
@@ -197,7 +196,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
aWndPos .Show();
aTextWindow .Show();
- pInputHdl = SC_MOD()->GetInputHdl( pViewSh, sal_False ); // use own handler even if ref-handler is set
+ pInputHdl = SC_MOD()->GetInputHdl( pViewSh, false ); // use own handler even if ref-handler is set
if (pInputHdl)
pInputHdl->SetInputWindow( this );
@@ -226,7 +225,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
SetAccessibleName(ScResId(STR_ACC_TOOLBAR_FORMULA));
}
-__EXPORT ScInputWindow::~ScInputWindow()
+ScInputWindow::~ScInputWindow()
{
sal_Bool bDown = ( ScGlobal::pSysLocale == NULL ); // after Clear?
@@ -244,7 +243,7 @@ __EXPORT ScInputWindow::~ScInputWindow()
if ( pHdl && pHdl->GetInputWindow() == this )
{
pHdl->SetInputWindow( NULL );
- pHdl->StopInputWinEngine( sal_False ); // #125841# reset pTopView pointer
+ pHdl->StopInputWinEngine( false ); // reset pTopView pointer
}
pSh = SfxViewShell::GetNext( *pSh, &aScType );
}
@@ -270,16 +269,16 @@ void ScInputWindow::SetInputHandler( ScInputHandler* pNew )
sal_Bool ScInputWindow::UseSubTotal(ScRangeList* pRangeList) const
{
- sal_Bool bSubTotal(sal_False);
+ sal_Bool bSubTotal(false);
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
if ( pViewSh )
{
ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
- sal_Int32 nRangeCount (pRangeList->Count());
- sal_Int32 nRangeIndex (0);
+ size_t nRangeCount (pRangeList->size());
+ size_t nRangeIndex (0);
while (!bSubTotal && nRangeIndex < nRangeCount)
{
- const ScRange* pRange = pRangeList->GetObject( nRangeIndex );
+ const ScRange* pRange = (*pRangeList)[nRangeIndex];
if( pRange )
{
SCTAB nTabEnd(pRange->aEnd.Tab());
@@ -312,7 +311,7 @@ sal_Bool ScInputWindow::UseSubTotal(ScRangeList* pRangeList) const
nRangeIndex = 0;
while (!bSubTotal && nRangeIndex < nRangeCount)
{
- const ScRange* pRange = pRangeList->GetObject( nRangeIndex );
+ const ScRange* pRange = (*pRangeList)[nRangeIndex];
if( pRange )
{
ScRange aDBArea;
@@ -329,7 +328,7 @@ sal_Bool ScInputWindow::UseSubTotal(ScRangeList* pRangeList) const
return bSubTotal;
}
-void __EXPORT ScInputWindow::Select()
+void ScInputWindow::Select()
{
ScModule* pScMod = SC_MOD();
ToolBox::Select();
@@ -372,15 +371,15 @@ void __EXPORT ScInputWindow::Select()
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
ScRangeList aMarkRangeList;
- rMark.FillRangeListWithMarks( &aMarkRangeList, sal_False );
+ rMark.FillRangeListWithMarks( &aMarkRangeList, false );
ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
// check if one of the marked ranges is empty
bool bEmpty = false;
- const sal_uLong nCount = aMarkRangeList.Count();
- for ( sal_uLong i = 0; i < nCount; ++i )
+ const size_t nCount = aMarkRangeList.size();
+ for ( size_t i = 0; i < nCount; ++i )
{
- const ScRange aRange( *aMarkRangeList.GetObject( i ) );
+ const ScRange aRange( *aMarkRangeList[i] );
if ( pDoc->IsBlockEmpty( aRange.aStart.Tab(),
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row() ) )
@@ -396,24 +395,29 @@ void __EXPORT ScInputWindow::Select()
const sal_Bool bDataFound = pViewSh->GetAutoSumArea( aRangeList );
if ( bDataFound )
{
+ ScAddress aAddr = aRangeList.back()->aEnd;
+ aAddr.IncRow();
const sal_Bool bSubTotal( UseSubTotal( &aRangeList ) );
- pViewSh->EnterAutoSum( aRangeList, bSubTotal ); // Block mit Summen fuellen
+ pViewSh->EnterAutoSum( aRangeList, bSubTotal, aAddr );
}
}
else
{
const sal_Bool bSubTotal( UseSubTotal( &aMarkRangeList ) );
- for ( sal_uLong i = 0; i < nCount; ++i )
+ for ( size_t i = 0; i < nCount; ++i )
{
- const ScRange aRange( *aMarkRangeList.GetObject( i ) );
+ const ScRange aRange( *aMarkRangeList[i] );
const bool bSetCursor = ( i == nCount - 1 ? true : false );
const bool bContinue = ( i != 0 ? true : false );
if ( !pViewSh->AutoSum( aRange, bSubTotal, bSetCursor, bContinue ) )
{
- pViewSh->MarkRange( aRange, sal_False, sal_False );
+ pViewSh->MarkRange( aRange, false, false );
pViewSh->SetCursor( aRange.aEnd.Col(), aRange.aEnd.Row() );
const ScRangeList aRangeList;
- const String aFormula = pViewSh->GetAutoSumFormula( aRangeList, bSubTotal );
+ ScAddress aAddr = aRange.aEnd;
+ aAddr.IncRow();
+ const String aFormula = pViewSh->GetAutoSumFormula(
+ aRangeList, bSubTotal, aAddr );
SetFuncString( aFormula );
break;
}
@@ -425,7 +429,8 @@ void __EXPORT ScInputWindow::Select()
ScRangeList aRangeList;
const sal_Bool bDataFound = pViewSh->GetAutoSumArea( aRangeList );
const sal_Bool bSubTotal( UseSubTotal( &aRangeList ) );
- const String aFormula = pViewSh->GetAutoSumFormula( aRangeList, bSubTotal );
+ ScAddress aAddr = pViewSh->GetViewData()->GetCurPos();
+ const String aFormula = pViewSh->GetAutoSumFormula( aRangeList, bSubTotal, aAddr );
SetFuncString( aFormula );
if ( bDataFound && pScMod->IsEditMode() )
@@ -481,7 +486,7 @@ void __EXPORT ScInputWindow::Select()
}
}
-void __EXPORT ScInputWindow::Resize()
+void ScInputWindow::Resize()
{
ToolBox::Resize();
@@ -554,8 +559,6 @@ void ScInputWindow::SetOkCancelMode()
SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod );
if (!bIsOkCancelMode)
{
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
-
RemoveItem( 3 ); // SID_INPUT_SUM und SID_INPUT_EQUAL entfernen
RemoveItem( 3 );
InsertItem( SID_INPUT_CANCEL, IMAGE( SID_INPUT_CANCEL ), 0, 3 );
@@ -578,8 +581,6 @@ void ScInputWindow::SetSumAssignMode()
SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod );
if (bIsOkCancelMode)
{
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
-
// SID_INPUT_CANCEL, und SID_INPUT_OK entfernen
RemoveItem( 3 );
RemoveItem( 3 );
@@ -589,9 +590,9 @@ void ScInputWindow::SetSumAssignMode()
SetHelpId ( SID_INPUT_SUM, HID_INSWIN_SUMME );
SetItemText ( SID_INPUT_EQUAL, aTextEqual );
SetHelpId ( SID_INPUT_EQUAL, HID_INSWIN_FUNC );
- bIsOkCancelMode = sal_False;
+ bIsOkCancelMode = false;
- SetFormulaMode(sal_False); // kein editieren -> keine Formel
+ SetFormulaMode(false); // kein editieren -> keine Formel
}
}
@@ -601,31 +602,16 @@ void ScInputWindow::SetFormulaMode( sal_Bool bSet )
aTextWindow.SetFormulaMode(bSet);
}
-void __EXPORT ScInputWindow::SetText( const String& rString )
+void ScInputWindow::SetText( const String& rString )
{
ToolBox::SetText(rString);
}
-String __EXPORT ScInputWindow::GetText() const
+String ScInputWindow::GetText() const
{
return ToolBox::GetText();
}
-
-//UNUSED2008-05 EditView* ScInputWindow::ActivateEdit( const String& rText,
-//UNUSED2008-05 const ESelection& rSel )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( !aTextWindow.IsInputActive() )
-//UNUSED2008-05 {
-//UNUSED2008-05 aTextWindow.StartEditEngine();
-//UNUSED2008-05 aTextWindow.GrabFocus();
-//UNUSED2008-05 aTextWindow.SetTextString( rText );
-//UNUSED2008-05 aTextWindow.GetEditView()->SetSelection( rSel );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 return aTextWindow.GetEditView();
-//UNUSED2008-05 }
-
sal_Bool ScInputWindow::IsInputActive()
{
return aTextWindow.IsInputActive();
@@ -703,11 +689,9 @@ void ScInputWindow::DataChanged( const DataChangedEvent& rDCEvt )
if ( rDCEvt.GetType() == DATACHANGED_SETTINGS && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
// update item images
-
ScModule* pScMod = SC_MOD();
SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod );
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
- // IMAGE macro uses pScMod, pImgMgr, bHC
+ // IMAGE macro uses pScMod, pImgMg
SetItemImage( SID_INPUT_FUNCTION, IMAGE( SID_INPUT_FUNCTION ) );
if ( bIsOkCancelMode )
@@ -735,14 +719,14 @@ ScTextWnd::ScTextWnd( Window* pParent )
pEditEngine ( NULL ),
pEditView ( NULL ),
bIsInsertMode( sal_True ),
- bFormulaMode ( sal_False ),
- bInputMode ( sal_False )
+ bFormulaMode ( false ),
+ bInputMode ( false )
{
- EnableRTL( sal_False ); // #106269# EditEngine can't be used with VCL EnableRTL
+ EnableRTL( false ); // EditEngine can't be used with VCL EnableRTL
bIsRTL = GetSettings().GetLayoutRTL();
- // #79096# always use application font, so a font with cjk chars can be installed
+ // always use application font, so a font with cjk chars can be installed
Font aAppFont = GetFont();
aTextFont = aAppFont;
aTextFont.SetSize( PixelToLogic( aAppFont.GetSize(), MAP_TWIP ) ); // AppFont ist in Pixeln
@@ -769,7 +753,7 @@ ScTextWnd::ScTextWnd( Window* pParent )
SetPointer ( POINTER_TEXT );
}
-__EXPORT ScTextWnd::~ScTextWnd()
+ScTextWnd::~ScTextWnd()
{
while (!maAccTextDatas.empty()) {
maAccTextDatas.back()->Dispose();
@@ -778,7 +762,7 @@ __EXPORT ScTextWnd::~ScTextWnd()
delete pEditEngine;
}
-void __EXPORT ScTextWnd::Paint( const Rectangle& rRec )
+void ScTextWnd::Paint( const Rectangle& rRec )
{
if (pEditView)
pEditView->Paint( rRec );
@@ -804,7 +788,7 @@ void __EXPORT ScTextWnd::Paint( const Rectangle& rRec )
}
}
-void __EXPORT ScTextWnd::Resize()
+void ScTextWnd::Resize()
{
if (pEditView)
{
@@ -812,11 +796,6 @@ void __EXPORT ScTextWnd::Resize()
long nDiff = aSize.Height()
- LogicToPixel( Size( 0, GetTextHeight() ) ).Height();
-#ifdef OS2_DOCH_NICHT
- nDiff-=2; // wird durch 2 geteilt
- // passt sonst nicht zur normalen Textausgabe
-#endif
-
aSize.Width() -= 2 * TEXT_STARTPOS - 1;
pEditView->SetOutputArea(
@@ -825,13 +804,13 @@ void __EXPORT ScTextWnd::Resize()
}
}
-void __EXPORT ScTextWnd::MouseMove( const MouseEvent& rMEvt )
+void ScTextWnd::MouseMove( const MouseEvent& rMEvt )
{
if (pEditView)
pEditView->MouseMove( rMEvt );
}
-void __EXPORT ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt )
+void ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt )
{
if (!HasFocus())
{
@@ -847,7 +826,7 @@ void __EXPORT ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt )
}
}
-void __EXPORT ScTextWnd::MouseButtonUp( const MouseEvent& rMEvt )
+void ScTextWnd::MouseButtonUp( const MouseEvent& rMEvt )
{
if (pEditView)
if (pEditView->MouseButtonUp( rMEvt ))
@@ -863,7 +842,7 @@ void __EXPORT ScTextWnd::MouseButtonUp( const MouseEvent& rMEvt )
}
}
-void __EXPORT ScTextWnd::Command( const CommandEvent& rCEvt )
+void ScTextWnd::Command( const CommandEvent& rCEvt )
{
bInputMode = sal_True;
sal_uInt16 nCommand = rCEvt.GetCommand();
@@ -872,15 +851,15 @@ void __EXPORT ScTextWnd::Command( const CommandEvent& rCEvt )
ScModule* pScMod = SC_MOD();
ScTabViewShell* pStartViewSh = ScTabViewShell::GetActiveViewShell();
- // #109441# don't modify the font defaults here - the right defaults are
+ // don't modify the font defaults here - the right defaults are
// already set in StartEditEngine when the EditEngine is created
- // #63263# verhindern, dass die EditView beim View-Umschalten wegkommt
- pScMod->SetInEditCommand( sal_True );
+ // verhindern, dass die EditView beim View-Umschalten wegkommt
+ pScMod->SetInEditCommand( true );
pEditView->Command( rCEvt );
- pScMod->SetInEditCommand( sal_False );
+ pScMod->SetInEditCommand( false );
- // #48929# COMMAND_STARTDRAG heiss noch lange nicht, dass der Inhalt geaendert wurde
+ // COMMAND_STARTDRAG heiss noch lange nicht, dass der Inhalt geaendert wurde
// darum in dem Fall kein InputChanged
//! erkennen, ob mit Move gedraggt wurde, oder Drag&Move irgendwie verbieten
@@ -922,7 +901,7 @@ void __EXPORT ScTextWnd::Command( const CommandEvent& rCEvt )
else
Window::Command(rCEvt); // sonst soll sich die Basisklasse drum kuemmern...
- bInputMode = sal_False;
+ bInputMode = false;
}
void ScTextWnd::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel )
@@ -937,33 +916,33 @@ void ScTextWnd::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel )
}
}
-void __EXPORT ScTextWnd::KeyInput(const KeyEvent& rKEvt)
+void ScTextWnd::KeyInput(const KeyEvent& rKEvt)
{
bInputMode = sal_True;
if (!SC_MOD()->InputKeyEvent( rKEvt ))
{
- sal_Bool bUsed = sal_False;
+ sal_Bool bUsed = false;
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh )
bUsed = pViewSh->SfxKeyInput(rKEvt); // nur Acceleratoren, keine Eingabe
if (!bUsed)
Window::KeyInput( rKEvt );
}
- bInputMode = sal_False;
+ bInputMode = false;
}
-void __EXPORT ScTextWnd::GetFocus()
+void ScTextWnd::GetFocus()
{
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh )
- pViewSh->SetFormShellAtTop( sal_False ); // focus in input line -> FormShell no longer on top
+ pViewSh->SetFormShellAtTop( false ); // focus in input line -> FormShell no longer on top
}
-void __EXPORT ScTextWnd::LoseFocus()
+void ScTextWnd::LoseFocus()
{
}
-String __EXPORT ScTextWnd::GetText() const
+String ScTextWnd::GetText() const
{
// ueberladen, um per Testtool an den Text heranzukommen
@@ -1043,7 +1022,7 @@ void lcl_ModifyRTLVisArea( EditView* pEditView )
void ScTextWnd::StartEditEngine()
{
- // #31147# Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
+ // Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && pObjSh->IsInModalMode() )
return;
@@ -1059,10 +1038,10 @@ void ScTextWnd::StartEditEngine()
}
else
pNew = new ScFieldEditEngine( EditEngine::CreatePool(), NULL, sal_True );
- pNew->SetExecuteURL( sal_False );
+ pNew->SetExecuteURL( false );
pEditEngine = pNew;
- pEditEngine->SetUpdateMode( sal_False );
+ pEditEngine->SetUpdateMode( false );
pEditEngine->SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) );
pEditEngine->SetWordDelimiters(
ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
@@ -1074,16 +1053,16 @@ void ScTextWnd::StartEditEngine()
pEditEngine->SetFontInfoInItemSet( *pSet, aTextFont );
lcl_ExtendEditFontAttribs( *pSet );
// turn off script spacing to match DrawText output
- pSet->Put( SvxScriptSpaceItem( sal_False, EE_PARA_ASIANCJKSPACING ) );
+ pSet->Put( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
if ( bIsRTL )
lcl_ModifyRTLDefaults( *pSet );
pEditEngine->SetDefaults( pSet );
}
- // #57254# Wenn in der Zelle URL-Felder enthalten sind, muessen die auch in
+ // Wenn in der Zelle URL-Felder enthalten sind, muessen die auch in
// die Eingabezeile uebernommen werden, weil sonst die Positionen nicht stimmen.
- sal_Bool bFilled = sal_False;
+ sal_Bool bFilled = false;
ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
if ( pHdl ) //! Testen, ob's der richtige InputHdl ist?
bFilled = pHdl->GetTextAndFields( *pEditEngine );
@@ -1140,7 +1119,7 @@ IMPL_LINK(ScTextWnd, NotifyHdl, EENotify*, EMPTYARG)
{
ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
- // #105354# Use the InputHandler's InOwnChange flag to prevent calling InputChanged
+ // Use the InputHandler's InOwnChange flag to prevent calling InputChanged
// while an InputHandler method is modifying the EditEngine content
if ( pHdl && !pHdl->IsInOwnChange() )
@@ -1188,10 +1167,6 @@ void ScTextWnd::SetTextString( const String& rNewString )
// Position der Aenderung suchen, nur Rest painten
- long nInvPos = 0;
- long nStartPos = 0;
- long nTextSize = 0;
-
if (!pEditEngine)
{
sal_Bool bPaintAll;
@@ -1220,6 +1195,7 @@ void ScTextWnd::SetTextString( const String& rNewString )
}
else
{
+ long nTextSize = 0;
xub_StrLen nDifPos;
if (rNewString.Len() > aString.Len())
nDifPos = rNewString.Match(aString);
@@ -1238,8 +1214,8 @@ void ScTextWnd::SetTextString( const String& rNewString )
// -1 wegen Rundung und "A"
Point aLogicStart = PixelToLogic(Point(TEXT_STARTPOS-1,0));
- nStartPos = aLogicStart.X();
- nInvPos = nStartPos;
+ long nStartPos = aLogicStart.X();
+ long nInvPos = nStartPos;
if (nDifPos)
nInvPos += GetTextWidth(aString,0,nDifPos);
@@ -1262,7 +1238,7 @@ void ScTextWnd::SetTextString( const String& rNewString )
if (!maAccTextDatas.empty())
maAccTextDatas.back()->TextChanged();
- bInputMode = sal_False;
+ bInputMode = false;
}
}
@@ -1294,10 +1270,10 @@ void ScTextWnd::MakeDialogEditView()
}
else
pNew = new ScFieldEditEngine( EditEngine::CreatePool(), NULL, sal_True );
- pNew->SetExecuteURL( sal_False );
+ pNew->SetExecuteURL( false );
pEditEngine = pNew;
- pEditEngine->SetUpdateMode( sal_False );
+ pEditEngine->SetUpdateMode( false );
pEditEngine->SetWordDelimiters( pEditEngine->GetWordDelimiters() += '=' );
pEditEngine->SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) );
@@ -1382,7 +1358,7 @@ ScPosWnd::ScPosWnd( Window* pParent ) :
ComboBox ( pParent, WinBits(WB_HIDE | WB_DROPDOWN) ),
pAccel ( NULL ),
nTipVisible ( 0 ),
- bFormulaMode( sal_False )
+ bFormulaMode( false )
{
Size aSize( GetTextWidth( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("GW99999:GW99999")) ),
GetTextHeight() );
@@ -1395,7 +1371,7 @@ ScPosWnd::ScPosWnd( Window* pParent ) :
StartListening( *SFX_APP() ); // fuer Navigator-Bereichsnamen-Updates
}
-__EXPORT ScPosWnd::~ScPosWnd()
+ScPosWnd::~ScPosWnd()
{
EndListening( *SFX_APP() );
@@ -1440,38 +1416,29 @@ void ScPosWnd::FillRangeNames()
// per Hand sortieren, weil Funktionen nicht sortiert werden:
ScRangeName* pRangeNames = pDoc->GetRangeName();
- sal_uInt16 nCount = pRangeNames->GetCount();
- if ( nCount > 0 )
+ if (!pRangeNames->empty())
{
- sal_uInt16 nValidCount = 0;
ScRange aDummy;
- sal_uInt16 i;
- for ( i=0; i<nCount; i++ )
+ std::vector<const ScRangeData*> aSortArray;
+ ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ for (; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pRangeNames)[i];
- if (pData->IsValidReference(aDummy))
- nValidCount++;
+ if (itr->IsValidReference(aDummy))
+ aSortArray.push_back(&(*itr));
}
- if ( nValidCount )
+
+ if (!aSortArray.empty())
{
- ScRangeData** ppSortArray = new ScRangeData* [ nValidCount ];
- sal_uInt16 j;
- for ( i=0, j=0; i<nCount; i++ )
- {
- ScRangeData* pData = (*pRangeNames)[i];
- if (pData->IsValidReference(aDummy))
- ppSortArray[j++] = pData;
- }
#ifndef ICC
- qsort( (void*)ppSortArray, nValidCount, sizeof(ScRangeData*),
+ size_t n = aSortArray.size();
+ qsort( (void*)&aSortArray[0], n, sizeof(ScRangeData*),
&ScRangeData_QsortNameCompare );
#else
- qsort( (void*)ppSortArray, nValidCount, sizeof(ScRangeData*),
+ qsort( (void*)&aSortArray[0], n, sizeof(ScRangeData*),
ICCQsortNameCompare );
#endif
- for ( j=0; j<nValidCount; j++ )
- InsertEntry( ppSortArray[j]->GetName() );
- delete [] ppSortArray;
+ for (size_t i = 0; i < n; ++i)
+ InsertEntry(aSortArray[i]->GetName());
}
}
}
@@ -1515,7 +1482,7 @@ void ScPosWnd::FillFunctions()
SetText(aFirstName);
}
-void __EXPORT ScPosWnd::Notify( SfxBroadcaster&, const SfxHint& rHint )
+void ScPosWnd::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( !bFormulaMode )
{
@@ -1651,7 +1618,7 @@ void ScPosWnd::Modify()
}
}
-void __EXPORT ScPosWnd::Select()
+void ScPosWnd::Select()
{
ComboBox::Select(); // in VCL gibt GetText() erst danach den ausgewaehlten Eintrag
@@ -1708,8 +1675,7 @@ void ScPosWnd::DoEnter()
ScDocument* pDoc = pDocShell->GetDocument();
ScRangeName* pNames = pDoc->GetRangeName();
ScRange aSelection;
- sal_uInt16 nIndex = 0;
- if ( pNames && !pNames->SearchName( aText, nIndex ) &&
+ if ( pNames && !pNames->findByName(aText) &&
(pViewData->GetSimpleArea( aSelection ) == SC_MARK_SIMPLE) )
{
ScRangeName aNewRanges( *pNames );
@@ -1717,11 +1683,11 @@ void ScPosWnd::DoEnter()
String aContent;
aSelection.Format( aContent, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
ScRangeData* pNew = new ScRangeData( pDoc, aText, aContent, aCursor );
- if ( aNewRanges.Insert(pNew) )
+ if ( aNewRanges.insert(pNew) )
{
ScDocFunc aFunc(*pDocShell);
- aFunc.ModifyRangeNames( aNewRanges, sal_False );
- pViewSh->UpdateInputHandler(sal_True);
+ aFunc.ModifyRangeNames( aNewRanges );
+ pViewSh->UpdateInputHandler(true);
}
else
delete pNew; // shouldn't happen
@@ -1747,7 +1713,7 @@ void ScPosWnd::DoEnter()
ReleaseFocus_Impl();
}
-long __EXPORT ScPosWnd::Notify( NotifyEvent& rNEvt )
+long ScPosWnd::Notify( NotifyEvent& rNEvt )
{
long nHandled = 0;
@@ -1822,3 +1788,4 @@ void ScPosWnd::ReleaseFocus_Impl()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/lnktrans.cxx b/sc/source/ui/app/lnktrans.cxx
index 2e0f5d276a97..d410d6b10099 100644
--- a/sc/source/ui/app/lnktrans.cxx
+++ b/sc/source/ui/app/lnktrans.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,7 @@ void ScLinkTransferObj::AddSupportedFormats()
sal_Bool ScLinkTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
{
- sal_Bool bOK = sal_False;
+ sal_Bool bOK = false;
if ( aLinkURL.Len() )
{
INetBookmark aBmk( aLinkURL, aLinkText );
@@ -95,3 +96,4 @@ void ScLinkTransferObj::DragFinished( sal_Int8 nDropAction )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/makefile.mk b/sc/source/ui/app/makefile.mk
index a7ff3fe86d7d..56fbbae434f2 100644
--- a/sc/source/ui/app/makefile.mk
+++ b/sc/source/ui/app/makefile.mk
@@ -32,40 +32,29 @@ TARGET=app
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/scmod.obj \
- $(SLO)$/scmod2.obj \
- $(SLO)$/scdll.obj \
- $(SLO)$/typemap.obj \
- $(SLO)$/transobj.obj \
- $(SLO)$/drwtrans.obj \
- $(SLO)$/lnktrans.obj \
- $(SLO)$/seltrans.obj \
- $(SLO)$/inputhdl.obj \
- $(SLO)$/inputwin.obj \
- $(SLO)$/rfindlst.obj \
- $(SLO)$/uiitems.obj \
+ $(EXCEPTIONSFILES) \
$(SLO)$/msgpool.obj \
- $(SLO)$/client.obj
+ $(SLO)$/rfindlst.obj
EXCEPTIONSFILES= \
+ $(SLO)$/client.obj \
$(SLO)$/drwtrans.obj \
- $(SLO)$/scdll.obj \
- $(SLO)$/scmod2.obj \
+ $(SLO)$/inputhdl.obj \
+ $(SLO)$/inputwin.obj \
+ $(SLO)$/lnktrans.obj \
+ $(SLO)$/scdll.obj \
$(SLO)$/scmod.obj \
- $(SLO)$/typemap.obj \
- $(SLO)$/client.obj \
- $(SLO)$/inputwin.obj
-
-#LIB3TARGET=$(SLB)$/ysclib.lib
-#LIB3OBJFILES=$(SLO)$/sclib.obj
+ $(SLO)$/scmod2.obj \
+ $(SLO)$/seltrans.obj \
+ $(SLO)$/typemap.obj \
+ $(SLO)$/transobj.obj \
+ $(SLO)$/uiitems.obj
# --- Targets -------------------------------------------------------
diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx
index 6f471ebaa91b..535b97ef9381 100644
--- a/sc/source/ui/app/msgpool.cxx
+++ b/sc/source/ui/app/msgpool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
//------------------------------------------------------------------------
-static SfxItemInfo __READONLY_DATA aMsgItemInfos[] =
+static SfxItemInfo const aMsgItemInfos[] =
{
{ 0, SFX_ITEM_POOLABLE }, // SCITEM_STRING
{ 0, SFX_ITEM_POOLABLE }, // SCITEM_SEARCHDATA - nicht mehr benutzt !!!
@@ -66,11 +67,11 @@ ScMessagePool::ScMessagePool()
aGlobalQueryItem ( ScQueryItem ( SCITEM_QUERYDATA, NULL, NULL ) ),
aGlobalSubTotalItem ( ScSubTotalItem ( SCITEM_SUBTDATA, NULL, NULL ) ),
aGlobalConsolidateItem ( ScConsolidateItem ( SCITEM_CONSOLIDATEDATA, NULL ) ),
- aGlobalPivotItem ( ScPivotItem ( SCITEM_PIVOTDATA, NULL, NULL, sal_False ) ),
+ aGlobalPivotItem ( ScPivotItem ( SCITEM_PIVOTDATA, NULL, NULL, false ) ),
aGlobalSolveItem ( ScSolveItem ( SCITEM_SOLVEDATA, NULL ) ),
aGlobalUserListItem ( ScUserListItem ( SCITEM_USERLIST ) ),
//
- aPrintWarnItem ( SfxBoolItem ( SCITEM_PRINTWARN, sal_False ) )
+ aPrintWarnItem ( SfxBoolItem ( SCITEM_PRINTWARN, false ) )
{
ppPoolDefaults = new SfxPoolItem*[MSGPOOL_END - MSGPOOL_START + 1];
@@ -93,7 +94,7 @@ ScMessagePool::ScMessagePool()
}
-__EXPORT ScMessagePool::~ScMessagePool()
+ScMessagePool::~ScMessagePool()
{
Delete();
SetSecondaryPool( NULL ); // before deleting defaults (accesses defaults)
@@ -107,7 +108,7 @@ __EXPORT ScMessagePool::~ScMessagePool()
}
-SfxMapUnit __EXPORT ScMessagePool::GetMetric( sal_uInt16 nWhich ) const
+SfxMapUnit ScMessagePool::GetMetric( sal_uInt16 nWhich ) const
{
// eigene Attribute: Twips, alles andere 1/100 mm
@@ -121,3 +122,4 @@ SfxMapUnit __EXPORT ScMessagePool::GetMetric( sal_uInt16 nWhich ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/rfindlst.cxx b/sc/source/ui/app/rfindlst.cxx
index 4f61fdb23263..d64a15b2bf09 100644
--- a/sc/source/ui/app/rfindlst.cxx
+++ b/sc/source/ui/app/rfindlst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,7 @@ static ColorData aColNames[SC_RANGECOLORS] =
ScRangeFindList::ScRangeFindList(const String& rName) :
aDocName( rName ),
- bHidden( sal_False )
+ bHidden( false )
{
}
@@ -58,10 +59,11 @@ ScRangeFindList::~ScRangeFindList()
}
}
-ColorData ScRangeFindList::GetColorName( sal_uInt16 nIndex ) // static
+ColorData ScRangeFindList::GetColorName( size_t nIndex )
{
return aColNames[nIndex % SC_RANGECOLORS];
}
//==================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 9a1858fe5170..d1c56ec1ae77 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <editeng/eeitem.hxx>
-#ifndef _FM_FMOBJFAC_HXX
#include <svx/fmobjfac.hxx>
-#endif
#include <svx/objfac3d.hxx>
#include <svx/tbxcolor.hxx>
@@ -117,7 +116,6 @@
#include "spelldialog.hxx"
#include <svx/fontwork.hxx>
#include <svx/srchdlg.hxx>
-#include <svx/hyprlink.hxx>
#include <svx/hyperdlg.hxx>
#include <svx/imapdlg.hxx>
@@ -130,31 +128,6 @@
//------------------------------------------------------------------
-//UNUSED2008-05 // filter detection can't use ScFilterOptions (in sc-dll),
-//UNUSED2008-05 // so access to wk3 flag must be implemented here again
-//UNUSED2008-05
-//UNUSED2008-05 class ScLibOptions : public utl::ConfigItem
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_Bool bWK3Flag;
-//UNUSED2008-05
-//UNUSED2008-05 public:
-//UNUSED2008-05 ScLibOptions();
-//UNUSED2008-05 sal_Bool GetWK3Flag() const { return bWK3Flag; }
-//UNUSED2008-05 };
-//UNUSED2008-05
-//UNUSED2008-05 #define CFGPATH_LIBFILTER "Office.Calc/Filter/Import/Lotus123"
-//UNUSED2008-05 #define ENTRYSTR_WK3 "WK3"
-//UNUSED2008-05
-//UNUSED2008-05 ScLibOptions::ScLibOptions() :
-//UNUSED2008-05 ConfigItem( rtl::OUString::createFromAscii( CFGPATH_LIBFILTER ) ),
-//UNUSED2008-05 bWK3Flag( sal_False )
-//UNUSED2008-05 {
-//UNUSED2008-05 com::sun::star::uno::Sequence<rtl::OUString> aNames(1);
-//UNUSED2008-05 aNames[0] = rtl::OUString::createFromAscii( ENTRYSTR_WK3 );
-//UNUSED2008-05 com::sun::star::uno::Sequence<com::sun::star::uno::Any> aValues = GetProperties(aNames);
-//UNUSED2008-05 if ( aValues.getLength() == 1 && aValues[0].hasValue() )
-//UNUSED2008-05 bWK3Flag = comphelper::getBOOL( aValues[0] );
-//UNUSED2008-05 }
//------------------------------------------------------------------
@@ -178,9 +151,7 @@ void ScDLL::Init()
ScModule* pMod = new ScModule( &ScDocShell::Factory() );
(*ppShlPtr) = pMod;
-//REMOVE ScDocShell::RegisterFactory( SDT_SC_DOCFACTPRIO );
-
- ScDocShell::Factory().SetDocumentServiceName( rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ) );
+ ScDocShell::Factory().SetDocumentServiceName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" )) );
ScGlobal::Init(); // erst wenn der ResManager initialisiert ist
// erst nach ScGlobal::Init duerfen die App-Optionen
@@ -265,7 +236,7 @@ void ScDLL::Init()
::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
// common SFX controller
- ::sfx2::TaskPaneWrapper::RegisterChildWindow( sal_False, pMod );
+ ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pMod );
// Svx-StatusBar-Controller
SvxInsertStatusBarControl ::RegisterControl(SID_ATTR_INSERT, pMod);
@@ -291,51 +262,42 @@ void ScDLL::Init()
ScInputWindowWrapper ::RegisterChildWindow(42, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK);
ScNavigatorDialogWrapper ::RegisterChildWindowContext(
sal::static_int_cast<sal_uInt16>(ScTabViewShell::GetInterfaceId()), pMod);
- ScSolverDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScOptSolverDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScNameDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScPivotLayoutWrapper ::RegisterChildWindow(sal_False, pMod);
- ScTabOpDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScFilterDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScSpecialFilterDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScDbNameDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScConsolidateDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScPrintAreasDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScCondFormatDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScColRowNameRangesDlgWrapper::RegisterChildWindow(sal_False, pMod);
- ScFormulaDlgWrapper ::RegisterChildWindow(sal_False, pMod);
+ ScSolverDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScNameDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod);
+ ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScFilterDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScSpecialFilterDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScCondFormatDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod);
+ ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod);
// First docking Window for Calc
- ScFunctionChildWindow ::RegisterChildWindow(sal_False, pMod);
+ ScFunctionChildWindow ::RegisterChildWindow(false, pMod);
// Redlining- Window
- ScAcceptChgDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- ScSimpleRefDlgWrapper ::RegisterChildWindow(sal_False, pMod, SFX_CHILDWIN_ALWAYSAVAILABLE|SFX_CHILDWIN_NEVERHIDE );
- ScHighlightChgDlgWrapper ::RegisterChildWindow(sal_False, pMod);
-
- SvxSearchDialogWrapper ::RegisterChildWindow(sal_False, pMod);
- SvxHlinkDlgWrapper ::RegisterChildWindow(sal_False, pMod);
- SvxFontWorkChildWindow ::RegisterChildWindow(sal_False, pMod);
- SvxHyperlinkDlgWrapper ::RegisterChildWindow(sal_False, pMod, SFX_CHILDWIN_FORCEDOCK);
- SvxIMapDlgChildWindow ::RegisterChildWindow(sal_False, pMod);
- GalleryChildWindow ::RegisterChildWindow(sal_False, pMod);
- ScSpellDialogChildWindow ::RegisterChildWindow(sal_False, pMod);
- ::avmedia::MediaPlayer ::RegisterChildWindow(sal_False, pMod);
-
- //<!--Added by PengYunQuan for Validity Cell Range Picker
- ScValidityRefChildWin::RegisterChildWindow(sal_False, pMod);
- //-->Added by PengYunQuan for Validity Cell Range Picker
+ ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod);
+ ScSimpleRefDlgWrapper ::RegisterChildWindow(false, pMod, SFX_CHILDWIN_ALWAYSAVAILABLE|SFX_CHILDWIN_NEVERHIDE );
+ ScHighlightChgDlgWrapper ::RegisterChildWindow(false, pMod);
+
+ SvxSearchDialogWrapper ::RegisterChildWindow(false, pMod);
+ SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
+ SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
+ SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
+ GalleryChildWindow ::RegisterChildWindow(false, pMod);
+ ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod);
+
+ ScValidityRefChildWin::RegisterChildWindow(false, pMod);
// Edit-Engine-Felder, soweit nicht schon in OfficeApplication::Init
SvClassManager& rClassManager = SvxFieldItem::GetClassManager();
-// rClassManager.SV_CLASS_REGISTER( SvxURLField );
-// rClassManager.SV_CLASS_REGISTER( SvxDateField );
-// rClassManager.SV_CLASS_REGISTER( SvxPageField );
rClassManager.SV_CLASS_REGISTER( SvxPagesField );
-// rClassManager.SV_CLASS_REGISTER( SvxTimeField );
rClassManager.SV_CLASS_REGISTER( SvxFileField );
-// rClassManager.SV_CLASS_REGISTER( SvxExtFileField );
rClassManager.SV_CLASS_REGISTER( SvxTableField );
SdrRegisterFieldClasses(); // SvDraw-Felder registrieren
@@ -361,5 +323,15 @@ void ScDLL::Exit()
// ScGlobal::Clear ist schon im Module-dtor
}
+//------------------------------------------------------------------
+// Statusbar
+//------------------------------------------------------------------
+
+#define TEXT_WIDTH(s) rStatusBar.GetTextWidth((s))
+
+#undef TEXT_WIDTH
+
// DetectFilter functionality has moved - please update your bookmarks
// see sc/source/ui/unoobj/scdetect.cxx, have a nice day.
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 2223a80e1763..41ba2db31cbe 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,6 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/objface.hxx>
-#include <svx/hyprlink.hxx>
#include "IAnyRefDialog.hxx"
#include <svtools/ehdl.hxx>
@@ -99,11 +99,7 @@
#include "anyrefdg.hxx"
#include "dwfunctr.hxx"
#include "formdata.hxx"
-//CHINA001 #include "tpview.hxx"
-//CHINA001 #include "tpusrlst.hxx"
-//CHINA001 #include "tpcalc.hxx"
#include "tpprint.hxx"
-//CHINA001 #include "opredlin.hxx"
#include "transobj.hxx"
#include "detfunc.hxx"
#include "preview.hxx"
@@ -114,7 +110,7 @@
#define ScModule
#include "scslots.hxx"
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
#define SC_IDLE_MIN 150
#define SC_IDLE_MAX 3000
@@ -130,13 +126,12 @@ SFX_IMPL_INTERFACE( ScModule, SfxShell, ScResId(RID_APPTITLE) )
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER,
ScResId(RID_OBJECTBAR_APP) );
SFX_STATUSBAR_REGISTRATION( ScResId(SCCFG_STATUSBAR) ); // nur ID wichtig
- SFX_CHILDWINDOW_REGISTRATION( SvxHyperlinkDlgWrapper::GetChildWindowId() );
}
//------------------------------------------------------------------
ScModule::ScModule( SfxObjectFactory* pFact ) :
- SfxModule( SfxApplication::CreateResManager( "sc" ), sal_False, pFact, NULL ),
+ SfxModule( SfxApplication::CreateResManager( "sc" ), false, pFact, NULL ),
pSelTransfer( NULL ),
pMessagePool( NULL ),
pRefInputHandler( NULL ),
@@ -155,9 +150,9 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
pSvxErrorHdl( NULL ),
pFormEditData( NULL ),
nCurRefDlgId( 0 ),
- bIsWaterCan( sal_False ),
- bIsInEditCommand( sal_False ),
- bIsInExecuteDrop( sal_False ),
+ bIsWaterCan( false ),
+ bIsInEditCommand( false ),
+ bIsInExecuteDrop( false ),
mbIsInSharedDocLoading( false ),
mbIsInSharedDocSaving( false )
{
@@ -469,7 +464,7 @@ void ScModule::Execute( SfxRequest& rReq )
{
ScAppOptions aNewOpts( GetAppOptions() );
sal_Bool bNew = !aNewOpts.GetDetectiveAuto();
- SFX_REQUEST_ARG( rReq, pAuto, SfxBoolItem, SID_DETECTIVE_AUTO, sal_False );
+ SFX_REQUEST_ARG( rReq, pAuto, SfxBoolItem, SID_DETECTIVE_AUTO, false );
if ( pAuto )
bNew = pAuto->GetValue();
@@ -562,7 +557,7 @@ void ScModule::Execute( SfxRequest& rReq )
{
try
{
- com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), com::sun::star::uno::UNO_QUERY);
+ com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), com::sun::star::uno::UNO_QUERY);
if( xDialog.is() )
{
xDialog->execute();
@@ -575,7 +570,7 @@ void ScModule::Execute( SfxRequest& rReq )
break;
default:
- DBG_ERROR( "ScApplication: Unknown Message." );
+ OSL_FAIL( "ScApplication: Unknown Message." );
break;
}
}
@@ -781,7 +776,7 @@ void ScModule::InsertEntryToLRUList(sal_uInt16 nFIndex)
sal_uInt16 aIdxList[LRU_MAX];
sal_uInt16 n = 0;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
while ((n < LRU_MAX) && n<nLRUFuncCount) // alte Liste abklappern
{
@@ -977,13 +972,12 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : NULL;
const SfxPoolItem* pItem = NULL;
- sal_Bool bRepaint = sal_False;
- sal_Bool bUpdateMarks = sal_False;
- sal_Bool bUpdateRefDev = sal_False;
- sal_Bool bCalcAll = sal_False;
- sal_Bool bSaveSpellCheck = sal_False;
- sal_Bool bSaveAppOptions = sal_False;
- sal_Bool bSaveInputOptions = sal_False;
+ sal_Bool bRepaint = false;
+ sal_Bool bUpdateMarks = false;
+ sal_Bool bUpdateRefDev = false;
+ sal_Bool bCalcAll = false;
+ sal_Bool bSaveAppOptions = false;
+ sal_Bool bSaveInputOptions = false;
//--------------------------------------------------------------------------
@@ -1087,6 +1081,10 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
if ( pDoc )
{
const ScDocOptions& rOldOpt = pDoc->GetDocOptions();
+ ScOptionsUtil::KeyBindingType eKeyOld = rOldOpt.GetKeyBindingType();
+ ScOptionsUtil::KeyBindingType eKeyNew = rNewOpt.GetKeyBindingType();
+ if (eKeyOld != eKeyNew)
+ pDocSh->ResetKeyBindings(eKeyNew);
bRepaint = ( bRepaint || ( rOldOpt != rNewOpt ) );
bCalcAll = bRepaint &&
@@ -1157,10 +1155,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
}
if ( bOldAutoSpell != bDoAutoSpell )
- {
SetAutoSpellProperty( bDoAutoSpell );
- bSaveSpellCheck = sal_True;
- }
if ( pDocSh )
pDocSh->PostPaintGridAll(); // wegen Markierungen
ScInputHandler* pInputHandler = GetInputHdl();
@@ -1244,12 +1239,6 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
//----------------------------------------------------------
-// if ( bSaveSpellCheck )
-// {
- // currently LinguProperties are saved only at program exit.
- // if a save method becomes available, it should be called here.
-// }
-
if ( bSaveAppOptions )
pAppCfg->OptionsChanged();
@@ -1323,7 +1312,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// update view scale
ScViewData* pViewData = pOneViewSh->GetViewData();
- pOneViewSh->SetZoom( pViewData->GetZoomX(), pViewData->GetZoomY(), sal_False );
+ pOneViewSh->SetZoom( pViewData->GetZoomX(), pViewData->GetZoomY(), false );
// repaint
pOneViewSh->PaintGrid();
@@ -1362,7 +1351,7 @@ ScInputHandler* ScModule::GetInputHdl( ScTabViewShell* pViewSh, sal_Bool bUseRef
if ( pViewSh )
pHdl = pViewSh->GetInputHandler(); // Viewshell hat jetzt immer einen
- // #57989# wenn keine ViewShell uebergeben oder aktiv, kann NULL herauskommen
+ // wenn keine ViewShell uebergeben oder aktiv, kann NULL herauskommen
DBG_ASSERT( pHdl || !pViewSh, "GetInputHdl: kein InputHandler gefunden" );
return pHdl;
}
@@ -1397,7 +1386,7 @@ sal_Bool ScModule::IsInputMode()
sal_Bool ScModule::InputKeyEvent( const KeyEvent& rKEvt, sal_Bool bStartEdit )
{
ScInputHandler* pHdl = GetInputHdl();
- return ( pHdl ? pHdl->KeyInput( rKEvt, bStartEdit ) : sal_False );
+ return ( pHdl ? pHdl->KeyInput( rKEvt, bStartEdit ) : false );
}
void ScModule::InputEnterHandler( sal_uInt8 nBlockMode )
@@ -1492,7 +1481,7 @@ void ScModule::ActivateInputWindow( const String* pStrFormula, sal_Bool bMatrix
// Formel uebernehmen
if ( pWin )
{
- pWin->SetFuncString( *pStrFormula, sal_False );
+ pWin->SetFuncString( *pStrFormula, false );
// SetSumAssignMode wegen sal_False nicht noetig
}
sal_uInt8 nMode = bMatrix ? SC_ENTER_MATRIX : SC_ENTER_NORMAL;
@@ -1507,7 +1496,7 @@ void ScModule::ActivateInputWindow( const String* pStrFormula, sal_Bool bMatrix
// Abbrechen
if ( pWin )
{
- pWin->SetFuncString( EMPTY_STRING, sal_False );
+ pWin->SetFuncString( EMPTY_STRING, false );
// SetSumAssignMode wegen sal_False nicht noetig
}
pHdl->CancelHandler();
@@ -1531,7 +1520,7 @@ void ScModule::SetRefDialog( sal_uInt16 nId, sal_Bool bVis, SfxViewFrame* pViewF
if ( !pViewFrm )
pViewFrm = SfxViewFrame::Current();
- // #79379# bindings update causes problems with update of stylist if
+ // bindings update causes problems with update of stylist if
// current style family has changed
//if ( pViewFrm )
// pViewFrm->GetBindings().Update(); // to avoid trouble in LockDispatcher
@@ -1547,7 +1536,7 @@ void ScModule::SetRefDialog( sal_uInt16 nId, sal_Bool bVis, SfxViewFrame* pViewF
else
{
// no ScTabViewShell - possible for example from a Basic macro
- bVis = sal_False;
+ bVis = false;
nCurRefDlgId = 0; // don't set nCurRefDlgId if no dialog is created
}
@@ -1590,7 +1579,7 @@ sal_Bool ScModule::IsModalMode(SfxObjectShell* pDocSh)
//! move reference dialog handling to view
//! (only keep function autopilot here for references to other documents)
- sal_Bool bIsModal = sal_False;
+ sal_Bool bIsModal = false;
if ( nCurRefDlgId )
{
@@ -1627,7 +1616,7 @@ sal_Bool ScModule::IsTableLocked()
//! move reference dialog handling to view
//! (only keep function autopilot here for references to other documents)
- sal_Bool bLocked = sal_False;
+ sal_Bool bLocked = false;
// bisher nur bei ScAnyRefDlg
@@ -1648,7 +1637,7 @@ sal_Bool ScModule::IsRefDialogOpen()
//! move reference dialog handling to view
//! (only keep function autopilot here for references to other documents)
- sal_Bool bIsOpen = sal_False;
+ sal_Bool bIsOpen = false;
if ( nCurRefDlgId )
{
@@ -1667,7 +1656,7 @@ sal_Bool ScModule::IsFormulaMode()
//! move reference dialog handling to view
//! (only keep function autopilot here for references to other documents)
- sal_Bool bIsFormula = sal_False;
+ sal_Bool bIsFormula = false;
if ( nCurRefDlgId )
{
@@ -1702,7 +1691,7 @@ void lcl_MarkedTabs( const ScMarkData& rMark, SCTAB& rStartTab, SCTAB& rEndTab )
if (bFirst)
rStartTab = i;
rEndTab = i;
- bFirst = sal_False;
+ bFirst = false;
}
}
}
@@ -1738,7 +1727,7 @@ void ScModule::SetReference( const ScRange& rRef, ScDocument* pDoc,
// hide the (color) selection now instead of later from LoseFocus,
// don't abort the ref input that causes this call (bDoneRefMode = sal_False)
- pRefDlg->HideReference( sal_False );
+ pRefDlg->HideReference( false );
pRefDlg->SetReference( aNew, pDoc );
}
}
@@ -1749,7 +1738,7 @@ void ScModule::SetReference( const ScRange& rRef, ScDocument* pDoc,
pHdl->SetReference( aNew, pDoc );
else
{
- DBG_ERROR("SetReference ohne Empfaenger");
+ OSL_FAIL("SetReference ohne Empfaenger");
}
}
}
@@ -1834,7 +1823,7 @@ IMPL_LINK( ScModule, IdleHandler, Timer*, EMPTYARG )
return 0;
}
- sal_Bool bMore = sal_False;
+ sal_Bool bMore = false;
ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
if ( pDocSh )
{
@@ -1848,7 +1837,7 @@ IMPL_LINK( ScModule, IdleHandler, Timer*, EMPTYARG )
bMore = bLinks || bWidth || bSpell; // ueberhaupt noch was?
- // While calculating a Basic formula, a paint event may have occured,
+ // While calculating a Basic formula, a paint event may have occurred,
// so check the bNeedsRepaint flags for this document's views
if (bWidth)
lcl_CheckNeedsRepaint( pDocSh );
@@ -2005,12 +1994,11 @@ SfxTabPage* ScModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const Sfx
{
SfxTabPage* pRet = NULL;
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
switch(nId)
{
case SID_SC_TP_LAYOUT:
{
- //CHINA001 pRet = ScTpLayoutOptions::Create(pParent, rSet);
::CreateTabPage ScTpLayoutOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_LAYOUT );
if ( ScTpLayoutOptionsCreate )
pRet = (*ScTpLayoutOptionsCreate) (pParent, rSet);
@@ -2018,7 +2006,6 @@ SfxTabPage* ScModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const Sfx
break;
case SID_SC_TP_CONTENT:
{
- //CHINA001 pRet = ScTpContentOptions::Create(pParent, rSet);
::CreateTabPage ScTpContentOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SCPAGE_CONTENT);
if ( ScTpContentOptionsCreate )
pRet = (*ScTpContentOptionsCreate)(pParent, rSet);
@@ -2027,28 +2014,41 @@ SfxTabPage* ScModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const Sfx
case SID_SC_TP_GRID: pRet = SvxGridTabPage::Create(pParent, rSet); break;
case SID_SC_TP_USERLISTS:
{
- //CHINA001 pRet = ScTpUserLists::Create(pParent, rSet);
::CreateTabPage ScTpUserListsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_USERLISTS );
if ( ScTpUserListsCreate )
pRet = (*ScTpUserListsCreate)( pParent, rSet);
}
break;
case SID_SC_TP_CALC:
- { //CHINA001 pRet = ScTpCalcOptions::Create(pParent, rSet);
+ {
::CreateTabPage ScTpCalcOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_CALC );
if ( ScTpCalcOptionsCreate )
pRet = (*ScTpCalcOptionsCreate)(pParent, rSet);
}
break;
+ case SID_SC_TP_FORMULA:
+ {
+ ::CreateTabPage ScTpFormulaOptionsCreate = pFact->GetTabPageCreatorFunc (RID_SCPAGE_FORMULA);
+ if (ScTpFormulaOptionsCreate)
+ pRet = (*ScTpFormulaOptionsCreate)(pParent, rSet);
+ }
+ break;
+ case SID_SC_TP_COMPATIBILITY:
+ {
+ ::CreateTabPage ScTpCompatOptionsCreate = pFact->GetTabPageCreatorFunc (RID_SCPAGE_COMPATIBILITY);
+ if (ScTpCompatOptionsCreate)
+ pRet = (*ScTpCompatOptionsCreate)(pParent, rSet);
+ }
+ break;
case SID_SC_TP_CHANGES:
- { //CHINA001 pRet = ScRedlineOptionsTabPage::Create(pParent, rSet);
+ {
::CreateTabPage ScRedlineOptionsTabPageCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_OPREDLINE );
if ( ScRedlineOptionsTabPageCreate )
pRet =(*ScRedlineOptionsTabPageCreate)(pParent, rSet);
}
break;
case RID_SC_TP_PRINT:
- {//CHINA001 pRet = ScTpPrintOptions::Create(pParent, rSet);
+ {
::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT );
if ( ScTpPrintOptionsCreate )
pRet = (*ScTpPrintOptionsCreate)( pParent, rSet);
@@ -2113,7 +2113,7 @@ IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo )
}
else
{
- DBG_ERROR("unbekannter Feldbefehl");
+ OSL_FAIL("unbekannter Feldbefehl");
pInfo->SetRepresentation(String('?'));
}
}
@@ -2131,7 +2131,7 @@ sal_Bool ScModule::RegisterRefWindow( sal_uInt16 nSlotId, Window *pWnd )
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScModule::UnregisterRefWindow( sal_uInt16 nSlotId, Window *pWnd )
@@ -2139,14 +2139,14 @@ sal_Bool ScModule::UnregisterRefWindow( sal_uInt16 nSlotId, Window *pWnd )
std::map<sal_uInt16, std::list<Window*> >::iterator iSlot = m_mapRefWindow.find( nSlotId );
if( iSlot == m_mapRefWindow.end() )
- return sal_False;
+ return false;
std::list<Window*> & rlRefWindow = iSlot->second;
std::list<Window*>::iterator i = std::find( rlRefWindow.begin(), rlRefWindow.end(), pWnd );
if( i == rlRefWindow.end() )
- return sal_False;
+ return false;
rlRefWindow.erase( i );
@@ -2161,7 +2161,7 @@ sal_Bool ScModule::IsAliveRefDlg( sal_uInt16 nSlotId, Window *pWnd )
std::map<sal_uInt16, std::list<Window*> >::iterator iSlot = m_mapRefWindow.find( nSlotId );
if( iSlot == m_mapRefWindow.end() )
- return sal_False;
+ return false;
std::list<Window*> & rlRefWindow = iSlot->second;
@@ -2182,7 +2182,7 @@ Window * ScModule::Find1RefWindow( sal_uInt16 nSlotId, Window *pWndAncestor )
while( Window *pParent = pWndAncestor->GetParent() ) pWndAncestor = pParent;
- for( std::list<Window*>::iterator i = rlRefWindow.begin(); i!=rlRefWindow.end(); i++ )
+ for( std::list<Window*>::iterator i = rlRefWindow.begin(); i!=rlRefWindow.end(); ++i )
if ( pWndAncestor->IsWindowOrChild( *i, (*i)->IsSystemWindow() ) )
return *i;
@@ -2197,11 +2197,12 @@ Window * ScModule::Find1RefWindow( Window *pWndAncestor )
while( Window *pParent = pWndAncestor->GetParent() ) pWndAncestor = pParent;
for( std::map<sal_uInt16, std::list<Window*> >::iterator i = m_mapRefWindow.begin();
- i!=m_mapRefWindow.end(); i++ )
- for( std::list<Window*>::iterator j = i->second.begin(); j!=i->second.end(); j++ )
+ i!=m_mapRefWindow.end(); ++i )
+ for( std::list<Window*>::iterator j = i->second.begin(); j!=i->second.end(); ++j )
if ( pWndAncestor->IsWindowOrChild( *j, (*j)->IsSystemWindow() ) )
return *j;
return NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scmod2.cxx b/sc/source/ui/app/scmod2.cxx
index 9ac668b9d4a3..eaa2aa9aa237 100644
--- a/sc/source/ui/app/scmod2.cxx
+++ b/sc/source/ui/app/scmod2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,7 +50,6 @@ using namespace com::sun::star;
//------------------------------------------------------------------
-// static
void ScModule::GetSpellSettings( sal_uInt16& rDefLang, sal_uInt16& rCjkLang, sal_uInt16& rCtlLang,
sal_Bool& rAutoSpell )
{
@@ -66,7 +66,6 @@ void ScModule::GetSpellSettings( sal_uInt16& rDefLang, sal_uInt16& rCjkLang, sal
rAutoSpell = aOptions.bIsSpellAuto;
}
-// static
void ScModule::SetAutoSpellProperty( sal_Bool bSet )
{
// use SvtLinguConfig instead of service LinguProperties to avoid
@@ -75,21 +74,20 @@ void ScModule::SetAutoSpellProperty( sal_Bool bSet )
uno::Any aAny;
aAny <<= bSet;
- aConfig.SetProperty( rtl::OUString::createFromAscii( LINGUPROP_AUTOSPELL ), aAny );
+ aConfig.SetProperty( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( LINGUPROP_AUTOSPELL )), aAny );
}
-// static
sal_Bool ScModule::HasThesaurusLanguage( sal_uInt16 nLang )
{
if ( nLang == LANGUAGE_NONE )
- return sal_False;
+ return false;
lang::Locale aLocale;
SvxLanguageToLocale( aLocale, nLang );
- sal_Bool bHasLang = sal_False;
+ sal_Bool bHasLang = false;
try
{
uno::Reference< linguistic2::XThesaurus > xThes(LinguMgr::GetThesaurus());
@@ -98,10 +96,11 @@ sal_Bool ScModule::HasThesaurusLanguage( sal_uInt16 nLang )
}
catch( uno::Exception& )
{
- DBG_ERROR("Error in Thesaurus");
+ OSL_FAIL("Error in Thesaurus");
}
return bHasLang;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index f6872ef38f09..7e9cbd9621a2 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@ using namespace com::sun::star;
sal_Bool lcl_IsURLButton( SdrObject* pObject )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObject);
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
@@ -69,7 +70,7 @@ sal_Bool lcl_IsURLButton( SdrObject* pObject )
uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
- rtl::OUString sPropButtonType = rtl::OUString::createFromAscii( "ButtonType" );
+ rtl::OUString sPropButtonType(RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ));
if(xInfo->hasPropertyByName( sPropButtonType ))
{
uno::Any aAny = xPropSet->getPropertyValue( sPropButtonType );
@@ -83,7 +84,6 @@ sal_Bool lcl_IsURLButton( SdrObject* pObject )
return bRet;
}
-// static
ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView )
{
@@ -180,7 +180,7 @@ sal_Bool ScSelectionTransferObj::StillValid()
{
//! check if view still has same cell selection
//! (but return sal_False if data has changed inbetween)
- return sal_False;
+ return false;
}
void ScSelectionTransferObj::ForgetView()
@@ -299,7 +299,7 @@ void ScSelectionTransferObj::CreateCellData()
// bApi = sal_True -> no error mesages
// #i18364# bStopEdit = sal_False -> don't end edit mode
// (this may be called from pasting into the edit line)
- sal_Bool bCopied = pViewData->GetView()->CopyToClip( pClipDoc, sal_False, sal_True, sal_True, sal_False );
+ sal_Bool bCopied = pViewData->GetView()->CopyToClip( pClipDoc, false, sal_True, sal_True, false );
ScDrawLayer::SetGlobalDrawPersist(NULL);
@@ -401,7 +401,7 @@ ScDrawTransferObj* ScSelectionTransferObj::GetDrawData()
sal_Bool ScSelectionTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
{
- sal_Bool bOK = sal_False;
+ sal_Bool bOK = false;
uno::Reference<datatransfer::XTransferable> xSource;
switch (eMode)
@@ -447,3 +447,4 @@ void ScSelectionTransferObj::ObjectReleased()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/template.cxx b/sc/source/ui/app/template.cxx
index 806ea0bc61dd..c613bf9cd41a 100644
--- a/sc/source/ui/app/template.cxx
+++ b/sc/source/ui/app/template.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,7 @@ ScTemplateDlg::ScTemplateDlg(Window * pParent, sal_uInt16 nAppResource) :
//------------------------------------------------------------------------
-__EXPORT ScTemplateDlg::~ScTemplateDlg()
+ScTemplateDlg::~ScTemplateDlg()
{
}
@@ -77,3 +78,4 @@ void ScTemplateDlg::ToggleApplyTemplate()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 1f9d0d4986bc..b584c7e86f7c 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -45,7 +47,7 @@
#include <sot/storage.hxx>
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfile.hxx>
@@ -83,7 +85,6 @@ using namespace com::sun::star;
// -----------------------------------------------------------------------
-// static
void ScTransferObj::GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCROW& nRow, SCCOL& nCol )
{
SCCOL nMaxCol = 0;
@@ -105,7 +106,6 @@ void ScTransferObj::GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCR
nCol = nMaxCol;
}
-// static
void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPrintFactor,
const ScRange& rBlock, sal_Bool bMetaFile )
{
@@ -133,8 +133,8 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc
nDragHandleX( 0 ),
nDragHandleY( 0 ),
nDragSourceFlags( 0 ),
- bDragWasInternal( sal_False ),
- bUsedForLink( sal_False ),
+ bDragWasInternal( false ),
+ bUsedForLink( false ),
bUseInApi( false )
{
DBG_ASSERT(pDoc->IsClipboard(), "wrong document");
@@ -153,7 +153,7 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc
nRow2 = sal::static_int_cast<SCROW>( nRow2 + nRow1 );
SCCOL nDummy;
- pDoc->GetClipArea( nDummy, nNonFiltered, sal_False );
+ pDoc->GetClipArea( nDummy, nNonFiltered, false );
bHasFiltered = (nNonFiltered < (nRow2 - nRow1));
++nNonFiltered; // to get count instead of diff
@@ -166,7 +166,7 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc
if (bFirst)
nTab1 = i;
nTab2 = i;
- bFirst = sal_False;
+ bFirst = false;
}
DBG_ASSERT(!bFirst, "no sheet selected");
@@ -193,17 +193,17 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc
ScTransferObj::~ScTransferObj()
{
- Application::GetSolarMutex().acquire();
+ SolarMutexGuard aSolarGuard;
ScModule* pScMod = SC_MOD();
if ( pScMod->GetClipData().pCellClipboard == this )
{
- DBG_ERROR("ScTransferObj wasn't released");
+ OSL_FAIL("ScTransferObj wasn't released");
pScMod->SetClipObject( NULL, NULL );
}
if ( pScMod->GetDragData().pCellTransfer == this )
{
- DBG_ERROR("ScTransferObj wasn't released");
+ OSL_FAIL("ScTransferObj wasn't released");
pScMod->ResetDragObject();
}
@@ -213,10 +213,8 @@ ScTransferObj::~ScTransferObj()
aDrawPersistRef.Clear(); // after the model
- Application::GetSolarMutex().release();
}
-// static
ScTransferObj* ScTransferObj::GetOwnClipboard( Window* pUIWin )
{
ScTransferObj* pObj = SC_MOD()->GetClipData().pCellClipboard;
@@ -231,7 +229,7 @@ ScTransferObj* ScTransferObj::GetOwnClipboard( Window* pUIWin )
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pUIWin ) );
if ( !aDataHelper.HasFormat( SOT_FORMATSTR_ID_DIF ) )
{
-// DBG_ERROR("ScTransferObj wasn't released");
+// OSL_FAIL("ScTransferObj wasn't released");
pObj = NULL;
}
}
@@ -260,7 +258,7 @@ void ScTransferObj::AddSupportedFormats()
sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
- sal_Bool bOK = sal_False;
+ sal_Bool bOK = false;
if( HasFormat( nFormat ) )
{
@@ -311,8 +309,15 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
sal_Bool bIncludeFiltered = pDoc->IsCutMode() || bUsedForLink;
ScImportExport aObj( pDoc, aBlock );
+ ScExportTextOptions aTextOptions(ScExportTextOptions::None, 0, true);
if ( bUsedForLink )
- aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, ' ', false ) );
+ {
+ // For a DDE link, convert line breaks and separators to space.
+ aTextOptions.meNewlineConversion = ScExportTextOptions::ToSpace;
+ aTextOptions.mcSeparatorConvertTo = ' ';
+ aTextOptions.mbAddQuotes = false;
+ }
+ aObj.SetExportTextOptions(aTextOptions);
aObj.SetFormulas( pDoc->GetViewOptions().GetOption( VOPT_FORMULAS ) );
aObj.SetIncludeFiltered( bIncludeFiltered );
@@ -331,7 +336,7 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
}
else
{
- DBG_ERROR("unknown DataType");
+ OSL_FAIL("unknown DataType");
}
}
else if ( nFormat == SOT_FORMAT_BITMAP )
@@ -342,7 +347,7 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
VirtualDevice aVirtDev;
aVirtDev.SetOutputSizePixel( aVirtDev.LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
- PaintToDev( &aVirtDev, pDoc, 1.0, aBlock, sal_False );
+ PaintToDev( &aVirtDev, pDoc, 1.0, aBlock, false );
aVirtDev.SetMapMode( MapMode( MAP_PIXEL ) );
Bitmap aBmp = aVirtDev.GetBitmap( Point(), aVirtDev.GetOutputSize() );
@@ -360,7 +365,7 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
MapMode aMapMode( pEmbObj->GetMapUnit() );
Rectangle aVisArea( pEmbObj->GetVisArea( ASPECT_CONTENT ) );
- aVDev.EnableOutput( sal_False );
+ aVDev.EnableOutput( false );
aVDev.SetMapMode( aMapMode );
aMtf.SetPrefSize( aVisArea.GetSize() );
aMtf.SetPrefMapMode( aMapMode );
@@ -390,7 +395,7 @@ sal_Bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj
{
// called from SetObject, put data into stream
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
switch (nUserObjectId)
{
case SCTRANS_TYPE_IMPEX:
@@ -415,7 +420,7 @@ sal_Bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj
}
else
{
- // #107722# can't use Write for EditEngine format because that would
+ // can't use Write for EditEngine format because that would
// write old format without support for unicode characters.
// Get the data from the EditEngine's transferable instead.
@@ -442,11 +447,11 @@ sal_Bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj
::comphelper::OStorageHelper::GetStorageFromURL( aTempFile.GetURL(), embed::ElementModes::READWRITE );
// write document storage
- pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, sal_False );
+ pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, false );
// mba: no relative ULRs for clipboard!
SfxMedium aMedium( xWorkStore, String() );
- bRet = pEmbObj->DoSaveObjectAs( aMedium, sal_False );
+ bRet = pEmbObj->DoSaveObjectAs( aMedium, false );
pEmbObj->DoSaveCompleted();
uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY );
@@ -470,7 +475,7 @@ sal_Bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj
break;
default:
- DBG_ERROR("unknown object id");
+ OSL_FAIL("unknown object id");
}
return bRet;
}
@@ -494,8 +499,8 @@ void ScTransferObj::DragFinished( sal_Int8 nDropAction )
{
ScMarkData aMarkData = GetSourceMarkData();
// external drag&drop doesn't copy objects, so they also aren't deleted:
- // #105703# bApi=sal_True, don't show error messages from drag&drop
- pSourceSh->GetDocFunc().DeleteContents( aMarkData, IDF_ALL & ~IDF_OBJECTS, sal_True, sal_True );
+ // bApi=TRUE, don't show error messages from drag&drop
+ pSourceSh->GetDocFunc().DeleteContents( aMarkData, IDF_ALL & ~IDF_OBJECTS, true, true );
}
}
@@ -527,7 +532,7 @@ void ScTransferObj::SetDrawPersist( const SfxObjectShellRef& rRef )
void ScTransferObj::SetDragSource( ScDocShell* pSourceShell, const ScMarkData& rMark )
{
ScRangeList aRanges;
- rMark.FillRangeListWithMarks( &aRanges, sal_False );
+ rMark.FillRangeListWithMarks( &aRanges, false );
xDragSourceRanges = new ScCellRangesObj( pSourceShell, aRanges );
}
@@ -570,7 +575,7 @@ ScMarkData ScTransferObj::GetSourceMarkData()
if (pRangesObj)
{
const ScRangeList& rRanges = pRangesObj->GetRangeList();
- aMarkData.MarkFromRangeList( rRanges, sal_False );
+ aMarkData.MarkFromRangeList( rRanges, false );
}
return aMarkData;
}
@@ -596,7 +601,7 @@ void ScTransferObj::InitDocShell()
String aTabName;
pDoc->GetName( aBlock.aStart.Tab(), aTabName );
- pDestDoc->RenameTab( 0, aTabName, sal_False ); // no UpdateRef (empty)
+ pDestDoc->RenameTab( 0, aTabName, false ); // no UpdateRef (empty)
pDestDoc->CopyStdStylesFrom( pDoc );
@@ -608,12 +613,12 @@ void ScTransferObj::InitDocShell()
// widths / heights
// (must be copied before CopyFromClip, for drawing objects)
- SCCOL nCol, nLastCol;
+ SCCOL nCol;
SCTAB nSrcTab = aBlock.aStart.Tab();
pDestDoc->SetLayoutRTL(0, pDoc->IsLayoutRTL(nSrcTab));
for (nCol=nStartX; nCol<=nEndX; nCol++)
- if ( pDoc->ColHidden(nCol, nSrcTab, nLastCol) )
- pDestDoc->ShowCol( nCol, 0, sal_False );
+ if ( pDoc->ColHidden(nCol, nSrcTab) )
+ pDestDoc->ShowCol( nCol, 0, false );
else
pDestDoc->SetColWidth( nCol, 0, pDoc->GetColWidth( nCol, nSrcTab ) );
@@ -623,9 +628,8 @@ void ScTransferObj::InitDocShell()
for (SCROW nRow = nStartY; nRow <= nEndY; ++nRow)
{
sal_uInt8 nSourceFlags = pDoc->GetRowFlags(nRow, nSrcTab);
- SCROW nLastRow = -1;
- if ( pDoc->RowHidden(nRow, nSrcTab, nLastRow) )
- pDestDoc->ShowRow( nRow, 0, sal_False );
+ if ( pDoc->RowHidden(nRow, nSrcTab) )
+ pDestDoc->ShowRow( nRow, 0, false );
else
{
pDestDoc->SetRowHeight( nRow, 0, pDoc->GetOriginalHeight( nRow, nSrcTab ) );
@@ -647,7 +651,7 @@ void ScTransferObj::InitDocShell()
sal_Bool bWasCut = pDoc->IsCutMode();
if (!bWasCut)
pDoc->SetClipArea( aDestRange, sal_True ); // Cut
- pDestDoc->CopyFromClip( aDestRange, aDestMark, IDF_ALL, NULL, pDoc, sal_False );
+ pDestDoc->CopyFromClip( aDestRange, aDestMark, IDF_ALL, NULL, pDoc, false );
pDoc->SetClipArea( aDestRange, bWasCut );
StripRefs( pDoc, nStartX,nStartY, nEndX,nEndY, pDestDoc, 0,0 );
@@ -730,7 +734,6 @@ void ScTransferObj::InitDocShell()
}
}
-// static
SfxObjectShell* ScTransferObj::SetDrawClipDoc( sal_Bool bAnyOle )
{
// update ScGlobal::pDrawClipDocShellRef
@@ -750,7 +753,6 @@ SfxObjectShell* ScTransferObj::SetDrawClipDoc( sal_Bool bAnyOle )
}
}
-// static
void ScTransferObj::StripRefs( ScDocument* pDoc,
SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY,
ScDocument* pDestDoc, SCCOL nSubX, SCROW nSubY )
@@ -772,7 +774,7 @@ void ScTransferObj::StripRefs( ScDocument* pDoc,
if (!pDoc->HasTable(nSrcTab) || !pDestDoc->HasTable(nDestTab))
{
- DBG_ERROR("Sheet not found in ScTransferObj::StripRefs");
+ OSL_FAIL("Sheet not found in ScTransferObj::StripRefs");
return;
}
@@ -786,7 +788,7 @@ void ScTransferObj::StripRefs( ScDocument* pDoc,
if (pCell->GetCellType() == CELLTYPE_FORMULA)
{
ScFormulaCell* pFCell = (ScFormulaCell*) pCell;
- sal_Bool bOut = sal_False;
+ sal_Bool bOut = false;
ScDetectiveRefIter aRefIter( pFCell );
while ( !bOut && aRefIter.GetNextRef( aRef ) )
{
@@ -871,3 +873,4 @@ sal_Int64 SAL_CALL ScTransferObj::getSomething( const com::sun::star::uno::Seque
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx
index 4450c00db807..10c35fde833f 100644
--- a/sc/source/ui/app/typemap.cxx
+++ b/sc/source/ui/app/typemap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,6 +106,7 @@
#include <svx/xftshxy.hxx>
#include <svx/xftsfit.hxx>
#include <editeng/langitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/grafctrl.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/shaditem.hxx>
@@ -133,3 +135,5 @@
#define SFX_TYPEMAP
#include "scslots.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx
index 75a21a5a7700..d01efc5ee730 100644
--- a/sc/source/ui/app/uiitems.cxx
+++ b/sc/source/ui/app/uiitems.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,22 +58,6 @@ TYPEINIT1(ScIndexHint, SfxHint);
// ScInputStatusItem - Status-Update fuer Eingabezeile
// -----------------------------------------------------------------------
-//UNUSED2008-05 ScInputStatusItem::ScInputStatusItem( sal_uInt16 nWhichP,
-//UNUSED2008-05 SCTAB nTab,
-//UNUSED2008-05 SCCOL nCol, SCROW nRow,
-//UNUSED2008-05 SCCOL nStartCol, SCROW nStartRow,
-//UNUSED2008-05 SCCOL nEndCol, SCROW nEndRow,
-//UNUSED2008-05 const String& rString, const EditTextObject* pData )
-//UNUSED2008-05
-//UNUSED2008-05 : SfxPoolItem ( nWhichP ),
-//UNUSED2008-05 aCursorPos ( nCol, nRow, nTab ),
-//UNUSED2008-05 aStartPos ( nStartCol, nStartRow, nTab ),
-//UNUSED2008-05 aEndPos ( nEndCol, nEndRow, nTab ),
-//UNUSED2008-05 aString ( rString ),
-//UNUSED2008-05 pEditData ( pData ? pData->Clone() : NULL )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
ScInputStatusItem::ScInputStatusItem( sal_uInt16 nWhichP,
const ScAddress& rCurPos,
const ScAddress& rStartPos,
@@ -98,17 +83,17 @@ ScInputStatusItem::ScInputStatusItem( const ScInputStatusItem& rItem )
{
}
-__EXPORT ScInputStatusItem::~ScInputStatusItem()
+ScInputStatusItem::~ScInputStatusItem()
{
delete pEditData;
}
-String __EXPORT ScInputStatusItem::GetValueText() const
+String ScInputStatusItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("InputStatus"));
}
-int __EXPORT ScInputStatusItem::operator==( const SfxPoolItem& rItem ) const
+int ScInputStatusItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -119,7 +104,7 @@ int __EXPORT ScInputStatusItem::operator==( const SfxPoolItem& rItem ) const
//! Edit-Daten vergleichen!
}
-SfxPoolItem* __EXPORT ScInputStatusItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScInputStatusItem::Clone( SfxItemPool * ) const
{
return new ScInputStatusItem( *this );
}
@@ -205,20 +190,20 @@ ScSortItem::ScSortItem( const ScSortItem& rItem ) :
{
}
-__EXPORT ScSortItem::~ScSortItem()
+ScSortItem::~ScSortItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScSortItem::GetValueText() const
+String ScSortItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("SortItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScSortItem::operator==( const SfxPoolItem& rItem ) const
+int ScSortItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -230,18 +215,18 @@ int __EXPORT ScSortItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScSortItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScSortItem::Clone( SfxItemPool * ) const
{
return new ScSortItem( *this );
}
//------------------------------------------------------------------------
-sal_Bool ScSortItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /* nMemberUd */ ) const
+bool ScSortItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /* nMemberUd */ ) const
{
// Return empty value as there is no useful conversion
rVal = com::sun::star::uno::Any();
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
@@ -253,7 +238,7 @@ ScQueryItem::ScQueryItem( sal_uInt16 nWhichP,
const ScQueryParam* pQueryData ) :
SfxPoolItem ( nWhichP ),
pViewData ( ptrViewData ),
- bIsAdvanced ( sal_False )
+ bIsAdvanced ( false )
{
if ( pQueryData ) theQueryData = *pQueryData;
}
@@ -264,7 +249,7 @@ ScQueryItem::ScQueryItem( sal_uInt16 nWhichP,
const ScQueryParam* pQueryData ) :
SfxPoolItem ( nWhichP ),
pViewData ( NULL ),
- bIsAdvanced ( sal_False )
+ bIsAdvanced ( false )
{
if ( pQueryData ) theQueryData = *pQueryData;
}
@@ -280,7 +265,7 @@ ScQueryItem::ScQueryItem( const ScQueryItem& rItem ) :
{
}
-__EXPORT ScQueryItem::~ScQueryItem()
+ScQueryItem::~ScQueryItem()
{
}
@@ -294,7 +279,7 @@ void ScQueryItem::SetAdvancedQuerySource(const ScRange* pSource)
bIsAdvanced = sal_True;
}
else
- bIsAdvanced = sal_False;
+ bIsAdvanced = false;
}
sal_Bool ScQueryItem::GetAdvancedQuerySource(ScRange& rSource) const
@@ -305,14 +290,14 @@ sal_Bool ScQueryItem::GetAdvancedQuerySource(ScRange& rSource) const
//------------------------------------------------------------------------
-String __EXPORT ScQueryItem::GetValueText() const
+String ScQueryItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("QueryItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScQueryItem::operator==( const SfxPoolItem& rItem ) const
+int ScQueryItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -326,7 +311,7 @@ int __EXPORT ScQueryItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScQueryItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScQueryItem::Clone( SfxItemPool * ) const
{
return new ScQueryItem( *this );
}
@@ -363,20 +348,20 @@ ScSubTotalItem::ScSubTotalItem( const ScSubTotalItem& rItem ) :
{
}
-__EXPORT ScSubTotalItem::~ScSubTotalItem()
+ScSubTotalItem::~ScSubTotalItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScSubTotalItem::GetValueText() const
+String ScSubTotalItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("SubTotalItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScSubTotalItem::operator==( const SfxPoolItem& rItem ) const
+int ScSubTotalItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -388,18 +373,18 @@ int __EXPORT ScSubTotalItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScSubTotalItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScSubTotalItem::Clone( SfxItemPool * ) const
{
return new ScSubTotalItem( *this );
}
//------------------------------------------------------------------------
-sal_Bool ScSubTotalItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /* nMemberUd */ ) const
+bool ScSubTotalItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /* nMemberUd */ ) const
{
// Return empty value as there is no useful conversion
rVal = com::sun::star::uno::Any();
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
@@ -423,26 +408,26 @@ ScUserListItem::ScUserListItem( const ScUserListItem& rItem )
pUserList = NULL;
}
-__EXPORT ScUserListItem::~ScUserListItem()
+ScUserListItem::~ScUserListItem()
{
delete pUserList;
}
//------------------------------------------------------------------------
-String __EXPORT ScUserListItem::GetValueText() const
+String ScUserListItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScUserListItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScUserListItem::operator==( const SfxPoolItem& rItem ) const
+int ScUserListItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
const ScUserListItem& r = (const ScUserListItem&)rItem;
- sal_Bool bEqual = sal_False;
+ sal_Bool bEqual = false;
if ( !pUserList || !(r.pUserList) )
bEqual = ( !pUserList && !(r.pUserList) );
@@ -455,7 +440,7 @@ int __EXPORT ScUserListItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScUserListItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScUserListItem::Clone( SfxItemPool * ) const
{
return new ScUserListItem( *this );
}
@@ -490,20 +475,20 @@ ScConsolidateItem::ScConsolidateItem( const ScConsolidateItem& rItem ) :
//------------------------------------------------------------------------
-__EXPORT ScConsolidateItem::~ScConsolidateItem()
+ScConsolidateItem::~ScConsolidateItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScConsolidateItem::GetValueText() const
+String ScConsolidateItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScConsolidateItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScConsolidateItem::operator==( const SfxPoolItem& rItem ) const
+int ScConsolidateItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -514,7 +499,7 @@ int __EXPORT ScConsolidateItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScConsolidateItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScConsolidateItem::Clone( SfxItemPool * ) const
{
return new ScConsolidateItem( *this );
}
@@ -550,21 +535,21 @@ ScPivotItem::ScPivotItem( const ScPivotItem& rItem ) :
//------------------------------------------------------------------------
-__EXPORT ScPivotItem::~ScPivotItem()
+ScPivotItem::~ScPivotItem()
{
delete pSaveData;
}
//------------------------------------------------------------------------
-String __EXPORT ScPivotItem::GetValueText() const
+String ScPivotItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScPivotItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScPivotItem::operator==( const SfxPoolItem& rItem ) const
+int ScPivotItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -577,7 +562,7 @@ int __EXPORT ScPivotItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScPivotItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScPivotItem::Clone( SfxItemPool * ) const
{
return new ScPivotItem( *this );
}
@@ -604,20 +589,20 @@ ScSolveItem::ScSolveItem( const ScSolveItem& rItem )
//------------------------------------------------------------------------
-__EXPORT ScSolveItem::~ScSolveItem()
+ScSolveItem::~ScSolveItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScSolveItem::GetValueText() const
+String ScSolveItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScSolveItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScSolveItem::operator==( const SfxPoolItem& rItem ) const
+int ScSolveItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -628,7 +613,7 @@ int __EXPORT ScSolveItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScSolveItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScSolveItem::Clone( SfxItemPool * ) const
{
return new ScSolveItem( *this );
}
@@ -654,20 +639,20 @@ ScTabOpItem::ScTabOpItem( const ScTabOpItem& rItem )
//------------------------------------------------------------------------
-__EXPORT ScTabOpItem::~ScTabOpItem()
+ScTabOpItem::~ScTabOpItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScTabOpItem::GetValueText() const
+String ScTabOpItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScTabOpItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScTabOpItem::operator==( const SfxPoolItem& rItem ) const
+int ScTabOpItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -678,7 +663,7 @@ int __EXPORT ScTabOpItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScTabOpItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScTabOpItem::Clone( SfxItemPool * ) const
{
return new ScTabOpItem( *this );
}
@@ -707,20 +692,20 @@ ScCondFrmtItem::ScCondFrmtItem( const ScCondFrmtItem& rItem )
//------------------------------------------------------------------------
-__EXPORT ScCondFrmtItem::~ScCondFrmtItem()
+ScCondFrmtItem::~ScCondFrmtItem()
{
}
//------------------------------------------------------------------------
-String __EXPORT ScCondFrmtItem::GetValueText() const
+String ScCondFrmtItem::GetValueText() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScCondFrmtItem"));
}
//------------------------------------------------------------------------
-int __EXPORT ScCondFrmtItem::operator==( const SfxPoolItem& rItem ) const
+int ScCondFrmtItem::operator==( const SfxPoolItem& rItem ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
@@ -731,7 +716,9 @@ int __EXPORT ScCondFrmtItem::operator==( const SfxPoolItem& rItem ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT ScCondFrmtItem::Clone( SfxItemPool * ) const
+SfxPoolItem* ScCondFrmtItem::Clone( SfxItemPool * ) const
{
return new ScCondFrmtItem( *this );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/wtcdummy.cxx b/sc/source/ui/app/wtcdummy.cxx
index a755830cbd71..afa788dc7714 100644
--- a/sc/source/ui/app/wtcdummy.cxx
+++ b/sc/source/ui/app/wtcdummy.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,12 +40,12 @@ class SdbColumns
SdbColumns::SdbColumns()
{
- DBG_ERROR("WATCOM Hack failed !");
+ OSL_FAIL("WATCOM Hack failed !");
}
SdbColumns::~SdbColumns()
{
- DBG_ERROR("WATCOM Hack failed !");
+ OSL_FAIL("WATCOM Hack failed !");
}
class SdbRow
@@ -56,10 +57,12 @@ class SdbRow
SdbRow::SdbRow()
{
- DBG_ERROR("WATCOM Hack failed !");
+ OSL_FAIL("WATCOM Hack failed !");
}
SdbRow::~SdbRow()
{
- DBG_ERROR("WATCOM Hack failed !");
+ OSL_FAIL("WATCOM Hack failed !");
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index ed23044bf85c..7095de34ce2f 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,23 +37,17 @@
#include <sfx2/objsh.hxx>
#include <sfx2/tabdlg.hxx>
-//CHINA001 #include <svx/align.hxx>
-//CHINA001 #include <svx/backgrnd.hxx>
-//CHINA001 #include <svx/border.hxx>
-//CHINA001 #include <svx/chardlg.hxx>
-//CHINA001 #include <svx/numfmt.hxx>
-//CHINA001 #include <svx/paragrph.hxx>
#include <svl/cjkoptions.hxx>
#include "tabpages.hxx"
#include "attrdlg.hxx"
#include "scresid.hxx"
#include "attrdlg.hrc"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
-#include <svx/flagsdef.hxx> //CHINA001
-#include <editeng/flstitem.hxx> //CHINA001
-#include <sfx2/app.hxx> //CHINA001
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/flagsdef.hxx>
+#include <editeng/flstitem.hxx>
+#include <sfx2/app.hxx>
#if !LAYOUT_SFX_TABDIALOG_BROKEN
#include <layout/layout-pre.hxx>
@@ -71,58 +66,53 @@ ScAttrDlg::ScAttrDlg( SfxViewFrame* pFrameP,
{
SvtCJKOptions aCJKOptions;
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
+ DBG_ASSERT(pFact, "Dialogdiet fail!");
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!");//CHINA001
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!");
#if LAYOUT_SFX_TABDIALOG_BROKEN
- AddTabPage( TP_NUMBER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 0 ); //CHINA001 AddTabPage( TP_NUMBER, SvxNumberFormatTabPage::Create, 0 );
+ AddTabPage( TP_NUMBER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 0 );
#else
- String number = rtl::OUString::createFromAscii ("Numbers");
- AddTabPage( TP_NUMBER, number, pFact->GetTabPageCreatorFunc (RID_SVXPAGE_NUMBERFORMAT), 0, sal_False, TAB_APPEND);
+ String number(RTL_CONSTASCII_USTRINGPARAM("Numbers"));
+ AddTabPage( TP_NUMBER, number, pFact->GetTabPageCreatorFunc (RID_SVXPAGE_NUMBERFORMAT), 0, false, TAB_APPEND);
#endif
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");//CHINA001
- AddTabPage( TP_FONT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 ); //CHINA001 AddTabPage( TP_FONT, SvxCharNamePage::Create, 0 );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");//CHINA001
- AddTabPage( TP_FONTEFF, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 ); //CHINA001 AddTabPage( TP_FONTEFF, SvxCharEffectsPage::Create, 0 );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!");//CHINA001
- AddTabPage( TP_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 ); //CHINA001 AddTabPage( TP_ALIGNMENT, SvxAlignmentTabPage::Create, 0 );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
+ AddTabPage( TP_FONT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
+ AddTabPage( TP_FONTEFF, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!");
+ AddTabPage( TP_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 );
if ( aCJKOptions.IsAsianTypographyEnabled() )
{
- //CHINA001 AddTabPage( TP_ASIAN, SvxAsianTabPage::Create, 0 );
-// ::CreateTabPage pCreateTabpage = pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN);
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");//CHINA001
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
AddTabPage( TP_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), 0 );
}
else
RemoveTabPage( TP_ASIAN );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");//CHINA001
- AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 ); //CHINA001 AddTabPage( TP_BORDER, SvxBorderTabPage::Create, 0 );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");//CHINA001
- AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 ); //CHINA001 AddTabPage( TP_BACKGROUND, SvxBackgroundTabPage::Create, 0 );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
+ AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
AddTabPage( TP_PROTECTION, ScTabPageProtection::Create, 0 );
FreeResource();
}
// -----------------------------------------------------------------------
-__EXPORT ScAttrDlg::~ScAttrDlg()
+ScAttrDlg::~ScAttrDlg()
{
}
// -----------------------------------------------------------------------
-void __EXPORT ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
+void ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
- SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); //CHINA001
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
switch ( nPageId )
{
case TP_NUMBER:
{
- //CHINA001 SvxNumberFormatTabPage& rNumPage = (SvxNumberFormatTabPage&)rTabPage;
-
- //CHINA001 rNumPage.SetOkHdl( LINK( this, ScAttrDlg, OkHandler ) );
aSet.Put (SfxLinkItem( SID_LINK_TYPE, LINK( this, ScAttrDlg, OkHandler )));
rTabPage.PageCreated(aSet);
}
@@ -134,8 +124,6 @@ void __EXPORT ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
DBG_ASSERT( pInfoItem, "FontListItem not found :-(" );
- //CHINA001 ((SvxCharNamePage&)rTabPage).
- //CHINA001 SetFontList( *((const SvxFontListItem*)pInfoItem) );
aSet.Put (SvxFontListItem(((const SvxFontListItem*)pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
rTabPage.PageCreated(aSet);
}
@@ -156,3 +144,4 @@ IMPL_LINK( ScAttrDlg, OkHandler, void*, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/condfrmt.cxx b/sc/source/ui/attrdlg/condfrmt.cxx
index c3bab9e32296..9afdd62faf18 100644
--- a/sc/source/ui/attrdlg/condfrmt.cxx
+++ b/sc/source/ui/attrdlg/condfrmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
#include <sfx2/dispatch.hxx>
#include <svl/stritem.hxx>
@@ -47,6 +47,7 @@
#include "condfrmt.hxx"
#undef _CONDFRMT_CXX
+#include "rangelst.hxx"
//============================================================================
// class ScConditionalFormat
@@ -102,7 +103,7 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aFlSep2 ( this, ScResId( FL_SEP2 ) ),
aFlSep1 ( this, ScResId( FL_SEP1 ) ),
pEdActive ( NULL ),
- bDlgLostFocus ( sal_False ),
+ bDlgLostFocus ( false ),
pDoc ( pCurDoc )
{
@@ -187,7 +188,7 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aCond2Size2 = Size( aPos.X() - aCond2Pos2.X(), aCond2Size3.Height() );
aCond2Size1 = Size( aPos.X() - aCond2Pos1.X(), aCond2Size3.Height() );
- aCbxCond2.Check( sal_False );
+ aCbxCond2.Check( false );
aLbCond21.SelectEntryPos( 0 );
aLbCond22.SelectEntryPos( 0 );
@@ -202,7 +203,7 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aCond3Size2 = Size( aPos.X() - aCond3Pos2.X(), aCond3Size3.Height() );
aCond3Size1 = Size( aPos.X() - aCond3Pos1.X(), aCond3Size3.Height() );
- aCbxCond3.Check( sal_False );
+ aCbxCond3.Check( false );
aLbCond31.SelectEntryPos( 0 );
aLbCond32.SelectEntryPos( 0 );
@@ -261,7 +262,6 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
}
}
-
if ( pCurrentFormat->Count() > 1 )
{
aCbxCond2.Check( sal_True );
@@ -350,15 +350,13 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aEdtCond31.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
}
-
//----------------------------------------------------------------------------
// Destruktor
-__EXPORT ScConditionalFormatDlg::~ScConditionalFormatDlg()
+ScConditionalFormatDlg::~ScConditionalFormatDlg()
{
}
-
//----------------------------------------------------------------------------
void ScConditionalFormatDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
@@ -405,14 +403,13 @@ sal_Bool ScConditionalFormatDlg::IsRefInputMode() const
return (pEdActive != NULL);
}
-
//----------------------------------------------------------------------------
void ScConditionalFormatDlg::SetActive()
{
if ( bDlgLostFocus )
{
- bDlgLostFocus = sal_False;
+ bDlgLostFocus = false;
if( pEdActive )
pEdActive->GrabFocus();
}
@@ -422,7 +419,6 @@ void ScConditionalFormatDlg::SetActive()
RefInputDone();
}
-
//----------------------------------------------------------------------------
// Holt die ausgewaehlte bedingte Formatierung ab
@@ -438,6 +434,9 @@ void ScConditionalFormatDlg::GetConditionalFormat( ScConditionalFormat& rCndFmt
if (pViewShell)
{
ScViewData* pData = pViewShell->GetViewData();
+ ScRangeListRef rRanges;
+ pData->GetMultiArea( rRanges );
+ rCndFmt.AddRangeInfo( rRanges );
aCurPos = ScAddress( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() );
}
@@ -481,7 +480,6 @@ void ScConditionalFormatDlg::GetConditionalFormat( ScConditionalFormat& rCndFmt
}
}
-
//----------------------------------------------------------------------------
// Zerstoert den Dialog
@@ -490,7 +488,6 @@ sal_Bool ScConditionalFormatDlg::Close()
return DoClose( ScCondFormatDlgWrapper::GetChildWindowId() );
}
-
//----------------------------------------------------------------------------
// Handler:
@@ -515,7 +512,6 @@ IMPL_LINK( ScConditionalFormatDlg, ClickCond1Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// Zellwert/Formel
@@ -543,7 +539,6 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond11Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// zwischen, gleich, groesser, ...
@@ -553,7 +548,17 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond12Hdl, void *, EMPTYARG )
{
sal_uInt16 nPos = aLbCond12.GetSelectEntryPos();
- if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen
+ aEdtCond11.Show();
+ aRbCond11.Show();
+ if( nPos > 7 )
+ {
+ aEdtCond11.Hide();
+ aRbCond11.Hide();
+ aFtCond1And.Hide();
+ aEdtCond12.Hide();
+ aRbCond12.Hide();
+ }
+ else if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen
{
aEdtCond11.SetSizePixel( aCond1Size3 );
aRbCond11.SetPosPixel( aRBtn1Pos1 );
@@ -574,7 +579,6 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond12Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// Enabled/Disabled Condition2-Controls
@@ -596,7 +600,6 @@ IMPL_LINK( ScConditionalFormatDlg, ClickCond2Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// Zellwert/Formel
@@ -624,7 +627,6 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond21Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// zwischen, gleich, groesser, ...
@@ -634,7 +636,17 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond22Hdl, void *, EMPTYARG )
{
sal_uInt16 nPos = aLbCond22.GetSelectEntryPos();
- if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen
+ aEdtCond21.Show();
+ aRbCond21.Show();
+ if( nPos > 7 )
+ {
+ aEdtCond21.Hide();
+ aRbCond21.Hide();
+ aFtCond2And.Hide();
+ aEdtCond22.Hide();
+ aRbCond22.Hide();
+ }
+ else if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen
{
aEdtCond21.SetSizePixel( aCond2Size3 );
aRbCond21.SetPosPixel( aRBtn2Pos1 );
@@ -655,7 +667,6 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond22Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// Enabled/Disabled Condition3-Controls
@@ -677,7 +688,6 @@ IMPL_LINK( ScConditionalFormatDlg, ClickCond3Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// Zellwert/Formel
@@ -705,7 +715,6 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond31Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
// zwischen, gleich, groesser, ...
@@ -715,7 +724,17 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond32Hdl, void *, EMPTYARG )
{
sal_uInt16 nPos = aLbCond32.GetSelectEntryPos();
- if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen
+ aEdtCond31.Show();
+ aRbCond31.Show();
+ if( nPos > 7 )
+ {
+ aEdtCond31.Hide();
+ aRbCond31.Hide();
+ aFtCond3And.Hide();
+ aEdtCond32.Hide();
+ aRbCond32.Hide();
+ }
+ else if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen
{
aEdtCond31.SetSizePixel( aCond3Size3 );
aRbCond31.SetPosPixel( aRBtn3Pos1 );
@@ -736,7 +755,6 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond32Hdl, void *, EMPTYARG )
return( 0L );
}
-
//----------------------------------------------------------------------------
IMPL_LINK( ScConditionalFormatDlg, GetFocusHdl, Control*, pCtrl )
@@ -762,7 +780,6 @@ IMPL_LINK( ScConditionalFormatDlg, GetFocusHdl, Control*, pCtrl )
return 0;
}
-
//----------------------------------------------------------------------------
IMPL_LINK( ScConditionalFormatDlg, LoseFocusHdl, Control*, EMPTYARG )
@@ -771,7 +788,6 @@ IMPL_LINK( ScConditionalFormatDlg, LoseFocusHdl, Control*, EMPTYARG )
return 0;
}
-
//----------------------------------------------------------------------------
// [OK], [Cancel]
@@ -783,7 +799,7 @@ IMPL_LINK( ScConditionalFormatDlg, BtnHdl, PushButton*, pBtn )
GetConditionalFormat( aCondFrmt );
ScCondFrmtItem aOutItem( FID_CONDITIONAL_FORMAT, aCondFrmt );
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
GetBindings().GetDispatcher()->Execute( FID_CONDITIONAL_FORMAT,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
@@ -796,7 +812,6 @@ IMPL_LINK( ScConditionalFormatDlg, BtnHdl, PushButton*, pBtn )
return( 0L );
}
-
//----------------------------------------------------------------------------
IMPL_LINK( ScConditionalFormatDlg, NewBtnHdl, PushButton*, pBtn )
@@ -809,7 +824,7 @@ IMPL_LINK( ScConditionalFormatDlg, NewBtnHdl, PushButton*, pBtn )
SfxDispatcher* pDisp = GetBindings().GetDispatcher();
sal_Bool bLocked = pDisp->IsLocked();
if (bLocked)
- pDisp->Lock(sal_False);
+ pDisp->Lock(false);
// Execute the "new style" slot, complete with undo and all necessary updates.
// The return value (SfxUInt16Item) is ignored, look for new styles instead.
@@ -853,3 +868,4 @@ IMPL_LINK( ScConditionalFormatDlg, NewBtnHdl, PushButton*, pBtn )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/makefile.mk b/sc/source/ui/attrdlg/makefile.mk
index 378fd1052ff7..a979840b6063 100644
--- a/sc/source/ui/attrdlg/makefile.mk
+++ b/sc/source/ui/attrdlg/makefile.mk
@@ -33,9 +33,7 @@ LIBTARGET=no
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -44,12 +42,16 @@ CXXFILES = attrdlg.cxx \
tabpages.cxx \
condfrmt.cxx
-SLOFILES = $(SLO)$/attrdlg.obj \
- $(SLO)$/tabpages.obj \
+SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
+ $(SLO)$/attrdlg.obj \
$(SLO)$/condfrmt.obj \
$(SLO)$/scabstdlg.obj \
- $(SLO)$/scuiexp.obj \
- $(SLO)$/scdlgfact.obj
+ $(SLO)$/scdlgfact.obj \
+ $(SLO)$/scuiexp.obj \
+ $(SLO)$/tabpages.obj
LIB1TARGET = $(SLB)$/$(TARGET).lib
diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx
index b50435041409..7ab625e03f61 100644
--- a/sc/source/ui/attrdlg/scabstdlg.cxx
+++ b/sc/source/ui/attrdlg/scabstdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,8 +50,10 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create()
if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, aStrBuf.makeStringAndClear() ) )
fp = ( ScAbstractDialogFactory* (__LOADONCALLAPI*)() )
- aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
+ aDialogLibrary.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDialogFactory")) );
if ( fp )
return fp();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 90e4b0f20221..cbf62f945e36 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,87 +37,92 @@
#include "scdlgfact.hxx"
-#include "sc.hrc" //CHINA001
-#include "scuiasciiopt.hxx" //add for ScImportAsciiDlg
-#include "scuiautofmt.hxx" //add for ScAutoFormatDlg
-#include "corodlg.hxx" //add for ScColRowLabelDlg
-#include "crdlg.hxx" //add for ScColOrRowDlg
-#include "dapidata.hxx" //add for ScDataPilotDatabaseDlg
-#include "dapitype.hxx" //add for ScDataPilotSourceTypeDlg, ScDataPilotServiceDlg
-#include "delcldlg.hxx" //add for ScDeleteCellDlg
-#include "delcodlg.hxx" //add for ScDeleteContentsDlg
-#include "filldlg.hxx" //add for ScFillSeriesDlg
-#include "groupdlg.hxx" //add for ScGroupDlg
-#include "inscldlg.hxx" //add for ScInsertCellDlg
-#include "inscodlg.hxx" //add for ScInsertContentsDlg
-#include "instbdlg.hxx" //add for ScInsertTableDlg
-#include "lbseldlg.hxx" //add for ScSelEntryDlg
-#include "linkarea.hxx" //add for ScLinkedAreaDlg
-#include "mtrindlg.hxx" //add for ScMetricInputDlg
-#include "mvtabdlg.hxx" //add for ScMoveTableDlg
-#include "namecrea.hxx" //add for ScNameCreateDlg
-#include "namepast.hxx" //add for ScNamePasteDlg
-#include "pfiltdlg.hxx" //add for ScPivotFilterDlg
-#include "pvfundlg.hxx" //add for ScDPFunctionDlg
+#include "sc.hrc"
+#include "scuiasciiopt.hxx"
+#include "scuiautofmt.hxx"
+#include "corodlg.hxx"
+#include "crdlg.hxx"
+#include "dapidata.hxx"
+#include "dapitype.hxx"
+#include "delcldlg.hxx"
+#include "delcodlg.hxx"
+#include "filldlg.hxx"
+#include "groupdlg.hxx"
+#include "inscldlg.hxx"
+#include "inscodlg.hxx"
+#include "instbdlg.hxx"
+#include "lbseldlg.hxx"
+#include "linkarea.hxx"
+#include "mtrindlg.hxx"
+#include "mvtabdlg.hxx"
+#include "namecrea.hxx"
+#include "namepast.hxx"
+#include "pfiltdlg.hxx"
+#include "pvfundlg.hxx"
#include "dpgroupdlg.hxx"
-#include "scendlg.hxx" //add for ScNewScenarioDlg
-#include "shtabdlg.hxx" //add for ScShowTabDlg
-#include "strindlg.hxx" //add for ScStringInputDlg
-#include "tabbgcolordlg.hxx"//add for ScTabBgColorDlg
-#include "scuiimoptdlg.hxx" //add for ScImportOptionsDlg
-#include "attrdlg.hxx" //add for ScAttrDlg
-#include "hfedtdlg.hxx" //add for ScHFEditDlg
-#include "styledlg.hxx" //add for ScStyleDlg
-#include "subtdlg.hxx" //add for ScSubTotalDlg
-#include "textdlgs.hxx" //add for ScCharDlg, ScParagraphDlg
-#include "validate.hxx" //add for ScValidationDlg
-#include "validate.hrc" //add for ScValidationDlg
-#include "sortdlg.hxx" //add for ScSortDlg
+#include "scendlg.hxx"
+#include "shtabdlg.hxx"
+#include "strindlg.hxx"
+#include "tabbgcolordlg.hxx"
+#include "scuiimoptdlg.hxx"
+#include "attrdlg.hxx"
+#include "hfedtdlg.hxx"
+#include "styledlg.hxx"
+#include "subtdlg.hxx"
+#include "textdlgs.hxx"
+#include "validate.hxx"
+#include "validate.hrc"
+#include "sortdlg.hxx"
#include "textimportoptions.hxx"
-#include "opredlin.hxx" //add for ScRedlineOptionsTabPage
-#include "tpcalc.hxx" //add for ScTpCalcOptions
-#include "tpprint.hxx" //add for ScTpPrintOptions
-#include "tpstat.hxx" //add for ScDocStatPage
-#include "tpusrlst.hxx" //add for ScTpUserLists
-#include "tpview.hxx" //add for ScTpContentOptions
+#include "opredlin.hxx"
+#include "tpcalc.hxx"
+#include "tpprint.hxx"
+#include "tpstat.hxx"
+#include "tpusrlst.hxx"
+#include "tpview.hxx"
+#include "tpformula.hxx"
+#include "datafdlg.hxx"
+#include "tpcompatibility.hxx"
// ause
#include "editutil.hxx"
#include <sfx2/layout.hxx>
-IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); //add for ScColOrRowDlg
-IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl);//CHINA001 add for ScImportAsciiDlg
-IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl); //CHINA001 add for ScAutoFormatDlg
-IMPL_ABSTDLG_BASE(AbstractScColRowLabelDlg_Impl); //add for ScColRowLabelDlg
-IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); //add for ScDataPilotDatabaseDlg
-IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); //add for ScDataPilotSourceTypeDlg
-IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); //add for ScDataPilotServiceDlg
-IMPL_ABSTDLG_BASE(AbstractScDeleteCellDlg_Impl); //add for ScDeleteCellDlg
-IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl); //add for ScDeleteContentsDlg
-IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl); //add for ScFillSeriesDlg
-IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl); //add for ScGroupDlg
-IMPL_ABSTDLG_BASE(AbstractScInsertCellDlg_Impl); //add for ScInsertCellDlg
-IMPL_ABSTDLG_BASE(AbstractScInsertContentsDlg_Impl); //add for ScInsertContentsDlg
-IMPL_ABSTDLG_BASE(AbstractScInsertTableDlg_Impl); //add for ScInsertTableDlg
-IMPL_ABSTDLG_BASE(AbstractScSelEntryDlg_Impl); //add for ScSelEntryDlg
-IMPL_ABSTDLG2_BASE(AbstractScLinkedAreaDlg_Impl); //add for ScLinkedAreaDlg
-IMPL_ABSTDLG_BASE(AbstractScMetricInputDlg_Impl); //add for ScMetricInputDlg
-IMPL_ABSTDLG_BASE(AbstractScMoveTableDlg_Impl); //add for ScMoveTableDlg
-IMPL_ABSTDLG_BASE(AbstractScNameCreateDlg_Impl); //add for ScNameCreateDlg
-IMPL_ABSTDLG_BASE(AbstractScNamePasteDlg_Impl); //add for ScNamePasteDlg
-IMPL_ABSTDLG_BASE(AbstractScPivotFilterDlg_Impl); //add for ScPivotFilterDlg
-IMPL_ABSTDLG_BASE(AbstractScDPFunctionDlg_Impl); //add for ScDPFunctionDlg
-IMPL_ABSTDLG_BASE(AbstractScDPSubtotalDlg_Impl); //add for ScDPSubtotalDlg
+IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl);
+IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScColRowLabelDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScDeleteCellDlg_Impl);
+//for dataform
+IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScInsertCellDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScInsertContentsDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScInsertTableDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScSelEntryDlg_Impl);
+IMPL_ABSTDLG2_BASE(AbstractScLinkedAreaDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScMetricInputDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScMoveTableDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScNameCreateDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScNamePasteDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScPivotFilterDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScDPFunctionDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScDPSubtotalDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDPNumGroupDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDPDateGroupDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl); //add for ScDPShowDetailDlg
-IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl); //add for ScNewScenarioDlg
-IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); //add for ScShowTabDlg
-IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); //add for ScStringInputDlg
-IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); //add for ScTabBgColorDlg
-IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); //add for ScImportOptionsDlg
+IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl);
+IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScTextImportOptionsDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
+IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl);
// AbstractTabDialog_Impl begin
void AbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId )
@@ -128,12 +134,12 @@ const SfxItemSet* AbstractTabDialog_Impl::GetOutputItemSet() const
{
return pDlg->GetOutputItemSet();
}
-//add by CHINA001
+
const sal_uInt16* AbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
{
return pDlg->GetInputRanges( pItem );
}
-//add by CHINA001
+
void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
{
pDlg->SetInputSet( pInSet );
@@ -151,7 +157,7 @@ String AbstractTabDialog_Impl::GetText() const
#if ENABLE_LAYOUT
namespace layout
{
-IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
+IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl);
// AbstractTabDialog_Impl begin
void AbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId )
@@ -163,12 +169,12 @@ const SfxItemSet* AbstractTabDialog_Impl::GetOutputItemSet() const
{
return pDlg->GetOutputItemSet();
}
-//add by CHINA001
+
const sal_uInt16* AbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
{
return pDlg->GetInputRanges( pItem );
}
-//add by CHINA001
+
void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
{
pDlg->SetInputSet( pInSet );
@@ -185,7 +191,7 @@ String AbstractTabDialog_Impl::GetText() const
}
#endif /* ENABLE_LAYOUT */
-//add for AbstractTabDialog_Impl end
+
// AbstractScImportAsciiDlg_Impl begin
void AbstractScImportAsciiDlg_Impl::GetOptions( ScAsciiOptions& rOpt )
{
@@ -244,16 +250,31 @@ void AbstractScDataPilotDatabaseDlg_Impl::GetValues( ScImportSourceDesc& rDesc )
//AbstractScDataPilotSourceTypeDlg_Impl begin
-sal_Bool AbstractScDataPilotSourceTypeDlg_Impl::IsDatabase() const
+bool AbstractScDataPilotSourceTypeDlg_Impl::IsDatabase() const
{
return pDlg->IsDatabase();
}
-sal_Bool AbstractScDataPilotSourceTypeDlg_Impl::IsExternal() const
+bool AbstractScDataPilotSourceTypeDlg_Impl::IsExternal() const
{
return pDlg->IsExternal();
}
+bool AbstractScDataPilotSourceTypeDlg_Impl::IsNamedRange() const
+{
+ return pDlg->IsNamedRange();
+}
+
+rtl::OUString AbstractScDataPilotSourceTypeDlg_Impl::GetSelectedNamedRange() const
+{
+ return pDlg->GetSelectedNamedRange();
+}
+
+void AbstractScDataPilotSourceTypeDlg_Impl::AppendNamedRange(const ::rtl::OUString& rName)
+{
+ pDlg->AppendNamedRange(rName);
+}
+
//AbstractScDataPilotSourceTypeDlg_Impl end
@@ -283,13 +304,13 @@ String AbstractScDataPilotServiceDlg_Impl::GetParPass() const
//AbstractScDataPilotServiceDlg_Impl end
//AbstractScDeleteCellDlg_Impl begin
-DelCellCmd AbstractScDeleteCellDlg_Impl::GetDelCellCmd() const //add for ScDeleteCellDlg
+DelCellCmd AbstractScDeleteCellDlg_Impl::GetDelCellCmd() const
{
return pDlg->GetDelCellCmd();
}
//AbstractScDeleteCellDlg_Impl end
-//add for AbstractScDeleteContentsDlg_Impl begin
+
void AbstractScDeleteContentsDlg_Impl::DisableObjects()
{
pDlg->DisableObjects();
@@ -298,9 +319,9 @@ sal_uInt16 AbstractScDeleteContentsDlg_Impl::GetDelContentsCmdBits() const
{
return pDlg->GetDelContentsCmdBits();
}
-//add for AbstractScDeleteContentsDlg_Impl end
-//add for AbstractScFillSeriesDlg_Impl begin
+
+
FillDir AbstractScFillSeriesDlg_Impl::GetFillDir() const
{
return pDlg->GetFillDir();
@@ -336,26 +357,26 @@ void AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(sal_Bool bFlag)
{
pDlg->SetEdStartValEnabled(bFlag);
}
-//add for AbstractScFillSeriesDlg_Impl end
-//add for AbstractScGroupDlg_Impl begin
+
+
sal_Bool AbstractScGroupDlg_Impl::GetColsChecked() const
{
return pDlg->GetColsChecked();
}
-//add for AbstractScGroupDlg_Impl end
-//add for AbstractScInsertCellDlg_Impl begin
+
+
InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const
{
return pDlg->GetInsCellCmd();
}
-//add for AbstractScInsertCellDlg_Impl end
-//add for AbstractScInsertContentsDlg_Impl begin
+
+
sal_uInt16 AbstractScInsertContentsDlg_Impl::GetInsContentsCmdBits() const
{
return pDlg->GetInsContentsCmdBits();
@@ -401,10 +422,10 @@ InsCellCmd AbstractScInsertContentsDlg_Impl::GetMoveMode()
{
return pDlg->GetMoveMode();
}
-//add for AbstractScInsertContentsDlg_Impl end
-//add for AbstractScInsertTableDlg_Impl begin
+
+
sal_Bool AbstractScInsertTableDlg_Impl::GetTablesFromFile()
{
return pDlg->GetTablesFromFile();
@@ -434,16 +455,16 @@ const String* AbstractScInsertTableDlg_Impl::GetNextTable( sal_uInt16* pN )
{
return pDlg->GetNextTable( pN );
}
-//add for AbstractScInsertTableDlg_Impl end
-//add for AbstractScSelEntryDlg_Impl begin
+
+
String AbstractScSelEntryDlg_Impl::GetSelectEntry() const
{
return pDlg->GetSelectEntry();
}
-//add for AbstractScSelEntryDlg_Impl end
-//add for AbstractScLinkedAreaDlg_Impl begin
+
+
void AbstractScLinkedAreaDlg_Impl::InitFromOldLink( const String& rFile, const String& rFilter,
const String& rOptions, const String& rSource,
sal_uLong nRefresh )
@@ -471,19 +492,19 @@ sal_uLong AbstractScLinkedAreaDlg_Impl::GetRefresh()
{
return pDlg->GetRefresh();
}
-//add for AbstractScLinkedAreaDlg_Impl end
-//add for AbstractScMetricInputDlg_Impl begin
+
+
long AbstractScMetricInputDlg_Impl::GetInputValue( FieldUnit eUnit ) const
{
return pDlg->GetInputValue( eUnit );
}
-//add for AbstractScMetricInputDlg_Impl end
-//add for AbstractScMoveTableDlg_Impl begin
-sal_uInt16 AbstractScMoveTableDlg_Impl::GetSelectedDocument() const //add for ScMoveTableDlg
+
+
+sal_uInt16 AbstractScMoveTableDlg_Impl::GetSelectedDocument() const
{
return pDlg->GetSelectedDocument();
}
@@ -492,44 +513,57 @@ sal_uInt16 AbstractScMoveTableDlg_Impl::GetSelectedTable() const
{
return pDlg->GetSelectedTable();
}
-sal_Bool AbstractScMoveTableDlg_Impl::GetCopyTable() const
+bool AbstractScMoveTableDlg_Impl::GetCopyTable() const
{
return pDlg->GetCopyTable();
}
-void AbstractScMoveTableDlg_Impl::SetCopyTable(sal_Bool bFla)
+bool AbstractScMoveTableDlg_Impl::GetRenameTable() const
+{
+ return pDlg->GetRenameTable();
+}
+void AbstractScMoveTableDlg_Impl::GetTabNameString( String& rString ) const
{
- return pDlg->SetCopyTable( bFla );
+ pDlg->GetTabNameString( rString );
+}
+void AbstractScMoveTableDlg_Impl::SetForceCopyTable()
+{
+ return pDlg->SetForceCopyTable();
}
void AbstractScMoveTableDlg_Impl::EnableCopyTable(sal_Bool bFlag)
{
return pDlg->EnableCopyTable( bFlag);
}
-//add for AbstractScMoveTableDlg_Impl end
+void AbstractScMoveTableDlg_Impl::EnableRenameTable(sal_Bool bFlag)
+{
+ return pDlg->EnableRenameTable( bFlag);
+}
-//add for AbstractScNameCreateDlg_Impl begin
-sal_uInt16 AbstractScNameCreateDlg_Impl::GetFlags() const //add for ScNameCreateDlg
+
+
+
+sal_uInt16 AbstractScNameCreateDlg_Impl::GetFlags() const
{
return pDlg->GetFlags();
}
-//add for AbstractScNameCreateDlg_Impl end
-//add for AbstractScNamePasteDlg_Impl begin
-String AbstractScNamePasteDlg_Impl::GetSelectedName() const //add for ScNamePasteDlg
+
+
+String AbstractScNamePasteDlg_Impl::GetSelectedName() const
{
return pDlg->GetSelectedName();
}
-//add for AbstractScNamePasteDlg_Impl end
-//add for AbstractScPivotFilterDlg_Impl begin
-const ScQueryItem& AbstractScPivotFilterDlg_Impl::GetOutputItem() //add for ScPivotFilterDlg
+
+
+const ScQueryItem& AbstractScPivotFilterDlg_Impl::GetOutputItem()
{
return pDlg->GetOutputItem();
}
-//add for AbstractScPivotFilterDlg_Impl end
-//add for AbstractScDPFunctionDlg_Impl begin
-sal_uInt16 AbstractScDPFunctionDlg_Impl::GetFuncMask() const //add for ScDPFunctionDlg
+
+
+sal_uInt16 AbstractScDPFunctionDlg_Impl::GetFuncMask() const
{
return pDlg->GetFuncMask();
}
@@ -537,10 +571,10 @@ sal_uInt16 AbstractScDPFunctionDlg_Impl::GetFuncMask() const //add for ScDPFunct
{
return pDlg->GetFieldRef();
}
-//add for AbstractScDPFunctionDlg_Impl end
-//add for AbstractScDPSubtotalDlg_Impl begin
-sal_uInt16 AbstractScDPSubtotalDlg_Impl::GetFuncMask() const //add for ScDPSubtotalDlg
+
+
+sal_uInt16 AbstractScDPSubtotalDlg_Impl::GetFuncMask() const
{
return pDlg->GetFuncMask();
}
@@ -548,7 +582,7 @@ void AbstractScDPSubtotalDlg_Impl::FillLabelData( ScDPLabelData& rLabelData ) co
{
pDlg->FillLabelData( rLabelData );
}
-//add for AbstractScDPSubtotalDlg_Impl end
+
ScDPNumGroupInfo AbstractScDPNumGroupDlg_Impl::GetGroupInfo() const
{
@@ -565,14 +599,14 @@ sal_Int32 AbstractScDPDateGroupDlg_Impl::GetDatePart() const
return pDlg->GetDatePart();
}
-//add for AbstractScDPShowDetailDlg_Impl begin
+
String AbstractScDPShowDetailDlg_Impl::GetDimensionName() const
{
return pDlg->GetDimensionName();
}
-//add for AbstractScDPShowDetailDlg_Impl end
-//add for AbstractScNewScenarioDlg_Impl begin
+
+
void AbstractScNewScenarioDlg_Impl::SetScenarioData( const String& rName, const String& rComment,
const Color& rColor, sal_uInt16 nFlags )
{
@@ -585,10 +619,10 @@ void AbstractScNewScenarioDlg_Impl::GetScenarioData( String& rName, String& rCom
pDlg->GetScenarioData( rName,rComment,rColor,rFlags);
}
-//add for AbstractScNewScenarioDlg_Impl end
-//add for AbstractScShowTabDlg_Impl begin
-void AbstractScShowTabDlg_Impl::Insert( const String& rString, sal_Bool bSelected ) //add for ScShowTabDlg
+
+
+void AbstractScShowTabDlg_Impl::Insert( const String& rString, sal_Bool bSelected )
{
pDlg->Insert( rString, bSelected);
}
@@ -611,31 +645,31 @@ String AbstractScShowTabDlg_Impl::GetSelectEntry(sal_uInt16 nPos) const
{
return pDlg->GetSelectEntry(nPos);
}
-//add for AbstractScShowTabDlg_Impl end
-//add for AbstractScStringInputDlg_Impl begin
-void AbstractScStringInputDlg_Impl::GetInputString( String& rString ) const //add for ScStringInputDlg
+
+
+void AbstractScStringInputDlg_Impl::GetInputString( String& rString ) const
{
pDlg->GetInputString( rString );
}
-//add for AbstractScStringInputDlg_Impl end
-//add for AbstractScTabBgColorDlg_Impl begin
-void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const //add for ScTabBgColorDlg
+
+
+void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const
{
pDlg->GetSelectedColor( rColor );
}
-//add for AbstractScTabBgColorDlg_Impl end
-//add for AbstractScImportOptionsDlg_Impl begin
-void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const //add for ScImportOptionsDlg
+
+
+void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const
{
pDlg->GetImportOptions(rOptions);
}
// add for AbstractScImportOptionsDlg_Impl end
-//add for AbstractScLangChooserDlg_Impl begin
+
LanguageType AbstractScTextImportOptionsDlg_Impl::GetLanguageType() const
{
return pDlg->getLanguageType();
@@ -646,11 +680,11 @@ bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const
return pDlg->isDateConversionSet();
}
-//add for AbstractScLangChooserDlg_Impl end
+
// =========================Factories for createdialog ===================
-//add for ScImportAsciiDlg begin
+
AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( Window* pParent, String aDatName,
SvStream* pInStream, int nId, sal_Unicode cSep )
{
@@ -685,9 +719,9 @@ AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImpor
return pDlg ? new AbstractScTextImportOptionsDlg_Impl(pDlg) : NULL;
}
-//add for ScAutoFormatDlg begin
-AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg
+
+AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( Window* pParent,
ScAutoFormat* pAutoFormat,
const ScAutoFormatData* pSelFormatData,
ScDocument* pDoc,
@@ -707,11 +741,11 @@ AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( W
return new AbstractScAutoFormatDlg_Impl( pDlg );
return 0;
}
-//add for ScAutoFormatDlg end
-//add for ScColRowLabelDlg begin
-AbstractScColRowLabelDlg * ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg(Window* pParent, //add for ScColRowLabelDlg
+
+
+AbstractScColRowLabelDlg * ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg(Window* pParent,
int nId,
sal_Bool bCol ,
sal_Bool bRow)
@@ -730,10 +764,10 @@ AbstractScColRowLabelDlg * ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg
return new AbstractScColRowLabelDlg_Impl( pDlg );
return 0;
}
-//add for ScColRowLabelDlg end
-//add for ScColOrRowDlg begin
+
+
VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScColOrRowDlg(Window* pParent,
const String& rStrTitle,
@@ -755,9 +789,9 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScColOrRowDlg(Window*
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
-//add for ScColOrRowDlg end
-//add for ScSortWarningDlg begin
+
+
VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window* pParent, const String& rExtendText,
const String& rCurrentText, int nId )
{
@@ -774,12 +808,12 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window
return new VclAbstractDialog_Impl( pDlg );
return 0;
}
-//add for ScSortWarningDlg end
-//add for ScDataPilotDatabaseDlg begin
+
+
AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg (Window* pParent ,
- int nId ) //add for ScDataPilotDatabaseDlg
+ int nId )
{
ScDataPilotDatabaseDlg * pDlg=NULL;
switch ( nId )
@@ -795,9 +829,9 @@ AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilo
return new AbstractScDataPilotDatabaseDlg_Impl( pDlg );
return 0;
}
-//add for ScDataPilotDatabaseDlg end
-//add for ScDataPilotSourceTypeDlg begin
+
+
AbstractScDataPilotSourceTypeDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSourceTypeDlg( Window* pParent,
sal_Bool bEnableExternal,
int nId )
@@ -820,7 +854,7 @@ AbstractScDataPilotSourceTypeDlg* ScAbstractDialogFactory_Impl::CreateScDataPilo
// add for ScDataPilotSourceTypeDlg end
-//add for ScDataPilotServiceDlg begin
+
AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotServiceDlg( Window* pParent,
const com::sun::star::uno::Sequence<rtl::OUString>& rServices,
int nId )
@@ -842,7 +876,7 @@ AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSe
// add for ScDataPilotServiceDlg end
-//add for ScDeleteCellDlg begin
+
AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg( Window* pParent, int nId,
sal_Bool bDisallowCellMove )
{
@@ -861,10 +895,30 @@ AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg( Wi
return 0;
}
-//add for ScDeleteCellDlg end
-//add for ScDeleteContentsDlg begin
-AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg
+
+
+AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell )
+{
+ ScDataFormDlg * pDlg=NULL;
+ switch ( nId )
+ {
+ case RID_SCDLG_DATAFORM :
+ pDlg = new ScDataFormDlg( pParent, pTabViewShell);
+ break;
+ default:
+ break;
+ }
+
+ if ( pDlg )
+ return new AbstractScDataFormDlg_Impl( pDlg );
+ return 0;
+}
+
+
+
+
+AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(Window* pParent,int nId,
sal_uInt16 nCheckDefaults )
{
ScDeleteContentsDlg * pDlg=NULL;
@@ -882,10 +936,10 @@ AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContent
return 0;
}
-//add for ScDeleteContentsDlg end
-//add for ScFillSeriesDlg begin
-AbstractScFillSeriesDlg* ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( Window* pParent, //add for ScFillSeriesDlg
+
+
+AbstractScFillSeriesDlg* ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( Window* pParent,
ScDocument& rDocument,
FillDir eFillDir,
FillCmd eFillCmd,
@@ -911,9 +965,9 @@ AbstractScFillSeriesDlg* ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( Wi
return 0;
}
-//add for ScFillSeriesDlg end
-//add for ScGroupDlg begin
+
+
AbstractScGroupDlg* ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg( Window* pParent,
sal_uInt16 nResId,
int nId,
@@ -936,11 +990,11 @@ AbstractScGroupDlg* ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg( Wind
return 0;
}
-//add for ScGroupDlg end
-//add for ScInsertCellDlg begin
-AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( Window* pParent, //add for ScInsertCellDlg
+
+
+AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( Window* pParent,
int nId,
sal_Bool bDisallowCellMove )
{
@@ -959,9 +1013,9 @@ AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( W
return 0;
}
-//add for ScInsertCellDlg end
-//add for ScInsertContentsDlg begin
+
+
AbstractScInsertContentsDlg * ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg( Window* pParent,
int nId,
sal_uInt16 nCheckDefaults,
@@ -981,9 +1035,9 @@ AbstractScInsertContentsDlg * ScAbstractDialogFactory_Impl::CreateScInsertConten
return new AbstractScInsertContentsDlg_Impl( pDlg );
return 0;
}
-//add for ScInsertContentsDlg end
-//add for ScInsertTableDlg begin
+
+
AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg ( Window* pParent, ScViewData& rViewData,
SCTAB nTabCount, bool bFromFile, int nId)
{
@@ -1001,7 +1055,7 @@ AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg
return new AbstractScInsertTableDlg_Impl( pDlg );
return 0;
}
-//add for ScInsertTableDlg end
+
// add for ScSelEntryDlg begin
AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Window* pParent,
@@ -1027,7 +1081,7 @@ AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Wind
}
// add for ScSelEntryDlg end
-//add for ScLinkedAreaDlg begin
+
AbstractScLinkedAreaDlg * ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg ( Window* pParent,
int nId)
{
@@ -1045,9 +1099,9 @@ AbstractScLinkedAreaDlg * ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg (
return new AbstractScLinkedAreaDlg_Impl( pDlg );
return 0;
}
-//add for ScLinkedAreaDlg end
-//add for ScMetricInputDlg begin
+
+
AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg ( Window* pParent,
sal_uInt16 nResId, // Ableitung fuer jeden Dialog!
long nCurrent,
@@ -1078,17 +1132,19 @@ AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg
return new AbstractScMetricInputDlg_Impl( pDlg );
return 0;
}
-//add for ScMetricInputDlg end
-//add for ScMoveTableDlg begin
-AbstractScMoveTableDlg * ScAbstractDialogFactory_Impl::CreateScMoveTableDlg( Window* pParent, int nId )
+
+
+AbstractScMoveTableDlg * ScAbstractDialogFactory_Impl::CreateScMoveTableDlg( Window* pParent,
+ const String& rDefault,
+ int nId )
{
ScMoveTableDlg * pDlg=NULL;
switch ( nId )
{
case RID_SCDLG_MOVETAB :
- pDlg = new ScMoveTableDlg( pParent );
+ pDlg = new ScMoveTableDlg( pParent, rDefault );
break;
default:
break;
@@ -1098,10 +1154,10 @@ AbstractScMoveTableDlg * ScAbstractDialogFactory_Impl::CreateScMoveTableDlg( Wi
return new AbstractScMoveTableDlg_Impl( pDlg );
return 0;
}
-//add for ScMoveTableDlg end
-//add for ScNameCreateDlg begin
+
+
AbstractScNameCreateDlg * ScAbstractDialogFactory_Impl::CreateScNameCreateDlg ( Window * pParent, sal_uInt16 nFlags, int nId )
{
ScNameCreateDlg * pDlg=NULL;
@@ -1118,10 +1174,10 @@ AbstractScNameCreateDlg * ScAbstractDialogFactory_Impl::CreateScNameCreateDlg (
return new AbstractScNameCreateDlg_Impl( pDlg );
return 0;
}
-//add for ScNameCreateDlg end
-//add for ScNamePasteDlg begin
+
+
AbstractScNamePasteDlg * ScAbstractDialogFactory_Impl::CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList,
int nId , sal_Bool bInsList )
{
@@ -1139,9 +1195,9 @@ AbstractScNameCreateDlg * ScAbstractDialogFactory_Impl::CreateScNameCreateDlg (
return new AbstractScNamePasteDlg_Impl( pDlg );
return 0;
}
-//add for ScNamePasteDlg end
-//add for ScPivotFilterDlg begin
+
+
AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg ( Window* pParent,
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId )
{
@@ -1159,10 +1215,10 @@ AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg
return new AbstractScPivotFilterDlg_Impl( pDlg );
return 0;
}
-//add for ScPivotFilterDlg end
-//add for ScDPFunctionDlg begin
+
+
AbstractScDPFunctionDlg * ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg ( Window* pParent,
int nId,
const ScDPLabelDataVector& rLabelVec,
@@ -1183,9 +1239,9 @@ AbstractScDPFunctionDlg * ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg (
return new AbstractScDPFunctionDlg_Impl( pDlg );
return 0;
}
-//add for ScDPFunctionDlg end
-//add for ScDPSubtotalDlg begin
+
+
AbstractScDPSubtotalDlg * ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg ( Window* pParent,
int nId,
ScDPObject& rDPObj,
@@ -1208,7 +1264,7 @@ AbstractScDPSubtotalDlg * ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg (
return new AbstractScDPSubtotalDlg_Impl( pDlg );
return 0;
}
-//add for ScDPSubtotalDlg end
+
AbstractScDPNumGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg(
Window* pParent, int nId, const ScDPNumGroupInfo& rInfo )
@@ -1227,7 +1283,7 @@ AbstractScDPDateGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg(
return 0;
}
-//add for ScDPShowDetailDlg begin
+
AbstractScDPShowDetailDlg * ScAbstractDialogFactory_Impl::CreateScDPShowDetailDlg (
Window* pParent, int nId, ScDPObject& rDPObj, sal_uInt16 nOrient )
{
@@ -1235,9 +1291,9 @@ AbstractScDPShowDetailDlg * ScAbstractDialogFactory_Impl::CreateScDPShowDetailDl
return new AbstractScDPShowDetailDlg_Impl( new ScDPShowDetailDlg( pParent, rDPObj, nOrient ) );
return 0;
}
-//add for ScDPShowDetailDlg end
-//add for ScNewScenarioDlg begin
+
+
AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg ( Window* pParent, const String& rName,
int nId,
sal_Bool bEdit , sal_Bool bSheetProtected )
@@ -1256,9 +1312,9 @@ AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg
return new AbstractScNewScenarioDlg_Impl( pDlg );
return 0;
}
-//add for ScNewScenarioDlg end
-//add for ScShowTabDlg begin
+
+
AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window* pParent, int nId )
{
ScShowTabDlg * pDlg=NULL;
@@ -1276,10 +1332,10 @@ AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window
return 0;
}
-//add for ScShowTabDlg end
-//add for ScStringInputDlg begin
+
+
AbstractScStringInputDlg * ScAbstractDialogFactory_Impl::CreateScStringInputDlg ( Window* pParent,
const String& rTitle,
const String& rEditTitle,
@@ -1301,9 +1357,9 @@ AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window
return new AbstractScStringInputDlg_Impl( pDlg );
return 0;
}
- //add for ScStringInputDlg end
-//add for ScTabBgColorDlg begin
+
+
AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg (
Window* pParent,
const String& rTitle,
@@ -1326,9 +1382,9 @@ if ( pDlg )
return new AbstractScTabBgColorDlg_Impl( pDlg );
return 0;
}
-//add for ScTabBgColorDlg end
-//add for ScImportOptionsDlg begin
+
+
AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window* pParent,
int nId,
sal_Bool bAscii,
@@ -1352,13 +1408,13 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions
return new AbstractScImportOptionsDlg_Impl( pDlg );
return 0;
}
-//add for ScImportOptionsDlg end
+
#if ENABLE_LAYOUT && !LAYOUT_SFX_TABDIALOG_BROKEN
#define SfxTabDialog layout::SfxTabDialog
#define AbstractTabDialog_Impl layout::AbstractTabDialog_Impl
#endif /* ENABLE_LAYOUT */
-//add for ScAttrDlg begin
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg( SfxViewFrame* pFrame,
Window* pParent,
const SfxItemSet* pCellAttrs,
@@ -1379,11 +1435,11 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg( SfxViewFra
return 0;
}
-//add for ScAttrDlg end
+
#undef SfxTabDialog
#undef AbstractTabDialog_Impl
-//add for ScHFEditDlg begin
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( SfxViewFrame* pFrame,
Window* pParent,
const SfxItemSet& rCoreSet,
@@ -1405,9 +1461,9 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( SfxViewF
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for ScHFEditDlg end
-//add for ScStyleDlg begin
+
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( Window* pParent,
SfxStyleSheetBase& rStyleBase,
sal_uInt16 nRscId,
@@ -1428,9 +1484,9 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( Window*
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for ScStyleDlg end
-//add for ScSubTotalDlg begin
+
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg( Window* pParent,
const SfxItemSet* pArgSet,
int nId)
@@ -1449,9 +1505,9 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg( Window
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for ScSubTotalDlg end
-//add for ScCharDlg begin
+
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,
const SfxObjectShell* pDocShell, int nId )
{
@@ -1469,9 +1525,9 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pP
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for ScCharDlg end
-//add for ScParagraphDlg begin
+
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ,
int nId )
{
@@ -1489,23 +1545,17 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg( Windo
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for ScParagraphDlg end
-//add for ScValidationDlg begin
+
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg( Window* pParent,
-//<!--Modified by PengYunQuan for Validity Cell Range Picker
-// const SfxItemSet* pArgSet,int nId )
const SfxItemSet* pArgSet,int nId, ScTabViewShell *pTabVwSh )
-//-->Modified by PengYunQuan for Validity Cell Range Picke
{
SfxTabDialog* pDlg=NULL;
switch ( nId )
{
case TAB_DLG_VALIDATION :
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //pDlg = new ScValidationDlg( pParent, pArgSet );
pDlg = new ScValidationDlg( pParent, pArgSet, pTabVwSh );
- //-->Modified by PengYunQuan for Validity Cell Range Picker
break;
default:
break;
@@ -1515,13 +1565,13 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg( Wind
return new AbstractTabDialog_Impl( pDlg );
return 0;
}
-//add for ScValidationDlg end
+
#if ENABLE_LAYOUT && !LAYOUT_SFX_TABDIALOG_BROKEN
#define SfxTabDialog layout::SfxTabDialog
#define AbstractTabDialog_Impl layout::AbstractTabDialog_Impl
#endif /* ENABLE_LAYOUT */
-//add for ScSortDlg begin
+
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg( Window* pParent,
const SfxItemSet* pArgSet,int nId )
{
@@ -1542,7 +1592,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg( Window*
#undef SfxTabDialog
#undef AbstractTabDialog_Impl
-//add for ScSortDlg end
+
//------------------ Factories for TabPages--------------------
CreateTabPage ScAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nId )
{
@@ -1554,6 +1604,10 @@ CreateTabPage ScAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI
case RID_SCPAGE_CALC :
return ScTpCalcOptions::Create;
//break;
+ case RID_SCPAGE_FORMULA:
+ return ScTpFormulaOptions::Create;
+ case RID_SCPAGE_COMPATIBILITY:
+ return ScTpCompatOptions::Create;
case RID_SCPAGE_PRINT :
return ScTpPrintOptions::Create;
//break;
@@ -1591,10 +1645,4 @@ GetTabPageRanges ScAbstractDialogFactory_Impl::GetTabPageRangesFunc( sal_uInt16
return 0;
}
-void ScDPFunctionDlg_Dummy()
-{
- // use ScDPListBoxWrapper to avoid warning (this isn't called)
- ListBox* pListBox = NULL;
- ScDPListBoxWrapper aWrapper( *pListBox );
-}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 772661a1a10b..d1eaf2edbab0 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
#define _SC_DLGFACT_HXX
// include ---------------------------------------------------------------
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
class Dialog;
class ScImportAsciiDlg;
class ScAutoFormatDlg;
@@ -37,6 +38,7 @@ class ScDataPilotDatabaseDlg;
class ScDataPilotSourceTypeDlg;
class ScDataPilotServiceDlg;
class ScDeleteCellDlg;
+class ScDataFormDlg;
class ScDeleteContentsDlg;
class ScFillSeriesDlg;
class ScGroupDlg;
@@ -72,7 +74,6 @@ public: \
{} \
virtual ~Class(); \
virtual short Execute() ;
-// virtual void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 )
#define DECL_ABSTDLG2_BASE(Class,DialogClass) \
DialogClass* pDlg; \
@@ -144,8 +145,11 @@ class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDl
class AbstractScDataPilotSourceTypeDlg_Impl :public AbstractScDataPilotSourceTypeDlg //add for ScDataPilotSourceTypeDlg
{
DECL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl, ScDataPilotSourceTypeDlg)
- virtual sal_Bool IsDatabase() const;
- virtual sal_Bool IsExternal() const;
+ virtual bool IsDatabase() const;
+ virtual bool IsExternal() const;
+ virtual bool IsNamedRange() const;
+ virtual rtl::OUString GetSelectedNamedRange() const;
+ virtual void AppendNamedRange(const ::rtl::OUString& rName);
};
class AbstractScDataPilotServiceDlg_Impl : public AbstractScDataPilotServiceDlg //add for ScDataPilotServiceDlg
@@ -164,6 +168,12 @@ class AbstractScDeleteCellDlg_Impl : public AbstractScDeleteCellDlg //add for S
virtual DelCellCmd GetDelCellCmd() const;
};
+//for dataform
+class AbstractScDataFormDlg_Impl : public AbstractScDataFormDlg //add for ScDataFormDlg
+{
+ DECL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl,ScDataFormDlg);
+};
+
class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg //add for ScDeleteContentsDlg
{
DECL_ABSTDLG_BASE( AbstractScDeleteContentsDlg_Impl,ScDeleteContentsDlg)
@@ -181,7 +191,7 @@ class AbstractScFillSeriesDlg_Impl:public AbstractScFillSeriesDlg //add for ScF
virtual double GetStep() const;
virtual double GetMax() const;
virtual String GetStartStr() const;
- virtual void SetEdStartValEnabled(sal_Bool bFlag=sal_False);
+ virtual void SetEdStartValEnabled(sal_Bool bFlag=false);
};
class AbstractScGroupDlg_Impl : public AbstractScGroupDlg //add for ScGroupDlg
@@ -255,9 +265,12 @@ class AbstractScMoveTableDlg_Impl : public AbstractScMoveTableDlg //add for ScM
DECL_ABSTDLG_BASE( AbstractScMoveTableDlg_Impl, ScMoveTableDlg)
virtual sal_uInt16 GetSelectedDocument () const;
virtual sal_uInt16 GetSelectedTable () const;
- virtual sal_Bool GetCopyTable () const;
- virtual void SetCopyTable (sal_Bool bFlag=sal_True);
- virtual void EnableCopyTable (sal_Bool bFlag=sal_True);
+ virtual bool GetCopyTable () const;
+ virtual bool GetRenameTable () const;
+ virtual void GetTabNameString( String& rString ) const;
+ virtual void SetForceCopyTable ();
+ virtual void EnableCopyTable (sal_Bool bFlag=true);
+ virtual void EnableRenameTable (sal_Bool bFlag=true);
};
class AbstractScNameCreateDlg_Impl : public AbstractScNameCreateDlg //add for ScNameCreateDlg
@@ -362,11 +375,11 @@ class AbstractTabDialog_Impl : public SfxAbstractTabDialog
DECL_ABSTDLG_BASE( AbstractTabDialog_Impl,SfxTabDialog )
virtual void SetCurPageId( sal_uInt16 nId );
virtual const SfxItemSet* GetOutputItemSet() const;
- virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); //add by CHINA001
- virtual void SetInputSet( const SfxItemSet* pInSet ); //add by CHINA001
+ virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem );
+ virtual void SetInputSet( const SfxItemSet* pInSet );
//From class Window.
- virtual void SetText( const XubString& rStr ); //add by CHINA001
- virtual String GetText() const; //add by CHINA001
+ virtual void SetText( const XubString& rStr );
+ virtual String GetText() const;
};
#if ENABLE_LAYOUT
namespace layout
@@ -377,11 +390,11 @@ class AbstractTabDialog_Impl : public SfxAbstractTabDialog
DECL_ABSTDLG_BASE( AbstractTabDialog_Impl,SfxTabDialog )
virtual void SetCurPageId( sal_uInt16 nId );
virtual const SfxItemSet* GetOutputItemSet() const;
- virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); //add by CHINA001
- virtual void SetInputSet( const SfxItemSet* pInSet ); //add by CHINA001
+ virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem );
+ virtual void SetInputSet( const SfxItemSet* pInSet );
//From class Window.
- virtual void SetText( const XubString& rStr ); //add by CHINA001
- virtual String GetText() const; //add by CHINA001
+ virtual void SetText( const XubString& rStr );
+ virtual String GetText() const;
};
} // end namespace layout
#endif /* ENABLE_LAYOUT */
@@ -391,8 +404,6 @@ class ScAbstractDialogFactory_Impl : public ScAbstractDialogFactory
{
public:
- //CHINA001 AbstractSwSaveLabelDlg* CreateSwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec, int nId );
-
virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, String aDatName, //add for ScImportAsciiDlg
SvStream* pInStream, int nId,
sal_Unicode cSep = '\t');
@@ -406,8 +417,8 @@ public:
int nId);
virtual AbstractScColRowLabelDlg * CreateScColRowLabelDlg (Window* pParent, //add for ScColRowLabelDlg
int nId,
- sal_Bool bCol = sal_False,
- sal_Bool bRow = sal_False);
+ sal_Bool bCol = false,
+ sal_Bool bRow = false);
virtual VclAbstractDialog * CreateScColOrRowDlg( Window* pParent, //add for ScColOrRowDlg
const String& rStrTitle,
@@ -425,7 +436,10 @@ public:
const com::sun::star::uno::Sequence<rtl::OUString>& rServices,
int nId );
virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId,
- sal_Bool bDisallowCellMove = sal_False ); //add for ScDeleteCellDlg
+ sal_Bool bDisallowCellMove = false ); //add for ScDeleteCellDlg
+
+ //for dataform
+ virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell); //add for ScDeleteCellDlg
virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg
sal_uInt16 nCheckDefaults = 0 );
@@ -443,12 +457,12 @@ public:
virtual AbstractScGroupDlg * CreateAbstractScGroupDlg( Window* pParent, //add for ScGroupDlg
sal_uInt16 nResId,
int nId,
- sal_Bool bUnGroup = sal_False,
+ sal_Bool bUnGroup = false,
sal_Bool bRows = sal_True );
virtual AbstractScInsertCellDlg * CreateScInsertCellDlg( Window* pParent, //add for ScInsertCellDlg
int nId,
- sal_Bool bDisallowCellMove = sal_False );
+ sal_Bool bDisallowCellMove = false );
virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( Window* pParent, //add for ScInsertContentsDlg
int nId,
@@ -480,7 +494,10 @@ public:
long nFirst = 1,
long nLast = 100 );
- virtual AbstractScMoveTableDlg * CreateScMoveTableDlg( Window* pParent, int nId ); //add for ScMoveTableDlg
+ virtual AbstractScMoveTableDlg * CreateScMoveTableDlg( Window* pParent, //add for ScMoveTableDlg
+ const String& rDefault,
+ int nId );
+
virtual AbstractScNameCreateDlg * CreateScNameCreateDlg ( Window * pParent, sal_uInt16 nFlags, int nId ); //add for ScNameCreateDlg
virtual AbstractScNamePasteDlg * CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList, //add for ScNamePasteDlg
@@ -517,7 +534,7 @@ public:
virtual AbstractScNewScenarioDlg * CreateScNewScenarioDlg ( Window* pParent, const String& rName, //add for ScNewScenarioDlg
int nId,
- sal_Bool bEdit = sal_False, sal_Bool bSheetProtected = sal_False );
+ sal_Bool bEdit = false, sal_Bool bSheetProtected = false );
virtual AbstractScShowTabDlg * CreateScShowTabDlg ( Window* pParent, int nId ); //add for ScShowTabDlg
virtual AbstractScStringInputDlg * CreateScStringInputDlg ( Window* pParent, //add for ScStringInputDlg
@@ -539,8 +556,8 @@ public:
sal_Bool bAscii = sal_True,
const ScImportOptions* pOptions = NULL,
const String* pStrTitle = NULL,
- sal_Bool bMultiByte = sal_False,
- sal_Bool bOnlyDbtoolsEncodings = sal_False,
+ sal_Bool bMultiByte = false,
+ sal_Bool bOnlyDbtoolsEncodings = false,
sal_Bool bImport = sal_True );
virtual SfxAbstractTabDialog * CreateScAttrDlg( SfxViewFrame* pFrame, //add for ScAttrDlg
Window* pParent,
@@ -569,10 +586,7 @@ public:
int nId );
virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent, //add for ScValidationDlg
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- // const SfxItemSet* pArgSet,int nId );
const SfxItemSet* pArgSet,int nId, ScTabViewShell *pTabVwSh );
- //-->Modified by PengYunQuan for Validity Cell Range Picker
virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent, //add for ScSortDlg
const SfxItemSet* pArgSet,int nId );
@@ -583,11 +597,7 @@ public:
};
-//CHINA001 struct ScDialogsResMgr
-//CHINA001 {
-//CHINA001 static ResMgr* GetResMgr();
-//CHINA001 };
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx
index 35a0a3a1fb35..41ed3cdf9502 100644
--- a/sc/source/ui/attrdlg/scuiexp.cxx
+++ b/sc/source/ui/attrdlg/scuiexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ extern "C"
return ::scui::GetFactory();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index c18f166f6e5d..41f8a7939a47 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,7 +74,7 @@ ScTabPageProtection::ScTabPageProtection( Window* pParent,
SetExchangeSupport();
// States werden in Reset gesetzt
- bTriEnabled = bDontCare = bProtect = bHideForm = bHideCell = bHidePrint = sal_False;
+ bTriEnabled = bDontCare = bProtect = bHideForm = bHideCell = bHidePrint = false;
aBtnProtect.SetClickHdl( LINK( this, ScTabPageProtection, ButtonClickHdl ) );
aBtnHideCell.SetClickHdl( LINK( this, ScTabPageProtection, ButtonClickHdl ) );
@@ -85,20 +86,20 @@ ScTabPageProtection::ScTabPageProtection( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScTabPageProtection::~ScTabPageProtection()
+ScTabPageProtection::~ScTabPageProtection()
{
}
//------------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTabPageProtection::GetRanges()
+sal_uInt16* ScTabPageProtection::GetRanges()
{
return pProtectionRanges;
}
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTabPageProtection::Create( Window* pParent,
+SfxTabPage* ScTabPageProtection::Create( Window* pParent,
const SfxItemSet& rAttrSet )
{
return ( new ScTabPageProtection( pParent, rAttrSet ) );
@@ -106,13 +107,13 @@ SfxTabPage* __EXPORT ScTabPageProtection::Create( Window* pParent,
//------------------------------------------------------------------------
-void __EXPORT ScTabPageProtection::Reset( const SfxItemSet& rCoreAttrs )
+void ScTabPageProtection::Reset( const SfxItemSet& rCoreAttrs )
{
// Variablen initialisieren
sal_uInt16 nWhich = GetWhich( SID_SCATTR_PROTECTION );
const ScProtectionAttr* pProtAttr = NULL;
- SfxItemState eItemState = rCoreAttrs.GetItemState( nWhich, sal_False,
+ SfxItemState eItemState = rCoreAttrs.GetItemState( nWhich, false,
(const SfxPoolItem**)&pProtAttr );
// handelt es sich um ein Default-Item?
@@ -128,7 +129,7 @@ void __EXPORT ScTabPageProtection::Reset( const SfxItemSet& rCoreAttrs )
// (weil alles zusammen ein Attribut ist, kann auch nur alles zusammen
// auf DontCare stehen - #38543#)
bProtect = sal_True;
- bHideForm = bHideCell = bHidePrint = sal_False;
+ bHideForm = bHideCell = bHidePrint = false;
}
else
{
@@ -150,13 +151,13 @@ void __EXPORT ScTabPageProtection::Reset( const SfxItemSet& rCoreAttrs )
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScTabPageProtection::FillItemSet( SfxItemSet& rCoreAttrs )
+sal_Bool ScTabPageProtection::FillItemSet( SfxItemSet& rCoreAttrs )
{
- sal_Bool bAttrsChanged = sal_False;
+ sal_Bool bAttrsChanged = false;
sal_uInt16 nWhich = GetWhich( SID_SCATTR_PROTECTION );
const SfxPoolItem* pOldItem = GetOldItem( rCoreAttrs, SID_SCATTR_PROTECTION );
const SfxItemSet& rOldSet = GetItemSet();
- SfxItemState eItemState = rOldSet.GetItemState( nWhich, sal_False );
+ SfxItemState eItemState = rOldSet.GetItemState( nWhich, false );
ScProtectionAttr aProtAttr;
if ( !bDontCare )
@@ -184,7 +185,7 @@ sal_Bool __EXPORT ScTabPageProtection::FillItemSet( SfxItemSet& rCoreAttrs )
//------------------------------------------------------------------------
-int __EXPORT ScTabPageProtection::DeactivatePage( SfxItemSet* pSetP )
+int ScTabPageProtection::DeactivatePage( SfxItemSet* pSetP )
{
if ( pSetP )
FillItemSet( *pSetP );
@@ -201,7 +202,7 @@ IMPL_LINK( ScTabPageProtection, ButtonClickHdl, TriStateBox*, pBox )
bDontCare = sal_True; // alles zusammen auf DontCare
else
{
- bDontCare = sal_False; // DontCare ueberall aus
+ bDontCare = false; // DontCare ueberall aus
sal_Bool bOn = ( eState == STATE_CHECK ); // ausgewaehlter Wert
if ( pBox == &aBtnProtect )
@@ -248,3 +249,5 @@ void ScTabPageProtection::UpdateButtons()
aBtnHideFormula.Enable( bEnable );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index 79b9e4cb302f..823aec21d053 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ ScDDComboBoxButton::ScDDComboBoxButton( OutputDevice* pOutputDevice )
// -------------------------------------------------------------------------
-__EXPORT ScDDComboBoxButton::~ScDDComboBoxButton()
+ScDDComboBoxButton::~ScDDComboBoxButton()
{
}
@@ -87,7 +88,7 @@ void ScDDComboBoxButton::Draw( const Point& rAt,
Rectangle aBtnRect( rAt, rSize );
Rectangle aInnerRect = aBtnRect;
- pOut->EnableMapMode( sal_False );
+ pOut->EnableMapMode( false );
DecorationView aDecoView( pOut);
@@ -176,3 +177,4 @@ void ScDDComboBoxButton::ImpDrawArrow( const Rectangle& rRect,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 3370574158ab..2a5d415410dc 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,7 +57,7 @@ using ::com::sun::star::accessibility::XAccessibleContext;
using ::rtl::OUString;
using ::rtl::OUStringHash;
using ::std::vector;
-using ::std::hash_map;
+using ::boost::unordered_map;
using ::std::auto_ptr;
ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY, ScDocument* pDoc) :
@@ -310,7 +311,7 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, sa
PopupMenuFloatingWindow(pParent),
maOpenTimer(this),
maCloseTimer(this),
- maName(OUString::createFromAscii("ScMenuFloatingWindow")),
+ maName(RTL_CONSTASCII_USTRINGPARAM("ScMenuFloatingWindow")),
mnSelectedMenu(MENU_NOT_SELECTED),
mnClickedMenu(MENU_NOT_SELECTED),
mpDoc(pDoc),
@@ -326,7 +327,7 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, sa
maLabelFont.SetHeight(nPopupFontHeight);
SetFont(maLabelFont);
- SetText(OUString::createFromAscii("ScMenuFloatingWindow"));
+ SetText( OUString(RTL_CONSTASCII_USTRINGPARAM("ScMenuFloatingWindow")) );
SetPopupModeEndHdl( LINK(this, ScMenuFloatingWindow, PopupEndHdl) );
}
@@ -1009,7 +1010,6 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc) :
Size aSize;
getSectionPosSize(aPos, aSize, WHOLE);
SetOutputSizePixel(aSize);
- Size aOutSize = GetOutputSizePixel();
getSectionPosSize(aPos, aSize, BTN_OK);
maBtnOk.SetPosSizePixel(aPos, aSize);
@@ -1039,14 +1039,14 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc) :
getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT);
maBtnSelectSingle.SetPosSizePixel(aPos, aSize);
maBtnSelectSingle.SetQuickHelpText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_SELECT_CURRENT).GetString());
- maBtnSelectSingle.SetModeImage(Image(ScResId(RID_IMG_SELECT_CURRENT)), BMP_COLOR_NORMAL);
+ maBtnSelectSingle.SetModeImage(Image(ScResId(RID_IMG_SELECT_CURRENT)));
maBtnSelectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) );
maBtnSelectSingle.Show();
getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT);
maBtnUnselectSingle.SetPosSizePixel(aPos, aSize);
maBtnUnselectSingle.SetQuickHelpText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_UNSELECT_CURRENT).GetString());
- maBtnUnselectSingle.SetModeImage(Image(ScResId(RID_IMG_UNSELECT_CURRENT)), BMP_COLOR_NORMAL);
+ maBtnUnselectSingle.SetModeImage(Image(ScResId(RID_IMG_UNSELECT_CURRENT)));
maBtnUnselectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) );
maBtnUnselectSingle.Show();
}
@@ -1384,9 +1384,9 @@ const Size& ScDPFieldPopupWindow::getWindowSize() const
return maWndSize;
}
-void ScDPFieldPopupWindow::getResult(hash_map<OUString, bool, OUStringHash>& rResult)
+void ScDPFieldPopupWindow::getResult(boost::unordered_map<OUString, bool, OUStringHash>& rResult)
{
- typedef hash_map<OUString, bool, OUStringHash> ResultMap;
+ typedef boost::unordered_map<OUString, bool, OUStringHash> ResultMap;
ResultMap aResult;
size_t n = maMembers.size();
for (size_t i = 0; i < n; ++i)
@@ -1420,3 +1420,4 @@ void ScDPFieldPopupWindow::setOKAction(Action* p)
mpOKAction.reset(p);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx
index 4358694f6b04..d52ccefea685 100644
--- a/sc/source/ui/cctrl/editfield.cxx
+++ b/sc/source/ui/cctrl/editfield.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,4 @@ void ScDoubleField::SetValue( double fValue, sal_Int32 nDecPlaces, bool bEraseTr
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/makefile.mk b/sc/source/ui/cctrl/makefile.mk
index 531013ea1c2e..41598f7901c1 100644
--- a/sc/source/ui/cctrl/makefile.mk
+++ b/sc/source/ui/cctrl/makefile.mk
@@ -33,24 +33,21 @@ LIBTARGET=NO
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
EXCEPTIONSFILES= \
- $(SLO)$/tbinsert.obj \
- $(SLO)$/tbzoomsliderctrl.obj \
- $(SLO)$/dpcontrol.obj
+ $(SLO)$/cbuttonw.obj \
+ $(SLO)$/dpcontrol.obj \
+ $(SLO)$/editfield.obj \
+ $(SLO)$/tbinsert.obj \
+ $(SLO)$/tbzoomsliderctrl.obj
SLOFILES = \
+ $(SLO)$/dpcontrol.obj \
$(SLO)$/popmenu.obj \
- $(SLO)$/tbinsert.obj \
- $(SLO)$/cbuttonw.obj \
- $(SLO)$/dpcontrol.obj \
- $(SLO)$/editfield.obj \
$(EXCEPTIONSFILES)
SRS1NAME=$(TARGET)
diff --git a/sc/source/ui/cctrl/popmenu.cxx b/sc/source/ui/cctrl/popmenu.cxx
index f7eb8aa1f4e9..0f0e135e08b4 100644
--- a/sc/source/ui/cctrl/popmenu.cxx
+++ b/sc/source/ui/cctrl/popmenu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@
//------------------------------------------------------------------
-void __EXPORT ScPopupMenu::Select()
+void ScPopupMenu::Select()
{
nSel = GetCurItemId();
bHit = sal_True;
@@ -46,3 +47,4 @@ void __EXPORT ScPopupMenu::Select()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx
index 930bddb0799f..191adb337664 100644
--- a/sc/source/ui/cctrl/tbinsert.cxx
+++ b/sc/source/ui/cctrl/tbinsert.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,8 +31,7 @@
// System - Includes -----------------------------------------------------
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
-
+#include <string>
// INCLUDE ---------------------------------------------------------------
@@ -69,11 +69,11 @@ ScTbxInsertCtrl::ScTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& r
rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) );
}
-__EXPORT ScTbxInsertCtrl::~ScTbxInsertCtrl()
+ScTbxInsertCtrl::~ScTbxInsertCtrl()
{
}
-void __EXPORT ScTbxInsertCtrl::StateChanged( sal_uInt16 /* nSID */, SfxItemState eState,
+void ScTbxInsertCtrl::StateChanged( sal_uInt16 /* nSID */, SfxItemState eState,
const SfxPoolItem* pState )
{
GetToolBox().EnableItem( GetId(), (GetItemState(pState) != SFX_ITEM_DISABLED) );
@@ -90,56 +90,40 @@ void __EXPORT ScTbxInsertCtrl::StateChanged( sal_uInt16 /* nSID */, SfxItemState
aSlotURL += rtl::OUString::valueOf( sal_Int32( nImageId ));
Image aImage = GetImage( m_xFrame,
aSlotURL,
- hasBigImages(),
- GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode() );
+ hasBigImages()
+ );
GetToolBox().SetItemImage(GetId(), aImage);
}
}
}
-SfxPopupWindow* __EXPORT ScTbxInsertCtrl::CreatePopupWindow()
+SfxPopupWindow* ScTbxInsertCtrl::CreatePopupWindow()
{
-// sal_uInt16 nWinResId, nTbxResId;
sal_uInt16 nSlotId = GetSlotId();
if (nSlotId == SID_TBXCTL_INSERT)
{
rtl::OUString aInsertBarResStr( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/insertbar" ));
createAndPositionSubToolBar( aInsertBarResStr );
-// nWinResId = RID_TBXCTL_INSERT;
-// nTbxResId = RID_TOOLBOX_INSERT;
}
else if (nSlotId == SID_TBXCTL_INSCELLS)
{
rtl::OUString aInsertCellsBarResStr( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/insertcellsbar" ));
createAndPositionSubToolBar( aInsertCellsBarResStr );
-// nWinResId = RID_TBXCTL_INSCELLS;
-// nTbxResId = RID_TOOLBOX_INSCELLS;
}
- else /* SID_TBXCTL_INSOBJ */
+ else
{
rtl::OUString aInsertObjectBarResStr( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/insertobjectbar" ));
createAndPositionSubToolBar( aInsertObjectBarResStr );
-// nWinResId = RID_TBXCTL_INSOBJ;
-// nTbxResId = RID_TOOLBOX_INSOBJ;
}
-/*
- WindowAlign eNewAlign = ( GetToolBox().IsHorizontal() ) ? WINDOWALIGN_LEFT : WINDOWALIGN_TOP;
- ScTbxInsertPopup *pWin = new ScTbxInsertPopup( nSlotId, eNewAlign,
- ScResId(nWinResId), ScResId(nTbxResId), GetBindings() );
- pWin->StartPopupMode(&GetToolBox(), sal_True);
- pWin->StartSelection();
- pWin->Show();
- return pWin;
-*/
return NULL;
}
-SfxPopupWindowType __EXPORT ScTbxInsertCtrl::GetPopupWindowType() const
+SfxPopupWindowType ScTbxInsertCtrl::GetPopupWindowType() const
{
return nLastSlotId ? SFX_POPUPWINDOW_ONTIMEOUT : SFX_POPUPWINDOW_ONCLICK;
}
-void __EXPORT ScTbxInsertCtrl::Select( sal_Bool /* bMod1 */ )
+void ScTbxInsertCtrl::Select( sal_Bool /* bMod1 */ )
{
SfxViewShell* pCurSh( SfxViewShell::Current() );
SfxDispatcher* pDispatch( 0 );
@@ -154,79 +138,6 @@ void __EXPORT ScTbxInsertCtrl::Select( sal_Bool /* bMod1 */ )
if ( pDispatch )
pDispatch->Execute(nLastSlotId);
}
-/*
-//------------------------------------------------------------------
-//
-// Popup - Window
-//
-//------------------------------------------------------------------
-
-ScTbxInsertPopup::ScTbxInsertPopup( sal_uInt16 nId, WindowAlign eNewAlign,
- const ResId& rRIdWin, const ResId& rRIdTbx,
- SfxBindings& rBindings ) :
- SfxPopupWindow ( nId, rRIdWin, rBindings),
- aTbx ( this, GetBindings(), rRIdTbx ),
- aRIdWinTemp(rRIdWin),
- aRIdTbxTemp(rRIdTbx)
-{
- aTbx.UseDefault();
- FreeResource();
-
- aTbx.GetToolBox().SetAlign( eNewAlign );
- if (eNewAlign == WINDOWALIGN_LEFT || eNewAlign == WINDOWALIGN_RIGHT)
- SetText( EMPTY_STRING );
-
- Size aSize = aTbx.CalcWindowSizePixel();
- aTbx.SetPosSizePixel( Point(), aSize );
- SetOutputSizePixel( aSize );
- aTbx.GetToolBox().SetSelectHdl( LINK(this, ScTbxInsertPopup, TbxSelectHdl));
- aTbxClickHdl = aTbx.GetToolBox().GetClickHdl();
- aTbx.GetToolBox().SetClickHdl( LINK(this, ScTbxInsertPopup, TbxClickHdl));
-}
-
-ScTbxInsertPopup::~ScTbxInsertPopup()
-{
-}
-
-SfxPopupWindow* __EXPORT ScTbxInsertPopup::Clone() const
-{
- return new ScTbxInsertPopup( GetId(), aTbx.GetToolBox().GetAlign(),
- aRIdWinTemp, aRIdTbxTemp,
- (SfxBindings&) GetBindings() );
-}
-
-void ScTbxInsertPopup::StartSelection()
-{
- aTbx.GetToolBox().StartSelection();
-}
-
-IMPL_LINK(ScTbxInsertPopup, TbxSelectHdl, ToolBox*, pBox)
-{
- EndPopupMode();
-
- sal_uInt16 nLastSlotId = pBox->GetCurItemId();
- SfxUInt16Item aItem( GetId(), nLastSlotId );
- SfxDispatcher* pDisp = GetBindings().GetDispatcher();
- pDisp->Execute( GetId(), SFX_CALLMODE_SYNCHRON, &aItem, 0L );
- pDisp->Execute( nLastSlotId, SFX_CALLMODE_ASYNCHRON );
- return 0;
-}
-
-IMPL_LINK(ScTbxInsertPopup, TbxClickHdl, ToolBox*, pBox)
-{
- sal_uInt16 nLastSlotId = pBox->GetCurItemId();
- SfxUInt16Item aItem( GetId(), nLastSlotId );
- GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_SYNCHRON, &aItem, 0L );
- if(aTbxClickHdl.IsSet())
- aTbxClickHdl.Call(pBox);
- return 0;
-}
-
-void __EXPORT ScTbxInsertPopup::PopupModeEnd()
-{
- aTbx.GetToolBox().EndSelection();
- SfxPopupWindow::PopupModeEnd();
-}
-*/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index f2557d16e4de..575269c5a0ec 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,21 +26,11 @@
*
************************************************************************/
#include "precompiled_sc.hxx"
-#ifndef _SC_ZOOMSLIDERTBCONTRL_HXX
#include "tbzoomsliderctrl.hxx"
-#endif
-#ifndef _SV_IMAGE_HXX
#include <vcl/image.hxx>
-#endif
-#ifndef _SV_TOOLBOX_HXX
#include <vcl/toolbox.hxx>
-#endif
-#ifndef _SV_SVAPP_HXX
#include <vcl/svapp.hxx>
-#endif
-#ifndef _SV_GRADIENT_HXX
#include <vcl/gradient.hxx>
-#endif
#include <svl/itemset.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
@@ -73,7 +64,7 @@ ScZoomSliderControl::ScZoomSliderControl(
// -----------------------------------------------------------------------
-__EXPORT ScZoomSliderControl::~ScZoomSliderControl()
+ScZoomSliderControl::~ScZoomSliderControl()
{
}
@@ -265,10 +256,9 @@ ScZoomSliderWnd::ScZoomSliderWnd( Window* pParent, const ::com::sun::star::uno::
m_xDispatchProvider( rDispatchProvider ),
m_xFrame( _xFrame )
{
- sal_Bool bIsHC = GetSettings().GetStyleSettings().GetHighContrastMode();
- mpImpl->maSliderButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERBUTTON_HC : RID_SVXBMP_SLIDERBUTTON ) );
- mpImpl->maIncreaseButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERINCREASE_HC : RID_SVXBMP_SLIDERINCREASE ) );
- mpImpl->maDecreaseButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERDECREASE_HC : RID_SVXBMP_SLIDERDECREASE ) );
+ mpImpl->maSliderButton = Image( SVX_RES( RID_SVXBMP_SLIDERBUTTON ) );
+ mpImpl->maIncreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERINCREASE ) );
+ mpImpl->maDecreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERDECREASE ) );
Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MAP_10TH_MM ) );
SetSizePixel( Size( aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight ) );
}
@@ -538,3 +528,5 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ )
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index a518860b1690..c0b9305ba3ee 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,22 +44,22 @@
// ============================================================================
-static const sal_Char __FAR_DATA pStrFix[] = "FIX";
-static const sal_Char __FAR_DATA pStrMrg[] = "MRG";
+static const sal_Char pStrFix[] = "FIX";
+static const sal_Char pStrMrg[] = "MRG";
// ============================================================================
ScAsciiOptions::ScAsciiOptions() :
- bFixedLen ( sal_False ),
+ bFixedLen ( false ),
aFieldSeps ( ';' ),
- bMergeFieldSeps ( sal_False ),
+ bMergeFieldSeps ( false ),
bQuotedFieldAsText(false),
bDetectSpecialNumber(false),
cTextSep ( cDefaultTextSep ),
eCharSet ( gsl_getSystemTextEncoding() ),
eLang ( LANGUAGE_SYSTEM ),
- bCharSetSystem ( sal_False ),
+ bCharSetSystem ( false ),
nStartRow ( 1 ),
nInfoCount ( 0 ),
pColStart ( NULL ),
@@ -185,11 +186,11 @@ sal_Bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
for (sal_uInt16 i=0; i<nInfoCount; i++)
if ( pColStart[i] != rCmp.pColStart[i] ||
pColFormat[i] != rCmp.pColFormat[i] )
- return sal_False;
+ return false;
return sal_True;
}
- return sal_False;
+ return false;
}
//
@@ -211,7 +212,7 @@ void ScAsciiOptions::ReadFromString( const String& rString )
if ( nCount >= 1 )
{
- bFixedLen = bMergeFieldSeps = sal_False;
+ bFixedLen = bMergeFieldSeps = false;
aFieldSeps.Erase();
aToken = rString.GetToken(0,',');
@@ -408,79 +409,4 @@ String ScAsciiOptions::WriteToString() const
return aOutStr;
}
-#if 0
-// Code, um die Spalten-Liste aus einem Excel-kompatiblen String zu erzeugen:
-// (im Moment nicht benutzt)
-
-void ScAsciiOptions::InterpretColumnList( const String& rString )
-{
- // Eingabe ist 1-basiert, pColStart fuer FixedLen ist 0-basiert
-
- // Kommas durch Semikolon ersetzen
-
- String aSemiStr = rString;
- sal_uInt16 nPos = 0;
- do
- nPos = aSemiStr.SearchAndReplace( ',', ';', nPos );
- while ( nPos != STRING_NOTFOUND );
-
- // Eintraege sortieren
-
- sal_uInt16 nCount = aSemiStr.GetTokenCount();
- sal_uInt16* pTemp = new sal_uInt16[nCount+1];
- pTemp[0] = 1; // erste Spalte faengt immer bei 1 an
- sal_uInt16 nFound = 1;
- sal_uInt16 i,j;
- for (i=0; i<nCount; i++)
- {
- sal_uInt16 nVal = (sal_uInt16) aSemiStr.GetToken(i);
- if (nVal)
- {
- sal_Bool bThere = sal_False;
- nPos = 0;
- for (j=0; j<nFound; j++)
- {
- if ( pTemp[j] == nVal )
- bThere = sal_True;
- else if ( pTemp[j] < nVal )
- nPos = j+1;
- }
- if ( !bThere )
- {
- if ( nPos < nFound )
- memmove( &pTemp[nPos+1], &pTemp[nPos], (nFound-nPos)*sizeof(sal_uInt16) );
- pTemp[nPos] = nVal;
- ++nFound;
- }
- }
- }
-
- // Eintraege uebernehmen
-
- delete[] pColStart;
- delete[] pColFormat;
- nInfoCount = nFound;
- if (nInfoCount)
- {
- pColStart = new sal_uInt16[nInfoCount];
- pColFormat = new sal_uInt8[nInfoCount];
- for (i=0; i<nInfoCount; i++)
- {
- pColStart[i] = pTemp[i] - 1;
- pColFormat[i] = SC_COL_STANDARD;
- }
- }
- else
- {
- pColStart = NULL;
- pColFormat = NULL;
- }
-
- bFixedLen = sal_True; // sonst macht's keinen Sinn
-
- // aufraeumen
-
- delete[] pTemp;
-}
-#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/asciiopt.hrc b/sc/source/ui/dbgui/asciiopt.hrc
index 7bf6d42d6e2f..6e1c9ae92877 100644
--- a/sc/source/ui/dbgui/asciiopt.hrc
+++ b/sc/source/ui/dbgui/asciiopt.hrc
@@ -25,7 +25,7 @@
*
************************************************************************/
#include "sc.hrc"
-//#define RID_SCDLG_ASCII 256
+
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
@@ -60,12 +60,3 @@
#define LB_TYPE1 28
#define CTR_TABLEBOX 29
#define STR_TEXTTOCOLUMNS 30
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/dbgui/asciiopt.src b/sc/source/ui/dbgui/asciiopt.src
index 5ddaba95d4df..94008212c263 100644
--- a/sc/source/ui/dbgui/asciiopt.src
+++ b/sc/source/ui/dbgui/asciiopt.src
@@ -275,48 +275,3 @@ ModalDialog RID_SCDLG_ASCII
Text [ en-US ] = "Text to Columns" ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 5256dbc1627c..3ac55d55cc12 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -141,7 +142,7 @@ ScConsolidateDlg::ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
//----------------------------------------------------------------------------
-__EXPORT ScConsolidateDlg::~ScConsolidateDlg()
+ScConsolidateDlg::~ScConsolidateDlg()
{
delete [] pAreaData;
delete pRangeUtil;
@@ -221,7 +222,7 @@ void ScConsolidateDlg::Init()
ScRangeName* pRangeNames = pDoc->GetRangeName();
ScDBCollection* pDbNames = pDoc->GetDBCollection();
- const sal_uInt16 nRangeCount = pRangeNames ? pRangeNames->GetCount() : 0;
+ const sal_uInt16 nRangeCount = pRangeNames ? pRangeNames->size() : 0;
const sal_uInt16 nDbCount = pDbNames ? pDbNames ->GetCount() : 0;
nAreaDataCount = nRangeCount+nDbCount;
@@ -314,7 +315,7 @@ void ScConsolidateDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScConsolidateDlg::Close()
+sal_Bool ScConsolidateDlg::Close()
{
return DoClose( ScConsolidateDlgWrapper::GetChildWindowId() );
}
@@ -326,7 +327,7 @@ void ScConsolidateDlg::SetActive()
{
if ( bDlgLostFocus )
{
- bDlgLostFocus = sal_False;
+ bDlgLostFocus = false;
if ( pRefInputEdit )
{
@@ -343,7 +344,7 @@ void ScConsolidateDlg::SetActive()
//----------------------------------------------------------------------------
-void __EXPORT ScConsolidateDlg::Deactivate()
+void ScConsolidateDlg::Deactivate()
{
bDlgLostFocus = sal_True;
}
@@ -355,10 +356,10 @@ sal_Bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd )
{
if ( !pRangeUtil || !pDoc || !pViewData ||
((pEd != &aEdDataArea) && (pEd != &aEdDestArea)) )
- return sal_False;
+ return false;
SCTAB nTab = pViewData->GetTabNo();
- sal_Bool bEditOk = sal_False;
+ sal_Bool bEditOk = false;
String theCompleteStr;
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
@@ -449,7 +450,7 @@ IMPL_LINK( ScConsolidateDlg, OkHdl, void*, EMPTYARG )
ScConsolidateItem aOutItem( nWhichCons, &theOutParam );
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
GetBindings().GetDispatcher()->Execute( SID_CONSOLIDATE,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
@@ -653,3 +654,4 @@ sal_uInt16 ScConsolidateDlg::FuncToLbPos( ScSubTotalFunc eFunc )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/consdlg.hrc b/sc/source/ui/dbgui/consdlg.hrc
index 6f9f6708c388..0e52b94ce052 100644
--- a/sc/source/ui/dbgui/consdlg.hrc
+++ b/sc/source/ui/dbgui/consdlg.hrc
@@ -58,4 +58,3 @@
#define FL_OPTIONS 60
#define BTN_REFS 61
-
diff --git a/sc/source/ui/dbgui/consdlg.src b/sc/source/ui/dbgui/consdlg.src
index 4dad5dcb3cee..394dd80ac9b4 100644
--- a/sc/source/ui/dbgui/consdlg.src
+++ b/sc/source/ui/dbgui/consdlg.src
@@ -228,4 +228,3 @@ ModelessDialog RID_SCDLG_CONSOLIDATE
TabStop = TRUE ;
};
};
-
diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx
index 0dbc4e7dab39..3455fa72c1fd 100644
--- a/sc/source/ui/dbgui/csvcontrol.cxx
+++ b/sc/source/ui/dbgui/csvcontrol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -335,3 +336,4 @@ ScCsvControl::XAccessibleRef ScCsvControl::CreateAccessible()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 92a25c326641..15a0eb4e10cd 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,8 +34,11 @@
#include "csvgrid.hxx"
#include <algorithm>
+#include <memory>
+
#include <svtools/colorcfg.hxx>
#include <svl/smplhint.hxx>
+#include <sal/macros.h>
#include <tools/poly.hxx>
#include "scmod.hxx"
#include "asciiopt.hxx"
@@ -60,14 +64,16 @@ struct Func_SetType
{
sal_Int32 mnType;
inline Func_SetType( sal_Int32 nType ) : mnType( nType ) {}
- inline void operator()( ScCsvColState& rState ) { rState.mnType = mnType; }
+ inline void operator()( ScCsvColState& rState ) const
+ { rState.mnType = mnType; }
};
struct Func_Select
{
bool mbSelect;
inline Func_Select( bool bSelect ) : mbSelect( bSelect ) {}
- inline void operator()( ScCsvColState& rState ) { rState.Select( mbSelect ); }
+ inline void operator()( ScCsvColState& rState ) const
+ { rState.Select( mbSelect ); }
};
@@ -75,8 +81,8 @@ struct Func_Select
ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) :
ScCsvControl( rParent ),
- mrColorConfig( SC_MOD()->GetColorConfig() ),
- mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), sal_True ) ),
+ mpColorConfig( 0 ),
+ mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), true ) ),
maHeaderFont( GetFont() ),
maColStates( 1 ),
maTypeNames( 1 ),
@@ -89,18 +95,26 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) :
maPopup.SetMenuFlags( maPopup.GetMenuFlags() | MENU_FLAG_NOAUTOMNEMONICS );
- EnableRTL( false ); // #107812# RTL
- InitColors();
+ EnableRTL( false ); // RTL
InitFonts();
ImplClearSplits();
- mrColorConfig.AddListener(this);
}
ScCsvGrid::~ScCsvGrid()
{
- mrColorConfig.RemoveListener(this);
+ OSL_ENSURE(mpColorConfig, "the object hasn't been initialized properly");
+ if (mpColorConfig)
+ mpColorConfig->RemoveListener(this);
}
+void
+ScCsvGrid::Init()
+{
+ OSL_PRECOND(!mpColorConfig, "the object has already been initialized");
+ mpColorConfig = &SC_MOD()->GetColorConfig();
+ InitColors();
+ mpColorConfig->AddListener(this);
+}
// common grid handling -------------------------------------------------------
@@ -199,11 +213,14 @@ sal_Int32 ScCsvGrid::GetNoScrollCol( sal_Int32 nPos ) const
void ScCsvGrid::InitColors()
{
- maBackColor.SetColor( static_cast< sal_uInt32 >( mrColorConfig.GetColorValue( ::svtools::DOCCOLOR ).nColor ) );
- maGridColor.SetColor( static_cast< sal_uInt32 >( mrColorConfig.GetColorValue( ::svtools::CALCGRID ).nColor ) );
- maGridPBColor.SetColor( static_cast< sal_uInt32 >( mrColorConfig.GetColorValue( ::svtools::CALCPAGEBREAK ).nColor ) );
- maAppBackColor.SetColor( static_cast< sal_uInt32 >( mrColorConfig.GetColorValue( ::svtools::APPBACKGROUND ).nColor ) );
- maTextColor.SetColor( static_cast< sal_uInt32 >( mrColorConfig.GetColorValue( ::svtools::FONTCOLOR ).nColor ) );
+ OSL_PRECOND(mpColorConfig, "the object hasn't been initialized properly");
+ if ( !mpColorConfig )
+ return;
+ maBackColor.SetColor( static_cast< sal_uInt32 >( mpColorConfig->GetColorValue( ::svtools::DOCCOLOR ).nColor ) );
+ maGridColor.SetColor( static_cast< sal_uInt32 >( mpColorConfig->GetColorValue( ::svtools::CALCGRID ).nColor ) );
+ maGridPBColor.SetColor( static_cast< sal_uInt32 >( mpColorConfig->GetColorValue( ::svtools::CALCPAGEBREAK ).nColor ) );
+ maAppBackColor.SetColor( static_cast< sal_uInt32 >( mpColorConfig->GetColorValue( ::svtools::APPBACKGROUND ).nColor ) );
+ maTextColor.SetColor( static_cast< sal_uInt32 >( mpColorConfig->GetColorValue( ::svtools::FONTCOLOR ).nColor ) );
const StyleSettings& rSett = GetSettings().GetStyleSettings();
maHeaderBackColor = rSett.GetFaceColor();
@@ -507,7 +524,7 @@ sal_uInt8 lcl_GetExtColumnType( sal_Int32 nIntType )
{
static sal_uInt8 pExtTypes[] =
{ SC_COL_STANDARD, SC_COL_TEXT, SC_COL_DMY, SC_COL_MDY, SC_COL_YMD, SC_COL_ENGLISH, SC_COL_SKIP };
- static sal_Int32 nExtTypeCount = sizeof( pExtTypes ) / sizeof( *pExtTypes );
+ static sal_Int32 nExtTypeCount = SAL_N_ELEMENTS(pExtTypes);
return pExtTypes[ ((0 <= nIntType) && (nIntType < nExtTypeCount)) ? nIntType : 0 ];
}
@@ -1347,9 +1364,12 @@ void ScCsvGrid::ImplDrawTrackingRect( sal_uInt32 nColIndex )
ScAccessibleCsvControl* ScCsvGrid::ImplCreateAccessible()
{
- return new ScAccessibleCsvGrid( *this );
+ std::auto_ptr<ScAccessibleCsvControl> pControl(new ScAccessibleCsvGrid( *this ));
+ pControl->Init();
+ return pControl.release();
}
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index a8f75992cb7f..dbc21d51afb2 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,9 +40,10 @@
#include <com/sun/star/uno/Sequence.hxx>
#include "miscuno.hxx"
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
// ============================================================================
@@ -60,9 +62,9 @@ static void load_FixedWidthList(ScCsvSplits &aSplits)
const Any *pProperties;
Sequence<OUString> aNames(1);
OUString* pNames = aNames.getArray();
- ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
+ ScLinkConfigItem aItem( OUString(RTL_CONSTASCII_USTRINGPARAM( SEP_PATH )) );
- pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST );
+ pNames[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FIXED_WIDTH_LIST ));
aValues = aItem.GetProperties( aNames );
pProperties = aValues.getConstArray();
@@ -95,9 +97,9 @@ static void save_FixedWidthList(ScCsvSplits aSplits)
Any *pProperties;
Sequence<OUString> aNames(1);
OUString* pNames = aNames.getArray();
- ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
+ ScLinkConfigItem aItem( OUString(RTL_CONSTASCII_USTRINGPARAM( SEP_PATH )) );
- pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST );
+ pNames[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FIXED_WIDTH_LIST ));
aValues = aItem.GetProperties( aNames );
pProperties = aValues.getArray();
pProperties[0] <<= sFixedWidthLists;
@@ -109,7 +111,7 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) :
ScCsvControl( rParent ),
mnPosCursorLast( 1 )
{
- EnableRTL( false ); // #107812# RTL
+ EnableRTL( false ); // RTL
InitColors();
InitSizeData();
maBackgrDev.SetFont( GetFont() );
@@ -680,3 +682,4 @@ ScAccessibleCsvControl* ScCsvRuler::ImplCreateAccessible()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvsplits.cxx b/sc/source/ui/dbgui/csvsplits.cxx
index b93bb09b5151..5215f3f9a799 100644
--- a/sc/source/ui/dbgui/csvsplits.cxx
+++ b/sc/source/ui/dbgui/csvsplits.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,3 +119,4 @@ sal_uInt32 ScCsvSplits::GetIterIndex( const_iterator aIter ) const
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index 842f1cc81dea..9972ae6f364a 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,17 +40,6 @@
// ============================================================================
-//UNUSED2009-05 ScCsvTableBox::ScCsvTableBox( Window* pParent ) :
-//UNUSED2009-05 ScCsvControl( pParent, maData, WB_BORDER | WB_TABSTOP | WB_DIALOGCONTROL ),
-//UNUSED2009-05 maRuler( *this ),
-//UNUSED2009-05 maGrid( *this ),
-//UNUSED2009-05 maHScroll( this, WB_HORZ | WB_DRAG ),
-//UNUSED2009-05 maVScroll( this, WB_VERT | WB_DRAG ),
-//UNUSED2009-05 maScrollBox( this )
-//UNUSED2009-05 {
-//UNUSED2009-05 Init();
-//UNUSED2009-05 }
-
ScCsvTableBox::ScCsvTableBox( Window* pParent, const ResId& rResId ) :
ScCsvControl( pParent, maData, rResId ),
maRuler( *this ),
@@ -58,7 +48,27 @@ ScCsvTableBox::ScCsvTableBox( Window* pParent, const ResId& rResId ) :
maVScroll( this, WB_VERT | WB_DRAG ),
maScrollBox( this )
{
- Init();
+ mbFixedMode = false;
+ mnFixedWidth = 1;
+
+ maHScroll.EnableRTL( false ); // RTL
+ maHScroll.SetLineSize( 1 );
+ maVScroll.SetLineSize( 1 );
+
+ Link aLink = LINK( this, ScCsvTableBox, CsvCmdHdl );
+ SetCmdHdl( aLink );
+ maRuler.SetCmdHdl( aLink );
+ maGrid.SetCmdHdl( aLink );
+
+ aLink = LINK( this, ScCsvTableBox, ScrollHdl );
+ maHScroll.SetScrollHdl( aLink );
+ maVScroll.SetScrollHdl( aLink );
+
+ aLink = LINK( this, ScCsvTableBox, ScrollEndHdl );
+ maHScroll.SetEndScrollHdl( aLink );
+ maVScroll.SetEndScrollHdl( aLink );
+
+ InitControls();
}
@@ -105,27 +115,7 @@ void ScCsvTableBox::SetFixedWidthMode()
void ScCsvTableBox::Init()
{
- mbFixedMode = false;
- mnFixedWidth = 1;
-
- maHScroll.EnableRTL( false ); // #107812# RTL
- maHScroll.SetLineSize( 1 );
- maVScroll.SetLineSize( 1 );
-
- Link aLink = LINK( this, ScCsvTableBox, CsvCmdHdl );
- SetCmdHdl( aLink );
- maRuler.SetCmdHdl( aLink );
- maGrid.SetCmdHdl( aLink );
-
- aLink = LINK( this, ScCsvTableBox, ScrollHdl );
- maHScroll.SetScrollHdl( aLink );
- maVScroll.SetScrollHdl( aLink );
-
- aLink = LINK( this, ScCsvTableBox, ScrollEndHdl );
- maHScroll.SetEndScrollHdl( aLink );
- maVScroll.SetEndScrollHdl( aLink );
-
- InitControls();
+ maGrid.Init();
}
void ScCsvTableBox::InitControls()
@@ -222,25 +212,6 @@ void ScCsvTableBox::SetUniStrings(
EnableRepaint();
}
-//UNUSED2009-05 void ScCsvTableBox::SetByteStrings(
-//UNUSED2009-05 const ByteString* pTextLines, CharSet eCharSet,
-//UNUSED2009-05 const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep )
-//UNUSED2009-05 {
-//UNUSED2009-05 // assuming that pTextLines is a string array with size CSV_PREVIEW_LINES
-//UNUSED2009-05 // -> will be dynamic sometime
-//UNUSED2009-05 DisableRepaint();
-//UNUSED2009-05 sal_Int32 nEndLine = GetFirstVisLine() + CSV_PREVIEW_LINES;
-//UNUSED2009-05 const ByteString* pString = pTextLines;
-//UNUSED2009-05 for( sal_Int32 nLine = GetFirstVisLine(); nLine < nEndLine; ++nLine, ++pString )
-//UNUSED2009-05 {
-//UNUSED2009-05 if( mbFixedMode )
-//UNUSED2009-05 maGrid.ImplSetTextLineFix( nLine, String( *pString, eCharSet ) );
-//UNUSED2009-05 else
-//UNUSED2009-05 maGrid.ImplSetTextLineSep( nLine, String( *pString, eCharSet ), rSepChars, cTextSep, bMergeSep );
-//UNUSED2009-05 }
-//UNUSED2009-05 EnableRepaint();
-//UNUSED2009-05 }
-
// column settings ------------------------------------------------------------
@@ -462,3 +433,4 @@ ScAccessibleCsvControl* ScCsvTableBox::ImplCreateAccessible()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 56e80e9f2d50..63d11e1141ae 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,7 +91,7 @@ ScDataPilotDatabaseDlg::ScDataPilotDatabaseDlg( Window* pParent ) :
uno::Reference<container::XNameAccess> xContext(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii( DP_SERVICE_DBCONTEXT ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( DP_SERVICE_DBCONTEXT )) ),
uno::UNO_QUERY);
if (xContext.is())
{
@@ -106,7 +107,7 @@ ScDataPilotDatabaseDlg::ScDataPilotDatabaseDlg( Window* pParent ) :
}
catch(uno::Exception&)
{
- DBG_ERROR("exception in database");
+ OSL_FAIL("exception in database");
}
aLbDatabase.SelectEntryPos( 0 );
@@ -165,7 +166,7 @@ void ScDataPilotDatabaseDlg::FillObjects()
uno::Reference<container::XNameAccess> xContext(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii( DP_SERVICE_DBCONTEXT ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( DP_SERVICE_DBCONTEXT )) ),
uno::UNO_QUERY);
if ( !xContext.is() ) return;
@@ -176,7 +177,7 @@ void ScDataPilotDatabaseDlg::FillObjects()
uno::Reference<task::XInteractionHandler> xHandler(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_INTHANDLER ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_INTHANDLER )) ),
uno::UNO_QUERY);
uno::Reference<sdbc::XConnection> xConnection = xSource->connectWithCompletion( xHandler );
@@ -219,7 +220,7 @@ void ScDataPilotDatabaseDlg::FillObjects()
}
catch(uno::Exception&)
{
- // #71604# this may happen if an invalid database is selected -> no DBG_ERROR
+ // this may happen if an invalid database is selected -> no DBG_ERROR
DBG_WARNING("exception in database");
}
}
@@ -227,3 +228,4 @@ void ScDataPilotDatabaseDlg::FillObjects()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index e275a34b8b88..086d4778fba8 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,7 @@
#include "dapitype.hrc"
using namespace com::sun::star;
+using ::rtl::OUString;
//-------------------------------------------------------------------------
@@ -48,17 +50,28 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bE
//
aFlFrame ( this, ScResId( FL_FRAME ) ),
aBtnSelection ( this, ScResId( BTN_SELECTION ) ),
+ aBtnNamedRange ( this, ScResId( BTN_NAMED_RANGE ) ),
aBtnDatabase ( this, ScResId( BTN_DATABASE ) ),
aBtnExternal ( this, ScResId( BTN_EXTERNAL ) ),
+ aLbNamedRange ( this, ScResId( LB_NAMED_RANGE ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) )
{
+ aBtnSelection.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
+ aBtnNamedRange.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
+ aBtnDatabase.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
+ aBtnExternal.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
+
if (!bEnableExternal)
aBtnExternal.Disable();
aBtnSelection.Check();
+ // Disabled unless at least one named range exists.
+ aLbNamedRange.Disable();
+ aBtnNamedRange.Disable();
+
FreeResource();
}
@@ -66,16 +79,44 @@ ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg()
{
}
-sal_Bool ScDataPilotSourceTypeDlg::IsDatabase() const
+bool ScDataPilotSourceTypeDlg::IsDatabase() const
{
return aBtnDatabase.IsChecked();
}
-sal_Bool ScDataPilotSourceTypeDlg::IsExternal() const
+bool ScDataPilotSourceTypeDlg::IsExternal() const
{
return aBtnExternal.IsChecked();
}
+bool ScDataPilotSourceTypeDlg::IsNamedRange() const
+{
+ return aBtnNamedRange.IsChecked();
+}
+
+OUString ScDataPilotSourceTypeDlg::GetSelectedNamedRange() const
+{
+ sal_uInt16 nPos = aLbNamedRange.GetSelectEntryPos();
+ return aLbNamedRange.GetEntry(nPos);
+}
+
+void ScDataPilotSourceTypeDlg::AppendNamedRange(const OUString& rName)
+{
+ aLbNamedRange.InsertEntry(rName);
+ if (aLbNamedRange.GetEntryCount() == 1)
+ {
+ // Select position 0 only for the first time.
+ aLbNamedRange.SelectEntryPos(0);
+ aBtnNamedRange.Enable();
+ }
+}
+
+IMPL_LINK( ScDataPilotSourceTypeDlg, RadioClickHdl, RadioButton*, pBtn )
+{
+ aLbNamedRange.Enable(pBtn == &aBtnNamedRange);
+ return 0;
+}
+
//-------------------------------------------------------------------------
ScDataPilotServiceDlg::ScDataPilotServiceDlg( Window* pParent,
@@ -140,3 +181,4 @@ String ScDataPilotServiceDlg::GetParPass() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dapitype.hrc b/sc/source/ui/dbgui/dapitype.hrc
index efbabe64fa04..e7b5c6dde95e 100644
--- a/sc/source/ui/dbgui/dapitype.hrc
+++ b/sc/source/ui/dbgui/dapitype.hrc
@@ -29,25 +29,26 @@
#define BTN_CANCEL 2
#define BTN_HELP 3
#define BTN_SELECTION 4
-#define BTN_DATABASE 5
-#define BTN_EXTERNAL 6
-#define FL_FRAME 7
+#define BTN_NAMED_RANGE 5
+#define BTN_DATABASE 6
+#define BTN_EXTERNAL 7
-#define FT_SERVICE 8
-#define LB_SERVICE 9
-#define FT_SOURCE 10
-#define ED_SOURCE 11
-#define FT_NAME 12
-#define ED_NAME 13
-#define FT_USER 14
-#define ED_USER 15
-#define FT_PASSWD 16
-#define ED_PASSWD 17
-
-#define FT_DATABASE 18
-#define LB_DATABASE 19
-#define FT_OBJECT 20
-#define CB_OBJECT 21
-#define FT_OBJTYPE 22
-#define LB_OBJTYPE 23
+#define FL_FRAME 8
+#define FT_SERVICE 9
+#define LB_SERVICE 10
+#define FT_SOURCE 11
+#define ED_SOURCE 12
+#define FT_NAME 13
+#define ED_NAME 14
+#define FT_USER 15
+#define ED_USER 16
+#define FT_PASSWD 17
+#define ED_PASSWD 18
+#define FT_DATABASE 19
+#define LB_DATABASE 20
+#define FT_OBJECT 21
+#define CB_OBJECT 22
+#define FT_OBJTYPE 23
+#define LB_OBJTYPE 24
+#define LB_NAMED_RANGE 25
diff --git a/sc/source/ui/dbgui/dapitype.src b/sc/source/ui/dbgui/dapitype.src
index 84b1c1c6068f..283106c15e84 100644
--- a/sc/source/ui/dbgui/dapitype.src
+++ b/sc/source/ui/dbgui/dapitype.src
@@ -31,12 +31,20 @@
ModalDialog RID_SCDLG_DAPITYPE
{
+ Text [ en-US ] = "Select Source";
OutputSize = TRUE ;
HelpId = HID_DATAPILOT_TYPE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 241 , 63 ) ;
+ Size = MAP_APPFONT ( 241 , 76 ) ;
Moveable = TRUE ;
Closeable = FALSE ;
+
+ FixedLine FL_FRAME
+ {
+ Pos = MAP_APPFONT ( 6 , 6 ) ;
+ Size = MAP_APPFONT ( 173 , 8 ) ;
+ Text [ en-US ] = "Selection";
+ };
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 185 , 6 ) ;
@@ -58,35 +66,39 @@ ModalDialog RID_SCDLG_DAPITYPE
};
RadioButton BTN_SELECTION
{
- HelpID = "sc:RadioButton:RID_SCDLG_DAPITYPE:BTN_SELECTION";
- Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Pos = MAP_APPFONT ( 12 , 18 ) ;
Size = MAP_APPFONT ( 164 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Current selection";
};
+ RadioButton BTN_NAMED_RANGE
+ {
+ Pos = MAP_APPFONT ( 12 , 32 ) ;
+ Size = MAP_APPFONT ( 70 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "~Named range";
+ };
+ ListBox LB_NAMED_RANGE
+ {
+ Pos = MAP_APPFONT ( 90 , 31 ) ;
+ Size = MAP_APPFONT ( 70 , 10 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ };
RadioButton BTN_DATABASE
{
- HelpID = "sc:RadioButton:RID_SCDLG_DAPITYPE:BTN_DATABASE";
- Pos = MAP_APPFONT ( 12 , 28 ) ;
+ Pos = MAP_APPFONT ( 12 , 46 ) ;
Size = MAP_APPFONT ( 164 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Data source registered in %PRODUCTNAME";
};
RadioButton BTN_EXTERNAL
{
- HelpID = "sc:RadioButton:RID_SCDLG_DAPITYPE:BTN_EXTERNAL";
- Pos = MAP_APPFONT ( 12 , 42 ) ;
+ Pos = MAP_APPFONT ( 12 , 60 ) ;
Size = MAP_APPFONT ( 164 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~External source/interface";
};
- FixedLine FL_FRAME
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 173 , 8 ) ;
- Text [ en-US ] = "Selection";
- };
- Text [ en-US ] = "Select Source";
};
@@ -296,24 +308,3 @@ ModalDialog RID_SCDLG_DAPIDATA
};
Text [ en-US ] = "Select Data Source";
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 03fc34eefe2c..fcf29c814933 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,7 +78,7 @@ public:
: rEdAssign(rEd),
rBtnHeader(rHdr), rBtnSize(rSize), rBtnFormat(rFmt), rBtnStrip(rStrip),
rCurArea(rArea),
- bHeader(sal_False), bSize(sal_False), bFormat(sal_False), bDirty(sal_False) {}
+ bHeader(false), bSize(false), bFormat(false), bDirty(false) {}
void Save();
void Restore();
@@ -125,7 +126,7 @@ void DBSaveData::Restore()
rBtnSize.Check ( bSize );
rBtnFormat.Check ( bFormat );
rBtnStrip.Check ( bStrip );
- bDirty = sal_False;
+ bDirty = false;
}
}
@@ -169,7 +170,7 @@ ScDbNameDlg::ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
//
pViewData ( ptrViewData ),
pDoc ( ptrViewData->GetDocument() ),
- bRefInputMode ( sal_False ),
+ bRefInputMode ( false ),
aAddrDetails ( pDoc->GetAddressConvention(), 0, 0 ),
aLocalDbCol ( *(pDoc->GetDBCollection()) )
{
@@ -191,7 +192,7 @@ ScDbNameDlg::ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
//----------------------------------------------------------------------------
-__EXPORT ScDbNameDlg::~ScDbNameDlg()
+ScDbNameDlg::~ScDbNameDlg()
{
DELETEZ( pSaveObj );
@@ -219,14 +220,6 @@ void ScDbNameDlg::Init()
aBtnMore.AddWindow( &aFTSource );
aBtnMore.AddWindow( &aFTOperations );
- String theAreaStr;
- SCCOL nStartCol = 0;
- SCROW nStartRow = 0;
- SCTAB nStartTab = 0;
- SCCOL nEndCol = 0;
- SCROW nEndRow = 0;
- SCTAB nEndTab = 0;
-
aBtnOk.SetClickHdl ( LINK( this, ScDbNameDlg, OkBtnHdl ) );
aBtnCancel.SetClickHdl ( LINK( this, ScDbNameDlg, CancelBtnHdl ) );
aBtnAdd.SetClickHdl ( LINK( this, ScDbNameDlg, AddBtnHdl ) );
@@ -235,8 +228,17 @@ void ScDbNameDlg::Init()
aEdAssign.SetModifyHdl ( LINK( this, ScDbNameDlg, AssModifyHdl ) );
UpdateNames();
+ String theAreaStr;
+
if ( pViewData && pDoc )
{
+ SCCOL nStartCol = 0;
+ SCROW nStartRow = 0;
+ SCTAB nStartTab = 0;
+ SCCOL nEndCol = 0;
+ SCROW nEndRow = 0;
+ SCTAB nEndTab = 0;
+
ScDBCollection* pDBColl = pDoc->GetDBCollection();
ScDBData* pDBData = NULL;
@@ -342,7 +344,7 @@ void ScDbNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScDbNameDlg::Close()
+sal_Bool ScDbNameDlg::Close()
{
return DoClose( ScDbNameDlgWrapper::GetChildWindowId() );
}
@@ -366,7 +368,7 @@ void ScDbNameDlg::UpdateNames()
{
sal_uInt16 nNameCount = aLocalDbCol.GetCount();
- aEdName.SetUpdateMode( sal_False );
+ aEdName.SetUpdateMode( false );
//-----------------------------------------------------------
aEdName.Clear();
aEdAssign.SetText( EMPTY_STRING );
@@ -541,9 +543,9 @@ IMPL_LINK( ScDbNameDlg, AddBtnHdl, void *, EMPTYARG )
aBtnRemove.Disable();
aEdAssign.SetText( EMPTY_STRING );
aBtnHeader.Check( sal_True ); // Default: mit Spaltenkoepfen
- aBtnDoSize.Check( sal_False );
- aBtnKeepFmt.Check( sal_False );
- aBtnStripData.Check( sal_False );
+ aBtnDoSize.Check( false );
+ aBtnKeepFmt.Check( false );
+ aBtnStripData.Check( false );
SetInfoStrings( NULL ); // leer
theCurArea = ScRange();
bSaved=sal_True;
@@ -608,11 +610,11 @@ IMPL_LINK( ScDbNameDlg, RemoveBtnHdl, void *, EMPTYARG )
aEdAssign.SetText( EMPTY_STRING );
theCurArea = ScRange();
aBtnHeader.Check( sal_True ); // Default: mit Spaltenkoepfen
- aBtnDoSize.Check( sal_False );
- aBtnKeepFmt.Check( sal_False );
- aBtnStripData.Check( sal_False );
+ aBtnDoSize.Check( false );
+ aBtnKeepFmt.Check( false );
+ aBtnStripData.Check( false );
SetInfoStrings( NULL ); // leer
- bSaved=sal_False;
+ bSaved=false;
pSaveObj->Restore();
NameModifyHdl( 0 );
}
@@ -647,7 +649,7 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG )
//pSaveObj->Restore();
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse
//SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg
- bRefInputMode = sal_False;
+ bRefInputMode = false;
}
else
{
@@ -668,7 +670,7 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG )
if ( aBtnAdd.GetText() != aStrAdd )
aBtnAdd.SetText( aStrAdd );
- bSaved=sal_False;
+ bSaved=false;
pSaveObj->Restore();
if ( aEdAssign.GetText().Len() > 0 )
@@ -720,3 +722,4 @@ IMPL_LINK( ScDbNameDlg, AssModifyHdl, void *, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx
index 420a3bc2005b..82ccb987599e 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.cxx
+++ b/sc/source/ui/dbgui/dpgroupdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,14 +35,10 @@
#include "dpgroupdlg.hxx"
-#ifndef SC_DPGROUPDLG_HRC
#include "dpgroupdlg.hrc"
-#endif
#include <tools/resary.hxx>
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
// ============================================================================
@@ -200,7 +197,7 @@ ScDPNumGroupInfo ScDPNumGroupDlg::GetGroupInfo() const
{
ScDPNumGroupInfo aInfo;
aInfo.Enable = sal_True;
- aInfo.DateValues = sal_False;
+ aInfo.DateValues = false;
aInfo.AutoStart = maStartHelper.IsAuto();
aInfo.AutoEnd = maEndHelper.IsAuto();
@@ -358,3 +355,4 @@ IMPL_LINK( ScDPDateGroupDlg, CheckHdl, SvxCheckListBox*, pListBox )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/dpgroupdlg.hrc b/sc/source/ui/dbgui/dpgroupdlg.hrc
index 5a4797489ddf..27adea32c4e1 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.hrc
+++ b/sc/source/ui/dbgui/dpgroupdlg.hrc
@@ -61,4 +61,3 @@
#define STR_UNITS 1
#endif
-
diff --git a/sc/source/ui/dbgui/dpgroupdlg.src b/sc/source/ui/dbgui/dpgroupdlg.src
index 84a27faf867c..4e73cfc185da 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.src
+++ b/sc/source/ui/dbgui/dpgroupdlg.src
@@ -283,4 +283,3 @@ ModalDialog RID_SCDLG_DPDATEGROUP
} ;
// ----------------------------------------------------------------------------
-
diff --git a/sc/source/ui/dbgui/dpuiglobal.hxx b/sc/source/ui/dbgui/dpuiglobal.hxx
new file mode 100644
index 000000000000..b64875030bcf
--- /dev/null
+++ b/sc/source/ui/dbgui/dpuiglobal.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Kohei Yoshida <kyoshida@novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SC_DPUIGLOBAL_HXX__
+#define __SC_DPUIGLOBAL_HXX__
+
+#define OUTER_MARGIN_HOR 4
+#define OUTER_MARGIN_VER 4
+#define DATA_FIELD_BTN_GAP 2 // must be an even number
+#define ROW_FIELD_BTN_GAP 2 // must be an even number
+#define FIELD_BTN_WIDTH 81
+#define FIELD_BTN_HEIGHT 23
+#define SELECT_FIELD_BTN_SPACE 2
+#define FIELD_AREA_GAP 3 // gap between row/column/data/page areas
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/expftext.cxx b/sc/source/ui/dbgui/expftext.cxx
index 405a18fcc004..605cd6756b48 100644
--- a/sc/source/ui/dbgui/expftext.cxx
+++ b/sc/source/ui/dbgui/expftext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <vcl/help.hxx>
/*************************************************************************
-#* Member: ScExpandedFixedText Datum:18.09.97
+#* Member: ScExpandedFixedText
#*------------------------------------------------------------------------
#*
#* Klasse: MD_Test
@@ -55,7 +56,7 @@ ScExpandedFixedText::ScExpandedFixedText( Window* pParent,
}
/*************************************************************************
-#* Member: RequestHelp Datum:18.09.97
+#* Member: RequestHelp
#*------------------------------------------------------------------------
#*
#* Klasse: ScExpandedFixedText
@@ -93,3 +94,4 @@ void ScExpandedFixedText::RequestHelp(const HelpEvent& rEvt)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 02bf712e59fb..7bd85a348dc9 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,426 +38,309 @@
#include <vcl/virdev.hxx>
#include "pvlaydlg.hxx"
+#include "dpuiglobal.hxx"
#include "AccessibleDataPilotControl.hxx"
#include "scresid.hxx"
-#include "sc.hrc"
+#include "pivot.hrc"
-// ============================================================================
-
-using namespace ::com::sun::star;
using ::rtl::OUString;
+using ::std::vector;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::WeakReference;
+using ::com::sun::star::accessibility::XAccessible;
-// ============================================================================
-
-namespace {
-
-/** Line width for insertion cursor in pixels. */
-const long CURSOR_WIDTH = 3;
-
-/** Number of tracking events before auto scrolling starts. */
-const size_t INITIAL_TRACKING_DELAY = 20;
+const size_t INVALID_INDEX = static_cast<size_t>(-1);
-} // namespace
-
-// ============================================================================
-
-ScPivotFieldWindow::ScPivotWindowField::ScPivotWindowField( const ScDPLabelData& rLabelData ) :
- maFuncData( rLabelData.mnCol, rLabelData.mnFuncMask ),
- maFieldName( rLabelData.getDisplayName() )
+ScDPFieldControlBase::ScrollBar::ScrollBar(Window* pParent, WinBits nStyle) :
+ ::ScrollBar(pParent, nStyle),
+ mpParent(pParent)
{
}
-ScPivotFieldWindow::ScPivotWindowField::ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotField& rField, bool bDataWindow ) :
- maFuncData( rField.nCol, rField.nFuncMask, rField.maFieldRef )
+void ScDPFieldControlBase::ScrollBar::Command( const CommandEvent& rCEvt )
{
- InitFieldName( rDialog, bDataWindow );
+ mpParent->Command(rCEvt);
}
-ScPivotFieldWindow::ScPivotWindowField::ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotFuncData& rFuncData, bool bDataWindow ) :
- maFuncData( rFuncData )
+ScDPFieldControlBase::ScDPFieldControlBase( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
+ Control(pParent, rResId),
+ mpDlg(pParent),
+ mpCaption(pCaption),
+ mnFieldSelected(0),
+ pAccessible(NULL)
{
- InitFieldName( rDialog, bDataWindow );
+ if (pCaption)
+ maName = MnemonicGenerator::EraseAllMnemonicChars( pCaption->GetText() );
}
-void ScPivotFieldWindow::ScPivotWindowField::InitFieldName( ScPivotLayoutDlg& rDialog, bool bDataWindow )
+ScDPFieldControlBase::~ScDPFieldControlBase()
{
- if( maFuncData.mnCol != PIVOT_DATA_FIELD )
+ if (pAccessible)
{
- ScDPLabelData* pLabelData = rDialog.GetLabelData( maFuncData.mnCol );
- DBG_ASSERT( pLabelData, "ScPivotWindowField::InitFieldName - no label data found" );
- if( pLabelData )
- {
- if( bDataWindow )
- {
- // write original nFuncMask to label data
- pLabelData->mnFuncMask = maFuncData.mnFuncMask;
- // GetFuncString() modifies nFuncMask (e.g. auto to sum or count)
- maFieldName = rDialog.GetFuncString( maFuncData.mnFuncMask, pLabelData->mbIsValue );
- }
- maFieldName += pLabelData->getDisplayName();
- }
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (xTempAcc.is())
+ pAccessible->dispose();
}
}
-// ============================================================================
-
-ScPivotFieldWindow::ScPivotFieldWindow( ScPivotLayoutDlg* pDialog, const ResId& rResId,
- ScrollBar& rScrollBar, FixedText* pFtCaption, const OUString& rName,
- ScPivotFieldType eFieldType, const sal_Char* pcHelpId, PointerStyle eDropPointer,
- size_t nColCount, size_t nRowCount, long nFieldWidthFactor, long nSpaceSize ) :
- Control( pDialog, rResId ),
- mpDialog( pDialog ),
- mpAccessible( 0 ),
- mrScrollBar( rScrollBar ),
- mpFtCaption( pFtCaption ),
- maName( rName ),
- meFieldType( eFieldType ),
- meDropPointer( eDropPointer ),
- mnColCount( nColCount ),
- mnRowCount( nRowCount ),
- mnFirstVisIndex( 0 ),
- mnSelectIndex( 0 ),
- mnInsCursorIndex( PIVOTFIELD_INVALID ),
- mnOldFirstVisIndex( 0 ),
- mnAutoScrollDelay( 0 ),
- mbVertical( eFieldType == PIVOTFIELDTYPE_SELECT ),
- mbIsTrackingSource( false )
-{
- SetHelpId( pcHelpId );
-
- mnLineSize = mbVertical ? mnRowCount : mnColCount;
- mnPageSize = mnColCount * mnRowCount;
-
- // a single field is 36x12 appfont units
- maFieldSize = LogicToPixel( Size( 36, 12 ), MapMode( MAP_APPFONT ) );
- maFieldSize.Width() *= nFieldWidthFactor;
- maSpaceSize = LogicToPixel( Size( nSpaceSize, nSpaceSize ), MapMode( MAP_APPFONT ) );
-
- // set window size
- long nWinWidth = static_cast< long >( mnColCount * maFieldSize.Width() + (mnColCount - 1) * maSpaceSize.Width() );
- long nWinHeight = static_cast< long >( mnRowCount * maFieldSize.Height() + (mnRowCount - 1) * maSpaceSize.Height() );
- SetSizePixel( Size( nWinWidth, nWinHeight ) );
-
- // scroll bar
- Point aScrollBarPos = GetPosPixel();
- Size aScrollBarSize( nWinWidth, nWinHeight );
- if( mbVertical )
- {
- aScrollBarPos.Y() += nWinHeight + maSpaceSize.Height();
- aScrollBarSize.Height() = GetSettings().GetStyleSettings().GetScrollBarSize();
- }
- else
+void ScDPFieldControlBase::UseMnemonic()
+{
+ // Now the FixedText has its mnemonic char. Grab the text and hide the
+ // FixedText to be able to handle tabstop and mnemonics separately.
+ if (mpCaption)
{
- aScrollBarPos.X() += nWinWidth + maSpaceSize.Width();
- aScrollBarSize.Width() = GetSettings().GetStyleSettings().GetScrollBarSize();
+ SetText(mpCaption->GetText());
+ mpCaption->Hide();
}
- mrScrollBar.SetPosSizePixel( aScrollBarPos, aScrollBarSize );
- mrScrollBar.SetLineSize( 1 );
- mrScrollBar.SetPageSize( static_cast< long >( mbVertical ? mnColCount : mnRowCount ) );
- mrScrollBar.SetVisibleSize( static_cast< long >( mbVertical ? mnColCount : mnRowCount ) );
- mrScrollBar.SetScrollHdl( LINK( this, ScPivotFieldWindow, ScrollHdl ) );
- mrScrollBar.SetEndScrollHdl( LINK( this, ScPivotFieldWindow, ScrollHdl ) );
+
+ // after reading the mnemonics, tab stop style bits can be updated
+ UpdateStyle();
}
-ScPivotFieldWindow::~ScPivotFieldWindow()
+OUString ScDPFieldControlBase::GetName() const
{
- ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
- if( xAcc.is() )
- xAcc->dispose();
+ return maName;
}
-void ScPivotFieldWindow::ReadDataLabels( const ScDPLabelDataVector& rLabels )
+void ScDPFieldControlBase::SetName(const OUString& rName)
{
- maFields.clear();
- maFields.reserve( rLabels.size() );
- for( ScDPLabelDataVector::const_iterator aIt = rLabels.begin(), aEnd = rLabels.end(); aIt != aEnd; ++aIt )
- {
- ScPivotWindowField aField( *aIt );
- if( aField.maFieldName.getLength() > 0 )
- maFields.push_back( aField );
- }
- Invalidate();
+ maName = rName;
}
-void ScPivotFieldWindow::ReadPivotFields( const ScPivotFieldVector& rPivotFields )
+bool ScDPFieldControlBase::IsExistingIndex( size_t nIndex ) const
{
- maFields.clear();
- maFields.reserve( rPivotFields.size() );
- for( ScPivotFieldVector::const_iterator aIt = rPivotFields.begin(), aEnd = rPivotFields.end(); aIt != aEnd; ++aIt )
- {
- ScPivotWindowField aField( *mpDialog, *aIt, meFieldType == PIVOTFIELDTYPE_DATA );
- if( aField.maFieldName.getLength() > 0 )
- maFields.push_back( aField );
- }
- Invalidate();
+ return nIndex < maFieldNames.size();
}
-void ScPivotFieldWindow::WriteFieldNames( ScDPNameVec& rFieldNames ) const
+void ScDPFieldControlBase::AddField( const String& rText, size_t nNewIndex )
{
- rFieldNames.clear();
- rFieldNames.reserve( maFields.size() );
- // do not use the names stored in maFields, but generate plain display names from label data
- for( ScPivotWindowFieldVector::const_iterator aIt = maFields.begin(), aEnd = maFields.end(); aIt != aEnd; ++aIt )
+ DBG_ASSERT( nNewIndex == maFieldNames.size(), "ScDPFieldWindow::AddField - invalid index" );
+ if( IsValidIndex( nNewIndex ) )
{
- if( ScDPLabelData* pLabelData = mpDialog->GetLabelData( aIt->maFuncData.mnCol ) )
+ maFieldNames.push_back( FieldName( rText, true ) );
+ if (pAccessible)
{
- OUString aDisplayName = pLabelData->getDisplayName();
- if( aDisplayName.getLength() > 0 )
- rFieldNames.push_back( aDisplayName );
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (xTempAcc.is())
+ pAccessible->AddField(nNewIndex);
+ else
+ pAccessible = NULL;
}
}
}
-void ScPivotFieldWindow::WritePivotFields( ScPivotFieldVector& rPivotFields ) const
+bool ScDPFieldControlBase::AddField( const String& rText, const Point& rPos, size_t& rnIndex )
{
- rPivotFields.resize( maFields.size() );
- ScPivotFieldVector::iterator aOutIt = rPivotFields.begin();
- for( ScPivotWindowFieldVector::const_iterator aIt = maFields.begin(), aEnd = maFields.end(); aIt != aEnd; ++aIt, ++aOutIt )
+ size_t nNewIndex = 0;
+ if( GetFieldIndex( rPos, nNewIndex ) )
{
- aOutIt->nCol = aIt->maFuncData.mnCol;
- aOutIt->nFuncMask = aIt->maFuncData.mnFuncMask;
- aOutIt->maFieldRef = aIt->maFuncData.maFieldRef;
- }
-}
+ if( nNewIndex > maFieldNames.size() )
+ nNewIndex = maFieldNames.size();
-OUString ScPivotFieldWindow::GetDescription() const
-{
- switch( meFieldType )
- {
- case PIVOTFIELDTYPE_COL: return String( ScResId( STR_ACC_DATAPILOT_COL_DESCR ) );
- case PIVOTFIELDTYPE_ROW: return String( ScResId( STR_ACC_DATAPILOT_ROW_DESCR ) );
- case PIVOTFIELDTYPE_DATA: return String( ScResId( STR_ACC_DATAPILOT_DATA_DESCR ) );
- case PIVOTFIELDTYPE_SELECT: return String( ScResId( STR_ACC_DATAPILOT_SEL_DESCR ) );
- default:;
+ maFieldNames.insert( maFieldNames.begin() + nNewIndex, FieldName( rText, true ) );
+ mnFieldSelected = nNewIndex;
+ ResetScrollBar();
+ Redraw();
+ rnIndex = nNewIndex;
+
+ if (pAccessible)
+ {
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (xTempAcc.is())
+ pAccessible->AddField(nNewIndex);
+ else
+ pAccessible = NULL;
+ }
+
+ return true;
}
- return OUString();
-}
-OUString ScPivotFieldWindow::GetFieldText( size_t nFieldIndex ) const
-{
- return (nFieldIndex < maFields.size()) ? maFields[ nFieldIndex ].maFieldName : OUString();
+ return false;
}
-ScPivotFuncDataEntry ScPivotFieldWindow::FindFuncDataByCol( SCCOL nCol ) const
+bool ScDPFieldControlBase::AppendField(const String& rText, size_t& rnIndex)
{
- for( ScPivotWindowFieldVector::const_iterator aIt = maFields.begin(), aEnd = maFields.end(); aIt != aEnd; ++aIt )
- if( aIt->maFuncData.mnCol == nCol )
- return ScPivotFuncDataEntry( &aIt->maFuncData, aIt - maFields.begin() );
- return ScPivotFuncDataEntry( 0, PIVOTFIELD_INVALID );
-}
+ if (!IsValidIndex(maFieldNames.size()))
+ return false;
-Point ScPivotFieldWindow::GetFieldPosition( size_t nFieldIndex ) const
-{
- long nRelIndex = static_cast< long >( nFieldIndex ) - mnFirstVisIndex;
- long nCol = static_cast< long >( mbVertical ? (nRelIndex / mnRowCount) : (nRelIndex % mnColCount) );
- long nRow = static_cast< long >( mbVertical ? (nRelIndex % mnRowCount) : (nRelIndex / mnColCount) );
- return Point( nCol * (maFieldSize.Width() + maSpaceSize.Width()), nRow * (maFieldSize.Height() + maSpaceSize.Height()) );
+ maFieldNames.push_back(FieldName(rText, true));
+ mnFieldSelected = maFieldNames.size() - 1;
+ ResetScrollBar();
+ Redraw();
+
+ rnIndex = mnFieldSelected;
+ return true;
}
-size_t ScPivotFieldWindow::GetFieldIndex( const Point& rWindowPos ) const
+void ScDPFieldControlBase::DelField( size_t nDelIndex )
{
- if( (rWindowPos.X() >= 0) && (rWindowPos.Y() >= 0) )
+ if ( IsExistingIndex(nDelIndex) )
{
- long nGridWidth = maFieldSize.Width() + maSpaceSize.Width();
- long nGridHeight = maFieldSize.Height() + maSpaceSize.Height();
- size_t nCol = static_cast< size_t >( rWindowPos.X() / nGridWidth );
- size_t nRow = static_cast< size_t >( rWindowPos.Y() / nGridHeight );
- if( (nCol < mnColCount) && (nRow < mnRowCount) )
+ if (pAccessible) // before decrement fieldcount
{
- long nColOffset = rWindowPos.X() % nGridWidth;
- long nRowOffset = rWindowPos.Y() % nGridHeight;
- // check that passed position is not in the space between the fields
- if( (nColOffset < maFieldSize.Width()) && (nRowOffset < maFieldSize.Height()) )
- {
- size_t nFieldIndex = mnFirstVisIndex + (mbVertical ? (nCol * mnRowCount + nRow) : (nRow * mnColCount + nCol));
- return (nFieldIndex < maFields.size()) ? nFieldIndex : PIVOTFIELD_INVALID;
- }
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (xTempAcc.is())
+ pAccessible->RemoveField(nDelIndex);
+ else
+ pAccessible = NULL;
}
+ maFieldNames.erase( maFieldNames.begin() + nDelIndex );
+ if (mnFieldSelected >= maFieldNames.size())
+ mnFieldSelected = maFieldNames.size() - 1;
+
+ ResetScrollBar();
+ Redraw();
}
- return PIVOTFIELD_INVALID;
}
-size_t ScPivotFieldWindow::GetDropIndex( const Point& rWindowPos ) const
+size_t ScDPFieldControlBase::GetFieldCount() const
{
- if( (rWindowPos.X() >= 0) && (rWindowPos.Y() >= 0) )
- {
- long nGridWidth = maFieldSize.Width() + maSpaceSize.Width();
- long nGridHeight = maFieldSize.Height() + maSpaceSize.Height();
- size_t nCol = static_cast< size_t >( rWindowPos.X() / nGridWidth );
- size_t nRow = static_cast< size_t >( rWindowPos.Y() / nGridHeight );
- if( (nCol < mnColCount) && (nRow < mnRowCount) )
- {
- size_t nFieldIndex = mnFirstVisIndex + (mbVertical ? (nCol * mnRowCount + nRow) : (nRow * mnColCount + nCol));
- long nColOffset = rWindowPos.X() % nGridWidth;
- long nRowOffset = rWindowPos.Y() % nGridHeight;
- // take next field, if position is in right/lower third
- if( (mnColCount == 1) ? (nRowOffset * 3 > nGridHeight * 2) : (nColOffset * 3 > nGridWidth * 2) )
- ++nFieldIndex;
- return ::std::min( nFieldIndex, maFields.size() );
- }
- }
- return maFields.size();
+ return maFieldNames.size();
}
-void ScPivotFieldWindow::GrabFocusAndSelect( size_t nSelectIndex )
+bool ScDPFieldControlBase::IsEmpty() const
{
- if( !HasFocus() ) GrabFocus();
- MoveSelection( nSelectIndex );
+ return maFieldNames.empty();
}
-void ScPivotFieldWindow::SelectNextField()
+void ScDPFieldControlBase::ClearFields()
{
- MoveSelection( NEXT_FIELD );
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (!xTempAcc.is() && pAccessible)
+ pAccessible = NULL;
+ if (pAccessible)
+ for( size_t nIdx = maFieldNames.size(); nIdx > 0; --nIdx )
+ pAccessible->RemoveField( nIdx - 1 );
+
+ maFieldNames.clear();
}
-void ScPivotFieldWindow::InsertField( size_t nInsertIndex, const ScPivotFuncData& rFuncData )
+void ScDPFieldControlBase::SetFieldText( const String& rText, size_t nIndex )
{
- if( (meFieldType != PIVOTFIELDTYPE_SELECT) && (nInsertIndex <= maFields.size()) )
+ if( IsExistingIndex( nIndex ) )
{
- size_t nFieldIndex = FindFuncDataByCol( rFuncData.mnCol ).second;
- if( nFieldIndex < maFields.size() )
- {
- // field exists already in this window, move it to the specified position
- MoveField( nFieldIndex, nInsertIndex );
- }
- else
+ maFieldNames[ nIndex ] = FieldName( rText, true );
+ Redraw();
+
+ if (pAccessible)
{
- // insert the field into the vector and notify accessibility object
- ScPivotWindowField aField( *mpDialog, rFuncData, meFieldType == PIVOTFIELDTYPE_DATA );
- if( aField.maFieldName.getLength() > 0 )
- {
- InsertFieldUnchecked( nInsertIndex, aField );
- // adjust selection and scroll position
- MoveSelection( nInsertIndex );
- Invalidate();
- }
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (xTempAcc.is())
+ pAccessible->FieldNameChange(nIndex);
+ else
+ pAccessible = NULL;
}
}
+ return PIVOTFIELD_INVALID;
}
-bool ScPivotFieldWindow::RemoveField( size_t nRemoveIndex )
+const String& ScDPFieldControlBase::GetFieldText( size_t nIndex ) const
{
- if( (meFieldType != PIVOTFIELDTYPE_SELECT) && (nRemoveIndex < maFields.size()) )
- {
- // remove the field from the vector and notify accessibility object
- RemoveFieldUnchecked( nRemoveIndex );
- // adjust selection and scroll position, if last field is removed
- if( !maFields.empty() )
- MoveSelection( (mnSelectIndex < maFields.size()) ? mnSelectIndex : (maFields.size() - 1) );
- Invalidate();
- return true;
- }
- return false;
+ if( IsExistingIndex( nIndex ) )
+ return maFieldNames[ nIndex ].first;
+ return EMPTY_STRING;
}
-bool ScPivotFieldWindow::MoveField( size_t nFieldIndex, size_t nInsertIndex )
+void ScDPFieldControlBase::GetExistingIndex( const Point& rPos, size_t& rnIndex )
{
- /* If field is moved behind current position, insertion index needs to be
- adjusted, because the field is first removed from the vector. This is
- done before nFieldIndex and nInsertIndex are checked for equality, to
- catch the cases "move before ourselves" and "move bedind ourselves"
- which are both no-ops. */
- if( nFieldIndex < nInsertIndex )
- --nInsertIndex;
-
- if( (meFieldType != PIVOTFIELDTYPE_SELECT) && (nFieldIndex != nInsertIndex) && (nFieldIndex < maFields.size()) && (nInsertIndex < maFields.size()) )
+ if( !maFieldNames.empty() && (GetFieldType() != TYPE_SELECT) && GetFieldIndex( rPos, rnIndex ) )
{
- // move the field in the vector and notify accessibility object
- ScPivotWindowField aField = maFields[ nFieldIndex ];
- RemoveFieldUnchecked( nFieldIndex );
- InsertFieldUnchecked( nInsertIndex, aField );
- // adjust selection and scroll position
- MoveSelection( nInsertIndex );
- Invalidate();
- return true;
+ if( rnIndex >= maFieldNames.size() )
+ rnIndex = maFieldNames.size() - 1;
}
- return false;
+ else
+ rnIndex = 0;
}
-const ScPivotFuncData* ScPivotFieldWindow::GetSelectedFuncData() const
+size_t ScDPFieldControlBase::GetSelectedField() const
{
- return (mnSelectIndex < maFields.size()) ? &maFields[ mnSelectIndex ].maFuncData : 0;
+ return mnFieldSelected;
}
-void ScPivotFieldWindow::ModifySelectedField( const ScPivotFuncData& rFuncData )
+void ScDPFieldControlBase::SetSelectedField(size_t nSelected)
{
- if( mnSelectIndex < maFields.size() )
- {
- maFields[ mnSelectIndex ].maFuncData = rFuncData;
- maFields[ mnSelectIndex ].InitFieldName( *mpDialog, meFieldType == PIVOTFIELDTYPE_DATA );
- Invalidate();
- }
+ mnFieldSelected = nSelected;
}
-bool ScPivotFieldWindow::RemoveSelectedField()
+vector<ScDPFieldControlBase::FieldName>& ScDPFieldControlBase::GetFieldNames()
{
- return RemoveField( mnSelectIndex );
+ return maFieldNames;
}
-bool ScPivotFieldWindow::MoveSelectedField( size_t nInsertIndex )
+const vector<ScDPFieldControlBase::FieldName>& ScDPFieldControlBase::GetFieldNames() const
{
- return MoveField( mnSelectIndex, nInsertIndex );
+ return maFieldNames;
}
-void ScPivotFieldWindow::NotifyStartTracking()
+void ScDPFieldControlBase::Paint( const Rectangle& /* rRect */ )
{
- // rescue old scrolling index, to be able to restore it when tracking is cancelled
- mnOldFirstVisIndex = mnFirstVisIndex;
+ // hiding the caption is now done from StateChanged
+ Redraw();
}
-void ScPivotFieldWindow::NotifyTracking( const Point& rWindowPos )
+void ScDPFieldControlBase::DataChanged( const DataChangedEvent& rDCEvt )
{
- size_t nFieldIndex = GetDropIndex( rWindowPos );
+ if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ Redraw();
+ }
+ Control::DataChanged( rDCEvt );
+}
- // insertion index changed: draw new cursor and exit
- if( nFieldIndex != mnInsCursorIndex )
+void ScDPFieldControlBase::Command( const CommandEvent& rCEvt )
+{
+ if (rCEvt.GetCommand() == COMMAND_WHEEL)
{
- mnInsCursorIndex = nFieldIndex;
- mnAutoScrollDelay = INITIAL_TRACKING_DELAY;
- Invalidate();
- return;
+ const CommandWheelData* pData = rCEvt.GetWheelData();
+ if (pData->GetMode() == COMMAND_WHEEL_SCROLL && !pData->IsHorz())
+ {
+ // Handle vertical mouse wheel scrolls.
+ long nNotch = pData->GetNotchDelta(); // positive => up; negative => down
+ HandleWheelScroll(nNotch);
+ }
}
+}
- // insertion index unchanged: countdown for auto scrolling
- if( mnAutoScrollDelay > 0 )
+void ScDPFieldControlBase::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if( rMEvt.IsLeft() )
{
--mnAutoScrollDelay;
return;
}
- // check if tracking happens on first or last field
- long nScrollDelta = 0;
- if( (mnInsCursorIndex > 0) && (mnInsCursorIndex == mnFirstVisIndex) )
- nScrollDelta = -static_cast< long >( mnLineSize );
- else if( (mnInsCursorIndex < maFields.size()) && (mnInsCursorIndex == mnFirstVisIndex + mnPageSize) )
- nScrollDelta = static_cast< long >( mnLineSize );
- if( nScrollDelta != 0 )
- {
- // update mnInsCursorIndex, so it will be drawn at the same position after scrolling
- mnInsCursorIndex += nScrollDelta;
- mnFirstVisIndex += nScrollDelta;
- // delay auto scroll by line size, to slow down scrolling in column/page windows
- mnAutoScrollDelay = mnLineSize - 1;
- Invalidate();
+ if( rMEvt.GetClicks() == 1 )
+ {
+ PointerStyle ePtr = mpDlg->NotifyMouseButtonDown( GetFieldType(), nIndex );
+ CaptureMouse();
+ SetPointer( Pointer( ePtr ) );
+ }
+ else
+ mpDlg->NotifyDoubleClick( GetFieldType(), nIndex );
+ }
}
}
-void ScPivotFieldWindow::NotifyEndTracking( ScPivotFieldEndTracking eEndType )
+void ScDPFieldControlBase::MouseButtonUp( const MouseEvent& rMEvt )
{
if( eEndType != ENDTRACKING_DROP )
mnFirstVisIndex = mnOldFirstVisIndex;
if( eEndType != ENDTRACKING_SUSPEND )
{
- mnOldFirstVisIndex = PIVOTFIELD_INVALID;
- mbIsTrackingSource = false;
+ if( rMEvt.GetClicks() == 1 )
+ {
+ mpDlg->NotifyMouseButtonUp( OutputToScreenPixel( rMEvt.GetPosPixel() ) );
+ SetPointer( Pointer( POINTER_ARROW ) );
+ }
+
+ if( IsMouseCaptured() )
+ ReleaseMouse();
}
mnInsCursorIndex = PIVOTFIELD_INVALID;
Invalidate();
}
-// protected ------------------------------------------------------------------
-
-void ScPivotFieldWindow::Paint( const Rectangle& /*rRect*/ )
+void ScDPFieldControlBase::MouseMove( const MouseEvent& rMEvt )
{
// prepare a virtual device for buffered painting
VirtualDevice aVirDev;
@@ -478,12 +362,8 @@ void ScPivotFieldWindow::Paint( const Rectangle& /*rRect*/ )
// draw field text focus
if( HasFocus() && (mnSelectIndex < maFields.size()) && (mnFirstVisIndex <= mnSelectIndex) && (mnSelectIndex < mnFirstVisIndex + mnPageSize) )
{
- long nFieldWidth = maFieldSize.Width();
- long nSelectionWidth = Min( GetTextWidth( maFields[ mnSelectIndex ].maFieldName ) + 4, nFieldWidth - 6 );
- Rectangle aSelection(
- GetFieldPosition( mnSelectIndex ) + Point( (nFieldWidth - nSelectionWidth) / 2, 3 ),
- Size( nSelectionWidth, maFieldSize.Height() - 6 ) );
- InvertTracking( aSelection, SHOWTRACK_SMALL | SHOWTRACK_WINDOW );
+ PointerStyle ePtr = mpDlg->NotifyMouseMove( OutputToScreenPixel( rMEvt.GetPosPixel() ) );
+ SetPointer( Pointer( ePtr ) );
}
// update scrollbar
@@ -506,326 +386,747 @@ void ScPivotFieldWindow::Paint( const Rectangle& /*rRect*/ )
SetStyle( (GetStyle() & nMask) | (IsEmpty() ? WB_NOTABSTOP : WB_TABSTOP) );
}
-void ScPivotFieldWindow::StateChanged( StateChangedType nStateChange )
+void ScDPFieldControlBase::KeyInput( const KeyEvent& rKEvt )
{
- Control::StateChanged( nStateChange );
+ const KeyCode& rKeyCode = rKEvt.GetKeyCode();
+ sal_uInt16 nCode = rKeyCode.GetCode();
+ bool bKeyEvaluated = false;
- if( nStateChange == STATE_CHANGE_INITSHOW )
+ const FieldNames& rFields = GetFieldNames();
+ if( rKeyCode.IsMod1() && (GetFieldType() != TYPE_SELECT) )
+ {
+ bKeyEvaluated = true;
+ switch( nCode )
+ {
+ case KEY_UP: MoveFieldRel( 0, -1 ); break;
+ case KEY_DOWN: MoveFieldRel( 0, 1 ); break;
+ case KEY_LEFT: MoveFieldRel( -1, 0 ); break;
+ case KEY_RIGHT: MoveFieldRel( 1, 0 ); break;
+ case KEY_HOME: MoveField( 0 ); break;
+ case KEY_END: MoveField( rFields.size() - 1 ); break;
+ default: bKeyEvaluated = false;
+ }
+ }
+ else
{
- /* After the fixed text associated to this control has received its
- unique mnemonic from VCL dialog initialization code, put this text
- into the field windows.
- #124828# Hiding the FixedTexts and clearing the tab stop style bits
- has to be done after assigning the mnemonics, but Paint() is too
- late, because the test tool may send key events to the dialog when
- it isn't visible. Mnemonics are assigned in Dialog::StateChanged()
- for STATE_CHANGE_INITSHOW, so this can be done immediately
- afterwards. */
- if( mpFtCaption )
+ bKeyEvaluated = true;
+ switch( nCode )
{
- SetText( mpFtCaption->GetText() );
- mpFtCaption->Hide();
+ case KEY_UP: MoveSelection( 0, -1 ); break;
+ case KEY_DOWN: MoveSelection( 0, 1 ); break;
+ case KEY_LEFT: MoveSelection( -1, 0 ); break;
+ case KEY_RIGHT: MoveSelection( 1, 0 ); break;
+ case KEY_HOME: SetSelectionHome(); break;
+ case KEY_END: SetSelectionEnd(); break;
+ case KEY_DELETE:
+ mpDlg->NotifyRemoveField( GetFieldType(), mnFieldSelected );
+ break;
+ default:
+ bKeyEvaluated = false;
}
}
+
+ if (bKeyEvaluated)
+ {
+ ScrollToShowSelection();
+ Redraw();
+ }
+ else
+ Control::KeyInput( rKEvt );
}
-void ScPivotFieldWindow::DataChanged( const DataChangedEvent& rDCEvt )
+void ScDPFieldControlBase::GetFocus()
{
- Control::DataChanged( rDCEvt );
- if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- Invalidate();
+ Control::GetFocus();
+ Redraw();
+ if( GetGetFocusFlags() & GETFOCUS_MNEMONIC ) // move field on shortcut
+ {
+ size_t nOldCount = GetFieldCount();
+ mpDlg->NotifyMoveFieldToEnd( GetFieldType() );
+ if (GetFieldCount() > nOldCount)
+ // Scroll to the end only when a new field is inserted.
+ ScrollToEnd();
+ }
+ else // else change focus
+ mpDlg->NotifyFieldFocus( GetFieldType(), true );
+
+ AccessibleSetFocus(true);
}
-void ScPivotFieldWindow::KeyInput( const KeyEvent& rKEvt )
+void ScDPFieldControlBase::LoseFocus()
{
- bool bKeyEvaluated = false;
+ Control::LoseFocus();
+ Redraw();
+ mpDlg->NotifyFieldFocus( GetFieldType(), false );
- if( !maFields.empty() )
- {
- const KeyCode& rKeyCode = rKEvt.GetKeyCode();
- sal_uInt16 nCode = rKeyCode.GetCode();
+ AccessibleSetFocus(false);
+}
- // do not move fields in selection window
- if( rKeyCode.IsMod1() && (meFieldType != PIVOTFIELDTYPE_SELECT) )
- {
- bKeyEvaluated = true;
- switch( nCode )
- {
- case KEY_UP: MoveSelectedField( mbVertical ? PREV_FIELD : PREV_LINE ); break;
- case KEY_DOWN: MoveSelectedField( mbVertical ? NEXT_FIELD : NEXT_LINE ); break;
- case KEY_LEFT: MoveSelectedField( mbVertical ? PREV_LINE : PREV_FIELD ); break;
- case KEY_RIGHT: MoveSelectedField( mbVertical ? NEXT_LINE : NEXT_FIELD ); break;
- case KEY_HOME: MoveSelectedField( FIRST_FIELD ); break;
- case KEY_END: MoveSelectedField( LAST_FIELD ); break;
- default: bKeyEvaluated = false;
- }
- }
- else
- {
- bKeyEvaluated = true;
- switch( nCode )
- {
- case KEY_UP: MoveSelection( mbVertical ? PREV_FIELD : PREV_LINE ); break;
- case KEY_DOWN: MoveSelection( mbVertical ? NEXT_FIELD : NEXT_LINE ); break;
- case KEY_LEFT: MoveSelection( mbVertical ? PREV_LINE : PREV_FIELD ); break;
- case KEY_RIGHT: MoveSelection( mbVertical ? NEXT_LINE : NEXT_FIELD ); break;
- case KEY_PAGEUP: MoveSelection( PREV_PAGE ); break;
- case KEY_PAGEDOWN: MoveSelection( NEXT_PAGE ); break;
- case KEY_HOME: MoveSelection( FIRST_FIELD ); break;
- case KEY_END: MoveSelection( LAST_FIELD ); break;
- // delete field per DEL key - dialog needs to change focus if window becomes empty
- case KEY_DELETE: RemoveSelectedField(); mpDialog->NotifyFieldRemoved( *this ); break;
- default: bKeyEvaluated = false;
- }
- }
+Reference<XAccessible> ScDPFieldControlBase::CreateAccessible()
+{
+ pAccessible =
+ new ScAccessibleDataPilotControl(GetAccessibleParentWindow()->GetAccessible(), this);
+
+ com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > xReturn = pAccessible;
+
+ pAccessible->Init();
+ xAccessible = xReturn;
+
+ return xReturn;
+}
+
+void ScDPFieldControlBase::FieldFocusChanged(size_t nOldSelected, size_t nFieldSelected)
+{
+ if (!pAccessible)
+ return;
+
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (xTempAcc.is())
+ pAccessible->FieldFocusChange(nOldSelected, nFieldSelected);
+ else
+ pAccessible = NULL;
+}
+
+void ScDPFieldControlBase::AccessibleSetFocus(bool bOn)
+{
+ if (!pAccessible)
+ return;
+
+ com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
+ if (!xTempAcc.is())
+ {
+ pAccessible = NULL;
+ return;
}
- if( !bKeyEvaluated )
- Control::KeyInput( rKEvt );
+ if (bOn)
+ pAccessible->GotFocus();
+ else
+ pAccessible->LostFocus();
}
-void ScPivotFieldWindow::MouseButtonDown( const MouseEvent& rMEvt )
+void ScDPFieldControlBase::UpdateStyle()
{
- if( rMEvt.IsLeft() )
+ WinBits nMask = ~(WB_TABSTOP | WB_NOTABSTOP);
+ SetStyle( (GetStyle() & nMask) | (IsEmpty() ? WB_NOTABSTOP : WB_TABSTOP) );
+}
+
+void ScDPFieldControlBase::DrawBackground( OutputDevice& rDev )
+{
+ const StyleSettings& rStyleSet = GetSettings().GetStyleSettings();
+ Color aFaceColor = rStyleSet.GetFaceColor();
+ Color aWinColor = rStyleSet.GetWindowColor();
+ Color aWinTextColor = rStyleSet.GetWindowTextColor();
+
+ Point aPos0;
+ Size aSize( GetSizePixel() );
+
+ if (mpCaption)
{
- size_t nNewSelectIndex = GetFieldIndex( rMEvt.GetPosPixel() );
- if( nNewSelectIndex < maFields.size() )
- {
- // grabbing after GetFieldIndex() will prevent to focus empty window
- GrabFocusAndSelect( nNewSelectIndex );
- if( rMEvt.GetClicks() == 1 )
- {
- // one click: start tracking
- mbIsTrackingSource = true;
- mnOldFirstVisIndex = mnFirstVisIndex;
- mpDialog->NotifyStartTracking( *this );
- }
- else
- {
- // two clicks: open field options dialog
- mpDialog->NotifyDoubleClick( *this );
- }
- }
+ rDev.SetLineColor( aWinTextColor );
+ rDev.SetFillColor( aWinColor );
+ }
+ else
+ {
+ rDev.SetLineColor( aFaceColor );
+ rDev.SetFillColor( aFaceColor );
+ }
+ rDev.DrawRect( Rectangle( aPos0, aSize ) );
+
+ rDev.SetTextColor( aWinTextColor );
+
+ /* Draw the caption text. This needs some special handling, because we
+ support hard line breaks here. This part will draw each line of the
+ text for itself. */
+
+ xub_StrLen nTokenCnt = GetText().GetTokenCount('\n');
+ long nY = (aSize.Height() - nTokenCnt * rDev.GetTextHeight()) / 2;
+ for( xub_StrLen nToken = 0, nStringIx = 0; nToken < nTokenCnt; ++nToken )
+ {
+ String aLine( GetText().GetToken( 0, '\n', nStringIx ) );
+ Point aLinePos( (aSize.Width() - rDev.GetCtrlTextWidth( aLine )) / 2, nY );
+ rDev.DrawCtrlText( aLinePos, aLine );
+ nY += rDev.GetTextHeight();
}
}
-void ScPivotFieldWindow::RequestHelp( const HelpEvent& rHEvt )
+void ScDPFieldControlBase::DrawField(
+ OutputDevice& rDev, const Rectangle& rRect, FieldName& rText, bool bFocus )
{
- if( (rHEvt.GetMode() & HELPMODE_QUICK) != 0 )
+ const StyleSettings& rStyleSet = GetSettings().GetStyleSettings();
+ Color aTextColor = rStyleSet.GetButtonTextColor();
+
+ VirtualDevice aVirDev( rDev );
+ // #i97623# VirtualDevice is always LTR while other windows derive direction from parent
+ aVirDev.EnableRTL( IsRTLEnabled() );
+
+ String aText = rText.first;
+ Size aDevSize( rRect.GetSize() );
+ long nWidth = aDevSize.Width();
+ long nHeight = aDevSize.Height();
+ long nLabelWidth = rDev.GetTextWidth( aText );
+ long nLabelHeight = rDev.GetTextHeight();
+
+ // #i31600# if text is too long, cut and add ellipsis
+ rText.second = nLabelWidth + 6 <= nWidth;
+ if( !rText.second )
{
- // show a tooltip with full field name, if field text is clipped
- size_t nFieldIndex = GetFieldIndex( rHEvt.GetMousePosPixel() - GetPosPixel() );
- if( (nFieldIndex < maFields.size()) && maFields[ nFieldIndex ].mbClipped )
+ xub_StrLen nMinLen = 0;
+ xub_StrLen nMaxLen = aText.Len();
+ bool bFits = false;
+ do
{
- Rectangle aRect( rHEvt.GetMousePosPixel(), GetSizePixel() );
- Help::ShowQuickHelp( this, aRect, maFields[ nFieldIndex ].maFieldName );
- return;
+ xub_StrLen nCurrLen = (nMinLen + nMaxLen) / 2;
+ aText = String( rText.first, 0, nCurrLen ).AppendAscii( "..." );
+ nLabelWidth = rDev.GetTextWidth( aText );
+ bFits = nLabelWidth + 6 <= nWidth;
+ (bFits ? nMinLen : nMaxLen) = nCurrLen;
}
+ while( !bFits || (nMinLen + 1 < nMaxLen) );
}
- Control::RequestHelp( rHEvt );
+ Point aLabelPos( (nWidth - nLabelWidth) / 2, ::std::max< long >( (nHeight - nLabelHeight) / 2, 3 ) );
+
+ aVirDev.SetOutputSizePixel( aDevSize );
+ aVirDev.SetFont( rDev.GetFont() );
+ DecorationView aDecoView( &aVirDev );
+ aDecoView.DrawButton( Rectangle( Point( 0, 0 ), aDevSize ), bFocus ? BUTTON_DRAW_DEFAULT : 0 );
+ aVirDev.SetTextColor( aTextColor );
+ aVirDev.DrawText( aLabelPos, aText );
+ rDev.DrawBitmap( rRect.TopLeft(), aVirDev.GetBitmap( Point( 0, 0 ), aDevSize ) );
}
-void ScPivotFieldWindow::GetFocus()
+ScDPLayoutDlg* ScDPFieldControlBase::GetParentDlg() const
{
- Control::GetFocus();
- Invalidate();
- ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
- if( xAcc.is() )
- xAcc->GotFocus();
+ return mpDlg;
}
-void ScPivotFieldWindow::LoseFocus()
+void ScDPFieldControlBase::AppendPaintable(Window* p)
{
- Control::LoseFocus();
- Invalidate();
- ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
- if( xAcc.is() )
- xAcc->LostFocus();
+ maPaintables.push_back(p);
}
-uno::Reference< accessibility::XAccessible > ScPivotFieldWindow::CreateAccessible()
+void ScDPFieldControlBase::DrawPaintables()
{
- mpAccessible = new ScAccessibleDataPilotControl( GetAccessibleParentWindow()->GetAccessible(), this );
- uno::Reference< accessibility::XAccessible > xReturn( mpAccessible );
- mpAccessible->Init();
- mxAccessible = xReturn;
- return xReturn;
+ Rectangle aRect(GetPosPixel(), GetSizePixel());
+ Paintables::iterator itr = maPaintables.begin(), itrEnd = maPaintables.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ Window* p = *itr;
+ if (!p->IsVisible())
+ continue;
+
+ p->Paint(aRect);
+ }
+}
+
+void ScDPFieldControlBase::DrawInvertSelection()
+{
+ if (!HasFocus())
+ return;
+
+ if (mnFieldSelected >= maFieldNames.size())
+ return;
+
+ size_t nPos = GetDisplayPosition(mnFieldSelected);
+ if (nPos == INVALID_INDEX)
+ return;
+
+ Size aFldSize = GetFieldSize();
+ long nFldWidth = aFldSize.Width();
+ long nSelWidth = std::min<long>(
+ GetTextWidth(maFieldNames[mnFieldSelected].first) + 4, nFldWidth - 6);
+
+ Point aPos = GetFieldPosition(nPos);
+ aPos += Point((nFldWidth - nSelWidth) / 2, 3);
+ Size aSize(nSelWidth, aFldSize.Height() - 6);
+
+ Rectangle aSel(aPos, aSize);
+ InvertTracking(aSel, SHOWTRACK_SMALL | SHOWTRACK_WINDOW);
+}
+
+bool ScDPFieldControlBase::IsShortenedText( size_t nIndex ) const
+{
+ const FieldNames& rFields = GetFieldNames();
+ return (nIndex < rFields.size()) && !rFields[nIndex].second;
}
-// private --------------------------------------------------------------------
+void ScDPFieldControlBase::MoveField( size_t nDestIndex )
+{
+ if (nDestIndex != mnFieldSelected)
+ {
+ swap(maFieldNames[nDestIndex], maFieldNames[mnFieldSelected]);
+ mnFieldSelected = nDestIndex;
+ }
+}
-size_t ScPivotFieldWindow::RecalcVisibleIndex( size_t nSelectIndex ) const
+void ScDPFieldControlBase::MoveFieldRel( SCsCOL nDX, SCsROW nDY )
{
- // calculate a scrolling offset that shows the selected field
- size_t nNewFirstVisIndex = mnFirstVisIndex;
- if( nSelectIndex < nNewFirstVisIndex )
- nNewFirstVisIndex = static_cast< size_t >( (nSelectIndex / mnLineSize) * mnLineSize );
- else if( nSelectIndex >= nNewFirstVisIndex + mnPageSize )
- nNewFirstVisIndex = static_cast< size_t >( (nSelectIndex / mnLineSize + 1) * mnLineSize ) - mnPageSize;
- // check if there are complete empty lines in the bottom/right
- size_t nMaxFirstVisIndex = (maFields.size() <= mnPageSize) ? 0 : (((maFields.size() - 1) / mnLineSize + 1) * mnLineSize - mnPageSize);
- return ::std::min( nNewFirstVisIndex, nMaxFirstVisIndex );
+ MoveField( CalcNewFieldIndex( nDX, nDY ) );
}
-void ScPivotFieldWindow::SetSelectionUnchecked( size_t nSelectIndex, size_t nFirstVisIndex )
+void ScDPFieldControlBase::SetSelection(size_t nIndex)
{
- if( !maFields.empty() && (nSelectIndex < maFields.size()) )
+ FieldNames& rFields = GetFieldNames();
+ if (rFields.empty())
+ return;
+
+ if (nIndex >= rFields.size())
+ // Prevent it from going out-of-bound.
+ nIndex = rFields.size() - 1;
+
+ if( mnFieldSelected != nIndex )
{
- bool bScrollPosChanged = mnFirstVisIndex != nFirstVisIndex;
- bool bSelectionChanged = mnSelectIndex != nSelectIndex;
+ size_t nOldSelected = mnFieldSelected;
+ mnFieldSelected = nIndex;
+ Redraw();
- sal_Int32 nOldSelected = static_cast< sal_Int32 >( mnSelectIndex );
- mnFirstVisIndex = nFirstVisIndex;
- mnSelectIndex = nSelectIndex;
+ if (HasFocus())
+ FieldFocusChanged(nOldSelected, mnFieldSelected);
+ }
- if( bScrollPosChanged || bSelectionChanged )
- Invalidate();
+ ScrollToShowSelection();
+}
- // TODO: accessibility action for changed scrolling position?
+void ScDPFieldControlBase::SetSelectionHome()
+{
+ const FieldNames& rFields = GetFieldNames();
+ if( !rFields.empty() )
+ {
+ SetSelection( 0 );
+ }
+}
- // notify accessibility object about changed selection
- if( bSelectionChanged && HasFocus() )
- {
- ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
- if( xAcc.is() )
- xAcc->FieldFocusChange( nOldSelected, static_cast< sal_Int32 >( mnSelectIndex ) );
- }
+void ScDPFieldControlBase::SetSelectionEnd()
+{
+ const FieldNames& rFields = GetFieldNames();
+ if( !rFields.empty() )
+ {
+ SetSelection( rFields.size() - 1 );
}
}
-void ScPivotFieldWindow::MoveSelection( size_t nSelectIndex )
+void ScDPFieldControlBase::MoveSelection(SCsCOL nDX, SCsROW nDY)
{
- if( nSelectIndex < maFields.size() )
- SetSelectionUnchecked( nSelectIndex, RecalcVisibleIndex( nSelectIndex ) );
+ size_t nNewIndex = CalcNewFieldIndex( nDX, nDY );
+ SetSelection( nNewIndex );
}
-void ScPivotFieldWindow::MoveSelection( MoveType eMoveType )
+void ScDPFieldControlBase::ModifySelectionOffset( long nOffsetDiff )
{
- if( maFields.empty() )
- return;
+ mnFieldSelected -= nOffsetDiff;
+ Redraw();
+}
+
+void ScDPFieldControlBase::SelectNext()
+{
+ SetSelection(mnFieldSelected + 1);
+}
+
+void ScDPFieldControlBase::GrabFocusWithSel( size_t nIndex )
+{
+ SetSelection( nIndex );
+ if( !HasFocus() )
+ GrabFocus();
+}
+
+//=============================================================================
+
+ScDPHorFieldControl::ScDPHorFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
+ ScDPFieldControlBase(pDialog, rResId, pCaption),
+ maScroll(this, WB_HORZ | WB_DRAG),
+ mnFieldBtnRowCount(0),
+ mnFieldBtnColCount(0)
+{
+ maScroll.SetScrollHdl( LINK(this, ScDPHorFieldControl, ScrollHdl) );
+ maScroll.SetEndScrollHdl( LINK(this, ScDPHorFieldControl, EndScrollHdl) );
+ maScroll.Hide();
+
+ AppendPaintable(&maScroll);
+}
+
+ScDPHorFieldControl::~ScDPHorFieldControl()
+{
+}
+
+Point ScDPHorFieldControl::GetFieldPosition( size_t nIndex )
+{
+ Point aPos;
+ Size aSize;
+ GetFieldBtnPosSize(nIndex, aPos, aSize);
+ return aPos;
+}
+
+Size ScDPHorFieldControl::GetFieldSize() const
+{
+ return Size(FIELD_BTN_WIDTH, FIELD_BTN_HEIGHT);
+}
- size_t nLastIndex = maFields.size() - 1;
- size_t nNewSelectIndex = mnSelectIndex;
- switch( eMoveType )
+bool ScDPHorFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
+{
+ rnIndex = INVALID_INDEX;
+ if (rPos.X() < 0 || rPos.Y() < 0)
+ return false;
+
+ Size aWndSize = GetSizePixel();
+ if (rPos.X() > aWndSize.Width() || rPos.Y() > aWndSize.Height())
+ return false;
+
+ size_t nX = rPos.X();
+ size_t nY = rPos.Y();
+ size_t nW = aWndSize.Width();
+ size_t nH = aWndSize.Height();
+
+ Size aFldSize = GetFieldSize();
+ size_t nCurX = OUTER_MARGIN_HOR + aFldSize.Width() + ROW_FIELD_BTN_GAP/2;
+ size_t nCurY = OUTER_MARGIN_VER + aFldSize.Height() + ROW_FIELD_BTN_GAP/2;
+ size_t nCol = 0;
+ size_t nRow = 0;
+ while (nX > nCurX && nCurX <= nW)
{
- case PREV_FIELD:
- nNewSelectIndex = (nNewSelectIndex > 0) ? (nNewSelectIndex - 1) : 0;
- break;
- case NEXT_FIELD:
- nNewSelectIndex = (nNewSelectIndex < nLastIndex) ? (nNewSelectIndex + 1) : nLastIndex;
- break;
- case PREV_LINE:
- nNewSelectIndex = (nNewSelectIndex > mnLineSize) ? (nNewSelectIndex - mnLineSize) : 0;
- break;
- case NEXT_LINE:
- nNewSelectIndex = (nNewSelectIndex + mnLineSize < nLastIndex) ? (nNewSelectIndex + mnLineSize) : nLastIndex;
- break;
- case PREV_PAGE:
- nNewSelectIndex = (nNewSelectIndex > mnPageSize) ? (nNewSelectIndex - mnPageSize) : 0;
- break;
- case NEXT_PAGE:
- nNewSelectIndex = (nNewSelectIndex + mnPageSize < nLastIndex) ? (nNewSelectIndex + mnPageSize) : nLastIndex;
- break;
- case FIRST_FIELD:
- nNewSelectIndex = 0;
- break;
- case LAST_FIELD:
- nNewSelectIndex = nLastIndex;
- break;
+ nCurX += aFldSize.Width() + ROW_FIELD_BTN_GAP;
+ ++nCol;
+ }
+ while (nY > nCurY && nCurY <= nH)
+ {
+ nCurY += aFldSize.Height() + ROW_FIELD_BTN_GAP;
+ ++nRow;
}
- // SetSelectionUnchecked() redraws the control and updates the scrollbar
- SetSelectionUnchecked( nNewSelectIndex, RecalcVisibleIndex( nNewSelectIndex ) );
+ size_t nOffset = maScroll.GetThumbPos();
+ nCol += nOffset; // convert to logical column ID.
+ rnIndex = nCol * mnFieldBtnRowCount + nRow;
+ size_t nFldCount = GetFieldCount();
+ if (rnIndex > nFldCount)
+ rnIndex = nFldCount;
+ return IsValidIndex(rnIndex);
}
-void ScPivotFieldWindow::MoveSelectedField( MoveType eMoveType )
+void ScDPHorFieldControl::Redraw()
{
- if( mnSelectIndex < maFields.size() )
+ VirtualDevice aVirDev;
+ // #i97623# VirtualDevice is always LTR while other windows derive direction from parent
+ aVirDev.EnableRTL( IsRTLEnabled() );
+ aVirDev.SetMapMode( MAP_PIXEL );
+
+ Point aPos0;
+ Size aSize( GetSizePixel() );
+ Font aFont( GetFont() ); // Font vom Window
+ aFont.SetTransparent( true );
+ aVirDev.SetFont( aFont );
+ aVirDev.SetOutputSizePixel( aSize );
+
+ DrawBackground( aVirDev );
+
+ FieldNames& rFields = GetFieldNames();
{
- // find position to insert the field by changing the selection first
- size_t nOldSelectIndex = mnSelectIndex;
- MoveSelection( eMoveType );
- MoveField( nOldSelectIndex, (nOldSelectIndex < mnSelectIndex) ? (mnSelectIndex + 1) : mnSelectIndex );
+ long nScrollOffset = maScroll.GetThumbPos();
+ FieldNames::iterator itr = rFields.begin(), itrEnd = rFields.end();
+ if (nScrollOffset)
+ ::std::advance(itr, nScrollOffset*mnFieldBtnRowCount);
+
+ for (size_t i = 0; itr != itrEnd; ++itr, ++i)
+ {
+ Point aFldPt;
+ Size aFldSize;
+ if (!GetFieldBtnPosSize(i, aFldPt, aFldSize))
+ break;
+
+ size_t nField = i + nScrollOffset*mnFieldBtnRowCount;
+ bool bFocus = HasFocus() && (nField == GetSelectedField());
+ DrawField(aVirDev, Rectangle(aFldPt, aFldSize), *itr, bFocus);
+ }
}
+
+ DrawBitmap( aPos0, aVirDev.GetBitmap( aPos0, aSize ) );
+ DrawPaintables();
+ DrawInvertSelection();
+ UpdateStyle();
+}
+
+void ScDPHorFieldControl::CalcSize()
+{
+ Size aWndSize = GetSizePixel();
+
+ long nScrollSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ maScroll.SetSizePixel(Size(aWndSize.Width() - OUTER_MARGIN_HOR*2, nScrollSize));
+ maScroll.SetPosPixel(Point(OUTER_MARGIN_HOR, aWndSize.Height() - OUTER_MARGIN_VER - nScrollSize));
+
+ long nTotalH = aWndSize.Height() - nScrollSize - OUTER_MARGIN_VER*2;
+ long nTotalW = aWndSize.Width() - OUTER_MARGIN_HOR*2;
+ mnFieldBtnRowCount = nTotalH / (GetFieldSize().Height() + ROW_FIELD_BTN_GAP);
+ mnFieldBtnColCount = (nTotalW + ROW_FIELD_BTN_GAP) / (GetFieldSize().Width() + ROW_FIELD_BTN_GAP);
+
+ maScroll.SetLineSize(1);
+ maScroll.SetVisibleSize(mnFieldBtnColCount);
+ maScroll.SetPageSize(mnFieldBtnColCount);
+ maScroll.SetRange(Range(0, mnFieldBtnColCount));
+}
+
+bool ScDPHorFieldControl::IsValidIndex(size_t /*nIndex*/) const
+{
+ return true;
}
-void ScPivotFieldWindow::InsertFieldUnchecked( size_t nInsertIndex, const ScPivotWindowField& rField )
+size_t ScDPHorFieldControl::CalcNewFieldIndex(SCsCOL nDX, SCsROW nDY) const
{
- maFields.insert( maFields.begin() + nInsertIndex, rField );
- ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
- if( xAcc.is() )
- xAcc->AddField( static_cast< sal_Int32 >( nInsertIndex ) );
+ size_t nSel = GetSelectedField();
+ size_t nFldCount = GetFieldCount();
+ SCsROW nRow = nSel % mnFieldBtnRowCount;
+ SCsCOL nCol = nSel / mnFieldBtnRowCount;
+ SCsCOL nColUpper = ceil(
+ static_cast<double>(nFldCount) / static_cast<double>(mnFieldBtnRowCount)) - 1;
+ SCsROW nRowUpper = mnFieldBtnRowCount - 1;
+
+ nCol += nDX;
+ if (nCol < 0)
+ nCol = 0;
+ else if (nColUpper < nCol)
+ nCol = nColUpper;
+ nRow += nDY;
+ if (nRow < 0)
+ nRow = 0;
+ else if (nRowUpper < nRow)
+ nRow = nRowUpper;
+
+ nSel = nCol*mnFieldBtnRowCount + nRow;
+ if (nSel >= nFldCount)
+ nSel = nFldCount - 1;
+
+ return nSel;
}
-void ScPivotFieldWindow::RemoveFieldUnchecked( size_t nRemoveIndex )
+size_t ScDPHorFieldControl::GetDisplayPosition(size_t nIndex) const
{
- ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
- if( xAcc.is() )
- xAcc->RemoveField( static_cast< sal_Int32 >( nRemoveIndex ) );
- maFields.erase( maFields.begin() + nRemoveIndex );
+ size_t nColFirst = maScroll.GetThumbPos();
+ size_t nColLast = nColFirst + mnFieldBtnColCount - 1;
+ size_t nCol = nIndex / mnFieldBtnRowCount;
+ size_t nRow = nIndex % mnFieldBtnRowCount;
+ if (nCol < nColFirst || nColLast < nCol)
+ // index is outside the visible area.
+ return INVALID_INDEX;
+
+ size_t nPos = (nCol - nColFirst)*mnFieldBtnRowCount + nRow;
+ return nPos;
}
-void ScPivotFieldWindow::DrawBackground( OutputDevice& rDev )
+String ScDPHorFieldControl::GetDescription() const
{
- Size aDevSize = rDev.GetOutputSizePixel();
- const StyleSettings& rStyleSett = GetSettings().GetStyleSettings();
+ return ScResId(STR_ACC_DATAPILOT_COL_DESCR);
+}
+
+void ScDPHorFieldControl::ScrollToEnd()
+{
+ maScroll.DoScroll(maScroll.GetRangeMax());
+}
- if( meFieldType == PIVOTFIELDTYPE_SELECT )
+void ScDPHorFieldControl::ScrollToShowSelection()
+{
+ size_t nLower = maScroll.GetThumbPos();
+ size_t nUpper = nLower + mnFieldBtnColCount - 1;
+ size_t nCol = GetSelectedField() / mnFieldBtnRowCount;
+ if (nCol < nLower)
{
- rDev.SetLineColor();
- rDev.SetFillColor( rStyleSett.GetFaceColor() );
- rDev.DrawRect( Rectangle( Point( 0, 0 ), aDevSize ) );
+ // scroll to left.
+ maScroll.DoScroll(nCol);
}
- else
+ else if (nUpper < nCol)
{
- rDev.SetLineColor( rStyleSett.GetWindowTextColor() );
- rDev.SetFillColor( rStyleSett.GetWindowColor() );
- rDev.DrawRect( Rectangle( Point( 0, 0 ), aDevSize ) );
-
- /* Draw the caption text. This needs some special handling, because we
- support hard line breaks here. This part will draw each line of the
- text for itself. */
- rDev.SetTextColor( rStyleSett.GetWindowTextColor() );
- xub_StrLen nTokenCnt = GetText().GetTokenCount( '\n' );
- long nY = (aDevSize.Height() - nTokenCnt * rDev.GetTextHeight()) / 2;
- for( xub_StrLen nToken = 0, nStringIx = 0; nToken < nTokenCnt; ++nToken )
- {
- String aLine = GetText().GetToken( 0, '\n', nStringIx );
- Point aLinePos( (aDevSize.Width() - rDev.GetCtrlTextWidth( aLine )) / 2, nY );
- rDev.DrawCtrlText( aLinePos, aLine );
- nY += rDev.GetTextHeight();
- }
+ // scroll to right.
+ maScroll.DoScroll(nCol - mnFieldBtnColCount + 1);
+ }
+}
+
+void ScDPHorFieldControl::ResetScrollBar()
+{
+ long nOldMax = maScroll.GetRangeMax();
+ long nNewMax = ceil(
+ static_cast<double>(GetFieldCount()) / static_cast<double>(mnFieldBtnRowCount));
+
+ if (nOldMax != nNewMax)
+ {
+ maScroll.SetRangeMax(nNewMax);
+ bool bShow = mnFieldBtnColCount*mnFieldBtnRowCount < GetFieldCount();
+ maScroll.Show(bShow);
+ }
+}
+
+void ScDPHorFieldControl::HandleWheelScroll(long /*nNotch*/)
+{
+ // not handled for horizontal field controls.
+}
+
+bool ScDPHorFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize)
+{
+ if (nPos >= mnFieldBtnColCount*mnFieldBtnRowCount)
+ return false;
+
+ Point aPos = Point(OUTER_MARGIN_HOR, OUTER_MARGIN_VER);
+ size_t nRow = nPos % mnFieldBtnRowCount;
+ size_t nCol = nPos / mnFieldBtnRowCount;
+
+ aPos.X() += nCol*(GetFieldSize().Width() + ROW_FIELD_BTN_GAP);
+ aPos.Y() += nRow*(GetFieldSize().Height() + ROW_FIELD_BTN_GAP);
+
+ rPos = aPos;
+ rSize = GetFieldSize();
+ return true;
+}
+
+void ScDPHorFieldControl::HandleScroll()
+{
+ Redraw();
+}
+
+IMPL_LINK(ScDPHorFieldControl, ScrollHdl, ScrollBar*, EMPTYARG)
+{
+ HandleScroll();
+ return 0;
+}
+
+IMPL_LINK(ScDPHorFieldControl, EndScrollHdl, ScrollBar*, EMPTYARG)
+{
+ HandleScroll();
+ return 0;
+}
+
+//=============================================================================
+
+ScDPPageFieldControl::ScDPPageFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
+ ScDPHorFieldControl(pDialog, rResId, pCaption)
+{
+}
+
+ScDPPageFieldControl::~ScDPPageFieldControl()
+{
+}
+
+ScDPFieldType ScDPPageFieldControl::GetFieldType() const
+{
+ return TYPE_PAGE;
+}
+
+String ScDPPageFieldControl::GetDescription() const
+{
+ return ScResId(STR_ACC_DATAPILOT_PAGE_DESCR);
+}
+
+//=============================================================================
+
+ScDPColFieldControl::ScDPColFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
+ ScDPHorFieldControl(pDialog, rResId, pCaption)
+{
+}
+
+ScDPColFieldControl::~ScDPColFieldControl()
+{
+}
+
+ScDPFieldType ScDPColFieldControl::GetFieldType() const
+{
+ return TYPE_COL;
+}
+
+String ScDPColFieldControl::GetDescription() const
+{
+ return ScResId(STR_ACC_DATAPILOT_COL_DESCR);
+}
+
+//=============================================================================
+
+ScDPRowFieldControl::ScDPRowFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption ) :
+ ScDPFieldControlBase( pDialog, rResId, pCaption ),
+ maScroll(this, WB_VERT | WB_DRAG),
+ mnColumnBtnCount(0)
+{
+ maScroll.SetScrollHdl( LINK(this, ScDPRowFieldControl, ScrollHdl) );
+ maScroll.SetEndScrollHdl( LINK(this, ScDPRowFieldControl, EndScrollHdl) );
+ maScroll.Show(false);
+
+ AppendPaintable(&maScroll);
+}
+
+ScDPRowFieldControl::~ScDPRowFieldControl()
+{
+}
+
+//-------------------------------------------------------------------
+
+Point ScDPRowFieldControl::GetFieldPosition(size_t nIndex)
+{
+ Point aPos;
+ Size aSize;
+ GetFieldBtnPosSize(nIndex, aPos, aSize);
+ return aPos;
+}
+
+Size ScDPRowFieldControl::GetFieldSize() const
+{
+ return Size(FIELD_BTN_WIDTH, FIELD_BTN_HEIGHT);
+}
+
+bool ScDPRowFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
+{
+ rnIndex = INVALID_INDEX;
+ if (rPos.X() < 0 || rPos.Y() < 0)
+ return false;
+
+ long nFldH = GetFieldSize().Height();
+ long nThreshold = OUTER_MARGIN_VER + nFldH + ROW_FIELD_BTN_GAP / 2;
+
+ size_t nIndex = 0;
+ for (; nIndex < mnColumnBtnCount; ++nIndex)
+ {
+ if (rPos.Y() < nThreshold)
+ break;
+
+ nThreshold += nFldH + ROW_FIELD_BTN_GAP;
}
+
+ if (nIndex >= mnColumnBtnCount)
+ nIndex = mnColumnBtnCount - 1;
+
+ nIndex += maScroll.GetThumbPos();
+ rnIndex = nIndex;
+ return IsValidIndex(rnIndex);
}
-void ScPivotFieldWindow::DrawField( OutputDevice& rDev, size_t nFieldIndex )
+void ScDPRowFieldControl::Redraw()
{
- if( (nFieldIndex < maFields.size()) && (mnFirstVisIndex <= nFieldIndex) && (nFieldIndex < mnFirstVisIndex + mnPageSize) )
+ VirtualDevice aVirDev;
+ // #i97623# VirtualDevice is always LTR while other windows derive direction from parent
+ aVirDev.EnableRTL( IsRTLEnabled() );
+ aVirDev.SetMapMode( MAP_PIXEL );
+
+ Point aPos0;
+ Size aWndSize = GetSizePixel();
+ Font aFont = GetFont();
+ aFont.SetTransparent(true);
+ aVirDev.SetFont(aFont);
+ aVirDev.SetOutputSizePixel(aWndSize);
+
+ DrawBackground(aVirDev);
+
+ FieldNames& rFields = GetFieldNames();
{
- // draw the button
- Point aFieldPos = GetFieldPosition( nFieldIndex );
- bool bFocus = HasFocus() && (nFieldIndex == mnSelectIndex);
- DecorationView aDecoView( &rDev );
- aDecoView.DrawButton( Rectangle( aFieldPos, maFieldSize ), bFocus ? BUTTON_DRAW_DEFAULT : 0 );
+ long nScrollOffset = maScroll.GetThumbPos();
+ FieldNames::iterator itr = rFields.begin(), itrEnd = rFields.end();
+ if (nScrollOffset)
+ ::std::advance(itr, nScrollOffset);
- // #i31600# if text is too long, cut and add ellipsis
- const OUString& rFullText = maFields[ nFieldIndex ].maFieldName;
- OUString aClippedText = rFullText;
- long nLabelWidth = rDev.GetTextWidth( rFullText );
- if( (maFields[ nFieldIndex ].mbClipped = nLabelWidth + 6 > maFieldSize.Width()) == true )
+ for (size_t i = 0; itr != itrEnd; ++itr, ++i)
{
- sal_Int32 nMinLen = 0;
- sal_Int32 nMaxLen = rFullText.getLength();
- bool bFits = false;
- do
- {
- sal_Int32 nCurrLen = (nMinLen + nMaxLen) / 2;
- aClippedText = rFullText.copy( 0, nCurrLen ) + OUString( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
- nLabelWidth = rDev.GetTextWidth( aClippedText );
- bFits = nLabelWidth + 6 <= maFieldSize.Width();
- (bFits ? nMinLen : nMaxLen) = nCurrLen;
- }
- while( !bFits || (nMinLen + 1 < nMaxLen) );
+ Point aFldPt;
+ Size aFldSize;
+ if (!GetFieldBtnPosSize(i, aFldPt, aFldSize))
+ break;
+
+ size_t nField = i + nScrollOffset;
+ bool bFocus = HasFocus() && (nField == GetSelectedField());
+ DrawField(aVirDev, Rectangle(aFldPt, aFldSize), *itr, bFocus);
}
// draw the button text
@@ -833,75 +1134,194 @@ void ScPivotFieldWindow::DrawField( OutputDevice& rDev, size_t nFieldIndex )
rDev.SetTextColor( GetSettings().GetStyleSettings().GetButtonTextColor() );
rDev.DrawText( aFieldPos + aLabelOffset, aClippedText );
}
+
+ // Create a bitmap from the virtual device, and place that bitmap onto
+ // this control.
+ DrawBitmap(aPos0, aVirDev.GetBitmap(aPos0, aWndSize));
+
+ DrawPaintables();
+ DrawInvertSelection();
+ UpdateStyle();
}
-void ScPivotFieldWindow::DrawInsertionCursor( OutputDevice& rDev )
+void ScDPRowFieldControl::CalcSize()
{
- if( (mnInsCursorIndex <= maFields.size()) && (mnFirstVisIndex <= mnInsCursorIndex) && (mnInsCursorIndex <= mnFirstVisIndex + mnPageSize) &&
- (!mbIsTrackingSource || (mnInsCursorIndex < mnSelectIndex) || (mnInsCursorIndex > mnSelectIndex + 1)) )
- {
- Color aTextColor = GetSettings().GetStyleSettings().GetButtonTextColor();
- rDev.SetLineColor( aTextColor );
- rDev.SetFillColor( aTextColor );
+ Size aWndSize = GetSizePixel();
- bool bVerticalCursor = mnColCount > 1;
- long nCursorLength = bVerticalCursor ? maFieldSize.Height() : maFieldSize.Width();
+ long nTotal = aWndSize.Height() - OUTER_MARGIN_VER;
+ mnColumnBtnCount = nTotal / (GetFieldSize().Height() + ROW_FIELD_BTN_GAP);
- bool bEndOfLastField = mnInsCursorIndex == mnFirstVisIndex + mnPageSize;
- Point aMainLinePos = GetFieldPosition( bEndOfLastField ? (mnInsCursorIndex - 1) : mnInsCursorIndex );
- if( bEndOfLastField )
- (bVerticalCursor ? aMainLinePos.X() : aMainLinePos.Y()) += ((bVerticalCursor ? maFieldSize.Width() : maFieldSize.Height()) - CURSOR_WIDTH);
- else if( (bVerticalCursor ? aMainLinePos.X() : aMainLinePos.Y()) > 0 )
- (bVerticalCursor ? aMainLinePos.X() : aMainLinePos.Y()) -= ((CURSOR_WIDTH + 1) / 2);
- Size aMainLineSize( bVerticalCursor ? CURSOR_WIDTH : nCursorLength, bVerticalCursor ? nCursorLength : CURSOR_WIDTH );
- rDev.DrawRect( Rectangle( aMainLinePos, aMainLineSize ) );
+ long nScrollSize = GetSettings().GetStyleSettings().GetScrollBarSize();
- Point aSubLinePos = aMainLinePos;
- (bVerticalCursor ? aSubLinePos.X() : aSubLinePos.Y()) -= CURSOR_WIDTH;
- Size aSubLineSize( bVerticalCursor ? (3 * CURSOR_WIDTH) : CURSOR_WIDTH, bVerticalCursor ? CURSOR_WIDTH : (3 * CURSOR_WIDTH) );
- rDev.DrawRect( Rectangle( aSubLinePos, aSubLineSize ) );
+ maScroll.SetSizePixel(Size(nScrollSize, aWndSize.Height() - OUTER_MARGIN_VER*2));
+ maScroll.SetPosPixel(Point(aWndSize.Width() - nScrollSize - OUTER_MARGIN_HOR, OUTER_MARGIN_VER));
+ maScroll.SetLineSize(1);
+ maScroll.SetVisibleSize(mnColumnBtnCount);
+ maScroll.SetPageSize(mnColumnBtnCount);
+ maScroll.SetRange(Range(0, mnColumnBtnCount));
+ maScroll.DoScroll(0);
- (bVerticalCursor ? aSubLinePos.Y() : aSubLinePos.X()) += (nCursorLength - CURSOR_WIDTH);
- rDev.DrawRect( Rectangle( aSubLinePos, aSubLineSize ) );
- }
}
-::rtl::Reference< ScAccessibleDataPilotControl > ScPivotFieldWindow::GetAccessibleControl()
+bool ScDPRowFieldControl::IsValidIndex(size_t /*nIndex*/) const
+{
+ // This method is here in case we decide to impose an arbitrary upper
+ // boundary on the number of fields.
+ return true;
+}
+
+size_t ScDPRowFieldControl::CalcNewFieldIndex(SCsCOL /*nDX*/, SCsROW nDY) const
+{
+ size_t nNewField = GetSelectedField();
+ nNewField += nDY;
+ return IsExistingIndex(nNewField) ? nNewField : GetSelectedField();
+}
+
+size_t ScDPRowFieldControl::GetDisplayPosition(size_t nIndex) const
+{
+ size_t nLower = maScroll.GetThumbPos();
+ size_t nUpper = nLower + mnColumnBtnCount;
+ if (nLower <= nIndex && nIndex <= nUpper)
+ return nIndex - nLower;
+
+ return INVALID_INDEX;
+}
+
+//-------------------------------------------------------------------
+
+String ScDPRowFieldControl::GetDescription() const
+{
+ return ScResId(STR_ACC_DATAPILOT_ROW_DESCR);
+}
+
+ScDPFieldType ScDPRowFieldControl::GetFieldType() const
+{
+ return TYPE_ROW;
+}
+
+void ScDPRowFieldControl::ScrollToEnd()
+{
+ maScroll.DoScroll(maScroll.GetRangeMax());
+}
+
+void ScDPRowFieldControl::ScrollToShowSelection()
{
- ::rtl::Reference< ScAccessibleDataPilotControl > xAccImpl;
- if( mpAccessible )
+ size_t nLower = maScroll.GetThumbPos();
+ size_t nUpper = nLower + mnColumnBtnCount - 1;
+ size_t nSel = GetSelectedField();
+ if (nSel < nLower)
{
- // try to resolve the weak reference mxAccessible
- uno::Reference< accessibility::XAccessible > xAcc = mxAccessible;
- if( xAcc.is() )
- xAccImpl.set( mpAccessible ); // the rtl reference keeps the object alive
- else
- mpAccessible = 0; // object is dead, forget the pointer
+ // scroll up
+ maScroll.DoScroll(nSel);
}
- return xAccImpl;
- }
-
-// handlers -------------------------------------------------------------------
+ else if (nUpper < nSel)
+ {
+ // scroll down
+ size_t nD = nSel - nUpper;
+ maScroll.DoScroll(nLower + nD);
+ }
+}
-IMPL_LINK( ScPivotFieldWindow, ScrollHdl, ScrollBar*, pScrollBar )
+void ScDPRowFieldControl::ResetScrollBar()
{
- // scrollbar may return negative values, if it is too small
- long nThumbPos = pScrollBar->GetThumbPos();
- if( nThumbPos >= 0 )
+ long nOldMax = maScroll.GetRangeMax();
+ long nNewMax = std::max<long>(mnColumnBtnCount, GetFieldCount());
+
+ if (nOldMax != nNewMax)
{
- size_t nNewFirstVisIndex = static_cast< size_t >( nThumbPos * mnLineSize );
- // keep the selection index on same relative position inside row/column
- size_t nSelectLineOffset = mnSelectIndex % mnLineSize;
- size_t nNewSelectIndex = mnSelectIndex;
- if( nNewSelectIndex < nNewFirstVisIndex )
- nNewSelectIndex = nNewFirstVisIndex + nSelectLineOffset;
- else if( nNewSelectIndex >= nNewFirstVisIndex + mnPageSize )
- nNewSelectIndex = nNewFirstVisIndex + mnPageSize - mnLineSize + nSelectLineOffset;
- nNewSelectIndex = ::std::min( nNewSelectIndex, maFields.size() - 1 );
- SetSelectionUnchecked( nNewSelectIndex, nNewFirstVisIndex );
+ maScroll.SetRangeMax(nNewMax);
+ maScroll.Show(GetFieldCount() > mnColumnBtnCount);
}
- GrabFocus();
+}
+
+void ScDPRowFieldControl::HandleWheelScroll(long nNotch)
+{
+ maScroll.DoScroll(maScroll.GetThumbPos() - nNotch);
+}
+
+bool ScDPRowFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize)
+{
+ if (nPos >= mnColumnBtnCount)
+ return false;
+
+ size_t nOffset = maScroll.GetThumbPos();
+ if (nPos + nOffset >= GetFieldCount())
+ return false;
+
+ rSize = GetFieldSize();
+ rPos = Point(OUTER_MARGIN_HOR, OUTER_MARGIN_VER);
+ rPos.Y() += nPos * (rSize.Height() + ROW_FIELD_BTN_GAP);
+ return true;
+}
+
+void ScDPRowFieldControl::HandleScroll()
+{
+ Redraw();
+}
+
+IMPL_LINK(ScDPRowFieldControl, ScrollHdl, ScrollBar*, EMPTYARG)
+{
+ HandleScroll();
return 0;
}
-// ============================================================================
+IMPL_LINK(ScDPRowFieldControl, EndScrollHdl, ScrollBar*, EMPTYARG)
+{
+ HandleScroll();
+ return 0;
+}
+
+//=============================================================================
+
+ScDPSelectFieldControl::ScDPSelectFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
+ ScDPHorFieldControl(pDialog, rResId, pCaption)
+{
+ SetName(String(ScResId(STR_SELECT)));
+}
+
+ScDPSelectFieldControl::~ScDPSelectFieldControl()
+{
+}
+
+ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
+{
+ return TYPE_SELECT;
+}
+
+String ScDPSelectFieldControl::GetDescription() const
+{
+ return ScResId(STR_ACC_DATAPILOT_SEL_DESCR);
+}
+
+//=============================================================================
+
+ScDPDataFieldControl::ScDPDataFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
+ ScDPHorFieldControl(pDialog, rResId, pCaption)
+{
+}
+
+ScDPDataFieldControl::~ScDPDataFieldControl()
+{
+}
+
+ScDPFieldType ScDPDataFieldControl::GetFieldType() const
+{
+ return TYPE_DATA;
+}
+
+Size ScDPDataFieldControl::GetFieldSize() const
+{
+ Size aWndSize = GetSizePixel();
+ long nFieldObjWidth = aWndSize.Width() / 2.0 - OUTER_MARGIN_HOR - DATA_FIELD_BTN_GAP/2;
+ Size aFieldSize(nFieldObjWidth, FIELD_BTN_HEIGHT);
+ return aFieldSize;
+}
+
+String ScDPDataFieldControl::GetDescription() const
+{
+ return ScResId(STR_ACC_DATAPILOT_DATA_DESCR);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 8e2bbc7458c3..03fd26ffd32e 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,14 +115,14 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
pDoc ( NULL ),
nSrcTab ( 0 ),
nFieldCount ( 0 ),
- bRefInputMode ( sal_False ),
+ bRefInputMode ( false ),
pTimer ( NULL )
{
for (sal_uInt16 i=0; i<=MAXCOL; i++)
pEntryLists[i] = NULL;
for (SCSIZE i=0;i<MAXQUERY;i++)
{
- bRefreshExceptQuery[i]=sal_False;
+ bRefreshExceptQuery[i]=false;
}
aBtnMore.SetMoreText( String(ScResId( SCSTR_MOREBTN_MOREOPTIONS )) );
aBtnMore.SetLessText( String(ScResId( SCSTR_MOREBTN_FEWEROPTIONS )) );
@@ -196,7 +197,7 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
//----------------------------------------------------------------------------
-__EXPORT ScFilterDlg::~ScFilterDlg()
+ScFilterDlg::~ScFilterDlg()
{
for (sal_uInt16 i=0; i<=MAXCOL; i++)
delete pEntryLists[i];
@@ -212,7 +213,7 @@ __EXPORT ScFilterDlg::~ScFilterDlg()
//----------------------------------------------------------------------------
-void __EXPORT ScFilterDlg::Init( const SfxItemSet& rArgSet )
+void ScFilterDlg::Init( const SfxItemSet& rArgSet )
{
const ScQueryItem& rQueryItem = (const ScQueryItem&)
rArgSet.Get( nWhichQuery );
@@ -399,7 +400,7 @@ void __EXPORT ScFilterDlg::Init( const SfxItemSet& rArgSet )
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScFilterDlg::Close()
+sal_Bool ScFilterDlg::Close()
{
if (pViewData)
pViewData->GetDocShell()->CancelAutoDBRange();
@@ -510,7 +511,7 @@ void ScFilterDlg::UpdateValueList( sal_uInt16 nList )
sal_uInt16 nOffset = GetSliderPos();
SCTAB nTab = nSrcTab;
SCROW nFirstRow = theQueryData.nRow1;
- SCROW nLastRow = theQueryData.nRow2;
+ SCROW nLastRow = theQueryData.bUseDynamicRange ? theQueryData.nDynamicEndRow : theQueryData.nRow2;
mbHasDates[nOffset+nList-1] = false;
// erstmal ohne die erste Zeile
@@ -555,6 +556,7 @@ void ScFilterDlg::UpdateValueList( sal_uInt16 nList )
}
}
pValList->SetText( aCurValue );
+ pValList->EnableDDAutoWidth(false);
}
UpdateHdrInValueList( nList );
@@ -598,13 +600,13 @@ void ScFilterDlg::UpdateHdrInValueList( sal_uInt16 nList )
}
else
{
- DBG_ERROR("Eintag in Liste nicht gefunden");
+ OSL_FAIL("Eintag in Liste nicht gefunden");
}
}
}
else
{
- DBG_ERROR("Spalte noch nicht initialisiert");
+ OSL_FAIL("Spalte noch nicht initialisiert");
}
}
}
@@ -641,7 +643,7 @@ ScQueryItem* ScFilterDlg::GetOutputItem()
{
ScAddress theCopyPos;
ScQueryParam theParam( theQueryData );
- sal_Bool bCopyPosOk = sal_False;
+ sal_Bool bCopyPosOk = false;
if ( aBtnCopyResult.IsChecked() )
{
@@ -657,7 +659,7 @@ ScQueryItem* ScFilterDlg::GetOutputItem()
if ( aBtnCopyResult.IsChecked() && bCopyPosOk )
{
- theParam.bInplace = sal_False;
+ theParam.bInplace = false;
theParam.nDestTab = theCopyPos.Tab();
theParam.nDestCol = theCopyPos.Col();
theParam.nDestRow = theCopyPos.Row();
@@ -713,13 +715,13 @@ IMPL_LINK( ScFilterDlg, EndDlgHdl, Button*, pBtn )
ERRORBOX( STR_INVALID_TABREF );
aEdCopyArea.GrabFocus();
- bAreaInputOk = sal_False;
+ bAreaInputOk = false;
}
}
if ( bAreaInputOk )
{
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
GetBindings().GetDispatcher()->Execute( FID_FILTER_OK,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
@@ -745,7 +747,7 @@ IMPL_LINK( ScFilterDlg, MoreClickHdl, MoreButton*, EMPTYARG )
else
{
pTimer->Stop();
- bRefInputMode = sal_False;
+ bRefInputMode = false;
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse
//SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg
}
@@ -858,8 +860,8 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
aEdVal4.Disable();
for (sal_uInt16 i= nOffset; i< MAXQUERY; i++)
{
- theQueryData.GetEntry(i).bDoQuery = sal_False;
- bRefreshExceptQuery[i]=sal_False;
+ theQueryData.GetEntry(i).bDoQuery = false;
+ bRefreshExceptQuery[i]=false;
theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0);
}
bRefreshExceptQuery[nOffset] =sal_True;
@@ -902,8 +904,8 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
sal_uInt16 nTemp=nOffset+1;
for (sal_uInt16 i= nTemp; i< MAXQUERY; i++)
{
- theQueryData.GetEntry(i).bDoQuery = sal_False;
- bRefreshExceptQuery[i]=sal_False;
+ theQueryData.GetEntry(i).bDoQuery = false;
+ bRefreshExceptQuery[i]=false;
theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0);
}
bRefreshExceptQuery[nTemp]=sal_True;
@@ -939,8 +941,8 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
sal_uInt16 nTemp=nOffset+2;
for (sal_uInt16 i= nTemp; i< MAXQUERY; i++)
{
- theQueryData.GetEntry(i).bDoQuery = sal_False;
- bRefreshExceptQuery[i]=sal_False;
+ theQueryData.GetEntry(i).bDoQuery = false;
+ bRefreshExceptQuery[i]=false;
theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0);
}
bRefreshExceptQuery[nTemp]=sal_True;
@@ -968,8 +970,8 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
sal_uInt16 nTemp=nOffset+3;
for (sal_uInt16 i= nTemp; i< MAXQUERY; i++)
{
- theQueryData.GetEntry(i).bDoQuery = sal_False;
- bRefreshExceptQuery[i]=sal_False;
+ theQueryData.GetEntry(i).bDoQuery = false;
+ bRefreshExceptQuery[i]=false;
theQueryData.GetEntry(i).nField = static_cast<SCCOL>(0);
}
bRefreshExceptQuery[nTemp]=sal_True;
@@ -1103,13 +1105,13 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd )
{
rEntry.pStr->Erase();
rEntry.nVal = SC_EMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
}
else if ( aStrVal == aStrNotEmpty )
{
rEntry.pStr->Erase();
rEntry.nVal = SC_NONEMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
}
else
{
@@ -1243,3 +1245,5 @@ void ScFilterDlg::RefreshEditRow( sal_uInt16 nOffset )
UpdateValueList( static_cast<sal_uInt16>(i+1) );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index 8028158cef88..d6f9d28b98ea 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -224,7 +225,7 @@ void ScFilterOptionsMgr::Init()
}
else
{
- rBtnCopyResult.Check( sal_False );
+ rBtnCopyResult.Check( false );
rEdCopyPos.SetText( EMPTY_STRING );
rLbCopyPos.Disable();
rEdCopyPos.Disable();
@@ -287,7 +288,7 @@ IMPL_LINK( ScFilterOptionsMgr, EdPosModifyHdl, Edit*, pEd )
if ( SCA_VALID == (nResult & SCA_VALID) )
{
String* pStr = NULL;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 i = 0;
sal_uInt16 nCount = rLbCopyPos.GetEntryCount();
@@ -335,3 +336,5 @@ IMPL_LINK( ScFilterOptionsMgr, BtnCopyResultHdl, CheckBox*, pBox )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index b21afc999b28..56946006ce02 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,12 +49,12 @@ ScImportOptions::ScImportOptions( const String& rStr )
// because the import options string is passed here when a CSV file is loaded and saved again.
// The old format is still supported because it might be used in macros.
- bFixedWidth = sal_False;
+ bFixedWidth = false;
nFieldSepCode = 0;
nTextSepCode = 0;
eCharSet = RTL_TEXTENCODING_DONTKNOW;
bSaveAsShown = sal_True; // "true" if not in string (after CSV import)
- bQuoteAllText = sal_False;
+ bQuoteAllText = false;
xub_StrLen nTokenCount = rStr.GetTokenCount(',');
if ( nTokenCount >= 3 )
{
@@ -70,7 +71,7 @@ ScImportOptions::ScImportOptions( const String& rStr )
if ( nTokenCount == 4 )
{
// compatibility with old options string: "Save as shown" as 4th token, numeric
- bSaveAsShown = (rStr.GetToken( 3, ',' ).ToInt32() ? sal_True : sal_False);
+ bSaveAsShown = (rStr.GetToken( 3, ',' ).ToInt32() ? sal_True : false);
bQuoteAllText = sal_True; // use old default then
}
else
@@ -115,3 +116,5 @@ void ScImportOptions::SetTextEncoding( rtl_TextEncoding nEnc )
gsl_getSystemTextEncoding() : nEnc);
aStrFont = ScGlobal::GetCharsetString( nEnc );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/imoptdlg.hrc b/sc/source/ui/dbgui/imoptdlg.hrc
index 22136706de9d..6fab4c6db907 100644
--- a/sc/source/ui/dbgui/imoptdlg.hrc
+++ b/sc/source/ui/dbgui/imoptdlg.hrc
@@ -26,8 +26,6 @@
************************************************************************/
#include "sc.hrc"
-//#define RID_SCDLG_IMPORTOPT 2256
-
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
@@ -41,5 +39,3 @@
#define FL_FIELDOPT 11
#define CB_FIXEDWIDTH 12
#define CB_SAVESHOWN 13
-#define CB_QUOTEALL 14
-
diff --git a/sc/source/ui/dbgui/imoptdlg.src b/sc/source/ui/dbgui/imoptdlg.src
index 905308e9fecb..8f6839533851 100644
--- a/sc/source/ui/dbgui/imoptdlg.src
+++ b/sc/source/ui/dbgui/imoptdlg.src
@@ -25,7 +25,6 @@
*
************************************************************************/
-
#include "imoptdlg.hrc"
ModalDialog RID_SCDLG_IMPORTOPT
@@ -103,8 +102,7 @@ ModalDialog RID_SCDLG_IMPORTOPT
};
CheckBox CB_SAVESHOWN
{
- HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_SAVESHOWN";
- Pos = MAP_APPFONT( 12, 78 );
+ Pos = MAP_APPFONT( 12, 66 );
Size = MAP_APPFONT( 172, 10 );
TabStop = TRUE;
Hide = TRUE;
@@ -135,21 +133,3 @@ ModalDialog RID_SCDLG_IMPORTOPT
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/dbgui/makefile.mk b/sc/source/ui/dbgui/makefile.mk
index 1e7000d0cb07..33b8cdbfca7a 100644
--- a/sc/source/ui/dbgui/makefile.mk
+++ b/sc/source/ui/dbgui/makefile.mk
@@ -33,53 +33,43 @@ LIBTARGET=no
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/sortdlg.obj \
- $(SLO)$/tpsort.obj \
- $(SLO)$/filtdlg.obj \
- $(SLO)$/sfiltdlg.obj \
- $(SLO)$/foptmgr.obj \
- $(SLO)$/pfiltdlg.obj \
- $(SLO)$/dbnamdlg.obj \
- $(SLO)$/expftext.obj \
- $(SLO)$/textimportoptions.obj \
- $(SLO)$/subtdlg.obj \
- $(SLO)$/tpsubt.obj \
- $(SLO)$/fieldwnd.obj \
- $(SLO)$/pvlaydlg.obj \
- $(SLO)$/pvfundlg.obj \
- $(SLO)$/dpgroupdlg.obj \
- $(SLO)$/dapitype.obj \
- $(SLO)$/dapidata.obj \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES= \
+ $(SLO)$/asciiopt.obj \
$(SLO)$/consdlg.obj \
- $(SLO)$/scendlg.obj \
- $(SLO)$/imoptdlg.obj \
- $(SLO)$/validate.obj \
- $(SLO)$/csvsplits.obj \
$(SLO)$/csvcontrol.obj \
- $(SLO)$/csvruler.obj \
$(SLO)$/csvgrid.obj \
+ $(SLO)$/csvruler.obj \
+ $(SLO)$/csvsplits.obj \
$(SLO)$/csvtablebox.obj \
- $(SLO)$/asciiopt.obj \
- $(SLO)$/scuiasciiopt.obj \
- $(SLO)$/scuiimoptdlg.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/csvgrid.obj \
- $(SLO)$/csvruler.obj \
- $(SLO)$/csvsplits.obj \
- $(SLO)$/csvtablebox.obj \
- $(SLO)$/fieldwnd.obj \
+ $(SLO)$/dapidata.obj \
+ $(SLO)$/dapitype.obj \
+ $(SLO)$/dbnamdlg.obj \
+ $(SLO)$/dpgroupdlg.obj \
+ $(SLO)$/expftext.obj \
+ $(SLO)$/fieldwnd.obj \
+ $(SLO)$/filtdlg.obj \
+ $(SLO)$/foptmgr.obj \
+ $(SLO)$/imoptdlg.obj \
+ $(SLO)$/pfiltdlg.obj \
$(SLO)$/pvfundlg.obj \
$(SLO)$/pvlaydlg.obj \
- $(SLO)$/dapidata.obj \
+ $(SLO)$/scendlg.obj \
+ $(SLO)$/scuiasciiopt.obj \
+ $(SLO)$/scuiimoptdlg.obj \
+ $(SLO)$/sfiltdlg.obj \
+ $(SLO)$/sortdlg.obj \
+ $(SLO)$/subtdlg.obj \
+ $(SLO)$/textimportoptions.obj \
+ $(SLO)$/tpsort.obj \
+ $(SLO)$/tpsubt.obj \
$(SLO)$/validate.obj
SRS1NAME=$(TARGET)
diff --git a/sc/source/ui/dbgui/outline.src b/sc/source/ui/dbgui/outline.src
index cd59bf3b099d..f1a895ddea23 100644
--- a/sc/source/ui/dbgui/outline.src
+++ b/sc/source/ui/dbgui/outline.src
@@ -27,7 +27,6 @@
#include "sc.hrc"
-
// Imageliste hier, damit sie nicht in ui.src beim Zusammenbauen der
// "echten" Imagelisten stoert
@@ -41,11 +40,3 @@ ImageList RID_OUTLINEBITMAPS
MaskColor = STD_MASKCOLOR;
OUTLINE_ID_LIST
};
-
-ImageList RID_OUTLINEBITMAPS_H
-{
- Prefix = "ouh";
- MaskColor = SC_HC_MASKCOLOR;
- OUTLINE_ID_LIST
-};
-
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index d08d13fcb001..5cdf37116f13 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,7 +115,7 @@ ScPivotFilterDlg::ScPivotFilterDlg( Window* pParent,
//------------------------------------------------------------------------
-__EXPORT ScPivotFilterDlg::~ScPivotFilterDlg()
+ScPivotFilterDlg::~ScPivotFilterDlg()
{
for (sal_uInt16 i=0; i<=MAXCOL; i++)
delete pEntryLists[i];
@@ -125,7 +126,7 @@ __EXPORT ScPivotFilterDlg::~ScPivotFilterDlg()
//------------------------------------------------------------------------
-void __EXPORT ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
+void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
{
const ScQueryItem& rQueryItem = (const ScQueryItem&)
rArgSet.Get( nWhichQuery );
@@ -427,13 +428,13 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem()
{
*rEntry.pStr = EMPTY_STRING;
rEntry.nVal = SC_EMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
}
else if ( aStrVal == aStrNotEmpty )
{
*rEntry.pStr = EMPTY_STRING;
rEntry.nVal = SC_NONEMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
}
else
{
@@ -455,7 +456,7 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem()
? (ScQueryConnect)nConnect2
: SC_AND;
- theParam.bInplace = sal_False;
+ theParam.bInplace = false;
theParam.nDestTab = 0; // Woher kommen diese Werte?
theParam.nDestCol = 0;
theParam.nDestRow = 0;
@@ -618,3 +619,4 @@ IMPL_LINK( ScPivotFilterDlg, ValModifyHdl, ComboBox*, pEd )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pivot.hrc b/sc/source/ui/dbgui/pivot.hrc
index fd14c0f98a6b..244be15649ec 100644
--- a/sc/source/ui/dbgui/pivot.hrc
+++ b/sc/source/ui/dbgui/pivot.hrc
@@ -42,8 +42,6 @@
#define SCROLL_DATA 93
#define WND_DATA 13
#define WND_SELECT 14
-#define WND_HSCROLL 17
-#define SCROLL_PAGE 98
#define WND_PAGE 18
#define FT_COL 31
#define FT_ROW 32
@@ -81,4 +79,3 @@
#define PIVOTSTR_DEV2 9
#define PIVOTSTR_VAR 10
#define PIVOTSTR_VAR2 11
-
diff --git a/sc/source/ui/dbgui/pivot.src b/sc/source/ui/dbgui/pivot.src
index 52b1a9d584cd..423c7df6e547 100644
--- a/sc/source/ui/dbgui/pivot.src
+++ b/sc/source/ui/dbgui/pivot.src
@@ -30,8 +30,8 @@
ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
OutputSize = TRUE ;
- HelpId = CMD_SID_OPENDLG_PIVOTTABLE ;
- Size = MAP_APPFONT ( 348 , 186 ) ;
+ HelpId = SID_OPENDLG_PIVOTTABLE ;
+ Size = MAP_APPFONT ( 350 , 216 ) ;
Hide = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
@@ -53,8 +53,9 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
Control WND_PAGE
{
- Pos = MAP_APPFONT ( 18 , 14 ) ;
- Size = MAP_APPFONT ( 180 , 24 ) ;
+ /* Size is calculated in the dialog code. */
+ Pos = MAP_APPFONT ( 20 , 14 ) ;
+ Size = MAP_APPFONT ( 1 , 1 ) ;
TabStop = TRUE ;
};
FixedText FT_COL
@@ -72,8 +73,9 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
Control WND_COL
{
- Pos = MAP_APPFONT ( 54 , 42 ) ;
- Size = MAP_APPFONT ( 144 , 24 ) ;
+ /* Size is calculated in the dialog code. */
+ Pos = MAP_APPFONT ( 56 , 56 ) ;
+ Size = MAP_APPFONT ( 1 , 1 ) ;
TabStop = TRUE ;
};
FixedText FT_ROW
@@ -91,13 +93,14 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
Control WND_ROW
{
- Pos = MAP_APPFONT ( 6 , 70 ) ;
- Size = MAP_APPFONT ( 36 , 96 ) ;
+ /* Size is calculated in the dialog code. */
+ Pos = MAP_APPFONT ( 6 , 98 ) ;
+ Size = MAP_APPFONT ( 1 , 1 ) ;
TabStop = TRUE ;
};
FixedText FT_DATA
{
- Pos = MAP_APPFONT ( 231, 176 ) ;
+ Pos = MAP_APPFONT ( 227, 176 ) ;
Size = MAP_APPFONT ( 37 , 8 ) ;
Text [ en-US ] = "Data Fields" ;
};
@@ -110,38 +113,33 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
Control WND_DATA
{
- Pos = MAP_APPFONT ( 54 , 70 ) ;
- Size = MAP_APPFONT ( 144 , 96 ) ;
+ /* Size is calculated in the dialog code. */
+ Pos = MAP_APPFONT ( 56 , 98 ) ;
+ Size = MAP_APPFONT ( 1 , 1 ) ;
TabStop = TRUE ;
};
Control WND_SELECT
{
- Pos = MAP_APPFONT ( 212 , 14 ) ;
- Size = MAP_APPFONT ( 74 , 138 ) ;
+ /* Size is calculated in the dialog code. */
+ Pos = MAP_APPFONT ( 210 , 14 ) ;
+ Size = MAP_APPFONT ( 1 , 1 ) ;
TabStop = TRUE ;
};
String STR_SELECT
{
Text [ en-US ] = "Selection area";
};
- ScrollBar WND_HSCROLL
- {
- Pos = MAP_APPFONT ( 212 , 154 ) ;
- Size = MAP_APPFONT ( 74 , 8 ) ;
- HScroll = TRUE ;
- TabStop = FALSE ;
- };
FixedText FT_INFO
{
- Pos = MAP_APPFONT ( 6 , 172 ) ;
- Size = MAP_APPFONT ( 280 , 8 ) ;
+ Pos = MAP_APPFONT ( 6 , 200 ) ;
+ Size = MAP_APPFONT ( 182 , 16 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "Drag the fields from the right into the desired position." ;
};
FixedLine FL_LAYOUT
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 200 , 8 ) ;
+ Size = MAP_APPFONT ( 282 , 8 ) ;
Text [ en-US ] = "Layout";
};
FixedLine FL_SELECT
@@ -152,43 +150,40 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
OKButton BTN_OK
{
- Pos = MAP_APPFONT ( 292 , 6 ) ;
+ Pos = MAP_APPFONT ( 294 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
- Pos = MAP_APPFONT ( 292 , 23 ) ;
+ Pos = MAP_APPFONT ( 294 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BTN_HELP
{
- Pos = MAP_APPFONT ( 292 , 43 ) ;
+ Pos = MAP_APPFONT ( 294 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
PushButton BTN_REMOVE
{
- HelpID = "sc:PushButton:RID_SCDLG_PIVOT_LAYOUT:BTN_REMOVE";
- Pos = MAP_APPFONT ( 292 , 63 ) ;
+ Pos = MAP_APPFONT ( 294 , 63 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Remove";
};
PushButton BTN_OPTIONS
{
- HelpID = "sc:PushButton:RID_SCDLG_PIVOT_LAYOUT:BTN_OPTIONS";
- Pos = MAP_APPFONT ( 292 , 80 ) ;
+ Pos = MAP_APPFONT ( 294 , 80 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Options...";
};
MoreButton BTN_MORE
{
- HelpID = "sc:MoreButton:RID_SCDLG_PIVOT_LAYOUT:BTN_MORE";
- Pos = MAP_APPFONT ( 292 , 166 ) ;
+ Pos = MAP_APPFONT ( 294 , 190 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
MapUnit = MAP_APPFONT ;
@@ -196,15 +191,15 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
FixedLine FL_OUTPUT
{
- Pos = MAP_APPFONT ( 6 , 186 ) ;
- Size = MAP_APPFONT ( 280 , 8 ) ;
+ Pos = MAP_APPFONT ( 6 , 216 ) ;
+ Size = MAP_APPFONT ( 268 , 8 ) ;
Text [ en-US ] = "Result" ;
Hide = TRUE ;
};
FixedText FT_INAREA
{
- Pos = MAP_APPFONT ( 12 , 199 ) ;
+ Pos = MAP_APPFONT ( 12 , 229 ) ;
Size = MAP_APPFONT ( 59 , 8 ) ;
Hide = TRUE ;
Text [ en-US ] = "Selection from" ;
@@ -213,15 +208,14 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_INAREA";
Border = TRUE ;
- Pos = MAP_APPFONT ( 73 , 197 ) ;
- Size = MAP_APPFONT ( 109 , 12 ) ;
+ Pos = MAP_APPFONT ( 73 , 227 ) ;
+ Size = MAP_APPFONT ( 100 , 12 ) ;
TabStop = TRUE ;
Hide = TRUE ;
};
ImageButton RB_INAREA
{
- HelpID = "sc:ImageButton:RID_SCDLG_PIVOT_LAYOUT:RB_INAREA";
- Pos = MAP_APPFONT ( 186 , 196 ) ;
+ Pos = MAP_APPFONT ( 177 , 226 ) ;
Size = MAP_APPFONT ( 13 , 15 ) ;
TabStop = TRUE ;
Hide = TRUE ;
@@ -230,7 +224,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
FixedText FT_OUTAREA
{
- Pos = MAP_APPFONT ( 12 , 217 ) ;
+ Pos = MAP_APPFONT ( 12 , 247 ) ;
Size = MAP_APPFONT ( 59 , 8 ) ;
Hide = TRUE ;
Text [ en-US ] = "Results to" ;
@@ -239,7 +233,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
HelpID = "sc:ListBox:RID_SCDLG_PIVOT_LAYOUT:LB_OUTAREA";
Border = TRUE ;
- Pos = MAP_APPFONT ( 73 , 215 ) ;
+ Pos = MAP_APPFONT ( 73 , 245 ) ;
Size = MAP_APPFONT ( 75 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
@@ -249,15 +243,14 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_OUTAREA";
Border = TRUE ;
- Pos = MAP_APPFONT ( 152 , 215 ) ;
- Size = MAP_APPFONT ( 109 , 12 ) ;
+ Pos = MAP_APPFONT ( 152 , 245 ) ;
+ Size = MAP_APPFONT ( 100 , 12 ) ;
TabStop = TRUE ;
Hide = TRUE ;
};
ImageButton RB_OUTAREA
{
- HelpID = "sc:ImageButton:RID_SCDLG_PIVOT_LAYOUT:RB_OUTAREA";
- Pos = MAP_APPFONT ( 265 , 214 ) ;
+ Pos = MAP_APPFONT ( 256 , 244 ) ;
Size = MAP_APPFONT ( 13 , 15 ) ;
TabStop = TRUE ;
Hide = TRUE ;
@@ -265,54 +258,48 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
CheckBox BTN_IGNEMPTYROWS
{
- HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_IGNEMPTYROWS";
- Pos = MAP_APPFONT ( 12 , 233 ) ;
- Size = MAP_APPFONT ( 136 , 10 ) ;
+ Pos = MAP_APPFONT ( 12 , 263 ) ;
+ Size = MAP_APPFONT ( 124 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Ignore ~empty rows" ;
};
CheckBox BTN_DETECTCAT
{
- HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_DETECTCAT";
- Pos = MAP_APPFONT ( 152 , 233 ) ;
- Size = MAP_APPFONT ( 128 , 10 ) ;
+ Pos = MAP_APPFONT ( 142 , 263 ) ;
+ Size = MAP_APPFONT ( 124 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "~Identify categories" ;
};
CheckBox BTN_TOTALCOL
{
- HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_TOTALCOL";
- Pos = MAP_APPFONT ( 12 , 247 ) ;
- Size = MAP_APPFONT ( 136 , 10 ) ;
+ Pos = MAP_APPFONT ( 12 , 277 ) ;
+ Size = MAP_APPFONT ( 124 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Total columns" ;
};
CheckBox BTN_TOTALROW
{
- HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_TOTALROW";
- Pos = MAP_APPFONT ( 152 , 247 ) ;
- Size = MAP_APPFONT ( 128 , 10 ) ;
+ Pos = MAP_APPFONT ( 142 , 277 ) ;
+ Size = MAP_APPFONT ( 124 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "~Total rows" ;
};
CheckBox BTN_FILTER
{
- HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_FILTER";
- Pos = MAP_APPFONT ( 12 , 261 ) ;
- Size = MAP_APPFONT ( 136 , 10 ) ;
+ Pos = MAP_APPFONT ( 12 , 291 ) ;
+ Size = MAP_APPFONT ( 124 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "~Add filter" ;
};
CheckBox BTN_DRILLDOWN
{
- HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_DRILLDOWN";
- Pos = MAP_APPFONT ( 152 , 261 ) ;
- Size = MAP_APPFONT ( 128 , 10 ) ;
+ Pos = MAP_APPFONT ( 142 , 291 ) ;
+ Size = MAP_APPFONT ( 124 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Ena~ble drill to details" ;
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 5ee9b320a04e..403ae802fc1e 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,8 @@ template< typename ListBoxType >
bool lclFillListBox( ListBoxType& rLBox, const Sequence< OUString >& rStrings, sal_uInt16 nEmptyPos = LISTBOX_APPEND )
{
bool bEmpty = false;
- if( const OUString* pStr = rStrings.getConstArray() )
+ const OUString* pStr = rStrings.getConstArray();
+ if( pStr )
{
for( const OUString* pEnd = pStr + rStrings.getLength(); pStr != pEnd; ++pStr )
{
@@ -107,15 +109,6 @@ bool lclFillListBox( ListBoxType& rLBox, const vector<ScDPLabelData::Member>& rM
return bEmpty;
}
-/** Searches for a listbox entry, starts search at specified position. */
-sal_uInt16 lclFindListBoxEntry( const ListBox& rLBox, const String& rEntry, sal_uInt16 nStartPos )
-{
- sal_uInt16 nPos = nStartPos;
- while( (nPos < rLBox.GetEntryCount()) && (rLBox.GetEntry( nPos ) != rEntry) )
- ++nPos;
- return (nPos < rLBox.GetEntryCount()) ? nPos : LISTBOX_ENTRY_NOTFOUND;
-}
-
/** This table represents the order of the strings in the resource string array. */
static const sal_uInt16 spnFunctions[] =
{
@@ -245,7 +238,7 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const
DataPilotFieldReference aRef;
aRef.ReferenceType = maLbTypeWrp.GetControlValue();
- aRef.ReferenceField = maLbBaseField.GetSelectEntry();
+ aRef.ReferenceField = GetBaseFieldName(maLbBaseField.GetSelectEntry());
sal_uInt16 nBaseItemPos = maLbBaseItem.GetSelectEntryPos();
switch( nBaseItemPos )
@@ -260,7 +253,7 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const
{
aRef.ReferenceItemType = DataPilotFieldReferenceItemType::NAMED;
if( !mbEmptyItem || (nBaseItemPos > SC_BASEITEM_USER_POS) )
- aRef.ReferenceItemName = maLbBaseItem.GetSelectEntry();
+ aRef.ReferenceItemName = GetBaseItemName(maLbBaseItem.GetSelectEntry());
}
}
@@ -291,8 +284,15 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
maLbBaseField.SetSelectHdl( LINK( this, ScDPFunctionDlg, SelectHdl ) );
// base field list box
- for( ScDPLabelDataVector::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt )
+ OUString aSelectedEntry;
+ for( ScDPLabelDataVec::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt )
+ {
maLbBaseField.InsertEntry(aIt->getDisplayName());
+ maBaseFieldNameMap.insert(
+ NameMapType::value_type(aIt->getDisplayName(), aIt->maName));
+ if (aIt->maName == rFuncData.maFieldRef.ReferenceField)
+ aSelectedEntry = aIt->getDisplayName();
+ }
// base item list box
maLbBaseItem.SetSeparatorPos( SC_BASEITEM_USER_POS - 1 );
@@ -302,7 +302,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
SelectHdl( &maLbType ); // enables base field/item list boxes
// select base field
- maLbBaseField.SelectEntry( rFuncData.maFieldRef.ReferenceField );
+ maLbBaseField.SelectEntry(aSelectedEntry);
if( maLbBaseField.GetSelectEntryPos() >= maLbBaseField.GetEntryCount() )
maLbBaseField.SelectEntryPos( 0 );
SelectHdl( &maLbBaseField ); // fills base item list, selects base item
@@ -326,7 +326,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
else
{
sal_uInt16 nStartPos = mbEmptyItem ? (SC_BASEITEM_USER_POS + 1) : SC_BASEITEM_USER_POS;
- sal_uInt16 nPos = lclFindListBoxEntry( maLbBaseItem, rFuncData.maFieldRef.ReferenceItemName, nStartPos );
+ sal_uInt16 nPos = FindBaseItemPos( rFuncData.maFieldRef.ReferenceItemName, nStartPos );
if( nPos >= maLbBaseItem.GetEntryCount() )
nPos = (maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS;
maLbBaseItem.SelectEntryPos( nPos );
@@ -335,6 +335,36 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
}
}
+const OUString& ScDPFunctionDlg::GetBaseFieldName(const OUString& rLayoutName) const
+{
+ NameMapType::const_iterator itr = maBaseFieldNameMap.find(rLayoutName);
+ return itr == maBaseFieldNameMap.end() ? rLayoutName : itr->second;
+}
+
+const OUString& ScDPFunctionDlg::GetBaseItemName(const OUString& rLayoutName) const
+{
+ NameMapType::const_iterator itr = maBaseItemNameMap.find(rLayoutName);
+ return itr == maBaseItemNameMap.end() ? rLayoutName : itr->second;
+}
+
+sal_uInt16 ScDPFunctionDlg::FindBaseItemPos( const String& rEntry, sal_uInt16 nStartPos ) const
+{
+ sal_uInt16 nPos = nStartPos;
+ bool bFound = false;
+ while (nPos < maLbBaseItem.GetEntryCount())
+ {
+ // translate the displayed field name back to its original field name.
+ const OUString& rName = GetBaseItemName(maLbBaseItem.GetEntry(nPos));
+ if (rName.equals(rEntry))
+ {
+ bFound = true;
+ break;
+ }
+ ++nPos;
+ }
+ return bFound ? nPos : LISTBOX_ENTRY_NOTFOUND;
+}
+
IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox )
{
if( pLBox == &maLbType )
@@ -375,7 +405,16 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox )
mbEmptyItem = false;
size_t nBasePos = maLbBaseField.GetSelectEntryPos();
if( nBasePos < mrLabelVec.size() )
- mbEmptyItem = lclFillListBox( maLbBaseItem, mrLabelVec[ nBasePos ].maMembers, SC_BASEITEM_USER_POS );
+ {
+ const vector<ScDPLabelData::Member>& rMembers = mrLabelVec[nBasePos].maMembers;
+ mbEmptyItem = lclFillListBox( maLbBaseItem, rMembers, SC_BASEITEM_USER_POS );
+ // build cache for base names.
+ NameMapType aMap;
+ vector<ScDPLabelData::Member>::const_iterator itr = rMembers.begin(), itrEnd = rMembers.end();
+ for (; itr != itrEnd; ++itr)
+ aMap.insert(NameMapType::value_type(itr->getDisplayName(), itr->maName));
+ maBaseItemNameMap.swap(aMap);
+ }
// select base item
sal_uInt16 nItemPos = (maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS;
@@ -547,7 +586,7 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const
else
rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::DATA;
- rLabelData.maSortInfo.Field = maLbSortBy.GetSelectEntry();
+ rLabelData.maSortInfo.Field = GetFieldName(maLbSortBy.GetSelectEntry());
rLabelData.maSortInfo.IsAscending = maRbSortAsc.IsChecked();
// *** LAYOUT MODE ***
@@ -560,7 +599,7 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const
rLabelData.maShowInfo.IsEnabled = maCbShow.IsChecked();
rLabelData.maShowInfo.ShowItemsMode = maLbShowFromWrp.GetControlValue();
rLabelData.maShowInfo.ItemCount = sal::static_int_cast<sal_Int32>( maNfShow.GetValue() );
- rLabelData.maShowInfo.DataField = maLbShowUsing.GetSelectEntry();
+ rLabelData.maShowInfo.DataField = GetFieldName(maLbShowUsing.GetSelectEntry());
// *** HIDDEN ITEMS ***
@@ -585,16 +624,20 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou
for( ScDPNameVec::const_iterator aIt = rDataFields.begin(), aEnd = rDataFields.end(); aIt != aEnd; ++aIt )
{
- maLbSortBy.InsertEntry( *aIt );
- maLbShowUsing.InsertEntry( *aIt ); // for AutoShow
+ // Cache names for later lookup.
+ maDataFieldNameMap.insert(NameMapType::value_type(aIt->maLayoutName, aIt->maName));
+
+ maLbSortBy.InsertEntry( aIt->maLayoutName );
+ maLbShowUsing.InsertEntry( aIt->maLayoutName ); // for AutoShow
}
+
if( maLbSortBy.GetEntryCount() > SC_SORTDATA_POS )
maLbSortBy.SetSeparatorPos( SC_SORTDATA_POS - 1 );
sal_uInt16 nSortPos = SC_SORTNAME_POS;
if( nSortMode == DataPilotFieldSortMode::DATA )
{
- nSortPos = lclFindListBoxEntry( maLbSortBy, maLabelData.maSortInfo.Field, SC_SORTDATA_POS );
+ nSortPos = FindListBoxEntry( maLbSortBy, maLabelData.maSortInfo.Field, SC_SORTDATA_POS );
if( nSortPos >= maLbSortBy.GetEntryCount() )
{
nSortPos = SC_SORTNAME_POS;
@@ -683,6 +726,31 @@ void ScDPSubtotalOptDlg::InitHideListBox()
maLbHide.Enable( bEnable );
}
+const OUString& ScDPSubtotalOptDlg::GetFieldName(const OUString& rLayoutName) const
+{
+ NameMapType::const_iterator itr = maDataFieldNameMap.find(rLayoutName);
+ return itr == maDataFieldNameMap.end() ? rLayoutName : itr->second;
+}
+
+sal_uInt16 ScDPSubtotalOptDlg::FindListBoxEntry(
+ const ListBox& rLBox, const String& rEntry, sal_uInt16 nStartPos ) const
+{
+ sal_uInt16 nPos = nStartPos;
+ bool bFound = false;
+ while (nPos < rLBox.GetEntryCount())
+ {
+ // translate the displayed field name back to its original field name.
+ const OUString& rName = GetFieldName(rLBox.GetEntry(nPos));
+ if (rName.equals(rEntry))
+ {
+ bFound = true;
+ break;
+ }
+ ++nPos;
+ }
+ return bFound ? nPos : LISTBOX_ENTRY_NOTFOUND;
+}
+
IMPL_LINK( ScDPSubtotalOptDlg, RadioClickHdl, RadioButton*, pBtn )
{
maLbSortBy.Enable( pBtn != &maRbSortMan );
@@ -788,3 +856,4 @@ IMPL_LINK( ScDPShowDetailDlg, DblClickHdl, ListBox*, pLBox )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pvfundlg.hrc b/sc/source/ui/dbgui/pvfundlg.hrc
index c9b6f562a9e1..fdff335fd247 100644
--- a/sc/source/ui/dbgui/pvfundlg.hrc
+++ b/sc/source/ui/dbgui/pvfundlg.hrc
@@ -27,9 +27,6 @@
#include "sc.hrc"
-// RID_SCDLG_DPDATAFIELD - DataPilot Data Field Function
-// RID_SCDLG_PIVOTSUBT - DataPilot Page/Row/Column Field Subtotals
-
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
@@ -80,4 +77,3 @@
#define NF_SHOW 1
#define CT_HIDE 1
-
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index b43779ffa62b..e805ecff55db 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+//----------------------------------------------------------------------------
+
#include "pvlaydlg.hxx"
+#include "dbdocfun.hxx"
+#include "dpuiglobal.hxx"
+
+#include <sfx2/dispatch.hxx>
+#include <vcl/msgbox.hxx>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
#include <com/sun/star/sheet/DataPilotFieldSortMode.hpp>
@@ -52,120 +60,158 @@
#include "dpshttab.hxx"
#include "scmod.hxx"
-#include "sc.hrc" //CHINA001
-#include "scabstdlg.hxx" //CHINA001
-
-// ============================================================================
+#include "sc.hrc"
+#include "scabstdlg.hxx"
-using namespace ::com::sun::star;
+using namespace com::sun::star;
using ::rtl::OUString;
+using ::std::vector;
+using ::std::for_each;
-// ============================================================================
+//----------------------------------------------------------------------------
-namespace {
+#define FSTR(index) aFuncNameArr[index-1]
+#define STD_FORMAT SCA_VALID | SCA_TAB_3D \
+ | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE
-const sal_uInt16 STD_FORMAT = sal_uInt16( SCA_VALID | SCA_TAB_3D | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE );
+//============================================================================
-OUString lclGetNameWithoutMnemonic( const FixedText& rFixedText )
+namespace {
+
+PointerStyle lclGetPointerForField( ScDPFieldType eType )
{
return MnemonicGenerator::EraseAllMnemonicChars( rFixedText.GetText() );
}
} // namespace
-// ============================================================================
-
-ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, const ScDPObject& rDPObject ) :
-
- ScAnyRefDlg( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
-
- maFlLayout( this, ScResId( FL_LAYOUT ) ),
- maScrPage( this, ScResId( SCROLL_PAGE ) ),
- maFtPage( this, ScResId( FT_PAGE ) ),
- maWndPage( this, ScResId( WND_PAGE ), maScrPage, &maFtPage, lclGetNameWithoutMnemonic( maFtPage ), PIVOTFIELDTYPE_PAGE, HID_SC_DPLAY_PAGE, POINTER_PIVOT_FIELD, 5, 2, 1, 0 ),
- maScrCol( this, ScResId( SCROLL_COL ) ),
- maFtCol( this, ScResId( FT_COL ) ),
- maWndCol( this, ScResId( WND_COL ), maScrCol, &maFtCol, lclGetNameWithoutMnemonic( maFtCol ), PIVOTFIELDTYPE_COL, HID_SC_DPLAY_COLUMN, POINTER_PIVOT_COL, 4, 2, 1, 0 ),
- maScrRow( this, ScResId( SCROLL_ROW ) ),
- maFtRow( this, ScResId( FT_ROW ) ),
- maWndRow( this, ScResId( WND_ROW ), maScrRow, &maFtRow, lclGetNameWithoutMnemonic( maFtRow ), PIVOTFIELDTYPE_ROW, HID_SC_DPLAY_ROW, POINTER_PIVOT_ROW, 1, 8, 1, 0 ),
- maScrData( this, ScResId( SCROLL_DATA ) ),
- maFtData( this, ScResId( FT_DATA ) ),
- maWndData( this, ScResId( WND_DATA ), maScrData, &maFtData, lclGetNameWithoutMnemonic( maFtData ), PIVOTFIELDTYPE_DATA, HID_SC_DPLAY_DATA, POINTER_PIVOT_FIELD, 1, 8, 4, 0 ),
- maFlSelect( this, ScResId( FL_SELECT ) ),
- maScrSelect( this, ScResId( WND_HSCROLL ) ),
- maWndSelect( this, ScResId( WND_SELECT ), maScrSelect, 0, String( ScResId( STR_SELECT ) ), PIVOTFIELDTYPE_SELECT, HID_SC_DPLAY_SELECT, POINTER_PIVOT_FIELD, 2, 10, 1, 2 ),
- maFtInfo( this, ScResId( FT_INFO ) ),
-
- maFlAreas( this, ScResId( FL_OUTPUT ) ),
- maFtInArea( this, ScResId( FT_INAREA) ),
- maEdInPos( this, ScResId( ED_INAREA) ),
- maRbInPos( this, ScResId( RB_INAREA ), &maEdInPos, this ),
- maLbOutPos( this, ScResId( LB_OUTAREA ) ),
- maFtOutArea( this, ScResId( FT_OUTAREA ) ),
- maEdOutPos( this, this, ScResId( ED_OUTAREA ) ),
- maRbOutPos( this, ScResId( RB_OUTAREA ), &maEdOutPos, this ),
- maBtnIgnEmptyRows( this, ScResId( BTN_IGNEMPTYROWS ) ),
- maBtnDetectCat( this, ScResId( BTN_DETECTCAT ) ),
- maBtnTotalCol( this, ScResId( BTN_TOTALCOL ) ),
- maBtnTotalRow( this, ScResId( BTN_TOTALROW ) ),
- maBtnFilter( this, ScResId( BTN_FILTER ) ),
- maBtnDrillDown( this, ScResId( BTN_DRILLDOWN ) ),
-
- maBtnOk( this, ScResId( BTN_OK ) ),
- maBtnCancel( this, ScResId( BTN_CANCEL ) ),
- maBtnHelp( this, ScResId( BTN_HELP ) ),
- maBtnRemove( this, ScResId( BTN_REMOVE ) ),
- maBtnOptions( this, ScResId( BTN_OPTIONS ) ),
- maBtnMore( this, ScResId( BTN_MORE ) ),
-
- mxDlgDPObject( new ScDPObject( rDPObject ) ),
- mpViewData( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData() ),
- mpDoc( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData()->GetDocument() ),
- mpFocusWindow( 0 ),
- mpTrackingWindow( 0 ),
- mpDropWindow( 0 ),
- mpActiveEdit( 0 ),
- mbRefInputMode( false )
-{
- DBG_ASSERT( mpViewData && mpDoc, "ScPivotLayoutDlg::ScPivotLayoutDlg - missing document or view data" );
-
- mxDlgDPObject->SetAlive( true ); // needed to get structure information
- mxDlgDPObject->FillOldParam( maPivotData );
- mxDlgDPObject->FillLabelData( maPivotData );
+//============================================================================
+
+//----------------------------------------------------------------------------
+
+ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
+ const ScDPObject& rDPObject, bool bNewOutput )
+ : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
+ aFlLayout ( this, ScResId( FL_LAYOUT ) ),
+ aFtPage ( this, ScResId( FT_PAGE ) ),
+ aWndPage ( this, ScResId( WND_PAGE ), &aFtPage ),
+ aFtCol ( this, ScResId( FT_COL ) ),
+ aWndCol ( this, ScResId( WND_COL ), &aFtCol ),
+ aFtRow ( this, ScResId( FT_ROW ) ),
+ aWndRow ( this, ScResId( WND_ROW ), &aFtRow ),
+ aFtData ( this, ScResId( FT_DATA ) ),
+ aWndData ( this, ScResId( WND_DATA ), &aFtData ),
+ aWndSelect ( this, ScResId( WND_SELECT ), NULL ),
+ aFtInfo ( this, ScResId( FT_INFO ) ),
+
+ aFlAreas ( this, ScResId( FL_OUTPUT ) ),
+
+ aFtInArea ( this, ScResId( FT_INAREA) ),
+ aEdInPos ( this, ScResId( ED_INAREA) ),
+ aRbInPos ( this, ScResId( RB_INAREA ), &aEdInPos, this ),
+
+ aLbOutPos ( this, ScResId( LB_OUTAREA ) ),
+ aFtOutArea ( this, ScResId( FT_OUTAREA ) ),
+ aEdOutPos ( this, this, ScResId( ED_OUTAREA ) ),
+ aRbOutPos ( this, ScResId( RB_OUTAREA ), &aEdOutPos, this ),
+ aBtnIgnEmptyRows( this, ScResId( BTN_IGNEMPTYROWS ) ),
+ aBtnDetectCat ( this, ScResId( BTN_DETECTCAT ) ),
+ aBtnTotalCol ( this, ScResId( BTN_TOTALCOL ) ),
+ aBtnTotalRow ( this, ScResId( BTN_TOTALROW ) ),
+ aBtnFilter ( this, ScResId( BTN_FILTER ) ),
+ aBtnDrillDown ( this, ScResId( BTN_DRILLDOWN ) ),
+
+ aBtnOk ( this, ScResId( BTN_OK ) ),
+ aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
+ aBtnHelp ( this, ScResId( BTN_HELP ) ),
+ aBtnRemove ( this, ScResId( BTN_REMOVE ) ),
+ aBtnOptions ( this, ScResId( BTN_OPTIONS ) ),
+ aBtnMore ( this, ScResId( BTN_MORE ) ),
+
+ aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
+ aStrNewTable ( ScResId( SCSTR_NEWTABLE ) ),
+
+ bIsDrag ( false ),
+
+ pEditActive ( NULL ),
+
+ eLastActiveType ( TYPE_SELECT ),
+ nOffset ( 0 ),
+ //
+ xDlgDPObject ( new ScDPObject( rDPObject ) ),
+ pViewData ( ((ScTabViewShell*)SfxViewShell::Current())->
+ GetViewData() ),
+ pDoc ( ((ScTabViewShell*)SfxViewShell::Current())->
+ GetViewData()->GetDocument() ),
+ bRefInputMode (false)
+{
+ xDlgDPObject->SetAlive( true ); // needed to get structure information
+ xDlgDPObject->FillOldParam( thePivotData, false );
+ xDlgDPObject->FillLabelData( thePivotData );
+
+ Init(bNewOutput);
+ FreeResource();
+}
- maBtnRemove.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
- maBtnOptions.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
-
- // PIVOT_MAXFUNC defined in sc/inc/dpglobal.hxx
- maFuncNames.reserve( PIVOT_MAXFUNC );
- for( sal_uInt16 i = 1; i <= PIVOT_MAXFUNC; ++i )
- maFuncNames.push_back( String( ScResId( i ) ) );
-
- maBtnMore.AddWindow( &maFlAreas );
- maBtnMore.AddWindow( &maFtInArea );
- maBtnMore.AddWindow( &maEdInPos );
- maBtnMore.AddWindow( &maRbInPos );
- maBtnMore.AddWindow( &maFtOutArea );
- maBtnMore.AddWindow( &maLbOutPos );
- maBtnMore.AddWindow( &maEdOutPos );
- maBtnMore.AddWindow( &maRbOutPos );
- maBtnMore.AddWindow( &maBtnIgnEmptyRows );
- maBtnMore.AddWindow( &maBtnDetectCat );
- maBtnMore.AddWindow( &maBtnTotalCol );
- maBtnMore.AddWindow( &maBtnTotalRow );
- maBtnMore.AddWindow( &maBtnFilter );
- maBtnMore.AddWindow( &maBtnDrillDown );
- maBtnMore.SetClickHdl( LINK( this, ScPivotLayoutDlg, MoreClickHdl ) );
-
- if( mxDlgDPObject->GetSheetDesc() )
- {
- maEdInPos.Enable();
- maRbInPos.Enable();
- ScRange aRange = mxDlgDPObject->GetSheetDesc()->aSourceRange;
- String aString;
- aRange.Format( aString, SCR_ABS_3D, mpDoc, mpDoc->GetAddressConvention() );
- maEdInPos.SetText( aString );
+//----------------------------------------------------------------------------
+
+ScDPLayoutDlg::~ScDPLayoutDlg()
+{
+ sal_uInt16 nEntries = aLbOutPos.GetEntryCount();
+ sal_uInt16 i;
+
+ for ( i=2; i<nEntries; i++ )
+ delete (String*)aLbOutPos.GetEntryData( i );
+}
+
+//----------------------------------------------------------------------------
+
+void ScDPLayoutDlg::Init(bool bNewOutput)
+{
+ DBG_ASSERT( pViewData && pDoc,
+ "Ctor-Initialisierung fehlgeschlagen!" );
+
+ aBtnRemove.SetClickHdl( LINK( this, ScDPLayoutDlg, ClickHdl ) );
+ aBtnOptions.SetClickHdl( LINK( this, ScDPLayoutDlg, ClickHdl ) );
+
+ aFuncNameArr.reserve( PIVOT_MAXFUNC );
+ for ( sal_uInt16 i = 0; i < PIVOT_MAXFUNC; ++i )
+ aFuncNameArr.push_back( String( ScResId( i + 1 ) ) );
+
+ aBtnMore.AddWindow( &aFlAreas );
+ aBtnMore.AddWindow( &aFtInArea );
+ aBtnMore.AddWindow( &aEdInPos );
+ aBtnMore.AddWindow( &aRbInPos );
+ aBtnMore.AddWindow( &aFtOutArea );
+ aBtnMore.AddWindow( &aLbOutPos );
+ aBtnMore.AddWindow( &aEdOutPos );
+ aBtnMore.AddWindow( &aRbOutPos );
+ aBtnMore.AddWindow( &aBtnIgnEmptyRows );
+ aBtnMore.AddWindow( &aBtnDetectCat );
+ aBtnMore.AddWindow( &aBtnTotalCol );
+ aBtnMore.AddWindow( &aBtnTotalRow );
+ aBtnMore.AddWindow( &aBtnFilter );
+ aBtnMore.AddWindow( &aBtnDrillDown );
+ aBtnMore.SetClickHdl( LINK( this, ScDPLayoutDlg, MoreClickHdl ) );
+
+ CalcWndSizes();
+
+ ScRange inRange;
+ String inString;
+ if (xDlgDPObject->GetSheetDesc())
+ {
+ aEdInPos.Enable();
+ aRbInPos.Enable();
+ const ScSheetSourceDesc* p = xDlgDPObject->GetSheetDesc();
+ OUString aRangeName = p->GetRangeName();
+ if (aRangeName.getLength())
+ aEdInPos.SetText(aRangeName);
+ else
+ {
+ aOldRange = p->GetSourceRange();
+ aOldRange.Format( inString, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ aEdInPos.SetText(inString);
+ }
}
else
{
@@ -181,11 +227,16 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
InitFieldWindows();
- maLbOutPos.SetSelectHdl( LINK( this, ScPivotLayoutDlg, SelAreaHdl ) );
- maEdOutPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdOutModifyHdl ) );
- maEdInPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdInModifyHdl ) );
- maBtnOk.SetClickHdl( LINK( this, ScPivotLayoutDlg, OkHdl ) );
- maBtnCancel.SetClickHdl( LINK( this, ScPivotLayoutDlg, CancelHdl ) );
+ aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) );
+ aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) );
+ aEdInPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdInModifyHdl ) );
+ aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) );
+ aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) );
+ Link aLink = LINK( this, ScDPLayoutDlg, GetFocusHdl );
+ if ( aEdInPos.IsEnabled() )
+ // Once disabled it will never get enabled, so no need to handle focus.
+ aEdInPos.SetGetFocusHdl( aLink );
+ aEdOutPos.SetGetFocusHdl( aLink );
if( mpViewData && mpDoc )
{
@@ -215,97 +266,152 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
}
}
- if ( maPivotData.nTab != MAXTAB+1 )
+ if (bNewOutput)
+ {
+ // Output to a new sheet by default for a brand-new output.
+ aLbOutPos.SelectEntryPos(1);
+ aEdOutPos.Disable();
+ aRbOutPos.Disable();
+ }
+ else
+ {
+ // Modifying an existing dp output.
+
+ if ( thePivotData.nTab != MAXTAB+1 )
+ {
+ String aStr;
+ ScAddress( thePivotData.nCol,
+ thePivotData.nRow,
+ thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() );
+ aEdOutPos.SetText( aStr );
+ EdModifyHdl(0);
+ }
+ else
+ {
+ aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 );
+ SelAreaHdl(NULL);
+ }
+ }
+
+ aBtnIgnEmptyRows.Check( thePivotData.bIgnoreEmptyRows );
+ aBtnDetectCat .Check( thePivotData.bDetectCategories );
+ aBtnTotalCol .Check( thePivotData.bMakeTotalCol );
+ aBtnTotalRow .Check( thePivotData.bMakeTotalRow );
+
+ if( const ScDPSaveData* pSaveData = xDlgDPObject->GetSaveData() )
{
- String aStr;
- ScAddress( maPivotData.nCol,
- maPivotData.nRow,
- maPivotData.nTab ).Format( aStr, STD_FORMAT, mpDoc, mpDoc->GetAddressConvention() );
- maEdOutPos.SetText( aStr );
- EdOutModifyHdl( 0 );
+ aBtnFilter.Check( pSaveData->GetFilterButton() );
+ aBtnDrillDown.Check( pSaveData->GetDrillDown() );
}
else
{
- maLbOutPos.SelectEntryPos( maLbOutPos.GetEntryCount()-1 );
- SelAreaHdl(NULL);
+ aBtnFilter.Check();
+ aBtnDrillDown.Check();
}
- maBtnIgnEmptyRows.Check( maPivotData.bIgnoreEmptyRows );
- maBtnDetectCat.Check( maPivotData.bDetectCategories );
- maBtnTotalCol.Check( maPivotData.bMakeTotalCol );
- maBtnTotalRow.Check( maPivotData.bMakeTotalRow );
+ aWndPage.SetHelpId( HID_SC_DPLAY_PAGE );
+ aWndCol.SetHelpId( HID_SC_DPLAY_COLUMN );
+ aWndRow.SetHelpId( HID_SC_DPLAY_ROW );
+ aWndData.SetHelpId( HID_SC_DPLAY_DATA );
+ aWndSelect.SetHelpId( HID_SC_DPLAY_SELECT );
- const ScDPSaveData* pSaveData = mxDlgDPObject->GetSaveData();
- maBtnFilter.Check( !pSaveData || pSaveData->GetFilterButton() );
- maBtnDrillDown.Check( !pSaveData || pSaveData->GetDrillDown() );
+ InitFocus();
+}
- // child event listener handles field movement when keyboard shortcut is pressed
- AddChildEventListener( LINK( this, ScPivotLayoutDlg, ChildEventListener ) );
- GrabFieldFocus( maWndSelect );
+//----------------------------------------------------------------------------
- FreeResource();
+sal_Bool ScDPLayoutDlg::Close()
+{
+ return DoClose( ScPivotLayoutWrapper::GetChildWindowId() );
}
ScPivotLayoutDlg::~ScPivotLayoutDlg()
{
- RemoveChildEventListener( LINK( this, ScPivotLayoutDlg, ChildEventListener ) );
+ ScAnyRefDlg::StateChanged( nStateChange );
- for( sal_uInt16 i = 2, nEntries = maLbOutPos.GetEntryCount(); i < nEntries; ++i )
- delete (String*)maLbOutPos.GetEntryData( i );
+ if ( nStateChange == STATE_CHANGE_INITSHOW )
+ {
+ // Hiding the FixedTexts and clearing the tab stop style bits
+ // has to be done after assigning the mnemonics, but Paint is too late,
+ // because the test tool may send key events to the dialog when it isn't visible.
+ // Mnemonics are assigned in the Dialog::StateChanged for STATE_CHANGE_INITSHOW,
+ // so this can be done immediately afterwards.
+
+ aWndPage.UseMnemonic();
+ aWndCol.UseMnemonic();
+ aWndRow.UseMnemonic();
+ aWndData.UseMnemonic();
+ }
}
ScDPLabelData* ScPivotLayoutDlg::GetLabelData( SCCOL nCol, size_t* pnIndex )
{
- ScDPLabelData* pLabelData = 0;
- for( ScDPLabelDataVector::iterator aIt = maLabelData.begin(), aEnd = maLabelData.end(); !pLabelData && (aIt != aEnd); ++aIt )
+ size_t nLabelCount = rLabels.size();
+ if (nLabelCount > MAX_LABELS)
+ nLabelCount = MAX_LABELS;
+
+ aLabelDataArr.clear();
+ aLabelDataArr.reserve( nLabelCount );
+ for ( size_t i=0; i < nLabelCount; i++ )
{
- if( aIt->mnCol == nCol )
- {
- pLabelData = &*aIt;
- if( pnIndex )
- *pnIndex = aIt - maLabelData.begin();
- }
+ aLabelDataArr.push_back(*rLabels[i]);
+ aWndSelect.AddField(aLabelDataArr[i].getDisplayName(), i);
+ ScDPFuncDataRef p(new ScDPFuncData(aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask));
+ aSelectArr.push_back(p);
}
- return pLabelData;
+ aWndSelect.ResetScrollBar();
+ aWndSelect.Paint(Rectangle());
}
-String ScPivotLayoutDlg::GetFuncString( sal_uInt16& rnFuncMask, bool bIsValue )
+//----------------------------------------------------------------------------
+
+void ScDPLayoutDlg::InitFieldWindow( const vector<PivotField>& rFields, ScDPFieldType eType )
{
- String aStr;
+ ScDPFuncDataVec* pInitArr = GetFieldDataArray(eType);
+ ScDPFieldControlBase* pInitWnd = GetFieldWindow(eType);
+
+ if (!pInitArr || !pInitWnd)
+ return;
- if( (rnFuncMask == PIVOT_FUNC_NONE) || (rnFuncMask == PIVOT_FUNC_AUTO) )
+ vector<PivotField>::const_iterator itr = rFields.begin(), itrEnd = rFields.end();
+ for (; itr != itrEnd; ++itr)
{
- if( bIsValue )
+ SCCOL nCol = itr->nCol;
+ sal_uInt16 nMask = itr->nFuncMask;
+ if (nCol == PIVOT_DATA_FIELD)
+ continue;
+
+ size_t nFieldIndex = pInitArr->size();
+ ScDPFuncDataRef p(new ScDPFuncData(nCol, nMask, itr->maFieldRef));
+ pInitArr->push_back(p);
+
+ if (eType == TYPE_DATA)
{
- aStr = GetFuncName( PIVOTSTR_SUM );
- rnFuncMask = PIVOT_FUNC_SUM;
+ // data field - we need to concatenate function name with the field name.
+ ScDPLabelData* pData = GetLabelData(nCol);
+ DBG_ASSERT( pData, "ScDPLabelData not found" );
+ if (pData)
+ {
+ OUString aStr = pData->maLayoutName;
+ if (!aStr.getLength())
+ {
+ sal_uInt16 nInitMask = pInitArr->back()->mnFuncMask;
+ aStr = GetFuncString(nInitMask, pData->mbIsValue);
+ aStr += pData->maName;
+ }
+
+ pInitWnd->AddField(aStr, nFieldIndex);
+ pData->mnFuncMask = nMask;
+ }
}
else
- {
- aStr = GetFuncName( PIVOTSTR_COUNT );
- rnFuncMask = PIVOT_FUNC_COUNT;
- }
- }
- else if( rnFuncMask == PIVOT_FUNC_SUM ) aStr = GetFuncName( PIVOTSTR_SUM );
- else if( rnFuncMask == PIVOT_FUNC_COUNT ) aStr = GetFuncName( PIVOTSTR_COUNT );
- else if( rnFuncMask == PIVOT_FUNC_AVERAGE ) aStr = GetFuncName( PIVOTSTR_AVG );
- else if( rnFuncMask == PIVOT_FUNC_MAX ) aStr = GetFuncName( PIVOTSTR_MAX );
- else if( rnFuncMask == PIVOT_FUNC_MIN ) aStr = GetFuncName( PIVOTSTR_MIN );
- else if( rnFuncMask == PIVOT_FUNC_PRODUCT ) aStr = GetFuncName( PIVOTSTR_PROD );
- else if( rnFuncMask == PIVOT_FUNC_COUNT_NUM ) aStr = GetFuncName( PIVOTSTR_COUNT2 );
- else if( rnFuncMask == PIVOT_FUNC_STD_DEV ) aStr = GetFuncName( PIVOTSTR_DEV );
- else if( rnFuncMask == PIVOT_FUNC_STD_DEVP ) aStr = GetFuncName( PIVOTSTR_DEV2 );
- else if( rnFuncMask == PIVOT_FUNC_STD_VAR ) aStr = GetFuncName( PIVOTSTR_VAR );
- else if( rnFuncMask == PIVOT_FUNC_STD_VARP ) aStr = GetFuncName( PIVOTSTR_VAR2 );
- else
- {
- aStr = ScGlobal::GetRscString( STR_TABLE_ERGEBNIS );
- aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ) );
+ pInitWnd->AddField(GetLabelString(nCol), nFieldIndex);
}
-
- return aStr;
+ pInitWnd->ResetScrollBar();
}
+//----------------------------------------------------------------------------
+
void ScPivotLayoutDlg::NotifyStartTracking( ScPivotFieldWindow& rSourceWindow )
{
mpTrackingWindow = &rSourceWindow;
@@ -317,38 +423,36 @@ void ScPivotLayoutDlg::NotifyStartTracking( ScPivotFieldWindow& rSourceWindow )
void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldWindow& rSourceWindow )
{
- // nothing to do on double-click in selection window
- if( rSourceWindow.GetType() == PIVOTFIELDTYPE_SELECT )
- return;
-
- const ScPivotFuncData* pFuncData = rSourceWindow.GetSelectedFuncData();
- DBG_ASSERT( pFuncData, "ScPivotLayoutDlg::NotifyDoubleClick - invalid selection" );
- if( !pFuncData )
- return;
+ InitWndSelect(thePivotData.maLabelArray);
+ InitFieldWindow(thePivotData.maPageFields, TYPE_PAGE);
+ InitFieldWindow(thePivotData.maColFields, TYPE_COL);
+ InitFieldWindow(thePivotData.maRowFields, TYPE_ROW);
+ InitFieldWindow(thePivotData.maDataFields, TYPE_DATA);
+}
ScDPLabelData* pLabelData = GetLabelData( pFuncData->mnCol );
DBG_ASSERT( pLabelData, "ScPivotLayoutDlg::NotifyDoubleClick - missing label data" );
if( !pLabelData )
return;
- ScAbstractDialogFactory* pFactory = ScAbstractDialogFactory::Create();
- DBG_ASSERT( pFactory, "ScPivotLayoutDlg::NotifyDoubleClick - ScAbstractDialogFactory creation failed" );
- if( !pFactory )
- return;
-
- if( rSourceWindow.GetType() == PIVOTFIELDTYPE_DATA )
- {
- ::std::auto_ptr< AbstractScDPFunctionDlg > xDlg( pFactory->CreateScDPFunctionDlg(
- this, RID_SCDLG_DPDATAFIELD, maLabelData, *pLabelData, *pFuncData ) );
- if( xDlg->Execute() == RET_OK )
- {
- ScPivotFuncData aFuncData( *pFuncData );
- aFuncData.mnFuncMask = pLabelData->mnFuncMask = xDlg->GetFuncMask();
- aFuncData.maFieldRef = xDlg->GetFieldRef();
- rSourceWindow.ModifySelectedField( aFuncData );
- }
- }
- else
+void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos )
+{
+ ScDPFuncData fData( *(aSelectArr[nFromIndex]) );
+ size_t nAt = 0;
+ ScDPFieldControlBase* toWnd = GetFieldWindow(eToType);
+ ScDPFieldControlBase* rmWnd1 = NULL;
+ ScDPFieldControlBase* rmWnd2 = NULL;
+ GetOtherFieldWindows(eToType, rmWnd1, rmWnd2);
+
+ ScDPFuncDataVec* toArr = GetFieldDataArray(eToType);
+ ScDPFuncDataVec* rmArr1 = NULL;
+ ScDPFuncDataVec* rmArr2 = NULL;
+ GetOtherDataArrays(eToType, rmArr1, rmArr2);
+
+ bool bDataArr = eToType == TYPE_DATA;
+
+ bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType );
+ if ( bAllowed && (!Contains( toArr, fData.mnCol, nAt )) )
{
// list of plain names of all data fields
ScDPNameVec aDataFieldNames;
@@ -360,53 +464,185 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldWindow& rSourceWindow )
this, RID_SCDLG_PIVOTSUBT, *mxDlgDPObject, *pLabelData, *pFuncData, aDataFieldNames, bLayout ) );
if( xDlg->Execute() == RET_OK )
{
- xDlg->FillLabelData( *pLabelData );
- ScPivotFuncData aFuncData( *pFuncData );
- aFuncData.mnFuncMask = pLabelData->mnFuncMask;
- rSourceWindow.ModifySelectedField( aFuncData );
+ ScDPLabelData* p = GetLabelData(fData.mnCol);
+ OUString aStr = p->maLayoutName;
+ sal_uInt16 nMask = fData.mnFuncMask;
+ if (!aStr.getLength())
+ {
+ aStr = GetFuncString(nMask);
+ aStr += p->maName;
+ }
+
+ if ( toWnd->AddField( aStr,
+ DlgPos2WndPos( rAtPos, *toWnd ),
+ nAddedAt ) )
+ {
+ fData.mnFuncMask = nMask;
+ Insert( toArr, fData, nAddedAt );
+ toWnd->GrabFocus();
+ }
}
}
}
-void ScPivotLayoutDlg::NotifyFieldRemoved( ScPivotFieldWindow& rSourceWindow )
+void ScDPLayoutDlg::AppendField(size_t nFromIndex, ScDPFieldType eToType)
{
- // update focus: move to selection window, if source window is empty now
- GrabFieldFocus( rSourceWindow );
+ ScDPFuncData aFuncData = *aSelectArr[nFromIndex];
+
+ size_t nAt = 0;
+ ScDPFieldControlBase* toWnd = GetFieldWindow(eToType);
+ ScDPFieldControlBase* rmWnd1 = NULL;
+ ScDPFieldControlBase* rmWnd2 = NULL;
+ GetOtherFieldWindows(eToType, rmWnd1, rmWnd2);
+
+ ScDPFuncDataVec* toArr = GetFieldDataArray(eToType);
+ ScDPFuncDataVec* rmArr1 = NULL;
+ ScDPFuncDataVec* rmArr2 = NULL;
+ GetOtherDataArrays(eToType, rmArr1, rmArr2);
+
+ bool bDataArr = eToType == TYPE_DATA;
+
+ if ( (!Contains( toArr, aFuncData.mnCol, nAt )) )
+ {
+ // ggF. in anderem Fenster entfernen
+ if ( rmArr1 )
+ {
+ if ( Contains( rmArr1, aFuncData.mnCol, nAt ) )
+ {
+ rmWnd1->DelField( nAt );
+ Remove( rmArr1, nAt );
+ }
+ }
+ if ( rmArr2 )
+ {
+ if ( Contains( rmArr2, aFuncData.mnCol, nAt ) )
+ {
+ rmWnd2->DelField( nAt );
+ Remove( rmArr2, nAt );
+ }
+ }
+
+ ScDPLabelData& rData = aLabelDataArr[nFromIndex+nOffset];
+ size_t nAddedAt = 0;
+
+ if ( !bDataArr )
+ {
+ if ( toWnd->AppendField(rData.getDisplayName(), nAddedAt) )
+ {
+ Insert( toArr, aFuncData, nAddedAt );
+ toWnd->GrabFocus();
+ }
+ }
+ else
+ {
+ ScDPLabelData* p = GetLabelData(aFuncData.mnCol);
+ OUString aStr = p->maLayoutName;
+ sal_uInt16 nMask = aFuncData.mnFuncMask;
+ if (!aStr.getLength())
+ {
+ aStr = GetFuncString(nMask);
+ aStr += p->maName;
+ }
+
+ if ( toWnd->AppendField(aStr, nAddedAt) )
+ {
+ aFuncData.mnFuncMask = nMask;
+ Insert( toArr, aFuncData, nAddedAt );
+ toWnd->GrabFocus();
+ }
+ }
+ }
}
-// protected ------------------------------------------------------------------
+//----------------------------------------------------------------------------
-void ScPivotLayoutDlg::Tracking( const TrackingEvent& rTEvt )
+void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos )
{
- DBG_ASSERT( mpTrackingWindow, "ScPivotLayoutDlg::Tracking - missing tracking source window" );
- if( !mpTrackingWindow )
- return;
+ if ( eFromType == TYPE_SELECT )
+ AddField( nFromIndex, eToType, rAtPos );
+ else if ( eFromType != eToType )
+ {
+ ScDPFieldControlBase* fromWnd = GetFieldWindow(eFromType);
+ ScDPFieldControlBase* toWnd = GetFieldWindow(eToType);
- // find target window
- const Point& rDialogPos = rTEvt.GetMouseEvent().GetPosPixel();
- ScPivotFieldWindow* pTargetWindow = dynamic_cast< ScPivotFieldWindow* >( FindWindow( rDialogPos ) );
+ ScDPFieldControlBase* rmWnd1 = NULL;
+ ScDPFieldControlBase* rmWnd2 = NULL;
+ GetOtherFieldWindows(eToType, rmWnd1, rmWnd2);
- // check if the target orientation is allowed for this field
- if( pTargetWindow && (mpTrackingWindow != pTargetWindow) && !IsInsertAllowed( *mpTrackingWindow, *pTargetWindow ) )
- pTargetWindow = 0;
+ ScDPFuncDataVec* fromArr = GetFieldDataArray(eFromType);
+ ScDPFuncDataVec* toArr = GetFieldDataArray(eToType);
- // tracking from selection window: do not show "delete" mouse pointer
- PointerStyle eTargetPointer = pTargetWindow ? pTargetWindow->GetDropPointerStyle() :
- ((mpTrackingWindow->GetType() == PIVOTFIELDTYPE_SELECT) ? POINTER_NOTALLOWED : POINTER_PIVOT_DELETE);
+ ScDPFuncDataVec* rmArr1 = NULL;
+ ScDPFuncDataVec* rmArr2 = NULL;
+ GetOtherDataArrays(eToType, rmArr1, rmArr2);
- // after calculating pointer style, check if target is selection window
- if( pTargetWindow && (pTargetWindow->GetType() == PIVOTFIELDTYPE_SELECT) )
- pTargetWindow = 0;
+ bool bDataArr = eToType == TYPE_DATA;
- // notify windows about tracking
- if( mpDropWindow != pTargetWindow )
- {
- // tracking window changed
- if( mpDropWindow )
- mpDropWindow->NotifyEndTracking( ENDTRACKING_SUSPEND );
- if( pTargetWindow )
- pTargetWindow->NotifyStartTracking();
- mpDropWindow = pTargetWindow;
+ if ( fromArr && toArr && fromWnd && toWnd )
+ {
+ ScDPFuncData fData( *((*fromArr)[nFromIndex]) );
+ bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType );
+
+ size_t nAt = 0;
+ if ( bAllowed && Contains( fromArr, fData.mnCol, nAt ) )
+ {
+ fromWnd->DelField( nAt );
+ Remove( fromArr, nAt );
+
+ if (!Contains( toArr, fData.mnCol, nAt ))
+ {
+ size_t nAddedAt = 0;
+ if ( !bDataArr )
+ {
+ // ggF. in anderem Fenster entfernen
+ if ( rmArr1 )
+ {
+ if ( Contains( rmArr1, fData.mnCol, nAt ) )
+ {
+ rmWnd1->DelField( nAt );
+ Remove( rmArr1, nAt );
+ }
+ }
+ if ( rmArr2 )
+ {
+ if ( Contains( rmArr2, fData.mnCol, nAt ) )
+ {
+ rmWnd2->DelField( nAt );
+ Remove( rmArr2, nAt );
+ }
+ }
+
+ if ( toWnd->AddField( GetLabelString( fData.mnCol ),
+ DlgPos2WndPos( rAtPos, *toWnd ),
+ nAddedAt ) )
+ {
+ Insert( toArr, fData, nAddedAt );
+ toWnd->GrabFocus();
+ }
+ }
+ else
+ {
+ ScDPLabelData* p = GetLabelData(fData.mnCol);
+ OUString aStr = p->maLayoutName;
+ sal_uInt16 nMask = fData.mnFuncMask;
+ if (!aStr.getLength())
+ {
+ aStr = GetFuncString(nMask);
+ aStr += p->maName;
+ }
+
+ if ( toWnd->AddField( aStr,
+ DlgPos2WndPos( rAtPos, *toWnd ),
+ nAddedAt ) )
+ {
+ fData.mnFuncMask = nMask;
+ Insert( toArr, fData, nAddedAt );
+ toWnd->GrabFocus();
+ }
+ }
+ }
+ }
+ }
}
if( mpDropWindow )
mpDropWindow->NotifyTracking( rDialogPos - pTargetWindow->GetPosPixel() );
@@ -414,25 +650,190 @@ void ScPivotLayoutDlg::Tracking( const TrackingEvent& rTEvt )
// end tracking: move or remove field
if( rTEvt.IsTrackingEnded() )
{
- bool bCancelled = rTEvt.IsTrackingCanceled();
- if( mpDropWindow )
+ ScDPFieldControlBase* theWnd = GetFieldWindow(eFromType);
+ ScDPFuncDataVec* theArr = GetFieldDataArray(eFromType);
+ size_t nAt = 0;
+ Point aToPos;
+ sal_Bool bDataArr = eFromType == TYPE_DATA;
+
+ ScDPFuncData fData( *((*theArr)[nFromIndex]) );
+
+ if ( Contains( theArr, fData.mnCol, nAt ) )
{
- mpDropWindow->NotifyEndTracking( bCancelled ? ENDTRACKING_CANCEL : ENDTRACKING_DROP );
- if( !bCancelled )
+ size_t nToIndex = 0;
+ aToPos = DlgPos2WndPos( rAtPos, *theWnd );
+ theWnd->GetExistingIndex( aToPos, nToIndex );
+
+ if ( nToIndex != nAt )
{
- size_t nInsertIndex = mpDropWindow->GetDropIndex( rDialogPos - mpDropWindow->GetPosPixel() );
- bool bMoved = MoveField( *mpTrackingWindow, *mpDropWindow, nInsertIndex, true );
- // focus drop window, if move was successful, otherwise back to source window
- GrabFieldFocus( bMoved ? *mpDropWindow : *mpTrackingWindow );
+ size_t nAddedAt = 0;
+
+ theWnd->DelField( nAt );
+ Remove( theArr, nAt );
+
+ if ( !bDataArr )
+ {
+ if ( theWnd->AddField( GetLabelString( fData.mnCol ),
+ aToPos,
+ nAddedAt ) )
+ {
+ Insert( theArr, fData, nAddedAt );
+ }
+ }
+ else
+ {
+ ScDPLabelData* p = GetLabelData(fData.mnCol);
+ OUString aStr = p->maLayoutName;
+ sal_uInt16 nMask = fData.mnFuncMask;
+ if (!aStr.getLength())
+ {
+ aStr = GetFuncString(nMask);
+ aStr += p->maName;
+ }
+
+ if ( theWnd->AddField( aStr,
+ DlgPos2WndPos( rAtPos, *theWnd ),
+ nAddedAt ) )
+ {
+ fData.mnFuncMask = nMask;
+ Insert( theArr, fData, nAddedAt );
+ }
+ }
}
}
- else
+ }
+}
+
+void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType )
+{
+ if ( eFromType == TYPE_SELECT )
+ AppendField( nFromIndex, eToType );
+ else if ( eFromType != eToType )
+ {
+ ScDPFieldControlBase* fromWnd = GetFieldWindow(eFromType);
+ ScDPFieldControlBase* toWnd = GetFieldWindow(eToType);
+
+ ScDPFieldControlBase* rmWnd1 = NULL;
+ ScDPFieldControlBase* rmWnd2 = NULL;
+ GetOtherFieldWindows(eToType, rmWnd1, rmWnd2);
+
+ ScDPFuncDataVec* fromArr = GetFieldDataArray(eFromType);
+ ScDPFuncDataVec* toArr = GetFieldDataArray(eToType);
+
+ ScDPFuncDataVec* rmArr1 = NULL;
+ ScDPFuncDataVec* rmArr2 = NULL;
+ GetOtherDataArrays(eToType, rmArr1, rmArr2);
+
+ bool bDataArr = eToType == TYPE_DATA;
+
+ if ( fromArr && toArr && fromWnd && toWnd )
{
- // drop target invalid (outside field windows): remove tracked field
- if( !bCancelled )
- mpTrackingWindow->RemoveSelectedField();
- // focus source window (or another window, if it is empty now)
- GrabFieldFocus( *mpTrackingWindow );
+ ScDPFuncData fData( *((*fromArr)[nFromIndex]) );
+
+ size_t nAt = 0;
+ if ( Contains( fromArr, fData.mnCol, nAt ) )
+ {
+ fromWnd->DelField( nAt );
+ Remove( fromArr, nAt );
+
+ if (!Contains( toArr, fData.mnCol, nAt ))
+ {
+ size_t nAddedAt = 0;
+ if ( !bDataArr )
+ {
+ // ggF. in anderem Fenster entfernen
+ if ( rmArr1 )
+ {
+ if ( Contains( rmArr1, fData.mnCol, nAt ) )
+ {
+ rmWnd1->DelField( nAt );
+ Remove( rmArr1, nAt );
+ }
+ }
+ if ( rmArr2 )
+ {
+ if ( Contains( rmArr2, fData.mnCol, nAt ) )
+ {
+ rmWnd2->DelField( nAt );
+ Remove( rmArr2, nAt );
+ }
+ }
+
+ if ( toWnd->AppendField( GetLabelString( fData.mnCol ), nAddedAt ) )
+ {
+ Insert( toArr, fData, nAddedAt );
+ toWnd->GrabFocus();
+ }
+ }
+ else
+ {
+ ScDPLabelData* p = GetLabelData(fData.mnCol);
+ OUString aStr = p->maLayoutName;
+ sal_uInt16 nMask = fData.mnFuncMask;
+ if (!aStr.getLength())
+ {
+ aStr = GetFuncString(nMask);
+ aStr += p->maName;
+ }
+
+ if ( toWnd->AppendField(aStr, nAddedAt) )
+ {
+ fData.mnFuncMask = nMask;
+ Insert( toArr, fData, nAddedAt );
+ toWnd->GrabFocus();
+ }
+ }
+ }
+ }
+ }
+ }
+ else // -> eFromType == eToType
+ {
+ ScDPFieldControlBase* theWnd = GetFieldWindow(eFromType);
+ ScDPFuncDataVec* theArr = GetFieldDataArray(eFromType);
+ size_t nAt = 0;
+ Point aToPos;
+ sal_Bool bDataArr = eFromType == TYPE_DATA;
+
+ ScDPFuncData fData( *((*theArr)[nFromIndex]) );
+
+ if ( Contains( theArr, fData.mnCol, nAt ) )
+ {
+ size_t nToIndex = 0;
+ theWnd->GetExistingIndex( aToPos, nToIndex );
+
+ if ( nToIndex != nAt )
+ {
+ size_t nAddedAt = 0;
+
+ theWnd->DelField( nAt );
+ Remove( theArr, nAt );
+
+ if ( !bDataArr )
+ {
+ if ( theWnd->AppendField(GetLabelString( fData.mnCol ), nAddedAt) )
+ {
+ Insert( theArr, fData, nAddedAt );
+ }
+ }
+ else
+ {
+ ScDPLabelData* p = GetLabelData(fData.mnCol);
+ OUString aStr = p->maLayoutName;
+ sal_uInt16 nMask = fData.mnFuncMask;
+ if (!aStr.getLength())
+ {
+ aStr = GetFuncString(nMask);
+ aStr += p->maName;
+ }
+
+ if ( theWnd->AppendField(aStr, nAddedAt) )
+ {
+ fData.mnFuncMask = nMask;
+ Insert( theArr, fData, nAddedAt );
+ }
+ }
+ }
}
eTargetPointer = POINTER_ARROW;
if( mpTrackingWindow != mpDropWindow )
@@ -444,32 +845,67 @@ void ScPivotLayoutDlg::Tracking( const TrackingEvent& rTEvt )
void ScPivotLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
- if( !mbRefInputMode || !mpActiveEdit )
- return;
+ ScDPFuncDataVec* pArr = GetFieldDataArray(eFromType);
- if( rRef.aStart != rRef.aEnd )
- RefInputStart( mpActiveEdit );
-
- if( mpActiveEdit == &maEdInPos )
- {
- String aRefStr;
- rRef.Format( aRefStr, SCR_ABS_3D, pDocP, pDocP->GetAddressConvention() );
- mpActiveEdit->SetRefString( aRefStr );
- }
- else if( mpActiveEdit == &maEdOutPos )
+ if( pArr )
{
- String aRefStr;
- rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() );
- mpActiveEdit->SetRefString( aRefStr );
+ ScDPFieldControlBase* pWnd = GetFieldWindow( eFromType );
+ if (pWnd)
+ {
+ pWnd->DelField( nIndex );
+ Remove( pArr, nIndex );
+ if( pWnd->IsEmpty() ) InitFocus();
+ }
}
}
sal_Bool ScPivotLayoutDlg::IsRefInputMode() const
{
- return mbRefInputMode;
+ if ( bIsDrag )
+ {
+ bIsDrag = false;
+
+ ScDPFieldType eDnDToType = TYPE_SELECT;
+ Point aPos = ScreenToOutputPixel( rAt );
+ bool bDel = false;
+
+ if ( aRectPage.IsInside( aPos ) )
+ {
+ eDnDToType = TYPE_PAGE;
+ }
+ else if ( aRectCol.IsInside( aPos ) )
+ {
+ eDnDToType = TYPE_COL;
+ }
+ else if ( aRectRow.IsInside( aPos ) )
+ {
+ eDnDToType = TYPE_ROW;
+ }
+ else if ( aRectData.IsInside( aPos ) )
+ {
+ eDnDToType = TYPE_DATA;
+ }
+ else if ( aRectSelect.IsInside( aPos ) )
+ {
+ eDnDToType = TYPE_SELECT;
+ }
+ else
+ bDel = true;
+
+ if (bDel)
+ {
+ // We don't remove any buttons from the select field.
+ if (eDnDFromType != TYPE_SELECT)
+ RemoveField( eDnDFromType, nDnDFromIndex );
+ }
+ else
+ MoveField( eDnDFromType, nDnDFromIndex, eDnDToType, aPos );
+ }
}
-void ScPivotLayoutDlg::SetActive()
+//----------------------------------------------------------------------------
+
+PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt )
{
if( mbRefInputMode )
{
@@ -489,25 +925,18 @@ void ScPivotLayoutDlg::SetActive()
RefInputDone();
}
-sal_Bool ScPivotLayoutDlg::Close()
+//----------------------------------------------------------------------------
+
+PointerStyle ScDPLayoutDlg::NotifyMouseButtonDown( ScDPFieldType eType, size_t nFieldIndex )
{
return DoClose( ScPivotLayoutWrapper::GetChildWindowId() );
}
-// private --------------------------------------------------------------------
+//----------------------------------------------------------------------------
-ScPivotFieldWindow& ScPivotLayoutDlg::GetFieldWindow( ScPivotFieldType eFieldType )
+void ScDPLayoutDlg::NotifyDoubleClick( ScDPFieldType eType, size_t nFieldIndex )
{
- switch( eFieldType )
- {
- case PIVOTFIELDTYPE_PAGE: return maWndPage;
- case PIVOTFIELDTYPE_ROW: return maWndRow;
- case PIVOTFIELDTYPE_COL: return maWndCol;
- case PIVOTFIELDTYPE_DATA: return maWndData;
- default:;
- }
- return maWndSelect;
-}
+ ScDPFuncDataVec* pArr = GetFieldDataArray(eType);
bool ScPivotLayoutDlg::IsInsertAllowed( const ScPivotFieldWindow& rSourceWindow, const ScPivotFieldWindow& rTargetWindow )
{
@@ -518,14 +947,90 @@ bool ScPivotLayoutDlg::IsInsertAllowed( const ScPivotFieldWindow& rSourceWindow,
DBG_ASSERT( pLabelData, "ScPivotLayoutDlg::IsInsertAllowed - label data not found" );
if( pLabelData )
{
- sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN;
- switch( rTargetWindow.GetType() )
+ OSL_FAIL("invalid selection");
+ return;
+ }
+
+ size_t nArrPos = 0;
+ if( ScDPLabelData* pData = GetLabelData( (*pArr)[nFieldIndex]->mnCol, &nArrPos ) )
+ {
+ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
+
+ switch ( eType )
{
- case PIVOTFIELDTYPE_PAGE: eOrient = sheet::DataPilotFieldOrientation_PAGE; break;
- case PIVOTFIELDTYPE_COL: eOrient = sheet::DataPilotFieldOrientation_COLUMN; break;
- case PIVOTFIELDTYPE_ROW: eOrient = sheet::DataPilotFieldOrientation_ROW; break;
- case PIVOTFIELDTYPE_DATA: eOrient = sheet::DataPilotFieldOrientation_DATA; break;
- default: return false;
+ case TYPE_PAGE:
+ case TYPE_COL:
+ case TYPE_ROW:
+ {
+ // list of names of all data fields
+ vector<ScDPName> aDataFieldNames;
+ for( ScDPFuncDataVec::const_iterator aIt = aDataArr.begin(), aEnd = aDataArr.end();
+ (aIt != aEnd) && aIt->get(); ++aIt )
+ {
+ ScDPLabelData* pDFData = GetLabelData((*aIt)->mnCol);
+ if (!pDFData)
+ continue;
+
+ if (!pDFData->maName.getLength())
+ continue;
+
+ OUString aLayoutName = pDFData->maLayoutName;
+ if (!aLayoutName.getLength())
+ {
+ // No layout name exists. Use the stock name.
+ sal_uInt16 nMask = (*aIt)->mnFuncMask;
+ OUString aFuncStr = GetFuncString(nMask);
+ aLayoutName = aFuncStr + pDFData->maName;
+ }
+ aDataFieldNames.push_back(ScDPName(pDFData->maName, aLayoutName));
+ }
+
+ bool bLayout = (eType == TYPE_ROW) &&
+ ((aDataFieldNames.size() > 1) || ((nFieldIndex + 1 < pArr->size()) && (*pArr)[nFieldIndex+1].get()));
+
+ AbstractScDPSubtotalDlg* pDlg = pFact->CreateScDPSubtotalDlg(
+ this, RID_SCDLG_PIVOTSUBT,
+ *xDlgDPObject, *pData, *(*pArr)[nFieldIndex], aDataFieldNames, bLayout );
+
+ if ( pDlg->Execute() == RET_OK )
+ {
+ pDlg->FillLabelData( *pData );
+ (*pArr)[nFieldIndex]->mnFuncMask = pData->mnFuncMask;
+ }
+ delete pDlg;
+ }
+ break;
+
+ case TYPE_DATA:
+ {
+ AbstractScDPFunctionDlg* pDlg = pFact->CreateScDPFunctionDlg(
+ this, RID_SCDLG_DPDATAFIELD,
+ aLabelDataArr, *pData, *(*pArr)[nFieldIndex] );
+
+ if ( pDlg->Execute() == RET_OK )
+ {
+ (*pArr)[nFieldIndex]->mnFuncMask = pData->mnFuncMask = pDlg->GetFuncMask();
+ (*pArr)[nFieldIndex]->maFieldRef = pDlg->GetFieldRef();
+
+ ScDPLabelData* p = GetLabelData(aDataArr[nFieldIndex]->mnCol);
+ OUString aStr = p->maLayoutName;
+ if (!aStr.getLength())
+ {
+ // Layout name is not available. Use default name.
+ aStr = GetFuncString (aDataArr[nFieldIndex]->mnFuncMask);
+ aStr += p->maName;
+ }
+ aWndData.SetFieldText( aStr, nFieldIndex );
+ }
+ delete pDlg;
+ }
+ break;
+
+ default:
+ {
+ // added to avoid warnings
+ }
}
return ScDPObject::IsOrientationAllowed( static_cast< sal_uInt16 >( eOrient ), pLabelData->mnFlags );
}
@@ -535,82 +1040,106 @@ bool ScPivotLayoutDlg::IsInsertAllowed( const ScPivotFieldWindow& rSourceWindow,
void ScPivotLayoutDlg::InitFieldWindows()
{
- maLabelData = maPivotData.maLabelArray;
- maWndSelect.ReadDataLabels( maLabelData );
- maWndPage.ReadPivotFields( maPivotData.maPageArr );
- maWndCol.ReadPivotFields( maPivotData.maColArr );
- maWndRow.ReadPivotFields( maPivotData.maRowArr );
- maWndData.ReadPivotFields( maPivotData.maDataArr );
+ /* Enable Remove/Options buttons on GetFocus in field window.
+ Enable them also, if dialog is deactivated (click into document).
+ The !IsActive() condition handles the case that a LoseFocus event of a
+ field window would follow the Deactivate event of this dialog. */
+ sal_Bool bEnable = (bGotFocus || !IsActive()) && (eType != TYPE_SELECT);
+
+ // The TestTool may set the focus into an empty field.
+ // Then the Remove/Options buttons must be disabled.
+ ScDPFieldControlBase* pWnd = GetFieldWindow(eType);
+ if ( bEnable && bGotFocus && pWnd && pWnd->IsEmpty() )
+ bEnable = false;
+
+ aBtnRemove.Enable( bEnable );
+ aBtnOptions.Enable( bEnable );
+ if( bGotFocus )
+ eLastActiveType = eType;
}
-void ScPivotLayoutDlg::GrabFieldFocus( ScPivotFieldWindow& rFieldWindow )
+//----------------------------------------------------------------------------
+
+void ScDPLayoutDlg::NotifyMoveFieldToEnd( ScDPFieldType eToType )
{
- if( rFieldWindow.IsEmpty() )
+ ScDPFieldControlBase* pWnd = GetFieldWindow(eLastActiveType);
+ ScDPFieldControlBase* pToWnd = GetFieldWindow(eToType);
+ if (pWnd && pToWnd && (eToType != TYPE_SELECT) && !pWnd->IsEmpty())
{
- if( maWndSelect.IsEmpty() )
- maBtnOk.GrabFocus();
+ MoveFieldToEnd(eLastActiveType, pWnd->GetSelectedField(), eToType);
+
+ if( pWnd->IsEmpty() )
+ NotifyFieldFocus( eToType, true );
else
- maWndSelect.GrabFocus();
+ pWnd->GrabFocus();
+ if( eLastActiveType == TYPE_SELECT )
+ aWndSelect.SelectNext();
}
else
rFieldWindow.GrabFocus();
}
-namespace {
-
-void lclFindFieldWindow( ScPivotFieldWindow*& rpFieldWindow, const ScPivotFuncData*& rpFuncData, size_t& rnFieldIndex, ScPivotFieldWindow& rFieldWindow )
+void ScDPLayoutDlg::Deactivate()
{
- ScPivotFuncDataEntry aEntry = rFieldWindow.FindFuncDataByCol( rpFuncData->mnCol );
- if( aEntry.first )
- {
- rpFieldWindow = &rFieldWindow;
- rpFuncData = aEntry.first;
- rnFieldIndex = aEntry.second;
- }
+ /* If the dialog has been deactivated (click into document), the LoseFocus
+ event from field window disables Remove/Options buttons. Re-enable them here by
+ simulating a GetFocus event. Event order of LoseFocus and Deactivate is not important.
+ The last event will enable the buttons in both cases (see NotifyFieldFocus). */
+ NotifyFieldFocus( eLastActiveType, true );
}
-} // namespace
+//----------------------------------------------------------------------------
bool ScPivotLayoutDlg::MoveField( ScPivotFieldWindow& rSourceWindow, ScPivotFieldWindow& rTargetWindow, size_t nInsertIndex, bool bMoveExisting )
{
- // move inside the same window
- if( &rSourceWindow == &rTargetWindow )
- return bMoveExisting && rTargetWindow.MoveSelectedField( nInsertIndex );
-
- // do not insert if not supported by target window
- if( !IsInsertAllowed( rSourceWindow, rTargetWindow ) )
- {
- rSourceWindow.RemoveSelectedField();
+ if (!pArr || pArr->empty())
return false;
- }
- // move from one window to another window
- if( const ScPivotFuncData* pSourceData = rSourceWindow.GetSelectedFuncData() )
+ ScDPFuncDataVec::const_iterator itr, itrBeg = pArr->begin(), itrEnd = pArr->end();
+ for (itr = itrBeg; itr != itrEnd; ++itr)
{
- // move to page/col/row window: try to find existing field in another window
- ScPivotFieldWindow* pSourceWindow = &rSourceWindow;
- size_t nSourceIndex = rSourceWindow.GetSelectedIndex();
- if( rTargetWindow.GetType() != PIVOTFIELDTYPE_DATA )
+ if ((*itr)->mnCol == nCol)
{
- lclFindFieldWindow( pSourceWindow, pSourceData, nSourceIndex, maWndPage );
- lclFindFieldWindow( pSourceWindow, pSourceData, nSourceIndex, maWndCol );
- lclFindFieldWindow( pSourceWindow, pSourceData, nSourceIndex, maWndRow );
+ // found!
+ nAt = ::std::distance(itrBeg, itr);
+ return true;
}
+ }
+ return false;
+}
- // found in target window: move to new position
- if( pSourceWindow == &rTargetWindow )
- return bMoveExisting && pSourceWindow->MoveField( nSourceIndex, nInsertIndex );
+//----------------------------------------------------------------------------
- // insert field into target window
- rTargetWindow.InsertField( nInsertIndex, *pSourceData );
- // remove field from source window
- pSourceWindow->RemoveField( nSourceIndex );
- // remove field from data window, if it is the original source
- if( (rSourceWindow.GetType() == PIVOTFIELDTYPE_DATA) && (pSourceWindow->GetType() != PIVOTFIELDTYPE_DATA) )
- rSourceWindow.RemoveSelectedField();
+void ScDPLayoutDlg::Remove( ScDPFuncDataVec* pArr, size_t nAt )
+{
+ if ( !pArr || (nAt>=pArr->size()) )
+ return;
+
+ pArr->erase( pArr->begin() + nAt );
+}
+
+//----------------------------------------------------------------------------
+
+void ScDPLayoutDlg::Insert( ScDPFuncDataVec* pArr, const ScDPFuncData& rFData, size_t nAt )
+{
+ if (!pArr)
+ return;
+
+ ScDPFuncDataRef p (new ScDPFuncData(rFData));
+ if (nAt >= pArr->size())
+ pArr->push_back(p);
+ else
+ pArr->insert(pArr->begin() + nAt, p);
+}
+
+//----------------------------------------------------------------------------
return true;
}
+ return pData;
+}
+
+//----------------------------------------------------------------------------
return false;
}
@@ -641,27 +1170,318 @@ IMPL_LINK( ScPivotLayoutDlg, ClickHdl, PushButton *, pBtn )
GrabFieldFocus( rTargetWindow );
}
}
- return 0;
+ else if ( rFuncMask == PIVOT_FUNC_SUM ) aStr = FSTR(PIVOTSTR_SUM);
+ else if ( rFuncMask == PIVOT_FUNC_COUNT ) aStr = FSTR(PIVOTSTR_COUNT);
+ else if ( rFuncMask == PIVOT_FUNC_AVERAGE ) aStr = FSTR(PIVOTSTR_AVG);
+ else if ( rFuncMask == PIVOT_FUNC_MAX ) aStr = FSTR(PIVOTSTR_MAX);
+ else if ( rFuncMask == PIVOT_FUNC_MIN ) aStr = FSTR(PIVOTSTR_MIN);
+ else if ( rFuncMask == PIVOT_FUNC_PRODUCT ) aStr = FSTR(PIVOTSTR_PROD);
+ else if ( rFuncMask == PIVOT_FUNC_COUNT_NUM ) aStr = FSTR(PIVOTSTR_COUNT2);
+ else if ( rFuncMask == PIVOT_FUNC_STD_DEV ) aStr = FSTR(PIVOTSTR_DEV);
+ else if ( rFuncMask == PIVOT_FUNC_STD_DEVP ) aStr = FSTR(PIVOTSTR_DEV2);
+ else if ( rFuncMask == PIVOT_FUNC_STD_VAR ) aStr = FSTR(PIVOTSTR_VAR);
+ else if ( rFuncMask == PIVOT_FUNC_STD_VARP ) aStr = FSTR(PIVOTSTR_VAR2);
+ else
+ {
+ aStr = ScGlobal::GetRscString( STR_TABLE_ERGEBNIS );
+ aStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " - " ));
+ }
+
+ return aStr;
+}
+
+//----------------------------------------------------------------------------
+
+Point ScDPLayoutDlg::DlgPos2WndPos( const Point& rPt, Window& rWnd )
+{
+ Point aWndPt( rPt );
+ aWndPt.X() = rPt.X()-rWnd.GetPosPixel().X();
+ aWndPt.Y() = rPt.Y()-rWnd.GetPosPixel().Y();
+
+ return aWndPt;
+}
+
+//----------------------------------------------------------------------------
+
+void ScDPLayoutDlg::CalcWndSizes()
+{
+ // row/column/data area sizes
+ long nFldW = FIELD_BTN_WIDTH;
+ long nFldH = FIELD_BTN_HEIGHT;
+ aWndData.SetSizePixel(Size(338, 185));
+ aWndPage.SetSizePixel(
+ Size(aWndData.GetSizePixel().Width() + 85,
+ aWndCol.GetPosPixel().Y() - aWndPage.GetPosPixel().Y() - FIELD_AREA_GAP));
+ aWndRow.SetSizePixel(
+ Size(aWndData.GetPosPixel().X()-aWndRow.GetPosPixel().X() - FIELD_AREA_GAP,
+ aWndData.GetSizePixel().Height()));
+ aWndCol.SetSizePixel(
+ Size(aWndData.GetPosPixel().X() - aWndCol.GetPosPixel().X() + aWndData.GetSizePixel().Width(),
+ aWndData.GetPosPixel().Y() - aWndCol.GetPosPixel().Y() - FIELD_AREA_GAP));
+
+ // #i29203# align right border of page window with data window
+ long nDataPosX = aWndData.GetPosPixel().X() + aWndData.GetSizePixel().Width();
+ aWndPage.SetPosPixel(
+ Point(nDataPosX - aWndPage.GetSizePixel().Width(),
+ aWndPage.GetPosPixel().Y()));
+
+ // selection area
+ long nLineSize = 10; // number of fields per column.
+ long nH = OUTER_MARGIN_VER + nLineSize* nFldH + nLineSize * ROW_FIELD_BTN_GAP;
+ nH += ROW_FIELD_BTN_GAP;
+ nH += GetSettings().GetStyleSettings().GetScrollBarSize() + OUTER_MARGIN_VER;
+ aWndSelect.SetSizePixel(
+ Size(2 * nFldW + ROW_FIELD_BTN_GAP + 10, nH));
+
+ aRectPage = Rectangle( aWndPage.GetPosPixel(), aWndPage.GetSizePixel() );
+ aRectRow = Rectangle( aWndRow.GetPosPixel(), aWndRow.GetSizePixel() );
+ aRectCol = Rectangle( aWndCol.GetPosPixel(), aWndCol.GetSizePixel() );
+ aRectData = Rectangle( aWndData.GetPosPixel(), aWndData.GetSizePixel() );
+ aRectSelect = Rectangle( aWndSelect.GetPosPixel(), aWndSelect.GetSizePixel() );
+
+ aWndPage.CalcSize();
+ aWndRow.CalcSize();
+ aWndCol.CalcSize();
+ aWndData.CalcSize();
+ aWndSelect.CalcSize();
+}
+
+namespace {
+
+class PivotFieldInserter : public ::std::unary_function<void, boost::shared_ptr<ScDPFuncData> >
+{
+ vector<PivotField>& mrFields;
+public:
+ explicit PivotFieldInserter(vector<PivotField>& r, size_t nSize) : mrFields(r)
+ {
+ mrFields.reserve(nSize);
+ }
+
+ PivotFieldInserter(const PivotFieldInserter& r) : mrFields(r.mrFields) {}
+
+ void operator() (const ::boost::shared_ptr<ScDPFuncData>& p)
+ {
+ PivotField aField;
+ aField.nCol = p->mnCol;
+ aField.nFuncMask = p->mnFuncMask;
+ aField.maFieldRef = p->maFieldRef;
+ mrFields.push_back(aField);
+ }
+};
+
+}
+
+bool ScDPLayoutDlg::GetPivotArrays(
+ vector<PivotField>& rPageFields, vector<PivotField>& rColFields,
+ vector<PivotField>& rRowFields, vector<PivotField>& rDataFields )
+{
+ vector<PivotField> aPageFields;
+ for_each(aPageArr.begin(), aPageArr.end(), PivotFieldInserter(aPageFields, aPageArr.size()));
+
+ vector<PivotField> aColFields;
+ for_each(aColArr.begin(), aColArr.end(), PivotFieldInserter(aColFields, aColArr.size()));
+
+ // default data pilot table always has an extra row field as a data layout field.
+ vector<PivotField> aRowFields;
+ for_each(aRowArr.begin(), aRowArr.end(), PivotFieldInserter(aRowFields, aRowArr.size()+1));
+ aRowFields.push_back(PivotField(PIVOT_DATA_FIELD, 0));
+
+ vector<PivotField> aDataFields;
+ for_each(aDataArr.begin(), aDataArr.end(), PivotFieldInserter(aDataFields, aDataArr.size()));
+
+ rPageFields.swap(aPageFields);
+ rColFields.swap(aColFields);
+ rRowFields.swap(aRowFields);
+ rDataFields.swap(aDataFields);
+
+ return true;
}
IMPL_LINK( ScPivotLayoutDlg, OkHdl, OKButton *, EMPTYARG )
{
- String aOutPosStr = maEdOutPos.GetText();
- ScAddress aAdrDest;
- bool bToNewTable = maLbOutPos.GetSelectEntryPos() == 1;
- sal_uInt16 nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, mpDoc, mpDoc->GetAddressConvention() ) : 0;
+ String aSrcStr = aEdInPos.GetText();
+ sal_uInt16 nResult = ScRange().Parse(aSrcStr, pDoc, pDoc->GetAddressConvention());
+ DataSrcType eSrcType = SRC_INVALID;
+ ScRange aNewRange;
- if( bToNewTable || ((aOutPosStr.Len() > 0) && ((nResult & SCA_VALID) == SCA_VALID)) )
+ if (SCA_VALID == (nResult & SCA_VALID))
{
- ScPivotFieldVector aPageFields, aColFields, aRowFields, aDataFields;
- maWndPage.WritePivotFields( aPageFields );
- maWndCol.WritePivotFields( aColFields );
- maWndRow.WritePivotFields( aRowFields );
- maWndData.WritePivotFields( aDataFields );
+ // Valid source range. Take it.
+ ScRefAddress start, end;
+ ConvertDoubleRef(pDoc, aSrcStr, 1, start, end, pDoc->GetAddressConvention());
+ aNewRange.aStart = start.GetAddress();
+ aNewRange.aEnd = end.GetAddress();
+ aEdInPos.SetRefValid(true);
+ eSrcType = SRC_REF;
+ }
+ else
+ {
+ // invalid source range. Check if this is a valid range name.
+ bool bValid = false;
+ ScRangeName* pRangeName = pDoc->GetRangeName();
+ if (pRangeName)
+ {
+ OUString aUpper = ScGlobal::pCharClass->upper(aSrcStr);
+ const ScRangeData* pData = pRangeName->findByUpperName(aUpper);
+ if (pData)
+ {
+ // range name found. Check if this is a valid reference.
+ bValid = pData->IsReference(aNewRange);
+ }
+ }
+
+ aEdInPos.SetRefValid(bValid);
+ if (!bValid)
+ {
+ // All attempts have failed. Give up.
+ aBtnOk.Disable();
+ return;
+ }
+
+ eSrcType = SRC_NAME;
+ }
- // TODO: handle data field in dialog field windows?
- aRowFields.resize( aRowFields.size() + 1 );
- aRowFields.back().nCol = PIVOT_DATA_FIELD;
+ aBtnOk.Enable();
+
+ // Now update the data src range or range name with the dp object.
+ ScSheetSourceDesc inSheet = *xDlgDPObject->GetSheetDesc();
+
+ switch (eSrcType)
+ {
+ case SRC_REF:
+ // data source is a range reference.
+ if (inSheet.GetSourceRange() == aNewRange)
+ // new range is identical to the current range. Nothing to do.
+ return;
+ inSheet.SetSourceRange(aNewRange);
+ break;
+ case SRC_NAME:
+ // data source is a range name.
+ inSheet.SetRangeName(aSrcStr);
+ break;
+ default:
+ OSL_ENSURE(false, "Unknown source type.");
+ return;
+ }
+
+ xDlgDPObject->SetSheetDesc(inSheet);
+ xDlgDPObject->FillOldParam( thePivotData, false );
+ xDlgDPObject->FillLabelData(thePivotData);
+
+ aLabelDataArr.clear();
+ aWndSelect.ClearFields();
+ aWndData.ClearFields();
+ aWndRow.ClearFields();
+ aWndCol.ClearFields();
+ aWndPage.ClearFields();
+
+ aSelectArr.clear();
+ aRowArr.clear();
+ aColArr.clear();
+ aDataArr.clear();
+ aPageArr.clear();
+
+ InitFields();
+ RepaintFieldWindows();
+}
+
+void ScDPLayoutDlg::RepaintFieldWindows()
+{
+ Rectangle aRect; // currently has no effect whatsoever.
+ aWndPage.Paint(aRect);
+ aWndCol.Paint(aRect);
+ aWndRow.Paint(aRect);
+ aWndData.Paint(aRect);
+}
+
+ScDPFieldControlBase* ScDPLayoutDlg::GetFieldWindow(ScDPFieldType eType)
+{
+ switch (eType)
+ {
+ case TYPE_PAGE:
+ return &aWndPage;
+ case TYPE_COL:
+ return &aWndCol;
+ case TYPE_ROW:
+ return &aWndRow;
+ case TYPE_DATA:
+ return &aWndData;
+ case TYPE_SELECT:
+ return &aWndSelect;
+ default:
+ ;
+ }
+ return NULL;
+}
+
+void ScDPLayoutDlg::GetOtherFieldWindows(ScDPFieldType eType, ScDPFieldControlBase*& rpWnd1, ScDPFieldControlBase*& rpWnd2)
+{
+ rpWnd1 = NULL;
+ rpWnd2 = NULL;
+ switch (eType)
+ {
+ case TYPE_PAGE:
+ rpWnd1 = &aWndRow;
+ rpWnd2 = &aWndCol;
+ break;
+ case TYPE_COL:
+ rpWnd1 = &aWndPage;
+ rpWnd2 = &aWndRow;
+ break;
+ case TYPE_ROW:
+ rpWnd1 = &aWndPage;
+ rpWnd2 = &aWndCol;
+ break;
+ default:
+ ;
+ }
+}
+
+ScDPLayoutDlg::ScDPFuncDataVec* ScDPLayoutDlg::GetFieldDataArray(ScDPFieldType eType)
+{
+ switch (eType)
+ {
+ case TYPE_PAGE:
+ return &aPageArr;
+ case TYPE_COL:
+ return &aColArr;
+ case TYPE_ROW:
+ return &aRowArr;
+ case TYPE_DATA:
+ return &aDataArr;
+ case TYPE_SELECT:
+ return &aSelectArr;
+ default:
+ ;
+ }
+ return NULL;
+}
+
+void ScDPLayoutDlg::GetOtherDataArrays(
+ ScDPFieldType eType, ScDPFuncDataVec*& rpArr1, ScDPFuncDataVec*& rpArr2)
+{
+ rpArr1 = NULL;
+ rpArr2 = NULL;
+ switch (eType)
+ {
+ case TYPE_PAGE:
+ rpArr1 = &aRowArr;
+ rpArr2 = &aColArr;
+ break;
+ case TYPE_COL:
+ rpArr1 = &aPageArr;
+ rpArr2 = &aRowArr;
+ break;
+ case TYPE_ROW:
+ rpArr1 = &aPageArr;
+ rpArr2 = &aColArr;
+ break;
+ default:
+ ;
+ }
+}
+
+//----------------------------------------------------------------------------
ScDPSaveData* pOldSaveData = mxDlgDPObject->GetSaveData();
@@ -675,129 +1495,227 @@ IMPL_LINK( ScPivotLayoutDlg, OkHdl, OKButton *, EMPTYARG )
aSaveData.SetFilterButton( maBtnFilter.IsChecked() );
aSaveData.SetDrillDown( maBtnDrillDown.IsChecked() );
- uno::Reference< sheet::XDimensionsSupplier > xSource = mxDlgDPObject->GetSource();
+//----------------------------------------------------------------------------
+
+void ScDPLayoutDlg::SetActive()
+{
+ if ( bRefInputMode )
+ {
+ if ( pEditActive )
+ pEditActive->GrabFocus();
+
+ if ( pEditActive == &aEdInPos )
+ EdInModifyHdl( NULL );
+ else if ( pEditActive == &aEdOutPos )
+ EdModifyHdl( NULL );
+ }
+ else
+ {
+ GrabFocus();
+ }
+
+ RefInputDone();
+}
+
+//----------------------------------------------------------------------------
+// Handler:
+//----------------------------------------------------------------------------
+
+IMPL_LINK( ScDPLayoutDlg, ClickHdl, PushButton *, pBtn )
+{
+ ScDPFieldControlBase* pWnd = GetFieldWindow( eLastActiveType );
+ if (!pWnd)
+ return 0;
+
+ if( pBtn == &aBtnRemove )
+ {
+ RemoveField( eLastActiveType, pWnd->GetSelectedField() );
+ if( !pWnd->IsEmpty() ) pWnd->GrabFocus();
+ }
+ else if( pBtn == &aBtnOptions )
+ {
+ NotifyDoubleClick( eLastActiveType, pWnd->GetSelectedField() );
+ pWnd->GrabFocus();
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+
+IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
+{
+ String aOutPosStr( aEdOutPos.GetText() );
+ ScAddress aAdrDest;
+ sal_Bool bToNewTable = (aLbOutPos.GetSelectEntryPos() == 1);
+ sal_uInt16 nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, pDoc, pDoc->GetAddressConvention() ) : 0;
+
+ if (!bToNewTable && (aOutPosStr.Len() == 0 || (nResult & SCA_VALID) != SCA_VALID))
+ {
+ // Invalid reference. Bail out.
+ if ( !aBtnMore.GetState() )
+ aBtnMore.SetState(true);
+
+ ErrorBox(this, WinBits(WB_OK | WB_DEF_OK), ScGlobal::GetRscString(STR_INVALID_TABREF)).Execute();
+ aEdOutPos.GrabFocus();
+ return 0;
+ }
- ScDPObject::ConvertOrientation( aSaveData, aPageFields, sheet::DataPilotFieldOrientation_PAGE, 0, 0, 0, xSource, false );
- ScDPObject::ConvertOrientation( aSaveData, aColFields, sheet::DataPilotFieldOrientation_COLUMN, 0, 0, 0, xSource, false );
- ScDPObject::ConvertOrientation( aSaveData, aRowFields, sheet::DataPilotFieldOrientation_ROW, 0, 0, 0, xSource, false );
- ScDPObject::ConvertOrientation( aSaveData, aDataFields, sheet::DataPilotFieldOrientation_DATA, 0, 0, 0, xSource, false, &aColFields, &aRowFields, &aPageFields );
+ ScPivotParam theOutParam;
+ vector<PivotField> aPageFields;
+ vector<PivotField> aColFields;
+ vector<PivotField> aRowFields;
+ vector<PivotField> aDataFields;
- for( ScDPLabelDataVector::const_iterator aIt = maLabelData.begin(), aEnd = maLabelData.end(); aIt != aEnd; ++aIt )
+ // Convert an array of function data into an array of pivot field data.
+ bool bFit = GetPivotArrays(aPageFields, aColFields, aRowFields, aDataFields);
+
+ if (!bFit)
+ {
+ // General data pilot table error. Bail out.
+ ErrorBox(this, WinBits(WB_OK | WB_DEF_OK), ScGlobal::GetRscString(STR_PIVOT_ERROR)).Execute();
+ return 0;
+ }
+
+ ScDPSaveData* pOldSaveData = xDlgDPObject->GetSaveData();
+
+ ScRange aOutRange( aAdrDest ); // bToNewTable is passed separately
+
+ ScDPSaveData aSaveData;
+ aSaveData.SetIgnoreEmptyRows( aBtnIgnEmptyRows.IsChecked() );
+ aSaveData.SetRepeatIfEmpty( aBtnDetectCat.IsChecked() );
+ aSaveData.SetColumnGrand( aBtnTotalCol.IsChecked() );
+ aSaveData.SetRowGrand( aBtnTotalRow.IsChecked() );
+ aSaveData.SetFilterButton( aBtnFilter.IsChecked() );
+ aSaveData.SetDrillDown( aBtnDrillDown.IsChecked() );
+
+ uno::Reference<sheet::XDimensionsSupplier> xSource = xDlgDPObject->GetSource();
+
+ ScDPObject::ConvertOrientation(
+ aSaveData, aPageFields, sheet::DataPilotFieldOrientation_PAGE, xSource );
+ ScDPObject::ConvertOrientation(
+ aSaveData, aColFields, sheet::DataPilotFieldOrientation_COLUMN, xSource );
+ ScDPObject::ConvertOrientation(
+ aSaveData, aRowFields, sheet::DataPilotFieldOrientation_ROW, xSource );
+ ScDPObject::ConvertOrientation(
+ aSaveData, aDataFields, sheet::DataPilotFieldOrientation_DATA, xSource,
+ &aColFields, &aRowFields, &aPageFields );
+
+ for( ScDPLabelDataVec::const_iterator aIt = aLabelDataArr.begin(), aEnd = aLabelDataArr.end(); aIt != aEnd; ++aIt )
+ {
+ if( ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName( aIt->maName ) )
{
- if( ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName( aIt->maName ) )
+ pDim->SetUsedHierarchy( aIt->mnUsedHier );
+ pDim->SetShowEmpty( aIt->mbShowAll );
+ pDim->SetSortInfo( &aIt->maSortInfo );
+ pDim->SetLayoutInfo( &aIt->maLayoutInfo );
+ pDim->SetAutoShowInfo( &aIt->maShowInfo );
+ ScDPSaveDimension* pOldDim = NULL;
+ if (pOldSaveData)
{
- pDim->SetUsedHierarchy( aIt->mnUsedHier );
- pDim->SetShowEmpty( aIt->mbShowAll );
- pDim->SetSortInfo( &aIt->maSortInfo );
- pDim->SetLayoutInfo( &aIt->maLayoutInfo );
- pDim->SetAutoShowInfo( &aIt->maShowInfo );
- ScDPSaveDimension* pOldDim = NULL;
- if (pOldSaveData)
+ // Transfer the existing layout names to new dimension instance.
+ pOldDim = pOldSaveData->GetExistingDimensionByName(aIt->maName);
+ if (pOldDim)
{
- // Transfer the existing layout names to new dimension instance.
- pOldDim = pOldSaveData->GetExistingDimensionByName(aIt->maName);
- if (pOldDim)
- {
- const OUString* pLayoutName = pOldDim->GetLayoutName();
- if (pLayoutName)
- pDim->SetLayoutName(*pLayoutName);
+ const OUString* pLayoutName = pOldDim->GetLayoutName();
+ if (pLayoutName)
+ pDim->SetLayoutName(*pLayoutName);
- const OUString* pSubtotalName = pOldDim->GetSubtotalName();
- if (pSubtotalName)
- pDim->SetSubtotalName(*pSubtotalName);
- }
+ const OUString* pSubtotalName = pOldDim->GetSubtotalName();
+ if (pSubtotalName)
+ pDim->SetSubtotalName(*pSubtotalName);
}
+ }
+ }
- bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL );
+ bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL );
- // visibility of members
- for (::std::vector<ScDPLabelData::Member>::const_iterator itr = aIt->maMembers.begin(), itrEnd = aIt->maMembers.end();
- itr != itrEnd; ++itr)
- {
- ScDPSaveMember* pMember = pDim->GetMemberByName(itr->maName);
+ // visibility of members
+ for (vector<ScDPLabelData::Member>::const_iterator itr = aIt->maMembers.begin(), itrEnd = aIt->maMembers.end();
+ itr != itrEnd; ++itr)
+ {
+ ScDPSaveMember* pMember = pDim->GetMemberByName(itr->maName);
- // #i40054# create/access members only if flags are not default
- // (or in manual sorting mode - to keep the order)
- if (bManualSort || !itr->mbVisible || !itr->mbShowDetails)
- {
- pMember->SetIsVisible(itr->mbVisible);
- pMember->SetShowDetails(itr->mbShowDetails);
- }
- if (pOldDim)
+ // #i40054# create/access members only if flags are not default
+ // (or in manual sorting mode - to keep the order)
+ if (bManualSort || !itr->mbVisible || !itr->mbShowDetails)
+ {
+ pMember->SetIsVisible(itr->mbVisible);
+ pMember->SetShowDetails(itr->mbShowDetails);
+ }
+ if (pOldDim)
+ {
+ // Transfer the existing layout name.
+ ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(itr->maName);
+ if (pOldMember)
{
- // Transfer the existing layout name.
- ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(itr->maName);
- if (pOldMember)
- {
- const OUString* pLayoutName = pOldMember->GetLayoutName();
- if (pLayoutName)
- pMember->SetLayoutName(*pLayoutName);
- }
+ const OUString* pLayoutName = pOldMember->GetLayoutName();
+ if (pLayoutName)
+ pMember->SetLayoutName(*pLayoutName);
}
}
}
}
- ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension();
- if (pDim && pOldSaveData)
+ }
+ ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension();
+ if (pDim && pOldSaveData)
+ {
+ ScDPSaveDimension* pOldDim = pOldSaveData->GetDataLayoutDimension();
+ if (pOldDim)
{
- ScDPSaveDimension* pOldDim = pOldSaveData->GetDataLayoutDimension();
- if (pOldDim)
- {
- const OUString* pLayoutName = pOldDim->GetLayoutName();
- if (pLayoutName)
- pDim->SetLayoutName(*pLayoutName);
- }
+ const OUString* pLayoutName = pOldDim->GetLayoutName();
+ if (pLayoutName)
+ pDim->SetLayoutName(*pLayoutName);
}
+ }
- sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE );
- ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable );
+ sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE );
+ ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable );
- mbRefInputMode = false; // to allow deselecting when switching sheets
+ bRefInputMode = false; // to allow deselecting when switching sheets
- SetDispatcherLock( false );
- SwitchToDocument();
+ SetDispatcherLock( false );
+ SwitchToDocument();
- // #95513# don't hide the dialog before executing the slot, instead it is used as
- // parent for message boxes in ScTabViewShell::GetDialogParent
+ ScTabViewShell* pTabViewShell = pViewData->GetViewShell();
+ pTabViewShell->SetDialogDPObject(xDlgDPObject.get());
- const SfxPoolItem* pRet = GetBindings().GetDispatcher()->Execute(
- SID_PIVOT_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aOutItem, 0L, 0L );
+ // don't hide the dialog before executing the slot, instead it is used as
+ // parent for message boxes in ScTabViewShell::GetDialogParent
- bool bSuccess = true;
- if (pRet)
- {
- const SfxBoolItem* pItem = dynamic_cast<const SfxBoolItem*>(pRet);
- if (pItem)
- bSuccess = pItem->GetValue();
- }
- if (bSuccess)
- // Table successfully inserted.
- Close();
- else
- {
- // Table insertion failed. Keep the dialog open.
- mbRefInputMode = true;
- SetDispatcherLock(true);
- }
+ const SfxPoolItem* pRet = GetBindings().GetDispatcher()->Execute(
+ SID_PIVOT_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aOutItem, 0L, 0L );
+
+ bool bSuccess = true;
+ if (pRet)
+ {
+ const SfxBoolItem* pItem = dynamic_cast<const SfxBoolItem*>(pRet);
+ if (pItem)
+ bSuccess = pItem->GetValue();
}
+ if (bSuccess)
+ // Table successfully inserted.
+ Close();
else
{
- if( !maBtnMore.GetState() )
- maBtnMore.SetState( true );
-
- ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ), ScGlobal::GetRscString( STR_INVALID_TABREF ) ).Execute();
- maEdOutPos.GrabFocus();
+ // Table insertion failed. Keep the dialog open.
+ bRefInputMode = true;
+ SetDispatcherLock(true);
}
+
return 0;
}
-IMPL_LINK( ScPivotLayoutDlg, CancelHdl, CancelButton *, EMPTYARG )
+//----------------------------------------------------------------------------
+
+IMPL_LINK( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG )
{
Close();
return 0;
}
-IMPL_LINK( ScPivotLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG )
+//----------------------------------------------------------------------------
+
+IMPL_LINK( ScDPLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG )
{
if ( maBtnMore.GetState() )
{
@@ -822,7 +1740,9 @@ IMPL_LINK( ScPivotLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG )
return 0;
}
-IMPL_LINK( ScPivotLayoutDlg, EdOutModifyHdl, Edit *, EMPTYARG )
+//----------------------------------------------------------------------------
+
+IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, Edit *, EMPTYARG )
{
String theCurPosStr = maEdOutPos.GetText();
sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, mpDoc, mpDoc->GetAddressConvention() );
@@ -848,20 +1768,12 @@ IMPL_LINK( ScPivotLayoutDlg, EdOutModifyHdl, Edit *, EMPTYARG )
return 0;
}
-
-IMPL_LINK( ScPivotLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG )
+IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG )
{
String theCurPosStr = maEdInPos.GetText();
sal_uInt16 nResult = ScRange().Parse( theCurPosStr, mpDoc, mpDoc->GetAddressConvention() );
- // invalid source range
- if( SCA_VALID != (nResult & SCA_VALID) )
- return 0;
-
- ScRefAddress start, end;
- ConvertDoubleRef( mpDoc, theCurPosStr, 1, start, end, mpDoc->GetAddressConvention() );
- ScRange aNewRange( start.GetAddress(), end.GetAddress() );
- ScSheetSourceDesc inSheet = *mxDlgDPObject->GetSheetDesc();
+//----------------------------------------------------------------------------
// new range is identical to the current range
if( inSheet.aSourceRange == aNewRange )
@@ -902,47 +1814,17 @@ IMPL_LINK( ScPivotLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG )
return 0;
}
-IMPL_LINK( ScPivotLayoutDlg, ChildEventListener, VclWindowEvent*, pEvent )
+IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl )
{
- Window* pWindow = pEvent->GetWindow();
- // check that this dialog is the parent of the window, to ignore focus events from sub dialogs
- if( (pEvent->GetId() == VCLEVENT_WINDOW_GETFOCUS) && pWindow && (pWindow->GetParent() == this) )
- {
- // check if old window and/or new window are field windows
- ScPivotFieldWindow* pSourceWindow = mpFocusWindow;
- ScPivotFieldWindow* pTargetWindow = dynamic_cast< ScPivotFieldWindow* >( pWindow );
-
- /* Enable or disable the Remove/Options buttons. Do nothing if the
- buttons themselves get the focus.
- #128113# The TestTool may set the focus into an empty window. Then
- the Remove/Options buttons must be disabled. */
- if( (pWindow != &maBtnRemove) && (pWindow != &maBtnOptions) )
- {
- bool bEnableButtons = pTargetWindow && (pTargetWindow->GetType() != PIVOTFIELDTYPE_SELECT) && !pTargetWindow->IsEmpty();
- maBtnRemove.Enable( bEnableButtons );
- maBtnOptions.Enable( bEnableButtons );
- /* Remember the new focus window (will not be changed, if
- Remove/Option buttons are getting focus, because they need to
- know the field window they are working on). */
- mpFocusWindow = pTargetWindow;
- }
-
- /* Move the last selected field to target window, if focus changes via
- keyboard shortcut. */
- if( pSourceWindow && pTargetWindow && (pSourceWindow != pTargetWindow) && ((pTargetWindow->GetGetFocusFlags() & GETFOCUS_MNEMONIC) != 0) )
- {
- // append field in target window
- MoveField( *pSourceWindow, *pTargetWindow, pTargetWindow->GetFieldCount(), false );
- // move cursor in selection window to next field
- if( pSourceWindow->GetType() == PIVOTFIELDTYPE_SELECT )
- pSourceWindow->SelectNextField();
- // return focus to source window (if it is not empty)
- GrabFieldFocus( pSourceWindow->IsEmpty() ? *pTargetWindow : *pSourceWindow );
- }
+ pEditActive = NULL;
+ if ( pCtrl == &aEdInPos )
+ pEditActive = &aEdInPos;
+ else if ( pCtrl == &aEdOutPos )
+ pEditActive = &aEdOutPos;
mpActiveEdit = dynamic_cast< ::formula::RefEdit* >( pEvent->GetWindow() );
}
return 0;
}
-// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 080c80e509ea..466642b8e087 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,7 +86,7 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo
XColorTable* pColorTable = ((SvxColorTableItem*)pItem)->GetColorTable();
if (pColorTable)
{
- aLbColor.SetUpdateMode( sal_False );
+ aLbColor.SetUpdateMode( false );
long nCount = pColorTable->Count();
for ( long n=0; n<nCount; n++ )
{
@@ -108,9 +109,9 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo
aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ", " ));
aComment += String( ScResId( STR_ON ) );
aComment += ' ';
- aComment += ScGlobal::GetpLocaleData()->getDate( Date() );//CHINA001 aComment += ScGlobal::pLocaleData->getDate( Date() );
+ aComment += ScGlobal::GetpLocaleData()->getDate( Date() );
aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ", " ));
- aComment += ScGlobal::GetpLocaleData()->getTime( Time() );//CHINA001 aComment += ScGlobal::pLocaleData->getTime( Time() );
+ aComment += ScGlobal::GetpLocaleData()->getTime( Time() );
aEdComment .SetText( aComment );
aEdName .SetText( rName );
@@ -127,16 +128,16 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo
aCbTwoWay.Check(sal_True);
//aCbAttrib.Check(sal_False);
//aCbValue.Check(sal_False);
- aCbCopyAll.Check(sal_False);
+ aCbCopyAll.Check(false);
aCbProtect.Check(sal_True);
if (bIsEdit)
- aCbCopyAll.Enable(sal_False);
+ aCbCopyAll.Enable(false);
// If the Sheet is protected then we disable the Scenario Protect input
// and default it to true above. Note we are in 'Add' mode here as: if
// Sheet && scenario protection are true, then we cannot edit this dialog.
if (bSheetProtected)
- aCbProtect.Enable(sal_False);
+ aCbProtect.Enable(false);
//! die drei funktionieren noch nicht...
/*
@@ -151,7 +152,7 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo
//------------------------------------------------------------------------
-__EXPORT ScNewScenarioDlg::~ScNewScenarioDlg()
+ScNewScenarioDlg::~ScNewScenarioDlg()
{
}
@@ -246,3 +247,4 @@ IMPL_LINK( ScNewScenarioDlg, EnableHdl, CheckBox *, pBox )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/scendlg.hrc b/sc/source/ui/dbgui/scendlg.hrc
index f7fa562a5b17..92f16e01d362 100644
--- a/sc/source/ui/dbgui/scendlg.hrc
+++ b/sc/source/ui/dbgui/scendlg.hrc
@@ -25,7 +25,7 @@
*
************************************************************************/
#include "sc.hrc"
-//#define RID_SCDLG_NEWSCENARIO 256
+
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
diff --git a/sc/source/ui/dbgui/scendlg.src b/sc/source/ui/dbgui/scendlg.src
index 640fdda8bc30..17f55fcc274d 100644
--- a/sc/source/ui/dbgui/scendlg.src
+++ b/sc/source/ui/dbgui/scendlg.src
@@ -102,7 +102,6 @@ ModalDialog RID_SCDLG_NEWSCENARIO
HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_TWOWAY";
Pos = MAP_APPFONT ( 12 , 121 ) ;
Size = MAP_APPFONT ( 183 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Zurckkopieren : Zurckkopieren */
Text [ en-US ] = "Copy ~back" ;
};
CheckBox CB_ATTRIB
@@ -170,41 +169,3 @@ ModalDialog RID_SCDLG_NEWSCENARIO
Text [ en-US ] = "Settings";
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 2cf981a15ff3..743fb1044a91 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,9 +51,10 @@
const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
// Defines - CSV Import Preserve Options
#define FIXED_WIDTH "FixedWidth"
#define FROM_ROW "FromRow"
@@ -96,7 +98,7 @@ sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList )
xub_StrLen nCount = rList.GetTokenCount('\t');
for ( xub_StrLen i=0; i<nCount; i+=2 )
{
- if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.GetToken(i,'\t') ) )//CHINA001 if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.GetToken(i,'\t') ) )
+ if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.GetToken(i,'\t') ) )
c = (sal_Unicode)rList.GetToken(i+1,'\t').ToInt32();
}
if (!c && aStr.Len())
@@ -121,17 +123,17 @@ static void load_Separators( OUString &sFieldSeparators, OUString &sTextSeparato
const Any *pProperties;
Sequence<OUString> aNames(9);
OUString* pNames = aNames.getArray();
- ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
-
- pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS );
- pNames[1] = OUString::createFromAscii( SEPARATORS );
- pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS );
- pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
- pNames[4] = OUString::createFromAscii( FROM_ROW );
- pNames[5] = OUString::createFromAscii( CHAR_SET );
- pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT );
- pNames[7] = OUString::createFromAscii( DETECT_SPECIAL_NUM );
- pNames[8] = OUString::createFromAscii( LANGUAGE );
+ ScLinkConfigItem aItem( OUString(RTL_CONSTASCII_USTRINGPARAM( SEP_PATH )) );
+
+ pNames[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( MERGE_DELIMITERS ));
+ pNames[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( SEPARATORS ));
+ pNames[2] = OUString(RTL_CONSTASCII_USTRINGPARAM( TEXT_SEPARATORS ));
+ pNames[3] = OUString(RTL_CONSTASCII_USTRINGPARAM( FIXED_WIDTH ));
+ pNames[4] = OUString(RTL_CONSTASCII_USTRINGPARAM( FROM_ROW ));
+ pNames[5] = OUString(RTL_CONSTASCII_USTRINGPARAM( CHAR_SET ));
+ pNames[6] = OUString(RTL_CONSTASCII_USTRINGPARAM( QUOTED_AS_TEXT ));
+ pNames[7] = OUString(RTL_CONSTASCII_USTRINGPARAM( DETECT_SPECIAL_NUM ));
+ pNames[8] = OUString(RTL_CONSTASCII_USTRINGPARAM( LANGUAGE ));
aValues = aItem.GetProperties( aNames );
pProperties = aValues.getConstArray();
if( pProperties[1].hasValue() )
@@ -172,17 +174,17 @@ static void save_Separators(
Any *pProperties;
Sequence<OUString> aNames(9);
OUString* pNames = aNames.getArray();
- ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) );
-
- pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS );
- pNames[1] = OUString::createFromAscii( SEPARATORS );
- pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS );
- pNames[3] = OUString::createFromAscii( FIXED_WIDTH );
- pNames[4] = OUString::createFromAscii( FROM_ROW );
- pNames[5] = OUString::createFromAscii( CHAR_SET );
- pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT );
- pNames[7] = OUString::createFromAscii( DETECT_SPECIAL_NUM );
- pNames[8] = OUString::createFromAscii( LANGUAGE );
+ ScLinkConfigItem aItem( OUString(RTL_CONSTASCII_USTRINGPARAM( SEP_PATH )) );
+
+ pNames[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( MERGE_DELIMITERS ));
+ pNames[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( SEPARATORS ));
+ pNames[2] = OUString(RTL_CONSTASCII_USTRINGPARAM( TEXT_SEPARATORS ));
+ pNames[3] = OUString(RTL_CONSTASCII_USTRINGPARAM( FIXED_WIDTH ));
+ pNames[4] = OUString(RTL_CONSTASCII_USTRINGPARAM( FROM_ROW ));
+ pNames[5] = OUString(RTL_CONSTASCII_USTRINGPARAM( CHAR_SET ));
+ pNames[6] = OUString(RTL_CONSTASCII_USTRINGPARAM( QUOTED_AS_TEXT ));
+ pNames[7] = OUString(RTL_CONSTASCII_USTRINGPARAM( DETECT_SPECIAL_NUM ));
+ pNames[8] = OUString(RTL_CONSTASCII_USTRINGPARAM( LANGUAGE ));
aValues = aItem.GetProperties( aNames );
pProperties = aValues.getArray();
pProperties[1] <<= sFieldSeparators;
@@ -268,9 +270,9 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
}
SetText( aName );
-
- OUString sFieldSeparators;
- OUString sTextSeparators;
+ // Default options
+ OUString sFieldSeparators(RTL_CONSTASCII_USTRINGPARAM("\t"));
+ OUString sTextSeparators(mcTextSep);
bool bMergeDelimiters = false;
bool bFixedWidth = false;
bool bQuotedFieldAsText = false;
@@ -408,6 +410,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
aLbType.Disable();
// *** table box preview ***
+ maTableBox.Init();
maTableBox.SetUpdateTextHdl( LINK( this, ScImportAsciiDlg, UpdateTextHdl ) );
maTableBox.InitTypes( aLbType );
maTableBox.SetColTypeHdl( LINK( this, ScImportAsciiDlg, ColTypeHdl ) );
@@ -491,7 +494,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, String &rText )
mnStreamPos = mpDatStream->Tell();
}
- // #107455# If the file content isn't unicode, ReadUniStringLine
+ // If the file content isn't unicode, ReadUniStringLine
// may try to seek beyond the file's end and cause a CANTSEEK error
// (depending on the stream type). The error code has to be cleared,
// or further read operations (including non-unicode) will fail.
@@ -729,3 +732,5 @@ IMPL_LINK( ScImportAsciiDlg, ColTypeHdl, ScCsvTableBox*, pTableBox )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 486704ca4d12..4fa3e6868875 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,10 +69,10 @@ private:
sal_uInt16 ScDelimiterTable::GetCode( const String& rDel ) const
{
sal_Unicode nCode = 0;
- xub_StrLen i = 0;
if ( nCount >= 2 )
{
+ xub_StrLen i = 0;
while ( i<nCount )
{
if ( rDel == theDelTab.GetToken( i, cSep ) )
@@ -92,10 +93,10 @@ sal_uInt16 ScDelimiterTable::GetCode( const String& rDel ) const
String ScDelimiterTable::GetDelimiter( sal_Unicode nCode ) const
{
String aStrDel;
- xub_StrLen i = 0;
if ( nCount >= 2 )
{
+ xub_StrLen i = 0;
while ( i<nCount )
{
if ( nCode == (sal_Unicode) theDelTab.GetToken( i+1, cSep ).ToInt32() )
@@ -212,11 +213,11 @@ ScImportOptionsDlg::ScImportOptionsDlg(
SetSizePixel( aWinSize );
aCbFixed.Show();
aCbFixed.SetClickHdl( LINK( this, ScImportOptionsDlg, FixedWidthHdl ) );
- aCbFixed.Check( sal_False );
+ aCbFixed.Check( false );
aCbShown.Show();
aCbShown.Check( sal_True );
aCbQuoteAll.Show();
- aCbQuoteAll.Check( sal_False );
+ aCbQuoteAll.Check( false );
}
else
{
@@ -245,7 +246,7 @@ ScImportOptionsDlg::ScImportOptionsDlg(
//------------------------------------------------------------------------
-__EXPORT ScImportOptionsDlg::~ScImportOptionsDlg()
+ScImportOptionsDlg::~ScImportOptionsDlg()
{
delete pFieldSepTab;
delete pTextSepTab;
@@ -320,3 +321,5 @@ IMPL_LINK( ScImportOptionsDlg, FixedWidthHdl, CheckBox*, pCheckBox )
}
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 7e0b53d863cc..e0fcb9936c96 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,7 +91,7 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi
pViewData ( NULL ),
pDoc ( NULL ),
pRefInputEdit ( NULL ),
- bRefInputMode ( sal_False ),
+ bRefInputMode ( false ),
pTimer ( NULL )
{
Init( rArgSet );
@@ -113,7 +114,7 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi
//----------------------------------------------------------------------------
-__EXPORT ScSpecialFilterDlg::~ScSpecialFilterDlg()
+ScSpecialFilterDlg::~ScSpecialFilterDlg()
{
sal_uInt16 nEntries = aLbFilterArea.GetEntryCount();
sal_uInt16 i;
@@ -134,7 +135,7 @@ __EXPORT ScSpecialFilterDlg::~ScSpecialFilterDlg()
//----------------------------------------------------------------------------
-void __EXPORT ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
+void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
{
const ScQueryItem& rQueryItem = (const ScQueryItem&)
rArgSet.Get( nWhichQuery );
@@ -153,37 +154,23 @@ void __EXPORT ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
{
if(pDoc->GetChangeTrack()!=NULL) aBtnCopyResult.Disable();
- ScRangeName* pRangeNames = pDoc->GetRangeName();
- const sal_uInt16 nCount = pRangeNames ? pRangeNames->GetCount() : 0;
-
- /*
- * Aus den RangeNames des Dokumentes werden nun die
- * gemerkt, bei denen es sich um Filter-Bereiche handelt
- */
-
+ ScRangeName* pRangeNames = pDoc->GetRangeName();
aLbFilterArea.Clear();
aLbFilterArea.InsertEntry( aStrUndefined, 0 );
- if ( nCount > 0 )
+ if (!pRangeNames->empty())
{
- String aString;
- ScRangeData* pData = NULL;
- sal_uInt16 nInsert = 0;
-
- for ( sal_uInt16 i=0; i<nCount; i++ )
+ ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ sal_uInt16 nInsert = 0;
+ for (; itr != itrEnd; ++itr)
{
- pData = (ScRangeData*)(pRangeNames->At( i ));
- if ( pData )
- {
- if ( pData->HasType( RT_CRITERIA ) )
- {
- pData->GetName( aString );
- nInsert = aLbFilterArea.InsertEntry( aString );
- pData->GetSymbol( aString );
- aLbFilterArea.SetEntryData( nInsert,
- new String( aString ) );
- }
- }
+ if (!itr->HasType(RT_CRITERIA))
+ continue;
+
+ nInsert = aLbFilterArea.InsertEntry(itr->GetName());
+ rtl::OUString aSymbol;
+ itr->GetSymbol(aSymbol);
+ aLbFilterArea.SetEntryData(nInsert, new String(aSymbol));
}
}
@@ -222,8 +209,8 @@ void __EXPORT ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
aStrNoName,
aStrUndefined );
- // #35206# Spezialfilter braucht immer Spaltenkoepfe
- aBtnHeader.Check(sal_True);
+ // Spezialfilter braucht immer Spaltenkoepfe
+ aBtnHeader.Check(true);
aBtnHeader.Disable();
// Modal-Modus einschalten
@@ -235,7 +222,7 @@ void __EXPORT ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScSpecialFilterDlg::Close()
+sal_Bool ScSpecialFilterDlg::Close()
{
if (pViewData)
pViewData->GetDocShell()->CancelAutoDBRange();
@@ -329,7 +316,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
ScQueryParam theOutParam( theQueryData );
ScAddress theAdrCopy;
sal_Bool bEditInputOk = sal_True;
- sal_Bool bQueryOk = sal_False;
+ sal_Bool bQueryOk = false;
ScRange theFilterArea;
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
@@ -349,7 +336,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
ERRORBOX( STR_INVALID_TABREF );
aEdCopyArea.GrabFocus();
- bEditInputOk = sal_False;
+ bEditInputOk = false;
}
}
@@ -361,7 +348,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
{
ERRORBOX( STR_INVALID_TABREF );
aEdFilterArea.GrabFocus();
- bEditInputOk = sal_False;
+ bEditInputOk = false;
}
}
@@ -382,7 +369,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
if ( aBtnCopyResult.IsChecked() )
{
- theOutParam.bInplace = sal_False;
+ theOutParam.bInplace = false;
theOutParam.nDestTab = theAdrCopy.Tab();
theOutParam.nDestCol = theAdrCopy.Col();
theOutParam.nDestRow = theAdrCopy.Row();
@@ -416,7 +403,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
if ( bQueryOk && theOutParam.GetEntryCount() > MAXQUERY &&
theOutParam.GetEntry(MAXQUERY).bDoQuery )
{
- bQueryOk = sal_False; // zu viele
+ bQueryOk = false; // zu viele
//! andere Fehlermeldung ??
}
}
@@ -424,7 +411,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
if ( bQueryOk )
{
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
GetBindings().GetDispatcher()->Execute( FID_FILTER_OK,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
@@ -466,7 +453,7 @@ IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pTimer )
else if( bRefInputMode )
{
pRefInputEdit = NULL;
- bRefInputMode = sal_False;
+ bRefInputMode = false;
}
}
@@ -509,7 +496,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd )
if ( SCA_VALID == (nResult & SCA_VALID) )
{
String* pStr = NULL;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 i = 0;
sal_uInt16 nCount = aLbFilterArea.GetEntryCount();
@@ -533,3 +520,4 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx
index c1b541d90b40..57b75c8e2d7e 100644
--- a/sc/source/ui/dbgui/sortdlg.cxx
+++ b/sc/source/ui/dbgui/sortdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,23 +47,23 @@ ScSortDlg::ScSortDlg( Window* pParent,
SfxTabDialog( pParent,
ScResId( RID_SCDLG_SORT ),
pArgSet ),
- bIsHeaders ( sal_False ),
- bIsByRows ( sal_False )
+ bIsHeaders ( false ),
+ bIsByRows ( false )
{
#if LAYOUT_SFX_TABDIALOG_BROKEN
AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 );
AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 );
#else
- String fields = rtl::OUString::createFromAscii ("fields");
- AddTabPage( TP_FIELDS, fields, ScTabPageSortFields::Create, 0, sal_False, TAB_APPEND);
- String options = rtl::OUString::createFromAscii ("options");
- AddTabPage( TP_OPTIONS, options, ScTabPageSortOptions::Create, 0, sal_False, TAB_APPEND);
+ String fields = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fields"));
+ AddTabPage( TP_FIELDS, fields, ScTabPageSortFields::Create, 0, false, TAB_APPEND);
+ String options = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("options"));
+ AddTabPage( TP_OPTIONS, options, ScTabPageSortOptions::Create, 0, false, TAB_APPEND);
#endif
FreeResource();
}
-__EXPORT ScSortDlg::~ScSortDlg()
+ScSortDlg::~ScSortDlg()
{
}
@@ -105,3 +106,5 @@ IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
return 0;
}
//========================================================================//
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx
index 2c9cba31cd13..172e887cf51e 100644
--- a/sc/source/ui/dbgui/subtdlg.cxx
+++ b/sc/source/ui/dbgui/subtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,4 @@ IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn )
}
IMPL_LINK_INLINE_END( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/textimportoptions.cxx b/sc/source/ui/dbgui/textimportoptions.cxx
index be918d2a0fbd..5e6dff6f8209 100644
--- a/sc/source/ui/dbgui/textimportoptions.cxx
+++ b/sc/source/ui/dbgui/textimportoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: langbox.hxx,v $
- * $Revision: 1.4.242.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -119,3 +117,4 @@ IMPL_LINK( ScTextImportOptionsDlg, RadioHdl, RadioButton*, pBtn )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/textimportoptions.src b/sc/source/ui/dbgui/textimportoptions.src
index 7305986b3bec..ea0b9390228b 100644
--- a/sc/source/ui/dbgui/textimportoptions.src
+++ b/sc/source/ui/dbgui/textimportoptions.src
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: retypepassdlg.src,v $
- * $Revision: 1.1.2.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -112,4 +109,3 @@ ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS
Text [ en-US ] = "Detect special numbers (such as dates)." ;
};
};
-
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 2bf85de61a0b..6974e7d2135a 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,8 +31,6 @@
#undef SC_DLLIMPLEMENTATION
-
-
#include <vcl/msgbox.hxx>
#include <i18npool/mslangid.hxx>
#include <svtools/collatorres.hxx>
@@ -80,7 +79,6 @@ static sal_uInt16 pSortRanges[] =
* geloest. Wird eine Seite Aktiviert/Deaktiviert, so gleicht sie diese
* Datenmember mit dem eigenen Zustand ab (->Activate()/Deactivate()).
*
- * 31.01.95:
* Die Klasse SfxTabPage bietet mittlerweile ein Verfahren an:
*
* virtual sal_Bool HasExchangeSupport() const; -> return sal_True;
@@ -127,8 +125,8 @@ ScTabPageSortFields::ScTabPageSortFields( Window* pParent,
rArgSet.Get( nWhichSort )).
GetSortData() ),
nFieldCount ( 0 ),
- bHasHeader ( sal_False ),
- bSortByRows ( sal_False )
+ bHasHeader ( false ),
+ bSortByRows ( false )
{
Init();
FreeResource();
@@ -137,7 +135,7 @@ ScTabPageSortFields::ScTabPageSortFields( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScTabPageSortFields::~ScTabPageSortFields()
+ScTabPageSortFields::~ScTabPageSortFields()
{
}
@@ -179,14 +177,14 @@ void ScTabPageSortFields::Init()
//------------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTabPageSortFields::GetRanges()
+sal_uInt16* ScTabPageSortFields::GetRanges()
{
return pSortRanges;
}
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTabPageSortFields::Create( Window* pParent,
+SfxTabPage* ScTabPageSortFields::Create( Window* pParent,
const SfxItemSet& rArgSet )
{
return ( new ScTabPageSortFields( pParent, rArgSet ) );
@@ -194,7 +192,7 @@ SfxTabPage* __EXPORT ScTabPageSortFields::Create( Window* pParent,
// -----------------------------------------------------------------------
-void __EXPORT ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
+void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
{
bSortByRows = rSortData.bByRow;
bHasHeader = rSortData.bHasHeader;
@@ -262,7 +260,7 @@ void __EXPORT ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet )
+sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet )
{
ScSortParam theSortData = rSortData;
if (pDlg)
@@ -320,7 +318,7 @@ sal_Bool __EXPORT ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet )
{
theSortData.bDoSort[0] =
theSortData.bDoSort[1] =
- theSortData.bDoSort[2] = sal_False;
+ theSortData.bDoSort[2] = false;
}
rArgSet.Put( ScSortItem( SCITEM_SORTDATA, NULL, &theSortData ) );
@@ -331,9 +329,8 @@ sal_Bool __EXPORT ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet )
// -----------------------------------------------------------------------
// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !)
-// void ScTabPageSortFields::ActivatePage( const SfxItemSet& rSet )
-void __EXPORT ScTabPageSortFields::ActivatePage()
+void ScTabPageSortFields::ActivatePage()
{
if ( pDlg )
{
@@ -356,7 +353,7 @@ void __EXPORT ScTabPageSortFields::ActivatePage()
// -----------------------------------------------------------------------
-int __EXPORT ScTabPageSortFields::DeactivatePage( SfxItemSet* pSetP )
+int ScTabPageSortFields::DeactivatePage( SfxItemSet* pSetP )
{
if ( pDlg )
{
@@ -479,7 +476,7 @@ void ScTabPageSortFields::FillFieldLists()
sal_uInt16 ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField )
{
sal_uInt16 nFieldPos = 0;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for ( sal_uInt16 n=1; n<nFieldCount && !bFound; n++ )
{
@@ -563,6 +560,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent,
aBtnCase ( this, ScResId( BTN_CASESENSITIVE ) ),
aBtnHeader ( this, ScResId( BTN_LABEL ) ),
aBtnFormats ( this, ScResId( BTN_FORMATS ) ),
+ aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ),
aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ),
aLbOutPos ( this, ScResId( LB_OUTAREA ) ),
aEdOutPos ( this, ScResId( ED_OUTAREA ) ),
@@ -575,8 +573,6 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent,
aLineDirection ( this, ScResId( FL_DIRECTION ) ),
aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ),
aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ),
- aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ),
-// aFtArea ( this, ScResId( FT_AREA ) ),
//
#if ENABLE_LAYOUT_EXPERIMENTAL
#undef this
@@ -611,7 +607,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScTabPageSortOptions::~ScTabPageSortOptions()
+ScTabPageSortOptions::~ScTabPageSortOptions()
{
sal_uInt16 nEntries = aLbOutPos.GetEntryCount();
@@ -626,9 +622,6 @@ __EXPORT ScTabPageSortOptions::~ScTabPageSortOptions()
void ScTabPageSortOptions::Init()
{
- aStrAreaLabel = aFtAreaLabel.GetText();
- aStrAreaLabel.Append( (sal_Unicode) ' ' );
-
// CollatorRessource has user-visible names for sort algorithms
pColRes = new CollatorRessource();
@@ -705,10 +698,6 @@ void ScTabPageSortOptions::Init()
theArea += theDbName;
theArea += ')';
- //aFtArea.SetText( theArea );
- theArea.Insert( aStrAreaLabel, 0 );
- aFtAreaLabel.SetText( theArea );
-
aBtnHeader.SetText( aStrColLabel );
}
@@ -716,13 +705,13 @@ void ScTabPageSortOptions::Init()
// get available languages
- aLbLanguage.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, sal_False );
+ aLbLanguage.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, false );
aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM );
}
//------------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTabPageSortOptions::GetRanges()
+sal_uInt16* ScTabPageSortOptions::GetRanges()
{
return pSortRanges;
}
@@ -732,7 +721,7 @@ sal_uInt16* __EXPORT ScTabPageSortOptions::GetRanges()
#if ENABLE_LAYOUT_EXPERIMENTAL
#undef SfxTabPage
#endif /* ENABLE_LAYOUT_EXPERIMENTAL */
-SfxTabPage* __EXPORT ScTabPageSortOptions::Create(
+SfxTabPage* ScTabPageSortOptions::Create(
Window* pParent,
const SfxItemSet& rArgSet )
{
@@ -741,7 +730,7 @@ SfxTabPage* __EXPORT ScTabPageSortOptions::Create(
// -----------------------------------------------------------------------
-void __EXPORT ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
+void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
{
if ( rSortData.bUserDef )
{
@@ -751,14 +740,15 @@ void __EXPORT ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
}
else
{
- aBtnSortUser.Check( sal_False );
+ aBtnSortUser.Check( false );
aLbSortUser.Disable();
aLbSortUser.SelectEntryPos( 0 );
}
- aBtnCase.Check ( rSortData.bCaseSens );
- aBtnFormats.Check ( rSortData.bIncludePattern );
- aBtnHeader.Check ( rSortData.bHasHeader );
+ aBtnCase.Check ( rSortData.bCaseSens );
+ aBtnFormats.Check ( rSortData.bIncludePattern );
+ aBtnHeader.Check ( rSortData.bHasHeader );
+ aBtnNaturalSort.Check ( rSortData.bNaturalSort );
if ( rSortData.bByRow )
{
@@ -801,7 +791,7 @@ void __EXPORT ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
}
else
{
- aBtnCopyResult.Check( sal_False );
+ aBtnCopyResult.Check( false );
aLbOutPos.Disable();
aEdOutPos.Disable();
aEdOutPos.SetText( EMPTY_STRING );
@@ -810,7 +800,7 @@ void __EXPORT ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
+sal_Bool ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
{
ScSortParam theSortData = rSortData;
if (pDlg)
@@ -824,6 +814,7 @@ sal_Bool __EXPORT ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
theSortData.bByRow = aBtnTopDown.IsChecked();
theSortData.bHasHeader = aBtnHeader.IsChecked();
theSortData.bCaseSens = aBtnCase.IsChecked();
+ theSortData.bNaturalSort = aBtnNaturalSort.IsChecked();
theSortData.bIncludePattern = aBtnFormats.IsChecked();
theSortData.bInplace = !aBtnCopyResult.IsChecked();
theSortData.nDestCol = theOutPos.Col();
@@ -858,8 +849,7 @@ sal_Bool __EXPORT ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
// -----------------------------------------------------------------------
// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !)
-// void ScTabPageSortOptions::ActivatePage( const SfxItemSet& rSet )
-void __EXPORT ScTabPageSortOptions::ActivatePage()
+void ScTabPageSortOptions::ActivatePage()
{
if ( pDlg )
{
@@ -882,7 +872,7 @@ void __EXPORT ScTabPageSortOptions::ActivatePage()
// -----------------------------------------------------------------------
-int __EXPORT ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP )
+int ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP )
{
sal_Bool bPosInputOk = sal_True;
@@ -1018,7 +1008,7 @@ IMPL_LINK( ScTabPageSortOptions, SortDirHdl, RadioButton *, pBtn )
// -----------------------------------------------------------------------
-void __EXPORT ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd )
+void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd )
{
if ( pEd == &aEdOutPos )
{
@@ -1028,7 +1018,7 @@ void __EXPORT ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd )
if ( SCA_VALID == (nResult & SCA_VALID) )
{
String* pStr = NULL;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 i = 0;
sal_uInt16 nCount = aLbOutPos.GetEntryCount();
@@ -1050,7 +1040,7 @@ void __EXPORT ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd )
IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG )
{
- aLbAlgorithm.SetUpdateMode( sal_False );
+ aLbAlgorithm.SetUpdateMode( false );
aLbAlgorithm.Clear();
LanguageType eLang = aLbLanguage.GetSelectLanguage();
@@ -1059,8 +1049,8 @@ IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG )
// for LANGUAGE_SYSTEM no algorithm can be selected because
// it wouldn't necessarily exist for other languages
// -> leave list box empty if LANGUAGE_SYSTEM is selected
- aFtAlgorithm.Enable( sal_False ); // nothing to select
- aLbAlgorithm.Enable( sal_False ); // nothing to select
+ aFtAlgorithm.Enable( false ); // nothing to select
+ aLbAlgorithm.Enable( false ); // nothing to select
}
else
{
@@ -1085,3 +1075,4 @@ IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index d2f4db3cde07..d27dae46011e 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,8 +31,6 @@
#undef SC_DLLIMPLEMENTATION
-
-
#include "scitems.hxx"
#include "uiitems.hxx"
#include "global.hxx"
@@ -62,7 +61,6 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
: SfxTabPage ( pParent,
ScResId( nResId ),
rArgSet ),
- //
aFtGroup ( this, ScResId( FT_GROUP ) ),
aLbGroup ( this, ScResId( LB_GROUP ) ),
aFtColumns ( this, ScResId( FT_COLUMNS ) ),
@@ -71,7 +69,6 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
aLbFunctions ( this, ScResId( LB_FUNCTIONS ) ),
aStrNone ( ScResId( SCSTR_NONE ) ),
aStrColumn ( ScResId( SCSTR_COLUMN ) ),
- //
pViewData ( NULL ),
pDoc ( NULL ),
nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
@@ -92,7 +89,7 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId,
// -----------------------------------------------------------------------
-__EXPORT ScTpSubTotalGroup::~ScTpSubTotalGroup()
+ScTpSubTotalGroup::~ScTpSubTotalGroup()
{
sal_uInt16 nCount = (sal_uInt16)aLbColumns.GetEntryCount();
@@ -133,7 +130,7 @@ void ScTpSubTotalGroup::Init()
//------------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTpSubTotalGroup::GetRanges()
+sal_uInt16* ScTpSubTotalGroup::GetRanges()
{
return pSubTotalsRanges;
}
@@ -148,16 +145,16 @@ sal_Bool ScTpSubTotalGroup::DoReset( sal_uInt16 nGroupNo,
DBG_ASSERT( (nGroupNo<=3) && (nGroupNo>0), "Invalid group" );
if ( (nGroupNo > 3) || (nGroupNo == 0) )
- return sal_False;
+ return false;
else
nGroupIdx = nGroupNo-1;
//----------------------------------------------------------
- // #79058# first we have to clear the listboxes...
+ // first we have to clear the listboxes...
for ( sal_uInt16 nLbEntry = 0; nLbEntry < aLbColumns.GetEntryCount(); ++nLbEntry )
{
- aLbColumns.CheckEntryPos( nLbEntry, sal_False );
+ aLbColumns.CheckEntryPos( nLbEntry, false );
*((sal_uInt16*)aLbColumns.GetEntryData( nLbEntry )) = 0;
}
aLbFunctions.SelectEntryPos( 0 );
@@ -214,7 +211,7 @@ sal_Bool ScTpSubTotalGroup::DoFillItemSet( sal_uInt16 nGroupNo,
|| (aLbColumns.GetEntryCount() == 0)
|| (aLbFunctions.GetEntryCount() == 0)
)
- return sal_False;
+ return false;
else
nGroupIdx = nGroupNo-1;
@@ -325,7 +322,7 @@ void ScTpSubTotalGroup::FillListBoxes()
sal_uInt16 ScTpSubTotalGroup::GetFieldSelPos( SCCOL nField )
{
sal_uInt16 nFieldPos = 0;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for ( sal_uInt16 n=0; n<nFieldCount && !bFound; n++ )
{
@@ -358,7 +355,7 @@ ScSubTotalFunc ScTpSubTotalGroup::LbPosToFunc( sal_uInt16 nPos )
case 9: return SUBTOTAL_FUNC_VAR;
case 10: return SUBTOTAL_FUNC_VARP;
default:
- DBG_ERROR( "ScTpSubTotalGroup::LbPosToFunc" );
+ OSL_FAIL( "ScTpSubTotalGroup::LbPosToFunc" );
return SUBTOTAL_FUNC_NONE;
}
}
@@ -382,7 +379,7 @@ sal_uInt16 ScTpSubTotalGroup::FuncToLbPos( ScSubTotalFunc eFunc )
case SUBTOTAL_FUNC_VAR: return 9;
case SUBTOTAL_FUNC_VARP: return 10;
default:
- DBG_ERROR( "ScTpSubTotalGroup::FuncToLbPos" );
+ OSL_FAIL( "ScTpSubTotalGroup::FuncToLbPos" );
return 0;
}
}
@@ -411,8 +408,7 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, ListBox *, pLb )
else if ( pLb == &aLbFunctions )
{
*pFunction = nFunction;
-// aLbColumns.CheckEntryPos( nColumn, (nFunction != 0) );//XXX
- aLbColumns.CheckEntryPos( nColumn, sal_True );
+ aLbColumns.CheckEntryPos( nColumn, true );
}
}
return 0;
@@ -438,19 +434,19 @@ IMPL_LINK( ScTpSubTotalGroup, CheckHdl, ListBox *, pLb )
//========================================================================
// Abgeleitete Gruppen-TabPages:
-SfxTabPage* __EXPORT ScTpSubTotalGroup1::Create( Window* pParent,
+SfxTabPage* ScTpSubTotalGroup1::Create( Window* pParent,
const SfxItemSet& rArgSet )
{ return ( new ScTpSubTotalGroup1( pParent, rArgSet ) ); }
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTpSubTotalGroup2::Create( Window* pParent,
+SfxTabPage* ScTpSubTotalGroup2::Create( Window* pParent,
const SfxItemSet& rArgSet )
{ return ( new ScTpSubTotalGroup2( pParent, rArgSet ) ); }
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTpSubTotalGroup3::Create( Window* pParent,
+SfxTabPage* ScTpSubTotalGroup3::Create( Window* pParent,
const SfxItemSet& rArgSet )
{ return ( new ScTpSubTotalGroup3( pParent, rArgSet ) ); }
@@ -472,25 +468,17 @@ ScTpSubTotalGroup3::ScTpSubTotalGroup3( Window* pParent, const SfxItemSet& rArgS
#define RESET(i) (ScTpSubTotalGroup::DoReset( (i), rArgSet ))
-
-void __EXPORT ScTpSubTotalGroup1::Reset( const SfxItemSet& rArgSet ) { RESET(1); }
-
-void __EXPORT ScTpSubTotalGroup2::Reset( const SfxItemSet& rArgSet ) { RESET(2); }
-
-void __EXPORT ScTpSubTotalGroup3::Reset( const SfxItemSet& rArgSet ) { RESET(3); }
-
+void ScTpSubTotalGroup1::Reset( const SfxItemSet& rArgSet ) { RESET(1); }
+void ScTpSubTotalGroup2::Reset( const SfxItemSet& rArgSet ) { RESET(2); }
+void ScTpSubTotalGroup3::Reset( const SfxItemSet& rArgSet ) { RESET(3); }
#undef RESET
// -----------------------------------------------------------------------
#define FILLSET(i) (ScTpSubTotalGroup::DoFillItemSet( (i), rArgSet ))
-
-sal_Bool __EXPORT ScTpSubTotalGroup1::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(1); }
-
-sal_Bool __EXPORT ScTpSubTotalGroup2::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(2); }
-
-sal_Bool __EXPORT ScTpSubTotalGroup3::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(3); }
-
+sal_Bool ScTpSubTotalGroup1::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(1); }
+sal_Bool ScTpSubTotalGroup2::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(2); }
+sal_Bool ScTpSubTotalGroup3::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(3); }
#undef FILL
//========================================================================
@@ -502,7 +490,6 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( Window* pParent,
: SfxTabPage ( pParent,
ScResId( RID_SCPAGE_SUBT_OPTIONS ),
rArgSet ),
- //
aFlGroup ( this, ScResId( FL_GROUP ) ),
aBtnPagebreak ( this, ScResId( BTN_PAGEBREAK ) ),
aBtnCase ( this, ScResId( BTN_CASE ) ),
@@ -513,7 +500,6 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( Window* pParent,
aBtnFormats ( this, ScResId( BTN_FORMATS ) ),
aBtnUserDef ( this, ScResId( BTN_USERDEF ) ),
aLbUserDef ( this, ScResId( LB_USERDEF ) ),
- //
pViewData ( NULL ),
pDoc ( NULL ),
nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
@@ -530,7 +516,7 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScTpSubTotalOptions::~ScTpSubTotalOptions()
+ScTpSubTotalOptions::~ScTpSubTotalOptions()
{
}
@@ -554,7 +540,7 @@ void ScTpSubTotalOptions::Init()
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTpSubTotalOptions::Create( Window* pParent,
+SfxTabPage* ScTpSubTotalOptions::Create( Window* pParent,
const SfxItemSet& rArgSet )
{
return ( new ScTpSubTotalOptions( pParent, rArgSet ) );
@@ -562,7 +548,7 @@ SfxTabPage* __EXPORT ScTpSubTotalOptions::Create( Window* pParent
// -----------------------------------------------------------------------
-void __EXPORT ScTpSubTotalOptions::Reset( const SfxItemSet& /* rArgSet */ )
+void ScTpSubTotalOptions::Reset( const SfxItemSet& /* rArgSet */ )
{
aBtnPagebreak.Check ( rSubTotalData.bPagebreak );
aBtnCase.Check ( rSubTotalData.bCaseSens );
@@ -579,7 +565,7 @@ void __EXPORT ScTpSubTotalOptions::Reset( const SfxItemSet& /* rArgSet */ )
}
else
{
- aBtnUserDef.Check( sal_False );
+ aBtnUserDef.Check( false );
aLbUserDef.Disable();
aLbUserDef.SelectEntryPos( 0 );
}
@@ -589,7 +575,7 @@ void __EXPORT ScTpSubTotalOptions::Reset( const SfxItemSet& /* rArgSet */ )
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScTpSubTotalOptions::FillItemSet( SfxItemSet& rArgSet )
+sal_Bool ScTpSubTotalOptions::FillItemSet( SfxItemSet& rArgSet )
{
ScSubTotalParam theSubTotalData; // auslesen, wenn schon teilweise gefuellt
SfxTabDialog* pDlg = GetTabDialog();
@@ -675,15 +661,16 @@ IMPL_LINK( ScTpSubTotalOptions, CheckHdl, CheckBox *, pBox )
return 0;
}
-__EXPORT ScTpSubTotalGroup1::~ScTpSubTotalGroup1()
+ScTpSubTotalGroup1::~ScTpSubTotalGroup1()
{
}
-__EXPORT ScTpSubTotalGroup2::~ScTpSubTotalGroup2()
+ScTpSubTotalGroup2::~ScTpSubTotalGroup2()
{
}
-__EXPORT ScTpSubTotalGroup3::~ScTpSubTotalGroup3()
+ScTpSubTotalGroup3::~ScTpSubTotalGroup3()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 8207d18c5709..fdfe24ba26e0 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,13 +50,13 @@
#include "validate.hrc"
#include "validate.hxx"
#include "compiler.hxx"
-#include "formula/opcode.hxx" //CHINA001
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+#include "formula/opcode.hxx"
+
+// cell range picker
#include "tabvwsh.hxx"
#include <sfx2/viewfrm.hxx>
#include <sfx2/childwin.hxx>
#include "reffact.hxx"
-//-->Added by PengYunQuan for Validity Cell Range Picker
// ============================================================================
@@ -69,9 +70,6 @@ static sal_uInt16 pValueRanges[] =
// ============================================================================
-//<!--Modified by PengYunQuan for Validity Cell Range Picker
-//ScValidationDlg::ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet ) :
-// SfxTabDialog( pParent, ScResId( TAB_DLG_VALIDATION ), pArgSet )
ScValidationDlg::ScValidationDlg( Window* pParent,
const SfxItemSet* pArgSet,
ScTabViewShell *pTabViewSh,
@@ -81,7 +79,6 @@ ScValidationDlg::ScValidationDlg( Window* pParent,
m_bOwnRefHdlr( false ),
m_pTabVwSh( pTabViewSh ),
m_bRefInputting( false )
-//-->Modified by PengYunQuan for Validity Cell Range Picker
{
AddTabPage( TP_VALIDATION_VALUES, ScTPValidationValue::Create, 0 );
AddTabPage( TP_VALIDATION_INPUTHELP, ScTPValidationHelp::Create, 0 );
@@ -89,20 +86,18 @@ ScValidationDlg::ScValidationDlg( Window* pParent,
FreeResource();
}
-//<!--Added by PengYunQuan for Validity Cell Range Picker
void ScTPValidationValue::SetReferenceHdl( const ScRange&rRange , ScDocument* pDoc )
{
if ( rRange.aStart != rRange.aEnd )
if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
if( m_pRefEdit )
- pValidationDlg/*->GetRefHandler()*/->RefInputStart( m_pRefEdit );
+ pValidationDlg->RefInputStart( m_pRefEdit );
if ( m_pRefEdit )
{
String aStr;
rRange.Format( aStr, SCR_ABS_3D, pDoc );
m_pRefEdit->SetRefString( aStr );
- //m_pRefEdit->SetRefString( rRange.aStart != rRange.aEnd ? aStr : String::CreateFromAscii("=").Append( aStr ) );
}
}
@@ -113,11 +108,11 @@ void ScTPValidationValue:: SetActiveHdl()
if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
if( m_pRefEdit )
{
- pValidationDlg/*->GetRefHandler()*/->RefInputDone();
+ pValidationDlg->RefInputDone();
}
}
-void ScTPValidationValue::RefInputStartPreHdl( ScRefEdit* pEdit, ScRefButton* pButton )
+void ScTPValidationValue::RefInputStartPreHdl( formula::RefEdit* pEdit, formula::RefButton* pButton )
{
if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
{
@@ -150,11 +145,9 @@ void ScTPValidationValue::RefInputDonePreHdl()
m_pRefEdit->SetParent( this );
m_btnRef.SetParent( m_pRefEdit ); //if Edit SetParent but button not, the tab order will be incorrect, need button to setparent to anthor window and restore parent later in order to restore the tab order
-// aExample1.SetParent( m_pRefEdit ); // the aExample1's child order will affect acc key
}
if( m_btnRef.GetParent()!=this ) m_btnRef.SetParent( this );
-// if( aExample1.GetParent()!=this ) aExample1.SetParent( this );
}
void ScTPValidationValue::RefInputDonePostHdl()
@@ -175,14 +168,11 @@ sal_Bool ScValidationDlg::Close()
return ScValidationDlgBase::Close();
}
-//-->Added by PengYunQuan for Validity Cell Range Picker
ScValidationDlg::~ScValidationDlg()
{
- //<!--Added by PengYunQuan for Validity Cell Range Picker
if( m_bOwnRefHdlr )
- RemoveRefDlg( sal_False );
- //-->Added by PengYunQuan for Validity Cell Range Picker
+ RemoveRefDlg( false );
}
@@ -234,7 +224,7 @@ sal_uInt16 lclGetPosFromCondMode( ScConditionMode eCondMode )
sal_uInt16 nLbPos = SC_VALIDDLG_DATA_EQUAL;
switch( eCondMode )
{
- case SC_COND_NONE: // #111771# may occur in old XML files after Excel import
+ case SC_COND_NONE: // may occur in old XML files after Excel import
case SC_COND_EQUAL: nLbPos = SC_VALIDDLG_DATA_EQUAL; break;
case SC_COND_LESS: nLbPos = SC_VALIDDLG_DATA_LESS; break;
case SC_COND_GREATER: nLbPos = SC_VALIDDLG_DATA_GREATER; break;
@@ -343,21 +333,16 @@ ScTPValidationValue::ScTPValidationValue( Window* pParent, const SfxItemSet& rAr
maStrValue( ScResId( SCSTR_VALID_VALUE ) ),
maStrRange( ScResId( SCSTR_VALID_RANGE ) ),
maStrList ( ScResId( SCSTR_VALID_LIST ) ),
-//<!--Added by PengYunQuan for Validity Cell Range Picker
- m_btnRef( this, ScResId( RB_VALIDITY_REF ) )
-//-->Added by PengYunQuan for Validity Cell Range Picker
+ m_btnRef( this, ScResId( RB_VALIDITY_REF ) )
{
Init();
FreeResource();
// list separator in formulas
- //CHINA001 const String& rListSep = ScCompiler::pSymbolTableNative[ ocSep ];
- String aListSep = ::GetScCompilerNativeSymbol( ocSep ); //CHINA001
+ String aListSep = ::ScCompiler::GetNativeSymbol( ocSep );
DBG_ASSERT( aListSep.Len() == 1, "ScTPValidationValue::ScTPValidationValue - list separator error" );
mcFmlaSep = aListSep.Len() ? aListSep.GetChar( 0 ) : ';';
- //<!--Added by PengYunQuan for Validity Cell Range Picker
- m_btnRef.Hide();
- //-->Added by PengYunQuan for Validity Cell Range Picker
+ m_btnRef.Hide(); // cell range picker
}
ScTPValidationValue::~ScTPValidationValue()
@@ -369,13 +354,13 @@ void ScTPValidationValue::Init()
maLbAllow.SetSelectHdl( LINK( this, ScTPValidationValue, SelectHdl ) );
maLbValue.SetSelectHdl( LINK( this, ScTPValidationValue, SelectHdl ) );
maCbShow.SetClickHdl( LINK( this, ScTPValidationValue, CheckHdl ) );
- //<!--Added by PengYunQuan for Validity Cell Range Picker
+
+ // cell range picker
maEdMin.SetGetFocusHdl( LINK( this, ScTPValidationValue, EditSetFocusHdl ) );
maEdMin.SetLoseFocusHdl( LINK( this, ScTPValidationValue, KillFocusHdl ) );
maEdMax.SetGetFocusHdl( LINK( this, ScTPValidationValue, EditSetFocusHdl ) );
m_btnRef.SetLoseFocusHdl( LINK( this, ScTPValidationValue, KillFocusHdl ) );
maEdMax.SetLoseFocusHdl( LINK( this, ScTPValidationValue, KillFocusHdl ) );
- //-->Added by PengYunQuan for Validity Cell Range Picker
maLbAllow.SelectEntryPos( SC_VALIDDLG_ALLOW_ANY );
maLbValue.SelectEntryPos( SC_VALIDDLG_DATA_EQUAL );
@@ -493,7 +478,6 @@ void ScTPValidationValue::SetSecondFormula( const String& rFmlaStr )
maEdMax.SetText( rFmlaStr );
}
-//<!--Added by PengYunQuan for Validity Cell Range Picker
ScValidationDlg * ScTPValidationValue::GetValidationDlg()
{
if( Window *pParent = GetParent() )
@@ -503,6 +487,7 @@ ScValidationDlg * ScTPValidationValue::GetValidationDlg()
}while ( NULL != ( pParent = pParent->GetParent() ) );
return NULL;
}
+
void ScTPValidationValue::SetupRefDlg()
{
if( ScValidationDlg *pValidationDlg = GetValidationDlg() )
@@ -585,7 +570,7 @@ void ScTPValidationValue::TidyListBoxes()
if ( pWnd )
{
- for ( std::list<Window*>::iterator i = alstOrder.begin(); i!=alstOrder.end(); i++ )
+ for ( std::list<Window*>::iterator i = alstOrder.begin(); i!=alstOrder.end(); ++i )
{
Window *pParent = (*i)->GetParent();
(*i)->SetParent( pWnd );
@@ -595,7 +580,7 @@ void ScTPValidationValue::TidyListBoxes()
}
}
-IMPL_LINK( ScTPValidationValue, EditSetFocusHdl, Edit *, /*pEdit*/ )
+IMPL_LINK( ScTPValidationValue, EditSetFocusHdl, Edit *, EMPTYARG)
{
sal_uInt16 nPos=maLbAllow.GetSelectEntryPos();
@@ -619,7 +604,6 @@ IMPL_LINK( ScTPValidationValue, KillFocusHdl, Window *, pWnd )
return 0;
}
-//-->Added by PengYunQuan for Validity Cell Range Picker
// ----------------------------------------------------------------------------
@@ -630,7 +614,7 @@ IMPL_LINK( ScTPValidationValue, SelectHdl, ListBox*, EMPTYARG )
bool bRange = (nLbPos == SC_VALIDDLG_ALLOW_RANGE);
bool bList = (nLbPos == SC_VALIDDLG_ALLOW_LIST);
- maCbAllow.Enable( bEnable ); // Leerzellen
+ maCbAllow.Enable( bEnable ); // Empty cell
maFtValue.Enable( bEnable );
maLbValue.Enable( bEnable );
maFtMin.Enable( bEnable );
@@ -673,9 +657,7 @@ IMPL_LINK( ScTPValidationValue, SelectHdl, ListBox*, EMPTYARG )
maFtMax.Show( bShowMax );
maEdMax.Show( bShowMax );
maFtHint.Show( bRange );
- //<!--Added by PengYunQuan for Validity Cell Range Picker
- m_btnRef.Show( bRange );
- //-->Added by PengYunQuan for Validity Cell Range Picker
+ m_btnRef.Show( bRange ); // cell range picker
return 0;
}
@@ -711,7 +693,7 @@ ScTPValidationHelp::ScTPValidationHelp( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScTPValidationHelp::~ScTPValidationHelp()
+ScTPValidationHelp::~ScTPValidationHelp()
{
}
@@ -719,21 +701,19 @@ __EXPORT ScTPValidationHelp::~ScTPValidationHelp()
void ScTPValidationHelp::Init()
{
- //aLb.SetSelectHdl( LINK( this, ScTPValidationHelp, SelectHdl ) );
-
- aTsbHelp.EnableTriState( sal_False );
+ aTsbHelp.EnableTriState( false );
}
//------------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTPValidationHelp::GetRanges()
+sal_uInt16* ScTPValidationHelp::GetRanges()
{
return pValueRanges;
}
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTPValidationHelp::Create( Window* pParent,
+SfxTabPage* ScTPValidationHelp::Create( Window* pParent,
const SfxItemSet& rArgSet )
{
return ( new ScTPValidationHelp( pParent, rArgSet ) );
@@ -741,7 +721,7 @@ SfxTabPage* __EXPORT ScTPValidationHelp::Create( Window* pParent,
// -----------------------------------------------------------------------
-void __EXPORT ScTPValidationHelp::Reset( const SfxItemSet& rArgSet )
+void ScTPValidationHelp::Reset( const SfxItemSet& rArgSet )
{
const SfxPoolItem* pItem;
@@ -763,7 +743,7 @@ void __EXPORT ScTPValidationHelp::Reset( const SfxItemSet& rArgSet )
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScTPValidationHelp::FillItemSet( SfxItemSet& rArgSet )
+sal_Bool ScTPValidationHelp::FillItemSet( SfxItemSet& rArgSet )
{
rArgSet.Put( SfxBoolItem( FID_VALID_SHOWHELP, aTsbHelp.GetState() == STATE_CHECK ) );
rArgSet.Put( SfxStringItem( FID_VALID_HELPTITLE, aEdtTitle.GetText() ) );
@@ -800,7 +780,7 @@ ScTPValidationError::ScTPValidationError( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScTPValidationError::~ScTPValidationError()
+ScTPValidationError::~ScTPValidationError()
{
}
@@ -812,21 +792,21 @@ void ScTPValidationError::Init()
aBtnSearch.SetClickHdl( LINK( this, ScTPValidationError, ClickSearchHdl ) );
aLbAction.SelectEntryPos( 0 );
- aTsbShow.EnableTriState( sal_False );
+ aTsbShow.EnableTriState( false );
SelectActionHdl( NULL );
}
//------------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTPValidationError::GetRanges()
+sal_uInt16* ScTPValidationError::GetRanges()
{
return pValueRanges;
}
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTPValidationError::Create( Window* pParent,
+SfxTabPage* ScTPValidationError::Create( Window* pParent,
const SfxItemSet& rArgSet )
{
return ( new ScTPValidationError( pParent, rArgSet ) );
@@ -834,14 +814,14 @@ SfxTabPage* __EXPORT ScTPValidationError::Create( Window* pParent,
// -----------------------------------------------------------------------
-void __EXPORT ScTPValidationError::Reset( const SfxItemSet& rArgSet )
+void ScTPValidationError::Reset( const SfxItemSet& rArgSet )
{
const SfxPoolItem* pItem;
if ( rArgSet.GetItemState( FID_VALID_SHOWERR, sal_True, &pItem ) == SFX_ITEM_SET )
aTsbShow.SetState( ((const SfxBoolItem*)pItem)->GetValue() ? STATE_CHECK : STATE_NOCHECK );
else
- aTsbShow.SetState( STATE_CHECK ); // #111720# check by default
+ aTsbShow.SetState( STATE_CHECK ); // check by default
if ( rArgSet.GetItemState( FID_VALID_ERRSTYLE, sal_True, &pItem ) == SFX_ITEM_SET )
aLbAction.SelectEntryPos( ((const SfxAllEnumItem*)pItem)->GetValue() );
@@ -863,7 +843,7 @@ void __EXPORT ScTPValidationError::Reset( const SfxItemSet& rArgSet )
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScTPValidationError::FillItemSet( SfxItemSet& rArgSet )
+sal_Bool ScTPValidationError::FillItemSet( SfxItemSet& rArgSet )
{
rArgSet.Put( SfxBoolItem( FID_VALID_SHOWERR, aTsbShow.GetState() == STATE_CHECK ) );
rArgSet.Put( SfxAllEnumItem( FID_VALID_ERRSTYLE, aLbAction.GetSelectEntryPos() ) );
@@ -908,7 +888,6 @@ IMPL_LINK( ScTPValidationError, ClickSearchHdl, PushButton*, EMPTYARG )
return( 0L );
}
-//<!--Added by PengYunQuan for Validity Cell Range Picker
bool ScValidationDlg::EnterRefStatus()
{
ScTabViewShell *pTabViewShell = GetTabViewShell();
@@ -921,7 +900,7 @@ bool ScValidationDlg::EnterRefStatus()
if ( pWnd && pWnd->GetWindow()!= this ) pWnd = NULL;
- SC_MOD()->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ SC_MOD()->SetRefDialog( nId, pWnd ? false : sal_True );
return true;
}
@@ -934,7 +913,6 @@ bool ScValidationDlg::LeaveRefStatus()
sal_uInt16 nId = SLOTID;
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
- //SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
if ( pViewFrm->GetChildWindow( nId ) )
{
DoClose( nId );
@@ -947,8 +925,8 @@ bool ScValidationDlg::SetupRefDlg()
if ( m_bOwnRefHdlr ) return false;
if( EnterRefMode() )
{
- SetModal( sal_False );
- return /*SetChkShell( GetDocShell() ),*/ m_bOwnRefHdlr = true && EnterRefStatus();
+ SetModal( false );
+ return m_bOwnRefHdlr = true && EnterRefStatus();
}
return false;
@@ -987,14 +965,12 @@ bool ScValidationDlg::RemoveRefDlg( sal_Bool bRestoreModal /* = sal_True */ )
return true;
}
-//TYPEINIT1( ScTPValidationValue, SfxTabPage )
-
void ScTPValidationValue::ScRefButtonEx::Click()
{
if( ScTPValidationValue *pParent = dynamic_cast< ScTPValidationValue*>( GetParent() ) )
pParent->OnClick( this );
- ScRefButton::Click();
+ formula::RefButton::Click();
}
void ScTPValidationValue::OnClick( Button *pBtn )
@@ -1010,7 +986,7 @@ sal_Bool ScValidationDlg::IsChildFocus()
if( pWin == this )
return sal_True;
- return sal_False;
+ return false;
}
@@ -1018,4 +994,5 @@ bool ScValidationDlg::IsAlive()
{
return SC_MOD()->IsAliveRefDlg( SLOTID, this );
}
-//-->Added by PengYunQuan for Validity Cell Range Picker
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/validate.src b/sc/source/ui/dbgui/validate.src
index 9f4b27fb9967..62e7f597ca25 100644
--- a/sc/source/ui/dbgui/validate.src
+++ b/sc/source/ui/dbgui/validate.src
@@ -27,7 +27,6 @@
#include "validate.hrc"
-
TabDialog TAB_DLG_VALIDATION
{
OutputSize = TRUE ;
@@ -62,9 +61,9 @@ TabDialog TAB_DLG_VALIDATION
};
Text [ en-US ] = "Validity" ;
};
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+
#define OFFSET_X 30
-//-->Added by PengYunQuan for Validity Cell Range Picker
+
TabPage TP_VALIDATION_VALUES
{
HelpID = "sc:TabPage:TP_VALIDATION_VALUES";
@@ -75,20 +74,14 @@ TabPage TP_VALIDATION_VALUES
FixedText FT_ALLOW
{
Pos = MAP_APPFONT ( 6 , 16 ) ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Size = MAP_APPFONT ( 70 , 8 ) ;
Size = MAP_APPFONT ( 70 - OFFSET_X , 8 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Text [ en-US ] = "~Allow" ;
};
ListBox LB_ALLOW
{
HelpID = "sc:ListBox:TP_VALIDATION_VALUES:LB_ALLOW";
Border = TRUE ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 80 , 14 ) ;
Pos = MAP_APPFONT ( 80 - OFFSET_X , 14 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Size = MAP_APPFONT ( 90 , 80 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
@@ -107,20 +100,14 @@ TabPage TP_VALIDATION_VALUES
FixedText FT_VALUE
{
Pos = MAP_APPFONT ( 6 , 58 ) ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Size = MAP_APPFONT ( 70 , 8 ) ;
Size = MAP_APPFONT ( 70 - OFFSET_X , 8 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Text [ en-US ] = "~Data" ;
};
ListBox LB_VALUE
{
HelpID = "sc:ListBox:TP_VALIDATION_VALUES:LB_VALUE";
Border = TRUE ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 80 , 56 ) ;
Pos = MAP_APPFONT ( 80 - OFFSET_X , 56 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Size = MAP_APPFONT ( 90 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
@@ -140,87 +127,57 @@ TabPage TP_VALIDATION_VALUES
FixedText FT_MIN
{
Pos = MAP_APPFONT ( 6 , 76 ) ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Size = MAP_APPFONT ( 70 , 8 ) ;
Size = MAP_APPFONT ( 70 - OFFSET_X , 8 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Text [ en-US ] = "~Minimum" ;
};
Edit EDT_MIN
{
HelpID = "sc:Edit:TP_VALIDATION_VALUES:EDT_MIN";
Border = TRUE ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 80 , 74 ) ;
- //Size = MAP_APPFONT ( 174 , 12 ) ;
Pos = MAP_APPFONT ( 80 - OFFSET_X , 74 ) ;
Size = MAP_APPFONT ( 90 , 12 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
TabStop = TRUE ;
};
MultiLineEdit EDT_LIST
{
HelpID = "sc:MultiLineEdit:TP_VALIDATION_VALUES:EDT_LIST";
Border = TRUE ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 80 , 74 ) ;
- //Size = MAP_APPFONT ( 174 , 105 ) ;
Pos = MAP_APPFONT ( 80 - OFFSET_X , 74 ) ;
Size = MAP_APPFONT ( 174 + OFFSET_X , 105 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
VScroll = TRUE ;
IgnoreTab = TRUE ;
};
FixedText FT_MAX
{
Pos = MAP_APPFONT ( 6 , 92 ) ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Size = MAP_APPFONT ( 70 , 8 ) ;
Size = MAP_APPFONT ( 70 - OFFSET_X , 8 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Text [ en-US ] = "Ma~ximum" ;
};
Edit EDT_MAX
{
HelpID = "sc:Edit:TP_VALIDATION_VALUES:EDT_MAX";
Border = TRUE ;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 80 , 90 ) ;
- //Size = MAP_APPFONT ( 174 , 12 ) ;
Pos = MAP_APPFONT ( 80 - OFFSET_X , 90 ) ;
Size = MAP_APPFONT ( 90 , 12 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
TabStop = TRUE ;
};
CheckBox TSB_ALLOW_BLANKS
{
- HelpID = "sc:CheckBox:TP_VALIDATION_VALUES:TSB_ALLOW_BLANKS";
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 80 , 30 ) ;
Pos = MAP_APPFONT ( 80 - OFFSET_X , 30 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Size = MAP_APPFONT ( 174 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Allow ~blank cells" ;
};
CheckBox CB_SHOWLIST
{
- HelpID = "sc:CheckBox:TP_VALIDATION_VALUES:CB_SHOWLIST";
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 80 , 44 ) ;
Pos = MAP_APPFONT ( 80 - OFFSET_X , 44 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Size = MAP_APPFONT ( 174 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Show selection ~list" ;
};
CheckBox CB_SORTLIST
{
- HelpID = "sc:CheckBox:TP_VALIDATION_VALUES:CB_SORTLIST";
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Pos = MAP_APPFONT ( 90 , 58 ) ;
Pos = MAP_APPFONT ( 90 - OFFSET_X , 58 ) ;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
Size = MAP_APPFONT ( 164 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Sor~t entries ascending" ;
@@ -232,7 +189,6 @@ TabPage TP_VALIDATION_VALUES
WordBreak = TRUE ;
Text [ en-US ] = "A valid source can only consist of a contiguous selection of rows and columns, or a formula that results in an area or array.";
};
- //<!--Added by PengYunQuan for Validity Cell Range Picker
ImageButton RB_VALIDITY_REF
{
HelpID = "sc:ImageButton:TP_VALIDATION_VALUES:RB_VALIDITY_REF";
@@ -241,7 +197,6 @@ TabPage TP_VALIDATION_VALUES
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Shrink" ;
};
- //-->Added by PengYunQuan for Validity Cell Range Picker
};
TabPage TP_VALIDATION_INPUTHELP
@@ -380,48 +335,3 @@ TabPage TP_VALIDATION_ERROR
};
Text [ en-US ] = "Error Alert" ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 1be8b2aa9dc0..1d51186f0c7a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,14 +53,13 @@
#include "markdata.hxx"
#include "hints.hxx"
#include "filter.hxx"
-//CHINA001 #include "linkarea.hxx" // dialog
#include "attrib.hxx" // raus, wenn ResetAttrib am Dokument
#include "patattr.hxx" // raus, wenn ResetAttrib am Dokument
#include "docpool.hxx" // raus, wenn ResetAttrib am Dokument
-#include "sc.hrc" //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include "sc.hrc"
+#include "scabstdlg.hxx"
#include "clipparam.hxx"
struct AreaLink_Impl
@@ -87,7 +87,7 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const String& rFile,
aSourceArea (rArea),
aDestArea (rDest),
bAddUndo (sal_True),
- bInCreate (sal_False),
+ bInCreate (false),
bDoInsert (sal_True)
{
DBG_ASSERT(pShell->ISA(ScDocShell), "ScAreaLink mit falscher ObjectShell");
@@ -96,29 +96,29 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const String& rFile,
SetRefreshControl( pImpl->m_pDocSh->GetDocument()->GetRefreshTimerControlAddress() );
}
-__EXPORT ScAreaLink::~ScAreaLink()
+ScAreaLink::~ScAreaLink()
{
StopRefreshTimer();
delete pImpl;
}
-void __EXPORT ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ )
+void ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ )
{
// use own dialog instead of SvBaseLink::Edit...
// DefModalDialogParent setzen, weil evtl. aus der DocShell beim ConvertFrom
// ein Optionen-Dialog kommt...
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScLinkedAreaDlg* pDlg = pFact->CreateScLinkedAreaDlg( pParent, RID_SCDLG_LINKAREA);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
pDlg->InitFromOldLink( aFileName, aFilterName, aOptions, aSourceArea, GetRefreshDelay() );
pImpl->m_pDialog = pDlg;
pDlg->StartExecuteModal( LINK( this, ScAreaLink, AreaEndEditHdl ) );
}
-void __EXPORT ScAreaLink::DataChanged( const String&,
+void ScAreaLink::DataChanged( const String&,
const ::com::sun::star::uno::Any& )
{
// bei bInCreate nichts tun, damit Update gerufen werden kann, um den Status im
@@ -139,7 +139,7 @@ void __EXPORT ScAreaLink::DataChanged( const String&,
// -> remove prefix
ScDocumentLoader::RemoveAppPrefix( aFilter );
- // #81155# dialog doesn't set area, so keep old one
+ // dialog doesn't set area, so keep old one
if ( !aArea.Len() )
{
aArea = aSourceArea;
@@ -154,7 +154,7 @@ void __EXPORT ScAreaLink::DataChanged( const String&,
}
}
-void __EXPORT ScAreaLink::Closed()
+void ScAreaLink::Closed()
{
// Verknuepfung loeschen: Undo
@@ -166,12 +166,12 @@ void __EXPORT ScAreaLink::Closed()
aFileName, aFilterName, aOptions,
aSourceArea, aDestArea, GetRefreshDelay() ) );
- bAddUndo = sal_False; // nur einmal
+ bAddUndo = false; // nur einmal
}
SCTAB nDestTab = aDestArea.aStart.Tab();
if (pDoc->IsStreamValid(nDestTab))
- pDoc->SetStreamValid(nDestTab, sal_False);
+ pDoc->SetStreamValid(nDestTab, false);
SvBaseLink::Closed();
}
@@ -205,14 +205,14 @@ sal_Bool ScAreaLink::IsEqual( const String& rFile, const String& rFilter, const
// find a range with name >rAreaName< in >pSrcDoc<, return it in >rRange<
sal_Bool ScAreaLink::FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName )
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
ScRangeName* pNames = pSrcDoc->GetRangeName();
sal_uInt16 nPos;
if (pNames) // benannte Bereiche
{
- if (pNames->SearchName( rAreaName, nPos ))
- if ( (*pNames)[nPos]->IsValidReference( rRange ) )
- bFound = sal_True;
+ const ScRangeData* p = pNames->findByName(rAreaName);
+ if (p && p->IsValidReference(rRange))
+ bFound = true;
}
if (!bFound) // Datenbankbereiche
{
@@ -225,14 +225,14 @@ sal_Bool ScAreaLink::FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const S
SCROW nRow1, nRow2;
(*pDBColl)[nPos]->GetArea(nTab,nCol1,nRow1,nCol2,nRow2);
rRange = ScRange( nCol1,nRow1,nTab, nCol2,nRow2,nTab );
- bFound = sal_True;
+ bFound = true;
}
}
if (!bFound) // direct reference (range or cell)
{
ScAddress::Details aDetails(pSrcDoc->GetAddressConvention(), 0, 0);
if ( rRange.ParseAny( rAreaName, pSrcDoc, aDetails ) & SCA_VALID )
- bFound = sal_True;
+ bFound = true;
}
return bFound;
}
@@ -245,14 +245,14 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
// Dokument laden - wie TabLink
if (!rNewFile.Len() || !rNewFilter.Len())
- return sal_False;
+ return false;
String aNewUrl( ScGlobal::GetAbsDocName( rNewFile, pImpl->m_pDocSh ) );
sal_Bool bNewUrlName = (aNewUrl != aFileName);
const SfxFilter* pFilter = pImpl->m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
if (!pFilter)
- return sal_False;
+ return false;
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
@@ -268,11 +268,11 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
if ( aOptions.Len() )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
- SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, sal_False, pFilter);
+ SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, false, pFilter);
// aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
- SfxObjectShellLock aRef = pSrcShell;
+ SfxObjectShellRef aRef = pSrcShell;
pSrcShell->DoLoad(pMed);
ScDocument* pSrcDoc = pSrcShell->GetDocument();
@@ -352,16 +352,16 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
{
pUndoDoc->InitUndo( pDoc, 0, pDoc->GetTableCount()-1 );
pDoc->CopyToDocument( 0,0,0,MAXCOL,MAXROW,MAXTAB,
- IDF_FORMULA, sal_False, pUndoDoc ); // alle Formeln
+ IDF_FORMULA, false, pUndoDoc ); // alle Formeln
}
else
pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
else // ohne Einfuegen
{
pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
}
@@ -410,7 +410,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
ScMarkData aDestMark;
aDestMark.SelectOneTable( nDestTab );
aDestMark.SetMarkArea( aNewTokenRange );
- pDoc->CopyFromClip( aNewTokenRange, aDestMark, IDF_ALL, NULL, &aClipDoc, sal_False );
+ pDoc->CopyFromClip( aNewTokenRange, aDestMark, IDF_ALL, NULL, &aClipDoc, false );
aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 );
}
}
@@ -427,7 +427,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
{
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, nDestTab, nDestTab );
- pDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, sal_False, pRedoDoc );
+ pDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoUpdateAreaLink( pImpl->m_pDocSh,
@@ -485,7 +485,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
aRef->DoClose();
- pDoc->SetInLinkUpdate( sal_False );
+ pDoc->SetInLinkUpdate( false );
if (bCanDo)
{
@@ -528,3 +528,4 @@ IMPL_LINK( ScAreaLink, AreaEndEditHdl, void*, EMPTYARG )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 305eea2618d9..bfb7c8f3c9a1 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,19 +29,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+#include <time.h>
+#include <boost/bind.hpp>
-// INCLUDE ---------------------------------------------------------------
-
-#include <time.h>
+#include "attrib.hxx"
#include "autostyl.hxx"
-
#include "docsh.hxx"
-#include "attrib.hxx"
#include "sc.hrc"
-//==================================================================
-
struct ScAutoStyleInitData
{
ScRange aRange;
@@ -62,15 +59,11 @@ struct ScAutoStyleData
nTimeout(nT), aRange(rR), aStyle(rT) {}
};
-//==================================================================
-
inline sal_uLong TimeNow() // Sekunden
{
return (sal_uLong) time(0);
}
-//==================================================================
-
ScAutoStyleList::ScAutoStyleList(ScDocShell* pShell) :
pDocSh( pShell )
{
@@ -81,89 +74,56 @@ ScAutoStyleList::ScAutoStyleList(ScDocShell* pShell) :
ScAutoStyleList::~ScAutoStyleList()
{
- sal_uLong i;
- sal_uLong nCount = aEntries.Count();
- for (i=0; i<nCount; i++)
- delete (ScAutoStyleData*) aEntries.GetObject(i);
- nCount = aInitials.Count();
- for (i=0; i<nCount; i++)
- delete (ScAutoStyleInitData*) aInitials.GetObject(i);
}
-//==================================================================
-
// initial short delay (asynchronous call)
void ScAutoStyleList::AddInitial( const ScRange& rRange, const String& rStyle1,
sal_uLong nTimeout, const String& rStyle2 )
{
- ScAutoStyleInitData* pNew =
- new ScAutoStyleInitData( rRange, rStyle1, nTimeout, rStyle2 );
- aInitials.Insert( pNew, aInitials.Count() );
+ aInitials.push_back(new ScAutoStyleInitData( rRange, rStyle1, nTimeout, rStyle2 ));
aInitTimer.Start();
}
IMPL_LINK( ScAutoStyleList, InitHdl, Timer*, EMPTYARG )
{
- sal_uLong nCount = aInitials.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ boost::ptr_vector<ScAutoStyleInitData>::iterator iter;
+ for (iter = aInitials.begin(); iter != aInitials.end(); ++iter)
{
- ScAutoStyleInitData* pData = (ScAutoStyleInitData*) aInitials.GetObject(i);
-
// apply first style immediately
- pDocSh->DoAutoStyle( pData->aRange, pData->aStyle1 );
+ pDocSh->DoAutoStyle(iter->aRange,iter->aStyle1);
// add second style to list
- if ( pData->nTimeout )
- AddEntry( pData->nTimeout, pData->aRange, pData->aStyle2 );
-
- delete pData;
+ if (iter->nTimeout)
+ AddEntry(iter->nTimeout,iter->aRange,iter->aStyle2 );
}
- aInitials.Clear();
+
+ aInitials.clear();
return 0;
}
-//==================================================================
-
void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const String& rStyle )
{
aTimer.Stop();
sal_uLong nNow = TimeNow();
- // alten Eintrag loeschen
-
- sal_uLong nCount = aEntries.Count();
- sal_uLong i;
- for (i=0; i<nCount; i++)
- {
- ScAutoStyleData* pData = (ScAutoStyleData*) aEntries.GetObject(i);
- if (pData->aRange == rRange)
- {
- delete pData;
- aEntries.Remove(i);
- --nCount;
- break; // nicht weitersuchen - es kann nur einen geben
- }
- }
+ aEntries.erase(std::remove_if(aEntries.begin(),aEntries.end(),
+ boost::bind(&ScAutoStyleData::aRange,_1) == rRange));
// Timeouts von allen Eintraegen anpassen
- if (nCount && nNow != nTimerStart)
+ if (!aEntries.empty() && nNow != nTimerStart)
{
DBG_ASSERT(nNow>nTimerStart, "Zeit laeuft rueckwaerts?");
AdjustEntries((nNow-nTimerStart)*1000);
}
// Einfuege-Position suchen
+ boost::ptr_vector<ScAutoStyleData>::iterator iter = std::find_if(aEntries.begin(),aEntries.end(),
+ boost::bind(&ScAutoStyleData::nTimeout,_1) >= nTimeout);
- sal_uLong nPos = LIST_APPEND;
- for (i=0; i<nCount && nPos == LIST_APPEND; i++)
- if (nTimeout <= ((ScAutoStyleData*) aEntries.GetObject(i))->nTimeout)
- nPos = i;
-
- ScAutoStyleData* pNew = new ScAutoStyleData( nTimeout, rRange, rStyle );
- aEntries.Insert( pNew, nPos );
+ aEntries.insert(iter,new ScAutoStyleData(nTimeout,rRange,rStyle));
// abgelaufene ausfuehren, Timer neu starten
@@ -173,26 +133,30 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
void ScAutoStyleList::AdjustEntries( sal_uLong nDiff ) // Millisekunden
{
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ boost::ptr_vector<ScAutoStyleData>::iterator iter;
+ for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
{
- ScAutoStyleData* pData = (ScAutoStyleData*) aEntries.GetObject(i);
- if ( pData->nTimeout <= nDiff )
- pData->nTimeout = 0; // abgelaufen
+ if (iter->nTimeout <= nDiff)
+ iter->nTimeout = 0; // abgelaufen
else
- pData->nTimeout -= nDiff; // weiterzaehlen
+ iter->nTimeout -= nDiff; // weiterzaehlen
}
}
void ScAutoStyleList::ExecuteEntries()
{
- ScAutoStyleData* pData;
- while ((pData = (ScAutoStyleData*) aEntries.GetObject(0)) != NULL && pData->nTimeout == 0)
+ boost::ptr_vector<ScAutoStyleData>::iterator iter;
+ for (iter = aEntries.begin(); iter != aEntries.end();)
{
- pDocSh->DoAutoStyle( pData->aRange, pData->aStyle ); //! oder Request ???
-
- delete pData;
- aEntries.Remove((sal_uLong)0);
+ if (!iter->nTimeout)
+ {
+ pDocSh->DoAutoStyle(iter->aRange,iter->aStyle);
+ iter = aEntries.erase(iter);
+ }
+ else
+ {
+ ++iter;
+ }
}
}
@@ -200,32 +164,25 @@ void ScAutoStyleList::ExecuteAllNow()
{
aTimer.Stop();
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong i=0; i<nCount; i++)
- {
- ScAutoStyleData* pData = (ScAutoStyleData*) aEntries.GetObject(i);
-
- pDocSh->DoAutoStyle( pData->aRange, pData->aStyle ); //! oder Request ???
+ boost::ptr_vector<ScAutoStyleData>::iterator iter;
+ for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
+ pDocSh->DoAutoStyle(iter->aRange,iter->aStyle);
- delete pData;
- }
- aEntries.Clear();
+ aEntries.clear();
}
void ScAutoStyleList::StartTimer( sal_uLong nNow ) // Sekunden
{
// ersten Eintrag mit Timeout != 0 suchen
+ boost::ptr_vector<ScAutoStyleData>::iterator iter = std::find_if(aEntries.begin(),aEntries.end(),
+ boost::bind(&ScAutoStyleData::nTimeout,_1) != static_cast<unsigned>(0));
- sal_uLong nPos = 0;
- ScAutoStyleData* pData;
- while ( (pData = (ScAutoStyleData*) aEntries.GetObject(nPos)) != NULL && pData->nTimeout == 0 )
- ++nPos;
-
- if (pData)
+ if (iter != aEntries.end())
{
- aTimer.SetTimeout( pData->nTimeout );
+ aTimer.SetTimeout(iter->nTimeout);
aTimer.Start();
}
+
nTimerStart = nNow;
}
@@ -242,3 +199,4 @@ IMPL_LINK( ScAutoStyleList, TimerHdl, Timer*, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index cf114cf8479e..7ff1efa3cb78 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,13 +87,13 @@ sal_Bool ScDBDocFunc::AddDBRange( const String& rName, const ScRange& rRange, sa
pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
sal_Bool bOk = pDocColl->Insert( pNew );
if ( bCompile )
- pDoc->CompileDBFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
if (!bOk)
{
delete pNew;
delete pUndoColl;
- return sal_False;
+ return false;
}
if (bUndo)
@@ -109,7 +110,7 @@ sal_Bool ScDBDocFunc::AddDBRange( const String& rName, const ScRange& rRange, sa
sal_Bool ScDBDocFunc::DeleteDBRange( const String& rName, sal_Bool /* bApi */ )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection* pDocColl = pDoc->GetDBCollection();
sal_Bool bUndo (pDoc->IsUndoEnabled());
@@ -125,7 +126,7 @@ sal_Bool ScDBDocFunc::DeleteDBRange( const String& rName, sal_Bool /* bApi */ )
pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
pDocColl->AtFree( nPos );
- pDoc->CompileDBFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
if (bUndo)
{
@@ -144,7 +145,7 @@ sal_Bool ScDBDocFunc::DeleteDBRange( const String& rName, sal_Bool /* bApi */ )
sal_Bool ScDBDocFunc::RenameDBRange( const String& rOld, const String& rNew, sal_Bool /* bApi */ )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection* pDocColl = pDoc->GetDBCollection();
sal_Bool bUndo (pDoc->IsUndoEnabled());
@@ -170,7 +171,7 @@ sal_Bool ScDBDocFunc::RenameDBRange( const String& rOld, const String& rNew, sal
delete pNewData;
pDoc->SetDBCollection( pUndoColl ); // gehoert dann dem Dokument
}
- pDoc->CompileDBFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
if (bInserted) // Einfuegen hat geklappt
{
@@ -194,7 +195,7 @@ sal_Bool ScDBDocFunc::RenameDBRange( const String& rOld, const String& rNew, sal
sal_Bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, sal_Bool /* bApi */ )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection* pDocColl = pDoc->GetDBCollection();
sal_Bool bUndo (pDoc->IsUndoEnabled());
@@ -239,10 +240,10 @@ sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Boo
{
//! auch fuer ScDBFunc::RepeatDB benutzen!
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScDBCollection* pColl = pDoc->GetDBCollection();
sal_uInt16 nIndex;
if ( pColl && pColl->SearchName( rDBName, nIndex ) )
@@ -263,7 +264,7 @@ sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Boo
if ( bQuery || bSort || bSubTotal )
{
- sal_Bool bQuerySize = sal_False;
+ sal_Bool bQuerySize = false;
ScRange aOldQuery;
ScRange aNewQuery;
if (bQuery && !aQueryParam.bInplace)
@@ -309,23 +310,23 @@ sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Boo
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0,
nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab,
- IDF_NONE, sal_False, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
pDoc->CopyToDocument( 0, static_cast<SCROW>(nOutStartRow),
nTab, MAXCOL, static_cast<SCROW>(nOutEndRow), nTab,
- IDF_NONE, sal_False, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
// Datenbereich sichern - incl. Filter-Ergebnis
- pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
- pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
ScRangeName* pDocRange = pDoc->GetRangeName();
- if (pDocRange->GetCount())
+ if (!pDocRange->empty())
pUndoRange = new ScRangeName( *pDocRange );
ScDBCollection* pDocDB = pDoc->GetDBCollection();
if (pDocDB->GetCount())
@@ -337,22 +338,22 @@ sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Boo
// Sortieren ohne SubTotals
aSubTotalParam.bRemoveOnly = sal_True; // wird unten wieder zurueckgesetzt
- DoSubTotals( nTab, aSubTotalParam, NULL, sal_False, bApi );
+ DoSubTotals( nTab, aSubTotalParam, NULL, false, bApi );
}
if (bSort)
{
pDBData->GetSortParam( aSortParam ); // Bereich kann sich geaendert haben
- Sort( nTab, aSortParam, sal_False, sal_False, bApi );
+ Sort( nTab, aSortParam, false, false, bApi );
}
if (bQuery)
{
pDBData->GetQueryParam( aQueryParam ); // Bereich kann sich geaendert haben
ScRange aAdvSource;
if (pDBData->GetAdvancedQuerySource(aAdvSource))
- Query( nTab, aQueryParam, &aAdvSource, sal_False, bApi );
+ Query( nTab, aQueryParam, &aAdvSource, false, bApi );
else
- Query( nTab, aQueryParam, NULL, sal_False, bApi );
+ Query( nTab, aQueryParam, NULL, false, bApi );
// bei nicht-inplace kann die Tabelle umgestellt worden sein
// if ( !aQueryParam.bInplace && aQueryParam.nDestTab != nTab )
@@ -361,8 +362,8 @@ sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Boo
if (bSubTotal)
{
pDBData->GetSubTotalParam( aSubTotalParam ); // Bereich kann sich geaendert haben
- aSubTotalParam.bRemoveOnly = sal_False;
- DoSubTotals( nTab, aSubTotalParam, NULL, sal_False, bApi );
+ aSubTotalParam.bRemoveOnly = false;
+ DoSubTotals( nTab, aSubTotalParam, NULL, false, bApi );
}
if (bRecord)
@@ -418,7 +419,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
SCTAB nSrcTab = nTab;
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
@@ -426,8 +427,8 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
rSortParam.nCol2, rSortParam.nRow2 );
if (!pDBData)
{
- DBG_ERROR( "Sort: keine DBData" );
- return sal_False;
+ OSL_FAIL( "Sort: keine DBData" );
+ return false;
}
ScDBData* pDestData = NULL;
@@ -435,7 +436,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
sal_Bool bCopy = !rSortParam.bInplace;
if ( bCopy && rSortParam.nDestCol == rSortParam.nCol1 &&
rSortParam.nDestRow == rSortParam.nRow1 && rSortParam.nDestTab == nTab )
- bCopy = sal_False;
+ bCopy = false;
ScSortParam aLocalParam( rSortParam );
if ( bCopy )
{
@@ -444,7 +445,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_PASTE_FULL);
- return sal_False;
+ return false;
}
nTab = rSortParam.nDestTab;
@@ -460,7 +461,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
if ( aLocalParam.bIncludePattern && pDoc->HasAttrib(
@@ -471,7 +472,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
// Merge-Attribute wuerden beim Sortieren durcheinanderkommen
if (!bApi)
rDocShell.ErrorMessage(STR_SORT_ERR_MERGED);
- return sal_False;
+ return false;
}
@@ -479,7 +480,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- sal_Bool bRepeatQuery = sal_False; // bestehenden Filter wiederholen?
+ sal_Bool bRepeatQuery = false; // bestehenden Filter wiederholen?
ScQueryParam aQueryParam;
pDBData->GetQueryParam( aQueryParam );
if ( aQueryParam.GetEntry(0).bDoQuery )
@@ -491,7 +492,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
aQueryParam.nDestCol != rSortParam.nDestCol ||
aQueryParam.nDestRow != rSortParam.nDestRow ||
aQueryParam.nDestTab != rSortParam.nDestTab ) // Query auf selben Zielbereich?
- bRepeatQuery = sal_False;
+ bRepeatQuery = false;
}
ScUndoSort* pUndoAction = 0;
@@ -502,7 +503,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
// Zeilenhoehen immer (wegen automatischer Anpassung)
//! auf ScBlockUndo umstellen
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
/* #i59745# Do not copy note captions to undo document. All existing
caption objects will be repositioned while sorting which is tracked
@@ -511,7 +512,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
existing captions) will be copied back into the source document. */
pDoc->CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nTab,
aLocalParam.nCol2, aLocalParam.nRow2, nTab,
- IDF_ALL|IDF_NOCAPTIONS, sal_False, pUndoDoc );
+ IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
const ScRange* pR = 0;
if (pDestData)
@@ -522,7 +523,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
caption objects are reinserted with drawing undo, and the cells
with the old notes (which still refer to the existing captions)
will be copied back into the source document. */
- pDoc->CopyToDocument( aOldDest, IDF_ALL|IDF_NOCAPTIONS, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( aOldDest, IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
pR = &aOldDest;
}
@@ -530,7 +531,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
//! auf ScBlockUndo umstellen
// if (bRepeatQuery)
pDoc->CopyToDocument( 0, aLocalParam.nRow1, nTab, MAXCOL, aLocalParam.nRow2, nTab,
- IDF_NONE, sal_False, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
ScDBCollection* pUndoDB = NULL;
ScDBCollection* pDocDB = pDoc->GetDBCollection();
@@ -554,10 +555,10 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
rSortParam.nCol2,rSortParam.nRow2,nSrcTab );
ScAddress aDest( rSortParam.nDestCol, rSortParam.nDestRow, rSortParam.nDestTab );
- rDocShell.GetDocFunc().MoveBlock( aSource, aDest, sal_False, sal_False, sal_False, sal_True );
+ rDocShell.GetDocFunc().MoveBlock( aSource, aDest, false, false, false, sal_True );
}
- // #105780# don't call ScDocument::Sort with an empty SortParam (may be empty here if bCopy is set)
+ // don't call ScDocument::Sort with an empty SortParam (may be empty here if bCopy is set)
if ( aLocalParam.bDoSort[0] )
pDoc->Sort( nTab, aLocalParam, bRepeatQuery );
@@ -568,7 +569,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
pDBData->GetSortParam( aOldSortParam );
if ( aOldSortParam.bDoSort[0] && aOldSortParam.bInplace ) // Inplace-Sortierung gemerkt?
{
- bSave = sal_False;
+ bSave = false;
aOldSortParam.nDestCol = rSortParam.nDestCol;
aOldSortParam.nDestRow = rSortParam.nDestRow;
aOldSortParam.nDestTab = rSortParam.nDestTab;
@@ -605,7 +606,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
}
else
{
- DBG_ERROR("Zielbereich nicht da");
+ OSL_FAIL("Zielbereich nicht da");
}
}
@@ -657,13 +658,13 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rQueryParam.nCol1, rQueryParam.nRow1,
rQueryParam.nCol2, rQueryParam.nRow2 );
if (!pDBData)
{
- DBG_ERROR( "Query: keine DBData" );
- return sal_False;
+ OSL_FAIL( "Query: keine DBData" );
+ return false;
}
// Wechsel von Inplace auf nicht-Inplace, dann erst Inplace aufheben:
@@ -679,7 +680,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
SCSIZE nEC = aOldQuery.GetEntryCount();
for (SCSIZE i=0; i<nEC; i++)
- aOldQuery.GetEntry(i).bDoQuery = sal_False;
+ aOldQuery.GetEntry(i).bDoQuery = false;
aOldQuery.bDuplicate = sal_True;
Query( nTab, aOldQuery, NULL, bRecord, bApi );
}
@@ -688,14 +689,14 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
ScQueryParam aLocalParam( rQueryParam ); // fuer Paint / Zielbereich
sal_Bool bCopy = !rQueryParam.bInplace; // kopiert wird in Table::Query
ScDBData* pDestData = NULL; // Bereich, in den kopiert wird
- sal_Bool bDoSize = sal_False; // Zielgroesse anpassen (einf./loeschen)
+ sal_Bool bDoSize = false; // Zielgroesse anpassen (einf./loeschen)
SCCOL nFormulaCols = 0; // nur bei bDoSize
- sal_Bool bKeepFmt = sal_False;
+ sal_Bool bKeepFmt = false;
ScRange aOldDest;
ScRange aDestTotal;
if ( bCopy && rQueryParam.nDestCol == rQueryParam.nCol1 &&
rQueryParam.nDestRow == rQueryParam.nRow1 && rQueryParam.nDestTab == nTab )
- bCopy = sal_False;
+ bCopy = false;
SCTAB nDestTab = nTab;
if ( bCopy )
{
@@ -705,7 +706,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_PASTE_FULL);
- return sal_False;
+ return false;
}
ScEditableTester aTester( pDoc, nDestTab, aLocalParam.nCol1,aLocalParam.nRow1,
@@ -714,7 +715,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
pDestData = pDoc->GetDBAtCursor( rQueryParam.nDestCol, rQueryParam.nDestRow,
@@ -746,7 +747,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_DOSUBTOTALS_2); // kann keine Zeilen einfuegen
- return sal_False;
+ return false;
}
}
}
@@ -755,7 +756,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- sal_Bool bKeepSub = sal_False; // bestehende Teilergebnisse wiederholen?
+ sal_Bool bKeepSub = false; // bestehende Teilergebnisse wiederholen?
ScSubTotalParam aSubTotalParam;
if (rQueryParam.GetEntry(0).bDoQuery) // nicht beim Aufheben
{
@@ -774,23 +775,23 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bCopy)
{
- pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab, sal_False, sal_True );
+ pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab, false, sal_True );
pDoc->CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
aLocalParam.nCol2, aLocalParam.nRow2, nDestTab,
- IDF_ALL, sal_False, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// Attribute sichern, falls beim Filtern mitkopiert
if (pDestData)
{
- pDoc->CopyToDocument( aOldDest, IDF_ALL, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
pOld = &aOldDest;
}
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
pDoc->CopyToDocument( 0, rQueryParam.nRow1, nTab, MAXCOL, rQueryParam.nRow2, nTab,
- IDF_NONE, sal_False, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
}
ScDBCollection* pDocDB = pDoc->GetDBCollection();
@@ -817,8 +818,8 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
aAttribRange.aEnd.SetCol( aAttribRange.aEnd.Col() + nFormulaCols );
pAttribDoc = new ScDocument( SCDOCMODE_UNDO );
- pAttribDoc->InitUndo( pDoc, nDestTab, nDestTab, sal_False, sal_True );
- pDoc->CopyToDocument( aAttribRange, IDF_ATTRIB, sal_False, pAttribDoc );
+ pAttribDoc->InitUndo( pDoc, nDestTab, nDestTab, false, sal_True );
+ pDoc->CopyToDocument( aAttribRange, IDF_ATTRIB, false, pAttribDoc );
}
if ( bDoSize )
@@ -842,7 +843,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
ScRange aNewDest( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
aLocalParam.nCol2, aLocalParam.nRow2, nDestTab );
- pDoc->FitBlock( aDestTotal, aNewDest, sal_False ); // sal_False - nicht loeschen
+ pDoc->FitBlock( aDestTotal, aNewDest, false ); // sal_False - nicht loeschen
if ( nFormulaCols > 0 )
{
@@ -853,7 +854,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
aLocalParam.nCol2+nFormulaCols, aLocalParam.nRow2, nDestTab );
ScRange aOldForm = aNewForm;
aOldForm.aEnd.SetRow( aOldDest.aEnd.Row() );
- pDoc->FitBlock( aOldForm, aNewForm, sal_False );
+ pDoc->FitBlock( aOldForm, aNewForm, false );
ScMarkData aMark;
aMark.SelectOneTable(nDestTab);
@@ -872,7 +873,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
ScRange aHdrRange = aAttribRange;
aHdrRange.aEnd.SetRow( aHdrRange.aStart.Row() );
- pAttribDoc->CopyToDocument( aHdrRange, IDF_ATTRIB, sal_False, pDoc );
+ pAttribDoc->CopyToDocument( aHdrRange, IDF_ATTRIB, false, pDoc );
}
// Daten
@@ -884,12 +885,14 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
nCol, nAttrRow, nDestTab );
DBG_ASSERT(pSrcPattern,"Pattern ist 0");
if (pSrcPattern)
+ {
pDoc->ApplyPatternAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2,
nDestTab, *pSrcPattern );
- const ScStyleSheet* pStyle = pSrcPattern->GetStyleSheet();
- if (pStyle)
- pDoc->ApplyStyleAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2,
+ const ScStyleSheet* pStyle = pSrcPattern->GetStyleSheet();
+ if (pStyle)
+ pDoc->ApplyStyleAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2,
nDestTab, *pStyle );
+ }
}
delete pAttribDoc;
@@ -932,7 +935,7 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
}
else
{
- DBG_ERROR("Zielbereich nicht da");
+ OSL_FAIL("Zielbereich nicht da");
}
}
@@ -942,10 +945,9 @@ sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
pDoc->UpdatePageBreaks( nTab );
}
- // #i23299# because of Subtotal functions, the whole rows must be set dirty
- ScRange aDirtyRange( 0 , aLocalParam.nRow1, nDestTab,
- MAXCOL, aLocalParam.nRow2, nDestTab );
- pDoc->SetDirty( aDirtyRange );
+ // #i23299# Subtotal functions depend on cell's filtered states.
+ ScRange aDirtyRange(0 , aLocalParam.nRow1, nDestTab, MAXCOL, aLocalParam.nRow2, nDestTab);
+ pDoc->SetSubTotalCellsDirty(aDirtyRange);
if ( bRecord )
{
@@ -991,17 +993,17 @@ sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
// - SelectionChanged (?)
sal_Bool bDo = !rParam.bRemoveOnly; // sal_False = nur loeschen
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
rParam.nCol2, rParam.nRow2 );
if (!pDBData)
{
- DBG_ERROR( "SubTotals: keine DBData" );
- return sal_False;
+ OSL_FAIL( "SubTotals: keine DBData" );
+ return false;
}
ScEditableTester aTester( pDoc, nTab, 0,rParam.nRow1+1, MAXCOL,MAXROW );
@@ -1009,7 +1011,7 @@ sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
if (pDoc->HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab,
@@ -1017,15 +1019,13 @@ sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0); // nicht in zusammengefasste einfuegen
- return sal_False;
+ return false;
}
- sal_Bool bOk = sal_True;
- sal_Bool bDelete = sal_False;
+ sal_Bool bOk = true;
if (rParam.bReplace)
if (pDoc->TestRemoveSubTotals( nTab, rParam ))
{
- bDelete = sal_True;
bOk = ( MessBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
// "StarCalc" "Daten loeschen?"
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
@@ -1043,13 +1043,12 @@ sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
ScOutlineTable* pUndoTab = NULL;
ScRangeName* pUndoRange = NULL;
ScDBCollection* pUndoDB = NULL;
- SCTAB nTabCount = 0; // fuer Referenz-Undo
if (bRecord) // alte Daten sichern
{
sal_Bool bOldFilter = bDo && rParam.bDoSort;
- nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = pDoc->GetTableCount();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
@@ -1063,23 +1062,23 @@ sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, sal_False, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, bOldFilter );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, bOldFilter );
// Datenbereich sichern - incl. Filter-Ergebnis
pDoc->CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
- IDF_ALL, sal_False, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
- IDF_FORMULA, sal_False, pUndoDoc );
+ IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
ScRangeName* pDocRange = pDoc->GetRangeName();
- if (pDocRange->GetCount())
+ if (!pDocRange->empty())
pUndoRange = new ScRangeName( *pDocRange );
ScDBCollection* pDocDB = pDoc->GetDBCollection();
if (pDocDB->GetCount())
@@ -1107,10 +1106,12 @@ sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
ScSortParam aOldSort;
pDBData->GetSortParam( aOldSort );
ScSortParam aSortParam( aNewParam, pForceNewSort ? *pForceNewSort : aOldSort );
- Sort( nTab, aSortParam, sal_False, sal_False, bApi );
+ Sort( nTab, aSortParam, false, false, bApi );
}
+ pDoc->InitializeNoteCaptions(nTab);
bSuccess = pDoc->DoSubTotals( nTab, aNewParam );
+ pDoc->SetDrawPageSize(nTab);
}
ScRange aDirtyRange( aNewParam.nCol1, aNewParam.nRow1, nTab,
aNewParam.nCol2, aNewParam.nRow2, nTab );
@@ -1158,7 +1159,7 @@ sal_Bool lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange
if ( !pCell->IsBlank() ) // real content?
{
if ( !rExcept.In( ScAddress( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ) ) )
- return sal_False; // cell found
+ return false; // cell found
}
pCell = aIter.GetNext();
}
@@ -1172,8 +1173,8 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
ScDocShellModificator aModificator( rDocShell );
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- sal_Bool bDone = sal_False;
- sal_Bool bUndoSelf = sal_False;
+ sal_Bool bDone = false;
+ sal_Bool bUndoSelf = false;
sal_uInt16 nErrId = 0;
ScDocument* pOldUndoDoc = NULL;
@@ -1184,7 +1185,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
if ( !rDocShell.IsEditable() || pDoc->GetChangeTrack() )
{
// not recorded -> disallow
@@ -1225,7 +1226,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
{
pOldUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pOldUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aRange, IDF_ALL, sal_False, pOldUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL, false, pOldUndoDoc );
}
pDoc->DeleteAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
@@ -1253,7 +1254,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
SCTAB nTab = aRange.aStart.Tab();
pOldUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pOldUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aRange, IDF_ALL, sal_False, pOldUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL, false, pOldUndoDoc );
}
if ( pNewObj == pOldObj )
@@ -1288,17 +1289,17 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
pDestObj->SetAlive(sal_True);
if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) )
{
- DBG_ERROR("cannot insert DPObject");
+ OSL_FAIL("cannot insert DPObject");
DELETEZ( pDestObj );
}
}
if ( pDestObj )
{
- // #78541# create new database connection for "refresh"
+ // create new database connection for "refresh"
// (and re-read column entry collections)
// so all changes take effect
if ( pNewObj == pOldObj && pDestObj->IsImportData() )
- pDestObj->InvalidateSource();
+ pDestObj->ClearSource();
pDestObj->InvalidateData(); // before getting the new output area
@@ -1306,14 +1307,14 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
if ( !pDestObj->GetName().Len() )
pDestObj->SetName( pDoc->GetDPCollection()->CreateNewName() );
- sal_Bool bOverflow = sal_False;
+ bool bOverflow = false;
ScRange aNewOut = pDestObj->GetNewOutputRange( bOverflow );
//! test for overlap with other data pilot tables
if( pOldObj )
{
const ScSheetSourceDesc* pSheetDesc = pOldObj->GetSheetDesc();
- if( pSheetDesc && pSheetDesc->aSourceRange.Intersects( aNewOut ) )
+ if( pSheetDesc && pSheetDesc->GetSourceRange().Intersects( aNewOut ) )
{
ScRange aOldRange = pOldObj->GetOutRange();
SCsROW nDiff = aOldRange.aStart.Row()-aNewOut.aStart.Row();
@@ -1376,7 +1377,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
SCTAB nTab = aNewOut.aStart.Tab();
pNewUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pNewUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aNewOut, IDF_ALL, sal_False, pNewUndoDoc );
+ pDoc->CopyToDocument( aNewOut, IDF_ALL, false, pNewUndoDoc );
}
pDestObj->Output( aNewOut.aStart );
@@ -1403,7 +1404,7 @@ sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pN
pAction->Undo();
delete pAction;
- bDone = sal_False;
+ bDone = false;
}
else
rDocShell.GetUndoManager()->AddUndoAction( pAction );
@@ -1443,7 +1444,7 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
ScDBCollection& rDBColl = *pDoc->GetDBCollection();
ScDBData* pData = NULL;
ScImportParam aImportParam;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 nCount = rDBColl.GetCount();
for (sal_uInt16 i=0; i<nCount && !bFound; i++)
{
@@ -1484,7 +1485,7 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
pData->GetArea(aRange);
pViewSh->MarkRange(aRange); // selektieren
- if ( bContinue ) // #41905# Fehler beim Import -> Abbruch
+ if ( bContinue ) // Fehler beim Import -> Abbruch
{
// interne Operationen, wenn welche gespeichert
@@ -1501,3 +1502,4 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 2537bfa0be56..fb5951338e37 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,6 +66,7 @@
#include "dbdocutl.hxx"
#include "editable.hxx"
#include "hints.hxx"
+#include "chgtrack.hxx"
using namespace com::sun::star;
@@ -78,7 +80,6 @@ using namespace com::sun::star;
#define SC_DBPROP_SELECTION "Selection"
#define SC_DBPROP_CURSOR "Cursor"
-// static
void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFrame )
{
// called after opening the database beamer
@@ -90,7 +91,7 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram
uno::Reference<frame::XDispatchProvider> xDP(xFrame, uno::UNO_QUERY);
uno::Reference<frame::XFrame> xBeamerFrame = xFrame->findFrame(
- rtl::OUString::createFromAscii("_beamer"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")),
frame::FrameSearchFlag::CHILDREN);
if (xBeamerFrame.is())
{
@@ -111,7 +112,7 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram
}
else
{
- DBG_ERROR("no selection supplier in the beamer!");
+ OSL_FAIL("no selection supplier in the beamer!");
}
}
}
@@ -121,7 +122,7 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram
sal_Bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
const uno::Sequence<beans::PropertyValue>& aArgs )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScImportParam aImParam;
aImParam.nCol1 = aImParam.nCol2 = rPos.Col();
@@ -176,10 +177,10 @@ sal_Bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
{
sal_Int32 nEntry = 0;
if ( aSelection[i] >>= nEntry )
- aList.Insert( (void*)nEntry, LIST_APPEND );
+ aList.Insert( (void*)(sal_IntPtr)nEntry, LIST_APPEND );
}
- sal_Bool bAddrInsert = sal_False; //!???
+ sal_Bool bAddrInsert = false; //!???
if ( bAddrInsert )
{
bDone = DoImport( rPos.Tab(), aImParam, xResSet, &aList, sal_True, bAddrInsert );
@@ -216,9 +217,11 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
const SbaSelectionList* pSelection, sal_Bool bRecord, sal_Bool bAddrInsert )
{
ScDocument* pDoc = rDocShell.GetDocument();
+ ScChangeTrack *pChangeTrack = NULL;
+ ScRange aChangedRange;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScDBData* pDBData = 0;
if ( !bAddrInsert )
@@ -227,8 +230,8 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
rParam.nCol2, rParam.nRow2 );
if (!pDBData)
{
- DBG_ERROR( "DoImport: no DBData" );
- return sal_False;
+ OSL_FAIL( "DoImport: no DBData" );
+ return false;
}
}
@@ -237,9 +240,9 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pWaitWin->EnterWait();
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
- sal_Bool bApi = sal_False; //! pass as argument
- sal_Bool bTruncated = sal_False; // for warning
+ sal_Bool bSuccess = false;
+ sal_Bool bApi = false; //! pass as argument
+ sal_Bool bTruncated = false; // for warning
sal_uInt16 nErrStringId = 0;
String aErrorMessage;
@@ -249,8 +252,8 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
SCROW nEndRow = nRow;
long i;
- sal_Bool bDoSelection = sal_False;
- sal_Bool bRealSelection = sal_False; // sal_True if not everything is selected
+ sal_Bool bDoSelection = false;
+ sal_Bool bRealSelection = false; // sal_True if not everything is selected
sal_uLong nListPos = 0;
sal_uLong nRowsRead = 0;
sal_uLong nListCount = 0;
@@ -265,7 +268,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// ImportDoc - also used for Redo
ScDocument* pImportDoc = new ScDocument( SCDOCMODE_UNDO );
pImportDoc->InitUndo( pDoc, nTab, nTab );
- ScColumn::bDoubleAlloc = sal_True;
+ ScColumn::DoubleAllocSwitch aAllocSwitch(true);
//
// get data from database into import document
@@ -276,17 +279,16 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// progress bar
// only text (title is still needed, for the cancel button)
ScProgress aProgress( &rDocShell, ScGlobal::GetRscString(STR_UNDO_IMPORTDATA), 0 );
- sal_uInt16 nInserted = 0;
uno::Reference<sdbc::XRowSet> xRowSet = uno::Reference<sdbc::XRowSet>(
xResultSet, uno::UNO_QUERY );
- sal_Bool bDispose = sal_False;
+ sal_Bool bDispose = false;
if ( !xRowSet.is() )
{
bDispose = sal_True;
xRowSet = uno::Reference<sdbc::XRowSet>(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_ROWSET ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ),
uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
DBG_ASSERT( xRowProp.is(), "can't get RowSet" );
@@ -303,22 +305,22 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
aAny <<= rtl::OUString( rParam.aDBName );
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_DATASOURCENAME), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_DATASOURCENAME)), aAny );
aAny <<= rtl::OUString( rParam.aStatement );
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMAND), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );
aAny <<= nType;
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMANDTYPE), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMANDTYPE)), aAny );
uno::Reference<sdb::XCompletedExecution> xExecute( xRowSet, uno::UNO_QUERY );
if ( xExecute.is() )
{
uno::Reference<task::XInteractionHandler> xHandler(
comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_INTHANDLER ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_INTHANDLER )) ),
uno::UNO_QUERY);
xExecute->executeWithCompletion( xHandler );
}
@@ -373,15 +375,16 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
++nRow;
}
- sal_Bool bEnd = sal_False;
+ sal_Bool bEnd = false;
if ( !bDoSelection )
xRowSet->beforeFirst();
+ sal_uInt16 nInserted = 0;
while ( !bEnd )
{
// skip rows that are not selected
if ( !bDoSelection )
{
- if ( (bEnd = !xRowSet->next()) == sal_False )
+ if ( (bEnd = !xRowSet->next()) == false )
++nRowsRead;
}
else
@@ -428,7 +431,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (!aProgress.SetStateText( 0, aText )) // stopped by user?
{
bEnd = sal_True;
- bSuccess = sal_False;
+ bSuccess = false;
nErrStringId = STR_DATABASE_ABORTED;
}
}
@@ -454,10 +457,9 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
catch ( uno::Exception& )
{
- DBG_ERROR("Unexpected exception in database");
+ OSL_FAIL("Unexpected exception in database");
}
- ScColumn::bDoubleAlloc = sal_False;
pImportDoc->DoColResize( nTab, rParam.nCol1,nEndCol, 0 );
//
@@ -488,13 +490,11 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if ( !aTester.IsEditable() )
{
nErrStringId = aTester.GetMessageId();
- bSuccess = sal_False;
- }
- else if ( pDoc->GetChangeTrack() != NULL )
- {
- nErrStringId = STR_PROTECTIONERR;
- bSuccess = sal_False;
+ bSuccess = false;
}
+ else if ( (pChangeTrack = pDoc->GetChangeTrack()) != NULL )
+ aChangedRange = ScRange(rParam.nCol1, rParam.nRow1, nTab,
+ nEndCol+nFormulaCols, nEndRow, nTab );
}
if ( bSuccess && bMoveCells )
@@ -506,7 +506,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (!pDoc->CanFitBlock( aOld, aNew ))
{
nErrStringId = STR_MSSG_DOSUBTOTALS_2; // can't insert cells
- bSuccess = sal_False;
+ bSuccess = false;
}
}
@@ -526,7 +526,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, IDF_ATTRIB );
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nMinEndCol, rParam.nRow1, nTab,
- IDF_ATTRIB, sal_False, pImportDoc );
+ IDF_ATTRIB, false, pImportDoc );
SCROW nDataStartRow = rParam.nRow1+1;
for (SCCOL nCopyCol=rParam.nCol1; nCopyCol<=nMinEndCol; nCopyCol++)
@@ -546,7 +546,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (pDoc->IsTabProtected(nTab))
{
ScPatternAttr aPattern(pImportDoc->GetPool());
- aPattern.GetItemSet().Put( ScProtectionAttr( sal_False,sal_False,sal_False,sal_False ) );
+ aPattern.GetItemSet().Put( ScProtectionAttr( false,false,false,false ) );
pImportDoc->ApplyPatternAreaTab( 0,0,MAXCOL,MAXROW, nTab, aPattern );
}
@@ -579,15 +579,15 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// nFormulaCols is set only if column count is unchanged
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- nCopyFlags, sal_False, pUndoDoc );
+ nCopyFlags, false, pUndoDoc );
if ( rParam.nCol2 > nEndCol )
pDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nUndoEndCol, nUndoEndRow, nTab,
- nCopyFlags, sal_False, pUndoDoc );
+ nCopyFlags, false, pUndoDoc );
if ( rParam.nRow2 > nEndRow )
pDoc->CopyToDocument( rParam.nCol1, nEndRow+1, nTab,
nUndoEndCol+nFormulaCols, nUndoEndRow, nTab,
- nCopyFlags, sal_False, pUndoDoc );
+ nCopyFlags, false, pUndoDoc );
}
//
@@ -607,7 +607,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
rParam.nCol2+nFormulaCols, rParam.nRow2, nTab );
ScRange aNew( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab );
- pDoc->FitBlock( aOld, aNew, sal_False ); // Formeln nicht loeschen
+ pDoc->FitBlock( aOld, aNew, false ); // Formeln nicht loeschen
}
else if ( nEndCol < rParam.nCol2 ) // DeleteArea calls PutInOrder
pDoc->DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
@@ -616,13 +616,13 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// CopyToDocument doesn't remove contents
pDoc->DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS & ~IDF_NOTE );
- // #41216# remove each column from ImportDoc after copying to reduce memory usage
+ // remove each column from ImportDoc after copying to reduce memory usage
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( sal_False ); // outside of the loop
+ pDoc->SetAutoCalc( false ); // outside of the loop
for (SCCOL nCopyCol = rParam.nCol1; nCopyCol <= nEndCol; nCopyCol++)
{
pImportDoc->CopyToDocument( nCopyCol, rParam.nRow1, nTab, nCopyCol, nEndRow, nTab,
- IDF_ALL, sal_False, pDoc );
+ IDF_ALL, false, pDoc );
pImportDoc->DeleteAreaTab( nCopyCol, rParam.nRow1, nCopyCol, nEndRow, nTab, IDF_CONTENTS );
pImportDoc->DoColResize( nTab, nCopyCol, nCopyCol, 0 );
}
@@ -633,7 +633,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (bKeepFormat) // formats for formulas
pImportDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- IDF_ATTRIB, sal_False, pDoc );
+ IDF_ATTRIB, false, pDoc );
// fill formulas
ScMarkData aMark;
aMark.SelectOneTable(nTab);
@@ -671,7 +671,7 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (nFormulaCols > 0) // include filled formulas for redo
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- IDF_ALL & ~IDF_NOTE, sal_False, pRedoDoc );
+ IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
ScDBData* pRedoDBData = pDBData ? new ScDBData( *pDBData ) : NULL;
@@ -712,9 +712,13 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
delete pImportDoc;
+ if (bSuccess && pChangeTrack)
+ pChangeTrack->AppendInsert ( aChangedRange );
+
return bSuccess;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 152f9f206cbe..ac589ccba498 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,6 +66,7 @@
#include "dociter.hxx"
#include "autoform.hxx"
#include "cell.hxx"
+#include "cellmergeoption.hxx"
#include "detdata.hxx"
#include "detfunc.hxx"
#include "docpool.hxx"
@@ -72,7 +74,6 @@
#include "drwlayer.hxx"
#include "editutil.hxx"
#include "globstr.hrc"
-//CHINA001 #include "namecrea.hxx" // NAME_TOP etc.
#include "olinetab.hxx"
#include "patattr.hxx"
#include "rangenam.hxx"
@@ -95,7 +96,7 @@
#include "inputwin.hxx"
#include "editable.hxx"
#include "compiler.hxx"
-#include "scui_def.hxx" //CHINA001
+#include "scui_def.hxx"
#include "tabprotection.hxx"
#include "clipparam.hxx"
#include "externalrefmgr.hxx"
@@ -103,9 +104,13 @@
#include <memory>
#include <basic/basmgr.hxx>
#include <boost/scoped_ptr.hpp>
+#include <set>
+#include <vector>
using namespace com::sun::star;
using ::com::sun::star::uno::Sequence;
+using ::std::vector;
+
// STATIC DATA -----------------------------------------------------------
@@ -126,7 +131,7 @@ IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction )
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
return 0;
}
@@ -154,11 +159,11 @@ sal_Bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, sal_Bool bPaint )
if ( pDoc->IsImportingXML() )
{
// for XML import, all row heights are updated together after importing
- return sal_False;
+ return false;
}
if ( !pDoc->IsAdjustHeightEnabled() )
{
- return sal_False;
+ return false;
}
SCTAB nTab = rRange.aStart.Tab();
@@ -169,7 +174,7 @@ sal_Bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, sal_Bool bPaint )
Fraction aOne(1,1);
sal_Bool bChanged = pDoc->SetOptimalHeight( nStartRow, nEndRow, nTab, 0, aProv.GetDevice(),
- aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, sal_False );
+ aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, false );
if ( bPaint && bChanged )
rDocShell.PostPaint( 0, nStartRow, nTab, MAXCOL, MAXROW, nTab,
@@ -226,7 +231,7 @@ sal_Bool ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
sal_Bool bUndo(pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
ScDocShellModificator aModificator( rDocShell );
@@ -306,7 +311,7 @@ sal_Bool ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
ScDocShellModificator aModificator( rDocShell );
@@ -428,7 +433,7 @@ sal_Bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return sal_False;
+ return false;
ScDocShellModificator aModificator( rDocShell );
@@ -465,7 +470,7 @@ sal_Bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
sal_Bool ScDocFunc::DetectiveRefresh( sal_Bool bAutomatic )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
sal_Bool bUndo (pDoc->IsUndoEnabled());
@@ -513,7 +518,7 @@ sal_Bool ScDocFunc::DetectiveRefresh( sal_Bool bAutomatic )
aFunc.ShowError( nCol, nRow );
break;
default:
- DBG_ERROR("falsche Op bei DetectiveRefresh");
+ OSL_FAIL("falsche Op bei DetectiveRefresh");
}
}
}
@@ -536,6 +541,45 @@ sal_Bool ScDocFunc::DetectiveRefresh( sal_Bool bAutomatic )
return bDone;
}
+static void lcl_collectAllPredOrSuccRanges(
+ const ScRangeList& rSrcRanges, vector<ScTokenRef>& rRefTokens, ScDocShell& rDocShell,
+ bool bPred)
+{
+ ScDocument* pDoc = rDocShell.GetDocument();
+ vector<ScTokenRef> aRefTokens;
+ ScRangeList aSrcRanges(rSrcRanges);
+ if (aSrcRanges.empty())
+ return;
+ ScRange* p = aSrcRanges.front();
+ ScDetectiveFunc aDetFunc(pDoc, p->aStart.Tab());
+ ScRangeList aDestRanges;
+ for (size_t i = 0, n = aSrcRanges.size(); i < n; ++i)
+ {
+ p = aSrcRanges[i];
+ if (bPred)
+ {
+ aDetFunc.GetAllPreds(
+ p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), aRefTokens);
+ }
+ else
+ {
+ aDetFunc.GetAllSuccs(
+ p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), aRefTokens);
+ }
+ }
+ rRefTokens.swap(aRefTokens);
+}
+
+void ScDocFunc::DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, vector<ScTokenRef>& rRefTokens)
+{
+ lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, true);
+}
+
+void ScDocFunc::DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, vector<ScTokenRef>& rRefTokens)
+{
+ lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, false);
+}
+
//------------------------------------------------------------------------
sal_Bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
@@ -545,28 +589,28 @@ sal_Bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
{
- DBG_ERROR("ScDocFunc::DeleteContents ohne Markierung");
- return sal_False;
+ OSL_FAIL("ScDocFunc::DeleteContents ohne Markierung");
+ return false;
}
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScEditableTester aTester( pDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
ScRange aMarkRange;
- sal_Bool bSimple = sal_False;
+ sal_Bool bSimple = false;
ScMarkData aMultiMark = rMark;
- aMultiMark.SetMarking(sal_False); // fuer MarkToMulti
+ aMultiMark.SetMarking(false); // fuer MarkToMulti
ScDocument* pUndoDoc = NULL;
sal_Bool bMulti = !bSimple && aMultiMark.IsMultiMarked();
@@ -579,18 +623,18 @@ sal_Bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
if (!bSimple)
{
if ( pDoc->ExtendMerge( aExtendedRange, sal_True ) )
- bMulti = sal_False;
+ bMulti = false;
}
// keine Objekte auf geschuetzten Tabellen
- sal_Bool bObjects = sal_False;
+ sal_Bool bObjects = false;
if ( nFlags & IDF_OBJECTS )
{
bObjects = sal_True;
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (aMultiMark.GetTableSelect(nTab) && pDoc->IsTabProtected(nTab))
- bObjects = sal_False;
+ bObjects = false;
}
sal_uInt16 nExtFlags = 0; // extra flags are needed only if attributes are deleted
@@ -630,7 +674,7 @@ sal_Bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
if (nFlags & IDF_EDITATTR) // Edit-Engine-Attribute
nUndoDocFlags |= IDF_STRING; // -> Zellen werden geaendert
if (nFlags & IDF_NOTE)
- nUndoDocFlags |= IDF_CONTENTS; // #68795# copy all cells with their notes
+ nUndoDocFlags |= IDF_CONTENTS; // copy all cells with their notes
// note captions are handled in drawing undo
nUndoDocFlags |= IDF_NOCAPTIONS;
pDoc->CopyToDocument( aExtendedRange, nUndoDocFlags, bMulti, pUndoDoc, &aMultiMark );
@@ -644,7 +688,6 @@ sal_Bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
else
{
pDoc->DeleteSelection( nFlags, aMultiMark );
-// aMultiMark.MarkToSimple();
}
// add undo action after drawing undo is complete (objects and note captions)
@@ -658,21 +701,7 @@ sal_Bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
else if (nExtFlags & SC_PF_LINES)
lcl_PaintAbove( rDocShell, aExtendedRange ); // fuer Linien ueber dem Bereich
-// rDocShell.UpdateOle(GetViewData()); //! an der View?
aModificator.SetDocumentModified();
-//! CellContentChanged();
-//! ShowAllCursors();
-
-#if 0
- //! muss an der View bleiben !!!!
- if ( nFlags & IDF_ATTRIB )
- {
- if ( nFlags & IDF_CONTENTS )
- ForgetFormatArea();
- else
- StartFormatArea(); // Attribute loeschen ist auch Attributierung
- }
-#endif
return sal_True;
}
@@ -686,19 +715,19 @@ sal_Bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScEditableTester aTester( pDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
ScRange aMarkRange;
ScMarkData aMultiMark = rMark;
- aMultiMark.SetMarking(sal_False); // for MarkToMulti
+ aMultiMark.SetMarking(false); // for MarkToMulti
aMultiMark.MarkToMulti();
aMultiMark.GetMultiMarkArea( aMarkRange );
@@ -745,7 +774,7 @@ sal_Bool ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
SCTAB* pTabs = NULL;
@@ -766,13 +795,13 @@ sal_Bool ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText,
const SfxPoolItem* pItem;
const ScPatternAttr* pPattern = pDoc->GetPattern( rPos.Col(),rPos.Row(),rPos.Tab() );
if ( SFX_ITEM_SET == pPattern->GetItemSet().GetItemState(
- ATTR_VALUE_FORMAT,sal_False,&pItem) )
+ ATTR_VALUE_FORMAT,false,&pItem) )
{
pHasFormat[0] = sal_True;
pOldFormats[0] = ((const SfxUInt32Item*)pItem)->GetValue();
}
else
- pHasFormat[0] = sal_False;
+ pHasFormat[0] = false;
}
pDoc->SetString( rPos.Col(), rPos.Row(), rPos.Tab(), rText );
@@ -790,7 +819,7 @@ sal_Bool ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText,
rDocShell.PostPaintCell( rPos );
aModificator.SetDocumentModified();
- // #107160# notify input handler here the same way as in PutCell
+ // notify input handler here the same way as in PutCell
if (bApi)
NotifyInputHandler( rPos );
@@ -813,7 +842,7 @@ sal_Bool ScDocFunc::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bo
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
pNewCell->Delete();
- return sal_False;
+ return false;
}
}
@@ -865,7 +894,7 @@ void ScDocFunc::NotifyInputHandler( const ScAddress& rPos )
// (the cell shows the same like the InputWindow)
if (bIsEditMode)
pInputHdl->SetModified();
- pViewSh->UpdateInputHandler(sal_False, !bIsEditMode);
+ pViewSh->UpdateInputHandler(false, !bIsEditMode);
}
}
}
@@ -885,7 +914,7 @@ sal_Bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngi
{
// PutData ruft PutCell oder SetNormalString
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScEditAttrTester aTester( &rEngine );
sal_Bool bEditCell = aTester.NeedsObject();
@@ -898,7 +927,7 @@ sal_Bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngi
sal_Bool bUpdateMode(rEngine.GetUpdateMode());
if (bUpdateMode)
- rEngine.SetUpdateMode(sal_False);
+ rEngine.SetUpdateMode(false);
ScMyRememberItemList aRememberItems;
ScMyRememberItem* pRememberItem = NULL;
@@ -1086,7 +1115,7 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow )
rDocShell.GetUndoManager()->AddUndoAction( new ScUndoShowHideNote( rDocShell, rPos, bShow ) );
if (rDoc.IsStreamValid(rPos.Tab()))
- rDoc.SetStreamValid(rPos.Tab(), sal_False);
+ rDoc.SetStreamValid(rPos.Tab(), false);
rDocShell.SetDocumentModified();
@@ -1117,7 +1146,7 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const String& rText, sal_Boo
//! Undo !!!
if (pDoc->IsStreamValid(rPos.Tab()))
- pDoc->SetStreamValid(rPos.Tab(), sal_False);
+ pDoc->SetStreamValid(rPos.Tab(), false);
rDocShell.PostPaintCell( rPos );
aModificator.SetDocumentModified();
@@ -1174,7 +1203,7 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, con
rDocShell.PostPaintCell( rPos );
if (rDoc.IsStreamValid(rPos.Tab()))
- rDoc.SetStreamValid(rPos.Tab(), sal_False);
+ rDoc.SetStreamValid(rPos.Tab(), false);
aModificator.SetDocumentModified();
bDone = true;
@@ -1194,7 +1223,7 @@ sal_Bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAtt
{
ScDocument* pDoc = rDocShell.GetDocument();
if ( bRecord && !pDoc->IsUndoEnabled() )
- bRecord = sal_False;
+ bRecord = false;
sal_Bool bImportingXML = pDoc->IsImportingXML();
// Cell formats can still be set if the range isn't editable only because of matrix formulas.
@@ -1205,7 +1234,7 @@ sal_Bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAtt
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return sal_False;
+ return false;
}
ScDocShellModificator aModificator( rDocShell );
@@ -1257,7 +1286,7 @@ sal_Bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const String& rStyleNam
{
ScDocument* pDoc = rDocShell.GetDocument();
if ( bRecord && !pDoc->IsUndoEnabled() )
- bRecord = sal_False;
+ bRecord = false;
sal_Bool bImportingXML = pDoc->IsImportingXML();
// Cell formats can still be set if the range isn't editable only because of matrix formulas.
@@ -1268,13 +1297,13 @@ sal_Bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const String& rStyleNam
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return sal_False;
+ return false;
}
ScStyleSheet* pStyleSheet = (ScStyleSheet*) pDoc->GetStyleSheetPool()->Find(
rStyleName, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
- return sal_False;
+ return false;
ScDocShellModificator aModificator( rDocShell );
@@ -1306,14 +1335,8 @@ sal_Bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const String& rStyleNam
}
-// sal_Bool bPaintExt = pDoc->HasAttrib( aMultiRange, HASATTR_PAINTEXT );
-// pDoc->ApplySelectionPattern( rPattern, rMark );
-
pDoc->ApplySelectionStyle( (ScStyleSheet&)*pStyleSheet, rMark );
-// if (!bPaintExt)
-// bPaintExt = pDoc->HasAttrib( aMultiRange, HASATTR_PAINTEXT );
-// sal_uInt16 nExtFlags = bPaintExt ? SC_PF_LINES : 0;
sal_uInt16 nExtFlags = 0;
if (!AdjustRowHeight( aMultiRange ))
rDocShell.PostPaint( aMultiRange, PAINT_GRID, nExtFlags );
@@ -1341,8 +1364,8 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
if ( !ValidRow(nStartRow) || !ValidRow(nEndRow) )
{
- DBG_ERROR("invalid row in InsertCells");
- return sal_False;
+ OSL_FAIL("invalid row in InsertCells");
+ return false;
}
ScDocument* pDoc = rDocShell.GetDocument();
@@ -1365,7 +1388,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
}
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -1432,7 +1455,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
if ( eCmd == INS_CELLSRIGHT )
nMergeTestEndX = MAXCOL;
- sal_Bool bNeedRefresh = sal_False;
+ sal_Bool bNeedRefresh = false;
SCCOL nEditTestEndX = (eCmd==INS_INSCOLS) ? MAXCOL : nMergeTestEndX;
SCROW nEditTestEndY = (eCmd==INS_INSROWS) ? MAXROW : nMergeTestEndY;
@@ -1441,7 +1464,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
WaitObject aWait( rDocShell.GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference
@@ -1451,7 +1474,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
if ( bRecord )
{
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, sal_False, sal_False );
+ pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
// pRefUndoDoc is filled in InsertCol / InsertRow
@@ -1462,7 +1485,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
// #i8302 : we unmerge overwhelming ranges, before insertion all the actions are put in the same ListAction
// the patch comes from mloiseleur and maoyg
- sal_Bool bInsertMerge = sal_False;
+ sal_Bool bInsertMerge = false;
std::vector<ScRange> qIncreaseRange;
String aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTCELLS );
if (bRecord)
@@ -1491,7 +1514,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return sal_False;
+ return false;
}
SCCOL nTestCol = -1;
@@ -1589,7 +1612,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return sal_False;
+ return false;
}
}
}
@@ -1620,8 +1643,8 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
nPaintFlags |= PAINT_TOP;
break;
default:
- DBG_ERROR("Falscher Code beim Einfuegen");
- bSuccess = sal_False;
+ OSL_FAIL("Falscher Code beim Einfuegen");
+ bSuccess = false;
break;
}
@@ -1680,7 +1703,11 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
default:
break;
}
- MergeCells(aRange, sal_False, sal_True, sal_True);
+ ScCellMergeOption aMergeOption(
+ aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row() );
+ aMergeOption.maTabs.insert(aRange.aStart.Tab());
+ MergeCells(aMergeOption, false, true, true);
}
qIncreaseRange.pop_back();
}
@@ -1720,7 +1747,6 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
rDocShell.PostPaint( nPaintStartX, nPaintStartY, i, nPaintEndX, nPaintEndY, i+nScenarioCount, nPaintFlags, nExtFlags );
}
}
- //aModificator.SetDocumentModified();
}
else
{
@@ -1729,13 +1755,16 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
while( !qIncreaseRange.empty() )
{
ScRange aRange = qIncreaseRange.back();
- MergeCells(aRange, sal_False, sal_True, sal_True);
+ ScCellMergeOption aMergeOption(
+ aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row() );
+ MergeCells(aMergeOption, false, true, true);
qIncreaseRange.pop_back();
}
if( pViewSh )
{
- pViewSh->MarkRange( rRange, sal_False );
+ pViewSh->MarkRange( rRange, false );
pViewSh->SetCursor( nCursorCol, nCursorRow );
}
}
@@ -1769,8 +1798,8 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
if ( !ValidRow(nStartRow) || !ValidRow(nEndRow) )
{
- DBG_ERROR("invalid row in DeleteCells");
- return sal_False;
+ OSL_FAIL("invalid row in DeleteCells");
+ return false;
}
ScDocument* pDoc = rDocShell.GetDocument();
@@ -1783,7 +1812,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
SCTAB i;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -1855,7 +1884,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
// Test zusammengefasste
@@ -1864,12 +1893,12 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
SCROW nMergeTestEndY = (eCmd==DEL_CELLSUP) ? MAXROW : nUndoEndY;
SCCOL nExtendStartCol = nUndoStartX;
SCROW nExtendStartRow = nUndoStartY;
- sal_Bool bNeedRefresh = sal_False;
+ sal_Bool bNeedRefresh = false;
//Issue 8302 want to be able to insert into the middle of merged cells
//the patch comes from maoyg
::std::vector<ScRange> qDecreaseRange;
- sal_Bool bDeletingMerge = sal_False;
+ sal_Bool bDeletingMerge = false;
String aUndo = ScGlobal::GetRscString( STR_UNDO_DELETECELLS );
if (bRecord)
rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
@@ -1893,7 +1922,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_DELETECELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return sal_False;
+ return false;
}
nExtendStartCol = nMergeStartX;
@@ -1998,7 +2027,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_DELETECELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return sal_False;
+ return false;
}
}
}
@@ -2030,12 +2059,12 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
nScenarioCount ++;
pDoc->CopyToDocument( nUndoStartX, nUndoStartY, i, nUndoEndX, nUndoEndY, i+nScenarioCount,
- IDF_ALL | IDF_NOCAPTIONS, sal_False, pUndoDoc );
+ IDF_ALL | IDF_NOCAPTIONS, false, pUndoDoc );
}
}
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, sal_False, sal_False );
+ pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
pUndoData = new ScRefUndoData( pDoc );
@@ -2049,7 +2078,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
rDocShell.UpdatePaintExt( nExtFlags, nStartCol, nStartRow, i, nEndCol, nEndRow, i );
}
- sal_Bool bUndoOutline = sal_False;
+ sal_Bool bUndoOutline = false;
switch (eCmd)
{
case DEL_CELLSUP:
@@ -2075,7 +2104,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
nPaintFlags |= PAINT_TOP;
break;
default:
- DBG_ERROR("Falscher Code beim Loeschen");
+ OSL_FAIL("Falscher Code beim Loeschen");
break;
}
@@ -2088,10 +2117,10 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
pRefUndoDoc->DeleteAreaTab(nUndoStartX,nUndoStartY,nUndoEndX,nUndoEndY, i, IDF_ALL);
// alle Tabellen anlegen, damit Formeln kopiert werden koennen:
- pUndoDoc->AddUndoTab( 0, nTabCount-1, sal_False, sal_False );
+ pUndoDoc->AddUndoTab( 0, nTabCount-1, false, false );
// kopieren mit bColRowFlags=sal_False (#54194#)
- pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,IDF_FORMULA,sal_False,pUndoDoc,NULL,sal_False);
+ pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,IDF_FORMULA,false,pUndoDoc,NULL,false);
delete pRefUndoDoc;
SCTAB* pTabs = new SCTAB[nSelCount];
@@ -2166,7 +2195,8 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
- MergeCells( aRange, sal_False, sal_True, sal_True );
+ ScCellMergeOption aMergeOption(aRange);
+ MergeCells( aMergeOption, false, true, true );
}
qDecreaseRange.pop_back();
}
@@ -2254,15 +2284,15 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
if ( !ValidRow(nStartRow) || !ValidRow(nEndRow) || !ValidRow(nDestRow) )
{
- DBG_ERROR("invalid row in MoveBlock");
- return sal_False;
+ OSL_FAIL("invalid row in MoveBlock");
+ return false;
}
// zugehoerige Szenarien auch anpassen - nur wenn innerhalb einer Tabelle verschoben wird!
- sal_Bool bScenariosAdded = sal_False;
+ sal_Bool bScenariosAdded = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
SCTAB nTabCount = pDoc->GetTableCount();
if ( nDestTab == nStartTab && !pDoc->IsScenario(nEndTab) )
@@ -2298,7 +2328,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
SCCOL nOldEndCol = nEndCol;
SCROW nOldEndRow = nEndRow;
- sal_Bool bClipOver = sal_False;
+ sal_Bool bClipOver = false;
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
{
SCCOL nTmpEndCol = nOldEndCol;
@@ -2322,7 +2352,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
SCCOL nClipX;
SCROW nClipY;
- pClipDoc->GetClipArea( nClipX, nClipY, sal_False );
+ pClipDoc->GetClipArea( nClipX, nClipY, false );
SCROW nUndoAdd = nUndoEndRow - nDestEndRow;
nDestEndRow = nDestRow + nClipY;
nUndoEndRow = nDestEndRow + nUndoAdd;
@@ -2333,7 +2363,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
if (!bApi)
rDocShell.ErrorMessage(STR_PASTE_FULL);
delete pClipDoc;
- return sal_False;
+ return false;
}
// Test auf Zellschutz
@@ -2350,7 +2380,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
delete pClipDoc;
- return sal_False;
+ return false;
}
// Test auf zusammengefasste - beim Verschieben erst nach dem Loeschen
@@ -2362,7 +2392,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_MOVEBLOCKTO_0);
delete pClipDoc;
- return sal_False;
+ return false;
}
// Are there borders in the cells? (for painting)
@@ -2391,23 +2421,23 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
if (bCut)
{
pDoc->CopyToDocument( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
- nUndoFlags, sal_False, pUndoDoc );
+ nUndoFlags, false, pUndoDoc );
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, sal_False, sal_False );
+ pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
}
if ( nDestTab != nStartTab )
pUndoDoc->AddUndoTab( nDestTab, nDestEndTab, bWholeCols, bWholeRows );
pDoc->CopyToDocument( nDestCol, nDestRow, nDestTab,
nDestEndCol, nDestEndRow, nDestEndTab,
- nUndoFlags, sal_False, pUndoDoc );
+ nUndoFlags, false, pUndoDoc );
pUndoData = new ScRefUndoData( pDoc );
pDoc->BeginDrawUndo();
}
- sal_Bool bSourceHeight = sal_False; // Hoehen angepasst?
+ sal_Bool bSourceHeight = false; // Hoehen angepasst?
if (bCut)
{
ScMarkData aDelMark; // only for tables
@@ -2441,10 +2471,10 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
delete pRefUndoDoc;
delete pUndoData;
delete pClipDoc;
- return sal_False;
+ return false;
}
- bSourceHeight = AdjustRowHeight( rSource, sal_False );
+ bSourceHeight = AdjustRowHeight( rSource, false );
}
ScRange aPasteDest( nDestCol, nDestRow, nDestTab, nDestEndCol, nDestEndRow, nDestEndTab );
@@ -2460,16 +2490,16 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
positions (e.g. if source and destination range overlaps). Cell notes
and drawing objects are pasted below after doing all adjusting. */
pDoc->CopyFromClip( aPasteDest, aDestMark, IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS),
- pRefUndoDoc, pClipDoc, sal_True, sal_False, bIncludeFiltered );
+ pRefUndoDoc, pClipDoc, sal_True, false, bIncludeFiltered );
// skipped rows and merged cells don't mix
if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
- UnmergeCells( aPasteDest, sal_False, sal_True );
+ UnmergeCells( aPasteDest, false, sal_True );
VirtualDevice aVirtDev;
sal_Bool bDestHeight = AdjustRowHeight(
ScRange( 0,nDestRow,nDestTab, MAXCOL,nDestEndRow,nDestEndTab ),
- sal_False );
+ false );
/* Paste cell notes and drawing objects after adjusting formula references
and row heights. There are no cell notes or drawing objects, if the
@@ -2480,19 +2510,19 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
touch existing cells. */
if ( pClipDoc->GetDrawLayer() )
pDoc->CopyFromClip( aPasteDest, aDestMark, IDF_NOTE | IDF_ADDNOTES | IDF_OBJECTS,
- pRefUndoDoc, pClipDoc, sal_True, sal_False, bIncludeFiltered );
+ pRefUndoDoc, pClipDoc, sal_True, false, bIncludeFiltered );
if (bRecord)
{
if (pRefUndoDoc)
{
// alle Tabellen anlegen, damit Formeln kopiert werden koennen:
- pUndoDoc->AddUndoTab( 0, nTabCount-1, sal_False, sal_False );
+ pUndoDoc->AddUndoTab( 0, nTabCount-1, false, false );
pRefUndoDoc->DeleteArea( nDestCol, nDestRow, nDestEndCol, nDestEndRow, aSourceMark, IDF_ALL );
// kopieren mit bColRowFlags=sal_False (#54194#)
pRefUndoDoc->CopyToDocument( 0, 0, 0, MAXCOL, MAXROW, MAXTAB,
- IDF_FORMULA, sal_False, pUndoDoc, NULL, sal_False );
+ IDF_FORMULA, false, pUndoDoc, NULL, false );
delete pRefUndoDoc;
}
@@ -2636,14 +2666,14 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String
sal_Int32 nNum = 0;
String genModuleName;
if ( sModuleName.Len() )
- sModuleName = sModuleName;
+ genModuleName = sModuleName;
else
{
genModuleName = String::CreateFromAscii( "Sheet1" );
nNum = 1;
}
- while( xLib->hasByName( genModuleName ) )
- genModuleName = rtl::OUString::createFromAscii( "Sheet" ) + rtl::OUString::valueOf( ++nNum );
+ while( xLib->hasByName( genModuleName ) )
+ genModuleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Sheet")) + rtl::OUString::valueOf( ++nNum );
uno::Any aSourceAny;
rtl::OUString sTmpSource = sSource;
@@ -2690,7 +2720,7 @@ void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName )
sal_Bool ScDocFunc::InsertTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi )
{
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
WaitObject aWait( rDocShell.GetActiveDialogParent() );
ScDocShellModificator aModificator( rDocShell );
@@ -2707,7 +2737,7 @@ sal_Bool ScDocFunc::InsertTable( SCTAB nTab, const String& rName, sal_Bool bReco
bInsertDocModule = pDoc ? pDoc->IsInVBAMode() : false;
}
if ( bInsertDocModule || ( bRecord && !pDoc->IsUndoEnabled() ) )
- bRecord = sal_False;
+ bRecord = false;
if (bRecord)
pDoc->BeginDrawUndo(); // InsertTab erzeugt ein SdrUndoNewPage
@@ -2749,13 +2779,13 @@ sal_Bool ScDocFunc::DeleteTable( SCTAB nTab, sal_Bool bRecord, sal_Bool /* bApi
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
sal_Bool bVbaEnabled = pDoc ? pDoc->IsInVBAMode() : false;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
if ( bVbaEnabled )
- bRecord = sal_False;
+ bRecord = false;
sal_Bool bWasLinked = pDoc->IsLinked(nTab);
ScDocument* pUndoDoc = NULL;
ScRefUndoData* pUndoData = NULL;
@@ -2767,10 +2797,10 @@ sal_Bool ScDocFunc::DeleteTable( SCTAB nTab, sal_Bool bRecord, sal_Bool /* bApi
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True ); // nur nTab mit Flags
pUndoDoc->AddUndoTab( 0, nCount-1 ); // alle Tabs fuer Referenzen
- pDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,sal_False, pUndoDoc );
+ pDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pUndoDoc );
String aOldName;
pDoc->GetName( nTab, aOldName );
- pUndoDoc->RenameTab( nTab, aOldName, sal_False );
+ pUndoDoc->RenameTab( nTab, aOldName, false );
if (bWasLinked)
pUndoDoc->SetLink( nTab, pDoc->GetLinkMode(nTab), pDoc->GetLinkDoc(nTab),
pDoc->GetLinkFlt(nTab), pDoc->GetLinkOpt(nTab),
@@ -2804,7 +2834,7 @@ sal_Bool ScDocFunc::DeleteTable( SCTAB nTab, sal_Bool bRecord, sal_Bool /* bApi
{
if (bRecord)
{
- SvShorts theTabs;
+ vector<SCTAB> theTabs;
theTabs.push_back(nTab);
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoDeleteTab( &rDocShell, theTabs, pUndoDoc, pUndoData ));
@@ -2856,7 +2886,7 @@ sal_Bool ScDocFunc::SetTableVisible( SCTAB nTab, sal_Bool bVisible, sal_Bool bAp
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return sal_False;
+ return false;
}
ScDocShellModificator aModificator( rDocShell );
@@ -2875,7 +2905,7 @@ sal_Bool ScDocFunc::SetTableVisible( SCTAB nTab, sal_Bool bVisible, sal_Bool bAp
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR); //! eigene Meldung?
- return sal_False;
+ return false;
}
}
@@ -2925,58 +2955,21 @@ sal_Bool ScDocFunc::SetLayoutRTL( SCTAB nTab, sal_Bool bRTL, sal_Bool /* bApi */
return sal_True;
}
-//UNUSED2009-05 sal_Bool ScDocFunc::SetGrammar( formula::FormulaGrammar::Grammar eGrammar )
-//UNUSED2009-05 {
-//UNUSED2009-05 ScDocument* pDoc = rDocShell.GetDocument();
-//UNUSED2009-05
-//UNUSED2009-05 if ( pDoc->GetGrammar() == eGrammar )
-//UNUSED2009-05 return sal_True;
-//UNUSED2009-05
-//UNUSED2009-05 sal_Bool bUndo(pDoc->IsUndoEnabled());
-//UNUSED2009-05 ScDocShellModificator aModificator( rDocShell );
-//UNUSED2009-05
-//UNUSED2009-05 pDoc->SetGrammar( eGrammar );
-//UNUSED2009-05
-//UNUSED2009-05 if (bUndo)
-//UNUSED2009-05 {
-//UNUSED2009-05 rDocShell.GetUndoManager()->AddUndoAction( new ScUndoSetGrammar( &rDocShell, eGrammar ) );
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 rDocShell.PostPaint( 0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_ALL );
-//UNUSED2009-05
-//UNUSED2009-05 ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
-//UNUSED2009-05 if (NULL != pViewSh)
-//UNUSED2009-05 {
-//UNUSED2009-05 pViewSh->UpdateInputHandler( sal_False, sal_False );
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 aModificator.SetDocumentModified();
-//UNUSED2009-05
-//UNUSED2009-05 SfxBindings* pBindings = rDocShell.GetViewBindings();
-//UNUSED2009-05 if (pBindings)
-//UNUSED2009-05 {
-//UNUSED2009-05 // erAck: 2006-09-07T22:19+0200 commented out in CWS scr1c1
-//UNUSED2009-05 //pBindings->Invalidate( FID_TAB_USE_R1C1 );
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 return sal_True;
-//UNUSED2009-05 }
-
sal_Bool ScDocFunc::RenameTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi )
{
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
if ( !pDoc->IsDocEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return sal_False;
+ return false;
}
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
String sOldName;
pDoc->GetName(nTab, sOldName);
if (pDoc->RenameTab( nTab, rName ))
@@ -3128,21 +3121,21 @@ sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOL
ScDocument* pDoc = rDocShell.GetDocument();
if ( bRecord && !pDoc->IsUndoEnabled() )
- bRecord = sal_False;
+ bRecord = false;
// import into read-only document is possible
if ( !pDoc->IsChangeReadOnlyEnabled() && !rDocShell.IsEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR); //! eigene Meldung?
- return sal_False;
+ return false;
}
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
SCCOLROW nStart = pRanges[0];
SCCOLROW nEnd = pRanges[2*nRangeCnt-1];
- sal_Bool bFormula = sal_False;
+ sal_Bool bFormula = false;
if ( eMode == SC_SIZE_OPTIMAL )
{
//! Option "Formeln anzeigen" - woher nehmen?
@@ -3159,13 +3152,13 @@ sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOL
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bWidth)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_False );
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
+ pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
- pDoc->CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, IDF_NONE, sal_False, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, IDF_NONE, false, pUndoDoc );
}
pUndoRanges = new SCCOLROW[ 2*nRangeCnt ];
@@ -3177,9 +3170,9 @@ sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOL
}
sal_Bool bShow = nSizeTwips > 0 || eMode != SC_SIZE_DIRECT;
- sal_Bool bOutline = sal_False;
+ sal_Bool bOutline = false;
- pDoc->IncSizeRecalcLevel( nTab ); // nicht fuer jede Spalte einzeln
+ pDoc->InitializeNoteCaptions(nTab);
for (SCCOLROW nRangeNo=0; nRangeNo<nRangeCnt; nRangeNo++)
{
SCCOLROW nStartNo = *(pRanges++);
@@ -3198,7 +3191,7 @@ sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOL
{
sal_uInt8 nOld = pDoc->GetRowFlags(nRow,nTab);
SCROW nLastRow = -1;
- bool bHidden = pDoc->RowHidden(nRow, nTab, nLastRow);
+ bool bHidden = pDoc->RowHidden(nRow, nTab, NULL, &nLastRow);
if ( !bHidden && ( nOld & CR_MANUALSIZE ) )
pDoc->SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
}
@@ -3234,8 +3227,7 @@ sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOL
{
for (SCCOL nCol=static_cast<SCCOL>(nStartNo); nCol<=static_cast<SCCOL>(nEndNo); nCol++)
{
- SCCOL nLastCol = -1;
- if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab, nLastCol) )
+ if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab) )
{
sal_uInt16 nThisSize = nSizeTwips;
@@ -3265,7 +3257,7 @@ sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOL
static_cast<SCROW>(nEndNo), nTab, bShow );
}
}
- pDoc->DecSizeRecalcLevel( nTab ); // nicht fuer jede Spalte einzeln
+ pDoc->SetDrawPageSize(nTab);
if (!bOutline)
DELETEZ(pUndoTab);
@@ -3297,14 +3289,14 @@ sal_Bool ScDocFunc::InsertPageBreak( sal_Bool bColumn, const ScAddress& rPos,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
SCTAB nTab = rPos.Tab();
SfxBindings* pBindings = rDocShell.GetViewBindings();
SCCOLROW nPos = bColumn ? static_cast<SCCOLROW>(rPos.Col()) :
static_cast<SCCOLROW>(rPos.Row());
if (nPos == 0)
- return sal_False; // erste Spalte / Zeile
+ return false; // erste Spalte / Zeile
ScBreakType nBreak = bColumn ?
pDoc->HasColBreak(static_cast<SCCOL>(nPos), nTab) :
@@ -3325,7 +3317,7 @@ sal_Bool ScDocFunc::InsertPageBreak( sal_Bool bColumn, const ScAddress& rPos,
pDoc->UpdatePageBreaks( nTab );
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
if (bColumn)
{
@@ -3361,7 +3353,7 @@ sal_Bool ScDocFunc::RemovePageBreak( sal_Bool bColumn, const ScAddress& rPos,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
SCTAB nTab = rPos.Tab();
SfxBindings* pBindings = rDocShell.GetViewBindings();
@@ -3379,7 +3371,7 @@ sal_Bool ScDocFunc::RemovePageBreak( sal_Bool bColumn, const ScAddress& rPos,
if (bRecord)
rDocShell.GetUndoManager()->AddUndoAction(
- new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, sal_False ) );
+ new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, false ) );
if (bColumn)
pDoc->RemoveColBreak(static_cast<SCCOL>(nPos), nTab, false, true);
@@ -3389,7 +3381,7 @@ sal_Bool ScDocFunc::RemovePageBreak( sal_Bool bColumn, const ScAddress& rPos,
pDoc->UpdatePageBreaks( nTab );
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
if (bColumn)
{
@@ -3585,7 +3577,7 @@ sal_Bool ScDocFunc::ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhic
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
// #i12940# ClearItems is called (from setPropertyToDefault) directly with uno object's cached
@@ -3594,11 +3586,10 @@ sal_Bool ScDocFunc::ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhic
ScRange aMarkRange;
ScMarkData aMultiMark = rMark;
- aMultiMark.SetMarking(sal_False); // for MarkToMulti
+ aMultiMark.SetMarking(false); // for MarkToMulti
aMultiMark.MarkToMulti();
aMultiMark.GetMultiMarkArea( aMarkRange );
-// if (bRecord)
if (bUndo)
{
SCTAB nStartTab = aMarkRange.aStart.Tab();
@@ -3633,13 +3624,12 @@ sal_Bool ScDocFunc::ChangeIndent( const ScMarkData& rMark, sal_Bool bIncrement,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
ScRange aMarkRange;
rMark.GetMultiMarkArea( aMarkRange );
-// if (bRecord)
if (bUndo)
{
SCTAB nStartTab = aMarkRange.aStart.Tab();
@@ -3688,7 +3678,7 @@ sal_Bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMar
{
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3698,7 +3688,7 @@ sal_Bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMar
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
aMark = *pTabMark;
@@ -3729,13 +3719,13 @@ sal_Bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMar
ScRange aCopyRange = rRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aStart.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, sal_False, pUndoDoc, &aMark );
+ pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, false, pUndoDoc, &aMark );
if (bSize)
{
pDoc->CopyToDocument( nStartCol,0,0, nEndCol,MAXROW,nTabCount-1,
- IDF_NONE, sal_False, pUndoDoc, &aMark );
+ IDF_NONE, false, pUndoDoc, &aMark );
pDoc->CopyToDocument( 0,nStartRow,0, MAXCOL,nEndRow,nTabCount-1,
- IDF_NONE, sal_False, pUndoDoc, &aMark );
+ IDF_NONE, false, pUndoDoc, &aMark );
}
pDoc->BeginDrawUndo();
}
@@ -3744,21 +3734,14 @@ sal_Bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMar
if (bSize)
{
-/* SCCOL nCols[2];
- nCols[0] = nStartCol;
- nCols[1] = nEndCol;
- SCROW nRows[2];
- nRows[0] = nStartRow;
- nRows[1] = nEndRow;
-*/
SCCOLROW nCols[2] = { nStartCol, nEndCol };
SCCOLROW nRows[2] = { nStartRow, nEndRow };
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (aMark.GetTableSelect(nTab))
{
- SetWidthOrHeight( sal_True, 1,nCols, nTab, SC_SIZE_VISOPT, STD_EXTRA_WIDTH, sal_False, sal_True);
- SetWidthOrHeight( sal_False,1,nRows, nTab, SC_SIZE_VISOPT, 0, sal_False, sal_False);
+ SetWidthOrHeight( sal_True, 1,nCols, nTab, SC_SIZE_VISOPT, STD_EXTRA_WIDTH, false, sal_True);
+ SetWidthOrHeight( false,1,nRows, nTab, SC_SIZE_VISOPT, 0, false, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP );
}
@@ -3769,7 +3752,7 @@ sal_Bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMar
if (aMark.GetTableSelect(nTab))
{
sal_Bool bAdj = AdjustRowHeight( ScRange(nStartCol, nStartRow, nTab,
- nEndCol, nEndRow, nTab), sal_False );
+ nEndCol, nEndRow, nTab), false );
if (bAdj)
rDocShell.PostPaint( 0,nStartRow,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT );
@@ -3801,7 +3784,7 @@ sal_Bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMa
{
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3827,13 +3810,13 @@ sal_Bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMa
WaitObject aWait( rDocShell.GetActiveDialogParent() );
ScDocument* pUndoDoc = NULL;
-// if (bRecord) // immer
+
if (bUndo)
{
//! auch bei Undo selektierte Tabellen beruecksichtigen
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
// use TokenArray if given, string (and flags) otherwise
@@ -3863,7 +3846,6 @@ sal_Bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMa
pDoc->InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
aMark, rString, NULL, eGrammar);
-// if (bRecord) // immer
if (bUndo)
{
//! auch bei Undo selektierte Tabellen beruecksichtigen
@@ -3890,7 +3872,7 @@ sal_Bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3900,7 +3882,7 @@ sal_Bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -3921,7 +3903,7 @@ sal_Bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
//! auch bei Undo selektierte Tabellen beruecksichtigen
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoTabOp( &rDocShell,
@@ -3963,7 +3945,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar
{
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3973,7 +3955,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -4028,7 +4010,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar
ScRange aCopyRange = aDestArea;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_AUTOFILL, sal_False, pUndoDoc, &aMark );
+ pDoc->CopyToDocument( aCopyRange, IDF_AUTOFILL, false, pUndoDoc, &aMark );
}
pDoc->Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
@@ -4045,7 +4027,6 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar
}
rDocShell.PostPaintGridAll();
-// rDocShell.PostPaintDataChanged();
aModificator.SetDocumentModified();
bSuccess = sal_True;
@@ -4063,7 +4044,7 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar
{
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -4073,7 +4054,7 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -4097,7 +4078,7 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar
aSourceArea.aEnd.Col(), aSourceArea.aEnd.Row(), aSourceArea.aEnd.Tab(),
DirFromFillDir(eDir) );
- // #27665# mindestens eine Zeile/Spalte als Quellbereich behalten:
+ // mindestens eine Zeile/Spalte als Quellbereich behalten:
SCSIZE nTotLines = ( eDir == FILL_TO_BOTTOM || eDir == FILL_TO_TOP ) ?
static_cast<SCSIZE>( aSourceArea.aEnd.Row() - aSourceArea.aStart.Row() + 1 ) :
static_cast<SCSIZE>( aSourceArea.aEnd.Col() - aSourceArea.aStart.Col() + 1 );
@@ -4135,7 +4116,7 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar
pDoc->CopyToDocument(
aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0,
aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1,
- IDF_AUTOFILL, sal_False, pUndoDoc, &aMark );
+ IDF_AUTOFILL, false, pUndoDoc, &aMark );
}
if (aDestArea.aStart.Col() <= aDestArea.aEnd.Col() &&
@@ -4154,7 +4135,6 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar
AdjustRowHeight(rRange);
rDocShell.PostPaintGridAll();
-// rDocShell.PostPaintDataChanged();
aModificator.SetDocumentModified();
}
@@ -4177,6 +4157,13 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar
sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, sal_uLong nCount, sal_Bool bRecord, sal_Bool bApi )
{
+ double fStep = 1.0;
+ double fMax = MAXDOUBLE;
+ return FillAuto( rRange, pTabMark, eDir, FILL_AUTO, FILL_DAY, nCount, fStep, fMax, bRecord, bApi );
+}
+
+sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, sal_uLong nCount, double fStep, double fMax, sal_Bool bRecord, sal_Bool bApi )
+{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
@@ -4188,7 +4175,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -4202,10 +4189,6 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
ScRange aSourceArea = rRange;
ScRange aDestArea = rRange;
- FillCmd eCmd = FILL_AUTO;
- FillDateCmd eDateCmd = FILL_DAY;
- double fStep = 1.0;
- double fMax = MAXDOUBLE;
switch (eDir)
{
@@ -4215,7 +4198,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
case FILL_TO_TOP:
if (nCount > sal::static_int_cast<sal_uLong>( aSourceArea.aStart.Row() ))
{
- DBG_ERROR("FillAuto: Row < 0");
+ OSL_FAIL("FillAuto: Row < 0");
nCount = aSourceArea.aStart.Row();
}
aDestArea.aStart.SetRow( sal::static_int_cast<SCROW>( aSourceArea.aStart.Row() - nCount ) );
@@ -4226,13 +4209,13 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
case FILL_TO_LEFT:
if (nCount > sal::static_int_cast<sal_uLong>( aSourceArea.aStart.Col() ))
{
- DBG_ERROR("FillAuto: Col < 0");
+ OSL_FAIL("FillAuto: Col < 0");
nCount = aSourceArea.aStart.Col();
}
aDestArea.aStart.SetCol( sal::static_int_cast<SCCOL>( aSourceArea.aStart.Col() - nCount ) );
break;
default:
- DBG_ERROR("Falsche Richtung bei FillAuto");
+ OSL_FAIL("Falsche Richtung bei FillAuto");
break;
}
@@ -4245,7 +4228,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
if ( pDoc->HasSelectedBlockMatrixFragment( nStartCol, nStartRow,
@@ -4253,7 +4236,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
{
if (!bApi)
rDocShell.ErrorMessage(STR_MATRIXFRAGMENTERR);
- return sal_False;
+ return false;
}
WaitObject aWait( rDocShell.GetActiveDialogParent() );
@@ -4274,7 +4257,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
pDoc->CopyToDocument(
aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0,
aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1,
- IDF_AUTOFILL, sal_False, pUndoDoc, &aMark );
+ IDF_AUTOFILL, false, pUndoDoc, &aMark );
}
pDoc->Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
@@ -4292,7 +4275,6 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
}
rDocShell.PostPaintGridAll();
-// rDocShell.PostPaintDataChanged();
aModificator.SetDocumentModified();
rRange = aDestArea; // Zielbereich zurueckgeben (zum Markieren)
@@ -4301,86 +4283,110 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
//------------------------------------------------------------------------
-sal_Bool ScDocFunc::MergeCells( const ScRange& rRange, sal_Bool bContents, sal_Bool bRecord, sal_Bool bApi )
+sal_Bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, sal_Bool bContents, sal_Bool bRecord, sal_Bool bApi )
{
+ using ::std::set;
+
ScDocShellModificator aModificator( rDocShell );
+ SCCOL nStartCol = rOption.mnStartCol;
+ SCROW nStartRow = rOption.mnStartRow;
+ SCCOL nEndCol = rOption.mnEndCol;
+ SCROW nEndRow = rOption.mnEndRow;
+ if ((nStartCol == nEndCol && nStartRow == nEndRow) || rOption.maTabs.empty())
+ {
+ // Nothing to do. Bail out quick.
+ return true;
+ }
+
ScDocument* pDoc = rDocShell.GetDocument();
- SCCOL nStartCol = rRange.aStart.Col();
- SCROW nStartRow = rRange.aStart.Row();
- SCCOL nEndCol = rRange.aEnd.Col();
- SCROW nEndRow = rRange.aEnd.Row();
- SCTAB nTab = rRange.aStart.Tab();
+ set<SCTAB>::const_iterator itrBeg = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end();
+ SCTAB nTab1 = *itrBeg, nTab2 = *rOption.maTabs.rbegin();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
- ScEditableTester aTester( pDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow );
- if (!aTester.IsEditable())
+ for (set<SCTAB>::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- if (!bApi)
- rDocShell.ErrorMessage(aTester.GetMessageId());
- return sal_False;
- }
+ ScEditableTester aTester( pDoc, *itr, nStartCol, nStartRow, nEndCol, nEndRow );
+ if (!aTester.IsEditable())
+ {
+ if (!bApi)
+ rDocShell.ErrorMessage(aTester.GetMessageId());
+ return false;
+ }
- if ( nStartCol == nEndCol && nStartRow == nEndRow )
- {
- // nichts zu tun
- return sal_True;
+ if ( pDoc->HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr,
+ HASATTR_MERGED | HASATTR_OVERLAPPED ) )
+ {
+ // "Zusammenfassen nicht verschachteln !"
+ if (!bApi)
+ rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0);
+ return false;
+ }
}
- if ( pDoc->HasAttrib( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
- HASATTR_MERGED | HASATTR_OVERLAPPED ) )
+ ScDocument* pUndoDoc = NULL;
+ bool bNeedContentsUndo = false;
+ for (set<SCTAB>::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- // "Zusammenfassen nicht verschachteln !"
- if (!bApi)
- rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0);
- return sal_False;
- }
+ SCTAB nTab = *itr;
+ bool bNeedContents = bContents &&
+ ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
+ !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) );
- sal_Bool bNeedContents = bContents &&
- ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
- !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) );
+ if (bRecord)
+ {
+ // test if the range contains other notes which also implies that we need an undo document
+ bool bHasNotes = false;
+ for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() )
+ for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() )
+ bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0);
- ScDocument* pUndoDoc = 0;
- if (bRecord)
- {
- // test if the range contains other notes which also implies that we need an undo document
- bool bHasNotes = false;
- for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() )
- for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() )
- bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0);
+ if (bNeedContents || bHasNotes || rOption.mbCenter)
+ {
+ if (!pUndoDoc)
+ {
+ pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
+ pUndoDoc->InitUndo(pDoc, nTab1, nTab2);
+ }
+ // note captions are collected by drawing undo
+ pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
+ IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
+ }
+ if( bHasNotes )
+ pDoc->BeginDrawUndo();
+ }
+
+ if (bNeedContents)
+ pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+ pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
- if (bNeedContents || bHasNotes)
+ if (rOption.mbCenter)
{
- pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
- // note captions are collected by drawing undo
- pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
- IDF_ALL|IDF_NOCAPTIONS, sal_False, pUndoDoc );
+ pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) );
+ pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) );
}
- if( bHasNotes )
- pDoc->BeginDrawUndo();
- }
- if (bNeedContents)
- pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
- pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+ if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) )
+ rDocShell.PostPaint( nStartCol, nStartRow, nTab,
+ nEndCol, nEndRow, nTab, PAINT_GRID );
+ if (bNeedContents || rOption.mbCenter)
+ {
+ ScRange aRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab);
+ pDoc->SetDirty(aRange);
+ }
- if( bRecord )
+ bNeedContentsUndo |= bNeedContents;
+ }
+
+ if (pUndoDoc)
{
- SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : 0;
+ SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : NULL;
rDocShell.GetUndoManager()->AddUndoAction(
- new ScUndoMerge( &rDocShell,
- nStartCol, nStartRow, nTab,
- nEndCol, nEndRow, nTab, bNeedContents, pUndoDoc, pDrawUndo ) );
+ new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, pUndoDoc, pDrawUndo) );
}
- if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) )
- rDocShell.PostPaint( nStartCol, nStartRow, nTab,
- nEndCol, nEndRow, nTab, PAINT_GRID );
- if (bNeedContents)
- pDoc->SetDirty( rRange );
aModificator.SetDocumentModified();
SfxBindings* pBindings = rDocShell.GetViewBindings();
@@ -4396,61 +4402,93 @@ sal_Bool ScDocFunc::MergeCells( const ScRange& rRange, sal_Bool bContents, sal_B
sal_Bool ScDocFunc::UnmergeCells( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi )
{
- ScDocShellModificator aModificator( rDocShell );
+ ScCellMergeOption aOption(rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row());
+ SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab();
+ for (SCTAB i = nTab1; i <= nTab2; ++i)
+ aOption.maTabs.insert(i);
+ return UnmergeCells(aOption, bRecord, bApi);
+}
+
+bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, sal_Bool bRecord, sal_Bool bApi )
+{
+ using ::std::set;
+
+ if (rOption.maTabs.empty())
+ // Nothing to unmerge.
+ return true;
+
+ ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
- SCTAB nTab = rRange.aStart.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
- if ( pDoc->HasAttrib( rRange, HASATTR_MERGED ) )
+ ScDocument* pUndoDoc = NULL;
+ bool bBeep = false;
+ for (set<SCTAB>::const_iterator itr = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end();
+ itr != itrEnd; ++itr)
{
- ScRange aExtended = rRange;
- pDoc->ExtendMerge( aExtended );
+ SCTAB nTab = *itr;
+ ScRange aRange = rOption.getSingleRange(nTab);
+ if ( !pDoc->HasAttrib(aRange, HASATTR_MERGED) )
+ {
+ bBeep = true;
+ continue;
+ }
+
+ ScRange aExtended = aRange;
+ pDoc->ExtendMerge(aExtended);
ScRange aRefresh = aExtended;
- pDoc->ExtendOverlapped( aRefresh );
+ pDoc->ExtendOverlapped(aRefresh);
if (bRecord)
{
- ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aExtended, IDF_ATTRIB, sal_False, pUndoDoc );
- rDocShell.GetUndoManager()->AddUndoAction(
- new ScUndoRemoveMerge( &rDocShell, rRange, pUndoDoc ) );
+ if (!pUndoDoc)
+ {
+ pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
+ pUndoDoc->InitUndo(pDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin());
+ }
+ pDoc->CopyToDocument(aExtended, IDF_ATTRIB, false, pUndoDoc);
}
const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
ScPatternAttr aPattern( pDoc->GetPool() );
aPattern.GetItemSet().Put( rDefAttr );
- pDoc->ApplyPatternAreaTab( rRange.aStart.Col(), rRange.aStart.Row(),
- rRange.aEnd.Col(), rRange.aEnd.Row(), nTab,
- aPattern );
+ pDoc->ApplyPatternAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row(), nTab,
+ aPattern );
pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(),
- aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
- SC_MF_HOR | SC_MF_VER );
+ aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
+ SC_MF_HOR | SC_MF_VER );
- pDoc->ExtendMerge( aRefresh, sal_True, sal_False );
+ pDoc->ExtendMerge( aRefresh, sal_True, false );
if ( !AdjustRowHeight( aExtended ) )
rDocShell.PostPaint( aExtended, PAINT_GRID );
- aModificator.SetDocumentModified();
}
- else if (!bApi)
- Sound::Beep(); //! sal_False zurueck???
+ if (bBeep && !bApi)
+ Sound::Beep();
+
+ if (bRecord)
+ {
+ rDocShell.GetUndoManager()->AddUndoAction(
+ new ScUndoRemoveMerge( &rDocShell, rOption, pUndoDoc ) );
+ }
+ aModificator.SetDocumentModified();
return sal_True;
}
//------------------------------------------------------------------------
-sal_Bool ScDocFunc::ModifyRangeNames( const ScRangeName& rNewRanges, sal_Bool bApi )
+bool ScDocFunc::ModifyRangeNames( const ScRangeName& rNewRanges )
{
- return SetNewRangeNames( new ScRangeName( rNewRanges ), bApi );
+ return SetNewRangeNames( new ScRangeName(rNewRanges) );
}
-sal_Bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, sal_Bool /* bApi */ ) // takes ownership of pNewRanges
+bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc ) // takes ownership of pNewRanges
{
ScDocShellModificator aModificator( rDocShell );
@@ -4476,12 +4514,15 @@ sal_Bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, sal_Bool /* bApi
pDoc->CompileNameFormula( sal_True ); // CreateFormulaString
pDoc->SetRangeName( pNewRanges ); // takes ownership
if ( bCompile )
- pDoc->CompileNameFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileNameFormula( false ); // CompileFormulaString
- aModificator.SetDocumentModified();
- SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
+ if (bModifyDoc)
+ {
+ aModificator.SetDocumentModified();
+ SFX_APP()->Broadcast( SfxSimpleHint(SC_HINT_AREAS_CHANGED) );
+ }
- return sal_True;
+ return true;
}
//------------------------------------------------------------------------
@@ -4505,11 +4546,10 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
String aContent;
ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format( aContent, SCR_ABS_3D, pDoc );
- sal_Bool bInsert = sal_False;
- sal_uInt16 nOldPos;
- if (rList.SearchName( aName, nOldPos )) // vorhanden ?
+ bool bInsert = false;
+ ScRangeData* pOld = rList.findByName(aName);
+ if (pOld)
{
- ScRangeData* pOld = rList[nOldPos];
String aOldStr;
pOld->GetSymbol( aOldStr );
if (aOldStr != aContent)
@@ -4529,8 +4569,8 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
aMessage ).Execute();
if ( nResult == RET_YES )
{
- rList.AtFree(nOldPos);
- bInsert = sal_True;
+ rList.erase(*pOld);
+ bInsert = true;
}
else if ( nResult == RET_CANCEL )
rCancel = sal_True;
@@ -4538,15 +4578,15 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
}
}
else
- bInsert = sal_True;
+ bInsert = true;
if (bInsert)
{
ScRangeData* pData = new ScRangeData( pDoc, aName, aContent,
ScAddress( nPosX, nPosY, nTab));
- if (!rList.Insert(pData))
+ if (!rList.insert(pData))
{
- DBG_ERROR("nanu?");
+ OSL_FAIL("nanu?");
delete pData;
}
}
@@ -4557,11 +4597,11 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
sal_Bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_Bool bApi )
{
if (!nFlags)
- return sal_False; // war nix
+ return false; // war nix
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
@@ -4572,17 +4612,17 @@ sal_Bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_B
sal_Bool bValid = sal_True;
if ( nFlags & ( NAME_TOP | NAME_BOTTOM ) )
if ( nStartRow == nEndRow )
- bValid = sal_False;
+ bValid = false;
if ( nFlags & ( NAME_LEFT | NAME_RIGHT ) )
if ( nStartCol == nEndCol )
- bValid = sal_False;
+ bValid = false;
if (bValid)
{
ScDocument* pDoc = rDocShell.GetDocument();
ScRangeName* pNames = pDoc->GetRangeName();
if (!pNames)
- return sal_False; // soll nicht sein
+ return false; // soll nicht sein
ScRangeName aNewRanges( *pNames );
sal_Bool bTop = ( ( nFlags & NAME_TOP ) != 0 );
@@ -4604,7 +4644,7 @@ sal_Bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_B
if ( bRight )
--nContX2;
- sal_Bool bCancel = sal_False;
+ sal_Bool bCancel = false;
SCCOL i;
SCROW j;
@@ -4630,7 +4670,7 @@ sal_Bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_B
if ( bBottom && bRight )
CreateOneName( aNewRanges, nEndCol,nEndRow,nTab, nContX1,nContY1,nContX2,nContY2, bCancel, bApi );
- bDone = ModifyRangeNames( aNewRanges, bApi );
+ bDone = ModifyRangeNames( aNewRanges );
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
@@ -4646,20 +4686,19 @@ sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
ScDocShellModificator aModificator( rDocShell );
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
const sal_Bool bRecord = pDoc->IsUndoEnabled();
SCTAB nTab = rStartPos.Tab();
ScDocument* pUndoDoc = NULL;
ScRangeName* pList = pDoc->GetRangeName();
- sal_uInt16 nCount = pList->GetCount();
sal_uInt16 nValidCount = 0;
- sal_uInt16 i;
- for (i=0; i<nCount; i++)
+ ScRangeName::iterator itrBeg = pList->begin(), itrEnd = pList->end();
+ for (ScRangeName::iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pList)[i];
- if ( !pData->HasType( RT_DATABASE ) && !pData->HasType( RT_SHARED ) )
+ const ScRangeData& r = *itr;
+ if (r.HasType(RT_DATABASE && !r.HasType(RT_SHARED)))
++nValidCount;
}
@@ -4678,18 +4717,18 @@ sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab );
pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
- IDF_ALL, sal_False, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
pDoc->BeginDrawUndo(); // wegen Hoehenanpassung
}
ScRangeData** ppSortArray = new ScRangeData* [ nValidCount ];
sal_uInt16 j = 0;
- for (i=0; i<nCount; i++)
+ for (ScRangeName::iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pList)[i];
- if ( !pData->HasType( RT_DATABASE ) && !pData->HasType( RT_SHARED ) )
- ppSortArray[j++] = pData;
+ ScRangeData& r = *itr;
+ if (!r.HasType(RT_DATABASE) && !r.HasType(RT_SHARED))
+ ppSortArray[j++] = &r;
}
#ifndef ICC
qsort( (void*)ppSortArray, nValidCount, sizeof(ScRangeData*),
@@ -4722,7 +4761,7 @@ sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, nTab, nTab );
pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
- IDF_ALL, sal_False, pRedoDoc );
+ IDF_ALL, false, pRedoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoListNames( &rDocShell,
@@ -4732,7 +4771,7 @@ sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
if (!AdjustRowHeight(ScRange(0,nStartRow,nTab,MAXCOL,nEndRow,nTab)))
rDocShell.PostPaint( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, PAINT_GRID );
-//! rDocShell.UpdateOle(GetViewData());
+
aModificator.SetDocumentModified();
bDone = sal_True;
}
@@ -4753,7 +4792,7 @@ sal_Bool ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNe
sal_Bool bUndo(pDoc->IsUndoEnabled());
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
String aFormula;
pDoc->GetFormula( nStartCol, nStartRow, nTab, aFormula );
@@ -4774,11 +4813,11 @@ sal_Bool ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNe
if ( DeleteContents( aMark, IDF_CONTENTS, sal_True, bApi ) )
{
// GRAM_PODF_A1 for API compatibility.
- bRet = EnterMatrix( aNewRange, &aMark, NULL, aFormula, bApi, sal_False, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
+ bRet = EnterMatrix( aNewRange, &aMark, NULL, aFormula, bApi, false, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
if (!bRet)
{
// versuchen, alten Zustand wiederherzustellen
- EnterMatrix( rOldRange, &aMark, NULL, aFormula, bApi, sal_False, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
+ EnterMatrix( rOldRange, &aMark, NULL, aFormula, bApi, false, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
}
}
@@ -4883,3 +4922,4 @@ sal_Bool ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 734fd20a71d7..6ad8123c3659 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
#include <editeng/svxenum.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/algitem.hxx>
#include <sot/clsids.hxx>
@@ -64,16 +66,20 @@
#include "chgtrack.hxx"
#include "chgviset.hxx"
#include <sfx2/request.hxx>
+#include <com/sun/star/awt/Key.hpp>
+#include <com/sun/star/awt/KeyModifier.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/script/vba/VBAEventId.hpp>
#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <com/sun/star/sheet/XSpreadsheetView.hpp>
#include <com/sun/star/task/XJob.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
#include <basic/sbstar.hxx>
#include <basic/basmgr.hxx>
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
#include <sot/formats.hxx>
#define SOT_FORMATSTR_ID_STARCALC_30 SOT_FORMATSTR_ID_STARCALC
@@ -120,54 +126,61 @@
#include "optsolver.hxx"
#include "sheetdata.hxx"
#include "tabprotection.hxx"
+#include "docparam.hxx"
#include "docsh.hxx"
#include "docshimp.hxx"
+#include "sizedev.hxx"
#include <rtl/logfile.hxx>
#include <comphelper/processfactory.hxx>
#include "uiitems.hxx"
#include "cellsuno.hxx"
+#include "dpobject.hxx"
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
using namespace com::sun::star;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::lang::XMultiServiceFactory;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
+using ::boost::shared_ptr;
+using ::std::vector;
// STATIC DATA -----------------------------------------------------------
// Stream-Namen im Storage
-const sal_Char __FAR_DATA ScDocShell::pStarCalcDoc[] = STRING_SCSTREAM; // "StarCalcDocument"
-const sal_Char __FAR_DATA ScDocShell::pStyleName[] = "SfxStyleSheets";
+const sal_Char ScDocShell::pStarCalcDoc[] = STRING_SCSTREAM; // "StarCalcDocument"
+const sal_Char ScDocShell::pStyleName[] = "SfxStyleSheets";
// Filter-Namen (wie in sclib.cxx)
-static const sal_Char __FAR_DATA pFilterSc50[] = "StarCalc 5.0";
-//static const sal_Char __FAR_DATA pFilterSc50Temp[] = "StarCalc 5.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterSc40[] = "StarCalc 4.0";
-//static const sal_Char __FAR_DATA pFilterSc40Temp[] = "StarCalc 4.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterSc30[] = "StarCalc 3.0";
-//static const sal_Char __FAR_DATA pFilterSc30Temp[] = "StarCalc 3.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterSc10[] = "StarCalc 1.0";
-static const sal_Char __FAR_DATA pFilterXML[] = "StarOffice XML (Calc)";
-static const sal_Char __FAR_DATA pFilterAscii[] = "Text - txt - csv (StarCalc)";
-static const sal_Char __FAR_DATA pFilterLotus[] = "Lotus";
-static const sal_Char __FAR_DATA pFilterQPro6[] = "Quattro Pro 6.0";
-static const sal_Char __FAR_DATA pFilterExcel4[] = "MS Excel 4.0";
-static const sal_Char __FAR_DATA pFilterEx4Temp[] = "MS Excel 4.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterExcel5[] = "MS Excel 5.0/95";
-static const sal_Char __FAR_DATA pFilterEx5Temp[] = "MS Excel 5.0/95 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterExcel95[] = "MS Excel 95";
-static const sal_Char __FAR_DATA pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterExcel97[] = "MS Excel 97";
-static const sal_Char __FAR_DATA pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterEx07Xml[] = "MS Excel 2007 XML";
-static const sal_Char __FAR_DATA pFilterDBase[] = "dBase";
-static const sal_Char __FAR_DATA pFilterDif[] = "DIF";
-static const sal_Char __FAR_DATA pFilterSylk[] = "SYLK";
-static const sal_Char __FAR_DATA pFilterHtml[] = "HTML (StarCalc)";
-static const sal_Char __FAR_DATA pFilterHtmlWebQ[] = "calc_HTML_WebQuery";
-static const sal_Char __FAR_DATA pFilterRtf[] = "Rich Text Format (StarCalc)";
+static const sal_Char pFilterSc50[] = "StarCalc 5.0";
+static const sal_Char pFilterSc40[] = "StarCalc 4.0";
+static const sal_Char pFilterSc30[] = "StarCalc 3.0";
+static const sal_Char pFilterSc10[] = "StarCalc 1.0";
+static const sal_Char pFilterXML[] = "StarOffice XML (Calc)";
+static const sal_Char pFilterAscii[] = "Text - txt - csv (StarCalc)";
+static const sal_Char pFilterLotus[] = "Lotus";
+static const sal_Char pFilterQPro6[] = "Quattro Pro 6.0";
+static const sal_Char pFilterExcel4[] = "MS Excel 4.0";
+static const sal_Char pFilterEx4Temp[] = "MS Excel 4.0 Vorlage/Template";
+static const sal_Char pFilterExcel5[] = "MS Excel 5.0/95";
+static const sal_Char pFilterEx5Temp[] = "MS Excel 5.0/95 Vorlage/Template";
+static const sal_Char pFilterExcel95[] = "MS Excel 95";
+static const sal_Char pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template";
+static const sal_Char pFilterExcel97[] = "MS Excel 97";
+static const sal_Char pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template";
+static const sal_Char pFilterDBase[] = "dBase";
+static const sal_Char pFilterDif[] = "DIF";
+static const sal_Char pFilterSylk[] = "SYLK";
+static const sal_Char pFilterHtml[] = "HTML (StarCalc)";
+static const sal_Char pFilterHtmlWebQ[] = "calc_HTML_WebQuery";
+static const sal_Char pFilterRtf[] = "Rich Text Format (StarCalc)";
//----------------------------------------------------------------------
@@ -177,7 +190,6 @@ static const sal_Char __FAR_DATA pFilterRtf[] = "Rich Text Format (StarCal
SFX_IMPL_INTERFACE(ScDocShell,SfxObjectShell, ScResId(SCSTR_DOCSHELL))
{
- SFX_CHILDWINDOW_REGISTRATION( SID_HYPERLINK_INSERT );
}
// GlobalName der aktuellen Version:
@@ -187,7 +199,7 @@ TYPEINIT1( ScDocShell, SfxObjectShell ); // SfxInPlaceObject: kein Type-I
//------------------------------------------------------------------
-void __EXPORT ScDocShell::FillClass( SvGlobalName* pClassName,
+void ScDocShell::FillClass( SvGlobalName* pClassName,
sal_uInt32* pFormat,
String* /* pAppName */,
String* pFullTypeName,
@@ -211,7 +223,7 @@ void __EXPORT ScDocShell::FillClass( SvGlobalName* pClassName,
}
else
{
- DBG_ERROR("wat fuer ne Version?");
+ OSL_FAIL("wat fuer ne Version?");
}
}
@@ -255,7 +267,7 @@ sal_uInt16 ScDocShell::GetHiddenInformationState( sal_uInt16 nStates )
{
SCTAB nTableCount = aDocument.GetTableCount();
SCTAB nTable = 0;
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while ( nTable < nTableCount && !bFound )
{
ScCellIterator aCellIter( &aDocument, 0,0, nTable, MAXCOL,MAXROW, nTable );
@@ -282,7 +294,7 @@ void ScDocShell::BeforeXMLLoading()
aDocument.SetImportingXML( sal_True );
aDocument.EnableExecuteLink( false ); // #i101304# to be safe, prevent nested loading from external references
- aDocument.EnableUndo( sal_False );
+ aDocument.EnableUndo( false );
// prevent unnecessary broadcasts and "half way listeners"
aDocument.SetInsertingFromOtherDoc( sal_True );
@@ -296,7 +308,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
{
UpdateLinks();
// don't prevent establishing of listeners anymore
- aDocument.SetInsertingFromOtherDoc( sal_False );
+ aDocument.SetInsertingFromOtherDoc( false );
if ( bRet )
{
ScChartListenerCollection* pChartListener = aDocument.GetChartListenerCollection();
@@ -328,7 +340,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
while ( bQuote && *pNameBuffer )
{
if ( *pNameBuffer == '\'' && *(pNameBuffer-1) != '\\' )
- bQuote = sal_False;
+ bQuote = false;
else if( !(*pNameBuffer == '\\' && *(pNameBuffer+1) == '\'') )
aDocURLBuffer.append(*pNameBuffer); // falls escaped Quote: nur Quote in den Namen
++pNameBuffer;
@@ -361,8 +373,8 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
ScDPCollection* pDPCollection = aDocument.GetDPCollection();
if ( pDPCollection )
{
- sal_uInt16 nDPCount = pDPCollection->GetCount();
- for (sal_uInt16 nDP=0; nDP<nDPCount; nDP++)
+ size_t nDPCount = pDPCollection->GetCount();
+ for (size_t nDP=0; nDP<nDPCount; ++nDP)
{
ScDPObject* pDPObj = (*pDPCollection)[nDP];
if ( !pDPObj->GetName().Len() )
@@ -370,15 +382,15 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
}
}
}
- ScColumn::bDoubleAlloc = sal_False;
+ ScColumn::bDoubleAlloc = false;
}
else
- aDocument.SetInsertingFromOtherDoc( sal_False );
+ aDocument.SetInsertingFromOtherDoc( false );
- aDocument.SetImportingXML( sal_False );
+ aDocument.SetImportingXML( false );
aDocument.EnableExecuteLink( true );
aDocument.EnableUndo( sal_True );
- bIsEmpty = sal_False;
+ bIsEmpty = false;
if (pModificator)
{
@@ -387,15 +399,36 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
}
else
{
- DBG_ERROR("The Modificator should exist");
+ OSL_FAIL("The Modificator should exist");
}
- aDocument.DisableIdle( sal_False );
+ aDocument.DisableIdle( false );
+}
+
+namespace {
+
+class LoadMediumGuard
+{
+public:
+ explicit LoadMediumGuard(ScDocument* pDoc) :
+ mpDoc(pDoc)
+ {
+ mpDoc->SetLoadingMedium(true);
+ }
+
+ ~LoadMediumGuard()
+ {
+ mpDoc->SetLoadingMedium(false);
+ }
+private:
+ ScDocument* mpDoc;
+};
+
}
sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor )
{
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScDocShell::LoadXML" );
+ LoadMediumGuard aLoadGuard(&aDocument);
// MacroCallMode is no longer needed, state is kept in SfxObjectShell now
@@ -410,17 +443,17 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un
ScXMLImportWrapper aImport( aDocument, pLoadMedium, xStor );
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
ErrCode nError = ERRCODE_NONE;
if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
- bRet = aImport.Import(sal_False, nError);
+ bRet = aImport.Import(false, nError);
else
bRet = aImport.Import(sal_True, nError);
if ( nError )
pLoadMedium->SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
- aDocument.SetXMLFromWrapper( sal_False );
+ aDocument.SetXMLFromWrapper( false );
AfterXMLLoading(bRet);
//! row heights...
@@ -435,21 +468,21 @@ sal_Bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const ::com::sun::star::un
aDocument.DisableIdle( sal_True );
ScXMLImportWrapper aImport( aDocument, pSaveMedium, xStor );
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
- bRet = aImport.Export(sal_False);
+ bRet = aImport.Export(false);
else
bRet = aImport.Export(sal_True);
- aDocument.DisableIdle( sal_False );
+ aDocument.DisableIdle( false );
return bRet;
}
-sal_Bool __EXPORT ScDocShell::Load( SfxMedium& rMedium )
+sal_Bool ScDocShell::Load( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::Load" );
-
+ LoadMediumGuard aLoadGuard(&aDocument);
ScRefreshTimerProtector( aDocument.GetRefreshTimerControlAddress() );
// only the latin script language is loaded
@@ -463,7 +496,7 @@ sal_Bool __EXPORT ScDocShell::Load( SfxMedium& rMedium )
{
if (GetMedium())
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
}
@@ -487,16 +520,16 @@ sal_Bool __EXPORT ScDocShell::Load( SfxMedium& rMedium )
InitItems();
CalcOutputFactor();
- // #73762# invalidate eventually temporary table areas
+ // invalidate eventually temporary table areas
if ( bRet )
aDocument.InvalidateTableArea();
- bIsEmpty = sal_False;
+ bIsEmpty = false;
FinishedLoading( SFX_LOADED_MAINDOCUMENT | SFX_LOADED_IMAGES );
return bRet;
}
-void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
+void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = aDocument.GetVbaEventProcessor();
if ( xVbaEvents.is() ) try
@@ -609,7 +642,7 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// the readonly documents should not be opened in shared mode
if ( HasSharedXMLFlagSet() && !SC_MOD()->IsInSharedDocLoading() && !IsReadOnly() )
{
- if ( SwitchToShared( sal_True, sal_False ) )
+ if ( SwitchToShared( sal_True, false ) )
{
ScViewData* pViewData = GetViewData();
ScTabView* pTabView = ( pViewData ? dynamic_cast< ScTabView* >( pViewData->GetView() ) : NULL );
@@ -675,7 +708,7 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
SfxFrame* pFrame = ( pViewFrame ? &pViewFrame->GetFrame() : NULL );
uno::Reference< frame::XController > xController = ( pFrame ? pFrame->GetController() : 0 );
uno::Reference< sheet::XSpreadsheetView > xSpreadsheetView( xController, uno::UNO_QUERY_THROW );
- aArgsForJob[0] = beans::NamedValue( ::rtl::OUString::createFromAscii( "SpreadsheetView" ),
+ aArgsForJob[0] = beans::NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "SpreadsheetView" )),
uno::makeAny( xSpreadsheetView ) );
xJob->execute( aArgsForJob );
}
@@ -795,8 +828,8 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScChangeViewSettings* pChangeViewSet = aDocument.GetChangeViewSettings();
if ( pChangeViewSet && pChangeViewSet->ShowChanges() )
{
- pChangeViewSet->SetShowChanges( sal_False );
- pChangeViewSet->SetShowAccepted( sal_False );
+ pChangeViewSet->SetShowChanges( false );
+ pChangeViewSet->SetShowAccepted( false );
aDocument.SetChangeViewSettings( *pChangeViewSet );
bChangedViewSettings = true;
}
@@ -804,14 +837,14 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
uno::Reference< frame::XStorable > xStor( GetModel(), uno::UNO_QUERY_THROW );
// TODO/LATER: More entries from the MediaDescriptor might be interesting for the merge
uno::Sequence< beans::PropertyValue > aValues(1);
- aValues[0].Name = ::rtl::OUString::createFromAscii( "FilterName" );
+ aValues[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName"));
aValues[0].Value <<= ::rtl::OUString( GetMedium()->GetFilter()->GetFilterName() );
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false);
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
{
aValues.realloc( 2 );
- aValues[1].Name = ::rtl::OUString::createFromAscii( "Password" );
+ aValues[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Password") );
aValues[1].Value <<= ::rtl::OUString( pPasswordItem->GetValue() );
}
@@ -856,7 +889,7 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
catch ( uno::Exception& )
{
- DBG_ERROR( "SFX_EVENT_SAVEDOC: caught exception\n" );
+ OSL_FAIL( "SFX_EVENT_SAVEDOC: caught exception\n" );
SC_MOD()->SetInSharedDocSaving( false );
try
@@ -917,19 +950,19 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// Inhalte fuer Organizer laden
-sal_Bool __EXPORT ScDocShell::LoadFrom( SfxMedium& rMedium )
+sal_Bool ScDocShell::LoadFrom( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::LoadFrom" );
-
+ LoadMediumGuard aLoadGuard(&aDocument);
ScRefreshTimerProtector( aDocument.GetRefreshTimerControlAddress() );
WaitObject aWait( GetActiveDialogParent() );
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
if (GetMedium())
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
}
@@ -972,34 +1005,13 @@ static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLa
rDateConvert = static_cast<bool>(aTokens[1].toInt32());
}
-namespace {
-
-class LoadMediumGuard
-{
-public:
- explicit LoadMediumGuard(ScDocument* pDoc) :
- mpDoc(pDoc)
- {
- mpDoc->SetLoadingMedium(true);
- }
-
- ~LoadMediumGuard()
- {
- mpDoc->SetLoadingMedium(false);
- }
-private:
- ScDocument* mpDoc;
-};
-
-}
-
-sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
+sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ConvertFrom" );
LoadMediumGuard aLoadGuard(&aDocument);
- sal_Bool bRet = sal_False; // sal_False heisst Benutzerabbruch !!
+ sal_Bool bRet = false; // sal_False heisst Benutzerabbruch !!
// bei Fehler: Fehler am Stream setzen!!
ScRefreshTimerProtector( aDocument.GetRefreshTimerControlAddress() );
@@ -1007,13 +1019,14 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
GetUndoManager()->Clear();
// ob nach dem Import optimale Spaltenbreiten gesetzt werden sollen
- sal_Bool bSetColWidths = sal_False;
- sal_Bool bSetSimpleTextColWidths = sal_False;
- sal_Bool bSimpleColWidth[MAXCOLCOUNT];
- memset( bSimpleColWidth, 1, (MAXCOLCOUNT) * sizeof(sal_Bool) );
+ sal_Bool bSetColWidths = false;
+ sal_Bool bSetSimpleTextColWidths = false;
+ ScColWidthParam aColWidthParam[MAXCOLCOUNT];
ScRange aColWidthRange;
// ob nach dem Import optimale Zeilenhoehen gesetzt werden sollen
- sal_Bool bSetRowHeights = sal_False;
+ sal_Bool bSetRowHeights = false;
+
+ vector<ScDocRowHeightUpdater::TabRanges> aRecalcRowRangesArray;
aConvFilterName.Erase(); //@ #BugId 54198
@@ -1022,7 +1035,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
// Datei uebertragen wird.
rMedium.GetPhysicalName(); //! CreateFileStream direkt rufen, wenn verfuegbar
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
const SfxFilter* pFilter = rMedium.GetFilter();
@@ -1075,7 +1088,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
ScColumn::bDoubleAlloc = sal_True;
FltError eError = ScFormatFilter::Get().ScImportLotus123( rMedium, &aDocument,
ScGlobal::GetCharsetValue(sItStr));
- ScColumn::bDoubleAlloc = sal_False;
+ ScColumn::bDoubleAlloc = false;
if (eError != eERR_OK)
{
if (!GetError())
@@ -1104,15 +1117,15 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
eFormat = EIF_BIFF8;
MakeDrawLayer(); //! im Filter
- CalcOutputFactor(); // #93255# prepare update of row height
- ScColumn::bDoubleAlloc = sal_True;
+ CalcOutputFactor(); // prepare update of row height
+ ScColumn::bDoubleAlloc = true;
FltError eError = ScFormatFilter::Get().ScImportExcel( rMedium, &aDocument, eFormat );
- ScColumn::bDoubleAlloc = sal_False;
+ ScColumn::bDoubleAlloc = false;
aDocument.UpdateFontCharSet();
if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
aDocument.UpdateChartListenerCollection(); //! fuer alle Importe?
- // #75299# all graphics objects must have names
+ // all graphics objects must have names
aDocument.EnsureGraphicNames();
if (eError == SCWARN_IMPORT_RANGE_OVERFLOW)
@@ -1127,17 +1140,14 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
}
else
- bRet = sal_True;
-
- // #93255# update of row height done inside of Excel filter to speed up chart import
-// bSetRowHeights = sal_True; // #75357# optimal row heights must be updated
+ bRet = true;
}
else if (aFltName.EqualsAscii(pFilterAscii))
{
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
ScAsciiOptions aOptions;
- sal_Bool bOptInit = sal_False;
+ sal_Bool bOptInit = false;
if ( pSet && SFX_ITEM_SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
@@ -1157,7 +1167,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
FltError eError = eERR_OK;
- sal_Bool bOverflow = sal_False;
+ sal_Bool bOverflow = false;
if( ! rMedium.IsStorage() )
{
@@ -1177,7 +1187,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
else
{
- DBG_ERROR( "No Stream" );
+ OSL_FAIL( "No Stream" );
}
}
@@ -1213,8 +1223,10 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
sItStr = ScGlobal::GetCharsetString( RTL_TEXTENCODING_IBM_850 );
}
+ ScDocRowHeightUpdater::TabRanges aRecalcRanges(0);
sal_uLong eError = DBaseImport( rMedium.GetPhysicalName(),
- ScGlobal::GetCharsetValue(sItStr), bSimpleColWidth );
+ ScGlobal::GetCharsetValue(sItStr), aColWidthParam, *aRecalcRanges.mpRanges );
+ aRecalcRowRangesArray.push_back(aRecalcRanges);
if (eError != eERR_OK)
{
@@ -1226,14 +1238,8 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
bRet = sal_True;
aColWidthRange.aStart.SetRow( 1 ); // Spaltenheader nicht
- bSetColWidths = sal_True;
- bSetSimpleTextColWidths = sal_True;
- // Memo-Felder fuehren zu einem bSimpleColWidth[nCol]==FALSE
- for ( SCCOL nCol=0; nCol <= MAXCOL && !bSetRowHeights; nCol++ )
- {
- if ( !bSimpleColWidth[nCol] )
- bSetRowHeights = sal_True;
- }
+ bSetColWidths = true;
+ bSetSimpleTextColWidths = true;
}
else if (aFltName.EqualsAscii(pFilterDif))
{
@@ -1293,7 +1299,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
else
{
- DBG_ERROR( "No Stream" );
+ OSL_FAIL( "No Stream" );
}
}
@@ -1307,7 +1313,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
{
ScColumn::bDoubleAlloc = sal_True;
FltError eError = ScFormatFilter::Get().ScImportQuattroPro( rMedium, &aDocument);
- ScColumn::bDoubleAlloc = sal_False;
+ ScColumn::bDoubleAlloc = false;
if (eError != eERR_OK)
{
if (!GetError())
@@ -1351,7 +1357,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
else
{
- DBG_ERROR( "No Stream" );
+ OSL_FAIL( "No Stream" );
}
}
@@ -1400,7 +1406,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
else
{
- DBG_ERROR( "No Stream" );
+ OSL_FAIL( "No Stream" );
}
}
@@ -1414,11 +1420,11 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
if (!bCalc3)
- aDocument.SetInsertingFromOtherDoc( sal_False );
+ aDocument.SetInsertingFromOtherDoc( false );
}
else
{
- DBG_ERROR("Kein Filter bei ConvertFrom");
+ OSL_FAIL("Kein Filter bei ConvertFrom");
}
InitItems();
@@ -1447,30 +1453,41 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
{
for ( SCCOL nCol=0; nCol <= nEndCol; nCol++ )
{
+ if (!bSetSimpleTextColWidths)
+ aColWidthParam[nCol].mbSimpleText = false;
+
sal_uInt16 nWidth = aDocument.GetOptimalColWidth(
- nCol, nTab, &aVirtDev, nPPTX, nPPTY, aZoom, aZoom, sal_False, &aMark,
- (bSetSimpleTextColWidths && bSimpleColWidth[nCol]) );
+ nCol, nTab, &aVirtDev, nPPTX, nPPTY, aZoom, aZoom, false, &aMark,
+ &aColWidthParam[nCol] );
aDocument.SetColWidth( nCol, nTab,
nWidth + (sal_uInt16)ScGlobal::nLastColWidthExtra );
}
}
-// if ( bSetRowHeights )
-// {
-// // nExtra must be 0
-// aDocument.SetOptimalHeight( 0, nEndRow, nTab, 0, &aVirtDev,
-// nPPTX, nPPTY, aZoom, aZoom, sal_False );
-// }
}
- if ( bSetRowHeights )
- UpdateAllRowHeights(); // with vdev or printer, depending on configuration
+
+ if (bSetRowHeights)
+ {
+ // Update all rows in all tables.
+ ScSizeDeviceProvider aProv(this);
+ ScDocRowHeightUpdater aUpdater(aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), NULL);
+ aUpdater.update();
+ }
+ else if (!aRecalcRowRangesArray.empty())
+ {
+ // Update only specified row ranges for better performance.
+ ScSizeDeviceProvider aProv(this);
+ ScDocRowHeightUpdater aUpdater(aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), &aRecalcRowRangesArray);
+ aUpdater.update();
+ }
}
FinishedLoading( SFX_LOADED_MAINDOCUMENT | SFX_LOADED_IMAGES );
- // #73762# invalidate eventually temporary table areas
+
+ // invalidate eventually temporary table areas
if ( bRet )
aDocument.InvalidateTableArea();
- bIsEmpty = sal_False;
+ bIsEmpty = false;
return bRet;
}
@@ -1514,7 +1531,7 @@ ScDocShell::PrepareSaveGuard::~PrepareSaveGuard()
}
-sal_Bool __EXPORT ScDocShell::Save()
+sal_Bool ScDocShell::Save()
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::Save" );
@@ -1530,19 +1547,22 @@ sal_Bool __EXPORT ScDocShell::Save()
}
-sal_Bool __EXPORT ScDocShell::SaveAs( SfxMedium& rMedium )
+sal_Bool ScDocShell::SaveAs( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::SaveAs" );
-#if ENABLE_SHEET_PROTECTION
ScTabViewShell* pViewShell = GetBestViewShell();
- if (pViewShell && ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_OOO))
+ bool bNeedsRehash = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_SHA1);
+ if (bNeedsRehash)
+ // legacy xls hash double-hashed by SHA1 is also supported.
+ bNeedsRehash = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_XL, PASSHASH_SHA1);
+
+ if (pViewShell && bNeedsRehash)
{
- if (!pViewShell->ExecuteRetypePassDlg(PASSHASH_OOO))
+ if (!pViewShell->ExecuteRetypePassDlg(PASSHASH_SHA1))
// password re-type cancelled. Don't save the document.
return false;
}
-#endif
ScRefreshTimerProtector( aDocument.GetRefreshTimerControlAddress() );
@@ -1557,15 +1577,8 @@ sal_Bool __EXPORT ScDocShell::SaveAs( SfxMedium& rMedium )
}
-sal_Bool __EXPORT ScDocShell::IsInformationLost()
+sal_Bool ScDocShell::IsInformationLost()
{
-/*
- const SfxFilter *pFilt = GetMedium()->GetFilter();
- sal_Bool bRet = pFilt && pFilt->IsAlienFormat() && bNoInformLost;
- if (bNoInformLost) // nur einmal!!
- bNoInformLost = sal_False;
- return bRet;
-*/
//!!! bei Gelegenheit ein korrekte eigene Behandlung einbauen
return SfxObjectShell::IsInformationLost();
@@ -1575,12 +1588,10 @@ sal_Bool __EXPORT ScDocShell::IsInformationLost()
// Xcl-like column width measured in characters of standard font.
xub_StrLen lcl_ScDocShell_GetColWidthInChars( sal_uInt16 nWidth )
{
- // double fColScale = 1.0;
- double f = nWidth;
+ double f = nWidth;
f *= 1328.0 / 25.0;
f += 90.0;
f *= 1.0 / 23.0;
- // f /= fColScale * 256.0;
f /= 256.0;
return xub_StrLen( f );
@@ -1631,7 +1642,7 @@ void lcl_ScDocShell_WriteEmptyFixedWidthString( SvStream& rStream,
const ScDocument& rDoc, SCTAB nTab, SCCOL nCol )
{
String aString;
- lcl_ScDocShell_GetFixedWidthString( aString, rDoc, nTab, nCol, sal_False,
+ lcl_ScDocShell_GetFixedWidthString( aString, rDoc, nTab, nCol, false,
SVX_HOR_JUSTIFY_STANDARD );
rStream.WriteUnicodeOrByteText( aString );
}
@@ -1656,7 +1667,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
rStream.StartWritingUnicodeText();
- bContextOrNotAsciiEncoding = sal_False;
+ bContextOrNotAsciiEncoding = false;
}
else
{
@@ -1676,7 +1687,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
}
else
- bContextOrNotAsciiEncoding = sal_False;
+ bContextOrNotAsciiEncoding = false;
}
SCCOL nStartCol = 0;
@@ -1710,7 +1721,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
ScBaseCell* pCell;
while ( ( pCell = aIter.GetNext( nCol, nRow ) ) != NULL )
{
- sal_Bool bProgress = sal_False; // only upon line change
+ sal_Bool bProgress = false; // only upon line change
if ( nNextRow < nRow )
{ // empty rows or/and empty columns up to end of row
bProgress = sal_True;
@@ -1783,7 +1794,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
case CELLTYPE_NOTE:
case CELLTYPE_NONE:
aString.Erase();
- bString = sal_False;
+ bString = false;
break;
case CELLTYPE_FORMULA :
{
@@ -1811,7 +1822,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
else
{
ScCellFormat::GetInputString( pCell, nFormat, aString, rFormatter );
- bString = sal_False;
+ bString = false;
}
}
else
@@ -1864,14 +1875,14 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
else
{
ScCellFormat::GetInputString( pCell, nFormat, aString, rFormatter );
- bString = sal_False;
+ bString = false;
}
}
break;
default:
- DBG_ERROR( "ScDocShell::AsciiSave: unknown CellType" );
+ OSL_FAIL( "ScDocShell::AsciiSave: unknown CellType" );
aString.Erase();
- bString = sal_False;
+ bString = false;
}
if ( bFixedWidth )
@@ -1919,7 +1930,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
else
{
- // #105549# This is nasty. The Unicode to byte encoding
+ // This is nasty. The Unicode to byte encoding
// may convert typographical quotation marks to ASCII
// quotation marks, which may interfer with the delimiter,
// so we have to escape delimiters after the string has
@@ -2034,7 +2045,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
rStream.SetNumberFormatInt( nOldNumberFormatInt );
}
-sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
+sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ConvertTo" );
@@ -2050,32 +2061,18 @@ sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
DBG_ASSERT( rMed.GetFilter(), "Filter == 0" );
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
String aFltName = rMed.GetFilter()->GetFilterName();
-/*
- if (aFltName.EqualsAscii(pFilterLotus))
- {
- SvStream* pStream = rMed.GetOutStream();
- if (pStream)
- {
- FltError eError = ScFormatFilter::Get().ScExportLotus123( *pStream, &aDocument, ExpWK1,
- CHARSET_IBMPC_437 );
- bRet = eError == eERR_OK;
- }
- }
- else
-*/
if (aFltName.EqualsAscii(pFilterXML))
{
//TODO/LATER: this shouldn't happen!
- DBG_ERROR("XML filter in ConvertFrom?!");
+ OSL_FAIL("XML filter in ConvertFrom?!");
bRet = SaveXML( &rMed, NULL );
}
else if (aFltName.EqualsAscii(pFilterExcel5) || aFltName.EqualsAscii(pFilterExcel95) ||
aFltName.EqualsAscii(pFilterExcel97) || aFltName.EqualsAscii(pFilterEx5Temp) ||
- aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp) ||
- aFltName.EqualsAscii(pFilterEx07Xml))
+ aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp))
{
WaitObject aWait( GetActiveDialogParent() );
@@ -2087,7 +2084,7 @@ sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
aDocument.SetExtDocOptions( pExtDocOpt = new ScExtDocOptions );
pViewShell->GetViewData()->WriteExtOptions( *pExtDocOpt );
- /* #115980# #i104990# If the imported document contains a medium
+ /* #i104990# If the imported document contains a medium
password, determine if we can save it, otherwise ask the users
whether they want to save without it. */
if( (rMed.GetFilter()->GetFilterFlags() & SFX_FILTER_ENCRYPTION) == 0 )
@@ -2103,13 +2100,11 @@ sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
}
}
-#if ENABLE_SHEET_PROTECTION
if( bDoSave )
{
bool bNeedRetypePassDlg = ScPassHashHelper::needsPassHashRegen( aDocument, PASSHASH_XL );
bDoSave = !bNeedRetypePassDlg || pViewShell->ExecuteRetypePassDlg( PASSHASH_XL );
}
-#endif
}
if( bDoSave )
@@ -2117,8 +2112,6 @@ sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
ExportFormatExcel eFormat = ExpBiff5;
if( aFltName.EqualsAscii( pFilterExcel97 ) || aFltName.EqualsAscii( pFilterEx97Temp ) )
eFormat = ExpBiff8;
- if( aFltName.EqualsAscii( pFilterEx07Xml ) )
- eFormat = Exp2007Xml;
FltError eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );
if( eError && !GetError() )
@@ -2188,19 +2181,15 @@ sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
WaitObject aWait( GetActiveDialogParent() );
// HACK damit Sba geoffnetes TempFile ueberschreiben kann
rMed.CloseOutStream();
- sal_Bool bHasMemo = sal_False;
+ sal_Bool bHasMemo = false;
sal_uLong eError = DBaseExport( rMed.GetPhysicalName(),
ScGlobal::GetCharsetValue(sCharSet), bHasMemo );
if ( eError != eERR_OK && (eError & ERRCODE_WARNING_MASK) )
{
-//! if ( !rMed.GetError() )
-//! rMed.SetError( eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
eError = eERR_OK;
}
-//! else if ( aDocument.GetTableCount() > 1 && !rMed.GetError() )
-//! rMed.SetError( SCWARN_EXPORT_ASCII, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
INetURLObject aTmpFile( rMed.GetPhysicalName(), INET_PROT_FILE );
if ( bHasMemo )
@@ -2222,9 +2211,9 @@ sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
INetURLObject aDbtFile( pNameItem->GetValue(), INET_PROT_FILE );
aDbtFile.setExtension( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("dbt")) );
if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) )
- bRet = sal_False;
+ bRet = false;
if ( bRet && !MoveFile( aTmpFile, aDbtFile ) )
- bRet = sal_False;
+ bRet = false;
if ( !bRet )
{
KillFile( aTmpFile );
@@ -2308,13 +2297,13 @@ sal_Bool __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
}
-sal_Bool __EXPORT ScDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor )
+sal_Bool ScDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor )
{
return SfxObjectShell::SaveCompleted( xStor );
}
-sal_Bool __EXPORT ScDocShell::DoSaveCompleted( SfxMedium * pNewStor )
+sal_Bool ScDocShell::DoSaveCompleted( SfxMedium * pNewStor )
{
sal_Bool bRet = SfxObjectShell::DoSaveCompleted( pNewStor );
@@ -2354,7 +2343,7 @@ sal_Bool ScDocShell::QuerySlotExecutable( sal_uInt16 nSlotId )
}
catch( util::VetoException& )
{
- bSlotExecutable = sal_False;
+ bSlotExecutable = false;
}
catch( uno::Exception& )
{
@@ -2363,7 +2352,7 @@ sal_Bool ScDocShell::QuerySlotExecutable( sal_uInt16 nSlotId )
}
-sal_uInt16 __EXPORT ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+sal_uInt16 ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
if(SC_MOD()->GetCurRefDlgId()>0)
{
@@ -2379,12 +2368,12 @@ sal_uInt16 __EXPORT ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsin
}
}
- return sal_False;
+ return false;
}
if ( aDocument.IsInLinkUpdate() || aDocument.IsInInterpreter() )
{
ErrorMessage(STR_CLOSE_ERROR_LINK);
- return sal_False;
+ return false;
}
DoEnterHandler();
@@ -2401,7 +2390,7 @@ sal_uInt16 __EXPORT ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsin
catch( util::VetoException& )
{
// if event processor throws VetoException, macro has vetoed close
- return sal_False;
+ return false;
}
catch( uno::Exception& )
{
@@ -2430,7 +2419,7 @@ void ScDocShell::PrepareReload()
}
-String ScDocShell::GetOwnFilterName() // static
+String ScDocShell::GetOwnFilterName()
{
return String::CreateFromAscii(pFilterSc50);
}
@@ -2440,32 +2429,32 @@ String ScDocShell::GetHtmlFilterName()
return String::CreateFromAscii(pFilterHtml);
}
-String ScDocShell::GetWebQueryFilterName() // static
+String ScDocShell::GetWebQueryFilterName()
{
return String::CreateFromAscii(pFilterHtmlWebQ);
}
-String ScDocShell::GetAsciiFilterName() // static
+String ScDocShell::GetAsciiFilterName()
{
return String::CreateFromAscii(pFilterAscii);
}
-String ScDocShell::GetLotusFilterName() // static
+String ScDocShell::GetLotusFilterName()
{
return String::CreateFromAscii(pFilterLotus);
}
-String ScDocShell::GetDBaseFilterName() // static
+String ScDocShell::GetDBaseFilterName()
{
return String::CreateFromAscii(pFilterDBase);
}
-String ScDocShell::GetDifFilterName() // static
+String ScDocShell::GetDifFilterName()
{
return String::CreateFromAscii(pFilterDif);
}
-sal_Bool ScDocShell::HasAutomaticTableName( const String& rFilter ) // static
+sal_Bool ScDocShell::HasAutomaticTableName( const String& rFilter )
{
// sal_True for those filters that keep the default table name
// (which is language specific)
@@ -2492,8 +2481,8 @@ sal_Bool ScDocShell::HasAutomaticTableName( const String& rFilter ) // stati
bFooterOn ( sal_True ), \
bNoInformLost ( sal_True ), \
bIsEmpty ( sal_True ), \
- bIsInUndo ( sal_False ), \
- bDocumentModifiedPending( sal_False ), \
+ bIsInUndo ( false ), \
+ bDocumentModifiedPending( false ), \
nDocumentLock ( 0 ), \
nCanUpdate (com::sun::star::document::UpdateDocMode::ACCORDING_TO_CONFIG), \
bUpdateEnabled ( sal_True ), \
@@ -2569,9 +2558,9 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags )
//------------------------------------------------------------------
-__EXPORT ScDocShell::~ScDocShell()
+ScDocShell::~ScDocShell()
{
- ResetDrawObjectShell(); // #55570# falls der Drawing-Layer noch versucht, darauf zuzugreifen
+ ResetDrawObjectShell(); // falls der Drawing-Layer noch versucht, darauf zuzugreifen
SfxStyleSheetPool* pStlPool = aDocument.GetStyleSheetPool();
if (pStlPool)
@@ -2599,14 +2588,14 @@ __EXPORT ScDocShell::~ScDocShell()
if (pModificator)
{
- DBG_ERROR("The Modificator should not exist");
+ OSL_FAIL("The Modificator should not exist");
delete pModificator;
}
}
//------------------------------------------------------------------
-::svl::IUndoManager* __EXPORT ScDocShell::GetUndoManager()
+SfxUndoManager* ScDocShell::GetUndoManager()
{
return aDocument.GetUndoManager();
}
@@ -2645,7 +2634,7 @@ void ScDocShell::SetDocumentModified( sal_Bool bIsModified /* = sal_True */ )
SetDocumentModifiedPending( sal_True );
else
{
- SetDocumentModifiedPending( sal_False );
+ SetDocumentModifiedPending( false );
aDocument.InvalidateStyleSheetUsage();
aDocument.InvalidateTableArea();
aDocument.InvalidateLastTableOpParams();
@@ -2656,7 +2645,7 @@ void ScDocShell::SetDocumentModified( sal_Bool bIsModified /* = sal_True */ )
// Detective AutoUpdate:
// Update if formulas were modified (DetectiveDirty) or the list contains
- // "Trace Error" entries (#75362# - Trace Error can look completely different
+ // "Trace Error" entries (Trace Error can look completely different
// after changes to non-formula cells).
ScDetOpList* pList = aDocument.GetDetOpList();
@@ -2665,10 +2654,10 @@ void ScDocShell::SetDocumentModified( sal_Bool bIsModified /* = sal_True */ )
{
GetDocFunc().DetectiveRefresh(sal_True); // sal_True = caused by automatic update
}
- aDocument.SetDetectiveDirty(sal_False); // always reset, also if not refreshed
+ aDocument.SetDetectiveDirty(false); // always reset, also if not refreshed
}
- // #b6697848# notify UNO objects after BCA_BRDCST_ALWAYS etc.
+ // notify UNO objects after BCA_BRDCST_ALWAYS etc.
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
}
}
@@ -2734,7 +2723,7 @@ void ScDocShell::GetDocStat( ScDocStat& rDocStat )
}
-SfxDocumentInfoDialog* __EXPORT ScDocShell::CreateDocumentInfoDialog(
+SfxDocumentInfoDialog* ScDocShell::CreateDocumentInfoDialog(
Window *pParent, const SfxItemSet &rSet )
{
SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog( pParent, rSet );
@@ -2746,17 +2735,13 @@ SfxDocumentInfoDialog* __EXPORT ScDocShell::CreateDocumentInfoDialog(
if( pDocSh == this )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
::CreateTabPage ScDocStatPageCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_STAT );
- DBG_ASSERT(ScDocStatPageCreate, "Tabpage create fail!");//CHINA001
+ DBG_ASSERT(ScDocStatPageCreate, "Tabpage create fail!");
pDlg->AddTabPage( 42,
ScGlobal::GetRscString( STR_DOC_STAT ),
ScDocStatPageCreate,
NULL);
-//CHINA001 pDlg->AddTabPage( 42,
-//CHINA001 ScGlobal::GetRscString( STR_DOC_STAT ),
-//CHINA001 ScDocStatPage::Create,
-//CHINA001 NULL );
}
return pDlg;
}
@@ -2784,6 +2769,109 @@ ScSheetSaveData* ScDocShell::GetSheetSaveData()
return pSheetSaveData;
}
+namespace {
+
+void removeKeysIfExists(Reference<ui::XAcceleratorConfiguration>& xScAccel, const vector<const awt::KeyEvent*>& rKeys)
+{
+ vector<const awt::KeyEvent*>::const_iterator itr = rKeys.begin(), itrEnd = rKeys.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ const awt::KeyEvent* p = *itr;
+ if (!p)
+ continue;
+
+ try
+ {
+ xScAccel->removeKeyEvent(*p);
+ }
+ catch (const container::NoSuchElementException&) {}
+ }
+}
+
+}
+
+void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType )
+{
+ using namespace ::com::sun::star::ui;
+
+ Reference<XMultiServiceFactory> xServiceManager = ::comphelper::getProcessServiceFactory();
+ if (!xServiceManager.is())
+ return;
+
+ Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgSupplier(
+ xServiceManager->createInstance(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))), UNO_QUERY);
+
+ if (!xModuleCfgSupplier.is())
+ return;
+
+ // Grab the Calc configuration.
+ Reference<XUIConfigurationManager> xConfigMgr =
+ xModuleCfgSupplier->getUIConfigurationManager(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument")));
+
+ if (!xConfigMgr.is())
+ return;
+
+ // shortcut manager
+ Reference<XAcceleratorConfiguration> xScAccel(
+ xConfigMgr->getShortCutManager(), UNO_QUERY);
+
+ if (!xScAccel.is())
+ return;
+
+ vector<const awt::KeyEvent*> aKeys;
+ aKeys.reserve(4);
+
+ // Backsapce key
+ awt::KeyEvent aBackspace;
+ aBackspace.KeyCode = awt::Key::BACKSPACE;
+ aBackspace.Modifiers = 0;
+ aKeys.push_back(&aBackspace);
+
+ // Delete key
+ awt::KeyEvent aDelete;
+ aDelete.KeyCode = awt::Key::DELETE;
+ aDelete.Modifiers = 0;
+ aKeys.push_back(&aDelete);
+
+ // Ctrl-D
+ awt::KeyEvent aCtrlD;
+ aCtrlD.KeyCode = awt::Key::D;
+ aCtrlD.Modifiers = awt::KeyModifier::MOD1;
+ aKeys.push_back(&aCtrlD);
+
+ // Alt-Down
+ awt::KeyEvent aAltDown;
+ aAltDown.KeyCode = awt::Key::DOWN;
+ aAltDown.Modifiers = awt::KeyModifier::MOD2;
+ aKeys.push_back(&aAltDown);
+
+ // Remove all involved keys first, because swapping commands don't work
+ // well without doing this.
+ removeKeysIfExists(xScAccel, aKeys);
+ xScAccel->store();
+
+ switch (eType)
+ {
+ case ScOptionsUtil::KEY_DEFAULT:
+ xScAccel->setKeyEvent(aDelete, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ClearContents")));
+ xScAccel->setKeyEvent(aBackspace, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Delete")));
+ xScAccel->setKeyEvent(aCtrlD, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FillDown")));
+ xScAccel->setKeyEvent(aAltDown, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DataSelect")));
+ break;
+ case ScOptionsUtil::KEY_OOO_LEGACY:
+ xScAccel->setKeyEvent(aDelete, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Delete")));
+ xScAccel->setKeyEvent(aBackspace, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ClearContents")));
+ xScAccel->setKeyEvent(aCtrlD, OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DataSelect")));
+ break;
+ default:
+ ;
+ }
+
+ xScAccel->store();
+}
+
void ScDocShell::UseSheetSaveEntries()
{
if (pSheetSaveData)
@@ -2804,7 +2892,7 @@ void ScDocShell::UseSheetSaveEntries()
for (nTab = 0; nTab < nTabCount; ++nTab)
if (aDocument.IsStreamValid(nTab))
- aDocument.SetStreamValid(nTab, sal_False);
+ aDocument.SetStreamValid(nTab, false);
}
}
}
@@ -2853,7 +2941,6 @@ void ScDocShellModificator::SetDocumentModified()
}
}
-//<!--Added by PengYunQuan for Validity Cell Range Picker
sal_Bool ScDocShell::AcceptStateUpdate() const
{
if( SfxObjectShell::AcceptStateUpdate() )
@@ -2862,9 +2949,8 @@ sal_Bool ScDocShell::AcceptStateUpdate() const
if( SC_MOD()->Find1RefWindow( SFX_APP()->GetTopWindow() ) )
return sal_True;
- return sal_False;
+ return false;
}
-//-->Added by PengYunQuan for Validity Cell Range Picker
bool ScDocShell::IsChangeRecording() const
@@ -2907,7 +2993,7 @@ void ScDocShell::SetChangeRecording( bool bActivate )
// Slots invalidieren
SfxBindings* pBindings = GetViewBindings();
if (pBindings)
- pBindings->InvalidateAll(sal_False);
+ pBindings->InvalidateAll(false);
}
}
@@ -2959,3 +3045,5 @@ bool ScDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 084e35b610ba..52d99479f27d 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,11 +57,6 @@
#include <sfx2/app.hxx>
// INCLUDE ---------------------------------------------------------------
-/*
-#include <svdrwetc.hxx>
-#include <svdrwobx.hxx>
-#include <sostor.hxx>
-*/
#include "drwlayer.hxx"
#include "stlpool.hxx"
#include "docsh.hxx"
@@ -72,7 +68,7 @@ using namespace com::sun::star;
//------------------------------------------------------------------
-sal_Bool __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
+sal_Bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::InitNew" );
@@ -102,27 +98,6 @@ sal_Bool __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >&
InitItems();
CalcOutputFactor();
-#if 0
- uno::Any aGlobs;
- uno::Sequence< uno::Any > aArgs(1);
- aArgs[ 0 ] <<= GetModel();
- aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
- GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
- // Fake ThisComponent being setup by Activate ( which is a view
- // related thing ),
- // a) if another document is opened then in theory ThisComponent
- // will be reset as before,
- // b) when this document is 'really' Activated then ThisComponent
- // again will be set as before
- // The only wrinkle seems if this document is loaded 'InVisible'
- // but.. I don't see that this is possible from the vba API
- // I could be wrong though
- // There may be implications setting the current component
- // too early :-/ so I will just manually set the Basic Variables
- BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
- if ( pAppMgr )
- pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );
-#endif
return bRet;
}
@@ -146,13 +121,8 @@ void ScDocShell::InitItems()
{
// AllItemSet fuer Controller mit benoetigten Items fuellen:
- // if ( pImpl->pFontList )
- // delete pImpl->pFontList;
-
// Druck-Optionen werden beim Drucken und evtl. in GetPrinter gesetzt
- // pImpl->pFontList = new FontList( GetPrinter(), Application::GetDefaultDevice() );
- //PutItem( SvxFontListItem( pImpl->pFontList, SID_ATTR_CHAR_FONTLIST ) );
UpdateFontList();
ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
@@ -169,7 +139,6 @@ void ScDocShell::InitItems()
pDrawLayer->SetNotifyUndoActionHdl( LINK( pDocFunc, ScDocFunc, NotifyDrawUndo ) );
- //if (SfxObjectShell::HasSbxObject())
pDrawLayer->UpdateBasic(); // DocShell-Basic in DrawPages setzen
}
else
@@ -178,19 +147,19 @@ void ScDocShell::InitItems()
PutItem( SvxColorTableItem( XColorTable::GetStdColorTable(), SID_COLOR_TABLE ) );
}
- if ( !aDocument.GetForbiddenCharacters().isValid() ||
+ if ( !aDocument.GetForbiddenCharacters().is() ||
!aDocument.IsValidAsianCompression() || !aDocument.IsValidAsianKerning() )
{
// get settings from SvxAsianConfig
- SvxAsianConfig aAsian( sal_False );
+ SvxAsianConfig aAsian( false );
- if ( !aDocument.GetForbiddenCharacters().isValid() )
+ if ( !aDocument.GetForbiddenCharacters().is() )
{
// set forbidden characters if necessary
uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
if (aLocales.getLength())
{
- vos::ORef<SvxForbiddenCharactersTable> xForbiddenTable =
+ rtl::Reference<SvxForbiddenCharactersTable> xForbiddenTable =
new SvxForbiddenCharactersTable( aDocument.GetServiceManager() );
const lang::Locale* pLocales = aLocales.getConstArray();
@@ -199,7 +168,6 @@ void ScDocShell::InitItems()
i18n::ForbiddenCharacters aForbidden;
aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine );
LanguageType eLang = SvxLocaleToLanguage(pLocales[i]);
- //pDoc->SetForbiddenCharacters( eLang, aForbidden );
xForbiddenTable->SetForbiddenCharacters( eLang, aForbidden );
}
@@ -233,12 +201,12 @@ void ScDocShell::ResetDrawObjectShell()
//------------------------------------------------------------------
-void __EXPORT ScDocShell::Activate()
+void ScDocShell::Activate()
{
}
-void __EXPORT ScDocShell::Deactivate()
+void ScDocShell::Deactivate()
{
}
@@ -257,7 +225,9 @@ ScDrawLayer* ScDocShell::MakeDrawLayer()
InitItems(); // incl. Undo und Basic
Broadcast( SfxSimpleHint( SC_HINT_DRWLAYER_NEW ) );
if (nDocumentLock)
- pDrawLayer->setLock(sal_True);
+ pDrawLayer->setLock(true);
}
return pDrawLayer;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index ec23a1b3a21a..87ae56cceb38 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,11 +80,6 @@
#include "conflictsdlg.hxx"
#include "globstr.hrc"
-#if DEBUG_CHANGETRACK
-#include <stdio.h>
-#endif // DEBUG_CHANGETRACK
-
-
//------------------------------------------------------------------
//
@@ -260,11 +256,10 @@ void ScDocShell::UnlockPaint_Impl(sal_Bool bDoc)
if (xRangeList)
{
sal_uInt16 nParts = pPaint->GetParts();
- sal_uLong nCount = xRangeList->Count();
- for ( sal_uLong i=0; i<nCount; i++ )
+ for ( size_t i = 0, nCount = xRangeList->size(); i < nCount; i++ )
{
//! nExtFlags ???
- ScRange aRange = *xRangeList->GetObject(i);
+ ScRange aRange = *(*xRangeList)[i];
PostPaint( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab(),
aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab(),
nParts );
@@ -279,7 +274,7 @@ void ScDocShell::UnlockPaint_Impl(sal_Bool bDoc)
}
else
{
- DBG_ERROR("UnlockPaint ohne LockPaint");
+ OSL_FAIL("UnlockPaint ohne LockPaint");
}
}
@@ -289,7 +284,7 @@ void ScDocShell::LockDocument_Impl(sal_uInt16 nNew)
{
ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
if (pDrawLayer)
- pDrawLayer->setLock(sal_True);
+ pDrawLayer->setLock(true);
}
nDocumentLock = nNew;
}
@@ -301,7 +296,7 @@ void ScDocShell::UnlockDocument_Impl(sal_uInt16 nNew)
{
ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
if (pDrawLayer)
- pDrawLayer->setLock(sal_False);
+ pDrawLayer->setLock(false);
}
}
@@ -329,12 +324,12 @@ void ScDocShell::SetLockCount(sal_uInt16 nNew)
void ScDocShell::LockPaint()
{
- LockPaint_Impl(sal_False);
+ LockPaint_Impl(false);
}
void ScDocShell::UnlockPaint()
{
- UnlockPaint_Impl(sal_False);
+ UnlockPaint_Impl(false);
}
void ScDocShell::LockDocument()
@@ -352,7 +347,7 @@ void ScDocShell::UnlockDocument()
}
else
{
- DBG_ERROR("UnlockDocument without LockDocument");
+ OSL_FAIL("UnlockDocument without LockDocument");
}
}
@@ -412,7 +407,7 @@ void ScDocShell::CalcOutputFactor()
nPrtToScreenFactor = nPrinterWidth / (double) nWindowWidth;
else
{
- DBG_ERROR("GetTextSize gibt 0 ??");
+ OSL_FAIL("GetTextSize gibt 0 ??");
nPrtToScreenFactor = 1.0;
}
}
@@ -472,7 +467,7 @@ void ScDocShell::UpdateFontList()
{
delete pImpl->pFontList;
// pImpl->pFontList = new FontList( GetPrinter(), Application::GetDefaultDevice() );
- pImpl->pFontList = new FontList( GetRefDevice(), NULL, sal_False ); // sal_False or sal_True???
+ pImpl->pFontList = new FontList( GetRefDevice(), NULL, false ); // sal_False or sal_True???
SvxFontListItem aFontListItem( pImpl->pFontList, SID_ATTR_CHAR_FONTLIST );
PutItem( aFontListItem );
@@ -486,7 +481,7 @@ OutputDevice* ScDocShell::GetRefDevice()
sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags )
{
- SfxPrinter *pOld = aDocument.GetPrinter( sal_False );
+ SfxPrinter *pOld = aDocument.GetPrinter( false );
if ( pOld && pOld->IsPrinting() )
return SFX_PRINTERROR_BUSY;
@@ -681,7 +676,7 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pP
DateTime aDT = pAction->GetDateTime();
String aDate = ScGlobal::pLocaleData->getDate( aDT );
aDate += ' ';
- aDate += ScGlobal::pLocaleData->getTime( aDT, sal_False, sal_False );
+ aDate += ScGlobal::pLocaleData->getTime( aDT, false, false );
SfxItemSet aSet( GetPool(),
SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_AUTHOR,
@@ -805,7 +800,7 @@ bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument
pA->GetDescription( aADesc, pSearchDoc, sal_True );
if ( aActionDesc.Equals( aADesc ) )
{
- DBG_ERROR( "lcl_FindAction(): found equal action!" );
+ OSL_FAIL( "lcl_FindAction(): found equal action!" );
return true;
}
}
@@ -817,7 +812,7 @@ bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument
void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheckDuplicates, sal_uLong nOffset, ScChangeActionMergeMap* pMergeMap, bool bInverseMap )
{
- ScTabViewShell* pViewSh = GetBestViewShell( sal_False ); //! Funktionen an die DocShell
+ ScTabViewShell* pViewSh = GetBestViewShell( false ); //! Funktionen an die DocShell
if (!pViewSh)
return;
@@ -833,14 +828,14 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
DBG_ASSERT(pThisTrack,"ChangeTracking nicht angeschaltet?");
if ( !bShared )
{
- // #51138# visuelles RedLining einschalten
+ // visuelles RedLining einschalten
ScChangeViewSettings aChangeViewSet;
aChangeViewSet.SetShowChanges(sal_True);
aDocument.SetChangeViewSettings(aChangeViewSet);
}
}
- // #97286# include 100th seconds in compare?
+ // include 100th seconds in compare?
sal_Bool bIgnore100Sec = !pSourceTrack->IsTime100thSeconds() ||
!pThisTrack->IsTime100thSeconds();
@@ -935,7 +930,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
LockPaint(); // #i73877# no repainting after each action
// MergeChangeData in das aktuelle Dokument uebernehmen
- sal_Bool bHasRejected = sal_False;
+ sal_Bool bHasRejected = false;
String aOldUser = pThisTrack->GetUser();
pThisTrack->SetUseFixDateTime( sal_True );
ScMarkData& rMarkData = pViewSh->GetViewData()->GetMarkData();
@@ -1058,7 +1053,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
aValue.Erase( 0, 1 );
aValue.Erase( aValue.Len()-1, 1 );
GetDocFunc().EnterMatrix( aSourceRange,
- NULL, NULL, aValue, sal_False, sal_False,
+ NULL, NULL, aValue, false, false,
EMPTY_STRING, formula::FormulaGrammar::GRAM_DEFAULT );
}
break;
@@ -1069,7 +1064,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
pViewSh->EnterData( aPos.Col(), aPos.Row(), aPos.Tab(), aValue );
break;
default:
- DBG_ERROR( "MergeDocument: unknown MatrixFlag" );
+ OSL_FAIL( "MergeDocument: unknown MatrixFlag" );
}
}
break;
@@ -1077,17 +1072,17 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
{
String aName;
aDocument.CreateValidTabName( aName );
- GetDocFunc().InsertTable( aSourceRange.aStart.Tab(), aName, sal_True, sal_False );
+ GetDocFunc().InsertTable( aSourceRange.aStart.Tab(), aName, sal_True, false );
}
break;
case SC_CAT_INSERT_ROWS:
- GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSROWS, sal_True, sal_False );
+ GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSROWS, sal_True, false );
break;
case SC_CAT_INSERT_COLS:
- GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSCOLS, sal_True, sal_False );
+ GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSCOLS, sal_True, false );
break;
case SC_CAT_DELETE_TABS :
- GetDocFunc().DeleteTable( aSourceRange.aStart.Tab(), sal_True, sal_False );
+ GetDocFunc().DeleteTable( aSourceRange.aStart.Tab(), sal_True, false );
break;
case SC_CAT_DELETE_ROWS:
{
@@ -1095,7 +1090,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
if ( pDel->IsTopDelete() )
{
aSourceRange = pDel->GetOverAllRange().MakeRange();
- GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELROWS, sal_True, sal_False );
+ GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELROWS, sal_True, false );
// #i101099# [Collaboration] Changes are not correctly shown
if ( bShared )
@@ -1115,7 +1110,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
if ( pDel->IsTopDelete() && !pDel->IsTabDeleteCol() )
{ // deleted Table enthaelt deleted Cols, die nicht
aSourceRange = pDel->GetOverAllRange().MakeRange();
- GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELCOLS, sal_True, sal_False );
+ GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELCOLS, sal_True, false );
}
}
break;
@@ -1124,7 +1119,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
const ScChangeActionMove* pMove = (const ScChangeActionMove*) pSourceAction;
ScRange aFromRange( pMove->GetFromRange().MakeRange() );
GetDocFunc().MoveBlock( aFromRange,
- aSourceRange.aStart, sal_True, sal_True, sal_False, sal_False );
+ aSourceRange.aStart, sal_True, sal_True, false, false );
}
break;
default:
@@ -1141,7 +1136,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
pAct->SetComment( rComment );
#ifdef DBG_UTIL
else
- DBG_ERROR( "MergeDocument: wohin mit dem Kommentar?!?" );
+ OSL_FAIL( "MergeDocument: wohin mit dem Kommentar?!?" );
#endif
}
@@ -1189,7 +1184,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
rMarkData = aOldMarkData;
pThisTrack->SetUser(aOldUser);
- pThisTrack->SetUseFixDateTime( sal_False );
+ pThisTrack->SetUseFixDateTime( false );
pSourceTrack->Clear(); //! der ist jetzt verhunzt
@@ -1219,18 +1214,9 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
return false;
}
-#if DEBUG_CHANGETRACK
- ::rtl::OUString aMessage = ::rtl::OUString::createFromAscii( "\nbefore merge:\n" );
- aMessage += pThisTrack->ToString();
- ::rtl::OString aMsg = ::rtl::OUStringToOString( aMessage, RTL_TEXTENCODING_UTF8 );
- OSL_ENSURE( false, aMsg.getStr() );
- //fprintf( stdout, "%s ", aMsg.getStr() );
- //fflush( stdout );
-#endif // DEBUG_CHANGETRACK
-
// reset show changes
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges( sal_False );
+ aChangeViewSet.SetShowChanges( false );
aDocument.SetChangeViewSettings( aChangeViewSet );
// find first merge action in this document
@@ -1396,14 +1382,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
aInfoBox.Execute();
}
-#if DEBUG_CHANGETRACK
- aMessage = ::rtl::OUString::createFromAscii( "\nafter merge:\n" );
- aMessage += pThisTrack->ToString();
- aMsg = ::rtl::OUStringToOString( aMessage, RTL_TEXTENCODING_UTF8 );
- OSL_ENSURE( false, aMsg.getStr() );
- //fprintf( stdout, "%s ", aMsg.getStr() );
- //fflush( stdout );
-#endif // DEBUG_CHANGETRACK
-
return ( pThisAction != NULL );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index c64a65b25a55..b4ee37a9e7b7 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
using namespace ::com::sun::star;
// INCLUDE ---------------------------------------------------------------
-#if STLPORT_VERSION>=321
#include <math.h> // prevent conflict between exception and std::exception
-#endif
#include "scitems.hxx"
#include <sfx2/fcontnr.hxx>
@@ -86,15 +85,12 @@ using namespace ::com::sun::star;
#include "appoptio.hxx"
#include "globstr.hrc"
#include "global.hxx"
-//CHINA001 #include "styledlg.hxx"
-//CHINA001 #include "hfedtdlg.hxx"
#include "dbdocfun.hxx"
#include "printfun.hxx" // DrawToDev
#include "viewdata.hxx"
#include "tabvwsh.hxx"
#include "impex.hxx"
#include "attrib.hxx"
-//CHINA001 #include "corodlg.hxx"
#include "undodat.hxx"
#include "autostyl.hxx"
#include "undocell.hxx"
@@ -104,7 +100,6 @@ using namespace ::com::sun::star;
#include "servobj.hxx"
#include "rangenam.hxx"
#include "scmod.hxx"
-//CHINA001 #include "scendlg.hxx"
#include "chgviset.hxx"
#include "reffact.hxx"
#include "chartlis.hxx"
@@ -118,8 +113,8 @@ using namespace ::com::sun::star;
#include "chgtrack.hxx"
#include "printopt.hxx"
#include <com/sun/star/document/UpdateDocMode.hpp>
-#include "scresid.hxx" //add by CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include "scresid.hxx"
+#include "scabstdlg.hxx"
#include "externalrefmgr.hxx"
#include "sharedocdlg.hxx"
#include "conditio.hxx"
@@ -222,7 +217,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
::com::sun::star::uno::Reference<
::com::sun::star::sdbc::XResultSet > xResultSet;
- if ( pReqArgs->GetItemState( FN_PARAM_3, sal_False, &pItem ) == SFX_ITEM_SET && pItem )
+ if ( pReqArgs->GetItemState( FN_PARAM_3, false, &pItem ) == SFX_ITEM_SET && pItem )
xResultSet.set(((const SfxUsrAnyItem*)pItem)->GetValue(),::com::sun::star::uno::UNO_QUERY);
String sDBName = sSbaData.GetToken(0,cSbaSep); // Datenbankname
@@ -242,13 +237,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
String aSelItem = sSbaData.GetToken(i,cSbaSep);
if (aSelItem.Len())
{
- void *pPtr = (void*)aSelItem.ToInt32();
- pSelectionList->Insert( pPtr, LIST_APPEND );
+ sal_uIntPtr nValue = aSelItem.ToInt32();
+ pSelectionList->Insert( (void*)nValue, LIST_APPEND );
}
}
// bei Bedarf neuen Datenbankbereich anlegen
- sal_Bool bMakeArea = sal_False;
+ sal_Bool bMakeArea = false;
if (bIsNewArea)
{
ScDBCollection* pDBColl = aDocument.GetDBCollection();
@@ -302,7 +297,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
else
{
- DBG_ERROR( "arguments expected" );
+ OSL_FAIL( "arguments expected" );
}
}
break;
@@ -312,18 +307,17 @@ void ScDocShell::Execute( SfxRequest& rReq )
if (pReqArgs)
{
ScDocument* pDoc = GetDocument();
-// sal_Bool bUndo (pDoc->IsUndoEnabled());
const SfxPoolItem* pItem;
String aChartName, aRangeName;
ScRange aSingleRange;
ScRangeListRef aRangeListRef;
- sal_Bool bMultiRange = sal_False;
+ sal_Bool bMultiRange = false;
sal_Bool bColHeaders = sal_True;
sal_Bool bRowHeaders = sal_True;
- sal_Bool bColInit = sal_False;
- sal_Bool bRowInit = sal_False;
+ sal_Bool bColInit = false;
+ sal_Bool bRowInit = false;
sal_Bool bAddRange = (nSlot == SID_CHART_ADDSOURCE);
if( IS_AVAILABLE( SID_CHART_NAME, &pItem ) )
@@ -349,11 +343,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
aRangeListRef = new ScRangeList;
aRangeListRef->Parse( aRangeName, pDoc );
- if ( aRangeListRef->Count() )
+ if ( !aRangeListRef->empty() )
{
- bMultiRange = sal_True;
- aSingleRange = *aRangeListRef->GetObject(0); // fuer Header
- bValid = sal_True;
+ bMultiRange = true;
+ aSingleRange = *aRangeListRef->front(); // fuer Header
+ bValid = true;
}
else
aRangeListRef.Clear();
@@ -384,23 +378,22 @@ void ScDocShell::Execute( SfxRequest& rReq )
if (!bRowInit)
bRowHeaders = aChartPositioner.HasRowHeaders();
- //CHINA001 ScColRowLabelDlg aDlg( pParent, bRowHeaders, bColHeaders );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScColRowLabelDlg* pDlg = pFact->CreateScColRowLabelDlg( pParent, RID_SCDLG_CHARTCOLROW, bRowHeaders, bColHeaders);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
- if ( pDlg->Execute() == RET_OK ) //CHINA001 if ( aDlg.Execute() == RET_OK )
+ DBG_ASSERT(pDlg, "Dialog create fail!");
+ if ( pDlg->Execute() == RET_OK )
{
- bColHeaders = pDlg->IsRow(); //CHINA001 bColHeaders = aDlg.IsRow(); // Spaltenkoepfe = 1. Zeile
- bRowHeaders = pDlg->IsCol(); //CHINA001 bRowHeaders = aDlg.IsCol();
+ bColHeaders = pDlg->IsRow();
+ bRowHeaders = pDlg->IsCol();
rReq.AppendItem(SfxBoolItem(FN_PARAM_1, bColHeaders));
rReq.AppendItem(SfxBoolItem(FN_PARAM_2, bRowHeaders));
}
else
- bOk = sal_False;
- delete pDlg; //CHINA001
+ bOk = false;
+ delete pDlg;
}
if (bOk) // ausfuehren
@@ -432,13 +425,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
else
{
- DBG_ERROR("UpdateChartArea: keine ViewShell oder falsche Daten");
+ OSL_FAIL("UpdateChartArea: keine ViewShell oder falsche Daten");
}
rReq.Done();
}
else
{
- DBG_ERROR("SID_CHART_SOURCE ohne Argumente");
+ OSL_FAIL("SID_CHART_SOURCE ohne Argumente");
}
break;
@@ -455,7 +448,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
if (pBindings)
{
pBindings->Invalidate( FID_AUTO_CALC );
-// pBindings->Invalidate( FID_RECALC ); // jetzt immer enabled
}
rReq.AppendItem( SfxBoolItem( FID_AUTO_CALC, bNewVal ) );
rReq.Done();
@@ -518,7 +510,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
// wird nach dem Laden aufgerufen, wenn DB-Bereiche mit
// weggelassenen Daten enthalten sind
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDBCollection* pDBColl = aDocument.GetDBCollection();
if ((nCanUpdate != com::sun::star::document::UpdateDocMode::NO_UPDATE) &&
@@ -554,7 +546,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
pDBData->GetArea(aRange);
pViewSh->MarkRange(aRange);
- if ( bContinue ) // #41905# Fehler beim Import -> Abbruch
+ if ( bContinue ) // Fehler beim Import -> Abbruch
{
// interne Operationen, wenn welche gespeichert
@@ -591,7 +583,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
case SID_AUTO_STYLE:
- DBG_ERROR("use ScAutoStyleHint instead of SID_AUTO_STYLE");
+ OSL_FAIL("use ScAutoStyleHint instead of SID_AUTO_STYLE");
break;
case SID_GET_COLORTABLE:
@@ -609,14 +601,14 @@ void ScDocShell::Execute( SfxRequest& rReq )
if(pDoc!=NULL)
{
// get argument (recorded macro)
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD, false );
sal_Bool bDo = sal_True;
// xmlsec05/06:
// getting real parent window when called from Security-Options TP
Window* pParent = NULL;
const SfxPoolItem* pParentItem;
- if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, sal_False, &pParentItem ) )
+ if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
// desired state
@@ -661,7 +653,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
// Slots invalidieren
if (pBindings)
- pBindings->InvalidateAll(sal_False);
+ pBindings->InvalidateAll(false);
if ( !pItem )
rReq.AppendItem( SfxBoolItem( FID_CHG_RECORD, bActivateTracking ) );
rReq.Done();
@@ -676,7 +668,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
Window* pParent = NULL;
const SfxPoolItem* pParentItem;
- if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, sal_False, &pParentItem ) )
+ if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
if ( ExecuteChangeProtectionDialog( pParent ) )
{
@@ -703,7 +695,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
if( aBox.Execute() == RET_YES )
bDo = ExecuteChangeProtectionDialog( NULL, sal_True );
else
- bDo = sal_False;
+ bDo = false;
}
else // merge might reject some actions
bDo = ExecuteChangeProtectionDialog( NULL, sal_True );
@@ -743,7 +735,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
// kein Filter angegeben -> Detection
if ( !aFilterName.Len() )
- ScDocumentLoader::GetFilterName( aFileName, aFilterName, aOptions, sal_True, sal_False );
+ ScDocumentLoader::GetFilterName( aFileName, aFilterName, aOptions, sal_True, false );
// filter name from dialog contains application prefix,
// GetFilter needs name without the prefix.
@@ -755,7 +747,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
if ( nVersion != 0 )
pSet->Put( SfxInt16Item( SID_VERSION, nVersion ) );
- pMed = new SfxMedium( aFileName, STREAM_STD_READ, sal_False, pFilter, pSet );
+ pMed = new SfxMedium( aFileName, STREAM_STD_READ, false, pFilter, pSet );
}
else
{
@@ -906,14 +898,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
while(aDocument.IsScenario(nActualTab));
sal_Bool bSheetProtected = aDocument.IsTabProtected(nActualTab);
- //! anderen Titel am Dialog setzen
-//CHINA001 ScNewScenarioDlg* pNewDlg =
-//CHINA001 new ScNewScenarioDlg( GetActiveDialogParent(), aName, sal_True, bSheetProtected);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
- AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( GetActiveDialogParent(), aName, RID_SCDLG_NEWSCENARIO, sal_True,bSheetProtected);
- DBG_ASSERT(pNewDlg, "Dialog create fail!");//CHINA001
+ AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( GetActiveDialogParent(), aName, RID_SCDLG_NEWSCENARIO, true,bSheetProtected);
+ DBG_ASSERT(pNewDlg, "Dialog create fail!");
pNewDlg->SetScenarioData( aName, aComment, aColor, nFlags );
if ( pNewDlg->Execute() == RET_OK )
{
@@ -1079,7 +1068,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
xCloseable->close( sal_True );
- if ( !SwitchToShared( sal_False, sal_True ) )
+ if ( !SwitchToShared( false, sal_True ) )
{
// TODO/LATER: what should be done in case the switch has failed?
// for example in case the user has cancelled the saveAs operation
@@ -1114,7 +1103,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
catch ( uno::Exception& )
{
- DBG_ERROR( "SID_SHARE_DOC: caught exception\n" );
+ OSL_FAIL( "SID_SHARE_DOC: caught exception\n" );
SC_MOD()->SetInSharedDocSaving( false );
try
@@ -1165,7 +1154,7 @@ void UpdateAcceptChangesDialog()
sal_Bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack();
if ( pChangeTrack )
{
@@ -1231,7 +1220,7 @@ sal_Bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool b
void ScDocShell::DoRecalc( sal_Bool bApi )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScTabViewShell* pSh = GetBestViewShell();
if ( pSh )
{
@@ -1256,7 +1245,7 @@ void ScDocShell::DoRecalc( sal_Bool bApi )
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
- // #47939# Wenn es Charts gibt, dann alles painten, damit nicht
+ // Wenn es Charts gibt, dann alles painten, damit nicht
// PostDataChanged und die Charts nacheinander kommen und Teile
// doppelt gepainted werden.
@@ -1299,7 +1288,7 @@ void ScDocShell::DoHardRecalc( sal_Bool /* bApi */ )
// (somewhat consistent with charts)
for (nTab=0; nTab<nTabCount; nTab++)
if (aDocument.IsStreamValid(nTab))
- aDocument.SetStreamValid(nTab, sal_False);
+ aDocument.SetStreamValid(nTab, false);
PostPaintGridAll();
}
@@ -1437,7 +1426,7 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages
sal_Bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
{
- sal_Bool bChange = sal_False;
+ sal_Bool bChange = false;
SCTAB nTab = rRange.aStart.Tab();
String aStyleName = aDocument.GetPageStyle( nTab );
@@ -1495,7 +1484,7 @@ sal_Bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
aOldPrFunc.GetScaleData( aPhysPage, nHdr, nFtr );
nBlkTwipsY += nHdr + nFtr;
- if ( nBlkTwipsX == 0 ) // #100639# hidden columns/rows may lead to 0
+ if ( nBlkTwipsX == 0 ) // hidden columns/rows may lead to 0
nBlkTwipsX = 1;
if ( nBlkTwipsY == 0 )
nBlkTwipsY = 1;
@@ -1518,7 +1507,7 @@ void ScDocShell::PageStyleModified( const String& rStyleName, sal_Bool bApi )
{
ScDocShellModificator aModificator( *this );
- sal_Bool bWarn = sal_False;
+ sal_Bool bWarn = false;
SCTAB nTabCount = aDocument.GetTableCount();
SCTAB nUseTab = MAXTAB+1;
@@ -1586,15 +1575,11 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
SfxItemSet& rStyleSet = pStyleSheet->GetItemSet();
-//CHINA001 ScStyleDlg* pDlg = new ScStyleDlg( GetActiveDialogParent(),
-//CHINA001 *pStyleSheet,
-//CHINA001 RID_SCDLG_STYLES_PAGE );
-//CHINA001
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateScStyleDlg( GetActiveDialogParent(), *pStyleSheet, RID_SCDLG_STYLES_PAGE, RID_SCDLG_STYLES_PAGE );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
@@ -1630,7 +1615,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
aOldData, aNewData ) );
}
- PageStyleModified( aNewName, sal_False );
+ PageStyleModified( aNewName, false );
rReq.Done();
}
delete pDlg;
@@ -1745,22 +1730,15 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
}
}
-//CHINA001 ScHFEditDlg* pDlg
-//CHINA001 = new ScHFEditDlg( SFX_APP()->GetViewFrame(),
-//CHINA001 GetActiveDialogParent(),
-//CHINA001 rStyleSet,
-//CHINA001 aStr,
-//CHINA001 nResId );
-//CHINA001
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateScHFEditDlg( SfxViewFrame::Current(),
GetActiveDialogParent(),
rStyleSet,
aStr,
RID_SCDLG_HFEDIT, nResId);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
@@ -1821,6 +1799,356 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */,
}
}
+void lcl_GetPrintData( ScDocShell* pDocShell /*in*/,
+ ScDocument* pDocument /*in*/, SfxPrinter* pPrinter /*in*/,
+ PrintDialog* pPrintDialog /*in*/, bool bForceSelected /*in*/,
+ ScMarkData* pMarkData /*inout*/, bool& rbHasOptions /*out*/,
+ ScPrintOptions& rOptions /*out*/, bool& rbAllTabs /*out*/,
+ long& rnTotalPages /*out*/, long aPageArr[] /*out*/,
+ MultiSelection& rPageRanges /*out*/, ScRange** ppMarkedRange /*out*/ )
+{
+ // get settings from print options sub-dialog
+ const SfxItemSet& rOptionSet = pPrinter->GetOptions();
+ const SfxPoolItem* pItem;
+ rbHasOptions = ( rOptionSet.GetItemState( SID_SCPRINTOPTIONS, false, &pItem ) == SFX_ITEM_SET );
+ if ( rbHasOptions )
+ {
+ rOptions = ((const ScTpPrintItem*)pItem)->GetPrintOptions();
+ }
+ else
+ {
+ // use configuration
+ rOptions = SC_MOD()->GetPrintOptions();
+ }
+
+ // update all pending row heights with a single progress bar,
+ // instead of a separate progress for each sheet from ScPrintFunc
+ pDocShell->UpdatePendingRowHeights( MAXTAB, true );
+
+ // get number of total pages
+ rnTotalPages = 0;
+ SCTAB nTabCount = pDocument->GetTableCount();
+ for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab )
+ {
+ ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, NULL, &rOptions );
+ long nThisTab = aPrintFunc.GetTotalPages();
+ aPageArr[nTab] = nThisTab;
+ rnTotalPages += nThisTab;
+ }
+
+ rPageRanges.SetTotalRange( Range( 0, RANGE_MAX ) );
+ rPageRanges.Select( Range( 1, rnTotalPages ) );
+
+ rbAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
+ if ( bForceSelected )
+ {
+ rbAllTabs = false;
+ }
+
+ if ( ( pPrintDialog && pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_SELECTED_CELLS ) || bForceSelected )
+ {
+ if ( pMarkData && ( pMarkData->IsMarked() || pMarkData->IsMultiMarked() ) )
+ {
+ pMarkData->MarkToMulti();
+ *ppMarkedRange = new ScRange;
+ pMarkData->GetMultiMarkArea( **ppMarkedRange );
+ pMarkData->MarkToSimple();
+ }
+ }
+
+ PrintDialogRange eDlgOption = pPrintDialog ? pPrintDialog->GetCheckedRange() : PRINTDIALOG_ALL;
+ if ( eDlgOption == PRINTDIALOG_RANGE )
+ {
+ rPageRanges = MultiSelection( pPrintDialog->GetRangeText() );
+ }
+
+ // get number of total pages if selection
+ if ( !rbAllTabs )
+ {
+ rnTotalPages = 0;
+ for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab )
+ {
+ if ( *ppMarkedRange ) // selected range is used instead of print ranges -> page count is different
+ {
+ ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, *ppMarkedRange, &rOptions );
+ aPageArr[nTab] = aPrintFunc.GetTotalPages();
+ }
+ if ( !pMarkData || pMarkData->GetTableSelect( nTab ) )
+ {
+ rnTotalPages += aPageArr[nTab];
+ }
+ }
+ if ( eDlgOption == PRINTDIALOG_ALL || bForceSelected )
+ {
+ rPageRanges.Select( Range( 1, rnTotalPages ) );
+ }
+ }
+}
+
+bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI )
+{
+ SfxPrinter* pPrinter = GetPrinter();
+ if ( !pPrinter )
+ {
+ return false;
+ }
+
+ bool bHasOptions = false;
+ ScPrintOptions aOptions;
+ bool bAllTabs = true;
+ long nTotalPages = 0;
+ long aPageArr[MAXTABCOUNT]; // pages per sheet
+ MultiSelection aPageRanges; // pages to print
+ ScRange* pMarkedRange = NULL;
+
+ lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected,
+ pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
+ aPageArr, aPageRanges, &pMarkedRange );
+
+ delete pMarkedRange;
+
+ if ( nTotalPages == 0 )
+ {
+ if ( !bIsAPI )
+ {
+ WarningBox aWarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
+ String( ScResId( STR_PRINT_NOTHING ) ) );
+ aWarningBox.Execute();
+ }
+ return false;
+ }
+
+ return true;
+}
+
+void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData )
+{
+ SfxPrinter* pPrinter = GetPrinter();
+ if ( !pPrinter )
+ {
+ return;
+ }
+
+ delete pOldJobSetup; // gesetzt nur bei Fehler in StartJob()
+ pOldJobSetup = new ScJobSetup( pPrinter ); // Einstellungen merken
+
+ // Einstellungen fuer die erste gedruckte Seite muessen hier (vor StartJob) gesetzt werden
+ //! Selection etc. mit Print() zusammenfassen !!!
+ //! Seiten nur einmal zaehlen
+
+ bool bHasOptions = false;
+ ScPrintOptions aOptions;
+ bool bAllTabs = true;
+ long nTotalPages = 0;
+ long aPageArr[MAXTABCOUNT]; // pages per sheet
+ MultiSelection aPageRanges; // pages to print
+ ScRange* pMarkedRange = NULL;
+
+ lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, false,
+ pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
+ aPageArr, aPageRanges, &pMarkedRange );
+
+ sal_Bool bFound = false; // erste Seite gefunden
+ long nTabStart = 0;
+ SCTAB nTabCount = aDocument.GetTableCount();
+ for ( SCTAB nTab=0; nTab<nTabCount && !bFound; nTab++ )
+ {
+ if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) )
+ {
+ long nNext = nTabStart + aPageArr[nTab];
+ sal_Bool bSelected = false;
+ for (long nP=nTabStart+1; nP<=nNext; nP++) // 1-basiert
+ if (aPageRanges.IsSelected( nP )) // eine Seite von dieser Tabelle selektiert?
+ bSelected = true;
+
+ if (bSelected)
+ {
+ ScPrintFunc aPrintFunc( this, pPrinter, nTab );
+
+ aPrintFunc.ApplyPrintSettings(); // dann Settings fuer diese Tabelle
+ bFound = true;
+ }
+ nTabStart = nNext;
+ }
+ }
+
+ delete pMarkedRange;
+}
+
+sal_Bool lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange )
+{
+ sal_Bool bFound = false;
+ ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ if (pDrawLayer)
+ {
+ SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
+ DBG_ASSERT(pPage,"Page ?");
+ if (pPage)
+ {
+ Rectangle aMMRect;
+ if ( pRange )
+ aMMRect = pDoc->GetMMRect( pRange->aStart.Col(), pRange->aStart.Row(),
+ pRange->aEnd.Col(), pRange->aEnd.Row(), nTab );
+
+ SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
+ SdrObject* pObject = aIter.Next();
+ while (pObject && !bFound)
+ {
+ if (pObject->IsTransparent())
+ {
+ if ( pRange )
+ {
+ Rectangle aObjRect = pObject->GetLogicRect();
+ if ( aObjRect.IsOver( aMMRect ) )
+ bFound = true;
+ }
+ else
+ bFound = true;
+ }
+
+ pObject = aIter.Next();
+ }
+ }
+ }
+
+ return bFound;
+}
+
+void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
+ ScMarkData* pMarkData, Window* pDialogParent, sal_Bool bForceSelected, sal_Bool bIsAPI )
+{
+ SfxPrinter* pPrinter = GetPrinter();
+ if ( !pPrinter )
+ {
+ return;
+ }
+
+ bool bHasOptions = false;
+ ScPrintOptions aOptions;
+ bool bAllTabs = true;
+ long nTotalPages = 0;
+ long aPageArr[MAXTABCOUNT]; // pages per sheet
+ MultiSelection aPageRanges; // pages to print
+ ScRange* pMarkedRange = NULL;
+
+ lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected,
+ pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
+ aPageArr, aPageRanges, &pMarkedRange );
+
+ sal_uInt16 nCollateCopies = 1;
+ if ( pPrintDialog && pPrintDialog->IsCollateEnabled() && pPrintDialog->IsCollateChecked() )
+ nCollateCopies = pPrintDialog->GetCopyCount();
+
+ // test if printed range contains transparent objects
+
+ sal_Bool bHasTransp = false;
+ sal_Bool bAnyPrintRanges = aDocument.HasPrintRange();
+ ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
+ SCTAB nTabCount = aDocument.GetTableCount();
+ for ( SCTAB nTab=0; nTab<nTabCount && !bHasTransp; nTab++ )
+ {
+ if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) )
+ {
+ SfxStyleSheetBase* pStyleSheet = pStylePool->Find(
+ aDocument.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE );
+ if ( pStyleSheet )
+ {
+ const SfxItemSet& rSet = pStyleSheet->GetItemSet();
+ if ( ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_CHARTS)).GetValue() == VOBJ_MODE_SHOW ||
+ ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_OBJECTS)).GetValue() == VOBJ_MODE_SHOW ||
+ ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_DRAWINGS)).GetValue() == VOBJ_MODE_SHOW )
+ {
+ if ( pMarkedRange )
+ bHasTransp = bHasTransp || lcl_HasTransparent( &aDocument, nTab, pMarkedRange );
+ else if ( aDocument.GetPrintRangeCount(nTab) )
+ {
+ sal_uInt16 nRangeCount = aDocument.GetPrintRangeCount(nTab);
+ for (sal_uInt16 i=0; i<nRangeCount; i++)
+ bHasTransp = bHasTransp ||
+ lcl_HasTransparent( &aDocument, nTab, aDocument.GetPrintRange( nTab, i ) );
+ }
+ else if (!bAnyPrintRanges || aDocument.IsPrintEntireSheet(nTab))
+ bHasTransp = bHasTransp || lcl_HasTransparent( &aDocument, nTab, NULL );
+ }
+ }
+ }
+ }
+
+ sal_Bool bContinue = pPrinter->InitJob( pDialogParent, !bIsAPI && bHasTransp );
+
+ if ( bContinue )
+ {
+ for ( sal_uInt16 n=0; n<nCollateCopies; n++ )
+ {
+ long nTabStart = 0;
+ long nDisplayStart = 0;
+ long nAttrPage = 1;
+
+ for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
+ {
+ if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) )
+ {
+ FmFormView* pDrawView = NULL;
+ Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX );
+
+ // #114135#
+ ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL
+
+ if(pModel)
+ {
+ pDrawView = new FmFormView( pModel, pPrinter );
+ pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
+ pDrawView->SetPrintPreview( true );
+ }
+
+ ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions );
+ aPrintFunc.SetDrawView( pDrawView );
+ aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, true, &rProgress, NULL );
+
+ nTabStart += aPageArr[nTab];
+ if ( aDocument.NeedPageResetAfterTab(nTab) )
+ nDisplayStart = 0;
+ else
+ nDisplayStart += aPageArr[nTab];
+ nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage
+
+ delete pDrawView;
+ }
+ }
+ }
+ }
+
+ delete pMarkedRange;
+
+ if (pOldJobSetup)
+ {
+ pPrinter->SetOrientation( pOldJobSetup->eOrientation );
+ pPrinter->SetPaperBin ( pOldJobSetup->nPaperBin );
+ pPrinter->SetPaper ( pOldJobSetup->ePaper );
+
+ if ( PAPER_USER == pOldJobSetup->ePaper )
+ {
+ pPrinter->SetMapMode( pOldJobSetup->aUserMapMode );
+ pPrinter->SetPaperSizeUser( pOldJobSetup->aUserSize );
+ }
+
+ delete pOldJobSetup;
+ pOldJobSetup = NULL;
+ }
+
+ if ( bHasOptions )
+ {
+ // remove PrintOptions from printer ItemSet,
+ // so next time the options from the configuration are used
+
+ SfxItemSet aSet( pPrinter->GetOptions() );
+ aSet.ClearItem( SID_SCPRINTOPTIONS );
+ pPrinter->SetOptions( aSet );
+ }
+
+ PostPaintGridAll(); //! nur wenn geaendert
+}
+
void ScDocShell::GetState( SfxItemSet &rSet )
{
SfxWhichIter aIter(rSet);
@@ -1865,12 +2193,8 @@ void ScDocShell::GetState( SfxItemSet &rSet )
break;
// Wenn eine Formel editiert wird, muss FID_RECALC auf jeden Fall enabled sein.
- // Recalc fuer das Doc war mal wegen #29898# disabled, wenn AutoCalc an war,
- // ist jetzt wegen #41540# aber auch immer enabled.
-// case FID_RECALC:
-// if ( aDocument.GetAutoCalc() )
-// rSet.DisableItem( nWhich );
-// break;
+ // Recalc fuer das Doc war mal wegen eines Bugs disabled, wenn AutoCalc an war,
+ // ist jetzt wegen eines anderen Bugs aber auch immer enabled.
case SID_TABLES_COUNT:
rSet.Put( SfxInt16Item( nWhich, aDocument.GetTableCount() ) );
@@ -1918,9 +2242,8 @@ void ScDocShell::GetSbxState( SfxItemSet &rSet )
pVisibleSh->GetState( rSet );
}
-void __EXPORT ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, sal_uInt16 nAspect )
+void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, sal_uInt16 nAspect )
{
-// bIsOle = sal_True; // jetzt ueber den CreateMode
SCTAB nVisTab = aDocument.GetVisibleTab();
if (!aDocument.HasTable(nVisTab))
@@ -1951,7 +2274,7 @@ void __EXPORT ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup *
pDev->SetLayoutMode( nOldLayoutMode );
}
-Rectangle __EXPORT ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
+Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
{
SfxObjectCreateMode eShellMode = GetCreateMode();
if ( eShellMode == SFX_CREATE_MODE_ORGANIZER )
@@ -1963,7 +2286,6 @@ Rectangle __EXPORT ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
if( nAspect == ASPECT_THUMBNAIL )
{
-// Rectangle aArea( 0,0, 3175,3175 ); // 120x120 Pixel in 1:1
Rectangle aArea( 0,0, SC_PREVIEW_SIZE_X,SC_PREVIEW_SIZE_Y );
sal_Bool bNegativePage = aDocument.IsNegativePage( aDocument.GetVisibleTab() );
if ( bNegativePage )
@@ -2018,7 +2340,7 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
if ( pStyleSheet )
pStyleSet = &pStyleSheet->GetItemSet();
else
- rbHeader = rbFooter = sal_False;
+ rbHeader = rbFooter = false;
}
DBG_ASSERT( pStyleSet, "PageStyle-Set not found! :-(" );
@@ -2037,7 +2359,7 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
rbFooter = ((const SfxBoolItem&)pSet->Get(ATTR_PAGE_ON)).GetValue();
}
-long __EXPORT ScDocShell::DdeGetData( const String& rItem,
+long ScDocShell::DdeGetData( const String& rItem,
const String& rMimeType,
::com::sun::star::uno::Any & rValue )
{
@@ -2086,7 +2408,7 @@ long __EXPORT ScDocShell::DdeGetData( const String& rItem,
return 0;
}
-long __EXPORT ScDocShell::DdeSetData( const String& rItem,
+long ScDocShell::DdeSetData( const String& rItem,
const String& rMimeType,
const ::com::sun::star::uno::Any & rValue )
{
@@ -2125,7 +2447,7 @@ long __EXPORT ScDocShell::DdeSetData( const String& rItem,
return 0;
}
-::sfx2::SvLinkSource* __EXPORT ScDocShell::DdeCreateLinkSource( const String& rItem )
+::sfx2::SvLinkSource* ScDocShell::DdeCreateLinkSource( const String& rItem )
{
// only check for valid item string - range is parsed again in ScServerObject ctor
@@ -2134,10 +2456,9 @@ long __EXPORT ScDocShell::DdeSetData( const String& rItem,
ScRangeName* pRange = aDocument.GetRangeName();
if( pRange )
{
- sal_uInt16 nPos;
- if( pRange->SearchName( aPos, nPos ) )
+ const ScRangeData* pData = pRange->findByName(aPos);
+ if (pData)
{
- ScRangeData* pData = (*pRange)[ nPos ];
if( pData->HasType( RT_REFAREA )
|| pData->HasType( RT_ABSAREA )
|| pData->HasType( RT_ABSPOS ) )
@@ -2306,7 +2627,7 @@ void ScDocShell::EnableSharedSettings( bool bEnable )
}
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges( sal_False );
+ aChangeViewSet.SetShowChanges( false );
aDocument.SetChangeViewSettings( aChangeViewSet );
}
@@ -2322,16 +2643,16 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument()
xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
uno::UNO_QUERY_THROW );
uno::Sequence < beans::PropertyValue > aArgs( 1 );
- aArgs[0].Name = ::rtl::OUString::createFromAscii( "Hidden" );
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" ));
aArgs[0].Value <<= sal_True;
if ( GetMedium() )
{
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false);
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
{
aArgs.realloc( 2 );
- aArgs[1].Name = ::rtl::OUString::createFromAscii( "Password" );
+ aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Password" ));
aArgs[1].Value <<= ::rtl::OUString( pPasswordItem->GetValue() );
}
}
@@ -2343,7 +2664,7 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument()
}
catch ( uno::Exception& )
{
- DBG_ERROR( "ScDocShell::LoadSharedDocument(): caught exception\n" );
+ OSL_FAIL( "ScDocShell::LoadSharedDocument(): caught exception\n" );
SC_MOD()->SetInSharedDocLoading( false );
try
{
@@ -2358,3 +2679,5 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument()
}
return xModel;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index fb5c30c5826e..4fafac178e2f 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,6 +43,7 @@
#include <svl/smplhint.hxx>
#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
// INCLUDE ---------------------------------------------------------------
@@ -51,7 +53,6 @@
#include "undodat.hxx"
#include "undotab.hxx"
#include "undoblk.hxx"
-//#include "pivot.hxx"
#include "dpobject.hxx"
#include "dpshttab.hxx"
#include "dbdocfun.hxx"
@@ -68,13 +69,25 @@
#include <basic/sbstar.hxx>
#include <basic/basmgr.hxx>
+#include <memory>
+#include <vector>
+
// defined in docfunc.cxx
void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String& sModuleSource );
+using com::sun::star::script::XLibraryContainer;
+using com::sun::star::script::vba::XVBACompatibility;
+using com::sun::star::container::XNameContainer;
+using com::sun::star::uno::Reference;
+using com::sun::star::uno::UNO_QUERY;
+
+using ::std::auto_ptr;
+using ::std::vector;
+
// ---------------------------------------------------------------------------
//
-// ehemalige viewfunc/dbfunc Methoden
+// former viewfunc/dbfunc methods
//
void ScDocShell::ErrorMessage( sal_uInt16 nGlobStrId )
@@ -167,7 +180,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
SCROW nEndRow = rMarked.aEnd.Row();
SCTAB nEndTab = rMarked.aEnd.Tab();
- // Wegen #49655# nicht einfach GetDBAtCursor: Der zusammenhaengende Datenbereich
+ // Nicht einfach GetDBAtCursor: Der zusammenhaengende Datenbereich
// fuer "unbenannt" (GetDataArea) kann neben dem Cursor legen, also muss auch ein
// benannter DB-Bereich dort gesucht werden.
@@ -179,7 +192,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
(rMarked.aStart != rMarked.aEnd && eSel != SC_DBSEL_ROW_DOWN) );
bool bOnlyDown = (!bSelected && eSel == SC_DBSEL_ROW_DOWN && rMarked.aStart.Row() == rMarked.aEnd.Row());
- sal_Bool bUseThis = sal_False;
+ sal_Bool bUseThis = false;
if (pData)
{
// Bereich nehmen, wenn nichts anderes markiert
@@ -211,9 +224,9 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
nEndCol = nStartCol;
nEndRow = nStartRow;
}
- aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, sal_False, bOnlyDown );
+ aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, bOnlyDown );
if ( nOldCol1 != nStartCol || nOldCol2 != nEndCol || nOldRow1 != nStartRow )
- bUseThis = sal_False; // passt gar nicht
+ bUseThis = false; // passt gar nicht
else if ( nOldRow2 != nEndRow )
{
// Bereich auf neue End-Zeile erweitern
@@ -227,13 +240,13 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
nOldCol2 == nEndCol && nOldRow2 == nEndRow ) // genau markiert?
bUseThis = sal_True;
else
- bUseThis = sal_False; // immer Markierung nehmen (Bug 11964)
+ bUseThis = false; // immer Markierung nehmen (Bug 11964)
}
// fuer Import nie "unbenannt" nehmen
if ( bUseThis && eMode == SC_DB_IMPORT && bIsNoName )
- bUseThis = sal_False;
+ bUseThis = false;
}
if ( bUseThis )
@@ -247,15 +260,10 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
nStartCol = nEndCol = nCol;
nStartRow = nEndRow = nRow;
nStartTab = nEndTab = nTab;
-// bMark = sal_False; // nichts zu markieren
}
else
{
- if ( bSelected )
- {
-// bMark = sal_False;
- }
- else
+ if ( !bSelected )
{ // zusammenhaengender Bereich
nStartCol = nCol;
nStartRow = nRow;
@@ -269,7 +277,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
nEndCol = nStartCol;
nEndRow = nStartRow;
}
- aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, sal_False, bOnlyDown );
+ aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, bOnlyDown );
}
sal_Bool bHasHeader = aDocument.HasColHeader( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
@@ -304,7 +312,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
pNoNameData->SetArea( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); // neu setzen
pNoNameData->SetByRow( sal_True );
pNoNameData->SetHeader( bHasHeader );
- pNoNameData->SetAutoFilter( sal_False );
+ pNoNameData->SetAutoFilter( false );
}
else
{
@@ -336,7 +344,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
if ( pUndoColl )
{
- aDocument.CompileDBFormula( sal_False ); // CompileFormulaString
+ aDocument.CompileDBFormula( false ); // CompileFormulaString
ScDBCollection* pRedoColl = new ScDBCollection( *pColl );
GetUndoManager()->AddUndoAction( new ScUndoDBData( this, pUndoColl, pRedoColl ) );
@@ -351,9 +359,6 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
pData = pNoNameData;
}
-// if (bMark)
-// MarkRange( ScRange( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab ), sal_False );
-
return pData;
}
@@ -408,7 +413,7 @@ sal_Bool ScDocShell::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab
ScSizeDeviceProvider aProv(this);
Fraction aZoom(1,1);
sal_Bool bChange = aDocument.SetOptimalHeight( nStartRow,nEndRow, nTab, 0, aProv.GetDevice(),
- aProv.GetPPTX(),aProv.GetPPTY(), aZoom,aZoom, sal_False );
+ aProv.GetPPTX(),aProv.GetPPTY(), aZoom,aZoom, false );
if (bChange)
PostPaint( 0,nStartRow,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID|PAINT_LEFT );
@@ -427,7 +432,7 @@ void ScDocShell::UpdateAllRowHeights( const ScMarkData* pTabMark )
void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
{
sal_Bool bIsUndoEnabled = aDocument.IsUndoEnabled();
- aDocument.EnableUndo( sal_False );
+ aDocument.EnableUndo( false );
aDocument.LockStreamValid( true ); // ignore draw page size (but not formula results)
if ( bBefore ) // check all sheets up to nUpdateTab
{
@@ -448,7 +453,7 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
if ( aUpdateSheets.GetTableSelect( nTab ) )
{
aDocument.UpdatePageBreaks( nTab );
- aDocument.SetPendingRowHeights( nTab, sal_False );
+ aDocument.SetPendingRowHeights( nTab, false );
}
}
else // only nUpdateTab
@@ -457,7 +462,7 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
{
AdjustRowHeight( 0, MAXROW, nUpdateTab );
aDocument.UpdatePageBreaks( nUpdateTab );
- aDocument.SetPendingRowHeights( nUpdateTab, sal_False );
+ aDocument.SetPendingRowHeights( nUpdateTab, false );
}
}
aDocument.LockStreamValid( false );
@@ -481,11 +486,11 @@ void ScDocShell::RefreshPivotTables( const ScRange& rSource )
if ( pOld )
{
const ScSheetSourceDesc* pSheetDesc = pOld->GetSheetDesc();
- if ( pSheetDesc && pSheetDesc->aSourceRange.Intersects( rSource ) )
+ if ( pSheetDesc && pSheetDesc->GetSourceRange().Intersects( rSource ) )
{
ScDPObject* pNew = new ScDPObject( *pOld );
ScDBDocFunc aFunc( *this );
- aFunc.DataPilotUpdate( pOld, pNew, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pOld, pNew, sal_True, false );
delete pNew; // DataPilotUpdate copies settings from "new" object
}
}
@@ -496,7 +501,7 @@ void ScDocShell::RefreshPivotTables( const ScRange& rSource )
String lcl_GetAreaName( ScDocument* pDoc, ScArea* pArea )
{
String aName;
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
ScDBData* pData = pDoc->GetDBAtArea( pArea->nTab, pArea->nColStart, pArea->nRowStart,
pArea->nColEnd, pArea->nRowEnd );
if (pData)
@@ -519,7 +524,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bReco
sal_uInt16 nPos;
SCCOL nColSize = 0;
SCROW nRowSize = 0;
- sal_Bool bErr = sal_False;
+ sal_Bool bErr = false;
for (nPos=0; nPos<rParam.nDataAreaCount; nPos++)
{
ScArea* pArea = rParam.ppDataAreas[nPos];
@@ -589,24 +594,24 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bReco
ScOutlineTable* pUndoTab = pTable ? new ScOutlineTable( *pTable ) : NULL;
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( &aDocument, 0, nTabCount-1, sal_False, sal_True );
+ pUndoDoc->InitUndo( &aDocument, 0, nTabCount-1, false, sal_True );
// Zeilenstatus
aDocument.CopyToDocument( 0,0,nDestTab, MAXCOL,MAXROW,nDestTab,
- IDF_NONE, sal_False, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
// alle Formeln
aDocument.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
- IDF_FORMULA, sal_False, pUndoDoc );
+ IDF_FORMULA, false, pUndoDoc );
// komplette Ausgangszeilen
aDocument.CopyToDocument( 0,aDestArea.nRowStart,nDestTab,
MAXCOL,aDestArea.nRowEnd,nDestTab,
- IDF_ALL, sal_False, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// alten Ausgabebereich
if (pDestData)
- aDocument.CopyToDocument( aOldDest, IDF_ALL, sal_False, pUndoDoc );
+ aDocument.CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
GetUndoManager()->AddUndoAction(
new ScUndoConsolidate( this, aDestArea, rParam, pUndoDoc,
@@ -619,15 +624,15 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bReco
aDocument.CopyToDocument( aDestArea.nColStart, aDestArea.nRowStart, aDestArea.nTab,
aDestArea.nColEnd, aDestArea.nRowEnd, aDestArea.nTab,
- IDF_ALL, sal_False, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// alten Ausgabebereich
if (pDestData)
- aDocument.CopyToDocument( aOldDest, IDF_ALL, sal_False, pUndoDoc );
+ aDocument.CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
GetUndoManager()->AddUndoAction(
new ScUndoConsolidate( this, aDestArea, rParam, pUndoDoc,
- sal_False, 0, NULL, pUndoData ) );
+ false, 0, NULL, pUndoData ) );
}
}
@@ -722,7 +727,7 @@ void ScDocShell::UseScenario( SCTAB nTab, const String& rName, sal_Bool bRecord
// Bei Zurueckkopier-Szenarios auch Inhalte
if ( nScenFlags & SC_SCENARIO_TWOWAY )
aDocument.CopyToDocument( 0,0,i, MAXCOL,MAXROW,i,
- IDF_ALL,sal_False, pUndoDoc );
+ IDF_ALL,false, pUndoDoc );
}
GetUndoManager()->AddUndoAction(
@@ -756,7 +761,7 @@ void ScDocShell::UseScenario( SCTAB nTab, const String& rName, sal_Bool bRecord
}
else
{
- DBG_ERROR( "UseScenario auf Szenario-Blatt" );
+ OSL_FAIL( "UseScenario auf Szenario-Blatt" );
}
}
@@ -820,7 +825,7 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
rName, rComment, rColor, nFlags, rMark ));
}
- aDocument.RenameTab( nNewTab, rName, sal_False ); // ohne Formel-Update
+ aDocument.RenameTab( nNewTab, rName, false ); // ohne Formel-Update
aDocument.SetScenario( nNewTab, sal_True );
aDocument.SetScenarioData( nNewTab, rComment, rColor, nFlags );
@@ -839,7 +844,7 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
aDocument.ApplySelectionPattern( aPattern, aDestMark );
if (!bCopyAll)
- aDocument.SetVisible( nNewTab, sal_False );
+ aDocument.SetVisible( nNewTab, false );
// dies ist dann das aktive Szenario
aDocument.CopyScenario( nNewTab, nTab, sal_True ); // sal_True - nicht aus Szenario kopieren
@@ -857,6 +862,47 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
return nTab;
}
+sal_uLong ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
+ SCTAB nDestPos, sal_Bool bInsertNew,
+ sal_Bool bNotifyAndPaint )
+{
+ ScDocument* pSrcDoc = rSrcDocShell.GetDocument();
+
+ sal_uLong nErrVal = aDocument.TransferTab( pSrcDoc, nSrcPos, nDestPos,
+ bInsertNew ); // no insert
+
+ // TransferTab doesn't copy drawing objects with bInsertNew=FALSE
+ if ( nErrVal > 0 && !bInsertNew)
+ aDocument.TransferDrawPage( pSrcDoc, nSrcPos, nDestPos );
+
+ if(nErrVal>0 && pSrcDoc->IsScenario( nSrcPos ))
+ {
+ String aComment;
+ Color aColor;
+ sal_uInt16 nFlags;
+
+ pSrcDoc->GetScenarioData( nSrcPos, aComment,aColor, nFlags);
+ aDocument.SetScenario(nDestPos,true);
+ aDocument.SetScenarioData(nDestPos,aComment,aColor,nFlags);
+ sal_Bool bActive = pSrcDoc->IsActiveScenario(nSrcPos);
+ aDocument.SetActiveScenario(nDestPos, bActive );
+
+ sal_Bool bVisible=pSrcDoc->IsVisible(nSrcPos);
+ aDocument.SetVisible(nDestPos,bVisible );
+
+ }
+
+ if ( nErrVal > 0 && pSrcDoc->IsTabProtected( nSrcPos ) )
+ aDocument.SetTabProtection(nDestPos, pSrcDoc->GetTabProtection(nSrcPos));
+ if ( bNotifyAndPaint )
+ {
+ Broadcast( ScTablesHint( SC_TAB_INSERTED, nDestPos ) );
+ PostPaintExtras();
+ PostPaintGridAll();
+ }
+ return nErrVal;
+}
+
sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord )
{
ScDocShellModificator aModificator( *this );
@@ -876,7 +922,7 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
if (!aDocument.CopyTab( nSrcTab, nDestTab ))
{
//! EndDrawUndo?
- return sal_False;
+ return false;
}
else
{
@@ -889,31 +935,30 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
if (bRecord)
{
- SvShorts aSrcList;
- SvShorts aDestList;
- aSrcList.push_front(nSrcTab);
- aDestList.push_front(nDestTab);
+ auto_ptr< vector<SCTAB> > pSrcList(new vector<SCTAB>(1, nSrcTab));
+ auto_ptr< vector<SCTAB> > pDestList(new vector<SCTAB>(1, nDestTab));
GetUndoManager()->AddUndoAction(
- new ScUndoCopyTab( this, aSrcList, aDestList ) );
+ new ScUndoCopyTab(this, pSrcList.release(), pDestList.release()));
}
sal_Bool bVbaEnabled = aDocument.IsInVBAMode();
if ( bVbaEnabled )
{
- StarBASIC* pStarBASIC = GetBasic();
String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
- if ( GetBasicManager()->GetName().Len() > 0 )
+ Reference< XLibraryContainer > xLibContainer = GetBasicContainer();
+ Reference< XVBACompatibility > xVBACompat( xLibContainer, UNO_QUERY );
+
+ if ( xVBACompat.is() )
{
- aLibName = GetBasicManager()->GetName();
- pStarBASIC = GetBasicManager()->GetLib( aLibName );
+ aLibName = xVBACompat->getProjectName();
}
+
SCTAB nTabToUse = nDestTab;
if ( nDestTab == SC_TAB_APPEND )
nTabToUse = aDocument.GetMaxTableNumber() - 1;
String sCodeName;
String sSource;
- com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer > xLibContainer = GetBasicContainer();
- com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > xLib;
+ Reference< XNameContainer > xLib;
if( xLibContainer.is() )
{
com::sun::star::uno::Any aLibAny = xLibContainer->getByName( aLibName );
@@ -933,7 +978,7 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
else
{
if ( aDocument.GetChangeTrack() )
- return sal_False;
+ return false;
if ( nSrcTab<nDestTab && nDestTab!=SC_TAB_APPEND )
nDestTab--;
@@ -945,15 +990,13 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
}
if (!aDocument.MoveTab( nSrcTab, nDestTab ))
- return sal_False;
+ return false;
else if (bRecord)
{
- SvShorts aSrcList;
- SvShorts aDestList;
- aSrcList.push_front(nSrcTab);
- aDestList.push_front(nDestTab);
+ auto_ptr< vector<SCTAB> > pSrcList(new vector<SCTAB>(1, nSrcTab));
+ auto_ptr< vector<SCTAB> > pDestList(new vector<SCTAB>(1, nDestTab));
GetUndoManager()->AddUndoAction(
- new ScUndoMoveTab( this, aSrcList, aDestList ) );
+ new ScUndoMoveTab(this, pSrcList.release(), pDestList.release()));
}
Broadcast( ScTablesHint( SC_TAB_MOVED, nSrcTab, nDestTab ) );
@@ -980,8 +1023,8 @@ IMPL_LINK( ScDocShell, RefreshDBDataHdl, ScRefreshTimer*, pRefreshTimer )
{
ScRange aRange;
pDBData->GetArea( aRange );
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> xResultSet;
- bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, xResultSet, NULL, sal_True, sal_False ); //! Api-Flag as parameter
+ Reference< ::com::sun::star::sdbc::XResultSet> xResultSet;
+ bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, xResultSet, NULL, true, false ); //! Api-Flag as parameter
// internal operations (sort, query, subtotal) only if no error
if (bContinue)
{
@@ -993,3 +1036,4 @@ IMPL_LINK( ScDocShell, RefreshDBDataHdl, ScRefreshTimer*, pRefreshTimer )
return bContinue != 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index a199c697ea43..07bc6e4c5d35 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,8 +43,6 @@
// INCLUDE ---------------------------------------------------------------
-//#include <svxlink.hxx>
-
#include "docsh.hxx"
#include "stlsheet.hxx"
@@ -53,6 +52,31 @@
#include "tabvwsh.hxx"
#include "tablink.hxx"
#include "collect.hxx"
+#include "docoptio.hxx"
+#include "globstr.hrc"
+#include "scmod.hxx"
+
+#include "formula/FormulaCompiler.hxx"
+#include "comphelper/processfactory.hxx"
+#include "vcl/msgbox.hxx"
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
+
+using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::container::XNameAccess;
+using ::com::sun::star::util::XChangesBatch;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::rtl::OUString;
+
+namespace {
struct ScStylePair
{
@@ -60,6 +84,12 @@ struct ScStylePair
SfxStyleSheetBase *pDest;
};
+inline OUString C2U(const char* s)
+{
+ return OUString::createFromAscii(s);
+}
+
+}
// STATIC DATA -----------------------------------------------------------
@@ -69,7 +99,7 @@ struct ScStylePair
// Ole
//
-void __EXPORT ScDocShell::SetVisArea( const Rectangle & rVisArea )
+void ScDocShell::SetVisArea( const Rectangle & rVisArea )
{
// with the SnapVisArea call in SetVisAreaOrSize, it's safe to always
// use both the size and position of the VisArea
@@ -127,7 +157,7 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifySt
// hier Position anpassen!
- // #92248# when loading an ole object, the VisArea is set from the document's
+ // when loading an ole object, the VisArea is set from the document's
// view settings and must be used as-is (document content may not be complete yet).
if ( !aDocument.IsImportingXML() )
aDocument.SnapVisArea( aArea );
@@ -153,8 +183,6 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifySt
if (pViewSh->GetViewData()->GetDocShell() == this)
pViewSh->UpdateOleZoom();
}
- //else
- // DataChanged( SvDataType() ); // fuer Zuppeln wenn nicht IP-aktiv
}
if (aDocument.IsEmbedded())
@@ -190,7 +218,6 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize )
Rectangle aOldArea = SfxObjectShell::GetVisArea();
Rectangle aNewArea = aOldArea;
- sal_Bool bChange = sal_False;
sal_Bool bEmbedded = aDocument.IsEmbedded();
if (bEmbedded)
aNewArea = aDocument.GetEmbeddedRect();
@@ -198,10 +225,7 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize )
{
SCTAB nTab = pViewData->GetTabNo();
if ( nTab != aDocument.GetVisibleTab() )
- {
aDocument.SetVisibleTab( nTab );
- bChange = sal_True;
- }
sal_Bool bNegativePage = aDocument.IsNegativePage( nTab );
SCCOL nX = pViewData->GetPosX(SC_SPLIT_LEFT);
@@ -216,20 +240,14 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize )
}
if (aNewArea != aOldArea)
- {
- SetVisAreaOrSize( aNewArea, sal_True ); // hier muss auch der Start angepasst werden
- bChange = sal_True;
- }
-
-// if (bChange)
-// DataChanged( SvDataType() ); //! passiert auch bei SetModified
+ SetVisAreaOrSize( aNewArea, true ); // hier muss auch der Start angepasst werden
}
//
// Style-Krempel fuer Organizer etc.
//
-SfxStyleSheetBasePool* __EXPORT ScDocShell::GetStyleSheetPool()
+SfxStyleSheetBasePool* ScDocShell::GetStyleSheetPool()
{
return (SfxStyleSheetBasePool*)aDocument.GetStyleSheetPool();
}
@@ -248,14 +266,14 @@ void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
SfxItemSet& rStyleSet = pStyle->GetItemSet();
const SfxPoolItem* pItem;
- if (rStyleSet.GetItemState(ATTR_PAGE_HEADERSET,sal_False,&pItem) == SFX_ITEM_SET)
+ if (rStyleSet.GetItemState(ATTR_PAGE_HEADERSET,false,&pItem) == SFX_ITEM_SET)
{
SfxItemSet& rSrcSet = ((SvxSetItem*)pItem)->GetItemSet();
SfxItemSet* pDestSet = new SfxItemSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
pDestSet->Put(rSrcSet);
rStyleSet.Put(SvxSetItem(ATTR_PAGE_HEADERSET,pDestSet));
}
- if (rStyleSet.GetItemState(ATTR_PAGE_FOOTERSET,sal_False,&pItem) == SFX_ITEM_SET)
+ if (rStyleSet.GetItemState(ATTR_PAGE_FOOTERSET,false,&pItem) == SFX_ITEM_SET)
{
SfxItemSet& rSrcSet = ((SvxSetItem*)pItem)->GetItemSet();
SfxItemSet* pDestSet = new SfxItemSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
@@ -267,7 +285,7 @@ void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
}
}
-void __EXPORT ScDocShell::LoadStyles( SfxObjectShell &rSource )
+void ScDocShell::LoadStyles( SfxObjectShell &rSource )
{
aDocument.StylesToNames();
@@ -350,7 +368,7 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Boo
}
-sal_Bool __EXPORT ScDocShell::Insert( SfxObjectShell &rSource,
+sal_Bool ScDocShell::Insert( SfxObjectShell &rSource,
sal_uInt16 nSourceIdx1, sal_uInt16 nSourceIdx2, sal_uInt16 nSourceIdx3,
sal_uInt16 &nIdx1, sal_uInt16 &nIdx2, sal_uInt16 &nIdx3, sal_uInt16 &rIdxDeleted )
{
@@ -362,6 +380,15 @@ sal_Bool __EXPORT ScDocShell::Insert( SfxObjectShell &rSource,
return bRet;
}
+void ScDocShell::ReconnectDdeLink(SfxObjectShell& rServer)
+{
+ ::sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager();
+ if (!pLinkManager)
+ return;
+
+ pLinkManager->ReconnectDdeLink(rServer);
+}
+
void ScDocShell::UpdateLinks()
{
sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager();
@@ -402,7 +429,7 @@ void ScDocShell::UpdateLinks()
String aFltName = aDocument.GetLinkFlt(i);
String aOptions = aDocument.GetLinkOpt(i);
sal_uLong nRefresh = aDocument.GetLinkRefreshDelay(i);
- sal_Bool bThere = sal_False;
+ sal_Bool bThere = false;
for (SCTAB j=0; j<i && !bThere; j++) // im Dokument mehrfach?
if (aDocument.IsLinked(j)
&& aDocument.GetLinkDoc(j) == aDocName
@@ -428,7 +455,7 @@ void ScDocShell::UpdateLinks()
pLink->SetInCreate( sal_True );
pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aDocName, &aFltName );
pLink->Update();
- pLink->SetInCreate( sal_False );
+ pLink->SetInCreate( false );
}
}
}
@@ -437,7 +464,7 @@ sal_Bool ScDocShell::ReloadTabLinks()
{
sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager();
- sal_Bool bAny = sal_False;
+ sal_Bool bAny = false;
sal_uInt16 nCount = pLinkManager->GetLinks().Count();
for (sal_uInt16 i=0; i<nCount; i++ )
{
@@ -445,12 +472,10 @@ sal_Bool ScDocShell::ReloadTabLinks()
if (pBase->ISA(ScTableLink))
{
ScTableLink* pTabLink = (ScTableLink*)pBase;
-// pTabLink->SetAddUndo(sal_False); //! Undo's zusammenfassen
- pTabLink->SetPaint(sal_False); // Paint nur einmal am Ende
+ pTabLink->SetPaint(false); // Paint nur einmal am Ende
pTabLink->Update();
- pTabLink->SetPaint(sal_True);
-// pTabLink->SetAddUndo(sal_True);
- bAny = sal_True;
+ pTabLink->SetPaint(true);
+ bAny = true;
}
}
@@ -466,4 +491,45 @@ sal_Bool ScDocShell::ReloadTabLinks()
return sal_True; //! Fehler erkennen
}
+void ScDocShell::CheckConfigOptions()
+{
+ if (IsConfigOptionsChecked())
+ // no need to check repeatedly.
+ return;
+
+ OUString aDecSep = ScGlobal::GetpLocaleData()->getNumDecimalSep();
+
+ ScModule* pScMod = SC_MOD();
+ const ScDocOptions& rOpt = pScMod->GetDocOptions();
+ OUString aSepArg = rOpt.GetFormulaSepArg();
+ OUString aSepArrRow = rOpt.GetFormulaSepArrayRow();
+ OUString aSepArrCol = rOpt.GetFormulaSepArrayCol();
+
+ if (aDecSep == aSepArg || aDecSep == aSepArrRow || aDecSep == aSepArrCol)
+ {
+ // One of arg separators conflicts with the current decimal
+ // separator. Reset them to default.
+ ScDocOptions aNew = rOpt;
+ aNew.ResetFormulaSeparators();
+ aDocument.SetDocOptions(aNew);
+ pScMod->SetDocOptions(aNew);
+
+ // Launch a nice warning dialog to let the users know of this change.
+ ScTabViewShell* pViewShell = GetBestViewShell();
+ if (pViewShell)
+ {
+ Window* pParent = pViewShell->GetFrameWin();
+ InfoBox aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS));
+ aBox.Execute();
+ }
+
+ // For now, this is the only option setting that could launch info
+ // dialog. But in the future we may want to implement a nicer
+ // dialog to display a list of warnings in case we have several
+ // pieces of information to display.
+ }
+
+ SetConfigOptionsChecked(true);
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh7.cxx b/sc/source/ui/docshell/docsh7.cxx
index 89f082672b29..85ca951be483 100644
--- a/sc/source/ui/docshell/docsh7.cxx
+++ b/sc/source/ui/docshell/docsh7.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,4 @@ void ScDocShell::GetDrawObjState( SfxItemSet & /* rSet */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 93101e802651..1d7ec23e50e9 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,8 +79,18 @@
#include "dbdocutl.hxx"
#include "dociter.hxx"
#include "globstr.hrc"
+#include "svl/zformat.hxx"
+#include "svl/intitem.hxx"
+#include "patattr.hxx"
+#include "scitems.hxx"
+#include "docpool.hxx"
+#include "segmenttree.hxx"
+#include "docparam.hxx"
+
+#include <vector>
using namespace com::sun::star;
+using ::std::vector;
// -----------------------------------------------------------------------
@@ -87,10 +98,10 @@ using namespace com::sun::star;
#define SC_SERVICE_DRVMAN "com.sun.star.sdbc.DriverManager"
//! move to a header file?
-//#define SC_DBPROP_DATASOURCENAME "DataSourceName"
#define SC_DBPROP_ACTIVECONNECTION "ActiveConnection"
#define SC_DBPROP_COMMAND "Command"
#define SC_DBPROP_COMMANDTYPE "CommandType"
+#define SC_DBPROP_PROPCHANGE_NOTIFY "PropertyChangeNotificationEnabled"
#define SC_DBPROP_NAME "Name"
#define SC_DBPROP_TYPE "Type"
@@ -119,7 +130,7 @@ namespace
if (!xFactory.is()) return SCERR_EXPORT_CONNECT;
_rDrvMgr.set( xFactory->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_DRVMAN ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_DRVMAN )) ),
uno::UNO_QUERY);
DBG_ASSERT( _rDrvMgr.is(), "can't get DriverManager" );
if (!_rDrvMgr.is()) return SCERR_EXPORT_CONNECT;
@@ -148,9 +159,9 @@ namespace
}
uno::Sequence<beans::PropertyValue> aProps(2);
- aProps[0].Name = rtl::OUString::createFromAscii(SC_DBPROP_EXTENSION);
+ aProps[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_EXTENSION));
aProps[0].Value <<= rtl::OUString( aExtension );
- aProps[1].Name = rtl::OUString::createFromAscii(SC_DBPROP_CHARSET);
+ aProps[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_CHARSET));
aProps[1].Value <<= aCharSetStr;
_rConnection = _rDrvMgr->getConnectionWithInfo( aConnUrl, aProps );
@@ -160,14 +171,13 @@ namespace
// -----------------------------------------------------------------------
// MoveFile/KillFile/IsDocument: similar to SfxContentHelper
-// static
sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject& rDestObj )
{
sal_Bool bMoveData = sal_True;
- sal_Bool bRet = sal_True, bKillSource = sal_False;
+ sal_Bool bRet = sal_True, bKillSource = false;
if ( rSourceObj.GetProtocol() != rDestObj.GetProtocol() )
{
- bMoveData = sal_False;
+ bMoveData = false;
bKillSource = sal_True;
}
String aName = rDestObj.getName();
@@ -180,7 +190,7 @@ sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObj
::ucbhelper::Content aDestPath( aDestPathObj.GetMainURL(INetURLObject::NO_DECODE),
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
uno::Reference< ::com::sun::star::ucb::XCommandInfo > xInfo = aDestPath.getCommands();
- rtl::OUString aTransferName = rtl::OUString::createFromAscii( "transfer" );
+ rtl::OUString aTransferName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "transfer" ));
if ( xInfo->hasCommandByName( aTransferName ) )
{
aDestPath.executeCommand( aTransferName, uno::makeAny(
@@ -195,7 +205,7 @@ sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObj
catch( uno::Exception& )
{
// ucb may throw different exceptions on failure now
- bRet = sal_False;
+ bRet = false;
}
if ( bKillSource )
@@ -205,7 +215,6 @@ sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObj
}
-// static
sal_Bool ScDocShell::KillFile( const INetURLObject& rURL )
{
sal_Bool bRet = sal_True;
@@ -213,22 +222,21 @@ sal_Bool ScDocShell::KillFile( const INetURLObject& rURL )
{
::ucbhelper::Content aCnt( rURL.GetMainURL(INetURLObject::NO_DECODE),
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
- aCnt.executeCommand( rtl::OUString::createFromAscii( "delete" ),
+ aCnt.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "delete" )),
comphelper::makeBoolAny( sal_True ) );
}
catch( uno::Exception& )
{
// ucb may throw different exceptions on failure now
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
-// static
sal_Bool ScDocShell::IsDocument( const INetURLObject& rURL )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
try
{
::ucbhelper::Content aCnt( rURL.GetMainURL(INetURLObject::NO_DECODE),
@@ -246,9 +254,58 @@ sal_Bool ScDocShell::IsDocument( const INetURLObject& rURL )
// -----------------------------------------------------------------------
+static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales)
+{
+ SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
+ if (!pFormatter)
+ return;
+
+ SCCOL nColCount = static_cast<SCCOL>(rScales.size());
+ for (SCCOL i = 0; i < nColCount; ++i)
+ {
+ if (rScales[i] < 0)
+ continue;
+
+ sal_uInt32 nOldFormat;
+ rDoc.GetNumberFormat(static_cast<SCCOL>(i), 0, 0, nOldFormat);
+ const SvNumberformat* pOldEntry = pFormatter->GetEntry(nOldFormat);
+ if (!pOldEntry)
+ continue;
+
+ LanguageType eLang = pOldEntry->GetLanguage();
+ sal_Bool bThousand, bNegRed;
+ sal_uInt16 nPrecision, nLeading;
+ pOldEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading);
+
+ nPrecision = static_cast<sal_uInt16>(rScales[i]);
+ String aNewPicture;
+ pFormatter->GenerateFormat(aNewPicture, nOldFormat, eLang,
+ bThousand, bNegRed, nPrecision, nLeading);
+
+ sal_uInt32 nNewFormat = pFormatter->GetEntryKey(aNewPicture, eLang);
+ if (nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
+ {
+ xub_StrLen nErrPos = 0;
+ short nNewType = 0;
+ bool bOk = pFormatter->PutEntry(
+ aNewPicture, nErrPos, nNewType, nNewFormat, eLang);
+
+ if (!bOk)
+ continue;
+ }
+
+ ScPatternAttr aNewAttrs( rDoc.GetPool() );
+ SfxItemSet& rSet = aNewAttrs.GetItemSet();
+ rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nNewFormat) );
+ rDoc.ApplyPatternAreaTab(static_cast<SCCOL>(i), 0, static_cast<SCCOL>(i), MAXROW, 0, aNewAttrs);
+ }
+}
+
sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
- sal_Bool bSimpleColWidth[MAXCOLCOUNT] )
+ ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc )
{
+ ScColumn::DoubleAllocSwitch aAllocSwitch(true);
+
sal_uLong nErr = eERR_OK;
long i;
@@ -265,14 +322,14 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
long nRowCount = 0;
if ( nRowCount < 0 )
{
- DBG_ERROR("can't get row count");
+ OSL_FAIL("can't get row count");
nRowCount = 0;
}
ScProgress aProgress( this, ScGlobal::GetRscString( STR_LOAD_DOC ), nRowCount );
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_ROWSET ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ),
uno::UNO_QUERY);
::utl::DisposableComponent aRowSetHelper(xRowSet);
uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
@@ -284,15 +341,19 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
aAny <<= xConnection;
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_ACTIVECONNECTION), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_ACTIVECONNECTION)), aAny );
aAny <<= nType;
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMANDTYPE), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMANDTYPE)), aAny );
aAny <<= rtl::OUString( aTabName );
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMAND), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );
+
+ aAny <<= false;
+ xRowProp->setPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_PROPCHANGE_NOTIFY)), aAny );
xRowSet->execute();
@@ -327,6 +388,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
// read column names
//! add type descriptions
+ vector<long> aScales(nColCount, -1);
for (i=0; i<nColCount; i++)
{
String aHeader = xMeta->getColumnLabel( i+1 );
@@ -356,6 +418,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
nPrec, nScale ) );
aHeader += ',';
aHeader += String::CreateFromInt32( nScale );
+ aScales[i] = nScale;
}
break;
}
@@ -363,20 +426,39 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
aDocument.SetString( static_cast<SCCOL>(i), 0, 0, aHeader );
}
+ lcl_setScalesToColumns(aDocument, aScales);
+
SCROW nRow = 1; // 0 is column titles
- sal_Bool bEnd = sal_False;
+ sal_Bool bEnd = false;
while ( !bEnd && xRowSet->next() )
{
+ bool bSimpleRow = true;
if ( nRow <= MAXROW )
{
SCCOL nCol = 0;
for (i=0; i<nColCount; i++)
{
+ ScDatabaseDocUtil::StrData aStrData;
ScDatabaseDocUtil::PutData( &aDocument, nCol, nRow, 0,
- xRow, i+1, pTypeArr[i], sal_False,
- &bSimpleColWidth[nCol] );
+ xRow, i+1, pTypeArr[i], false,
+ &aStrData );
+
+ if (aStrData.mnStrLength > aColWidthParam[nCol].mnMaxTextLen)
+ {
+ aColWidthParam[nCol].mnMaxTextLen = aStrData.mnStrLength;
+ aColWidthParam[nCol].mnMaxTextRow = nRow;
+ }
+
+ if (!aStrData.mbSimpleText)
+ {
+ bSimpleRow = false;
+ aColWidthParam[nCol].mbSimpleText = false;
+ }
+
++nCol;
}
+ if (!bSimpleRow)
+ rRowHeightsRecalc.setTrue(nRow, nRow);
++nRow;
}
else // past the end of the spreadsheet
@@ -395,7 +477,7 @@ sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet
}
catch ( uno::Exception& )
{
- DBG_ERROR("Unexpected exception in database");
+ OSL_FAIL("Unexpected exception in database");
nErr = ERRCODE_IO_GENERAL;
}
@@ -423,7 +505,7 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
// updating of column titles didn't work in 5.2 and isn't always wanted
// (saving normally shouldn't modify the document)
//! read flag from configuration
- sal_Bool bUpdateTitles = sal_False;
+ sal_Bool bUpdateTitles = false;
ScDocument* pDoc = rDocShell.GetDocument();
SvNumberFormatter* pNumFmt = pDoc->GetFormatTable();
@@ -440,8 +522,8 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow );
for ( SCCOL nCol = nFirstCol; nCol <= nLastCol; nCol++ )
{
- sal_Bool bTypeDefined = sal_False;
- sal_Bool bPrecDefined = sal_False;
+ sal_Bool bTypeDefined = false;
+ sal_Bool bPrecDefined = false;
sal_Int32 nFieldLen = 0;
sal_Int32 nPrecision = 0;
sal_Int32 nDbType = sdbc::DataType::SQLNULL;
@@ -486,7 +568,6 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
break;
case 'N' :
nDbType = sdbc::DataType::DECIMAL;
- bTypeDefined = sal_True;
break;
}
if ( bTypeDefined && !nFieldLen && nToken > 2 )
@@ -584,8 +665,8 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
}
}
}
- sal_Bool bSdbLenAdjusted = sal_False;
- sal_Bool bSdbLenBad = sal_False;
+ sal_Bool bSdbLenAdjusted = false;
+ sal_Bool bSdbLenBad = false;
// Feldlaenge
if ( nDbType == sdbc::DataType::VARCHAR && !nFieldLen )
{ // maximale Feldbreite bestimmen
@@ -735,7 +816,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
for ( SCCOL nDocCol = nFirstCol; nDocCol <= nLastCol && bHasFieldNames; nDocCol++ )
{ // nur Strings in erster Zeile => sind Feldnamen
if ( !aDocument.HasStringData( nDocCol, nFirstRow, nTab ) )
- bHasFieldNames = sal_False;
+ bHasFieldNames = false;
}
long nColCount = nLastCol - nFirstCol + 1;
@@ -792,7 +873,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
if (!xTableDesc.is()) return SCERR_EXPORT_CONNECT;
aAny <<= rtl::OUString( aTabName );
- xTableDesc->setPropertyValue( rtl::OUString::createFromAscii(SC_DBPROP_NAME), aAny );
+ xTableDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_NAME)), aAny );
// create columns
@@ -825,31 +906,26 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
if (!xColumnDesc.is()) return SCERR_EXPORT_CONNECT;
aAny <<= pColNames[nCol];
- xColumnDesc->setPropertyValue( rtl::OUString::createFromAscii(SC_DBPROP_NAME), aAny );
+ xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_NAME)), aAny );
aAny <<= pColTypes[nCol];
- xColumnDesc->setPropertyValue( rtl::OUString::createFromAscii(SC_DBPROP_TYPE), aAny );
+ xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_TYPE)), aAny );
aAny <<= pColLengths[nCol];
- xColumnDesc->setPropertyValue( rtl::OUString::createFromAscii(SC_DBPROP_PRECISION), aAny );
+ xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_PRECISION)), aAny );
aAny <<= pColScales[nCol];
- xColumnDesc->setPropertyValue( rtl::OUString::createFromAscii(SC_DBPROP_SCALE), aAny );
+ xColumnDesc->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_SCALE)), aAny );
xColumnsAppend->appendByDescriptor( xColumnDesc );
}
xTablesAppend->appendByDescriptor( xTableDesc );
- // re-open connection
-// xConnection = xDrvMan->getConnectionWithInfo( aConnUrl, aProps );
-// DBG_ASSERT( xConnection.is(), "can't get Connection" );
-// if (!xConnection.is()) return SCERR_EXPORT_CONNECT;
-
// get row set for writing
uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_ROWSET ) ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ),
uno::UNO_QUERY);
::utl::DisposableComponent aRowSetHelper(xRowSet);
uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
@@ -858,15 +934,15 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
aAny <<= xConnection;
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_ACTIVECONNECTION), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_ACTIVECONNECTION)), aAny );
aAny <<= (sal_Int32) sdb::CommandType::TABLE;
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMANDTYPE), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMANDTYPE)), aAny );
aAny <<= rtl::OUString( aTabName );
xRowProp->setPropertyValue(
- rtl::OUString::createFromAscii(SC_DBPROP_COMMAND), aAny );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );
xRowSet->execute();
@@ -900,7 +976,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
if ( pCell && pCell->GetCellType() != CELLTYPE_NOTE )
{
if ( pCell->GetCellType() == CELLTYPE_EDIT )
- { // #60761# Paragraphs erhalten
+ { // Paragraphs erhalten
lcl_getLongVarCharEditString( aString,
pCell, aEditEngine);
}
@@ -927,7 +1003,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
case sdbc::DataType::DATE:
{
aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
- // #39274# zwischen 0 Wert und 0 kein Wert unterscheiden
+ // zwischen 0 Wert und 0 kein Wert unterscheiden
sal_Bool bIsNull = (fVal == 0.0);
if ( bIsNull )
bIsNull = !aDocument.HasValueData( nDocCol, nDocRow, nTab );
@@ -961,7 +1037,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
break;
default:
- DBG_ERROR( "ScDocShell::DBaseExport: unknown FieldType" );
+ OSL_FAIL( "ScDocShell::DBaseExport: unknown FieldType" );
if ( nErr == eERR_OK )
nErr = SCWARN_EXPORT_DATALOST;
aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
@@ -1088,7 +1164,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
}
catch ( uno::Exception& )
{
- DBG_ERROR("Unexpected exception in database");
+ OSL_FAIL("Unexpected exception in database");
nErr = ERRCODE_IO_GENERAL;
}
@@ -1096,3 +1172,4 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docshimp.hxx b/sc/source/ui/docshell/docshimp.hxx
index 6532c46d0835..37f6d6bb1387 100644
--- a/sc/source/ui/docshell/docshimp.hxx
+++ b/sc/source/ui/docshell/docshimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@ struct DocShell_Impl
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/editable.cxx b/sc/source/ui/docshell/editable.cxx
index 4c58e2ad9c86..4e5535f92677 100644
--- a/sc/source/ui/docshell/editable.cxx
+++ b/sc/source/ui/docshell/editable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,9 +92,9 @@ void ScEditableTester::TestBlock( ScDocument* pDoc, SCTAB nTab,
sal_Bool bThisMatrix;
if ( !pDoc->IsBlockEditable( nTab, nStartCol, nStartRow, nEndCol, nEndRow, &bThisMatrix ) )
{
- bIsEditable = sal_False;
+ bIsEditable = false;
if ( !bThisMatrix )
- bOnlyMatrix = sal_False;
+ bOnlyMatrix = false;
}
}
}
@@ -127,9 +128,9 @@ void ScEditableTester::TestSelection( ScDocument* pDoc, const ScMarkData& rMark
sal_Bool bThisMatrix;
if ( !pDoc->IsSelectionEditable( rMark, &bThisMatrix ) )
{
- bIsEditable = sal_False;
+ bIsEditable = false;
if ( !bThisMatrix )
- bOnlyMatrix = sal_False;
+ bOnlyMatrix = false;
}
}
}
@@ -141,9 +142,9 @@ void ScEditableTester::TestView( ScViewFunc* pView )
sal_Bool bThisMatrix;
if ( !pView->SelectionEditable( &bThisMatrix ) )
{
- bIsEditable = sal_False;
+ bIsEditable = false;
if ( !bThisMatrix )
- bOnlyMatrix = sal_False;
+ bOnlyMatrix = false;
}
}
}
@@ -160,3 +161,4 @@ sal_uInt16 ScEditableTester::GetMessageId() const
return STR_PROTECTIONERR;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index e3293a7eed5b..f9de3e8c0c48 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -145,7 +146,7 @@ struct UpdateFormulaCell : public unary_function<ScFormulaCell*, void>
// External names, external cell and range references all have a
// ocExternalRef token.
const ScTokenArray* pCode = pCell->GetCode();
- if (!pCode->HasOpCode( ocExternalRef))
+ if (!pCode->HasExternalRef())
return;
ScTokenArray* pArray = pCell->GetCode();
@@ -388,11 +389,6 @@ void ScExternalRefCache::Table::getAllNumberFormats(vector<sal_uInt32>& rNumFmts
}
}
-const ScRangeList& ScExternalRefCache::Table::getCachedRanges() const
-{
- return maCachedRanges;
-}
-
bool ScExternalRefCache::Table::isRangeCached(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
{
return maCachedRanges.In(ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0));
@@ -406,7 +402,7 @@ void ScExternalRefCache::Table::setCachedCell(SCCOL nCol, SCROW nRow)
void ScExternalRefCache::Table::setCachedCellRange(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
{
ScRange aRange(nCol1, nRow1, 0, nCol2, nRow2, 0);
- if (!maCachedRanges.Count())
+ if ( maCachedRanges.empty() )
maCachedRanges.Append(aRange);
else
maCachedRanges.Join(aRange);
@@ -584,11 +580,8 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
}
ScMatrixRef xMat = new ScMatrix(
- static_cast<SCSIZE>(nDataCol2-nDataCol1+1), static_cast<SCSIZE>(nDataRow2-nDataRow1+1));
-
-#if 0
- // TODO: Switch to this code block once we have support for sparsely-filled
- // matrices in ScMatrix.
+ static_cast<SCSIZE>(nDataCol2-nDataCol1+1),
+ static_cast<SCSIZE>(nDataRow2-nDataRow1+1), ScMatrix::SPARSE_EMPTY);
// Only fill non-empty cells, for better performance.
vector<SCROW> aRows;
@@ -620,46 +613,11 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
}
}
}
-#else
- vector<SCROW> aRows;
- pTab->getAllRows(aRows, nDataRow1, nDataRow2);
- if (aRows.empty())
- // Cache is empty.
- return TokenArrayRef();
- else
- // Trim the column below the last non-empty row.
- nDataRow2 = aRows.back();
-
- // Empty all matrix elements first, and fill only non-empty elements.
- for (SCROW nRow = nDataRow1; nRow <= nDataRow2; ++nRow)
- {
- for (SCCOL nCol = nDataCol1; nCol <= nDataCol2; ++nCol)
- {
- TokenRef pToken = pTab->getCell(nCol, nRow);
- SCSIZE nC = nCol - nCol1, nR = nRow - nRow1;
- if (!pToken)
- return TokenArrayRef();
-
- switch (pToken->GetType())
- {
- case svDouble:
- xMat->PutDouble(pToken->GetDouble(), nC, nR);
- break;
- case svString:
- xMat->PutString(pToken->GetString(), nC, nR);
- break;
- default:
- xMat->PutEmpty(nC, nR);
- }
- }
- }
-#endif
if (!bFirstTab)
pArray->AddOpCode(ocSep);
- ScMatrix* pMat2 = xMat;
- ScMatrixToken aToken(pMat2);
+ ScMatrixToken aToken(xMat);
if (!pArray)
pArray.reset(new ScTokenArray);
pArray->AddToken(aToken);
@@ -733,7 +691,7 @@ void ScExternalRefCache::setCellData(sal_uInt16 nFileId, const String& rTabName,
}
void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRange, const vector<SingleRangeData>& rData,
- TokenArrayRef pArray)
+ const TokenArrayRef& pArray)
{
using ::std::pair;
if (rData.empty() || !isDocInitialized(nFileId))
@@ -869,7 +827,7 @@ String ScExternalRefCache::getTableName(sal_uInt16 nFileId, size_t nCacheId) con
return EMPTY_STRING;
}
-void ScExternalRefCache::getAllTableNames(sal_uInt16 nFileId, vector<String>& rTabNames) const
+void ScExternalRefCache::getAllTableNames(sal_uInt16 nFileId, vector<OUString>& rTabNames) const
{
rTabNames.clear();
DocItem* pDoc = getDocItem(nFileId);
@@ -1128,12 +1086,6 @@ ScExternalRefCache::ReferencedStatus::ReferencedStatus() :
reset(0);
}
-ScExternalRefCache::ReferencedStatus::ReferencedStatus( size_t nDocs ) :
- mbAllReferenced(false)
-{
- reset( nDocs);
-}
-
void ScExternalRefCache::ReferencedStatus::reset( size_t nDocs )
{
if (nDocs)
@@ -1322,20 +1274,17 @@ static FormulaToken* lcl_convertToToken(ScBaseCell* pCell)
static_cast<ScEditCell*>(pCell)->GetString(aStr);
return new formula::FormulaStringToken(aStr);
}
- //break;
case CELLTYPE_STRING:
{
String aStr;
static_cast<ScStringCell*>(pCell)->GetString(aStr);
return new formula::FormulaStringToken(aStr);
}
- //break;
case CELLTYPE_VALUE:
{
double fVal = static_cast<ScValueCell*>(pCell)->GetValue();
return new formula::FormulaDoubleToken(fVal);
}
- //break;
case CELLTYPE_FORMULA:
{
ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
@@ -1354,15 +1303,14 @@ static FormulaToken* lcl_convertToToken(ScBaseCell* pCell)
return new formula::FormulaStringToken(aStr);
}
}
- //break;
default:
- DBG_ERROR("attempted to convert an unknown cell type.");
+ OSL_FAIL("attempted to convert an unknown cell type.");
}
return NULL;
}
-static ScTokenArray* lcl_convertToTokenArray(ScDocument* pSrcDoc, ScRange& rRange,
+static ScTokenArray* lcl_convertToTokenArray(const ScDocument* pSrcDoc, ScRange& rRange,
vector<ScExternalRefCache::SingleRangeData>& rCacheData)
{
ScAddress& s = rRange.aStart;
@@ -1460,7 +1408,7 @@ static ScTokenArray* lcl_convertToTokenArray(ScDocument* pSrcDoc, ScRange& rRang
}
break;
default:
- DBG_ERROR("attempted to convert an unknown cell type.");
+ OSL_FAIL("attempted to convert an unknown cell type.");
}
}
}
@@ -1468,8 +1416,7 @@ static ScTokenArray* lcl_convertToTokenArray(ScDocument* pSrcDoc, ScRange& rRang
if (!bFirstTab)
pArray->AddOpCode(ocSep);
- ScMatrix* pMat2 = xMat;
- ScMatrixToken aToken(pMat2);
+ ScMatrixToken aToken(xMat);
pArray->AddToken(aToken);
itrCache->mpRangeData = xMat;
@@ -1497,8 +1444,7 @@ static ScTokenArray* lcl_fillEmptyMatrix(const ScRange& rRange)
for (SCSIZE j = 0; j < nR; ++j)
xMat->PutEmpty(i, j);
- ScMatrix* pMat2 = xMat;
- ScMatrixToken aToken(pMat2);
+ ScMatrixToken aToken(xMat);
auto_ptr<ScTokenArray> pArray(new ScTokenArray);
pArray->AddToken(aToken);
return pArray.release();
@@ -1561,7 +1507,7 @@ ScExternalRefManager::ApiGuard::~ApiGuard()
// ----------------------------------------------------------------------------
-void ScExternalRefManager::getAllCachedTableNames(sal_uInt16 nFileId, vector<String>& rTabNames) const
+void ScExternalRefManager::getAllCachedTableNames(sal_uInt16 nFileId, vector<OUString>& rTabNames) const
{
maRefCache.getAllTableNames(nFileId, rTabNames);
}
@@ -1651,6 +1597,101 @@ void ScExternalRefManager::storeRangeNameTokens(sal_uInt16 nFileId, const String
maRefCache.setRangeNameTokens(nFileId, rName, pArray);
}
+namespace {
+
+/**
+ * Put a single cell data into internal cache table.
+ *
+ * @param pFmt optional cell format index that may need to be stored with
+ * the cell value.
+ */
+void putCellDataIntoCache(
+ ScExternalRefCache& rRefCache, const ScExternalRefCache::TokenRef& pToken,
+ sal_uInt16 nFileId, const String& rTabName, const ScAddress& rCell,
+ const ScExternalRefCache::CellFormat* pFmt)
+{
+ // Now, insert the token into cache table but don't cache empty cells.
+ if (pToken->GetType() != formula::svEmptyCell)
+ {
+ sal_uInt32 nFmtIndex = (pFmt && pFmt->mbIsSet) ? pFmt->mnIndex : 0;
+ rRefCache.setCellData(nFileId, rTabName, rCell.Col(), rCell.Row(), pToken, nFmtIndex);
+ }
+}
+
+/**
+ * Put the data into our internal cache table.
+ *
+ * @param rRefCache cache table set.
+ * @param pArray single range data to be returned.
+ * @param nFileId external file ID
+ * @param rTabName name of the table where the data should be cached.
+ * @param rCacheData range data to be cached.
+ * @param rCacheRange original cache range, including the empty region if
+ * any.
+ * @param rDataRange reduced cache range that includes only the non-empty
+ * data area.
+ */
+void putRangeDataIntoCache(
+ ScExternalRefCache& rRefCache, ScExternalRefCache::TokenArrayRef& pArray,
+ sal_uInt16 nFileId, const String& rTabName,
+ const vector<ScExternalRefCache::SingleRangeData>& rCacheData,
+ const ScRange& rCacheRange, const ScRange& rDataRange)
+{
+ if (pArray)
+ // Cache these values.
+ rRefCache.setCellRangeData(nFileId, rDataRange, rCacheData, pArray);
+ else
+ {
+ // Array is empty. Fill it with an empty matrix of the required size.
+ pArray.reset(lcl_fillEmptyMatrix(rCacheRange));
+
+ // Make sure to set this range 'cached', to prevent unnecessarily
+ // accessing the src document time and time again.
+ ScExternalRefCache::TableTypeRef pCacheTab =
+ rRefCache.getCacheTable(nFileId, rTabName, true, NULL);
+ if (pCacheTab)
+ pCacheTab->setCachedCellRange(
+ rCacheRange.aStart.Col(), rCacheRange.aStart.Row(), rCacheRange.aEnd.Col(), rCacheRange.aEnd.Row());
+ }
+}
+
+/**
+ * When accessing an external document for the first time, we need to
+ * populate the cache with all its sheet names (whether they are referenced
+ * or not) in the correct order. Many client codes that use external
+ * references make this assumption.
+ *
+ * @param rRefCache cache table set.
+ * @param pSrcDoc source document instance.
+ * @param nFileId external file ID associated with the source document.
+ */
+void initDocInCache(ScExternalRefCache& rRefCache, const ScDocument* pSrcDoc, sal_uInt16 nFileId)
+{
+ if (!pSrcDoc)
+ return;
+
+ if (rRefCache.isDocInitialized(nFileId))
+ // Already initialized. No need to do this twice.
+ return;
+
+ SCTAB nTabCount = pSrcDoc->GetTableCount();
+ if (nTabCount)
+ {
+ // Populate the cache with all table names in the source document.
+ vector<String> aTabNames;
+ aTabNames.reserve(nTabCount);
+ for (SCTAB i = 0; i < nTabCount; ++i)
+ {
+ String aName;
+ pSrcDoc->GetName(i, aName);
+ aTabNames.push_back(aName);
+ }
+ rRefCache.initializeDoc(nFileId, aTabNames);
+ }
+}
+
+}
+
ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
sal_uInt16 nFileId, const String& rTabName, const ScAddress& rCell,
const ScAddress* pCurPos, SCTAB* pTab, ScExternalRefCache::CellFormat* pFmt)
@@ -1666,6 +1707,29 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
if (pFmt)
pFmt->mbIsSet = false;
+ const ScDocument* pSrcDoc = getInMemorySrcDocument(nFileId);
+ if (pSrcDoc)
+ {
+ // source document already loaded in memory. Re-use this instance.
+ SCTAB nTab;
+ if (!pSrcDoc->GetTable(rTabName, nTab))
+ {
+ // specified table name doesn't exist in the source document.
+ ScExternalRefCache::TokenRef pToken(new FormulaErrorToken(errNoRef));
+ return pToken;
+ }
+
+ if (pTab)
+ *pTab = nTab;
+
+ ScExternalRefCache::TokenRef pToken =
+ getSingleRefTokenFromSrcDoc(
+ nFileId, pSrcDoc, ScAddress(rCell.Col(),rCell.Row(),nTab), pFmt);
+
+ putCellDataIntoCache(maRefCache, pToken, nFileId, rTabName, rCell, pFmt);
+ return pToken;
+ }
+
// Check if the given table name and the cell position is cached.
sal_uInt32 nFmtIndex = 0;
ScExternalRefCache::TokenRef pToken = maRefCache.getCellData(
@@ -1673,21 +1737,12 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
if (pToken)
{
// Cache hit !
- if (pFmt)
- {
- short nFmtType = mpDoc->GetFormatTable()->GetType(nFmtIndex);
- if (nFmtType != NUMBERFORMAT_UNDEFINED)
- {
- pFmt->mbIsSet = true;
- pFmt->mnIndex = nFmtIndex;
- pFmt->mnType = nFmtType;
- }
- }
+ fillCellFormat(nFmtIndex, pFmt);
return pToken;
}
// reference not cached. read from the source document.
- ScDocument* pSrcDoc = getSrcDocument(nFileId);
+ pSrcDoc = getSrcDocument(nFileId);
if (!pSrcDoc)
{
// Source document not reachable. Throw a reference error.
@@ -1695,7 +1750,6 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
return pToken;
}
- ScBaseCell* pCell = NULL;
SCTAB nTab;
if (!pSrcDoc->GetTable(rTabName, nTab))
{
@@ -1724,33 +1778,11 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
return pToken;
}
- pSrcDoc->GetCell(rCell.Col(), rCell.Row(), nTab, pCell);
- ScExternalRefCache::TokenRef pTok(lcl_convertToToken(pCell));
-
- pSrcDoc->GetNumberFormat(rCell.Col(), rCell.Row(), nTab, nFmtIndex);
- nFmtIndex = getMappedNumberFormat(nFileId, nFmtIndex, pSrcDoc);
- if (pFmt)
- {
- short nFmtType = mpDoc->GetFormatTable()->GetType(nFmtIndex);
- if (nFmtType != NUMBERFORMAT_UNDEFINED)
- {
- pFmt->mbIsSet = true;
- pFmt->mnIndex = nFmtIndex;
- pFmt->mnType = nFmtType;
- }
- }
-
- if (!pTok.get())
- {
- // Generate an error for unresolvable cells.
- pTok.reset( new FormulaErrorToken( errNoValue));
- }
+ pToken = getSingleRefTokenFromSrcDoc(
+ nFileId, pSrcDoc, ScAddress(rCell.Col(),rCell.Row(),nTab), pFmt);
- // Now, insert the token into cache table but don't cache empty cells.
- if (pTok->GetType() != formula::svEmptyCell)
- maRefCache.setCellData(nFileId, rTabName, rCell.Col(), rCell.Row(), pTok, nFmtIndex);
-
- return pTok;
+ putCellDataIntoCache(maRefCache, pToken, nFileId, rTabName, rCell, pFmt);
+ return pToken;
}
ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
@@ -1761,6 +1793,20 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
maybeLinkExternalFile(nFileId);
+ ScRange aDataRange(rRange);
+ const ScDocument* pSrcDoc = getInMemorySrcDocument(nFileId);
+ if (pSrcDoc)
+ {
+ // Document already loaded in memory.
+ vector<ScExternalRefCache::SingleRangeData> aCacheData;
+ ScExternalRefCache::TokenArrayRef pArray =
+ getDoubleRefTokensFromSrcDoc(pSrcDoc, rTabName, aDataRange, aCacheData);
+
+ // Put the data into cache.
+ putRangeDataIntoCache(maRefCache, pArray, nFileId, rTabName, aCacheData, rRange, aDataRange);
+ return pArray;
+ }
+
// Check if the given table name and the cell position is cached.
ScExternalRefCache::TokenArrayRef pArray =
maRefCache.getCellRangeData(nFileId, rTabName, rRange);
@@ -1768,7 +1814,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
// Cache hit !
return pArray;
- ScDocument* pSrcDoc = getSrcDocument(nFileId);
+ pSrcDoc = getSrcDocument(nFileId);
if (!pSrcDoc)
{
// Source document is not reachable. Throw a reference error.
@@ -1777,7 +1823,142 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
return pArray;
}
+ vector<ScExternalRefCache::SingleRangeData> aCacheData;
+ pArray = getDoubleRefTokensFromSrcDoc(pSrcDoc, rTabName, aDataRange, aCacheData);
+
+ // Put the data into cache.
+ putRangeDataIntoCache(maRefCache, pArray, nFileId, rTabName, aCacheData, rRange, aDataRange);
+ return pArray;
+}
+
+ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens(sal_uInt16 nFileId, const String& rName, const ScAddress* pCurPos)
+{
+ if (pCurPos)
+ insertRefCell(nFileId, *pCurPos);
+
+ maybeLinkExternalFile(nFileId);
+
+ String aName = rName; // make a copy to have the casing corrected.
+ const ScDocument* pSrcDoc = getInMemorySrcDocument(nFileId);
+ if (pSrcDoc)
+ {
+ // Document already loaded in memory.
+ ScExternalRefCache::TokenArrayRef pArray =
+ getRangeNameTokensFromSrcDoc(nFileId, pSrcDoc, aName);
+
+ if (pArray)
+ // Cache this range name array.
+ maRefCache.setRangeNameTokens(nFileId, aName, pArray);
+
+ return pArray;
+ }
+
+ ScExternalRefCache::TokenArrayRef pArray = maRefCache.getRangeNameTokens(nFileId, rName);
+ if (pArray.get())
+ // This range name is cached.
+ return pArray;
+
+ pSrcDoc = getSrcDocument(nFileId);
+ if (!pSrcDoc)
+ // failed to load document from disk.
+ return ScExternalRefCache::TokenArrayRef();
+
+ pArray = getRangeNameTokensFromSrcDoc(nFileId, pSrcDoc, aName);
+
+ if (pArray)
+ // Cache this range name array.
+ maRefCache.setRangeNameTokens(nFileId, aName, pArray);
+
+ return pArray;
+}
+
+void ScExternalRefManager::refreshAllRefCells(sal_uInt16 nFileId)
+{
+ RefCellMap::iterator itrFile = maRefCells.find(nFileId);
+ if (itrFile == maRefCells.end())
+ return;
+
+ RefCellSet& rRefCells = itrFile->second;
+ for_each(rRefCells.begin(), rRefCells.end(), UpdateFormulaCell());
+
+ ScViewData* pViewData = ScDocShell::GetViewData();
+ if (!pViewData)
+ return;
+
+ ScTabViewShell* pVShell = pViewData->GetViewShell();
+ if (!pVShell)
+ return;
+
+ // Repainting the grid also repaints the texts, but is there a better way
+ // to refresh texts?
+ pVShell->Invalidate(FID_REPAINT);
+ pVShell->PaintGrid();
+}
+
+void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rCell)
+{
+ RefCellMap::iterator itr = maRefCells.find(nFileId);
+ if (itr == maRefCells.end())
+ {
+ RefCellSet aRefCells;
+ pair<RefCellMap::iterator, bool> r = maRefCells.insert(
+ RefCellMap::value_type(nFileId, aRefCells));
+ if (!r.second)
+ // insertion failed.
+ return;
+
+ itr = r.first;
+ }
+
+ ScBaseCell* pCell = mpDoc->GetCell(rCell);
+ if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
+ itr->second.insert(static_cast<ScFormulaCell*>(pCell));
+}
+
+void ScExternalRefManager::fillCellFormat(sal_uInt32 nFmtIndex, ScExternalRefCache::CellFormat* pFmt) const
+{
+ if (!pFmt)
+ return;
+
+ short nFmtType = mpDoc->GetFormatTable()->GetType(nFmtIndex);
+ if (nFmtType != NUMBERFORMAT_UNDEFINED)
+ {
+ pFmt->mbIsSet = true;
+ pFmt->mnIndex = nFmtIndex;
+ pFmt->mnType = nFmtType;
+ }
+}
+
+ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefTokenFromSrcDoc(
+ sal_uInt16 nFileId, const ScDocument* pSrcDoc, const ScAddress& rCell,
+ ScExternalRefCache::CellFormat* pFmt)
+{
+ // Get the cell from src doc, and convert it into a token.
+ ScBaseCell* pCell = NULL;
+ pSrcDoc->GetCell(rCell.Col(), rCell.Row(), rCell.Tab(), pCell);
+ ScExternalRefCache::TokenRef pToken(lcl_convertToToken(pCell));
+
+ if (!pToken.get())
+ {
+ // Generate an error for unresolvable cells.
+ pToken.reset( new FormulaErrorToken( errNoValue));
+ }
+
+ // Get number format information.
+ sal_uInt32 nFmtIndex = 0;
+ pSrcDoc->GetNumberFormat(rCell.Col(), rCell.Row(), rCell.Tab(), nFmtIndex);
+ nFmtIndex = getMappedNumberFormat(nFileId, nFmtIndex, pSrcDoc);
+ fillCellFormat(nFmtIndex, pFmt);
+ return pToken;
+}
+
+ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSrcDoc(
+ const ScDocument* pSrcDoc, const String& rTabName, ScRange& rRange,
+ vector<ScExternalRefCache::SingleRangeData>& rCacheData)
+{
+ ScExternalRefCache::TokenArrayRef pArray;
SCTAB nTab1;
+
if (!pSrcDoc->GetTable(rTabName, nTab1))
{
// specified table name doesn't exist in the source document.
@@ -1809,50 +1990,17 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
aRange.aEnd.SetTab(nTab1 + nTabSpan);
pArray.reset(lcl_convertToTokenArray(pSrcDoc, aRange, aCacheData));
-
- if (pArray)
- // Cache these values.
- maRefCache.setCellRangeData(nFileId, aRange, aCacheData, pArray);
- else
- {
- // Array is empty. Fill it with an empty matrix of the required size.
- pArray.reset(lcl_fillEmptyMatrix(rRange));
-
- // Make sure to set this range 'cached', to prevent unnecessarily
- // accessing the src document time and time again.
- ScExternalRefCache::TableTypeRef pCacheTab =
- maRefCache.getCacheTable(nFileId, rTabName, true, NULL);
- if (pCacheTab)
- pCacheTab->setCachedCellRange(
- rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row());
- }
-
+ rRange = aRange;
+ rCacheData.swap(aCacheData);
return pArray;
}
-ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens(sal_uInt16 nFileId, const String& rName, const ScAddress* pCurPos)
+ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSrcDoc(
+ sal_uInt16 nFileId, const ScDocument* pSrcDoc, String& rName)
{
- if (pCurPos)
- insertRefCell(nFileId, *pCurPos);
-
- maybeLinkExternalFile(nFileId);
-
- ScExternalRefCache::TokenArrayRef pArray = maRefCache.getRangeNameTokens(nFileId, rName);
- if (pArray.get())
- return pArray;
-
- ScDocument* pSrcDoc = getSrcDocument(nFileId);
- if (!pSrcDoc)
- return ScExternalRefCache::TokenArrayRef();
-
ScRangeName* pExtNames = pSrcDoc->GetRangeName();
String aUpperName = ScGlobal::pCharClass->upper(rName);
- sal_uInt16 n;
- bool bRes = pExtNames->SearchNameUpper(aUpperName, n);
- if (!bRes)
- return ScExternalRefCache::TokenArrayRef();
-
- ScRangeData* pRangeData = (*pExtNames)[n];
+ const ScRangeData* pRangeData = pExtNames->findByUpperName(aUpperName);
if (!pRangeData)
return ScExternalRefCache::TokenArrayRef();
@@ -1863,28 +2011,28 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens(sal_u
ScExternalRefCache::TokenArrayRef pNew(new ScTokenArray);
- ScTokenArray* pCode = pRangeData->GetCode();
- for (FormulaToken* pToken = pCode->First(); pToken; pToken = pCode->Next())
+ ScTokenArray aCode(*pRangeData->GetCode());
+ for (const FormulaToken* pToken = aCode.First(); pToken; pToken = aCode.Next())
{
bool bTokenAdded = false;
switch (pToken->GetType())
{
case svSingleRef:
{
- const ScSingleRefData& rRef = static_cast<ScToken*>(pToken)->GetSingleRef();
+ const ScSingleRefData& rRef = static_cast<const ScToken*>(pToken)->GetSingleRef();
String aTabName;
pSrcDoc->GetName(rRef.nTab, aTabName);
- ScExternalSingleRefToken aNewToken(nFileId, aTabName, static_cast<ScToken*>(pToken)->GetSingleRef());
+ ScExternalSingleRefToken aNewToken(nFileId, aTabName, static_cast<const ScToken*>(pToken)->GetSingleRef());
pNew->AddToken(aNewToken);
bTokenAdded = true;
}
break;
case svDoubleRef:
{
- const ScSingleRefData& rRef = static_cast<ScToken*>(pToken)->GetSingleRef();
+ const ScSingleRefData& rRef = static_cast<const ScToken*>(pToken)->GetSingleRef();
String aTabName;
pSrcDoc->GetName(rRef.nTab, aTabName);
- ScExternalDoubleRefToken aNewToken(nFileId, aTabName, static_cast<ScToken*>(pToken)->GetDoubleRef());
+ ScExternalDoubleRefToken aNewToken(nFileId, aTabName, static_cast<const ScToken*>(pToken)->GetDoubleRef());
pNew->AddToken(aNewToken);
bTokenAdded = true;
}
@@ -1897,55 +2045,41 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens(sal_u
pNew->AddToken(*pToken);
}
- // Make sure to pass the correctly-cased range name here.
- maRefCache.setRangeNameTokens(nFileId, pRangeData->GetName(), pNew);
+ rName = pRangeData->GetName(); // Get the correctly-cased name.
return pNew;
}
-void ScExternalRefManager::refreshAllRefCells(sal_uInt16 nFileId)
+const ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
{
- RefCellMap::iterator itrFile = maRefCells.find(nFileId);
- if (itrFile == maRefCells.end())
- return;
-
- RefCellSet& rRefCells = itrFile->second;
- for_each(rRefCells.begin(), rRefCells.end(), UpdateFormulaCell());
-
- ScViewData* pViewData = ScDocShell::GetViewData();
- if (!pViewData)
- return;
-
- ScTabViewShell* pVShell = pViewData->GetViewShell();
- if (!pVShell)
- return;
-
- // Repainting the grid also repaints the texts, but is there a better way
- // to refresh texts?
- pVShell->Invalidate(FID_REPAINT);
- pVShell->PaintGrid();
-}
+ const String* pFileName = getExternalFileName(nFileId);
+ if (!pFileName)
+ return NULL;
-void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rCell)
-{
- RefCellMap::iterator itr = maRefCells.find(nFileId);
- if (itr == maRefCells.end())
+ ScDocument* pSrcDoc = NULL;
+ TypeId aType(TYPE(ScDocShell));
+ ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType, false));
+ while (pShell)
{
- RefCellSet aRefCells;
- pair<RefCellMap::iterator, bool> r = maRefCells.insert(
- RefCellMap::value_type(nFileId, aRefCells));
- if (!r.second)
- // insertion failed.
- return;
-
- itr = r.first;
+ SfxMedium* pMedium = pShell->GetMedium();
+ if (pMedium)
+ {
+ String aName = pMedium->GetName();
+ // TODO: We should make the case sensitivity platform dependent.
+ if (pFileName->EqualsIgnoreCaseAscii(aName))
+ {
+ // Found !
+ pSrcDoc = pShell->GetDocument();
+ break;
+ }
+ }
+ pShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pShell, &aType, false));
}
- ScBaseCell* pCell = mpDoc->GetCell(rCell);
- if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
- itr->second.insert(static_cast<ScFormulaCell*>(pCell));
+ initDocInCache(maRefCache, pSrcDoc, nFileId);
+ return pSrcDoc;
}
-ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
+const ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
{
if (!mpDoc->IsExecuteLinkEnabled())
return NULL;
@@ -1957,10 +2091,6 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
{
// document already loaded.
- // TODO: Find out a way to access a document that's already open in
- // memory and re-use that instance, instead of loading it from the
- // disk again.
-
SfxObjectShell* p = itr->second.maShell;
itr->second.maLastAccess = Time();
return static_cast<ScDocShell*>(p)->GetDocument();
@@ -1989,21 +2119,7 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
maDocShells.insert(DocShellMap::value_type(nFileId, aSrcDoc));
SfxObjectShell* p = aSrcDoc.maShell;
ScDocument* pSrcDoc = static_cast<ScDocShell*>(p)->GetDocument();
-
- SCTAB nTabCount = pSrcDoc->GetTableCount();
- if (!maRefCache.isDocInitialized(nFileId) && nTabCount)
- {
- // Populate the cache with all table names in the source document.
- vector<String> aTabNames;
- aTabNames.reserve(nTabCount);
- for (SCTAB i = 0; i < nTabCount; ++i)
- {
- String aName;
- pSrcDoc->GetName(i, aName);
- aTabNames.push_back(aName);
- }
- maRefCache.initializeDoc(nFileId, aTabNames);
- }
+ initDocInCache(maRefCache, pSrcDoc, nFileId);
return pSrcDoc;
}
@@ -2033,7 +2149,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri
{
// Generate a relative file path.
INetURLObject aBaseURL(getOwnDocumentName());
- aBaseURL.insertName(OUString::createFromAscii("content.xml"));
+ aBaseURL.insertName(OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")));
String aStr = URIHelper::simpleNormalizedMakeRelative(
aBaseURL.GetMainURL(INetURLObject::NO_DECODE), aFile);
@@ -2137,7 +2253,7 @@ void ScExternalRefManager::SrcFileData::maybeCreateRealFileName(const String& rO
// Formulate the absolute file path from the relative path.
const String& rRelPath = maRelativeName;
INetURLObject aBaseURL(rOwnDocName);
- aBaseURL.insertName(OUString::createFromAscii("content.xml"));
+ aBaseURL.insertName(OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")));
bool bWasAbs = false;
maRealFileName = aBaseURL.smartRel2Abs(rRelPath, bWasAbs).GetMainURL(INetURLObject::NO_DECODE);
}
@@ -2358,7 +2474,7 @@ void ScExternalRefManager::addLinkListener(sal_uInt16 nFileId, LinkListener* pLi
LinkListenerMap::value_type(nFileId, LinkListeners()));
if (!r.second)
{
- DBG_ERROR("insertion of new link listener list failed");
+ OSL_FAIL("insertion of new link listener list failed");
return;
}
@@ -2419,7 +2535,7 @@ void ScExternalRefManager::purgeStaleSrcDocument(sal_Int32 nTimeOut)
maSrcDocTimer.Stop();
}
-sal_uInt32 ScExternalRefManager::getMappedNumberFormat(sal_uInt16 nFileId, sal_uInt32 nNumFmt, ScDocument* pSrcDoc)
+sal_uInt32 ScExternalRefManager::getMappedNumberFormat(sal_uInt16 nFileId, sal_uInt32 nNumFmt, const ScDocument* pSrcDoc)
{
NumFmtMap::iterator itr = maNumFormatMap.find(nFileId);
if (itr == maNumFormatMap.end())
@@ -2454,3 +2570,4 @@ IMPL_LINK(ScExternalRefManager, TimeOutHdl, AutoTimer*, pTimer)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/hiranges.cxx b/sc/source/ui/docshell/hiranges.cxx
index af1226216a06..0ad4c4e3e5d8 100644
--- a/sc/source/ui/docshell/hiranges.cxx
+++ b/sc/source/ui/docshell/hiranges.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ ScHighlightRanges::~ScHighlightRanges()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 7f11f15f5db4..133cb368e117 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,14 +40,11 @@ class StarBASIC;
#define GLOBALOVERFLOW
#endif
-// INCLUDE ---------------------------------------------------------------
-
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <osl/endian.h>
#include <i18npool/mslangid.hxx>
-#include <tools/list.hxx>
#include <tools/string.hxx>
#include <rtl/math.hxx>
#include <svtools/htmlout.hxx>
@@ -82,6 +80,9 @@ class StarBASIC;
// ause
#include "editutil.hxx"
+#include "patattr.hxx"
+#include "docpool.hxx"
+#include "stringutil.hxx"
#include "globstr.hrc"
#include <vcl/msgbox.hxx>
@@ -112,9 +113,9 @@ enum SylkVersion
ScImportExport::ScImportExport( ScDocument* p )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( sal_False ), bIncludeFiltered( sal_True ),
- bAll( sal_True ), bSingle( sal_True ), bUndo( sal_False ),
- bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( sal_True ), bSingle( sal_True ), bUndo( false ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -127,9 +128,9 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
aRange( rPt ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( sal_False ), bIncludeFiltered( sal_True ),
- bAll( sal_False ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
- bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( false ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -143,9 +144,9 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
aRange( r ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( sal_False ), bIncludeFiltered( sal_True ),
- bAll( sal_False ), bSingle( sal_False ), bUndo( sal_Bool( pDocSh != NULL ) ),
- bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( false ), bSingle( false ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -160,9 +161,9 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( sal_False ), bIncludeFiltered( sal_True ),
- bAll( sal_False ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
- bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( false ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -174,10 +175,9 @@ ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
ScRangeName* pRange = pDoc->GetRangeName();
if( pRange )
{
- sal_uInt16 nPos;
- if( pRange->SearchName( aPos, nPos ) )
+ const ScRangeData* pData = pRange->findByName(aPos);
+ if (pData)
{
- ScRangeData* pData = (*pRange)[ nPos ];
if( pData->HasType( RT_REFAREA )
|| pData->HasType( RT_ABSAREA )
|| pData->HasType( RT_ABSPOS ) )
@@ -187,7 +187,7 @@ ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
// Bereich?
if( aRange.Parse( aPos, pDoc, eConv ) & SCA_VALID )
- bSingle = sal_False;
+ bSingle = false;
// Zelle?
else if( aRange.aStart.Parse( aPos, pDoc, eConv ) & SCA_VALID )
aRange.aEnd = aRange.aStart;
@@ -243,14 +243,14 @@ sal_Bool ScImportExport::StartPaste()
InfoBox aInfoBox(Application::GetDefDialogParent(),
ScGlobal::GetRscString( aTester.GetMessageId() ) );
aInfoBox.Execute();
- return sal_False;
+ return false;
}
}
if( bUndo && pDocSh && pDoc->IsUndoEnabled())
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, false, pUndoDoc );
}
return sal_True;
}
@@ -267,7 +267,7 @@ void ScImportExport::EndPaste()
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, sal_False, pRedoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, false, pRedoDoc );
ScMarkData aDestMark;
aDestMark.SelectOneTable( aRange.aStart.Tab() );
pDocSh->GetUndoManager()->AddUndoAction(
@@ -291,56 +291,11 @@ void ScImportExport::EndPaste()
/////////////////////////////////////////////////////////////////////////////
-
-#if 0
-sal_Bool ScImportExport::ImportData( SvData& rData )
-{
- sal_uLong nFmt = rData.GetFormat();
- if ( nFmt == SOT_FORMATSTR_ID_HTML_SIMPLE )
- {
- MSE40HTMLClipFormatObj aMSE40ClpObj;
- if ( aMSE40ClpObj.GetData( rData ) )
- {
- SvStream* pStream = aMSE40ClpObj.GetStream();
- return ImportStream( *pStream, nFmt );
- }
- return sal_False;
- }
- else
- {
- void* pMem;
- sal_uLong nSize = rData.GetMinMemorySize();
- rData.GetData( &pMem, TRANSFER_REFERENCE );
- if( nFmt == FORMAT_STRING
- || nFmt == FORMAT_RTF
- || nFmt == SOT_FORMATSTR_ID_SYLK
- || nFmt == SOT_FORMATSTR_ID_HTML
- || nFmt == SOT_FORMATSTR_ID_DIF )
- {
- //! String? Unicode??
-
- // Stringende ermitteln!
- sal_Char* pBegin = (sal_Char*) pMem;
- sal_Char* pEnd = (sal_Char*) pMem + nSize;
-
- nSize = 0;
- while( pBegin != pEnd && *pBegin != '\0' )
- pBegin++, nSize++;
- // #72909# MT says only STRING has to be zero-terminated
- DBG_ASSERT( pBegin != pEnd || nFmt != FORMAT_STRING, "non zero-terminated String" )
- }
- SvMemoryStream aStrm( pMem, nSize, STREAM_READ );
- return ImportStream( aStrm, nFmt );
- }
-}
-
-#endif
-
sal_Bool ScImportExport::ImportData( const String& /* rMimeType */,
const ::com::sun::star::uno::Any & /* rValue */ )
{
DBG_ASSERT( !this, "Implementation is missing" );
- return sal_False;
+ return false;
}
sal_Bool ScImportExport::ExportData( const String& rMimeType,
@@ -357,7 +312,7 @@ sal_Bool ScImportExport::ExportData( const String& rMimeType,
aStrm.Seek( STREAM_SEEK_TO_END ) );
return sal_True;
}
- return sal_False;
+ return false;
}
@@ -412,7 +367,7 @@ sal_Bool ScImportExport::ExportString( ::rtl::OUString& rText, sal_uLong nFmt )
return sal_True;
}
rText = rtl::OUString();
- return sal_False;
+ return false;
// ExportStream must handle RTL_TEXTENCODING_UNICODE
}
@@ -443,7 +398,7 @@ sal_Bool ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding e
}
}
rText.Erase();
- return sal_False;
+ return false;
}
@@ -484,7 +439,7 @@ sal_Bool ScImportExport::ImportStream( SvStream& rStrm, const String& rBaseURL,
return sal_True;
}
- return sal_False;
+ return false;
}
@@ -553,11 +508,10 @@ sal_Bool ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL,
return sal_True;
}
- return sal_False;
+ return false;
}
-//static
void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, sal_Bool bZero )
{
rtl_TextEncoding eEnc = rStrm.GetStreamCharSet();
@@ -588,7 +542,6 @@ void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rS
// This function could be replaced by endlub()
-// static
void ScImportExport::WriteUnicodeOrByteEndl( SvStream& rStrm )
{
if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
@@ -625,7 +578,7 @@ static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
sal_Bool bCont;
do
{
- bCont = sal_False;
+ bCont = false;
const sal_Unicode* p0 = p;
for( ;; )
{
@@ -913,6 +866,18 @@ static bool lcl_PutString(
if ( nColFormat == SC_COL_TEXT )
{
+ double fDummy;
+ sal_uInt32 nIndex;
+ if (pFormatter->IsNumberFormat(rStr, nIndex, fDummy))
+ {
+ // Set the format of this cell to Text.
+ sal_uInt32 nFormat = pFormatter->GetStandardFormat(NUMBERFORMAT_TEXT);
+ ScPatternAttr aNewAttrs(pDoc->GetPool());
+ SfxItemSet& rSet = aNewAttrs.GetItemSet();
+ rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) );
+ pDoc->ApplyPattern(nCol, nRow, nTab, aNewAttrs);
+
+ }
pDoc->PutCell( nCol, nRow, nTab, ScBaseCell::CreateTextCell( rStr, pDoc ) );
return bMultiLine;
}
@@ -949,13 +914,13 @@ static bool lcl_PutString(
}
sal_uInt16 nFound = 0;
- sal_Bool bInNum = sal_False;
+ sal_Bool bInNum = false;
for ( xub_StrLen nPos=0; nPos<nLen && (bInNum ||
nFound<nMaxNumberParts); nPos++ )
{
if (bInNum && nFound == 3 && nColFormat == SC_COL_YMD &&
nPos <= nStart[nFound]+2 && rStr.GetChar(nPos) == 'T')
- bInNum = sal_False; // ISO-8601: YYYY-MM-DDThh:mm...
+ bInNum = false; // ISO-8601: YYYY-MM-DDThh:mm...
else if ((((!bInNum && nFound==nMP) || (bInNum && nFound==nMP+1))
&& ScGlobal::pCharClass->isLetterNumeric( rStr, nPos))
|| ScGlobal::pCharClass->isDigit( rStr, nPos))
@@ -969,7 +934,7 @@ static bool lcl_PutString(
nEnd[nFound-1] = nPos;
}
else
- bInNum = sal_False;
+ bInNum = false;
}
if ( nFound == 1 )
@@ -1009,7 +974,7 @@ static bool lcl_PutString(
if ( nFound >= 3 )
{
using namespace ::com::sun::star;
- sal_Bool bSecondCal = sal_False;
+ sal_Bool bSecondCal = false;
sal_uInt16 nDay = (sal_uInt16) rStr.Copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).ToInt32();
sal_uInt16 nYear = (sal_uInt16) rStr.Copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).ToInt32();
String aMStr = rStr.Copy( nStart[nMP], nEnd[nMP]+1-nStart[nMP] );
@@ -1031,7 +996,7 @@ static bool lcl_PutString(
else if ( i == 8 && rTransliteration.isEqual( aSeptCorrect,
xMonths[i].AbbrevName ) &&
rTransliteration.isEqual( aMStr, aSepShortened ) )
- { // #102136# correct English abbreviation is SEPT,
+ { // correct English abbreviation is SEPT,
// but data mostly contains SEP only
nMonth = sal::static_int_cast<sal_Int16>( i+1 );
}
@@ -1051,7 +1016,7 @@ static bool lcl_PutString(
}
else if ( i == 8 && pSecondTransliteration->isEqual(
aMStr, aSepShortened ) )
- { // #102136# correct English abbreviation is SEPT,
+ { // correct English abbreviation is SEPT,
// but data mostly contains SEP only
nMonth = sal::static_int_cast<sal_Int16>( i+1 );
bSecondCal = sal_True;
@@ -1115,7 +1080,7 @@ static bool lcl_PutString(
if (nFound > 5)
nFormat = pDocFormatter->GetStandardFormat( fDays, nFormat, nType, eDocLang);
- pDoc->PutCell( nCol, nRow, nTab, new ScValueCell(fDays), nFormat, sal_False );
+ pDoc->PutCell( nCol, nRow, nTab, new ScValueCell(fDays), nFormat, false );
return bMultiLine; // success
}
@@ -1125,7 +1090,13 @@ static bool lcl_PutString(
// Standard or date not determined -> SetString / EditCell
if( rStr.Search( _LF ) == STRING_NOTFOUND )
- pDoc->SetString( nCol, nRow, nTab, rStr, pFormatter, bDetectNumFormat );
+ {
+ ScSetStringParam aParam;
+ aParam.mpNumFormatter = pFormatter;
+ aParam.mbDetectNumberFormat = bDetectNumFormat;
+ aParam.mbSetTextCellFormat = true;
+ pDoc->SetString( nCol, nRow, nTab, rStr, &aParam );
+ }
else
{
bMultiLine = true;
@@ -1168,8 +1139,7 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
rStrm.Seek( nOldPos );
rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() );
- sal_Bool bOld = ScColumn::bDoubleAlloc;
- ScColumn::bDoubleAlloc = sal_True;
+ ScColumn::DoubleAllocSwitch aAllocSwitch(true);
SCCOL nStartCol = aRange.aStart.Col();
SCCOL nEndCol = aRange.aEnd.Col();
@@ -1354,7 +1324,7 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
{
delete pEnglishTransliteration;
delete pEnglishCalendar;
- return sal_False;
+ return false;
}
}
@@ -1363,14 +1333,13 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
if (!StartPaste())
{
EndPaste();
- return sal_False;
+ return false;
}
}
bDetermineRange = !bDetermineRange; // toggle
} while (!bDetermineRange);
- ScColumn::bDoubleAlloc = bOld;
pDoc->DoColResize( nTab, nStartCol, nEndCol, 0 );
delete pEnglishTransliteration;
@@ -1384,7 +1353,6 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
}
-// static
const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* p,
String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted )
{
@@ -1421,10 +1389,38 @@ const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* p
return p;
}
- //
- //
- //
+namespace {
+
+/**
+ * Check if a given string has any line break characters or separators.
+ *
+ * @param rStr string to inspect.
+ * @param cSep separator character.
+ */
+bool hasLineBreaksOrSeps( const String& rStr, sal_Unicode cSep )
+{
+ const sal_Unicode* p = rStr.GetBuffer();
+ for (xub_StrLen i = 0, n = rStr.Len(); i < n; ++i, ++p)
+ {
+ sal_Unicode c = *p;
+ if (c == cSep)
+ // separator found.
+ return true;
+
+ switch (c)
+ {
+ case _LF:
+ case _CR:
+ // line break found.
+ return true;
+ default:
+ ;
+ }
+ }
+ return false;
+}
+}
sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
{
@@ -1451,7 +1447,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
{
if (bFormulas)
{
- pDoc->GetFormula( nCol, nRow, aRange.aStart.Tab(), aCell, sal_True );
+ pDoc->GetFormula( nCol, nRow, aRange.aStart.Tab(), aCell );
if( aCell.Search( cSep ) != STRING_NOTFOUND )
lcl_WriteString( rStrm, aCell, cStr, cStr );
else
@@ -1505,7 +1501,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
if( mExportTextOptions.mcSeparatorConvertTo && cSep )
aCell.SearchAndReplaceAll( cSep, mExportTextOptions.mcSeparatorConvertTo );
- if( mExportTextOptions.mbAddQuotes && ( aCell.Search( cSep ) != STRING_NOTFOUND ) )
+ if( mExportTextOptions.mbAddQuotes && hasLineBreaksOrSeps(aCell, cSep) )
lcl_WriteString( rStrm, aCell, cStr, cStr );
else
lcl_WriteSimpleString( rStrm, aCell );
@@ -1514,7 +1510,6 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
if( nCol < nEndCol )
lcl_WriteSimpleString( rStrm, String(cSep) );
}
-// if( nRow < nEndRow )
WriteUnicodeOrByteEndl( rStrm );
if( rStrm.GetError() != SVSTREAM_OK )
break;
@@ -1530,7 +1525,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
{
sal_Bool bOk = sal_True;
- sal_Bool bMyDoc = sal_False;
+ sal_Bool bMyDoc = false;
SylkVersion eVersion = SYLK_OTHER;
// US-English separators for StringToDouble
@@ -1570,7 +1565,7 @@ sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
if( cTag == 'C' ) // Content
{
if( *p++ != ';' )
- return sal_False;
+ return false;
while( *p )
{
sal_Unicode ch = *p++;
@@ -1612,7 +1607,7 @@ sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
p = lcl_ScanSylkString( p, aText, eVersion);
}
else
- bText = sal_False;
+ bText = false;
const sal_Unicode* q = p;
while( *q && *q != ';' )
q++;
@@ -1689,7 +1684,7 @@ sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
else if( cTag == 'F' ) // Format
{
if( *p++ != ';' )
- return sal_False;
+ return false;
sal_Int32 nFormat = -1;
while( *p )
{
@@ -1809,7 +1804,7 @@ sal_Bool ScImportExport::Doc2Sylk( SvStream& rStrm )
{
String aBufStr;
double nVal;
- sal_Bool bForm = sal_False;
+ sal_Bool bForm = false;
SCROW r = nRow - nStartRow + 1;
SCCOL c = nCol - nStartCol + 1;
ScBaseCell* pCell;
@@ -1969,7 +1964,7 @@ sal_Bool ScImportExport::Dif2Doc( SvStream& rStrm )
SCCOL nEndCol;
SCROW nEndRow;
pImportDoc->GetCellArea( nTab, nEndCol, nEndRow );
- // #131247# if there are no cells in the imported content, nEndCol/nEndRow may be before the start
+ // if there are no cells in the imported content, nEndCol/nEndRow may be before the start
if ( nEndCol < aRange.aStart.Col() )
nEndCol = aRange.aStart.Col();
if ( nEndRow < aRange.aStart.Row() )
@@ -1981,7 +1976,7 @@ sal_Bool ScImportExport::Dif2Doc( SvStream& rStrm )
{
sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
- pImportDoc->CopyToDocument( aRange, nFlags, sal_False, pDoc );
+ pImportDoc->CopyToDocument( aRange, nFlags, false, pDoc );
EndPaste();
}
@@ -2030,7 +2025,19 @@ sal_Bool ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
- pImp->WriteToDocument();
+
+ if (pExtOptions)
+ {
+ // Pick up import options if available.
+ LanguageType eLang = pExtOptions->GetLanguage();
+ SvNumberFormatter aNumFormatter(pDoc->GetServiceManager(), eLang);
+ bool bSpecialNumber = pExtOptions->IsDetectSpecialNumber();
+ pImp->WriteToDocument(false, 1.0, &aNumFormatter, bSpecialNumber);
+ }
+ else
+ // Regular import, with no options.
+ pImp->WriteToDocument();
+
EndPaste();
}
delete pImp;
@@ -2042,7 +2049,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
public:
ScFormatFilterMissing()
{
- OSL_ASSERT ("Missing file filters");
+ OSL_FAIL("Missing file filters");
}
virtual FltError ScImportLotus123( SfxMedium&, ScDocument*, CharSet ) RETURN_ERROR
virtual FltError ScImportQuattroPro( SfxMedium &, ScDocument * ) RETURN_ERROR
@@ -2081,7 +2088,7 @@ ScFormatFilterPlugin &ScFormatFilter::Get()
if ( aModule.loadRelative( &thisModule,
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "scfilt" ) ) ) ) )
{
- oslGenericFunction fn = aModule.getFunctionSymbol( ::rtl::OUString::createFromAscii( "ScFilterCreate" ) );
+ oslGenericFunction fn = aModule.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScFilterCreate" )) );
if (fn != NULL)
plugin = reinterpret_cast<FilterFn>(fn)();
}
@@ -2090,3 +2097,5 @@ ScFormatFilterPlugin &ScFormatFilter::Get()
return *plugin;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/macromgr.cxx b/sc/source/ui/docshell/macromgr.cxx
new file mode 100644
index 000000000000..fdc837d363e3
--- /dev/null
+++ b/sc/source/ui/docshell/macromgr.cxx
@@ -0,0 +1,216 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * 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_sc.hxx"
+
+// INCLUDE ---------------------------------------------------------------
+
+#include "macromgr.hxx"
+#include "document.hxx"
+
+#include "basic/basmgr.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "sfx2/objsh.hxx"
+#include "cell.hxx"
+#include <com/sun/star/container/XContainer.hpp>
+
+#include <list>
+
+using namespace ::com::sun::star;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+using ::rtl::OUStringHash;
+using ::boost::unordered_map;
+using ::std::list;
+using ::std::for_each;
+using ::std::pair;
+
+// ============================================================================
+
+/**
+ * A simple container to keep track of cells that depend on basic modules
+ * changes. We don't check for duplicates at insertion time; instead, we
+ * remove duplicates at query time.
+ */
+class ScUserMacroDepTracker
+{
+public:
+ void addCell(const OUString& rModuleName, ScFormulaCell* pCell)
+ {
+ ModuleCellMap::iterator itr = maCells.find(rModuleName);
+ if (itr == maCells.end())
+ {
+ pair<ModuleCellMap::iterator, bool> r = maCells.insert(
+ ModuleCellMap::value_type(rModuleName, list<ScFormulaCell*>()));
+
+ if (!r.second)
+ // insertion failed.
+ return;
+
+ itr = r.first;
+ }
+ itr->second.push_back(pCell);
+ }
+
+ void removeCell(ScFormulaCell* pCell)
+ {
+ ModuleCellMap::iterator itr = maCells.begin(), itrEnd = maCells.end();
+ for (; itr != itrEnd; ++itr)
+ itr->second.remove(pCell);
+ }
+
+ void getCellsByModule(const OUString& rModuleName, list<ScFormulaCell*>& rCells)
+ {
+ ModuleCellMap::iterator itr = maCells.find(rModuleName);
+ if (itr == maCells.end())
+ return;
+
+ list<ScFormulaCell*>& rCellList = itr->second;
+
+ // Remove duplicates.
+ rCellList.sort();
+ rCellList.unique();
+ // exception safe copy
+ list<ScFormulaCell*> temp(rCellList);
+ rCells.swap(temp);
+ }
+
+private:
+ typedef boost::unordered_map<OUString, list<ScFormulaCell*>, OUStringHash> ModuleCellMap;
+ ModuleCellMap maCells;
+};
+
+
+// ============================================================================
+
+ScMacroManager::ScMacroManager(ScDocument* pDoc) :
+ mpDepTracker(new ScUserMacroDepTracker),
+ mpDoc(pDoc)
+{
+}
+
+ScMacroManager::~ScMacroManager()
+{
+}
+
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener > ContainerListenerHelper;
+
+class VBAProjectListener : public ContainerListenerHelper
+{
+ ScMacroManager* mpMacroMgr;
+public:
+ VBAProjectListener( ScMacroManager* pMacroMgr ) : mpMacroMgr( pMacroMgr ) {}
+ // XEventListener
+ virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw(RuntimeException) {}
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const container::ContainerEvent& /*Event*/ ) throw(RuntimeException){}
+ virtual void SAL_CALL elementReplaced( const container::ContainerEvent& Event ) throw(RuntimeException)
+ {
+ rtl::OUString sModuleName;
+ Event.Accessor >>= sModuleName;
+ OSL_TRACE("VBAProjectListener::elementReplaced(%s)", rtl::OUStringToOString( sModuleName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ mpMacroMgr->InitUserFuncData();
+ mpMacroMgr->BroadcastModuleUpdate(sModuleName);
+ }
+ virtual void SAL_CALL elementRemoved( const container::ContainerEvent& /*Event*/ ) throw(RuntimeException){}
+
+};
+
+void ScMacroManager::InitUserFuncData()
+{
+ // Clear boost::unordered_map
+ mhFuncToVolatile.clear();
+ String sProjectName( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+
+ Reference< container::XContainer > xModuleContainer;
+ SfxObjectShell* pShell = mpDoc->GetDocumentShell();
+ if ( pShell && pShell->GetBasicManager()->GetName().Len() > 0 )
+ sProjectName = pShell->GetBasicManager()->GetName();
+ try
+ {
+ Reference< script::XLibraryContainer > xLibraries( pShell->GetBasicContainer(), uno::UNO_QUERY_THROW );
+ xModuleContainer.set( xLibraries->getByName( sProjectName ), uno::UNO_QUERY_THROW );
+
+ if ( xModuleContainer.is() )
+ {
+ // remove old listener ( if there was one )
+ if ( mxContainerListener.is() )
+ xModuleContainer->removeContainerListener( mxContainerListener );
+ // Create listener
+ mxContainerListener = new VBAProjectListener( this );
+ xModuleContainer->addContainerListener( mxContainerListener );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+void ScMacroManager::SetUserFuncVolatile( const OUString& sName, bool isVolatile )
+{
+ mhFuncToVolatile[ sName ] = isVolatile;
+}
+
+bool ScMacroManager::GetUserFuncVolatile( const OUString& sName )
+{
+ NameBoolMap::iterator it = mhFuncToVolatile.find( sName );
+ if ( it == mhFuncToVolatile.end() )
+ return false;
+ return it->second;
+}
+
+void ScMacroManager::AddDependentCell(const OUString& aModuleName, ScFormulaCell* pCell)
+{
+ mpDepTracker->addCell(aModuleName, pCell);
+}
+
+void ScMacroManager::RemoveDependentCell(ScFormulaCell* pCell)
+{
+ mpDepTracker->removeCell(pCell);
+}
+
+void ScMacroManager::BroadcastModuleUpdate(const OUString& aModuleName)
+{
+ list<ScFormulaCell*> aCells;
+ mpDepTracker->getCellsByModule(aModuleName, aCells);
+ list<ScFormulaCell*>::iterator itr = aCells.begin(), itrEnd = aCells.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ ScFormulaCell* pCell = *itr;
+ mpDoc->PutInFormulaTree(pCell); // for F9 recalc
+
+ // for recalc on cell value change. If the cell is not volatile, the
+ // cell stops listening right away after it gets re-interpreted.
+ mpDoc->StartListeningArea(BCA_LISTEN_ALWAYS, pCell);
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/makefile.mk b/sc/source/ui/docshell/makefile.mk
index af45c63c2cdf..6736362d9565 100644
--- a/sc/source/ui/docshell/makefile.mk
+++ b/sc/source/ui/docshell/makefile.mk
@@ -33,9 +33,7 @@ LIBTARGET=no
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -68,41 +66,35 @@ CXXFILES = \
SLOFILES = \
- $(SLO)$/docsh.obj \
- $(SLO)$/docsh2.obj \
- $(SLO)$/docsh3.obj \
- $(SLO)$/docsh4.obj \
- $(SLO)$/docsh5.obj \
- $(SLO)$/docsh6.obj \
- $(SLO)$/docsh7.obj \
- $(SLO)$/docsh8.obj \
- $(SLO)$/externalrefmgr.obj \
- $(SLO)$/tablink.obj \
- $(SLO)$/arealink.obj \
- $(SLO)$/dbdocfun.obj \
- $(SLO)$/dbdocimp.obj \
- $(SLO)$/impex.obj \
- $(SLO)$/docfunc.obj \
- $(SLO)$/olinefun.obj \
- $(SLO)$/servobj.obj \
- $(SLO)$/tpstat.obj \
- $(SLO)$/autostyl.obj \
- $(SLO)$/pagedata.obj \
+ $(EXCEPTIONSFILES) \
$(SLO)$/hiranges.obj \
- $(SLO)$/pntlock.obj \
- $(SLO)$/sizedev.obj \
- $(SLO)$/editable.obj
+ $(SLO)$/pagedata.obj \
+ $(SLO)$/pntlock.obj
EXCEPTIONSFILES= \
+ $(SLO)$/arealink.obj \
+ $(SLO)$/autostyl.obj \
+ $(SLO)$/dbdocfun.obj \
+ $(SLO)$/dbdocimp.obj \
+ $(SLO)$/docfunc.obj \
$(SLO)$/docsh.obj \
- $(SLO)$/docsh3.obj \
+ $(SLO)$/docsh2.obj \
+ $(SLO)$/docsh3.obj \
$(SLO)$/docsh4.obj \
- $(SLO)$/docsh5.obj \
+ $(SLO)$/docsh5.obj \
+ $(SLO)$/docsh6.obj \
+ $(SLO)$/docsh7.obj \
$(SLO)$/docsh8.obj \
+ $(SLO)$/editable.obj \
$(SLO)$/externalrefmgr.obj \
- $(SLO)$/dbdocimp.obj \
- $(SLO)$/docfunc.obj
+ $(SLO)$/impex.obj \
+ $(SLO)$/macromgr.obj \
+ $(SLO)$/olinefun.obj \
+ $(SLO)$/servobj.obj \
+ $(SLO)$/sizedev.obj \
+ $(SLO)$/tablink.obj \
+ $(SLO)$/tpstat.obj
SRS1NAME=$(TARGET)
SRC1FILES = tpstat.src
@@ -132,7 +124,8 @@ LIB1OBJFILES = \
$(SLO)$/hiranges.obj \
$(SLO)$/pntlock.obj \
$(SLO)$/sizedev.obj \
- $(SLO)$/editable.obj
+ $(SLO)$/editable.obj \
+ $(SLO)$/macromgr.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index 5e2503f94e15..6d35207b78ce 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98,7 +99,7 @@ void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab,
sal_Bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, sal_Bool bColumns, sal_Bool bRecord, sal_Bool bApi )
{
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
@@ -110,7 +111,7 @@ sal_Bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, sal_Bool bColumns
ScOutlineTable* pUndoTab = NULL;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
if (bRecord)
pUndoTab = new ScOutlineTable( *pTable );
@@ -118,7 +119,7 @@ sal_Bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, sal_Bool bColumns
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
sal_Bool bRes;
- sal_Bool bSize = sal_False;
+ sal_Bool bSize = false;
if ( bColumns )
bRes = pArray->Insert( nStartCol, nEndCol, bSize );
else
@@ -135,7 +136,7 @@ sal_Bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, sal_Bool bColumns
}
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
sal_uInt16 nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
@@ -162,7 +163,7 @@ sal_Bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, sal_Bool bColumns
sal_Bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, sal_Bool bColumns, sal_Bool bRecord, sal_Bool bApi )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -173,7 +174,7 @@ sal_Bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, sal_Bool bColum
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
@@ -184,7 +185,7 @@ sal_Bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, sal_Bool bColum
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
sal_Bool bRes;
- sal_Bool bSize = sal_False;
+ sal_Bool bSize = false;
if ( bColumns )
bRes = pArray->Remove( nStartCol, nEndCol, bSize );
else
@@ -197,11 +198,11 @@ sal_Bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, sal_Bool bColum
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoMakeOutline( &rDocShell,
nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
- pUndoTab, bColumns, sal_False ) );
+ pUndoTab, bColumns, false ) );
}
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
sal_uInt16 nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
@@ -230,11 +231,11 @@ sal_Bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, sal_Bool bColum
sal_Bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, sal_Bool bRecord, sal_Bool bApi )
{
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
@@ -250,8 +251,8 @@ sal_Bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, sal_Bool bRecord, sal_
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, sal_False, pUndoDoc );
- pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
@@ -262,14 +263,14 @@ sal_Bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, sal_Bool bRecord, sal_
pUndoDoc, pUndoTab ) );
}
- SelectLevel( nTab, sal_True, pTable->GetColArray()->GetDepth(), sal_False, sal_False, bApi );
- SelectLevel( nTab, sal_False, pTable->GetRowArray()->GetDepth(), sal_False, sal_False, bApi );
+ SelectLevel( nTab, sal_True, pTable->GetColArray()->GetDepth(), false, false, bApi );
+ SelectLevel( nTab, false, pTable->GetRowArray()->GetDepth(), false, false, bApi );
pDoc->SetOutlineTable( nTab, NULL );
pDoc->UpdatePageBreaks( nTab );
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
@@ -296,7 +297,7 @@ sal_Bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, sal_Bool bRecord,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
ScDocument* pUndoDoc = NULL;
@@ -318,13 +319,13 @@ sal_Bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, sal_Bool bRecord,
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, IDF_NONE, sal_False, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
// einblenden
- SelectLevel( nTab, sal_True, pTable->GetColArray()->GetDepth(), sal_False, sal_False, bApi );
- SelectLevel( nTab, sal_False, pTable->GetRowArray()->GetDepth(), sal_False, sal_False, bApi );
+ SelectLevel( nTab, sal_True, pTable->GetColArray()->GetDepth(), false, false, bApi );
+ SelectLevel( nTab, false, pTable->GetRowArray()->GetDepth(), false, false, bApi );
pDoc->SetOutlineTable( nTab, NULL );
}
@@ -340,7 +341,7 @@ sal_Bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, sal_Bool bRecord,
}
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
@@ -357,13 +358,13 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab ); // ist schon da
if (!pTable)
- return sal_False;
+ return false;
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
if (!pArray)
- return sal_False;
+ return false;
SCCOLROW nStart, nEnd;
pArray->GetRange( nStart, nEnd );
@@ -374,15 +375,15 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_False );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, sal_False,
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
@@ -392,6 +393,7 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
bColumns, nLevel ) );
}
+ pDoc->InitializeNoteCaptions(nTab);
ScSubOutlineIterator aIter( pArray ); // alle Eintraege
ScOutlineEntry* pEntry;
while ((pEntry=aIter.GetNext()) != NULL)
@@ -400,7 +402,7 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
sal_Bool bShow = (nThisLevel < nLevel);
if (bShow) // einblenden
{
- pEntry->SetHidden( sal_False );
+ pEntry->SetHidden( false );
pEntry->SetVisible( sal_True );
}
else if ( nThisLevel == nLevel ) // ausblenden
@@ -410,7 +412,7 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
}
else // verdeckt
{
- pEntry->SetVisible( sal_False );
+ pEntry->SetVisible( false );
}
SCCOLROW nThisStart = pEntry->GetStart();
@@ -425,6 +427,7 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
}
}
+ pDoc->SetDrawPageSize(nTab);
pDoc->UpdatePageBreaks( nTab );
if (bPaint)
@@ -440,7 +443,7 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1
sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -451,7 +454,7 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
@@ -469,8 +472,8 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, sal_False, pUndoDoc );
- pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoOutlineBlock( &rDocShell,
@@ -490,7 +493,7 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
nEnd = pEntry->GetEnd();
if ( nStart>=nStartCol && nEnd<=nEndCol )
{
- pEntry->SetHidden( sal_False );
+ pEntry->SetHidden( false );
pEntry->SetVisible( sal_True );
if (nStart<nMin) nMin=nStart;
if (nEnd>nMax) nMax=nEnd;
@@ -505,13 +508,14 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
nMax=0;
pArray = pTable->GetRowArray();
ScSubOutlineIterator aRowIter( pArray );
+ pDoc->InitializeNoteCaptions(nTab);
while ((pEntry=aRowIter.GetNext()) != NULL)
{
nStart = pEntry->GetStart();
nEnd = pEntry->GetEnd();
if ( nStart>=nStartRow && nEnd<=nEndRow )
{
- pEntry->SetHidden( sal_False );
+ pEntry->SetHidden( false );
pEntry->SetVisible( sal_True );
if (nStart<nMin) nMin=nStart;
if (nEnd>nMax) nMax=nEnd;
@@ -521,10 +525,10 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
if ( !pDoc->RowFiltered( i,nTab ) ) // weggefilterte nicht einblenden
pDoc->ShowRow( i, nTab, sal_True );
+ pDoc->SetDrawPageSize(nTab);
pDoc->UpdatePageBreaks( nTab );
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP );
-
rDocShell.SetDocumentModified();
bDone = sal_True;
@@ -539,7 +543,7 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b
sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -550,7 +554,7 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
@@ -581,13 +585,13 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
pDoc->CopyToDocument( static_cast<SCCOL>(nEffStartCol), 0, nTab,
static_cast<SCCOL>(nEffEndCol), MAXROW, nTab, IDF_NONE,
- sal_False, pUndoDoc );
- pDoc->CopyToDocument( 0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, IDF_NONE, sal_False, pUndoDoc );
+ false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, IDF_NONE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoOutlineBlock( &rDocShell,
nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
- pUndoDoc, pUndoTab, sal_False ) );
+ pUndoDoc, pUndoTab, false ) );
}
// Spalten
@@ -600,7 +604,7 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b
nEnd = pEntry->GetEnd();
if ( static_cast<SCCOLROW>(nStartCol)<=nEnd && static_cast<SCCOLROW>(nEndCol)>=nStart )
- HideOutline( nTab, sal_True, nColLevel, i, sal_False, sal_False, bApi );
+ HideOutline( nTab, sal_True, nColLevel, i, false, false, bApi );
}
// Zeilen
@@ -613,7 +617,7 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b
nEnd = pEntry->GetEnd();
if ( nStartRow<=nEnd && nEndRow>=nStart )
- HideOutline( nTab, sal_False, nRowLevel, i, sal_False, sal_False, bApi );
+ HideOutline( nTab, false, nRowLevel, i, false, false, bApi );
}
pDoc->UpdatePageBreaks( nTab );
@@ -639,7 +643,7 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
{
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
@@ -652,15 +656,15 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_False );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, sal_False,
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
@@ -671,7 +675,8 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
//! HideCursor();
- pEntry->SetHidden(sal_False);
+ pDoc->InitializeNoteCaptions(nTab);
+ pEntry->SetHidden(false);
SCCOLROW i;
for ( i = nStart; i <= nEnd; i++ )
{
@@ -692,15 +697,16 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
for ( i = nSubStart; i <= nSubEnd; i++ )
{
if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, sal_False );
+ pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
else
- pDoc->ShowRow( i, nTab, sal_False );
+ pDoc->ShowRow( i, nTab, false );
}
}
}
pArray->SetVisibleBelow( nLevel, nEntry, sal_True, sal_True );
+ pDoc->SetDrawPageSize(nTab);
pDoc->InvalidatePageBreaks(nTab);
pDoc->UpdatePageBreaks( nTab );
@@ -723,7 +729,7 @@ sal_Bool ScOutlineDocFunc::HideOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
{
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
@@ -736,37 +742,39 @@ sal_Bool ScOutlineDocFunc::HideOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_False );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, sal_False,
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoDoOutline( &rDocShell,
nStart, nEnd, nTab, pUndoDoc,
- bColumns, nLevel, nEntry, sal_False ) );
+ bColumns, nLevel, nEntry, false ) );
}
//! HideCursor();
- pEntry->SetHidden(sal_True);
+ pDoc->InitializeNoteCaptions(nTab);
+ pEntry->SetHidden(true);
SCCOLROW i;
for ( i = nStart; i <= nEnd; i++ )
{
if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, sal_False );
+ pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
else
- pDoc->ShowRow( i, nTab, sal_False );
+ pDoc->ShowRow( i, nTab, false );
}
- pArray->SetVisibleBelow( nLevel, nEntry, sal_False );
+ pArray->SetVisibleBelow( nLevel, nEntry, false );
+ pDoc->SetDrawPageSize(nTab);
pDoc->InvalidatePageBreaks(nTab);
pDoc->UpdatePageBreaks( nTab );
@@ -788,3 +796,4 @@ sal_Bool ScOutlineDocFunc::HideOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/pagedata.cxx b/sc/source/ui/docshell/pagedata.cxx
index 68076f04ce77..b3ec3e31d010 100644
--- a/sc/source/ui/docshell/pagedata.cxx
+++ b/sc/source/ui/docshell/pagedata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111,11 +112,11 @@ ScPrintRangeData& ScPageBreakData::GetData(size_t nPos)
sal_Bool ScPageBreakData::IsEqual( const ScPageBreakData& rOther ) const
{
if ( nUsed != rOther.nUsed )
- return sal_False;
+ return false;
for (sal_uInt16 i=0; i<nUsed; i++)
if ( pData[i].GetPrintRange() != rOther.pData[i].GetPrintRange() )
- return sal_False;
+ return false;
//! ScPrintRangeData komplett vergleichen ??
@@ -137,3 +138,4 @@ void ScPageBreakData::AddPages()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/pntlock.cxx b/sc/source/ui/docshell/pntlock.cxx
index 7e26c96ac2d8..2ca47820eb6d 100644
--- a/sc/source/ui/docshell/pntlock.cxx
+++ b/sc/source/ui/docshell/pntlock.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@ ScPaintLockData::ScPaintLockData(sal_uInt16 nNewMode) :
nLevel( 0 ),
nDocLevel( 0 ),
nParts( 0 ),
- bModified( sal_False )
+ bModified( false )
{
}
@@ -59,3 +60,4 @@ void ScPaintLockData::AddRange( const ScRange& rRange, sal_uInt16 nP )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 93e23e9cae79..6bd9f6d629bf 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,6 +42,8 @@
#include "rangenam.hxx"
#include "sc.hrc" // SC_HINT_AREAS_CHANGED
+using namespace formula;
+
// -----------------------------------------------------------------------
sal_Bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& rName )
@@ -51,16 +54,15 @@ sal_Bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const Strin
ScRangeName* pNames = pDoc->GetRangeName();
if (pNames)
{
- sal_uInt16 nPos;
- if( pNames->SearchName( rName, nPos ) )
+ const ScRangeData* pData = pNames->findByName(rName);
+ if (pData)
{
- ScRangeData* pData = (*pNames)[ nPos ];
if ( pData->IsValidReference( rRange ) )
return sal_True;
}
}
}
- return sal_False;
+ return false;
}
ScServerObjectSvtListenerForwarder::ScServerObjectSvtListenerForwarder(
@@ -82,7 +84,7 @@ void ScServerObjectSvtListenerForwarder::Notify( SvtBroadcaster& /* rBC */, cons
ScServerObject::ScServerObject( ScDocShell* pShell, const String& rItem ) :
aForwarder( this ),
pDocSh( pShell ),
- bRefreshListener( sal_False )
+ bRefreshListener( false )
{
// parse item string
@@ -97,18 +99,20 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const String& rItem ) :
SCTAB nTab = pDocSh->GetCurTab();
aRange.aStart.SetTab( nTab );
- if ( aRange.Parse( rItem, pDoc ) & SCA_VALID )
+ // For DDE link, we always must parse references using OOO A1 convention.
+
+ if ( aRange.Parse( rItem, pDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
{
// area reference
}
- else if ( aRange.aStart.Parse( rItem, pDoc, pDoc->GetAddressConvention() ) & SCA_VALID )
+ else if ( aRange.aStart.Parse( rItem, pDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
{
// cell reference
aRange.aEnd = aRange.aStart;
}
else
{
- DBG_ERROR("ScServerObject: invalid item");
+ OSL_FAIL("ScServerObject: invalid item");
}
}
@@ -119,7 +123,7 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const String& rItem ) :
StartListening(*SFX_APP()); // for SC_HINT_AREAS_CHANGED
}
-__EXPORT ScServerObject::~ScServerObject()
+ScServerObject::~ScServerObject()
{
Clear();
}
@@ -144,12 +148,12 @@ void ScServerObject::EndListeningAll()
SfxListener::EndListeningAll();
}
-sal_Bool __EXPORT ScServerObject::GetData(
+sal_Bool ScServerObject::GetData(
::com::sun::star::uno::Any & rData /*out param*/,
const String & rMimeType, sal_Bool /* bSynchron */ )
{
if (!pDocSh)
- return sal_False;
+ return false;
// named ranges may have changed -> update aRange
if ( aItemStr.Len() )
@@ -170,7 +174,7 @@ sal_Bool __EXPORT ScServerObject::GetData(
pDocSh->GetDocument()->StartListeningArea( aRange, &aForwarder );
StartListening(*pDocSh);
StartListening(*SFX_APP());
- bRefreshListener = sal_False;
+ bRefreshListener = false;
}
String aDdeTextFmt = pDocSh->GetDdeTextFmt();
@@ -208,9 +212,9 @@ sal_Bool __EXPORT ScServerObject::GetData(
return 0;
}
-void __EXPORT ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- sal_Bool bDataChanged = sal_False;
+ sal_Bool bDataChanged = false;
// DocShell can't be tested via type info, because SFX_HINT_DYING comes from the dtor
if ( &rBC == pDocSh )
@@ -271,3 +275,4 @@ void __EXPORT ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx
index 405437e5c18f..19dc2843470e 100644
--- a/sc/source/ui/docshell/sizedev.cxx
+++ b/sc/source/ui/docshell/sizedev.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
if ( bTextWysiwyg )
{
pDevice = pDocSh->GetPrinter();
- bOwner = sal_False;
+ bOwner = false;
aOldMapMode = pDevice->GetMapMode();
pDevice->SetMapMode( MAP_PIXEL ); // GetNeededSize needs pixel MapMode
@@ -75,3 +76,4 @@ ScSizeDeviceProvider::~ScSizeDeviceProvider()
pDevice->SetMapMode( aOldMapMode );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 04755f9b8c82..b962bcfd37e1 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,8 +86,8 @@ ScTableLink::ScTableLink(ScDocShell* pDocSh, const String& rFile,
aFileName(rFile),
aFilterName(rFilter),
aOptions(rOpt),
- bInCreate( sal_False ),
- bInEdit( sal_False ),
+ bInCreate( false ),
+ bInEdit( false ),
bAddUndo( sal_True ),
bDoPaint( sal_True )
{
@@ -102,8 +103,8 @@ ScTableLink::ScTableLink(SfxObjectShell* pShell, const String& rFile,
aFileName(rFile),
aFilterName(rFilter),
aOptions(rOpt),
- bInCreate( sal_False ),
- bInEdit( sal_False ),
+ bInCreate( false ),
+ bInEdit( false ),
bAddUndo( sal_True ),
bDoPaint( sal_True )
{
@@ -112,7 +113,7 @@ ScTableLink::ScTableLink(SfxObjectShell* pShell, const String& rFile,
SetRefreshControl( pImpl->m_pDocSh->GetDocument()->GetRefreshTimerControlAddress() );
}
-__EXPORT ScTableLink::~ScTableLink()
+ScTableLink::~ScTableLink()
{
// Verbindung aufheben
@@ -126,7 +127,7 @@ __EXPORT ScTableLink::~ScTableLink()
delete pImpl;
}
-void __EXPORT ScTableLink::Edit( Window* pParent, const Link& rEndEditHdl )
+void ScTableLink::Edit( Window* pParent, const Link& rEndEditHdl )
{
// DefModalDialogParent setzen, weil evtl. aus der DocShell beim ConvertFrom
// ein Optionen-Dialog kommt...
@@ -140,7 +141,7 @@ void __EXPORT ScTableLink::Edit( Window* pParent, const Link& rEndEditHdl )
SvBaseLink::Edit( pParent, LINK( this, ScTableLink, TableEndEditHdl ) );
}
-void __EXPORT ScTableLink::DataChanged( const String&,
+void ScTableLink::DataChanged( const String&,
const ::com::sun::star::uno::Any& )
{
sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument()->GetLinkManager();
@@ -159,7 +160,7 @@ void __EXPORT ScTableLink::DataChanged( const String&,
}
}
-void __EXPORT ScTableLink::Closed()
+void ScTableLink::Closed()
{
// Verknuepfung loeschen: Undo
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
@@ -170,7 +171,7 @@ void __EXPORT ScTableLink::Closed()
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoRemoveLink( pImpl->m_pDocSh, aFileName ) );
- bAddUndo = sal_False; // nur einmal
+ bAddUndo = false; // nur einmal
}
// Verbindung wird im dtor aufgehoben
@@ -189,14 +190,14 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
// Dokument laden
if (!rNewFile.Len() || !rNewFilter.Len())
- return sal_False;
+ return false;
String aNewUrl( ScGlobal::GetAbsDocName( rNewFile, pImpl->m_pDocSh ) );
sal_Bool bNewUrlName = (aNewUrl != aFileName);
const SfxFilter* pFilter = pImpl->m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
if (!pFilter)
- return sal_False;
+ return false;
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
pDoc->SetInLinkUpdate( sal_True );
@@ -214,7 +215,7 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
if ( aOptions.Len() )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
- SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, sal_False, pFilter, pSet);
+ SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, false, pFilter, pSet);
if ( bInEdit ) // only if using the edit dialog,
pMed->UseInteractionHandler( sal_True ); // enable the filter options dialog
@@ -240,10 +241,10 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
ScDocShellModificator aModificator( *pImpl->m_pDocSh );
- sal_Bool bNotFound = sal_False;
+ sal_Bool bNotFound = false;
ScDocument* pSrcDoc = pSrcShell->GetDocument();
- // #74835# from text filters that don't set the table name,
+ // from text filters that don't set the table name,
// use the one table regardless of link table name
sal_Bool bAutoTab = (pSrcDoc->GetTableCount() == 1) &&
ScDocShell::HasAutomaticTableName( rNewFilter );
@@ -264,9 +265,9 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
else
pUndoDoc->AddUndoTab( nTab, nTab, sal_True, sal_True );
- bFirst = sal_False;
+ bFirst = false;
ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab);
- pDoc->CopyToDocument(aRange, IDF_ALL, sal_False, pUndoDoc);
+ pDoc->CopyToDocument(aRange, IDF_ALL, false, pUndoDoc);
pUndoDoc->TransferDrawPage( pDoc, nTab, nTab );
pUndoDoc->SetLink( nTab, nMode, aFileName, aFilterName,
aOptions, aTabName, GetRefreshDelay() );
@@ -283,7 +284,7 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
{
pDoc->RenameTab( nTab,
ScGlobal::GetDocTabName( aNewUrl, aTabName ),
- sal_False, sal_True ); // kein RefUpdate, kein ValidTabName
+ false, sal_True ); // kein RefUpdate, kein ValidTabName
}
}
@@ -304,7 +305,7 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
}
if (bFound)
- pDoc->TransferTab( pSrcDoc, nSrcTab, nTab, sal_False, // nicht neu einfuegen
+ pDoc->TransferTab( pSrcDoc, nSrcTab, nTab, false, // nicht neu einfuegen
(nMode == SC_LINK_VALUE) ); // nur Werte?
else
{
@@ -313,7 +314,7 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
bool bShowError = true;
if ( nMode == SC_LINK_VALUE )
{
- // #139464# Value link (used with external references in formulas):
+ // Value link (used with external references in formulas):
// Look for formulas that reference the sheet, and put errors in the referenced cells.
ScRangeList aErrorCells; // cells on the linked sheets that need error values
@@ -341,7 +342,7 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
pCell = aCellIter.GetNext();
}
- sal_uLong nRanges = aErrorCells.Count();
+ size_t nRanges = aErrorCells.size();
if ( nRanges ) // found any?
{
ScTokenArray aTokenArr;
@@ -350,9 +351,9 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
aTokenArr.AddOpCode( ocClose );
aTokenArr.AddOpCode( ocStop );
- for (sal_uLong nPos=0; nPos<nRanges; nPos++)
+ for (size_t nPos=0; nPos < nRanges; nPos++)
{
- const ScRange* pRange = aErrorCells.GetObject(nPos);
+ const ScRange* pRange = aErrorCells[ nPos ];
SCCOL nStartCol = pRange->aStart.Col();
SCROW nStartRow = pRange->aStart.Row();
SCCOL nEndCol = pRange->aEnd.Col();
@@ -404,7 +405,6 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
// aufraeumen
-// pSrcShell->DoClose();
aRef->DoClose();
// Undo
@@ -427,7 +427,7 @@ sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
//! Fehler ausgeben ?
}
- pDoc->SetInLinkUpdate( sal_False );
+ pDoc->SetInLinkUpdate( false );
// notify Uno objects (for XRefreshListener)
//! also notify Uno objects if file name was changed!
@@ -448,14 +448,14 @@ IMPL_LINK( ScTableLink, TableEndEditHdl, ::sfx2::SvBaseLink*, pLink )
{
if ( pImpl->m_aEndEditLink.IsSet() )
pImpl->m_aEndEditLink.Call( pLink );
- bInEdit = sal_False;
+ bInEdit = false;
Application::SetDefDialogParent( pImpl->m_pOldParent );
return 0;
}
// === ScDocumentLoader ==================================================
-String ScDocumentLoader::GetOptions( SfxMedium& rMedium ) // static
+String ScDocumentLoader::GetOptions( SfxMedium& rMedium )
{
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
@@ -467,7 +467,7 @@ String ScDocumentLoader::GetOptions( SfxMedium& rMedium ) // static
sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
String& rFilter, String& rOptions,
- sal_Bool bWithContent, sal_Bool bWithInteraction ) // static
+ sal_Bool bWithContent, sal_Bool bWithInteraction )
{
TypeId aScType = TYPE(ScDocShell);
SfxObjectShell* pDocSh = SfxObjectShell::GetFirst( &aScType );
@@ -489,12 +489,12 @@ sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
INetURLObject aUrl( rFileName );
INetProtocol eProt = aUrl.GetProtocol();
if ( eProt == INET_PROT_NOT_VALID ) // invalid URL?
- return sal_False; // abort without creating a medium
+ return false; // abort without creating a medium
// Filter-Detection
const SfxFilter* pSfxFilter = NULL;
- SfxMedium* pMedium = new SfxMedium( rFileName, STREAM_STD_READ, sal_False );
+ SfxMedium* pMedium = new SfxMedium( rFileName, STREAM_STD_READ, false );
if ( pMedium->GetError() == ERRCODE_NONE )
{
if ( bWithInteraction )
@@ -507,7 +507,7 @@ sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
aMatcher.GuessFilterIgnoringContent( *pMedium, &pSfxFilter );
}
- sal_Bool bOK = sal_False;
+ sal_Bool bOK = false;
if ( pMedium->GetError() == ERRCODE_NONE )
{
if ( pSfxFilter )
@@ -521,7 +521,7 @@ sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
return bOK;
}
-void ScDocumentLoader::RemoveAppPrefix( String& rFilterName ) // static
+void ScDocumentLoader::RemoveAppPrefix( String& rFilterName )
{
String aAppPrefix = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( STRING_SCAPP ));
aAppPrefix.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
@@ -546,7 +546,7 @@ ScDocumentLoader::ScDocumentLoader( const String& rFileName,
if ( rOptions.Len() )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) );
- pMedium = new SfxMedium( rFileName, STREAM_STD_READ, sal_False, pFilter, pSet );
+ pMedium = new SfxMedium( rFileName, STREAM_STD_READ, false, pFilter, pSet );
if ( pMedium->GetError() != ERRCODE_NONE )
return ;
@@ -577,9 +577,6 @@ ScDocumentLoader::ScDocumentLoader( const String& rFileName,
ScDocumentLoader::~ScDocumentLoader()
{
-/* if ( pDocShell )
- pDocShell->DoClose();
-*/
if ( aRef.Is() )
aRef->DoClose();
else if ( pMedium )
@@ -620,3 +617,4 @@ String ScDocumentLoader::GetTitle() const
return EMPTY_STRING;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 396522fb0121..0c9dcef4606f 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,7 @@
// Dokumentinfo-Tabpage:
//========================================================================
-SfxTabPage* __EXPORT ScDocStatPage::Create( Window *pParent, const SfxItemSet& rSet )
+SfxTabPage* ScDocStatPage::Create( Window *pParent, const SfxItemSet& rSet )
{
return new ScDocStatPage( pParent, rSet );
}
@@ -79,23 +80,24 @@ ScDocStatPage::ScDocStatPage( Window *pParent, const SfxItemSet& rSet )
//------------------------------------------------------------------------
-__EXPORT ScDocStatPage::~ScDocStatPage()
+ScDocStatPage::~ScDocStatPage()
{
}
//------------------------------------------------------------------------
-sal_Bool __EXPORT ScDocStatPage::FillItemSet( SfxItemSet& /* rSet */ )
+sal_Bool ScDocStatPage::FillItemSet( SfxItemSet& /* rSet */ )
{
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
-void __EXPORT ScDocStatPage::Reset( const SfxItemSet& /* rSet */ )
+void ScDocStatPage::Reset( const SfxItemSet& /* rSet */ )
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/tpstat.src b/sc/source/ui/docshell/tpstat.src
index 7226da4642c3..3ee5b91a7b2e 100644
--- a/sc/source/ui/docshell/tpstat.src
+++ b/sc/source/ui/docshell/tpstat.src
@@ -77,36 +77,3 @@ TabPage RID_SCPAGE_STAT
Text [ en-US ] = "Document: " ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index 605611f2e309..4014d27dde64 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,11 +34,9 @@
//------------------------------------------------------------------
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
-//CHINA001 #include <svx/labdlg.hxx>
#include <svl/srchitem.hxx>
#include <svx/tabarea.hxx>
#include <svx/tabline.hxx>
-//CHINA001 #include <svx/transfrm.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
@@ -63,7 +62,6 @@ SFX_IMPL_INTERFACE(ScChartShell, ScDrawShell, ScResId(SCSTR_CHARTSHELL) )
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
ScResId(RID_DRAW_OBJECTBAR) );
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_CHART) );
- //SFX_OBJECTMENU_REGISTRATION( SID_OBJECTMENU0, ScResId(RID_OBJECTMENU_DRAW) );
}
TYPEINIT1( ScChartShell, ScDrawShell );
@@ -81,3 +79,4 @@ ScChartShell::~ScChartShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 6e621d1dec55..cd2ad601a465 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
-//#include <svx/labdlg.hxx> CHINA001
#include <svl/srchitem.hxx>
#include <svx/tabarea.hxx>
#include <svx/tabline.hxx>
-//CHINA001 #include <svx/transfrm.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/objsh.hxx>
@@ -57,7 +56,6 @@
#include "drawview.hxx"
#include "scresid.hxx"
#include <svx/svdobj.hxx>
-//add header of cui CHINA001
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <svx/drawitem.hxx>
@@ -115,7 +113,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
{
sal_uInt16 nSlot = rReq.GetSlot();
Window* pWin = pViewData->GetActiveWin();
-// SfxViewFrame* pViewFrame = SfxViewShell::Current()->GetViewFrame(); //!!! koennte knallen
ScDrawView* pView = pViewData->GetScDrawView();
SdrModel* pDoc = pViewData->GetDocument()->GetDrawLayer();
@@ -189,9 +186,9 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
}
if( pView->AreObjectsMarked() )
- pView->SetAttrToMarked( *rReq.GetArgs(), sal_False );
+ pView->SetAttrToMarked( *rReq.GetArgs(), false );
else
- pView->SetDefaultAttr( *rReq.GetArgs(), sal_False);
+ pView->SetDefaultAttr( *rReq.GetArgs(), false);
pView->InvalidateAttribs();
}
break;
@@ -208,7 +205,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
ExecuteTextAttrDlg( rReq );
break;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
case SID_DRAW_HLINK_EDIT:
if ( pSingleSelectedObj )
pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
@@ -236,7 +232,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() );
}
break;
-#endif
case SID_ATTR_TRANSFORM:
{
@@ -246,7 +241,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
if( !pArgs )
{
- // const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( rMarkList.GetMark(0) != 0 )
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -258,8 +252,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
// --------- Itemset fuer Groesse und Position --------
SfxItemSet aNewGeoAttr(pView->GetGeoAttrFromMarked());
- //SvxCaptionTabDialog* pDlg = new SvxCaptionTabDialog(pWin, pView);
- //change for cui CHINA001
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -279,17 +271,16 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
}
delete pDlg;
- }// change for cui
+ }
}
else
{
SfxItemSet aNewAttr(pView->GetGeoAttrFromMarked());
- //CHINA001 SvxTransformTabDialog* pDlg = new SvxTransformTabDialog(pWin, &aNewAttr, pView);
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
SfxAbstractTabDialog* pDlg = pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog creation failed!");
if (pDlg->Execute() == RET_OK)
{
rReq.Done(*(pDlg->GetOutputItemSet()));
@@ -343,7 +334,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
{
const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, sal_False, &pItem ))
+ if( SFX_ITEM_SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, false, &pItem ))
{
rtl::OUString sMacro;
SvxMacro* pMacro = ((SvxMacroItem*)pItem)->GetMacroTable().Get( SFX_EVENT_MOUSECLICK_OBJECT );
@@ -382,31 +373,25 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
SfxItemSet aNewAttr( pView->GetDefaultAttr() );
if( bHasMarked )
- pView->MergeAttrFromMarked( aNewAttr, sal_False );
-
-//CHINA001 SvxLineTabDialog* pDlg
-//CHINA001 = new SvxLineTabDialog( pViewData->GetDialogParent(),
-//CHINA001 &aNewAttr,
-//CHINA001 pViewData->GetDocument()->GetDrawLayer(),
-//CHINA001 pObj,
-//CHINA001 bHasMarked );
+ pView->MergeAttrFromMarked( aNewAttr, false );
+
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet Factory fail!");//CHINA001
+ DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(),
&aNewAttr,
pViewData->GetDocument()->GetDrawLayer(),
pObj,
bHasMarked);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialogdiet fail!");
if ( nTabPage != 0xffff )
pDlg->SetCurPageId( nTabPage );
if ( pDlg->Execute() == RET_OK )
{
if( bHasMarked )
- pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), sal_False );
+ pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false );
else
- pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), sal_False );
+ pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
pView->InvalidateAttribs();
rReq.Done();
@@ -422,21 +407,16 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
SfxItemSet aNewAttr( pView->GetDefaultAttr() );
if( bHasMarked )
- pView->MergeAttrFromMarked( aNewAttr, sal_False );
+ pView->MergeAttrFromMarked( aNewAttr, false );
- //CHINA001 SvxAreaTabDialog* pDlg
- //CHINA001 = new SvxAreaTabDialog( pViewData->GetDialogParent(),
-//CHINA001 &aNewAttr,
-//CHINA001 pViewData->GetDocument()->GetDrawLayer(),
-//CHINA001 pView );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet Factory fail!");//CHINA001
+ DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( pViewData->GetDialogParent(),
&aNewAttr,
pViewData->GetDocument()->GetDrawLayer(),
pView);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialogdiet fail!");
// #i74099# by default, the dialog deletes the current color table if a different one is loaded
// (see SwDrawShell::ExecDrawDlg)
@@ -451,9 +431,9 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
if ( pDlg->Execute() == RET_OK )
{
if( bHasMarked )
- pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), sal_False );
+ pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false );
else
- pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), sal_False );
+ pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
pView->InvalidateAttribs();
rReq.Done();
@@ -469,7 +449,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, sal_uInt16 /* nTabPage *
SfxItemSet aNewAttr ( pView->GetDefaultAttr() );
if( bHasMarked )
- pView->MergeAttrFromMarked( aNewAttr, sal_False );
+ pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView );
@@ -481,7 +461,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, sal_uInt16 /* nTabPage *
if ( bHasMarked )
pView->SetAttributes( *pDlg->GetOutputItemSet() );
else
- pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), sal_False );
+ pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
pView->InvalidateAttribs();
rReq.Done();
@@ -489,7 +469,6 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, sal_uInt16 /* nTabPage *
delete( pDlg );
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
{
if ( pObj )
@@ -499,5 +478,5 @@ void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk
lcl_setModified( GetObjectShell() );
}
}
-#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 4bd887225fd9..4e1539fc38ff 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,21 +113,21 @@ void ScDrawShell::GetState( SfxItemSet& rSet ) // Zustaende / Toggles
if ( !bDisableAnchor )
{
- switch( pView->GetAnchor() )
+ switch( pView->GetAnchorType() )
{
case SCA_PAGE:
rSet.Put( SfxBoolItem( SID_ANCHOR_PAGE, sal_True ) );
- rSet.Put( SfxBoolItem( SID_ANCHOR_CELL, sal_False ) );
+ rSet.Put( SfxBoolItem( SID_ANCHOR_CELL, false ) );
break;
case SCA_CELL:
- rSet.Put( SfxBoolItem( SID_ANCHOR_PAGE, sal_False ) );
+ rSet.Put( SfxBoolItem( SID_ANCHOR_PAGE, false ) );
rSet.Put( SfxBoolItem( SID_ANCHOR_CELL, sal_True ) );
break;
default:
- rSet.Put( SfxBoolItem( SID_ANCHOR_PAGE, sal_False ) );
- rSet.Put( SfxBoolItem( SID_ANCHOR_CELL, sal_False ) );
+ rSet.Put( SfxBoolItem( SID_ANCHOR_PAGE, false ) );
+ rSet.Put( SfxBoolItem( SID_ANCHOR_CELL, false ) );
break;
}
}
@@ -136,7 +137,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
{
ScDrawView* pView = pViewData->GetScDrawView();
- // #111711# call IsMirrorAllowed first to make sure ForcePossibilities (and thus CheckMarked)
+ // call IsMirrorAllowed first to make sure ForcePossibilities (and thus CheckMarked)
// is called before GetMarkCount, so the nMarkCount value is valid for the rest of this method.
if (!pView->IsMirrorAllowed(sal_True,sal_True))
{
@@ -176,7 +177,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
}
// do not change layer of form controls
- // #158385# #i83729# do not change layer of cell notes (on internal layer)
+ // #i83729# do not change layer of cell notes (on internal layer)
if ( !nMarkCount || pView->HasMarkedControl() || pView->HasMarkedInternal() )
{
rSet.DisableItem( SID_OBJECT_HEAVEN );
@@ -194,27 +195,23 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
}
}
- sal_Bool bCanRename = sal_False;
+ sal_Bool bCanRename = false;
if ( nMarkCount > 1 )
{
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
// no hypelink options for a selected group
rSet.DisableItem( SID_DRAW_HLINK_EDIT );
rSet.DisableItem( SID_DRAW_HLINK_DELETE );
rSet.DisableItem( SID_OPEN_HYPERLINK );
-#endif
}
else if ( nMarkCount == 1 )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( !pInfo || (pInfo->GetHlink().getLength() == 0) )
{
rSet.DisableItem( SID_DRAW_HLINK_DELETE );
rSet.DisableItem( SID_OPEN_HYPERLINK );
}
-#endif
SdrLayerID nLayerID = pObj->GetLayer();
if ( nLayerID != SC_LAYER_INTERN )
bCanRename = sal_True; // #i51351# anything except internal objects can be renamed
@@ -296,7 +293,7 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
if( bHasMarked )
{
- rSet.Put( pDrView->GetAttrFromMarked(sal_False) );
+ rSet.Put( pDrView->GetAttrFromMarked(false) );
// Wenn die View selektierte Objekte besitzt, muessen entspr. Items
// von SFX_ITEM_DEFAULT (_ON) auf SFX_ITEM_DISABLED geaendert werden
@@ -325,7 +322,7 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
// #i34458# The SvxSizeItem in SID_TABLE_CELL is no longer needed by
// SvxPosSizeStatusBarControl, it's enough to have it in SID_ATTR_SIZE.
- sal_Bool bActionItem = sal_False;
+ sal_Bool bActionItem = false;
if ( pDrView->IsAction() ) // action rectangle
{
Rectangle aRect;
@@ -365,7 +362,7 @@ void ScDrawShell::GetAttrFuncState(SfxItemSet &rSet)
// Dialoge fuer Draw-Attribute disablen, wenn noetig
ScDrawView* pDrView = pViewData->GetScDrawView();
- SfxItemSet aViewSet = pDrView->GetAttrFromMarked(sal_False);
+ SfxItemSet aViewSet = pDrView->GetAttrFromMarked(false);
if ( aViewSet.GetItemState( XATTR_LINESTYLE ) == SFX_ITEM_DEFAULT )
{
@@ -388,7 +385,7 @@ sal_Bool ScDrawShell::AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList
{
if(nLayerNo!=pObj->GetLayer())
{
- bResult=sal_False;
+ bResult=false;
break;
}
}
@@ -397,3 +394,4 @@ sal_Bool ScDrawShell::AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index 0b6e790ea9a4..75b1747dc3be 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,7 +69,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
!((SdrTextObj*) pObj)->HasText() )
{
if ( pDlg )
- pDlg->SetActive(sal_False);
+ pDlg->SetActive(false);
rSet.DisableItem(XATTR_FORMTXTSTYLE);
rSet.DisableItem(XATTR_FORMTXTADJUST);
@@ -102,7 +103,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
if ( pColorTable )
pDlg->SetColorTable( pColorTable );
else
- { DBG_ERROR( "ColorList not found :-/" ); }
+ { OSL_FAIL( "ColorList not found :-/" ); }
}
}
SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
@@ -113,3 +114,4 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 3130e39b79f1..ea0830b65d7e 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,9 +39,8 @@
#include <sfx2/request.hxx>
#include <sfx2/bindings.hxx>
#include <tools/urlobj.hxx>
-//CHINA001 #include <svx/dlgname.hxx>
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
#include <svx/fmglob.hxx>
#include <svx/hlnkitem.hxx>
#include <svx/fontwork.hxx>
@@ -66,7 +66,6 @@
#include "viewdata.hxx"
#include "tabvwsh.hxx"
#include "docsh.hxx"
-//CHINA001 #include "strindlg.hxx"
#include "scresid.hxx"
#include "undotab.hxx"
#include "drwlayer.hxx"
@@ -92,14 +91,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
if ( nMarkCount == 1 ) // URL-Button markiert ?
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
{
aHLinkItem.SetURL( pInfo->GetHlink() );
aHLinkItem.SetInsertMode(HLINK_FIELD);
}
-#endif
SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
@@ -111,10 +108,10 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
- rtl::OUString sPropButtonType = rtl::OUString::createFromAscii( "ButtonType" );
- rtl::OUString sPropTargetURL = rtl::OUString::createFromAscii( "TargetURL" );
- rtl::OUString sPropTargetFrame = rtl::OUString::createFromAscii( "TargetFrame" );
- rtl::OUString sPropLabel = rtl::OUString::createFromAscii( "Label" );
+ rtl::OUString sPropButtonType(RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ));
+ rtl::OUString sPropTargetURL(RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ));
+ rtl::OUString sPropTargetFrame(RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" ));
+ rtl::OUString sPropLabel(RTL_CONSTASCII_USTRINGPARAM( "Label" ));
if(xInfo->hasPropertyByName( sPropButtonType ))
{
@@ -178,7 +175,7 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
const String& rTarget = pHyper->GetTargetFrame();
SvxLinkInsertMode eMode = pHyper->GetInsertMode();
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if ( eMode == HLINK_FIELD || eMode == HLINK_BUTTON )
{
ScDrawView* pView = pViewData->GetScDrawView();
@@ -198,20 +195,16 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
- rtl::OUString sPropTargetURL =
- rtl::OUString::createFromAscii( "TargetURL" );
+ rtl::OUString sPropTargetURL(RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ));
// Darf man eine URL an dem Objekt setzen?
if (xInfo->hasPropertyByName( sPropTargetURL ))
{
// Ja!
- rtl::OUString sPropButtonType =
- rtl::OUString::createFromAscii( "ButtonType" );
- rtl::OUString sPropTargetFrame =
- rtl::OUString::createFromAscii( "TargetFrame" );
- rtl::OUString sPropLabel =
- rtl::OUString::createFromAscii( "Label" );
+ rtl::OUString sPropButtonType(RTL_CONSTASCII_USTRINGPARAM( "ButtonType") );
+ rtl::OUString sPropTargetFrame(RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" ));
+ rtl::OUString sPropLabel(RTL_CONSTASCII_USTRINGPARAM( "Label" ));
uno::Any aAny;
if ( xInfo->hasPropertyByName( sPropLabel ) )
@@ -242,13 +235,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
bDone = sal_True;
}
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else
{
SetHlinkForObject( pObj, rURL );
bDone = sal_True;
}
-#endif
}
}
@@ -261,7 +252,7 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
}
break;
default:
- DBG_ERROR("falscher Slot");
+ OSL_FAIL("falscher Slot");
}
}
@@ -300,7 +291,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
rBindings.Invalidate(SID_OBJECT_HELL);
// leave draw shell if nothing selected (layer may be locked)
if ( pView->GetMarkedObjectList().GetMarkCount() == 0 )
- pViewData->GetViewShell()->SetDrawShell( sal_False );
+ pViewData->GetViewShell()->SetDrawShell( false );
break;
case SID_FRAME_TO_TOP:
@@ -371,13 +362,13 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
case SID_DELETE_CONTENTS:
pView->DeleteMarked();
if (!pTabView->IsDrawSelMode())
- pViewData->GetViewShell()->SetDrawShell( sal_False );
+ pViewData->GetViewShell()->SetDrawShell( false );
break;
case SID_CUT:
pView->DoCut();
if (!pTabView->IsDrawSelMode())
- pViewData->GetViewShell()->SetDrawShell( sal_False );
+ pViewData->GetViewShell()->SetDrawShell( false );
break;
case SID_COPY:
@@ -385,8 +376,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
break;
case SID_PASTE:
- DBG_ERROR( "SdrView::PasteClipboard not supported anymore" );
- // pView->PasteClipboard( pWin );
+ OSL_FAIL( "SdrView::PasteClipboard not supported anymore" );
break;
case SID_SELECTALL:
@@ -394,26 +384,26 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
break;
case SID_ANCHOR_PAGE:
- pView->SetAnchor( SCA_PAGE );
+ pView->SetPageAnchored();
rBindings.Invalidate( SID_ANCHOR_PAGE );
rBindings.Invalidate( SID_ANCHOR_CELL );
break;
case SID_ANCHOR_CELL:
- pView->SetAnchor( SCA_CELL );
+ pView->SetCellAnchored();
rBindings.Invalidate( SID_ANCHOR_PAGE );
rBindings.Invalidate( SID_ANCHOR_CELL );
break;
case SID_ANCHOR_TOGGLE:
{
- switch( pView->GetAnchor() )
+ switch( pView->GetAnchorType() )
{
case SCA_CELL:
- pView->SetAnchor( SCA_PAGE );
+ pView->SetPageAnchored();
break;
default:
- pView->SetAnchor( SCA_CELL );
+ pView->SetCellAnchored();
break;
}
}
@@ -493,7 +483,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
case SID_ENABLE_HYPHENATION:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION, false);
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
@@ -723,7 +713,7 @@ void ScDrawShell::ExecFormatPaintbrush( SfxRequest& rReq )
}
else
{
- sal_Bool bLock = sal_False;
+ sal_Bool bLock = false;
const SfxItemSet *pArgs = rReq.GetArgs();
if( pArgs && pArgs->Count() >= 1 )
bLock = static_cast<const SfxBoolItem&>(pArgs->Get(SID_FORMATPAINTBRUSH)).GetValue();
@@ -758,3 +748,4 @@ ScDrawView* ScDrawShell::GetDrawView()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx
index 44b88738430a..e9a986cac5f9 100644
--- a/sc/source/ui/drawfunc/drformsh.cxx
+++ b/sc/source/ui/drawfunc/drformsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,11 +35,9 @@
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
-//CHINA001 #include <svx/labdlg.hxx>
#include <svl/srchitem.hxx>
#include <svx/tabarea.hxx>
#include <svx/tabline.hxx>
-//CHINA001 #include <svx/transfrm.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
@@ -81,3 +80,4 @@ ScDrawFormShell::~ScDrawFormShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drformsh.src b/sc/source/ui/drawfunc/drformsh.src
index 3fc8699c9dbf..638d9a5676ad 100644
--- a/sc/source/ui/drawfunc/drformsh.src
+++ b/sc/source/ui/drawfunc/drformsh.src
@@ -77,15 +77,13 @@
MenuItem\
{\
Identifier = SID_FRAME_UP ; \
- HelpId = CMD_SID_FRAME_UP ; \
- /* ### ACHTUNG: Neuer Text in Resource? W~eiter nach vorn : Weiter nach vorn */\
+ HelpId = SID_FRAME_UP ; \
Text [ en-US ] = "Bring ~Forward" ; \
};\
MenuItem\
{\
Identifier = SID_FRAME_DOWN ; \
- HelpId = CMD_SID_FRAME_DOWN ; \
- /* ### ACHTUNG: Neuer Text in Resource? Weiter ~nach hinten : Weiter nach hinten */\
+ HelpId = SID_FRAME_DOWN ; \
Text [ en-US ] = "Send Back~ward" ; \
};\
MenuItem\
@@ -180,7 +178,6 @@
//
String RID_POPUP_DRAWFORM
{
- /* ### ACHTUNG: Neuer Text in Resource? Popup-Men fr Zeichenobjekte : Popup-Men fr Zeichenobjekte */
Text [ en-US ] = "Popup menu for form objects";
};
//
@@ -216,35 +213,3 @@ Menu RID_POPUP_DRAWFORM
ITEM_GROUP_MENU
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index e804053b8c47..9237d0e1f66a 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -122,7 +123,7 @@ ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) :
SfxShell(pData->GetViewShell()),
pViewData(pData),
pClipEvtLstnr(NULL),
- bPastePossible(sal_False)
+ bPastePossible(false)
{
SetPool( pViewData->GetScDrawView()->GetDefaultAttr().GetPool() );
@@ -138,13 +139,13 @@ ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) :
SetName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("DrawText")));
}
-__EXPORT ScDrawTextObjectBar::~ScDrawTextObjectBar()
+ScDrawTextObjectBar::~ScDrawTextObjectBar()
{
if ( pClipEvtLstnr )
{
- pClipEvtLstnr->AddRemoveListener( pViewData->GetActiveWin(), sal_False );
+ pClipEvtLstnr->AddRemoveListener( pViewData->GetActiveWin(), false );
- // #122057# The listener may just now be waiting for the SolarMutex and call the link
+ // The listener may just now be waiting for the SolarMutex and call the link
// afterwards, in spite of RemoveListener. So the link has to be reset, too.
pClipEvtLstnr->ClearCallbackLink();
@@ -158,7 +159,7 @@ __EXPORT ScDrawTextObjectBar::~ScDrawTextObjectBar()
//
//========================================================================
-void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
+void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
{
ScDrawView* pView = pViewData->GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
@@ -230,13 +231,13 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
if( pArgs )
- pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), sal_False, &pItem);
+ pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem);
if ( pItem )
{
aString = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
- pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
+ pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
if ( pFontItem )
{
@@ -277,7 +278,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const String& rTarget = pHyper->GetTargetFrame();
SvxLinkInsertMode eMode = pHyper->GetInsertMode();
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if ( pOutView && ( eMode == HLINK_DEFAULT || eMode == HLINK_FIELD ) )
{
const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
@@ -346,37 +347,16 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_ENABLE_HYPHENATION:
case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
-#if 0 // DR
- if (IsNoteEdit())
- {
- pView->CaptionTextDirection( rReq.GetSlot()); // process Notes before we end the text edit.
- ExecuteGlobal( rReq );
- pViewData->GetDispatcher().Execute(pViewData->GetView()->GetDrawFuncPtr()->GetSlotID(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
- }
- else
-#endif
- {
- pView->ScEndTextEdit(); // end text edit before switching direction
- ExecuteGlobal( rReq );
- // restore consistent state between shells and functions:
- pViewData->GetDispatcher().Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
- }
- break;
-
-#if 0
- // Hyphenation is handled above - text edit is ended
- case SID_ENABLE_HYPHENATION:
- // force loading of hyphenator (object is skipped in repaint)
- ((ScDrawLayer*)pView->GetModel())->UseHyphenator();
- pOutliner->SetHyphenator( LinguMgr::GetHyphenator() );
+ pView->ScEndTextEdit(); // end text edit before switching direction
ExecuteGlobal( rReq );
+ // restore consistent state between shells and functions:
+ pViewData->GetDispatcher().Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
break;
-#endif
case SID_THES:
{
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, false );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -393,11 +373,11 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
}
}
-void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
+void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
{
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
sal_Bool bHasFontWork = pViewFrm->HasChildWindow(SID_FONTWORK);
- sal_Bool bDisableFontWork = sal_False;
+ sal_Bool bDisableFontWork = false;
if (IsNoteEdit())
{
@@ -417,7 +397,7 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if ( pOutView )
{
- sal_Bool bField = sal_False;
+ sal_Bool bField = false;
const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
if (pFieldItem)
{
@@ -521,7 +501,7 @@ IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pData
return 0;
}
-void __EXPORT ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
+void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
{
SdrView* pView = pViewData->GetScDrawView();
if ( !pView->GetTextEditOutlinerView() )
@@ -582,7 +562,7 @@ void __EXPORT ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
//
//========================================================================
-void __EXPORT ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq )
+void ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq )
{
// Unterstreichung
@@ -636,7 +616,7 @@ void lcl_RemoveFields( OutlinerView& rOutView )
xub_StrLen nNewEnd = aSel.nEndPos;
sal_Bool bUpdate = pOutliner->GetUpdateMode();
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
//! GetPortions and GetAttribs should be const!
EditEngine& rEditEng = (EditEngine&)pOutliner->GetEditEngine();
@@ -666,7 +646,7 @@ void lcl_RemoveFields( OutlinerView& rOutView )
if (!bChanged)
{
if (bUpdate)
- pOutliner->SetUpdateMode( sal_False );
+ pOutliner->SetUpdateMode( false );
String aName = ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
pOutliner->GetUndoManager().EnterListAction( aName, aName );
bChanged = sal_True;
@@ -697,7 +677,7 @@ void lcl_RemoveFields( OutlinerView& rOutView )
rOutView.SetSelection( aOldSel );
}
-void __EXPORT ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
+void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
{
SdrView* pView = pViewData->GetScDrawView();
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -731,7 +711,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
rReq.Done( aEmptyAttr );
pViewData->GetScDrawView()->InvalidateDrawTextAttrs();
- bDone = sal_False; // bereits hier passiert
+ bDone = false; // bereits hier passiert
}
break;
@@ -896,7 +876,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
}
}
-void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
+void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
{
if ( IsNoteEdit() )
{
@@ -1028,7 +1008,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
if( pOutl )
{
if( pOutl->IsVertical() )
- bLeftToRight = sal_False;
+ bLeftToRight = false;
}
else
bLeftToRight = ( (const SvxWritingModeItem&) aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB;
@@ -1093,3 +1073,4 @@ void ScDrawTextObjectBar::ExecuteTrans( SfxRequest& rReq )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index 31a9049aeadb..7dfafc870102 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,25 +51,20 @@
#include "drtxtob.hxx"
#include "drawview.hxx"
#include "viewdata.hxx"
-//CHINA001 #include "textdlgs.hxx"
#include "scresid.hxx"
-#include "scabstdlg.hxx" //CHINA00
+#include "scabstdlg.hxx"
//------------------------------------------------------------------------
sal_Bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs,
SfxItemSet& rOutSet )
{
-//CHINA001 ScCharDlg* pDlg = new ScCharDlg( pViewData->GetDialogParent(),
-//CHINA001 &rArgs,
-//CHINA001 pViewData->GetSfxDocShell() );
-//CHINA001
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( pViewData->GetDialogParent(), &rArgs,
pViewData->GetSfxDocShell(),RID_SCDLG_CHAR );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
sal_Bool bRet = ( pDlg->Execute() == RET_OK );
if ( bRet )
@@ -100,20 +96,17 @@ sal_Bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
// Muss natuerlich noch geaendert werden
// aNewAttr.Put( SvxParaDlgLimitsItem( 567 * 50, 5670) );
- aNewAttr.Put( SvxHyphenZoneItem( sal_False, SID_ATTR_PARA_HYPHENZONE ) );
+ aNewAttr.Put( SvxHyphenZoneItem( false, SID_ATTR_PARA_HYPHENZONE ) );
aNewAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, SID_ATTR_PARA_PAGEBREAK ) );
aNewAttr.Put( SvxFmtSplitItem( sal_True, SID_ATTR_PARA_SPLIT) );
aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
-//CHINA001 ScParagraphDlg* pDlg = new ScParagraphDlg( pViewData->GetDialogParent(),
-//CHINA001 &aNewAttr );
-//CHINA001
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateScParagraphDlg( pViewData->GetDialogParent(), &aNewAttr, RID_SCDLG_PARAGRAPH);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
sal_Bool bRet = ( pDlg->Execute() == RET_OK );
if ( bRet )
@@ -154,3 +147,4 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 137ddfa654d2..d85ac90fa677 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,7 +70,7 @@ sal_Bool ScDrawTextObjectBar::IsNoteEdit()
// wenn kein Text editiert wird, Funktionen wie in drawsh
-void __EXPORT ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
+void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
{
ScTabView* pTabView = pViewData->GetView();
ScDrawView* pView = pTabView->GetScDrawView();
@@ -84,7 +85,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_CUT:
pView->DoCut();
if (!pTabView->IsDrawSelMode())
- pViewData->GetViewShell()->SetDrawShell( sal_False );
+ pViewData->GetViewShell()->SetDrawShell( false );
break;
case SID_PASTE:
@@ -118,7 +119,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_ENABLE_HYPHENATION:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION, false);
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
@@ -147,7 +148,7 @@ void ScDrawTextObjectBar::GetGlobalClipState( SfxItemSet& rSet )
}
}
-void __EXPORT ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
+void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
{
ScTabView* pTabView = pViewData->GetView();
ScDrawView* pView = pTabView->GetScDrawView();
@@ -251,7 +252,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
!((SdrTextObj*) pObj)->HasText() )
{
if ( pDlg )
- pDlg->SetActive(sal_False);
+ pDlg->SetActive(false);
rSet.DisableItem(XATTR_FORMTXTSTYLE);
rSet.DisableItem(XATTR_FORMTXTADJUST);
@@ -285,7 +286,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
if ( pColorTable )
pDlg->SetColorTable( pColorTable );
else
- { DBG_ERROR( "ColorList not found :-/" ); }
+ { OSL_FAIL( "ColorList not found :-/" ); }
}
}
SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
@@ -297,3 +298,4 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx
index 5e40fcea171d..9906919f0f3f 100644
--- a/sc/source/ui/drawfunc/fuconarc.cxx
+++ b/sc/source/ui/drawfunc/fuconarc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include "tabvwsh.hxx"
#include "drawview.hxx"
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
#include <svx/svdocirc.hxx>
#include <svx/sxciaitm.hxx>
@@ -65,9 +66,9 @@ FuConstArc::~FuConstArc()
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstArc::MouseButtonDown( const MouseEvent& rMEvt )
+sal_Bool FuConstArc::MouseButtonDown( const MouseEvent& rMEvt )
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = FuConstruct::MouseButtonDown( rMEvt );
@@ -88,7 +89,7 @@ sal_Bool __EXPORT FuConstArc::MouseButtonDown( const MouseEvent& rMEvt )
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstArc::MouseMove( const MouseEvent& rMEvt )
+sal_Bool FuConstArc::MouseMove( const MouseEvent& rMEvt )
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -99,27 +100,18 @@ sal_Bool __EXPORT FuConstArc::MouseMove( const MouseEvent& rMEvt )
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstArc::MouseButtonUp( const MouseEvent& rMEvt )
+sal_Bool FuConstArc::MouseButtonUp( const MouseEvent& rMEvt )
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
{
- // Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
pView->EndCreateObj( SDRCREATE_NEXTPOINT );
bReturn = sal_True;
}
-/*
- else if ( pView->IsCreateObj() && rMEvt.IsRight() )
- {
- // Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
- pView->EndCreateObj( SDRCREATE_FORCEEND );
- bReturn = sal_True;
- }
-*/
return (FuConstruct::MouseButtonUp(rMEvt) || bReturn);
}
@@ -132,7 +124,7 @@ sal_Bool __EXPORT FuConstArc::MouseButtonUp( const MouseEvent& rMEvt )
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstArc::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuConstArc::KeyInput(const KeyEvent& rKEvt)
{
sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
@@ -191,7 +183,7 @@ void FuConstArc::Deactivate()
pViewShell->SetActivePointer( aOldPointer );
}
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
{
// case SID_DRAW_ARC:
@@ -224,7 +216,7 @@ SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle
}
else
{
- DBG_ERROR("Object is NO circle object");
+ OSL_FAIL("Object is NO circle object");
}
}
@@ -232,3 +224,4 @@ SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index be8dd2bf2188..c2704f8c32c6 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,9 +76,9 @@ FuConstCustomShape::~FuConstCustomShape()
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
@@ -91,13 +92,9 @@ sal_Bool __EXPORT FuConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
if ( pObj )
{
SetAttributes( pObj );
- sal_Bool bForceFillStyle = sal_True;
- sal_Bool bForceNoFillStyle = sal_False;
+ sal_Bool bForceNoFillStyle = false;
if ( ((SdrObjCustomShape*)pObj)->UseNoFillStyle() )
- {
- bForceFillStyle = sal_False;
bForceNoFillStyle = sal_True;
- }
if ( bForceNoFillStyle )
pObj->SetMergedItem( XFillStyleItem( XFILL_NONE ) );
}
@@ -113,7 +110,7 @@ sal_Bool __EXPORT FuConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstCustomShape::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuConstCustomShape::MouseMove(const MouseEvent& rMEvt)
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -124,12 +121,12 @@ sal_Bool __EXPORT FuConstCustomShape::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuConstCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
{
@@ -149,7 +146,7 @@ sal_Bool __EXPORT FuConstCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstCustomShape::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuConstCustomShape::KeyInput(const KeyEvent& rKEvt)
{
sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
@@ -193,7 +190,7 @@ void FuConstCustomShape::Deactivate()
pViewShell->SetActivePointer( aOldPointer );
}
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, const Rectangle& rRectangle)
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
@@ -218,7 +215,7 @@ SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, c
void FuConstCustomShape::SetAttributes( SdrObject* pObj )
{
- sal_Bool bAttributesAppliedFromGallery = sal_False;
+ sal_Bool bAttributesAppliedFromGallery = false;
if ( GalleryExplorer::GetSdrObjCount( GALLERY_THEME_POWERPOINT ) )
{
@@ -274,7 +271,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER, 0 ) );
pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
- pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ pObj->SetMergedItem( SdrTextAutoGrowHeightItem( false ) );
((SdrObjCustomShape*)pObj)->MergeDefaultAttributes( &aCustomShape );
}
}
@@ -286,3 +283,5 @@ bool FuConstCustomShape::doConstructOrthogonal() const
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index 58075d5fc1ce..46bacf8ef245 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include "sc.hrc"
#include "drawview.hxx"
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
#include <svx/svdopath.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/point/b2dpoint.hxx>
@@ -73,9 +74,9 @@ FuConstPolygon::~FuConstPolygon()
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstPolygon::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuConstPolygon::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
@@ -86,7 +87,7 @@ sal_Bool __EXPORT FuConstPolygon::MouseButtonDown(const MouseEvent& rMEvt)
{
// Texteingabe hier nicht zulassen
aVEvt.eEvent = SDREVENT_BEGDRAGOBJ;
- pView->EnableExtendedMouseEventDispatcher(sal_False);
+ pView->EnableExtendedMouseEventDispatcher(false);
}
else
{
@@ -105,7 +106,7 @@ sal_Bool __EXPORT FuConstPolygon::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstPolygon::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuConstPolygon::MouseMove(const MouseEvent& rMEvt)
{
pView->MouseMove(rMEvt, pWindow);
sal_Bool bReturn = FuConstruct::MouseMove(rMEvt);
@@ -118,13 +119,13 @@ sal_Bool __EXPORT FuConstPolygon::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- sal_Bool bReturn = sal_False;
- sal_Bool bSimple = sal_False;
+ sal_Bool bReturn = false;
+ sal_Bool bSimple = false;
SdrViewEvent aVEvt;
(void)pView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt);
@@ -155,7 +156,7 @@ sal_Bool __EXPORT FuConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstPolygon::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuConstPolygon::KeyInput(const KeyEvent& rKEvt)
{
sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
@@ -242,14 +243,14 @@ void FuConstPolygon::Deactivate()
{
pView->SetEditMode(SDREDITMODE_EDIT);
- pView->EnableExtendedMouseEventDispatcher(sal_False);
+ pView->EnableExtendedMouseEventDispatcher(false);
FuConstruct::Deactivate();
pViewShell->SetActivePointer( aOldPointer );
}
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
{
// case SID_DRAW_POLYGON:
@@ -343,7 +344,7 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
}
else
{
- DBG_ERROR("Object is NO path object");
+ OSL_FAIL("Object is NO path object");
}
pObj->SetLogicRect(rRectangle);
@@ -353,3 +354,5 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 19106e891389..d6f623ad8367 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include "drawview.hxx"
#include <editeng/outlobj.hxx>
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
#include <svx/svdopath.hxx>
#include <svx/svdocapt.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -73,9 +74,9 @@ FuConstRectangle::~FuConstRectangle()
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
@@ -106,7 +107,7 @@ sal_Bool __EXPORT FuConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstRectangle::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuConstRectangle::MouseMove(const MouseEvent& rMEvt)
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -117,12 +118,12 @@ sal_Bool __EXPORT FuConstRectangle::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
{
@@ -160,7 +161,7 @@ sal_Bool __EXPORT FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstRectangle::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuConstRectangle::KeyInput(const KeyEvent& rKEvt)
{
sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
@@ -225,15 +226,9 @@ void FuConstRectangle::Deactivate()
pViewShell->SetActivePointer( aOldPointer );
}
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
{
- // case SID_DRAW_LINE:
- // case SID_DRAW_RECT:
- // case SID_DRAW_ELLIPSE:
- // case SID_DRAW_CAPTION:
- // case SID_DRAW_CAPTION_VERTICAL:
-
SdrObject* pObj = SdrObjFactory::MakeNewObject(
pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
0L, pDrDoc);
@@ -258,7 +253,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
}
else
{
- DBG_ERROR("Object is NO line object");
+ OSL_FAIL("Object is NO line object");
}
break;
@@ -280,7 +275,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
pObj->SetMergedItemSet(aSet);
}
- // #105815# don't set default text, start edit mode instead
+ // don't set default text, start edit mode instead
// (Edit mode is started in ScTabViewShell::ExecDraw, because
// it must be handled by FuText)
// String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
@@ -292,7 +287,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
}
else
{
- DBG_ERROR("Object is NO caption object");
+ OSL_FAIL("Object is NO caption object");
}
break;
@@ -313,3 +308,4 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
return pObj;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 25a6e556e43e..f4db6ebfb742 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,9 +83,9 @@ sal_uInt8 FuConstruct::Command(const CommandEvent& rCEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
@@ -118,7 +119,7 @@ sal_Bool __EXPORT FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
}
}
- bIsInDragMode = sal_False;
+ bIsInDragMode = false;
return bReturn;
}
@@ -129,7 +130,7 @@ sal_Bool __EXPORT FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstruct::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuConstruct::MouseMove(const MouseEvent& rMEvt)
{
FuDraw::MouseMove(rMEvt);
@@ -176,9 +177,9 @@ sal_Bool __EXPORT FuConstruct::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = SimpleMouseButtonUp( rMEvt );
@@ -196,7 +197,7 @@ sal_Bool __EXPORT FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
SdrMark* pMark = rMarkList.GetMark(0);
SdrObject* pObj = pMark->GetMarkedSdrObj();
- // #49458# bei Uno-Controls nicht in Textmodus
+ // bei Uno-Controls nicht in Textmodus
if ( pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) )
{
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
@@ -244,7 +245,7 @@ sal_Bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt)
else if ( pView->IsMarkObj() )
pView->EndMarkObj();
- else bReturn = sal_False;
+ else bReturn = false;
if ( !pView->IsAction() )
{
@@ -252,7 +253,7 @@ sal_Bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt)
if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 )
{
- pView->MarkObj(aPnt, -2, sal_False, rMEvt.IsMod1());
+ pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
if ( pView->AreObjectsMarked() )
@@ -274,9 +275,9 @@ sal_Bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstruct::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuConstruct::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
switch ( rKEvt.GetKeyCode().GetCode() )
{
@@ -333,3 +334,4 @@ void FuConstruct::Deactivate()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx
index 4f499f519298..3bd7175a5bdd 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,8 +44,8 @@ FuConstUnoControl::FuConstUnoControl(ScTabViewShell* pViewSh, Window* pWin, ScDr
SdrModel* pDoc, SfxRequest& rReq)
: FuConstruct(pViewSh, pWin, pViewP, pDoc, rReq)
{
- SFX_REQUEST_ARG( rReq, pInventorItem, SfxUInt32Item, SID_FM_CONTROL_INVENTOR, sal_False );
- SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER, sal_False );
+ SFX_REQUEST_ARG( rReq, pInventorItem, SfxUInt32Item, SID_FM_CONTROL_INVENTOR, false );
+ SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER, false );
if( pInventorItem )
nInventor = pInventorItem->GetValue();
if( pIdentifierItem )
@@ -67,9 +68,9 @@ FuConstUnoControl::~FuConstUnoControl()
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstUnoControl::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuConstUnoControl::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
@@ -90,7 +91,7 @@ sal_Bool __EXPORT FuConstUnoControl::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstUnoControl::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuConstUnoControl::MouseMove(const MouseEvent& rMEvt)
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -101,12 +102,12 @@ sal_Bool __EXPORT FuConstUnoControl::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuConstUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
{
@@ -126,7 +127,7 @@ sal_Bool __EXPORT FuConstUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuConstUnoControl::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuConstUnoControl::KeyInput(const KeyEvent& rKEvt)
{
sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
@@ -170,7 +171,7 @@ void FuConstUnoControl::Deactivate()
pViewShell->SetActivePointer( aOldPointer );
}
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, const Rectangle& rRectangle)
{
// case SID_FM_CREATE_CONTROL:
@@ -188,3 +189,4 @@ SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, co
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 219d3ab4a4af..df8725cbded0 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,17 +92,10 @@ void FuDraw::DoModifiers(const MouseEvent& rMEvt)
// Alt = zentrisch
sal_Bool bShift = rMEvt.IsShift();
-// sal_Bool bCtrl = rMEvt.IsMod1();
sal_Bool bAlt = rMEvt.IsMod2();
-// ScViewData* pViewData = pViewShell->GetViewData();
-// const ScViewOptions& rOpt = pViewData->GetOptions();
-// const ScGridOptions& rGrid = rOpt.GetGridOptions();
-// sal_Bool bGridOpt = rGrid.GetUseGridSnap();
-
- sal_Bool bOrtho = bShift;
+ bool bOrtho = bShift;
sal_Bool bAngleSnap = bShift;
-// sal_Bool bGridSnap = ( bGridOpt != bCtrl ); // andere Snap's nicht unterstuetzt
sal_Bool bCenter = bAlt;
// #i33136#
@@ -115,13 +109,6 @@ void FuDraw::DoModifiers(const MouseEvent& rMEvt)
if (pView->IsAngleSnapEnabled() != bAngleSnap)
pView->SetAngleSnapEnabled(bAngleSnap);
-/* Control fuer Snap beisst sich beim Verschieben mit "kopieren" !!!
-
- if (pView->IsGridSnap() != bGridSnap)
- pView->SetGridSnap(bGridSnap);
- if (pView->IsSnapEnabled() != bGridSnap)
- pView->SetSnapEnabled(bGridSnap);
-*/
if (pView->IsCreate1stPointAsCenter() != bCenter)
pView->SetCreate1stPointAsCenter(bCenter);
if (pView->IsResizeAtCenter() != bCenter)
@@ -137,9 +124,9 @@ void FuDraw::ResetModifiers()
sal_Bool bGridOpt = rGrid.GetUseGridSnap();
if (pView->IsOrtho())
- pView->SetOrtho(sal_False);
+ pView->SetOrtho(false);
if (pView->IsAngleSnapEnabled())
- pView->SetAngleSnapEnabled(sal_False);
+ pView->SetAngleSnapEnabled(false);
if (pView->IsGridSnap() != bGridOpt)
pView->SetGridSnap(bGridOpt);
@@ -147,9 +134,9 @@ void FuDraw::ResetModifiers()
pView->SetSnapEnabled(bGridOpt);
if (pView->IsCreate1stPointAsCenter())
- pView->SetCreate1stPointAsCenter(sal_False);
+ pView->SetCreate1stPointAsCenter(false);
if (pView->IsResizeAtCenter())
- pView->SetResizeAtCenter(sal_False);
+ pView->SetResizeAtCenter(false);
}
/*************************************************************************
@@ -158,13 +145,13 @@ void FuDraw::ResetModifiers()
|*
\************************************************************************/
-sal_Bool __EXPORT FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
DoModifiers( rMEvt );
- return sal_False;
+ return false;
}
/*************************************************************************
@@ -173,14 +160,14 @@ sal_Bool __EXPORT FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuDraw::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
{
- // #106438# evaluate modifiers only if in a drawing layer action
+ // evaluate modifiers only if in a drawing layer action
// (don't interfere with keyboard shortcut handling)
if (pView->IsAction())
DoModifiers( rMEvt );
- return sal_False;
+ return false;
}
/*************************************************************************
@@ -189,13 +176,13 @@ sal_Bool __EXPORT FuDraw::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
ResetModifiers();
- return sal_False;
+ return false;
}
/*************************************************************************
@@ -209,7 +196,7 @@ sal_Bool __EXPORT FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const KeyEvent* pInitialKey )
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if ( pObj && pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) )
{
// start text edit - like FuSelection::MouseButtonUp,
@@ -240,33 +227,14 @@ sal_Bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const Key
return bReturn;
}
-sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
ScViewData& rViewData = *pViewShell->GetViewData();
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_ESCAPE:
-
- /* 18.12.95: TextShell beibehalten nicht mehr gewuenscht...
- *
- * if ( pView->IsAction() )
- * {
- * pView->BrkAction();
- * pWindow->ReleaseMouse();
- * bReturn = sal_True;
- * }
- * else if ( pView->IsTextEdit() )
- * {
- * pView->EndTextEdit();
- * pView->SetCreateMode();
- * pViewShell->GetScDrawView()->InvalidateDrawTextAttrs();
- * bReturn = sal_True;
- * }
- * else
- */
-
if ( pViewShell->IsDrawTextShell() || aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT )
{
// in normale Draw-Shell, wenn Objekt selektiert, sonst Zeichnen aus
@@ -281,7 +249,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
}
else if ( pView->AreObjectsMarked() )
{
- // #97016# III
+ // III
SdrHdlList& rHdlList = const_cast< SdrHdlList& >( pView->GetHdlList() );
if( rHdlList.GetFocusHdl() )
rHdlList.ResetFocusHdl();
@@ -290,7 +258,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
// Beim Bezier-Editieren ist jetzt wieder das Objekt selektiert
if (!pView->AreObjectsMarked())
- pViewShell->SetDrawShell( sal_False );
+ pViewShell->SetDrawShell( false );
bReturn = sal_True;
}
@@ -305,8 +273,8 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
if( rKEvt.GetKeyCode().GetModifier() == 0 )
{
- // #98256# activate OLE object on RETURN for selected object
- // #98198# put selected text object in edit mode
+ // activate OLE object on RETURN for selected object
+ // put selected text object in edit mode
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
{
@@ -314,7 +282,6 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
if( pObj && pObj->ISA( SdrOle2Obj ) && !bOle )
{
- //HMHpView->HideMarkHdl();
pViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
// consumed
@@ -331,7 +298,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
if( rKEvt.GetKeyCode().GetModifier() == 0 )
{
- // #98198# put selected text object in edit mode
+ // put selected text object in edit mode
// (this is not SID_SETINPUTMODE, but F2 hardcoded, like in Writer)
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
@@ -358,23 +325,23 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
// changeover to the next object
if(!pView->MarkNextObj( !aCode.IsShift() ))
{
- // #97016# No next object: go over open end and
+ // No next object: go over open end and
// get first from the other side
pView->UnmarkAllObj();
pView->MarkNextObj(!aCode.IsShift());
}
- // #97016# II
+ // II
if(pView->AreObjectsMarked())
pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
bReturn = sal_True;
}
- // #98994# handle Mod1 and Mod2 to get travelling running on different systems
+ // handle Mod1 and Mod2 to get travelling running on different systems
if(rKEvt.GetKeyCode().IsMod1() || rKEvt.GetKeyCode().IsMod2())
{
- // #97016# II do something with a selected handle?
+ // II do something with a selected handle?
const SdrHdlList& rHdlList = pView->GetHdlList();
sal_Bool bForward(!rKEvt.GetKeyCode().IsShift());
@@ -408,11 +375,11 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
if ( aCode.IsMod1() )
{
- // #97016# mark last object
+ // mark last object
pView->UnmarkAllObj();
- pView->MarkNextObj(sal_False);
+ pView->MarkNextObj(false);
- // #97016# II
+ // II
if(pView->AreObjectsMarked())
pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
@@ -433,11 +400,11 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
if ( aCode.IsMod1() )
{
- // #97016# mark first object
+ // mark first object
pView->UnmarkAllObj();
pView->MarkNextObj(sal_True);
- // #97016# II
+ // II
if(pView->AreObjectsMarked())
pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
@@ -503,7 +470,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
if(rKEvt.GetKeyCode().IsMod2())
{
- // #97016# move in 1 pixel distance
+ // move in 1 pixel distance
Size aLogicSizeOnePixel = (pWindow) ? pWindow->PixelToLogic(Size(1,1)) : Size(100, 100);
nX *= aLogicSizeOnePixel.Width();
nY *= aLogicSizeOnePixel.Height();
@@ -518,16 +485,16 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
// is there a movement to do?
if(0 != nX || 0 != nY)
{
- // #97016# II
+ // II
const SdrHdlList& rHdlList = pView->GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
if(0L == pHdl)
{
- // #107086# only take action when move is allowed
+ // only take action when move is allowed
if(pView->IsMoveAllowed())
{
- // #90129# restrict movement to WorkArea
+ // restrict movement to WorkArea
const Rectangle& rWorkArea = pView->GetWorkArea();
if(!rWorkArea.IsEmpty())
@@ -562,7 +529,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
// now move the selected draw objects
pView->MoveAllMarked(Size(nX, nY));
- // #97016# II
+ // II
pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
bReturn = sal_True;
@@ -583,14 +550,14 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
if(pView->IsDragObj())
{
- FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
+ bool bWasNoSnap = rDragStat.IsNoSnap();
sal_Bool bWasSnapEnabled = pView->IsSnapEnabled();
// switch snapping off
if(!bWasNoSnap)
((SdrDragStat&)rDragStat).SetNoSnap(sal_True);
if(bWasSnapEnabled)
- pView->SetSnapEnabled(sal_False);
+ pView->SetSnapEnabled(false);
pView->MovAction(aEndPoint);
pView->EndDragObj();
@@ -688,7 +655,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
if (!bReturn)
{
- // #98198# allow direct typing into a selected text object
+ // allow direct typing into a selected text object
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() && EditEngine::IsSimpleCharInput(rKEvt) )
@@ -704,7 +671,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
return (bReturn);
}
-// #97016# II
+// II
void FuDraw::SelectionHasChanged()
{
const SdrHdlList& rHdlList = pView->GetHdlList();
@@ -777,7 +744,7 @@ sal_Bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, Window* pWindow )
return sal_True;
}
- return sal_False;
+ return false;
}
void FuDraw::ForcePointer(const MouseEvent* pMEvt)
@@ -828,11 +795,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ????
pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) )
-#else
- else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) )
-#endif
pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
else if ( IsDetectiveHit( aPnt ) )
pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
@@ -843,7 +806,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
sal_Bool FuDraw::IsSizingOrMovingNote( const MouseEvent& rMEvt ) const
{
- sal_Bool bIsSizingOrMoving = sal_False;
+ sal_Bool bIsSizingOrMoving = false;
if ( rMEvt.IsLeft() )
{
const SdrMarkList& rNoteMarkList = pView->GetMarkedObjectList();
@@ -861,3 +824,5 @@ sal_Bool FuDraw::IsSizingOrMovingNote( const MouseEvent& rMEvt ) const
}
return bIsSizingOrMoving;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 4cc08ececd49..33eb9f8882ad 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,8 +35,10 @@
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdview.hxx>
+#include <svx/linkwarn.hxx>
#include <svtools/filter.hxx>
#include <svl/stritem.hxx>
+#include <svtools/miscopt.hxx>
#include <vcl/msgbox.hxx>
#include <tools/urlobj.hxx>
#include <avmedia/mediawindow.hxx>
@@ -50,54 +53,6 @@
#include "progress.hxx"
#include "sc.hrc"
-
-
-////========================================================================
-//// class ImportProgress
-////
-//// Bemerkung:
-//// Diese Klasse stellt lediglich den Handler fuer den ImportProgress des
-//// Grafikfilters bereit.
-////========================================================================
-//
-//class ImportProgress
-//{
-//public:
-// ImportProgress( GraphicFilter& rFilter );
-// ~ImportProgress();
-//
-// DECL_LINK( Update, GraphicFilter* );
-//
-//private:
-// ScProgress aProgress;
-//};
-//
-////------------------------------------------------------------------------
-//
-//ImportProgress::ImportProgress( GraphicFilter& rFilter )
-// : aProgress( NULL, // SfxViewFrame*, NULL == alle Docs locken
-// String( ScResId(STR_INSERTGRAPHIC) ),
-// 100 )
-//{
-// rFilter.SetUpdatePercentHdl( LINK( this, ImportProgress, Update) );
-//}
-//
-////------------------------------------------------------------------------
-//
-//__EXPORT ImportProgress::~ImportProgress()
-//{
-// aProgress.SetState( 100 );
-//}
-//
-////------------------------------------------------------------------------
-//
-//IMPL_LINK( ImportProgress, Update, GraphicFilter*, pGraphicFilter )
-//{
-// aProgress.SetState( pGraphicFilter->GetPercent() );
-// return 0;
-//}
-
-
//------------------------------------------------------------------------
void SC_DLLPUBLIC ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage )
@@ -151,7 +106,7 @@ void lcl_InsertGraphic( const Graphic& rGraphic,
const String& rFileName, const String& rFilterName, sal_Bool bAsLink, sal_Bool bApi,
ScTabViewShell* pViewSh, Window* pWindow, SdrView* pView )
{
- // #74778# set the size so the graphic has its original pixel size
+ // set the size so the graphic has its original pixel size
// at 100% view scale (as in SetMarkedOriginalSize),
// instead of respecting the current view scale
@@ -184,9 +139,9 @@ void lcl_InsertGraphic( const Graphic& rGraphic,
SdrGrafObj* pObj = new SdrGrafObj( rGraphic, aRect );
- // #118522# calling SetGraphicLink here doesn't work
+ // calling SetGraphicLink here doesn't work
- // #49961# Path is no longer used as name for the graphics object
+ // Path is no longer used as name for the graphics object
ScDrawLayer* pLayer = (ScDrawLayer*) pView->GetModel();
String aName = pLayer->GetNewGraphicName(); // "Grafik x"
@@ -196,7 +151,7 @@ void lcl_InsertGraphic( const Graphic& rGraphic,
sal_uLong nInsOptions = bApi ? SDRINSERT_DONTMARK : 0;
pView->InsertObjectAtView( pObj, *pPV, nInsOptions );
- // #118522# SetGraphicLink has to be used after inserting the object,
+ // SetGraphicLink has to be used after inserting the object,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
// See #i37444#.
if ( bAsLink )
@@ -264,7 +219,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
if ( pReqArgs->GetItemState( FN_PARAM_FILTER, sal_True, &pItem ) == SFX_ITEM_SET )
aFilterName = ((const SfxStringItem*)pItem)->GetValue();
- sal_Bool bAsLink = sal_False;
+ sal_Bool bAsLink = false;
if ( pReqArgs->GetItemState( FN_PARAM_1, sal_True, &pItem ) == SFX_ITEM_SET )
bAsLink = ((const SfxBoolItem*)pItem)->GetValue();
@@ -289,7 +244,15 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
String aFilterName = aDlg.GetCurrentFilter();
sal_Bool bAsLink = aDlg.IsAsLink();
- lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, sal_False, pViewSh, pWindow, pView );
+ // really store as link only?
+ if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
+ {
+ SvxLinkWarningDialog aWarnDlg(pWin,aFileName);
+ if( aWarnDlg.Execute() != RET_OK )
+ bAsLink = false; // don't store as link
+ }
+
+ lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, false, pViewSh, pWindow, pView );
// append items for recording
rReq.AppendItem( SfxStringItem( SID_INSERT_GRAPHIC, aFileName ) );
@@ -300,30 +263,6 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
else
{
// error is handled in SvxOpenGraphicDialog::GetGraphic
-
-#if 0
- sal_uInt16 nRes = 0;
- switch ( nError )
- {
- case GRFILTER_OPENERROR: nRes = SCSTR_GRFILTER_OPENERROR; break;
- case GRFILTER_IOERROR: nRes = SCSTR_GRFILTER_IOERROR; break;
- case GRFILTER_FORMATERROR: nRes = SCSTR_GRFILTER_FORMATERROR; break;
- case GRFILTER_VERSIONERROR: nRes = SCSTR_GRFILTER_VERSIONERROR; break;
- case GRFILTER_FILTERERROR: nRes = SCSTR_GRFILTER_FILTERERROR; break;
- case GRFILTER_TOOBIG: nRes = SCSTR_GRFILTER_TOOBIG; break;
- }
- if ( nRes )
- {
- InfoBox aInfoBox( pWindow, String(ScResId(nRes)) );
- aInfoBox.Execute();
- }
- else
- {
- sal_uLong nStreamError = GetGrfFilter()->GetLastError().nStreamError;
- if( ERRCODE_NONE != nStreamError )
- ErrorHandler::HandleError( nStreamError );
- }
-#endif
}
}
}
@@ -445,3 +384,5 @@ void FuInsertMedia::Deactivate()
{
FuPoor::Deactivate();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 0c68c871ece1..3efae6b07752 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -162,7 +163,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
// use ScChartPositioner to auto-detect column/row headers (like ScChartArray in old version)
ScRangeListRef aRangeListRef( new ScRangeList );
aRangeListRef->Parse( aRangeString, pScDoc );
- if ( aRangeListRef->Count() )
+ if ( !aRangeListRef->empty() )
{
pScDoc->LimitChartIfAll( aRangeListRef ); // limit whole columns/rows to used area
@@ -193,16 +194,16 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
uno::Sequence< beans::PropertyValue > aArgs( 4 );
aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellRangeRepresentation")), -1,
uno::makeAny( aRangeString ), beans::PropertyState_DIRECT_VALUE );
aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1,
uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE );
aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstCellAsLabel")), -1,
uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE );
aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataRowSource")), -1,
uno::makeAny( eDataRowSource ), beans::PropertyState_DIRECT_VALUE );
xReceiver->setArguments( aArgs );
@@ -228,7 +229,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
uno::Reference < embed::XEmbeddedObject > xObj;
uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
- sal_Bool bIsFromFile = sal_False;
+ sal_Bool bIsFromFile = false;
::rtl::OUString aName;
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
@@ -237,7 +238,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
sal_uInt16 nSlot = rReq.GetSlot();
- SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, false );
if ( nSlot == SID_INSERT_OBJECT && pNameItem )
{
SvGlobalName aClassName = pNameItem->GetValue();
@@ -311,14 +312,14 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
if ( xSet.is() )
{
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"),
+ xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")),
uno::makeAny( ::rtl::OUString( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) );
}
}
}
else
{
- DBG_ERROR("Invalid URL!");
+ OSL_FAIL("Invalid URL!");
//! error message
//! can this happen???
}
@@ -400,7 +401,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
if ( nAspect != embed::Aspects::MSOLE_ICON )
{
- // #73279# Math objects change their object size during InsertObject.
+ // Math objects change their object size during InsertObject.
// New size must be set in SdrObject, or a wrong scale will be set at
// ActivateObject.
@@ -426,8 +427,8 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
// XXX Activate aus Makro ist toedlich !!! ???
if (bIsFromFile)
{
- // #45012# Objekt ist selektiert, also Draw-Shell aktivieren
- pViewShell->SetDrawShell( sal_True );
+ // Objekt ist selektiert, also Draw-Shell aktivieren
+ pViewShell->SetDrawShell( true );
}
else
{
@@ -440,7 +441,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
}
catch( uno::Exception& )
{
- OSL_ASSERT( "May need error handling here!\n" );
+ OSL_FAIL( "May need error handling here!\n" );
}
}
else
@@ -524,19 +525,20 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
aMultiMark.MarkToMulti();
ScRangeList aRanges;
- aMultiMark.FillRangeListWithMarks( &aRanges, sal_False );
+ aMultiMark.FillRangeListWithMarks( &aRanges, false );
String aStr;
ScDocument* pDocument = pViewSh->GetViewData()->GetDocument();
aRanges.Format( aStr, SCR_ABS_3D, pDocument, pDocument->GetAddressConvention() );
aRangeString = aStr;
// get "total" range for positioning
- sal_uLong nCount = aRanges.Count();
- if ( nCount > 0 )
+ if ( !aRanges.empty() )
{
- aPositionRange = *aRanges.GetObject(0);
- for (sal_uLong i=1; i<nCount; i++)
- aPositionRange.ExtendTo( *aRanges.GetObject(i) );
+ aPositionRange = *aRanges[ 0 ];
+ for ( size_t i = 1, nCount = aRanges.size(); i < nCount; ++i )
+ {
+ aPositionRange.ExtendTo( *aRanges[ i ] );
+ }
}
if(bAutomaticMark)
@@ -574,7 +576,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- sal_Bool bSizeCh = sal_False;
+ sal_Bool bSizeCh = false;
if (bDrawRect && !aMarkDest.IsEmpty())
{
aSize = aMarkDest.GetSize();
@@ -610,7 +612,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
nToTable = ((const SfxUInt16Item*)pItem)->GetValue();
else if ( pItem->ISA( SfxBoolItem ) )
{
- // #46033# in der idl fuer Basic steht FN_PARAM_4 als SfxBoolItem
+ // in der idl fuer Basic steht FN_PARAM_4 als SfxBoolItem
// -> wenn gesetzt, neue Tabelle, sonst aktuelle Tabelle
if ( ((const SfxBoolItem*)pItem)->GetValue() )
@@ -652,7 +654,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
}
else
{
- DBG_ERROR( "Could not create new table :-/" );
+ OSL_FAIL( "Could not create new table :-/" );
}
}
else if ( nToTable != pData->GetTabNo() )
@@ -715,7 +717,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
{
uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
xMCF->createInstanceWithContext(
- rtl::OUString::createFromAscii("com.sun.star.comp.chart2.WizardDialog")
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.WizardDialog"))
, xContext), uno::UNO_QUERY);
uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY );
if( xChartModel.is() && xInit.is() )
@@ -725,10 +727,10 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
uno::Sequence<uno::Any> aSeq(2);
uno::Any* pArray = aSeq.getArray();
beans::PropertyValue aParam1;
- aParam1.Name = rtl::OUString::createFromAscii("ParentWindow");
+ aParam1.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
aParam1.Value <<= uno::makeAny(xDialogParentWindow);
beans::PropertyValue aParam2;
- aParam2.Name = rtl::OUString::createFromAscii("ChartModel");
+ aParam2.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChartModel"));
aParam2.Value <<= uno::makeAny(xChartModel);
pArray[0] <<= uno::makeAny(aParam1);
pArray[1] <<= uno::makeAny(aParam2);
@@ -742,7 +744,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
{
//get dialog size:
awt::Size aDialogAWTSize;
- if( xDialogProps->getPropertyValue( ::rtl::OUString::createFromAscii("Size") )
+ if( xDialogProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) )
>>= aDialogAWTSize )
{
Size aDialogSize( aDialogAWTSize.Width, aDialogAWTSize.Height );
@@ -750,18 +752,18 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
{
//calculate and set new position
Point aDialogPos = pViewShell->GetChartDialogPos( aDialogSize, aRect );
- xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("Position"),
+ xDialogProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Position")),
uno::makeAny( awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) );
}
}
//tell the dialog to unlock controller
- xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("UnlockControllersOnExecute"),
+ xDialogProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UnlockControllersOnExecute")),
uno::makeAny( sal_True ) );
}
catch( uno::Exception& )
{
- OSL_ASSERT( "Chart wizard couldn't be positioned automatically\n" );
+ OSL_FAIL( "Chart wizard couldn't be positioned automatically\n" );
}
}
@@ -788,7 +790,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
bAddUndo = false; // don't create the undo action for inserting
// leave the draw shell
- pViewShell->SetDrawShell( sal_False );
+ pViewShell->SetDrawShell( false );
}
else
{
@@ -847,3 +849,4 @@ void FuInsertChart::Deactivate()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fumark.cxx b/sc/source/ui/drawfunc/fumark.cxx
index 929f3cfd5b4e..b46e43d93125 100644
--- a/sc/source/ui/drawfunc/fumark.cxx
+++ b/sc/source/ui/drawfunc/fumark.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,8 +52,8 @@
FuMarkRect::FuMarkRect(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pViewP,
SdrModel* pDoc, SfxRequest& rReq) :
FuPoor(pViewSh, pWin, pViewP, pDoc, rReq),
- bVisible(sal_False),
- bStartDrag(sal_False)
+ bVisible(false),
+ bStartDrag(false)
{
}
@@ -74,7 +75,7 @@ FuMarkRect::~FuMarkRect()
sal_Bool FuMarkRect::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
pWindow->CaptureMouse();
@@ -122,14 +123,14 @@ sal_Bool FuMarkRect::MouseMove(const MouseEvent& rMEvt)
sal_Bool FuMarkRect::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
if ( bVisible )
{
// Hide ZoomRect
pViewShell->DrawMarkRect(aZoomRect);
- bVisible = sal_False;
+ bVisible = false;
}
Size aZoomSizePixel = pWindow->LogicToPixel(aZoomRect).GetSize();
@@ -142,7 +143,7 @@ sal_Bool FuMarkRect::MouseButtonUp(const MouseEvent& rMEvt)
aZoomRect.SetSize(Size()); // dann ganz leer
}
- bStartDrag = sal_False;
+ bStartDrag = false;
pWindow->ReleaseMouse();
pViewShell->GetViewData()->GetDispatcher().
@@ -171,7 +172,7 @@ sal_uInt8 FuMarkRect::Command(const CommandEvent& rCEvt)
{
if ( COMMAND_STARTDRAG == rCEvt.GetCommand() )
{
- // #29877# nicht anfangen, auf der Tabelle rumzudraggen,
+ // nicht anfangen, auf der Tabelle rumzudraggen,
// aber Maus-Status nicht zuruecksetzen
return SC_CMD_IGNORE;
}
@@ -190,7 +191,7 @@ sal_uInt8 FuMarkRect::Command(const CommandEvent& rCEvt)
sal_Bool FuMarkRect::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
switch ( rKEvt.GetKeyCode().GetCode() )
{
@@ -269,8 +270,8 @@ void FuMarkRect::Deactivate()
{
// Hide ZoomRect
pViewShell->DrawMarkRect(aZoomRect);
- bVisible = sal_False;
- bStartDrag = sal_False;
+ bVisible = false;
+ bStartDrag = false;
}
}
@@ -288,3 +289,4 @@ void FuMarkRect::ForcePointer(const MouseEvent* /* pMEvt */)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index dabda66355ab..014a10e19405 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,8 +56,8 @@ FuPoor::FuPoor(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pViewP,
pDrDoc(pDoc),
aSfxRequest(rReq),
pDialog(NULL),
- bIsInDragMode(sal_False),
- // #95491# remember MouseButton state
+ bIsInDragMode(false),
+ // remember MouseButton state
mnCode(0)
{
aScrollTimer.SetTimeoutHdl( LINK(this, FuPoor, ScrollHdl) );
@@ -169,7 +170,7 @@ IMPL_LINK_INLINE_START( FuPoor, ScrollHdl, Timer *, EMPTYARG )
{
Point aPosPixel = pWindow->GetPointerPosPixel();
- // #95491# use remembered MouseButton state to create correct
+ // use remembered MouseButton state to create correct
// MouseEvents for this artifical MouseMove.
MouseMove(MouseEvent(aPosPixel, 1, 0, GetMouseButtonCode()));
@@ -177,22 +178,22 @@ IMPL_LINK_INLINE_START( FuPoor, ScrollHdl, Timer *, EMPTYARG )
}
IMPL_LINK_INLINE_END( FuPoor, ScrollHdl, Timer *, pTimer )
-// #95491# moved from inline to *.cxx
+// moved from inline to *.cxx
sal_Bool FuPoor::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- return sal_False;
+ return false;
}
-// #95491# moved from inline to *.cxx
+// moved from inline to *.cxx
sal_Bool FuPoor::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- return sal_False;
+ return false;
}
/*************************************************************************
@@ -214,7 +215,7 @@ sal_Bool FuPoor::MouseButtonDown(const MouseEvent& rMEvt)
sal_Bool FuPoor::KeyInput(const KeyEvent& /* rKEvt */)
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
return(bReturn);
}
@@ -320,9 +321,9 @@ sal_Bool FuPoor::IsDetectiveHit( const Point& rLogicPos )
{
SdrPageView* pPV = pView->GetSdrPageView();
if (!pPV)
- return sal_False;
+ return false;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SdrObjListIter aIter( *pPV->GetObjList(), IM_FLAT );
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
@@ -350,7 +351,7 @@ void FuPoor::StopDragTimer()
/*************************************************************************
|*
-|* #98185# Create default drawing objects via keyboard
+|* Create default drawing objects via keyboard
|*
\************************************************************************/
@@ -383,3 +384,5 @@ bool FuPoor::doConstructOrthogonal() const
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 80a8d46de9da..ceca9c45bd9d 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,7 +84,7 @@ using namespace com::sun::star;
FuSelection::FuSelection(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pViewP,
SdrModel* pDoc, SfxRequest& rReq ) :
FuDraw(pViewSh, pWin, pViewP, pDoc, rReq),
- bVCAction(sal_False)
+ bVCAction(false)
{
}
@@ -110,9 +111,9 @@ sal_uInt8 FuSelection::Command(const CommandEvent& rCEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
const bool bSelectionOnly = rMEvt.IsRight();
if ( pView->IsAction() )
@@ -122,8 +123,8 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
return sal_True;
}
- bVCAction = sal_False;
- bIsInDragMode = sal_False; // irgendwo muss es ja zurueckgesetzt werden (#50033#)
+ bVCAction = false;
+ bIsInDragMode = false; // irgendwo muss es ja zurueckgesetzt werden (#50033#)
sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
@@ -204,8 +205,7 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
pObj = pHit;
}
- ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, sal_True );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
+ ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, true );
// For interoperability favour links over macros if both are defined
if ( pInfo->GetHlink().getLength() > 0 )
{
@@ -213,20 +213,27 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
sURL = pInfo->GetHlink();
}
else if ( pInfo->GetMacro().getLength() > 0 )
-#else
- if ( pInfo->GetMacro().getLength() > 0 )
-#endif
{
SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
{
+ uno::Reference< beans::XPropertySet > xProps( pObj->getUnoShape(), uno::UNO_QUERY );
+ uno::Any aCaller;
+ if ( xProps.is() )
+ {
+ try
+ {
+ aCaller = xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")) );
+ }
+ catch( uno::Exception& ) {}
+ }
uno::Any aRet;
uno::Sequence< sal_Int16 > aOutArgsIndex;
uno::Sequence< uno::Any > aOutArgs;
uno::Sequence< uno::Any >* pInArgs =
new uno::Sequence< uno::Any >(0);
pObjSh->CallXScript( pInfo->GetMacro(),
- *pInArgs, aRet, aOutArgsIndex, aOutArgs);
+ *pInArgs, aRet, aOutArgsIndex, aOutArgs, true, &aCaller );
pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
return sal_True; // kein CaptureMouse etc.
}
@@ -283,14 +290,14 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
pView->UnlockInternalLayer();
// try to select the clicked object
- if ( pView->MarkObj( aMDPos, -2, sal_False, rMEvt.IsMod1() ) )
+ if ( pView->MarkObj( aMDPos, -2, false, rMEvt.IsMod1() ) )
{
//*********************************************************
//Objekt verschieben
//********************************************************
if (pView->IsMarkedHit(aMDPos))
{
- // #95834# Don't start drag timer if inplace editing of an OLE object
+ // Don't start drag timer if inplace editing of an OLE object
// was just ended with this mouse click - the view will be moved
// (different tool bars) and the object that was clicked on would
// be moved unintentionally.
@@ -339,7 +346,7 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuSelection::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuSelection::MouseMove(const MouseEvent& rMEvt)
{
sal_Bool bReturn = FuDraw::MouseMove(rMEvt);
@@ -366,13 +373,7 @@ sal_Bool __EXPORT FuSelection::MouseMove(const MouseEvent& rMEvt)
// Event an den Manager weiterleiten
if( bVCAction )
{
- // GetSbxForm gibts nicht mehr - Basic-Controls sind tot
- //SdrPageView* pPgView = pView->GetPageViewByIndex(0);
- //ScDrawPage* pPage = (ScDrawPage*)pPgView->GetPage();
- //VCSbxForm* pForm = (VCSbxForm*)(SbxObject*)(pPage->GetSbxForm());
- //((VCManager*)(pForm->GetVCContainer()))->
- // MouseMove( pWindow, rMEvt );
- bReturn = sal_True;
+ bReturn = true;
}
ForcePointer(&rMEvt);
@@ -386,13 +387,12 @@ sal_Bool __EXPORT FuSelection::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
sal_Bool bReturn = FuDraw::MouseButtonUp(rMEvt);
-// sal_Bool bOle = pViewShell->GetViewData()->IsOle();
sal_Bool bOle = pViewShell->GetViewFrame()->GetFrame().IsInPlace();
if (aDragTimer.IsActive() )
@@ -485,14 +485,6 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
}
}
-/*
- if ( pView->IsObjEdit() )
- {
- sal_Bool bShowCursor = sal_True;
-//! pOutlinerView = pView->GetOutlinerView(pWindow, bShowCursor);
- bReturn = sal_True;
- }
-*/
/**************************************************************************
* Ggf. OLE-Objekt beruecksichtigen
**************************************************************************/
@@ -518,7 +510,7 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
SdrMark* pMark = rMarkList.GetMark(0);
SdrObject* pObj = pMark->GetMarkedSdrObj();
- // #43984# aktivieren nur, wenn die Maus auch (noch) ueber dem
+ // aktivieren nur, wenn die Maus auch (noch) ueber dem
// selektierten Objekt steht
SdrViewEvent aVEvt;
@@ -537,7 +529,6 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
{
if (((SdrOle2Obj*) pObj)->GetObjRef().is())
{
- //HMHpView->HideMarkHdl();
pViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0 );
}
}
@@ -545,7 +536,7 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
//
// Edit text
- // #49458# not in UNO controls
+ // not in UNO controls
// #i32352# not in media objects
//
else if ( pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) && !pObj->ISA(SdrMediaObj) )
@@ -578,15 +569,8 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
// Event an den Manager weiterleiten
if( bVCAction )
{
- // GetSbxForm gibts nicht mehr - Basic-Controls sind tot
- //SdrPageView* pPgView = pView->GetPageViewByIndex(0);
- //ScDrawPage* pPage = (ScDrawPage*)pPgView->GetPage();
- //VCSbxForm* pForm = (VCSbxForm*)(SbxObject*)(pPage->GetSbxForm());
- //((VCManager*)(pForm->GetVCContainer()))->
- // MouseButtonUp( pWindow, rMEvt );
- //HMHpView->ShowMarkHdl();
- bVCAction = sal_False;
- bReturn = sal_True;
+ bVCAction = false;
+ bReturn = true;
}
ForcePointer(&rMEvt);
@@ -626,7 +610,7 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool FuSelection::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if (!bReturn)
{
@@ -645,27 +629,9 @@ sal_Bool FuSelection::KeyInput(const KeyEvent& rKEvt)
void FuSelection::Activate()
{
-/*
- SdrDragMode eMode;
- switch (aSfxRequest.GetSlot() )
- {
- case SID_OBJECT_SELECT:
- eMode = SDRDRAG_MOVE;
- break;
- case SID_OBJECT_ROTATE:
- eMode = SDRDRAG_ROTATE;
- break;
- case SID_OBJECT_MIRROR:
- eMode = SDRDRAG_MIRROR;
- break;
- }
- pView->SetDragMode(eMode);
-*/
FuDraw::Activate();
}
-
-
/*************************************************************************
|*
|* Function deaktivieren
@@ -677,10 +643,6 @@ void FuSelection::Deactivate()
/**************************************************************************
* Hide Cursor
**************************************************************************/
-// sal_Bool bShowCursor = sal_False;
-//! pOutlinerView = pView->GetOutlinerView(pWindow, bShowCursor);
-
-// pView->SetDragMode(SDRDRAG_MOVE);
FuDraw::Deactivate();
}
@@ -689,7 +651,4 @@ void FuSelection::Deactivate()
#pragma optimize ( "", on )
#endif
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx
index 503235e865a6..4978b3c7c709 100644
--- a/sc/source/ui/drawfunc/fusel2.cxx
+++ b/sc/source/ui/drawfunc/fusel2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,9 +67,9 @@ inline long Diff( const Point& rP1, const Point& rP2 )
sal_Bool FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos )
{
if (!pPV)
- return sal_False;
+ return false;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SdrObjListIter aIter( *pPV->GetObjList(), IM_FLAT );
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
@@ -95,7 +96,7 @@ sal_Bool FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos )
SCsROW nCurY = (SCsROW) pViewData->GetCurY();
sal_Bool bStart = ( Diff( rPos,aLineStart ) > Diff( rPos,aLineEnd ) );
if ( nCurX == nStartCol && nCurY == nStartRow )
- bStart = sal_False;
+ bStart = false;
else if ( nCurX == nEndCol && nCurY == nEndRow )
bStart = sal_True;
@@ -111,7 +112,7 @@ sal_Bool FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos )
nDifX = nEndCol - nCurX;
nDifY = nEndRow - nCurY;
}
- pViewShell->MoveCursorRel( nDifX, nDifY, SC_FOLLOW_JUMP, sal_False );
+ pViewShell->MoveCursorRel( nDifX, nDifY, SC_FOLLOW_JUMP, false );
bFound = sal_True;
}
@@ -183,3 +184,4 @@ void FuSelection::ActivateNoteHandles(SdrObject* pObject)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 99aab320e16d..7e926e0b1ae4 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,7 +50,7 @@
#include "tabvwsh.hxx"
#include "drawview.hxx"
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
#include "scresid.hxx"
// Maximal erlaubte Mausbewegung um noch Drag&Drop zu starten
@@ -131,9 +132,9 @@ FuText::~FuText()
|*
\************************************************************************/
-sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
+sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
if ( pView->MouseButtonDown(rMEvt, pWindow) )
@@ -244,7 +245,7 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
}
else
{
- sal_Bool bMacro = sal_False;
+ sal_Bool bMacro = false;
// if (bMacro && pView->TakeMacroObject(aMDPos,pObj,pPV))
if (bMacro && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
@@ -276,7 +277,7 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
pHdl=pView->GetHdl(nHdlNum);
}
- if ( pView->MarkObj(aMDPos, -2, sal_False, rMEvt.IsMod1()) )
+ if ( pView->MarkObj(aMDPos, -2, false, rMEvt.IsMod1()) )
{
aDragTimer.Start();
@@ -342,9 +343,9 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuText::MouseMove(const MouseEvent& rMEvt)
+sal_Bool FuText::MouseMove(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
// pViewShell->SetActivePointer(aNewPointer);
@@ -365,9 +366,6 @@ sal_Bool __EXPORT FuText::MouseMove(const MouseEvent& rMEvt)
if ( pView->IsAction() )
{
-/* aNewPointer = Pointer(POINTER_TEXT);
- pViewShell->SetActivePointer(aNewPointer);
-*/
Point aPix(rMEvt.GetPosPixel());
Point aPnt(pWindow->PixelToLogic(aPix));
@@ -375,8 +373,6 @@ sal_Bool __EXPORT FuText::MouseMove(const MouseEvent& rMEvt)
pView->MovAction(aPnt);
}
-// ForcePointer(&rMEvt);
-
return (bReturn);
}
@@ -386,12 +382,12 @@ sal_Bool __EXPORT FuText::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
+sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
{
- // #95491# remember button state for creation of own MouseEvents
+ // remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if (aDragTimer.IsActive() )
{
@@ -437,8 +433,8 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
SfxItemSet aItemSet( pDrDoc->GetItemPool(),
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
- aItemSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aItemSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ aItemSet.Put( SdrTextAutoGrowWidthItem( false ) );
+ aItemSet.Put( SdrTextAutoGrowHeightItem( false ) );
aItemSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
aItemSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
aItemSet.Put( SdrTextAniCountItem( 1 ) );
@@ -448,7 +444,7 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
}
}
- // #93382# init object different when vertical writing
+ // init object different when vertical writing
sal_uInt16 nSlotID(aSfxRequest.GetSlot());
sal_Bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotID);
if(bVertical)
@@ -465,7 +461,7 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
pText->SetVerticalWriting(sal_True);
aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aSet.Put(SdrTextAutoGrowHeightItem(false));
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
@@ -481,7 +477,7 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
if ( !pView->AreObjectsMarked() )
{
- pView->MarkObj(aPnt, -2, sal_False, rMEvt.IsMod1());
+ pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
if ( pView->AreObjectsMarked() )
@@ -501,7 +497,7 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 )
{
- pView->MarkObj(aPnt, -2, sal_False, rMEvt.IsMod1());
+ pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
if ( pView->AreObjectsMarked() )
@@ -523,49 +519,6 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
void FuText::ForcePointer(const MouseEvent* /* pMEvt */)
{
pViewShell->SetActivePointer( aNewPointer );
-
-/*
- if ( !pView->IsAction() )
- {
- Point aPnt(pWindow->PixelToLogic( pWindow->ScreenToOutputPixel(
- Pointer::GetPosPixel() ) ) );
- SdrHdl* pHdl=pView->HitHandle(aPnt, *pWindow);
-
- if (pHdl!=NULL)
- {
- pViewShell->SetActivePointer(pHdl->GetPointer() );
- }
- else
- {
- SdrObject* pObj;
- SdrPageView* pPV;
-
- if ( pView->IsMarkedHit(aPnt) )
- {
- if ( pView->TakeTextEditObject(aPnt, pObj, pPV) )
- {
- pViewShell->SetActivePointer(Pointer(POINTER_TEXT));
- }
- else
- {
- pViewShell->SetActivePointer(Pointer(POINTER_MOVE));
- }
- }
- else
- {
-// if ( pView->TakeMacroObject(aPnt, pObj, pPV) )
- if ( pView->PickObj(aPnt, pObj, pPV, SDRSEARCH_PICKMACRO) )
- {
- pViewShell->SetActivePointer( pObj->GetMacroPointer() );
- }
- else
- {
- pViewShell->SetActivePointer( aNewPointer );
- }
- }
- }
- }
-*/
}
@@ -579,9 +532,9 @@ void FuText::ForcePointer(const MouseEvent* /* pMEvt */)
|*
\************************************************************************/
-sal_Bool __EXPORT FuText::KeyInput(const KeyEvent& rKEvt)
+sal_Bool FuText::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if ( pView->KeyInput(rKEvt, pWindow) )
{
@@ -621,17 +574,12 @@ void FuText::Activate()
**********************************************************************/
sal_uInt16 nObj = OBJ_TEXT;
-/* sal_uInt16 nIdent;
- sal_uInt32 nInvent;
- pView->TakeCurrentObj(nIdent, nInvent);
-*/
pView->SetCurrentObj(nObj);
pView->SetCreateMode();
}
aNewPointer = Pointer(POINTER_TEXT);
-// aNewPointer = Pointer(POINTER_CROSS); //! ???
aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer );
@@ -700,22 +648,6 @@ void FuText::SelectionHasChanged()
sal_uInt32 nInvent;
pView->TakeCurrentObj(nIdent, nInvent);
-// if (! pView->IsEditMode() )
-// {
-// if (nIdent == OBJ_TEXT)
-// {
-// nObj = OBJ_TEXT;
-// }
-// else if (nIdent == OBJ_OUTLINETEXT)
-// {
-// nObj = OBJ_OUTLINETEXT;
-// }
-// else if (nIdent == OBJ_TITLETEXT)
-// {
-// nObj = OBJ_TITLETEXT;
-// }
-// }
-
pView->SetCurrentObj(nObj);
pView->SetCreateMode();
@@ -759,8 +691,6 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
pObj->ISA(SdrTextObj))
{
SdrPageView* pPV = pView->GetSdrPageView();
- Rectangle aRect = pObj->GetLogicRect();
- Point aPnt = aRect.Center();
if ( pObj->HasTextEdit() )
{
@@ -815,7 +745,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
}
}
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
{
// case SID_DRAW_TEXT:
@@ -834,7 +764,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
SdrTextObj* pText = (SdrTextObj*)pObj;
pText->SetLogicRect(rRectangle);
- // #105815# don't set default text, start edit mode instead
+ // don't set default text, start edit mode instead
// String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
// pText->SetText(aText);
@@ -848,7 +778,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
SfxItemSet aSet(pDrDoc->GetItemPool());
aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aSet.Put(SdrTextAutoGrowHeightItem(false));
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
@@ -859,8 +789,8 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
{
SfxItemSet aSet(pDrDoc->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
- aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ aSet.Put( SdrTextAutoGrowWidthItem( false ) );
+ aSet.Put( SdrTextAutoGrowHeightItem( false ) );
aSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
aSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
aSet.Put( SdrTextAniCountItem( 1 ) );
@@ -869,14 +799,15 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
pObj->SetMergedItemSetAndBroadcast(aSet);
}
- SetInEditMode( pObj ); // #105815# start edit mode
+ SetInEditMode( pObj ); // start edit mode
}
else
{
- DBG_ERROR("Object is NO text object");
+ OSL_FAIL("Object is NO text object");
}
}
return pObj;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx
index ef7e0d675162..e43c1ce44344 100644
--- a/sc/source/ui/drawfunc/futext2.cxx
+++ b/sc/source/ui/drawfunc/futext2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,139 +42,49 @@
#define _TREELIST_HXX
#define _CACHESTR_HXX
#define _NEW_HXX
-//#define _SHL_HXX
-//#define _LINK_HXX
-//#define _ERRCODE_HXX
-//#define _GEN_HXX
-//#define _FRACT_HXX
-//#define _STRING_HXX
-//#define _MTF_HXX
-//#define _CONTNR_HXX
-//#define _LIST_HXX
-//#define _TABLE_HXX
#define _DYNARY_HXX
-//#define _UNQIDX_HXX
#define _SVMEMPOOL_HXX
-//#define _UNQID_HXX
-//#define _DEBUG_HXX
-//#define _DATE_HXX
-//#define _TIME_HXX
-//#define _DATETIME_HXX
-//#define _INTN_HXX
-//#define _WLDCRD_HXX
-//#define _FSYS_HXX
-//#define _STREAM_HXX
#define _CACHESTR_HXX
#define _SV_MULTISEL_HXX
//SV
-//#define _CLIP_HXX ***
#define _CONFIG_HXX
#define _CURSOR_HXX
#define _FONTDLG_HXX
#define _PRVWIN_HXX
-//#define _COLOR_HXX
-//#define _PAL_HXX
-//#define _BITMAP_HXX
-//#define _GDIOBJ_HXX
-//#define _POINTR_HXX
-//#define _ICON_HXX
-//#define _IMAGE_HXX
-//#define _KEYCOD_HXX
-//#define _EVENT_HXX
#define _HELP_HXX
-//#define _APP_HXX
-//#define _MDIAPP_HXX
-//#define _TIMER_HXX
-//#define _METRIC_HXX
-//#define _REGION_HXX
-//#define _OUTDEV_HXX
-//#define _SYSTEM_HXX
-//#define _VIRDEV_HXX
-//#define _JOBSET_HXX
-//#define _PRINT_HXX
-//#define _WINDOW_HXX
-//#define _SYSWIN_HXX
-//#define _WRKWIN_HXX
#define _MDIWIN_HXX
-//#define _FLOATWIN_HXX
-//#define _DOCKWIN_HXX
-//#define _CTRL_HXX
-//#define _SCRBAR_HXX
-//#define _BUTTON_HXX
-//#define _IMAGEBTN_HXX
-//#define _FIXED_HXX
-//#define _GROUP_HXX
-//#define _EDIT_HXX
-//#define _COMBOBOX_HXX
-//#define _LSTBOX_HXX
-//#define _SELENG_HXX ***
-//#define _SPLIT_HXX
#define _SPIN_HXX
-//#define _FIELD_HXX
-//#define _MOREBTN_HXX ***
-//#define _TOOLBOX_HXX
#define _STATUS_HXX
#define _SVTCTRL3_HXX
-//#define _DIALOG_HXX
-//#define _MSGBOX_HXX
-//#define _SYSDLG_HXX
-//#define _FILDLG_HXX ***
-//#define _PRNDLG_HXX
#define _COLDLG_HXX
-//#define _TABDLG_HXX
-//#define _MENU_HXX ***
-//#define _GDIMTF_HXX
-//#define _POLY_HXX
-//#define _ACCEL_HXX
-//#define _GRAPH_HXX
#define _SOUND_HXX
//svtools
#define _SCRWIN_HXX
#define _RULER_HXX
-//#define _TABBAR_HXX
-//#define _VALUESET_HXX
#define _STDMENU_HXX
-//#define _STDCTRL_HXX
-//#define _CTRLBOX_HXX
#define _CTRLTOOL_HXX
#define _EXTATTR_HXX
#define _FRM3D_HXX
#define _EXTATTR_HXX
//SVTOOLS
-//#define _SVTREELIST_HXX
#define _FILTER_HXX
-//#define _SVLBOXITM_HXX
-//#define _SVTREEBOX_HXX
#define _SVICNVW_HXX
#define _SVTABBX_HXX
//sfxcore.hxx
-//#define _SFXINIMGR_HXX
-//#define _SFXCFGITEM_HXX
-//#define _SFX_PRINTER_HXX
#define _SFXGENLINK_HXX
#define _SFXHINTPOST_HXX
#define _SFXDOCINF_HXX
#define _SFXLINKHDL_HXX
-//#define _SFX_PROGRESS_HXX
//sfxsh.hxx
-//#define _SFX_SHELL_HXX
-//#define _SFXAPP_HXX
-//#define _SFXDISPATCH_HXX
-//#define _SFXMSG_HXX
-//#define _SFXOBJFACE_HXX
-//#define _SFXREQUEST_HXX
#define _SFXMACRO_HXX
// SFX
-//#define _SFXAPPWIN_HXX
#define _SFX_SAVEOPT_HXX
-//#define _SFX_CHILDWIN_HXX
-//#define _SFXCTRLITEM_HXX
#define _SFXPRNMON_HXX
#define _INTRO_HXX
#define _SFXMSGDESCR_HXX
@@ -190,79 +101,37 @@
#define _SFXEVENT_HXX
//sfxdoc.hxx
-//#define _SFX_OBJSH_HXX
-//#define _SFX_CLIENTSH_HXX
-//#define _SFXDOCINF_HXX
-//#define _SFX_OBJFAC_HXX
#define _SFX_DOCFILT_HXX
-//#define _SFXDOCFILE_HXX
-//define _VIEWFAC_HXX
-//#define _SFXVIEWFRM_HXX
-//#define _SFXVIEWSH_HXX
-//#define _MDIFRM_HXX
#define _SFX_IPFRM_HXX
-//#define _SFX_INTERNO_HXX
//sfxdlg.hxx
-//#define _SFXTABDLG_HXX
-//#define _BASEDLGS_HXX
#define _SFX_DINFDLG_HXX
#define _SFXDINFEDT_HXX
#define _SFX_MGETEMPL_HXX
#define _SFX_TPLPITEM_HXX
-//#define _SFX_STYLEDLG_HXX
#define _NEWSTYLE_HXX
-//#define _SFXDOCTEMPL_HXX
-//#define _SFXDOCTDLG_HXX
-//#define _SFX_TEMPLDLG_HXX
-//#define _SFXNEW_HXX
#define _SFXDOCMAN_HXX
-//#define _SFXDOCKWIN_HXX **
//sfxitems.hxx
#define _SFX_WHMAP_HXX
-//#define _ARGS_HXX ***
-//#define _SFXPOOLITEM_HXX
-//#define _SFXINTITEM_HXX
-//#define _SFXENUMITEM_HXX
#define _SFXFLAGITEM_HXX
-//#define _SFXSTRITEM_HXX
#define _SFXPTITEM_HXX
#define _SFXRECTITEM_HXX
-//#define _SFXITEMPOOL_HXX
-//#define _SFXITEMSET_HXX
#define _SFXITEMITER_HXX
#define _SFX_WHITER_HXX
#define _SFXPOOLCACH_HXX
-//#define _AEITEM_HXX
#define _SFXRNGITEM_HXX
-//#define _SFXSLSTITM_HXX
-//#define _SFXSTYLE_HXX
-
-//xout.hxx
-//#define _XENUM_HXX
-//#define _XPOLY_HXX
-//#define _XATTR_HXX
-//#define _XOUTX_HXX
-//#define _XPOOL_HXX
-//#define _XTABLE_HXX
//svdraw.hxx
#define _SDR_NOITEMS
#define _SDR_NOTOUCH
#define _SDR_NOTRANSFORM
-//#define _SDR_NOOBJECTS
-//#define _SDR_NOVIEWS
-//#define SI_NOITEMS
-//#define SI_NODRW
#define _SI_NOSBXCONTROLS
#define _VCATTR_HXX
#define _VCONT_HXX
-//#define _VCSBX_HXX ***
#define _SI_NOOTHERFORMS
#define _VCTRLS_HXX
-//#define _VCDRWOBJ_HXX ***
#define _SI_NOCONTROL
#define _SETBRW_HXX
#define _VCBRW_HXX
@@ -301,3 +170,4 @@ SdrOutliner* FuText::MakeOutliner()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 68278f4892a8..096a7b602744 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -187,63 +188,13 @@ void FuText::StopEditMode(sal_Bool /*bTextDirection*/)
// invalidate stream positions only for the affected sheet
rDoc.LockStreamValid(false);
if (rDoc.IsStreamValid(aNotePos.Tab()))
- rDoc.SetStreamValid(aNotePos.Tab(), sal_False);
+ rDoc.SetStreamValid(aNotePos.Tab(), false);
}
}
// Called following an EndDragObj() to update the new note rectangle position
void FuText::StopDragMode(SdrObject* /*pObject*/)
{
-#if 0 // DR
- ScViewData& rViewData = *pViewShell->GetViewData();
- if( ScDrawObjData* pData = ScDrawLayer::GetNoteCaptionData( pObject, rViewData.GetTabNo() ) )
- {
- ScDocument& rDoc = *rViewData.GetDocument();
- const ScAddress& rPos = pData->maStart;
- ScPostIt* pNote = rDoc.GetNote( rPos );
- DBG_ASSERT( pNote && (pNote->GetCaption() == pObject), "FuText::StopDragMode - missing or invalid cell note" );
- if( pNote )
- {
- Rectangle aOldRect = pNote->CalcRectangle( rDoc, rPos );
- Rectangle aNewRect = pObject->GetLogicRect();
- if( aOldRect != aNewRect )
- {
- pNote->UpdateFromRectangle( rDoc, rPos, aNewRect );
- OutlinerParaObject* pPObj = pCaption->GetOutlinerParaObject();
- bool bVertical = (pPObj && pPObj->IsVertical());
- // The new height/width is honoured if property item is reset.
- if(!bVertical && aNewRect.Bottom() - aNewRect.Top() > aOldRect.Bottom() - aOldRect.Top())
- {
- if(pCaption->IsAutoGrowHeight() && !bVertical)
- {
- pCaption->SetMergedItem( SdrTextAutoGrowHeightItem( false ) );
- aNote.SetItemSet( *pDoc, pCaption->GetMergedItemSet() );
- }
- }
- else if(bVertical && aNewRect.Right() - aNewRect.Left() > aOldRect.Right() - aOldRect.Left())
- {
- if(pCaption->IsAutoGrowWidth() && bVertical)
- {
- pCaption->SetMergedItem( SdrTextAutoGrowWidthItem( false ) );
- aNote.SetItemSet( *pDoc, pCaption->GetMergedItemSet() );
- }
- }
- pViewShell->SetNote( aTabPos.Col(), aTabPos.Row(), aTabPos.Tab(), aNote );
-
- // This repaint should not be necessary but it cleans
- // up the 'marks' left behind by the note handles
- // now that notes can simultaineously have handles and edit active.
- ScRange aDrawRange = rDoc.GetRange( rPos.Tab(), aOldRect );
- // Set Start/End Row to previous/next row to allow for handles.
- if( aDrawRange.aStart.Row() > 0 )
- aDrawRange.aStart.IncRow( -1 );
- if( aDrawRange.aEnd.Row() < MAXROW )
- aDrawRange.aEnd.IncRow( 1 );
- ScDocShell* pDocSh = rViewData.GetDocShell();
- pDocSh->PostPaint( aDrawRange, PAINT_GRID| PAINT_EXTRAS);
- }
- }
- }
-#endif
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index add82f255f05..4d950a69c783 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,7 +96,7 @@ void ScGraphicShell::GetFilterState( SfxItemSet& rSet )
{
ScDrawView* pView = GetViewData()->GetScDrawView();
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_Bool bEnable = sal_False;
+ sal_Bool bEnable = false;
if( rMarkList.GetMarkCount() == 1 )
{
@@ -146,3 +147,4 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq )
Invalidate();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/makefile.mk b/sc/source/ui/drawfunc/makefile.mk
index f82008e4cdeb..41aa76331df5 100644
--- a/sc/source/ui/drawfunc/makefile.mk
+++ b/sc/source/ui/drawfunc/makefile.mk
@@ -32,9 +32,7 @@ TARGET=drawfunc
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -45,40 +43,37 @@ SRC1FILES = \
drformsh.src
SLOFILES = \
- $(SLO)$/fupoor.obj \
- $(SLO)$/fumark.obj \
- $(SLO)$/fudraw.obj \
- $(SLO)$/fusel.obj \
- $(SLO)$/fusel2.obj \
- $(SLO)$/fuconstr.obj \
- $(SLO)$/fuconrec.obj \
- $(SLO)$/fuconarc.obj \
- $(SLO)$/fuconuno.obj \
- $(SLO)$/fuconpol.obj \
- $(SLO)$/fuconcustomshape.obj \
- $(SLO)$/fuins1.obj \
- $(SLO)$/fuins2.obj \
- $(SLO)$/futext.obj \
- $(SLO)$/futext2.obj \
- $(SLO)$/futext3.obj \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES= \
+ $(SLO)$/chartsh.obj \
$(SLO)$/drawsh.obj \
$(SLO)$/drawsh2.obj \
$(SLO)$/drawsh4.obj \
$(SLO)$/drawsh5.obj \
+ $(SLO)$/drformsh.obj \
$(SLO)$/drtxtob.obj \
$(SLO)$/drtxtob1.obj \
$(SLO)$/drtxtob2.obj \
- $(SLO)$/drformsh.obj \
- $(SLO)$/oleobjsh.obj \
- $(SLO)$/chartsh.obj \
- $(SLO)$/graphsh.obj \
- $(SLO)$/mediash.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/fusel.obj \
+ $(SLO)$/fuconarc.obj \
+ $(SLO)$/fuconcustomshape.obj \
+ $(SLO)$/fuconpol.obj \
+ $(SLO)$/fuconrec.obj \
+ $(SLO)$/fuconstr.obj \
+ $(SLO)$/fuconuno.obj \
+ $(SLO)$/fudraw.obj \
+ $(SLO)$/fuins1.obj \
$(SLO)$/fuins2.obj \
- $(SLO)$/graphsh.obj \
- $(SLO)$/mediash.obj
+ $(SLO)$/fumark.obj \
+ $(SLO)$/fupoor.obj \
+ $(SLO)$/fusel.obj \
+ $(SLO)$/fusel2.obj \
+ $(SLO)$/futext.obj \
+ $(SLO)$/futext2.obj \
+ $(SLO)$/futext3.obj \
+ $(SLO)$/graphsh.obj \
+ $(SLO)$/mediash.obj \
+ $(SLO)$/oleobjsh.obj
NOOPTFILES=\
$(SLO)$/fusel.obj
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 9aec72095c1e..6fcdedf3b7fd 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117,7 +118,7 @@ void ScMediaShell::ExecuteMedia( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
const SfxPoolItem* pItem;
- if( !pArgs || ( SFX_ITEM_SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, sal_False, &pItem ) ) )
+ if( !pArgs || ( SFX_ITEM_SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, false, &pItem ) ) )
pItem = NULL;
if( pItem )
@@ -141,3 +142,5 @@ void ScMediaShell::ExecuteMedia( SfxRequest& rReq )
Invalidate();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/objdraw.src b/sc/source/ui/drawfunc/objdraw.src
index 4b417b28e59b..586aaf822e92 100644
--- a/sc/source/ui/drawfunc/objdraw.src
+++ b/sc/source/ui/drawfunc/objdraw.src
@@ -186,7 +186,6 @@
ITEM_FORMAT_PARA_DLG\
};
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
#define MN_EDITLNK \
MenuItem\
{\
@@ -202,7 +201,6 @@
HelpID = CMD_SID_DRAW_HLINK_DELETE ; \
Text [ en-US ] = "~Remove Hyperlink" ; \
};
-#endif
#define MN_DRWTXTATTR \
MenuItem\
@@ -210,7 +208,6 @@
Identifier = SID_DRAWTEXT_ATTR_DLG ; \
HelpID = CMD_SID_DRAWTEXT_ATTR_DLG ; \
Text [ en-US ] = "Te~xt..." ; \
- /* ### ACHTUNG: Neuer Text in Resource? Textattribute fr die selektierten Textobjekte festlegen : Textattribute fr die selektierten Textobjekte festlegen */\
Text [ x-comment ] = " ";\
};
@@ -227,8 +224,7 @@
MenuItem\
{\
Identifier = SID_ORIGINALSIZE ; \
- HelpId = CMD_SID_ORIGINALSIZE ; \
- /* ### ACHTUNG: Neuer Text in Resource? Originalgre : Originalgre */\
+ HelpId = SID_ORIGINALSIZE ; \
Text [ en-US ] = "~Original Size" ; \
Text [ x-comment ] = " ";\
};
@@ -296,16 +292,14 @@
MenuItem\
{\
Identifier = SID_FRAME_UP ; \
- HelpId = CMD_SID_FRAME_UP ; \
- /* ### ACHTUNG: Neuer Text in Resource? W~eiter nach vorn : Weiter nach vorn */\
+ HelpId = SID_FRAME_UP ; \
Text [ en-US ] = "Bring ~Forward" ; \
Text [ x-comment ] = " ";\
};\
MenuItem\
{\
Identifier = SID_FRAME_DOWN ; \
- HelpId = CMD_SID_FRAME_DOWN ; \
- /* ### ACHTUNG: Neuer Text in Resource? Weiter ~nach hinten : Weiter nach hinten */\
+ HelpId = SID_FRAME_DOWN ; \
Text [ en-US ] = "Send Back~ward" ; \
Text [ x-comment ] = " ";\
};\
@@ -432,7 +426,6 @@ String RID_GRAPHIC_OBJECTBAR
//
String RID_POPUP_DRAW
{
- /* ### ACHTUNG: Neuer Text in Resource? Popup-Men fr Zeichenobjekte : Popup-Men fr Zeichenobjekte */
Text [ en-US ] = "Pop-up menu for drawing objects" ;
Text [ x-comment ] = " ";
};
@@ -479,14 +472,12 @@ Menu RID_POPUP_DRAW
MenuItem { Separator = TRUE ; };
//------------------------------
ITEM_GROUP_MENU
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
//------------------------------
MenuItem { Separator = TRUE ; };
//------------------------------
MN_EDITLNK
MN_DELLNK
MenuItem { ITEM_OPEN_HYPERLINK };
-#endif
};
};
@@ -556,14 +547,12 @@ Menu RID_POPUP_GRAPHIC
MenuItem { Separator = TRUE ; };
//------------------------------
ITEM_GROUP_MENU
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
//------------------------------
MenuItem { Separator = TRUE ; };
//------------------------------
MN_EDITLNK
MN_DELLNK
MenuItem { ITEM_OPEN_HYPERLINK };
-#endif
};
};
@@ -663,7 +652,6 @@ Menu RID_POPUP_CHART
String RID_POPUP_DRAWTEXT
{
- /* ### ACHTUNG: Neuer Text in Resource? Popup-Men fr Text-Objekte : Popup-Men fr Text-Objekte */
Text [ en-US ] = "Pop-up menu for text objects" ;
Text [ x-comment ] = " ";
};
diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx
index f9346dd8da88..d8a0b8c052ac 100644
--- a/sc/source/ui/drawfunc/oleobjsh.cxx
+++ b/sc/source/ui/drawfunc/oleobjsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,11 +35,9 @@
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
-//CHINA001 #include <svx/labdlg.hxx>
#include <svl/srchitem.hxx>
#include <svx/tabarea.hxx>
#include <svx/tabline.hxx>
-//CHINA001 #include <svx/transfrm.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
@@ -81,3 +80,4 @@ ScOleObjectShell::~ScOleObjectShell()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 99cc1c14688f..e923f66b31d0 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
-
#include <editeng/editview.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
@@ -59,7 +57,7 @@
SFX_IMPL_DOCKINGWINDOW( ScFunctionChildWindow, FID_FUNCTION_BOX )
/*************************************************************************
-#* Member: ScFunctionChildWindow Datum:06.10.97
+#* Member: ScFunctionChildWindow
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionChildWindow
@@ -74,7 +72,7 @@ SFX_IMPL_DOCKINGWINDOW( ScFunctionChildWindow, FID_FUNCTION_BOX )
#*
#************************************************************************/
-__EXPORT ScFunctionChildWindow::ScFunctionChildWindow( Window* pParentP,
+ScFunctionChildWindow::ScFunctionChildWindow( Window* pParentP,
sal_uInt16 nId,
SfxBindings* pBindings,
SfxChildWinInfo* pInfo ) :
@@ -90,7 +88,7 @@ __EXPORT ScFunctionChildWindow::ScFunctionChildWindow( Window* pParentP,
}
/*************************************************************************
-#* Member: ScFunctionDockWin Datum:06.10.97
+#* Member: ScFunctionDockWin
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -130,13 +128,12 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
aDDFuncList.Hide();
nArgs=0;
nDockMode=0;
- bSizeFlag=sal_False;
+ bSizeFlag=false;
aCatBox.SetDropDownLineCount(9);
Font aFont=aFiFuncDesc.GetFont();
aFont.SetColor(Color(COL_BLACK));
aFiFuncDesc.SetFont(aFont);
aFiFuncDesc.SetBackground( GetBackground() ); //! never transparent?
-//? SetBackground();
Link aLink=LINK( this, ScFunctionDockWin, SelHdl);
aCatBox.SetSelectHdl(aLink);
@@ -153,7 +150,6 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
StartListening( *pBindingsP, sal_True );
Point aTopLeft=aCatBox.GetPosPixel();
- //String aString=aCatBox.GetEntry( 0)+String("www");
String aString=String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ww"));
Size aTxtSize( aFiFuncDesc.GetTextWidth(aString), aFiFuncDesc.GetTextHeight() );
nMinWidth=aTxtSize.Width()+aTopLeft.X()
@@ -169,7 +165,7 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
}
/*************************************************************************
-#* Member: ScFunctionDockWin Datum:06.10.97
+#* Member: ScFunctionDockWin
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -182,13 +178,13 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
#*
#************************************************************************/
-__EXPORT ScFunctionDockWin::~ScFunctionDockWin()
+ScFunctionDockWin::~ScFunctionDockWin()
{
EndListening( GetBindings() );
}
/*************************************************************************
-#* Member: UpdateFunctionList Datum:06.10.97
+#* Member: UpdateFunctionList
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -204,20 +200,9 @@ __EXPORT ScFunctionDockWin::~ScFunctionDockWin()
void ScFunctionDockWin::InitLRUList()
{
- const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
- sal_uInt16 nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX );
- sal_uInt16* pLRUListIds = rAppOpt.GetLRUFuncList();
-
- sal_uInt16 i;
- for ( i=0; i<LRU_MAX; i++ )
- aLRUList[i] = NULL;
+ ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
+ pFuncMgr->fillLastRecentlyUsedFunctions(aLRUList);
- if ( pLRUListIds )
- {
- ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
- for ( i=0; i<nLRUFuncCount; i++ )
- aLRUList[i] = pFuncMgr->Get( pLRUListIds[i] );
- }
sal_uInt16 nSelPos = aCatBox.GetSelectEntryPos();
@@ -226,7 +211,7 @@ void ScFunctionDockWin::InitLRUList()
}
/*************************************************************************
-#* Member: UpdateFunctionList Datum:10.12.99
+#* Member: UpdateFunctionList
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -250,7 +235,7 @@ void ScFunctionDockWin::UpdateLRUList()
/*************************************************************************
-#* Member: SetSize Datum:06.10.97
+#* Member: SetSize
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -327,7 +312,7 @@ void ScFunctionDockWin::SetSize()
}
}
/*************************************************************************
-#* Member: SetLeftRightSize Datum:15.10.97
+#* Member: SetLeftRightSize
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -343,7 +328,7 @@ void ScFunctionDockWin::SetSize()
void ScFunctionDockWin::SetLeftRightSize()
{
- if(bSizeFlag==sal_False)
+ if(bSizeFlag==false)
{
bSizeFlag=sal_True;
@@ -352,8 +337,6 @@ void ScFunctionDockWin::SetLeftRightSize()
aDiffSize.Width()-=aNewSize.Width();
aDiffSize.Height()-=aNewSize.Height();
- //@ SetUpdateMode( sal_False);
-
String aString = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ww"));
Size aTxtSize( aFuncList.GetTextWidth(aString), aFuncList.GetTextHeight() );
@@ -372,14 +355,12 @@ void ScFunctionDockWin::SetLeftRightSize()
aOldSize=aNewSize;
aNewSize.Width()+=aDiffSize.Width();
aNewSize.Height()+=aDiffSize.Height();
- //SetSizePixel(aNewSize);
- //@ SetUpdateMode( sal_True);
- bSizeFlag=sal_False;
+ bSizeFlag=false;
}
}
/*************************************************************************
-#* Member: SetTopBottonSize Datum:15.10.97
+#* Member: SetTopBottonSize
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -395,7 +376,7 @@ void ScFunctionDockWin::SetLeftRightSize()
void ScFunctionDockWin::SetTopBottonSize()
{
- if(bSizeFlag==sal_False)
+ if(bSizeFlag==false)
{
bSizeFlag=sal_True;
Size aDiffSize=GetSizePixel();
@@ -408,14 +389,12 @@ void ScFunctionDockWin::SetTopBottonSize()
aNewSize.Width()+=aDiffSize.Width();
aNewSize.Height()+=aDiffSize.Height();
- //SetSizePixel(aNewSize);
- //@ SetUpdateMode( sal_True);
- bSizeFlag=sal_False;
+ bSizeFlag=false;
}
}
/*************************************************************************
-#* Member: SetMyWidthLeRi Datum:15.10.97
+#* Member: SetMyWidthLeRi
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -440,8 +419,6 @@ void ScFunctionDockWin::SetMyWidthLeRi(Size &aNewSize)
Point aCDTopLeft=aCatBox.GetPosPixel();
Point aFLTopLeft=aFuncList.GetPosPixel();
- Point aSplitterTopLeft=aPrivatSplit.GetPosPixel();
- Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
aCDSize.Width()=aNewSize.Width()-aCDTopLeft.X()-aFLTopLeft.X();
aFLSize.Width()=aNewSize.Width()-2*aFLTopLeft.X();
@@ -455,7 +432,7 @@ void ScFunctionDockWin::SetMyWidthLeRi(Size &aNewSize)
}
/*************************************************************************
-#* Member: SetHeight Datum:06.10.97
+#* Member: SetHeight
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -503,7 +480,7 @@ void ScFunctionDockWin::SetMyHeightLeRi(Size &aNewSize)
}
/*************************************************************************
-#* Member: SetMyWidthToBo Datum:16.10.97
+#* Member: SetMyWidthToBo
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -544,7 +521,7 @@ void ScFunctionDockWin::SetMyWidthToBo(Size &aNewSize)
}
/*************************************************************************
-#* Member: SetHeight Datum:16.10.97
+#* Member: SetHeight
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -573,7 +550,7 @@ void ScFunctionDockWin::SetMyHeightToBo(Size &aNewSize)
}
/*************************************************************************
-#* Member: SetDescription Datum:13.10.97
+#* Member: SetDescription
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -596,30 +573,30 @@ void ScFunctionDockWin::SetDescription()
{
pDesc->initArgumentInfo(); // full argument info is needed
- String aString=pAllFuncList->GetSelectEntry();
+ ::rtl::OUStringBuffer aBuf(pAllFuncList->GetSelectEntry());
if(nDockMode==0)
{
- aString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ":\n\n" ));
+ aBuf.appendAscii(":\n\n");
}
else
{
- aString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
+ aBuf.appendAscii(": ");
}
- aString+=pDesc->GetParamList();
+ aBuf.append(pDesc->GetParamList());
if(nDockMode==0)
{
- aString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "\n\n" ));
+ aBuf.appendAscii("\n\n");
}
else
{
- aString += '\n';
+ aBuf.appendAscii("\n");
}
- aString+=*(pDesc->pFuncDesc);
+ aBuf.append(*pDesc->pFuncDesc);
- aFiFuncDesc.SetText(aString);
+ aFiFuncDesc.SetText(aBuf.makeStringAndClear());
aFiFuncDesc.StateChanged(STATE_CHANGE_TEXT);
aFiFuncDesc.Invalidate();
aFiFuncDesc.Update();
@@ -628,7 +605,7 @@ void ScFunctionDockWin::SetDescription()
}
/*************************************************************************
-#* Member: Resizing Datum:06.10.97
+#* Member: Resizing
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -642,7 +619,7 @@ void ScFunctionDockWin::SetDescription()
#*
#************************************************************************/
-void __EXPORT ScFunctionDockWin::Resizing( Size& rNewSize )
+void ScFunctionDockWin::Resizing( Size& rNewSize )
{
if((sal_uLong)rNewSize.Width()<nMinWidth) rNewSize.Width()=nMinWidth;
if((sal_uLong)rNewSize.Height()<nMinHeight) rNewSize.Height()=nMinHeight;
@@ -650,7 +627,7 @@ void __EXPORT ScFunctionDockWin::Resizing( Size& rNewSize )
}
/*************************************************************************
-#* Member: Close Datum:07.10.97
+#* Member: Close
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -663,9 +640,9 @@ void __EXPORT ScFunctionDockWin::Resizing( Size& rNewSize )
#*
#************************************************************************/
-sal_Bool __EXPORT ScFunctionDockWin::Close()
+sal_Bool ScFunctionDockWin::Close()
{
- SfxBoolItem aItem( FID_FUNCTION_BOX, sal_False );
+ SfxBoolItem aItem( FID_FUNCTION_BOX, false );
GetBindings().GetDispatcher()->Execute( FID_FUNCTION_BOX,
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
@@ -678,7 +655,7 @@ sal_Bool __EXPORT ScFunctionDockWin::Close()
/*************************************************************************
-#* Member: CheckAlignment Datum:16.10.97
+#* Member: CheckAlignment
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -691,7 +668,7 @@ sal_Bool __EXPORT ScFunctionDockWin::Close()
#* Output: Das uebergebene Alignment
#*
#************************************************************************/
-SfxChildAlignment __EXPORT ScFunctionDockWin::CheckAlignment(SfxChildAlignment /* abla */,
+SfxChildAlignment ScFunctionDockWin::CheckAlignment(SfxChildAlignment /* abla */,
SfxChildAlignment aChildAlign)
{
String aString = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ww"));
@@ -703,7 +680,7 @@ SfxChildAlignment __EXPORT ScFunctionDockWin::CheckAlignment(SfxChildAlignment /
}
else
{
- bInit=sal_False;
+ bInit=false;
eSfxOldAlignment=aChildAlign;
eSfxNewAlignment=aChildAlign;
}
@@ -718,9 +695,7 @@ SfxChildAlignment __EXPORT ScFunctionDockWin::CheckAlignment(SfxChildAlignment /
case SFX_ALIGN_TOOLBOXTOP:
case SFX_ALIGN_TOOLBOXBOTTOM:
- nMinWidth= 0;/*aDDFuncList.GetPosPixel().X()+
- 10*aTxtSize.Width()+
- aFuncList.GetPosPixel().X();*/
+ nMinWidth= 0;
nMinHeight=0;
break;
@@ -736,7 +711,6 @@ SfxChildAlignment __EXPORT ScFunctionDockWin::CheckAlignment(SfxChildAlignment /
nMinWidth=aTxtSize.Width()+aTopLeft.X()
+2*aFuncList.GetPosPixel().X();
nMinHeight=19*aTxtSize.Height();
- //aCatBox.SelectEntryPos(0);
break;
}
@@ -744,7 +718,7 @@ SfxChildAlignment __EXPORT ScFunctionDockWin::CheckAlignment(SfxChildAlignment /
return aChildAlign;
}
/*************************************************************************
-#* Member: Close Datum:07.10.97
+#* Member: Close
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -758,21 +732,11 @@ SfxChildAlignment __EXPORT ScFunctionDockWin::CheckAlignment(SfxChildAlignment /
#************************************************************************/
void ScFunctionDockWin::Notify( SfxBroadcaster&, const SfxHint& /* rHint */ )
{
-// const SfxPoolItemHint *pPoolItemHint = PTR_CAST(SfxPoolItemHint, &rHint);
- /*
- if ( pPoolItemHint
- && ( pPoolItemHint->GetObject()->ISA( SvxColorTableItem ) ) )
- {
- // Die Liste der Farben hat sich geaendert
- pColorTable = ( (SvxColorTableItem*) pPoolItemHint->GetObject() )->GetColorTable();
- FillValueSet();
- }
- */
}
/*************************************************************************
-#* Member: Resize Datum:06.10.97
+#* Member: Resize
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -786,7 +750,7 @@ void ScFunctionDockWin::Notify( SfxBroadcaster&, const SfxHint& /* rHint */ )
#*
#************************************************************************/
-void __EXPORT ScFunctionDockWin::Resize()
+void ScFunctionDockWin::Resize()
{
if ( !IsFloatingMode() ||
!GetFloatingWindow()->IsRollUp() )
@@ -799,7 +763,7 @@ void __EXPORT ScFunctionDockWin::Resize()
}
/*************************************************************************
-#* Member: UpdateFunctionList Datum:06.10.97
+#* Member: UpdateFunctionList
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -820,7 +784,7 @@ void ScFunctionDockWin::UpdateFunctionList()
? (nSelPos-1) : 0;
pAllFuncList->Clear();
- pAllFuncList->SetUpdateMode( sal_False );
+ pAllFuncList->SetUpdateMode( false );
if ( nSelPos > 0 )
{
@@ -837,11 +801,11 @@ void ScFunctionDockWin::UpdateFunctionList()
}
else // LRU-Liste
{
- for ( sal_uInt16 i=0; i<LRU_MAX && aLRUList[i]; i++ )
+ for(::std::vector<const formula::IFunctionDescription*>::iterator iter=aLRUList.begin();iter!=aLRUList.end();++iter)
{
- const ScFuncDesc* pDesc = aLRUList[i];
+ const formula::IFunctionDescription* pDesc = *iter;
pAllFuncList->SetEntryData(
- pAllFuncList->InsertEntry( *(pDesc->pFuncName) ),
+ pAllFuncList->InsertEntry(pDesc->getFunctionName()),
(void*)pDesc );
}
}
@@ -862,7 +826,7 @@ void ScFunctionDockWin::UpdateFunctionList()
}
/*************************************************************************
-#* Member: DoEnter Datum:06.10.97
+#* Member: DoEnter
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -957,7 +921,7 @@ void ScFunctionDockWin::DoEnter(sal_Bool /* bOk */) //@@ ???
else
{
aString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "()" ));
- pEdView->InsertText(aString,sal_False);
+ pEdView->InsertText(aString,false);
pHdl->DataChanged();
}
}
@@ -978,7 +942,7 @@ void ScFunctionDockWin::DoEnter(sal_Bool /* bOk */) //@@ ???
/*************************************************************************
-#* Handle: SelHdl Datum:06.10.97
+#* Handle: SelHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -1011,7 +975,7 @@ IMPL_LINK( ScFunctionDockWin, SelHdl, ListBox*, pLb )
}
/*************************************************************************
-#* Handle: SelHdl Datum:06.10.97
+#* Handle: SelHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -1038,7 +1002,7 @@ IMPL_LINK( ScFunctionDockWin, SetSelectionHdl, void*, pCtrl )
}
/*************************************************************************
-#* Handle: SetSplitHdl Datum:13.10.97
+#* Handle: SetSplitHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScFunctionDockWin
@@ -1067,12 +1031,6 @@ IMPL_LINK( ScFunctionDockWin, SetSplitHdl, ScPrivatSplit*, pCtrl )
aFuncList.SetSizePixel(aFLSize);
aFiFuncDesc.SetPosPixel(aFDTopLeft);
aFiFuncDesc.SetSizePixel(aFDSize);
- /*
- aFuncList.Invalidate();
- aFuncList.Update();
- aFiFuncDesc.Invalidate();
- aFiFuncDesc.Update();
- */
}
//...
@@ -1180,3 +1138,4 @@ void ScFunctionDockWin::StateChanged( StateChangedType nStateChange )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/dwfunctr.hrc b/sc/source/ui/formdlg/dwfunctr.hrc
index 388fea28b7ca..a53c884583d2 100644
--- a/sc/source/ui/formdlg/dwfunctr.hrc
+++ b/sc/source/ui/formdlg/dwfunctr.hrc
@@ -31,7 +31,3 @@
#define IMB_INSERT 1
#define FI_FUNCDESC 1
#define FT_SPLIT 2
-
-
-// ********************************************************************** EOF
-
diff --git a/sc/source/ui/formdlg/dwfunctr.src b/sc/source/ui/formdlg/dwfunctr.src
index d9e77c96c8dc..dc50a2b41486 100644
--- a/sc/source/ui/formdlg/dwfunctr.src
+++ b/sc/source/ui/formdlg/dwfunctr.src
@@ -27,6 +27,7 @@
// include ---------------------------------------------------------------
#include "sc.hrc"
#include "dwfunctr.hrc"
+
// pragma ----------------------------------------------------------------
// RID_SVXDLG_CALCFUNC --------------------------------------------------
@@ -114,7 +115,7 @@ DockingWindow FID_FUNCTION_BOX
{
ImageBitmap = Bitmap
{
- File = "fx.bmp" ;
+ File = "fx.png";
};
MaskColor = STD_MASKCOLOR;
};
@@ -124,36 +125,3 @@ DockingWindow FID_FUNCTION_BOX
Text [ en-US ] = "Functions" ;
};
// ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/formdlg/formdata.cxx b/sc/source/ui/formdlg/formdata.cxx
index e493e3f7b00f..d11ad33a6a45 100644
--- a/sc/source/ui/formdlg/formdata.cxx
+++ b/sc/source/ui/formdlg/formdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,4 @@ void ScFormEditData::SaveValues()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/formdlgs.src b/sc/source/ui/formdlg/formdlgs.src
index e3550030c74e..3d09f22ef985 100644
--- a/sc/source/ui/formdlg/formdlgs.src
+++ b/sc/source/ui/formdlg/formdlgs.src
@@ -26,4 +26,5 @@
************************************************************************/
#include "sc.hrc"
+
//---------------------------------------------------------------------------
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 845bf1adfa5a..14a4e0023efa 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,7 +97,6 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
// title has to be from the view that opened the dialog,
// even if it's not the current view
- SfxObjectShell* pParentDoc = NULL;
if ( pB )
{
SfxDispatcher* pMyDisp = pB->GetDispatcher();
@@ -107,15 +107,10 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
{
pScViewShell = PTR_CAST( ScTabViewShell, pMyViewFrm->GetViewShell() );
if( pScViewShell )
- pScViewShell->UpdateInputHandler(sal_True);
- pParentDoc = pMyViewFrm->GetObjectShell();
+ pScViewShell->UpdateInputHandler(true);
}
}
}
- //if ( !pParentDoc && pScViewShell ) // use current only if above fails
- // pParentDoc = pScViewShell->GetObjectShell();
- //if ( pParentDoc )
- // aDocName = pParentDoc->GetTitle();
if ( pDoc == NULL )
pDoc = pViewData->GetDocument();
@@ -132,7 +127,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
if ( pInputHdl )
pInputHdl->NotifyChange( NULL );
- m_aHelper.enableInput( sal_False );
+ m_aHelper.enableInput( false );
m_aHelper.EnableSpreadsheets();
m_aHelper.Init();
m_aHelper.SetDispatcherLock( sal_True );
@@ -166,14 +161,14 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
String aFormula;
pDoc->GetFormula( nCol, nRow, nTab, aFormula );
sal_Bool bEdit = ( aFormula.Len() > 1 );
- sal_Bool bMatrix = sal_False;
+ sal_Bool bMatrix = false;
if ( bEdit )
{
bMatrix = CheckMatrix(aFormula);
xub_StrLen nFStart = 0;
xub_StrLen nFEnd = 0;
- if ( GetFormulaHelper().GetNextFunc( aFormula, sal_False, nFStart, &nFEnd) )
+ if ( GetFormulaHelper().GetNextFunc( aFormula, false, nFStart, &nFEnd) )
{
pScMod->InputReplaceSelection( aFormula );
pScMod->InputSetSelection( nFStart, nFEnd );
@@ -184,7 +179,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
pData->SetFStart( nFStart );
}
else
- bEdit = sal_False;
+ bEdit = false;
}
if ( !bEdit )
@@ -197,7 +192,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
pScMod->InputSetSelection( 1, aNewFormula.Len()+1 );
xub_StrLen PrivStart, PrivEnd;
pScMod->InputGetSelection( PrivStart, PrivEnd);
- SetMeText(pScMod->InputGetFormulaStr(),PrivStart, PrivEnd,bMatrix,sal_False,sal_False);
+ SetMeText(pScMod->InputGetFormulaStr(),PrivStart, PrivEnd,bMatrix,false,false);
pData->SetFStart( 1 ); // hinter dem "="
}
@@ -208,7 +203,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
pCell = new ScFormulaCell( pDoc, aCursorPos, rStrExp );
Update(rStrExp);
- } // if (!pData)
+ }
}
@@ -270,7 +265,7 @@ void ScFormulaDlg::fill()
}
}
-__EXPORT ScFormulaDlg::~ScFormulaDlg()
+ScFormulaDlg::~ScFormulaDlg()
{
ScModule* pScMod = SC_MOD();
ScFormEditData* pData = pScMod->GetFormEditData();
@@ -286,7 +281,7 @@ __EXPORT ScFormulaDlg::~ScFormulaDlg()
sal_Bool ScFormulaDlg::IsInputHdl(ScInputHandler* pHdl)
{
- sal_Bool bAlive = sal_False;
+ sal_Bool bAlive = false;
// gehoert der InputHandler zu irgendeiner ViewShell ?
@@ -325,9 +320,9 @@ ScInputHandler* ScFormulaDlg::GetNextInputHandler(ScDocShell* pDocShell,PtrTabVi
}
-sal_Bool __EXPORT ScFormulaDlg::Close()
+sal_Bool ScFormulaDlg::Close()
{
- DoEnter(sal_False);
+ DoEnter(false);
return sal_True;
}
@@ -340,7 +335,7 @@ bool ScFormulaDlg::calculateValue( const String& rStrExp, String& rStrResult )
::std::auto_ptr<ScFormulaCell> pFCell( new ScFormulaCell( pDoc, aCursorPos, rStrExp ) );
- // #35521# HACK! um bei ColRowNames kein #REF! zu bekommen,
+ // HACK! um bei ColRowNames kein #REF! zu bekommen,
// wenn ein Name eigentlich als Bereich in die Gesamt-Formel
// eingefuegt wird, bei der Einzeldarstellung aber als
// single-Zellbezug interpretiert wird
@@ -357,7 +352,7 @@ bool ScFormulaDlg::calculateValue( const String& rStrExp, String& rStrResult )
pFCell.reset( new ScFormulaCell( pDoc, aCursorPos, aBraced ) );
}
else
- bColRowName = sal_False;
+ bColRowName = false;
}
sal_uInt16 nErrCode = pFCell->GetErrCode();
@@ -405,6 +400,7 @@ bool ScFormulaDlg::calculateValue( const String& rStrExp, String& rStrResult )
// virtuelle Methoden von ScAnyRefDlg:
void ScFormulaDlg::RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton )
{
+ pEdit->SetSelection(Selection(0, SELECTION_MAX));
::std::pair<formula::RefButton*,formula::RefEdit*> aPair = RefInputStartBefore( pEdit, pButton );
m_aHelper.RefInputStart( aPair.second, aPair.first);
RefInputStartAfter( aPair.second, aPair.first );
@@ -452,10 +448,24 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
}
else
{
- sal_uInt16 nFmt = ( rRef.aStart.Tab() == aCursorPos.Tab() )
- ? SCA_VALID
- : SCA_VALID | SCA_TAB_3D;
- rRef.Format( aRefStr, nFmt, pRefDoc, pRefDoc->GetAddressConvention() );
+ // We can't use ScRange::Format here because in R1C1 mode we need
+ // to display the reference position relative to the cursor
+ // position.
+ ScTokenArray aArray;
+ ScComplexRefData aRefData;
+ aRefData.InitRangeRel(rRef, aCursorPos);
+ bool bSingle = aRefData.Ref1 == aRefData.Ref2;
+ if (aCursorPos.Tab() != rRef.aStart.Tab())
+ aRefData.Ref1.SetFlag3D(true);
+ if (bSingle)
+ aArray.AddSingleReference(aRefData.Ref1);
+ else
+ aArray.AddDoubleReference(aRefData);
+ ScCompiler aComp(pDoc, aCursorPos, aArray);
+ aComp.SetGrammar(pDoc->GetGrammar());
+ ::rtl::OUStringBuffer aBuf;
+ aComp.CreateStringFromTokenArray(aBuf);
+ aRefStr = aBuf.makeStringAndClear();
}
UpdateParaWin(theSel,aRefStr);
@@ -474,7 +484,7 @@ sal_Bool ScFormulaDlg::IsDocAllowed(SfxObjectShell* pDocSh) const
// not allowed: different from this doc, and no name
// pDocSh is always a ScDocShell
if ( pDocSh && ((ScDocShell*)pDocSh)->GetDocument() != pDoc && !pDocSh->HasName() )
- return sal_False;
+ return false;
return sal_True; // everything else is allowed
}
@@ -530,7 +540,7 @@ void ScFormulaDlg::AddRefEntry( )
sal_Bool ScFormulaDlg::IsTableLocked( ) const
{
// per Default kann bei Referenzeingabe auch die Tabelle umgeschaltet werden
- return sal_False;
+ return false;
}
void ScFormulaDlg::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton)
{
@@ -549,9 +559,9 @@ void ScFormulaDlg::dispatch(sal_Bool _bOK,sal_Bool _bMartixChecked)
// Wenn durch Dokument-Umschalterei die Eingabezeile weg war/ist,
// ist der String leer. Dann nicht die alte Formel loeschen.
if ( !aStrItem.GetValue().Len() )
- aRetItem.SetValue( sal_False ); // sal_False = Cancel
+ aRetItem.SetValue( false ); // sal_False = Cancel
- m_aHelper.SetDispatcherLock( sal_False ); // Modal-Modus ausschalten
+ m_aHelper.SetDispatcherLock( false ); // Modal-Modus ausschalten
clear();
@@ -665,3 +675,4 @@ table::CellAddress ScFormulaDlg::getReferencePosition() const
return pArray;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/formdlg/makefile.mk b/sc/source/ui/formdlg/makefile.mk
index 339e8fa4d581..4440abaf314d 100644
--- a/sc/source/ui/formdlg/makefile.mk
+++ b/sc/source/ui/formdlg/makefile.mk
@@ -32,18 +32,19 @@ TARGET=formdlgs
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/formula.obj \
- $(SLO)$/formdata.obj \
- $(SLO)$/privsplt.obj \
- $(SLO)$/dwfunctr.obj
+ $(EXCEPTIONSFILES) \
+ $(SLO)$/formdata.obj
+
+EXCEPTIONSFILES = \
+ $(SLO)$/dwfunctr.obj \
+ $(SLO)$/formula.obj \
+ $(SLO)$/privsplt.obj
SRS1NAME=$(TARGET)
SRC1FILES = \
diff --git a/sc/source/ui/formdlg/privsplt.cxx b/sc/source/ui/formdlg/privsplt.cxx
index 860b1bb23249..65df2a6f86c9 100644
--- a/sc/source/ui/formdlg/privsplt.cxx
+++ b/sc/source/ui/formdlg/privsplt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include "privsplt.hxx"
/*************************************************************************
-#* Member: ScPrivatSplit Datum:13.10.97
+#* Member: ScPrivatSplit
#*------------------------------------------------------------------------
#*
#* Klasse: MD_Test
@@ -63,7 +64,7 @@ ScPrivatSplit::ScPrivatSplit( Window* pParent, const ResId& rResId,
aWinPointer=GetPointer();
- aMovingFlag=sal_False;
+ aMovingFlag=false;
if(eScSplit==SC_SPLIT_HORZ)
{
aWinPointer=Pointer(POINTER_HSPLIT);
@@ -77,7 +78,7 @@ ScPrivatSplit::ScPrivatSplit( Window* pParent, const ResId& rResId,
/*************************************************************************
-#* Member: MouseButtonDown Datum:13.10.97
+#* Member: MouseButtonDown
#*------------------------------------------------------------------------
#*
#* Klasse: ScPrivatSplit
@@ -102,7 +103,7 @@ void ScPrivatSplit::MouseButtonDown( const MouseEvent& rMEvt )
}
/*************************************************************************
-#* Member: MouseButtonUp Datum:13.10.97
+#* Member: MouseButtonUp
#*------------------------------------------------------------------------
#*
#* Klasse: ScPrivatSplit
@@ -164,7 +165,7 @@ void ScPrivatSplit::MouseButtonUp( const MouseEvent& rMEvt )
}
/*************************************************************************
-#* Member: MouseMove Datum:13.10.97
+#* Member: MouseMove
#*------------------------------------------------------------------------
#*
#* Klasse: ScPrivatSplit
@@ -229,7 +230,7 @@ void ScPrivatSplit::MouseMove( const MouseEvent& rMEvt )
}
/*************************************************************************
-#* Member: SetYRange Datum:14.10.97
+#* Member: SetYRange
#*------------------------------------------------------------------------
#*
#* Klasse: ScPrivatSplit
@@ -249,7 +250,7 @@ void ScPrivatSplit::SetYRange(Range cRgeY)
/*************************************************************************
-#* Member: GetDeltaY Datum:13.10.97
+#* Member: GetDeltaY
#*------------------------------------------------------------------------
#*
#* Klasse: ScPrivatSplit
@@ -267,7 +268,7 @@ short ScPrivatSplit::GetDeltaX()
}
/*************************************************************************
-#* Member: GetDeltaY Datum:13.10.97
+#* Member: GetDeltaY
#*------------------------------------------------------------------------
#*
#* Klasse: ScPrivatSplit
@@ -285,7 +286,7 @@ short ScPrivatSplit::GetDeltaY()
}
/*************************************************************************
-#* Member: CtrModified Datum:13.10.97
+#* Member: CtrModified
#*------------------------------------------------------------------------
#*
#* Klasse: ScPrivatSplit
@@ -388,17 +389,17 @@ void ScPrivatSplit::StateChanged( StateChangedType nType )
if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( sal_True, false, false );
Invalidate();
}
if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( false, sal_True, false );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( false, false, sal_True );
Invalidate();
}
@@ -420,3 +421,4 @@ void ScPrivatSplit::DataChanged( const DataChangedEvent& rDCEvt )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibilityHints.hxx b/sc/source/ui/inc/AccessibilityHints.hxx
index 8d966a78fa7f..dee0c99d4861 100644
--- a/sc/source/ui/inc/AccessibilityHints.hxx
+++ b/sc/source/ui/inc/AccessibilityHints.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,3 +96,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx
index 38dfdc483886..6d0c1dfb524b 100644
--- a/sc/source/ui/inc/AccessibleCell.hxx
+++ b/sc/source/ui/inc/AccessibleCell.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -171,3 +172,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleCellBase.hxx b/sc/source/ui/inc/AccessibleCellBase.hxx
index 2bcef463480d..fb79d76c91a1 100644
--- a/sc/source/ui/inc/AccessibleCellBase.hxx
+++ b/sc/source/ui/inc/AccessibleCellBase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -151,3 +152,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx b/sc/source/ui/inc/AccessibleContextBase.hxx
index ecfeff96af39..245122f5b73a 100644
--- a/sc/source/ui/inc/AccessibleContextBase.hxx
+++ b/sc/source/ui/inc/AccessibleContextBase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_IllegalAccessibleComponentStateException_HPP_
#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
-#endif
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weak.hxx>
@@ -43,7 +42,7 @@
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <cppuhelper/interfacecontainer.h>
@@ -342,3 +341,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx
index 14f48b51efc1..87cd4f8d7d26 100644
--- a/sc/source/ui/inc/AccessibleCsvControl.hxx
+++ b/sc/source/ui/inc/AccessibleCsvControl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -664,3 +665,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleDataPilotControl.hxx b/sc/source/ui/inc/AccessibleDataPilotControl.hxx
index f92fb79987a7..fb0e0f40ecd6 100644
--- a/sc/source/ui/inc/AccessibleDataPilotControl.hxx
+++ b/sc/source/ui/inc/AccessibleDataPilotControl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include "AccessibleContextBase.hxx"
-class ScPivotFieldWindow;
+class ScDPFieldControlBase;
class ScAccessibleDataPilotButton;
class ScAccessibleDataPilotControl
@@ -42,7 +43,7 @@ public:
ScAccessibleDataPilotControl(
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>& rxParent,
- ScPivotFieldWindow* pFieldWindow);
+ ScDPFieldControlBase* pDPFieldWindow);
virtual void Init();
@@ -131,7 +132,7 @@ protected:
throw (::com::sun::star::uno::RuntimeException);
private:
- ScPivotFieldWindow* mpFieldWindow;
+ ScDPFieldControlBase* mpDPFieldWindow;
struct AccessibleWeak
{
::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xWeakAcc;
@@ -143,3 +144,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleDocument.hxx b/sc/source/ui/inc/AccessibleDocument.hxx
index 2ec612e0865b..fbfa0667f68f 100644
--- a/sc/source/ui/inc/AccessibleDocument.hxx
+++ b/sc/source/ui/inc/AccessibleDocument.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -326,3 +327,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleDocumentBase.hxx b/sc/source/ui/inc/AccessibleDocumentBase.hxx
index fc76a8d771cf..eeab25f7af1c 100644
--- a/sc/source/ui/inc/AccessibleDocumentBase.hxx
+++ b/sc/source/ui/inc/AccessibleDocumentBase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#ifndef _SC_ACCESSIBLEDOCUMENTBASE_HXX
#define _SC_ACCESSIBLEDOCUMENTBASE_HXX
-#ifndef _SC_ACCESSIBLE_CONTEXT_BASE_HXX
#include "AccessibleContextBase.hxx"
-#endif
class ScAccessibleDocumentBase
: public ScAccessibleContextBase
@@ -48,3 +47,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
index 8ce9050c6094..b524c6f5ffa3 100644
--- a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
+++ b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,11 +114,6 @@ public:
///===== internal ========================================================
-//UNUSED2009-05 com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible >
-//UNUSED2009-05 GetCurrentAccessibleTable();
-
-//UNUSED2009-05 void ChildCountChanged();
-
protected:
/// Return this object's description.
virtual ::rtl::OUString SAL_CALL
@@ -157,3 +153,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleEditObject.hxx b/sc/source/ui/inc/AccessibleEditObject.hxx
index 55bb92f13424..5dd40f7c0d62 100644
--- a/sc/source/ui/inc/AccessibleEditObject.hxx
+++ b/sc/source/ui/inc/AccessibleEditObject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -176,3 +177,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessiblePageHeader.hxx b/sc/source/ui/inc/AccessiblePageHeader.hxx
index 1e28670419a4..b3598adf7469 100644
--- a/sc/source/ui/inc/AccessiblePageHeader.hxx
+++ b/sc/source/ui/inc/AccessiblePageHeader.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessiblePageHeaderArea.hxx b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx
index dbf7c126b617..3f907e5609ed 100644
--- a/sc/source/ui/inc/AccessiblePageHeaderArea.hxx
+++ b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#ifndef _SC_ACCESSIBLEPAGEHEADERAREA_HXX
#define _SC_ACCESSIBLEPAGEHEADERAREA_HXX
-#ifndef _SC_ACCESSIBLE_CONTEXT_BASE_HXX
#include "AccessibleContextBase.hxx"
-#endif
#include <editeng/svxenum.hxx>
class EditTextObject;
@@ -136,3 +135,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessiblePreviewCell.hxx b/sc/source/ui/inc/AccessiblePreviewCell.hxx
index 47a2be3b6713..02090ad207f9 100644
--- a/sc/source/ui/inc/AccessiblePreviewCell.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewCell.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
index 520abe7c53c3..f3e8d7b29ea3 100644
--- a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -150,3 +151,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessiblePreviewTable.hxx b/sc/source/ui/inc/AccessiblePreviewTable.hxx
index 6d9ae3c3025f..9dfbcfbd6662 100644
--- a/sc/source/ui/inc/AccessiblePreviewTable.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewTable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -180,3 +181,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleSpreadsheet.hxx b/sc/source/ui/inc/AccessibleSpreadsheet.hxx
index 87447285dea2..428e1744e622 100644
--- a/sc/source/ui/inc/AccessibleSpreadsheet.hxx
+++ b/sc/source/ui/inc/AccessibleSpreadsheet.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,15 +93,12 @@ public:
void CompleteSelectionChanged(sal_Bool bNewState);
virtual void LostFocus();
-
virtual void GotFocus();
void BoundingBoxChanged();
-
void VisAreaChanged();
///===== SfxListener =====================================================
-
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
///===== XAccessibleTable ================================================
@@ -285,5 +283,6 @@ private:
Rectangle GetVisCells(const Rectangle& rVisArea);
};
-
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleTableBase.hxx b/sc/source/ui/inc/AccessibleTableBase.hxx
index 017ef4dfca3f..e436b623397e 100644
--- a/sc/source/ui/inc/AccessibleTableBase.hxx
+++ b/sc/source/ui/inc/AccessibleTableBase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -296,3 +297,5 @@ protected:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx
index 0a61280a574a..43d3c1aba20d 100644
--- a/sc/source/ui/inc/AccessibleText.hxx
+++ b/sc/source/ui/inc/AccessibleText.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -149,7 +150,7 @@ public:
virtual void UpdateData() { }
virtual void SetDoUpdate(sal_Bool /* bValue */) { }
- virtual sal_Bool IsDirty() const { return sal_False; }
+ virtual sal_Bool IsDirty() const { return false; }
DECL_LINK( NotifyHdl, EENotify* );
protected:
@@ -203,7 +204,6 @@ public:
virtual SvxViewForwarder* GetViewForwarder();
virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool /* bCreate */ ) { return NULL; }
-//UNUSED2008-05 DECL_LINK( NotifyHdl, EENotify* );
private:
ScPreviewViewForwarder* mpViewForwarder;
ScPreviewShell* mpViewShell;
@@ -233,7 +233,6 @@ public:
virtual SvxViewForwarder* GetViewForwarder();
virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool /* bCreate */ ) { return NULL; }
-//UNUSED2008-05 DECL_LINK( NotifyHdl, EENotify* );
private:
ScPreviewViewForwarder* mpViewForwarder;
ScPreviewShell* mpViewShell;
@@ -268,7 +267,7 @@ public:
virtual void UpdateData() { }
virtual void SetDoUpdate(sal_Bool /* bValue */) { }
- virtual sal_Bool IsDirty() const { return sal_False; }
+ virtual sal_Bool IsDirty() const { return false; }
private:
ScPreviewViewForwarder* mpViewForwarder;
ScPreviewShell* mpViewShell;
@@ -301,7 +300,7 @@ public:
virtual void UpdateData() { }
virtual void SetDoUpdate(sal_Bool /* bValue */) { }
- virtual sal_Bool IsDirty() const { return sal_False; }
+ virtual sal_Bool IsDirty() const { return false; }
private:
ScPreviewViewForwarder* mpViewForwarder;
ScPreviewShell* mpViewShell;
@@ -350,10 +349,12 @@ public:
virtual void UpdateData() {}
virtual void SetDoUpdate( sal_Bool /* bValue */ ) {}
- virtual sal_Bool IsDirty() const { return sal_False; }
+ virtual sal_Bool IsDirty() const { return false; }
};
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/ChartRangeSelectionListener.hxx b/sc/source/ui/inc/ChartRangeSelectionListener.hxx
index 65c725da5675..45127b333983 100644
--- a/sc/source/ui/inc/ChartRangeSelectionListener.hxx
+++ b/sc/source/ui/inc/ChartRangeSelectionListener.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,5 @@ private:
// SC_CHARTRANGESELECTIONLISTENER_HXX
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/DrawModelBroadcaster.hxx b/sc/source/ui/inc/DrawModelBroadcaster.hxx
index 045e9bc86f41..a3c56b722d58 100644
--- a/sc/source/ui/inc/DrawModelBroadcaster.hxx
+++ b/sc/source/ui/inc/DrawModelBroadcaster.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/IAnyRefDialog.hxx b/sc/source/ui/inc/IAnyRefDialog.hxx
index ffd86491da5d..afd90f5305f3 100644
--- a/sc/source/ui/inc/IAnyRefDialog.hxx
+++ b/sc/source/ui/inc/IAnyRefDialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,15 +44,9 @@ class SAL_NO_VTABLE IAnyRefDialog : public formula::IControlReferenceHandler
public:
virtual ~IAnyRefDialog(){}
- //virtual void ShowReference(const String& _sRef) = 0;
- //virtual void HideReference( sal_Bool bDoneRefMode = sal_True ) = 0;
- //virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0;
- //virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0;
-
-
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0;
virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0;
- virtual void RefInputDone( sal_Bool bForced = sal_False ) = 0;
+ virtual void RefInputDone( sal_Bool bForced = false ) = 0;
virtual sal_Bool IsTableLocked() const = 0;
virtual sal_Bool IsRefInputMode() const = 0;
@@ -62,3 +57,5 @@ public:
};
#endif // SC_IANYREFDIALOG_HXX_INCLUDED
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/ScDevChart.hxx b/sc/source/ui/inc/ScDevChart.hxx
index a08a89da0570..5f60bcec9a3e 100644
--- a/sc/source/ui/inc/ScDevChart.hxx
+++ b/sc/source/ui/inc/ScDevChart.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,5 @@ bool UseDevChart()
// INCLUDED_DEVCHARTCONFIG_HXX
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/acredlin.hrc b/sc/source/ui/inc/acredlin.hrc
index b21676ee6ae9..54ad490291af 100644
--- a/sc/source/ui/inc/acredlin.hrc
+++ b/sc/source/ui/inc/acredlin.hrc
@@ -30,17 +30,15 @@
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 5
-//
+
#define CTR_REDLINING 10
#define TP_FILTER 11
#define TP_VIEW 12
-
#define FT_ASSIGN 14
#define ED_ASSIGN 15
#define RB_ASSIGN 16
-
#define STR_INSERT_COLS 20
#define STR_INSERT_ROWS 21
#define STR_INSERT_TABS 22
@@ -57,6 +55,7 @@
#define STR_CHILD_CONTENT 33
#define STR_CHILD_ORGCONTENT 34
#define STR_EMPTY 35
+
// Bitmaps
#define BMP_STR_CLOSE 41
#define BMP_STR_OPEN 42
@@ -70,6 +69,3 @@
#define SC_SORT_AUTHOR 53
#define SC_SORT_DATE 54
#define SC_SORT_COMMENT 55
-
-//
-
diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx
index 16e3117c7cd3..f984c2347fe5 100644
--- a/sc/source/ui/inc/acredlin.hxx
+++ b/sc/source/ui/inc/acredlin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,9 @@
#ifndef SC_ACREDLIN_HXX
#define SC_ACREDLIN_HXX
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
@@ -45,9 +40,7 @@
#include "anyrefdg.hxx"
#include <vcl/lstbox.hxx>
-#ifndef _SVX_ACREDLIN_HXX
#include <svx/ctredlin.hxx>
-#endif
#include <svx/simptabl.hxx>
#ifndef _SVARRAY_HXX
@@ -173,7 +166,6 @@ private:
void Init();
void InitFilter();
-//UNUSED2008-05 void SetMyStaticData();
DECL_LINK( FilterHandle, SvxTPFilter* );
DECL_LINK( RefHandle, SvxTPFilter* );
@@ -208,12 +200,12 @@ protected:
String* MakeTypeString(ScChangeActionType eType);
SvLBoxEntry* InsertChangeAction(const ScChangeAction* pScChangeAction,ScChangeActionState eState,
- SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=sal_False,
- sal_Bool bDisabled=sal_False,sal_uLong nPos=LIST_APPEND);
+ SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=false,
+ sal_Bool bDisabled=false,sal_uLong nPos=LIST_APPEND);
SvLBoxEntry* InsertFilteredAction(const ScChangeAction* pScChangeAction,ScChangeActionState eState,
- SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=sal_False,
- sal_Bool bDisabled=sal_False,sal_uLong nPos=LIST_APPEND);
+ SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=false,
+ sal_Bool bDisabled=false,sal_uLong nPos=LIST_APPEND);
SvLBoxEntry* InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
@@ -242,7 +234,7 @@ protected:
void ClearView();
sal_Bool Expand(ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction,
- SvLBoxEntry* pEntry, sal_Bool bFilter=sal_False);
+ SvLBoxEntry* pEntry, sal_Bool bFilter=false);
public:
ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
@@ -262,3 +254,4 @@ public:
#endif // SC_NAMEDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index ecbeed14ef42..c1c2ec29029c 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,39 +29,29 @@
#ifndef SC_ANYREFDG_HXX
#define SC_ANYREFDG_HXX
-#ifndef _IMAGEBTN_HXX
-#include <vcl/button.hxx>
-#endif
-#ifndef _EDIT_HXX
+#include <vcl/imagebtn.hxx>
#include <vcl/edit.hxx>
-#endif
-#ifndef _ACCEL_HXX
#include <vcl/accel.hxx>
-#endif
#include <sfx2/basedlgs.hxx>
+#include <sfx2/tabdlg.hxx>
#include "address.hxx"
#include "cell.hxx"
#include "compiler.hxx"
#include "formula/funcutl.hxx"
#include "IAnyRefDialog.hxx"
#include "scresid.hxx"
+#include "scmod.hxx"
+
#include <memory>
class SfxObjectShell;
class ScRange;
class ScDocument;
class ScTabViewShell;
-//The class of ScAnyRefDlg is rewritten by PengYunQuan for Validity Cell Range Picker
-//class ScAnyRefDlg;
class ScRefHandler;
class ScRangeList;
-//<!--Added by PengYunQuan for Validity Cell Range Picker
class SfxShell;
-#include "scmod.hxx"
-typedef formula::RefButton ScRefButton;
-typedef formula::RefEdit ScRefEdit;
-//-->Added by PengYunQuan for Validity Cell Range Picker
class ScFormulaReferenceHelper
{
IAnyRefDialog* m_pDlg;
@@ -100,7 +91,7 @@ public:
void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
void HideReference( sal_Bool bDoneRefMode = sal_True );
void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
- void RefInputDone( sal_Bool bForced = sal_False );
+ void RefInputDone( sal_Bool bForced = false );
void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
inline void SetWindow(Window* _pWindow) { m_pWindow = _pWindow; }
@@ -110,28 +101,27 @@ public:
void ViewShellChanged( ScTabViewShell* pScViewShell );
static void enableInput(sal_Bool _bInput);
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+
protected:
Window * GetWindow(){ return m_pWindow; }
+
public:
- bool CanInputStart( const ScRefEdit *pEdit ){ return !!pEdit; }
+ bool CanInputStart( const formula::RefEdit *pEdit ){ return !!pEdit; }
bool CanInputDone( sal_Bool bForced ){ return pRefEdit && (bForced || !pRefBtn); }
-//<!--Added by PengYunQuan for Validity Cell Range Picker
};
+
//============================================================================
-//The class of ScAnyRefDlg is rewritten by PengYunQuan for Validity Cell Range Picker
class SC_DLLPUBLIC ScRefHandler : //public SfxModelessDialog,
public IAnyRefDialog
{
-//<!--Added by PengYunQuan for Validity Cell Range Picker
Window & m_rWindow;
bool m_bInRefMode;
+
public:
operator Window *(){ return &m_rWindow; }
Window * operator ->() { return static_cast<Window *>(*this); }
template<class,bool> friend class ScRefHdlrImplBase;
-//-->Added by PengYunQuan for Validity Cell Range Picker
friend class formula::RefButton;
friend class formula::RefEdit;
@@ -156,7 +146,7 @@ protected:
//virtual long PreNotify( NotifyEvent& rNEvt );
virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
- virtual void RefInputDone( sal_Bool bForced = sal_False );
+ virtual void RefInputDone( sal_Bool bForced = false );
void ShowSimpleReference( const XubString& rStr );
void ShowFormulaReference( const XubString& rStr );
@@ -189,18 +179,15 @@ public:
//Overwrite TWindow will implemented by ScRefHdlrImplBase
//virtual void StateChanged( StateChangedType nStateChange );
-//<!--Added by PengYunQuan for Validity Cell Range Picker
public:
bool EnterRefMode();
bool LeaveRefMode();
- inline bool CanInputStart( const ScRefEdit *pEdit );
+ inline bool CanInputStart( const formula::RefEdit *pEdit );
inline bool CanInputDone( sal_Bool bForced );
-//-->Added by PengYunQuan for Validity Cell Range Picker
};
-
//============================================================================
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+
template< class TWindow, bool bBindRef = true >
class ScRefHdlrImplBase:public TWindow, public ScRefHandler
{
@@ -260,7 +247,7 @@ struct ScAnyRefDlg : ::ScRefHdlrImpl< ScAnyRefDlg, SfxModelessDialog>
};
//============================================================================
-inline bool ScRefHandler::CanInputStart( const ScRefEdit *pEdit )
+inline bool ScRefHandler::CanInputStart( const formula::RefEdit *pEdit )
{
return m_aHelper.CanInputStart( pEdit );
}
@@ -272,10 +259,9 @@ inline bool ScRefHandler::CanInputDone( sal_Bool bForced )
template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxModelessDialog,true>::StateChanged( StateChangedType nStateChange );
template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxModelessDialog,true>::PreNotify( NotifyEvent& rNEvt );
-#include <sfx2/tabdlg.hxx>
template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxTabDialog,false>::StateChanged( StateChangedType nStateChange );
template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxTabDialog,false>::PreNotify( NotifyEvent& rNEvt );
-//<!--Added by PengYunQuan for Validity Cell Range Picker
#endif // SC_ANYREFDG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/areasave.hxx b/sc/source/ui/inc/areasave.hxx
index 115a4f739363..c1a7eeb9aa65 100644
--- a/sc/source/ui/inc/areasave.hxx
+++ b/sc/source/ui/inc/areasave.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx
index 914e2917d2e0..fafd293a2a4b 100644
--- a/sc/source/ui/inc/areasdlg.hxx
+++ b/sc/source/ui/inc/areasdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,12 +31,8 @@
#include "address.hxx"
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <anyrefdg.hxx>
class ScDocument;
@@ -106,3 +103,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx
index a8bd1dfa81ee..7fb3c937538d 100644
--- a/sc/source/ui/inc/asciiopt.hxx
+++ b/sc/source/ui/inc/asciiopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,24 +32,12 @@
#define SC_ASCIIOPT_HXX
#include <tools/string.hxx>
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
#include <tools/stream.hxx>
#include <svx/txencbox.hxx>
#include "csvtablebox.hxx"
@@ -56,7 +45,7 @@
// ============================================================================
-class ScAsciiOptions
+class SC_DLLPUBLIC ScAsciiOptions
{
private:
sal_Bool bFixedLen;
@@ -118,94 +107,6 @@ public:
void SetColumnInfo( const ScCsvExpDataVec& rDataVec );
};
-
-//CHINA001 // ============================================================================
-//CHINA001
-//CHINA001 class ScImportAsciiDlg : public ModalDialog
-//CHINA001 {
-//CHINA001 SvStream* pDatStream;
-//CHINA001 sal_uLong* pRowPosArray;
-//CHINA001 sal_uLong* pRowPosArrayUnicode;
-//CHINA001 sal_uInt16 nArrayEndPos;
-//CHINA001 sal_uInt16 nArrayEndPosUnicode;
-//CHINA001 sal_uLong nStreamPos;
-//CHINA001 sal_uLong nStreamPosUnicode;
-//CHINA001 sal_Bool bVFlag;
-//CHINA001
-//CHINA001 FixedLine aFlFieldOpt;
-//CHINA001 FixedText aFtCharSet;
-//CHINA001 SvxTextEncodingBox aLbCharSet;
-//CHINA001
-//CHINA001 FixedText aFtRow;
-//CHINA001 NumericField aNfRow;
-//CHINA001
-//CHINA001 FixedLine aFlSepOpt;
-//CHINA001 RadioButton aRbFixed;
-//CHINA001 RadioButton aRbSeparated;
-//CHINA001
-//CHINA001 CheckBox aCkbTab;
-//CHINA001 CheckBox aCkbSemicolon;
-//CHINA001 CheckBox aCkbComma;
-//CHINA001 CheckBox aCkbSpace;
-//CHINA001 CheckBox aCkbOther;
-//CHINA001 Edit aEdOther;
-//CHINA001 CheckBox aCkbAsOnce;
-//CHINA001 FixedText aFtTextSep;
-//CHINA001 ComboBox aCbTextSep;
-//CHINA001
-//CHINA001 FixedLine aFlWidth;
-//CHINA001 FixedText aFtType;
-//CHINA001 ListBox aLbType;
-//CHINA001
-//CHINA001 ScCsvTableBox maTableBox;
-//CHINA001
-//CHINA001 OKButton aBtnOk;
-//CHINA001 CancelButton aBtnCancel;
-//CHINA001 HelpButton aBtnHelp;
-//CHINA001
-//CHINA001 String aCharSetUser;
-//CHINA001 String aColumnUser;
-//CHINA001 String aFldSepList;
-//CHINA001 String aTextSepList;
-//CHINA001
-//CHINA001 // aPreviewLine contains the byte string as read from the file
-//CHINA001 ByteString aPreviewLine[ CSV_PREVIEW_LINES ];
-//CHINA001 // same for Unicode
-//CHINA001 String aPreviewLineUnicode[ CSV_PREVIEW_LINES ];
-//CHINA001
-//CHINA001 CharSet meCharSet; /// Selected char set.
-//CHINA001 bool mbCharSetSystem; /// Is System char set selected?
-//CHINA001
-//CHINA001 public:
-//CHINA001 ScImportAsciiDlg(
-//CHINA001 Window* pParent, String aDatName,
-//CHINA001 SvStream* pInStream, sal_Unicode cSep = '\t' );
-//CHINA001 ~ScImportAsciiDlg();
-//CHINA001
-//CHINA001 void GetOptions( ScAsciiOptions& rOpt );
-//CHINA001
-//CHINA001 private:
-//CHINA001 /** Sets the selected char set data to meCharSet and mbCharSetSystem. */
-//CHINA001 void SetSelectedCharSet();
-//CHINA001 /** Returns all separator characters in a string. */
-//CHINA001 String GetSeparators() const;
-//CHINA001
-//CHINA001 /** Enables or disables all separator checkboxes and edit fields. */
-//CHINA001 void SetupSeparatorCtrls();
-//CHINA001
-//CHINA001 void UpdateVertical( bool bSwitchToFromUnicode = false );
-//CHINA001
-//CHINA001 DECL_LINK( CharSetHdl, SvxTextEncodingBox* );
-//CHINA001 DECL_LINK( FirstRowHdl, NumericField* );
-//CHINA001 DECL_LINK( RbSepFixHdl, RadioButton* );
-//CHINA001 DECL_LINK( SeparatorHdl, Control* );
-//CHINA001 DECL_LINK( LbColTypeHdl, ListBox* );
-//CHINA001 DECL_LINK( UpdateTextHdl, ScCsvTableBox* );
-//CHINA001 DECL_LINK( ColTypeHdl, ScCsvTableBox* );
-//CHINA001 };
-//CHINA001
-//CHINA001
-// ============================================================================
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/attrdlg.hrc b/sc/source/ui/inc/attrdlg.hrc
index f43c1cb30b86..d048e302f062 100644
--- a/sc/source/ui/inc/attrdlg.hrc
+++ b/sc/source/ui/inc/attrdlg.hrc
@@ -47,5 +47,3 @@
#define BTN_HIDE_PRINT 6
#define FT_HINT2 7
#define FL_PRINT 8
-
-
diff --git a/sc/source/ui/inc/attrdlg.hxx b/sc/source/ui/inc/attrdlg.hxx
index de95dfcdaa2c..8f1bae4260ff 100644
--- a/sc/source/ui/inc/attrdlg.hxx
+++ b/sc/source/ui/inc/attrdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,4 @@ private:
#endif // SC_ATTRDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/auditsh.hxx b/sc/source/ui/inc/auditsh.hxx
index d396857930f8..0d11a49f517d 100644
--- a/sc/source/ui/inc/auditsh.hxx
+++ b/sc/source/ui/inc/auditsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx
index 6ea0f6c7f358..408e5a892107 100644
--- a/sc/source/ui/inc/autofmt.hxx
+++ b/sc/source/ui/inc/autofmt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,24 +29,12 @@
#ifndef SC_AUTOFMT_HXX
#define SC_AUTOFMT_HXX
-#ifndef _VIRDEV_HXX //autogen
#include <vcl/virdev.hxx>
-#endif
-#ifndef SV_FIXED_HXX
#include <vcl/fixed.hxx>
-#endif
-#ifndef SV_LSTBOX_HXX
#include <vcl/lstbox.hxx>
-#endif
-#ifndef SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
-#ifndef SV_MOREBTN_HXX
#include <vcl/morebtn.hxx>
-#endif
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
#include <svtools/scriptedtext.hxx>
#include <svx/framelinkarray.hxx>
#include "scdllapi.h"
@@ -66,65 +55,6 @@ enum AutoFmtLine { TOP_LINE, BOTTOM_LINE, LEFT_LINE, RIGHT_LINE };
//========================================================================
-//CHINA001 class ScAutoFormatDlg : public ModalDialog
-//CHINA001 {
-//CHINA001 public:
-//CHINA001 ScAutoFormatDlg( Window* pParent,
-//CHINA001 ScAutoFormat* pAutoFormat,
-//CHINA001 const ScAutoFormatData* pSelFormatData,
-//CHINA001 ScDocument* pDoc );
-//CHINA001 ~ScAutoFormatDlg();
-//CHINA001
-//CHINA001 sal_uInt16 GetIndex() const { return nIndex; }
-//CHINA001 String GetCurrFormatName();
-//CHINA001
-//CHINA001 private:
-//CHINA001 FixedLine aFlFormat;
-//CHINA001 ListBox aLbFormat;
-//CHINA001 ScAutoFmtPreview* pWndPreview;
-//CHINA001 OKButton aBtnOk;
-//CHINA001 CancelButton aBtnCancel;
-//CHINA001 HelpButton aBtnHelp;
-//CHINA001 PushButton aBtnAdd;
-//CHINA001 PushButton aBtnRemove;
-//CHINA001 MoreButton aBtnMore;
-//CHINA001 FixedLine aFlFormatting;
-//CHINA001 CheckBox aBtnNumFormat;
-//CHINA001 CheckBox aBtnBorder;
-//CHINA001 CheckBox aBtnFont;
-//CHINA001 CheckBox aBtnPattern;
-//CHINA001 CheckBox aBtnAlignment;
-//CHINA001 CheckBox aBtnAdjust;
-//CHINA001 PushButton aBtnRename;
-//CHINA001 String aStrTitle;
-//CHINA001 String aStrLabel;
-//CHINA001 String aStrClose;
-//CHINA001 String aStrDelTitle;
-//CHINA001 String aStrDelMsg;
-//CHINA001 String aStrRename;
-//CHINA001
-//CHINA001 //------------------------
-//CHINA001 ScAutoFormat* pFormat;
-//CHINA001 const ScAutoFormatData* pSelFmtData;
-//CHINA001 sal_uInt16 nIndex;
-//CHINA001 sal_Bool bCoreDataChanged;
-//CHINA001 sal_Bool bFmtInserted;
-//CHINA001
-//CHINA001 void Init ();
-//CHINA001 void UpdateChecks ();
-//CHINA001 //------------------------
-//CHINA001 DECL_LINK( CheckHdl, Button * );
-//CHINA001 DECL_LINK( AddHdl, void * );
-//CHINA001 DECL_LINK( RemoveHdl, void * );
-//CHINA001 DECL_LINK( SelFmtHdl, void * );
-//CHINA001 DECL_LINK( CloseHdl, PushButton * );
-//CHINA001 DECL_LINK( DblClkHdl, void * );
-//CHINA001 DECL_LINK( RenameHdl, void *);
-//CHINA001
-//CHINA001 };
-//CHINA001
-//========================================================================
-
class SC_DLLPUBLIC ScAutoFmtPreview : public Window
{
public:
@@ -208,3 +138,4 @@ private:
#endif // SC_AUTOFMT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/autostyl.hxx b/sc/source/ui/inc/autostyl.hxx
index 3423876f0616..c45be3bb0a78 100644
--- a/sc/source/ui/inc/autostyl.hxx
+++ b/sc/source/ui/inc/autostyl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,22 +29,27 @@
#ifndef SC_AUTOSTYL_HXX
#define SC_AUTOSTYL_HXX
-#include <vcl/timer.hxx>
-#include <tools/list.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include <tools/string.hxx>
+#include <vcl/timer.hxx>
+
class ScDocShell;
class ScRange;
+class ScAutoStyleData;
+class ScAutoStyleInitData;
class ScAutoStyleList
{
private:
+
ScDocShell* pDocSh;
Timer aTimer;
Timer aInitTimer;
sal_uLong nTimerStart;
- List aEntries;
- List aInitials;
+ boost::ptr_vector<ScAutoStyleData> aEntries;
+ boost::ptr_vector<ScAutoStyleInitData> aInitials;
void ExecuteEntries();
void AdjustEntries(sal_uLong nDiff);
@@ -66,3 +72,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/cbutton.hxx b/sc/source/ui/inc/cbutton.hxx
index a6e37137f62c..dc588ebb02f8 100644
--- a/sc/source/ui/inc/cbutton.hxx
+++ b/sc/source/ui/inc/cbutton.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,15 +50,15 @@ public:
void Draw( const Point& rAt,
const Size& rSize,
sal_Bool bState,
- sal_Bool bBtnIn = sal_False );
+ sal_Bool bBtnIn = false );
void Draw( const Point& rAt,
sal_Bool bState,
- sal_Bool bBtnIn = sal_False )
+ sal_Bool bBtnIn = false )
{ Draw( rAt, aBtnSize, bState, bBtnIn ); }
void Draw( sal_Bool bState,
- sal_Bool bBtnIn = sal_False )
+ sal_Bool bBtnIn = false )
{ Draw( aBtnPos, aBtnSize, bState, bBtnIn ); }
void SetOptSizePixel();
@@ -82,3 +83,4 @@ protected:
#endif // SC_CBUTTON_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/cellmergeoption.hxx b/sc/source/ui/inc/cellmergeoption.hxx
new file mode 100644
index 000000000000..ad5fe34d41ca
--- /dev/null
+++ b/sc/source/ui/inc/cellmergeoption.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Kohei Yoshida <kyoshida@novell.com> ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef SC_CELLMERGEOPTION_HXX
+#define SC_CELLMERGEOPTION_HXX
+
+#include "address.hxx"
+
+#include <set>
+
+class ScRange;
+
+struct ScCellMergeOption
+{
+ ::std::set<SCTAB> maTabs;
+ SCCOL mnStartCol;
+ SCROW mnStartRow;
+ SCCOL mnEndCol;
+ SCROW mnEndRow;
+ bool mbCenter;
+
+ explicit ScCellMergeOption();
+ explicit ScCellMergeOption(const ScRange& rRange);
+ explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow,
+ SCCOL nEndCol, SCROW nEndRow,
+ bool bCenter = false);
+ explicit ScCellMergeOption(const ScCellMergeOption& r);
+
+ ScRange getSingleRange(SCTAB nTab) const;
+ ScRange getFirstSingleRange() const;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 113574297368..6bbdd8ab6e27 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <svx/svdmark.hxx>
#include <tools/link.hxx>
#include "formatsh.hxx"
+#include "address.hxx"
class SvxClipboardFmtItem;
class TransferableDataHelper;
@@ -64,6 +66,8 @@ private:
const String& _rFile, const String& _rFilter, const String& _rOptions,
const String& _rSource, sal_uLong _nRefresh, SfxRequest& _rRequest );
+ void ExecuteDataPilotDialog();
+
DECL_LINK( ClipboardChanged, TransferableDataHelper* );
DECL_LINK( DialogClosed, AbstractScLinkedAreaDlg* );
@@ -104,3 +108,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/chartsh.hxx b/sc/source/ui/inc/chartsh.hxx
index 95efd03f3b76..0e09211ce346 100644
--- a/sc/source/ui/inc/chartsh.hxx
+++ b/sc/source/ui/inc/chartsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/client.hxx b/sc/source/ui/inc/client.hxx
index 1b13ee224d77..ac39d6d386b5 100644
--- a/sc/source/ui/inc/client.hxx
+++ b/sc/source/ui/inc/client.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_CLIENT_HXX
#define SC_CLIENT_HXX
-#ifndef _SFX_CLIENTSH_HXX //autogen
#include <sfx2/ipclient.hxx>
-#endif
class ScDocument;
class ScTabViewShell;
@@ -62,3 +61,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/colrowba.hxx b/sc/source/ui/inc/colrowba.hxx
index 5616817b3679..fdc4b191972a 100644
--- a/sc/source/ui/inc/colrowba.hxx
+++ b/sc/source/ui/inc/colrowba.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,3 +109,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/condfrmt.hrc b/sc/source/ui/inc/condfrmt.hrc
index 06af0cd485ce..e1013438d219 100644
--- a/sc/source/ui/inc/condfrmt.hrc
+++ b/sc/source/ui/inc/condfrmt.hrc
@@ -76,4 +76,3 @@
#define BTN_COND1_NEW 34
#define BTN_COND2_NEW 35
#define BTN_COND3_NEW 36
-
diff --git a/sc/source/ui/inc/condfrmt.hxx b/sc/source/ui/inc/condfrmt.hxx
index c8963ef689ee..85d7b6e225da 100644
--- a/sc/source/ui/inc/condfrmt.hxx
+++ b/sc/source/ui/inc/condfrmt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -150,3 +151,4 @@ private:
#endif // SC_CONDFRMT_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/conflictsdlg.hxx b/sc/source/ui/inc/conflictsdlg.hxx
index 342de87f7bbe..5dcdd07d62fe 100644
--- a/sc/source/ui/inc/conflictsdlg.hxx
+++ b/sc/source/ui/inc/conflictsdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,7 +83,6 @@ private:
static void Transform_Impl( ScChangeActionList& rActionList, ScChangeActionMergeMap* pMergeMap );
public:
-//UNUSED2008-05 static bool HasSharedAction( ScConflictsList& rConflictsList, sal_uLong nSharedAction );
static bool HasOwnAction( ScConflictsList& rConflictsList, sal_uLong nOwnAction );
static ScConflictsListEntry* GetSharedActionEntry( ScConflictsList& rConflictsList, sal_uLong nSharedAction );
@@ -148,11 +148,8 @@ class ScConflictsListBox: public SvxRedlinTable
private:
public:
-//UNUSED2008-05 ScConflictsListBox( Window* pParent, WinBits nBits = WB_BORDER );
ScConflictsListBox( Window* pParent, const ResId& rResId );
~ScConflictsListBox();
-
-//UNUSED2008-05 sal_uLong GetRootEntryPos( const SvLBoxEntry* pRootEntry ) const;
};
//=============================================================================
@@ -214,3 +211,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx
index fc53a377420d..fa4fe9e41651 100644
--- a/sc/source/ui/inc/consdlg.hxx
+++ b/sc/source/ui/inc/consdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,10 @@
#ifndef SC_CONSDLG_HXX
#define SC_CONSDLG_HXX
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
#include "global.hxx"
#include "anyrefdg.hxx"
@@ -134,3 +127,4 @@ private:
#endif // SC_CONSDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 1e775345d42e..1de37c004126 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,7 +61,6 @@ class ScContentTree : public SvTreeListBox
{
ScNavigatorDlg* pParentWindow;
ImageList aEntryImages;
- ImageList aHCEntryImages;
SvLBoxEntry* pRootNodes[SC_CONTENT_COUNT];
sal_uInt16 nRootType; // als Root eingestellt
String aManualDoc; // im Navigator umgeschaltet (Title)
@@ -110,7 +110,6 @@ class ScContentTree : public SvTreeListBox
sal_uLong GetChildIndex( SvLBoxEntry* pEntry ) const;
void DoDrag();
-//UNUSED2008-05 void AdjustTitle();
ScDocument* GetSourceDocument();
@@ -167,3 +166,4 @@ public:
#endif // SC_NAVIPI_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/corodlg.hxx b/sc/source/ui/inc/corodlg.hxx
index 0d7d68913a61..87662e0f3da1 100644
--- a/sc/source/ui/inc/corodlg.hxx
+++ b/sc/source/ui/inc/corodlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,9 @@
#ifndef SC_CORODLG_HXX
#define SC_CORODLG_HXX
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include "sc.hrc"
#include "scresid.hxx"
@@ -47,8 +42,8 @@ class ScColRowLabelDlg : public ModalDialog
{
public:
ScColRowLabelDlg( Window* pParent,
- sal_Bool bCol = sal_False,
- sal_Bool bRow = sal_False )
+ sal_Bool bCol = false,
+ sal_Bool bRow = false )
: ModalDialog( pParent, ScResId( RID_SCDLG_CHARTCOLROW ) ),
aFlColRow ( this, ScResId(6) ),
aBtnRow ( this, ScResId(2) ),
@@ -79,3 +74,4 @@ private:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/crdlg.hxx b/sc/source/ui/inc/crdlg.hxx
index 6b920c31afa6..648544ee117f 100644
--- a/sc/source/ui/inc/crdlg.hxx
+++ b/sc/source/ui/inc/crdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,10 +33,7 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
-#include "scui_def.hxx" //CHINA001
-
-//CHINA001 #define SCRET_COLS 0x42
-//CHINA001 #define SCRET_ROWS 0x43
+#include "scui_def.hxx"
//------------------------------------------------------------------------
@@ -64,3 +62,4 @@ private:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/crnrdlg.hrc b/sc/source/ui/inc/crnrdlg.hrc
index 1d27531f9bc1..7467b398d5fb 100644
--- a/sc/source/ui/inc/crnrdlg.hrc
+++ b/sc/source/ui/inc/crnrdlg.hrc
@@ -32,9 +32,9 @@
#define BTN_ADD 3
#define BTN_REMOVE 4
#define BTN_HELP 5
-//
+
#define LB_RANGE 11
-//
+
#define FL_ASSIGN 12
#define ED_AREA 13
#define RB_AREA 14
@@ -43,4 +43,3 @@
#define ED_DATA 17
#define RB_DATA 18
#define FT_DATA_LABEL 19
-//
diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx
index cfb859b82895..7c5c58b9bc5d 100644
--- a/sc/source/ui/inc/crnrdlg.hxx
+++ b/sc/source/ui/inc/crnrdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
class ScViewData;
class ScDocument;
@@ -78,7 +79,7 @@ private:
ScRangePairListRef xColNameRanges;
ScRangePairListRef xRowNameRanges;
- typedef ::std::hash_map< String, ScRange, ScStringHashCode, ::std::equal_to<String> > NameRangeMap;
+ typedef ::boost::unordered_map< String, ScRange, ScStringHashCode, ::std::equal_to<String> > NameRangeMap;
NameRangeMap aRangeMap;
ScViewData* pViewData;
ScDocument* pDoc;
@@ -90,8 +91,8 @@ private:
void Init ();
void UpdateNames ();
void UpdateRangeData ( const ScRange& rRange, sal_Bool bColName );
- void SetColRowData( const ScRange& rLabelRange,sal_Bool bRef=sal_False);
- void AdjustColRowData( const ScRange& rDataRange,sal_Bool bRef=sal_False);
+ void SetColRowData( const ScRange& rLabelRange,sal_Bool bRef=false);
+ void AdjustColRowData( const ScRange& rDataRange,sal_Bool bRef=false);
DECL_LINK( CancelBtnHdl, void * );
DECL_LINK( OkBtnHdl, void * );
DECL_LINK( AddBtnHdl, void * );
@@ -110,3 +111,4 @@ private:
#endif // SC_CRNRDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index c38abfb83598..68a97150e8e4 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -430,3 +431,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx
index fb6d687533e6..acb21731528e 100644
--- a/sc/source/ui/inc/csvgrid.hxx
+++ b/sc/source/ui/inc/csvgrid.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,7 +105,7 @@ private:
VirtualDevice maGridDev; /// Data grid with selection and cursor.
PopupMenu maPopup; /// Popup menu for column types.
- ::svtools::ColorConfig& mrColorConfig; /// Application color configuration.
+ ::svtools::ColorConfig* mpColorConfig; /// Application color configuration.
Color maBackColor; /// Cell background color.
Color maGridColor; /// Table grid color.
Color maGridPBColor; /// Grid color for "first imported line" delimiter.
@@ -136,6 +137,9 @@ public:
explicit ScCsvGrid( ScCsvControl& rParent );
virtual ~ScCsvGrid();
+ /** Finishes initialization. Must be called after constructing a new object. */
+ void Init();
+
// common grid handling ---------------------------------------------------
public:
/** Updates layout data dependent from the control's state. */
@@ -356,3 +360,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx
index 0ae09022d3f7..c0c1f99cc5da 100644
--- a/sc/source/ui/inc/csvruler.hxx
+++ b/sc/source/ui/inc/csvruler.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -198,3 +199,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/csvsplits.hxx b/sc/source/ui/inc/csvsplits.hxx
index 4685269936d5..42d38bcca803 100644
--- a/sc/source/ui/inc/csvsplits.hxx
+++ b/sc/source/ui/inc/csvsplits.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,3 +102,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx
index 205e8b50cad1..22bb380e38c2 100644
--- a/sc/source/ui/inc/csvtablebox.hxx
+++ b/sc/source/ui/inc/csvtablebox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,9 +75,11 @@ private:
// ------------------------------------------------------------------------
public:
-//UNUSED2009-05 explicit ScCsvTableBox( Window* pParent );
explicit ScCsvTableBox( Window* pParent, const ResId& rResId );
+ /** Finishes initialization. Must be called after constructing a new object. */
+ void Init();
+
// common table box handling ----------------------------------------------
public:
/** Sets the control to separators mode. */
@@ -85,8 +88,6 @@ public:
void SetFixedWidthMode();
private:
- /** Initialisation on construction. */
- SC_DLLPRIVATE void Init();
/** Initializes the children controls (pos/size, scroll bars, ...). */
SC_DLLPRIVATE void InitControls();
/** Initializes size and position data of horizontal scrollbar. */
@@ -109,10 +110,6 @@ public:
void SetUniStrings(
const String* pTextLines, const String& rSepChars,
sal_Unicode cTextSep, bool bMergeSep );
-//UNUSED2009-05 /** Fills all cells of all lines with the passed texts (ByteStrings). */
-//UNUSED2009-05 void SetByteStrings(
-//UNUSED2009-05 const ByteString* pLineTexts, CharSet eCharSet,
-//UNUSED2009-05 const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep );
// column settings --------------------------------------------------------
public:
@@ -159,3 +156,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dapidata.hxx b/sc/source/ui/inc/dapidata.hxx
index 13d7e91bdceb..588ef43cf72a 100644
--- a/sc/source/ui/inc/dapidata.hxx
+++ b/sc/source/ui/inc/dapidata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_DAPIDATA_HXX
#define SC_DAPIDATA_HXX
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
@@ -70,3 +69,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx
index 4222bc0bfec6..54eefe20f520 100644
--- a/sc/source/ui/inc/dapitype.hxx
+++ b/sc/source/ui/inc/dapitype.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_DAPITYPE_HXX
#define SC_DAPITYPE_HXX
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/dialog.hxx>
#include <vcl/edit.hxx>
#include <vcl/fixed.hxx>
@@ -44,8 +43,10 @@ class ScDataPilotSourceTypeDlg : public ModalDialog
private:
FixedLine aFlFrame;
RadioButton aBtnSelection;
+ RadioButton aBtnNamedRange;
RadioButton aBtnDatabase;
RadioButton aBtnExternal;
+ ListBox aLbNamedRange;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
@@ -54,8 +55,14 @@ public:
ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bEnableExternal );
~ScDataPilotSourceTypeDlg();
- sal_Bool IsDatabase() const;
- sal_Bool IsExternal() const;
+ bool IsDatabase() const;
+ bool IsExternal() const;
+ bool IsNamedRange() const;
+ rtl::OUString GetSelectedNamedRange() const;
+ void AppendNamedRange(const rtl::OUString& rNames);
+
+private:
+ DECL_LINK( RadioClickHdl, RadioButton * );
};
@@ -93,3 +100,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/datafdlg.hrc b/sc/source/ui/inc/datafdlg.hrc
new file mode 100644
index 000000000000..2a8341da5482
--- /dev/null
+++ b/sc/source/ui/inc/datafdlg.hrc
@@ -0,0 +1,42 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "sc.hrc" // -> RID_SCDLG_DATAFORM
+
+//dataform
+#define BTN_DATAFORM_NEW 1
+#define BTN_DATAFORM_DELETE 2
+#define BTN_DATAFORM_RESTORE 3
+#define BTN_DATAFORM_LAST 4
+#define BTN_DATAFORM_NEXT 5
+#define BTN_DATAFORM_CLOSE 6
+#define WND_DATAFORM_SCROLLBAR 7
+#define LAB_DATAFORM_RECORDNO 8
+
+#define FT_DATAFORM_FIXEDTEXT1 9
+#define ED_DATAFORM_EDIT1 10
+
+#define STR_NEW_RECORD 11
diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
new file mode 100644
index 000000000000..5742e7ac8550
--- /dev/null
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef SC_DATAFDLG_HXX
+#define SC_DATAFDLG_HXX
+
+
+#ifndef _SV_DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+
+#ifndef _SV_BUTTON_HXX //autogen
+#include <vcl/imagebtn.hxx>
+#endif
+
+#ifndef _SV_FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+
+
+#include "global.hxx"
+
+#include <tabvwsh.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+
+#define MAX_DATAFORM_COLS 256
+#define MAX_DATAFORM_ROWS 32000
+#define CTRL_HEIGHT 22
+#define FIXED_WIDTH 60
+#define EDIT_WIDTH 140
+#define FIXED_LEFT 12
+#define EDIT_LEFT 78
+#define LINE_HEIGHT 30
+
+//zhangyun
+class ScDataFormDlg : public ModalDialog
+{
+private:
+
+ PushButton aBtnNew;
+ PushButton aBtnDelete;
+ PushButton aBtnRestore;
+ PushButton aBtnLast;
+ PushButton aBtnNext;
+ PushButton aBtnClose;
+ ScrollBar aSlider;
+ FixedText aFixedText;
+
+ ScTabViewShell* pTabViewShell;
+ ScDocument* pDoc;
+ sal_uInt16 aColLength;
+ SCROW aCurrentRow;
+ SCCOL nStartCol;
+ SCCOL nEndCol;
+ SCROW nStartRow;
+ SCROW nEndRow;
+ SCTAB nTab;
+ sal_Bool bNoSelection;
+
+ FixedText** pFixedTexts;
+ Edit** pEdits;
+
+public:
+ ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShell);
+ ~ScDataFormDlg();
+
+ void FillCtrls(SCROW nCurrentRow);
+private:
+
+ void SetButtonState();
+
+ // Handler:
+ DECL_LINK( Impl_NewHdl, PushButton* );
+ DECL_LINK( Impl_LastHdl, PushButton* );
+ DECL_LINK( Impl_NextHdl, PushButton* );
+
+ DECL_LINK( Impl_RestoreHdl, PushButton* );
+ DECL_LINK( Impl_DeleteHdl, PushButton* );
+ DECL_LINK( Impl_CloseHdl, PushButton* );
+
+ DECL_LINK( Impl_ScrollHdl, ScrollBar* );
+ DECL_LINK( Impl_DataModifyHdl, Edit* );
+};
+#endif // SC_DATAFDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dbdocfun.hxx b/sc/source/ui/inc/dbdocfun.hxx
index c443be157f8c..132eb9a3750b 100644
--- a/sc/source/ui/inc/dbdocfun.hxx
+++ b/sc/source/ui/inc/dbdocfun.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,7 +91,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::sdbc::XResultSet >& xResultSet,
const SbaSelectionList* pSelection, sal_Bool bRecord,
- sal_Bool bAddrInsert = sal_False );
+ sal_Bool bAddrInsert = false );
sal_Bool DoImportUno( const ScAddress& rPos,
const com::sun::star::uno::Sequence<
@@ -116,9 +117,11 @@ public:
sal_Bool RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi );
sal_Bool DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewObj,
- sal_Bool bRecord, sal_Bool bApi, sal_Bool bAllowMove = sal_False );
+ sal_Bool bRecord, sal_Bool bApi, sal_Bool bAllowMove = false );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index 46d12646f13f..823b4509fcc5 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,6 @@ private:
public:
ScDBFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
-//UNUSED2008-05 ScDBFunc( Window* pParent, const ScDBFunc& rDBFunc, ScTabViewShell* pViewShell );
virtual ~ScDBFunc();
// nur UISort wiederholt bei Bedarf die Teilergebnisse
@@ -77,19 +77,16 @@ public:
void GotoDBArea( const String& rDBName );
// DB-Bereich vom Cursor
- ScDBData* GetDBData( sal_Bool bMarkArea = sal_True, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP );
+ ScDBData* GetDBData( sal_Bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP, bool bShrinkToData = false, bool bExpandRows = false );
void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
void Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
bool MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest, sal_Bool bNewTable,
- const ScDPObject& rSource, sal_Bool bApi = sal_False );
+ const ScDPObject& rSource, sal_Bool bApi = false );
void DeletePivotTable();
- // Wang Xu Ming -- 2009-6-17
- // DataPilot Migration
- sal_uLong RecalcPivotTable();
- // End Comments
+ void RecalcPivotTable();
sal_Bool HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts );
sal_Bool HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo );
void GroupDataPilot();
@@ -125,7 +122,7 @@ public:
void HideMarkedOutlines( sal_Bool bRecord = sal_True );
sal_Bool OutlinePossible(sal_Bool bHide);
- void UpdateCharts(sal_Bool bAllCharts = sal_False); // Default: am Cursor
+ void UpdateCharts(sal_Bool bAllCharts = false); // Default: am Cursor
static sal_uInt16 DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts );
};
@@ -134,3 +131,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dbnamdlg.hrc b/sc/source/ui/inc/dbnamdlg.hrc
index fd0205e3bbed..ab3e51cbf1b2 100644
--- a/sc/source/ui/inc/dbnamdlg.hrc
+++ b/sc/source/ui/inc/dbnamdlg.hrc
@@ -48,4 +48,3 @@
#define STR_MODIFY 31
#define STR_DB_INVALID 32
#define BTN_MORE 33
-
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index 604a9b828984..a2df8f728379 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,11 @@
#ifndef SC_DBNAMDLG_HXX
#define SC_DBNAMDLG_HXX
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
#include "anyrefdg.hxx"
#include "dbcolect.hxx"
#include "expftext.hxx"
@@ -75,7 +70,7 @@ private:
CheckBox aBtnDoSize;
CheckBox aBtnKeepFmt;
CheckBox aBtnStripData;
- ScExpandedFixedText aFTSource; //@18.09.97 erweiterter FixedText
+ ScExpandedFixedText aFTSource;
FixedText aFTOperations;
OKButton aBtnOk;
@@ -125,3 +120,4 @@ private:
#endif // SC_DBNAMDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/delcldlg.hxx b/sc/source/ui/inc/delcldlg.hxx
index d3a07ffcc482..59cb84e5f3a7 100644
--- a/sc/source/ui/inc/delcldlg.hxx
+++ b/sc/source/ui/inc/delcldlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@ private:
public:
- ScDeleteCellDlg( Window* pParent, sal_Bool bDisallowCellMove = sal_False );
+ ScDeleteCellDlg( Window* pParent, sal_Bool bDisallowCellMove = false );
~ScDeleteCellDlg();
DelCellCmd GetDelCellCmd() const;
@@ -62,3 +63,4 @@ public:
#endif // SC_DELCLDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/delcodlg.hxx b/sc/source/ui/inc/delcodlg.hxx
index 7491dfab0e27..d7a203f75dea 100644
--- a/sc/source/ui/inc/delcodlg.hxx
+++ b/sc/source/ui/inc/delcodlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,4 @@ public:
#endif // SC_DELCODLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 7424f03e138d..0719b640072b 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,9 @@
#include "global.hxx"
#include "formula/grammar.hxx"
#include "tabbgcolor.hxx"
+#include "token.hxx"
+
+#include <vector>
class ScEditEngineDefaulter;
class SdrUndoAction;
@@ -40,20 +44,22 @@ class ScDocShell;
class ScMarkData;
class ScPatternAttr;
class ScRange;
+class ScRangeList;
class ScRangeName;
class ScBaseCell;
class ScTokenArray;
struct ScTabOpParam;
class ScTableProtection;
+struct ScCellMergeOption;
// ---------------------------------------------------------------------------
class ScDocFunc
{
private:
- ScDocShell& rDocShell;
+ ScDocShell& rDocShell;
- sal_Bool AdjustRowHeight( const ScRange& rRange, sal_Bool bPaint = sal_True );
+ sal_Bool AdjustRowHeight( const ScRange& rRange, sal_Bool bPaint = true );
void CreateOneName( ScRangeName& rList,
SCCOL nPosX, SCROW nPosY, SCTAB nTab,
SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
@@ -73,7 +79,9 @@ public:
sal_Bool DetectiveAddError(const ScAddress& rPos);
sal_Bool DetectiveMarkInvalid(SCTAB nTab);
sal_Bool DetectiveDelAll(SCTAB nTab);
- sal_Bool DetectiveRefresh(sal_Bool bAutomatic = sal_False);
+ sal_Bool DetectiveRefresh(sal_Bool bAutomatic = false);
+ void DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, ::std::vector<ScTokenRef>& rRefTokens);
+ void DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, ::std::vector<ScTokenRef>& rRefTokens);
sal_Bool DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
sal_Bool bRecord, sal_Bool bApi );
@@ -92,8 +100,7 @@ public:
// creates a new cell for use with PutCell
ScBaseCell* InterpretEnglishString( const ScAddress& rPos, const String& rText,
- const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar,
- short* pRetFormatType = NULL );
+ const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar );
bool ShowNote( const ScAddress& rPos, bool bShow = true );
inline bool HideNote( const ScAddress& rPos ) { return ShowNote( rPos, false ); }
@@ -108,7 +115,7 @@ public:
sal_Bool InsertCells( const ScRange& rRange,const ScMarkData* pTabMark,
InsCellCmd eCmd, sal_Bool bRecord, sal_Bool bApi,
- sal_Bool bPartOfPaste = sal_False );
+ sal_Bool bPartOfPaste = false );
sal_Bool DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
DelCellCmd eCmd, sal_Bool bRecord, sal_Bool bApi );
@@ -126,9 +133,7 @@ public:
sal_Bool SetLayoutRTL( SCTAB nTab, sal_Bool bRTL, sal_Bool bApi );
-//UNUSED2009-05 sal_Bool SetGrammar( formula::FormulaGrammar::Grammar eGrammar );
-
- SC_DLLPUBLIC sal_Bool SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges,
+ SC_DLLPUBLIC sal_Bool SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges,
SCTAB nTab, ScSizeMode eMode, sal_uInt16 nSizeTwips,
sal_Bool bRecord, sal_Bool bApi );
@@ -159,21 +164,24 @@ public:
sal_Bool FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, sal_Bool bRecord, sal_Bool bApi );
sal_Bool FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
- FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd,
+ FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd,
double fStart, double fStep, double fMax,
sal_Bool bRecord, sal_Bool bApi );
// FillAuto: rRange wird von Source-Range auf Dest-Range angepasst
+ SC_DLLPUBLIC sal_Bool FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, sal_uLong nCount, double fStep, double fMax, sal_Bool bRecord, sal_Bool bApi );
+
sal_Bool FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, sal_uLong nCount, sal_Bool bRecord, sal_Bool bApi );
sal_Bool ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, sal_Bool bApi );
- sal_Bool MergeCells( const ScRange& rRange, sal_Bool bContents,
+ sal_Bool MergeCells( const ScCellMergeOption& rOption, sal_Bool bContents,
sal_Bool bRecord, sal_Bool bApi );
sal_Bool UnmergeCells( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi );
+ bool UnmergeCells( const ScCellMergeOption& rOption, sal_Bool bRecord, sal_Bool bApi );
- sal_Bool SetNewRangeNames( ScRangeName* pNewRanges, sal_Bool bApi ); // takes ownership of pNewRanges
- sal_Bool ModifyRangeNames( const ScRangeName& rNewRanges, sal_Bool bApi );
+ bool SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc = true ); // takes ownership of pNewRanges
+ bool ModifyRangeNames( const ScRangeName& rNewRanges );
sal_Bool CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_Bool bApi );
sal_Bool InsertNameList( const ScAddress& rStartPos, sal_Bool bApi );
@@ -188,3 +196,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 194f7c7d2a76..4f3cefbd68a6 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,8 +41,12 @@
#include "document.hxx"
#include "shellids.hxx"
#include "refreshtimer.hxx"
+#include "optutil.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+#include <sot/sotref.hxx>
class ScEditEngineDefaulter;
class FontList;
@@ -67,11 +72,13 @@ class ScImportOptions;
class ScDocShellModificator;
class ScOptSolverSave;
class ScSheetSaveData;
+class ScFlatBoolRowSegments;
+struct ScColWidthParam;
namespace sfx2 { class FileDialogHelper; }
struct DocShell_Impl;
-typedef ::std::hash_map< sal_uLong, sal_uLong > ScChangeActionMergeMap;
+typedef ::boost::unordered_map< sal_uLong, sal_uLong > ScChangeActionMergeMap;
//==================================================================
@@ -84,8 +91,8 @@ typedef ::std::hash_map< sal_uLong, sal_uLong > ScChangeActionMergeMap;
class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
{
- static const sal_Char __FAR_DATA pStarCalcDoc[];
- static const sal_Char __FAR_DATA pStyleName[];
+ static const sal_Char pStarCalcDoc[];
+ static const sal_Char pStyleName[];
ScDocument aDocument;
@@ -147,7 +154,7 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
SC_DLLPRIVATE SCTAB GetSaveTab();
SC_DLLPRIVATE sal_uLong DBaseImport( const String& rFullFileName, CharSet eCharSet,
- sal_Bool bSimpleColWidth[MAXCOLCOUNT] );
+ ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc );
SC_DLLPRIVATE sal_uLong DBaseExport( const String& rFullFileName, CharSet eCharSet,
sal_Bool& bHasMemo );
@@ -196,7 +203,7 @@ public:
String * pFullTypeName,
String * pShortTypeName,
sal_Int32 nFileFormat,
- sal_Bool bTemplate = sal_False ) const;
+ sal_Bool bTemplate = false ) const;
virtual sal_Bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
virtual sal_Bool Load( SfxMedium& rMedium );
@@ -205,7 +212,7 @@ public:
virtual sal_Bool Save();
virtual sal_Bool SaveAs( SfxMedium& rMedium );
virtual sal_Bool ConvertTo( SfxMedium &rMedium );
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false );
virtual void PrepareReload();
virtual sal_Bool IsInformationLost();
virtual void LoadStyles( SfxObjectShell &rSource );
@@ -270,7 +277,7 @@ public:
/// If bJustQueryIfProtected==sal_True protection is not
/// changed and <TRUE/> is returned if not protected or
/// password was entered correctly.
- sal_Bool ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = sal_False );
+ sal_Bool ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = false );
void SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages );
sal_Bool AdjustPrintZoom( const ScRange& rRange );
@@ -298,12 +305,16 @@ public:
ScMarkData& rMark, sal_Bool bRecord = sal_True );
void ModifyScenario( SCTAB nTab, const String& rName, const String& rComment,
const Color& rColor, sal_uInt16 nFlags );
+ sal_uLong TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
+ SCTAB nDestPos, sal_Bool bInsertNew,
+ sal_Bool bNotifyAndPaint );
+
sal_Bool MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord );
void DoRecalc( sal_Bool bApi );
void DoHardRecalc( sal_Bool bApi );
- void UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize = sal_False);
+ void UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize = false);
sal_Bool IsOle();
void DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
@@ -311,9 +322,12 @@ public:
ScDBData* GetOldAutoDBRange(); // has to be deleted by caller!
void CancelAutoDBRange(); // called when dialog is cancelled
+ virtual void ReconnectDdeLink(SfxObjectShell& rServer);
void UpdateLinks(); // Link-Eintraege aktuallisieren
sal_Bool ReloadTabLinks(); // Links ausfuehren (Inhalt aktualisieren)
+ virtual void CheckConfigOptions();
+
void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
void PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
@@ -410,11 +424,11 @@ public:
const ScOptSolverSave* GetSolverSaveData() const { return pSolverSaveData; } // may be null
void SetSolverSaveData( const ScOptSolverSave& rData );
- //<!--Added by PengYunQuan for Validity Cell Range Picker
sal_Bool AcceptStateUpdate() const;
- //-->Added by PengYunQuan for Validity Cell Range Picker
ScSheetSaveData* GetSheetSaveData();
+ void ResetKeyBindings( ScOptionsUtil::KeyBindingType eType );
+
// passwword protection for Calc (derived from SfxObjectShell)
// see also: FID_CHG_RECORD, SID_CHG_PROTECT
virtual bool IsChangeRecording() const;
@@ -461,3 +475,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx
index c3da78d9b91a..ec868b9e8ba0 100644
--- a/sc/source/ui/inc/dpcontrol.hxx
+++ b/sc/source/ui/inc/dpcontrol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
#include <boost/shared_ptr.hpp>
#include <memory>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
namespace com { namespace sun { namespace star {
@@ -281,7 +282,7 @@ public:
const Size& getWindowSize() const;
- void getResult(::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rResult);
+ void getResult(::boost::unordered_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rResult);
void close(bool bOK);
/**
@@ -361,3 +362,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dpgroupdlg.hxx b/sc/source/ui/inc/dpgroupdlg.hxx
index 52f2e7c8f592..7a1770ab6844 100644
--- a/sc/source/ui/inc/dpgroupdlg.hxx
+++ b/sc/source/ui/inc/dpgroupdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,9 @@
#ifndef SC_DPGROUPDLG_HXX
#define SC_DPGROUPDLG_HXX
-#ifndef _FIXED_HXX
#include <vcl/fixed.hxx>
-#endif
-#ifndef _DIALOG_HXX
#include <vcl/dialog.hxx>
-#endif
-#ifndef _BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/field.hxx>
#include <svx/checklbx.hxx>
#include "editfield.hxx"
@@ -170,3 +165,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index 433d46100de9..17296dcbce10 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <svx/svdmark.hxx>
#include <tools/link.hxx>
-class AbstractSvxNameDialog; //CHINA001 class SvxNameDialog;
+class AbstractSvxNameDialog;
class ScViewData;
class ScDrawView;
@@ -44,9 +45,7 @@ class ScDrawShell : public SfxShell
DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk );
-#endif
protected:
ScViewData* GetViewData() { return pViewData; }
@@ -92,3 +91,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/drawutil.hxx b/sc/source/ui/inc/drawutil.hxx
index 67e1c0ba836f..d6bd314e4ef7 100644
--- a/sc/source/ui/inc/drawutil.hxx
+++ b/sc/source/ui/inc/drawutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index 7112fbacddf9..ca3eb42e208a 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,15 +42,14 @@ class ScDrawObjData;
class ScDrawView: public FmFormView
{
ScViewData* pViewData;
- OutputDevice* pDev; //! noetig ?
+ OutputDevice* pDev; //! needed ?
ScDocument* pDoc;
SCTAB nTab;
- Fraction aScaleX; // Faktor fuer Drawing-MapMode
+ Fraction aScaleX; // Factor for Drawing-MapMode
Fraction aScaleY;
SdrDropMarkerOverlay* pDropMarker;
SdrObject* pDropMarkObj;
sal_Bool bInConstruct;
- //HMHBOOL bDisableHdl;
void Construct();
void UpdateBrowser();
@@ -75,12 +75,8 @@ public:
virtual void DeleteMarked();
- void DrawMarks( OutputDevice* pOut ) const;
-
void MarkDropObj( SdrObject* pObj );
- //HMHBOOL IsDisableHdl() const { return bDisableHdl; }
-
void SetMarkedToLayer( sal_uInt8 nLayerNo );
void InvalidateAttribs();
@@ -97,8 +93,9 @@ public:
void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
- void SetAnchor( ScAnchorType );
- ScAnchorType GetAnchor() const;
+ void SetPageAnchored();
+ void SetCellAnchored();
+ ScAnchorType GetAnchorType() const;
void VCAddWin( Window* pWin );
void VCRemoveWin( Window* pWin );
@@ -111,11 +108,10 @@ public:
void SetMarkedOriginalSize();
sal_Bool SelectObject( const String& rName );
-//UNUSED2008-05 String GetSelectedChartName() const;
bool HasMarkedControl() const;
bool HasMarkedInternal() const;
- FASTBOOL InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
+ bool InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
/** Returns the selected object, if it is the caption object of a cell note.
@param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */
@@ -139,8 +135,7 @@ public:
/** Unlocks the internal layer that contains caption objects of cell notes. */
inline void UnlockInternalLayer() { LockInternalLayer( false ); }
- SdrEndTextEditKind ScEndTextEdit(); // ruft SetDrawTextUndo(0)
-//UNUSED2009-05 void CaptionTextDirection(sal_uInt16 nSlot);
+ SdrEndTextEditKind ScEndTextEdit(); // calls SetDrawTextUndo(0)
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
};
@@ -149,3 +144,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/drformsh.hxx b/sc/source/ui/inc/drformsh.hxx
index 7f7473eb7519..ec32afef4d62 100644
--- a/sc/source/ui/inc/drformsh.hxx
+++ b/sc/source/ui/inc/drformsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/drtxtob.hxx b/sc/source/ui/inc/drtxtob.hxx
index 332d28b89c9f..ae6be419b942 100644
--- a/sc/source/ui/inc/drtxtob.hxx
+++ b/sc/source/ui/inc/drtxtob.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
#ifndef SC_DRTXTOB_HXX
#define SC_DRTXTOB_HXX
-#ifndef _SFX_HXX
-#endif
-
#include <sfx2/shell.hxx>
#include <sfx2/module.hxx>
#include <tools/link.hxx>
@@ -87,3 +85,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx
index 22168c670a56..c1194f9bd5cc 100644
--- a/sc/source/ui/inc/drwtrans.hxx
+++ b/sc/source/ui/inc/drwtrans.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,8 +53,6 @@ private:
SdrModel* pModel;
TransferableDataHelper aOleData;
TransferableObjectDescriptor aObjDesc;
-//REMOVE SvEmbeddedObjectRef aDocShellRef;
-//REMOVE SvEmbeddedObjectRef aDrawPersistRef;
SfxObjectShellRef aDocShellRef;
SfxObjectShellRef aDrawPersistRef;
@@ -75,7 +74,6 @@ private:
void InitDocShell();
-//REMOVE SvInPlaceObjectRef GetSingleObject();
SdrOle2Obj* GetSingleObject();
public:
@@ -114,3 +112,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index f308c2815113..85387e5c11ae 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,25 +33,16 @@
#include <svl/lstner.hxx>
#include <svtools/stdctrl.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
-#include <vcl/button.hxx>
-#endif
+#include <vcl/imagebtn.hxx>
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
#include "anyrefdg.hxx"
#include "global.hxx" // ScAddress
#include "privsplt.hxx"
#include "funcdesc.hxx"
-#ifndef LRU_MAX
-#define LRU_MAX 10
-#endif
/*************************************************************************
|*
|* Ableitung vom SfxChildWindow als "Behaelter" fuer Controller
@@ -101,7 +93,7 @@ private:
String** pArgArr;
- const ScFuncDesc* aLRUList[LRU_MAX];
+ ::std::vector< const formula::IFunctionDescription*> aLRUList;
void UpdateFunctionList();
void UpdateLRUList();
@@ -156,3 +148,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/editable.hxx b/sc/source/ui/inc/editable.hxx
index d2f7487edef2..7e0e0472da65 100644
--- a/sc/source/ui/inc/editable.hxx
+++ b/sc/source/ui/inc/editable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/editfield.hxx b/sc/source/ui/inc/editfield.hxx
index 9836e94aa215..bfae24f4fd9f 100644
--- a/sc/source/ui/inc/editfield.hxx
+++ b/sc/source/ui/inc/editfield.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx
index 3c1792c3333b..bd6b75ae2ede 100644
--- a/sc/source/ui/inc/editsh.hxx
+++ b/sc/source/ui/inc/editsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/expftext.hxx b/sc/source/ui/inc/expftext.hxx
index 170deba5b403..e0d7717037fe 100644
--- a/sc/source/ui/inc/expftext.hxx
+++ b/sc/source/ui/inc/expftext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,5 @@ class SC_DLLPUBLIC ScExpandedFixedText: public FixedText
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 65dd07d19e8a..e9aaee89604a 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,18 +31,14 @@
#include <utility>
#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <cppuhelper/weakref.hxx>
-#include <rtl/ref.hxx>
+#include "address.hxx"
+#include "dpglobal.hxx"
#include <vcl/ctrl.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/scrbar.hxx>
+#include <cppuhelper/weakref.hxx>
-#include "address.hxx"
-#include "pivot.hxx"
-
-// ============================================================================
-
-class ScPivotLayoutDlg;
+class ScDPLayoutDlg;
class ScAccessibleDataPilotControl;
const size_t PIVOTFIELD_INVALID = static_cast< size_t >( -1 );
@@ -72,181 +69,340 @@ typedef ::std::pair< const ScPivotFuncData*, size_t > ScPivotFuncDataEntry;
// ============================================================================
-/** Represents a field area in the pivot table layout dialog. */
-class ScPivotFieldWindow : public Control
+/**
+ * Represents a field area in the DataPilot layout dialog. This base class
+ * handles storage of field names and the accessibility object.
+ */
+class ScDPFieldControlBase : public Control
{
+protected:
+ typedef ::std::pair<String, bool> FieldName; // true = text fits into button
+ typedef ::std::vector<FieldName> FieldNames;
+
public:
- ScPivotFieldWindow(
- ScPivotLayoutDlg* pDialog,
- const ResId& rResId,
- ScrollBar& rScrollBar,
- FixedText* pFtCaption,
- const ::rtl::OUString& rName,
- ScPivotFieldType eFieldType,
- const sal_Char* pcHelpId,
- PointerStyle eDropPointer,
- size_t nColCount,
- size_t nRowCount,
- long nFieldWidthFactor,
- long nSpaceSize );
-
- virtual ~ScPivotFieldWindow();
-
- /** Initializes this field window from the passed label data (used for selection window). */
- void ReadDataLabels( const ScDPLabelDataVector& rLabels );
- /** Initializes this field window from the passed field data (used for row/col/page/data window). */
- void ReadPivotFields( const ScPivotFieldVector& rPivotFields );
-
- /** Fills the passed vector with the plain names of all fields from this field window. */
- void WriteFieldNames( ScDPNameVec& rFieldNames ) const;
- /** Fills the passed pivot field vector with the fields of this field window. */
- void WritePivotFields( ScPivotFieldVector& rPivotFields ) const;
-
- /** Returns the type of this field window. */
- inline ScPivotFieldType GetType() const { return meFieldType; }
- /** Returns the mouse pointer style for tracking over this window. */
- inline PointerStyle GetDropPointerStyle() const { return meDropPointer; }
- /** Returns the name of the control without shortcut. */
- inline ::rtl::OUString GetName() const { return maName; }
- /** Returns the description of the control which is used for the accessibility objects. */
- ::rtl::OUString GetDescription() const;
-
- /** Returns true, if the window is empty. */
- inline bool IsEmpty() const { return maFields.empty(); }
- /** Returns the number of existing fields. */
- inline size_t GetFieldCount() const { return maFields.size(); }
+
+ /**
+ * Custom scroll bar to pass the command event to its parent window.
+ * We need this to pass the mouse wheel events to its parent field
+ * control to have mouse wheel events appaer to be properly handled by the
+ * scroll bar.
+ */
+ class ScrollBar : public ::ScrollBar
+ {
+ public:
+ ScrollBar(Window* pParent, WinBits nStyle);
+ virtual void Command( const CommandEvent& rCEvt );
+ private:
+ Window* mpParent;
+ };
+
+ ScDPFieldControlBase(
+ ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption );
+ virtual ~ScDPFieldControlBase();
+
+ virtual void CalcSize() = 0;
+
+ virtual bool IsValidIndex( size_t nIndex ) const = 0;
+ /** @return The pixel position of a field (without bound check). */
+ virtual Point GetFieldPosition( size_t nIndex ) = 0;
+ /** Calculates the field index at a specific pixel position.
+ @param rnIndex The index of the field is returned here.
+ @return TRUE, if the index value is valid. */
+ virtual bool GetFieldIndex( const Point& rPos, size_t& rnIndex ) = 0;
+ /** @return The pixel size of a field. */
+ virtual Size GetFieldSize() const = 0;
+
+ /** @return The description of the control which is used for the accessibility objects. */
+ virtual String GetDescription() const = 0;
+ /** @return The type of the FieldWindow. */
+ virtual ScDPFieldType GetFieldType() const = 0;
+ virtual void ScrollToShowSelection() = 0;
+ virtual void ScrollToEnd() = 0;
+ virtual void ResetScrollBar() = 0;
+ virtual void HandleWheelScroll(long nNotch) = 0;
+
+ /** Reads the FixedText's text with mnemonic and hides the FixedText. */
+ void UseMnemonic();
+
+ /** @return The name of the control without shortcut. */
+ ::rtl::OUString GetName() const;
+ void SetName(const ::rtl::OUString& rName);
+
+ /** @return TRUE, if the field with the given index exists. */
+ bool IsExistingIndex( size_t nIndex ) const;
+
+ /** Inserts a field to the specified index. */
+ void AddField( const String& rText, size_t nNewIndex );
+
+ /** Inserts a field using the specified pixel position.
+ @param rPos The coordinates to insert the field.
+ @param rnIndex The new index of the field is returned here.
+ @return true, if the field has been created. */
+ bool AddField( const String& rText, const Point& rPos, size_t& rnIndex );
+
+ bool AppendField(const String& rText, size_t& rnIndex);
+
+ /** Removes a field from the specified index. */
+ void DelField( size_t nDelIndex );
+
+ /** @return The count of existing fields. */
+ size_t GetFieldCount() const;
+
+ bool IsEmpty() const;
+
+ /** Removes all fields. */
+ void ClearFields();
+ /** Changes the text on an existing field. */
+ void SetFieldText( const String& rText, size_t nIndex );
/** Returns the text of an existing field. */
- ::rtl::OUString GetFieldText( size_t nFieldIndex ) const;
-
- /** Returns the index of a field with the specified column identifier. */
- ScPivotFuncDataEntry FindFuncDataByCol( SCCOL nCol ) const;
-
- /** Returns the pixel size of a field. */
- inline const Size& GetFieldSize() const { return maFieldSize; }
- /** Returns the pixel position of a field (without bound check). */
- Point GetFieldPosition( size_t nFieldIndex ) const;
- /** Calculates the field index at a specific pixel position. */
- size_t GetFieldIndex( const Point& rWindowPos ) const;
- /** Calculates the field insertion index for mouse drop at a specific pixel position. */
- size_t GetDropIndex( const Point& rWindowPos ) const;
-
- /** Returns the index of the selected field. */
- inline size_t GetSelectedIndex() const { return mnSelectIndex; }
- /** Grabs focus and sets the passed selection. */
- void GrabFocusAndSelect( size_t nIndex );
- /** Selects the next field. */
- void SelectNextField();
-
- /** Inserts a new field in front of the specified field. */
- void InsertField( size_t nInsertIndex, const ScPivotFuncData& rFuncData );
- /** Removes the specified field. */
- bool RemoveField( size_t nRemoveIndex );
- /** Moves the specified field to a new position. */
- bool MoveField( size_t nFieldIndex, size_t nInsertIndex );
-
- /** Returns the selected field (pointer is valid as long as field vector is not changed). */
- const ScPivotFuncData* GetSelectedFuncData() const;
- /** Removes the selected field. */
- void ModifySelectedField( const ScPivotFuncData& rFuncData );
- /** Removes the selected field. */
- bool RemoveSelectedField();
- /** Moves the selected field in front of the specified field. */
- bool MoveSelectedField( size_t nInsertIndex );
-
- /** Called from dialog when tracking starts in this field window. */
- void NotifyStartTracking();
- /** Called from dialog while tracking in this field window. */
- void NotifyTracking( const Point& rWindowPos );
- /** Called from dialog when tracking ends in this field window. */
- void NotifyEndTracking( ScPivotFieldEndTracking eEndType );
+ const String& GetFieldText( size_t nIndex ) const;
+
+ /** Calculates a field index at a specific pixel position. Returns in every
+ case the index of an existing field.
+ @param rnIndex The index of the field is returned here.
+ @return TRUE, if the index value is valid. */
+ void GetExistingIndex( const Point& rPos, size_t& rnIndex );
+
+ size_t GetSelectedField() const;
+ void SetSelectedField(size_t nSelected);
+
+ /** Notifies this control that the offset of the first field has been changed.
+ The control has to adjust the selection to keep the same field selected
+ on scrolling with scrollbar. */
+ void ModifySelectionOffset( long nOffsetDiff );
+ /** Selects the next field. Called i.e. after moving a field from SELECT area. */
+ void SelectNext();
+ /** Grabs focus and sets new selection. */
+ void GrabFocusWithSel( size_t nIndex );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
protected:
- virtual void Paint( const Rectangle& rRect );
- virtual void StateChanged( StateChangedType nStateChange );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void GetFocus();
- virtual void LoseFocus();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- CreateAccessible();
+ FieldNames& GetFieldNames();
+ const FieldNames& GetFieldNames() const;
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ void FieldFocusChanged(size_t nOldSelected, size_t nFieldSelected);
+ void AccessibleSetFocus(bool bOn);
+
+ /** Updates the tab stop style bits. */
+ void UpdateStyle();
+
+ /** Draws the background. */
+ void DrawBackground( OutputDevice& rDev );
+
+ /** Draws a field into the specified rectangle. */
+ void DrawField(
+ OutputDevice& rDev, const Rectangle& rRect, FieldName& rText, bool bFocus );
+
+ ScDPLayoutDlg* GetParentDlg() const;
+
+ void AppendPaintable(Window* p);
+ void DrawPaintables();
+ void DrawInvertSelection();
+
+ /** @return The new selection index after moving to the given direction. */
+ virtual size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const = 0;
+
+ /**
+ * @param nIndex logical index of a field name, independent of scroll
+ * offsets.
+ * @return Display position of the button. The first displayed button is
+ * always 0 no matter what the current scroll offset is. In case
+ * the field specified by the index is outside the visible range,
+ * <code>INVALID_INDEX</code> is returned.
+ */
+ virtual size_t GetDisplayPosition(size_t nIndex) const = 0;
+
+ /** Draws the complete control. */
+ virtual void Redraw() = 0;
private:
- /** A structure containing all data needed for a field in this window. */
- struct ScPivotWindowField
- {
- ScPivotFuncData maFuncData; /// Field data from source pivot table.
- ::rtl::OUString maFieldName; /// Name displayed on the field button.
- bool mbClipped; /// True = field text does not fit into button.
- explicit ScPivotWindowField( const ScDPLabelData& rLabelData );
- explicit ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotField& rField, bool bDataWindow );
- explicit ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotFuncData& rFuncData, bool bDataWindow );
- void InitFieldName( ScPivotLayoutDlg& rDialog, bool bDataWindow );
- };
+ /** @return TRUE, if the field with the given index exists and the text is
+ too long for the button control. */
+ bool IsShortenedText( size_t nIndex ) const;
+
+ /** Moves the selected field to nDestIndex. */
+ void MoveField( size_t nDestIndex );
+ /** Moves the selected field to the given direction. */
+ void MoveFieldRel( SCsCOL nDX, SCsROW nDY );
+
+ /** Sets selection to the field with index nIndex. */
+ void SetSelection( size_t nIndex );
+ /** Sets selection to first field. */
+ void SetSelectionHome();
+ /** Sets selection to last field. */
+ void SetSelectionEnd();
+ /** Sets selection to new position relative to current. */
+ void MoveSelection( SCsCOL nDX, SCsROW nDY );
- /** Specifies how the selection cursor can move in the window. */
- enum MoveType { PREV_FIELD, NEXT_FIELD, PREV_LINE, NEXT_LINE, PREV_PAGE, NEXT_PAGE, FIRST_FIELD, LAST_FIELD };
+private:
+ typedef ::std::vector<Window*> Paintables;
+ Paintables maPaintables;
- /** Calculates a scroll position to make the passed field visible. Tries to
- stick to current scroll position if possible. */
- size_t RecalcVisibleIndex( size_t nSelectIndex ) const;
+ FieldNames maFieldNames; /// String array of the field names and flags, if text fits into button.
+ ScDPLayoutDlg* mpDlg;
+ FixedText* mpCaption; /// FixedText containing the name of the control.
+ ::rtl::OUString maName;
- /** Sets selection to the specified field and changes scrolling position. */
- void SetSelectionUnchecked( size_t nSelectIndex, size_t nFirstVisIndex );
- /** Selects a field and adjusts scrolling position to make the field visible. */
- void MoveSelection( size_t nSelectIndex );
- /** Sets selection to a new position relative to current. */
- void MoveSelection( MoveType eMoveType );
- /** Moves the selected field to a new position relative to current. */
- void MoveSelectedField( MoveType eMoveType );
+ size_t mnFieldSelected; /// Currently selected field.
- /** Inserts the passed field into the vector and notifies accessibility object. */
- void InsertFieldUnchecked( size_t nInsertIndex, const ScPivotWindowField& rField );
- /** Removes the specified field from the vector and notifies accessibility object. */
- void RemoveFieldUnchecked( size_t nRemoveIndex );
+ com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAccessible;
+ ScAccessibleDataPilotControl* pAccessible;
+};
- /** Draws the background. */
- void DrawBackground( OutputDevice& rDev );
- /** Draws the specified field. */
- void DrawField( OutputDevice& rDev, size_t nFieldIndex );
- /** Draws the insertion cursor. */
- void DrawInsertionCursor( OutputDevice& rDev );
+// ============================================================================
+
+/**
+ * Base class for field control with a horizontal scroll bar at the bottom.
+ * Page, column, data and select fields are derived from this class.
+ */
+class ScDPHorFieldControl : public ScDPFieldControlBase
+{
+protected:
+ virtual size_t CalcNewFieldIndex(SCsCOL nDX, SCsROW nDY) const;
+ virtual size_t GetDisplayPosition(size_t nIndex) const;
+ virtual void Redraw();
+
+public:
+ ScDPHorFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption );
+
+ virtual ~ScDPHorFieldControl();
- /** Returns a reference to the accessiblity object, if still alive. */
- ::rtl::Reference< ScAccessibleDataPilotControl > GetAccessibleControl();
+ virtual void CalcSize();
+ virtual bool IsValidIndex( size_t nIndex ) const;
+ virtual Point GetFieldPosition(size_t nIndex);
+ virtual Size GetFieldSize() const;
+ virtual bool GetFieldIndex( const Point& rPos, size_t& rnIndex );
+ virtual String GetDescription() const;
- DECL_LINK( ScrollHdl, ScrollBar* );
+ virtual void ScrollToEnd();
+ virtual void ScrollToShowSelection();
+ virtual void ResetScrollBar();
+ virtual void HandleWheelScroll(long nNotch);
private:
- typedef ::std::vector< ScPivotWindowField > ScPivotWindowFieldVector;
-
- ScPivotLayoutDlg* mpDialog; /// Parent pivot table dialog.
- ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible >
- mxAccessible; /// Weak reference to the accessible object.
- ScAccessibleDataPilotControl*
- mpAccessible; /// Pointer to the accessible implementation.
- ScrollBar& mrScrollBar; /// Scrollbar of the select window.
- FixedText* mpFtCaption; /// Associated fixedtext control with caption text and mnemonic.
- ::rtl::OUString maName; /// Name of the control, used for accessibility.
- ScPivotWindowFieldVector maFields; /// Vector with all fields contained in this window.
- Size maFieldSize; /// Size of a single field in pixels.
- Size maSpaceSize; /// Size between fields in pixels.
- ScPivotFieldType meFieldType; /// Type of this field window.
- PointerStyle meDropPointer; /// Mouse pointer style for tracking over this window.
- size_t mnColCount; /// Number of field columns.
- size_t mnRowCount; /// Number of field rows.
- size_t mnLineSize; /// Number of fields per line (depending on scrolling orientation).
- size_t mnPageSize; /// Number of visible fields.
- size_t mnFirstVisIndex; /// Index of first visible field (scrolling offset).
- size_t mnSelectIndex; /// Currently selected field.
- size_t mnInsCursorIndex; /// Position of the insertion cursor.
- size_t mnOldFirstVisIndex; /// Stores original scroll position during auto scrolling.
- size_t mnAutoScrollDelay; /// Initial counter before auto scrolling starts on tracking.
- bool mbVertical; /// True = sort fields vertically.
- bool mbIsTrackingSource; /// True = this field window is the source while tracking.
+ bool GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize);
+ void HandleScroll();
+
+ DECL_LINK(ScrollHdl, ScrollBar*);
+ DECL_LINK(EndScrollHdl, ScrollBar*);
+
+private:
+
+ ScrollBar maScroll;
+
+ size_t mnFieldBtnRowCount;
+ size_t mnFieldBtnColCount;
};
// ============================================================================
-#endif
+class ScDPPageFieldControl : public ScDPHorFieldControl
+{
+public:
+ ScDPPageFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption);
+ virtual ~ScDPPageFieldControl();
+
+ virtual ScDPFieldType GetFieldType() const;
+ virtual String GetDescription() const;
+};
+
+// ============================================================================
+
+class ScDPColFieldControl : public ScDPHorFieldControl
+{
+public:
+ ScDPColFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption);
+ virtual ~ScDPColFieldControl();
+
+ virtual ScDPFieldType GetFieldType() const;
+ virtual String GetDescription() const;
+};
+
+// ============================================================================
+
+/**
+ * Row field control with a vertical scroll bar.
+ */
+class ScDPRowFieldControl : public ScDPFieldControlBase
+{
+public:
+ ScDPRowFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption );
+
+ virtual ~ScDPRowFieldControl();
+
+ virtual void CalcSize();
+ virtual bool IsValidIndex( size_t nIndex ) const;
+ virtual Point GetFieldPosition( size_t nIndex );
+ virtual Size GetFieldSize() const;
+ virtual bool GetFieldIndex( const Point& rPos, size_t& rnIndex );
+ virtual String GetDescription() const;
+ virtual ScDPFieldType GetFieldType() const;
+
+ virtual void ScrollToEnd();
+ virtual void ScrollToShowSelection();
+ virtual void ResetScrollBar();
+ virtual void HandleWheelScroll(long nNotch);
+
+protected:
+ virtual size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const;
+ virtual size_t GetDisplayPosition(size_t nIndex) const;
+ virtual void Redraw();
+
+private:
+ bool GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize);
+ void HandleScroll();
+
+ DECL_LINK(ScrollHdl, ScrollBar*);
+ DECL_LINK(EndScrollHdl, ScrollBar*);
+
+private:
+
+ ScDPFieldControlBase::ScrollBar maScroll;
+ size_t mnColumnBtnCount;
+};
+
+// ============================================================================
+
+class ScDPSelectFieldControl : public ScDPHorFieldControl
+{
+public:
+ ScDPSelectFieldControl(
+ ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption);
+ virtual ~ScDPSelectFieldControl();
+
+ virtual ScDPFieldType GetFieldType() const;
+ virtual String GetDescription() const;
+};
+
+// ============================================================================
+
+class ScDPDataFieldControl : public ScDPHorFieldControl
+{
+public:
+ ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption );
+ virtual ~ScDPDataFieldControl();
+
+ virtual ScDPFieldType GetFieldType() const;
+ virtual Size GetFieldSize() const;
+ virtual String GetDescription() const;
+};
+
+#endif // SC_FIELDWND_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/filldlg.hxx b/sc/source/ui/inc/filldlg.hxx
index 49173487ef56..abecfa27c75a 100644
--- a/sc/source/ui/inc/filldlg.hxx
+++ b/sc/source/ui/inc/filldlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,29 +29,17 @@
#ifndef SC_FILLDLG_HXX
#define SC_FILLDLG_HXX
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
#include "global.hxx"
class ScDocument;
//----------------------------------------------------------------------------
-//CHINA001 #define FDS_OPT_NONE 0
-//CHINA001 #define FDS_OPT_HORZ 1
-//CHINA001 #define FDS_OPT_VERT 2
-//CHINA001
-#include "scui_def.hxx" //CHINA001
+#include "scui_def.hxx"
//============================================================================
class ScFillSeriesDlg : public ModalDialog
@@ -76,7 +65,7 @@ public:
String GetStartStr() const { return aEdStartVal.GetText(); }
- void SetEdStartValEnabled(sal_Bool bFlag=sal_False);
+ void SetEdStartValEnabled(sal_Bool bFlag=false);
private:
FixedText aFtStartVal;
@@ -141,3 +130,4 @@ private:
#endif // SC_FILLDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx
index 16cad04b60b8..47a9dc414824 100644
--- a/sc/source/ui/inc/filtdlg.hxx
+++ b/sc/source/ui/inc/filtdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,9 @@
#ifndef SC_FILTDLG_HXX
#define SC_FILTDLG_HXX
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include "global.hxx" // -> ScQueryParam
#include "address.hxx"
@@ -265,3 +260,4 @@ private:
#endif // SC_FILTDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/filter.hrc b/sc/source/ui/inc/filter.hrc
index f62c4d5e015e..d973bb15180b 100644
--- a/sc/source/ui/inc/filter.hrc
+++ b/sc/source/ui/inc/filter.hrc
@@ -79,11 +79,3 @@
#define LB_CRITERIA_AREA 51
#define ED_CRITERIA_AREA 52
#define RB_CRITERIA_AREA 53
-
-//IAccessibility2 Implementation 2009-----
-#define STR_COPY_AREA_TO 5054
-#define RID_FILTER_OPERATOR 5055
-#define RID_FILTER_FIELDNAME 5056
-#define RID_FILTER_CONDITION 5057
-#define RID_FILTER_VALUE 5058
-//-----IAccessibility2 Implementation 2009
diff --git a/sc/source/ui/inc/foptmgr.hxx b/sc/source/ui/inc/foptmgr.hxx
index d72679a47ca2..5ba7345cd314 100644
--- a/sc/source/ui/inc/foptmgr.hxx
+++ b/sc/source/ui/inc/foptmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,10 @@
#ifndef SC_FOPTMGR_HXX
#define SC_FOPTMGR_HXX
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
//----------------------------------------------------------------------------
@@ -119,3 +112,5 @@ private:
#endif // SC_FOPTMGR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/formatsh.hxx b/sc/source/ui/inc/formatsh.hxx
index e45fb99c54ef..7dc1919ea30e 100644
--- a/sc/source/ui/inc/formatsh.hxx
+++ b/sc/source/ui/inc/formatsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,6 +75,11 @@ public:
void ExecFormatPaintbrush( SfxRequest& rReq );
void StateFormatPaintbrush( SfxItemSet& rSet );
+
+private:
+ short GetCurrentNumberFormatType();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/formdata.hxx b/sc/source/ui/inc/formdata.hxx
index 72c7862a007b..395809357763 100644
--- a/sc/source/ui/inc/formdata.hxx
+++ b/sc/source/ui/inc/formdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,4 @@ private:
#endif // SC_CRNRDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 18b8fa24c6a4..306aaa565d8d 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include "anyrefdg.hxx"
#include "global.hxx" // ScAddress
#include <svtools/stdctrl.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <vcl/group.hxx>
#include <svtools/svmedit.hxx>
#include <vcl/tabpage.hxx>
@@ -113,7 +112,7 @@ public:
virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
- virtual void RefInputDone( sal_Bool bForced = sal_False );
+ virtual void RefInputDone( sal_Bool bForced = false );
virtual sal_Bool IsTableLocked() const;
virtual sal_Bool IsRefInputMode() const;
@@ -136,3 +135,4 @@ protected:
#endif // SC_CRNRDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconarc.hxx b/sc/source/ui/inc/fuconarc.hxx
index e643b92397e9..232d5c0e1b79 100644
--- a/sc/source/ui/inc/fuconarc.hxx
+++ b/sc/source/ui/inc/fuconarc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@ class FuConstArc : public FuConstruct
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
@@ -60,3 +61,4 @@ class FuConstArc : public FuConstruct
#endif // _SD_FUCONARC_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconcustomshape.hxx b/sc/source/ui/inc/fuconcustomshape.hxx
index 3980bfef7b3f..6fb89242cbc0 100644
--- a/sc/source/ui/inc/fuconcustomshape.hxx
+++ b/sc/source/ui/inc/fuconcustomshape.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,7 @@ public:
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject( const sal_uInt16 nID, const Rectangle& rRectangle );
// #i33136#
@@ -59,3 +60,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconpol.hxx b/sc/source/ui/inc/fuconpol.hxx
index ef82acdf3b04..0104388ac03a 100644
--- a/sc/source/ui/inc/fuconpol.hxx
+++ b/sc/source/ui/inc/fuconpol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,10 +55,11 @@ class FuConstPolygon : public FuConstruct
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
#endif // _FUCONPOL_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconrec.hxx b/sc/source/ui/inc/fuconrec.hxx
index e98c823e0d15..5c0cf72735c7 100644
--- a/sc/source/ui/inc/fuconrec.hxx
+++ b/sc/source/ui/inc/fuconrec.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,7 @@ class FuConstRectangle : public FuConstruct
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
@@ -60,3 +61,4 @@ class FuConstRectangle : public FuConstruct
#endif // _SD_FUCONREC_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconstr.hxx b/sc/source/ui/inc/fuconstr.hxx
index 994aa1ac48b2..5468e2f60f6a 100644
--- a/sc/source/ui/inc/fuconstr.hxx
+++ b/sc/source/ui/inc/fuconstr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,5 @@ class FuConstruct : public FuDraw
#endif // _SD_FUCONSTR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconuno.hxx b/sc/source/ui/inc/fuconuno.hxx
index de3fcb4a5f65..efb19ccf39e7 100644
--- a/sc/source/ui/inc/fuconuno.hxx
+++ b/sc/source/ui/inc/fuconuno.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@ public:
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
};
@@ -65,3 +66,4 @@ public:
#endif // _SD_FUCONCTL_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fudraw.hxx b/sc/source/ui/inc/fudraw.hxx
index 80b33dca50e9..c2820c5c0569 100644
--- a/sc/source/ui/inc/fudraw.hxx
+++ b/sc/source/ui/inc/fudraw.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ class FuDraw : public FuPoor
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- // #97016# II
+ // II
virtual void SelectionHasChanged();
sal_Bool IsSizingOrMovingNote( const MouseEvent& rMEvt ) const;
@@ -75,3 +76,5 @@ class FuDraw : public FuPoor
#endif // _SD_FUDRAW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuedipo.hxx b/sc/source/ui/inc/fuedipo.hxx
index fe54e7027426..892fd748fbb8 100644
--- a/sc/source/ui/inc/fuedipo.hxx
+++ b/sc/source/ui/inc/fuedipo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,3 +59,4 @@ class FuEditPoints : public FuDraw
#endif // _SD_FUEDIPO_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuinsert.hxx b/sc/source/ui/inc/fuinsert.hxx
index 4dda7cb2b5ba..2964971244d6 100644
--- a/sc/source/ui/inc/fuinsert.hxx
+++ b/sc/source/ui/inc/fuinsert.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,4 @@ class FuInsertMedia : public FuPoor
#endif // _SD_FUINSERT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fumark.hxx b/sc/source/ui/inc/fumark.hxx
index 8156656fe794..58f22302ea24 100644
--- a/sc/source/ui/inc/fumark.hxx
+++ b/sc/source/ui/inc/fumark.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,4 @@ class FuMarkRect : public FuPoor
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/funcpage.hxx b/sc/source/ui/inc/funcpage.hxx
index 224e5e19d850..ca24748cc5a7 100644
--- a/sc/source/ui/inc/funcpage.hxx
+++ b/sc/source/ui/inc/funcpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include "funcutl.hxx"
#include "global.hxx" // ScAddress
#include <svtools/stdctrl.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <vcl/group.hxx>
#include <svtools/svmedit.hxx>
#include <vcl/tabpage.hxx>
@@ -126,3 +125,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/funcutl.hxx b/sc/source/ui/inc/funcutl.hxx
index 084cc6271700..d7878714e4f2 100644
--- a/sc/source/ui/inc/funcutl.hxx
+++ b/sc/source/ui/inc/funcutl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,12 +29,8 @@
#ifndef SC_FUNCUTL_HXX
#define SC_FUNCUTL_HXX
-#ifndef _SCRBAR_HXX //autogen
#include <vcl/scrbar.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svtools/svmedit.hxx>
#include "anyrefdg.hxx" // formula::RefButton
@@ -196,3 +193,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fupoor.hxx b/sc/source/ui/inc/fupoor.hxx
index 3f41c9f15535..5638b3bc6f68 100644
--- a/sc/source/ui/inc/fupoor.hxx
+++ b/sc/source/ui/inc/fupoor.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@ class Window;
class SdrModel;
class Dialog;
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
class SdrObject;
// Return-Werte fuer Command
@@ -73,7 +74,7 @@ protected:
sal_Bool bIsInDragMode;
Point aMDPos; // Position von MouseButtonDown
- // #95491# member to hold state of the mouse buttons for creation
+ // member to hold state of the mouse buttons for creation
// of own MouseEvents (like in ScrollHdl)
private:
sal_uInt16 mnCode;
@@ -83,7 +84,7 @@ public:
SdrModel* pDoc, SfxRequest& rReq);
virtual ~FuPoor();
- // #95491# see member
+ // see member
void SetMouseButtonCode(sal_uInt16 nNew) { if(nNew != mnCode) mnCode = nNew; }
sal_uInt16 GetMouseButtonCode() const { return mnCode; }
@@ -95,13 +96,13 @@ public:
// Mouse- & Key-Events; Returnwert=TRUE: Event wurde bearbeitet
virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent&) { return sal_False; }
+ virtual sal_Bool MouseMove(const MouseEvent&) { return false; }
- // #95491# moved from inline to *.cxx
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); // { return sal_False; }
+ // moved from inline to *.cxx
+ virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); // { return FALSE; }
- // #95491# moved from inline to *.cxx
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); // { return sal_False; }
+ // moved from inline to *.cxx
+ virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); // { return FALSE; }
virtual sal_uInt8 Command(const CommandEvent& rCEvt);
@@ -119,7 +120,7 @@ public:
void StopDragTimer();
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
protected:
@@ -134,3 +135,4 @@ public:
#endif // _SD_FUPOOR_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fusel.hxx b/sc/source/ui/inc/fusel.hxx
index 8dae89c71b63..d13ddc3e9558 100644
--- a/sc/source/ui/inc/fusel.hxx
+++ b/sc/source/ui/inc/fusel.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
#ifndef SC_FUSEL_HXX
#define SC_FUSEL_HXX
-#ifndef _SV_HXX
-#endif
-
#include "fudraw.hxx"
//class Outliner;
@@ -79,3 +77,4 @@ private:
#endif // _SD_FUSEL_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/futext.hxx b/sc/source/ui/inc/futext.hxx
index b25d4792b755..f3150424ba50 100644
--- a/sc/source/ui/inc/futext.hxx
+++ b/sc/source/ui/inc/futext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,11 +65,11 @@ public:
virtual void SelectionHasChanged();
void SetInEditMode( SdrObject* pObj = NULL, const Point* pMousePixel = NULL,
- sal_Bool bCursorToEnd = sal_False, const KeyEvent* pInitialKey = NULL );
- void StopEditMode(sal_Bool bTextDirection = sal_False);
+ sal_Bool bCursorToEnd = false, const KeyEvent* pInitialKey = NULL );
+ void StopEditMode(sal_Bool bTextDirection = false);
void StopDragMode(SdrObject* pObject);
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
private:
@@ -79,3 +80,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/graphsh.hxx b/sc/source/ui/inc/graphsh.hxx
index db9d04096142..64c3e053368b 100644
--- a/sc/source/ui/inc/graphsh.hxx
+++ b/sc/source/ui/inc/graphsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/gridmerg.hxx b/sc/source/ui/inc/gridmerg.hxx
index 3f0fae61b658..86cae4fdfab8 100644
--- a/sc/source/ui/inc/gridmerg.hxx
+++ b/sc/source/ui/inc/gridmerg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,3 +63,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index aad45058de2c..a3762b40d421 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,6 +109,7 @@ private:
// #114409#
::sdr::overlay::OverlayObjectList* mpOOCursors;
::sdr::overlay::OverlayObjectList* mpOOSelection;
+ ::sdr::overlay::OverlayObjectList* mpOOSelectionBorder;
::sdr::overlay::OverlayObjectList* mpOOAutoFill;
::sdr::overlay::OverlayObjectList* mpOODragRect;
::sdr::overlay::OverlayObjectList* mpOOHeader;
@@ -263,19 +265,10 @@ private:
void DrawMarkDropObj( SdrObject* pObj );
SdrObject* GetEditObject();
sal_Bool IsMyModel(SdrEditView* pSdrView);
- //void DrawStartTimer();
void DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sal_uLong nLayer );
void DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pContentDev );
- //sal_Bool DrawBeforeScroll();
- void DrawAfterScroll(/*sal_Bool bVal*/);
- //void DrawMarks();
- //sal_Bool NeedDrawMarks();
- void DrawComboButton( const Point& rCellPos,
- long nCellSizeX,
- long nCellSizeY,
- sal_Bool bArrowState,
- sal_Bool bBtnIn = sal_False );
+ void DrawAfterScroll(/*BOOL bVal*/);
Rectangle GetListValButtonRect( const ScAddress& rButtonPos );
void DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, OutputDevice* pContentDev );
@@ -363,16 +356,12 @@ public:
ScUpdateMode eMode = SC_UPDATE_ALL );
void InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
- sal_Bool bTestMerge = sal_False, sal_Bool bRepeat = sal_False );
-
-//UNUSED2008-05 void DrawDragRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
+ sal_Bool bTestMerge = false, sal_Bool bRepeat = false );
void CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress);
void HideCursor();
void ShowCursor();
- void DrawCursor();
- void DrawAutoFillMark();
void UpdateAutoFillMark(sal_Bool bMarked, const ScRange& rMarkRange);
void UpdateListValPos( sal_Bool bVisible, const ScAddress& rPos );
@@ -380,7 +369,7 @@ public:
sal_Bool ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKeyboard );
void HideNoteMarker();
- MapMode GetDrawMapMode( sal_Bool bForce = sal_False );
+ MapMode GetDrawMapMode( sal_Bool bForce = false );
void ContinueDrag();
@@ -394,11 +383,14 @@ public:
void CheckNeedsRepaint();
void UpdateDPFromFieldPopupMenu();
+ void UpdateVisibleRange();
// #114409#
void CursorChanged();
void DrawLayerCreated();
+ void DeleteCopySourceOverlay();
+ void UpdateCopySourceOverlay();
void DeleteCursorOverlay();
void UpdateCursorOverlay();
void DeleteSelectionOverlay();
@@ -424,3 +416,4 @@ protected:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/groupdlg.hxx b/sc/source/ui/inc/groupdlg.hxx
index 7dc0d6aad615..1510d1cf6154 100644
--- a/sc/source/ui/inc/groupdlg.hxx
+++ b/sc/source/ui/inc/groupdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@ class ScGroupDlg : public ModalDialog
public:
ScGroupDlg( Window* pParent,
sal_uInt16 nResId,
- sal_Bool bUnGroup = sal_False,
+ sal_Bool bUnGroup = false,
sal_Bool bRows = sal_True );
~ScGroupDlg();
@@ -59,3 +60,4 @@ private:
#endif // SC_STRINDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/hdrcont.hxx b/sc/source/ui/inc/hdrcont.hxx
index 4c7140b23eb2..da614f7fa762 100644
--- a/sc/source/ui/inc/hdrcont.hxx
+++ b/sc/source/ui/inc/hdrcont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#define SC_HDRCONT_HXX
#include <vcl/window.hxx>
-#ifndef _SELENG_HXX //autogen
#include <vcl/seleng.hxx>
-#endif
#include "address.hxx"
// ---------------------------------------------------------------------------
@@ -139,3 +138,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/hfedtdlg.hxx b/sc/source/ui/inc/hfedtdlg.hxx
index 67a9868952e2..0f63f2e7bae9 100644
--- a/sc/source/ui/inc/hfedtdlg.hxx
+++ b/sc/source/ui/inc/hfedtdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,5 @@ public:
#endif // SC_HFEDTDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/highred.hrc b/sc/source/ui/inc/highred.hrc
index 426c9ba29ee2..b6a4a1a4023c 100644
--- a/sc/source/ui/inc/highred.hrc
+++ b/sc/source/ui/inc/highred.hrc
@@ -34,7 +34,6 @@
#define CB_HIGHLIGHT_ACCEPT 6
#define CB_HIGHLIGHT_REJECT 7
-//
#define FL_FILTER 10
#define TP_FILTER 11
#define TP_VIEW 12
@@ -44,12 +43,6 @@
#define ED_ASSIGN 15
#define RB_ASSIGN 16
-
-
-
-
-
-
#define STR_INSERT_COLS 20
#define STR_INSERT_ROWS 21
#define STR_INSERT_TABS 22
@@ -65,7 +58,3 @@
#define BMP_STR_OPEN 32
#define BMP_STR_END 33
#define BMP_STR_ERROR 34
-
-
-//
-
diff --git a/sc/source/ui/inc/highred.hxx b/sc/source/ui/inc/highred.hxx
index b0699f7f5b5a..d3b6b24513a0 100644
--- a/sc/source/ui/inc/highred.hxx
+++ b/sc/source/ui/inc/highred.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,9 @@
#ifndef SC_HIGHRED_HXX
#define SC_HIGHRED_HXX
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
@@ -44,14 +39,10 @@
#include "rangenam.hxx"
#include "anyrefdg.hxx"
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
#include <vcl/lstbox.hxx>
-#ifndef _SVX_ACREDLIN_HXX
#include <svx/ctredlin.hxx>
-#endif
#include <svx/simptabl.hxx>
#include "chgtrack.hxx"
#include "chgviset.hxx"
@@ -104,7 +95,7 @@ private:
protected:
- virtual void RefInputDone( sal_Bool bForced = sal_False );
+ virtual void RefInputDone( sal_Bool bForced = false );
public:
ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
@@ -122,3 +113,4 @@ public:
#endif // SC_NAMEDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/hintwin.hxx b/sc/source/ui/inc/hintwin.hxx
index 2fd9e7897ab6..f199698178bc 100644
--- a/sc/source/ui/inc/hintwin.hxx
+++ b/sc/source/ui/inc/hintwin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/hiranges.hxx b/sc/source/ui/inc/hiranges.hxx
index ed4d66b79408..e14c74938bdd 100644
--- a/sc/source/ui/inc/hiranges.hxx
+++ b/sc/source/ui/inc/hiranges.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,3 +63,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/imoptdlg.hxx b/sc/source/ui/inc/imoptdlg.hxx
index 31a6569b9dd1..016b0e863304 100644
--- a/sc/source/ui/inc/imoptdlg.hxx
+++ b/sc/source/ui/inc/imoptdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,19 +45,19 @@ class SC_DLLPUBLIC ScImportOptions
public:
ScImportOptions()
: nFieldSepCode(0), nTextSepCode(0),
- eCharSet(RTL_TEXTENCODING_DONTKNOW), bFixedWidth(sal_False),
- bSaveAsShown(sal_False), bQuoteAllText(sal_False)
+ eCharSet(RTL_TEXTENCODING_DONTKNOW), bFixedWidth(false),
+ bSaveAsShown(false), bQuoteAllText(false)
{}
ScImportOptions( const String& rStr );
ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, const String& rStr )
: nFieldSepCode(nFieldSep), nTextSepCode(nTextSep), aStrFont(rStr),
- bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
+ bFixedWidth(false), bSaveAsShown(false), bQuoteAllText(false)
{ eCharSet = ScGlobal::GetCharsetValue(aStrFont); }
ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, rtl_TextEncoding nEnc )
: nFieldSepCode(nFieldSep), nTextSepCode(nTextSep),
- bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
+ bFixedWidth(false), bSaveAsShown(false), bQuoteAllText(false)
{ SetTextEncoding( nEnc ); }
ScImportOptions( const ScImportOptions& rCpy )
@@ -110,3 +111,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index 25b33b525362..a4c28b1150e7 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,6 +40,10 @@ class SvStream;
class SfxMedium;
class ScAsciiOptions;
+/**
+ * These options control how multi-line cells are converted during export in
+ * certain lossy formats (such as csv).
+ */
struct ScExportTextOptions
{
enum NewlineConversion { ToSystem, ToSpace, None };
@@ -50,7 +55,7 @@ struct ScExportTextOptions
bool mbAddQuotes;
};
-class ScImportExport
+class SC_DLLPUBLIC ScImportExport
{
ScDocShell* pDocSh;
ScDocument* pDoc;
@@ -108,7 +113,7 @@ public:
static sal_Bool IsFormatSupported( sal_uLong nFormat );
static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p,
String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted );
- static void WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, sal_Bool bZero = sal_False );
+ static void WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, sal_Bool bZero = false );
static void WriteUnicodeOrByteEndl( SvStream& rStrm );
static inline sal_Bool IsEndianSwap( const SvStream& rStrm );
@@ -152,7 +157,6 @@ public:
};
-// static
inline sal_Bool ScImportExport::IsEndianSwap( const SvStream& rStrm )
{
#ifdef OSL_BIGENDIAN
@@ -162,7 +166,6 @@ inline sal_Bool ScImportExport::IsEndianSwap( const SvStream& rStrm )
#endif
}
-// static
inline void ScImportExport::SetNoEndianSwap( SvStream& rStrm )
{
#ifdef OSL_BIGENDIAN
@@ -182,10 +185,11 @@ public:
rStr.getLength() * sizeof(sal_Unicode), STREAM_READ)
{
SetStreamCharSet( RTL_TEXTENCODING_UNICODE );
- SetEndianSwap( sal_False );
+ SetEndianSwap( false );
}
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 8291877bbc57..76c4daca74cc 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,7 +126,14 @@ private:
private:
void UpdateActiveView();
void SyncViews( EditView* pSourceView = NULL );
- sal_Bool StartTable( sal_Unicode cTyped, sal_Bool bFromCommand );
+ /**
+ * @param cTyped typed character. If 0, look at existing document content
+ * for text or number.
+ * @param bInputActivated true if the cell input mode is activated (via
+ * F2), false otherwise.
+ * @return true if the new edit mode has been started.
+ */
+ bool StartTable( sal_Unicode cTyped, bool bFromCommand, bool bInputActivated );
void RemoveSelection();
void UpdateFormulaMode();
void InvalidateAttribs();
@@ -172,7 +180,7 @@ public:
sal_Bool GetTextAndFields( ScEditEngineDefaulter& rDestEngine );
- sal_Bool KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit = sal_False );
+ sal_Bool KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit = false );
void EnterHandler( sal_uInt8 nBlockMode = 0 );
void CancelHandler();
void SetReference( const ScRange& rRef, ScDocument* pDoc );
@@ -184,13 +192,12 @@ public:
void ClearText();
void InputSelection( EditView* pView );
- void InputChanged( EditView* pView, sal_Bool bFromNotify = sal_False );
+ void InputChanged( EditView* pView, sal_Bool bFromNotify = false );
void ViewShellGone(ScTabViewShell* pViewSh);
void SetRefViewShell(ScTabViewShell* pRefVsh) {pRefViewSh=pRefVsh;}
-
- void NotifyChange( const ScInputHdlState* pState, sal_Bool bForce = sal_False,
+ void NotifyChange( const ScInputHdlState* pState, sal_Bool bForce = false,
ScTabViewShell* pSourceSh = NULL,
sal_Bool bStopEditing = sal_True);
void UpdateCellAdjust( SvxCellHorJustify eJust );
@@ -210,8 +217,8 @@ public:
EditView* GetTableView() { return pTableView; }
EditView* GetTopView() { return pTopView; }
- sal_Bool DataChanging( sal_Unicode cTyped = 0, sal_Bool bFromCommand = sal_False );
- void DataChanged( sal_Bool bFromTopNotify = sal_False );
+ sal_Bool DataChanging( sal_Unicode cTyped = 0, sal_Bool bFromCommand = false );
+ void DataChanged( sal_Bool bFromTopNotify = false );
sal_Bool TakesReturn() const { return ( nTipVisible != 0 ); }
@@ -244,7 +251,7 @@ public:
void ForgetLastPattern();
- void UpdateSpellSettings( sal_Bool bFromStartTab = sal_False );
+ void UpdateSpellSettings( sal_Bool bFromStartTab = false );
void FormulaPreview();
@@ -291,8 +298,7 @@ private:
EditTextObject* pEditData;
};
-
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 60a6896cf696..27bc405f24c5 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -170,8 +171,6 @@ public:
sal_Bool IsInputActive();
EditView* GetEditView();
-//UNUSED2008-05 EditView* ActivateEdit( const String& rText,
-//UNUSED2008-05 const ESelection& rSel );
void TextGrabFocus();
void TextInvalidate();
@@ -226,3 +225,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/inscldlg.hxx b/sc/source/ui/inc/inscldlg.hxx
index e4b0d2b9d03e..41608bccdf83 100644
--- a/sc/source/ui/inc/inscldlg.hxx
+++ b/sc/source/ui/inc/inscldlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,7 @@ private:
HelpButton aBtnHelp;
public:
- ScInsertCellDlg( Window* pParent,sal_Bool bDisallowCellMove = sal_False );
+ ScInsertCellDlg( Window* pParent,sal_Bool bDisallowCellMove = false );
~ScInsertCellDlg();
InsCellCmd GetInsCellCmd() const;
@@ -60,3 +61,4 @@ public:
#endif // SC_INSCLDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/inscodlg.hxx b/sc/source/ui/inc/inscodlg.hxx
index debd448c422f..0b893ed0f7cc 100644
--- a/sc/source/ui/inc/inscodlg.hxx
+++ b/sc/source/ui/inc/inscodlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,12 +35,6 @@
#include "global.hxx"
//------------------------------------------------------------------------
-//CHINA001 #define INS_CONT_NOEMPTY 0x0100
-//CHINA001 #define INS_CONT_TRANS 0x0200
-//CHINA001 #define INS_CONT_LINK 0x0400
-//CHINA001
-//CHINA001 #define SC_CELL_SHIFT_DISABLE_DOWN 0x01
-//CHINA001 #define SC_CELL_SHIFT_DISABLE_RIGHT 0x02
#include "scui_def.hxx"
class ScInsertContentsDlg : public ModalDialog
@@ -120,3 +115,4 @@ private:
#endif // SC_INSCODLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/instbdlg.hrc b/sc/source/ui/inc/instbdlg.hrc
index 08bff85388dd..dbe7e98e342a 100644
--- a/sc/source/ui/inc/instbdlg.hrc
+++ b/sc/source/ui/inc/instbdlg.hrc
@@ -27,8 +27,6 @@
#include <sc.hrc> // -> RID_SCDLG_INSERT_TABLE
-//#define RID_SCDLG_INSERT_TABLE 300
-
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
@@ -48,5 +46,3 @@
#define BTN_BROWSE 28
#define CB_LINK 29
#define FT_PATH 30
-
-
diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index ba738b3eea86..718e6d107b9b 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,24 +31,12 @@
#include "address.hxx"
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
#include <vcl/edit.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
#include <sfx2/objsh.hxx>
#include <vcl/field.hxx>
@@ -134,3 +123,4 @@ private:
#endif // SC_INSTBDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/invmerge.hxx b/sc/source/ui/inc/invmerge.hxx
index 49dfbc730fee..ebe03a91988f 100644
--- a/sc/source/ui/inc/invmerge.hxx
+++ b/sc/source/ui/inc/invmerge.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/lbseldlg.hxx b/sc/source/ui/inc/lbseldlg.hxx
index 7ee7de254414..2f1c50828324 100644
--- a/sc/source/ui/inc/lbseldlg.hxx
+++ b/sc/source/ui/inc/lbseldlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/dialog.hxx>
@@ -61,10 +60,10 @@ public:
~ScSelEntryDlg();
String GetSelectEntry() const;
-//UNUSED2008-05 sal_uInt16 GetSelectEntryPos() const;
};
#endif // SC_LBSELDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/linkarea.hrc b/sc/source/ui/inc/linkarea.hrc
index bc906fdb14ad..401739474acb 100644
--- a/sc/source/ui/inc/linkarea.hrc
+++ b/sc/source/ui/inc/linkarea.hrc
@@ -39,4 +39,3 @@
#define BTN_RELOAD 10
#define NF_DELAY 11
#define FT_SECONDS 12
-
diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx
index ee4896e4b8b9..2a5ab6a18ccb 100644
--- a/sc/source/ui/inc/linkarea.hxx
+++ b/sc/source/ui/inc/linkarea.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,20 +32,13 @@
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <vcl/dialog.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <svtools/stdctrl.hxx>
#include <svtools/inettbc.hxx>
-//REMOVE #ifndef SO2_DECL_SVEMBEDDEDOBJECT_DEFINED
-//REMOVE #define SO2_DECL_SVEMBEDDEDOBJECT_DEFINED
-//REMOVE SO2_DECL_REF(SvEmbeddedObject)
-//REMOVE #endif
-
namespace sfx2 { class DocumentInserter; }
namespace sfx2 { class FileDialogHelper; }
@@ -104,3 +98,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/lnktrans.hxx b/sc/source/ui/inc/lnktrans.hxx
index 7e37c6cce554..23b89f0d2d41 100644
--- a/sc/source/ui/inc/lnktrans.hxx
+++ b/sc/source/ui/inc/lnktrans.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/mediash.hxx b/sc/source/ui/inc/mediash.hxx
index e297dc11777a..58fccaae74f2 100644
--- a/sc/source/ui/inc/mediash.hxx
+++ b/sc/source/ui/inc/mediash.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/miscdlgs.hrc b/sc/source/ui/inc/miscdlgs.hrc
index 00b1658849d6..3f1faa5492aa 100644
--- a/sc/source/ui/inc/miscdlgs.hrc
+++ b/sc/source/ui/inc/miscdlgs.hrc
@@ -36,20 +36,6 @@
// -> RID_SCDLG_FILLSERIES
// -> RID_SCDLG_AUTOFORMAT
-// Fuer den DesignEditor:
-/*
-#define RID_SCDLG_DELCELL 1256
-#define RID_SCDLG_INSCELL 1257
-#define RID_SCDLG_DELCONT 1258
-#define RID_SCDLG_INSCONT 1259
-#define RID_SCDLG_MOVETAB 1260
-#define RID_SCDLG_STRINPUT 1261
-#define RID_SCDLG_MTRINPUT 1262
-#define RID_SCDLG_SELENTRY 1263
-#define RID_SCDLG_FILLSERIES 1264
-#define RID_SCDLG_AUTOFORMAT 1255
-*/
-
// allgemein
#define BTN_OK 100
#define BTN_CANCEL 102
@@ -112,6 +98,16 @@
#define LB_INSERT 4
#define BTN_COPY 5
#define STR_NEWDOC 6
+#define BTN_MOVE 7
+#define FL_ACTION 8
+#define FL_LOCATION 9
+#define FL_NAME 11
+#define FT_TABNAME 12
+#define FT_TABNAME_WARN 13
+#define STR_CURRENTDOC 14
+#define STR_TABNAME_WARN_USED 15
+#define STR_TABNAME_WARN_EMPTY 16
+#define STR_TABNAME_WARN_INVALID 17
// Eingabe eines Strings
#define ED_INPUT 10
@@ -185,4 +181,3 @@
// Tab Bg Color
#define TAB_BG_COLOR_CT_BORDER 1
#define TAB_BG_COLOR_SET_BGDCOLOR 2
-
diff --git a/sc/source/ui/inc/msgpool.hxx b/sc/source/ui/inc/msgpool.hxx
index bf769c397b82..25f182e74872 100644
--- a/sc/source/ui/inc/msgpool.hxx
+++ b/sc/source/ui/inc/msgpool.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,6 @@
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
-//#include <dbitems.hxx>
#include "uiitems.hxx"
@@ -76,3 +76,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/mtrindlg.hxx b/sc/source/ui/inc/mtrindlg.hxx
index 092457d4a1da..c6e0e1b117e2 100644
--- a/sc/source/ui/inc/mtrindlg.hxx
+++ b/sc/source/ui/inc/mtrindlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@ private:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
index e05795518555..d563650fca05 100644
--- a/sc/source/ui/inc/mvtabdlg.hxx
+++ b/sc/source/ui/inc/mvtabdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/edit.hxx>
#include <layout/layout.hxx>
#include <layout/layout-pre.hxx>
@@ -43,33 +45,60 @@
class ScMoveTableDlg : public ModalDialog
{
public:
- ScMoveTableDlg( Window* pParent );
+ ScMoveTableDlg( Window* pParent, const String& rDefault );
~ScMoveTableDlg();
sal_uInt16 GetSelectedDocument () const;
SCTAB GetSelectedTable () const;
- sal_Bool GetCopyTable () const;
- void SetCopyTable (sal_Bool bFlag=sal_True);
- void EnableCopyTable (sal_Bool bFlag=sal_True);
+ bool GetCopyTable () const;
+ bool GetRenameTable () const;
+ void GetTabNameString( String& rString ) const;
+ void SetForceCopyTable ();
+ void EnableCopyTable (sal_Bool bFlag=true);
+ void EnableRenameTable (sal_Bool bFlag=true);
private:
+ void ResetRenameInput();
+ void CheckNewTabName();
+ ScDocument* GetSelectedDoc();
+
+private:
+ FixedLine aFlAction;
+ RadioButton aBtnMove;
+ RadioButton aBtnCopy;
+ FixedLine aFlLocation;
FixedText aFtDoc;
ListBox aLbDoc;
FixedText aFtTable;
ListBox aLbTable;
- CheckBox aBtnCopy;
+ FixedLine aFlName;
+ FixedText aFtTabName;
+ Edit aEdTabName;
+ FixedText aFtWarn;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
+ String maStrTabNameUsed;
+ String maStrTabNameEmpty;
+ String maStrTabNameInvalid;
+
+ const String& mrDefaultName;
+
sal_uInt16 nDocument;
SCTAB nTable;
- sal_Bool bCopyTable;
+ bool bCopyTable:1;
+ bool bRenameTable:1;
+ bool mbEverEdited:1;
+
//--------------------------------------
void Init ();
+ void InitBtnRename ();
void InitDocListBox ();
DECL_LINK( OkHdl, void * );
DECL_LINK( SelHdl, ListBox * );
+ DECL_LINK( CheckBtnHdl, void * );
+ DECL_LINK( CheckNameHdl, Edit * );
};
#include <layout/layout-post.hxx>
@@ -77,3 +106,4 @@ private:
#endif // SC_MVTABDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/namecrea.hxx b/sc/source/ui/inc/namecrea.hxx
index eea0dd01ec6f..1f494d685cb3 100644
--- a/sc/source/ui/inc/namecrea.hxx
+++ b/sc/source/ui/inc/namecrea.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,7 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
-#include "scui_def.hxx" //CHINA001
-
-//CHINA001 #define NAME_TOP 1
-//CHINA001 #define NAME_LEFT 2
-//CHINA001 #define NAME_BOTTOM 4
-//CHINA001 #define NAME_RIGHT 8
+#include "scui_def.hxx"
class ScNameCreateDlg : public ModalDialog
{
@@ -57,3 +53,5 @@ public:
#endif //SC_NAMECREA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/namedlg.hrc b/sc/source/ui/inc/namedlg.hrc
index b2eec6879ec3..0d49fe8c3f60 100644
--- a/sc/source/ui/inc/namedlg.hrc
+++ b/sc/source/ui/inc/namedlg.hrc
@@ -33,20 +33,19 @@
#define BTN_REMOVE 4
#define BTN_HELP 5
#define BTN_MORE 6
-//
+
#define FL_NAME 11
#define ED_NAME 12
#define FL_ASSIGN 13
#define ED_ASSIGN 15
#define RB_ASSIGN 16
-//
+
#define STR_ADD 21
#define STR_MODIFY 22
#define STR_INVALIDSYMBOL 23
-//
+
#define BTN_CRITERIA 31
#define BTN_PRINTAREA 32
#define BTN_COLHEADER 33
#define BTN_ROWHEADER 34
#define FL_TYPE 35
-
diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx
index f83e7f0ad3e5..2939c3caab0b 100644
--- a/sc/source/ui/inc/namedlg.hxx
+++ b/sc/source/ui/inc/namedlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,9 @@
#ifndef SC_NAMEDLG_HXX
#define SC_NAMEDLG_HXX
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <vcl/fixed.hxx>
#include "rangenam.hxx"
#include "anyrefdg.hxx"
@@ -86,7 +81,7 @@ private:
void Init();
void UpdateChecks();
void UpdateNames();
- void CalcCurTableAssign( String& aAssign, sal_uInt16 nPos );
+ void CalcCurTableAssign( String& aAssign, ScRangeData* pRangeData );
// Handler:
DECL_LINK( OkBtnHdl, void * );
@@ -100,7 +95,7 @@ private:
protected:
- virtual void RefInputDone( sal_Bool bForced = sal_False );
+ virtual void RefInputDone( sal_Bool bForced = false );
public:
@@ -121,3 +116,4 @@ public:
#endif // SC_NAMEDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx
index ad98d257ba46..c90c20904ffe 100644
--- a/sc/source/ui/inc/namepast.hxx
+++ b/sc/source/ui/inc/namepast.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,10 +34,7 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#include "scui_def.hxx" //CHINA001
-//CHINA001 #define BTN_PASTE_NAME 100
-//CHINA001 #define BTN_PASTE_LIST 101
-//CHINA001
+#include "scui_def.hxx"
class ScRangeName;
class ScNamePasteDlg : public ModalDialog
@@ -60,3 +58,5 @@ public:
#endif //SC_NAMEPAST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/navcitem.hxx b/sc/source/ui/inc/navcitem.hxx
index 0a8971491cf7..7f03633061d2 100644
--- a/sc/source/ui/inc/navcitem.hxx
+++ b/sc/source/ui/inc/navcitem.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,4 @@ private:
#endif // SC_NAVCITEM_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index bf034b27c618..1e5fa665ad1b 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -243,7 +244,6 @@ private:
SfxBindings& rBindings; // must be first member
ImageList aCmdImageList; // must be before aTbxCmd
- ImageList aCmdImageListH;
FixedInfo aFtCol;
ColumnEdit aEdCol;
FixedInfo aFtRow;
@@ -364,3 +364,4 @@ private:
#endif // SC_NAVIPI_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/navsett.hxx b/sc/source/ui/inc/navsett.hxx
index 4332ee8cf454..6e4e85a10c39 100644
--- a/sc/source/ui/inc/navsett.hxx
+++ b/sc/source/ui/inc/navsett.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,4 @@ public:
#endif // SC_NAVSETT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx
index 3523259d84b4..01eeec8dbcd5 100644
--- a/sc/source/ui/inc/notemark.hxx
+++ b/sc/source/ui/inc/notemark.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_NOTEMARK_HXX
#define SC_NOTEMARK_HXX
-#ifndef _MAPMOD_HXX //autogen
#include <vcl/mapmod.hxx>
-#endif
#include <vcl/timer.hxx>
#include "global.hxx"
#include "address.hxx"
@@ -78,3 +77,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/oleobjsh.hxx b/sc/source/ui/inc/oleobjsh.hxx
index fa4f71729c97..0d3e5c8d86a8 100644
--- a/sc/source/ui/inc/oleobjsh.hxx
+++ b/sc/source/ui/inc/oleobjsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/olinefun.hxx b/sc/source/ui/inc/olinefun.hxx
index acdbf5e25a37..2f0b00c3e580 100644
--- a/sc/source/ui/inc/olinefun.hxx
+++ b/sc/source/ui/inc/olinefun.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,3 +67,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/olinewin.hxx b/sc/source/ui/inc/olinewin.hxx
index 8aa62084c7fd..e1dee0826d34 100644
--- a/sc/source/ui/inc/olinewin.hxx
+++ b/sc/source/ui/inc/olinewin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -242,3 +243,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/opredlin.hxx b/sc/source/ui/inc/opredlin.hxx
index df0377517ded..116097c30532 100644
--- a/sc/source/ui/inc/opredlin.hxx
+++ b/sc/source/ui/inc/opredlin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,25 +30,15 @@
#include <sfx2/tabdlg.hxx>
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
#include <svtools/ctrlbox.hxx>
#include <svx/fntctrl.hxx>
#include <svx/strarray.hxx>
@@ -84,3 +75,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/optdlg.hrc b/sc/source/ui/inc/optdlg.hrc
index 27b8976e3541..9ac8213cf621 100644
--- a/sc/source/ui/inc/optdlg.hrc
+++ b/sc/source/ui/inc/optdlg.hrc
@@ -27,13 +27,6 @@
#include "sc.hrc"
-/*
-#define RID_SCDLG_OPTIONS 256
-#define RID_SCPAGE_VIEW 256
-#define RID_SCPAGE_USERLISTS 257
-#define RID_SCPAGE_CALC 258
-#define RID_SCPAGE_PRINT 259
-*/
#define TP_GENERAL 1
#define TP_SAVE 2
@@ -49,6 +42,7 @@
#define TP_LAYOUT 12
#define TP_INPUT 13
#define TP_CHANGES 14
+#define TP_FORMULA 15
// TP_CALC:
#define BTN_ITERATE 1
@@ -89,14 +83,6 @@
#define BTN_NOTES 22
#define GB_CONTENTS 23
-//#define FT_OLE 31
-//#define FT_CHARTS 32
-//#define FT_DRAWINGS 33
-//#define LB_OLE 34
-//#define LB_CHARTS 35
-//#define LB_DRAWINGS 36
-//#define GB_OBJECTS 37
-
// TP_USERLISTS:
#define FT_LISTS 1
@@ -123,19 +109,19 @@
// TP_LCONTENT
-#define GB_DISPLAY 20
-#define CB_FORMULA 21
-#define CB_NIL 22
+#define GB_DISPLAY 20
+#define CB_FORMULA 21
+#define CB_NIL 22
#define CB_ANNOT 23
#define CB_VALUE 24
#define CB_ANCHOR 25
#define GB_OBJECT 26
#define FT_OBJGRF 27
#define LB_OBJGRF 28
-#define FT_DIAGRAM 29
-#define LB_DIAGRAM 30
-#define FT_DRAW 31
-#define LB_DRAW 32
+#define FT_DIAGRAM 29
+#define LB_DIAGRAM 30
+#define FT_DRAW 31
+#define LB_DRAW 32
#define CB_CLIP 33
#define GB_ZOOM 34
#define CB_SYNCZOOM 35
@@ -176,9 +162,8 @@
#define FL_SEPARATOR1 71
#define FL_SEPARATOR2 72
#define FL_SEPARATOR 73
-#define FL_H_SEPARATOR 74
-// TP_INPUT
+// TP_INPUT
#define GB_OPTIONS 70
#define CB_ALIGN 71
#define LB_ALIGN 72
@@ -190,3 +175,22 @@
#define CB_TEXTFMT 78
#define CB_REPLWARN 79
+
+// TP_FORMULA
+#define FL_FORMULA_OPTIONS 80
+#define FT_FORMULA_SYNTAX 81
+#define LB_FORMULA_SYNTAX 82
+#define CB_ENGLISH_FUNC_NAME 83
+#define FL_FORMULA_SEPS 84
+#define FT_FORMULA_SEP_ARG 85
+#define ED_FORMULA_SEP_ARG 86
+#define FT_FORMULA_SEP_ARRAY_R 87
+#define ED_FORMULA_SEP_ARRAY_R 88
+#define FT_FORMULA_SEP_ARRAY_C 89
+#define ED_FORMULA_SEP_ARRAY_C 90
+#define BTN_FORMULA_SEP_RESET 91
+
+// TP_COMPATIBILITY
+#define FL_KEY_BINDINGS 1
+#define FT_KEY_BINDINGS 2
+#define LB_KEY_BINDINGS 3
diff --git a/sc/source/ui/inc/optload.hrc b/sc/source/ui/inc/optload.hrc
index 992bb8c737e4..c090c64dc136 100644
--- a/sc/source/ui/inc/optload.hrc
+++ b/sc/source/ui/inc/optload.hrc
@@ -36,5 +36,3 @@
#define CB_AUTO_UPDATE_FIELDS 8
#define CB_AUTO_UPDATE_CHARTS 9
#define FT_UPDATE_LINKS 10
-
-
diff --git a/sc/source/ui/inc/optload.hxx b/sc/source/ui/inc/optload.hxx
index 25a3c8abe7c9..14e1c4661903 100644
--- a/sc/source/ui/inc/optload.hxx
+++ b/sc/source/ui/inc/optload.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <sfx2/tabdlg.hxx>
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <vcl/fixed.hxx>
class ScDocument;
@@ -66,3 +65,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/optsolver.hrc b/sc/source/ui/inc/optsolver.hrc
index 9df8eea1d7f4..5ed7b8560060 100644
--- a/sc/source/ui/inc/optsolver.hrc
+++ b/sc/source/ui/inc/optsolver.hrc
@@ -91,8 +91,5 @@
#define BTN_OK 5
#define BTN_CANCEL 6
-#define IMG_DEL_H 1
-
#define STR_INVALIDINPUT 1
#define STR_INVALIDCONDITION 2
-
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index 652fd7fc8fc9..c7a06213c067 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -262,3 +263,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 26d2262b5a8e..b109d2951eb0 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#define SC_OUTPUT_HXX
#include "address.hxx"
-#include <tools/list.hxx>
#include <tools/color.hxx>
#include <tools/fract.hxx>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
@@ -222,7 +222,8 @@ public:
void SetSnapPixel( sal_Bool bSet = sal_True );
void DrawGrid( sal_Bool bGrid, sal_Bool bPage );
- void DrawStrings( sal_Bool bPixelToLogic = sal_False );
+ void DrawStrings( sal_Bool bPixelToLogic = false );
+ void DrawDocumentBackground();
void DrawBackground();
void DrawShadow();
void DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRight, sal_Bool bBottom);
@@ -250,9 +251,6 @@ public:
void FindChanged();
void SetPagebreakMode( ScPageBreakData* pPageData );
-#ifdef OLD_SELECTION_PAINT
- void DrawMark( Window* pWin );
-#endif
void DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
SCCOL nRefEndX, SCROW nRefEndY,
const Color& rColor, sal_Bool bHandle );
@@ -270,3 +268,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/addin/inc/rot13.hrc b/sc/source/ui/inc/overlayobject.hxx
index a610c9cc6663..91219edaa0c4 100644
--- a/sc/addin/inc/rot13.hrc
+++ b/sc/source/ui/inc/overlayobject.hxx
@@ -1,8 +1,9 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
@@ -24,12 +25,34 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef SC_ADDIN_ROT13_HRC
-#define SC_ADDIN_ROT13_HRC
-#define ROT13_DESC 1
-#define ROT13_PAR1_NAME 2
-#define ROT13_PAR1_DESC 3
+#ifndef __SC_OVERLAYOBJECT_HXX__
+#define __SC_OVERLAYOBJECT_HXX__
+
+#include "svx/sdr/overlay/overlayobject.hxx"
+
+class OutputDevice;
+class Window;
+
+class ScOverlayDashedBorder : public ::sdr::overlay::OverlayObject
+{
+public:
+ ScOverlayDashedBorder(const ::basegfx::B2DRange& rRange, const Color& rColor, Window* pWin);
+ virtual ~ScOverlayDashedBorder();
+
+ virtual void Trigger(sal_uInt32 nTime);
+
+ virtual void stripeDefinitionHasChanged();
+
+protected:
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+private:
+ ::basegfx::B2DRange maRange;
+ Window* mpParent;
+ bool mbToggle;
+};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pagedata.hxx b/sc/source/ui/inc/pagedata.hxx
index 85160b22c7a8..f0114ddb2101 100644
--- a/sc/source/ui/inc/pagedata.hxx
+++ b/sc/source/ui/inc/pagedata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/parawin.hxx b/sc/source/ui/inc/parawin.hxx
index fa79312a8536..bacbc2c35078 100644
--- a/sc/source/ui/inc/parawin.hxx
+++ b/sc/source/ui/inc/parawin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include "funcutl.hxx"
#include "global.hxx" // ScAddress
#include <svtools/stdctrl.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <vcl/group.hxx>
#include <svtools/svmedit.hxx>
#include <vcl/tabpage.hxx>
@@ -169,3 +168,4 @@ public:
#endif // SC_PARAWIN_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pfiltdlg.hxx b/sc/source/ui/inc/pfiltdlg.hxx
index 4733f8bae6b0..bb68e07b3891 100644
--- a/sc/source/ui/inc/pfiltdlg.hxx
+++ b/sc/source/ui/inc/pfiltdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,28 +29,13 @@
#ifndef SC_PFILTDLG_HXX
#define SC_PFILTDLG_HXX
-#ifndef _SV_HXX
-#endif
-
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
#include <svtools/stdctrl.hxx>
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
#include "address.hxx"
#include "queryparam.hxx"
@@ -143,3 +129,4 @@ private:
#endif // SC_PFILTDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pfuncache.hxx b/sc/source/ui/inc/pfuncache.hxx
index 5736377cef17..b64e9753e43d 100644
--- a/sc/source/ui/inc/pfuncache.hxx
+++ b/sc/source/ui/inc/pfuncache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -123,3 +124,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pgbrksh.hxx b/sc/source/ui/inc/pgbrksh.hxx
index f367b4cc4f1f..bca834c27eb0 100644
--- a/sc/source/ui/inc/pgbrksh.hxx
+++ b/sc/source/ui/inc/pgbrksh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pivotsh.hxx b/sc/source/ui/inc/pivotsh.hxx
index 2d3a21fa9756..fff0f99ad388 100644
--- a/sc/source/ui/inc/pivotsh.hxx
+++ b/sc/source/ui/inc/pivotsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pntlock.hxx b/sc/source/ui/inc/pntlock.hxx
index 888a11f5596e..d88d89d745d7 100644
--- a/sc/source/ui/inc/pntlock.hxx
+++ b/sc/source/ui/inc/pntlock.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/popmenu.hxx b/sc/source/ui/inc/popmenu.hxx
index bc1f6c094d84..a7ee2d7bfd3e 100644
--- a/sc/source/ui/inc/popmenu.hxx
+++ b/sc/source/ui/inc/popmenu.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_POPMENU_HXX
#define SC_POPMENU_HXX
-#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
-#endif
#include "scdllapi.h"
class SC_DLLPUBLIC ScPopupMenu : public PopupMenu
@@ -41,8 +40,8 @@ private:
protected:
virtual void Select();
public:
- ScPopupMenu() : nSel(0),bHit(sal_False) {}
- ScPopupMenu(const ResId& rRes) : PopupMenu(rRes),nSel(0),bHit(sal_False) {}
+ ScPopupMenu() : nSel(0),bHit(false) {}
+ ScPopupMenu(const ResId& rRes) : PopupMenu(rRes),nSel(0),bHit(false) {}
sal_uInt16 GetSelected() const { return nSel; }
sal_Bool WasHit() const { return bHit; }
};
@@ -51,3 +50,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx
index e5f901720b36..6988259526d0 100644
--- a/sc/source/ui/inc/preview.hxx
+++ b/sc/source/ui/inc/preview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,6 +64,8 @@ private:
ScPreviewLocationData* pLocationData; // stores table layout for accessibility API
FmFormView* pDrawView;
+ SCTAB nCurTab;
+
// intern:
sal_Bool bInPaint;
sal_Bool bInGetState;
@@ -124,7 +127,7 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void DataChanged(sal_Bool bNewTime = sal_False); // statt Invalidate rufen
+ void DataChanged(sal_Bool bNewTime = false); // statt Invalidate rufen
void DoInvalidate();
void SetXOffset( long nX );
@@ -166,3 +169,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/prevloc.hxx b/sc/source/ui/inc/prevloc.hxx
index d32ea007e737..936803cd88c2 100644
--- a/sc/source/ui/inc/prevloc.hxx
+++ b/sc/source/ui/inc/prevloc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,12 @@
#ifndef SC_PREVLOC_HXX
#define SC_PREVLOC_HXX
-#include "address.hxx"
-#include <tools/list.hxx>
-#include <vcl/mapmod.hxx>
+#include <boost/ptr_container/ptr_list.hpp>
+
#include <sal/types.h>
+#include <vcl/mapmod.hxx>
+#include "address.hxx"
#define SC_PREVIEW_MAXRANGES 4
#define SC_PREVIEW_RANGE_EDGE 0
@@ -47,6 +49,7 @@ class Rectangle;
class ScAddress;
class ScRange;
class ScDocument;
+class ScPreviewLocationEntry;
struct ScPreviewColRowInfo
{
@@ -99,9 +102,8 @@ class ScPreviewLocationData
sal_uInt8 aDrawRangeId[SC_PREVIEW_MAXRANGES];
sal_uInt16 nDrawRanges;
SCTAB nPrintTab;
- List aEntries;
+ boost::ptr_list<ScPreviewLocationEntry> aEntries;
-//UNUSED2008-05 ScAddress GetCellFromRange( const Size& rOffsetPixel, const ScRange& rRange ) const;
Rectangle GetOffsetPixel( const ScAddress& rCellPos, const ScRange& rRange ) const;
public:
@@ -155,3 +157,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 9534aa687ad6..271a35260e99 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,11 +82,11 @@ protected:
virtual String GetDescription() const;
- virtual void WriteUserData(String &, sal_Bool bBrowse = sal_False);
- virtual void ReadUserData(const String &, sal_Bool bBrowse = sal_False);
+ virtual void WriteUserData(String &, sal_Bool bBrowse = false);
+ virtual void ReadUserData(const String &, sal_Bool bBrowse = false);
- virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
- virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
+ virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
+ virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
public:
TYPEINFO();
@@ -114,7 +115,7 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
+ virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false );
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
@@ -131,3 +132,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 601496c315eb..84f486999315 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include "pagepar.hxx"
#include "editutil.hxx"
-#ifndef _PRINT_HXX //autogen
#include <vcl/print.hxx>
-#endif
class SfxPrinter;
class SfxProgress;
@@ -366,3 +365,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/privsplt.hxx b/sc/source/ui/inc/privsplt.hxx
index 375f176222b3..ff3af449551e 100644
--- a/sc/source/ui/inc/privsplt.hxx
+++ b/sc/source/ui/inc/privsplt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,5 @@ class ScPrivatSplit : public Control
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/protectiondlg.hrc b/sc/source/ui/inc/protectiondlg.hrc
index 52e57040922c..2f7cc5ee21a8 100644
--- a/sc/source/ui/inc/protectiondlg.hrc
+++ b/sc/source/ui/inc/protectiondlg.hrc
@@ -40,5 +40,5 @@
#define FT_OPTIONS 10
#define CLB_OPTIONS 11
-#define ST_SELECT_LOCKED_CELLS 50
-#define ST_SELECT_UNLOCKED_CELLS 51
+#define ST_SELECT_PROTECTED_CELLS 50
+#define ST_SELECT_UNPROTECTED_CELLS 51
diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx
index d7d555ff5ac5..9fbedaffad07 100644
--- a/sc/source/ui/inc/protectiondlg.hxx
+++ b/sc/source/ui/inc/protectiondlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,3 +81,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index 4e2b64f33f42..b41293779b75 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,7 @@
#include <sfx2/itemconnect.hxx>
#include "pivot.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
// ============================================================================
@@ -68,6 +69,7 @@ private:
class ScDPFunctionDlg : public ModalDialog
{
+ typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > NameMapType;
public:
explicit ScDPFunctionDlg( Window* pParent, const ScDPLabelDataVector& rLabelVec,
const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
@@ -78,6 +80,12 @@ public:
private:
void Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
+ const ::rtl::OUString& GetBaseFieldName(const ::rtl::OUString& rLayoutName) const;
+ const ::rtl::OUString& GetBaseItemName(const ::rtl::OUString& rLayoutName) const;
+
+ /** Searches for a listbox entry, starts search at specified position. */
+ sal_uInt16 FindBaseItemPos( const String& rEntry, sal_uInt16 nStartPos ) const;
+
DECL_LINK( SelectHdl, ListBox* );
DECL_LINK( DblClickHdl, MultiListBox* );
@@ -98,6 +106,9 @@ private:
HelpButton maBtnHelp;
MoreButton maBtnMore;
+ NameMapType maBaseFieldNameMap; // cache for base field display -> original name.
+ NameMapType maBaseItemNameMap; // cache for base item display -> original name.
+
ScDPListBoxWrapper maLbTypeWrp; /// Wrapper for direct usage of API constants.
const ScDPLabelDataVector& mrLabelVec; /// Data of all labels.
@@ -160,6 +171,11 @@ private:
void Init( const ScDPNameVec& rDataFields, bool bEnableLayout );
void InitHideListBox();
+ const ::rtl::OUString& GetFieldName(const ::rtl::OUString& rLayoutName) const;
+
+ /** Searches for a listbox entry, starts search at specified position. */
+ sal_uInt16 FindListBoxEntry( const ListBox& rLBox, const String& rEntry, sal_uInt16 nStartPos ) const;
+
DECL_LINK( RadioClickHdl, RadioButton* );
DECL_LINK( CheckHdl, CheckBox* );
DECL_LINK( SelectHdl, ListBox* );
@@ -195,6 +211,9 @@ private:
ScDPObject& mrDPObj; /// The DataPilot object (for member names).
ScDPLabelData maLabelData; /// Cache for members data.
+
+ typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > NameMapType;
+ NameMapType maDataFieldNameMap; /// Cache for displayed name to field name mapping.
};
// ============================================================================
@@ -223,7 +242,7 @@ private:
CancelButton maBtnCancel;
HelpButton maBtnHelp;
- typedef ::std::hash_map<String, long, ScStringHashCode> DimNameIndexMap;
+ typedef ::boost::unordered_map<String, long, ScStringHashCode> DimNameIndexMap;
DimNameIndexMap maNameIndexMap;
ScDPObject& mrDPObj;
};
@@ -232,3 +251,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index d6f12e8c5d49..1b04a1445800 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,11 @@
#include <memory>
#include <vector>
-#include <formula/funcutl.hxx>
-#include <svtools/stdctrl.hxx>
#include <vcl/lstbox.hxx>
-#include <vcl/morebtn.hxx>
#include <vcl/scrbar.hxx>
-
+#include <svtools/stdctrl.hxx>
+#include <vcl/morebtn.hxx>
+#include "pivot.hxx"
#include "anyrefdg.hxx"
#include "fieldwnd.hxx"
@@ -47,24 +47,38 @@ class ScDocument;
class ScRangeData;
class ScDPObject;
-// ============================================================================
+//============================================================================
-class ScPivotLayoutDlg : public ScAnyRefDlg
+class ScDPLayoutDlg : public ScAnyRefDlg
{
+ /** data source type */
+ enum DataSrcType {
+ SRC_REF, /// range reference
+ SRC_NAME, /// range name
+ SRC_INVALID /// invalid range
+ };
public:
- ScPivotLayoutDlg(
- SfxBindings* pB,
- SfxChildWindow* pCW,
- Window* pParent,
- const ScDPObject& rDPObject );
- virtual ~ScPivotLayoutDlg();
-
- ScDPLabelData* GetLabelData( SCCOL nCol, size_t* pnIndex = 0 );
- String GetFuncString( sal_uInt16& rnFuncMask, bool bIsValue = true );
-
- void NotifyStartTracking( ScPivotFieldWindow& rSourceWindow );
- void NotifyDoubleClick( ScPivotFieldWindow& rSourceWindow );
- void NotifyFieldRemoved( ScPivotFieldWindow& rSourceWindow );
+ ScDPLayoutDlg(
+ SfxBindings* pB,
+ SfxChildWindow* pCW,
+ Window* pParent,
+ const ScDPObject& rDPObject,
+ bool bNewOutput );
+ virtual ~ScDPLayoutDlg();
+
+ virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
+ virtual sal_Bool IsRefInputMode() const { return bRefInputMode; }
+ virtual void SetActive();
+ virtual sal_Bool Close();
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ void NotifyDoubleClick ( ScDPFieldType eType, size_t nFieldIndex );
+ PointerStyle NotifyMouseButtonDown( ScDPFieldType eType, size_t nFieldIndex );
+ void NotifyMouseButtonUp ( const Point& rAt );
+ PointerStyle NotifyMouseMove ( const Point& rAt );
+ void NotifyFieldFocus ( ScDPFieldType eType, sal_Bool bGotFocus );
+ void NotifyMoveFieldToEnd ( ScDPFieldType eToType );
+ void NotifyRemoveField ( ScDPFieldType eType, size_t nFieldIndex );
protected:
virtual void Tracking( const TrackingEvent& rTEvt );
@@ -74,89 +88,146 @@ protected:
virtual sal_Bool Close();
private:
- /** Returns the localized function name for the specified (1-based) resource index. */
- inline const String& GetFuncName( sal_uInt16 nFuncIdx ) const { return maFuncNames[ nFuncIdx - 1 ]; }
- /** Returns the specified field window. */
- ScPivotFieldWindow& GetFieldWindow( ScPivotFieldType eFieldType );
+ typedef boost::shared_ptr< ScDPFuncData > ScDPFuncDataRef;
+ typedef std::vector< ScDPFuncDataRef > ScDPFuncDataVec;
+ typedef std::auto_ptr< ScDPObject > ScDPObjectPtr;
+
+ FixedLine aFlLayout;
+ FixedText aFtPage;
+ ScDPPageFieldControl aWndPage;
+ FixedText aFtCol;
+ ScDPColFieldControl aWndCol;
+ FixedText aFtRow;
+ ScDPRowFieldControl aWndRow;
+ FixedText aFtData;
+ ScDPDataFieldControl aWndData;
+ ScDPSelectFieldControl aWndSelect;
+ FixedInfo aFtInfo;
+
+ FixedLine aFlAreas;
+
+ // DP source selection
+ FixedText aFtInArea;
+ ::formula::RefEdit aEdInPos;
+ ::formula::RefButton aRbInPos;
+
+ // DP output location
+ ListBox aLbOutPos;
+ FixedText aFtOutArea;
+ formula::RefEdit aEdOutPos;
+ formula::RefButton aRbOutPos;
+
+ CheckBox aBtnIgnEmptyRows;
+ CheckBox aBtnDetectCat;
+ CheckBox aBtnTotalCol;
+ CheckBox aBtnTotalRow;
+ CheckBox aBtnFilter;
+ CheckBox aBtnDrillDown;
+
+ OKButton aBtnOk;
+ CancelButton aBtnCancel;
+ HelpButton aBtnHelp;
+ PushButton aBtnRemove;
+ PushButton aBtnOptions;
+ MoreButton aBtnMore;
+
+ const String aStrUndefined;
+ const String aStrNewTable;
+ std::vector< String > aFuncNameArr;
+
+ ScDPFieldType eDnDFromType;
+ size_t nDnDFromIndex;
+ sal_Bool bIsDrag;
+
+ ::formula::RefEdit* pEditActive;
+
+ Rectangle aRectPage;
+ Rectangle aRectRow;
+ Rectangle aRectCol;
+ Rectangle aRectData;
+ Rectangle aRectSelect;
+
+ ScDPLabelDataVec aLabelDataArr; // (nCol, Feldname, Zahl/Text)
+
+ ScDPFieldType eLastActiveType; /// Type of last active area.
+ size_t nOffset; /// Offset of first field in TYPE_SELECT area.
+
+ ScDPFuncDataVec aSelectArr;
+ ScDPFuncDataVec aPageArr;
+ ScDPFuncDataVec aColArr;
+ ScDPFuncDataVec aRowArr;
+ ScDPFuncDataVec aDataArr;
+
+ long mnFieldObjSpace;
+
+ ScDPObjectPtr xDlgDPObject;
+ ScRange aOldRange;
+ ScPivotParam thePivotData;
+ ScViewData* pViewData;
+ ScDocument* pDoc;
+ bool bRefInputMode;
- /** Fills the field windows from the current pivot table settings. */
- void InitFieldWindows();
- /** Sets focus to the specified field window, if it is not empty. */
- void GrabFieldFocus( ScPivotFieldWindow& rFieldWindow );
-
- /** Returns true, if the specified field can be inserted into the specified field window. */
- bool IsInsertAllowed( const ScPivotFieldWindow& rSourceWindow, const ScPivotFieldWindow& rTargetWindow );
- /** Moves the selected field in the source window to the specified window. */
- bool MoveField( ScPivotFieldWindow& rSourceWindow, ScPivotFieldWindow& rTargetWindow, size_t nInsertIndex, bool bMoveExisting );
+private:
+ void Init (bool bNewOutput);
+ void InitWndSelect ( const ::std::vector<ScDPLabelDataRef>& rLabels );
+ void InitFieldWindow ( const ::std::vector<PivotField>& rFields, ScDPFieldType eType );
+ void InitFocus ();
+ void InitFields ();
+ void CalcWndSizes ();
+ Point DlgPos2WndPos ( const Point& rPt, Window& rWnd );
+ ScDPLabelData* GetLabelData ( SCsCOL nCol, size_t* pPos = NULL );
+ String GetLabelString ( SCsCOL nCol );
+ bool IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType );
+ String GetFuncString ( sal_uInt16& rFuncMask, sal_Bool bIsValue = true );
+ sal_Bool Contains ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt );
+ void Remove ( ScDPFuncDataVec* pArr, size_t nAt );
+ void Insert ( ScDPFuncDataVec* pArr, const ScDPFuncData& rFData, size_t nAt );
+
+ void AddField ( size_t nFromIndex,
+ ScDPFieldType eToType, const Point& rAtPos );
+ void AppendField(size_t nFromIndex, ScDPFieldType eToType);
+ void MoveField ( ScDPFieldType eFromType, size_t nFromIndex,
+ ScDPFieldType eToType, const Point& rAtPos );
+ void MoveFieldToEnd(ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType);
+ void RemoveField ( ScDPFieldType eRemType, size_t nRemIndex );
+
+ bool GetPivotArrays( ::std::vector<PivotField>& rPageFields,
+ ::std::vector<PivotField>& rColFields,
+ ::std::vector<PivotField>& rRowFields,
+ ::std::vector<PivotField>& rDataFields );
+
+ void UpdateSrcRange();
+ void RepaintFieldWindows();
+
+ ScDPFieldControlBase* GetFieldWindow(ScDPFieldType eType);
+
+ /**
+ * Get pointers to field windows that are <b>not</b> the window of
+ * specified type. The select window type is not included.
+ */
+ void GetOtherFieldWindows(
+ ScDPFieldType eType, ScDPFieldControlBase*& rpWnd1, ScDPFieldControlBase*& rpWnd2);
+
+ ScDPFuncDataVec* GetFieldDataArray(ScDPFieldType eType);
+
+ /**
+ * Like GetOtherFieldWindows(), get pointers to data arrays of the fields
+ * that are <b>not</b> the specified field type.
+ */
+ void GetOtherDataArrays(
+ ScDPFieldType eType, ScDPFuncDataVec*& rpArr1, ScDPFuncDataVec*& rpArr2);
// Handler
DECL_LINK( ClickHdl, PushButton * );
- DECL_LINK( OkHdl, OKButton * );
- DECL_LINK( CancelHdl, CancelButton * );
+ DECL_LINK( SelAreaHdl, ListBox * );
DECL_LINK( MoreClickHdl, MoreButton * );
- DECL_LINK( EdOutModifyHdl, Edit * );
+ DECL_LINK( EdModifyHdl, Edit * );
DECL_LINK( EdInModifyHdl, Edit * );
- DECL_LINK( SelAreaHdl, ListBox * );
- DECL_LINK( ChildEventListener, VclWindowEvent* );
-
-private:
- typedef ::std::auto_ptr< ScDPObject > ScDPObjectPtr;
-
- FixedLine maFlLayout;
- ScrollBar maScrPage;
- FixedText maFtPage;
- ScPivotFieldWindow maWndPage;
- ScrollBar maScrCol;
- FixedText maFtCol;
- ScPivotFieldWindow maWndCol;
- ScrollBar maScrRow;
- FixedText maFtRow;
- ScPivotFieldWindow maWndRow;
- ScrollBar maScrData;
- FixedText maFtData;
- ScPivotFieldWindow maWndData;
- FixedLine maFlSelect;
- ScrollBar maScrSelect;
- ScPivotFieldWindow maWndSelect;
- FixedInfo maFtInfo;
-
- FixedLine maFlAreas;
- FixedText maFtInArea;
- ::formula::RefEdit maEdInPos;
- ::formula::RefButton maRbInPos;
- ListBox maLbOutPos;
- FixedText maFtOutArea;
- formula::RefEdit maEdOutPos;
- formula::RefButton maRbOutPos;
- CheckBox maBtnIgnEmptyRows;
- CheckBox maBtnDetectCat;
- CheckBox maBtnTotalCol;
- CheckBox maBtnTotalRow;
- CheckBox maBtnFilter;
- CheckBox maBtnDrillDown;
-
- OKButton maBtnOk;
- CancelButton maBtnCancel;
- HelpButton maBtnHelp;
- PushButton maBtnRemove;
- PushButton maBtnOptions;
- MoreButton maBtnMore;
-
- ::std::vector< String > maFuncNames; /// Localized function names from resource.
-
- ScDPObjectPtr mxDlgDPObject; /// Clone of the pivot table object this dialog is based on.
- ScPivotParam maPivotData; /// The pivot table field configuration.
- ScDPLabelDataVector maLabelData; /// Information about all dimensions.
-
- ScViewData* mpViewData;
- ScDocument* mpDoc;
- ScPivotFieldWindow* mpFocusWindow; /// Pointer to the field window that currently has the focus.
- ScPivotFieldWindow* mpTrackingWindow; /// Pointer to the field window that has started mouse tracking.
- ScPivotFieldWindow* mpDropWindow; /// Pointer to the field window that shows an insertion cursor.
- ::formula::RefEdit* mpActiveEdit;
- bool mbRefInputMode;
+ DECL_LINK( OkHdl, OKButton * );
+ DECL_LINK( CancelHdl, CancelButton * );
+ DECL_LINK( GetFocusHdl, Control* );
};
-// ============================================================================
+#endif // SC_PVLAYDLG_HXX
-#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/redcom.hxx b/sc/source/ui/inc/redcom.hxx
index a891fde67bec..c02a06b9ffec 100644
--- a/sc/source/ui/inc/redcom.hxx
+++ b/sc/source/ui/inc/redcom.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,14 +29,10 @@
#ifndef SC_REDCOM_HXX
#define SC_REDCOM_HXX
-//CHINA001 #ifndef _SVX_POSTDLG_HXX //autogen
-//CHINA001 #include <svx/postdlg.hxx>
-//CHINA001 #endif
-
#include "chgtrack.hxx"
class ScDocShell;
-class AbstractSvxPostItDialog; //CHINA001
+class AbstractSvxPostItDialog;
class ScRedComDialog
{
@@ -60,7 +57,7 @@ protected:
public:
ScRedComDialog( Window* pParent, const SfxItemSet& rCoreSet,
- ScDocShell *,ScChangeAction *,sal_Bool bPrevNext = sal_False);
+ ScDocShell *,ScChangeAction *,sal_Bool bPrevNext = false);
~ScRedComDialog();
short Execute();
@@ -68,3 +65,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index 1798c7287922..fc30485dbe92 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,7 +100,6 @@ class ScSimpleRefDlgWrapper: public SfxChildWindow
void StartRefInput();
};
-//<!--Added by PengYunQuan for Validity Cell Range Picker
class SC_DLLPUBLIC ScValidityRefChildWin : public SfxChildWindow
{
bool m_bVisibleLock:1;
@@ -114,9 +114,10 @@ public:
void Hide(){ if( !m_bVisibleLock) SfxChildWindow::Hide(); }
void Show( sal_uInt16 nFlags ){ if( !m_bVisibleLock ) SfxChildWindow::Show( nFlags ); }
};
-//-->Added by PengYunQuan for Validity Cell Range Picker
//==================================================================
#endif // SC_REFFACT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/refundo.hxx b/sc/source/ui/inc/refundo.hxx
index 5c80ab2d557e..25de386d023e 100644
--- a/sc/source/ui/inc/refundo.hxx
+++ b/sc/source/ui/inc/refundo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/retypepassdlg.hxx b/sc/source/ui/inc/retypepassdlg.hxx
index 59753d8d386b..92a41599821f 100644
--- a/sc/source/ui/inc/retypepassdlg.hxx
+++ b/sc/source/ui/inc/retypepassdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -172,3 +173,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/rfindlst.hxx b/sc/source/ui/inc/rfindlst.hxx
index 42699c5edae8..fed5f21e2b0e 100644
--- a/sc/source/ui/inc/rfindlst.hxx
+++ b/sc/source/ui/inc/rfindlst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,7 +50,7 @@ class ScRangeFindList
{
List aEntries;
String aDocName;
- sal_Bool bHidden;
+ bool bHidden;
public:
ScRangeFindList(const String& rName);
@@ -63,9 +64,9 @@ public:
void SetHidden( sal_Bool bSet ) { bHidden = bSet; }
const String& GetDocName() const { return aDocName; }
- sal_Bool IsHidden() const { return bHidden; }
+ bool IsHidden() const { return bHidden; }
- static ColorData GetColorName( sal_uInt16 nIndex );
+ static ColorData GetColorName( size_t nIndex );
};
@@ -73,3 +74,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/scendlg.hxx b/sc/source/ui/inc/scendlg.hxx
index 2a673d6d9c77..e9acea5c11aa 100644
--- a/sc/source/ui/inc/scendlg.hxx
+++ b/sc/source/ui/inc/scendlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@
class ScNewScenarioDlg : public ModalDialog
{
public:
- ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bool bEdit = sal_False, sal_Bool bSheetProtected = sal_False );
+ ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bool bEdit = false, sal_Bool bSheetProtected = false );
~ScNewScenarioDlg();
void SetScenarioData( const String& rName, const String& rComment,
@@ -78,3 +79,4 @@ private:
#endif // SC_SCENDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/scui_def.hxx b/sc/source/ui/inc/scui_def.hxx
index ca34ab0775b2..564b9f6eb362 100644
--- a/sc/source/ui/inc/scui_def.hxx
+++ b/sc/source/ui/inc/scui_def.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@
#define SCRET_REMOVE 0x42 //from subtdlg.hxx
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index 07b37dd6a61d..133d310c664e 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -145,3 +146,4 @@ inline bool ScImportAsciiDlg::Seek(sal_uLong nPos)
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx
index 455ad68ecfb1..00113dca3806 100644
--- a/sc/source/ui/inc/scuiautofmt.hxx
+++ b/sc/source/ui/inc/scuiautofmt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,3 +87,4 @@ private:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/scuiimoptdlg.hxx b/sc/source/ui/inc/scuiimoptdlg.hxx
index 08215d99e98d..9a0de3c23f4c 100644
--- a/sc/source/ui/inc/scuiimoptdlg.hxx
+++ b/sc/source/ui/inc/scuiimoptdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,8 +43,8 @@ public:
sal_Bool bAscii = sal_True,
const ScImportOptions* pOptions = NULL,
const String* pStrTitle = NULL,
- sal_Bool bMultiByte = sal_False,
- sal_Bool bOnlyDbtoolsEncodings = sal_False,
+ sal_Bool bMultiByte = false,
+ sal_Bool bOnlyDbtoolsEncodings = false,
sal_Bool bImport = sal_True );
~ScImportOptionsDlg();
@@ -77,3 +78,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index 84fb33e7a6ef..b8c3e20b8136 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -163,3 +164,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/select.hxx b/sc/source/ui/inc/select.hxx
index fa7718abd4bc..0c8ea64c4e0c 100644
--- a/sc/source/ui/inc/select.hxx
+++ b/sc/source/ui/inc/select.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_SELECT_HXX
#define SC_SELECT_HXX
-#ifndef _SELENG_HXX //autogen
#include <vcl/seleng.hxx>
-#endif
#include "viewdata.hxx" // ScSplitPos
@@ -65,6 +64,9 @@ private:
ScSplitPos GetWhich();
+ sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
+ bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll );
+
public:
ScViewFunctionSet( ScViewData* pNewViewData );
@@ -76,7 +78,7 @@ public:
virtual void BeginDrag();
virtual void CreateAnchor();
virtual void DestroyAnchor();
- virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False );
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = false );
virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
virtual void DeselectAtPoint( const Point& rPointPixel );
virtual void DeselectAll();
@@ -107,7 +109,7 @@ public:
virtual void BeginDrag();
virtual void CreateAnchor();
virtual void DestroyAnchor();
- virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False );
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = false );
virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
virtual void DeselectAtPoint( const Point& rPointPixel );
virtual void DeselectAll();
@@ -125,3 +127,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/selectionstate.hxx b/sc/source/ui/inc/selectionstate.hxx
index cbdc6b1faff7..f60b334bfed5 100644
--- a/sc/source/ui/inc/selectionstate.hxx
+++ b/sc/source/ui/inc/selectionstate.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ inline bool operator!=( const ScSelectionState& rL, const ScSelectionState& rR )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/seltrans.hxx b/sc/source/ui/inc/seltrans.hxx
index 3df2420f0ca3..9b0f39a39873 100644
--- a/sc/source/ui/inc/seltrans.hxx
+++ b/sc/source/ui/inc/seltrans.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/servobj.hxx b/sc/source/ui/inc/servobj.hxx
index 2a3fa940037a..b0bb345de3e9 100644
--- a/sc/source/ui/inc/servobj.hxx
+++ b/sc/source/ui/inc/servobj.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,7 +65,7 @@ public:
virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/,
const String & rMimeType,
- sal_Bool bSynchron = sal_False );
+ sal_Bool bSynchron = false );
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
void EndListeningAll();
@@ -74,3 +75,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx
index 52c2f393b19a..e15fde82102b 100644
--- a/sc/source/ui/inc/sharedocdlg.hxx
+++ b/sc/source/ui/inc/sharedocdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/shtabdlg.hxx b/sc/source/ui/inc/shtabdlg.hxx
index 07801cb9bba6..90dd3e217031 100644
--- a/sc/source/ui/inc/shtabdlg.hxx
+++ b/sc/source/ui/inc/shtabdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,16 +29,10 @@
#ifndef SC_SHTABDLG_HXX
#define SC_SHTABDLG_HXX
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <svtools/tooltiplbox.hxx>
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
//------------------------------------------------------------------------
@@ -73,3 +68,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/simpref.hrc b/sc/source/ui/inc/simpref.hrc
index d6fb6d4412eb..c7dbb3ebdea9 100644
--- a/sc/source/ui/inc/simpref.hrc
+++ b/sc/source/ui/inc/simpref.hrc
@@ -34,4 +34,3 @@
#define FT_ASSIGN 10
#define ED_ASSIGN 11
#define RB_ASSIGN 12
-
diff --git a/sc/source/ui/inc/simpref.hxx b/sc/source/ui/inc/simpref.hxx
index dc268901d30a..4dcf023b2780 100644
--- a/sc/source/ui/inc/simpref.hxx
+++ b/sc/source/ui/inc/simpref.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,21 +29,13 @@
#ifndef SC_SIMPREF_HXX
#define SC_SIMPREF_HXX
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
-#ifndef _COMBOBOX_HXX //autogen
#include <vcl/combobox.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _MOREBTN_HXX //autogen
#include <vcl/morebtn.hxx>
-#endif
#include "anyrefdg.hxx"
#include "dbcolect.hxx"
#include "expftext.hxx"
@@ -88,7 +81,7 @@ private:
protected:
- virtual void RefInputDone( sal_Bool bForced = sal_False );
+ virtual void RefInputDone( sal_Bool bForced = false );
public:
ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
@@ -120,3 +113,4 @@ public:
#endif // SC_DBNAMDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/sizedev.hxx b/sc/source/ui/inc/sizedev.hxx
index 2221396c97e2..d3cd5362b2b7 100644
--- a/sc/source/ui/inc/sizedev.hxx
+++ b/sc/source/ui/inc/sizedev.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/solveroptions.hrc b/sc/source/ui/inc/solveroptions.hrc
index e3be150ccd1b..3c543e61a8f5 100644
--- a/sc/source/ui/inc/solveroptions.hrc
+++ b/sc/source/ui/inc/solveroptions.hrc
@@ -44,4 +44,3 @@
#define NF_VALUE 1
#define ED_VALUE 1
-
diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx
index fc0714558be4..0d28b9e6f5ea 100644
--- a/sc/source/ui/inc/solveroptions.hxx
+++ b/sc/source/ui/inc/solveroptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <vcl/dialog.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
@@ -121,3 +120,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/solverutil.hxx b/sc/source/ui/inc/solverutil.hxx
index 89997e03c1a3..a447cec257fd 100644
--- a/sc/source/ui/inc/solverutil.hxx
+++ b/sc/source/ui/inc/solverutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/solvrdlg.hrc b/sc/source/ui/inc/solvrdlg.hrc
index 7139abd2a5f6..ab40fd3f72a2 100644
--- a/sc/source/ui/inc/solvrdlg.hrc
+++ b/sc/source/ui/inc/solvrdlg.hrc
@@ -43,4 +43,3 @@
#define STR_INVALIDVAR 2
#define STR_INVALIDFORM 3
#define STR_NOFORMULA 4
-
diff --git a/sc/source/ui/inc/solvrdlg.hxx b/sc/source/ui/inc/solvrdlg.hxx
index 18923980c437..86eb96f15b70 100644
--- a/sc/source/ui/inc/solvrdlg.hxx
+++ b/sc/source/ui/inc/solvrdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107,3 +108,4 @@ private:
#endif // SC_SOLVRDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/sortdlg.hrc b/sc/source/ui/inc/sortdlg.hrc
index 387690531cfd..f583dd3d2ce9 100644
--- a/sc/source/ui/inc/sortdlg.hrc
+++ b/sc/source/ui/inc/sortdlg.hrc
@@ -34,13 +34,6 @@
// -> SCSTR_UNDEFINED
// -> SCSTR_FIELD
-/*
-#define RID_SCDLG_SORT 256
-#define RID_SCPAGE_SORT_FIELDS 257
-#define RID_SCPAGE_SORT_OPTIONS 258
-#define RID_SCDLG_SORT_WARNING
-*/
-
#define TP_FIELDS 1
#define TP_OPTIONS 2
@@ -63,8 +56,6 @@
#define LB_SORT_USER 2
#define LB_OUTAREA 3
#define ED_OUTAREA 4
-#define FT_AREA_LABEL 5
-//#define FT_AREA 6
#define BTN_SORT_USER 7
#define BTN_CASESENSITIVE 8
#define BTN_LABEL 9
@@ -78,13 +69,10 @@
#define LB_LANGUAGE 17
#define FT_ALGORITHM 18
#define LB_ALGORITHM 19
+#define BTN_NATURALSORT 20
-//#define RID_SCDLG_SORT_WARNING
#define FT_TEXT 1
#define FT_TIP 2
#define BTN_EXTSORT 3
#define BTN_CURSORT 4
#define BTN_CANCEL 5
-
-
-
diff --git a/sc/source/ui/inc/sortdlg.hxx b/sc/source/ui/inc/sortdlg.hxx
index da7beb3f1b46..1d6e01d02b25 100644
--- a/sc/source/ui/inc/sortdlg.hxx
+++ b/sc/source/ui/inc/sortdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
-#include "scui_def.hxx" //CHINA001
+#include "scui_def.hxx"
#ifndef LAYOUT_SFX_TABDIALOG_BROKEN
#define LAYOUT_SFX_TABDIALOG_BROKEN 1
@@ -85,3 +86,5 @@ private:
#endif
#endif // SC_SORTDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/spelldialog.hxx b/sc/source/ui/inc/spelldialog.hxx
index 67f7a197c4ad..3639007655a9 100644
--- a/sc/source/ui/inc/spelldialog.hxx
+++ b/sc/source/ui/inc/spelldialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,3 +102,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/spelleng.hxx b/sc/source/ui/inc/spelleng.hxx
index 92f97164aaef..aae57483b8b6 100644
--- a/sc/source/ui/inc/spelleng.hxx
+++ b/sc/source/ui/inc/spelleng.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -167,3 +168,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/spellparam.hxx b/sc/source/ui/inc/spellparam.hxx
index ecc66d7ccdcb..77ebb2476091 100644
--- a/sc/source/ui/inc/spellparam.hxx
+++ b/sc/source/ui/inc/spellparam.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,3 +86,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/strindlg.hxx b/sc/source/ui/inc/strindlg.hxx
index a3a99684cddc..16630a099a41 100644
--- a/sc/source/ui/inc/strindlg.hxx
+++ b/sc/source/ui/inc/strindlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,4 @@ private:
#endif // SC_STRINDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/styledlg.hxx b/sc/source/ui/inc/styledlg.hxx
index 93eb54dd5ddd..73fab86b8088 100644
--- a/sc/source/ui/inc/styledlg.hxx
+++ b/sc/source/ui/inc/styledlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
#ifndef SC_STYLEDLG_HXX
#define SC_STYLEDLG_HXX
-#ifndef _SFX_HXX
-#endif
-
#include <sfx2/styledlg.hxx>
//==================================================================
@@ -57,3 +55,4 @@ private:
#endif // SC_STYLEDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/subtdlg.hrc b/sc/source/ui/inc/subtdlg.hrc
index 66c63df48953..b0680ece924b 100644
--- a/sc/source/ui/inc/subtdlg.hrc
+++ b/sc/source/ui/inc/subtdlg.hrc
@@ -27,12 +27,6 @@
#include "sc.hrc"
-/*
-#define RID_SCDLG_SUBTOTALS 256
-#define RID_SCPAGE_SUBT_GROUP 256
-#define RID_SCPAGE_SUBT_OPTIONS 257
-*/
-
// TabDialog
#define BTN_REMOVE 1
#define PAGE_GROUP1 2
@@ -60,5 +54,3 @@
#define BTN_FORMATS 33
#define BTN_USERDEF 34
#define LB_USERDEF 35
-
-
diff --git a/sc/source/ui/inc/subtdlg.hxx b/sc/source/ui/inc/subtdlg.hxx
index ec68d0e1fba1..d2ca8b9e8d37 100644
--- a/sc/source/ui/inc/subtdlg.hxx
+++ b/sc/source/ui/inc/subtdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,9 @@
#ifndef SC_SUBTDLG_HXX
#define SC_SUBTDLG_HXX
-#ifndef _SFX_HXX
-#endif
-
#include <sfx2/tabdlg.hxx>
-#include "scui_def.hxx" //CHINA001
-//------------------------------------------------------------------------
-
-//CHINA001 #define SCRET_REMOVE 0x42
+#include "scui_def.hxx"
//==================================================================
@@ -54,3 +49,4 @@ private:
#endif // SC_SUBTDLG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabbgcolordlg.hxx b/sc/source/ui/inc/tabbgcolordlg.hxx
index 64145a58a07c..7c1870aa6cad 100644
--- a/sc/source/ui/inc/tabbgcolordlg.hxx
+++ b/sc/source/ui/inc/tabbgcolordlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: tabbgcolordlg.hxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -77,3 +75,5 @@ private:
};
#endif // SC_TABBGCOLORDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx
index e1bb3809207e..6e922fa00a29 100644
--- a/sc/source/ui/inc/tabcont.hxx
+++ b/sc/source/ui/inc/tabcont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,6 +77,7 @@ public:
using TabBar::StartDrag;
+ void UpdateInputContext();
void UpdateStatus();
void ActivateView(sal_Bool bActivate);
@@ -85,3 +87,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabopdlg.hrc b/sc/source/ui/inc/tabopdlg.hrc
index 5ae127b63e73..633c69881776 100644
--- a/sc/source/ui/inc/tabopdlg.hrc
+++ b/sc/source/ui/inc/tabopdlg.hrc
@@ -46,5 +46,3 @@
#define STR_WRONGROWCOL 4
#define STR_NOCOLFORMULA 5
#define STR_NOROWFORMULA 6
-
-
diff --git a/sc/source/ui/inc/tabopdlg.hxx b/sc/source/ui/inc/tabopdlg.hxx
index 088f6c28a140..4f43614adde8 100644
--- a/sc/source/ui/inc/tabopdlg.hxx
+++ b/sc/source/ui/inc/tabopdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,3 +113,4 @@ private:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx
index 742519fc8929..cec2618541ac 100644
--- a/sc/source/ui/inc/tabpages.hxx
+++ b/sc/source/ui/inc/tabpages.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef SC_TABPAGES_HXX
#define SC_TABPAGES_HXX
-#ifndef _GROUP_HXX //autogen
#include <vcl/group.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <sfx2/tabdlg.hxx>
@@ -81,3 +80,5 @@ private:
#endif // SC_TABPAGES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabpopsh.hxx b/sc/source/ui/inc/tabpopsh.hxx
index 177e3d75136f..b9db71011897 100644
--- a/sc/source/ui/inc/tabpopsh.hxx
+++ b/sc/source/ui/inc/tabpopsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabsplit.hxx b/sc/source/ui/inc/tabsplit.hxx
index 751df38a598b..23ba73b6b307 100644
--- a/sc/source/ui/inc/tabsplit.hxx
+++ b/sc/source/ui/inc/tabsplit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,3 +59,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 9c3327805a88..7ca610e85453 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,11 +30,6 @@
#include <vcl/scrbar.hxx>
-//REMOVE #ifndef SO2_DECL_SVINPLACECLIENT_DEFINED
-//REMOVE #define SO2_DECL_SVINPLACECLIENT_DEFINED
-//REMOVE SO2_DECL_REF(SvInPlaceClient)
-//REMOVE #endif
-
#include <sfx2/ipclient.hxx>
#include "viewutil.hxx"
@@ -176,7 +172,6 @@ private:
sal_Bool bInActivatePart;
sal_Bool bInZoomUpdate;
sal_Bool bMoveIsShift;
- sal_Bool bNewStartIfMarking;
void Init();
@@ -197,6 +192,13 @@ private:
static void SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, sal_Bool bLayoutRTL );
static long GetScrollBarPos( ScrollBar& rScroll, sal_Bool bLayoutRTL );
+ void GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY);
+ void GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
+ SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode);
+
+ void SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nMovX);
+ void SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, SCsROW nMovY);
+
protected:
void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL,
const SCROW* pPosY = NULL );
@@ -206,6 +208,7 @@ protected:
void ZoomChanged();
void UpdateShow();
+ void UpdateVisibleRange();
void GetBorderSize( SvBorder& rBorder, const Size& rSize );
void ResetDrawDragMode();
@@ -221,7 +224,6 @@ protected:
public:
ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
-//UNUSED2009-05 ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell );
~ScTabView();
void MakeDrawLayer();
@@ -249,7 +251,7 @@ public:
/** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */
double GetPendingRelTabBarWidth() const;
- void DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInner = sal_False );
+ void DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInner = false );
void RepeatResize( sal_Bool bUpdateFix = sal_True );
void UpdateFixPos();
Point GetGridOffset() const;
@@ -265,12 +267,11 @@ public:
void DrawDeselectAll();
void DrawMarkListHasChanged();
void UpdateAnchorHandles();
-//UNUSED2008-05 String GetSelectedChartName() const;
ScPageBreakData* GetPageBreakData() { return pPageBreakData; }
ScHighlightRanges* GetHighlightRanges() { return pHighlightRanges; }
- void UpdatePageBreakData( sal_Bool bForcePaint = sal_False );
+ void UpdatePageBreakData( sal_Bool bForcePaint = false );
void DrawMarkRect( const Rectangle& rRect );
@@ -302,11 +303,10 @@ public:
void InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType,
sal_Bool bPaint = sal_True );
- void DoneRefMode( sal_Bool bContinue = sal_False );
+ void DoneRefMode( sal_Bool bContinue = false );
void UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ );
void StopRefMode();
-//UNUSED2008-05 void EndSelection();
void StopMarking();
void FakeButtonUp( ScSplitPos eWhich );
@@ -316,16 +316,12 @@ public:
ScSplitPos FindWindow( Window* pWindow ) const;
void SetActivePointer( const Pointer& rPointer );
-//UNUSED2008-05 void SetActivePointer( const ResId& rId );
void ActiveGrabFocus();
-//UNUSED2008-05 void ActiveCaptureMouse();
-//UNUSED2008-05 void ActiveReleaseMouse();
-//UNUSED2008-05 Point ActivePixelToLogic( const Point& rDevicePoint );
void ClickCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bControl );
- SC_DLLPUBLIC void SetCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bNew = sal_False );
+ SC_DLLPUBLIC void SetCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bNew = false );
SC_DLLPUBLIC void CellContentChanged();
void SelectionChanged();
@@ -369,15 +365,15 @@ public:
SC_DLLPUBLIC void MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
sal_Bool bShift, sal_Bool bControl,
- sal_Bool bKeepOld = sal_False, sal_Bool bKeepSel = sal_False );
+ sal_Bool bKeepOld = false, sal_Bool bKeepSel = false );
void MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
- sal_Bool bShift, sal_Bool bKeepSel = sal_False );
+ sal_Bool bShift, sal_Bool bKeepSel = false );
void MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
- sal_Bool bShift, sal_Bool bKeepSel = sal_False );
+ sal_Bool bShift, sal_Bool bKeepSel = false );
void MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
- sal_Bool bShift, sal_Bool bKeepSel = sal_False );
+ sal_Bool bShift, sal_Bool bKeepSel = false );
void MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
- sal_Bool bShift, sal_Bool bKeepSel = sal_False );
+ sal_Bool bShift, sal_Bool bKeepSel = false );
void MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift );
void MoveCursorEnter( sal_Bool bShift ); // Shift fuer Richtung (kein Markieren)
@@ -386,11 +382,8 @@ public:
void FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection = sal_True );
- void SetNewStartIfMarking();
-
- // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet
- SC_DLLPUBLIC void SetTabNo( SCTAB nTab, sal_Bool bNew = sal_False, sal_Bool bExtendSelection = sal_False, bool bSameTabButMoved = false );
- void SelectNextTab( short nDir, sal_Bool bExtendSelection = sal_False );
+ SC_DLLPUBLIC void SetTabNo( SCTAB nTab, sal_Bool bNew = false, sal_Bool bExtendSelection = false );
+ void SelectNextTab( short nDir, sal_Bool bExtendSelection = false );
void ActivateView( sal_Bool bActivate, sal_Bool bFirst );
void ActivatePart( ScSplitPos eWhich );
@@ -410,15 +403,6 @@ public:
// Zeichnen
- void InvertBlockMark(SCCOL nBlockStartX, SCROW nBlockStartY,
- SCCOL nBlockEndX, SCROW nBlockEndY);
-
-//UNUSED2008-05 void DrawDragRect( SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY,
-//UNUSED2008-05 ScSplitPos ePos );
-//UNUSED2008-05 void PaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab );
-//UNUSED2008-05 void PaintLeftRow( SCROW nRow );
-//UNUSED2008-05 void PaintTopCol( SCCOL nCol );
-
void PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
ScUpdateMode eMode = SC_UPDATE_ALL );
@@ -436,6 +420,7 @@ public:
void CreateAnchorHandles(SdrHdlList& rHdl, const ScAddress& rAddress);
+ void UpdateCopySourceOverlay();
void UpdateSelectionOverlay();
void UpdateShrinkOverlay();
void UpdateAllOverlays();
@@ -466,32 +451,36 @@ public:
// Bloecke
- void SelectAll( sal_Bool bContinue = sal_False );
+ void SelectAll( sal_Bool bContinue = false );
void SelectAllTables();
void DeselectAllTables();
void MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
- sal_Bool bCols = sal_False, sal_Bool bRows = sal_False, sal_Bool bCellSelection = sal_False );
+ sal_Bool bCols = false, sal_Bool bRows = false, sal_Bool bCellSelection = false );
void InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
- sal_Bool bTestNeg = sal_False,
- sal_Bool bCols = sal_False, sal_Bool bRows = sal_False );
+ sal_Bool bTestNeg = false,
+ sal_Bool bCols = false, sal_Bool bRows = false );
void InitOwnBlockMode();
- void DoneBlockMode( sal_Bool bContinue = sal_False );
+ void DoneBlockMode( sal_Bool bContinue = false );
sal_Bool IsBlockMode() const { return bIsBlockMode; }
+ void ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode);
+ void ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY);
+ void ExpandBlockArea(SCsCOL nMovX, SCsROW nMovY);
+
void MarkColumns();
void MarkRows();
void MarkDataArea( sal_Bool bIncludeCursor = sal_True );
void MarkMatrixFormula();
void Unmark();
- void MarkRange( const ScRange& rRange, sal_Bool bSetCursor = sal_True, sal_Bool bContinue = sal_False );
+ void MarkRange( const ScRange& rRange, sal_Bool bSetCursor = sal_True, sal_Bool bContinue = false );
sal_Bool IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
void PaintMarks( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
- void PaintBlock( sal_Bool bReset = sal_False );
+ void PaintBlock( sal_Bool bReset = false );
void SetMarkData( const ScMarkData& rNew );
void MarkDataChanged();
@@ -499,7 +488,7 @@ public:
void LockModifiers( sal_uInt16 nModifiers );
sal_uInt16 GetLockedModifiers() const;
void ViewOptionsHasChanged( sal_Bool bHScrollChanged,
- sal_Bool bGraphicsChanged = sal_False);
+ sal_Bool bGraphicsChanged = false);
Point GetMousePosPixel();
@@ -530,3 +519,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 241b1842ad07..49fd72ea8106 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -168,7 +169,6 @@ private:
SbxObject* pScSbxObject;
-//UNUSED2008-05 sal_Bool bChartDlgIsEdit; // Datenbereich aendern
sal_Bool bChartAreaValid; // wenn Chart aufgezogen wird
String aEditChartName;
ScRangeListRef aChartSource;
@@ -184,7 +184,6 @@ private:
private:
void Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
-//UNUSED2008-05 void SetMySubShell( SfxShell* pShell );
SfxShell* GetMySubShell() const;
void DoReadUserData( const String& rData );
@@ -201,9 +200,9 @@ private:
protected:
virtual void Activate(sal_Bool bMDI);
virtual void Deactivate(sal_Bool bMDI);
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false );
- virtual void ShowCursor(FASTBOOL bOn);
+ virtual void ShowCursor(bool bOn);
virtual void Move(); // Benachrichtigung
@@ -221,14 +220,14 @@ protected:
virtual sal_Bool HasSelection( sal_Bool bText ) const;
virtual String GetDescription() const;
- virtual void WriteUserData(String &, sal_Bool bBrowse = sal_False);
- virtual void ReadUserData(const String &, sal_Bool bBrowse = sal_False);
- virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
- virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
+ virtual void WriteUserData(String &, sal_Bool bBrowse = false);
+ virtual void ReadUserData(const String &, sal_Bool bBrowse = false);
+ virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
+ virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false );
virtual void UIDeactivated( SfxInPlaceClient* pClient );
- virtual FASTBOOL KeyInput( const KeyEvent &rKeyEvent );
+ virtual bool KeyInput( const KeyEvent &rKeyEvent );
virtual SdrView* GetDrawView() const;
public:
@@ -240,9 +239,6 @@ public:
// -> Clone-Methode fuer Factory
-//UNUSED2008-05 ScTabViewShell( SfxViewFrame* pViewFrame,
-//UNUSED2008-05 const ScTabViewShell& rWin );
-
// aus einer allgemeinen Shell konstruieren und
// soviel wie moeglich uebernehmen (SliderPos etc.):
@@ -251,13 +247,13 @@ public:
virtual ~ScTabViewShell();
- Window* GetDialogParent();
+ SC_DLLPUBLIC Window* GetDialogParent();
bool IsRefInputMode() const;
void ExecuteInputDirect();
ScInputHandler* GetInputHandler() const;
- void UpdateInputHandler( sal_Bool bForce = sal_False, sal_Bool bStopEditing = sal_True );
+ void UpdateInputHandler( sal_Bool bForce = false, sal_Bool bStopEditing = sal_True );
void UpdateInputHandlerCellAdjust( SvxCellHorJustify eJust );
sal_Bool TabKeyInput(const KeyEvent& rKEvt);
sal_Bool SfxKeyInput(const KeyEvent& rKEvt);
@@ -267,9 +263,6 @@ public:
SvxBorderLine* GetDefaultFrameLine() const { return pCurFrameLine; }
void SetDefaultFrameLine(const SvxBorderLine* pLine );
-//UNUSED2008-05 void ExecuteShowNIY( SfxRequest& rReq );
-//UNUSED2008-05 void StateDisabled( SfxItemSet& rSet );
-
SC_DLLPUBLIC void Execute( SfxRequest& rReq );
SC_DLLPUBLIC void GetState( SfxItemSet& rSet );
@@ -297,7 +290,7 @@ public:
void GetSaveState( SfxItemSet& rSet );
void ExecSearch( SfxRequest& rReq );
- void ExecuteUndo(SfxRequest& rReq);
+ SC_DLLPUBLIC void ExecuteUndo(SfxRequest& rReq);
void GetUndoState(SfxItemSet &rSet);
void ExecuteSbx( SfxRequest& rReq );
@@ -333,7 +326,7 @@ public:
void SetDrawShellOrSub();
- void SetCurSubShell( ObjectSelectionType eOST, sal_Bool bForce = sal_False );
+ void SetCurSubShell( ObjectSelectionType eOST, sal_Bool bForce = false );
void SetFormShellAtTop( sal_Bool bSet );
@@ -350,22 +343,17 @@ public:
void FillFieldData( ScHeaderFieldData& rData );
-//UNUSED2008-05 void ResetChartArea();
void SetChartArea( const ScRangeListRef& rSource, const Rectangle& rDest );
sal_Bool GetChartArea( ScRangeListRef& rSource, Rectangle& rDest, SCTAB& rTab ) const;
-//UNUSED2008-05 sal_Bool IsChartDlgEdit() const;
-//UNUSED2008-05 void SetChartDlgEdit(sal_Bool bFlag){bChartDlgIsEdit=bFlag;}
-
void SetEditChartName(const String& aStr){aEditChartName=aStr;}
-//UNUSED2008-05 const String& GetEditChartName() const;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
ScNavigatorSettings* GetNavigatorSettings();
// Drucken:
- virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
+ virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false );
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter,
sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false );
@@ -434,3 +422,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/target.hxx b/sc/source/ui/inc/target.hxx
index 6fc62ffaa8cf..f01793b80206 100644
--- a/sc/source/ui/inc/target.hxx
+++ b/sc/source/ui/inc/target.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tbinsert.hrc b/sc/source/ui/inc/tbinsert.hrc
index 44c0d295cfc6..78ff1ca0ec84 100644
--- a/sc/source/ui/inc/tbinsert.hrc
+++ b/sc/source/ui/inc/tbinsert.hrc
@@ -28,5 +28,3 @@
#define RID_TOOLBOX_INSERT 1
#define RID_TOOLBOX_INSCELLS 2
#define RID_TOOLBOX_INSOBJ 3
-
-
diff --git a/sc/source/ui/inc/tbinsert.hxx b/sc/source/ui/inc/tbinsert.hxx
index 27b9ceff8520..1910b2f7a081 100644
--- a/sc/source/ui/inc/tbinsert.hxx
+++ b/sc/source/ui/inc/tbinsert.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,16 +31,12 @@
#include <sfx2/tbxctrl.hxx>
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-
class ScTbxInsertCtrl : public SfxToolBoxControl
{
sal_uInt16 nLastSlotId;
using SfxToolBoxControl::Select;
- virtual void Select( sal_Bool bMod1 = sal_False );
+ virtual void Select( sal_Bool bMod1 = false );
public:
SFX_DECL_TOOLBOX_CONTROL();
@@ -54,35 +51,6 @@ public:
const SfxPoolItem* pState );
};
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-/*
-class ScTbxInsertPopup : public SfxPopupWindow
-{
- SfxToolBoxManager aTbx;
- ResId aRIdWinTemp;
- ResId aRIdTbxTemp;
-
- Link aTbxClickHdl;
-
- DECL_LINK( TbxSelectHdl, ToolBox* );
- DECL_LINK( TbxClickHdl, ToolBox* );
-
-protected:
- virtual void PopupModeEnd();
-
-public:
- ScTbxInsertPopup( sal_uInt16 nId, WindowAlign eAlign,
- const ResId& rRIdWin, const ResId& rRIdTbx,
- SfxBindings& rBindings );
- ~ScTbxInsertPopup();
-
- virtual SfxPopupWindow* Clone() const;
- void StartSelection();
-};
-*/
-
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tbzoomsliderctrl.hxx b/sc/source/ui/inc/tbzoomsliderctrl.hxx
index c442c3e7c0ac..481801c14af4 100644
--- a/sc/source/ui/inc/tbzoomsliderctrl.hxx
+++ b/sc/source/ui/inc/tbzoomsliderctrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,21 +28,11 @@
#ifndef _SC_ZOOMSLIDERTBCONTRL_HXX
#define _SC_ZOOMSLIDERTBCONTRL_HXX
-#ifndef _WINDOW_HXX //autogen
#include <vcl/window.hxx>
-#endif
-#ifndef _SFXPOOLITEM_HXX //autogen
#include <svl/poolitem.hxx>
-#endif
-#ifndef _SFXTBXCTRL_HXX //autogen
#include <sfx2/tbxctrl.hxx>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
#include <com/sun/star/frame/XDispatchProvider.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
#include <com/sun/star/frame/XFrame.hpp>
-#endif
#include <svx/zoomslideritem.hxx>
@@ -85,3 +76,5 @@ protected:
virtual void Paint( const Rectangle& rRect );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/textdlgs.hxx b/sc/source/ui/inc/textdlgs.hxx
index de580944ef26..202409e00d7b 100644
--- a/sc/source/ui/inc/textdlgs.hxx
+++ b/sc/source/ui/inc/textdlgs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/textimportoptions.hrc b/sc/source/ui/inc/textimportoptions.hrc
index 93c554ef5c45..f31c5ab05eb5 100644
--- a/sc/source/ui/inc/textimportoptions.hrc
+++ b/sc/source/ui/inc/textimportoptions.hrc
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: retypepassdlg.src,v $
- * $Revision: 1.1.2.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sc/source/ui/inc/textimportoptions.hxx b/sc/source/ui/inc/textimportoptions.hxx
index bbb2bf6ebf09..82fa4a67fcb4 100644
--- a/sc/source/ui/inc/textimportoptions.hxx
+++ b/sc/source/ui/inc/textimportoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: langbox.hxx,v $
- * $Revision: 1.4.242.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -74,3 +72,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 1c664ecb8f1f..9ab7c107561b 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,6 @@ private:
RadioButton aBtnDateSc10;
RadioButton aBtnDate1904;
- FixedLine aHSeparatorFL;
CheckBox aBtnCase;
CheckBox aBtnCalc;
CheckBox aBtnMatch;
@@ -100,3 +100,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx
new file mode 100644
index 000000000000..70d043d5ddec
--- /dev/null
+++ b/sc/source/ui/inc/tpcompatibility.hxx
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * LibreOffice - a multi-platform office productivity suite
+ *
+ * This file is part of LibreOffice.
+ *
+ * LibreOffice 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.
+ *
+ * LibreOffice 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 LibreOffice. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __SC_TPCOMPATIBILITY_HXX__
+#define __SC_TPCOMPATIBILITY_HXX__
+
+#include <sfx2/tabdlg.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+class ScDocOptions;
+
+class ScTpCompatOptions : public SfxTabPage
+{
+public:
+ static SfxTabPage* Create (Window* pParent, const SfxItemSet& rCoreAttrs);
+
+ virtual sal_Bool FillItemSet(SfxItemSet& rCoreAttrs);
+ virtual void Reset(const SfxItemSet& rCoreAttrs);
+ virtual int DeactivatePage(SfxItemSet* pSet = NULL);
+
+private:
+ explicit ScTpCompatOptions(Window* pParent, const SfxItemSet& rCoreAttrs);
+ virtual ~ScTpCompatOptions();
+
+private:
+ FixedLine maFlKeyBindings;
+ FixedText maFtKeyBindings;
+ ListBox maLbKeyBindings;
+
+ ::boost::shared_ptr<ScDocOptions> mpOldOptions;
+ ::boost::shared_ptr<ScDocOptions> mpNewOptions;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
new file mode 100644
index 000000000000..41746603c5f1
--- /dev/null
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * 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 SC_TPFORMULA_HXX
+#define SC_TPFORMULA_HXX
+
+#include <sfx2/tabdlg.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/button.hxx>
+
+#include <memory>
+
+class ScDocOptions;
+class SfxItemSet;
+class Window;
+
+class ScTpFormulaOptions : public SfxTabPage
+{
+public:
+ static SfxTabPage* Create (Window* pParent, const SfxItemSet& rCoreSet);
+
+// static USHORT* GetRanges();
+ virtual sal_Bool FillItemSet(SfxItemSet& rCoreSet);
+ virtual void Reset( const SfxItemSet& rCoreSet );
+ virtual int DeactivatePage(SfxItemSet* pSet = NULL);
+
+private:
+ explicit ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreSet);
+ virtual ~ScTpFormulaOptions();
+
+ void Init();
+ void ResetSeparators();
+ void OnFocusSeparatorInput(Edit* pEdit);
+
+ bool IsValidSeparator(const ::rtl::OUString& rSep) const;
+ bool IsValidSeparatorSet() const;
+
+ DECL_LINK( ButtonHdl, PushButton* );
+ DECL_LINK( SepModifyHdl, Edit* );
+ DECL_LINK( SepEditOnFocusHdl, Edit* );
+
+private:
+ FixedLine maFlFormulaOpt;
+ FixedText maFtFormulaSyntax;
+ ListBox maLbFormulaSyntax;
+ CheckBox maCbEnglishFuncName;
+
+ FixedLine maFlFormulaSeps;
+ FixedText maFtSepFuncArg;
+ Edit maEdSepFuncArg;
+ FixedText maFtSepArrayCol;
+ Edit maEdSepArrayCol;
+ FixedText maFtSepArrayRow;
+ Edit maEdSepArrayRow;
+ PushButton maBtnSepReset;
+
+ ::std::auto_ptr<ScDocOptions> mpOldOptions;
+ ::std::auto_ptr<ScDocOptions> mpNewOptions;
+
+ /** Stores old separator value of currently focused separator edit box.
+ This value is used to revert undesired value change. */
+ ::rtl::OUString maOldSepValue;
+
+ sal_Unicode mnDecSep;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index e63985d300e8..171b1a56af90 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,8 +53,6 @@ protected:
const SfxItemSet& rSet,
sal_uInt16 nSetId );
-// using SvxHFPage::ActivatePage;
-// using SvxHFPage::DeactivatePage;
virtual void ActivatePage();
virtual void DeactivatePage();
virtual void ActivatePage( const SfxItemSet& rSet );
@@ -101,3 +100,4 @@ private:
#endif // SC_TPHF_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx
index 3cdc6e91c882..7c1a994e1080 100644
--- a/sc/source/ui/inc/tphfedit.hxx
+++ b/sc/source/ui/inc/tphfedit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <svx/pageitem.hxx>
#include <svtools/stdctrl.hxx>
#include <vcl/group.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <vcl/timer.hxx>
#include <vcl/virdev.hxx>
#include "scdllapi.h"
@@ -53,7 +52,7 @@ class SvxFieldItem;
class ScAccessibleEditObject;
class ScEditWindow;
-SC_DLLPUBLIC ScEditWindow* GetScEditWindow (); //CHINA001
+SC_DLLPUBLIC ScEditWindow* GetScEditWindow ();
enum ScEditWindowLocation
{
@@ -114,8 +113,6 @@ private:
SC_DLLPRIVATE DECL_LINK( TimerHdl, Timer*);
-// void DrawArrow();
-
protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt );
@@ -138,102 +135,6 @@ public:
virtual long PreNotify( NotifyEvent& rNEvt );
};
-
-//===================================================================
-//CHINA001
-//CHINA001 class ScHFEditPage : public SfxTabPage
-//CHINA001 {
-//CHINA001 public:
-//CHINA001 virtual sal_Bool FillItemSet ( SfxItemSet& rCoreSet );
-//CHINA001 virtual void Reset ( const SfxItemSet& rCoreSet );
-//CHINA001
-//CHINA001 void SetNumType(SvxNumType eNumType);
-//CHINA001
-//CHINA001 protected:
-//CHINA001 ScHFEditPage( Window* pParent,
-//CHINA001 sal_uInt16 nResId,
-//CHINA001 const SfxItemSet& rCoreSet,
-//CHINA001 sal_uInt16 nWhich );
-//CHINA001 virtual ~ScHFEditPage();
-//CHINA001
-//CHINA001 private:
-//CHINA001 FixedText aFtLeft;
-//CHINA001 ScEditWindow aWndLeft;
-//CHINA001 FixedText aFtCenter;
-//CHINA001 ScEditWindow aWndCenter;
-//CHINA001 FixedText aFtRight;
-//CHINA001 ScEditWindow aWndRight;
-//CHINA001 ImageButton aBtnText;
-//CHINA001 ScExtIButton aBtnFile;
-//CHINA001 ImageButton aBtnTable;
-//CHINA001 ImageButton aBtnPage;
-//CHINA001 ImageButton aBtnLastPage;
-//CHINA001 ImageButton aBtnDate;
-//CHINA001 ImageButton aBtnTime;
-//CHINA001 FixedLine aFlInfo;
-//CHINA001 FixedInfo aFtInfo;
-//CHINA001 ScPopupMenu aPopUpFile;
-//CHINA001
-//CHINA001 sal_uInt16 nWhich;
-//CHINA001 String aCmdArr[6];
-//CHINA001
-//CHINA001 private:
-//CHINA001 #ifdef _TPHFEDIT_CXX
-//CHINA001 void FillCmdArr();
-//CHINA001 DECL_LINK( ClickHdl, ImageButton* );
-//CHINA001 DECL_LINK( MenuHdl, ScExtIButton* );
-//CHINA001 #endif
-//CHINA001 };
-//CHINA001
-//CHINA001 //===================================================================
-//CHINA001
-//CHINA001 class ScRightHeaderEditPage : public ScHFEditPage
-//CHINA001 {
-//CHINA001 public:
-//CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
-//CHINA001 static sal_uInt16* GetRanges();
-//CHINA001
-//CHINA001 private:
-//CHINA001 ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
-//CHINA001 };
-//CHINA001
-//CHINA001 //===================================================================
-//CHINA001
-//CHINA001 class ScLeftHeaderEditPage : public ScHFEditPage
-//CHINA001 {
-//CHINA001 public:
-//CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
-//CHINA001 static sal_uInt16* GetRanges();
-//CHINA001
-//CHINA001 private:
-//CHINA001 ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
-//CHINA001 };
-//CHINA001
-//CHINA001 //===================================================================
-//CHINA001
-//CHINA001 class ScRightFooterEditPage : public ScHFEditPage
-//CHINA001 {
-//CHINA001 public:
-//CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
-//CHINA001 static sal_uInt16* GetRanges();
-//CHINA001
-//CHINA001 private:
-//CHINA001 ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
-//CHINA001 };
-//CHINA001
-//CHINA001 //===================================================================
-//CHINA001
-//CHINA001 class ScLeftFooterEditPage : public ScHFEditPage
-//CHINA001 {
-//CHINA001 public:
-//CHINA001 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet );
-//CHINA001 static sal_uInt16* GetRanges();
-//CHINA001
-//CHINA001 private:
-//CHINA001 ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
-//CHINA001 };
-
-
-
#endif // SC_TPHFEDIT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx
index 3eae915e0768..7aa00147fa64 100644
--- a/sc/source/ui/inc/tpprint.hxx
+++ b/sc/source/ui/inc/tpprint.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index 83769422e2a7..8f22696c879d 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,7 @@ class ScSortDlg;
struct ScSortParam;
//========================================================================
-// Kriterien
+// Kriterien (Sort Criteria)
class ScTabPageSortFields : public SfxTabPage
{
@@ -122,7 +123,7 @@ private:
};
//========================================================================
-// Sortieroptionen:
+// Sortieroptionen (Sort Options)
class ScDocument;
class ScRangeData;
@@ -164,6 +165,7 @@ private:
CheckBox aBtnCase;
CheckBox aBtnHeader;
CheckBox aBtnFormats;
+ CheckBox aBtnNaturalSort;
CheckBox aBtnCopyResult;
ListBox aLbOutPos;
@@ -181,7 +183,7 @@ private:
RadioButton aBtnTopDown;
RadioButton aBtnLeftRight;
- FixedText aFtAreaLabel;
+// FixedText aFtAreaLabel;
// FixedInfo aFtArea;
LocalizedString aStrRowLabel;
LocalizedString aStrColLabel;
@@ -220,3 +222,4 @@ private:
#endif // SC_TPSORT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpstat.hxx b/sc/source/ui/inc/tpstat.hxx
index 3725f58d8637..46f6b7fdaf0e 100644
--- a/sc/source/ui/inc/tpstat.hxx
+++ b/sc/source/ui/inc/tpstat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index a370e73934ba..049633ad40b6 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -186,3 +187,4 @@ private:
#endif // SC_TPSORT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx
index 0e0eea20efdb..d72b9f306e4e 100644
--- a/sc/source/ui/inc/tptable.hxx
+++ b/sc/source/ui/inc/tptable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,8 +78,6 @@ private:
FixedImage aBmpPageDir;
Image aImgLeftRight;
Image aImgTopDown;
- Image aImgLeftRightHC;
- Image aImgTopDownHC;
CheckBox aBtnPageNo;
NumericField aEdPageNo;
@@ -113,3 +112,5 @@ private:
};
#endif // SC_TPTABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx
index 99d5b21f8db9..f627baa52225 100644
--- a/sc/source/ui/inc/tpusrlst.hxx
+++ b/sc/source/ui/inc/tpusrlst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,3 +116,4 @@ private:
#endif // SC_TPUSRLST_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index 0c839c513c2a..68093f0ce0f5 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -169,3 +170,4 @@ public:
#endif // SC_TPUSRLST_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx
index 4cfbc4ba1673..2afa83c05cb6 100644
--- a/sc/source/ui/inc/transobj.hxx
+++ b/sc/source/ui/inc/transobj.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,8 +53,6 @@ private:
SCROW nNonFiltered; // non-filtered rows
TransferableDataHelper aOleData;
TransferableObjectDescriptor aObjDesc;
-//REMOVE SvEmbeddedObjectRef aDocShellRef;
-//REMOVE SvEmbeddedObjectRef aDrawPersistRef;
SfxObjectShellRef aDocShellRef;
SfxObjectShellRef aDrawPersistRef;
com::sun::star::uno::Reference<com::sun::star::sheet::XSheetCellRanges> xDragSourceRanges;
@@ -116,3 +115,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx
index c7ec17209085..c97c14143798 100644
--- a/sc/source/ui/inc/ui_pch.hxx
+++ b/sc/source/ui/inc/ui_pch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,6 @@
#define _PRINTFUN_CXX
#define _INPUTHDL_CXX
-// ab hier automatisch per makepch generiert
-// folgende duerfen nicht aufgenommen werden:
-// scslots.hxx
-
#include <tools/solar.h>
#include <tools/string.hxx>
#include <svl/solar.hrc>
@@ -46,7 +43,6 @@
#include <tools/contnr.hxx>
#include <vcl/sv.h>
#include <tools/ref.hxx>
-#include <tools/list.hxx>
#include <tools/link.hxx>
#include <i18npool/lang.h>
#include <sfx2/sfx.hrc>
@@ -67,7 +63,6 @@
#include <vcl/region.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/bitmap.hxx>
-#include <sot/sotref.hxx>
#include <svx/svxids.hrc>
#include <vcl/vclenum.hxx>
#include <sot/object.hxx>
@@ -184,7 +179,7 @@
#include <scresid.hxx>
#include <sfx2/ipfrm.hxx>
#include <docsh.hxx>
-//REMOVE #include <sfx2/interno.hxx>
+#include <vcl/wintypes.hxx>
#include <sfx2/docfac.hxx>
#include <scitems.hxx>
#include <vcl/virdev.hxx>
@@ -329,3 +324,4 @@
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/uiitems.hxx b/sc/source/ui/inc/uiitems.hxx
index 1b86a5722e54..f35302c92901 100644
--- a/sc/source/ui/inc/uiitems.hxx
+++ b/sc/source/ui/inc/uiitems.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,13 +55,6 @@ class ScInputStatusItem : public SfxPoolItem
public:
TYPEINFO();
-//UNUSED2008-05 ScInputStatusItem( sal_uInt16 nWhich,
-//UNUSED2008-05 SCTAB nTab,
-//UNUSED2008-05 SCCOL nCol, SCROW nRow,
-//UNUSED2008-05 SCCOL nStartCol, SCROW nStartRow,
-//UNUSED2008-05 SCCOL nEndCol, SCROW nSEndRow,
-//UNUSED2008-05 const String& rString,
-//UNUSED2008-05 const EditTextObject* pData );
ScInputStatusItem( sal_uInt16 nWhich,
const ScAddress& rCurPos,
@@ -165,7 +159,7 @@ public:
virtual String GetValueText() const;
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
ScViewData* GetViewData () const { return pViewData; }
const ScSortParam& GetSortData () const { return theSortData; }
@@ -225,7 +219,7 @@ public:
virtual String GetValueText() const;
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
ScViewData* GetViewData () const { return pViewData; }
const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; }
@@ -376,3 +370,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx
index 5743966e9943..abc6770157e0 100644
--- a/sc/source/ui/inc/undobase.hxx
+++ b/sc/source/ui/inc/undobase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -174,3 +175,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index c04ebb575f46..d8617490219a 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,11 @@
#include "markdata.hxx"
#include "viewutil.hxx"
#include "spellparam.hxx"
+#include "cellmergeoption.hxx"
+
+#include "cell.hxx"
+
+#include <boost/shared_ptr.hpp>
class ScDocShell;
class ScBaseCell;
@@ -182,9 +188,9 @@ struct ScUndoPasteOptions
ScUndoPasteOptions() :
nFunction( PASTE_NOFUNC ),
- bSkipEmpty( sal_False ),
- bTranspose( sal_False ),
- bAsLink( sal_False ),
+ bSkipEmpty( false ),
+ bTranspose( false ),
+ bAsLink( false ),
eMoveMode( INS_NONE )
{}
};
@@ -351,9 +357,11 @@ public:
virtual String GetComment() const;
+ ScEditDataArray* GetDataArray();
private:
ScMarkData aMarkData;
ScRange aRange;
+ ScEditDataArray aDataArray;
ScDocument* pUndoDoc;
sal_Bool bMulti;
ScPatternAttr* pApplyPattern;
@@ -361,6 +369,7 @@ private:
SvxBoxInfoItem* pLineInner;
void DoChange( const sal_Bool bUndo );
+ void ChangeEditData( const bool bUndo );
};
@@ -445,10 +454,8 @@ class ScUndoMerge: public ScSimpleUndo
{
public:
TYPEINFO();
- ScUndoMerge( ScDocShell* pNewDocShell,
- SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
- SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
- bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo );
+ ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
+ bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo);
virtual ~ScUndoMerge();
virtual void Undo();
@@ -459,7 +466,7 @@ public:
virtual String GetComment() const;
private:
- ScRange maRange;
+ ScCellMergeOption maOption;
bool mbMergeContents; // Merge contents in Redo().
ScDocument* mpUndoDoc; // wenn Daten zusammengefasst
SdrUndoAction* mpDrawUndo;
@@ -940,7 +947,7 @@ class ScUndoRemoveMerge: public ScBlockUndo
public:
TYPEINFO();
ScUndoRemoveMerge( ScDocShell* pNewDocShell,
- const ScRange& rArea,
+ const ScCellMergeOption& rOption,
ScDocument* pNewUndoDoc );
virtual ~ScUndoRemoveMerge();
@@ -952,6 +959,9 @@ public:
virtual String GetComment() const;
private:
+ void SetCurTab();
+
+ ScCellMergeOption maOption;
ScDocument* pUndoDoc;
};
@@ -986,3 +996,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx
index 965cb3daebae..2ab9ab1a9cfa 100644
--- a/sc/source/ui/inc/undocell.hxx
+++ b/sc/source/ui/inc/undocell.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,6 +32,8 @@
#include "undobase.hxx"
#include "postit.hxx"
+#include <boost/shared_ptr.hpp>
+
class ScDocShell;
class ScBaseCell;
class ScPatternAttr;
@@ -59,6 +62,11 @@ public:
virtual String GetComment() const;
+ /** once the objects are passed to this class, their life-cycle is
+ managed by this class; the calling function must pass new'ed
+ objects to this method. */
+ void SetEditData( EditTextObject* pOld, EditTextObject* pNew );
+
private:
SCCOL nCol;
SCROW nRow;
@@ -66,9 +74,11 @@ private:
ScPatternAttr* pOldPattern;
ScPatternAttr* pNewPattern;
ScPatternAttr* pApplyPattern;
+ ::boost::shared_ptr<EditTextObject> pOldEditData;
+ ::boost::shared_ptr<EditTextObject> pNewEditData;
sal_Bool bIsAutomatic;
- void DoChange( const ScPatternAttr* pWhichPattern ) const;
+ void DoChange( const ScPatternAttr* pWhichPattern, const ::boost::shared_ptr<EditTextObject>& pEditData ) const;
};
@@ -364,3 +374,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx
index 90e486a505be..2aebb30a0cc5 100644
--- a/sc/source/ui/inc/undodat.hxx
+++ b/sc/source/ui/inc/undodat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -406,39 +407,6 @@ private:
sal_Bool bQuerySize;
};
-//UNUSED2008-05 class ScUndoPivot: public ScSimpleUndo
-//UNUSED2008-05 {
-//UNUSED2008-05 public:
-//UNUSED2008-05 TYPEINFO();
-//UNUSED2008-05 ScUndoPivot( ScDocShell* pNewDocShell,
-//UNUSED2008-05 const ScArea& rOld, const ScArea& rNew,
-//UNUSED2008-05 ScDocument* pOldDoc, ScDocument* pNewDoc,
-//UNUSED2008-05 const ScPivot* pOldPivot, const ScPivot* pNewPivot );
-//UNUSED2008-05 virtual ~ScUndoPivot();
-//UNUSED2008-05
-//UNUSED2008-05 virtual void Undo();
-//UNUSED2008-05 virtual void Redo();
-//UNUSED2008-05 virtual void Repeat(SfxRepeatTarget& rTarget);
-//UNUSED2008-05 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
-//UNUSED2008-05
-//UNUSED2008-05 virtual String GetComment() const;
-//UNUSED2008-05
-//UNUSED2008-05 private:
-//UNUSED2008-05 ScArea aOldArea;
-//UNUSED2008-05 ScArea aNewArea;
-//UNUSED2008-05 ScDocument* pOldUndoDoc;
-//UNUSED2008-05 ScDocument* pNewUndoDoc;
-//UNUSED2008-05 ScPivotParam aOldParam; // fuer Redo
-//UNUSED2008-05 ScQueryParam aOldQuery;
-//UNUSED2008-05 ScArea aOldSrc;
-//UNUSED2008-05 ScPivotParam aNewParam; // fuer Undo in Collection
-//UNUSED2008-05 ScQueryParam aNewQuery;
-//UNUSED2008-05 ScArea aNewSrc;
-//UNUSED2008-05 String aOldName;
-//UNUSED2008-05 String aOldTag;
-//UNUSED2008-05 String aNewName;
-//UNUSED2008-05 String aNewTag;
-//UNUSED2008-05 };
class ScUndoDataPilot: public ScSimpleUndo
{
@@ -528,8 +496,45 @@ private:
void Init();
};
+// amelia
+class ScUndoDataForm: public ScBlockUndo
+{
+public:
+ TYPEINFO();
+ ScUndoDataForm( ScDocShell* pNewDocShell,
+ SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
+ SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
+ const ScMarkData& rMark,
+ ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
+ sal_uInt16 nNewFlags,
+ ScRefUndoData* pRefData, void* pFill1, void* pFill2, void* pFill3,
+ sal_Bool bRedoIsFilled = true
+ );
+ virtual ~ScUndoDataForm();
+
+ virtual void Undo();
+ virtual void Redo();
+ virtual void Repeat(SfxRepeatTarget& rTarget);
+ virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
+ virtual String GetComment() const;
+
+private:
+ ScMarkData aMarkData;
+ ScDocument* pUndoDoc;
+ ScDocument* pRedoDoc;
+ sal_uInt16 nFlags;
+ ScRefUndoData* pRefUndoData;
+ ScRefUndoData* pRefRedoData;
+ sal_uLong nStartChangeAction;
+ sal_uLong nEndChangeAction;
+ sal_Bool bRedoFilled;
+
+ void DoChange( const sal_Bool bUndo );
+ void SetChangeTrack();
+};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undodraw.hxx b/sc/source/ui/inc/undodraw.hxx
index 20db8643e3ca..f8f633a2dc7c 100644
--- a/sc/source/ui/inc/undodraw.hxx
+++ b/sc/source/ui/inc/undodraw.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undoolk.hxx b/sc/source/ui/inc/undoolk.hxx
index 0f986396c89d..9d34785ea1af 100644
--- a/sc/source/ui/inc/undoolk.hxx
+++ b/sc/source/ui/inc/undoolk.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ void EnableDrawAdjust ( ScDocument* pDoc, sal_Bool bEnable );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undostyl.hxx b/sc/source/ui/inc/undostyl.hxx
index b22554f1eeaa..f5069ab031b0 100644
--- a/sc/source/ui/inc/undostyl.hxx
+++ b/sc/source/ui/inc/undostyl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,3 +116,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx
index 24e36c0f8d97..0c6bec3782af 100644
--- a/sc/source/ui/inc/undotab.hxx
+++ b/sc/source/ui/inc/undotab.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,13 +35,6 @@
#include <tools/color.hxx>
#include "tabbgcolor.hxx"
-#ifndef _SVSTDARR_SHORTS
-
-#define _SVSTDARR_SHORTS
-#include <svl/svstdarr.hxx>
-
-#endif
-
#ifndef _SVSTDARR_STRINGS
#define _SVSTDARR_STRINGS
@@ -50,7 +44,9 @@
#include <com/sun/star/uno/Sequence.hxx>
+#include <boost/shared_ptr.hpp>
#include <memory>
+#include <vector>
class ScDocShell;
class ScDocument;
@@ -127,7 +123,7 @@ public:
TYPEINFO();
ScUndoDeleteTab(
ScDocShell* pNewDocShell,
- const SvShorts &theTabs, //SCTAB nNewTab,
+ const std::vector<SCTAB> &theTabs, //SCTAB nNewTab,
ScDocument* pUndoDocument,
ScRefUndoData* pRefData );
virtual ~ScUndoDeleteTab();
@@ -140,7 +136,7 @@ public:
virtual String GetComment() const;
private:
- SvShorts theTabs;
+ std::vector<SCTAB> theTabs;
sal_uLong nStartChangeAction;
sal_uLong nEndChangeAction;
@@ -179,9 +175,13 @@ class ScUndoMoveTab: public ScSimpleUndo
{
public:
TYPEINFO();
- ScUndoMoveTab( ScDocShell* pNewDocShell,
- const SvShorts &aOldTab,
- const SvShorts &aNewTab);
+ ScUndoMoveTab(
+ ScDocShell* pNewDocShell,
+ ::std::vector<SCTAB>* pOldTabs,
+ ::std::vector<SCTAB>* pNewTabs,
+ ::std::vector< ::rtl::OUString>* pOldNames = NULL,
+ ::std::vector< ::rtl::OUString>* pNewNames = NULL );
+
virtual ~ScUndoMoveTab();
virtual void Undo();
@@ -192,8 +192,10 @@ public:
virtual String GetComment() const;
private:
- SvShorts theOldTabs;
- SvShorts theNewTabs;
+ ::boost::shared_ptr< ::std::vector<SCTAB> > mpOldTabs;
+ ::boost::shared_ptr< ::std::vector<SCTAB> > mpNewTabs;
+ ::boost::shared_ptr< ::std::vector< ::rtl::OUString> > mpOldNames;
+ ::boost::shared_ptr< ::std::vector< ::rtl::OUString> > mpNewNames;
void DoChange( sal_Bool bUndo ) const;
};
@@ -203,9 +205,11 @@ class ScUndoCopyTab: public ScSimpleUndo
{
public:
TYPEINFO();
- ScUndoCopyTab(ScDocShell* pNewDocShell,
- const SvShorts &aOldTab,
- const SvShorts &aNewTab);
+ ScUndoCopyTab(
+ ScDocShell* pNewDocShell,
+ ::std::vector<SCTAB>* pOldTabs,
+ ::std::vector<SCTAB>* pNewTabs,
+ ::std::vector< ::rtl::OUString>* pNewNames = NULL );
virtual ~ScUndoCopyTab();
@@ -217,9 +221,10 @@ public:
virtual String GetComment() const;
private:
+ ::boost::shared_ptr< ::std::vector<SCTAB> > mpOldTabs;
+ ::boost::shared_ptr< ::std::vector<SCTAB> > mpNewTabs;
+ ::boost::shared_ptr< ::std::vector< ::rtl::OUString> > mpNewNames;
SdrUndoAction* pDrawUndo;
- SvShorts theOldTabs;
- SvShorts theNewTabs;
void DoChange() const;
};
@@ -517,27 +522,6 @@ private:
void DoChange( sal_Bool bNew );
};
-
-//UNUSED2009-05 class ScUndoSetGrammar : public ScSimpleUndo
-//UNUSED2009-05 {
-//UNUSED2009-05 public:
-//UNUSED2009-05 TYPEINFO();
-//UNUSED2009-05 ScUndoSetGrammar( ScDocShell* pShell,
-//UNUSED2009-05 formula::FormulaGrammar::Grammar eGrammar );
-//UNUSED2009-05 virtual ~ScUndoSetGrammar();
-//UNUSED2009-05
-//UNUSED2009-05 virtual void Undo();
-//UNUSED2009-05 virtual void Redo();
-//UNUSED2009-05 virtual void Repeat(SfxRepeatTarget& rTarget);
-//UNUSED2009-05 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
-//UNUSED2009-05
-//UNUSED2009-05 virtual String GetComment() const;
-//UNUSED2009-05
-//UNUSED2009-05 private:
-//UNUSED2009-05 formula::FormulaGrammar::Grammar meNewGrammar, meOldGrammar;
-//UNUSED2009-05
-//UNUSED2009-05 void DoChange( formula::FormulaGrammar::Grammar eGrammar );
-//UNUSED2009-05 };
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/undoutil.hxx b/sc/source/ui/inc/undoutil.hxx
index 38302096b1fa..48985a132fe3 100644
--- a/sc/source/ui/inc/undoutil.hxx
+++ b/sc/source/ui/inc/undoutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/validate.hrc b/sc/source/ui/inc/validate.hrc
index 45e5dda39c2d..bde827c84e00 100644
--- a/sc/source/ui/inc/validate.hrc
+++ b/sc/source/ui/inc/validate.hrc
@@ -58,9 +58,7 @@
#define CB_SORTLIST 28
#define EDT_LIST 29
#define FT_SOURCEHINT 30
-//<!--Added by PengYunQuan for Validity Cell Range Picker
#define RB_VALIDITY_REF 88
-//-->Added by PengYunQuan for Validity Cell Range Picker
/* Position indexes for "Allow" list box.
They do not map directly to ScValidationMode and can safely be modified to
@@ -85,4 +83,3 @@
#define SC_VALIDDLG_DATA_NOTEQUAL 5
#define SC_VALIDDLG_DATA_BETWEEN 6
#define SC_VALIDDLG_DATA_NOTBETWEEN 7
-
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index ffe44b1e2061..0ad2ac9c6df2 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,13 +34,11 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <svtools/svmedit.hxx>
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+
#include "anyrefdg.hxx"
-//-->Added by PengYunQuan for Validity Cell Range Picker
// ============================================================================
-//<!--Added by PengYunQuan for Validity Cell Range Picker
struct ScRefHandlerCaller{
virtual ~ScRefHandlerCaller(){}
};
@@ -49,15 +48,15 @@ protected:
ScRefHandlerCaller *m_pHandler;
void (ScRefHandlerCaller::*m_pSetReferenceHdl)( const ScRange& , ScDocument* );
void (ScRefHandlerCaller::*m_pSetActiveHdl)();
- void (ScRefHandlerCaller::*m_pRefInputStartPreHdl)( ScRefEdit* pEdit, ScRefButton* pButton );
- void (ScRefHandlerCaller::*m_pRefInputStartPostHdl)( ScRefEdit* pEdit, ScRefButton* pButton );
+ void (ScRefHandlerCaller::*m_pRefInputStartPreHdl)( formula::RefEdit* pEdit, formula::RefButton* pButton );
+ void (ScRefHandlerCaller::*m_pRefInputStartPostHdl)( formula::RefEdit* pEdit, formula::RefButton* pButton );
void (ScRefHandlerCaller::*m_pRefInputDonePreHdl)();
void (ScRefHandlerCaller::*m_pRefInputDonePostHdl)();
public:
typedef void (ScRefHandlerCaller::*PFUNCSETREFHDLTYPE)( const ScRange& , ScDocument* );
typedef void (ScRefHandlerCaller::*PCOMMONHDLTYPE)();
- typedef void (ScRefHandlerCaller::*PINPUTSTARTDLTYPE)( ScRefEdit* pEdit, ScRefButton* pButton );
+ typedef void (ScRefHandlerCaller::*PINPUTSTARTDLTYPE)( formula::RefEdit* pEdit, formula::RefButton* pButton );
PFUNCSETREFHDLTYPE SetSetRefHdl( PFUNCSETREFHDLTYPE pNewHdl )
{
@@ -86,33 +85,23 @@ public:
ScRefHandlerHelper():m_pHandler(NULL), m_pSetReferenceHdl( NULL ), m_pSetActiveHdl(NULL), m_pRefInputStartPreHdl( NULL ), m_pRefInputStartPostHdl( NULL ), m_pRefInputDonePreHdl( NULL ), m_pRefInputDonePostHdl( NULL ){}
};
-//-->Added by PengYunQuan for Validity Cell Range Picker
/** The "Validity" tab dialog. */
-//<!--Modified by PengYunQuan for Validity Cell Range Picker
-//class ScValidationDlg : public SfxTabDialog
class ScValidationDlg :public ScRefHdlrImpl<ScValidationDlg, SfxTabDialog, false>, public ScRefHandlerHelper
-//-->Modified by PengYunQuan for Validity Cell Range Picker
{
- //<!--Added by PengYunQuan for Validity Cell Range Picker
typedef ScRefHdlrImpl<ScValidationDlg, SfxTabDialog, false> ScValidationDlgBase;
- //Start_Moddify by liliang 03/26/2008 SODC_13677_2
DECL_LINK( OkHdl, Button * );
- //End_Moddify by liliang 03/26/2008 SODC_13677_2
+
bool m_bOwnRefHdlr:1;
ScTabViewShell *m_pTabVwSh;
bool m_bRefInputting:1;
bool EnterRefStatus();
bool LeaveRefStatus();
- //-->Added by PengYunQuan for Validity Cell Range Picker
+
public:
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //explicit ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet );
explicit ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet, ScTabViewShell * pTabViewSh, SfxBindings *pB = NULL );
- //-->Modified by PengYunQuan for Validity Cell Range Picker
- //<!--Added by PengYunQuan for Validity Cell Range Picker
virtual ~ScValidationDlg();
inline static ScValidationDlg * Find1AliveObject( Window *pAncestor );
bool IsAlive();
@@ -140,14 +129,14 @@ public:
DBG_ASSERT( false, "should not execute here!!!when the edit kill focus, should remove refhandler.\r\n" );
if ( IsInExecute() )
- EndDialog( sal_False );
+ EndDialog( false );
else if ( GetStyle() & WB_CLOSEABLE )
Close();
}
bool IsRefInputting(){ return m_bRefInputting; }
- virtual void RefInputStart( ScRefEdit* pEdit, ScRefButton* pButton = NULL )
+ virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL )
{
if( !CanInputStart( pEdit ) )
return;
@@ -160,7 +149,7 @@ public:
(m_pHandler->*m_pRefInputStartPostHdl)( pEdit, pButton );
}
- virtual void RefInputDone( sal_Bool bForced = sal_False )
+ virtual void RefInputDone( sal_Bool bForced = false )
{
if( !CanInputDone( bForced ) )
return;
@@ -180,17 +169,13 @@ public:
enum { SLOTID = SID_VALIDITY_REFERENCE };
sal_Bool Close();
- //-->Added by PengYunQuan for Validity Cell Range Picker
};
// ============================================================================
/** The tab page "Criteria" from the Validation dialog. */
-//<!--Modified by PengYunQuan for Validity Cell Range Picker
-//class ScTPValidationValue : public SfxTabPage
class ScTPValidationValue : public ScRefHandlerCaller, public SfxTabPage
-//-->Modified by PengYunQuan for Validity Cell Range Picker
{
public:
explicit ScTPValidationValue( Window* pParent, const SfxItemSet& rArgSet );
@@ -222,16 +207,10 @@ private:
FixedText maFtValue;
ListBox maLbValue;
FixedText maFtMin;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Edit maEdMin;
- ScRefEdit maEdMin;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
+ formula::RefEdit maEdMin;
MultiLineEdit maEdList; /// Entries for explicit list
FixedText maFtMax;
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //Edit maEdMax;
- ScRefEdit maEdMax;
- //-->Modified by PengYunQuan for Validity Cell Range Picker
+ formula::RefEdit maEdMax;
FixedText maFtHint; /// Hint text for cell range validity.
String maStrMin;
@@ -240,33 +219,31 @@ private:
String maStrRange;
String maStrList;
sal_Unicode mcFmlaSep; /// List separator in formulas.
- //<!--Added by PengYunQuan for Validity Cell Range Picker
+
DECL_LINK( EditSetFocusHdl, Edit *);
DECL_LINK( KillFocusHdl, Window *);
void OnClick( Button *pBtn );
- ScRefEdit *m_pRefEdit;
- class ScRefButtonEx:public ::ScRefButton
+ formula::RefEdit* m_pRefEdit;
+ class ScRefButtonEx:public ::formula::RefButton
{
void Click();
public:
- ScRefButtonEx( Window* pParent, const ResId& rResId, ScRefEdit* pEdit = NULL, ScRefHandler *pRefHdlr = NULL ): ::ScRefButton( pParent, rResId, pEdit, pRefHdlr ){}
+ ScRefButtonEx( Window* pParent, const ResId& rResId, formula::RefEdit* pEdit = NULL, ScRefHandler *pRefHdlr = NULL ): ::formula::RefButton( pParent, rResId, pEdit, pRefHdlr ){}
}m_btnRef;
friend class ScRefButtonEx;
void SetReferenceHdl( const ScRange& , ScDocument* );
void SetActiveHdl();
- void RefInputStartPreHdl( ScRefEdit* pEdit, ScRefButton* pButton );
+ void RefInputStartPreHdl( formula::RefEdit* pEdit, formula::RefButton* pButton );
void RefInputDonePreHdl();
void RefInputDonePostHdl();
ScValidationDlg * GetValidationDlg();
- //TYPEINFO();
void TidyListBoxes();
public:
sal_uInt16 GetAllowEntryPos();
String GetMinText();
void SetupRefDlg();
void RemoveRefDlg();
- //-->Added by PengYunQuan for Validity Cell Range Picker
};
@@ -332,7 +309,6 @@ public:
virtual void Reset ( const SfxItemSet& rArgSet );
};
-//<!--Added by PengYunQuan for Validity Cell Range Picker
inline ScTabViewShell *ScValidationDlg::GetTabViewShell()
{
return m_pTabVwSh;
@@ -342,6 +318,7 @@ inline ScValidationDlg * ScValidationDlg::Find1AliveObject( Window *pAncestor )
{
return static_cast<ScValidationDlg *>( SC_MOD()->Find1RefWindow( SLOTID, pAncestor ) );
}
-//-->Added by PengYunQuan for Validity Cell Range Picker
+
#endif // SC_VALIDATE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 6df6497dde0d..83a15fc79b60 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,6 +87,13 @@ enum ScMarkType
#endif
};
+enum ScPasteFlags
+{
+ SC_PASTE_NONE = 0, // No flags specified
+ SC_PASTE_MODE = 1, // Enable paste-mode
+ SC_PASTE_BORDER = 2, // Show a border around the source cells
+};
+
class ScDocShell;
class ScDocument;
class ScDBFunc;
@@ -139,6 +147,8 @@ private:
SCCOL nPosX[2];
SCROW nPosY[2];
+ bool bShowGrid; // per-sheet show grid-lines option.
+
sal_Bool bOldCurValid; // "virtuelle" Cursorpos. bei zusammengefassten
ScViewDataTable();
@@ -207,6 +217,8 @@ private:
SCCOL nTabStartCol; // fuer Enter nach Tab
ScRange aDelRange; // fuer AutoFill-Loeschen
+ ScPasteFlags nPasteFlags;
+
ScSplitPos eEditActivePart; // the part that was active when edit mode was started
sal_Bool bEditActive[4]; // aktiv?
sal_Bool bActive; // aktives Fenster ?
@@ -231,9 +243,6 @@ public:
~ScViewData();
void InitData( ScDocument* pDocument );
-//UNUSED2008-05 void InitFrom( const ScViewData* pRef );
-//UNUSED2008-05 void SetDocShell( ScDocShell* pShell );
-
ScDocShell* GetDocShell() const { return pDocShell; }
ScDBFunc* GetView() const { return pView; }
@@ -251,7 +260,7 @@ public:
ScDrawView* GetScDrawView(); // von View
sal_Bool IsMinimized(); // von View
- void UpdateInputHandler( sal_Bool bForce = sal_False, sal_Bool bStopEditing = sal_True );
+ void UpdateInputHandler( sal_Bool bForce = false, sal_Bool bStopEditing = sal_True );
void WriteUserData(String& rData);
void ReadUserData(const String& rData);
@@ -262,8 +271,6 @@ public:
ScDocument* GetDocument() const;
- void SetViewShell( ScTabViewShell* pViewSh );
-
sal_Bool IsActive() const { return bActive; }
void Activate(sal_Bool bActivate) { bActive = bActivate; }
@@ -293,6 +300,8 @@ public:
SCCOL GetFixPosX() const { return pThisTab->nFixPosX; }
SCROW GetFixPosY() const { return pThisTab->nFixPosY; }
sal_Bool IsPagebreakMode() const { return bPagebreak; }
+ bool IsPasteMode() const { return nPasteFlags & SC_PASTE_MODE; }
+ bool ShowPasteSource() const { return nPasteFlags & SC_PASTE_BORDER; }
void SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
void SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
@@ -307,6 +316,7 @@ public:
void SetFixPosX( SCCOL nPos ) { pThisTab->nFixPosX = nPos; }
void SetFixPosY( SCROW nPos ) { pThisTab->nFixPosY = nPos; }
void SetPagebreakMode( sal_Bool bSet );
+ void SetPasteMode ( ScPasteFlags nFlags ) { nPasteFlags = nFlags; }
void SetZoomType( SvxZoomType eNew, sal_Bool bAll );
void SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs );
@@ -320,6 +330,9 @@ public:
const Fraction& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; }
const Fraction& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; }
+ void SetShowGrid( bool bShow );
+ bool GetShowGrid() const { return pThisTab->bShowGrid; }
+
const MapMode& GetLogicMode( ScSplitPos eWhich );
const MapMode& GetLogicMode(); // Offset 0
@@ -355,7 +368,7 @@ public:
sal_Bool GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix );
sal_Bool GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich,
SCsCOL& rPosX, SCsROW& rPosY,
- sal_Bool bTestMerge = sal_True, sal_Bool bRepair = sal_False,
+ sal_Bool bTestMerge = sal_True, sal_Bool bRepair = false,
sal_Bool bNextIfLarge = sal_True );
void GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich,
SCsCOL nPosX, SCsROW nPosY, sal_Bool& rLeft, sal_Bool& rTop );
@@ -377,7 +390,7 @@ public:
void SetRefEnd( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ )
{ nRefEndX = nNewX; nRefEndY = nNewY; nRefEndZ = nNewZ; }
- void ResetDelMark() { bDelMarkValid = sal_False; }
+ void ResetDelMark() { bDelMarkValid = false; }
void SetDelMark( const ScRange& rRange )
{ aDelRange = rRange; bDelMarkValid = sal_True; }
@@ -416,7 +429,7 @@ public:
{ return pEditView[eWhich]; }
void EditGrowX();
- void EditGrowY( sal_Bool bInitial = sal_False );
+ void EditGrowY( sal_Bool bInitial = false );
ScSplitPos GetEditActivePart() const { return eEditActivePart; }
SCCOL GetEditViewCol() const { return nEditCol; }
@@ -433,7 +446,7 @@ public:
void SetActivePart( ScSplitPos eNewActive );
Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
- sal_Bool bAllowNeg = sal_False ) const;
+ sal_Bool bAllowNeg = false ) const;
Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScHSplitPos eWhich ) const;
Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScVSplitPos eWhich ) const;
@@ -444,11 +457,8 @@ public:
SCROW VisibleCellsY( ScVSplitPos eWhichY ) const;
SCCOL PrevCellsX( ScHSplitPos eWhichX ) const; // Zellen auf der vorgehenden Seite
SCROW PrevCellsY( ScVSplitPos eWhichY ) const;
-//UNUSED2008-05 SCCOL LastCellsX( ScHSplitPos eWhichX ) const; // Zellen auf der letzten Seite
-//UNUSED2008-05 SCROW LastCellsY( ScVSplitPos eWhichY ) const;
sal_Bool IsOle();
-//UNUSED2008-05 void UpdateOle( ScSplitPos eWhich );
void SetScreen( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
void SetScreen( const Rectangle& rVisArea );
void SetScreenPos( const Point& rVisAreaStart );
@@ -555,3 +565,4 @@ inline ScSplitPos Which( ScVSplitPos eVPos )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 29b7305af200..9306cb8c3ad3 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,6 @@
#include "tabbgcolor.hxx"
-#ifndef _SVSTDARR_SHORTS
-#define _SVSTDARR_SHORTS
-#include <svl/svstdarr.hxx>
-
-#endif
-
#ifndef _SVSTDARR_STRINGS
#define _SVSTDARR_STRINGS
@@ -45,6 +40,7 @@
#endif
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/Aspects.hpp>
+#include <vector>
class ScPatternAttr;
class ScAutoFormatData;
@@ -84,7 +80,6 @@ private:
public:
ScViewFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
-//UNUSED2008-05 ScViewFunc( Window* pParent, const ScViewFunc& rViewFunc, ScTabViewShell* pViewShell );
~ScViewFunc();
const ScPatternAttr* GetSelectionPattern ();
@@ -94,42 +89,44 @@ public:
sal_uInt8 GetSelectionScriptType();
sal_Bool GetAutoSumArea(ScRangeList& rRangeList);
- void EnterAutoSum(const ScRangeList& rRangeList, sal_Bool bSubTotal);
+ void EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr);
bool AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor, bool bContinue );
- String GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal );
+ String GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr );
void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
sal_Bool bRecord = sal_True, const EditTextObject* pData = NULL );
void EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rValue );
void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const EditTextObject* pData,
- sal_Bool bRecord = sal_True, sal_Bool bTestSimple = sal_False );
+ sal_Bool bRecord = sal_True, sal_Bool bTestSimple = false );
void EnterMatrix( const String& rString );
void EnterBlock( const String& rString, const EditTextObject* pData );
void EnterDataAtCursor( const String& rString ); //! nicht benutzt ?
- SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = NULL, sal_Bool bIncludeObjects = sal_False );
- SC_DLLPUBLIC sal_Bool CopyToClip( ScDocument* pClipDoc = NULL, sal_Bool bCut = sal_False, sal_Bool bApi = sal_False,
- sal_Bool bIncludeObjects = sal_False, sal_Bool bStopEdit = sal_True );
+ SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = NULL, sal_Bool bIncludeObjects = false );
+ SC_DLLPUBLIC sal_Bool CopyToClip( ScDocument* pClipDoc = NULL, sal_Bool bCut = false, sal_Bool bApi = false,
+ sal_Bool bIncludeObjects = false, sal_Bool bStopEdit = true );
+ SC_DLLPUBLIC sal_Bool CopyToClip( ScDocument* pClipDoc, const ScRange& rRange, sal_Bool bCut = false,
+ sal_Bool bApi = false, sal_Bool bIncludeObjects = false, sal_Bool bStopEdit = true );
ScTransferObj* CopyToTransferable();
SC_DLLPUBLIC sal_Bool PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
- sal_uInt16 nFunction = PASTE_NOFUNC, sal_Bool bSkipEmpty = sal_False,
- sal_Bool bTranspose = sal_False, sal_Bool bAsLink = sal_False,
+ sal_uInt16 nFunction = PASTE_NOFUNC, sal_Bool bSkipEmpty = false,
+ sal_Bool bTranspose = false, sal_Bool bAsLink = false,
InsCellCmd eMoveMode = INS_NONE,
sal_uInt16 nUndoExtraFlags = IDF_NONE,
- sal_Bool bAllowDialogs = sal_False );
+ sal_Bool bAllowDialogs = false );
void FillTab( sal_uInt16 nFlags, sal_uInt16 nFunction, sal_Bool bSkipEmpty, sal_Bool bAsLink );
SC_DLLPUBLIC void PasteFromSystem();
- SC_DLLPUBLIC sal_Bool PasteFromSystem( sal_uLong nFormatId, sal_Bool bApi = sal_False );
+ SC_DLLPUBLIC sal_Bool PasteFromSystem( sal_uLong nFormatId, sal_Bool bApi = false );
void PasteFromTransferable( const ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable >& rxTransferable );
void PasteDraw();
void PasteDraw( const Point& rLogicPos, SdrModel* pModel,
- sal_Bool bGroup = sal_False, sal_Bool bSameDocClipboard = sal_False );
+ sal_Bool bGroup = false, sal_Bool bSameDocClipboard = false );
sal_Bool PasteOnDrawObject( const ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable >& rxTransferable,
@@ -139,9 +136,9 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable >& rxTransferable,
SCCOL nPosX, SCROW nPosY, Point* pLogicPos = NULL,
- sal_Bool bLink = sal_False, sal_Bool bAllowDialogs = sal_False );
+ sal_Bool bLink = false, sal_Bool bAllowDialogs = false );
- sal_Bool PasteFile( const Point&, const String&, sal_Bool bLink=sal_False );
+ sal_Bool PasteFile( const Point&, const String&, sal_Bool bLink=false );
sal_Bool PasteObject( const Point&, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >&, const Size* = NULL, const Graphic* = NULL, const ::rtl::OUString& = ::rtl::OUString(), sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT );
sal_Bool PasteBitmap( const Point&, const Bitmap& );
sal_Bool PasteMetaFile( const Point&, const GDIMetaFile& );
@@ -158,7 +155,7 @@ public:
void InsertBookmark( const String& rDescription, const String& rURL,
SCCOL nPosX, SCROW nPosY, const String* pTarget = NULL,
- sal_Bool bTryReplace = sal_False );
+ sal_Bool bTryReplace = false );
sal_Bool HasBookmarkAtCursor( SvxHyperlinkItem* pContent );
long DropRequestHdl( Exchange* pExchange );
@@ -178,7 +175,7 @@ public:
void ApplyAttr( const SfxPoolItem& rAttrItem );
void ApplySelectionPattern( const ScPatternAttr& rAttr,
sal_Bool bRecord = sal_True,
- sal_Bool bCursorOnly = sal_False );
+ sal_Bool bCursorOnly = false );
void ApplyPatternLines( const ScPatternAttr& rAttr,
const SvxBoxItem* pNewOuter,
const SvxBoxInfoItem* pNewInner, sal_Bool bRecord = sal_True );
@@ -206,7 +203,7 @@ public:
sal_Bool Unprotect( SCTAB nTab, const String& rPassword );
void DeleteCells( DelCellCmd eCmd, sal_Bool bRecord = sal_True );
- sal_Bool InsertCells( InsCellCmd eCmd, sal_Bool bRecord = sal_True, sal_Bool bPartOfPaste = sal_False );
+ sal_Bool InsertCells( InsCellCmd eCmd, sal_Bool bRecord = sal_True, sal_Bool bPartOfPaste = false );
void DeleteMulti( sal_Bool bRows, sal_Bool bRecord = sal_True );
void DeleteContents( sal_uInt16 nFlags, sal_Bool bRecord = sal_True );
@@ -240,8 +237,8 @@ public:
sal_Bool TestMergeCells();
sal_Bool TestRemoveMerge();
- sal_Bool MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool bRecord = sal_True );
- sal_Bool RemoveMerge( sal_Bool bRecord = sal_True );
+ sal_Bool MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool bRecord = true, sal_Bool bCenter = false );
+ sal_Bool RemoveMerge( sal_Bool bRecord = true );
void FillSimple( FillDir eDir, sal_Bool bRecord = sal_True );
void FillSeries( FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd,
@@ -267,11 +264,11 @@ public:
sal_Bool AppendTable( const String& rName, sal_Bool bRecord = sal_True );
- sal_Bool DeleteTable( SCTAB nTabNr, sal_Bool bRecord = sal_True );
- sal_Bool DeleteTables(const SvShorts &TheTabs, sal_Bool bRecord = sal_True );
+ sal_Bool DeleteTable( SCTAB nTabNr, sal_Bool bRecord = true );
+ sal_Bool DeleteTables(const std::vector<SCTAB>& TheTabs, sal_Bool bRecord = true );
sal_Bool RenameTable( const String& rName, SCTAB nTabNr );
- void MoveTable( sal_uInt16 nDestDocNo, SCTAB nDestTab, sal_Bool bCopy );
+ void MoveTable( sal_uInt16 nDestDocNo, SCTAB nDestTab, sal_Bool bCopy, const String* pNewTabName = NULL );
void ImportTables( ScDocShell* pSrcShell,
SCTAB nCount, const SCTAB* pSrcTabs,
sal_Bool bLink,SCTAB nTab);
@@ -308,10 +305,8 @@ public:
void ReplaceNote( const ScAddress& rPos, const String& rNoteText, const String* pAuthor, const String* pDate );
void DoRefConversion( sal_Bool bRecord = sal_True );
-//UNUSED2008-05 void DoSpellingChecker( sal_Bool bRecord = sal_True );
- void DoHangulHanjaConversion( sal_Bool bRecord = sal_True );
- void DoThesaurus( sal_Bool bRecord = sal_True );
-//UNUSED2008-05 DECL_LINK( SpellError, void * );
+ void DoHangulHanjaConversion( sal_Bool bRecord = true );
+ void DoThesaurus( sal_Bool bRecord = true );
/** Generic implementation of sheet conversion functions. */
void DoSheetConversion( const ScConversionParam& rParam, sal_Bool bRecord = sal_True );
@@ -329,14 +324,25 @@ public:
void DetectiveMarkInvalid();
void DetectiveDelAll();
void DetectiveRefresh();
+ void DetectiveMarkPred();
+ void DetectiveMarkSucc();
+
+ void InsertCurrentTime(short nCellFmt, const ::rtl::OUString& rUndoStr);
void ShowNote( bool bShow = true );
inline void HideNote() { ShowNote( false ); }
void EditNote();
- void ForgetFormatArea() { bFormatValid = sal_False; }
+ void ForgetFormatArea() { bFormatValid = false; }
sal_Bool SelectionEditable( sal_Bool* pOnlyNotBecauseOfMatrix = NULL );
+ // Amelia Wang
+ SC_DLLPUBLIC void DataFormPutData( SCROW nCurrentRow ,
+ SCROW nStartRow , SCCOL nStartCol ,
+ SCROW nEndRow , SCCOL nEndCol ,
+ Edit** pEdits ,
+ sal_uInt16 aColLength );
+
// interne Hilfsfunktionen
protected:
void UpdateLineAttrs( SvxBorderLine& rLine,
@@ -344,8 +350,6 @@ protected:
const SvxBorderLine* pSrcLine,
sal_Bool bColor );
-//UNUSED2008-05 void PaintWidthHeight( sal_Bool bColumns, SCCOLROW nStart, SCCOLROW nEnd );
-
private:
void PasteRTF( SCCOL nCol, SCROW nStartRow,
@@ -362,9 +366,12 @@ private:
sal_Bool TestFormatArea( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bAttrChanged );
void DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab,
sal_Bool bAttrChanged, sal_Bool bAddUndo );
+
+ void MarkAndJumpToRanges(const ScRangeList& rRanges);
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx
index 503b86976d39..d01faeae35ff 100644
--- a/sc/source/ui/inc/viewutil.hxx
+++ b/sc/source/ui/inc/viewutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,10 +104,6 @@ public:
ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
void SetNew( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
sal_Bool GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
-#ifdef OLD_SELECTION_PAINT
- sal_Bool GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, sal_Bool& rCont );
- void GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
-#endif
};
@@ -114,3 +111,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/warnbox.hxx b/sc/source/ui/inc/warnbox.hxx
index 3b06c98c9e3e..e8f548f606fe 100644
--- a/sc/source/ui/inc/warnbox.hxx
+++ b/sc/source/ui/inc/warnbox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 1f95a3db251d..ac3596d72e28 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-// System - Includes ---------------------------------------------------------
-
-
-
#include <svl/undo.hxx>
#include <unotools/textsearch.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -40,8 +37,6 @@
#include <sfx2/app.hxx>
#include <sfx2/viewfrm.hxx>
-// INCLUDE -------------------------------------------------------------------
-
#include "acredlin.hxx"
#include "global.hxx"
#include "reffact.hxx"
@@ -64,8 +59,6 @@
#define ABS_SREF3D ABS_SREF | SCA_TAB_3D
#define ABS_DREF3D ABS_DREF | SCA_TAB_3D
-
-
#define ERRORBOX(s) ErrorBox(this,WinBits(WB_OK|WB_DEF_OK),s).Execute();
inline void EnableDisable( Window& rWin, sal_Bool bEnable )
@@ -83,16 +76,15 @@ inline void EnableDisable( Window& rWin, sal_Bool bEnable )
//============================================================================
// class ScRedlinData
//----------------------------------------------------------------------------
-
ScRedlinData::ScRedlinData()
:RedlinData()
{
nInfo=RD_SPECIAL_NONE;
nActionNo=0;
pData=NULL;
- bDisabled=sal_False;
- bIsRejectable=sal_False;
- bIsAcceptable=sal_False;
+ bDisabled=false;
+ bIsRejectable=false;
+ bIsAcceptable=false;
nTable=SCTAB_MAX;
nCol=SCCOL_MAX;
nRow=SCROW_MAX;
@@ -103,12 +95,11 @@ ScRedlinData::~ScRedlinData()
nInfo=RD_SPECIAL_NONE;
nActionNo=0;
pData=NULL;
- bDisabled=sal_False;
- bIsRejectable=sal_False;
- bIsAcceptable=sal_False;
+ bDisabled=false;
+ bIsRejectable=false;
+ bIsAcceptable=false;
}
-
//============================================================================
// class ScAcceptChgDlg
//----------------------------------------------------------------------------
@@ -116,13 +107,10 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
ScViewData* ptrViewData)
: SfxModelessDialog( pB, pCW, pParent, ScResId(RID_SCDLG_CHANGES) ),
- //
aAcceptChgCtr ( this, ScResId( CTR_REDLINING ) ),
- //
pViewData ( ptrViewData ),
pDoc ( ptrViewData->GetDocument() ),
aLocalRangeName ( *(pDoc->GetRangeName()) ),
- //
aStrInsertCols ( ScResId( STR_INSERT_COLS)),
aStrInsertRows ( ScResId( STR_INSERT_ROWS)),
aStrInsertTabs ( ScResId( STR_INSERT_TABS)),
@@ -141,22 +129,20 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
aStrEmpty ( ScResId( STR_EMPTY ))
{
FreeResource();
-// bScAcceptChgDlgIsDead=sal_False;
- bNoSelection=sal_False;
- bNeedsUpdate=sal_False;
- bIgnoreMsg=sal_False;
+ bNoSelection=false;
+ bNeedsUpdate=false;
+ bIgnoreMsg=false;
nAcceptCount=0;
nRejectCount=0;
bAcceptEnableFlag=sal_True;
bRejectEnableFlag=sal_True;
- bHasFilterEntry=sal_False;
- bUseColor=sal_False;
+ bHasFilterEntry=false;
+ bUseColor=false;
aReOpenTimer.SetTimeout(50);
aReOpenTimer.SetTimeoutHdl(LINK( this, ScAcceptChgDlg, ReOpenTimerHdl ));
// dialog is now only hidden, not deleted, on switching views,
// so there's no need to restore settings when reopening
-
MinSize=aAcceptChgCtr.GetMinSizePixel();
MinSize.Height()+=2;
MinSize.Width()+=2;
@@ -172,7 +158,7 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
pTPFilter->SetReadyHdl(LINK( this, ScAcceptChgDlg, FilterHandle ));
pTPFilter->SetRefHdl(LINK( this, ScAcceptChgDlg, RefHandle ));
pTPFilter->SetModifyHdl(LINK( this, ScAcceptChgDlg, FilterModified));
- pTPFilter->HideRange(sal_False);
+ pTPFilter->HideRange(false);
pTPView->InsertCalcHeader();
pTPView->SetRejectClickHdl( LINK( this, ScAcceptChgDlg,RejectHandle));
pTPView->SetAcceptClickHdl( LINK(this, ScAcceptChgDlg, AcceptHandle));
@@ -201,7 +187,6 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
}
ScAcceptChgDlg::~ScAcceptChgDlg()
{
-// bScAcceptChgDlgIsDead=sal_True;
ClearView();
ScChangeTrack* pChanges=pDoc->GetChangeTrack();
@@ -216,23 +201,19 @@ void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData)
{
pViewData=ptrViewData;
if(pViewData!=NULL)
- {
pDoc=ptrViewData->GetDocument();
- }
else
- {
pDoc=NULL;
- }
- bNoSelection=sal_False;
- bNeedsUpdate=sal_False;
- bIgnoreMsg=sal_False;
+ bNoSelection=false;
+ bNeedsUpdate=false;
+ bIgnoreMsg=false;
nAcceptCount=0;
nRejectCount=0;
bAcceptEnableFlag=sal_True;
bRejectEnableFlag=sal_True;
- // #91781# don't call Init here (switching between views), just set link below
+ // don't call Init here (switching between views), just set link below
// (dialog is just hidden, not deleted anymore, when switching views)
ClearView();
UpdateView();
@@ -245,7 +226,7 @@ void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData)
}
}
-void __EXPORT ScAcceptChgDlg::Init()
+void ScAcceptChgDlg::Init()
{
String aAreaStr;
ScRange aRange;
@@ -291,17 +272,15 @@ void __EXPORT ScAcceptChgDlg::Init()
}
}
else
- {
pTPFilter->SelectedAuthorPos(0);
- }
pTPFilter->CheckRange(aChangeViewSet.HasRange());
- ScRange* pRangeEntry=aChangeViewSet.GetTheRangeList().GetObject(0);
aRangeList=aChangeViewSet.GetTheRangeList();
- if(pRangeEntry!=NULL)
+ if( !aChangeViewSet.GetTheRangeList().empty() )
{
+ const ScRange* pRangeEntry = aChangeViewSet.GetTheRangeList().front();
String aRefStr;
pRangeEntry->Format( aRefStr, ABS_DREF3D, pDoc );
pTPFilter->SetRange(aRefStr);
@@ -318,7 +297,7 @@ void ScAcceptChgDlg::ClearView()
{
nAcceptCount=0;
nRejectCount=0;
- pTheView->SetUpdateMode(sal_False);
+ pTheView->SetUpdateMode(false);
pTheView->Clear();
pTheView->SetUpdateMode(sal_True);
@@ -332,23 +311,14 @@ String* ScAcceptChgDlg::MakeTypeString(ScChangeActionType eType)
{
case SC_CAT_INSERT_COLS: pStr=&aStrInsertCols;break;
-
case SC_CAT_INSERT_ROWS: pStr=&aStrInsertRows;break;
-
case SC_CAT_INSERT_TABS: pStr=&aStrInsertTabs;break;
-
case SC_CAT_DELETE_COLS: pStr=&aStrDeleteCols;break;
-
case SC_CAT_DELETE_ROWS: pStr=&aStrDeleteRows;break;
-
case SC_CAT_DELETE_TABS: pStr=&aStrDeleteTabs;break;
-
case SC_CAT_MOVE: pStr=&aStrMove;break;
-
case SC_CAT_CONTENT: pStr=&aStrContent;break;
-
case SC_CAT_REJECT: pStr=&aStrReject;break;
-
default: pStr=&aUnknown;break;
}
return pStr;
@@ -357,9 +327,9 @@ String* ScAcceptChgDlg::MakeTypeString(ScChangeActionType eType)
sal_Bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
{
- if(pScChangeAction==NULL) return sal_False;
+ if(pScChangeAction==NULL) return false;
- sal_Bool bFlag=sal_False;
+ sal_Bool bFlag=false;
ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
String aUser=pScChangeAction->GetUser();
@@ -375,14 +345,10 @@ sal_Bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
if(eType==SC_CAT_CONTENT)
{
if(!pScChangeAction->IsDialogParent())
- {
- pScChangeAction->GetDescription( aDesc, pDoc, sal_True);
- }
+ pScChangeAction->GetDescription( aDesc, pDoc, true);
}
else
- {
pScChangeAction->GetDescription( aDesc, pDoc,!pScChangeAction->IsMasterDelete());
- }
if(aDesc.Len()>0)
{
@@ -395,23 +361,17 @@ sal_Bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
{
if(pTPFilter->IsRange())
{
- ScRange* pRangeEntry=aRangeList.First();
-
- while(pRangeEntry!=NULL)
+ for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
{
- if(pRangeEntry->Intersects(aRef)) break;
- pRangeEntry=aRangeList.Next();
- }
-
- if(pRangeEntry!=NULL)
- {
- bFlag=sal_True;
+ ScRange* pRangeEntry = aRangeList[ i ];
+ if (pRangeEntry->Intersects(aRef)) {
+ bFlag = true;
+ break;
+ }
}
}
else
- {
- bFlag=sal_True;
- }
+ bFlag=true;
}
return bFlag;
@@ -427,7 +387,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(const ScChangeAction* pScChangeA
SvLBoxEntry* pEntry=NULL;
- sal_Bool bFlag=sal_False;
+ sal_Bool bFlag=false;
ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
String aUser=pScChangeAction->GetUser();
@@ -455,8 +415,8 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(const ScChangeAction* pScChangeA
{
aString=aStrContentWithChild;
pNewData->nInfo=RD_SPECIAL_VISCONTENT;
- pNewData->bIsRejectable=sal_False;
- pNewData->bIsAcceptable=sal_False;
+ pNewData->bIsRejectable=false;
+ pNewData->bIsAcceptable=false;
}
else
{
@@ -472,7 +432,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(const ScChangeAction* pScChangeA
{
pScChangeAction->GetDescription( aDesc, pDoc,sal_True);
pNewData->bDisabled=sal_True;
- pNewData->bIsRejectable=sal_False;
+ pNewData->bIsRejectable=false;
}
else
pScChangeAction->GetDescription( aDesc, pDoc,!pScChangeAction->IsMasterDelete());
@@ -495,7 +455,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(const ScChangeAction* pScChangeA
aString+=' ';
aString+=ScGlobal::pLocaleData->getTime(aDateTime);
aString+='\t';
- bIsGenerated=sal_False;
+ bIsGenerated=false;
}
else
{
@@ -521,18 +481,15 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(const ScChangeAction* pScChangeA
{
if(pTPFilter->IsRange())
{
- ScRange* pRangeEntry=aRangeList.First();
-
- while(pRangeEntry!=NULL)
- {
- if(pRangeEntry->Intersects(aRef)) break;
- pRangeEntry=aRangeList.Next();
- }
- //SC_CAS_VIRGIN,SC_CAS_ACCEPTED,SC_CAS_REJECTED
- if(pRangeEntry!=NULL)
+ for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
{
- bHasFilterEntry=sal_True;
- bFlag=sal_True;
+ ScRange* pRangeEntry = aRangeList[ i ];
+ if( pRangeEntry->Intersects(aRef) )
+ {
+ bHasFilterEntry=true;
+ bFlag=true;
+ break;
+ }
}
}
else if(!bIsGenerated)
@@ -562,9 +519,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(const ScChangeAction* pScChangeA
}
}
else
- {
pEntry=pTheView->InsertEntry(aString,pNewData,pParent,nPos);
- }
return pEntry;
}
@@ -581,7 +536,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertFilteredAction(const ScChangeAction* pScChang
SvLBoxEntry* pEntry=NULL;
- int bFlag=sal_False;
+ int bFlag=false;
ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
String aUser=pScChangeAction->GetUser();
@@ -591,24 +546,19 @@ SvLBoxEntry* ScAcceptChgDlg::InsertFilteredAction(const ScChangeAction* pScChang
{
if(pTPFilter->IsRange())
{
- ScRange* pRangeEntry=aRangeList.First();
-
- while(pRangeEntry!=NULL)
- {
- if(pRangeEntry->Intersects(aRef)) break;
- pRangeEntry=aRangeList.Next();
- }
- //SC_CAS_VIRGIN,SC_CAS_ACCEPTED,SC_CAS_REJECTED
- if(pRangeEntry!=NULL &&
- pScChangeAction->GetState()==eState)
+ for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
{
- bFlag=sal_True;
+ ScRange* pRangeEntry=aRangeList[ i ];
+ if( pRangeEntry->Intersects(aRef) )
+ {
+ if( pScChangeAction->GetState()==eState )
+ bFlag=true;
+ break;
+ }
}
}
else if(pScChangeAction->GetState()==eState && !bIsGenerated)
- {
- bFlag=sal_True;
- }
+ bFlag=true;
}
if(bFlag)
@@ -637,8 +587,8 @@ SvLBoxEntry* ScAcceptChgDlg::InsertFilteredAction(const ScChangeAction* pScChang
{
aString=aStrContentWithChild;
pNewData->nInfo=RD_SPECIAL_VISCONTENT;
- pNewData->bIsRejectable=sal_False;
- pNewData->bIsAcceptable=sal_False;
+ pNewData->bIsRejectable=false;
+ pNewData->bIsAcceptable=false;
}
else
{
@@ -654,7 +604,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertFilteredAction(const ScChangeAction* pScChang
{
pScChangeAction->GetDescription( aDesc, pDoc,sal_True);
pNewData->bDisabled=sal_True;
- pNewData->bIsRejectable=sal_False;
+ pNewData->bIsRejectable=false;
}
else
pScChangeAction->GetDescription( aDesc, pDoc,!pScChangeAction->IsMasterDelete());
@@ -710,7 +660,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionConte
sal_Bool bIsGenerated=pChanges->IsGenerated(pScChangeAction->GetActionNumber());
- sal_Bool bFlag=sal_False;
+ sal_Bool bFlag=false;
ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
String aUser=pScChangeAction->GetUser();
@@ -720,17 +670,14 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionConte
{
if(pTPFilter->IsRange())
{
- ScRange* pRangeEntry=aRangeList.First();
-
- while(pRangeEntry!=NULL)
- {
- if(pRangeEntry->Intersects(aRef)) break;
- pRangeEntry=aRangeList.Next();
- }
- //SC_CAS_VIRGIN,SC_CAS_ACCEPTED,SC_CAS_REJECTED
- if(pRangeEntry!=NULL)
+ for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
{
- bFlag=sal_True;
+ ScRange* pRangeEntry = aRangeList[ i ];
+ if( pRangeEntry->Intersects(aRef) )
+ {
+ bFlag=true;
+ break;
+ }
}
}
else if(!bIsGenerated)
@@ -811,7 +758,7 @@ SvLBoxEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionConte
pNewData->pData=(void *)pScChangeAction;
pNewData->nActionNo=pScChangeAction->GetActionNumber();
pNewData->bIsAcceptable=pScChangeAction->IsClickable();
- pNewData->bIsRejectable=sal_False;
+ pNewData->bIsRejectable=false;
pNewData->bDisabled=!pNewData->bIsAcceptable;
pNewData->aDateTime=aDateTime;
pNewData->nRow = aRef.aStart.Row();
@@ -834,7 +781,7 @@ long ScAcceptChgDlg::PreNotify( NotifyEvent& rNEvt )
{
ClearView();
UpdateView();
- bNoSelection=sal_False;
+ bNoSelection=false;
}
return SfxModelessDialog::PreNotify(rNEvt);
@@ -843,7 +790,7 @@ long ScAcceptChgDlg::PreNotify( NotifyEvent& rNEvt )
void ScAcceptChgDlg::UpdateView()
{
- bNeedsUpdate=sal_False;
+ bNeedsUpdate=false;
DateTime aDateTime;
SvLBoxEntry* pParent=NULL;
ScChangeTrack* pChanges=NULL;
@@ -851,7 +798,7 @@ void ScAcceptChgDlg::UpdateView()
bAcceptEnableFlag=sal_True;
bRejectEnableFlag=sal_True;
SetPointer(Pointer(POINTER_WAIT));
- pTheView->SetUpdateMode(sal_False);
+ pTheView->SetUpdateMode(false);
sal_Bool bFilterFlag=pTPFilter->IsDate()||pTPFilter->IsRange()||
pTPFilter->IsAuthor()||pTPFilter->IsComment();
@@ -861,16 +808,14 @@ void ScAcceptChgDlg::UpdateView()
{
pChanges=pDoc->GetChangeTrack();
if(pChanges!=NULL)
- {
pScChangeAction=pChanges->GetFirst();
- }
}
ScChangeActionTable ActionTable;
- sal_Bool bTheFlag=sal_False;
+ sal_Bool bTheFlag=false;
while(pScChangeAction!=NULL)
{
- bHasFilterEntry=sal_False;
+ bHasFilterEntry=false;
switch(pScChangeAction->GetState())
{
case SC_CAS_VIRGIN:
@@ -902,13 +847,11 @@ void ScAcceptChgDlg::UpdateView()
if(pParent!=NULL && pScChangeAction->IsDialogParent())
{
if(!bFilterFlag)
- {
- pParent->EnableChildsOnDemand(sal_True);
- }
+ pParent->EnableChildsOnDemand(true);
else
{
sal_Bool bTestFlag=bHasFilterEntry;
- bHasFilterEntry=sal_False;
+ bHasFilterEntry=false;
if(Expand(pChanges,pScChangeAction,pParent,!bTestFlag)&&!bTestFlag)
pTheView->RemoveEntry(pParent);
}
@@ -918,7 +861,7 @@ void ScAcceptChgDlg::UpdateView()
}
if( bTheFlag && (!pDoc->IsDocEditable() || pChanges->IsProtected()) )
- bTheFlag=sal_False;
+ bTheFlag=false;
pTPView->EnableAccept(bTheFlag);
pTPView->EnableAcceptAll(bTheFlag);
@@ -943,9 +886,7 @@ void ScAcceptChgDlg::UpdateView()
SetPointer(Pointer(POINTER_ARROW));
SvLBoxEntry* pEntry=pTheView->First();
if(pEntry!=NULL)
- {
pTheView->Select(pEntry);
- }
}
//----------------------------------------------------------------------------
@@ -964,10 +905,8 @@ void ScAcceptChgDlg::Resize()
IMPL_LINK( ScAcceptChgDlg, MinSizeHandle, SvxAcceptChgCtr*, pCtr )
{
if(pCtr==&aAcceptChgCtr)
- {
if(!IsRollUp())
SetOutputSizePixel(MinSize);
- }
return 0;
}
@@ -984,12 +923,11 @@ IMPL_LINK( ScAcceptChgDlg, RefHandle, SvxTPFilter*, EMPTYARG )
if(pWnd!=NULL)
{
-// bSimpleRefDlgStarted=sal_True;
sal_uInt16 nAcceptId=ScAcceptChgDlgWrapper::GetChildWindowId();
- pViewFrm->ShowChildWindow(nAcceptId,sal_False);
+ pViewFrm->ShowChildWindow(nAcceptId,false);
pWnd->SetCloseHdl(LINK( this, ScAcceptChgDlg,RefInfoHandle));
pWnd->SetRefString(pTPFilter->GetRange());
- pWnd->SetAutoReOpen(sal_False);
+ pWnd->SetAutoReOpen(false);
Window* pWin=pWnd->GetWindow();
pWin->SetPosSizePixel(GetPosPixel(),GetSizePixel());
Hide();
@@ -1003,8 +941,7 @@ IMPL_LINK( ScAcceptChgDlg, RefInfoHandle, String*, pResult)
{
sal_uInt16 nId;
-// bSimpleRefDlgStarted=sal_False;
- ScSimpleRefDlgWrapper::SetAutoReOpen(sal_True);
+ ScSimpleRefDlgWrapper::SetAutoReOpen(true);
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
if(pResult!=NULL)
@@ -1029,7 +966,7 @@ IMPL_LINK( ScAcceptChgDlg, RefInfoHandle, String*, pResult)
else
{
nId = ScAcceptChgDlgWrapper::GetChildWindowId();
- pViewFrm->SetChildWindow( nId, sal_False );
+ pViewFrm->SetChildWindow( nId, false );
}
return 0;
}
@@ -1039,7 +976,7 @@ IMPL_LINK( ScAcceptChgDlg, FilterHandle, SvxTPFilter*, pRef )
if(pRef!=NULL)
{
ClearView();
- aRangeList.Clear();
+ aRangeList.RemoveAll();
aRangeList.Parse(pTPFilter->GetRange(),pDoc);
UpdateView();
}
@@ -1065,9 +1002,8 @@ IMPL_LINK( ScAcceptChgDlg, RejectHandle, SvxTPView*, pRef )
(ScChangeAction*) pEntryData->pData;
if(pScChangeAction->GetType()==SC_CAT_INSERT_TABS)
- {
pViewData->SetTabNo(0);
- }
+
pChanges->Reject(pScChangeAction);
}
pEntry = pTheView->NextSelected(pEntry);
@@ -1082,7 +1018,7 @@ IMPL_LINK( ScAcceptChgDlg, RejectHandle, SvxTPView*, pRef )
}
SetPointer(Pointer(POINTER_ARROW));
- bIgnoreMsg=sal_False;
+ bIgnoreMsg=false;
return 0;
}
IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef )
@@ -1104,13 +1040,9 @@ IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef )
if(pScChangeAction->GetType()==SC_CAT_CONTENT)
{
if(pEntryData->nInfo==RD_SPECIAL_CONTENT)
- {
- pChanges->SelectContent(pScChangeAction,sal_True);
- }
+ pChanges->SelectContent(pScChangeAction,true);
else
- {
pChanges->SelectContent(pScChangeAction);
- }
}
else
pChanges->Accept(pScChangeAction);
@@ -1124,7 +1056,7 @@ IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef )
ClearView();
UpdateView();
}
- bIgnoreMsg=sal_False;
+ bIgnoreMsg=false;
return 0;
}
@@ -1143,12 +1075,9 @@ void ScAcceptChgDlg::RejectFiltered()
while(pScChangeAction!=NULL)
{
if(pScChangeAction->IsDialogRoot())
- {
if(IsValidAction(pScChangeAction))
- {
pChanges->Reject((ScChangeAction*)pScChangeAction);
- }
- }
+
pScChangeAction=pScChangeAction->GetPrev();
}
}
@@ -1159,19 +1088,14 @@ void ScAcceptChgDlg::AcceptFiltered()
const ScChangeAction* pScChangeAction=NULL;
if(pChanges!=NULL)
- {
pScChangeAction=pChanges->GetLast();
- }
while(pScChangeAction!=NULL)
{
if(pScChangeAction->IsDialogRoot())
- {
if(IsValidAction(pScChangeAction))
- {
pChanges->Accept((ScChangeAction*)pScChangeAction);
- }
- }
+
pScChangeAction=pScChangeAction->GetPrev();
}
}
@@ -1184,13 +1108,10 @@ IMPL_LINK( ScAcceptChgDlg, RejectAllHandle, SvxTPView*, EMPTYARG )
if(pChanges!=NULL)
{
if(pTPFilter->IsDate()||pTPFilter->IsAuthor()||pTPFilter->IsRange()||pTPFilter->IsComment())
- {
RejectFiltered();
- }
else
- {
pChanges->RejectAll();
- }
+
pViewData->SetTabNo(0);
ScDocShell* pDocSh=pViewData->GetDocShell();
@@ -1203,7 +1124,7 @@ IMPL_LINK( ScAcceptChgDlg, RejectAllHandle, SvxTPView*, EMPTYARG )
}
SetPointer(Pointer(POINTER_ARROW));
- bIgnoreMsg=sal_False;
+ bIgnoreMsg=false;
return 0;
}
@@ -1217,13 +1138,10 @@ IMPL_LINK( ScAcceptChgDlg, AcceptAllHandle, SvxTPView*, EMPTYARG )
if(pChanges!=NULL)
{
if(pTPFilter->IsDate()||pTPFilter->IsAuthor()||pTPFilter->IsRange()||pTPFilter->IsComment())
- {
AcceptFiltered();
- }
else
- {
pChanges->AcceptAll();
- }
+
ScDocShell* pDocSh=pViewData->GetDocShell();
pDocSh->PostPaintExtras();
pDocSh->PostPaintGridAll();
@@ -1231,7 +1149,7 @@ IMPL_LINK( ScAcceptChgDlg, AcceptAllHandle, SvxTPView*, EMPTYARG )
ClearView();
UpdateView();
}
- bIgnoreMsg=sal_False;
+ bIgnoreMsg=false;
SetPointer(Pointer(POINTER_ARROW));
return 0;
@@ -1240,10 +1158,9 @@ IMPL_LINK( ScAcceptChgDlg, AcceptAllHandle, SvxTPView*, EMPTYARG )
IMPL_LINK( ScAcceptChgDlg, SelectHandle, SvxRedlinTable*, EMPTYARG )
{
if(!bNoSelection)
- {
aSelectionTimer.Start();
- }
- bNoSelection=sal_False;
+
+ bNoSelection=false;
return 0;
}
@@ -1258,22 +1175,17 @@ void ScAcceptChgDlg::GetDependents( const ScChangeAction* pScChangeAction,
{
ScRedlinData *pParentData=(ScRedlinData *)(pParent->GetUserData());
ScChangeAction* pParentAction=(ScChangeAction*) pParentData->pData;
+
if(pParentAction!=pScChangeAction)
- {
pChanges->GetDependents((ScChangeAction*) pScChangeAction,
aActionTable,pScChangeAction->IsMasterDelete());
- }
else
- {
pChanges->GetDependents((ScChangeAction*) pScChangeAction,
aActionTable);
- }
}
else
- {
pChanges->GetDependents((ScChangeAction*) pScChangeAction,
aActionTable,pScChangeAction->IsMasterDelete());
- }
}
sal_Bool ScAcceptChgDlg::InsertContentChilds(ScChangeActionTable* pActionTable,SvLBoxEntry* pParent)
@@ -1281,7 +1193,7 @@ sal_Bool ScAcceptChgDlg::InsertContentChilds(ScChangeActionTable* pActionTable,S
sal_Bool bTheTestFlag=sal_True;
ScRedlinData *pEntryData=(ScRedlinData *)(pParent->GetUserData());
const ScChangeAction* pScChangeAction = (ScChangeAction*) pEntryData->pData;
- sal_Bool bParentInserted = sal_False;
+ sal_Bool bParentInserted = false;
// If the parent is a MatrixOrigin then place it in the right order before
// the MatrixReferences. Also if it is the first content change at this
// position don't insert the first dependent MatrixReference as the special
@@ -1309,13 +1221,13 @@ sal_Bool ScAcceptChgDlg::InsertContentChilds(ScChangeActionTable* pActionTable,S
SvLBoxEntry* pOriginal=InsertChangeActionContent(pCChild,pParent,RD_SPECIAL_CONTENT);
if(pOriginal!=NULL)
{
- bTheTestFlag=sal_False;
+ bTheTestFlag=false;
ScRedlinData *pParentData=(ScRedlinData *)(pOriginal->GetUserData());
pParentData->pData=(void *)pScChangeAction;
pParentData->nActionNo=pScChangeAction->GetActionNumber();
pParentData->bIsAcceptable=pScChangeAction->IsRejectable(); // select old value
- pParentData->bIsRejectable=sal_False;
- pParentData->bDisabled=sal_False;
+ pParentData->bIsRejectable=false;
+ pParentData->bDisabled=false;
}
while(pCChild!=NULL)
{
@@ -1324,7 +1236,7 @@ sal_Bool ScAcceptChgDlg::InsertContentChilds(ScChangeActionTable* pActionTable,S
pEntry=InsertChangeActionContent(pCChild,pParent,RD_SPECIAL_NONE);
if(pEntry!=NULL)
- bTheTestFlag=sal_False;
+ bTheTestFlag=false;
}
pCChild=(const ScChangeActionContent*)pActionTable->Next();
}
@@ -1336,13 +1248,13 @@ sal_Bool ScAcceptChgDlg::InsertContentChilds(ScChangeActionTable* pActionTable,S
if(pEntry!=NULL)
{
- bTheTestFlag=sal_False;
+ bTheTestFlag=false;
ScRedlinData *pParentData=(ScRedlinData *)(pEntry->GetUserData());
pParentData->pData=(void *)pScChangeAction;
pParentData->nActionNo=pScChangeAction->GetActionNumber();
pParentData->bIsAcceptable=pScChangeAction->IsClickable();
- pParentData->bIsRejectable=sal_False;
- pParentData->bDisabled=sal_False;
+ pParentData->bIsRejectable=false;
+ pParentData->bDisabled=false;
}
}
@@ -1359,16 +1271,12 @@ sal_Bool ScAcceptChgDlg::InsertAcceptedORejected(SvLBoxEntry* pParent)
String aString=pTheView->GetEntryText( pParent);
String a2String=aString.Copy(0,aStrAllAccepted.Len());
if(a2String==aStrAllAccepted)
- {
eState=SC_CAS_ACCEPTED;
- }
else
{
a2String=aString.Copy(0,aStrAllRejected.Len());
if(a2String==aStrAllRejected)
- {
eState=SC_CAS_REJECTED;
- }
}
ScChangeAction* pScChangeAction=pChanges->GetFirst();
@@ -1376,7 +1284,7 @@ sal_Bool ScAcceptChgDlg::InsertAcceptedORejected(SvLBoxEntry* pParent)
{
if(pScChangeAction->GetState()==eState &&
InsertFilteredAction(pScChangeAction,eState,pParent)!=NULL)
- bTheTestFlag=sal_False;
+ bTheTestFlag=false;
pScChangeAction=pScChangeAction->GetNext();
}
return bTheTestFlag;
@@ -1390,23 +1298,19 @@ sal_Bool ScAcceptChgDlg::InsertChilds(ScChangeActionTable* pActionTable,SvLBoxEn
const ScChangeAction* pChild=(const ScChangeAction*)pActionTable->First();
while(pChild!=NULL)
{
- pEntry=InsertChangeAction(pChild,SC_CAS_VIRGIN,pParent,sal_False,sal_True);
+ pEntry=InsertChangeAction(pChild,SC_CAS_VIRGIN,pParent,false,sal_True);
if(pEntry!=NULL)
{
- bTheTestFlag=sal_False;
+ bTheTestFlag=false;
ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
- pEntryData->bIsRejectable=sal_False;
- pEntryData->bIsAcceptable=sal_False;
+ pEntryData->bIsRejectable=false;
+ pEntryData->bIsAcceptable=false;
pEntryData->bDisabled=sal_True;
if(pChild->IsDialogParent())
- {
-
- //pEntry->EnableChildsOnDemand(sal_True);
Expand(pChanges,pChild,pEntry);
- }
}
pChild=pActionTable->Next();
}
@@ -1425,30 +1329,21 @@ sal_Bool ScAcceptChgDlg::InsertDeletedChilds(const ScChangeAction* pScChangeActi
{
if(pScChangeAction!=pChild)
- pEntry=InsertChangeAction(pChild,SC_CAS_VIRGIN,pParent,sal_False,sal_True);
+ pEntry=InsertChangeAction(pChild,SC_CAS_VIRGIN,pParent,false,sal_True);
else
pEntry=InsertChangeAction(pChild,SC_CAS_VIRGIN,pParent,sal_True,sal_True);
if(pEntry!=NULL)
{
ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
- pEntryData->bIsRejectable=sal_False;
- pEntryData->bIsAcceptable=sal_False;
+ pEntryData->bIsRejectable=false;
+ pEntryData->bIsAcceptable=false;
pEntryData->bDisabled=sal_True;
- bTheTestFlag=sal_False;
+ bTheTestFlag=false;
+
if ( pChild->IsDialogParent() )
- {
Expand(pChanges,pChild,pEntry);
- /*
- pChanges->GetDependents((ScChangeAction*) pChild,aDelActionTable);
- if(aDelActionTable.First()!=NULL)
- {
- pEntry->EnableChildsOnDemand(sal_True);
- }
- aDelActionTable.Clear();
- */
- }
}
pChild=pActionTable->Next();
}
@@ -1507,14 +1402,12 @@ IMPL_LINK( ScAcceptChgDlg, ExpandingHandle, SvxRedlinTable*, pTable )
{
ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
if(pEntryData!=NULL)
- {
pScChangeAction=(ScChangeAction*) pEntryData->pData;
- }
if(pEntry->HasChildsOnDemand())
{
sal_Bool bTheTestFlag=sal_True;
- pEntry->EnableChildsOnDemand(sal_False);
+ pEntry->EnableChildsOnDemand(false);
pTheView->RemoveEntry(pTheView->FirstChild(pEntry));
if(pEntryData!=NULL)
@@ -1571,10 +1464,10 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio
bAcceptEnableFlag=sal_True;
bRejectEnableFlag=sal_True;
SetPointer(Pointer(POINTER_WAIT));
- pTheView->SetUpdateMode(sal_False);
+ pTheView->SetUpdateMode(false);
ScChangeActionTable ActionTable;
- sal_Bool bTheFlag=sal_False;
+ sal_Bool bTheFlag=false;
sal_Bool bFilterFlag=pTPFilter->IsDate()||pTPFilter->IsRange()||
pTPFilter->IsAuthor()||pTPFilter->IsComment();
@@ -1618,13 +1511,11 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio
if(pParent!=NULL && pScChangeAction->IsDialogParent())
{
if(!bFilterFlag)
- {
- pParent->EnableChildsOnDemand(sal_True);
- }
+ pParent->EnableChildsOnDemand(true);
else
{
sal_Bool bTestFlag=bHasFilterEntry;
- bHasFilterEntry=sal_False;
+ bHasFilterEntry=false;
if(Expand(pChanges,pScChangeAction,pParent,!bTestFlag)&&!bTestFlag)
pTheView->RemoveEntry(pParent);
}
@@ -1634,7 +1525,7 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio
}
if( bTheFlag && (!pDoc->IsDocEditable() || pChanges->IsProtected()) )
- bTheFlag=sal_False;
+ bTheFlag=false;
pTPView->EnableAccept(bTheFlag);
pTPView->EnableAcceptAll(bTheFlag);
@@ -1649,7 +1540,7 @@ void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartActio
void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction)
{
- pTheView->SetUpdateMode(sal_False);
+ pTheView->SetUpdateMode(false);
SvLBoxEntry* pEntry=pTheView->GetCurEntry();
@@ -1660,22 +1551,18 @@ void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction)
sal_uLong nAction=0;
if(pEntryData!=NULL)
- {
nAction=pEntryData->nActionNo;
- }
if(nAction>=nStartAction && nAction<=nEndAction)
- {
pTheView->SetCurEntry(pTheView->GetModel()->GetEntry(0));
- }
- sal_Bool bRemove=sal_False;
+ sal_Bool bRemove=false;
// MUST do it backwards, don't delete parents before children and GPF
pEntry=pTheView->Last();
while(pEntry!=NULL)
{
- bRemove=sal_False;
+ bRemove=false;
pEntryData=(ScRedlinData *)(pEntry->GetUserData());
if(pEntryData!=NULL)
{
@@ -1688,10 +1575,8 @@ void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction)
SvLBoxEntry* pPrevEntry = pTheView->Prev(pEntry);
if(bRemove)
- {
- //delete pEntryData;
pTheView->RemoveEntry(pEntry);
- }
+
pEntry=pPrevEntry;
}
pTheView->SetUpdateMode(sal_True);
@@ -1700,18 +1585,18 @@ void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction)
void ScAcceptChgDlg::UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartAction,sal_uLong nEndAction)
{
- pTheView->SetUpdateMode(sal_False);
+ pTheView->SetUpdateMode(false);
sal_uLong nPos=LIST_APPEND;
- sal_Bool bRemove=sal_False;
+ sal_Bool bRemove=false;
SvLBoxEntry* pEntry=pTheView->First();
SvLBoxEntry* pNextEntry = (pEntry ? pTheView->NextSibling(pEntry) : NULL);
SvLBoxEntry* pLastEntry=NULL;
while(pEntry!=NULL)
{
- bRemove=sal_False;
+ bRemove=false;
ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
if(pEntryData!=NULL)
{
@@ -1762,8 +1647,6 @@ void ScAcceptChgDlg::UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartActi
IMPL_LINK( ScAcceptChgDlg, ChgTrackModHdl, ScChangeTrack*, pChgTrack)
{
-// if(bScAcceptChgDlgIsDead) return 0;
-
ScChangeTrackMsgQueue& aMsgQueue= pChgTrack->GetMsgQueue();
ScChangeTrackMsgInfo* pTrackInfo=aMsgQueue.Get();
@@ -1816,7 +1699,7 @@ IMPL_LINK( ScAcceptChgDlg, UpdateSelectionHdl, Timer*, EMPTYARG )
sal_Bool bAcceptFlag = sal_True;
sal_Bool bRejectFlag = sal_True;
- sal_Bool bContMark = sal_False;
+ sal_Bool bContMark = false;
pTabView->DoneBlockMode(); // clears old marking
SvLBoxEntry* pEntry = pTheView->FirstSelected();
@@ -1843,8 +1726,8 @@ IMPL_LINK( ScAcceptChgDlg, UpdateSelectionHdl, Timer*, EMPTYARG )
}
else
{
- bAcceptFlag = sal_False;
- bRejectFlag = sal_False;
+ bAcceptFlag = false;
+ bRejectFlag = false;
}
bAcceptEnableFlag = bAcceptFlag;
bRejectEnableFlag = bRejectFlag;
@@ -1890,13 +1773,12 @@ IMPL_LINK( ScAcceptChgDlg, CommandHdl, Control*, EMPTYARG )
aPopup.CheckItem(nItemId);
PopupMenu *pSubMenu = aPopup.GetPopupMenu(SC_SUB_SORT);
+
if (pSubMenu)
- {
pSubMenu->CheckItem(nItemId);
- }
}
- aPopup.EnableItem(SC_CHANGES_COMMENT,sal_False);
+ aPopup.EnableItem(SC_CHANGES_COMMENT,false);
if(pDoc->IsDocEditable() && pEntry!=NULL)
{
@@ -1925,7 +1807,7 @@ IMPL_LINK( ScAcceptChgDlg, CommandHdl, Control*, EMPTYARG )
ScChangeAction* pScChangeAction=
(ScChangeAction*) pEntryData->pData;
- pViewData->GetDocShell()->ExecuteChangeCommentDialog( pScChangeAction, this,sal_False);
+ pViewData->GetDocShell()->ExecuteChangeCommentDialog( pScChangeAction, this,false);
}
}
}
@@ -2029,7 +1911,7 @@ void ScAcceptChgDlg::InitFilter()
pTheView->SetFilterComment(pTPFilter->IsComment());
utl::SearchParam aSearchParam( pTPFilter->GetComment(),
- utl::SearchParam::SRCH_REGEXP,sal_False,sal_False,sal_False );
+ utl::SearchParam::SRCH_REGEXP,false,false,false );
pTheView->SetCommentParams(&aSearchParam);
@@ -2037,10 +1919,6 @@ void ScAcceptChgDlg::InitFilter()
}
}
-//UNUSED2008-05 void ScAcceptChgDlg::SetMyStaticData()
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
IMPL_LINK( ScAcceptChgDlg, FilterModified, SvxTPFilter*, EMPTYARG )
{
return 0;
@@ -2067,13 +1945,10 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
if(pLeftData!=NULL && pRightData!=NULL)
{
if(pLeftData->aDateTime < pRightData->aDateTime)
- {
eCompare=COMPARE_LESS;
- }
else if(pLeftData->aDateTime > pRightData->aDateTime)
- {
eCompare=COMPARE_GREATER;
- }
+
return eCompare;
}
}
@@ -2087,25 +1962,17 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
eCompare=COMPARE_GREATER;
if(pLeftData->nTable < pRightData->nTable)
- {
eCompare=COMPARE_LESS;
- }
else if(pLeftData->nTable == pRightData->nTable)
{
if(pLeftData->nRow < pRightData->nRow)
- {
eCompare=COMPARE_LESS;
- }
else if(pLeftData->nRow == pRightData->nRow)
{
if(pLeftData->nCol < pRightData->nCol)
- {
eCompare=COMPARE_LESS;
- }
else if(pLeftData->nCol == pRightData->nCol)
- {
eCompare=COMPARE_EQUAL;
- }
}
}
@@ -2137,3 +2004,4 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
return eCompare;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/acredlin.src b/sc/source/ui/miscdlgs/acredlin.src
index 269746cf0fa1..541959eb1d7b 100644
--- a/sc/source/ui/miscdlgs/acredlin.src
+++ b/sc/source/ui/miscdlgs/acredlin.src
@@ -26,6 +26,7 @@
************************************************************************/
#include "acredlin.hrc"
+
ModelessDialog RID_SCDLG_CHANGES
{
OutputSize = TRUE ;
@@ -142,22 +143,23 @@ ModelessDialog RID_SCDLG_CHANGES
};
Bitmap BMP_STR_CLOSE
{
- File = "dir-clos.bmp" ;
+ File = "dir-clos.png" ;
};
Bitmap BMP_STR_OPEN
{
- File = "dir-open.bmp" ;
+ File = "dir-open.png" ;
};
Bitmap BMP_STR_END
{
- File = "basobj2.bmp" ;
+ File = "basobj2.png" ;
};
Bitmap BMP_STR_ERROR
{
- File = "basbrk.bmp" ;
+ File = "basbrk.png" ;
};
Text [ en-US ] = "Accept or Reject Changes" ;
};
+
Menu RID_POPUP_CHANGES
{
ItemList =
@@ -217,44 +219,3 @@ Menu RID_POPUP_CHANGES
};
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index bd058da042cb..2a3e02fa9eeb 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,8 +71,8 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi
, pAccel( NULL )
, pHiddenMarks(NULL)
, nRefTab(0)
- , bHighLightRef( sal_False )
- , bAccInserted( sal_False )
+ , bHighLightRef( false )
+ , bAccInserted( false )
{
ScInputOptions aInputOption=SC_MOD()->GetInputOptions();
bEnableColorRef=aInputOption.GetRangeFinder();
@@ -101,7 +102,7 @@ void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable )
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
while( pFrame )
{
- // #71577# enable everything except InPlace, including bean frames
+ // enable everything except InPlace, including bean frames
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
@@ -130,7 +131,7 @@ void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable )
// -----------------------------------------------------------------------------
void ScFormulaReferenceHelper::ShowSimpleReference( const XubString& rStr )
{
- if( /*!pRefEdit &&*/ bEnableColorRef )
+ if( bEnableColorRef )
{
bHighLightRef=sal_True;
ScViewData* pViewData=ScDocShell::GetViewData();
@@ -141,21 +142,17 @@ void ScFormulaReferenceHelper::ShowSimpleReference( const XubString& rStr )
ScRangeList aRangeList;
- pTabViewShell->DoneRefMode( sal_False );
+ pTabViewShell->DoneRefMode( false );
pTabViewShell->ClearHighlightRanges();
if( ParseWithNames( aRangeList, rStr, pDoc ) )
{
- ScRange* pRangeEntry = aRangeList.First();
-
- sal_uInt16 nIndex=0;
- while(pRangeEntry != NULL)
+ for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
{
- ColorData aColName = ScRangeFindList::GetColorName(nIndex++);
- pTabViewShell->AddHighlightRange(*pRangeEntry, aColName);
-
- pRangeEntry = aRangeList.Next();
- }
+ ScRange* pRangeEntry = aRangeList[ i ];
+ ColorData aColName = ScRangeFindList::GetColorName( i );
+ pTabViewShell->AddHighlightRange( *pRangeEntry, aColName );
+ }
}
}
}
@@ -211,7 +208,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr )
if(pTabViewShell!=NULL && pScTokA!=NULL)
{
- pTabViewShell->DoneRefMode( sal_False );
+ pTabViewShell->DoneRefMode( false );
pTabViewShell->ClearHighlightRanges();
pScTokA->Reset();
@@ -267,10 +264,10 @@ void ScFormulaReferenceHelper::HideReference( sal_Bool bDoneRefMode )
// In that case, RefMode was just started and must not be ended now.
if ( bDoneRefMode )
- pTabViewShell->DoneRefMode( sal_False );
+ pTabViewShell->DoneRefMode( false );
pTabViewShell->ClearHighlightRanges();
}
- bHighLightRef=sal_False;
+ bHighLightRef=false;
}
}
// -----------------------------------------------------------------------------
@@ -303,8 +300,6 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit, formula::R
if( !pRefEdit && pEdit )
{
m_pDlg->RefInputStart( pEdit, pButton );
-// if( pRefEdit )
-// pRefEdit->SilentGrabFocus();
}
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -318,14 +313,14 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit, formula::R
ScRangeList aRangeList;
if( ParseWithNames( aRangeList, pRefEdit->GetText(), pDoc ) )
{
- const ScRange* pRange = aRangeList.GetObject( 0 );
- if( pRange )
+ if ( !aRangeList.empty() )
{
+ const ScRange* pRange = aRangeList.front();
pViewShell->SetTabNo( pRange->aStart.Tab() );
pViewShell->MoveCursorAbs( pRange->aStart.Col(),
- pRange->aStart.Row(), SC_FOLLOW_JUMP, sal_False, sal_False );
+ pRange->aStart.Row(), SC_FOLLOW_JUMP, false, false );
pViewShell->MoveCursorAbs( pRange->aEnd.Col(),
- pRange->aEnd.Row(), SC_FOLLOW_JUMP, sal_True, sal_False );
+ pRange->aEnd.Row(), SC_FOLLOW_JUMP, sal_True, false );
m_pDlg->SetReference( *pRange, pDoc );
}
}
@@ -351,7 +346,7 @@ void ScFormulaReferenceHelper::Init()
pRefComp->SetCompileForFAP(sal_True);
nRefTab = nTab;
- } // if ( pViewData )
+ }
}
// -----------------------------------------------------------------------------
IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel )
@@ -373,15 +368,12 @@ IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel )
//----------------------------------------------------------------------------
void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced )
{
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //if (pRefEdit && (bForced || !pRefBtn))
- if ( CanInputDone( bForced ) )//if (pRefEdit && (bForced || !pRefBtn))
- //-->Modified by PengYunQuan for Validity Cell Range Picker
+ if ( CanInputDone( bForced ) )
{
if (bAccInserted) // Accelerator wieder abschalten
{
Application::RemoveAccel( pAccel.get() );
- bAccInserted = sal_False;
+ bAccInserted = false;
}
// Fenstertitel anpassen
@@ -432,7 +424,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
pHiddenMarks = new sal_Bool [nChildren];
for (sal_uInt16 i = 0; i < nChildren; i++)
{
- pHiddenMarks[i] = sal_False;
+ pHiddenMarks[i] = false;
Window* pWin = m_pWindow->GetChild(i);
pWin = pWin->GetWindow( WINDOW_CLIENT );
if (pWin == (Window*)pRefEdit)
@@ -487,18 +479,15 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
// Fenstertitel anpassen
m_pWindow->SetText( MnemonicGenerator::EraseAllMnemonicChars( sNewDialogText ) );
-// if ( pButton ) // ueber den Button: Enter und Escape abfangen
-// {
- if (!pAccel.get())
- {
- pAccel.reset( new Accelerator );
- pAccel->InsertItem( 1, KeyCode( KEY_RETURN ) );
- pAccel->InsertItem( 2, KeyCode( KEY_ESCAPE ) );
- pAccel->SetSelectHdl( LINK( this, ScFormulaReferenceHelper, AccelSelectHdl ) );
- }
- Application::InsertAccel( pAccel.get() );
- bAccInserted = sal_True;
-// }
+ if (!pAccel.get())
+ {
+ pAccel.reset( new Accelerator );
+ pAccel->InsertItem( 1, KeyCode( KEY_RETURN ) );
+ pAccel->InsertItem( 2, KeyCode( KEY_ESCAPE ) );
+ pAccel->SetSelectHdl( LINK( this, ScFormulaReferenceHelper, AccelSelectHdl ) );
+ }
+ Application::InsertAccel( pAccel.get() );
+ bAccInserted = true;
}
}
// -----------------------------------------------------------------------------
@@ -526,7 +515,7 @@ sal_Bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
{
SfxApplication* pSfxApp = SFX_APP();
- SetDispatcherLock( sal_False ); //! here and in dtor ?
+ SetDispatcherLock( false ); //! here and in dtor ?
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if ( pViewFrm && pViewFrm->HasChildWindow(FID_INPUTLINE_STATUS) )
@@ -550,7 +539,7 @@ sal_Bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
if (pMyDisp)
pMyViewFrm = pMyDisp->GetFrame();
}
- SC_MOD()->SetRefDialog( nId, sal_False, pMyViewFrm );
+ SC_MOD()->SetRefDialog( nId, false, pMyViewFrm );
pSfxApp->Broadcast( SfxSimpleHint( FID_KILLEDITVIEW ) );
@@ -587,7 +576,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( sal_Bool bLock )
// -----------------------------------------------------------------------------
void ScFormulaReferenceHelper::ViewShellChanged(ScTabViewShell* /* pScViewShell */)
{
- enableInput( sal_False );
+ enableInput( false );
EnableSpreadsheets();
}
@@ -600,7 +589,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChil
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
while( pFrame )
{
- // #71577# enable everything except InPlace, including bean frames
+ // enable everything except InPlace, including bean frames
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
@@ -613,7 +602,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChil
Window *pParent=pWin->GetParent();
if(pParent)
{
- pParent->EnableInput(bFlag,sal_False);
+ pParent->EnableInput(bFlag,false);
if(bChilds)
pViewSh->EnableRefInput(bFlag);
}
@@ -640,7 +629,7 @@ void lcl_InvalidateWindows()
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
while( pFrame )
{
- // #71577# enable everything except InPlace, including bean frames
+ // enable everything except InPlace, including bean frames
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
@@ -705,7 +694,6 @@ bool ScRefHandler::EnterRefMode()
if( m_bInRefMode ) return false;
SC_MOD()->InputEnterHandler();
-// ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell();
ScTabViewShell* pScViewShell = NULL;
@@ -740,15 +728,13 @@ bool ScRefHandler::EnterRefMode()
if ( pInputHdl )
pInputHdl->NotifyChange( NULL );
- m_aHelper.enableInput( sal_False );
+ m_aHelper.enableInput( false );
m_aHelper.EnableSpreadsheets();
m_aHelper.Init();
- m_aHelper.SetDispatcherLock( sal_True );
- //@Test
- //SFX_APPWINDOW->Disable(sal_True); //@BugID 54702
+ m_aHelper.SetDispatcherLock( true );
return m_bInRefMode = true;
}
@@ -767,14 +753,13 @@ bool ScRefHandler::LeaveRefMode()
lcl_HideAllReferences();
if( Dialog *pDlg = dynamic_cast<Dialog*>( static_cast<Window*>(*this) ) )
- pDlg->SetModalInputMode(sal_False);
- SetDispatcherLock( sal_False ); //! here and in DoClose ?
+ pDlg->SetModalInputMode(false);
+ SetDispatcherLock( false ); //! here and in DoClose ?
ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell();
if( pScViewShell )
pScViewShell->UpdateInputHandler(sal_True);
- //SFX_APPWINDOW->Enable(sal_True,sal_True);
lcl_InvalidateWindows();
m_bInRefMode = false;
@@ -783,15 +768,6 @@ bool ScRefHandler::LeaveRefMode()
//----------------------------------------------------------------------------
-//SfxBindings& ScRefHandler::GetBindings()
-//{
-// //! SfxModelessDialog should allow access to pBindings pointer
-//
-// return *pMyBindings;
-//}
-
-//----------------------------------------------------------------------------
-
void ScRefHandler::SwitchToDocument()
{
ScTabViewShell* pCurrent = ScTabViewShell::GetActiveViewShell();
@@ -835,14 +811,14 @@ sal_Bool ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh ma
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScRefHandler::IsRefInputMode() const
+sal_Bool ScRefHandler::IsRefInputMode() const
{
return m_rWindow.IsVisible(); // nur wer sichtbar ist kann auch Referenzen bekommen
}
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScRefHandler::DoClose( sal_uInt16 nId )
+sal_Bool ScRefHandler::DoClose( sal_uInt16 nId )
{
m_aHelper.DoClose(nId);
return sal_True;
@@ -869,11 +845,11 @@ void ScRefHandler::AddRefEntry()
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScRefHandler::IsTableLocked() const
+sal_Bool ScRefHandler::IsTableLocked() const
{
// per Default kann bei Referenzeingabe auch die Tabelle umgeschaltet werden
- return sal_False;
+ return false;
}
//----------------------------------------------------------------------------
@@ -894,38 +870,6 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton*
m_aHelper.ToggleCollapsed( pEdit, pButton );
}
-//The two following function is commentted out by PengYunQuan for Validity Cell Range Picker
-//long ScAnyRefDlg::PreNotify( NotifyEvent& rNEvt )
-//{
-// sal_uInt16 nSwitch=rNEvt.GetType();
-// if(nSwitch==EVENT_GETFOCUS)
-// {
-// pActiveWin=rNEvt.GetWindow();
-// }
-// return SfxModelessDialog::PreNotify(rNEvt);
-//}
-//
-//void ScAnyRefDlg::StateChanged( StateChangedType nStateChange )
-//{
-// SfxModelessDialog::StateChanged( nStateChange );
-//
-// if(nStateChange == STATE_CHANGE_VISIBLE)
-// {
-// if(IsVisible())
-// {
-// m_aHelper.enableInput( sal_False );
-// m_aHelper.EnableSpreadsheets();
-// m_aHelper.SetDispatcherLock( sal_True );
-// aTimer.Start();
-// }
-// else
-// {
-// m_aHelper.enableInput( sal_True );
-// m_aHelper.SetDispatcherLock( sal_False ); //! here and in DoClose ?
-// }
-// }
-//}
-
#if defined( _MSC_VER )
#define INTRODUCE_TEMPLATE
#else
@@ -957,7 +901,7 @@ INTRODUCE_TEMPLATE void ScRefHdlrImplBase<TWindow,bBindRef>::StateChanged( State
{\
if(m_rWindow.IsVisible())\
{\
- m_aHelper.enableInput( sal_False );\
+ m_aHelper.enableInput( false );\
m_aHelper.EnableSpreadsheets();\
m_aHelper.SetDispatcherLock( sal_True );\
aTimer.Start();\
@@ -965,7 +909,7 @@ INTRODUCE_TEMPLATE void ScRefHdlrImplBase<TWindow,bBindRef>::StateChanged( State
else\
{\
m_aHelper.enableInput( sal_True );\
- m_aHelper.SetDispatcherLock( sal_False ); /*//! here and in DoClose ?*/\
+ m_aHelper.SetDispatcherLock( false ); /*//! here and in DoClose ?*/\
}\
}\
}
@@ -1009,3 +953,4 @@ void ScRefHandler::RefInputDone( sal_Bool bForced )
m_aHelper.RefInputDone( bForced );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index f93deead5216..3cc608c0c8d0 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,7 +59,6 @@
#include "global.hxx"
#include "globstr.hrc"
#include "autoform.hxx"
-//CHINA001 #include "strindlg.hxx"
#include "miscdlgs.hrc"
#include "autofmt.hxx"
#include "scresid.hxx"
@@ -69,417 +69,6 @@
#define FRAME_OFFSET 4
-//CHINA001 //========================================================================
-//CHINA001 // AutoFormat-Dialog:
-//CHINA001
-//CHINA001 ScAutoFormatDlg::ScAutoFormatDlg( Window* pParent,
-//CHINA001 ScAutoFormat* pAutoFormat,
-//CHINA001 const ScAutoFormatData* pSelFormatData,
-//CHINA001 ScDocument* pDoc ) :
-//CHINA001
-//CHINA001 ModalDialog ( pParent, ScResId( RID_SCDLG_AUTOFORMAT ) ),
-//CHINA001 //
-//CHINA001 aLbFormat ( this, ScResId( LB_FORMAT ) ),
-//CHINA001 aFlFormat ( this, ScResId( FL_FORMAT ) ),
-//CHINA001 pWndPreview ( new ScAutoFmtPreview( this, ScResId( WND_PREVIEW ), pDoc ) ),
-//CHINA001 aBtnNumFormat ( this, ScResId( BTN_NUMFORMAT ) ),
-//CHINA001 aBtnBorder ( this, ScResId( BTN_BORDER ) ),
-//CHINA001 aBtnFont ( this, ScResId( BTN_FONT ) ),
-//CHINA001 aBtnPattern ( this, ScResId( BTN_PATTERN ) ),
-//CHINA001 aBtnAlignment ( this, ScResId( BTN_ALIGNMENT ) ),
-//CHINA001 aBtnAdjust ( this, ScResId( BTN_ADJUST ) ),
-//CHINA001 aFlFormatting ( this, ScResId( FL_FORMATTING ) ),
-//CHINA001 aBtnOk ( this, ScResId( BTN_OK ) ),
-//CHINA001 aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
-//CHINA001 aBtnHelp ( this, ScResId( BTN_HELP ) ),
-//CHINA001 aBtnAdd ( this, ScResId( BTN_ADD ) ),
-//CHINA001 aBtnRemove ( this, ScResId( BTN_REMOVE ) ),
-//CHINA001 aBtnMore ( this, ScResId( BTN_MORE ) ),
-//CHINA001 aBtnRename ( this, ScResId( BTN_RENAME ) ),
-//CHINA001 aStrTitle ( ScResId( STR_ADD_TITLE ) ),
-//CHINA001 aStrLabel ( ScResId( STR_ADD_LABEL ) ),
-//CHINA001 aStrRename ( ScResId( STR_RENAME_TITLE ) ),
-//CHINA001 aStrClose ( ScResId( STR_BTN_CLOSE ) ),
-//CHINA001 aStrDelTitle ( ScResId( STR_DEL_TITLE ) ),
-//CHINA001 aStrDelMsg ( ScResId( STR_DEL_MSG ) ) ,
-//CHINA001 //
-//CHINA001 nIndex ( 0 ),
-//CHINA001 bFmtInserted ( sal_False ),
-//CHINA001 bCoreDataChanged( sal_False ),
-//CHINA001 pFormat ( pAutoFormat ),
-//CHINA001 pSelFmtData ( pSelFormatData )
-//CHINA001 {
-//CHINA001 Init();
-//CHINA001 pWndPreview->NotifyChange( (*pFormat)[0] );
-//CHINA001 FreeResource();
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 ScAutoFormatDlg::~ScAutoFormatDlg()
-//CHINA001 {
-//CHINA001 delete pWndPreview;
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 void ScAutoFormatDlg::Init()
-//CHINA001 {
-//CHINA001 sal_uInt16 nCount;
-//CHINA001 String aEntry;
-//CHINA001
-//CHINA001 aLbFormat .SetSelectHdl( LINK( this, ScAutoFormatDlg, SelFmtHdl ) );
-//CHINA001 aBtnNumFormat.SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) );
-//CHINA001 aBtnBorder .SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) );
-//CHINA001 aBtnFont .SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) );
-//CHINA001 aBtnPattern .SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) );
-//CHINA001 aBtnAlignment.SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) );
-//CHINA001 aBtnAdjust .SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) );
-//CHINA001 aBtnAdd .SetClickHdl ( LINK( this, ScAutoFormatDlg, AddHdl ) );
-//CHINA001 aBtnRemove .SetClickHdl ( LINK( this, ScAutoFormatDlg, RemoveHdl ) );
-//CHINA001 aBtnOk .SetClickHdl ( LINK( this, ScAutoFormatDlg, CloseHdl ) );
-//CHINA001 aBtnCancel .SetClickHdl ( LINK( this, ScAutoFormatDlg, CloseHdl ) );
-//CHINA001 aBtnRename .SetClickHdl ( LINK( this, ScAutoFormatDlg, RenameHdl ) );
-//CHINA001 aLbFormat .SetDoubleClickHdl( LINK( this, ScAutoFormatDlg, DblClkHdl ) );
-//CHINA001
-//CHINA001 aBtnMore.AddWindow( &aBtnRename );
-//CHINA001 aBtnMore.AddWindow( &aBtnNumFormat );
-//CHINA001 aBtnMore.AddWindow( &aBtnBorder );
-//CHINA001 aBtnMore.AddWindow( &aBtnFont );
-//CHINA001 aBtnMore.AddWindow( &aBtnPattern );
-//CHINA001 aBtnMore.AddWindow( &aBtnAlignment );
-//CHINA001 aBtnMore.AddWindow( &aBtnAdjust );
-//CHINA001 aBtnMore.AddWindow( &aFlFormatting );
-//CHINA001
-//CHINA001 nCount = pFormat->GetCount();
-//CHINA001
-//CHINA001 for ( sal_uInt16 i = 0; i < nCount; i++ )
-//CHINA001 {
-//CHINA001 ((*pFormat)[i])->GetName( aEntry );
-//CHINA001 aLbFormat.InsertEntry( aEntry );
-//CHINA001 }
-//CHINA001
-//CHINA001 if ( nCount == 1 )
-//CHINA001 aBtnRemove.Disable();
-//CHINA001
-//CHINA001 aLbFormat.SelectEntryPos( 0 );
-//CHINA001 aBtnRename.Disable();
-//CHINA001 aBtnRemove.Disable();
-//CHINA001
-//CHINA001 nIndex = 0;
-//CHINA001 UpdateChecks();
-//CHINA001
-//CHINA001 if ( !pSelFmtData )
-//CHINA001 {
-//CHINA001 aBtnAdd.Disable();
-//CHINA001 aBtnRemove.Disable();
-//CHINA001 bFmtInserted = sal_True;
-//CHINA001 }
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 void ScAutoFormatDlg::UpdateChecks()
-//CHINA001 {
-//CHINA001 ScAutoFormatData* pData = (*pFormat)[nIndex];
-//CHINA001
-//CHINA001 aBtnNumFormat.Check( pData->GetIncludeValueFormat() );
-//CHINA001 aBtnBorder .Check( pData->GetIncludeFrame() );
-//CHINA001 aBtnFont .Check( pData->GetIncludeFont() );
-//CHINA001 aBtnPattern .Check( pData->GetIncludeBackground() );
-//CHINA001 aBtnAlignment.Check( pData->GetIncludeJustify() );
-//CHINA001 aBtnAdjust .Check( pData->GetIncludeWidthHeight() );
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001 // Handler:
-//CHINA001 //---------
-//CHINA001
-//CHINA001 IMPL_LINK( ScAutoFormatDlg, CloseHdl, PushButton *, pBtn )
-//CHINA001 {
-//CHINA001 if ( pBtn == &aBtnOk || pBtn == &aBtnCancel )
-//CHINA001 {
-//CHINA001 if ( bCoreDataChanged )
-//CHINA001 ScGlobal::GetAutoFormat()->Save();
-//CHINA001
-//CHINA001 EndDialog( (pBtn == &aBtnOk) ? RET_OK : RET_CANCEL );
-//CHINA001 }
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 IMPL_LINK_INLINE_START( ScAutoFormatDlg, DblClkHdl, void *, EMPTYARG )
-//CHINA001 {
-//CHINA001 if ( bCoreDataChanged )
-//CHINA001 ScGlobal::GetAutoFormat()->Save();
-//CHINA001
-//CHINA001 EndDialog( RET_OK );
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001 IMPL_LINK_INLINE_END( ScAutoFormatDlg, DblClkHdl, void *, EMPTYARG )
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 IMPL_LINK( ScAutoFormatDlg, CheckHdl, Button *, pBtn )
-//CHINA001 {
-//CHINA001 ScAutoFormatData* pData = (*pFormat)[nIndex];
-//CHINA001 sal_Bool bCheck = ((CheckBox*)pBtn)->IsChecked();
-//CHINA001
-//CHINA001 if ( pBtn == &aBtnNumFormat )
-//CHINA001 pData->SetIncludeValueFormat( bCheck );
-//CHINA001 else if ( pBtn == &aBtnBorder )
-//CHINA001 pData->SetIncludeFrame( bCheck );
-//CHINA001 else if ( pBtn == &aBtnFont )
-//CHINA001 pData->SetIncludeFont( bCheck );
-//CHINA001 else if ( pBtn == &aBtnPattern )
-//CHINA001 pData->SetIncludeBackground( bCheck );
-//CHINA001 else if ( pBtn == &aBtnAlignment )
-//CHINA001 pData->SetIncludeJustify( bCheck );
-//CHINA001 else if ( pBtn == &aBtnAdjust )
-//CHINA001 pData->SetIncludeWidthHeight( bCheck );
-//CHINA001
-//CHINA001 if ( !bCoreDataChanged )
-//CHINA001 {
-//CHINA001 aBtnCancel.SetText( aStrClose );
-//CHINA001 bCoreDataChanged = sal_True;
-//CHINA001 }
-//CHINA001
-//CHINA001 pWndPreview->NotifyChange( pData );
-//CHINA001
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 IMPL_LINK( ScAutoFormatDlg, AddHdl, void *, EMPTYARG )
-//CHINA001 {
-//CHINA001 if ( !bFmtInserted && pSelFmtData )
-//CHINA001 {
-//CHINA001 String aStrStandard( ScResId(STR_STANDARD) );
-//CHINA001 String aFormatName;
-//CHINA001 ScStringInputDlg* pDlg;
-//CHINA001 sal_Bool bOk = sal_False;
-//CHINA001
-//CHINA001 while ( !bOk )
-//CHINA001 {
-//CHINA001 pDlg = new ScStringInputDlg( this,
-//CHINA001 aStrTitle,
-//CHINA001 aStrLabel,
-//CHINA001 aFormatName,
-//CHINA001 HID_SC_ADD_AUTOFMT );
-//CHINA001
-//CHINA001 if ( pDlg->Execute() == RET_OK )
-//CHINA001 {
-//CHINA001 pDlg->GetInputString( aFormatName );
-//CHINA001
-//CHINA001 if ( (aFormatName.Len() > 0) && (aFormatName != aStrStandard) )
-//CHINA001 {
-//CHINA001 ScAutoFormatData* pNewData
-//CHINA001 = new ScAutoFormatData( *pSelFmtData );
-//CHINA001
-//CHINA001 pNewData->SetName( aFormatName );
-//CHINA001 bFmtInserted = pFormat->Insert( pNewData );
-//CHINA001
-//CHINA001 if ( bFmtInserted )
-//CHINA001 {
-//CHINA001 sal_uInt16 nAt = pFormat->IndexOf( pNewData );
-//CHINA001
-//CHINA001 aLbFormat.InsertEntry( aFormatName, nAt );
-//CHINA001 aLbFormat.SelectEntry( aFormatName );
-//CHINA001 aBtnAdd.Disable();
-//CHINA001
-//CHINA001 if ( !bCoreDataChanged )
-//CHINA001 {
-//CHINA001 aBtnCancel.SetText( aStrClose );
-//CHINA001 bCoreDataChanged = sal_True;
-//CHINA001 }
-//CHINA001
-//CHINA001 SelFmtHdl( 0 );
-//CHINA001 bOk = sal_True;
-//CHINA001 }
-//CHINA001 else
-//CHINA001 delete pNewData;
-//CHINA001
-//CHINA001 }
-//CHINA001
-//CHINA001 if ( !bFmtInserted )
-//CHINA001 {
-//CHINA001 sal_uInt16 nRet = ErrorBox( this,
-//CHINA001 WinBits( WB_OK_CANCEL | WB_DEF_OK),
-//CHINA001 ScGlobal::GetRscString(STR_INVALID_AFNAME)
-//CHINA001 ).Execute();
-//CHINA001
-//CHINA001 bOk = ( nRet == RET_CANCEL );
-//CHINA001 }
-//CHINA001 }
-//CHINA001 else
-//CHINA001 bOk = sal_True;
-//CHINA001
-//CHINA001 delete pDlg;
-//CHINA001 }
-//CHINA001 }
-//CHINA001
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 IMPL_LINK( ScAutoFormatDlg, RemoveHdl, void *, EMPTYARG )
-//CHINA001 {
-//CHINA001 if ( (nIndex > 0) && (aLbFormat.GetEntryCount() > 0) )
-//CHINA001 {
-//CHINA001 String aMsg( aStrDelMsg.GetToken( 0, '#' ) );
-//CHINA001
-//CHINA001 aMsg += aLbFormat.GetSelectEntry();
-//CHINA001 aMsg += aStrDelMsg.GetToken( 1, '#' );
-//CHINA001
-//CHINA001 if ( RET_YES ==
-//CHINA001 QueryBox( this, WinBits( WB_YES_NO | WB_DEF_YES ), aMsg ).Execute() )
-//CHINA001 {
-//CHINA001 aLbFormat.RemoveEntry( nIndex );
-//CHINA001 aLbFormat.SelectEntryPos( nIndex-1 );
-//CHINA001
-//CHINA001 if ( nIndex-1 == 0 )
-//CHINA001 aBtnRemove.Disable();
-//CHINA001
-//CHINA001 if ( !bCoreDataChanged )
-//CHINA001 {
-//CHINA001 aBtnCancel.SetText( aStrClose );
-//CHINA001 bCoreDataChanged = sal_True;
-//CHINA001 }
-//CHINA001
-//CHINA001 pFormat->AtFree( nIndex ); // in der Core loeschen
-//CHINA001 nIndex--;
-//CHINA001
-//CHINA001 SelFmtHdl( 0 );
-//CHINA001 }
-//CHINA001 }
-//CHINA001
-//CHINA001 SelFmtHdl( 0 );
-//CHINA001
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 IMPL_LINK( ScAutoFormatDlg, RenameHdl, void *, pBtn)
-//CHINA001 {
-//CHINA001 sal_Bool bOk = sal_False;
-//CHINA001 while( !bOk )
-//CHINA001 {
-//CHINA001
-//CHINA001 String aFormatName=aLbFormat.GetSelectEntry();
-//CHINA001 String aEntry;
-//CHINA001
-//CHINA001 ScStringInputDlg* pDlg = new ScStringInputDlg( this,
-//CHINA001 aStrRename,
-//CHINA001 aStrLabel,
-//CHINA001 aFormatName,
-//CHINA001 HID_SC_RENAME_AUTOFMT );
-//CHINA001 if( pDlg->Execute() == RET_OK )
-//CHINA001 {
-//CHINA001 sal_Bool bFmtRenamed = sal_False;
-//CHINA001 pDlg->GetInputString( aFormatName );
-//CHINA001 sal_uInt16 n;
-//CHINA001
-//CHINA001 if ( aFormatName.Len() > 0 )
-//CHINA001 {
-//CHINA001 for( n = 0; n < pFormat->GetCount(); ++n )
-//CHINA001 {
-//CHINA001 (*pFormat)[n]->GetName(aEntry);
-//CHINA001 if ( aEntry== aFormatName)
-//CHINA001 break;
-//CHINA001 }
-//CHINA001 if( n >= pFormat->GetCount() )
-//CHINA001 {
-//CHINA001 // Format mit dem Namen noch nicht vorhanden, also
-//CHINA001 // umbenennen
-//CHINA001
-//CHINA001 aLbFormat.RemoveEntry(nIndex );
-//CHINA001 ScAutoFormatData* p=(*pFormat)[ nIndex ];
-//CHINA001 ScAutoFormatData* pNewData
-//CHINA001 = new ScAutoFormatData(*p);
-//CHINA001
-//CHINA001 pFormat->AtFree( nIndex );
-//CHINA001
-//CHINA001 pNewData->SetName( aFormatName );
-//CHINA001
-//CHINA001 pFormat->Insert( pNewData);
-//CHINA001
-//CHINA001 sal_uInt16 nCount = pFormat->GetCount();
-//CHINA001
-//CHINA001 aLbFormat.SetUpdateMode(sal_False);
-//CHINA001 aLbFormat.Clear();
-//CHINA001 for ( sal_uInt16 i = 0; i < nCount; i++ )
-//CHINA001 {
-//CHINA001 ((*pFormat)[i])->GetName( aEntry );
-//CHINA001 aLbFormat.InsertEntry( aEntry );
-//CHINA001 }
-//CHINA001
-//CHINA001 aLbFormat.SetUpdateMode( sal_True);
-//CHINA001 aLbFormat.SelectEntry( aFormatName);
-//CHINA001
-//CHINA001 if ( !bCoreDataChanged )
-//CHINA001 {
-//CHINA001 aBtnCancel.SetText( aStrClose );
-//CHINA001 bCoreDataChanged = sal_True;
-//CHINA001 }
-//CHINA001
-//CHINA001
-//CHINA001 SelFmtHdl( 0 );
-//CHINA001 bOk = sal_True;
-//CHINA001 bFmtRenamed = sal_True;
-//CHINA001 }
-//CHINA001 }
-//CHINA001 if( !bFmtRenamed )
-//CHINA001 {
-//CHINA001 bOk = RET_CANCEL == ErrorBox( this,
-//CHINA001 WinBits( WB_OK_CANCEL | WB_DEF_OK),
-//CHINA001 ScGlobal::GetRscString(STR_INVALID_AFNAME)
-//CHINA001 ).Execute();
-//CHINA001 }
-//CHINA001 }
-//CHINA001 else
-//CHINA001 bOk = sal_True;
-//CHINA001 delete pDlg;
-//CHINA001 }
-//CHINA001
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 IMPL_LINK( ScAutoFormatDlg, SelFmtHdl, void *, EMPTYARG )
-//CHINA001 {
-//CHINA001 nIndex = aLbFormat.GetSelectEntryPos();
-//CHINA001 UpdateChecks();
-//CHINA001
-//CHINA001 if ( nIndex == 0 )
-//CHINA001 {
-//CHINA001 aBtnRename.Disable();
-//CHINA001 aBtnRemove.Disable();
-//CHINA001 }
-//CHINA001 else
-//CHINA001 {
-//CHINA001 aBtnRename.Enable();
-//CHINA001 aBtnRemove.Enable();
-//CHINA001 }
-//CHINA001
-//CHINA001 pWndPreview->NotifyChange( (*pFormat)[nIndex] );
-//CHINA001
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 //------------------------------------------------------------------------
-//CHINA001
-//CHINA001 String ScAutoFormatDlg::GetCurrFormatName()
-//CHINA001 {
-//CHINA001 String aResult;
-//CHINA001
-//CHINA001 ((*pFormat)[nIndex])->GetName( aResult );
-//CHINA001
-//CHINA001 return aResult;
-//CHINA001 }
-//CHINA001
//========================================================================
// ScAutoFmtPreview
@@ -489,7 +78,7 @@ ScAutoFmtPreview::ScAutoFmtPreview( Window* pParent, const ResId& rRes, ScDocume
aVD ( *this ),
aScriptedText ( aVD ),
xBreakIter ( pDoc->GetBreakIterator() ),
- bFitWidth ( sal_False ),
+ bFitWidth ( false ),
mbRTL ( false ),
aPrvSize ( GetSizePixel().Width() - 6, GetSizePixel().Height() - 30 ),
mnLabelColWidth ( (aPrvSize.Width() - 4) / 4 - 12 ),
@@ -849,7 +438,7 @@ void ScAutoFmtPreview::Init()
SetBorderStyle( WINDOW_BORDER_MONO );
maArray.Initialize( 5, 5 );
maArray.SetUseDiagDoubleClipping( false );
- CalcCellArray( sal_False );
+ CalcCellArray( false );
CalcLineMap();
TypeId aType(TYPE(ScDocShell));
@@ -940,9 +529,6 @@ void ScAutoFmtPreview::NotifyChange( ScAutoFormatData* pNewData )
void ScAutoFmtPreview::DoPaint( const Rectangle& /* rRect */ )
{
sal_uInt32 nOldDrawMode = aVD.GetDrawMode();
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- aVD.SetDrawMode( DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
Size aWndSize( GetSizePixel() );
Font aFont( aVD.GetFont() );
@@ -977,3 +563,4 @@ void ScAutoFmtPreview::Paint( const Rectangle& rRect )
DoPaint( rRect );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 51f457788d27..6b3f694195fd 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,20 +77,6 @@ bool ScConflictsListEntry::HasOwnAction( sal_uLong nOwnAction ) const
// class ScConflictsListHelper
//=============================================================================
-//UNUSED2008-05 bool ScConflictsListHelper::HasSharedAction( ScConflictsList& rConflictsList, sal_uLong nSharedAction )
-//UNUSED2008-05 {
-//UNUSED2008-05 ScConflictsList::const_iterator aEnd = rConflictsList.end();
-//UNUSED2008-05 for ( ScConflictsList::const_iterator aItr = rConflictsList.begin(); aItr != aEnd; ++aItr )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( aItr->HasSharedAction( nSharedAction ) )
-//UNUSED2008-05 {
-//UNUSED2008-05 return true;
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 return false;
-//UNUSED2008-05 }
-
bool ScConflictsListHelper::HasOwnAction( ScConflictsList& rConflictsList, sal_uLong nOwnAction )
{
ScConflictsList::const_iterator aEnd = rConflictsList.end();
@@ -145,12 +132,12 @@ void ScConflictsListHelper::Transform_Impl( ScChangeActionList& rActionList, ScC
if ( aItrMap != pMergeMap->end() )
{
*aItr = aItrMap->second;
- aItr++;
+ ++aItr;
}
else
{
aItr = rActionList.erase( aItr );
- DBG_ERROR( "ScConflictsListHelper::Transform_Impl: erased action from conflicts list!" );
+ OSL_FAIL( "ScConflictsListHelper::Transform_Impl: erased action from conflicts list!" );
}
}
}
@@ -357,25 +344,6 @@ void ScConflictsResolver::HandleAction( ScChangeAction* pAction, bool bIsSharedA
}
}
}
- else if ( eConflictAction == SC_CONFLICT_ACTION_KEEP_OTHER )
- {
- if ( pAction->GetType() == SC_CAT_CONTENT )
- {
- if ( bHandleContentAction )
- {
- // do nothing
- //mpTrack->SelectContent( pAction );
- }
- }
- else
- {
- if ( bHandleNonContentAction )
- {
- // do nothing
- //mpTrack->Accept( pAction );
- }
- }
- }
}
}
else
@@ -430,11 +398,6 @@ void ScConflictsResolver::HandleAction( ScChangeAction* pAction, bool bIsSharedA
// class ScConflictsListBox
//=============================================================================
-//UNUSED2008-05 ScConflictsListBox::ScConflictsListBox( Window* pParent, WinBits nBits )
-//UNUSED2008-05 :SvxRedlinTable( pParent, nBits )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
ScConflictsListBox::ScConflictsListBox( Window* pParent, const ResId& rResId )
:SvxRedlinTable( pParent, rResId )
{
@@ -444,23 +407,6 @@ ScConflictsListBox::~ScConflictsListBox()
{
}
-//UNUSED2008-05 sal_uLong ScConflictsListBox::GetRootEntryPos( const SvLBoxEntry* pRootEntry ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_uLong nPos = 0;
-//UNUSED2008-05 SvLBoxEntry* pEntry = GetRootLevelParent( First() );
-//UNUSED2008-05 while ( pEntry )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( pEntry == pRootEntry )
-//UNUSED2008-05 {
-//UNUSED2008-05 return nPos;
-//UNUSED2008-05 }
-//UNUSED2008-05 pEntry = NextSibling( pEntry );
-//UNUSED2008-05 ++nPos;
-//UNUSED2008-05 }
-//UNUSED2008-05 return 0xffffffff;
-//UNUSED2008-05 }
-
-
//=============================================================================
// class ScConflictsDlg
//=============================================================================
@@ -582,7 +528,7 @@ String ScConflictsDlg::GetActionString( const ScChangeAction* pAction, ScDocumen
DateTime aDateTime = pAction->GetDateTime();
aString += ScGlobal::pLocaleData->getDate( aDateTime );
aString += ' ';
- aString += ScGlobal::pLocaleData->getTime( aDateTime, sal_False );
+ aString += ScGlobal::pLocaleData->getTime( aDateTime, false );
aString += '\t';
}
@@ -606,7 +552,7 @@ void ScConflictsDlg::HandleListBoxSelection( bool bSelectHandle )
{
if ( bSelectHandle )
{
- maLbConflicts.SelectAll( sal_False );
+ maLbConflicts.SelectAll( false );
}
if ( !maLbConflicts.IsSelected( pRootEntry ) )
{
@@ -662,7 +608,7 @@ IMPL_LINK( ScConflictsDlg, UpdateSelectionHdl, Timer*, EMPTYARG )
ScTabView* pTabView = mpViewData->GetView();
pTabView->DoneBlockMode();
- sal_Bool bContMark = sal_False;
+ sal_Bool bContMark = false;
SvLBoxEntry* pEntry = maLbConflicts.FirstSelected();
while ( pEntry )
{
@@ -735,7 +681,7 @@ void ScConflictsDlg::KeepAllHandler( bool bMine )
SetConflictAction( pRootEntry, eConflictAction );
pRootEntry = maLbConflicts.NextSibling( pRootEntry );
}
- maLbConflicts.SetUpdateMode( sal_False );
+ maLbConflicts.SetUpdateMode( false );
maLbConflicts.Clear();
maLbConflicts.SetUpdateMode( sal_True );
SetPointer( Pointer( POINTER_ARROW ) );
@@ -892,3 +838,5 @@ void ScConflictsDlg::UpdateView()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.src b/sc/source/ui/miscdlgs/conflictsdlg.src
index 1bdec57067f4..dd127cebe24b 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.src
+++ b/sc/source/ui/miscdlgs/conflictsdlg.src
@@ -110,4 +110,3 @@ ModalDialog RID_SCDLG_CONFLICTS
Text [ en-US ] = "Unknown User" ;
};
};
-
diff --git a/sc/source/ui/miscdlgs/crdlg.cxx b/sc/source/ui/miscdlgs/crdlg.cxx
index 90e77cf58e92..e2dea76b26aa 100644
--- a/sc/source/ui/miscdlgs/crdlg.cxx
+++ b/sc/source/ui/miscdlgs/crdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,7 @@ ScColOrRowDlg::ScColOrRowDlg( Window* pParent,
//------------------------------------------------------------------------
-__EXPORT ScColOrRowDlg::~ScColOrRowDlg()
+ScColOrRowDlg::~ScColOrRowDlg()
{
}
@@ -85,3 +86,4 @@ IMPL_LINK_INLINE_END( ScColOrRowDlg, OkHdl, OKButton *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 2acd7003556a..49fbe93e017f 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ const sal_uLong nEntryDataDelim = 2;
/*************************************************************************
-#* Member: ScColRowNameRangesDlg Datum:04.09.97
+#* Member: ScColRowNameRangesDlg
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -86,7 +87,7 @@ ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB,
ScViewData* ptrViewData )
: ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_COLROWNAMERANGES ),
- //
+
aFlAssign ( this, ScResId( FL_ASSIGN ) ),
aLbRange ( this, ScResId( LB_RANGE ) ),
@@ -108,7 +109,7 @@ ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB,
pDoc ( ptrViewData->GetDocument() ),
pEdActive ( NULL ),
- bDlgLostFocus ( sal_False )
+ bDlgLostFocus ( false )
{
xColNameRanges = pDoc->GetColNameRanges()->Clone();
xRowNameRanges = pDoc->GetRowNameRanges()->Clone();
@@ -121,7 +122,7 @@ ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB,
/*************************************************************************
-#* Member: ~ScColRowNameRangesDlg Datum:04.09.97
+#* Member: ~ScColRowNameRangesDlg
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -134,13 +135,13 @@ ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB,
#*
#************************************************************************/
-__EXPORT ScColRowNameRangesDlg::~ScColRowNameRangesDlg()
+ScColRowNameRangesDlg::~ScColRowNameRangesDlg()
{
}
/*************************************************************************
-#* Member: Init Datum:04.09.97
+#* Member: Init
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -157,13 +158,6 @@ __EXPORT ScColRowNameRangesDlg::~ScColRowNameRangesDlg()
void ScColRowNameRangesDlg::Init()
{
- SCCOL nStartCol = 0;
- SCROW nStartRow = 0;
- SCTAB nStartTab = 0;
- SCCOL nEndCol = 0;
- SCROW nEndRow = 0;
- SCTAB nEndTab = 0;
-
aBtnOk.SetClickHdl ( LINK( this, ScColRowNameRangesDlg, OkBtnHdl ) );
aBtnCancel.SetClickHdl ( LINK( this, ScColRowNameRangesDlg, CancelBtnHdl ) );
aBtnAdd.SetClickHdl ( LINK( this, ScColRowNameRangesDlg, AddBtnHdl ) );
@@ -192,6 +186,12 @@ void ScColRowNameRangesDlg::Init()
if ( pViewData && pDoc )
{
+ SCCOL nStartCol = 0;
+ SCROW nStartRow = 0;
+ SCTAB nStartTab = 0;
+ SCCOL nEndCol = 0;
+ SCROW nEndRow = 0;
+ SCTAB nEndTab = 0;
pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab );
SetColRowData( ScRange( ScAddress( nStartCol, nStartRow, nStartTab ),
@@ -200,7 +200,7 @@ void ScColRowNameRangesDlg::Init()
else
{
aBtnColHead.Check( sal_True );
- aBtnRowHead.Check( sal_False );
+ aBtnRowHead.Check( false );
aEdAssign.SetText( EMPTY_STRING );
aEdAssign2.SetText( EMPTY_STRING );
}
@@ -211,15 +211,13 @@ void ScColRowNameRangesDlg::Init()
aEdAssign.Enable();
aEdAssign.GrabFocus();
aRbAssign.Enable();
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Enable(); // Ref-Feld hat Focus
Range1SelectHdl( 0 );
}
/*************************************************************************
-#* Member: SetColRowData Datum:04.09.97
+#* Member: SetColRowData
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -245,11 +243,11 @@ void ScColRowNameRangesDlg::SetColRowData( const ScRange& rLabelRange,sal_Bool b
if ( (static_cast<SCCOLROW>(nCol2 - nCol1) >= nRow2 - nRow1) || (nCol1 == 0 && nCol2 == MAXCOL) )
{ // Spaltenkoepfe und Grenzfall gesamte Tabelle
aBtnColHead.Check( sal_True );
- aBtnRowHead.Check( sal_False );
+ aBtnRowHead.Check( false );
if ( nRow2 == MAXROW )
{
if ( nRow1 == 0 )
- bValid = sal_False; // Grenzfall gesamte Tabelle
+ bValid = false; // Grenzfall gesamte Tabelle
else
{ // Head unten, Data oben
theCurData.aStart.SetRow( 0 );
@@ -265,7 +263,7 @@ void ScColRowNameRangesDlg::SetColRowData( const ScRange& rLabelRange,sal_Bool b
else
{ // Zeilenkoepfe
aBtnRowHead.Check( sal_True );
- aBtnColHead.Check( sal_False );
+ aBtnColHead.Check( false );
if ( nCol2 == MAXCOL )
{ // Head rechts, Data links
theCurData.aStart.SetCol( 0 );
@@ -320,7 +318,7 @@ void ScColRowNameRangesDlg::SetColRowData( const ScRange& rLabelRange,sal_Bool b
/*************************************************************************
-#* Member: AdjustColRowData Datum:04.09.97
+#* Member: AdjustColRowData
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -396,7 +394,7 @@ void ScColRowNameRangesDlg::AdjustColRowData( const ScRange& rDataRange,sal_Bool
/*************************************************************************
-#* Member: SetReference Datum:04.09.97
+#* Member: SetReference
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -433,7 +431,7 @@ void ScColRowNameRangesDlg::SetReference( const ScRange& rRef, ScDocument* /* pD
/*************************************************************************
-#* Member: Close Datum:04.09.97
+#* Member: Close
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -446,14 +444,14 @@ void ScColRowNameRangesDlg::SetReference( const ScRange& rRef, ScDocument* /* pD
#*
#************************************************************************/
-sal_Bool __EXPORT ScColRowNameRangesDlg::Close()
+sal_Bool ScColRowNameRangesDlg::Close()
{
return DoClose( ScColRowNameRangesDlgWrapper::GetChildWindowId() );
}
/*************************************************************************
-#* Member: SetActive Datum:04.09.97
+#* Member: SetActive
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -470,7 +468,7 @@ void ScColRowNameRangesDlg::SetActive()
{
if ( bDlgLostFocus )
{
- bDlgLostFocus = sal_False;
+ bDlgLostFocus = false;
if( pEdActive )
pEdActive->GrabFocus();
}
@@ -487,7 +485,7 @@ void ScColRowNameRangesDlg::SetActive()
/*************************************************************************
-#* Member: UpdateNames Datum:04.09.97
+#* Member: UpdateNames
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -502,16 +500,16 @@ void ScColRowNameRangesDlg::SetActive()
void ScColRowNameRangesDlg::UpdateNames()
{
- aLbRange.SetUpdateMode( sal_False );
+ aLbRange.SetUpdateMode( false );
//-----------------------------------------------------------
aLbRange.Clear();
aRangeMap.clear();
aEdAssign.SetText( EMPTY_STRING );
- sal_uLong nCount, j;
+ size_t nCount, j;
sal_uInt16 nPos; //@008 Hilfsvariable q eingefuegt
- SCCOL nCol1; //@008 04.09.97
+ SCCOL nCol1;
SCROW nRow1; //Erweiterung fuer Bereichsnamen
SCTAB nTab1;
SCCOL nCol2;
@@ -528,7 +526,7 @@ void ScColRowNameRangesDlg::UpdateNames()
aString += strDelim;
nPos = aLbRange.InsertEntry( aString );
aLbRange.SetEntryData( nPos, (void*)nEntryDataDelim );
- if ( (nCount = xColNameRanges->Count()) > 0 )
+ if ( (nCount = xColNameRanges->size()) > 0 )
{
ScRangePair** ppSortArray = xColNameRanges->CreateNameSortedArray(
nCount, pDoc );
@@ -575,7 +573,7 @@ void ScColRowNameRangesDlg::UpdateNames()
aString += strDelim;
nPos = aLbRange.InsertEntry( aString );
aLbRange.SetEntryData( nPos, (void*)nEntryDataDelim );
- if ( (nCount = xRowNameRanges->Count()) > 0 )
+ if ( (nCount = xRowNameRanges->size()) > 0 )
{
ScRangePair** ppSortArray = xRowNameRanges->CreateNameSortedArray(
nCount, pDoc );
@@ -622,7 +620,7 @@ void ScColRowNameRangesDlg::UpdateNames()
/*************************************************************************
-#* Member: UpdateRangeData Datum:04.09.97
+#* Member: UpdateRangeData
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -639,7 +637,7 @@ void ScColRowNameRangesDlg::UpdateNames()
void ScColRowNameRangesDlg::UpdateRangeData( const ScRange& rRange, sal_Bool bColName )
{
ScRangePair* pPair = NULL;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if ( bColName && (pPair = xColNameRanges->Find( rRange )) != NULL )
bFound = sal_True;
else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != NULL )
@@ -673,7 +671,7 @@ void ScColRowNameRangesDlg::UpdateRangeData( const ScRange& rRange, sal_Bool bCo
/*************************************************************************
-#* Member: IsRefInputMode Datum:04.09.97
+#* Member: IsRefInputMode
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -697,7 +695,7 @@ sal_Bool ScColRowNameRangesDlg::IsRefInputMode() const
// ========
/*************************************************************************
-#* Handler: OkBtnHdl Datum:04.09.97
+#* Handler: OkBtnHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -731,7 +729,7 @@ IMPL_LINK( ScColRowNameRangesDlg, OkBtnHdl, void *, EMPTYARG )
/*************************************************************************
-#* Handler: CancelBtnHdl Datum:04.09.97
+#* Handler: CancelBtnHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -753,7 +751,7 @@ IMPL_LINK_INLINE_END( ScColRowNameRangesDlg, CancelBtnHdl, void *, EMPTYARG )
/*************************************************************************
-#* Handler: AddBtnHdl Datum:04.09.97
+#* Handler: AddBtnHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -778,7 +776,7 @@ IMPL_LINK( ScColRowNameRangesDlg, AddBtnHdl, void *, EMPTYARG )
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
ScRange aRange1, aRange2;
sal_Bool bOk1;
- if ( (bOk1 = ((aRange1.ParseAny( aNewArea, pDoc, eConv ) & SCA_VALID) == SCA_VALID)) != sal_False
+ if ( (bOk1 = ((aRange1.ParseAny( aNewArea, pDoc, eConv ) & SCA_VALID) == SCA_VALID)) != false
&& ((aRange2.ParseAny( aNewData, pDoc, eConv ) & SCA_VALID) == SCA_VALID) )
{
theCurArea = aRange1;
@@ -806,7 +804,7 @@ IMPL_LINK( ScColRowNameRangesDlg, AddBtnHdl, void *, EMPTYARG )
aBtnRemove.Disable();
aEdAssign.SetText( EMPTY_STRING );
aBtnColHead.Check( sal_True );
- aBtnRowHead.Check( sal_False );
+ aBtnRowHead.Check( false );
aEdAssign2.SetText( EMPTY_STRING );
theCurArea = ScRange();
theCurData = theCurArea;
@@ -826,7 +824,7 @@ IMPL_LINK( ScColRowNameRangesDlg, AddBtnHdl, void *, EMPTYARG )
/*************************************************************************
-#* Handler: RemoveBtnHdl Datum:04.09.97
+#* Handler: RemoveBtnHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -852,7 +850,7 @@ IMPL_LINK( ScColRowNameRangesDlg, RemoveBtnHdl, void *, EMPTYARG )
const ScRange& rRange = itr->second;
ScRangePair* pPair = NULL;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if ( bColName && (pPair = xColNameRanges->Find( rRange )) != NULL )
bFound = sal_True;
else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != NULL )
@@ -893,7 +891,7 @@ IMPL_LINK( ScColRowNameRangesDlg, RemoveBtnHdl, void *, EMPTYARG )
aEdAssign.SetText( EMPTY_STRING );
theCurArea = theCurData = ScRange();
aBtnColHead.Check( sal_True );
- aBtnRowHead.Check( sal_False );
+ aBtnRowHead.Check( false );
aEdAssign2.SetText( EMPTY_STRING );
Range1SelectHdl( 0 );
}
@@ -903,7 +901,7 @@ IMPL_LINK( ScColRowNameRangesDlg, RemoveBtnHdl, void *, EMPTYARG )
/*************************************************************************
-#* Handler: Range1SelectHdl Datum:04.09.97
+#* Handler: Range1SelectHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -984,14 +982,12 @@ IMPL_LINK( ScColRowNameRangesDlg, Range1SelectHdl, void *, EMPTYARG )
aEdAssign.Enable();
aRbAssign.Enable();
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Enable();
return 0;
}
/*************************************************************************
-#* Handler: Range1DataModifyHdl Datum:04.09.97
+#* Handler: Range1DataModifyHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -1008,7 +1004,7 @@ IMPL_LINK( ScColRowNameRangesDlg, Range1SelectHdl, void *, EMPTYARG )
IMPL_LINK( ScColRowNameRangesDlg, Range1DataModifyHdl, void *, EMPTYARG )
{
String aNewArea( aEdAssign.GetText() );
- sal_Bool bValid = sal_False;
+ sal_Bool bValid = false;
if ( aNewArea.Len() > 0 )
{
ScRange aRange;
@@ -1040,7 +1036,7 @@ IMPL_LINK( ScColRowNameRangesDlg, Range1DataModifyHdl, void *, EMPTYARG )
/*************************************************************************
-#* Handler: Range2DataModifyHdl Datum:04.09.97
+#* Handler: Range2DataModifyHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -1077,7 +1073,7 @@ IMPL_LINK( ScColRowNameRangesDlg, Range2DataModifyHdl, void *, EMPTYARG )
/*************************************************************************
-#* Handler: ColClickHdl Datum:04.09.97
+#* Handler: ColClickHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -1097,7 +1093,7 @@ IMPL_LINK( ScColRowNameRangesDlg, ColClickHdl, void *, EMPTYARG )
if ( !aBtnColHead.GetSavedValue() )
{
aBtnColHead.Check( sal_True );
- aBtnRowHead.Check( sal_False );
+ aBtnRowHead.Check( false );
if ( theCurArea.aStart.Row() == 0 && theCurArea.aEnd.Row() == MAXROW )
{
theCurArea.aEnd.SetRow( MAXROW - 1 );
@@ -1115,7 +1111,7 @@ IMPL_LINK( ScColRowNameRangesDlg, ColClickHdl, void *, EMPTYARG )
/*************************************************************************
-#* Handler: RowClickHdl Datum:04.09.97
+#* Handler: RowClickHdl
#*------------------------------------------------------------------------
#*
#* Klasse: ScColRowNameRangesDlg
@@ -1135,7 +1131,7 @@ IMPL_LINK( ScColRowNameRangesDlg, RowClickHdl, void *, EMPTYARG )
if ( !aBtnRowHead.GetSavedValue() )
{
aBtnRowHead.Check( sal_True );
- aBtnColHead.Check( sal_False );
+ aBtnColHead.Check( false );
if ( theCurArea.aStart.Col() == 0 && theCurArea.aEnd.Col() == MAXCOL )
{
theCurArea.aEnd.SetCol( MAXCOL - 1 );
@@ -1173,3 +1169,5 @@ IMPL_LINK( ScColRowNameRangesDlg, LoseFocusHdl, Control*, EMPTYARG )
bDlgLostFocus = !IsActive();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
new file mode 100644
index 000000000000..10ef3a3b7dda
--- /dev/null
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -0,0 +1,416 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+#undef SC_DLLIMPLEMENTATION
+
+//------------------------------------------------------------------
+
+#include "datafdlg.hxx"
+#include "scresid.hxx"
+#include "datafdlg.hrc"
+#include "viewdata.hxx"
+#include "docsh.hxx"
+#include "refundo.hxx"
+#include "undodat.hxx"
+
+#include "rtl/ustrbuf.hxx"
+
+#define HDL(hdl) LINK( this, ScDataFormDlg, hdl )
+
+using ::rtl::OUStringBuffer;
+
+//zhangyun
+ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShellOri) :
+ ModalDialog ( pParent, ScResId( RID_SCDLG_DATAFORM ) ),
+ aBtnNew ( this, ScResId( BTN_DATAFORM_NEW ) ),
+ aBtnDelete ( this, ScResId( BTN_DATAFORM_DELETE ) ),
+ aBtnRestore ( this, ScResId( BTN_DATAFORM_RESTORE ) ),
+ aBtnLast ( this, ScResId( BTN_DATAFORM_LAST ) ),
+ aBtnNext ( this, ScResId( BTN_DATAFORM_NEXT ) ),
+ aBtnClose ( this, ScResId( BTN_DATAFORM_CLOSE ) ),
+ aSlider ( this, ScResId( WND_DATAFORM_SCROLLBAR ) ),
+ aFixedText ( this, ScResId( LAB_DATAFORM_RECORDNO ) )
+{
+ pTabViewShell = pTabViewShellOri;
+ FreeResource();
+ //read header form current document, and add new controls
+ DBG_ASSERT( pTabViewShell, "pTabViewShell is NULL! :-/" );
+ ScViewData* pViewData = pTabViewShell->GetViewData();
+
+ pDoc = pViewData->GetDocument();
+ if (pDoc)
+ {
+ ScRange aRange;
+ pViewData->GetSimpleArea( aRange );
+ ScAddress aStart = aRange.aStart;
+ ScAddress aEnd = aRange.aEnd;
+
+ nStartCol = aStart.Col();
+ nEndCol = aEnd.Col();
+ nStartRow = aStart.Row();
+ nEndRow = aEnd.Row();
+
+ nTab = pViewData->GetTabNo();
+ //if there is no selection
+ if ((nStartCol == nEndCol) && (nStartRow == nEndRow))
+ bNoSelection = true;
+
+ if (bNoSelection)
+ {
+ //find last not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_COLS;i++)
+ {
+ String aColName;
+ nEndCol++;
+ pDoc->GetString( nEndCol, nStartRow, nTab, aColName );
+ int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
+ if ( aColName.Len() == 0 && nColWidth)
+ {
+ nEndCol--;
+ break;
+ }
+ }
+
+ //find first not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_COLS;i++)
+ {
+ String aColName;
+ if (nStartCol <= 0)
+ break;
+ nStartCol--;
+
+ pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
+ int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
+ if ( aColName.Len() == 0 && nColWidth)
+ {
+ nStartCol++;
+ break;
+ }
+ }
+
+ //skip leading hide column
+ for (int i=1;i<=MAX_DATAFORM_COLS;i++)
+ {
+ String aColName;
+ int nColWidth = pDoc->GetColWidth( nStartCol, nTab );
+ if (nColWidth)
+ break;
+ nStartCol++;
+ }
+
+ if (nEndCol < nStartCol)
+ nEndCol = nStartCol;
+
+ //find last not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
+ {
+ String aColName;
+ nEndRow++;
+ pDoc->GetString( nStartCol, nEndRow, nTab, aColName );
+ if ( aColName.Len() == 0 )
+ {
+ nEndRow--;
+ break;
+ }
+ }
+
+ //find first not blank cell in row
+ for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
+ {
+ String aColName;
+ if (nStartRow <= 0)
+ break;
+ nStartRow--;
+
+ pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
+ if ( aColName.Len() == 0 )
+ {
+ nStartRow++;
+ break;
+ }
+ }
+
+ if (nEndRow < nStartRow)
+ nEndRow = nStartRow;
+ }
+
+ aCurrentRow = nStartRow + 1;
+
+ String aFieldName;
+
+ int nTop = 12;
+
+ Size nFixedSize(FIXED_WIDTH, CTRL_HEIGHT );
+ Size nEditSize(EDIT_WIDTH, CTRL_HEIGHT );
+
+ aColLength = nEndCol - nStartCol + 1;
+
+ //new the controls
+ pFixedTexts = new FixedText*[aColLength];
+ pEdits = new Edit*[aColLength];
+
+ for(sal_uInt16 nIndex = 0; nIndex < aColLength; nIndex++)
+ {
+ pDoc->GetString( nIndex + nStartCol, nStartRow, nTab, aFieldName );
+ int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab );
+ if (nColWidth)
+ {
+ pFixedTexts[nIndex] = new FixedText(this);
+ pEdits[nIndex] = new Edit(this, WB_BORDER);
+
+ pFixedTexts[nIndex]->SetSizePixel(nFixedSize);
+ pEdits[nIndex]->SetSizePixel(nEditSize);
+ pFixedTexts[nIndex]->SetPosPixel(Point(FIXED_LEFT, nTop));
+ pEdits[nIndex]->SetPosPixel(Point(EDIT_LEFT, nTop));
+ pFixedTexts[nIndex]->SetText(aFieldName);
+ pFixedTexts[nIndex]->Show();
+ pEdits[nIndex]->Show();
+
+ nTop += LINE_HEIGHT;
+ }
+ else
+ {
+ pFixedTexts[nIndex] = NULL;
+ pEdits[nIndex] = NULL;
+ }
+ pEdits[nIndex]->SetModifyHdl( HDL(Impl_DataModifyHdl) );
+ }
+
+ Size nDialogSize = this->GetSizePixel();
+ if (nTop > nDialogSize.Height())
+ {
+ nDialogSize.setHeight(nTop);
+ this->SetSizePixel(nDialogSize);
+ }
+ Size nScrollSize = aSlider.GetSizePixel();
+ nScrollSize.setHeight(nDialogSize.Height()-20);
+ aSlider.SetSizePixel(nScrollSize);
+ }
+
+ FillCtrls(aCurrentRow);
+
+ aSlider.SetPageSize( 10 );
+ aSlider.SetVisibleSize( 1 );
+ aSlider.SetLineSize( 1 );
+ aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) );
+ aSlider.Show();
+
+ aBtnNew.SetClickHdl ( HDL(Impl_NewHdl) );
+ aBtnLast.SetClickHdl ( HDL(Impl_LastHdl) );
+ aBtnNext.SetClickHdl ( HDL(Impl_NextHdl) );
+
+ aBtnRestore.SetClickHdl ( HDL(Impl_RestoreHdl) );
+ aBtnDelete.SetClickHdl ( HDL(Impl_DeleteHdl) );
+ aBtnClose.SetClickHdl ( HDL(Impl_CloseHdl) );
+
+ aSlider.SetEndScrollHdl( HDL( Impl_ScrollHdl ) );
+
+ SetButtonState();
+}
+
+ScDataFormDlg::~ScDataFormDlg()
+{
+ for(sal_uInt16 i = 0; i < aColLength; i++)
+ {
+ if (pEdits[i])
+ delete pEdits[i];
+ if (pFixedTexts[i])
+ delete pFixedTexts[i];
+ }
+ if (pEdits)
+ delete pEdits;
+ if (pFixedTexts)
+ delete pFixedTexts;
+}
+
+void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
+{
+ String aFieldName;
+ for (sal_uInt16 i = 0; i < aColLength; ++i)
+ {
+ if (pEdits[i])
+ {
+ if (aCurrentRow<=nEndRow)
+ {
+ pDoc->GetString( i + nStartCol, aCurrentRow, nTab, aFieldName );
+ pEdits[i]->SetText(aFieldName);
+ }
+ else
+ pEdits[i]->SetText(String());
+ }
+ }
+
+ if (aCurrentRow <= nEndRow)
+ {
+ OUStringBuffer aBuf;
+ aBuf.append(static_cast<sal_Int32>(aCurrentRow - nStartRow));
+ aBuf.appendAscii(" / ");
+ aBuf.append(static_cast<sal_Int32>(nEndRow - nStartRow));
+ aFixedText.SetText(aBuf.makeStringAndClear());
+ }
+ else
+ aFixedText.SetText(String(ScResId(STR_NEW_RECORD)));
+
+ aSlider.SetThumbPos(aCurrentRow-nStartRow-1);
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit)
+{
+ if ( pEdit->IsModified() )
+ aBtnRestore.Enable( true );
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG )
+{
+ ScViewData* pViewData = pTabViewShell->GetViewData();
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ if ( pDoc )
+ {
+ sal_Bool bHasData = false;
+ for(sal_uInt16 i = 0; i < aColLength; i++)
+ if (pEdits[i])
+ if ( pEdits[i]->GetText().Len() != 0 )
+ {
+ bHasData = sal_True;
+ break;
+ }
+
+ if ( bHasData )
+ {
+ pTabViewShell->DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , pEdits , aColLength );
+ aCurrentRow++;
+ if (aCurrentRow >= nEndRow + 2)
+ {
+ nEndRow ++ ;
+ aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) );
+ }
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ pDocSh->SetDocumentModified();
+ pDocSh->PostPaintGridAll();
+ }
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_LastHdl, PushButton*, EMPTYARG )
+{
+ if (pDoc)
+ {
+ if ( aCurrentRow > nStartRow +1 )
+ aCurrentRow--;
+
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_NextHdl, PushButton*, EMPTYARG )
+{
+ if (pDoc)
+ {
+ if ( aCurrentRow <= nEndRow)
+ aCurrentRow++;
+
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_RestoreHdl, PushButton*, EMPTYARG )
+{
+ if (pDoc)
+ {
+ FillCtrls(aCurrentRow);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_DeleteHdl, PushButton*, EMPTYARG )
+{
+ ScViewData* pViewData = pTabViewShell->GetViewData();
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ if (pDoc)
+ {
+ ScRange aRange(nStartCol, aCurrentRow, nTab, nEndCol, aCurrentRow, nTab);
+ pDoc->DeleteRow(aRange);
+ nEndRow--;
+
+ SetButtonState();
+ pDocSh->GetUndoManager()->Clear();
+
+ FillCtrls(aCurrentRow);
+ pDocSh->SetDocumentModified();
+ pDocSh->PostPaintGridAll();
+ }
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_CloseHdl, PushButton*, EMPTYARG )
+{
+ EndDialog( );
+ return 0;
+}
+
+IMPL_LINK( ScDataFormDlg, Impl_ScrollHdl, ScrollBar*, EMPTYARG )
+{
+ long nOffset = aSlider.GetThumbPos();
+ aCurrentRow = nStartRow + nOffset + 1;
+ SetButtonState();
+ FillCtrls(aCurrentRow);
+ return 0;
+}
+
+void ScDataFormDlg::SetButtonState()
+{
+ if ( aCurrentRow > nEndRow )
+ {
+ aBtnDelete.Enable( false );
+ aBtnLast.Enable( true );
+ aBtnNext.Enable( false );
+ }
+ else
+ {
+ aBtnDelete.Enable( true );
+ aBtnNext.Enable( true );
+ }
+ if ( 1 == aCurrentRow )
+ aBtnLast.Enable( false );
+
+ aBtnRestore.Enable( false );
+ if ( pEdits )
+ pEdits[0]->GrabFocus();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/delcldlg.cxx b/sc/source/ui/miscdlgs/delcldlg.cxx
index 24e63f77dac3..a036dbf22a16 100644
--- a/sc/source/ui/miscdlgs/delcldlg.cxx
+++ b/sc/source/ui/miscdlgs/delcldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,9 +113,10 @@ DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
return nReturn;
}
-__EXPORT ScDeleteCellDlg::~ScDeleteCellDlg()
+ScDeleteCellDlg::~ScDeleteCellDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx
index 5f59ecae260d..d824067e24ba 100644
--- a/sc/source/ui/miscdlgs/delcodlg.cxx
+++ b/sc/source/ui/miscdlgs/delcodlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@
//==================================================================
-sal_Bool ScDeleteContentsDlg::bPreviousAllCheck = sal_False;
+sal_Bool ScDeleteContentsDlg::bPreviousAllCheck = false;
sal_uInt16 ScDeleteContentsDlg::nPreviousChecks = (IDF_DATETIME | IDF_STRING |
IDF_NOTE | IDF_FORMULA |
IDF_VALUE);
@@ -64,12 +65,12 @@ ScDeleteContentsDlg::ScDeleteContentsDlg( Window* pParent,
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
- bObjectsDisabled( sal_False )
+ bObjectsDisabled( false )
{
if ( nCheckDefaults != 0 )
{
ScDeleteContentsDlg::nPreviousChecks = nCheckDefaults;
- ScDeleteContentsDlg::bPreviousAllCheck = sal_False;
+ ScDeleteContentsDlg::bPreviousAllCheck = false;
}
aBtnDelAll.Check ( ScDeleteContentsDlg::bPreviousAllCheck );
@@ -158,7 +159,7 @@ void ScDeleteContentsDlg::DisableChecks( sal_Bool bDelAllChecked )
void ScDeleteContentsDlg::DisableObjects()
{
bObjectsDisabled = sal_True;
- aBtnDelObjects.Check(sal_False);
+ aBtnDelObjects.Check(false);
aBtnDelObjects.Disable();
}
@@ -172,9 +173,10 @@ IMPL_LINK_INLINE_START( ScDeleteContentsDlg, DelAllHdl, void *, EMPTYARG )
}
IMPL_LINK_INLINE_END( ScDeleteContentsDlg, DelAllHdl, void *, EMPTYARG )
-__EXPORT ScDeleteContentsDlg::~ScDeleteContentsDlg()
+ScDeleteContentsDlg::~ScDeleteContentsDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 042dbc175f07..67b297c2a180 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111,7 +112,7 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent,
//----------------------------------------------------------------------------
-__EXPORT ScFillSeriesDlg::~ScFillSeriesDlg()
+ScFillSeriesDlg::~ScFillSeriesDlg()
{
}
@@ -223,7 +224,7 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt );
aEdEndVal.SetText( aEndTxt );
- bStartValFlag=sal_False;
+ bStartValFlag=false;
aFlSep1.SetStyle( aFlSep1.GetStyle() | WB_VERT );
aFlSep2.SetStyle( aFlSep2.GetStyle() | WB_VERT );
@@ -232,10 +233,9 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScFillSeriesDlg::CheckStartVal()
+sal_Bool ScFillSeriesDlg::CheckStartVal()
{
- sal_Bool bValOk = sal_False;
- sal_uInt32 nKey = 0;
+ sal_Bool bValOk = false;
String aStr( aEdStartVal.GetText() );
if ( aStr.Len() == 0 || aBtnAutoFill.IsChecked())
@@ -244,15 +244,17 @@ sal_Bool __EXPORT ScFillSeriesDlg::CheckStartVal()
bValOk = sal_True;
}
else
+ {
+ sal_uInt32 nKey = 0;
bValOk = rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fStartVal );
-
+ }
return bValOk;
}
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScFillSeriesDlg::CheckIncrementVal()
+sal_Bool ScFillSeriesDlg::CheckIncrementVal()
{
sal_uInt32 nKey = 0;
String aStr( aEdIncrement.GetText() );
@@ -263,10 +265,9 @@ sal_Bool __EXPORT ScFillSeriesDlg::CheckIncrementVal()
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScFillSeriesDlg::CheckEndVal()
+sal_Bool ScFillSeriesDlg::CheckEndVal()
{
- sal_Bool bValOk = sal_False;
- sal_uInt32 nKey = 0;
+ sal_Bool bValOk = false;
String aStr( aEdEndVal.GetText() );
if ( aStr.Len() == 0 )
@@ -275,8 +276,10 @@ sal_Bool __EXPORT ScFillSeriesDlg::CheckEndVal()
bValOk = sal_True;
}
else
+ {
+ sal_uInt32 nKey = 0;
bValOk = rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fEndVal );
-
+ }
return bValOk;
}
@@ -345,17 +348,17 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
Edit* pEdWrong = NULL;
if ( !CheckStartVal() )
{
- bAllOk = sal_False;
+ bAllOk = false;
pEdWrong = &aEdStartVal;
}
else if ( !CheckIncrementVal() )
{
- bAllOk = sal_False;
+ bAllOk = false;
pEdWrong = &aEdIncrement;
}
else if ( !CheckEndVal() )
{
- bAllOk = sal_False;
+ bAllOk = false;
pEdWrong = &aEdEndVal;
}
if ( bAllOk )
@@ -375,3 +378,4 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/groupdlg.cxx b/sc/source/ui/miscdlgs/groupdlg.cxx
index d0bef5e4f4c7..eeda6abd96d9 100644
--- a/sc/source/ui/miscdlgs/groupdlg.cxx
+++ b/sc/source/ui/miscdlgs/groupdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,9 +76,10 @@ sal_Bool ScGroupDlg::GetColsChecked() const
//------------------------------------------------------------------------
-__EXPORT ScGroupDlg::~ScGroupDlg()
+ScGroupDlg::~ScGroupDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx
index 0b0a4de9f985..5df31766517f 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,10 +103,9 @@ ScHighlightChgDlg::ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Wind
aOkButton.SetClickHdl(LINK( this, ScHighlightChgDlg, OKBtnHdl));
aHighlightBox.SetClickHdl(LINK( this, ScHighlightChgDlg, HighLightHandle ));
aFilterCtr.SetRefHdl(LINK( this, ScHighlightChgDlg, RefHandle ));
- aFilterCtr.HideRange(sal_False);
+ aFilterCtr.HideRange(false);
aFilterCtr.Show();
- SetDispatcherLock( sal_True );
- //SFX_APPWINDOW->Disable(sal_False);
+ SetDispatcherLock( true );
Init();
@@ -113,11 +113,10 @@ ScHighlightChgDlg::ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Wind
ScHighlightChgDlg::~ScHighlightChgDlg()
{
- SetDispatcherLock( sal_False );
- //SFX_APPWINDOW->Enable();
+ SetDispatcherLock( false );
}
-void __EXPORT ScHighlightChgDlg::Init()
+void ScHighlightChgDlg::Init()
{
String aAreaStr;
ScRange aRange;
@@ -164,12 +163,11 @@ void __EXPORT ScHighlightChgDlg::Init()
}
aFilterCtr.CheckRange(aChangeViewSet.HasRange());
- ScRange* pRangeEntry=aChangeViewSet.GetTheRangeList().GetObject(0);
-
- if(pRangeEntry!=NULL)
+ if ( !aChangeViewSet.GetTheRangeList().empty() )
{
String aRefStr;
+ const ScRange* pRangeEntry = aChangeViewSet.GetTheRangeList().front();
pRangeEntry->Format( aRefStr, ABS_DREF3D, pDoc );
aFilterCtr.SetRange(aRefStr);
}
@@ -195,7 +193,7 @@ void ScHighlightChgDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
}
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScHighlightChgDlg::Close()
+sal_Bool ScHighlightChgDlg::Close()
{
return DoClose( ScHighlightChgDlgWrapper::GetChildWindowId() );
}
@@ -214,17 +212,6 @@ void ScHighlightChgDlg::RefInputDone( sal_Bool bForced)
void ScHighlightChgDlg::SetActive()
{
- /*
- if(pTPFilter!=NULL)
- {
- aAcceptChgCtr.GetFilterPage()->SetFocusToRange();
- aEdAssign.Hide();
- aRbAssign.Hide();
- SFX_APPWINDOW->Enable();
- SetDispatcherLock( sal_False );
- }
- //RefInputDone();
- */
}
sal_Bool ScHighlightChgDlg::IsRefInputMode() const
@@ -256,8 +243,7 @@ IMPL_LINK( ScHighlightChgDlg, RefHandle, SvxTPFilter*, pRef )
{
if(pRef!=NULL)
{
- SetDispatcherLock( sal_True );
- //SFX_APPWINDOW->Disable(sal_False);
+ SetDispatcherLock( true );
aEdAssign.Show();
aRbAssign.Show();
aEdAssign.SetText(aFilterCtr.GetRange());
@@ -300,3 +286,4 @@ IMPL_LINK( ScHighlightChgDlg, OKBtnHdl, PushButton*, pOKBtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/highred.src b/sc/source/ui/miscdlgs/highred.src
index 3fa4a62fcd17..5c86c5863185 100644
--- a/sc/source/ui/miscdlgs/highred.src
+++ b/sc/source/ui/miscdlgs/highred.src
@@ -105,34 +105,3 @@ ModelessDialog RID_SCDLG_HIGHLIGHT_CHANGES
};
Text [ en-US ] = "Show Changes" ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/miscdlgs/inscldlg.cxx b/sc/source/ui/miscdlgs/inscldlg.cxx
index 2e9f8a1c09ce..237d9423990c 100644
--- a/sc/source/ui/miscdlgs/inscldlg.cxx
+++ b/sc/source/ui/miscdlgs/inscldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,9 +113,10 @@ InsCellCmd ScInsertCellDlg::GetInsCellCmd() const
return nReturn;
}
-__EXPORT ScInsertCellDlg::~ScInsertCellDlg()
+ScInsertCellDlg::~ScInsertCellDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index 263b1171b3f4..0e2546f5db2f 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,11 +86,11 @@ ScInsertContentsDlg::ScInsertContentsDlg( Window* pParent,
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
- bOtherDoc ( sal_False ),
- bFillMode ( sal_False ),
- bChangeTrack ( sal_False ),
- bMoveDownDisabled( sal_False ),
- bMoveRightDisabled( sal_False )
+ bOtherDoc ( false ),
+ bFillMode ( false ),
+ bChangeTrack ( false ),
+ bMoveDownDisabled( false ),
+ bMoveRightDisabled( false )
{
if ( pStrTitle )
SetText( *pStrTitle );
@@ -97,7 +98,7 @@ ScInsertContentsDlg::ScInsertContentsDlg( Window* pParent,
if ( nCheckDefaults != 0 )
{
ScInsertContentsDlg::nPreviousChecks = nCheckDefaults;
- ScInsertContentsDlg::bPreviousAllCheck = sal_False;
+ ScInsertContentsDlg::bPreviousAllCheck = false;
ScInsertContentsDlg::nPreviousChecks2 = 0;
}
@@ -332,7 +333,7 @@ IMPL_LINK( ScInsertContentsDlg, LinkBtnHdl, void*, EMPTYARG )
return 0;
}
-__EXPORT ScInsertContentsDlg::~ScInsertContentsDlg()
+ScInsertContentsDlg::~ScInsertContentsDlg()
{
ScInsertContentsDlg::nPreviousChecks2 = 0;
if(aBtnSkipEmptyCells.IsChecked())
@@ -370,3 +371,4 @@ sal_uInt16 ScInsertContentsDlg::GetFormulaCmdBits() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index be425ee51bec..3a3e0726705e 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,7 +106,7 @@ ScInsertTableDlg::ScInsertTableDlg( Window* pParent, ScViewData& rData, SCTAB nT
//------------------------------------------------------------------------
-__EXPORT ScInsertTableDlg::~ScInsertTableDlg()
+ScInsertTableDlg::~ScInsertTableDlg()
{
if (pDocShTables)
pDocShTables->DoClose();
@@ -170,7 +171,7 @@ void ScInsertTableDlg::Init_Impl( bool bFromFile )
#define ModalDialog Dialog
#endif /* ENABLE_LAYOUT */
-short __EXPORT ScInsertTableDlg::Execute()
+short ScInsertTableDlg::Execute()
{
// set Parent of DocumentInserter and Doc-Manager
Window* pOldDefParent = Application::GetDefDialogParent();
@@ -226,7 +227,7 @@ void ScInsertTableDlg::SetFromTo_Impl()
void ScInsertTableDlg::FillTables_Impl( ScDocument* pSrcDoc )
{
- aLbTables.SetUpdateMode( sal_False );
+ aLbTables.SetUpdateMode( false );
aLbTables.Clear();
if ( pSrcDoc )
@@ -432,3 +433,4 @@ IMPL_LINK( ScInsertTableDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/instbdlg.src b/sc/source/ui/miscdlgs/instbdlg.src
index 86b291547284..7c5b90731b05 100644
--- a/sc/source/ui/miscdlgs/instbdlg.src
+++ b/sc/source/ui/miscdlgs/instbdlg.src
@@ -32,7 +32,6 @@ ModalDialog RID_SCDLG_INSERT_TABLE
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 274 , 190 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Tabelle einfgen : Tabelle einfgen */
Text [ en-US ] = "Insert Sheet" ;
Moveable = TRUE ;
Closeable = TRUE ;
@@ -147,7 +146,6 @@ ModalDialog RID_SCDLG_INSERT_TABLE
HelpID = "sc:CheckBox:RID_SCDLG_INSERT_TABLE:CB_LINK";
Pos = MAP_APPFONT ( 149 , 131 ) ;
Size = MAP_APPFONT ( 60 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Ver~knpfen : Ver~knpfen */
Text [ en-US ] = "Lin~k" ;
};
FixedText FT_PATH
@@ -156,39 +154,3 @@ ModalDialog RID_SCDLG_INSERT_TABLE
Size = MAP_APPFONT ( 192 , 8 ) ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/miscdlgs/lbseldlg.cxx b/sc/source/ui/miscdlgs/lbseldlg.cxx
index 67ec1a647638..307e293384d6 100644
--- a/sc/source/ui/miscdlgs/lbseldlg.cxx
+++ b/sc/source/ui/miscdlgs/lbseldlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,13 +85,6 @@ String ScSelEntryDlg::GetSelectEntry() const
//------------------------------------------------------------------------
-//UNUSED2008-05 sal_uInt16 ScSelEntryDlg::GetSelectEntryPos() const
-//UNUSED2008-05 {
-//UNUSED2008-05 return aLb.GetSelectEntryPos();
-//UNUSED2008-05 }
-
-//------------------------------------------------------------------------
-
IMPL_LINK_INLINE_START( ScSelEntryDlg, DblClkHdl, void *, EMPTYARG )
{
EndDialog( RET_OK );
@@ -100,9 +94,10 @@ IMPL_LINK_INLINE_END( ScSelEntryDlg, DblClkHdl, void *, EMPTYARG )
//------------------------------------------------------------------------
-__EXPORT ScSelEntryDlg::~ScSelEntryDlg()
+ScSelEntryDlg::~ScSelEntryDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 3ba5b2952cf1..baff23726e72 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -133,9 +134,9 @@ IMPL_LINK( ScLinkedAreaDlg, FileHdl, ComboBox*, EMPTYARG )
String aFilter;
String aOptions;
- // get filter name by looking at the file content (bWithContent = sal_True)
- // Break operation if any error occured inside.
- if (!ScDocumentLoader::GetFilterName( aEntered, aFilter, aOptions, sal_True, sal_True ))
+ // get filter name by looking at the file content (bWithContent = TRUE)
+ // Break operation if any error occurred inside.
+ if (!ScDocumentLoader::GetFilterName( aEntered, aFilter, aOptions, true, true ))
return 0;
// #i53241# replace HTML filter with DataQuery filter
@@ -234,7 +235,7 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
{
WaitObject aWait( this );
- // #92296# replace HTML filter with DataQuery filter
+ // replace HTML filter with DataQuery filter
const String aHTMLFilterName( RTL_CONSTASCII_USTRINGPARAM( FILTERNAME_HTML ) );
const String aWebQFilterName( RTL_CONSTASCII_USTRINGPARAM( FILTERNAME_QUERY ) );
@@ -265,7 +266,6 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
if ( !pSourceShell->GetError() ) // only errors
{
- //aCbUrl.SetText( pSourceShell->GetTitle( SFX_TITLE_FULLNAME ) );
aCbUrl.SetText( pMed->GetName() );
}
else
@@ -288,7 +288,7 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
void ScLinkedAreaDlg::UpdateSourceRanges()
{
- aLbRanges.SetUpdateMode( sal_False );
+ aLbRanges.SetUpdateMode( false );
aLbRanges.Clear();
if ( pSourceShell )
@@ -367,3 +367,4 @@ sal_uLong ScLinkedAreaDlg::GetRefresh()
return 0; // disabled
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/makefile.mk b/sc/source/ui/miscdlgs/makefile.mk
index d34994341ade..403c98237f81 100644
--- a/sc/source/ui/miscdlgs/makefile.mk
+++ b/sc/source/ui/miscdlgs/makefile.mk
@@ -33,61 +33,52 @@ LIBTARGET=no
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
+ $(SLO)$/acredlin.obj \
+ $(SLO)$/anyrefdg.obj \
+ $(SLO)$/autofmt.obj \
+ $(SLO)$/conflictsdlg.obj \
+ $(SLO)$/crdlg.obj \
+ $(SLO)$/crnrdlg.obj \
+ $(SLO)$/datafdlg.obj \
$(SLO)$/delcldlg.obj \
- $(SLO)$/inscldlg.obj \
$(SLO)$/delcodlg.obj \
+ $(SLO)$/filldlg.obj \
+ $(SLO)$/groupdlg.obj \
+ $(SLO)$/highred.obj \
+ $(SLO)$/inscldlg.obj \
$(SLO)$/inscodlg.obj \
- $(SLO)$/strindlg.obj \
- $(SLO)$/tabbgcolordlg.obj \
- $(SLO)$/mtrindlg.obj \
+ $(SLO)$/instbdlg.obj \
$(SLO)$/lbseldlg.obj \
- $(SLO)$/filldlg.obj \
- $(SLO)$/autofmt.obj \
- $(SLO)$/solvrdlg.obj \
- $(SLO)$/optsolver.obj \
- $(SLO)$/solveroptions.obj \
- $(SLO)$/solverutil.obj \
+ $(SLO)$/linkarea.obj \
+ $(SLO)$/mtrindlg.obj \
$(SLO)$/mvtabdlg.obj \
- $(SLO)$/groupdlg.obj \
- $(SLO)$/tabopdlg.obj \
- $(SLO)$/crdlg.obj \
$(SLO)$/namecrea.obj \
$(SLO)$/namepast.obj \
- $(SLO)$/textdlgs.obj \
- $(SLO)$/anyrefdg.obj \
- $(SLO)$/crnrdlg.obj \
- $(SLO)$/shtabdlg.obj \
- $(SLO)$/instbdlg.obj \
- $(SLO)$/acredlin.obj \
- $(SLO)$/highred.obj \
- $(SLO)$/simpref.obj \
+ $(SLO)$/optsolver.obj \
+ $(SLO)$/protectiondlg.obj \
$(SLO)$/redcom.obj \
- $(SLO)$/linkarea.obj \
- $(SLO)$/warnbox.obj \
- $(SLO)$/scuiautofmt.obj \
- $(SLO)$/conflictsdlg.obj \
- $(SLO)$/sharedocdlg.obj \
- $(SLO)$/protectiondlg.obj \
- $(SLO)$/retypepassdlg.obj
-
-EXCEPTIONSFILES = \
- $(SLO)$/acredlin.obj \
- $(SLO)$/conflictsdlg.obj \
+ $(SLO)$/retypepassdlg.obj \
+ $(SLO)$/scuiautofmt.obj \
$(SLO)$/sharedocdlg.obj \
- $(SLO)$/optsolver.obj \
- $(SLO)$/solveroptions.obj \
- $(SLO)$/crnrdlg.obj \
- $(SLO)$/solverutil.obj \
- $(SLO)$/protectiondlg.obj \
- $(SLO)$/retypepassdlg.obj
+ $(SLO)$/shtabdlg.obj \
+ $(SLO)$/simpref.obj \
+ $(SLO)$/solveroptions.obj \
+ $(SLO)$/solverutil.obj \
+ $(SLO)$/solvrdlg.obj \
+ $(SLO)$/strindlg.obj \
+ $(SLO)$/tabbgcolordlg.obj \
+ $(SLO)$/tabopdlg.obj \
+ $(SLO)$/textdlgs.obj \
+ $(SLO)$/warnbox.obj
SRS1NAME=$(TARGET)
SRC1FILES = \
diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx
index c1227bc0c58f..d49e3c0a6b21 100644
--- a/sc/source/ui/miscdlgs/mtrindlg.cxx
+++ b/sc/source/ui/miscdlgs/mtrindlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@ ScMetricInputDlg::ScMetricInputDlg( Window* pParent,
//------------------------------------------------------------------------
-__EXPORT ScMetricInputDlg::~ScMetricInputDlg()
+ScMetricInputDlg::~ScMetricInputDlg()
{
}
@@ -128,7 +129,7 @@ void ScMetricInputDlg::CalcPositions()
Point aNewPos;
aFtSize.Width() = aFtEditTitle.GetTextWidth(aFtEditTitle.GetText());
- // #95990# add mnemonic char width to fixed text width
+ // add mnemonic char width to fixed text width
aFtSize.Width() += aFtEditTitle.GetTextWidth(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("(W)")));
aFtEditTitle.SetSizePixel( aFtSize );
@@ -184,3 +185,4 @@ IMPL_LINK_INLINE_END( ScMetricInputDlg, ModifyHdl, MetricField *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index a42af4893ba0..c2a4d2036c7f 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,22 +56,37 @@
//==================================================================
-ScMoveTableDlg::ScMoveTableDlg( Window* pParent )
+ScMoveTableDlg::ScMoveTableDlg( Window* pParent,
+ const String& rDefault )
: ModalDialog ( pParent, ScResId( RID_SCDLG_MOVETAB ) ),
//
+ aFlAction ( this, ScResId( FL_ACTION ) ),
+ aBtnMove ( this, ScResId( BTN_MOVE ) ),
+ aBtnCopy ( this, ScResId( BTN_COPY ) ),
+ aFlLocation ( this, ScResId( FL_LOCATION ) ),
aFtDoc ( this, ScResId( FT_DEST ) ),
aLbDoc ( this, ScResId( LB_DEST ) ),
aFtTable ( this, ScResId( FT_INSERT ) ),
aLbTable ( this, ScResId( LB_INSERT ) ),
- aBtnCopy ( this, ScResId( BTN_COPY ) ),
+ aFlName ( this, ScResId( FL_NAME ) ),
+ aFtTabName ( this, ScResId( FT_TABNAME ) ),
+ aEdTabName ( this, ScResId( ED_INPUT ) ),
+ aFtWarn ( this, ScResId( FT_TABNAME_WARN ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
+
+ maStrTabNameUsed( ScResId(STR_TABNAME_WARN_USED) ),
+ maStrTabNameEmpty( ScResId(STR_TABNAME_WARN_EMPTY) ),
+ maStrTabNameInvalid( ScResId(STR_TABNAME_WARN_INVALID) ),
//
+ mrDefaultName( rDefault ),
nDocument ( 0 ),
nTable ( 0 ),
- bCopyTable ( sal_False )
+ bCopyTable ( false ),
+ bRenameTable( false ),
+ mbEverEdited( false )
{
#if ENABLE_LAYOUT
#undef ScResId
@@ -82,7 +98,7 @@ ScMoveTableDlg::ScMoveTableDlg( Window* pParent )
//------------------------------------------------------------------------
-__EXPORT ScMoveTableDlg::~ScMoveTableDlg()
+ScMoveTableDlg::~ScMoveTableDlg()
{
}
@@ -92,12 +108,22 @@ sal_uInt16 ScMoveTableDlg::GetSelectedDocument () const { return nDocument; }
SCTAB ScMoveTableDlg::GetSelectedTable () const { return nTable; }
-sal_Bool ScMoveTableDlg::GetCopyTable () const { return bCopyTable; }
+bool ScMoveTableDlg::GetCopyTable () const { return bCopyTable; }
-void ScMoveTableDlg::SetCopyTable(sal_Bool bFlag)
+bool ScMoveTableDlg::GetRenameTable () const { return bRenameTable; }
+
+void ScMoveTableDlg::GetTabNameString( String& rString ) const
{
- aBtnCopy.Check(bFlag);
+ rString = aEdTabName.GetText();
}
+
+void ScMoveTableDlg::SetForceCopyTable()
+{
+ aBtnCopy.Check(true);
+ aBtnMove.Disable();
+ aBtnCopy.Disable();
+}
+
void ScMoveTableDlg::EnableCopyTable(sal_Bool bFlag)
{
if(bFlag)
@@ -106,14 +132,117 @@ void ScMoveTableDlg::EnableCopyTable(sal_Bool bFlag)
aBtnCopy.Disable();
}
+void ScMoveTableDlg::EnableRenameTable(sal_Bool bFlag)
+{
+ bRenameTable = bFlag;
+ aEdTabName.Enable(bFlag);
+ aFtTabName.Enable(bFlag);
+ ResetRenameInput();
+}
+
+void ScMoveTableDlg::ResetRenameInput()
+{
+ if (mbEverEdited)
+ // Don't reset the name when the sheet name has ever been edited.
+ return;
+
+ if (!aEdTabName.IsEnabled())
+ {
+ aEdTabName.SetText(String());
+ return;
+ }
+
+ bool bVal = aBtnCopy.IsChecked();
+ if (bVal)
+ {
+ // copy
+ ScDocument* pDoc = GetSelectedDoc();
+ if (pDoc)
+ {
+ String aStr = mrDefaultName;
+ pDoc->CreateValidTabName(aStr);
+ aEdTabName.SetText(aStr);
+ }
+ else
+ aEdTabName.SetText(mrDefaultName);
+ }
+ else
+ // move
+ aEdTabName.SetText(mrDefaultName);
+
+ CheckNewTabName();
+}
+
+void ScMoveTableDlg::CheckNewTabName()
+{
+ const String& rNewName = aEdTabName.GetText();
+ if (!rNewName.Len())
+ {
+ // New sheet name is empty. This is not good.
+ aFtWarn.SetText(maStrTabNameEmpty);
+ aFtWarn.Show();
+ aBtnOk.Disable();
+ return;
+ }
+
+ if (!ScDocument::ValidTabName(rNewName))
+ {
+ // New sheet name contains invalid characters.
+ aFtWarn.SetText(maStrTabNameInvalid);
+ aFtWarn.Show();
+ aBtnOk.Disable();
+ return;
+ }
+
+ bool bFound = false;
+ sal_uInt16 nLast = aLbTable.GetEntryCount() - 1;
+ for ( sal_uInt16 i=0; i<=nLast; ++i )
+ {
+ if ( rNewName == aLbTable.GetEntry( i ) )
+ {
+ if( ( aBtnMove.IsChecked() ) &&
+ ( aLbDoc.GetSelectEntryPos() == 0 ) &&
+ ( aEdTabName.GetText() == mrDefaultName) )
+
+ // Move inside same document, thus same name is allowed.
+ bFound = false;
+ else
+ bFound = true;
+ }
+ }
+
+ if ( bFound )
+ {
+ aFtWarn.SetText(maStrTabNameUsed);
+ aFtWarn.Show();
+ aBtnOk.Disable();
+ }
+ else
+ {
+ aFtWarn.Hide();
+ aBtnOk.Enable();
+ }
+}
+
+ScDocument* ScMoveTableDlg::GetSelectedDoc()
+{
+ sal_uInt16 nPos = aLbDoc.GetSelectEntryPos();
+ return static_cast<ScDocument*>(aLbDoc.GetEntryData(nPos));
+}
//------------------------------------------------------------------------
-void __EXPORT ScMoveTableDlg::Init()
+void ScMoveTableDlg::Init()
{
aBtnOk.SetClickHdl ( LINK( this, ScMoveTableDlg, OkHdl ) );
aLbDoc.SetSelectHdl ( LINK( this, ScMoveTableDlg, SelHdl ) );
- aBtnCopy.Check( sal_False );
+ aBtnCopy.SetToggleHdl( LINK( this, ScMoveTableDlg, CheckBtnHdl ) );
+ aEdTabName.SetModifyHdl( LINK( this, ScMoveTableDlg, CheckNameHdl ) );
+ aBtnMove.Check( true );
+ aBtnCopy.Check( false );
+ aEdTabName.Enable(false);
+ aFtWarn.SetControlBackground( Color( COL_YELLOW ) );
+ aFtWarn.Hide();
InitDocListBox();
SelHdl( &aLbDoc );
}
@@ -126,9 +255,10 @@ void ScMoveTableDlg::InitDocListBox()
ScDocShell* pScSh = NULL;
sal_uInt16 nSelPos = 0;
sal_uInt16 i = 0;
+ String aEntryName;
aLbDoc.Clear();
- aLbDoc.SetUpdateMode( sal_False );
+ aLbDoc.SetUpdateMode( false );
while ( pSh )
{
@@ -136,10 +266,16 @@ void ScMoveTableDlg::InitDocListBox()
if ( pScSh )
{
+ aEntryName = pScSh->GetTitle();
+
if ( pScSh == SfxObjectShell::Current() )
+ {
nSelPos = i;
+ aEntryName += sal_Unicode( ' ' );
+ aEntryName += String( ScResId( STR_CURRENTDOC ) );
+ }
- aLbDoc.InsertEntry( pScSh->GetTitle(), i );
+ aLbDoc.InsertEntry( aEntryName, i );
aLbDoc.SetEntryData( i, (void*)pScSh->GetDocument() );
i++;
@@ -152,10 +288,17 @@ void ScMoveTableDlg::InitDocListBox()
aLbDoc.SelectEntryPos( nSelPos );
}
-
//------------------------------------------------------------------------
// Handler:
+IMPL_LINK( ScMoveTableDlg, CheckBtnHdl, void *, pBtn )
+{
+ if (pBtn == &aBtnCopy)
+ ResetRenameInput();
+
+ return 0;
+}
+
IMPL_LINK( ScMoveTableDlg, OkHdl, void *, EMPTYARG )
{
sal_uInt16 nDocSel = aLbDoc.GetSelectEntryPos();
@@ -166,27 +309,43 @@ IMPL_LINK( ScMoveTableDlg, OkHdl, void *, EMPTYARG )
nDocument = (nDocSel != nDocLast) ? nDocSel : SC_DOC_NEW;
nTable = (nTabSel != nTabLast) ? static_cast<SCTAB>(nTabSel) : SC_TAB_APPEND;
bCopyTable = aBtnCopy.IsChecked();
+
+ if (bCopyTable)
+ {
+ // Return an empty string when the new name is the same as the
+ // automatic name assigned by the document.
+ String aCopyName = mrDefaultName;
+ ScDocument* pDoc = GetSelectedDoc();
+ if (pDoc)
+ pDoc->CreateValidTabName(aCopyName);
+ if (aCopyName == aEdTabName.GetText())
+ aEdTabName.SetText( String() );
+ }
+ else
+ {
+ // Return an empty string, when the new name is the same as the
+ // original name.
+ if( mrDefaultName == aEdTabName.GetText() )
+ aEdTabName.SetText( String() );
+ }
+
EndDialog( RET_OK );
return 0;
}
-//------------------------------------------------------------------------
-
IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb )
{
if ( pLb == &aLbDoc )
{
- ScDocument* pDoc = (ScDocument*)
- aLbDoc.GetEntryData( aLbDoc.GetSelectEntryPos() );
- SCTAB nLast = 0;
+ ScDocument* pDoc = GetSelectedDoc();
String aName;
aLbTable.Clear();
- aLbTable.SetUpdateMode( sal_False );
+ aLbTable.SetUpdateMode( false );
if ( pDoc )
{
- nLast = pDoc->GetTableCount()-1;
+ SCTAB nLast = pDoc->GetTableCount()-1;
for ( SCTAB i=0; i<=nLast; i++ )
{
pDoc->GetName( i, aName );
@@ -196,6 +355,18 @@ IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb )
aLbTable.InsertEntry( ScGlobal::GetRscString(STR_MOVE_TO_END) );
aLbTable.SetUpdateMode( sal_True );
aLbTable.SelectEntryPos( 0 );
+ ResetRenameInput();
+ }
+
+ return 0;
+}
+
+IMPL_LINK( ScMoveTableDlg, CheckNameHdl, Edit *, pEdt )
+{
+ if ( pEdt == &aEdTabName )
+ {
+ mbEverEdited = true;
+ CheckNewTabName();
}
return 0;
@@ -203,3 +374,4 @@ IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/namecrea.cxx b/sc/source/ui/miscdlgs/namecrea.cxx
index 402881d9b3af..ed7921c6f177 100644
--- a/sc/source/ui/miscdlgs/namecrea.cxx
+++ b/sc/source/ui/miscdlgs/namecrea.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,10 +53,10 @@ ScNameCreateDlg::ScNameCreateDlg( Window * pParent, sal_uInt16 nFlags )
aCancelButton ( this, ScResId( BTN_CANCEL ) ),
aHelpButton ( this, ScResId( BTN_HELP ) )
{
- aTopBox.Check ( (nFlags & NAME_TOP) ? sal_True : sal_False );
- aLeftBox.Check ( (nFlags & NAME_LEFT) ? sal_True : sal_False );
- aBottomBox.Check( (nFlags & NAME_BOTTOM)? sal_True : sal_False );
- aRightBox.Check ( (nFlags & NAME_RIGHT) ? sal_True : sal_False );
+ aTopBox.Check ( (nFlags & NAME_TOP) ? sal_True : false );
+ aLeftBox.Check ( (nFlags & NAME_LEFT) ? sal_True : false );
+ aBottomBox.Check( (nFlags & NAME_BOTTOM)? sal_True : false );
+ aRightBox.Check ( (nFlags & NAME_RIGHT) ? sal_True : false );
FreeResource();
}
@@ -77,3 +78,4 @@ sal_uInt16 ScNameCreateDlg::GetFlags() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/namepast.cxx b/sc/source/ui/miscdlgs/namepast.cxx
index e79bb9300f14..1f28fc4a9258 100644
--- a/sc/source/ui/miscdlgs/namepast.cxx
+++ b/sc/source/ui/miscdlgs/namepast.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,22 +60,11 @@ ScNamePasteDlg::ScNamePasteDlg( Window * pParent, const ScRangeName* pList, sal_
aNameList.SetSelectHdl( LINK( this,ScNamePasteDlg,ListSelHdl) );
aNameList.SetDoubleClickHdl( LINK( this,ScNamePasteDlg,ListDblClickHdl) );
- sal_uInt16 nCnt = pList->GetCount();
- String aText;
-
- for( sal_uInt16 i=0 ; i<nCnt ; i++ )
+ ScRangeName::const_iterator itr = pList->begin(), itrEnd = pList->end();
+ for (; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pList)[ i ];
-
- if( pData )
- {
- if ( !pData->HasType( RT_DATABASE )
- && !pData->HasType( RT_SHARED ) )
- {
- pData->GetName( aText );
- aNameList.InsertEntry( aText );
- }
- }
+ if (!itr->HasType(RT_DATABASE) && !itr->HasType(RT_SHARED))
+ aNameList.InsertEntry(itr->GetName());
}
ListSelHdl( &aNameList );
@@ -131,3 +121,4 @@ String ScNamePasteDlg::GetSelectedName() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index c158a7035691..39becaf0990c 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,7 +68,7 @@ ScSolverProgressDialog::ScSolverProgressDialog( Window* pParent )
maFlButtons ( this, ScResId( FL_BUTTONS ) ),
maBtnOk ( this, ScResId( BTN_OK ) )
{
- maBtnOk.Enable(sal_False);
+ maBtnOk.Enable(false);
FreeResource();
}
@@ -302,13 +303,11 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
aSlotURL += rtl::OUString::valueOf( sal_Int32( SID_DEL_ROWS ) );
uno::Reference<frame::XFrame> xFrame = GetBindings().GetActiveFrame();
- Image aDelNm = ::GetImage( xFrame, aSlotURL, sal_False, sal_False );
- Image aDelHC = ::GetImage( xFrame, aSlotURL, sal_False, sal_True ); // high contrast
+ Image aDelNm = ::GetImage( xFrame, aSlotURL, false );
for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow )
{
- mpDelButton[nRow]->SetModeImage( aDelNm, BMP_COLOR_NORMAL );
- mpDelButton[nRow]->SetModeImage( aDelHC, BMP_COLOR_HIGHCONTRAST );
+ mpDelButton[nRow]->SetModeImage( aDelNm );
}
maBtnOpt.SetClickHdl( LINK( this, ScOptSolverDlg, BtnHdl ) );
@@ -556,7 +555,7 @@ IMPL_LINK( ScOptSolverDlg, BtnHdl, PushButton*, pBtn )
{
bool bSolve = ( pBtn == &maBtnSolve );
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
bool bClose = true;
@@ -810,7 +809,7 @@ bool ScOptSolverDlg::FindTimeout( sal_Int32& rTimeout )
for (sal_Int32 nProp=0; nProp<nPropCount && !bFound; ++nProp)
{
const beans::PropertyValue& rValue = maProperties[nProp];
- if ( rValue.Name.equalsAscii( SC_UNONAME_TIMEOUT ) )
+ if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_TIMEOUT ) ) )
bFound = ( rValue.Value >>= rTimeout );
}
return bFound;
@@ -855,10 +854,10 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
}
uno::Sequence<table::CellAddress> aVariables;
sal_Int32 nVarPos = 0;
- sal_uLong nRangeCount = aVarRanges.Count();
- for (sal_uLong nRangePos=0; nRangePos<nRangeCount; ++nRangePos)
+
+ for ( size_t nRangePos=0, nRange = aVarRanges.size(); nRangePos < nRange; ++nRangePos )
{
- ScRange aRange(*aVarRanges.GetObject(nRangePos));
+ ScRange aRange(*aVarRanges[ nRangePos ] );
aRange.Justify();
SCTAB nTab = aRange.aStart.Tab();
@@ -1077,3 +1076,4 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
return bClose;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx
index 1205d393c3f8..90157f61f3ec 100644
--- a/sc/source/ui/miscdlgs/protectiondlg.cxx
+++ b/sc/source/ui/miscdlgs/protectiondlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include "scresid.hxx"
#include "tabprotection.hxx"
+#include <sal/macros.h>
#include <vcl/msgbox.hxx>
@@ -41,7 +43,7 @@ static const ScTableProtection::Option aOptions[] = {
ScTableProtection::SELECT_LOCKED_CELLS,
ScTableProtection::SELECT_UNLOCKED_CELLS,
};
-static const sal_uInt16 nOptionCount = sizeof(aOptions)/sizeof(aOptions[0]);
+static const sal_uInt16 nOptionCount = SAL_N_ELEMENTS(aOptions);
ScTableProtectionDlg::ScTableProtectionDlg(Window* pParent) :
@@ -60,8 +62,8 @@ ScTableProtectionDlg::ScTableProtectionDlg(Window* pParent) :
maBtnCancel (this, ScResId(BTN_CANCEL)),
maBtnHelp (this, ScResId(BTN_HELP)),
- maSelectLockedCells(ScResId(ST_SELECT_LOCKED_CELLS)),
- maSelectUnlockedCells(ScResId(ST_SELECT_UNLOCKED_CELLS))
+ maSelectLockedCells(ScResId(ST_SELECT_PROTECTED_CELLS)),
+ maSelectUnlockedCells(ScResId(ST_SELECT_UNPROTECTED_CELLS))
{
Init();
FreeResource();
@@ -159,3 +161,5 @@ IMPL_LINK( ScTableProtectionDlg, PasswordModifyHdl, Edit*, EMPTYARG )
maBtnOk.Enable(aPass1.Equals(aPass2));
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/protectiondlg.src b/sc/source/ui/miscdlgs/protectiondlg.src
index f46cb6700ded..aca43c6beeb3 100644
--- a/sc/source/ui/miscdlgs/protectiondlg.src
+++ b/sc/source/ui/miscdlgs/protectiondlg.src
@@ -58,7 +58,7 @@ ModalDialog RID_SCDLG_TABPROTECTION
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 150 , 10 );
- Text [ en-US ] = "P~rotect this sheet and the contents of locked cells" ;
+ Text [ en-US ] = "P~rotect this sheet and the contents of protected cells" ;
};
FixedText FT_PASSWORD1
@@ -119,13 +119,13 @@ ModalDialog RID_SCDLG_TABPROTECTION
TabStop = TRUE ;
};
- String ST_SELECT_LOCKED_CELLS
+ String ST_SELECT_PROTECTED_CELLS
{
- Text [ en-US ] = "Select locked cells";
+ Text [ en-US ] = "Select protected cells";
};
- String ST_SELECT_UNLOCKED_CELLS
+ String ST_SELECT_UNPROTECTED_CELLS
{
- Text [ en-US ] = "Select unlocked cells";
+ Text [ en-US ] = "Select unprotected cells";
};
};
diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx
index f5caffb8a0ab..1aaf202e7a3f 100644
--- a/sc/source/ui/miscdlgs/redcom.cxx
+++ b/sc/source/ui/miscdlgs/redcom.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,19 +36,18 @@
#include "redcom.hxx"
#include "docsh.hxx"
#include "tabvwsh.hxx"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
//------------------------------------------------------------------------
ScRedComDialog::ScRedComDialog( Window* pParent, const SfxItemSet& rCoreSet,
ScDocShell *pShell,ScChangeAction *pAction,sal_Bool bPrevNext)
{
- //CHINA001 pDlg = new SvxPostItDialog(pParent,rCoreSet,bPrevNext,sal_True);
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- pDlg = pFact->CreateSvxPostItDialog( pParent, rCoreSet, bPrevNext, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ pDlg = pFact->CreateSvxPostItDialog( pParent, rCoreSet, bPrevNext, true );
+ DBG_ASSERT(pDlg, "Dialog creation failed!");
pDocShell=pShell;
pDlg->DontChangeAuthor();
pDlg->HideAuthor();
@@ -125,7 +125,7 @@ void ScRedComDialog::ReInit(ScChangeAction *pAction)
DateTime aDT = pChangeAction->GetDateTime();
String aDate = ScGlobal::pLocaleData->getDate( aDT );
aDate += ' ';
- aDate += ScGlobal::pLocaleData->getTime( aDT, sal_False, sal_False );
+ aDate += ScGlobal::pLocaleData->getTime( aDT, false, false );
pDlg->ShowLastAuthor(aAuthor, aDate);
pDlg->SetNote(aComment);
@@ -184,3 +184,4 @@ IMPL_LINK(ScRedComDialog, NextHdl, AbstractSvxPostItDialog*, pDlgP )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index 24e5dc409c83..2a844c784888 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,7 +78,7 @@ ScRetypePassDlg::ScRetypePassDlg(Window* pParent) :
mpDocItem(static_cast<ScDocProtection*>(NULL)),
mnCurScrollPos(0),
- meDesiredHash(PASSHASH_OOO)
+ meDesiredHash(PASSHASH_SHA1)
{
Init();
}
@@ -542,3 +543,5 @@ IMPL_LINK( ScRetypePassInputDlg, PasswordModifyHdl, Edit*, EMPTYARG )
CheckPasswordInput();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.src b/sc/source/ui/miscdlgs/retypepassdlg.src
index daf563201587..0c9f11e46947 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.src
+++ b/sc/source/ui/miscdlgs/retypepassdlg.src
@@ -27,7 +27,6 @@
#include "retypepassdlg.hrc"
-
ModalDialog RID_SCDLG_RETYPEPASS
{
HelpID = "sc:ModalDialog:RID_SCDLG_RETYPEPASS";
@@ -321,5 +320,3 @@ ModalDialog RID_SCDLG_RETYPEPASS_INPUT
Text [ en-US ] = "Remove password from this protected item." ;
};
};
-
-
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index 0812be6c4360..9ed724c31063 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,8 +102,8 @@ ScAutoFormatDlg::ScAutoFormatDlg( Window* pParent,
pFormat ( pAutoFormat ),
pSelFmtData ( pSelFormatData ),
nIndex ( 0 ),
- bCoreDataChanged( sal_False ),
- bFmtInserted ( sal_False )
+ bCoreDataChanged( false ),
+ bFmtInserted ( false )
{
Init();
pWndPreview->NotifyChange( (*pFormat)[0] );
@@ -111,7 +112,7 @@ ScAutoFormatDlg::ScAutoFormatDlg( Window* pParent,
//------------------------------------------------------------------------
-__EXPORT ScAutoFormatDlg::~ScAutoFormatDlg()
+ScAutoFormatDlg::~ScAutoFormatDlg()
{
delete pWndPreview;
}
@@ -254,7 +255,7 @@ IMPL_LINK( ScAutoFormatDlg, AddHdl, void *, EMPTYARG )
String aStrStandard( SfxResId(STR_STANDARD) );
String aFormatName;
ScStringInputDlg* pDlg;
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
while ( !bOk )
{
@@ -358,7 +359,7 @@ IMPL_LINK( ScAutoFormatDlg, RemoveHdl, void *, EMPTYARG )
IMPL_LINK( ScAutoFormatDlg, RenameHdl, void *, EMPTYARG )
{
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
while( !bOk )
{
@@ -372,7 +373,7 @@ IMPL_LINK( ScAutoFormatDlg, RenameHdl, void *, EMPTYARG )
HID_SC_REN_AFMT_DLG, HID_SC_REN_AFMT_NAME );
if( pDlg->Execute() == RET_OK )
{
- sal_Bool bFmtRenamed = sal_False;
+ sal_Bool bFmtRenamed = false;
pDlg->GetInputString( aFormatName );
sal_uInt16 n;
@@ -402,7 +403,7 @@ IMPL_LINK( ScAutoFormatDlg, RenameHdl, void *, EMPTYARG )
sal_uInt16 nCount = pFormat->GetCount();
- aLbFormat.SetUpdateMode(sal_False);
+ aLbFormat.SetUpdateMode(false);
aLbFormat.Clear();
for ( sal_uInt16 i = 0; i < nCount; i++ )
{
@@ -466,7 +467,7 @@ IMPL_LINK( ScAutoFormatDlg, SelFmtHdl, void *, EMPTYARG )
//------------------------------------------------------------------------
-String __EXPORT ScAutoFormatDlg::GetCurrFormatName()
+String ScAutoFormatDlg::GetCurrFormatName()
{
String aResult;
@@ -474,3 +475,5 @@ String __EXPORT ScAutoFormatDlg::GetCurrFormatName()
return aResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 8730932c6f91..5b5492dccc8e 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -172,7 +173,7 @@ void ScShareDocumentDlg::UpdateView()
aString += '\t';
aString += ScGlobal::pLocaleData->getDate( aDateTime );
aString += ' ';
- aString += ScGlobal::pLocaleData->getTime( aDateTime, sal_False );
+ aString += ScGlobal::pLocaleData->getTime( aDateTime, false );
maLbUsers.InsertEntry( aString, NULL );
}
@@ -185,7 +186,7 @@ void ScShareDocumentDlg::UpdateView()
}
catch ( uno::Exception& )
{
- DBG_ERROR( "ScShareDocumentDlg::UpdateView(): caught exception\n" );
+ OSL_FAIL( "ScShareDocumentDlg::UpdateView(): caught exception\n" );
maLbUsers.Clear();
maLbUsers.InsertEntry( maStrNoUserData, NULL );
}
@@ -228,8 +229,10 @@ void ScShareDocumentDlg::UpdateView()
aString += ScGlobal::pLocaleData->getDate( aDateTime );
aString += ' ';
- aString += ScGlobal::pLocaleData->getTime( aDateTime, sal_False );
+ aString += ScGlobal::pLocaleData->getTime( aDateTime, false );
maLbUsers.InsertEntry( aString, NULL );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx
index cf0059a12ceb..7e5ab24eb412 100644
--- a/sc/source/ui/miscdlgs/shtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/shtabdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,9 +104,10 @@ IMPL_LINK_INLINE_START( ScShowTabDlg, DblClkHdl, void *, EMPTYARG )
}
IMPL_LINK_INLINE_END( ScShowTabDlg, DblClkHdl, void *, EMPTYARG )
-__EXPORT ScShowTabDlg::~ScShowTabDlg()
+ScShowTabDlg::~ScShowTabDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx
index 1157f42c9dd6..5d5a8ba468fd 100644
--- a/sc/source/ui/miscdlgs/simpref.cxx
+++ b/sc/source/ui/miscdlgs/simpref.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,11 +81,11 @@ ScSimpleRefDlg::ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
//
pViewData ( ptrViewData ),
pDoc ( ptrViewData->GetDocument() ),
- bRefInputMode ( sal_False ),
+ bRefInputMode ( false ),
bAutoReOpen ( sal_True ),
- bCloseOnButtonUp( sal_False ),
- bSingleCell ( sal_False ),
- bMultiSelection ( sal_False )
+ bCloseOnButtonUp( false ),
+ bSingleCell ( false ),
+ bMultiSelection ( false )
{
// damit die Strings in der Resource bei den FixedTexten bleiben koennen:
Init();
@@ -93,9 +94,9 @@ ScSimpleRefDlg::ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
}
//----------------------------------------------------------------------------
-__EXPORT ScSimpleRefDlg::~ScSimpleRefDlg()
+ScSimpleRefDlg::~ScSimpleRefDlg()
{
- SetDispatcherLock( sal_False ); // Modal-Modus einschalten
+ SetDispatcherLock( false ); // Modal-Modus einschalten
}
//----------------------------------------------------------------------------
@@ -116,7 +117,7 @@ void ScSimpleRefDlg::Init()
{
aBtnOk.SetClickHdl ( LINK( this, ScSimpleRefDlg, OkBtnHdl ) );
aBtnCancel.SetClickHdl ( LINK( this, ScSimpleRefDlg, CancelBtnHdl ) );
- bCloseFlag=sal_False;
+ bCloseFlag=false;
}
//----------------------------------------------------------------------------
@@ -159,7 +160,7 @@ void ScSimpleRefDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScSimpleRefDlg::Close()
+sal_Bool ScSimpleRefDlg::Close()
{
CancelBtnHdl(&aBtnCancel);
return sal_True;
@@ -230,7 +231,7 @@ void ScSimpleRefDlg::RefInputDone( sal_Bool bForced)
// ========
IMPL_LINK( ScSimpleRefDlg, OkBtnHdl, void *, EMPTYARG )
{
- bAutoReOpen=sal_False;
+ bAutoReOpen=false;
String aResult=aEdAssign.GetText();
aCloseHdl.Call(&aResult);
Link aUnoLink = aDoneHdl; // stack var because this is deleted in DoClose
@@ -242,7 +243,7 @@ IMPL_LINK( ScSimpleRefDlg, OkBtnHdl, void *, EMPTYARG )
//------------------------------------------------------------------------
IMPL_LINK( ScSimpleRefDlg, CancelBtnHdl, void *, EMPTYARG )
{
- bAutoReOpen=sal_False;
+ bAutoReOpen=false;
String aResult=aEdAssign.GetText();
aCloseHdl.Call(NULL);
Link aUnoLink = aAbortedHdl; // stack var because this is deleted in DoClose
@@ -255,3 +256,4 @@ IMPL_LINK( ScSimpleRefDlg, CancelBtnHdl, void *, EMPTYARG )
//------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 8bbc93df0009..9927d5060306 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -264,7 +265,7 @@ void ScSolverOptionsDialog::FillListBox()
// fill the list box
- maLbSettings.SetUpdateMode(sal_False);
+ maLbSettings.SetUpdateMode(false);
maLbSettings.Clear();
String sEmpty;
@@ -396,7 +397,7 @@ IMPL_LINK( ScSolverOptionsDialog, EngineSelectHdl, ListBox*, EMPTYARG )
IMPL_LINK( ScSolverOptionsDialog, SettingsSelHdl, SvxCheckListBox*, EMPTYARG )
{
- sal_Bool bCheckbox = sal_False;
+ sal_Bool bCheckbox = false;
SvLBoxEntry* pEntry = maLbSettings.GetCurEntry();
if (pEntry)
@@ -490,3 +491,4 @@ double ScSolverValueDialog::GetValue() const
return fValue;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx
index ae080f2525c7..9414fc04a94f 100644
--- a/sc/source/ui/miscdlgs/solverutil.cxx
+++ b/sc/source/ui/miscdlgs/solverutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,20 +83,18 @@ uno::Reference<sheet::XSolver> lcl_CreateSolver( const uno::Reference<uno::XInte
return xSolver;
}
-// static
void ScSolverUtil::GetImplementations( uno::Sequence<rtl::OUString>& rImplNames,
uno::Sequence<rtl::OUString>& rDescriptions )
{
rImplNames.realloc(0); // clear
rDescriptions.realloc(0);
- sal_Int32 nCount = 0;
uno::Reference<uno::XComponentContext> xCtx;
uno::Reference<lang::XMultiServiceFactory> xMSF = comphelper::getProcessServiceFactory();
uno::Reference<beans::XPropertySet> xPropset(xMSF, uno::UNO_QUERY);
try
{
- xPropset->getPropertyValue(rtl::OUString::createFromAscii("DefaultContext")) >>= xCtx;
+ xPropset->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xCtx;
}
catch ( uno::Exception & )
{
@@ -105,9 +104,10 @@ void ScSolverUtil::GetImplementations( uno::Sequence<rtl::OUString>& rImplNames,
if ( xCtx.is() && xEnAc.is() )
{
uno::Reference<container::XEnumeration> xEnum =
- xEnAc->createContentEnumeration( rtl::OUString::createFromAscii(SCSOLVER_SERVICE) );
+ xEnAc->createContentEnumeration( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SCSOLVER_SERVICE)) );
if ( xEnum.is() )
{
+ sal_Int32 nCount = 0;
while ( xEnum->hasMoreElements() )
{
uno::Any aAny = xEnum->nextElement();
@@ -141,7 +141,6 @@ void ScSolverUtil::GetImplementations( uno::Sequence<rtl::OUString>& rImplNames,
}
}
-// static
uno::Reference<sheet::XSolver> ScSolverUtil::GetSolver( const rtl::OUString& rImplName )
{
uno::Reference<sheet::XSolver> xSolver;
@@ -151,7 +150,7 @@ uno::Reference<sheet::XSolver> ScSolverUtil::GetSolver( const rtl::OUString& rIm
uno::Reference<beans::XPropertySet> xPropset(xMSF, uno::UNO_QUERY);
try
{
- xPropset->getPropertyValue(rtl::OUString::createFromAscii("DefaultContext")) >>= xCtx;
+ xPropset->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xCtx;
}
catch ( uno::Exception & )
{
@@ -161,7 +160,7 @@ uno::Reference<sheet::XSolver> ScSolverUtil::GetSolver( const rtl::OUString& rIm
if ( xCtx.is() && xEnAc.is() )
{
uno::Reference<container::XEnumeration> xEnum =
- xEnAc->createContentEnumeration( rtl::OUString::createFromAscii(SCSOLVER_SERVICE) );
+ xEnAc->createContentEnumeration( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SCSOLVER_SERVICE)) );
if ( xEnum.is() )
{
while ( xEnum->hasMoreElements() && !xSolver.is() )
@@ -187,7 +186,6 @@ uno::Reference<sheet::XSolver> ScSolverUtil::GetSolver( const rtl::OUString& rIm
return xSolver;
}
-// static
uno::Sequence<beans::PropertyValue> ScSolverUtil::GetDefaults( const rtl::OUString& rImplName )
{
uno::Sequence<beans::PropertyValue> aDefaults;
@@ -227,3 +225,4 @@ uno::Sequence<beans::PropertyValue> ScSolverUtil::GetDefaults( const rtl::OUStri
return aDefaults;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index e3e58b8f75ad..a03daeb49fee 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,7 +81,7 @@ ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
pDoc ( pDocument ),
nCurTab ( aCursorPos.Tab() ),
pEdActive ( NULL ),
- bDlgLostFocus ( sal_False ),
+ bDlgLostFocus ( false ),
errMsgInvalidVar ( ScResId( STR_INVALIDVAR ) ),
errMsgInvalidForm ( ScResId( STR_INVALIDFORM ) ),
errMsgNoFormula ( ScResId( STR_NOFORMULA ) ),
@@ -95,13 +96,13 @@ ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
//----------------------------------------------------------------------------
-__EXPORT ScSolverDlg::~ScSolverDlg()
+ScSolverDlg::~ScSolverDlg()
{
}
//----------------------------------------------------------------------------
-void __EXPORT ScSolverDlg::Init()
+void ScSolverDlg::Init()
{
String aStr;
@@ -130,7 +131,7 @@ void __EXPORT ScSolverDlg::Init()
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScSolverDlg::Close()
+sal_Bool ScSolverDlg::Close()
{
return DoClose( ScSolverDlgWrapper::GetChildWindowId() );
}
@@ -141,7 +142,7 @@ void ScSolverDlg::SetActive()
{
if ( bDlgLostFocus )
{
- bDlgLostFocus = sal_False;
+ bDlgLostFocus = false;
if( pEdActive )
pEdActive->GrabFocus();
}
@@ -214,7 +215,7 @@ sal_Bool ScSolverDlg::IsRefInputMode() const
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScSolverDlg::CheckTargetValue( String& rStrVal )
+sal_Bool ScSolverDlg::CheckTargetValue( String& rStrVal )
{
sal_uInt32 n1 = 0;
double n2;
@@ -259,7 +260,7 @@ IMPL_LINK( ScSolverDlg, BtnHdl, PushButton*, pBtn )
theTargetValStr );
ScSolveItem aOutItem( SCITEM_SOLVEDATA, &aOutParam );
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
GetBindings().GetDispatcher()->Execute( SID_SOLVE,
@@ -314,3 +315,4 @@ IMPL_LINK( ScSolverDlg, LoseFocusHdl, Control*, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/strindlg.cxx b/sc/source/ui/miscdlgs/strindlg.cxx
index db042d9b3a6d..c33f4b53b43b 100644
--- a/sc/source/ui/miscdlgs/strindlg.cxx
+++ b/sc/source/ui/miscdlgs/strindlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,9 +82,10 @@ void ScStringInputDlg::GetInputString( String& rString ) const
rString = aEdInput.GetText();
}
-__EXPORT ScStringInputDlg::~ScStringInputDlg()
+ScStringInputDlg::~ScStringInputDlg()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
index 2419b0d36f55..fec8ef51c2a5 100644
--- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: tabbgcolordlg.cxx,v $
- * $Revision: 1.0 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -100,8 +98,6 @@ void ScTabBgColorDlg::FillColorValueSets_Impl()
::boost::scoped_ptr<XColorTable> pOwnColorTable; // locally instantiated in case the doc shell doesn't have one.
const Size aSize15x15 = Size( 15, 15 );
- const Size aSize10x10 = Size( 10, 10 );
- const Size aSize5x5 = Size( 5, 5 );
sal_uInt16 nSelectedItem = 0;
DBG_ASSERT( pDocSh, "DocShell not found!" );
@@ -196,3 +192,5 @@ void ScTabBgColorDlg::ScTabBgColorValueSet::KeyInput( const KeyEvent& rKEvt )
}
ValueSet::KeyInput(rKEvt);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index 0c2d3ced899c..a42ddf505731 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,7 +77,7 @@ ScTabOpDlg::ScTabOpDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
pDoc ( pDocument ),
nCurTab ( theFormulaCell.Tab() ),
pEdActive ( NULL ),
- bDlgLostFocus ( sal_False ),
+ bDlgLostFocus ( false ),
errMsgNoFormula ( ScResId( STR_NOFORMULA ) ),
errMsgNoColRow ( ScResId( STR_NOCOLROW ) ),
errMsgWrongFormula ( ScResId( STR_WRONGFORMULA ) ),
@@ -90,14 +91,14 @@ ScTabOpDlg::ScTabOpDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
//----------------------------------------------------------------------------
-__EXPORT ScTabOpDlg::~ScTabOpDlg()
+ScTabOpDlg::~ScTabOpDlg()
{
Hide();
}
//----------------------------------------------------------------------------
-void __EXPORT ScTabOpDlg::Init()
+void ScTabOpDlg::Init()
{
aBtnOk. SetClickHdl ( LINK( this, ScTabOpDlg, BtnHdl ) );
aBtnCancel. SetClickHdl ( LINK( this, ScTabOpDlg, BtnHdl ) );
@@ -127,7 +128,7 @@ void __EXPORT ScTabOpDlg::Init()
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScTabOpDlg::Close()
+sal_Bool ScTabOpDlg::Close()
{
return DoClose( ScTabOpDlgWrapper::GetChildWindowId() );
}
@@ -138,7 +139,7 @@ void ScTabOpDlg::SetActive()
{
if ( bDlgLostFocus )
{
- bDlgLostFocus = sal_False;
+ bDlgLostFocus = false;
if( pEdActive )
pEdActive->GrabFocus();
}
@@ -239,7 +240,7 @@ void ScTabOpDlg::RaiseError( ScTabOpErr eError )
sal_Bool lcl_Parse( const String& rString, ScDocument* pDoc, SCTAB nCurTab,
ScRefAddress& rStart, ScRefAddress& rEnd )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
if ( rString.Search(':') != STRING_NOTFOUND )
bRet = ConvertDoubleRef( pDoc, rString, nCurTab, rStart, rEnd, eConv );
@@ -324,7 +325,7 @@ IMPL_LINK( ScTabOpDlg, BtnHdl, PushButton*, pBtn )
nMode );
ScTabOpItem aOutItem( SID_TABOP, &aOutParam );
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
GetBindings().GetDispatcher()->Execute( SID_TABOP,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
@@ -369,3 +370,4 @@ IMPL_LINK( ScTabOpDlg, LoseFocusHdl, Control*, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx
index 5d9994922957..4048bdaa8ff7 100644
--- a/sc/source/ui/miscdlgs/textdlgs.cxx
+++ b/sc/source/ui/miscdlgs/textdlgs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,19 +39,16 @@
#include <svx/svxids.hrc>
-//CHINA001 #include <svx/chardlg.hxx>
#include <editeng/flstitem.hxx>
-//CHINA001 #include <svx/paragrph.hxx>
-//CHINA001 #include <svx/tabstpge.hxx>
#include <sfx2/objsh.hxx>
#include <svl/cjkoptions.hxx>
#include "textdlgs.hxx"
#include "scresid.hxx"
#include "sc.hrc"
-#include <svx/svxids.hrc> //add CHINA001
-#include <svl/intitem.hxx> //add CHINA001
-#include <svx/flagsdef.hxx> //CHINA001
+#include <svx/svxids.hrc>
+#include <svl/intitem.hxx>
+#include <svx/flagsdef.hxx>
// -----------------------------------------------------------------------
ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr,
@@ -61,16 +59,16 @@ ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr,
{
FreeResource();
- AddTabPage( RID_SVXPAGE_CHAR_NAME ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, 0);
- AddTabPage( RID_SVXPAGE_CHAR_EFFECTS ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, 0);
- AddTabPage( RID_SVXPAGE_CHAR_POSITION ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_POSITION, SvxCharPositionPage::Create, 0);
+ AddTabPage( RID_SVXPAGE_CHAR_NAME );
+ AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
+ AddTabPage( RID_SVXPAGE_CHAR_POSITION );
}
// -----------------------------------------------------------------------
-void __EXPORT ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
- SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); //CHINA001
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
switch( nId )
{
case RID_SVXPAGE_CHAR_NAME:
@@ -78,16 +76,13 @@ void __EXPORT ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
SvxFontListItem aItem(*( (const SvxFontListItem*)
( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
- //CHINA001 ( (SvxCharNamePage&) rPage ).SetFontList( aItem );
aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
rPage.PageCreated(aSet);
}
break;
case RID_SVXPAGE_CHAR_EFFECTS:
- //CHINA001 ( (SvxCharEffectsPage&) rPage ).DisableControls(
- //CHINA001 DISABLE_CASEMAP);
- aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); //CHINA001
+ aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
rPage.PageCreated(aSet);
break;
@@ -106,31 +101,27 @@ ScParagraphDlg::ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) :
SvtCJKOptions aCJKOptions;
- AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH, SvxStdParagraphTabPage::Create, 0);
- AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH, SvxParaAlignTabPage::Create, 0);
- //AddTabPage( RID_SVXPAGE_EXT_PARAGRAPH, SvxExtParagraphTabPage::Create, 0);
+ AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
+ AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
if ( aCJKOptions.IsAsianTypographyEnabled() )
- AddTabPage( RID_SVXPAGE_PARA_ASIAN);//CHINA001 AddTabPage( RID_SVXPAGE_PARA_ASIAN, SvxAsianTabPage::Create,0);
+ AddTabPage( RID_SVXPAGE_PARA_ASIAN);
else
RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
- AddTabPage( RID_SVXPAGE_TABULATOR );//CHINA001 AddTabPage( RID_SVXPAGE_TABULATOR, SvxTabulatorTabPage::Create, 0);
+ AddTabPage( RID_SVXPAGE_TABULATOR );
}
// -----------------------------------------------------------------------
-void __EXPORT ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
switch( nId )
{
case RID_SVXPAGE_TABULATOR:
{
- //CHINA001 ( (SvxTabulatorTabPage&) rPage ).
- //CHINA001 DisableControls( TABTYPE_ALL &~TABTYPE_LEFT |
- //CHINA001 TABFILL_ALL &~TABFILL_NONE );
- SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));//add CHINA001
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_CONTROLFLAGS,(TABTYPE_ALL &~TABTYPE_LEFT) |
(TABFILL_ALL &~TABFILL_NONE) ));
- rPage.PageCreated(aSet);//add CHINA001
+ rPage.PageCreated(aSet);
}
break;
}
@@ -138,3 +129,4 @@ void __EXPORT ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index e230b9c2df25..8fa78a0f1a1c 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,10 @@
ScCbWarningBox::ScCbWarningBox( Window* pParent, const String& rMsgStr, bool bDefYes ) :
WarningBox( pParent, WB_YES_NO | (bDefYes ? WB_DEF_YES : WB_DEF_NO), rMsgStr )
{
- SetDefaultCheckBoxText();
+ // By default, the check box is ON, and the user needs to un-check it to
+ // disable all future warnings.
+ SetCheckBoxState(true);
+ SetCheckBoxText(String(ScResId(SCSTR_WARN_ME_IN_FUTURE_CHECK)));
}
sal_Int16 ScCbWarningBox::Execute()
@@ -49,7 +53,7 @@ sal_Int16 ScCbWarningBox::Execute()
if( IsDialogEnabled() )
{
nRet = WarningBox::Execute();
- if( GetCheckBoxState() )
+ if (!GetCheckBoxState())
DisableDialog();
}
return nRet;
@@ -75,17 +79,18 @@ ScReplaceWarnBox::ScReplaceWarnBox( Window* pParent ) :
bool ScReplaceWarnBox::IsDialogEnabled()
{
- return SC_MOD()->GetInputOptions().GetReplaceCellsWarn() == sal_True;
+ return SC_MOD()->GetInputOptions().GetReplaceCellsWarn() == true;
}
void ScReplaceWarnBox::DisableDialog()
{
ScModule* pScMod = SC_MOD();
ScInputOptions aInputOpt( pScMod->GetInputOptions() );
- aInputOpt.SetReplaceCellsWarn( sal_False );
+ aInputOpt.SetReplaceCellsWarn( false );
pScMod->SetInputOptions( aInputOpt );
}
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/namedlg/makefile.mk b/sc/source/ui/namedlg/makefile.mk
index 7c1151b8340b..f9cd60d008a4 100644
--- a/sc/source/ui/namedlg/makefile.mk
+++ b/sc/source/ui/namedlg/makefile.mk
@@ -32,9 +32,7 @@ TARGET=namedlg
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -43,6 +41,9 @@ CXXFILES = \
namedlg.cxx
SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
$(SLO)$/namedlg.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 0a3b0c4603a4..18560d2c521a 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,15 +67,15 @@
struct SaveData
{
SaveData()
- : bCriteria(sal_False),bPrintArea(sal_False),
- bColHeader(sal_False),bRowHeader(sal_False),
- bDirty(sal_False) {}
+ : bCriteria(false),bPrintArea(false),
+ bColHeader(false),bRowHeader(false),
+ bDirty(false) {}
void Clear()
{
aStrSymbol.Erase();
bCriteria = bPrintArea =
- bColHeader = bRowHeader = sal_False;
+ bColHeader = bRowHeader = false;
bDirty = sal_True;
}
@@ -104,7 +105,7 @@ static SaveData* pSaveObj = NULL;
aBtnPrintArea.Check( pSaveObj->bPrintArea ); \
aBtnColHeader.Check( pSaveObj->bColHeader ); \
aBtnRowHeader.Check( pSaveObj->bRowHeader ); \
- pSaveObj->bDirty = sal_False; \
+ pSaveObj->bDirty = false; \
}
#define ERRORBOX(s) ErrorBox(this,WinBits(WB_OK|WB_DEF_OK),s).Execute();
@@ -141,7 +142,7 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
aBtnRemove ( this, ScResId( BTN_REMOVE ) ),
aBtnMore ( this, ScResId( BTN_MORE ) ),
//
- bSaved (sal_False),
+ bSaved (false),
aStrAdd ( ScResId( STR_ADD ) ),
aStrModify ( ScResId( STR_MODIFY ) ),
errMsgInvalidSym( ScResId( STR_INVALIDSYMBOL ) ),
@@ -161,7 +162,7 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
//----------------------------------------------------------------------------
-__EXPORT ScNameDlg::~ScNameDlg()
+ScNameDlg::~ScNameDlg()
{
DELETEZ( pSaveObj );
}
@@ -169,7 +170,7 @@ __EXPORT ScNameDlg::~ScNameDlg()
//----------------------------------------------------------------------------
-void __EXPORT ScNameDlg::Init()
+void ScNameDlg::Init()
{
String aAreaStr;
ScRange aRange;
@@ -253,7 +254,7 @@ void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScNameDlg::Close()
+sal_Bool ScNameDlg::Close()
{
return DoClose( ScNameDlgWrapper::GetChildWindowId() );
}
@@ -270,13 +271,11 @@ void ScNameDlg::SetActive()
//----------------------------------------------------------------------------
-void __EXPORT ScNameDlg::UpdateChecks()
+void ScNameDlg::UpdateChecks()
{
- sal_uInt16 nCurPos=0;
-
- if(aLocalRangeName.SearchName( aEdName.GetText(), nCurPos))
+ const ScRangeData* pData = aLocalRangeName.findByName(aEdName.GetText());
+ if (pData)
{
- ScRangeData* pData=(ScRangeData*)(aLocalRangeName.At( nCurPos ));
aBtnCriteria .Check( pData->HasType( RT_CRITERIA ) );
aBtnPrintArea.Check( pData->HasType( RT_PRINTAREA ) );
aBtnColHeader.Check( pData->HasType( RT_COLHEADER ) );
@@ -315,44 +314,31 @@ void __EXPORT ScNameDlg::UpdateChecks()
//----------------------------------------------------------------------------
-void __EXPORT ScNameDlg::UpdateNames()
+void ScNameDlg::UpdateNames()
{
- sal_uInt16 nRangeCount = aLocalRangeName.GetCount();
-
- aEdName.SetUpdateMode( sal_False );
- //-----------------------------------------------------------
+ aEdName.SetUpdateMode( false );
sal_uInt16 nNamePos = aEdName.GetTopEntry();
aEdName.Clear();
aEdAssign.SetText( EMPTY_STRING );
- if ( nRangeCount > 0 )
- {
- ScRangeData* pRangeData = NULL;
- String aString;
-
- for ( sal_uInt16 i=0; i<nRangeCount; i++ )
- {
- pRangeData = (ScRangeData*)(aLocalRangeName.At( i ));
- if ( pRangeData )
- {
- if ( !pRangeData->HasType( RT_DATABASE )
- && !pRangeData->HasType( RT_SHARED ) )
- {
- pRangeData->GetName( aString );
- aEdName.InsertEntry( aString );
- }
- }
- }
- }
- else
+ if (aLocalRangeName.empty())
{
aBtnAdd.SetText( aStrAdd );
aBtnAdd.Disable();
aBtnRemove.Disable();
}
- //-----------------------------------------------------------
- aEdName.SetUpdateMode( sal_True );
+ else
+ {
+ ScRangeName::const_iterator itr = aLocalRangeName.begin(), itrEnd = aLocalRangeName.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ if (!itr->HasType(RT_DATABASE) && !itr->HasType(RT_SHARED))
+ aEdName.InsertEntry(itr->GetName());
+ }
+ }
+
+ aEdName.SetUpdateMode( true );
aEdName.SetTopEntry(nNamePos);
aEdName.Invalidate();
}
@@ -360,10 +346,8 @@ void __EXPORT ScNameDlg::UpdateNames()
//----------------------------------------------------------------------------
-void __EXPORT ScNameDlg::CalcCurTableAssign( String& aAssign, sal_uInt16 nCurPos )
+void ScNameDlg::CalcCurTableAssign( String& aAssign, ScRangeData* pRangeData )
{
- ScRangeData* pRangeData = (ScRangeData*)(aLocalRangeName.At( nCurPos ));
-
if ( pRangeData )
{
rtl::OUStringBuffer sBuffer;
@@ -390,7 +374,7 @@ IMPL_LINK( ScNameDlg, OkBtnHdl, void *, EMPTYARG )
{
ScDocShell* pDocSh = pViewData->GetDocShell();
ScDocFunc aFunc(*pDocSh);
- aFunc.ModifyRangeNames( aLocalRangeName, sal_False );
+ aFunc.ModifyRangeNames( aLocalRangeName );
Close();
}
return 0;
@@ -411,7 +395,7 @@ IMPL_LINK_INLINE_END( ScNameDlg, CancelBtnHdl, void *, EMPTYARG )
IMPL_LINK( ScNameDlg, AddBtnHdl, void *, EMPTYARG )
{
- sal_Bool bAdded = sal_False;
+ sal_Bool bAdded = false;
String aNewEntry = aEdName.GetText();
sal_uInt16 nNamePos = aEdName.GetTopEntry();
aNewEntry.EraseLeadingChars( ' ' );
@@ -425,7 +409,6 @@ IMPL_LINK( ScNameDlg, AddBtnHdl, void *, EMPTYARG )
{
ScRangeData* pNewEntry = NULL;
RangeType nType = RT_NAME;
- sal_uInt16 nFoundAt = 0;
String theSymbol = aEdAssign.GetText();
String aStrPos;
String aStrArea;
@@ -450,21 +433,20 @@ IMPL_LINK( ScNameDlg, AddBtnHdl, void *, EMPTYARG )
// in ein Token-Array uebersetzt werden?)
if ( 0 == pNewEntry->GetErrCode() )
{
- // Eintrag bereits vorhanden? Dann vorher entfernen (=Aendern)
- if ( aLocalRangeName.SearchName( aNewEntry, nFoundAt ) )
- { // alten Index uebernehmen
- pNewEntry->SetIndex(
- ((ScRangeData*)(aLocalRangeName.At(nFoundAt)))->GetIndex() );
- aLocalRangeName.AtFree( nFoundAt );
+ ScRangeData* pData = aLocalRangeName.findByName(aNewEntry);
+ if (pData)
+ {
+ pNewEntry->SetIndex(pData->GetIndex());
+ aLocalRangeName.erase(*pData);
}
else
pSaveObj->Clear();
- if ( !aLocalRangeName.Insert( pNewEntry ) )
+ if ( !aLocalRangeName.insert( pNewEntry ) )
delete pNewEntry;
UpdateNames();
- bSaved=sal_False;
+ bSaved=false;
RESTORE_DATA()
aEdName.SetText(EMPTY_STRING);
aEdName.GrabFocus();
@@ -504,10 +486,9 @@ IMPL_LINK( ScNameDlg, AddBtnHdl, void *, EMPTYARG )
IMPL_LINK( ScNameDlg, RemoveBtnHdl, void *, EMPTYARG )
{
- sal_uInt16 nRemoveAt = 0;
const String aStrEntry = aEdName.GetText();
-
- if ( aLocalRangeName.SearchName( aStrEntry, nRemoveAt ) )
+ ScRangeData* pData = aLocalRangeName.findByName(aStrEntry);
+ if (pData)
{
String aStrDelMsg = ScGlobal::GetRscString( STR_QUERY_DELENTRY );
String aMsg = aStrDelMsg.GetToken( 0, '#' );
@@ -518,10 +499,10 @@ IMPL_LINK( ScNameDlg, RemoveBtnHdl, void *, EMPTYARG )
if ( RET_YES ==
QueryBox( this, WinBits( WB_YES_NO | WB_DEF_YES ), aMsg ).Execute() )
{
- aLocalRangeName.AtFree( nRemoveAt );
+ aLocalRangeName.erase(*pData);
UpdateNames();
UpdateChecks();
- bSaved=sal_False;
+ bSaved=false;
RESTORE_DATA()
theCurSel = Selection( 0, SELECTION_MAX );
aBtnAdd.SetText( aStrAdd );
@@ -537,21 +518,15 @@ IMPL_LINK( ScNameDlg, RemoveBtnHdl, void *, EMPTYARG )
IMPL_LINK( ScNameDlg, NameSelectHdl, void *, EMPTYARG )
{
- sal_uInt16 nAtPos;
-
- if ( aLocalRangeName.SearchName( aEdName.GetText(), nAtPos ) )
+ ScRangeData* pData = aLocalRangeName.findByName(aEdName.GetText());
+ if (pData)
{
- String aSymbol;
- ScRangeData* pData = (ScRangeData*)(aLocalRangeName.At( nAtPos ));
-
- if ( pData )
- {
- pData->GetSymbol( aSymbol );
- CalcCurTableAssign( aSymbol, nAtPos );
- aEdAssign.SetText( aSymbol );
- aBtnAdd.SetText( aStrModify );
- theCurSel = Selection( 0, SELECTION_MAX );
- }
+ String aSymbol;
+ pData->GetSymbol( aSymbol );
+ CalcCurTableAssign( aSymbol, pData );
+ aEdAssign.SetText( aSymbol );
+ aBtnAdd.SetText( aStrModify );
+ theCurSel = Selection( 0, SELECTION_MAX );
}
UpdateChecks();
return 0;
@@ -603,7 +578,7 @@ IMPL_LINK( ScNameDlg, EdModifyHdl, Edit *, pEd )
aBtnAdd.SetText( aStrAdd );
aBtnRemove.Disable();
- bSaved=sal_False;
+ bSaved=false;
RESTORE_DATA()
}
theSymbol = aEdAssign.GetText();
@@ -649,3 +624,4 @@ IMPL_LINK_INLINE_START( ScNameDlg, AssignGetFocusHdl, void *, EMPTYARG )
IMPL_LINK_INLINE_END( ScNameDlg, AssignGetFocusHdl, void *, EMPTYARG )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 7952d968e36c..90d83f861008 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,7 +88,7 @@ static sal_uInt16 pTypeList[SC_CONTENT_COUNT] =
SC_CONTENT_DRAWING
};
-sal_Bool ScContentTree::bIsInDrag = sal_False;
+sal_Bool ScContentTree::bIsInDrag = false;
ScDocShell* ScContentTree::GetManualOrCurrent()
@@ -127,9 +128,8 @@ ScDocShell* ScContentTree::GetManualOrCurrent()
ScContentTree::ScContentTree( Window* pParent, const ResId& rResId ) :
SvTreeListBox ( pParent, rResId ),
aEntryImages ( ScResId( RID_IMAGELIST_NAVCONT ) ),
- aHCEntryImages ( ScResId( RID_IMAGELIST_H_NAVCONT ) ),
nRootType ( SC_CONTENT_ROOT ),
- bHiddenDoc ( sal_False ),
+ bHiddenDoc ( false ),
pHiddenDocument ( NULL )
{
sal_uInt16 i;
@@ -168,11 +168,7 @@ void ScContentTree::InitRoot( sal_uInt16 nType )
String aName( ScResId( SCSTR_CONTENT_ROOT + nType ) );
// wieder an die richtige Position:
sal_uInt16 nPos = nRootType ? 0 : pPosList[nType]-1;
- SvLBoxEntry* pNew = InsertEntry( aName, rImage, rImage, NULL, sal_False, nPos );
-
- const Image& rHCImage = aHCEntryImages.GetImage( nType );
- SetExpandedEntryBmp( pNew, rHCImage, BMP_COLOR_HIGHCONTRAST );
- SetCollapsedEntryBmp( pNew, rHCImage, BMP_COLOR_HIGHCONTRAST );
+ SvLBoxEntry* pNew = InsertEntry( aName, rImage, rImage, NULL, false, nPos );
pRootNodes[nType] = pNew;
}
@@ -204,7 +200,7 @@ void ScContentTree::InsertContent( sal_uInt16 nType, const String& rValue )
{
if (nType >= SC_CONTENT_COUNT)
{
- DBG_ERROR("ScContentTree::InsertContent mit falschem Typ");
+ OSL_FAIL("ScContentTree::InsertContent mit falschem Typ");
return;
}
@@ -213,7 +209,7 @@ void ScContentTree::InsertContent( sal_uInt16 nType, const String& rValue )
InsertEntry( rValue, pParent );
else
{
- DBG_ERROR("InsertContent ohne Parent");
+ OSL_FAIL("InsertContent ohne Parent");
}
}
@@ -317,7 +313,7 @@ IMPL_LINK( ScContentTree, ContentDoubleClickHdl, ScContentTree *, EMPTYARG )
case SC_CONTENT_DBAREA:
{
- // #47905# Wenn gleiche Bereichs- und DB-Namen existieren, wird
+ // Wenn gleiche Bereichs- und DB-Namen existieren, wird
// bei SID_CURRENTCELL der Bereichsname genommen.
// DB-Bereiche darum direkt ueber die Adresse anspringen.
@@ -370,7 +366,7 @@ void ScContentTree::MouseButtonDown( const MouseEvent& rMEvt )
void ScContentTree::KeyInput( const KeyEvent& rKEvt )
{
- sal_Bool bUsed = sal_False;
+ sal_Bool bUsed = false;
const KeyCode aCode = rKEvt.GetKeyCode();
if (aCode.GetCode() == KEY_RETURN)
@@ -413,16 +409,6 @@ void ScContentTree::KeyInput( const KeyEvent& rKEvt )
SvTreeListBox::KeyInput(rKEvt);
}
-//sal_Bool __EXPORT ScContentTree::Drop( const DropEvent& rEvt )
-//{
-// return pParentWindow->Drop(rEvt); // Drop auf Navigator
-//}
-
-//sal_Bool __EXPORT ScContentTree::QueryDrop( DropEvent& rEvt )
-//{
-// return pParentWindow->QueryDrop(rEvt); // Drop auf Navigator
-//}
-
sal_Int8 ScContentTree::AcceptDrop( const AcceptDropEvent& /* rEvt */ )
{
return DND_ACTION_NONE;
@@ -442,9 +428,9 @@ void ScContentTree::DragFinished( sal_Int8 /* nAction */ )
{
}
-void __EXPORT ScContentTree::Command( const CommandEvent& rCEvt )
+void ScContentTree::Command( const CommandEvent& rCEvt )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
switch ( rCEvt.GetCommand() )
{
@@ -454,8 +440,6 @@ void __EXPORT ScContentTree::Command( const CommandEvent& rCEvt )
// den StarView MouseMove-Handler, der Command() aufruft, umbringen.
// Deshalb Drag&Drop asynchron:
-// DoDrag();
-
Application::PostUserEvent( STATIC_LINK( this, ScContentTree, ExecDragHdl ) );
bDone = sal_True;
@@ -537,16 +521,16 @@ void __EXPORT ScContentTree::Command( const CommandEvent& rCEvt )
SvTreeListBox::Command(rCEvt);
}
-void __EXPORT ScContentTree::RequestHelp( const HelpEvent& rHEvt )
+void ScContentTree::RequestHelp( const HelpEvent& rHEvt )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if( rHEvt.GetMode() & HELPMODE_QUICK )
{
Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
SvLBoxEntry* pEntry = GetEntry( aPos );
if ( pEntry )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
String aHelpText;
SvLBoxEntry* pParent = GetParent(pEntry);
if ( !pParent ) // Top-Level ?
@@ -631,7 +615,7 @@ void ScContentTree::Refresh( sal_uInt16 nType )
if (!DrawNamesChanged(SC_CONTENT_DRAWING))
return;
- SetUpdateMode(sal_False);
+ SetUpdateMode(false);
ClearType( nType );
@@ -684,38 +668,29 @@ void ScContentTree::GetAreaNames()
return;
ScRangeName* pRangeNames = pDoc->GetRangeName();
- sal_uInt16 nCount = pRangeNames->GetCount();
- if ( nCount > 0 )
+ if (!pRangeNames->empty())
{
- sal_uInt16 nValidCount = 0;
ScRange aDummy;
- sal_uInt16 i;
- for ( i=0; i<nCount; i++ )
+ ScRangeName::const_iterator itrBeg = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ std::vector<const ScRangeData*> aSortArray;
+ for (ScRangeName::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pRangeNames)[i];
- if (pData->IsValidReference(aDummy))
- nValidCount++;
+ if (itr->IsValidReference(aDummy))
+ aSortArray.push_back(&(*itr));
}
- if ( nValidCount )
+
+ if (!aSortArray.empty())
{
- ScRangeData** ppSortArray = new ScRangeData* [ nValidCount ];
- sal_uInt16 j;
- for ( i=0, j=0; i<nCount; i++ )
- {
- ScRangeData* pData = (*pRangeNames)[i];
- if (pData->IsValidReference(aDummy))
- ppSortArray[j++] = pData;
- }
#ifndef ICC
- qsort( (void*)ppSortArray, nValidCount, sizeof(ScRangeData*),
+ size_t n = aSortArray.size();
+ qsort( (void*)&aSortArray[0], n, sizeof(ScRangeData*),
&ScRangeData_QsortNameCompare );
#else
- qsort( (void*)ppSortArray, nValidCount, sizeof(ScRangeData*),
+ qsort( (void*)&aSortArray[0], n, sizeof(ScRangeData*),
ICCQsortNameCompare );
#endif
- for ( j=0; j<nValidCount; j++ )
- InsertContent( SC_CONTENT_RANGENAME, ppSortArray[j]->GetName() );
- delete [] ppSortArray;
+ for (size_t i = 0; i < n; ++i)
+ InsertContent(SC_CONTENT_RANGENAME, aSortArray[i]->GetName());
}
}
}
@@ -744,7 +719,7 @@ void ScContentTree::GetDbNames()
}
}
-bool ScContentTree::IsPartOfType( sal_uInt16 nContentType, sal_uInt16 nObjIdentifier ) // static
+bool ScContentTree::IsPartOfType( sal_uInt16 nContentType, sal_uInt16 nObjIdentifier )
{
bool bRet = false;
switch ( nContentType )
@@ -759,7 +734,7 @@ bool ScContentTree::IsPartOfType( sal_uInt16 nContentType, sal_uInt16 nObjIdenti
bRet = ( nObjIdentifier != OBJ_GRAF && nObjIdentifier != OBJ_OLE2 ); // everything else
break;
default:
- DBG_ERROR("unknown content type");
+ OSL_FAIL("unknown content type");
}
return bRet;
}
@@ -865,7 +840,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex )
}
}
- DBG_ERROR("Link nicht gefunden");
+ OSL_FAIL("Link nicht gefunden");
return NULL;
}
@@ -921,7 +896,7 @@ ScAddress ScContentTree::GetNotePos( sal_uLong nIndex )
}
}
- DBG_ERROR("Notiz nicht gefunden");
+ OSL_FAIL("Notiz nicht gefunden");
return ScAddress();
}
@@ -929,11 +904,11 @@ sal_Bool ScContentTree::NoteStringsChanged()
{
ScDocument* pDoc = GetSourceDocument();
if (!pDoc)
- return sal_False;
+ return false;
SvLBoxEntry* pParent = pRootNodes[SC_CONTENT_NOTE];
if (!pParent)
- return sal_False;
+ return false;
SvLBoxEntry* pEntry = FirstChild( pParent );
@@ -948,11 +923,11 @@ sal_Bool ScContentTree::NoteStringsChanged()
if( const ScPostIt* pNote = pCell->GetNote() )
{
if ( !pEntry )
- bEqual = sal_False;
+ bEqual = false;
else
{
if ( lcl_NoteString( *pNote ) != GetEntryText(pEntry) )
- bEqual = sal_False;
+ bEqual = false;
pEntry = NextSibling( pEntry );
}
@@ -962,7 +937,7 @@ sal_Bool ScContentTree::NoteStringsChanged()
}
if ( pEntry )
- bEqual = sal_False; // kommt noch was
+ bEqual = false; // kommt noch was
return !bEqual;
}
@@ -971,11 +946,11 @@ sal_Bool ScContentTree::DrawNamesChanged( sal_uInt16 nType )
{
ScDocument* pDoc = GetSourceDocument();
if (!pDoc)
- return sal_False;
+ return false;
SvLBoxEntry* pParent = pRootNodes[nType];
if (!pParent)
- return sal_False;
+ return false;
SvLBoxEntry* pEntry = FirstChild( pParent );
@@ -1001,11 +976,11 @@ sal_Bool ScContentTree::DrawNamesChanged( sal_uInt16 nType )
if ( IsPartOfType( nType, pObject->GetObjIdentifier() ) )
{
if ( !pEntry )
- bEqual = sal_False;
+ bEqual = false;
else
{
if ( ScDrawLayer::GetVisibleName( pObject ) != GetEntryText(pEntry) )
- bEqual = sal_False;
+ bEqual = false;
pEntry = NextSibling( pEntry );
}
@@ -1017,23 +992,25 @@ sal_Bool ScContentTree::DrawNamesChanged( sal_uInt16 nType )
}
if ( pEntry )
- bEqual = sal_False; // kommt noch was
+ bEqual = false; // kommt noch was
return !bEqual;
}
sal_Bool lcl_GetRange( ScDocument* pDoc, sal_uInt16 nType, const String& rName, ScRange& rRange )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
sal_uInt16 nPos;
if ( nType == SC_CONTENT_RANGENAME )
{
ScRangeName* pList = pDoc->GetRangeName();
if (pList)
- if (pList->SearchName( rName, nPos ))
- if ( (*pList)[nPos]->IsValidReference( rRange ) )
- bFound = sal_True;
+ {
+ const ScRangeData* p = pList->findByName(rName);
+ if (p && p->IsValidReference(rRange))
+ bFound = true;
+ }
}
else if ( nType == SC_CONTENT_DBAREA )
{
@@ -1160,7 +1137,7 @@ void ScContentTree::DoDrag()
}
}
- sal_Bool bDoLinkTrans = sal_False; // use ScLinkTransferObj
+ sal_Bool bDoLinkTrans = false; // use ScLinkTransferObj
String aLinkURL; // for ScLinkTransferObj
String aLinkText;
@@ -1270,7 +1247,7 @@ void ScContentTree::DoDrag()
}
}
- bIsInDrag = sal_False; // static Member
+ bIsInDrag = false; // static Member
delete pDocLoader; // falls Dokument zum Draggen geladen wurde
}
@@ -1284,17 +1261,6 @@ IMPL_STATIC_LINK(ScContentTree, ExecDragHdl, void*, EMPTYARG)
return 0;
}
-//UNUSED2008-05 void ScContentTree::AdjustTitle()
-//UNUSED2008-05 {
-//UNUSED2008-05 String aTitle = pParentWindow->aTitleBase;
-//UNUSED2008-05 if (bHiddenDoc)
-//UNUSED2008-05 {
-//UNUSED2008-05 aTitle.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " - " ));
-//UNUSED2008-05 aTitle += aHiddenTitle;
-//UNUSED2008-05 }
-//UNUSED2008-05 pParentWindow->SetText(aTitle);
-//UNUSED2008-05 }
-
sal_Bool ScContentTree::LoadFile( const String& rUrl )
{
String aDocName = rUrl;
@@ -1302,7 +1268,7 @@ sal_Bool ScContentTree::LoadFile( const String& rUrl )
if ( nPos != STRING_NOTFOUND )
aDocName.Erase(nPos); // nur der Name, ohne #...
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
String aFilter, aOptions;
ScDocumentLoader aLoader( aDocName, aFilter, aOptions );
if ( !aLoader.IsError() )
@@ -1315,7 +1281,6 @@ sal_Bool ScContentTree::LoadFile( const String& rUrl )
Refresh(); // Inhalte aus geladenem Dokument holen
pHiddenDocument = NULL;
-// AdjustTitle();
pParentWindow->GetDocNames( &aHiddenTitle ); // Liste fuellen
}
@@ -1370,7 +1335,7 @@ void ScContentTree::ToggleRoot() // nach Selektion
void ScContentTree::ResetManualDoc()
{
aManualDoc.Erase();
- bHiddenDoc = sal_False;
+ bHiddenDoc = false;
ActiveDocChanged();
}
@@ -1433,9 +1398,7 @@ void ScContentTree::SelectDoc(const String& rName) // rName wie im Menue/Li
if ( rName.Copy( nNotActiveStart ) == pParentWindow->aStrNotActive )
aRealName = rName.Copy( 0, nNotActiveStart );
- //
-
- sal_Bool bLoaded = sal_False;
+ sal_Bool bLoaded = false;
// ist es ein normal geladenes Doc ?
@@ -1450,7 +1413,7 @@ void ScContentTree::SelectDoc(const String& rName) // rName wie im Menue/Li
if (bLoaded)
{
- bHiddenDoc = sal_False;
+ bHiddenDoc = false;
SetManualDoc(aRealName);
}
else if (aHiddenTitle.Len()) // verstecktes ausgewaehlt
@@ -1460,7 +1423,7 @@ void ScContentTree::SelectDoc(const String& rName) // rName wie im Menue/Li
}
else
{
- DBG_ERROR("SelectDoc: nicht gefunden");
+ OSL_FAIL("SelectDoc: nicht gefunden");
}
}
@@ -1526,3 +1489,4 @@ void ScContentTree::StoreSettings() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/makefile.mk b/sc/source/ui/navipi/makefile.mk
index 9c0de073dd8c..1ce4df4b4927 100644
--- a/sc/source/ui/navipi/makefile.mk
+++ b/sc/source/ui/navipi/makefile.mk
@@ -32,20 +32,18 @@ TARGET=navipi
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/navipi.obj \
- $(SLO)$/navcitem.obj \
- $(SLO)$/scenwnd.obj \
- $(SLO)$/content.obj
+SLOFILES = \
+ $(EXCEPTIONSFILES)
-EXCEPTIONSFILES = \
+EXCEPTIONSFILES = \
+ $(SLO)$/content.obj \
+ $(SLO)$/navcitem.obj \
+ $(SLO)$/navipi.obj \
$(SLO)$/scenwnd.obj
SRS1NAME=$(TARGET)
diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx
index 97872ae77720..3d30ddb74d94 100644
--- a/sc/source/ui/navipi/navcitem.cxx
+++ b/sc/source/ui/navipi/navcitem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,7 @@ ScNavigatorControllerItem::ScNavigatorControllerItem( sal_uInt16 nIdP,
//------------------------------------------------------------------------
-void __EXPORT ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemState /* eState */,
+void ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemState /* eState */,
const SfxPoolItem* pItem )
{
switch( GetId() )
@@ -63,7 +64,6 @@ void __EXPORT ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, Sf
case SID_CURRENTCELL:
if ( pItem )
{
-// const SfxPointItem* pCellPosItem = PTR_CAST(SfxPointItem, pItem);
const SfxStringItem* pCellPosItem = PTR_CAST(SfxStringItem, pItem);
DBG_ASSERT( pCellPosItem, "SfxStringItem expected!" );
@@ -77,9 +77,6 @@ void __EXPORT ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, Sf
SCCOL nCol = aScAddress.Col()+1;
SCROW nRow = aScAddress.Row()+1;
-// SCCOL nCol = (sal_uInt16)pCellPosItem->GetValue().X()+1;
-// SCROW nRow = (sal_uInt16)pCellPosItem->GetValue().Y()+1;
-
rNavigatorDlg.UpdateColumn( &nCol );
rNavigatorDlg.UpdateRow ( &nRow );
rNavigatorDlg.CursorPosChanged();
@@ -125,3 +122,4 @@ void __EXPORT ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, Sf
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index a4dcaa801624..c2988f6826b0 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
//------------------------------------------------------------------
-// #include <math.h>
#include <rangelst.hxx>
#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
@@ -77,7 +77,6 @@ static const xub_StrLen SCNAV_COLLETTERS = ::ScColToAlpha(SCNAV_MAXCOL).Len();
//------------------------------------------------------------------------
-// static
void ScNavigatorDlg::ReleaseFocus()
{
SfxViewShell* pCurSh = SfxViewShell::Current();
@@ -105,13 +104,13 @@ ColumnEdit::ColumnEdit( ScNavigatorDlg* pParent, const ResId& rResId )
//------------------------------------------------------------------------
-__EXPORT ColumnEdit::~ColumnEdit()
+ColumnEdit::~ColumnEdit()
{
}
//------------------------------------------------------------------------
-long __EXPORT ColumnEdit::Notify( NotifyEvent& rNEvt )
+long ColumnEdit::Notify( NotifyEvent& rNEvt )
{
long nHandled = SpinField::Notify( rNEvt );
@@ -143,7 +142,7 @@ long __EXPORT ColumnEdit::Notify( NotifyEvent& rNEvt )
//------------------------------------------------------------------------
-void __EXPORT ColumnEdit::LoseFocus()
+void ColumnEdit::LoseFocus()
{
EvalText();
}
@@ -151,7 +150,7 @@ void __EXPORT ColumnEdit::LoseFocus()
//------------------------------------------------------------------------
-void __EXPORT ColumnEdit::Up()
+void ColumnEdit::Up()
{
nCol++;
@@ -168,7 +167,7 @@ void __EXPORT ColumnEdit::Up()
//------------------------------------------------------------------------
-void __EXPORT ColumnEdit::Down()
+void ColumnEdit::Down()
{
if ( nCol>1 )
SetCol( nCol-1 );
@@ -180,7 +179,7 @@ void __EXPORT ColumnEdit::Down()
//------------------------------------------------------------------------
-void __EXPORT ColumnEdit::First()
+void ColumnEdit::First()
{
nCol = 1;
SetText( 'A' );
@@ -188,7 +187,7 @@ void __EXPORT ColumnEdit::First()
//------------------------------------------------------------------------
-void __EXPORT ColumnEdit::Last()
+void ColumnEdit::Last()
{
String aStr;
nCol = NumToAlpha( SCNAV_MAXCOL, aStr );
@@ -316,13 +315,13 @@ RowEdit::RowEdit( ScNavigatorDlg* pParent, const ResId& rResId )
//------------------------------------------------------------------------
-__EXPORT RowEdit::~RowEdit()
+RowEdit::~RowEdit()
{
}
//------------------------------------------------------------------------
-long __EXPORT RowEdit::Notify( NotifyEvent& rNEvt )
+long RowEdit::Notify( NotifyEvent& rNEvt )
{
long nHandled = NumericField::Notify( rNEvt );
@@ -343,7 +342,7 @@ long __EXPORT RowEdit::Notify( NotifyEvent& rNEvt )
//------------------------------------------------------------------------
-void __EXPORT RowEdit::LoseFocus()
+void RowEdit::LoseFocus()
{
}
@@ -370,13 +369,13 @@ ScDocListBox::ScDocListBox( ScNavigatorDlg* pParent, const ResId& rResId )
//------------------------------------------------------------------------
-__EXPORT ScDocListBox::~ScDocListBox()
+ScDocListBox::~ScDocListBox()
{
}
//------------------------------------------------------------------------
-void __EXPORT ScDocListBox::Select()
+void ScDocListBox::Select()
{
ScNavigatorDlg::ReleaseFocus();
@@ -397,13 +396,11 @@ CommandToolBox::CommandToolBox( ScNavigatorDlg* pParent, const ResId& rResId )
SetSizePixel( CalcWindowSizePixel() );
SetDropdownClickHdl( LINK(this, CommandToolBox, ToolBoxDropdownClickHdl) );
SetItemBits( IID_DROPMODE, GetItemBits( IID_DROPMODE ) | TIB_DROPDOWNONLY );
-// EnableItem( IID_UP, sal_False );
-// EnableItem( IID_DOWN, sal_False );
}
//------------------------------------------------------------------------
-__EXPORT CommandToolBox::~CommandToolBox()
+CommandToolBox::~CommandToolBox()
{
}
@@ -447,7 +444,6 @@ void CommandToolBox::Select( sal_uInt16 nSelId )
case IID_DOWN:
rDlg.EndOfDataArea();
break;
- // IID_DROPMODE ist in Click
case IID_CHANGEROOT:
rDlg.aLbEntries.ToggleRoot();
UpdateButtons();
@@ -455,14 +451,14 @@ void CommandToolBox::Select( sal_uInt16 nSelId )
}
}
-void __EXPORT CommandToolBox::Select()
+void CommandToolBox::Select()
{
Select( GetCurItemId() );
}
//------------------------------------------------------------------------
-void __EXPORT CommandToolBox::Click()
+void CommandToolBox::Click()
{
}
@@ -485,7 +481,7 @@ IMPL_LINK( CommandToolBox, ToolBoxDropdownClickHdl, ToolBox*, EMPTYARG )
if ( nId >= RID_DROPMODE_URL && nId <= RID_DROPMODE_COPY )
rDlg.SetDropMode( nId - RID_DROPMODE_URL );
- // #49956# den gehighlighteten Button aufheben
+ // den gehighlighteten Button aufheben
Point aPoint;
MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC );
MouseMove( aLeave );
@@ -505,8 +501,8 @@ void CommandToolBox::UpdateButtons()
// Umschalten-Button:
if ( eMode == NAV_LMODE_SCENARIOS || eMode == NAV_LMODE_NONE )
{
- EnableItem( IID_CHANGEROOT, sal_False );
- CheckItem( IID_CHANGEROOT, sal_False );
+ EnableItem( IID_CHANGEROOT, false );
+ CheckItem( IID_CHANGEROOT, false );
}
else
{
@@ -515,23 +511,19 @@ void CommandToolBox::UpdateButtons()
CheckItem( IID_CHANGEROOT, bRootSet );
}
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
-
sal_uInt16 nImageId = 0;
switch ( rDlg.nDropMode )
{
- case SC_DROPMODE_URL: nImageId = bHC ? RID_IMG_H_DROP_URL : RID_IMG_DROP_URL; break;
- case SC_DROPMODE_LINK: nImageId = bHC ? RID_IMG_H_DROP_LINK : RID_IMG_DROP_LINK; break;
- case SC_DROPMODE_COPY: nImageId = bHC ? RID_IMG_H_DROP_COPY : RID_IMG_DROP_COPY; break;
+ case SC_DROPMODE_URL: nImageId = RID_IMG_DROP_URL; break;
+ case SC_DROPMODE_LINK: nImageId = RID_IMG_DROP_LINK; break;
+ case SC_DROPMODE_COPY: nImageId = RID_IMG_DROP_COPY; break;
}
SetItemImage( IID_DROPMODE, Image(ScResId(nImageId)) );
}
void CommandToolBox::InitImageList()
{
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
-
- ImageList& rImgLst = bHC ? rDlg.aCmdImageListH : rDlg.aCmdImageList;
+ ImageList& rImgLst = rDlg.aCmdImageList;
sal_uInt16 nCount = GetItemCount();
for (sal_uInt16 i = 0; i < nCount; i++)
@@ -559,7 +551,7 @@ void CommandToolBox::DataChanged( const DataChangedEvent& rDCEvt )
//==================================================================
ScNavigatorSettings::ScNavigatorSettings() :
- maExpandedVec( SC_CONTENT_COUNT, sal_False ),
+ maExpandedVec( SC_CONTENT_COUNT, false ),
mnRootSelected( SC_CONTENT_ROOT ),
mnChildSelected( SC_CONTENT_NOCHILD )
{
@@ -614,7 +606,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(
// Die Groesse des Floats nicht neu setzen (sal_False bei SetListMode), damit der
// Navigator nicht aufgeklappt wird, wenn er minimiert war (#38872#).
- pNavigator->SetListMode( eNavMode, sal_False ); // FALSE: Groesse des Float nicht setzen
+ pNavigator->SetListMode( eNavMode, false ); // FALSE: Groesse des Float nicht setzen
sal_uInt16 nCmdId;
switch (eNavMode)
@@ -632,17 +624,9 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(
}
pNavigator->bFirstBig = ( nCmdId == 0 ); // dann spaeter
-
-/*???
- FloatingWindow* pFloat = GetFloatingWindow();
- if ( pFloat )
- pFloat->SetMinOutputSizePixel( pNavigator->GetMinOutputSizePixel() );
-*/
-
-//!? pNavigator->Show();
}
-void __EXPORT ScNavigatorDialogWrapper::Resizing( Size& rSize )
+void ScNavigatorDialogWrapper::Resizing( Size& rSize )
{
((ScNavigatorDlg*)GetWindow())->Resizing(rSize);
}
@@ -660,7 +644,6 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win
Window( pParent, ScResId(RID_SCDLG_NAVIGATOR) ),
rBindings ( *pB ), // is used in CommandToolBox ctor
aCmdImageList( ScResId( IL_CMD ) ),
- aCmdImageListH( ScResId( ILH_CMD ) ),
aFtCol ( this, ScResId( FT_COL ) ),
aEdCol ( this, ScResId( ED_COL ) ),
aFtRow ( this, ScResId( FT_ROW ) ),
@@ -682,7 +665,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win
nCurCol ( 0 ),
nCurRow ( 0 ),
nCurTab ( 0 ),
- bFirstBig ( sal_False )
+ bFirstBig ( false )
{
ScNavipiCfg& rCfg = SC_MOD()->GetNavipiCfg();
nDropMode = rCfg.GetDragMode();
@@ -716,12 +699,6 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win
nListModeHeight = aInitSize.Height()
+ nInitListHeight;
- // kein Resize, eh der ganze Kontext-Kram initialisiert ist!
-// SetOutputSizePixel( aInitSize ); //???
-/*! FloatingWindow* pFloat = pContextWin->GetFloatingWindow();
- if ( pFloat)
- pFloat->SetMinOutputSizePixel( aInitSize );
-*/
ppBoundItems = new ScNavigatorControllerItem* [CTRL_ITEMS];
rBindings.ENTERREGISTRATIONS();
@@ -775,7 +752,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win
//------------------------------------------------------------------------
-__EXPORT ScNavigatorDlg::~ScNavigatorDlg()
+ScNavigatorDlg::~ScNavigatorDlg()
{
aContentTimer.Stop();
@@ -792,7 +769,7 @@ __EXPORT ScNavigatorDlg::~ScNavigatorDlg()
//------------------------------------------------------------------------
-void __EXPORT ScNavigatorDlg::Resizing( Size& rNewSize ) // Size = Outputsize?
+void ScNavigatorDlg::Resizing( Size& rNewSize ) // Size = Outputsize?
{
FloatingWindow* pFloat = pContextWin->GetFloatingWindow();
if ( pFloat )
@@ -810,8 +787,6 @@ void __EXPORT ScNavigatorDlg::Resizing( Size& rNewSize ) // Size = Outputsize?
rNewSize.Height() = aMinOut.Height();
}
}
-// else
-// SfxDockingWindow::Resizing(rNewSize);
}
@@ -842,7 +817,7 @@ void ScNavigatorDlg::DataChanged( const DataChangedEvent& rDCEvt )
//------------------------------------------------------------------------
-void __EXPORT ScNavigatorDlg::Resize()
+void ScNavigatorDlg::Resize()
{
DoResize();
}
@@ -854,7 +829,7 @@ void ScNavigatorDlg::DoResize()
Size aNewSize = GetOutputSizePixel();
long nTotalHeight = aNewSize.Height();
- // #41403# bei angedocktem Navigator wird das Fenster evtl. erst klein erzeugt,
+ // bei angedocktem Navigator wird das Fenster evtl. erst klein erzeugt,
// dann kommt ein Resize auf die wirkliche Groesse -> dann Inhalte einschalten
sal_Bool bSmall = ( nTotalHeight <= aInitSize.Height() + SCNAV_MINTOL );
@@ -862,19 +837,18 @@ void ScNavigatorDlg::DoResize()
{
// Inhalte laut Config wieder einschalten
- bFirstBig = sal_False;
+ bFirstBig = false;
NavListMode eNavMode = NAV_LMODE_AREAS;
ScNavipiCfg& rCfg = SC_MOD()->GetNavipiCfg();
NavListMode eLastMode = (NavListMode) rCfg.GetListMode();
if ( eLastMode == NAV_LMODE_SCENARIOS )
eNavMode = NAV_LMODE_SCENARIOS;
- SetListMode( eNavMode, sal_False ); // FALSE: Groesse des Float nicht setzen
+ SetListMode( eNavMode, false ); // FALSE: Groesse des Float nicht setzen
}
// auch wenn die Inhalte nicht sichtbar sind, die Groessen anpassen,
// damit die Breite stimmt
- //@@ 03.11.97 changes begin
Point aEntryPos = aLbEntries.GetPosPixel();
Point aListPos = aLbDocuments.GetPosPixel();
aNewSize.Width() -= 2*nBorderOffset;
@@ -898,8 +872,6 @@ void ScNavigatorDlg::DoResize()
aWndScenarios.SetSizePixel( aNewSize );
aLbDocuments.SetSizePixel( aDocSize );
- //@@ 03.11.97 end
-
sal_Bool bListMode = (eListMode != NAV_LMODE_NONE);
FloatingWindow* pFloat = pContextWin->GetFloatingWindow();
if ( pFloat && bListMode )
@@ -908,7 +880,7 @@ void ScNavigatorDlg::DoResize()
//------------------------------------------------------------------------
-void __EXPORT ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
+void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.ISA(SfxSimpleHint) )
{
@@ -1021,7 +993,7 @@ void ScNavigatorDlg::SetCurrentCell( SCCOL nColNo, SCROW nRowNo )
String aAddr;
aScAddress.Format( aAddr, SCA_ABS );
- sal_Bool bUnmark = sal_False;
+ sal_Bool bUnmark = false;
if ( GetViewData() )
bUnmark = !pViewData->GetMarkData().IsCellMarked( nColNo, nRowNo );
@@ -1110,7 +1082,7 @@ ScTabViewShell* ScNavigatorDlg::GetTabViewShell() const
ScNavigatorSettings* ScNavigatorDlg::GetNavigatorSettings()
{
- // #95791# Don't store the settings pointer here, because the settings belong to
+ // Don't store the settings pointer here, because the settings belong to
// the view, and the view may be closed while the navigator is open (reload).
// If the pointer is cached here again later for performance reasons, it has to
// be forgotten when the view is closed.
@@ -1164,7 +1136,6 @@ void ScNavigatorDlg::UpdateTable( const SCTAB* pTab )
else if ( GetViewData() )
nCurTab = pViewData->GetTabNo();
-// aLbTables.SetTab( nCurTab );
CheckDataArea();
}
@@ -1198,14 +1169,14 @@ void ScNavigatorDlg::SetListMode( NavListMode eMode, sal_Bool bSetSize )
if ( eMode != eListMode )
{
if ( eMode != NAV_LMODE_NONE )
- bFirstBig = sal_False; // nicht mehr automatisch umschalten
+ bFirstBig = false; // nicht mehr automatisch umschalten
eListMode = eMode;
switch ( eMode )
{
case NAV_LMODE_NONE:
- ShowList( sal_False, bSetSize );
+ ShowList( false, bSetSize );
break;
case NAV_LMODE_AREAS:
@@ -1336,7 +1307,7 @@ void ScNavigatorDlg::ShowScenarios( sal_Bool bShow, sal_Bool bSetSize )
void ScNavigatorDlg::GetDocNames( const String* pManualSel )
{
aLbDocuments.Clear();
- aLbDocuments.SetUpdateMode( sal_False );
+ aLbDocuments.SetUpdateMode( false );
ScDocShell* pCurrentSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
@@ -1475,7 +1446,7 @@ void ScNavigatorDlg::EndOfDataArea()
//------------------------------------------------------------------------
-SfxChildAlignment __EXPORT ScNavigatorDlg::CheckAlignment(
+SfxChildAlignment ScNavigatorDlg::CheckAlignment(
SfxChildAlignment eActAlign, SfxChildAlignment eAlign )
{
SfxChildAlignment eRetAlign;
@@ -1509,61 +1480,4 @@ SfxChildAlignment __EXPORT ScNavigatorDlg::CheckAlignment(
return eRetAlign;
}
-//------------------------------------------------------------------------
-//
-// Drop auf den Navigator - andere Datei laden (File oder Bookmark)
-//
-//------------------------------------------------------------------------
-
-#if 0
-sal_Bool __EXPORT ScNavigatorDlg::Drop( const DropEvent& rEvt )
-{
- sal_Bool bReturn = sal_False;
-
- if ( !aLbEntries.IsInDrag() ) // kein Verschieben innerhalb der TreeListBox
- {
- String aFileName;
-
- SvScDataObjectRef pObject = SvScDataObject::PasteDragServer(rEvt);
-
- sal_uLong nFormat = INetBookmark::HasFormat(*pObject);
- INetBookmark aBookmark;
- if (aBookmark.Paste(*pObject,nFormat))
- aFileName = aBookmark.GetURL();
- else
- {
- // FORMAT_FILE direkt aus DragServer
-
- sal_uInt16 nCount = DragServer::GetItemCount();
- for ( sal_uInt16 i = 0; i < nCount && !aFileName.Len(); ++i )
- if (DragServer::HasFormat( i, FORMAT_FILE ))
- aFileName = DragServer::PasteFile( i );
- }
-
- if ( aFileName.Len() )
- bReturn = aLbEntries.LoadFile( aFileName );
- }
- return bReturn;
-}
-
-sal_Bool __EXPORT ScNavigatorDlg::QueryDrop( DropEvent& rEvt )
-{
- sal_Bool bReturn = sal_False;
-
- if ( !aLbEntries.IsInDrag() ) // kein Verschieben innerhalb der TreeListBox
- {
- SvScDataObjectRef pObject = SvScDataObject::PasteDragServer(rEvt);
- if ( pObject->HasFormat(FORMAT_FILE)
- || INetBookmark::HasFormat(*pObject) )
- {
- rEvt.SetAction(DROP_COPY); // Kopier-Cursor anzeigen
- bReturn = sal_True;
- }
- }
-
- return bReturn;
-}
-#endif
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/navipi/navipi.hrc b/sc/source/ui/navipi/navipi.hrc
index 0adb65a5a042..643435655a26 100644
--- a/sc/source/ui/navipi/navipi.hrc
+++ b/sc/source/ui/navipi/navipi.hrc
@@ -26,8 +26,6 @@
************************************************************************/
#include "sc.hrc"
-//#define RID_SCDLG_NAVIGATOR 256
-
#define FT_ROW 1
#define ED_ROW 2
#define FT_COL 3
@@ -41,13 +39,9 @@
#define STR_NOTACTIVE 11
#define STR_HIDDEN 12
#define STR_ACTIVEWIN 13
-//#define IMG_ENTRIES 14
#define STR_QHLP_SCEN_LISTBOX 15
#define STR_QHLP_SCEN_COMMENT 16
#define IL_CMD 17
-#define ILH_CMD 18
-
-
#define IID_AREAS 1
#define IID_DBAREAS 2
@@ -59,5 +53,3 @@
#define IID_DROPMODE 9
#define IID_CHANGEROOT 10
#define IID_ZOOMOUT 11
-
-
diff --git a/sc/source/ui/navipi/navipi.src b/sc/source/ui/navipi/navipi.src
index c2e9ecb6a4e6..08e57cf4bf3c 100644
--- a/sc/source/ui/navipi/navipi.src
+++ b/sc/source/ui/navipi/navipi.src
@@ -59,23 +59,13 @@ Window RID_SCDLG_NAVIGATOR
{
SVLook = TRUE ;
HelpId = HID_SC_NAVIGATOR ;
- //? Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT ( 115 , 116 ) ;
OutputSize = TRUE ;
DialogControl = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Navigator" ;
- // Closeable = TRUE ;
- // Moveable = TRUE ;
- // Zoomable = TRUE ;
- // Sizeable = TRUE ;
- // EnableResizing = TRUE ;
- // HideWhenDeactivate = TRUE ;
- // Border = TRUE ;
- // Dockable = TRUE ;
FixedText FT_ROW
{
- // Pos = MAP_APPFONT( 2, 20 );
Pos = MAP_APPFONT ( 2 , 19 ) ;
// an kleinere Toolbox-Bitmaps angepasst
Size = MAP_APPFONT ( 19 , 10 ) ;
@@ -85,7 +75,6 @@ Window RID_SCDLG_NAVIGATOR
{
HelpId = HID_SC_NAVIPI_ROW ;
Border = TRUE ;
- // Pos = MAP_APPFONT( 31, 19 );
Pos = MAP_APPFONT ( 31 , 18 ) ;
// an kleinere Toolbox-Bitmaps angepasst
Size = MAP_APPFONT ( 30 , 12 ) ;
@@ -119,7 +108,6 @@ Window RID_SCDLG_NAVIGATOR
// "Control" braucht immer eigene HelpId
HelpId = HID_SC_NAVIPI_ENTRIES ;
Border = TRUE ;
- // Pos = MAP_APPFONT( 2, 52 );
Pos = MAP_APPFONT ( 2 , 35 ) ;
Size = MAP_APPFONT ( 110 , 100 ) ;
TabStop = TRUE ;
@@ -128,7 +116,6 @@ Window RID_SCDLG_NAVIGATOR
{
HelpId = HID_SC_NAVIPI_DOC ;
Border = TRUE ;
- // Pos = MAP_APPFONT( 2, 35 );
Pos = MAP_APPFONT ( 2 , 89 ) ;
Size = MAP_APPFONT ( 82 , 50 ) ;
TabStop = TRUE ;
@@ -141,12 +128,6 @@ Window RID_SCDLG_NAVIGATOR
MaskColor = STD_MASKCOLOR ;
SC_NAVI_CMD_IDLIST
};
- ImageList ILH_CMD
- {
- Prefix = "nah";
- MaskColor = SC_HC_MASKCOLOR ;
- SC_NAVI_CMD_IDLIST
- };
ToolBox TBX_CMD
{
Pos = MAP_APPFONT ( 66 , 3 ) ;
@@ -244,50 +225,30 @@ Window RID_SCDLG_NAVIGATOR
};
-
ImageList RID_IMAGELIST_NAVCONT
{
Prefix = "nc";
MaskColor = STD_MASKCOLOR ;
SC_NAVI_CONT_IDLIST
};
-ImageList RID_IMAGELIST_H_NAVCONT
-{
- Prefix = "nch";
- MaskColor = SC_HC_MASKCOLOR ;
- SC_NAVI_CONT_IDLIST
-};
Image RID_IMG_DROP_URL
{
- ImageBitmap = Bitmap { File = "dropurl.bmp" ; };
+ ImageBitmap = Bitmap { File = "dropurl.png" ; };
MaskColor = STD_MASKCOLOR ;
};
+
Image RID_IMG_DROP_LINK
{
- ImageBitmap = Bitmap { File = "droplink.bmp" ; };
+ ImageBitmap = Bitmap { File = "droplink.png" ; };
MaskColor = STD_MASKCOLOR ;
};
+
Image RID_IMG_DROP_COPY
{
- ImageBitmap = Bitmap { File = "dropcopy.bmp" ; };
+ ImageBitmap = Bitmap { File = "dropcopy.png" ; };
MaskColor = STD_MASKCOLOR ;
};
-Image RID_IMG_H_DROP_URL
-{
- ImageBitmap = Bitmap { File = "dropurl_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR ;
-};
-Image RID_IMG_H_DROP_LINK
-{
- ImageBitmap = Bitmap { File = "droplink_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR ;
-};
-Image RID_IMG_H_DROP_COPY
-{
- ImageBitmap = Bitmap { File = "dropcopy_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR ;
-};
// content description strings are also used in ScLinkTargetsObj
@@ -295,38 +256,47 @@ String SCSTR_CONTENT_ROOT
{
Text [ en-US ] = "Contents" ;
};
+
String SCSTR_CONTENT_TABLE
{
Text [ en-US ] = "Sheets" ;
};
+
String SCSTR_CONTENT_RANGENAME
{
Text [ en-US ] = "Range names" ;
};
+
String SCSTR_CONTENT_DBAREA
{
Text [ en-US ] = "Database Ranges" ;
};
+
String SCSTR_CONTENT_GRAPHIC
{
Text [ en-US ] = "Graphics" ;
};
+
String SCSTR_CONTENT_OLEOBJECT
{
Text [ en-US ] = "OLE objects" ;
};
+
String SCSTR_CONTENT_NOTE
{
Text [ en-US ] = "Comments" ;
};
+
String SCSTR_CONTENT_AREALINK
{
Text [ en-US ] = "Linked areas" ;
};
+
String SCSTR_CONTENT_DRAWING
{
Text [ en-US ] = "Drawing objects";
};
+
// PopupMenu -------------------------------------------------------------
Menu RID_POPUP_DROPMODE
{
@@ -352,6 +322,7 @@ Menu RID_POPUP_DROPMODE
};
};
};
+
Menu RID_POPUP_NAVIPI_SCENARIO
{
ItemList =
@@ -370,45 +341,3 @@ Menu RID_POPUP_NAVIPI_SCENARIO
};
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index a90f4513aa85..48cc2fff6c6c 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,7 +88,7 @@ void ScScenarioListBox::UpdateEntries( List* pNewEntryList )
{
// sheet contains scenarios
DBG_ASSERT( pNewEntryList->Count() % 3 == 0, "ScScenarioListBox::UpdateEntries - wrong list size" );
- SetUpdateMode( sal_False );
+ SetUpdateMode( false );
String* pEntry = static_cast< String* >( pNewEntryList->First() );
while( pEntry )
{
@@ -307,3 +308,4 @@ void ScScenarioWindow::SetSizePixel( const Size& rNewSize )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/makefile.mk b/sc/source/ui/optdlg/makefile.mk
index 52df7072ecf8..b2be3b5c02ad 100644
--- a/sc/source/ui/optdlg/makefile.mk
+++ b/sc/source/ui/optdlg/makefile.mk
@@ -32,9 +32,7 @@ TARGET=optdlg
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -43,15 +41,22 @@ CXXFILES = \
tpusrlst.cxx \
tpview.cxx \
tpcalc.cxx \
+ tpformula.cxx \
tpprint.cxx \
opredlin.cxx
SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES= \
+ $(SLO)$/opredlin.obj \
+ $(SLO)$/tpcalc.obj \
+ $(SLO)$/tpcompatibility.obj \
+ $(SLO)$/tpformula.obj \
+ $(SLO)$/tpprint.obj \
$(SLO)$/tpusrlst.obj \
- $(SLO)$/tpview.obj \
- $(SLO)$/tpcalc.obj \
- $(SLO)$/tpprint.obj \
- $(SLO)$/opredlin.obj
+ $(SLO)$/tpview.obj
+
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index a906849494e1..7648ec79cb4e 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,28 +81,16 @@ ScRedlineOptionsTabPage::ScRedlineOptionsTabPage( Window* pParent,
aRemoveColorLB.SetSelectHdl( aLk );
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-__EXPORT ScRedlineOptionsTabPage::~ScRedlineOptionsTabPage()
+ScRedlineOptionsTabPage::~ScRedlineOptionsTabPage()
{
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-SfxTabPage* __EXPORT ScRedlineOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet )
+SfxTabPage* ScRedlineOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet )
{
return new ScRedlineOptionsTabPage( pParent, rSet );
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-sal_Bool __EXPORT ScRedlineOptionsTabPage::FillItemSet( SfxItemSet& /* rSet */ )
+sal_Bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet& /* rSet */ )
{
ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
@@ -165,14 +154,10 @@ sal_Bool __EXPORT ScRedlineOptionsTabPage::FillItemSet( SfxItemSet& /* rSet */ )
if (pDocSh)
pDocSh->PostPaintGridAll();
- return sal_False;
+ return false;
}
-/*-----------------------------------------------------------------------
- Beschreibung:
- -----------------------------------------------------------------------*/
-
-void __EXPORT ScRedlineOptionsTabPage::Reset( const SfxItemSet& /* rSet */ )
+void ScRedlineOptionsTabPage::Reset( const SfxItemSet& /* rSet */ )
{
XColorTable* pColorTbl = XColorTable::GetStdColorTable();
@@ -181,10 +166,10 @@ void __EXPORT ScRedlineOptionsTabPage::Reset( const SfxItemSet& /* rSet */ )
aInsertColorLB.InsertEntry(aAuthorStr);
aRemoveColorLB.InsertEntry(aAuthorStr);
- aContentColorLB.SetUpdateMode( sal_False);
- aMoveColorLB.SetUpdateMode( sal_False);
- aInsertColorLB.SetUpdateMode( sal_False);
- aRemoveColorLB.SetUpdateMode( sal_False);
+ aContentColorLB.SetUpdateMode( false);
+ aMoveColorLB.SetUpdateMode( false);
+ aInsertColorLB.SetUpdateMode( false);
+ aRemoveColorLB.SetUpdateMode( false);
for( sal_uInt16 i = 0; i < pColorTbl->Count(); ++i )
{
@@ -236,54 +221,7 @@ void __EXPORT ScRedlineOptionsTabPage::Reset( const SfxItemSet& /* rSet */ )
IMPL_LINK( ScRedlineOptionsTabPage, ColorHdl, ColorListBox *, EMPTYARG )
{
-/*
- SvxFontPrevWindow *pPrev;
- ListBox *pLB;
-
- if (pColorLB == &aInsertColorLB)
- {
- pPrev = &aInsertPreviewWN;
- pLB = &aInsertLB;
- }
- else
- {
- pPrev = &aDeletedPreviewWN;
- pLB = &aDeletedLB;
- }
-
- SvxFont& rFont = pPrev->GetFont();
- sal_uInt16 nPos = pLB->GetSelectEntryPos();
- if (nPos == LISTBOX_ENTRY_NOTFOUND)
- nPos = 0;
-
- CharAttr *pAttr = (CharAttr *)pLB->GetEntryData(nPos);
-
- if (pAttr->nItemId == SID_ATTR_BRUSH)
- {
- rFont.SetColor(Color(COL_BLACK));
- nPos = pColorLB->GetSelectEntryPos();
- if (nPos && nPos != LISTBOX_ENTRY_NOTFOUND)
- {
- Brush aBrush(Color(pColorLB->GetSelectEntryColor()));
- pPrev->SetBrush(aBrush);
- }
- else
- {
- Brush aBrush(Color(COL_LIGHTGRAY));
- pPrev->SetBrush(aBrush);
- }
- }
- else
- {
- nPos = pColorLB->GetSelectEntryPos();
- if (nPos && nPos != LISTBOX_ENTRY_NOTFOUND)
- rFont.SetColor(pColorLB->GetEntryColor(nPos));
- else
- rFont.SetColor(Color(COL_RED));
- }
-
- pPrev->Invalidate();
-*/
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index a0ab61319e50..a969b311ddf7 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,7 +83,6 @@ ScTpCalcOptions::ScTpCalcOptions( Window* pParent,
aBtnDateStd ( this, ScResId( BTN_DATESTD ) ),
aBtnDateSc10 ( this, ScResId( BTN_DATESC10 ) ),
aBtnDate1904 ( this, ScResId( BTN_DATE1904 ) ),
- aHSeparatorFL ( this, ScResId( FL_H_SEPARATOR ) ),
aBtnCase ( this, ScResId( BTN_CASE ) ),
aBtnCalc ( this, ScResId( BTN_CALC ) ),
aBtnMatch ( this, ScResId( BTN_MATCH ) ),
@@ -106,7 +106,7 @@ ScTpCalcOptions::ScTpCalcOptions( Window* pParent,
//-----------------------------------------------------------------------
-__EXPORT ScTpCalcOptions::~ScTpCalcOptions()
+ScTpCalcOptions::~ScTpCalcOptions()
{
delete pOldOptions;
delete pLocalOptions;
@@ -125,21 +125,21 @@ void ScTpCalcOptions::Init()
//-----------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTpCalcOptions::GetRanges()
+sal_uInt16* ScTpCalcOptions::GetRanges()
{
return pCalcOptRanges;
}
//-----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTpCalcOptions::Create( Window* pParent, const SfxItemSet& rAttrSet )
+SfxTabPage* ScTpCalcOptions::Create( Window* pParent, const SfxItemSet& rAttrSet )
{
return ( new ScTpCalcOptions( pParent, rAttrSet ) );
}
//-----------------------------------------------------------------------
-void __EXPORT ScTpCalcOptions::Reset( const SfxItemSet& /* rCoreAttrs */ )
+void ScTpCalcOptions::Reset( const SfxItemSet& /* rCoreAttrs */ )
{
sal_uInt16 d,m,y;
@@ -190,7 +190,7 @@ void __EXPORT ScTpCalcOptions::Reset( const SfxItemSet& /* rCoreAttrs */ )
//-----------------------------------------------------------------------
-sal_Bool __EXPORT ScTpCalcOptions::FillItemSet( SfxItemSet& rCoreAttrs )
+sal_Bool ScTpCalcOptions::FillItemSet( SfxItemSet& rCoreAttrs )
{
// alle weiteren Optionen werden in den Handlern aktualisiert
pLocalOptions->SetIterCount( (sal_uInt16)aEdSteps.GetValue() );
@@ -212,12 +212,12 @@ sal_Bool __EXPORT ScTpCalcOptions::FillItemSet( SfxItemSet& rCoreAttrs )
return sal_True;
}
else
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
-int __EXPORT ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
+int ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
{
int nReturn = KEEP_PAGE;
@@ -291,7 +291,7 @@ IMPL_LINK( ScTpCalcOptions, CheckClickHdl, CheckBox*, pBtn )
}
else
{
- pLocalOptions->SetIter( sal_False );
+ pLocalOptions->SetIter( false );
aFtSteps.Disable(); aEdSteps.Disable();
aFtEps .Disable(); aEdEps .Disable();
}
@@ -303,3 +303,4 @@ IMPL_LINK( ScTpCalcOptions, CheckClickHdl, CheckBox*, pBtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx b/sc/source/ui/optdlg/tpcompatibility.cxx
new file mode 100644
index 000000000000..367180b5153a
--- /dev/null
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * LibreOffice - a multi-platform office productivity suite
+ *
+ * This file is part of LibreOffice.
+ *
+ * LibreOffice 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.
+ *
+ * LibreOffice 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 LibreOffice. 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_sc.hxx"
+
+#undef SC_DLLIMPLEMENTATION
+
+#include "tpcompatibility.hxx"
+#include "optdlg.hrc"
+#include "scresid.hxx"
+#include "docoptio.hxx"
+
+ScTpCompatOptions::ScTpCompatOptions(Window *pParent, const SfxItemSet &rCoreAttrs) :
+ SfxTabPage(pParent, ScResId(RID_SCPAGE_COMPATIBILITY), rCoreAttrs),
+ maFlKeyBindings(this, ScResId(FL_KEY_BINDINGS)),
+ maFtKeyBindings(this, ScResId(FT_KEY_BINDINGS)),
+ maLbKeyBindings(this, ScResId(LB_KEY_BINDINGS))
+{
+ FreeResource();
+
+ const ScTpCalcItem& rItem = static_cast<const ScTpCalcItem&>(
+ rCoreAttrs.Get(GetWhich(SID_SCDOCOPTIONS)));
+ mpOldOptions.reset(new ScDocOptions(rItem.GetDocOptions()));
+ mpNewOptions.reset(new ScDocOptions(rItem.GetDocOptions()));
+}
+
+ScTpCompatOptions::~ScTpCompatOptions()
+{
+}
+
+SfxTabPage* ScTpCompatOptions::Create(Window *pParent, const SfxItemSet &rCoreAttrs)
+{
+ return new ScTpCompatOptions(pParent, rCoreAttrs);
+}
+
+sal_Bool ScTpCompatOptions::FillItemSet(SfxItemSet &rCoreAttrs)
+{
+ ScOptionsUtil::KeyBindingType eKeyB = ScOptionsUtil::KEY_DEFAULT;
+ switch (maLbKeyBindings.GetSelectEntryPos())
+ {
+ case 0:
+ eKeyB = ScOptionsUtil::KEY_DEFAULT;
+ break;
+ case 1:
+ eKeyB = ScOptionsUtil::KEY_OOO_LEGACY;
+ break;
+ default:
+ ;
+ }
+ mpNewOptions->SetKeyBindingType(eKeyB);
+
+ if (*mpNewOptions != *mpOldOptions)
+ {
+ rCoreAttrs.Put(ScTpCalcItem(GetWhich(SID_SCDOCOPTIONS), *mpNewOptions));
+ return true;
+ }
+ else
+ return false;
+}
+
+void ScTpCompatOptions::Reset(const SfxItemSet &/*rCoreAttrs*/)
+{
+ ScOptionsUtil::KeyBindingType eKeyB = mpOldOptions->GetKeyBindingType();
+ switch (eKeyB)
+ {
+ case ScOptionsUtil::KEY_DEFAULT:
+ maLbKeyBindings.SelectEntryPos(0);
+ break;
+ case ScOptionsUtil::KEY_OOO_LEGACY:
+ maLbKeyBindings.SelectEntryPos(1);
+ break;
+ default:
+ ;
+ }
+}
+
+int ScTpCompatOptions::DeactivatePage(SfxItemSet* /*pSet*/)
+{
+ return KEEP_PAGE;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
new file mode 100644
index 000000000000..c87183e6bb33
--- /dev/null
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -0,0 +1,290 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * 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_sc.hxx"
+
+#undef SC_DLLIMPLEMENTATION
+
+
+
+//------------------------------------------------------------------
+
+#include "tpformula.hxx"
+#include "optdlg.hrc"
+#include "scresid.hxx"
+#include "formula/grammar.hxx"
+#include "docoptio.hxx"
+#include "global.hxx"
+
+#include <unotools/localedatawrapper.hxx>
+
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/i18n/LocaleDataItem.hpp>
+
+using ::rtl::OUString;
+using ::com::sun::star::lang::Locale;
+using ::com::sun::star::i18n::LocaleDataItem;
+
+ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreAttrs) :
+ SfxTabPage(pParent, ScResId(RID_SCPAGE_FORMULA), rCoreAttrs),
+
+ maFlFormulaOpt(this, ScResId(FL_FORMULA_OPTIONS)),
+ maFtFormulaSyntax(this, ScResId(FT_FORMULA_SYNTAX)),
+ maLbFormulaSyntax(this, ScResId(LB_FORMULA_SYNTAX)),
+ maCbEnglishFuncName(this, ScResId(CB_ENGLISH_FUNC_NAME)),
+ maFlFormulaSeps(this, ScResId(FL_FORMULA_SEPS)),
+ maFtSepFuncArg(this, ScResId(FT_FORMULA_SEP_ARG)),
+ maEdSepFuncArg(this, ScResId(ED_FORMULA_SEP_ARG)),
+ maFtSepArrayCol(this, ScResId(FT_FORMULA_SEP_ARRAY_C)),
+ maEdSepArrayCol(this, ScResId(ED_FORMULA_SEP_ARRAY_C)),
+ maFtSepArrayRow(this, ScResId(FT_FORMULA_SEP_ARRAY_R)),
+ maEdSepArrayRow(this, ScResId(ED_FORMULA_SEP_ARRAY_R)),
+ maBtnSepReset(this, ScResId(BTN_FORMULA_SEP_RESET)),
+
+ mpOldOptions(NULL),
+ mpNewOptions(NULL),
+ mnDecSep(0)
+{
+ FreeResource();
+
+ const ScTpCalcItem& rItem = static_cast<const ScTpCalcItem&>(
+ rCoreAttrs.Get(GetWhich(SID_SCDOCOPTIONS)));
+ mpOldOptions.reset(new ScDocOptions(rItem.GetDocOptions()));
+ mpNewOptions.reset(new ScDocOptions(rItem.GetDocOptions()));
+
+ Init();
+}
+
+ScTpFormulaOptions::~ScTpFormulaOptions()
+{
+}
+
+void ScTpFormulaOptions::Init()
+{
+ Link aLink = LINK( this, ScTpFormulaOptions, ButtonHdl );
+ maBtnSepReset.SetClickHdl(aLink);
+
+ aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl );
+ maEdSepFuncArg.SetModifyHdl(aLink);
+ maEdSepArrayCol.SetModifyHdl(aLink);
+ maEdSepArrayRow.SetModifyHdl(aLink);
+
+ aLink = LINK( this, ScTpFormulaOptions, SepEditOnFocusHdl );
+ maEdSepFuncArg.SetGetFocusHdl(aLink);
+ maEdSepArrayCol.SetGetFocusHdl(aLink);
+ maEdSepArrayRow.SetGetFocusHdl(aLink);
+
+ // Get the decimal separator for current locale.
+ String aSep = mpOldOptions->GetLocaleDataWrapper().getNumDecimalSep();
+ mnDecSep = aSep.Len() ? aSep.GetChar(0) : sal_Unicode('.');
+}
+
+void ScTpFormulaOptions::ResetSeparators()
+{
+ ScDocOptions aOpt;
+ maEdSepFuncArg.SetText(aOpt.GetFormulaSepArg());
+ maEdSepArrayCol.SetText(aOpt.GetFormulaSepArrayCol());
+ maEdSepArrayRow.SetText(aOpt.GetFormulaSepArrayRow());
+}
+
+void ScTpFormulaOptions::OnFocusSeparatorInput(Edit* pEdit)
+{
+ if (!pEdit)
+ return;
+
+ // Make sure the entire text is selected.
+ xub_StrLen nLen = pEdit->GetText().Len();
+ Selection aSel(0, nLen);
+ pEdit->SetSelection(aSel);
+ maOldSepValue = pEdit->GetText();
+}
+
+bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const
+{
+ if (rSep.getLength() != 1)
+ // Must be one-character long.
+ return false;
+
+ if (rSep.compareToAscii("a") >= 0 && rSep.compareToAscii("z") <= 0)
+ return false;
+
+ if (rSep.compareToAscii("A") >= 0 && rSep.compareToAscii("Z") <= 0)
+ return false;
+
+ sal_Unicode c = rSep.getStr()[0];
+ switch (c)
+ {
+ case '+':
+ case '-':
+ case '/':
+ case '*':
+ case '<':
+ case '>':
+ case '[':
+ case ']':
+ case '(':
+ case ')':
+ case '"':
+ case '\'':
+ // Disallowed characters. Anything else we want to disallow ?
+ return false;
+ }
+
+ if (c == mnDecSep)
+ // decimal separator is not allowed.
+ return false;
+
+ return true;
+}
+
+bool ScTpFormulaOptions::IsValidSeparatorSet() const
+{
+ // Make sure the column and row separators are different.
+ String aColStr = maEdSepArrayCol.GetText();
+ String aRowStr = maEdSepArrayRow.GetText();
+ if (aColStr == aRowStr)
+ return false;
+
+ return true;
+}
+
+IMPL_LINK( ScTpFormulaOptions, ButtonHdl, PushButton*, pBtn )
+{
+ if (pBtn == &maBtnSepReset)
+ ResetSeparators();
+
+ return 0;
+}
+
+IMPL_LINK( ScTpFormulaOptions, SepModifyHdl, Edit*, pEdit )
+{
+ if (!pEdit)
+ return 0;
+
+ String aStr = pEdit->GetText();
+ if (aStr.Len() > 1)
+ {
+ // In case the string is more than one character long, only grab the
+ // first character.
+ aStr = aStr.Copy(0, 1);
+ pEdit->SetText(aStr);
+ }
+
+ if ((!IsValidSeparator(aStr) || !IsValidSeparatorSet()) && maOldSepValue.getLength())
+ // Invalid separator. Restore the old value.
+ pEdit->SetText(maOldSepValue);
+
+ OnFocusSeparatorInput(pEdit);
+ return 0;
+}
+
+IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Edit*, pEdit )
+{
+ OnFocusSeparatorInput(pEdit);
+ return 0;
+}
+
+SfxTabPage* ScTpFormulaOptions::Create(Window* pParent, const SfxItemSet& rCoreSet)
+{
+ return new ScTpFormulaOptions(pParent, rCoreSet);
+}
+
+sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet)
+{
+ ::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT;
+ switch (maLbFormulaSyntax.GetSelectEntryPos())
+ {
+ case 0:
+ eGram = ::formula::FormulaGrammar::GRAM_NATIVE;
+ break;
+ case 1:
+ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1;
+ break;
+ case 2:
+ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1;
+ break;
+ }
+
+ mpNewOptions->SetFormulaSyntax(eGram);
+ mpNewOptions->SetUseEnglishFuncName(maCbEnglishFuncName.IsChecked());
+ mpNewOptions->SetFormulaSepArg(maEdSepFuncArg.GetText());
+ mpNewOptions->SetFormulaSepArrayCol(maEdSepArrayCol.GetText());
+ mpNewOptions->SetFormulaSepArrayRow(maEdSepArrayRow.GetText());
+
+ if (*mpNewOptions != *mpOldOptions)
+ {
+ rCoreSet.Put(ScTpCalcItem(GetWhich(SID_SCDOCOPTIONS), *mpNewOptions));
+ return true;
+ }
+ else
+ return false;
+}
+
+void ScTpFormulaOptions::Reset(const SfxItemSet& /*rCoreSet*/)
+{
+ ::formula::FormulaGrammar::Grammar eGram = mpNewOptions->GetFormulaSyntax();
+ switch (eGram)
+ {
+ case ::formula::FormulaGrammar::GRAM_NATIVE:
+ maLbFormulaSyntax.SelectEntryPos(0);
+ break;
+ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1:
+ maLbFormulaSyntax.SelectEntryPos(1);
+ break;
+ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1:
+ maLbFormulaSyntax.SelectEntryPos(2);
+ break;
+ default:
+ maLbFormulaSyntax.SelectEntryPos(0);
+ }
+
+ maCbEnglishFuncName.Check(mpNewOptions->GetUseEnglishFuncName());
+
+ OUString aSep = mpNewOptions->GetFormulaSepArg();
+ OUString aSepArrayRow = mpNewOptions->GetFormulaSepArrayRow();
+ OUString aSepArrayCol = mpNewOptions->GetFormulaSepArrayCol();
+
+ if (aSep.getLength() == 1 && aSepArrayRow.getLength() == 1 && aSepArrayCol.getLength() == 1)
+ {
+ // Each separator must be one character long.
+ maEdSepFuncArg.SetText(aSep);
+ maEdSepArrayCol.SetText(aSepArrayCol);
+ maEdSepArrayRow.SetText(aSepArrayRow);
+ }
+ else
+ ResetSeparators();
+}
+
+int ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/)
+{
+ // What's this method for ?
+ return KEEP_PAGE;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index 636f9f8a931d..29fd59c5309b 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,7 +93,7 @@ void ScTpPrintOptions::Reset( const SfxItemSet& rCoreSet )
ScPrintOptions aOptions;
const SfxPoolItem* pItem;
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SCPRINTOPTIONS, sal_False , &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SCPRINTOPTIONS, false , &pItem))
aOptions = ((const ScTpPrintItem*)pItem)->GetPrintOptions();
else
{
@@ -100,7 +101,7 @@ void ScTpPrintOptions::Reset( const SfxItemSet& rCoreSet )
aOptions = SC_MOD()->GetPrintOptions();
}
- if ( SFX_ITEM_SET == rCoreSet.GetItemState( SID_PRINT_SELECTEDSHEET, sal_False , &pItem ) )
+ if ( SFX_ITEM_SET == rCoreSet.GetItemState( SID_PRINT_SELECTEDSHEET, false , &pItem ) )
{
sal_Bool bChecked = ( (const SfxBoolItem*)pItem )->GetValue();
aSelectedSheetsCB.Check( bChecked );
@@ -138,7 +139,8 @@ sal_Bool ScTpPrintOptions::FillItemSet( SfxItemSet& rCoreAttrs )
}
else
{
- return sal_False;
+ return false;
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 535e60e72f28..6761f313e38c 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,10 +31,7 @@
#undef SC_DLLIMPLEMENTATION
-
-
//------------------------------------------------------------------
-
#include <vcl/msgbox.hxx>
#include "global.hxx"
@@ -53,11 +51,6 @@
#include "tpusrlst.hxx"
#undef _TPUSRLST_CXX
-//CHINA001 #include "scui_def.hxx" //CHINA001
-//CHINA001 #include "scresid.hxx" //add by CHINA001
-//CHINA001 #include "miscdlgs.hrc" //add by CHINA001
-//CHINA001
-//CHINA001 #include "scabstdlg.hxx" //CHINA001
// STATIC DATA -----------------------------------------------------------
#define CR (sal_Unicode)13
@@ -101,15 +94,14 @@ ScTpUserLists::ScTpUserLists( Window* pParent,
aStrCopyList ( ScResId( STR_COPYLIST ) ),
aStrCopyFrom ( ScResId( STR_COPYFROM ) ),
aStrCopyErr ( ScResId( STR_COPYERR ) ),
- //
nWhichUserLists ( GetWhich( SID_SCUSERLISTS ) ),
pUserLists ( NULL ),
pDoc ( NULL ),
pViewData ( NULL ),
pRangeUtil ( new ScRangeUtil ),
- bModifyMode ( sal_False ),
- bCancelMode ( sal_False ),
- bCopyDone ( sal_False ),
+ bModifyMode ( false ),
+ bCancelMode ( false ),
+ bCopyDone ( false ),
nCancelPos ( 0 )
{
SetExchangeSupport();
@@ -119,7 +111,7 @@ ScTpUserLists::ScTpUserLists( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScTpUserLists::~ScTpUserLists()
+ScTpUserLists::~ScTpUserLists()
{
delete pUserLists;
delete pRangeUtil;
@@ -171,27 +163,25 @@ void ScTpUserLists::Init()
aFtCopyFrom.Disable();
aEdCopyFrom.Disable();
}
-
-// aLbLists.GrabFocus();
}
// -----------------------------------------------------------------------
-sal_uInt16* __EXPORT ScTpUserLists::GetRanges()
+sal_uInt16* ScTpUserLists::GetRanges()
{
return pUserListsRanges;
}
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScTpUserLists::Create( Window* pParent, const SfxItemSet& rAttrSet )
+SfxTabPage* ScTpUserLists::Create( Window* pParent, const SfxItemSet& rAttrSet )
{
return ( new ScTpUserLists( pParent, rAttrSet ) );
}
// -----------------------------------------------------------------------
-void __EXPORT ScTpUserLists::Reset( const SfxItemSet& rCoreAttrs )
+void ScTpUserLists::Reset( const SfxItemSet& rCoreAttrs )
{
const ScUserListItem& rUserListItem = (const ScUserListItem&)
rCoreAttrs.Get( nWhichUserLists );
@@ -236,13 +226,11 @@ void __EXPORT ScTpUserLists::Reset( const SfxItemSet& rCoreAttrs )
aEdCopyFrom .Enable();
aBtnCopy .Enable();
}
-
-// aLbLists.GrabFocus();
}
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScTpUserLists::FillItemSet( SfxItemSet& rCoreAttrs )
+sal_Bool ScTpUserLists::FillItemSet( SfxItemSet& rCoreAttrs )
{
// Modifikationen noch nicht uebernommen?
// -> Click auf Add-Button simulieren
@@ -254,11 +242,11 @@ sal_Bool __EXPORT ScTpUserLists::FillItemSet( SfxItemSet& rCoreAttrs )
GetItemSet().Get( nWhichUserLists );
ScUserList* pCoreList = rUserListItem.GetUserList();
- sal_Bool bDataModified = sal_False;
+ sal_Bool bDataModified = false;
if ( (pUserLists == NULL) && (pCoreList == NULL) )
{
- bDataModified = sal_False;
+ bDataModified = false;
}
else if ( pUserLists != NULL )
{
@@ -283,7 +271,7 @@ sal_Bool __EXPORT ScTpUserLists::FillItemSet( SfxItemSet& rCoreAttrs )
// -----------------------------------------------------------------------
-int __EXPORT ScTpUserLists::DeactivatePage( SfxItemSet* pSetP )
+int ScTpUserLists::DeactivatePage( SfxItemSet* pSetP )
{
if ( pSetP )
FillItemSet( *pSetP );
@@ -343,7 +331,7 @@ void ScTpUserLists::UpdateEntries( sal_uInt16 nList )
}
else
{
- DBG_ERROR( "Invalid ListIndex :-/" );
+ OSL_FAIL( "Invalid ListIndex :-/" );
}
}
@@ -358,7 +346,6 @@ void ScTpUserLists::MakeListStr( String& rListStr )
xub_StrLen c = 0;
aInputStr.ConvertLineEnd( LINEEND_LF );
- //aStr.EraseAllChars( ' ' );
xub_StrLen nToken=rListStr.GetTokenCount(LF);
@@ -371,18 +358,6 @@ void ScTpUserLists::MakeListStr( String& rListStr )
aStr+=cDelimiter;
}
- /*
- // '\n' durch cDelimiter ersetzen:
- for ( c=0;
- (c < nLen) && (nFound != STRING_NOTFOUND);
- c++ )
- {
- nFound = aStr.Search( LF, nFound );
- if ( nFound != STRING_NOTFOUND )
- aStr[nFound] = cDelimiter;
- }
- */
-
aStr.EraseLeadingChars( cDelimiter );
aStr.EraseTrailingChars( cDelimiter );
nLen = aStr.Len();
@@ -420,7 +395,7 @@ void ScTpUserLists::AddNewList( const String& rEntriesStr )
if ( !pUserLists->Insert( new ScUserListData( theEntriesStr ) ) )
{
- DBG_ERROR( "Entry could not be inserted :-/" );
+ OSL_FAIL( "Entry could not be inserted :-/" );
}
}
@@ -439,18 +414,11 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos,
SCCOL nEndCol = rEndPos.Col();
SCROW nEndRow = rEndPos.Row();
sal_uInt16 nCellDir = SCRET_COLS;
- sal_Bool bValueIgnored = sal_False;
+ sal_Bool bValueIgnored = false;
if ( (nStartCol != nEndCol) && (nStartRow != nEndRow) )
{
nCellDir = ScColOrRowDlg( this, aStrCopyList, aStrCopyFrom ).Execute();
-//CHINA001 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
-//CHINA001 DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
-//CHINA001
-//CHINA001 VclAbstractDialog* pDlg = pFact->CreateScColOrRowDlg( this, aStrCopyList, aStrCopyFrom,ResId(RID_SCDLG_COLORROW) );
-//CHINA001 DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
-//CHINA001 nCellDir = pDlg->Execute();
-//CHINA001 delete pDlg; //CHINA001
}
else if ( nStartCol != nEndCol )
nCellDir = SCRET_ROWS;
@@ -624,8 +592,8 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
aEdCopyFrom.Enable();
}
aBtnNew.SetText( aStrNew );
- bCancelMode = sal_False;
- bModifyMode = sal_False;
+ bCancelMode = false;
+ bModifyMode = false;
}
}
else if ( pBtn == &aBtnAdd )
@@ -657,7 +625,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
aBtnAdd.Disable();
aBtnRemove.Enable();
aBtnNew.SetText( aStrNew );
- bCancelMode = sal_False;
+ bCancelMode = false;
}
else // if ( bModifyMode )
{
@@ -677,8 +645,8 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
LbSelectHdl( &aLbLists );
}
- aBtnNew.SetText( aStrNew ); bCancelMode = sal_False;
- aBtnAdd.SetText( aStrAdd ); bModifyMode = sal_False;
+ aBtnNew.SetText( aStrNew ); bCancelMode = false;
+ aBtnAdd.SetText( aStrAdd ); bModifyMode = false;
aBtnAdd.Disable();
aBtnRemove.Enable();
aFtLists.Enable();
@@ -748,7 +716,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
ScRefAddress theStartPos;
ScRefAddress theEndPos;
String theAreaStr( aEdCopyFrom.GetText() );
- sal_Bool bAreaOk = sal_False;
+ sal_Bool bAreaOk = false;
if ( theAreaStr.Len() > 0 )
{
@@ -837,3 +805,4 @@ IMPL_LINK( ScTpUserLists, EdEntriesModHdl, MultiLineEdit*, pEd )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index a8bad6b3ded0..79ec3116762f 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,10 +57,6 @@
-/*-----------------11.01.97 10.52-------------------
- Optionen Inhalte
---------------------------------------------------*/
-
ScTpContentOptions::ScTpContentOptions( Window* pParent,
const SfxItemSet& rArgSet ) :
SfxTabPage(pParent, ScResId( RID_SCPAGE_CONTENT ), rArgSet),
@@ -132,29 +129,21 @@ ScTpContentOptions::ScTpContentOptions( Window* pParent,
aGridCB .SetClickHdl( LINK( this, ScTpContentOptions, GridHdl ) );
}
-/*-----------------11.01.97 10.52-------------------
-
---------------------------------------------------*/
ScTpContentOptions::~ScTpContentOptions()
{
delete pLocalOptions;
}
-/*-----------------11.01.97 10.52-------------------
-
---------------------------------------------------*/
SfxTabPage* ScTpContentOptions::Create( Window* pParent,
const SfxItemSet& rCoreSet )
{
return new ScTpContentOptions(pParent, rCoreSet);
}
-/*-----------------11.01.97 10.52-------------------
---------------------------------------------------*/
sal_Bool ScTpContentOptions::FillItemSet( SfxItemSet& rCoreSet )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
if( aFormulaCB .GetSavedValue() != aFormulaCB .IsChecked() ||
aNilCB .GetSavedValue() != aNilCB .IsChecked() ||
aAnnotCB .GetSavedValue() != aAnnotCB .IsChecked() ||
@@ -195,14 +184,11 @@ sal_Bool ScTpContentOptions::FillItemSet( SfxItemSet& rCoreSet )
return bRet;
}
-/*-----------------11.01.97 10.53-------------------
-
---------------------------------------------------*/
void ScTpContentOptions::Reset( const SfxItemSet& rCoreSet )
{
const SfxPoolItem* pItem;
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SCVIEWOPTIONS, sal_False , &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SCVIEWOPTIONS, false , &pItem))
pLocalOptions = new ScViewOptions(
((const ScTpViewItem*)pItem)->GetViewOptions() );
else
@@ -231,9 +217,9 @@ void ScTpContentOptions::Reset( const SfxItemSet& rCoreSet )
aHandleCB.Check( !pLocalOptions->GetOption(VOPT_SOLIDHANDLES) ); // inverted
aBigHandleCB.Check( pLocalOptions->GetOption(VOPT_BIGHANDLES) );
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_RANGEFINDER, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_RANGEFINDER, false, &pItem))
aRangeFindCB.Check(((const SfxBoolItem*)pItem)->GetValue());
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_OPT_SYNCZOOM, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_OPT_SYNCZOOM, false, &pItem))
aSyncZoomCB.Check(((const SfxBoolItem*)pItem)->GetValue());
aRangeFindCB.SaveValue();
@@ -260,19 +246,13 @@ void ScTpContentOptions::Reset( const SfxItemSet& rCoreSet )
aHandleCB .SaveValue();
aBigHandleCB .SaveValue();
}
-/*-----------------11.01.97 12.45-------------------
-
---------------------------------------------------*/
void ScTpContentOptions::ActivatePage( const SfxItemSet& rSet)
{
const SfxPoolItem* pItem;
- if(SFX_ITEM_SET == rSet.GetItemState(SID_SCVIEWOPTIONS, sal_False , &pItem))
+ if(SFX_ITEM_SET == rSet.GetItemState(SID_SCVIEWOPTIONS, false , &pItem))
*pLocalOptions = ((const ScTpViewItem*)pItem)->GetViewOptions();
}
-/*-----------------11.01.97 12.45-------------------
-
---------------------------------------------------*/
int ScTpContentOptions::DeactivatePage( SfxItemSet* pSetP )
{
@@ -280,9 +260,6 @@ int ScTpContentOptions::DeactivatePage( SfxItemSet* pSetP )
FillItemSet(*pSetP);
return SfxTabPage::LEAVE_PAGE;
}
-/*-----------------11.01.97 13.43-------------------
-
---------------------------------------------------*/
IMPL_LINK( ScTpContentOptions, SelLbObjHdl, ListBox*, pLb )
{
@@ -300,10 +277,6 @@ IMPL_LINK( ScTpContentOptions, SelLbObjHdl, ListBox*, pLb )
return 0;
}
-/*-----------------11.01.97 14.25-------------------
-
---------------------------------------------------*/
-
IMPL_LINK( ScTpContentOptions, CBHdl, CheckBox*, pBtn )
{
ScViewOption eOption = VOPT_FORMULAS;
@@ -334,9 +307,6 @@ IMPL_LINK( ScTpContentOptions, CBHdl, CheckBox*, pBtn )
return 0;
}
-/*-----------------11.01.97 13.13-------------------
-
---------------------------------------------------*/
void ScTpContentOptions::InitGridOpt()
{
@@ -372,7 +342,7 @@ void ScTpContentOptions::InitGridOpt()
//------------------------------------------------------
- aColorLB.SetUpdateMode( sal_False );
+ aColorLB.SetUpdateMode( false );
// Eintraege aus der Colortable
@@ -395,7 +365,7 @@ void ScTpContentOptions::InitGridOpt()
Invalidate();
}
- // #79720# also select grid color entry on subsequent calls
+ // also select grid color entry on subsequent calls
String aName;
Color aCol = pLocalOptions->GetGridColor( &aName );
@@ -406,9 +376,6 @@ void ScTpContentOptions::InitGridOpt()
else
aColorLB.SelectEntryPos( aColorLB.InsertEntry( aCol, aName ) );
}
-/*-----------------11.01.97 13.40-------------------
-
---------------------------------------------------*/
IMPL_LINK( ScTpContentOptions, GridHdl, CheckBox*, pBox )
{
@@ -418,9 +385,6 @@ IMPL_LINK( ScTpContentOptions, GridHdl, CheckBox*, pBox )
pLocalOptions->SetOption( VOPT_GRID, bChecked );
return 0;
}
-/*-----------------11.01.97 10.53-------------------
-
---------------------------------------------------*/
ScTpLayoutOptions::ScTpLayoutOptions( Window* pParent,
const SfxItemSet& rArgSet ) :
@@ -484,16 +448,10 @@ ScTpLayoutOptions::ScTpLayoutOptions( Window* pParent,
}
}
-/*-----------------11.01.97 10.53-------------------
-
---------------------------------------------------*/
ScTpLayoutOptions::~ScTpLayoutOptions()
{
}
-/*-----------------11.01.97 10.53-------------------
-
---------------------------------------------------*/
SfxTabPage* ScTpLayoutOptions::Create( Window* pParent,
const SfxItemSet& rCoreSet )
@@ -505,9 +463,6 @@ SfxTabPage* ScTpLayoutOptions::Create( Window* pParent,
pNew->SetDocument(pDocSh->GetDocument());
return pNew;
}
-/*-----------------11.01.97 10.53-------------------
-
---------------------------------------------------*/
sal_Bool ScTpLayoutOptions::FillItemSet( SfxItemSet& rCoreSet )
{
@@ -600,9 +555,6 @@ sal_Bool ScTpLayoutOptions::FillItemSet( SfxItemSet& rCoreSet )
return bRet;
}
-/*-----------------11.01.97 10.53-------------------
-
---------------------------------------------------*/
void ScTpLayoutOptions::Reset( const SfxItemSet& rCoreSet )
{
@@ -625,7 +577,7 @@ void ScTpLayoutOptions::Reset( const SfxItemSet& rCoreSet )
aUnitLB.SaveValue();
const SfxPoolItem* pItem;
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_ATTR_DEFTABSTOP, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem))
aTabMF.SetValue(aTabMF.Normalize(((SfxUInt16Item*)pItem)->GetValue()), FUNIT_TWIP);
aTabMF.SaveValue();
@@ -655,29 +607,29 @@ void ScTpLayoutOptions::Reset( const SfxItemSet& rCoreSet )
// added to avoid warnings
}
}
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_SELECTION, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_SELECTION, false, &pItem))
aAlignCB.Check(((const SfxBoolItem*)pItem)->GetValue());
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_SELECTIONPOS, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_SELECTIONPOS, false, &pItem))
aAlignLB.SelectEntryPos(((const SfxUInt16Item*)pItem)->GetValue());
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_EDITMODE, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_EDITMODE, false, &pItem))
aEditModeCB.Check(((const SfxBoolItem*)pItem)->GetValue());
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_FMT_EXPAND, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_FMT_EXPAND, false, &pItem))
aFormatCB.Check(((const SfxBoolItem*)pItem)->GetValue());
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_REF_EXPAND, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_REF_EXPAND, false, &pItem))
aExpRefCB.Check(((const SfxBoolItem*)pItem)->GetValue());
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_MARK_HEADER, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_MARK_HEADER, false, &pItem))
aMarkHdrCB.Check(((const SfxBoolItem*)pItem)->GetValue());
- if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_TEXTWYSIWYG, sal_False, &pItem))
+ if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_TEXTWYSIWYG, false, &pItem))
aTextFmtCB.Check(((const SfxBoolItem*)pItem)->GetValue());
- if( SFX_ITEM_SET == rCoreSet.GetItemState( SID_SC_INPUT_REPLCELLSWARN, sal_False, &pItem ) )
+ if( SFX_ITEM_SET == rCoreSet.GetItemState( SID_SC_INPUT_REPLCELLSWARN, false, &pItem ) )
aReplWarnCB.Check( ( (const SfxBoolItem*)pItem)->GetValue() );
aAlignCB .SaveValue();
@@ -696,16 +648,9 @@ void ScTpLayoutOptions::Reset( const SfxItemSet& rCoreSet )
aRequestRB.SaveValue();
}
-/*-----------------11.01.97 12.46-------------------
-
---------------------------------------------------*/
-
void ScTpLayoutOptions::ActivatePage( const SfxItemSet& /* rCoreSet */ )
{
}
-/*-----------------11.01.97 12.46-------------------
-
---------------------------------------------------*/
int ScTpLayoutOptions::DeactivatePage( SfxItemSet* pSetP )
{
@@ -714,11 +659,6 @@ int ScTpLayoutOptions::DeactivatePage( SfxItemSet* pSetP )
return SfxTabPage::LEAVE_PAGE;
}
-
-/*-----------------13.01.97 14.44-------------------
- Metric des Deftabstops umschalten
---------------------------------------------------*/
-
IMPL_LINK(ScTpLayoutOptions, MetricHdl, ListBox*, EMPTYARG)
{
const sal_uInt16 nMPos = aUnitLB.GetSelectEntryPos();
@@ -733,9 +673,7 @@ IMPL_LINK(ScTpLayoutOptions, MetricHdl, ListBox*, EMPTYARG)
return 0;
}
-/*-----------------11.01.97 15.30-------------------
---------------------------------------------------*/
IMPL_LINK( ScTpLayoutOptions, AlignHdl, CheckBox*, pBox )
{
aAlignLB.Enable(pBox->IsChecked());
@@ -743,3 +681,4 @@ IMPL_LINK( ScTpLayoutOptions, AlignHdl, CheckBox*, pBox )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index 719f954ed594..7b73e7e56599 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,6 +69,8 @@ const sal_uInt16 SC_AREASDLG_RR_OFFSET = 2;
//============================================================================
+using ::rtl::OUString;
+
#define HDL(hdl) LINK( this, ScPrintAreasDlg, hdl )
#define ERRORBOX(nId) ErrorBox( this, WinBits(WB_OK|WB_DEF_OK), \
ScGlobal::GetRscString( nId ) ).Execute()
@@ -75,10 +78,17 @@ const sal_uInt16 SC_AREASDLG_RR_OFFSET = 2;
// globale Funktionen (->am Ende der Datei):
-bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange );
-void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr );
+bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange );
+void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr );
+void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, OUString& rStr )
+{
+ String aStr;
+ lcl_GetRepeatRangeString(pRange, pDoc, bIsRow, aStr);
+ rStr = aStr;
+}
#if 0
+// this method is useful when debugging address flags.
static void printAddressFlags(sal_uInt16 nFlag)
{
if ((nFlag & SCA_COL_ABSOLUTE ) == SCA_COL_ABSOLUTE ) printf("SCA_COL_ABSOLUTE \n");
@@ -131,7 +141,7 @@ ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, Window*
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
//
- bDlgLostFocus ( sal_False ),
+ bDlgLostFocus ( false ),
pRefInputEdit ( &aEdPrintArea ),
pDoc ( NULL ),
pViewData ( NULL ),
@@ -209,9 +219,6 @@ void ScPrintAreasDlg::SetReference( const ScRange& rRef, ScDocument* /* pDoc */
if ( &aEdPrintArea == pRefInputEdit )
{
rRef.Format( aStr, SCR_ABS, pDoc, eConv );
-
-// aEdPrintArea.ReplaceSelected( aStr );
-
String aVal = aEdPrintArea.GetText();
Selection aSel = aEdPrintArea.GetSelection();
aSel.Justify();
@@ -266,7 +273,7 @@ void ScPrintAreasDlg::SetActive()
{
if ( bDlgLostFocus )
{
- bDlgLostFocus = sal_False;
+ bDlgLostFocus = false;
if ( pRefInputEdit )
{
@@ -376,7 +383,7 @@ sal_Bool ScPrintAreasDlg::Impl_GetItem( Edit* pEd, SfxStringItem& rItem )
sal_Bool ScPrintAreasDlg::Impl_CheckRefStrings()
{
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
String aStrPrintArea = aEdPrintArea.GetText();
String aStrRepeatRow = aEdRepeatRow.GetText();
String aStrRepeatCol = aEdRepeatCol.GetText();
@@ -388,7 +395,6 @@ sal_Bool ScPrintAreasDlg::Impl_CheckRefStrings()
const sal_uInt16 nValidRange = nValidAddr | SCA_VALID_ROW2 | SCA_VALID_COL2;
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
const sal_Unicode sep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
- // const sal_Unicode rsep = ScCompiler::GetNativeSymbol(ocRange).GetChar(0);
ScAddress aAddr;
ScRange aRange;
@@ -401,7 +407,7 @@ sal_Bool ScPrintAreasDlg::Impl_CheckRefStrings()
{
sal_uInt16 nAddrResult = aAddr.Parse( aOne, pDoc, eConv );
if ((nAddrResult & nValidAddr) != nValidAddr)
- bPrintAreaOk = sal_False;
+ bPrintAreaOk = false;
}
}
}
@@ -427,7 +433,11 @@ sal_Bool ScPrintAreasDlg::Impl_CheckRefStrings()
else if ( !bRepeatColOk ) pEd = &aEdRepeatCol;
ERRORBOX( STR_INVALID_TABREF );
- pEd->GrabFocus();
+
+ OSL_ASSERT(pEd);
+
+ if (pEd)
+ pEd->GrabFocus();
}
return bOk;
@@ -455,7 +465,7 @@ void ScPrintAreasDlg::Impl_FillLists()
else
{
ScRangeListRef aList( new ScRangeList );
- pViewData->GetMarkData().FillRangeListWithMarks( aList, sal_False );
+ pViewData->GetMarkData().FillRangeListWithMarks( aList, false );
aList->Format( aStrRange, SCR_ABS, pDoc, eConv );
}
@@ -464,54 +474,45 @@ void ScPrintAreasDlg::Impl_FillLists()
//------------------------------------------------------
// Ranges holen und in ListBoxen merken
//------------------------------------------------------
- ScRangeName* pRangeNames = pDoc->GetRangeName();
- const sal_uInt16 nCount = pRangeNames ? pRangeNames->GetCount() : 0;
+ ScRangeName* pRangeNames = pDoc->GetRangeName();
+
+ if (!pRangeNames || pRangeNames->empty())
+ // No range names to process.
+ return;
- if ( nCount > 0 )
+ ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ for (; itr != itrEnd; ++itr)
{
- String aName;
- String aSymbol;
-// ScRange aRange;
- ScRangeData* pData = NULL;
+ if (!itr->HasType(RT_ABSAREA) && !itr->HasType(RT_REFAREA) && !itr->HasType(RT_ABSPOS))
+ continue;
- for ( sal_uInt16 i=0; i<nCount; i++ )
+ OUString aName = itr->GetName();
+ OUString aSymbol;
+ itr->GetSymbol(aSymbol);
+ if (aRange.ParseAny(aSymbol, pDoc, eConv) & SCA_VALID)
{
- pData = (ScRangeData*)(pRangeNames->At( i ));
- if ( pData )
+ if (itr->HasType(RT_PRINTAREA))
{
- if ( pData->HasType( RT_ABSAREA )
- || pData->HasType( RT_REFAREA )
- || pData->HasType( RT_ABSPOS ) )
- {
- pData->GetName( aName );
- pData->GetSymbol( aSymbol );
- if ( aRange.ParseAny( aSymbol, pDoc, eConv ) & SCA_VALID )
- {
- if ( pData->HasType( RT_PRINTAREA ) )
- {
- aRange.Format( aSymbol, SCR_ABS, pDoc, eConv );
- aLbPrintArea.SetEntryData(
- aLbPrintArea.InsertEntry( aName ),
- new String( aSymbol ) );
- }
-
- if ( pData->HasType( RT_ROWHEADER ) )
- {
- lcl_GetRepeatRangeString(&aRange, pDoc, true, aSymbol);
- aLbRepeatRow.SetEntryData(
- aLbRepeatRow.InsertEntry( aName ),
- new String( aSymbol ) );
- }
-
- if ( pData->HasType( RT_COLHEADER ) )
- {
- lcl_GetRepeatRangeString(&aRange, pDoc, false, aSymbol);
- aLbRepeatCol.SetEntryData(
- aLbRepeatCol.InsertEntry( aName ),
- new String( aSymbol ) );
- }
- }
- }
+ aRange.Format(aSymbol, SCR_ABS, pDoc, eConv);
+ aLbPrintArea.SetEntryData(
+ aLbPrintArea.InsertEntry(aName),
+ new String(aSymbol) );
+ }
+
+ if (itr->HasType(RT_ROWHEADER))
+ {
+ lcl_GetRepeatRangeString(&aRange, pDoc, true, aSymbol);
+ aLbRepeatRow.SetEntryData(
+ aLbRepeatRow.InsertEntry(aName),
+ new String(aSymbol) );
+ }
+
+ if (itr->HasType(RT_COLHEADER))
+ {
+ lcl_GetRepeatRangeString(&aRange, pDoc, false, aSymbol);
+ aLbRepeatCol.SetEntryData(
+ aLbRepeatCol.InsertEntry(aName),
+ new String(aSymbol));
}
}
}
@@ -528,7 +529,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_BtnHdl, PushButton*, pBtn )
{
if ( Impl_CheckRefStrings() )
{
- sal_Bool bDataChanged = sal_False;
+ sal_Bool bDataChanged = false;
String aStr;
SfxStringItem aPrintArea( SID_CHANGE_PRINTAREA, aStr );
SfxStringItem aRepeatRow( FN_PARAM_2, aStr );
@@ -561,7 +562,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_BtnHdl, PushButton*, pBtn )
if ( bDataChanged )
{
- SetDispatcherLock( sal_False );
+ SetDispatcherLock( false );
SwitchToDocument();
GetBindings().GetDispatcher()->Execute( SID_CHANGE_PRINTAREA,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
@@ -675,7 +676,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd )
if ( (nEntryCount > nFirstCustomPos) && aStrEd.Len() > 0 )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
String* pSymbol = NULL;
sal_uInt16 i;
@@ -725,7 +726,7 @@ bool lcl_CheckOne_OOO( const String& rStr, bool bIsRow, SCCOLROW& rVal )
{
sal_Int32 n = aStr.ToInt32();
- if ( ( bStrOk = (n > 0) && ( n <= MAXROWCOUNT ) ) != sal_False )
+ if ( ( bStrOk = (n > 0) && ( n <= MAXROWCOUNT ) ) != false )
nNum = static_cast<SCCOLROW>(n - 1);
}
}
@@ -904,3 +905,4 @@ void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIs
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx
index 729c43ecbf24..798cf65f85bc 100644
--- a/sc/source/ui/pagedlg/hfedtdlg.cxx
+++ b/sc/source/ui/pagedlg/hfedtdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,10 +41,9 @@
#include "hfedtdlg.hxx"
#include "global.hxx"
#include "globstr.hrc"
-//CHINA001 #include "tphfedit.hxx"
#include "scresid.hxx"
#include "hfedtdlg.hrc"
-#include "scuitphfedit.hxx" //CHINA001
+#include "scuitphfedit.hxx"
//------------------------------------------------------------------
// macros from docsh4.cxx
@@ -168,13 +168,13 @@ ScHFEditDlg::ScHFEditDlg( SfxViewFrame* pFrameP,
// -----------------------------------------------------------------------
-__EXPORT ScHFEditDlg::~ScHFEditDlg()
+ScHFEditDlg::~ScHFEditDlg()
{
}
// -----------------------------------------------------------------------
-void __EXPORT ScHFEditDlg::PageCreated( sal_uInt16 /* nId */, SfxTabPage& rPage )
+void ScHFEditDlg::PageCreated( sal_uInt16 /* nId */, SfxTabPage& rPage )
{
// kann ja nur ne ScHFEditPage sein...
@@ -184,3 +184,4 @@ void __EXPORT ScHFEditDlg::PageCreated( sal_uInt16 /* nId */, SfxTabPage& rPage
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/hfedtdlg.hrc b/sc/source/ui/pagedlg/hfedtdlg.hrc
index 30e6f8ecae63..f18cc50ce7b4 100644
--- a/sc/source/ui/pagedlg/hfedtdlg.hrc
+++ b/sc/source/ui/pagedlg/hfedtdlg.hrc
@@ -27,9 +27,6 @@
#include "sc.hrc"
-//#define RID_SCPAGE_HFEDIT 256
-//#define RID_SCDLG_HFEDIT 256
-
#define FT_LEFT 1
#define FT_CENTER 2
#define FT_RIGHT 3
@@ -52,13 +49,6 @@
#define FL_INFO 14
-#define IMG_TEXT_H 21
-#define IMG_PAGE_H 22
-#define IMG_PAGES_H 23
-#define IMG_DATE_H 24
-#define IMG_TIME_H 25
-#define IMG_FILE_H 26
-#define IMG_TABLE_H 27
#define FT_HF_DEFINED 28
#define LB_DEFINED 29
#define FT_HF_CUSTOM 30
diff --git a/sc/source/ui/pagedlg/hfedtdlg.src b/sc/source/ui/pagedlg/hfedtdlg.src
index a0892545f2eb..bcfdef66b613 100644
--- a/sc/source/ui/pagedlg/hfedtdlg.src
+++ b/sc/source/ui/pagedlg/hfedtdlg.src
@@ -81,6 +81,7 @@ TabDialog RID_SCDLG_HFED_HEADER
};
};
};
+
TabDialog RID_SCDLG_HFED_FOOTER
{
OutputSize = TRUE ;
@@ -112,6 +113,7 @@ TabDialog RID_SCDLG_HFED_FOOTER
};
};
};
+
//------------------------------------------------------------------------
// Bearbeiten/Kopf-Fusszeile:
//------------------------------------------------------------------------
@@ -158,6 +160,7 @@ TabDialog RID_SCDLG_HFEDIT_ALL
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_SHDR
{
OutputSize = TRUE ;
@@ -195,6 +198,7 @@ TabDialog RID_SCDLG_HFEDIT_SHDR
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_SFTR
{
OutputSize = TRUE ;
@@ -232,6 +236,7 @@ TabDialog RID_SCDLG_HFEDIT_SFTR
};
};
};
+
TabDialog RID_SCDLG_HFEDIT
{
OutputSize = TRUE ;
@@ -263,6 +268,7 @@ TabDialog RID_SCDLG_HFEDIT
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_HEADER
{
OutputSize = TRUE ;
@@ -294,6 +300,7 @@ TabDialog RID_SCDLG_HFEDIT_HEADER
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_FOOTER
{
OutputSize = TRUE ;
@@ -325,6 +332,7 @@ TabDialog RID_SCDLG_HFEDIT_FOOTER
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_RIGHTHEADER
{
OutputSize = TRUE ;
@@ -350,6 +358,7 @@ TabDialog RID_SCDLG_HFEDIT_RIGHTHEADER
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_LEFTHEADER
{
OutputSize = TRUE ;
@@ -375,6 +384,7 @@ TabDialog RID_SCDLG_HFEDIT_LEFTHEADER
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_RIGHTFOOTER
{
OutputSize = TRUE ;
@@ -400,6 +410,7 @@ TabDialog RID_SCDLG_HFEDIT_RIGHTFOOTER
};
};
};
+
TabDialog RID_SCDLG_HFEDIT_LEFTFOOTER
{
OutputSize = TRUE ;
@@ -425,6 +436,7 @@ TabDialog RID_SCDLG_HFEDIT_LEFTFOOTER
};
};
};
+
//------------------------------------------------------------------------
// ScTpHFEdit
//------------------------------------------------------------------------
@@ -440,45 +452,18 @@ TabPage RID_HFBASE
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "~Left area" ;
};
- /* "Control" braucht eigene HelpId, darum in der Ableitung:
- Control WND_LEFT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
-*/
FixedText FT_CENTER
{
Pos = MAP_APPFONT ( 90 , 6 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "~Center area" ;
};
- /* "Control" braucht eigene HelpId, darum in der Ableitung:
- Control WND_CENTER
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
-*/
FixedText FT_RIGHT
{
Pos = MAP_APPFONT ( 174 , 6 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "R~ight area" ;
};
- /* "Control" braucht eigene HelpId, darum in der Ableitung:
- Control WND_RIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 174 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
-*/
FixedText FT_HF_DEFINED
{
Pos = MAP_APPFONT ( 12 , 102 ) ;
@@ -486,18 +471,6 @@ TabPage RID_HFBASE
Text [ en-US ] = "Hea~der" ;
};
- /* #i84123# list box needs own help id, which is set in the derived tab pages
- ListBox LB_DEFINED
- {
- HelpID = "sc:ListBox:RID_HFBASE:LB_DEFINED";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 100 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- TabStop = TRUE ;
- };
- */
-
FixedText FT_HF_CUSTOM
{
Pos = MAP_APPFONT ( 12 , 124 ) ;
@@ -514,15 +487,11 @@ TabPage RID_HFBASE
QuickHelpText [ en-US ] = "Text Attributes" ;
ButtonImage = Image
{
- ImageBitmap = Bitmap { File = "text.bmp" ; };
+ ImageBitmap = Bitmap { File = "text.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
- Image IMG_TEXT_H
- {
- ImageBitmap = Bitmap { File = "text_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
+
ImageButton BTN_FILE
{
HelpId = HID_SC_HF_FILE ;
@@ -532,15 +501,10 @@ TabPage RID_HFBASE
QuickHelpText [ en-US ] = "Title" ;
ButtonImage = Image
{
- ImageBitmap = Bitmap { File = "file.bmp" ; };
+ ImageBitmap = Bitmap { File = "file.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
- Image IMG_FILE_H
- {
- ImageBitmap = Bitmap { File = "file_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
Menu RID_POPUP_FCOMMAND
{
@@ -578,15 +542,11 @@ TabPage RID_HFBASE
QuickHelpText [ en-US ] = "Sheet Name" ;
ButtonImage = Image
{
- ImageBitmap = Bitmap { File = "table.bmp" ; };
+ ImageBitmap = Bitmap { File = "table.png" ; };
MaskColor = STD_MASKCOLOR;
};
};
- Image IMG_TABLE_H
- {
- ImageBitmap = Bitmap { File = "table_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
+
ImageButton BTN_PAGE
{
HelpId = HID_SC_HF_PAGE ;
@@ -596,15 +556,11 @@ TabPage RID_HFBASE
QuickHelpText [ en-US ] = "Page" ;
ButtonImage = Image
{
- ImageBitmap = Bitmap { File = "page.bmp" ; };
+ ImageBitmap = Bitmap { File = "page.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
- Image IMG_PAGE_H
- {
- ImageBitmap = Bitmap { File = "page_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
+
ImageButton BTN_PAGES
{
HelpId = HID_SC_HF_PAGES ;
@@ -614,15 +570,11 @@ TabPage RID_HFBASE
QuickHelpText [ en-US ] = "Pages" ;
ButtonImage = Image
{
- ImageBitmap = Bitmap { File = "pages.bmp" ; };
+ ImageBitmap = Bitmap { File = "pages.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
- Image IMG_PAGES_H
- {
- ImageBitmap = Bitmap { File = "pages_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
+
ImageButton BTN_DATE
{
HelpId = HID_SC_HF_DATE ;
@@ -632,15 +584,11 @@ TabPage RID_HFBASE
QuickHelpText [ en-US ] = "Date" ;
ButtonImage = Image
{
- ImageBitmap = Bitmap { File = "date.bmp" ; };
+ ImageBitmap = Bitmap { File = "date.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
- Image IMG_DATE_H
- {
- ImageBitmap = Bitmap { File = "date_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
+
ImageButton BTN_TIME
{
HelpId = HID_SC_HF_TIME ;
@@ -650,15 +598,11 @@ TabPage RID_HFBASE
QuickHelpText [ en-US ] = "Time" ;
ButtonImage = Image
{
- ImageBitmap = Bitmap { File = "time.bmp" ; };
+ ImageBitmap = Bitmap { File = "time.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
- Image IMG_TIME_H
- {
- ImageBitmap = Bitmap { File = "time_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
+
FixedText FT_INFO
{
Pos = MAP_APPFONT ( 12 , 155 ) ;
@@ -673,6 +617,7 @@ TabPage RID_HFBASE
Text [ en-US ] = "Note" ;
};
};
+
// Kombinationen: Header/Footer links/rechts
// die Eingabefenster jeweils mit eigener ID, sonst aus RID_HFBASE kopiert
TabPage RID_SCPAGE_HFED_HL < RID_HFBASE
@@ -713,6 +658,7 @@ TabPage RID_SCPAGE_HFED_HL < RID_HFBASE
TabStop = TRUE ;
};
};
+
TabPage RID_SCPAGE_HFED_HR < RID_HFBASE
{
Hide = TRUE ;
@@ -751,6 +697,7 @@ TabPage RID_SCPAGE_HFED_HR < RID_HFBASE
TabStop = TRUE ;
};
};
+
TabPage RID_SCPAGE_HFED_FL < RID_HFBASE
{
Hide = TRUE ;
@@ -789,6 +736,7 @@ TabPage RID_SCPAGE_HFED_FL < RID_HFBASE
TabStop = TRUE ;
};
};
+
TabPage RID_SCPAGE_HFED_FR < RID_HFBASE
{
Hide = TRUE ;
@@ -827,4 +775,3 @@ TabPage RID_SCPAGE_HFED_FR < RID_HFBASE
TabStop = TRUE ;
};
};
-
diff --git a/sc/source/ui/pagedlg/makefile.mk b/sc/source/ui/pagedlg/makefile.mk
index 500e642e79eb..a7984f7d19af 100644
--- a/sc/source/ui/pagedlg/makefile.mk
+++ b/sc/source/ui/pagedlg/makefile.mk
@@ -33,16 +33,14 @@ LIBTARGET=no
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
CXXFILES = \
- areasdlg.cxx \
- hfedtdlg.cxx \
+ areasdlg.cxx \
+ hfedtdlg.cxx \
tptable.cxx \
tphf.cxx \
tphfedit.cxx
@@ -50,13 +48,15 @@ CXXFILES = \
SLOFILES = \
- $(SLO)$/areasdlg.obj \
- $(SLO)$/hfedtdlg.obj \
- $(SLO)$/tptable.obj \
- $(SLO)$/tphf.obj \
- $(SLO)$/tphfedit.obj \
- $(SLO)$/scuitphfedit.obj
+ $(EXCEPTIONSFILES)
+EXCEPTIONSFILES = \
+ $(SLO)$/areasdlg.obj \
+ $(SLO)$/hfedtdlg.obj \
+ $(SLO)$/scuitphfedit.obj \
+ $(SLO)$/tphf.obj \
+ $(SLO)$/tphfedit.obj \
+ $(SLO)$/tptable.obj \
SRS1NAME=$(TARGET)
SRC1FILES = pagedlg.src \
@@ -67,7 +67,7 @@ LIB1TARGET = $(SLB)$/$(TARGET).lib
LIB1OBJFILES = \
$(SLO)$/areasdlg.obj \
- $(SLO)$/tphfedit.obj
+ $(SLO)$/tphfedit.obj
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sc/source/ui/pagedlg/pagedlg.hrc b/sc/source/ui/pagedlg/pagedlg.hrc
index 2f3593c2f6d1..0c26340599a1 100644
--- a/sc/source/ui/pagedlg/pagedlg.hrc
+++ b/sc/source/ui/pagedlg/pagedlg.hrc
@@ -71,9 +71,6 @@
#define FT_SCALEPAGEHEIGHT 53
#define FT_SCALEPAGENUM 54
-#define IMG_LEFTRIGHT_H 41
-#define IMG_TOPDOWN_H 42
-
// List box entries "Scaling mode"
#define SC_TPTABLE_SCALE_PERCENT 0
#define SC_TPTABLE_SCALE_TO 1
diff --git a/sc/source/ui/pagedlg/pagedlg.src b/sc/source/ui/pagedlg/pagedlg.src
index 070da19e8076..0a56d70f966a 100644
--- a/sc/source/ui/pagedlg/pagedlg.src
+++ b/sc/source/ui/pagedlg/pagedlg.src
@@ -25,6 +25,7 @@
*
************************************************************************/
#include "pagedlg.hrc"
+
ModelessDialog RID_SCDLG_AREAS
{
HelpId = HID_SCPAGE_AREAS ;
@@ -156,6 +157,7 @@ ModelessDialog RID_SCDLG_AREAS
QuickHelpText [ en-US ] = "Shrink" ;
};
};
+
TabPage RID_SCPAGE_TABLE
{
Hide = TRUE ;
@@ -256,24 +258,14 @@ TabPage RID_SCPAGE_TABLE
};
Image IMG_LEFTRIGHT
{
- ImageBitmap = Bitmap { File = "lftrgt.bmp" ; };
+ ImageBitmap = Bitmap { File = "lftrgt.png" ; };
MaskColor = STD_MASKCOLOR;
};
- Image IMG_LEFTRIGHT_H
- {
- ImageBitmap = Bitmap { File = "lftrgt_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
Image IMG_TOPDOWN
{
- ImageBitmap = Bitmap { File = "topdown.bmp" ; };
+ ImageBitmap = Bitmap { File = "topdown.png" ; };
MaskColor = STD_MASKCOLOR;
};
- Image IMG_TOPDOWN_H
- {
- ImageBitmap = Bitmap { File = "topdown_h.bmp" ; };
- MaskColor = SC_HC_MASKCOLOR;
- };
CheckBox BTN_PAGENO
{
HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_PAGENO";
@@ -415,28 +407,3 @@ TabPage RID_SCPAGE_TABLE
Text [ en-US ] = "Scale" ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 4a48c4f26729..dd47ce988480 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,6 @@
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
-//CHINA001 #include <svx/chardlg.hxx>
#include <editeng/editobj.hxx>
#include <editeng/editstat.hxx>
#include <editeng/editview.hxx>
@@ -51,7 +51,6 @@
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
-//CHINA001 #include "tphfedit.hxx"
#include "editutil.hxx"
#include "global.hxx"
#include "attrib.hxx"
@@ -65,7 +64,7 @@
#include "textdlgs.hxx"
#include "AccessibleEditObject.hxx"
-#include "scuitphfedit.hxx" //CHINA001
+#include "scuitphfedit.hxx"
#include <memory> // header file for auto_ptr
// STATIC DATA -----------------------------------------------------------
@@ -141,14 +140,6 @@ ScHFEditPage::ScHFEditPage( Window* pParent,
aBtnFile .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
aBtnTable .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
- aBtnText .SetModeImage( Image( ScResId( IMG_TEXT_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnFile .SetModeImage( Image( ScResId( IMG_FILE_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnTable .SetModeImage( Image( ScResId( IMG_TABLE_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnPage .SetModeImage( Image( ScResId( IMG_PAGE_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnLastPage.SetModeImage( Image( ScResId( IMG_PAGES_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnDate .SetModeImage( Image( ScResId( IMG_DATE_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnTime .SetModeImage( Image( ScResId( IMG_TIME_H ) ), BMP_COLOR_HIGHCONTRAST );
-
if(!bHeader)
{
maFtDefinedHF.SetText(ScGlobal::GetRscString( STR_FOOTER ));
@@ -181,7 +172,7 @@ ScHFEditPage::ScHFEditPage( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScHFEditPage::~ScHFEditPage()
+ScHFEditPage::~ScHFEditPage()
{
}
@@ -196,7 +187,7 @@ void ScHFEditPage::SetNumType(SvxNumType eNumType)
#define IS_AVAILABLE(w)(rCoreSet.GetItemState( (w) ) >= SFX_ITEM_AVAILABLE)
-void __EXPORT ScHFEditPage::Reset( const SfxItemSet& rCoreSet )
+void ScHFEditPage::Reset( const SfxItemSet& rCoreSet )
{
if ( IS_AVAILABLE( nWhich ) )
{
@@ -217,7 +208,7 @@ void __EXPORT ScHFEditPage::Reset( const SfxItemSet& rCoreSet )
// -----------------------------------------------------------------------
-sal_Bool __EXPORT ScHFEditPage::FillItemSet( SfxItemSet& rCoreSet )
+sal_Bool ScHFEditPage::FillItemSet( SfxItemSet& rCoreSet )
{
ScPageHFItem aItem( nWhich );
EditTextObject* pLeft = aWndLeft .CreateTextObject();
@@ -709,7 +700,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
ESelection aSel(0,0,0,0);
aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ), aSel );
++aSel.nEndPos;
- String aPageEntry(RTL_CONSTASCII_STRINGPARAM(", "));
+ String aPageEntry(RTL_CONSTASCII_USTRINGPARAM(", "));
aPageEntry += ScGlobal::GetRscString( STR_PAGE ) ;
aPageEntry += ' ';
aWndCenter.GetEditEngine()->QuickInsertText(aPageEntry, ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
@@ -742,7 +733,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
aSel.nEndPos = aPageEntry.Len();
aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
++aSel.nEndPos;
- String aCommaSpace(RTL_CONSTASCII_STRINGPARAM(", "));
+ String aCommaSpace(RTL_CONSTASCII_USTRINGPARAM(", "));
aWndCenter.GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.Len() );
aWndCenter.GetEditEngine()->QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
@@ -763,7 +754,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
aSel.nEndPos = aPageEntry.Len();
aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
++aSel.nEndPos;
- String aCommaSpace(RTL_CONSTASCII_STRINGPARAM(", "));
+ String aCommaSpace(RTL_CONSTASCII_USTRINGPARAM(", "));
aWndCenter.GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.Len() );
aWndCenter.GetEditEngine()->QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
@@ -866,7 +857,7 @@ IMPL_LINK( ScHFEditPage, ListHdl_Impl, ListBox*, pList )
IMPL_LINK( ScHFEditPage, ClickHdl, ImageButton*, pBtn )
{
- pActiveEdWnd = ::GetScEditWindow(); //CHINA001
+ pActiveEdWnd = ::GetScEditWindow();
if ( !pActiveEdWnd )
return 0;
@@ -899,7 +890,7 @@ IMPL_LINK( ScHFEditPage, ClickHdl, ImageButton*, pBtn )
IMPL_LINK( ScHFEditPage, MenuHdl, ScExtIButton*, pBtn )
{
- pActiveEdWnd = ::GetScEditWindow(); //CHINA001
+ pActiveEdWnd = ::GetScEditWindow();
if ( !pActiveEdWnd )
return 0;
@@ -934,12 +925,12 @@ ScRightHeaderEditPage::ScRightHeaderEditPage( Window* pParent, const SfxItemSet&
// -----------------------------------------------------------------------
-sal_uInt16* __EXPORT ScRightHeaderEditPage::GetRanges()
+sal_uInt16* ScRightHeaderEditPage::GetRanges()
{ return pPageRightHeaderRanges; }
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScRightHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
+SfxTabPage* ScRightHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
{ return ( new ScRightHeaderEditPage( pParent, rCoreSet ) ); };
@@ -954,12 +945,12 @@ ScLeftHeaderEditPage::ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& r
// -----------------------------------------------------------------------
-sal_uInt16* __EXPORT ScLeftHeaderEditPage::GetRanges()
+sal_uInt16* ScLeftHeaderEditPage::GetRanges()
{ return pPageLeftHeaderRanges; }
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScLeftHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
+SfxTabPage* ScLeftHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
{ return ( new ScLeftHeaderEditPage( pParent, rCoreSet ) ); };
//========================================================================
@@ -973,12 +964,12 @@ ScRightFooterEditPage::ScRightFooterEditPage( Window* pParent, const SfxItemSet&
// -----------------------------------------------------------------------
-sal_uInt16* __EXPORT ScRightFooterEditPage::GetRanges()
+sal_uInt16* ScRightFooterEditPage::GetRanges()
{ return pPageRightFooterRanges; }
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScRightFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
+SfxTabPage* ScRightFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
{ return ( new ScRightFooterEditPage( pParent, rCoreSet ) ); };
//========================================================================
@@ -992,10 +983,12 @@ ScLeftFooterEditPage::ScLeftFooterEditPage( Window* pParent, const SfxItemSet& r
// -----------------------------------------------------------------------
-sal_uInt16* __EXPORT ScLeftFooterEditPage::GetRanges()
+sal_uInt16* ScLeftFooterEditPage::GetRanges()
{ return pPageLeftFooterRanges; }
// -----------------------------------------------------------------------
-SfxTabPage* __EXPORT ScLeftFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
+SfxTabPage* ScLeftFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
{ return ( new ScLeftFooterEditPage( pParent, rCoreSet ) ); };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index e4a73d24aa01..824d64a0e287 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,11 +48,10 @@
#include "tabvwsh.hxx"
#include "viewdata.hxx"
#include "document.hxx"
-//CHINA001 #include "tphfedit.hxx"
#include "hfedtdlg.hxx"
#include "styledlg.hxx"
#include "scresid.hxx"
-#include "scuitphfedit.hxx" //CHINA001
+#include "scuitphfedit.hxx"
#undef _TPHF_CXX
@@ -107,13 +107,13 @@ ScHFPage::ScHFPage( Window* pParent, sal_uInt16 nResId,
//------------------------------------------------------------------
-__EXPORT ScHFPage::~ScHFPage()
+ScHFPage::~ScHFPage()
{
}
//------------------------------------------------------------------
-void __EXPORT ScHFPage::Reset( const SfxItemSet& rSet )
+void ScHFPage::Reset( const SfxItemSet& rSet )
{
SvxHFPage::Reset( rSet );
TurnOnHdl( 0 );
@@ -121,7 +121,7 @@ void __EXPORT ScHFPage::Reset( const SfxItemSet& rSet )
//------------------------------------------------------------------
-sal_Bool __EXPORT ScHFPage::FillItemSet( SfxItemSet& rOutSet )
+sal_Bool ScHFPage::FillItemSet( SfxItemSet& rOutSet )
{
sal_Bool bResult = SvxHFPage::FillItemSet( rOutSet );
@@ -141,7 +141,7 @@ sal_Bool __EXPORT ScHFPage::FillItemSet( SfxItemSet& rOutSet )
//------------------------------------------------------------------
-void __EXPORT ScHFPage::ActivatePage( const SfxItemSet& rSet )
+void ScHFPage::ActivatePage( const SfxItemSet& rSet )
{
sal_uInt16 nPageWhich = GetWhich( SID_ATTR_PAGE );
const SvxPageItem& rPageItem = (const SvxPageItem&)
@@ -159,7 +159,7 @@ void __EXPORT ScHFPage::ActivatePage( const SfxItemSet& rSet )
//------------------------------------------------------------------
-int __EXPORT ScHFPage::DeactivatePage( SfxItemSet* pSetP )
+int ScHFPage::DeactivatePage( SfxItemSet* pSetP )
{
if ( LEAVE_PAGE == SvxHFPage::DeactivatePage( pSetP ) )
if ( pSetP )
@@ -214,7 +214,7 @@ IMPL_LINK( ScHFPage, HFEditHdl, void*, EMPTYARG )
if ( !pViewSh )
{
- DBG_ERROR( "Current ViewShell not found." );
+ OSL_FAIL( "Current ViewShell not found." );
return 0;
}
@@ -293,14 +293,14 @@ ScHeaderPage::ScHeaderPage( Window* pParent, const SfxItemSet& rSet )
//------------------------------------------------------------------
-SfxTabPage* __EXPORT ScHeaderPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
+SfxTabPage* ScHeaderPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
{
return ( new ScHeaderPage( pParent, rCoreSet ) );
}
//------------------------------------------------------------------
-sal_uInt16* __EXPORT ScHeaderPage::GetRanges()
+sal_uInt16* ScHeaderPage::GetRanges()
{
return SvxHeaderPage::GetRanges();
}
@@ -316,14 +316,14 @@ ScFooterPage::ScFooterPage( Window* pParent, const SfxItemSet& rSet )
//------------------------------------------------------------------
-SfxTabPage* __EXPORT ScFooterPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
+SfxTabPage* ScFooterPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
{
return ( new ScFooterPage( pParent, rCoreSet ) );
}
//------------------------------------------------------------------
-sal_uInt16* __EXPORT ScFooterPage::GetRanges()
+sal_uInt16* ScFooterPage::GetRanges()
{
return SvxHeaderPage::GetRanges();
}
@@ -331,3 +331,4 @@ sal_uInt16* __EXPORT ScFooterPage::GetRanges()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.src b/sc/source/ui/pagedlg/tphf.src
index b2f59e06da72..d6cda1047cc1 100644
--- a/sc/source/ui/pagedlg/tphf.src
+++ b/sc/source/ui/pagedlg/tphf.src
@@ -26,6 +26,7 @@
************************************************************************/
#include "sc.hrc"
+
PushButton RID_SCBTN_HFEDIT
{
TabStop = TRUE ;
@@ -34,31 +35,3 @@ PushButton RID_SCBTN_HFEDIT
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Edit..." ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 9d2c979a71ca..3a8730b5b09b 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,6 @@
#include <editeng/eeitem.hxx>
-//CHINA001 #include <svx/chardlg.hxx>
#include <editeng/editobj.hxx>
#include <editeng/editstat.hxx>
#include <editeng/editview.hxx>
@@ -59,10 +59,9 @@
#include "tabvwsh.hxx"
#include "prevwsh.hxx"
#include "hfedtdlg.hrc"
-//CHINA001 #include "textdlgs.hxx"
#include "AccessibleEditObject.hxx"
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
// STATIC DATA -----------------------------------------------------------
@@ -73,312 +72,6 @@ ScEditWindow* GetScEditWindow ()
return pActiveEdWnd;
}
-//CHINA001
-//CHINA001 static sal_uInt16 pPageRightHeaderRanges[] = { SID_SCATTR_PAGE_HEADERRIGHT,
-//CHINA001 SID_SCATTR_PAGE_HEADERRIGHT,
-//CHINA001 0 };
-//CHINA001
-//CHINA001 static sal_uInt16 pPageRightFooterRanges[] = { SID_SCATTR_PAGE_FOOTERRIGHT,
-//CHINA001 SID_SCATTR_PAGE_FOOTERRIGHT,
-//CHINA001 0 };
-//CHINA001
-//CHINA001 static sal_uInt16 pPageLeftHeaderRanges[] = { SID_SCATTR_PAGE_HEADERLEFT,
-//CHINA001 SID_SCATTR_PAGE_HEADERLEFT,
-//CHINA001 0 };
-//CHINA001
-//CHINA001 static sal_uInt16 pPageLeftFooterRanges[] = { SID_SCATTR_PAGE_FOOTERLEFT,
-//CHINA001 SID_SCATTR_PAGE_FOOTERLEFT,
-//CHINA001 0 };
-//CHINA001
-//CHINA001 static ScEditWindow* pActiveEdWnd = NULL;
-//CHINA001
-//CHINA001
-//CHINA001
-//CHINA001 //========================================================================
-//CHINA001 // class ScHFEditPage
-//CHINA001 //
-//CHINA001
-//CHINA001 ScHFEditPage::ScHFEditPage( Window* pParent,
-//CHINA001 sal_uInt16 nResId,
-//CHINA001 const SfxItemSet& rCoreAttrs,
-//CHINA001 sal_uInt16 nWhichId )
-//CHINA001
-//CHINA001 : SfxTabPage ( pParent, ScResId( nResId ), rCoreAttrs ),
-//CHINA001
-//CHINA001 aWndLeft ( this, ScResId( WND_LEFT ), Left ),
-//CHINA001 aWndCenter ( this, ScResId( WND_CENTER ), Center ),
-//CHINA001 aWndRight ( this, ScResId( WND_RIGHT ), Right ),
-//CHINA001 aFtLeft ( this, ScResId( FT_LEFT ) ),
-//CHINA001 aFtCenter ( this, ScResId( FT_CENTER ) ),
-//CHINA001 aFtRight ( this, ScResId( FT_RIGHT ) ),
-//CHINA001 aFlInfo ( this, ScResId( FL_INFO ) ),
-//CHINA001 aFtInfo ( this, ScResId( FT_INFO ) ),
-//CHINA001 aBtnText ( this, ScResId( BTN_TEXT ) ),
-//CHINA001 aBtnPage ( this, ScResId( BTN_PAGE ) ),
-//CHINA001 aBtnLastPage ( this, ScResId( BTN_PAGES ) ),
-//CHINA001 aBtnDate ( this, ScResId( BTN_DATE ) ),
-//CHINA001 aBtnTime ( this, ScResId( BTN_TIME ) ),
-//CHINA001 aBtnFile ( this, ScResId( BTN_FILE ) ),
-//CHINA001 aBtnTable ( this, ScResId( BTN_TABLE ) ),
-//CHINA001 aPopUpFile ( ScResId( RID_POPUP_FCOMMAND) ),
-//CHINA001 nWhich ( nWhichId )
-//CHINA001 {
-//CHINA001 //! use default style from current document?
-//CHINA001 //! if font color is used, header/footer background color must be set
-//CHINA001
-//CHINA001 ScPatternAttr aPatAttr( rCoreAttrs.GetPool() );
-//CHINA001
-//CHINA001 aBtnFile.SetPopupMenu(&aPopUpFile);
-//CHINA001
-//CHINA001 aBtnFile.SetMenuHdl( LINK( this, ScHFEditPage, MenuHdl ) );
-//CHINA001 aBtnText .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-//CHINA001 aBtnPage .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-//CHINA001 aBtnLastPage.SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-//CHINA001 aBtnDate .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-//CHINA001 aBtnTime .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-//CHINA001 aBtnFile .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-//CHINA001 aBtnTable .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-//CHINA001
-//CHINA001 aBtnText .SetModeImage( Image( ScResId( IMG_TEXT_H ) ), BMP_COLOR_HIGHCONTRAST );
-//CHINA001 aBtnFile .SetModeImage( Image( ScResId( IMG_FILE_H ) ), BMP_COLOR_HIGHCONTRAST );
-//CHINA001 aBtnTable .SetModeImage( Image( ScResId( IMG_TABLE_H ) ), BMP_COLOR_HIGHCONTRAST );
-//CHINA001 aBtnPage .SetModeImage( Image( ScResId( IMG_PAGE_H ) ), BMP_COLOR_HIGHCONTRAST );
-//CHINA001 aBtnLastPage.SetModeImage( Image( ScResId( IMG_PAGES_H ) ), BMP_COLOR_HIGHCONTRAST );
-//CHINA001 aBtnDate .SetModeImage( Image( ScResId( IMG_DATE_H ) ), BMP_COLOR_HIGHCONTRAST );
-//CHINA001 aBtnTime .SetModeImage( Image( ScResId( IMG_TIME_H ) ), BMP_COLOR_HIGHCONTRAST );
-//CHINA001
-//CHINA001 aWndLeft. SetFont( aPatAttr );
-//CHINA001 aWndCenter. SetFont( aPatAttr );
-//CHINA001 aWndRight. SetFont( aPatAttr );
-//CHINA001
-//CHINA001 FillCmdArr();
-//CHINA001
-//CHINA001 aWndLeft.GrabFocus();
-//CHINA001
-//CHINA001 FreeResource();
-//CHINA001 }
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 __EXPORT ScHFEditPage::~ScHFEditPage()
-//CHINA001 {
-//CHINA001 }
-//CHINA001
-//CHINA001 void ScHFEditPage::SetNumType(SvxNumType eNumType)
-//CHINA001 {
-//CHINA001 aWndLeft.SetNumType(eNumType);
-//CHINA001 aWndCenter.SetNumType(eNumType);
-//CHINA001 aWndRight.SetNumType(eNumType);
-//CHINA001 }
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 #define IS_AVAILABLE(w)(rCoreSet.GetItemState( (w) ) >= SFX_ITEM_AVAILABLE)
-//CHINA001
-//CHINA001 void __EXPORT ScHFEditPage::Reset( const SfxItemSet& rCoreSet )
-//CHINA001 {
-//CHINA001 if ( IS_AVAILABLE( nWhich ) )
-//CHINA001 {
-//CHINA001 const ScPageHFItem& rItem = (const ScPageHFItem&)(rCoreSet.Get( nWhich ));
-//CHINA001
-//CHINA001 const EditTextObject* pLeft = rItem.GetLeftArea();
-//CHINA001 const EditTextObject* pCenter = rItem.GetCenterArea();
-//CHINA001 const EditTextObject* pRight = rItem.GetRightArea();
-//CHINA001
-//CHINA001 if ( pLeft && pCenter && pRight )
-//CHINA001 {
-//CHINA001 aWndLeft .SetText( *pLeft );
-//CHINA001 aWndCenter .SetText( *pCenter );
-//CHINA001 aWndRight .SetText( *pRight );
-//CHINA001 }
-//CHINA001 }
-//CHINA001 }
-//CHINA001
-//CHINA001 #undef IS_AVAILABLE
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 sal_Bool __EXPORT ScHFEditPage::FillItemSet( SfxItemSet& rCoreSet )
-//CHINA001 {
-//CHINA001 ScPageHFItem aItem( nWhich );
-//CHINA001 EditTextObject* pLeft = aWndLeft .CreateTextObject();
-//CHINA001 EditTextObject* pCenter = aWndCenter.CreateTextObject();
-//CHINA001 EditTextObject* pRight = aWndRight .CreateTextObject();
-//CHINA001
-//CHINA001 aItem.SetLeftArea ( *pLeft );
-//CHINA001 aItem.SetCenterArea( *pCenter );
-//CHINA001 aItem.SetRightArea ( *pRight );
-//CHINA001 delete pLeft;
-//CHINA001 delete pCenter;
-//CHINA001 delete pRight;
-//CHINA001
-//CHINA001 rCoreSet.Put( aItem );
-//CHINA001
-//CHINA001 return sal_True;
-//CHINA001 }
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 #define SET_CMD(i,id) x
-//CHINA001 aCmd = aDel; x
-//CHINA001 aCmd += ScGlobal::GetRscString( id ); x
-//CHINA001 aCmd += aDel; x
-//CHINA001 aCmdArr[i] = aCmd;
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 void ScHFEditPage::FillCmdArr()
-//CHINA001 {
-//CHINA001 String aDel( ScGlobal::GetRscString( STR_HFCMD_DELIMITER ) );
-//CHINA001 String aCmd;
-//CHINA001
-//CHINA001 SET_CMD( 0, STR_HFCMD_PAGE )
-//CHINA001 SET_CMD( 1, STR_HFCMD_PAGES )
-//CHINA001 SET_CMD( 2, STR_HFCMD_DATE )
-//CHINA001 SET_CMD( 3, STR_HFCMD_TIME )
-//CHINA001 SET_CMD( 4, STR_HFCMD_FILE )
-//CHINA001 SET_CMD( 5, STR_HFCMD_TABLE )
-//CHINA001 }
-//CHINA001
-//CHINA001 #undef SET_CMD
-//CHINA001
-//CHINA001 //-----------------------------------------------------------------------
-//CHINA001 // Handler:
-//CHINA001 //-----------------------------------------------------------------------
-//CHINA001
-//CHINA001 IMPL_LINK( ScHFEditPage, ClickHdl, ImageButton*, pBtn )
-//CHINA001 {
-//CHINA001 if ( !pActiveEdWnd )
-//CHINA001 return 0;
-//CHINA001
-//CHINA001 if ( pBtn == &aBtnText )
-//CHINA001 {
-//CHINA001 pActiveEdWnd->SetCharAttriutes();
-//CHINA001 }
-//CHINA001 else
-//CHINA001 {
-//CHINA001 if ( pBtn == &aBtnPage )
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem(SvxPageField()) );
-//CHINA001 else if ( pBtn == &aBtnLastPage )
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem(SvxPagesField()) );
-//CHINA001 else if ( pBtn == &aBtnDate )
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR)) );
-//CHINA001 else if ( pBtn == &aBtnTime )
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem(SvxTimeField()) );
-//CHINA001 else if ( pBtn == &aBtnFile )
-//CHINA001 {
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem( SvxFileField() ) );
-//CHINA001 }
-//CHINA001 else if ( pBtn == &aBtnTable )
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem(SvxTableField()) );
-//CHINA001 }
-//CHINA001 pActiveEdWnd->GrabFocus();
-//CHINA001
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 IMPL_LINK( ScHFEditPage, MenuHdl, ScExtIButton*, pBtn )
-//CHINA001 {
-//CHINA001 if ( !pActiveEdWnd )
-//CHINA001 return 0;
-//CHINA001
-//CHINA001 if(pBtn!=NULL)
-//CHINA001 {
-//CHINA001 switch(pBtn->GetSelected())
-//CHINA001 {
-//CHINA001 case FILE_COMMAND_TITEL:
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem( SvxFileField() ) );
-//CHINA001 break;
-//CHINA001 case FILE_COMMAND_FILENAME:
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem( SvxExtFileField(
-//CHINA001 EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_NAME_EXT ) ) );
-//CHINA001 break;
-//CHINA001 case FILE_COMMAND_PATH:
-//CHINA001 pActiveEdWnd->InsertField( SvxFieldItem( SvxExtFileField(
-//CHINA001 EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_FULLPATH ) ) );
-//CHINA001 break;
-//CHINA001 }
-//CHINA001 }
-//CHINA001 return 0;
-//CHINA001 }
-//CHINA001
-//CHINA001 //========================================================================
-//CHINA001 // class ScRightHeaderEditPage
-//CHINA001 //========================================================================
-//CHINA001
-//CHINA001 ScRightHeaderEditPage::ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 : ScHFEditPage( pParent, RID_SCPAGE_HFED_HR, rCoreSet,
-//CHINA001 rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_HEADERRIGHT) )
-//CHINA001 {}
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 sal_uInt16* __EXPORT ScRightHeaderEditPage::GetRanges()
-//CHINA001 { return pPageRightHeaderRanges; }
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 SfxTabPage* __EXPORT ScRightHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 { return ( new ScRightHeaderEditPage( pParent, rCoreSet ) ); };
-//CHINA001
-//CHINA001
-//CHINA001 //========================================================================
-//CHINA001 // class ScLeftHeaderEditPage
-//CHINA001 //========================================================================
-//CHINA001
-//CHINA001 ScLeftHeaderEditPage::ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 : ScHFEditPage( pParent, RID_SCPAGE_HFED_HL, rCoreSet,
-//CHINA001 rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_HEADERLEFT) )
-//CHINA001 {}
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 sal_uInt16* __EXPORT ScLeftHeaderEditPage::GetRanges()
-//CHINA001 { return pPageLeftHeaderRanges; }
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 SfxTabPage* __EXPORT ScLeftHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 { return ( new ScLeftHeaderEditPage( pParent, rCoreSet ) ); };
-//CHINA001
-//CHINA001 //========================================================================
-//CHINA001 // class ScRightFooterEditPage
-//CHINA001 //========================================================================
-//CHINA001
-//CHINA001 ScRightFooterEditPage::ScRightFooterEditPage( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 : ScHFEditPage( pParent, RID_SCPAGE_HFED_FR, rCoreSet,
-//CHINA001 rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_FOOTERRIGHT) )
-//CHINA001 {}
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 sal_uInt16* __EXPORT ScRightFooterEditPage::GetRanges()
-//CHINA001 { return pPageRightFooterRanges; }
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 SfxTabPage* __EXPORT ScRightFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 { return ( new ScRightFooterEditPage( pParent, rCoreSet ) ); };
-//CHINA001
-//CHINA001 //========================================================================
-//CHINA001 // class ScLeftFooterEditPage
-//CHINA001 //========================================================================
-//CHINA001
-//CHINA001 ScLeftFooterEditPage::ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 : ScHFEditPage( pParent, RID_SCPAGE_HFED_FL, rCoreSet,
-//CHINA001 rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_FOOTERLEFT) )
-//CHINA001 {}
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 sal_uInt16* __EXPORT ScLeftFooterEditPage::GetRanges()
-//CHINA001 { return pPageLeftFooterRanges; }
-//CHINA001
-//CHINA001 // -----------------------------------------------------------------------
-//CHINA001
-//CHINA001 SfxTabPage* __EXPORT ScLeftFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
-//CHINA001 { return ( new ScLeftFooterEditPage( pParent, rCoreSet ) ); };
-
//========================================================================
void lcl_GetFieldData( ScHeaderFieldData& rData )
@@ -402,7 +95,7 @@ ScEditWindow::ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLo
eLocation(eLoc),
pAcc(NULL)
{
- EnableRTL(sal_False);
+ EnableRTL(false);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
Color aBgColor = rStyleSettings.GetWindowColor();
@@ -437,7 +130,7 @@ ScEditWindow::ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLo
// -----------------------------------------------------------------------
-__EXPORT ScEditWindow::~ScEditWindow()
+ScEditWindow::~ScEditWindow()
{
// delete Accessible object before deleting EditEngine and EditView
if (pAcc)
@@ -460,9 +153,9 @@ void ScEditWindow::SetNumType(SvxNumType eNumType)
// -----------------------------------------------------------------------
-EditTextObject* __EXPORT ScEditWindow::CreateTextObject()
+EditTextObject* ScEditWindow::CreateTextObject()
{
- // wegen #38841# die Absatzattribute zuruecksetzen
+ // Absatzattribute zuruecksetzen
// (GetAttribs beim Format-Dialog-Aufruf gibt immer gesetzte Items zurueck)
const SfxItemSet& rEmpty = pEdEngine->GetEmptyItemSet();
@@ -523,13 +216,12 @@ void ScEditWindow::SetCharAttriutes()
SfxItemSet aSet( pEdView->GetAttribs() );
- //CHINA001 ScCharDlg* pDlg = new ScCharDlg( GetParent(), &aSet, pDocSh );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( GetParent(), &aSet,
pDocSh,RID_SCDLG_CHAR );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
pDlg->SetText( ScGlobal::GetRscString( STR_TEXTATTRS ) );
if ( pDlg->Execute() == RET_OK )
{
@@ -538,14 +230,14 @@ void ScEditWindow::SetCharAttriutes()
pEdView->SetAttribs( aSet );
}
- if(pTabViewSh!=NULL) pTabViewSh->SetInFormatDialog(sal_False);
+ if(pTabViewSh!=NULL) pTabViewSh->SetInFormatDialog(false);
delete pDlg;
}
}
// -----------------------------------------------------------------------
-void __EXPORT ScEditWindow::Paint( const Rectangle& rRec )
+void ScEditWindow::Paint( const Rectangle& rRec )
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
Color aBgColor = rStyleSettings.GetWindowColor();
@@ -561,14 +253,14 @@ void __EXPORT ScEditWindow::Paint( const Rectangle& rRec )
// -----------------------------------------------------------------------
-void __EXPORT ScEditWindow::MouseMove( const MouseEvent& rMEvt )
+void ScEditWindow::MouseMove( const MouseEvent& rMEvt )
{
pEdView->MouseMove( rMEvt );
}
// -----------------------------------------------------------------------
-void __EXPORT ScEditWindow::MouseButtonDown( const MouseEvent& rMEvt )
+void ScEditWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( !HasFocus() )
GrabFocus();
@@ -578,14 +270,14 @@ void __EXPORT ScEditWindow::MouseButtonDown( const MouseEvent& rMEvt )
// -----------------------------------------------------------------------
-void __EXPORT ScEditWindow::MouseButtonUp( const MouseEvent& rMEvt )
+void ScEditWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
pEdView->MouseButtonUp( rMEvt );
}
// -----------------------------------------------------------------------
-void __EXPORT ScEditWindow::KeyInput( const KeyEvent& rKEvt )
+void ScEditWindow::KeyInput( const KeyEvent& rKEvt )
{
sal_uInt16 nKey = rKEvt.GetKeyCode().GetModifier()
+ rKEvt.GetKeyCode().GetCode();
@@ -609,7 +301,7 @@ void ScEditWindow::Command( const CommandEvent& rCEvt )
// -----------------------------------------------------------------------
-void __EXPORT ScEditWindow::GetFocus()
+void ScEditWindow::GetFocus()
{
pActiveEdWnd = this;
@@ -622,7 +314,7 @@ void __EXPORT ScEditWindow::GetFocus()
pAcc = NULL;
}
-void __EXPORT ScEditWindow::LoseFocus()
+void ScEditWindow::LoseFocus()
{
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTemp = xAcc;
if (xTemp.is() && pAcc)
@@ -644,19 +336,16 @@ void __EXPORT ScEditWindow::LoseFocus()
case Left:
{
sName = String(ScResId(STR_ACC_LEFTAREA_NAME));
-// sDescription = String(ScResId(STR_ACC_LEFTAREA_DESCR));
}
break;
case Center:
{
sName = String(ScResId(STR_ACC_CENTERAREA_NAME));
-// sDescription = String(ScResId(STR_ACC_CENTERAREA_DESCR));
}
break;
case Right:
{
sName = String(ScResId(STR_ACC_RIGHTAREA_NAME));
-// sDescription = String(ScResId(STR_ACC_RIGHTAREA_DESCR));
}
break;
}
@@ -667,47 +356,13 @@ void __EXPORT ScEditWindow::LoseFocus()
return pAcc;
}
-/*
-class ScExtIButton : public ImageButton
-{
-private:
-
- Timer aTimer;
- ScPopupMenu* pPopupMenu;
-
- DECL_LINK( TimerHdl, Timer*);
-
- void DrawArrow();
-
-protected:
-
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseButtonUp( const MouseEvent& rMEvt);
-
- virtual void StartPopup();
-
-public:
-
- ScExtIButton(Window* pParent, const ResId& rResId );
-
- void SetPopupMenu(ScPopupMenu* pPopUp);
-
- sal_uInt16 GetSelected();
-
- void SetMenuHdl( const Link& rLink ) { aFxLink = rLink; }
- const Link& GetMenuHdl() const { return aFxLink; }
-
-}
-*/
ScExtIButton::ScExtIButton(Window* pParent, const ResId& rResId )
: ImageButton(pParent,rResId),
pPopupMenu(NULL)
{
nSelected=0;
aTimer.SetTimeout(600);
- SetDropDown( sal_True);
-
-// DrawArrow();
+ SetDropDown( true);
}
void ScExtIButton::SetPopupMenu(ScPopupMenu* pPopUp)
@@ -761,7 +416,7 @@ void ScExtIButton::StartPopup()
{
aMLink.Call(this);
}
- SetPressed( sal_False);
+ SetPressed( false);
}
}
@@ -782,93 +437,5 @@ IMPL_LINK( ScExtIButton, TimerHdl, Timer*, EMPTYARG )
return 0;
}
-/*
-static void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack,
- sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False )
-{
- Color aOldFillColor = pBox->GetFillColor();
- WindowAlign eAlign = pBox->meAlign;
- if ( bLeft )
- eAlign = WINDOWALIGN_RIGHT;
- else if ( bTop )
- eAlign = WINDOWALIGN_BOTTOM;
-
- switch ( eAlign )
- {
- case WINDOWALIGN_LEFT:
- if ( bBlack )
- pBox->SetFillColor( Color( COL_BLACK ) );
- pBox->DrawRect( Rectangle( nX+0, nY+0, nX+0, nY+6 ) );
- pBox->DrawRect( Rectangle( nX+1, nY+1, nX+1, nY+5 ) );
- pBox->DrawRect( Rectangle( nX+2, nY+2, nX+2, nY+4 ) );
- pBox->DrawRect( Rectangle( nX+3, nY+3, nX+3, nY+3 ) );
- if ( bBlack )
- {
- pBox->SetFillColor( aOldFillColor );
- pBox->DrawRect( Rectangle( nX+1, nY+2, nX+1, nY+4 ) );
- pBox->DrawRect( Rectangle( nX+2, nY+3, nX+2, nY+3 ) );
- }
- break;
- case WINDOWALIGN_TOP:
- if ( bBlack )
- pBox->SetFillColor( Color( COL_BLACK ) );
- pBox->DrawRect( Rectangle( nX+0, nY+0, nX+6, nY+0 ) );
- pBox->DrawRect( Rectangle( nX+1, nY+1, nX+5, nY+1 ) );
- pBox->DrawRect( Rectangle( nX+2, nY+2, nX+4, nY+2 ) );
- pBox->DrawRect( Rectangle( nX+3, nY+3, nX+3, nY+3 ) );
- if ( bBlack )
- {
- pBox->SetFillColor( aOldFillColor );
- pBox->DrawRect( Rectangle( nX+2, nY+1, nX+4, nY+1 ) );
- pBox->DrawRect( Rectangle( nX+3, nY+2, nX+3, nY+2 ) );
- }
- break;
- case WINDOWALIGN_RIGHT:
- if ( bBlack )
- pBox->SetFillColor( Color( COL_BLACK ) );
- pBox->DrawRect( Rectangle( nX+3, nY+0, nX+3, nY+6 ) );
- pBox->DrawRect( Rectangle( nX+2, nY+1, nX+2, nY+5 ) );
- pBox->DrawRect( Rectangle( nX+1, nY+2, nX+1, nY+4 ) );
- pBox->DrawRect( Rectangle( nX+0, nY+3, nX+0, nY+3 ) );
- if ( bBlack )
- {
- pBox->SetFillColor( aOldFillColor );
- pBox->DrawRect( Rectangle( nX+2, nY+2, nX+2, nY+4 ) );
- pBox->DrawRect( Rectangle( nX+1, nY+3, nX+1, nY+3 ) );
- }
- break;
- case WINDOWALIGN_BOTTOM:
- if ( bBlack )
- pBox->SetFillColor( Color( COL_BLACK ) );
- pBox->DrawRect( Rectangle( nX+0, nY+3, nX+6, nY+3 ) );
- pBox->DrawRect( Rectangle( nX+1, nY+2, nX+5, nY+2 ) );
- pBox->DrawRect( Rectangle( nX+2, nY+1, nX+4, nY+1 ) );
- pBox->DrawRect( Rectangle( nX+3, nY+0, nX+3, nY+0 ) );
- if ( bBlack )
- {
- pBox->SetFillColor( aOldFillColor );
- pBox->DrawRect( Rectangle( nX+2, nY+2, nX+4, nY+2 ) );
- pBox->DrawRect( Rectangle( nX+3, nY+1, nX+3, nY+1 ) );
- }
- break;
- }
-}
-Down
- - Timer starten
-
-Click
- - Timer abbrechen
-
-Timer
- if ( ??? )
- {
- - SetPressed( sal_True );
- - EndSelection();
- - Menu anzeigen
- - SetPressed( sal_False );
- }
-
-
-*/
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index 56f8dbaf4689..59d58f2913db 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,10 +126,8 @@ ScTablePage::ScTablePage( Window* pParent, const SfxItemSet& rCoreAttrs ) :
aBtnTopDown ( this, ScResId( BTN_TOPDOWN ) ),
aBtnLeftRight ( this, ScResId( BTN_LEFTRIGHT ) ),
aBmpPageDir ( this, ScResId( BMP_PAGEDIR ) ),
- aImgLeftRight ( ScResId( IMG_LEFTRIGHT ) ),
- aImgTopDown ( ScResId( IMG_TOPDOWN ) ),
- aImgLeftRightHC ( ScResId( IMG_LEFTRIGHT_H ) ),
- aImgTopDownHC ( ScResId( IMG_TOPDOWN_H ) ),
+ aImgLeftRight ( ScResId( IMG_LEFTRIGHT ) ),
+ aImgTopDown ( ScResId( IMG_TOPDOWN ) ),
aBtnPageNo ( this, ScResId( BTN_PAGENO ) ),
aEdPageNo ( this, ScResId( ED_PAGENO ) ),
aFlPrint ( this, ScResId( FL_PRINT ) ),
@@ -171,11 +170,8 @@ ScTablePage::ScTablePage( Window* pParent, const SfxItemSet& rCoreAttrs ) :
void ScTablePage::ShowImage()
{
- bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
bool bLeftRight = aBtnLeftRight.IsChecked();
- aBmpPageDir.SetImage( bHC ?
- (bLeftRight ? aImgLeftRightHC : aImgTopDownHC) :
- (bLeftRight ? aImgLeftRight : aImgTopDown) );
+ aBmpPageDir.SetImage( (bLeftRight ? aImgLeftRight : aImgTopDown) );
}
// -----------------------------------------------------------------------
@@ -306,7 +302,7 @@ sal_Bool ScTablePage::FillItemSet( SfxItemSet& rCoreSet )
{
const SfxItemSet& rOldSet = GetItemSet();
sal_uInt16 nWhichPageNo = GetWhich(SID_SCATTR_PAGE_FIRSTPAGENO);
- sal_Bool bDataChanged = sal_False;
+ sal_Bool bDataChanged = false;
//-----------
// sal_Bool-Flags
@@ -571,3 +567,4 @@ sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/src/attrdlg.src b/sc/source/ui/src/attrdlg.src
index af14f7362cb3..d228a0cb03cb 100644
--- a/sc/source/ui/src/attrdlg.src
+++ b/sc/source/ui/src/attrdlg.src
@@ -166,42 +166,3 @@ TabPage RID_SCPAGE_PROTECTION
Text [ en-US ] = "Print" ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/autofmt.src b/sc/source/ui/src/autofmt.src
index 2288c96a257c..b6405c9d8c91 100644
--- a/sc/source/ui/src/autofmt.src
+++ b/sc/source/ui/src/autofmt.src
@@ -33,8 +33,6 @@ ModalDialog RID_SCDLG_AUTOFORMAT
HelpId = CMD_SID_AUTOFORMAT ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 312 , 121 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? AutoFormat : Autoformat */
- /* ### ACHTUNG: Neuer Text in Resource? AutoFormat : Autoformat */
Text [ en-US ] = "AutoFormat" ;
Moveable = TRUE ;
Closeable = FALSE ;
@@ -64,7 +62,6 @@ ModalDialog RID_SCDLG_AUTOFORMAT
Hide = TRUE ;
Pos = MAP_APPFONT ( 172 , 146 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Breite/Hhe anpassen : ~Breite/Hhe anpassen */
Text [ en-US ] = "A~utoFit width and height" ;
TabStop = TRUE ;
};
@@ -147,7 +144,6 @@ ModalDialog RID_SCDLG_AUTOFORMAT
HelpID = "sc:PushButton:RID_SCDLG_AUTOFORMAT:BTN_ADD";
Pos = MAP_APPFONT ( 256 , 63 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Einfgen... : ~Einfgen... */
Text [ en-US ] = "~Add..." ;
TabStop = TRUE ;
};
@@ -156,7 +152,6 @@ ModalDialog RID_SCDLG_AUTOFORMAT
HelpID = "sc:PushButton:RID_SCDLG_AUTOFORMAT:BTN_REMOVE";
Pos = MAP_APPFONT ( 256 , 81 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
};
@@ -178,9 +173,6 @@ ModalDialog RID_SCDLG_AUTOFORMAT
};
String STR_ADD_TITLE
{
- /* ### ACHTUNG: Neuer Text in Resource? AutoFormat hinzufgen : Autoformat hinzufgen */
- /* ### ACHTUNG: Neuer Text in Resource? AutoFormat hinzufgen : Autoformat hinzufgen */
- /* ### ACHTUNG: Neuer Text in Resource? AutoFormat hinzufgen : AutoFormat hinzufgen */
Text [ en-US ] = "Add AutoFormat" ;
};
@@ -195,17 +187,14 @@ ModalDialog RID_SCDLG_AUTOFORMAT
};
String STR_DEL_TITLE
{
- /* ### ACHTUNG: Neuer Text in Resource? AutoFormat lschen : AutoFormat lschen */
Text [ en-US ] = "Delete AutoFormat" ;
};
String STR_DEL_MSG
{
- /* ### ACHTUNG: Neuer Text in Resource? Wollen Sie das AutoFormat # wirklich lschen? : Wollen Sie das AutoFormat # wirklich lschen? */
Text [ en-US ] = "Do you really want to delete the # AutoFomat?" ;
};
String STR_BTN_CLOSE
{
- /* ### ACHTUNG: Neuer Text in Resource? Schlie~en : Schlie~en */
Text [ en-US ] = "~Close" ;
};
String STR_JAN
@@ -218,7 +207,6 @@ ModalDialog RID_SCDLG_AUTOFORMAT
};
String STR_MAR
{
- /* ### ACHTUNG: Neuer Text in Resource? Mr : Mr */
Text [ en-US ] = "Mar" ;
};
String STR_NORTH
@@ -231,7 +219,6 @@ ModalDialog RID_SCDLG_AUTOFORMAT
};
String STR_SOUTH
{
- /* ### ACHTUNG: Neuer Text in Resource? Sd : Sd */
Text [ en-US ] = "South" ;
};
String STR_SUM
@@ -239,43 +226,3 @@ ModalDialog RID_SCDLG_AUTOFORMAT
Text [ en-US ] = "Total" ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/condfrmt.src b/sc/source/ui/src/condfrmt.src
index 4adc735a7f2d..accbbbc8a654 100644
--- a/sc/source/ui/src/condfrmt.src
+++ b/sc/source/ui/src/condfrmt.src
@@ -26,6 +26,7 @@
************************************************************************/
#include "condfrmt.hrc"
+
ModelessDialog RID_SCDLG_CONDFORMAT
{
OutputSize = TRUE ;
@@ -75,6 +76,8 @@ ModelessDialog RID_SCDLG_CONDFORMAT
< "not equal to" ; Default ; > ;
< "between" ; Default ; > ;
< "not between" ; Default ; > ;
+ < "duplicated values" ; Default ; > ;
+ < "non duplicated values" ; Default ; > ;
};
};
Edit EDT_COND1_1
@@ -186,6 +189,8 @@ ModelessDialog RID_SCDLG_CONDFORMAT
< "not equal to" ; Default ; > ;
< "between" ; Default ; > ;
< "not between" ; Default ; > ;
+ < "duplicated values" ; Default ; > ;
+ < "non duplicated values" ; Default ; > ;
};
};
Edit EDT_COND2_1
@@ -297,6 +302,8 @@ ModelessDialog RID_SCDLG_CONDFORMAT
< "not equal to" ; Default ; > ;
< "between" ; Default ; > ;
< "not between" ; Default ; > ;
+ < "duplicated values" ; Default ; > ;
+ < "non duplicated values" ; Default ; > ;
};
};
Edit EDT_COND3_1
@@ -384,17 +391,3 @@ ModelessDialog RID_SCDLG_CONDFORMAT
};
Text [ en-US ] = "Conditional Formatting" ;
};
-
-String LABEL_FORMARTTING_CONDITIONS
-{
- Text [ en-US ] = "Formatting Conditions" ;
-};
-String LABEL_CONDITIONS
-{
- Text [ en-US ] = "Conditions" ;
-};
-String LABEL_CONDITION_VALUE
-{
- Text [ en-US ] = "Condition Value" ;
-};
-
diff --git a/sc/source/ui/src/crnrdlg.src b/sc/source/ui/src/crnrdlg.src
index 7dac2b7e6b81..29ed6772d896 100644
--- a/sc/source/ui/src/crnrdlg.src
+++ b/sc/source/ui/src/crnrdlg.src
@@ -25,6 +25,7 @@
*
************************************************************************/
#include "crnrdlg.hrc"
+
ModelessDialog RID_SCDLG_COLROWNAMERANGES
{
OutputSize = TRUE ;
@@ -140,36 +141,3 @@ ModelessDialog RID_SCDLG_COLROWNAMERANGES
};
Text [ en-US ] = "Define Label Range" ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/datafdlg.src b/sc/source/ui/src/datafdlg.src
new file mode 100644
index 000000000000..1cb3578f4546
--- /dev/null
+++ b/sc/source/ui/src/datafdlg.src
@@ -0,0 +1,99 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Amelia Wang <amwang@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "datafdlg.hrc"
+
+//zhangyun, dataform
+ModalDialog RID_SCDLG_DATAFORM
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 191 , 180 ) ;
+ Text [ en-US ] = "Data Form" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ FixedText LAB_DATAFORM_RECORDNO
+ {
+ Pos = MAP_APPFONT ( 136 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ Text [ en-US ] = "/" ;
+ };
+ PushButton BTN_DATAFORM_NEW
+ {
+ Pos = MAP_APPFONT ( 135 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ Text [ en-US ] = "New" ;
+ };
+ PushButton BTN_DATAFORM_DELETE
+ {
+ Pos = MAP_APPFONT ( 135 , 40 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Delete" ;
+ };
+ PushButton BTN_DATAFORM_RESTORE
+ {
+ Pos = MAP_APPFONT ( 135 , 57 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Restore" ;
+ };
+ PushButton BTN_DATAFORM_LAST
+ {
+ Pos = MAP_APPFONT ( 135 , 82 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Last Record" ;
+ };
+ PushButton BTN_DATAFORM_NEXT
+ {
+ Pos = MAP_APPFONT ( 135 , 99 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Next Record" ;
+ };
+ PushButton BTN_DATAFORM_CLOSE
+ {
+ Pos = MAP_APPFONT ( 135 , 116 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Close" ;
+ };
+ ScrollBar WND_DATAFORM_SCROLLBAR
+ {
+ Pos = MAP_APPFONT ( 124 , 6 ) ;
+ Size = MAP_APPFONT ( 8 , 135 ) ;
+ HScroll = FALSE ;
+ TabStop = FALSE ;
+ };
+ String STR_NEW_RECORD
+ {
+ Text [ en-US ] = "New Record" ;
+ };
+};
+//end
diff --git a/sc/source/ui/src/dbnamdlg.src b/sc/source/ui/src/dbnamdlg.src
index fa1c589c88f0..88454229b5d4 100644
--- a/sc/source/ui/src/dbnamdlg.src
+++ b/sc/source/ui/src/dbnamdlg.src
@@ -185,24 +185,3 @@ ModelessDialog RID_SCDLG_DBNAMES
Text [ en-US ] = "Invalid range" ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 30787b6e3b84..387b3ba14895 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -27,8 +27,6 @@
#include "globstr.hrc"
#include "sc.hrc"
-
-
Resource RID_GLOBSTR
{
String STR_UNDO_INSERTCELLS
@@ -619,6 +617,10 @@ Resource RID_GLOBSTR
{
Text [ en-US ] = "Page" ;
};
+ String STR_PGNUM
+ {
+ Text [ en-US ] = "Page %1" ;
+ };
String STR_LOAD_DOC
{
Text [ en-US ] = "Load document" ;
@@ -1718,6 +1720,77 @@ Resource RID_GLOBSTR
{
Text [ en-US ] = "Unknown User";
};
+
+ String STR_SHAPE_AUTOSHAPE
+ {
+ Text [ en-US ] = "AutoShape";
+ };
+
+ String STR_SHAPE_RECTANGLE
+ {
+ Text [ en-US ] = "Rectangle";
+ };
+
+ String STR_SHAPE_LINE
+ {
+ Text [ en-US ] = "Line";
+ };
+
+ String STR_SHAPE_OVAL
+ {
+ Text [ en-US ] = "Oval";
+ };
+
+ String STR_SHAPE_TEXTBOX
+ {
+ Text [ en-US ] = "Text Box";
+ };
+
+ String STR_FORM_BUTTON
+ {
+ Text [ en-US ] = "Button";
+ };
+
+ String STR_FORM_CHECKBOX
+ {
+ Text [ en-US ] = "Check Box";
+ };
+
+ String STR_FORM_OPTIONBUTTON
+ {
+ Text [ en-US ] = "Option Button";
+ };
+
+ String STR_FORM_LABEL
+ {
+ Text [ en-US ] = "Label";
+ };
+
+ String STR_FORM_LISTBOX
+ {
+ Text [ en-US ] = "List Box";
+ };
+
+ String STR_FORM_GROUPBOX
+ {
+ Text [ en-US ] = "Group Box";
+ };
+
+ String STR_FORM_DROPDOWN
+ {
+ Text [ en-US ] = "Drop Down";
+ };
+
+ String STR_FORM_SPINNER
+ {
+ Text [ en-US ] = "Spinner";
+ };
+
+ String STR_FORM_SCROLLBAR
+ {
+ Text [ en-US ] = "Scroll Bar";
+ };
+
String STR_STYLE_FAMILY_CELL
{
Text [ en-US ] = "Cell Styles";
@@ -1738,5 +1811,17 @@ Resource RID_GLOBSTR
{
Text [ en-US ] = "Pivot table needs at least two rows of data to create or refresh." ;
};
+ String STR_OPTIONS_WARN_SEPARATORS
+ {
+ Text [ en-US ] = "Because the current formula separator settings conflict with the locale, the formula separators have been reset to their default values.";
+ };
+ String STR_UNDO_INSERT_CURRENT_DATE
+ {
+ Text [ en-US ] = "Insert Current Date";
+ };
+ String STR_UNDO_INSERT_CURRENT_TIME
+ {
+ Text [ en-US ] = "Insert Current Time";
+ };
};
diff --git a/sc/source/ui/src/hdrcont.src b/sc/source/ui/src/hdrcont.src
index c4edc13e2f6f..d84a868dc9b4 100644
--- a/sc/source/ui/src/hdrcont.src
+++ b/sc/source/ui/src/hdrcont.src
@@ -43,7 +43,6 @@
Identifier = SID_CUT ; \
HelpId = CMD_SID_CUT ; \
Text [ en-US ] = "Cu~t" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Die Selektion in die Zwischenablage kopieren und lschen : Die Selektion in die Zwischenablage kopieren und lschen */\
};\
MenuItem\
{\
@@ -54,10 +53,8 @@
MenuItem\
{\
Identifier = SID_PASTE ; \
- HelpId = CMD_SID_PASTE ; \
- /* ### ACHTUNG: Neuer Text in Resource? Einfgen : Einfgen */\
+ HelpId = SID_PASTE ; \
Text [ en-US ] = "~Paste" ; \
- /* ### ACHTUNG: Neuer Text in Resource? Den Inhalt der Zwischenablage einfgen : Den Inhalt der Zwischenablage einfgen */\
};
//-------------------------------------------------------------------------------
@@ -73,17 +70,14 @@ Menu RID_POPUP_ROWHEADER
MenuItem
{
Identifier = FID_ROW_HEIGHT ;
- HelpId = CMD_FID_ROW_HEIGHT ;
- /* ### ACHTUNG: Neuer Text in Resource? Zeilenhhe... : Zeilenhhe... */
+ HelpId = FID_ROW_HEIGHT ;
Text [ en-US ] = "Row Hei~ght..." ;
};
MenuItem
{
Identifier = FID_ROW_OPT_HEIGHT ;
- HelpId = CMD_FID_ROW_OPT_HEIGHT ;
- /* ### ACHTUNG: Neuer Text in Resource? Optimale Zeilenhhe... : Optimale Zeilenhhe... */
+ HelpId = FID_ROW_OPT_HEIGHT ;
Text [ en-US ] = "Optimal ~Row Height..." ;
- /* ### ACHTUNG: Neuer Text in Resource? Optimale Zeilenhhe einstellen : Optimale Zeilenhhe einstellen */
};
//------------------------------
MenuItem { Separator = TRUE ; };
@@ -91,26 +85,20 @@ Menu RID_POPUP_ROWHEADER
MenuItem
{
Identifier = FID_INS_ROW ;
- HelpId = CMD_FID_INS_ROW ;
- /* ### ACHTUNG: Neuer Text in Resource? Zeilen einfgen : Zeilen einfgen */
+ HelpId = FID_INS_ROW ;
Text [ en-US ] = "~Insert Rows" ;
- /* ### ACHTUNG: Neuer Text in Resource? Ganze Zeilen einfgen : Ganze Zeilen einfgen */
};
MenuItem
{
Identifier = SID_DEL_ROWS ;
- HelpId = CMD_SID_DEL_ROWS ;
- /* ### ACHTUNG: Neuer Text in Resource? Zeilen lschen : Zeilen lschen */
+ HelpId = SID_DEL_ROWS ;
Text [ en-US ] = "~Delete Rows" ;
- /* ### ACHTUNG: Neuer Text in Resource? Ganze Zeilen lschen : Ganze Zeilen lschen */
};
MenuItem
{
Identifier = SID_DELETE ;
- HelpId = CMD_SID_DELETE ;
- /* ### ACHTUNG: Neuer Text in Resource? Inhalte l~schen... : Inhalte l~schen... */
+ HelpId = SID_DELETE ;
Text [ en-US ] = "De~lete Contents..." ;
- /* ### ACHTUNG: Neuer Text in Resource? Ausgewhlte Inhalte lschen (Formeln, Formate etc.) : Ausgewhlte Inhalte lschen (Formeln, Formate etc.) */
};
//------------------------------
MenuItem { Separator = TRUE ; };
@@ -155,7 +143,6 @@ Menu RID_POPUP_COLHEADER
Identifier = FID_COL_WIDTH ;
HelpId = CMD_FID_COL_WIDTH ;
Text [ en-US ] = "Col~umn Width..." ;
- /* ### ACHTUNG: Neuer Text in Resource? Spaltenbreite ndern : Spaltenbreite ndern */
};
MenuItem
{
@@ -169,26 +156,20 @@ Menu RID_POPUP_COLHEADER
MenuItem
{
Identifier = FID_INS_COLUMN ;
- HelpId = CMD_FID_INS_COLUMN ;
- /* ### ACHTUNG: Neuer Text in Resource? Spalten einfgen : Spalten einfgen */
+ HelpId = FID_INS_COLUMN ;
Text [ en-US ] = "~Insert Columns" ;
- /* ### ACHTUNG: Neuer Text in Resource? Ganze Spalten einfgen : Ganze Spalten einfgen */
};
MenuItem
{
Identifier = SID_DEL_COLS ;
- HelpId = CMD_SID_DEL_COLS ;
- /* ### ACHTUNG: Neuer Text in Resource? Spalten lschen : Spalten lschen */
+ HelpId = SID_DEL_COLS ;
Text [ en-US ] = "~Delete Columns" ;
- /* ### ACHTUNG: Neuer Text in Resource? Ganze Spalten lschen : Ganze Spalten lschen */
};
MenuItem
{
Identifier = SID_DELETE ;
- HelpId = CMD_SID_DELETE ;
- /* ### ACHTUNG: Neuer Text in Resource? Inhalte l~schen... : Inhalte l~schen... */
+ HelpId = SID_DELETE ;
Text [ en-US ] = "D~elete Contents..." ;
- /* ### ACHTUNG: Neuer Text in Resource? Ausgewhlte Inhalte lschen (Formeln, Formate etc.) : Ausgewhlte Inhalte lschen (Formeln, Formate etc.) */
};
//------------------------------
MenuItem { Separator = TRUE ; };
@@ -217,40 +198,3 @@ Menu RID_POPUP_COLHEADER
};
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/makefile.mk b/sc/source/ui/src/makefile.mk
index 96bb78e2902c..e1974edab4c1 100644
--- a/sc/source/ui/src/makefile.mk
+++ b/sc/source/ui/src/makefile.mk
@@ -33,9 +33,7 @@ TARGET=ui
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
# --- Files --------------------------------------------------------
@@ -53,6 +51,7 @@ SRC1FILES = \
dbnamdlg.src \
subtdlg.src \
miscdlgs.src \
+ datafdlg.src \
autofmt.src \
solvrdlg.src \
optsolver.src \
diff --git a/sc/source/ui/src/miscdlgs.src b/sc/source/ui/src/miscdlgs.src
index c40207e5eaf8..531970af1072 100644
--- a/sc/source/ui/src/miscdlgs.src
+++ b/sc/source/ui/src/miscdlgs.src
@@ -94,6 +94,7 @@ ModalDialog RID_SCDLG_DELCELL
Text [ en-US ] = "Selection" ;
};
};
+
ModalDialog RID_SCDLG_INSCELL
{
OutputSize = TRUE ;
@@ -467,37 +468,69 @@ ModalDialog RID_SCDLG_INSCONT
Size = MAP_APPFONT( 1 , 38 ) ;
};
};
+
ModalDialog RID_SCDLG_MOVETAB
{
OutputSize = TRUE ;
HelpId = CMD_FID_TAB_MOVE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 168 , 130 ) ;
+ Size = MAP_APPFONT ( 158 , 236 ) ;
Text [ en-US ] = "Move/Copy Sheet" ;
Moveable = TRUE ;
Closeable = FALSE ;
OKButton BTN_OK
{
- Pos = MAP_APPFONT ( 112 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 66 , 216 ) ;
+ Size = MAP_APPFONT ( 42 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
- Pos = MAP_APPFONT ( 112 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 110 , 216 ) ;
+ Size = MAP_APPFONT ( 42 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BTN_HELP
{
- Pos = MAP_APPFONT ( 112 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT ( 6 , 216 ) ;
+ Size = MAP_APPFONT ( 42 , 14 ) ;
TabStop = TRUE ;
};
- FixedText FT_DEST
+ FixedLine FL_SEP1
+ {
+ Pos = MAP_APPFONT ( 0 , 208 ) ;
+ Size = MAP_APPFONT (168 , 4 ) ;
+ };
+ FixedLine FL_ACTION
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
+ Size = MAP_APPFONT ( 146 , 8 ) ;
+ Text [ en-US ] = "Action" ;
+ };
+ RadioButton BTN_MOVE
+ {
+ Pos = MAP_APPFONT ( 12 , 17 ) ;
+ Size = MAP_APPFONT ( 114 , 10 ) ;
+ Text [ en-US ] = "~Move" ;
+ TabStop = TRUE ;
+ };
+ RadioButton BTN_COPY
+ {
+ Pos = MAP_APPFONT ( 12 , 30 ) ;
+ Size = MAP_APPFONT ( 114 , 10 ) ;
+ Text [ en-US ] = "~Copy" ;
+ TabStop = TRUE ;
+ };
+ FixedLine FL_LOCATION
+ {
+ Pos = MAP_APPFONT ( 6 , 43 ) ;
+ Size = MAP_APPFONT ( 146 , 8 ) ;
+ Text [ en-US ] = "Location" ;
+ };
+ FixedText FT_DEST
+ {
+ Pos = MAP_APPFONT ( 12 , 54 ) ;
Size = MAP_APPFONT ( 100 , 8 ) ;
Text [ en-US ] = "To ~document" ;
};
@@ -505,14 +538,14 @@ ModalDialog RID_SCDLG_MOVETAB
{
HelpID = "sc:ListBox:RID_SCDLG_MOVETAB:LB_DEST";
Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 17 ) ;
- Size = MAP_APPFONT ( 100 , 60 ) ;
+ Pos = MAP_APPFONT ( 12 , 65 ) ;
+ Size = MAP_APPFONT ( 134 , 60 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText FT_INSERT
{
- Pos = MAP_APPFONT ( 6 , 35 ) ;
+ Pos = MAP_APPFONT ( 12 , 83 ) ;
Size = MAP_APPFONT ( 100 , 8 ) ;
Text [ en-US ] = "~Insert before" ;
};
@@ -520,23 +553,57 @@ ModalDialog RID_SCDLG_MOVETAB
{
HelpID = "sc:ListBox:RID_SCDLG_MOVETAB:LB_INSERT";
Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 46 ) ;
- Size = MAP_APPFONT ( 100 , 62 ) ;
+ Pos = MAP_APPFONT ( 12 , 93 ) ;
+ Size = MAP_APPFONT ( 134 , 62 ) ;
TabStop = TRUE ;
};
- CheckBox BTN_COPY
+ FixedLine FL_NAME
{
- HelpID = "sc:CheckBox:RID_SCDLG_MOVETAB:BTN_COPY";
- Pos = MAP_APPFONT ( 6 , 114 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- Text [ en-US ] = "~Copy" ;
+ Pos = MAP_APPFONT ( 6 , 162 ) ;
+ Size = MAP_APPFONT ( 146 , 8 ) ;
+ Text [ en-US ] = "Name" ;
+ };
+ FixedText FT_TABNAME
+ {
+ Pos = MAP_APPFONT ( 12 , 173 ) ;
+ Size = MAP_APPFONT ( 100 , 8 ) ;
+ Text [ en-US ] = "New ~name" ;
+ };
+ Edit ED_INPUT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 183 ) ;
+ Size = MAP_APPFONT ( 134 , 12 ) ;
TabStop = TRUE ;
};
+ FixedText FT_TABNAME_WARN
+ {
+ Pos = MAP_APPFONT ( 12 , 197 ) ;
+ Size = MAP_APPFONT ( 134 , 8 ) ;
+ Text [ en-US ] = "..." ;
+ };
+ String STR_CURRENTDOC
+ {
+ Text [ en-US ] = "(current document)" ;
+ };
String STR_NEWDOC
{
Text [ en-US ] = "- new document -" ;
};
+ String STR_TABNAME_WARN_USED
+ {
+ Text [ en-US ] = "This name is already used." ;
+ };
+ String STR_TABNAME_WARN_EMPTY
+ {
+ Text [ en-US ] = "Name is empty." ;
+ };
+ String STR_TABNAME_WARN_INVALID
+ {
+ Text [ en-US ] = "Name contains one or more invalid characters." ;
+ };
};
+
ModalDialog RID_SCDLG_STRINPUT
{
HelpID = "sc:ModalDialog:RID_SCDLG_STRINPUT";
@@ -578,6 +645,7 @@ ModalDialog RID_SCDLG_STRINPUT
Size = MAP_APPFONT ( 110 , 8 ) ;
};
};
+
ModalDialog RID_SCDLG_TAB_BG_COLOR
{
HelpID = "sc:ModalDialog:RID_SCDLG_TAB_BG_COLOR";
@@ -623,108 +691,6 @@ ModalDialog RID_SCDLG_TAB_BG_COLOR
DefButton = FALSE ;
};
};
-/*
-ModalDialog RID_SCDLG_TAB_BG_COLOR
-{
- HelpID = "sc:ModalDialog:RID_SCDLG_TAB_BG_COLOR";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 180 , 150 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Control TAB_BG_COLOR_CT_BORDER
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 1 , 1 ) ; //12, 32
- Size = MAP_APPFONT ( 116+2 , 145+2 ) ;
- DialogControl = TRUE;
- };
- Control TAB_BG_COLOR_SET_BGDCOLOR
- {
- // * HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;
- Hide = FALSE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 116 , 145 ) ;
- TabStop = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 125 , 50 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 125 , 67 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = FALSE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 125 , 84 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = FALSE ;
- };
-};
-*/
-/*
-ModalDialog RID_SCDLG_MTRINPUT
-{
- HelpID = "sc:ModalDialog:RID_SCDLG_MTRINPUT";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 190 , 63 ) ;
- Moveable = TRUE ;
- Closeable = FALSE ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 136 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 136 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 136 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_LABEL
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- };
- MetricField ED_VALUE
- {
- // HelpID, weil die generierten aus den Ableitungen nicht in die hid.lst kommen
- HelpId = HID_SC_MTRIN_VAL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 70 , 6 ) ;
- Size = MAP_APPFONT ( 60 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- };
- CheckBox BTN_DEFVAL
- {
- HelpID = "sc:CheckBox:RID_SCDLG_MTRINPUT:BTN_DEFVAL";
- // HelpID, weil die generierten aus den Ableitungen nicht in die hid.lst kommen
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 70 , 24 ) ;
- Size = MAP_APPFONT ( 58 , 10 ) ;
- Text [ en-US ] = "~Default value" ;
- };
-};
-*/
ModalDialog RID_SCDLG_COL_MAN
{
@@ -1539,6 +1505,3 @@ ModalDialog RID_SCDLG_CHARTCOLROW
};
Text [ en-US ] = "Change Source Data Range" ;
};
-
-
-
diff --git a/sc/source/ui/src/namedlg.src b/sc/source/ui/src/namedlg.src
index f5fa0d822b12..ab8cd31088e8 100644
--- a/sc/source/ui/src/namedlg.src
+++ b/sc/source/ui/src/namedlg.src
@@ -59,7 +59,6 @@ ModelessDialog RID_SCDLG_NAMES
HelpID = "sc:PushButton:RID_SCDLG_NAMES:BTN_ADD";
Pos = MAP_APPFONT ( 166 , 74 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Hinzu~fgen : Hinzu~fgen */
Text [ en-US ] = "~Add" ;
TabStop = TRUE ;
DefButton = TRUE ;
@@ -69,7 +68,6 @@ ModelessDialog RID_SCDLG_NAMES
HelpID = "sc:PushButton:RID_SCDLG_NAMES:BTN_REMOVE";
Pos = MAP_APPFONT ( 166 , 92 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
};
@@ -159,17 +157,14 @@ ModelessDialog RID_SCDLG_NAMES
};
String STR_ADD
{
- /* ### ACHTUNG: Neuer Text in Resource? Hinzu~fgen : Hinzu~fgen */
Text [ en-US ] = "~Add" ;
};
String STR_MODIFY
{
- /* ### ACHTUNG: Neuer Text in Resource? ~ndern : ~ndern */
Text [ en-US ] = "Mod~ify" ;
};
String STR_INVALIDSYMBOL
{
- /* ### ACHTUNG: Neuer Text in Resource? Ungltiger Ausdruck : Ungltiger Ausdruck */
Text [ en-US ] = "Invalid expression" ;
};
};
diff --git a/sc/source/ui/src/opredlin.src b/sc/source/ui/src/opredlin.src
index 8cabbca238f6..fc29e8b0a0a1 100644
--- a/sc/source/ui/src/opredlin.src
+++ b/sc/source/ui/src/opredlin.src
@@ -101,40 +101,3 @@ TabPage RID_SCPAGE_OPREDLINE
Text [ en-US ] = "By author" ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src
index 9bcc3c71f4f7..f69d0febff4f 100644
--- a/sc/source/ui/src/optdlg.src
+++ b/sc/source/ui/src/optdlg.src
@@ -96,7 +96,6 @@ TabPage RID_SCPAGE_CALC
HelpID = "sc:RadioButton:RID_SCPAGE_CALC:BTN_DATESC10";
Pos = MAP_APPFONT ( 139 , 28 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? 01.01.1900 ( Star~Calc 1.0 ) : StarCa~lc 1.0 */
Text [ en-US ] = "01/01/1900 (Star~Calc 1.0)" ;
QuickHelpText [ en-US ] = "Value 0 corresponds to 01/01/1900" ;
};
@@ -105,7 +104,6 @@ TabPage RID_SCPAGE_CALC
HelpID = "sc:RadioButton:RID_SCPAGE_CALC:BTN_DATE1904";
Pos = MAP_APPFONT ( 139 , 42 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~01.01.1904 : ~1904 */
Text [ en-US ] = "~01/01/1904" ;
QuickHelpText [ en-US ] = "0 corresponds to 01/01/1904" ;
};
@@ -120,11 +118,6 @@ TabPage RID_SCPAGE_CALC
Size = MAP_APPFONT ( 121 , 8 ) ;
Text [ en-US ] = "Date" ;
};
- FixedLine FL_H_SEPARATOR
- {
- Pos = MAP_APPFONT ( 6 , 64 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- };
CheckBox BTN_CASE
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_CASE";
@@ -164,13 +157,13 @@ TabPage RID_SCPAGE_CALC
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_GENERAL_PREC";
Pos = MAP_APPFONT ( 12 , 147 ) ;
- Size = MAP_APPFONT ( 148 , 10 ) ;
- Text [ en-US ] = "Limit decimals for general number format" ;
+ Size = MAP_APPFONT ( 164 , 10 ) ;
+ Text [ en-US ] = "~Limit decimals for general number format" ;
};
FixedText FT_PREC
{
- Pos = MAP_APPFONT ( 138 , 148 ) ;
- Size = MAP_APPFONT ( 84 , 8 ) ;
+ Pos = MAP_APPFONT ( 169 , 147 ) ;
+ Size = MAP_APPFONT ( 53 , 8 ) ;
Text [ en-US ] = "~Decimal places" ;
Right = TRUE ;
};
@@ -178,7 +171,7 @@ TabPage RID_SCPAGE_CALC
{
HelpID = "sc:NumericField:RID_SCPAGE_CALC:ED_PREC";
Border = TRUE ;
- Pos = MAP_APPFONT ( 226 , 146 ) ;
+ Pos = MAP_APPFONT ( 226 , 145 ) ;
Size = MAP_APPFONT ( 25 , 12 ) ;
Maximum = 20 ;
Spin = TRUE ;
@@ -192,6 +185,149 @@ TabPage RID_SCPAGE_CALC
/* */
/**************************************************************************/
+TabPage RID_SCPAGE_FORMULA
+{
+ HelpId = HID_SCPAGE_FORMULA ;
+ SVLook = TRUE ;
+ Hide = TRUE ;
+ Pos = MAP_APPFONT ( 0 , 0 ) ;
+ Size = MAP_APPFONT ( 260 , 185 ) ;
+
+ FixedLine FL_FORMULA_OPTIONS
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 248 , 8 ) ;
+ Text [ en-US ] = "Formula options";
+ };
+
+ FixedText FT_FORMULA_SYNTAX
+ {
+ Pos = MAP_APPFONT ( 21, 16 ) ;
+ Size = MAP_APPFONT ( 80, 8 ) ;
+ Text [ en-US ] = "Formula ~syntax" ;
+ };
+
+ ListBox LB_FORMULA_SYNTAX
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 85, 14 ) ;
+ Size = MAP_APPFONT ( 60, 46 ) ;
+ DropDown = TRUE ;
+ StringList [ en-US ] =
+ {
+ < "Calc A1" ; Default ; > ;
+ < "Excel A1" ; Default ; > ;
+ < "Excel R1C1" ; Default ; > ;
+ };
+ };
+
+ CheckBox CB_ENGLISH_FUNC_NAME
+ {
+ Pos = MAP_APPFONT ( 12, 31 ) ;
+ Size = MAP_APPFONT ( 120, 8 ) ;
+ Text [ en-US ] = "Use English function names" ;
+ };
+
+ FixedLine FL_FORMULA_SEPS
+ {
+ Pos = MAP_APPFONT ( 6 , 46 ) ;
+ Size = MAP_APPFONT ( 248 , 8 ) ;
+ Text [ en-US ] = "Separators";
+ };
+
+ FixedText FT_FORMULA_SEP_ARG
+ {
+ Pos = MAP_APPFONT ( 21, 59 );
+ Size = MAP_APPFONT ( 60, 8 );
+ Text [ en-US ] = "~Function";
+ };
+
+ Edit ED_FORMULA_SEP_ARG
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT ( 75, 57 );
+ Size = MAP_APPFONT ( 10, 12 );
+ };
+
+ FixedText FT_FORMULA_SEP_ARRAY_C
+ {
+ Pos = MAP_APPFONT ( 21, 77 );
+ Size = MAP_APPFONT ( 60, 8 );
+ Text [ en-US ] = "Array co~lumn";
+ };
+
+ Edit ED_FORMULA_SEP_ARRAY_C
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT ( 75, 75 );
+ Size = MAP_APPFONT ( 10, 12 );
+ };
+
+ FixedText FT_FORMULA_SEP_ARRAY_R
+ {
+ Pos = MAP_APPFONT ( 21, 95 );
+ Size = MAP_APPFONT ( 60, 8 );
+ Text [ en-US ] = "Array ~row";
+ };
+
+ Edit ED_FORMULA_SEP_ARRAY_R
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT ( 75, 93 );
+ Size = MAP_APPFONT ( 10, 12 );
+ };
+
+ PushButton BTN_FORMULA_SEP_RESET
+ {
+ Pos = MAP_APPFONT ( 21, 113 );
+ Size = MAP_APPFONT ( 40, 14 );
+ Text [ en-US ] = "Rese~t";
+ };
+};
+
+TabPage RID_SCPAGE_COMPATIBILITY
+{
+ HelpId = HID_SCPAGE_COMPATIBILITY ;
+ SVLook = TRUE ;
+ Hide = TRUE ;
+ Pos = MAP_APPFONT ( 0 , 0 ) ;
+ Size = MAP_APPFONT ( 260 , 185 ) ;
+
+ FixedLine FL_KEY_BINDINGS
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 248 , 8 ) ;
+ Text [ en-US ] = "Key bindings";
+ };
+
+ FixedText FT_KEY_BINDINGS
+ {
+ Pos = MAP_APPFONT ( 12, 16 ) ;
+ Size = MAP_APPFONT ( 165, 24 ) ;
+ Wordbreak = TRUE;
+ Text [ en-US ] = "Select desired ~key binding type. Changing the key binding type may overwrite some of the existing key bindings." ;
+ };
+
+ ListBox LB_KEY_BINDINGS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 179, 20 ) ;
+ Size = MAP_APPFONT ( 75, 46 ) ;
+ DropDown = TRUE ;
+ StringList [ en-US ] =
+ {
+ < "Default" ; Default ; > ;
+ < "OpenOffice.org legacy" ; Default ; > ;
+ };
+ };
+};
+
+/**************************************************************************/
+/* */
+/* */
+/* */
+/**************************************************************************/
+
TabPage RID_SCPAGE_USERLISTS
{
HelpId = HID_SCPAGE_USERLISTS ;
@@ -216,7 +352,6 @@ TabPage RID_SCPAGE_USERLISTS
{
Pos = MAP_APPFONT ( 105 , 3 ) ;
Size = MAP_APPFONT ( 93 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Ein~trge : Ein~trge */
Text [ en-US ] = "~Entries" ;
};
MultiLineEdit ED_ENTRIES
@@ -239,7 +374,6 @@ TabPage RID_SCPAGE_USERLISTS
{
Pos = MAP_APPFONT ( 6 , 168 ) ;
Size = MAP_APPFONT ( 62 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Liste kopieren ~aus : Liste kopieren aus */
Text [ en-US ] = "Copy list ~from" ;
};
PushButton BTN_NEW
@@ -254,7 +388,6 @@ TabPage RID_SCPAGE_USERLISTS
HelpID = "sc:PushButton:RID_SCPAGE_USERLISTS:BTN_ADD";
Pos = MAP_APPFONT ( 204 , 36 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Hinzufgen : ~Hinzufgen */
Text [ en-US ] = "~Add" ;
Disable = TRUE ;
};
@@ -263,7 +396,6 @@ TabPage RID_SCPAGE_USERLISTS
HelpID = "sc:PushButton:RID_SCPAGE_USERLISTS:BTN_REMOVE";
Pos = MAP_APPFONT ( 204 , 54 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
Text [ en-US ] = "~Delete" ;
};
PushButton BTN_COPY
@@ -279,7 +411,6 @@ TabPage RID_SCPAGE_USERLISTS
};
String STR_QUERYREMOVE
{
- /* ### ACHTUNG: Neuer Text in Resource? Soll der Eintrag\n#\ngelscht werden? : Soll der Eintrag\n#\ngelscht werden? */
Text [ en-US ] = "Should the entry\n#\nbe deleted?" ;
};
String STR_COPYLIST
diff --git a/sc/source/ui/src/optsolver.src b/sc/source/ui/src/optsolver.src
index 4928c4d7dfa8..e5954f51f0cd 100644
--- a/sc/source/ui/src/optsolver.src
+++ b/sc/source/ui/src/optsolver.src
@@ -437,8 +437,6 @@ ModelessDialog RID_SCDLG_OPTSOLVER
DefButton = TRUE ;
};
- // IMG_DEL_H not used - image is set dynamically
-
String STR_INVALIDINPUT
{
Text [ en-US ] = "Invalid input." ;
diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src
index e16f60acd7fc..f12667ebf818 100644
--- a/sc/source/ui/src/popup.src
+++ b/sc/source/ui/src/popup.src
@@ -43,8 +43,8 @@ Menu RID_POPUP_CELLS
MenuItem
{
Identifier = SID_CELL_FORMAT_RESET ;
- HelpId = CMD_SID_CELL_FORMAT_RESET ;
- Text [ en-US ] = "~Default Formatting" ;
+ HelpId = SID_CELL_FORMAT_RESET ;
+ Text [ en-US ] = "~Clear Direct Formatting" ;
};
//------------------------------
MenuItem { Separator = TRUE ; };
diff --git a/sc/source/ui/src/pseudo.src b/sc/source/ui/src/pseudo.src
index e3d27edf0ecb..73f78d1be0b8 100644
--- a/sc/source/ui/src/pseudo.src
+++ b/sc/source/ui/src/pseudo.src
@@ -25,38 +25,4 @@
*
************************************************************************/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#include <svx/svxids.hrc>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/sc.src b/sc/source/ui/src/sc.src
index dae422e15cd0..878c951cb058 100644
--- a/sc/source/ui/src/sc.src
+++ b/sc/source/ui/src/sc.src
@@ -27,13 +27,10 @@
#include "sc.hrc" // -> #include <sfx.hrc>
-
-
// App-Titel------------------------------------------------------
String RID_APPTITLE
{
- /* ### ACHTUNG: Neuer Text in Resource? StarCalc 4.0 : StarCalc 3.1 */
Text [ en-US ] = "%PRODUCTNAME Calc" ;
};
@@ -41,8 +38,6 @@ String RID_APPTITLE
// Icons & Bitmaps: ----------------------------------------------------------
-
-
// ???
String 30001 { Text = "Dummy1" ; };
String 30002 { Text = "Dummy2" ; };
diff --git a/sc/source/ui/src/scerrors.src b/sc/source/ui/src/scerrors.src
index bdb76b2b710c..2a2e2ad47169 100644
--- a/sc/source/ui/src/scerrors.src
+++ b/sc/source/ui/src/scerrors.src
@@ -132,7 +132,7 @@ Resource RID_ERRHDLSC
};
String SCWARN_IMPORT_SHEET_OVERFLOW & ERRCODE_RES_MASK
{
- Text [ en-US ] = "Some sheets could not be loaded because the maximum number of sheets was exceeded." ;
+ Text [ en-US ] = "Not all sheets have been loaded because the maximum number of sheets was exceeded.\n\nPlease be warned that re-saving this document will permanently delete those sheets that have not been loaded!" ;
};
String SCWARN_IMPORT_OPEN_FM3 & ERRCODE_RES_MASK
{
@@ -167,4 +167,3 @@ Resource RID_ERRHDLSC
Text [ en-US ] = "Format error discovered in the file in sub-document $(ARG1) at $(ARG2)(row,col).";
};
};
-
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 071eedf4a4a0..eac7f317be6a 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -24,6 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#include "sc.hrc" // -> #include <sfx.hrc>
// Strings fuer Interface-Namen ------------------------------------------
@@ -32,38 +33,47 @@ String SCSTR_APPLICATION
{
Text [ en-US ] = "%PRODUCTNAME Calc 6.0";
};
+
String SCSTR_50_APPLICATION
{
Text [ en-US ] = "StarCalc 5.0" ;
};
+
String SCSTR_40_APPLICATION
{
Text [ en-US ] = "StarCalc 4.0" ;
};
+
String SCSTR_30_APPLICATION
{
Text [ en-US ] = "StarCalc 3.0" ;
};
+
String SCSTR_LONG_SCDOC_NAME
{
Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION Spreadsheet";
};
+
String SCSTR_50_LONG_DOCNAME
{
Text [ en-US ] = "%PRODUCTNAME 5.0 Spreadsheet" ;
};
+
String SCSTR_40_LONG_DOCNAME
{
Text [ en-US ] = "%PRODUCTNAME 4.0 Spreadsheet" ;
};
+
String SCSTR_30_LONG_DOCNAME
{
Text [ en-US ] = "StarCalc 3.0 Spreadsheet" ;
};
+
String SCSTR_SHORT_SCDOC_NAME
{
Text [ en-US ] = "Spreadsheet" ;
};
+
String SCSTR_HUMAN_SCDOC_NAME
{
Text [ en-US ] = "Spreadsheet" ;
@@ -89,7 +99,6 @@ String SCSTR_FORMATSHELL
Text [ en-US ] = "Formats for Cells";
};
-
String SCSTR_DRAWSHELL
{
Text [ en-US ] = "Graphics objects" ;
@@ -119,6 +128,7 @@ String SCSTR_GRAPHICSHELL
{
Text [ en-US ] = "Graphics";
};
+
String SCSTR_PAGEBREAKSHELL
{
Text [ en-US ] = "Pagebreak";
@@ -150,148 +160,182 @@ String STR_ROWHEIGHT
{
Text [ en-US ] = "Height" ;
};
+
String STR_OPT_ROWHEIGHT
{
Text [ en-US ] = "Add" ;
};
+
String STR_ROWHEIGHT_TITLE
{
Text [ en-US ] = "Row Height" ;
};
+
String STR_OPT_ROWHEIGHT_TITLE
{
Text [ en-US ] = "Optimal Row Height" ;
};
+
String STR_COLWIDTH
{
Text [ en-US ] = "Width" ;
};
+
String STR_OPT_COLWIDTH
{
Text [ en-US ] = "Add" ;
};
+
String STR_COLWIDTH_TITLE
{
Text [ en-US ] = "Column Width" ;
};
+
String STR_OPT_COLWIDTH_TITLE
{
Text [ en-US ] = "Optimal Column Width" ;
};
+
String SCSTR_UNDEFINED
{
Text [ en-US ] = "- undefined -" ;
};
+
String SCSTR_NONE
{
Text [ en-US ] = "- none -" ;
};
+
String SCSTR_EMPTY
{
Text [ en-US ] = "- empty -" ;
};
+
String SCSTR_NOTEMPTY
{
Text [ en-US ] = "- not empty -" ;
};
+
String SCSTR_NEWTABLE
{
Text [ en-US ] = "- new sheet -" ;
};
+
String SCSTR_ALL
{
Text [ en-US ] = "- all -" ;
};
+
String SCSTR_STDFILTER
{
Text [ en-US ] = "Standard Filter..." ;
};
+
String SCSTR_TOP10FILTER
{
Text [ en-US ] = "Top 10" ;
};
+
String SCSTR_NONAME
{
Text [ en-US ] = "unnamed" ;
};
+
String SCSTR_COLUMN
{
Text [ en-US ] = "Column" ;
};
+
String SCSTR_ROW
{
Text [ en-US ] = "Row" ;
};
+
String SCSTR_NEW
{
Text [ en-US ] = "~New" ;
};
+
String SCSTR_ADD
{
Text [ en-US ] = "~Add" ;
};
+
String SCSTR_REMOVE
{
Text [ en-US ] = "~Delete" ;
};
+
String SCSTR_CANCEL
{
Text [ en-US ] = "Cance~l" ;
};
+
String SCSTR_MODIFY
{
Text [ en-US ] = "Modif~y" ;
};
-
String SCSTR_SHOWTABLE
{
Text [ en-US ] = "Show Sheet" ;
};
+
String SCSTR_HIDDENTABLES
{
Text [ en-US ] = "Hidden Sheets" ;
};
+
String SCSTR_SELECTDB
{
Text [ en-US ] = "Select Database Range" ;
};
+
String SCSTR_AREAS
{
Text [ en-US ] = "Ranges" ;
};
+
String SCSTR_TABLE
{
Text [ en-US ] = "Sheet" ;
};
+
String SCSTR_NAME
{
Text [ en-US ] = "Name" ;
};
+
String SCSTR_INSTABLE
{
Text [ en-US ] = "Insert Sheet" ;
};
+
String SCSTR_APDTABLE
{
Text [ en-US ] = "Append Sheet" ;
};
+
String SCSTR_RENAMETAB
{
Text [ en-US ] = "Rename Sheet" ;
};
+
String SCSTR_SET_TAB_BG_COLOR
{
Text [ en-US ] = "Tab Color" ;
};
+
String SCSTR_NO_TAB_BG_COLOR
{
Text [ en-US ] = "Default" ;
};
+
String SCSTR_RENAMEOBJECT
{
Text [ en-US ] = "Name Object";
};
+
String STR_INSERTGRAPHIC
{
Text [ en-US ] = "Insert Picture" ;
@@ -303,50 +347,62 @@ String SCSTR_HOR_JUSTIFY_LEFT
{
Text [ en-US ] = "Align left" ;
};
+
String SCSTR_HOR_JUSTIFY_CENTER
{
Text [ en-US ] = "Centered horizontally" ;
};
+
String SCSTR_HOR_JUSTIFY_RIGHT
{
Text [ en-US ] = "Align right" ;
};
+
String SCSTR_HOR_JUSTIFY_BLOCK
{
Text [ en-US ] = "Justify" ;
};
+
String SCSTR_HOR_JUSTIFY_REPEAT
{
Text [ en-US ] = "Repeat alignment" ;
};
+
String SCSTR_HOR_JUSTIFY_STANDARD
{
Text [ en-US ] = "Horizontal alignment default" ;
};
+
String SCSTR_VER_JUSTIFY_TOP
{
Text [ en-US ] = "Align to top" ;
};
+
String SCSTR_VER_JUSTIFY_CENTER
{
Text [ en-US ] = "Centered vertically" ;
};
+
String SCSTR_VER_JUSTIFY_BOTTOM
{
Text [ en-US ] = "Align to bottom" ;
};
+
String SCSTR_VER_JUSTIFY_STANDARD
{
Text [ en-US ] = "Vertical alignment default" ;
};
+
String SCSTR_ORIENTATION_TOPBOTTOM
{
Text [ en-US ] = "Top to bottom" ;
};
+
String SCSTR_ORIENTATION_BOTTOMTOP
{
Text [ en-US ] = "Bottom to Top" ;
};
+
String SCSTR_ORIENTATION_STANDARD
{
Text [ en-US ] = "Default orientation" ;
@@ -356,30 +412,37 @@ String SCSTR_PROTECTDOC
{
Text [ en-US ] = "Protect Document" ;
};
+
String SCSTR_UNPROTECTDOC
{
Text [ en-US ] = "Unprotect document" ;
};
+
String SCSTR_PROTECTTAB
{
Text [ en-US ] = "Protect Sheet" ;
};
+
String SCSTR_UNPROTECTTAB
{
Text [ en-US ] = "Unprotect sheet" ;
};
+
String SCSTR_CHG_PROTECT
{
Text [ en-US ] = "Protect Records" ;
};
+
String SCSTR_CHG_UNPROTECT
{
Text [ en-US ] = "Unprotect Records" ;
};
+
String SCSTR_PASSWORD
{
Text [ en-US ] = "Password:" ;
};
+
String SCSTR_PASSWORDOPT
{
Text [ en-US ] = "Password (optional):" ;
@@ -455,18 +518,22 @@ String SCSTR_VALID_MINIMUM
{
Text [ en-US ] = "~Minimum" ;
};
+
String SCSTR_VALID_MAXIMUM
{
Text [ en-US ] = "~Maximum" ;
};
+
String SCSTR_VALID_VALUE
{
Text [ en-US ] = "~Value" ;
};
+
String SCSTR_VALID_RANGE
{
Text [ en-US ] = "~Source" ;
};
+
String SCSTR_VALID_LIST
{
Text [ en-US ] = "~Entries" ;
@@ -505,26 +572,32 @@ String SCSTR_GRFILTER_OPENERROR
{
Text [ en-US ] = "Graphics file can not be opened" ;
};
+
String SCSTR_GRFILTER_IOERROR
{
Text [ en-US ] = "Graphics file can not be read" ;
};
+
String SCSTR_GRFILTER_FORMATERROR
{
Text [ en-US ] = "Unknown graphic format" ;
};
+
String SCSTR_GRFILTER_VERSIONERROR
{
Text [ en-US ] = "This graphic file version is not supported" ;
};
+
String SCSTR_GRFILTER_FILTERERROR
{
Text [ en-US ] = "Graphics filter not found" ;
};
+
String SCSTR_GRFILTER_TOOBIG
{
Text [ en-US ] = "Not enough memory available to insert graphics." ;
};
+
String SCSTR_UNDO_GRAFFILTER
{
Text [ en-US ] = "Graphics Filter" ;
@@ -718,6 +791,11 @@ String STR_ACC_DATAPILOT_SEL_DESCR
Text [ en-US ] = "Lists the fields that you can drag to one of the other three areas.";
};
+String STR_ACC_DATAPILOT_PAGE_DESCR
+{
+ Text [ en-US ] = "Fields that you drop here will be available as filter lists at the top of the final DataPilot table.";
+};
+
String SCSTR_MEDIASHELL
{
Text [ en-US ] = "Media Playback";
@@ -772,3 +850,7 @@ StringArray SCSTR_PRINT_OPTIONS
};
};
+String SCSTR_WARN_ME_IN_FUTURE_CHECK
+{
+ Text [ en-US ] = "Warn me about this in the future.";
+};
diff --git a/sc/source/ui/src/scwarngs.src b/sc/source/ui/src/scwarngs.src
index 9cd22567d77c..c3b8460c14df 100644
--- a/sc/source/ui/src/scwarngs.src
+++ b/sc/source/ui/src/scwarngs.src
@@ -28,8 +28,6 @@
#include "scwarngs.hxx"
#include "sc.hrc"
-
-
#define SH_MAX 0x7fff
Resource RID_WRNHDLSC
@@ -40,44 +38,6 @@ Resource RID_WRNHDLSC
};
String ERRCODE_SC_IMPORT_WRN_RNGOVRFLW & SH_MAX
{
- /* ### ACHTUNG: Neuer Text in Resource? Die Maximalanzahl von Zeilen wurde berschritten. berzhlige Zeilen wurden nicht mitimportiert! : Die Maximalanzahl von Zeilen wurde berschritten. berzhlige Zeilen wurden nicht mitimportiert! */
Text [ en-US ] = "The number of rows exceeded the maximum. Additional rows were not imported!" ;
};
- /*
- String ERRCODE_SC_ & SH_MAX
- {
- Text = "";
- };
-*/
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/simpref.src b/sc/source/ui/src/simpref.src
index 09e04c76ac14..ce8c51318347 100644
--- a/sc/source/ui/src/simpref.src
+++ b/sc/source/ui/src/simpref.src
@@ -26,16 +26,15 @@
************************************************************************/
#include "simpref.hrc"
+
ModelessDialog RID_SCDLG_SIMPLEREF
{
OutputSize = TRUE ;
- //HelpId = SID_DEFINE_DBNAME ;
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 222 , 60 ) ;
Text = "Bereich festlegen" ;
Moveable = TRUE ;
- // Closeable = TRUE; // Dieser Dialog hat einen Cancel-Button !
FixedText FT_ASSIGN
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
@@ -78,30 +77,3 @@ ModelessDialog RID_SCDLG_SIMPLEREF
TabStop = TRUE ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/solveroptions.src b/sc/source/ui/src/solveroptions.src
index dd1195effc64..106382fb9c79 100644
--- a/sc/source/ui/src/solveroptions.src
+++ b/sc/source/ui/src/solveroptions.src
@@ -97,7 +97,6 @@ ModalDialog RID_SCDLG_SOLVEROPTIONS
Text [ en-US ] = "Options" ;
};
-
ModalDialog RID_SCDLG_SOLVER_INTEGER
{
OutputSize = TRUE ;
@@ -190,4 +189,3 @@ ModalDialog RID_SCDLG_SOLVER_DOUBLE
};
Text [ en-US ] = "Edit Setting" ;
};
-
diff --git a/sc/source/ui/src/solvrdlg.src b/sc/source/ui/src/solvrdlg.src
index 8956e513734a..b1513ec8c2e1 100644
--- a/sc/source/ui/src/solvrdlg.src
+++ b/sc/source/ui/src/solvrdlg.src
@@ -26,6 +26,7 @@
************************************************************************/
#include "solvrdlg.hrc"
+
ModelessDialog RID_SCDLG_SOLVER
{
OutputSize = TRUE ;
@@ -121,7 +122,6 @@ ModelessDialog RID_SCDLG_SOLVER
};
String STR_INVALIDVAL
{
- /* ### ACHTUNG: Neuer Text in Resource? Unzulssiger Zielwert! : Unzulssiger Zielwert! */
Text [ en-US ] = "Invalid target value." ;
};
String STR_INVALIDVAR
@@ -134,7 +134,6 @@ ModelessDialog RID_SCDLG_SOLVER
};
String STR_NOFORMULA
{
- /* ### ACHTUNG: Neuer Text in Resource? Zelle mu eine Formel enthalten! : Zelle mu eine Formel enthalten! */
Text [ en-US ] = "Cell must contain a formula." ;
};
};
diff --git a/sc/source/ui/src/sortdlg.src b/sc/source/ui/src/sortdlg.src
index a6b02c729f29..9dd8b6f17d29 100644
--- a/sc/source/ui/src/sortdlg.src
+++ b/sc/source/ui/src/sortdlg.src
@@ -25,6 +25,7 @@
*
************************************************************************/
#include "sortdlg.hrc"
+
TabPage RID_SCPAGE_SORT_FIELDS
{
Hide = TRUE ;
@@ -125,6 +126,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
Text [ en-US ] = "T~hen by" ;
};
};
+
TabPage RID_SCPAGE_SORT_OPTIONS
{
Hide = TRUE ;
@@ -163,11 +165,22 @@ TabPage RID_SCPAGE_SORT_OPTIONS
Text [ en-US ] = "Include ~formats" ;
TabStop = TRUE ;
};
- CheckBox BTN_COPYRESULT
+ CheckBox BTN_NATURALSORT
{
HelpID = "sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT";
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
+ Text [ de ] = "Enable ~natural sort" ;
+ Text [ en-US ] = "Enable ~natural sort" ;
+ Text [ cs ] = "Aktivovat přirozené třídění" ;
+ Text [ sk ] = "Aktivovať prirodzené triedenie" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " " ;
+ };
+ CheckBox BTN_COPYRESULT
+ {
+ Pos = MAP_APPFONT ( 12 , 62 ) ;
+ Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Copy sort results to:" ;
TabStop = TRUE ;
};
@@ -175,7 +188,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
{
HelpID = "sc:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_OUTAREA";
Border = TRUE ;
- Pos = MAP_APPFONT ( 20 , 59 ) ;
+ Pos = MAP_APPFONT ( 20 , 73 ) ;
Size = MAP_APPFONT ( 93 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
@@ -185,14 +198,13 @@ TabPage RID_SCPAGE_SORT_OPTIONS
HelpID = "sc:Edit:RID_SCPAGE_SORT_OPTIONS:ED_OUTAREA";
Disable = TRUE ;
Border = TRUE ;
- Pos = MAP_APPFONT ( 119 , 59 ) ;
+ Pos = MAP_APPFONT ( 119 , 73 ) ;
Size = MAP_APPFONT ( 132 , 12 ) ;
TabStop = TRUE ;
};
CheckBox BTN_SORT_USER
{
- HelpID = "sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_SORT_USER";
- Pos = MAP_APPFONT ( 12 , 75 ) ;
+ Pos = MAP_APPFONT ( 12 , 89 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Custom sort ~order" ;
TabStop = TRUE ;
@@ -202,14 +214,14 @@ TabPage RID_SCPAGE_SORT_OPTIONS
HelpID = "sc:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_SORT_USER";
Disable = TRUE ;
Border = TRUE ;
- Pos = MAP_APPFONT ( 20 , 86 ) ;
+ Pos = MAP_APPFONT ( 20 , 100 ) ;
Size = MAP_APPFONT ( 231 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText FT_LANGUAGE
{
- Pos = MAP_APPFONT ( 12 , 104 ) ;
+ Pos = MAP_APPFONT ( 12 , 118 ) ;
Size = MAP_APPFONT ( 101 , 8 ) ;
Text [ en-US ] = "~Language";
};
@@ -217,7 +229,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
{
HelpID = "sc:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_LANGUAGE";
Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 115 ) ;
+ Pos = MAP_APPFONT ( 12 , 129 ) ;
Size = MAP_APPFONT ( 101 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
@@ -225,7 +237,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
FixedText FT_ALGORITHM
{
- Pos = MAP_APPFONT ( 119 , 104 ) ;
+ Pos = MAP_APPFONT ( 119 , 118 ) ;
Size = MAP_APPFONT ( 132 , 8 ) ;
Text [ en-US ] = "O~ptions";
};
@@ -233,40 +245,33 @@ TabPage RID_SCPAGE_SORT_OPTIONS
{
HelpID = "sc:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_ALGORITHM";
Border = TRUE ;
- Pos = MAP_APPFONT ( 119 , 115 ) ;
+ Pos = MAP_APPFONT ( 119 , 129 ) ;
Size = MAP_APPFONT ( 132 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedLine FL_DIRECTION
{
- Pos = MAP_APPFONT ( 6 , 133 ) ;
+ Pos = MAP_APPFONT ( 6 , 147 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Direction" ;
};
RadioButton BTN_TOP_DOWN
{
- HelpID = "sc:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_TOP_DOWN";
- Pos = MAP_APPFONT ( 12 , 144 ) ;
+ Pos = MAP_APPFONT ( 12 , 158 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Top to bottom (sort rows)" ;
TabStop = TRUE ;
};
RadioButton BTN_LEFT_RIGHT
{
- HelpID = "sc:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_LEFT_RIGHT";
- Pos = MAP_APPFONT ( 12 , 158 ) ;
+ Pos = MAP_APPFONT ( 12 , 172 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "L~eft to right (sort columns)" ;
TabStop = TRUE ;
};
- FixedText FT_AREA_LABEL
- {
- Pos = MAP_APPFONT ( 6 , 171 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Data area:" ;
- };
};
+
TabDialog RID_SCDLG_SORT
{
OutputSize = TRUE ;
diff --git a/sc/source/ui/src/subtdlg.src b/sc/source/ui/src/subtdlg.src
index 4a7504ce2b15..7f3d01e7d99b 100644
--- a/sc/source/ui/src/subtdlg.src
+++ b/sc/source/ui/src/subtdlg.src
@@ -52,7 +52,6 @@ TabPage RID_SCPAGE_SUBT_OPTIONS
HelpID = "sc:CheckBox:RID_SCPAGE_SUBT_OPTIONS:BTN_CASE";
Pos = MAP_APPFONT ( 12 , 28 ) ;
Size = MAP_APPFONT ( 239 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Gro-/Kleinschreibung beachten : ~Gro-/Kleinschreibung beachten */
Text [ en-US ] = "~Case sensitive" ;
TabStop = TRUE ;
};
@@ -69,7 +68,6 @@ TabPage RID_SCPAGE_SUBT_OPTIONS
HelpID = "sc:CheckBox:RID_SCPAGE_SUBT_OPTIONS:BTN_FORMATS";
Pos = MAP_APPFONT ( 12 , 101 ) ;
Size = MAP_APPFONT ( 239 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Formate einschlieen : ~Formate einschlieen */
Text [ en-US ] = "I~nclude formats" ;
TabStop = TRUE ;
};
@@ -142,7 +140,6 @@ TabPage RID_SUBTBASE
{
Pos = MAP_APPFONT ( 6 , 32 ) ;
Size = MAP_APPFONT ( 121 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Teilergebnisse berechnen fr : ~Teilergebnisse berechnen fr */
Text [ en-US ] = "~Calculate subtotals for" ;
};
Control WND_COLUMNS
@@ -189,10 +186,12 @@ TabPage RID_SCPAGE_SUBT_GROUP1 < RID_SUBTBASE
{
HelpId = HID_SCPAGE_SUBT_GROUP1 ;
};
+
TabPage RID_SCPAGE_SUBT_GROUP2 < RID_SUBTBASE
{
HelpId = HID_SCPAGE_SUBT_GROUP2 ;
};
+
TabPage RID_SCPAGE_SUBT_GROUP3 < RID_SUBTBASE
{
HelpId = HID_SCPAGE_SUBT_GROUP3 ;
@@ -240,60 +239,7 @@ TabDialog RID_SCDLG_SUBTOTALS
{
Pos = MAP_APPFONT ( 143 , 160 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/tabopdlg.src b/sc/source/ui/src/tabopdlg.src
index 1bda4236942c..d2c74783df8d 100644
--- a/sc/source/ui/src/tabopdlg.src
+++ b/sc/source/ui/src/tabopdlg.src
@@ -26,6 +26,7 @@
************************************************************************/
#include "tabopdlg.hrc"
+
ModelessDialog RID_SCDLG_TABOP
{
OutputSize = TRUE ;
diff --git a/sc/source/ui/src/textdlgs.src b/sc/source/ui/src/textdlgs.src
index 2b0e408262ba..66883a39ebd6 100644
--- a/sc/source/ui/src/textdlgs.src
+++ b/sc/source/ui/src/textdlgs.src
@@ -25,8 +25,6 @@
*
************************************************************************/
-
-
#include <svx/dialogs.hrc>
#include "sc.hrc"
@@ -84,7 +82,6 @@ TabDialog RID_SCDLG_CHAR
{
Pos = MAP_APPFONT ( 169 , 151 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Zurck : Zurck */
Text [ en-US ] = "Back" ;
TabStop = TRUE ;
};
@@ -108,17 +105,9 @@ TabDialog RID_SCDLG_PARAGRAPH
PageItem
{
Identifier = RID_SVXPAGE_STD_PARAGRAPH ;
- /* ### ACHTUNG: Neuer Text in Resource? Einzge und Abstnde : Einzge und Abstnde */
Text [ en-US ] = "Indents & Spacing" ;
PageResID = RID_SVXPAGE_STD_PARAGRAPH ;
};
- /*
- PageItem {
- Identifier = RID_SVXPAGE_EXT_PARAGRAPH;
- Text [ en-US ] = "Paragraph (Extensions)";
- PageResID = RID_SVXPAGE_EXT_PARAGRAPH;
- };
-*/
PageItem
{
Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ;
@@ -160,38 +149,7 @@ TabDialog RID_SCDLG_PARAGRAPH
{
Pos = MAP_APPFONT ( 169 , 151 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Zurck : Zurck */
Text [ en-US ] = "Back" ;
TabStop = TRUE ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/toolbox.src b/sc/source/ui/src/toolbox.src
index 83ab7338970d..27c4531a59f6 100644
--- a/sc/source/ui/src/toolbox.src
+++ b/sc/source/ui/src/toolbox.src
@@ -104,7 +104,6 @@ String SCSTR_QHELP_BTNCALC
String SCSTR_QHELP_BTNOK
{
- /* ### ACHTUNG: Neuer Text in Resource? bernehmen : bernehmen */
Text [ en-US ] = "Accept" ;
};
@@ -123,6 +122,133 @@ String SCSTR_QHELP_BTNEQUAL
Text [ en-US ] = "Function" ;
};
+ // --------------------------------------------------------------------
+ // PopUp's fuer Werkzeugleiste
+ // --------------------------------------------------------------------
+
+FloatingWindow RID_TBXCTL_INSERT
+{
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ HelpID = RID_TBXCTL_INSERT ;
+ Text [ en-US ] = "Insert" ;
+
+ ToolBox RID_TOOLBOX_INSERT
+ {
+ MenuStrings = TRUE ;
+ SVLook = TRUE ;
+ HelpID = RID_TOOLBOX_INSERT ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = SID_INSERT_GRAPHIC ;
+ HelpID = SID_INSERT_GRAPHIC ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_CHARMAP ;
+ HelpId = SID_CHARMAP ;
+ };
+ };
+ };
+};
+
+FloatingWindow RID_TBXCTL_INSCELLS
+{
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ HelpID = RID_TBXCTL_INSCELLS ;
+ Text [ en-US ] = "Insert Cells" ;
+
+ ToolBox RID_TOOLBOX_INSCELLS
+ {
+ MenuStrings = TRUE ;
+ SVLook = TRUE ;
+ HelpID = RID_TOOLBOX_INSCELLS ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = FID_INS_CELLSDOWN ;
+ HelpId = FID_INS_CELLSDOWN ;
+ };
+ ToolBoxItem
+ {
+ Identifier = FID_INS_CELLSRIGHT ;
+ HelpId = FID_INS_CELLSRIGHT ;
+ };
+ ToolBoxItem
+ {
+ Identifier = FID_INS_ROW ;
+ HelpId = FID_INS_ROW ;
+ };
+ ToolBoxItem
+ {
+ Identifier = FID_INS_COLUMN ;
+ HelpId = FID_INS_COLUMN ;
+ };
+ };
+ };
+};
+
+FloatingWindow RID_TBXCTL_INSOBJ
+{
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Hide = TRUE ;
+ SVLook = TRUE;
+ HelpID = RID_TBXCTL_INSOBJ ;
+ Text [ en-US ] = "Insert Object" ;
+ ToolBox RID_TOOLBOX_INSOBJ
+ {
+ MenuStrings = TRUE ;
+ SVLook = TRUE ;
+ HelpID = RID_TOOLBOX_INSOBJ ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ // mit Aufziehen des Zielbereichs
+ ITEM_TOOLBAR_DRAW_CHART
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_INSERT_SMATH ;
+ HelpId = SID_INSERT_SMATH ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_INSERT_FLOATINGFRAME ;
+ HelpID = SID_INSERT_FLOATINGFRAME ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_INSERT_OBJECT ;
+ HelpId = SID_INSERT_OBJECT ;
+ };
+#ifdef SOLAR_PLUGIN
+ ToolBoxItem
+ {
+ Identifier = SID_INSERT_PLUGIN ;
+ HelpId = SID_INSERT_PLUGIN ;
+ };
+#endif
+#ifdef SOLAR_JAVA
+ ToolBoxItem
+ {
+ Identifier = SID_INSERT_APPLET ;
+ HelpId = SID_INSERT_APPLET ;
+ };
+#endif
+ };
+ };
+};
+
// Don't use this image list for normal toolbar images. We have now our commandimagelist
// folder in default_images. This list is now only used for special toolboxes that are
// used in floating windows.
@@ -130,11 +256,11 @@ String SCSTR_QHELP_BTNEQUAL
#define DEFAULT_IDLIST \
IdList = { \
/* Eingabezeile */ \
- SID_INPUT_FUNCTION; /* 20047 */ \
- SID_INPUT_SUM; /* 20048 */ \
- SID_INPUT_EQUAL; /* 20049 */ \
- SID_INPUT_CANCEL; \
- SID_INPUT_OK; \
+ SID_INPUT_FUNCTION; /* 26047 */ \
+ SID_INPUT_SUM; /* 26048 */ \
+ SID_INPUT_EQUAL; /* 26049 */ \
+ SID_INPUT_CANCEL; /* 26050 */ \
+ SID_INPUT_OK; /* 26051 */ \
}; \
IdCount = { \
5; \
@@ -153,17 +279,3 @@ ImageList RID_DEFAULTIMAGELIST_LC
MaskColor = STD_MASKCOLOR ;
DEFAULT_IDLIST
};
-
-ImageList RID_DEFAULTIMAGELIST_SCH
-{
- Prefix = "sch";
- MaskColor = SC_HC_MASKCOLOR ;
- DEFAULT_IDLIST
-};
-
-ImageList RID_DEFAULTIMAGELIST_LCH
-{
- Prefix = "lch";
- MaskColor = SC_HC_MASKCOLOR ;
- DEFAULT_IDLIST
-};
diff --git a/sc/source/ui/styleui/makefile.mk b/sc/source/ui/styleui/makefile.mk
index 9361033a34a4..16cdb2e7b791 100644
--- a/sc/source/ui/styleui/makefile.mk
+++ b/sc/source/ui/styleui/makefile.mk
@@ -32,9 +32,7 @@ TARGET=styleui
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -43,6 +41,9 @@ CXXFILES = \
styledlg.cxx
SLOFILES = \
+ $(EXCEPTIONSFILES)
+
+EXCEPTIONSFILES = \
$(SLO)$/styledlg.obj \
SRS1NAME=$(TARGET)
diff --git a/sc/source/ui/styleui/scstyles.src b/sc/source/ui/styleui/scstyles.src
index 1968b6dca877..b70db0e615e2 100644
--- a/sc/source/ui/styleui/scstyles.src
+++ b/sc/source/ui/styleui/scstyles.src
@@ -27,6 +27,7 @@
#include "sc.hrc"
#include <svl/style.hrc>
+
#define IMPL_FAMILY(family,filter) \
StyleFamily = family; \
FilterList = { filter }
@@ -43,14 +44,15 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
< STR_STYLE_FILTER_USED ; SFXSTYLEBIT_USED ; > ;
< STR_STYLE_FILTER_USERDEF ; SFXSTYLEBIT_USERDEF ; > ; ) ;
Text [ en-US ] = "Cell Styles" ;
-};
+ };
+
SfxStyleFamilyItem
{
IMPL_FAMILY ( SFX_STYLE_FAMILY_PAGE ,
< STR_STYLE_FILTER_ALL ; SFXSTYLEBIT_ALL ; > ;
< STR_STYLE_FILTER_USERDEF ; SFXSTYLEBIT_USERDEF ; > ; ) ;
Text [ en-US ] = "Page Styles" ;
-};
+ };
};
// style family images are now taken from an ImageList
@@ -60,11 +62,5 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
Prefix = "sf";
MaskColor = STD_MASKCOLOR ;
IdList = { 1; 2; };
-};
- ImageList 2 // == BMP_COLOR_HIGHCONTRAST + 1
- {
- Prefix = "sfh";
- MaskColor = SC_HC_MASKCOLOR ;
- IdList = { 1; 2; };
-};
+ };
};
diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx
index 08e7983d4dee..6a596b1d2eb0 100644
--- a/sc/source/ui/styleui/styledlg.cxx
+++ b/sc/source/ui/styleui/styledlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,14 +36,7 @@
//------------------------------------------------------------------
#include "scitems.hxx"
-//CHINA001 #include <svx/align.hxx>
-//CHINA001 #include <svx/backgrnd.hxx>
-//CHINA001 #include <svx/border.hxx>
-//CHINA001 #include <svx/chardlg.hxx>
-//CHINA001 #include <svx/numfmt.hxx>
-#include <svx/numinf.hxx> //CHINA001
-//CHINA001 #include <svx/page.hxx>
-//CHINA001 #include <svx/paragrph.hxx>
+#include <svx/numinf.hxx>
#include <sfx2/objsh.hxx>
#include <svl/style.hxx>
#include <svl/cjkoptions.hxx>
@@ -54,13 +48,13 @@
#include "scresid.hxx"
#include "sc.hrc"
#include "styledlg.hrc"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/svxids.hrc> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
-#include <svl/intitem.hxx> //CHINA001
-#include <editeng/flstitem.hxx> //CHINA001
-#include <svl/aeitem.hxx> //CHINA001
-#include <svx/flagsdef.hxx> //CHINA001
+#include <svx/svxdlg.hxx>
+#include <svx/svxids.hrc>
+#include <svx/dialogs.hrc>
+#include <svl/intitem.hxx>
+#include <editeng/flstitem.hxx>
+#include <svl/aeitem.hxx>
+#include <svx/flagsdef.hxx>
//==================================================================
ScStyleDlg::ScStyleDlg( Window* pParent,
@@ -70,59 +64,57 @@ ScStyleDlg::ScStyleDlg( Window* pParent,
: SfxStyleDialog ( pParent,
ScResId( nRscId ),
rStyleBase,
- sal_False ),
+ false ),
nDlgRsc ( nRscId )
{
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); //CHINA001
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+ DBG_ASSERT(pFact, "Dialogdiet fail!");
switch ( nRscId )
{
case RID_SCDLG_STYLES_PAR: // Zellformatvorlagen
{
SvtCJKOptions aCJKOptions;
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_NUMBER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_NUMBERFORMAT ) ); //CHINA001 AddTabPage( TP_NUMBER, &SvxNumberFormatTabPage::Create, &SvxNumberFormatTabPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_FONT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) ); //CHINA001 AddTabPage( TP_FONT, &SvxCharNamePage::Create, &SvxCharNamePage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_FONTEFF, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) ); //CHINA001 AddTabPage( TP_FONTEFF, &SvxCharEffectsPage::Create, &SvxCharEffectsPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT( pFact->GetTabPageRangesFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_ALIGNMENT ) ); //CHINA001 AddTabPage( TP_ALIGNMENT, &SvxAlignmentTabPage::Create, &SvxAlignmentTabPage::GetRanges );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_NUMBER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_NUMBERFORMAT ) );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_FONT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_FONTEFF, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT( pFact->GetTabPageRangesFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_ALIGNMENT ) );
if ( aCJKOptions.IsAsianTypographyEnabled() )
{
- //CHINA001 AddTabPage( TP_ASIAN, &SvxAsianTabPage::Create, &SvxAsianTabPage::GetRanges );
-
- DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");//CHINA001
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
AddTabPage( TP_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
}
else
RemoveTabPage( TP_ASIAN );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); //CHINA001 AddTabPage( TP_BORDER, &SvxBorderTabPage::Create, &SvxBorderTabPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); //CHINA001 AddTabPage( TP_BACKGROUND, &SvxBackgroundTabPage::Create, &SvxBackgroundTabPage::GetRanges );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
AddTabPage( TP_PROTECTION, &ScTabPageProtection::Create, &ScTabPageProtection::GetRanges );
}
break;
case RID_SCDLG_STYLES_PAGE: // Seitenvorlagen
{
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_PAGE_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ) ); //CHINA001 AddTabPage( TP_PAGE_STD, &SvxPageDescPage::Create, &SvxPageDescPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); //CHINA001 AddTabPage( TP_BORDER, &SvxBorderTabPage::Create, &SvxBorderTabPage::GetRanges );
- DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");//CHINA001
- DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");//CHINA001
- AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); //CHINA001 AddTabPage( TP_BACKGROUND, &SvxBackgroundTabPage::Create, &SvxBackgroundTabPage::GetRanges );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_PAGE_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ) );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
+ DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
+ DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
+ AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
AddTabPage( TP_PAGE_HEADER, &ScHeaderPage::Create, &ScHeaderPage::GetRanges );
AddTabPage( TP_PAGE_FOOTER, &ScFooterPage::Create, &ScFooterPage::GetRanges );
AddTabPage( TP_TABLE, &ScTablePage::Create, &ScTablePage::GetRanges );
@@ -130,7 +122,7 @@ ScStyleDlg::ScStyleDlg( Window* pParent,
break;
default:
- DBG_ERROR( "Family not supported" );
+ OSL_FAIL( "Family not supported" );
}
//--------------------------------------------------------------------
@@ -139,18 +131,18 @@ ScStyleDlg::ScStyleDlg( Window* pParent,
// -----------------------------------------------------------------------
-__EXPORT ScStyleDlg::~ScStyleDlg()
+ScStyleDlg::~ScStyleDlg()
{
}
// -----------------------------------------------------------------------
-void __EXPORT ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
+void ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
{
if ( nDlgRsc == RID_SCDLG_STYLES_PAR )
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
- SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); //CHINA001
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
switch ( nPageId )
{
case TP_NUMBER:
@@ -160,9 +152,6 @@ void __EXPORT ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage
DBG_ASSERT( pInfoItem, "NumberInfoItem nicht gefunden!" );
- //CHINA001 ((SvxNumberFormatTabPage&)rTabPage).
- //CHINA001 SetNumberFormatList(
- //CHINA001 (const SvxNumberInfoItem&)*pInfoItem ) ;
aSet.Put (SvxNumberInfoItem( (const SvxNumberInfoItem&)*pInfoItem ) );
rTabPage.PageCreated(aSet);
}
@@ -175,9 +164,6 @@ void __EXPORT ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage
DBG_ASSERT( pInfoItem, "FontListItem nicht gefunden!" );
- //CHINA001 ((SvxCharNamePage&)rTabPage).
- //CHINA001 SetFontList(
- //CHINA001 (const SvxFontListItem&)*pInfoItem );
aSet.Put (SvxFontListItem(((const SvxFontListItem&)*pInfoItem).GetFontList(), SID_ATTR_CHAR_FONTLIST));
rTabPage.PageCreated(aSet);
}
@@ -189,13 +175,12 @@ void __EXPORT ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage
}
else if ( nDlgRsc == RID_SCDLG_STYLES_PAGE )
{
- SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));//CHINA001
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
switch ( nPageId )
{
case TP_PAGE_STD:
- //CHINA001 ((SvxPageDescPage&)rTabPage).SetMode( SVX_PAGE_MODE_CENTER );
- aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_CENTER)); //CHINA001
- rTabPage.PageCreated(aSet); //CHINA001
+ aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_CENTER));
+ rTabPage.PageCreated(aSet);
break;
case TP_PAGE_HEADER:
@@ -206,8 +191,7 @@ void __EXPORT ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage
break;
case TP_BACKGROUND:
if( nDlgRsc == RID_SCDLG_STYLES_PAGE)
- //CHINA001 ((SvxBackgroundTabPage&)rTabPage).ShowSelector();
- { //add CHINA001
+ {
aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR));
rTabPage.PageCreated(aSet);
}
@@ -222,7 +206,7 @@ void __EXPORT ScStyleDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage
// -----------------------------------------------------------------------
-const SfxItemSet* __EXPORT ScStyleDlg::GetRefreshedSet()
+const SfxItemSet* ScStyleDlg::GetRefreshedSet()
{
SfxItemSet* pItemSet = GetInputSetImpl();
pItemSet->ClearItem();
@@ -232,3 +216,4 @@ const SfxItemSet* __EXPORT ScStyleDlg::GetRefreshedSet()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/styleui/styledlg.src b/sc/source/ui/styleui/styledlg.src
index 4c862e21ebd0..43029db3d3d4 100644
--- a/sc/source/ui/styleui/styledlg.src
+++ b/sc/source/ui/styleui/styledlg.src
@@ -27,6 +27,7 @@
#include "sc.hrc"
#include "styledlg.hrc" // -> TP_xxx
+
TabDialog RID_SCDLG_STYLES_PAR
{
OutputSize = TRUE ;
@@ -50,7 +51,6 @@ TabDialog RID_SCDLG_STYLES_PAR
PageItem
{
Identifier = TP_FONT ;
- /* ### ACHTUNG: Neuer Text in Resource? Schrift : Zeichen */
Text [ en-US ] = "Font" ;
};
PageItem
@@ -86,6 +86,7 @@ TabDialog RID_SCDLG_STYLES_PAR
};
};
};
+
TabDialog RID_SCDLG_STYLES_PAGE
{
OutputSize = TRUE ;
@@ -134,39 +135,3 @@ TabDialog RID_SCDLG_STYLES_PAGE
};
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx
index 0d5d719a6682..fab15bd8a996 100644
--- a/sc/source/ui/undo/areasave.cxx
+++ b/sc/source/ui/undo/areasave.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,7 +109,7 @@ void ScAreaLinkSaver::InsertNewLink( ScDocument* pDoc ) const
pLink->SetDestArea( aDestArea );
pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName, &aFilterName, &aSourceArea );
pLink->Update();
- pLink->SetInCreate( sal_False );
+ pLink->SetInCreate( false );
}
}
@@ -149,13 +150,13 @@ sal_Bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
if (pBase->ISA(ScAreaLink))
{
if ( nPos >= GetCount() || !(*this)[nPos]->IsEqual( *(ScAreaLink*)pBase ) )
- return sal_False;
+ return false;
++nPos;
}
}
if ( nPos < GetCount() )
- return sal_False; // fewer links in the document than in the save collection
+ return false; // fewer links in the document than in the save collection
}
return sal_True;
@@ -200,7 +201,6 @@ void ScAreaLinkSaveCollection::Restore( ScDocument* pDoc ) const
}
}
-// static
ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocument* pDoc )
{
ScAreaLinkSaveCollection* pColl = NULL;
@@ -228,3 +228,4 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum
return pColl;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/makefile.mk b/sc/source/ui/undo/makefile.mk
index 50fab82972ca..12c94fd32cc9 100644
--- a/sc/source/ui/undo/makefile.mk
+++ b/sc/source/ui/undo/makefile.mk
@@ -32,9 +32,7 @@ TARGET=undo
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -58,26 +56,23 @@ CXXFILES = \
SLOFILES = \
- $(SLO)$/target.obj \
- $(SLO)$/refundo.obj \
+ $(EXCEPTIONSFILES) \
+ $(SLO)$/target.obj
+
+EXCEPTIONSFILES= \
$(SLO)$/areasave.obj \
+ $(SLO)$/refundo.obj \
$(SLO)$/undobase.obj \
- $(SLO)$/undoutil.obj \
- $(SLO)$/undocell.obj \
- $(SLO)$/undostyl.obj \
- $(SLO)$/undoolk.obj \
$(SLO)$/undoblk.obj \
$(SLO)$/undoblk2.obj \
$(SLO)$/undoblk3.obj \
+ $(SLO)$/undocell.obj \
$(SLO)$/undodat.obj \
$(SLO)$/undodraw.obj \
- $(SLO)$/undotab.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/undoblk3.obj \
- $(SLO)$/undocell.obj \
- $(SLO)$/undostyl.obj \
- $(SLO)$/undotab.obj
+ $(SLO)$/undoolk.obj \
+ $(SLO)$/undostyl.obj \
+ $(SLO)$/undotab.obj \
+ $(SLO)$/undoutil.obj
# --- Tagets -------------------------------------------------------
diff --git a/sc/source/ui/undo/refundo.cxx b/sc/source/ui/undo/refundo.cxx
index dcbfc5b9e590..0376f7c7a9c4 100644
--- a/sc/source/ui/undo/refundo.cxx
+++ b/sc/source/ui/undo/refundo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -188,7 +189,7 @@ void ScRefUndoData::DoUndo( ScDocument* pDoc, sal_Bool bUndoRefFirst )
if (pDetOpList)
pDoc->SetDetOpList( new ScDetOpList(*pDetOpList) );
- // #65055# bUndoRefFirst ist bSetChartRangeLists
+ // bUndoRefFirst ist bSetChartRangeLists
if ( pChartListenerCollection )
pDoc->SetChartListenerCollection( new ScChartListenerCollection(
*pChartListenerCollection ), bUndoRefFirst );
@@ -196,7 +197,7 @@ void ScRefUndoData::DoUndo( ScDocument* pDoc, sal_Bool bUndoRefFirst )
if (pDBCollection || pRangeName)
{
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( sal_False ); // Mehrfachberechnungen vermeiden
+ pDoc->SetAutoCalc( false ); // Mehrfachberechnungen vermeiden
pDoc->CompileAll();
pDoc->SetDirty();
pDoc->SetAutoCalc( bOldAutoCalc );
@@ -212,3 +213,4 @@ void ScRefUndoData::DoUndo( ScDocument* pDoc, sal_Bool bUndoRefFirst )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/target.cxx b/sc/source/ui/undo/target.cxx
index 1c2e4a925378..d652e3f8931a 100644
--- a/sc/source/ui/undo/target.cxx
+++ b/sc/source/ui/undo/target.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,8 @@
TYPEINIT1(ScTabViewTarget, SfxRepeatTarget);
-__EXPORT ScTabViewTarget::~ScTabViewTarget()
+ScTabViewTarget::~ScTabViewTarget()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 6c6a14670285..7f3e5f8e094b 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,25 +62,12 @@ ScSimpleUndo::ScSimpleUndo( ScDocShell* pDocSh ) :
{
}
-__EXPORT ScSimpleUndo::~ScSimpleUndo()
+ScSimpleUndo::~ScSimpleUndo()
{
delete pDetectiveUndo;
}
-bool ScSimpleUndo::SetViewMarkData( const ScMarkData& rMarkData )
-{
- if ( IsPaintLocked() )
- return false;
-
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if ( !pViewShell )
- return false;
-
- pViewShell->SetMarkData( rMarkData );
- return true;
-}
-
-sal_Bool __EXPORT ScSimpleUndo::Merge( SfxUndoAction *pNextAction )
+sal_Bool ScSimpleUndo::Merge( SfxUndoAction *pNextAction )
{
// Zu jeder Undo-Action kann eine SdrUndoGroup fuer das Aktualisieren
// der Detektiv-Pfeile gehoeren.
@@ -99,7 +87,7 @@ sal_Bool __EXPORT ScSimpleUndo::Merge( SfxUndoAction *pNextAction )
return sal_True;
}
- return sal_False;
+ return false;
}
void ScSimpleUndo::BeginUndo()
@@ -127,7 +115,7 @@ void ScSimpleUndo::EndUndo()
pViewShell->ShowAllCursors();
}
- pDocShell->SetInUndo( sal_False );
+ pDocShell->SetInUndo( false );
}
void ScSimpleUndo::BeginRedo()
@@ -154,17 +142,17 @@ void ScSimpleUndo::EndRedo()
pViewShell->ShowAllCursors();
}
- pDocShell->SetInUndo( sal_False );
+ pDocShell->SetInUndo( false );
}
-void ScSimpleUndo::ShowTable( SCTAB nTab ) // static
+void ScSimpleUndo::ShowTable( SCTAB nTab )
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
pViewShell->SetTabNo( nTab );
}
-void ScSimpleUndo::ShowTable( const ScRange& rRange ) // static
+void ScSimpleUndo::ShowTable( const ScRange& rRange )
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -189,7 +177,7 @@ ScBlockUndo::ScBlockUndo( ScDocShell* pDocSh, const ScRange& rRange,
pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
}
-__EXPORT ScBlockUndo::~ScBlockUndo()
+ScBlockUndo::~ScBlockUndo()
{
DeleteSdrUndoAction( pDrawUndo );
}
@@ -197,7 +185,7 @@ __EXPORT ScBlockUndo::~ScBlockUndo()
void ScBlockUndo::BeginUndo()
{
ScSimpleUndo::BeginUndo();
- EnableDrawAdjust( pDocShell->GetDocument(), sal_False );
+ EnableDrawAdjust( pDocShell->GetDocument(), false );
}
void ScBlockUndo::EndUndo()
@@ -212,13 +200,6 @@ void ScBlockUndo::EndUndo()
ScSimpleUndo::EndUndo();
}
-/*
-void ScBlockUndo::BeginRedo()
-{
- ScSimpleUndo::BeginRedo();
-}
-*/
-
void ScBlockUndo::EndRedo()
{
if (eMode == SC_UNDO_AUTOHEIGHT)
@@ -254,7 +235,7 @@ sal_Bool ScBlockUndo::AdjustHeight()
sal_Bool bRet = pDoc->SetOptimalHeight( aBlockRange.aStart.Row(), aBlockRange.aEnd.Row(),
/*!*/ aBlockRange.aStart.Tab(), 0, &aVirtDev,
- nPPTX, nPPTY, aZoomX, aZoomY, sal_False );
+ nPPTX, nPPTY, aZoomX, aZoomY, false );
if (bRet)
pDocShell->PostPaint( 0, aBlockRange.aStart.Row(), aBlockRange.aStart.Tab(),
@@ -274,7 +255,7 @@ void ScBlockUndo::ShowBlock()
{
ShowTable( aBlockRange ); // bei mehreren Tabs im Range ist jede davon gut
pViewShell->MoveCursorAbs( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
- SC_FOLLOW_JUMP, sal_False, sal_False );
+ SC_FOLLOW_JUMP, false, false );
SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
ScRange aRange = aBlockRange;
aRange.aStart.SetTab( nTab );
@@ -301,7 +282,7 @@ ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocument* pRefDoc, ScRefUndoData*
pDrawUndo = GetSdrUndoAction( pDoc );
}
-__EXPORT ScMoveUndo::~ScMoveUndo()
+ScMoveUndo::~ScMoveUndo()
{
delete pRefUndoData;
delete pRefUndoDoc;
@@ -312,10 +293,10 @@ void ScMoveUndo::UndoRef()
{
ScDocument* pDoc = pDocShell->GetDocument();
ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1);
- pRefUndoDoc->CopyToDocument( aRange, IDF_FORMULA, sal_False, pDoc, NULL, sal_False );
+ pRefUndoDoc->CopyToDocument( aRange, IDF_FORMULA, false, pDoc, NULL, false );
if (pRefUndoData)
pRefUndoData->DoUndo( pDoc, (eMode == SC_UNDO_REFFIRST) );
- // #65055# HACK: ScDragDropUndo ist der einzige mit REFFIRST.
+ // HACK: ScDragDropUndo ist der einzige mit REFFIRST.
// Falls nicht, resultiert daraus evtl. ein zu haeufiges Anpassen
// der ChartRefs, nicht schoen, aber auch nicht schlecht..
}
@@ -324,7 +305,7 @@ void ScMoveUndo::BeginUndo()
{
ScSimpleUndo::BeginUndo();
- EnableDrawAdjust( pDocShell->GetDocument(), sal_False );
+ EnableDrawAdjust( pDocShell->GetDocument(), false );
if (pRefUndoDoc && eMode == SC_UNDO_REFFIRST)
UndoRef();
@@ -332,8 +313,7 @@ void ScMoveUndo::BeginUndo()
void ScMoveUndo::EndUndo()
{
- //@17.12.97 Reihenfolge der Fkt.s geaendert
- DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() ); // #125875# must also be called when pointer is null
+ DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() ); // must also be called when pointer is null
if (pRefUndoDoc && eMode == SC_UNDO_REFLAST)
UndoRef();
@@ -343,20 +323,6 @@ void ScMoveUndo::EndUndo()
ScSimpleUndo::EndUndo();
}
-/*
-void ScMoveUndo::BeginRedo()
-{
- ScSimpleUndo::BeginRedo();
-}
-*/
-
-/*
-void ScMoveUndo::EndRedo()
-{
- ScSimpleUndo::EndRedo();
-}
-*/
-
// -----------------------------------------------------------------------
ScDBFuncUndo::ScDBFuncUndo( ScDocShell* pDocSh, const ScRange& rOriginal, SdrUndoAction* pDrawUndo ) :
@@ -450,7 +416,7 @@ void ScDBFuncUndo::BeginRedo()
aOriginalRange.aEnd.Col(), aOriginalRange.aEnd.Row() );
pNoNameData->SetByRow( sal_True );
- pNoNameData->SetAutoFilter( sal_False );
+ pNoNameData->SetAutoFilter( false );
// header is always set with the operation in redo
}
}
@@ -509,7 +475,7 @@ sal_Bool ScUndoWrapper::IsLinked()
if (pWrappedUndo)
return pWrappedUndo->IsLinked();
else
- return sal_False;
+ return false;
}
void ScUndoWrapper::SetLinked( sal_Bool bIsLinked )
@@ -523,7 +489,7 @@ sal_Bool ScUndoWrapper::Merge( SfxUndoAction* pNextAction )
if (pWrappedUndo)
return pWrappedUndo->Merge(pNextAction);
else
- return sal_False;
+ return false;
}
void ScUndoWrapper::Undo()
@@ -549,7 +515,8 @@ sal_Bool ScUndoWrapper::CanRepeat(SfxRepeatTarget& rTarget) const
if (pWrappedUndo)
return pWrappedUndo->CanRepeat(rTarget);
else
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index afc237057ab8..0e59c0a35f92 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,6 +39,7 @@
#include <vcl/virdev.hxx>
#include <vcl/waitobj.hxx>
#include <editeng/boxitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <sfx2/app.hxx>
#include "undoblk.hxx"
@@ -64,6 +66,7 @@
#include "clipparam.hxx"
#include "sc.hrc"
+#include <set>
// STATIC DATA -----------------------------------------------------------
@@ -128,14 +131,14 @@ ScUndoInsertCells::ScUndoInsertCells( ScDocShell* pNewDocShell,
SetChangeTrack();
}
-__EXPORT ScUndoInsertCells::~ScUndoInsertCells()
+ScUndoInsertCells::~ScUndoInsertCells()
{
delete pPasteUndo;
delete []pTabs;
delete []pScenarios;
}
-String __EXPORT ScUndoInsertCells::GetComment() const
+String ScUndoInsertCells::GetComment() const
{
return ScGlobal::GetRscString( pPasteUndo ? STR_UNDO_PASTE : STR_UNDO_INSERTCELLS );
}
@@ -291,7 +294,7 @@ void ScUndoInsertCells::DoChange( const sal_Bool bUndo )
pViewShell->CellContentChanged();
}
-void __EXPORT ScUndoInsertCells::Undo()
+void ScUndoInsertCells::Undo()
{
if ( pPasteUndo )
pPasteUndo->Undo(); // undo paste first
@@ -302,24 +305,24 @@ void __EXPORT ScUndoInsertCells::Undo()
EndUndo();
}
-void __EXPORT ScUndoInsertCells::Redo()
+void ScUndoInsertCells::Redo()
{
WaitObject aWait( pDocShell->GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
if ( pPasteUndo )
pPasteUndo->Redo(); // redo paste last
}
-void __EXPORT ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
if ( pPasteUndo )
{
- // #94115# Repeat for paste with inserting cells is handled completely
+ // Repeat for paste with inserting cells is handled completely
// by the Paste undo action
pPasteUndo->Repeat( rTarget );
@@ -329,7 +332,7 @@ void __EXPORT ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoInsertCells::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoInsertCells::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -367,13 +370,13 @@ ScUndoDeleteCells::ScUndoDeleteCells( ScDocShell* pNewDocShell,
SetChangeTrack();
}
-__EXPORT ScUndoDeleteCells::~ScUndoDeleteCells()
+ScUndoDeleteCells::~ScUndoDeleteCells()
{
delete []pTabs;
delete []pScenarios;
}
-String __EXPORT ScUndoDeleteCells::GetComment() const
+String ScUndoDeleteCells::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_DELETECELLS ); // "Loeschen"
}
@@ -439,7 +442,7 @@ void ScUndoDeleteCells::DoChange( const sal_Bool bUndo )
for( i=0; i<nCount && bUndo; i++ )
{
pRefUndoDoc->CopyToDocument( aEffRange.aStart.Col(), aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Col(), aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
- IDF_ALL | IDF_NOCAPTIONS, sal_False, pDoc );
+ IDF_ALL | IDF_NOCAPTIONS, false, pDoc );
}
ScRange aWorkRange( aEffRange );
@@ -526,7 +529,7 @@ void ScUndoDeleteCells::DoChange( const sal_Bool bUndo )
// CellContentChanged kommt mit der Markierung
}
-void __EXPORT ScUndoDeleteCells::Undo()
+void ScUndoDeleteCells::Undo()
{
WaitObject aWait( pDocShell->GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference
BeginUndo();
@@ -545,11 +548,11 @@ void __EXPORT ScUndoDeleteCells::Undo()
}
}
-void __EXPORT ScUndoDeleteCells::Redo()
+void ScUndoDeleteCells::Redo()
{
WaitObject aWait( pDocShell->GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference
BeginRedo();
- DoChange( sal_False);
+ DoChange( false);
EndRedo();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
@@ -558,13 +561,13 @@ void __EXPORT ScUndoDeleteCells::Redo()
pViewShell->DoneBlockMode(); // aktuelle weg
}
-void __EXPORT ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( eCmd, sal_True );
}
-sal_Bool __EXPORT ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -590,12 +593,12 @@ ScUndoDeleteMulti::ScUndoDeleteMulti( ScDocShell* pNewDocShell,
SetChangeTrack();
}
-__EXPORT ScUndoDeleteMulti::~ScUndoDeleteMulti()
+ScUndoDeleteMulti::~ScUndoDeleteMulti()
{
delete [] pRanges;
}
-String __EXPORT ScUndoDeleteMulti::GetComment() const
+String ScUndoDeleteMulti::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_DELETECELLS ); // wie DeleteCells
}
@@ -672,7 +675,7 @@ void ScUndoDeleteMulti::SetChangeTrack()
nStartChangeAction = nEndChangeAction = 0;
}
-void __EXPORT ScUndoDeleteMulti::Undo()
+void ScUndoDeleteMulti::Undo()
{
WaitObject aWait( pDocShell->GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference
BeginUndo();
@@ -699,10 +702,10 @@ void __EXPORT ScUndoDeleteMulti::Undo()
SCCOLROW nStart = *(pOneRange++);
SCCOLROW nEnd = *(pOneRange++);
if (bRows)
- pRefUndoDoc->CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, IDF_ALL,sal_False,pDoc );
+ pRefUndoDoc->CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, IDF_ALL,false,pDoc );
else
pRefUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart),0,nTab,
- static_cast<SCCOL>(nEnd),MAXROW,nTab, IDF_ALL,sal_False,pDoc );
+ static_cast<SCCOL>(nEnd),MAXROW,nTab, IDF_ALL,false,pDoc );
}
ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
@@ -718,7 +721,7 @@ void __EXPORT ScUndoDeleteMulti::Undo()
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
-void __EXPORT ScUndoDeleteMulti::Redo()
+void ScUndoDeleteMulti::Redo()
{
WaitObject aWait( pDocShell->GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference
BeginRedo();
@@ -750,14 +753,14 @@ void __EXPORT ScUndoDeleteMulti::Redo()
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
-void __EXPORT ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
{
// DeleteCells, falls einfache Selektion
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( DEL_DELROWS, sal_True );
}
-sal_Bool __EXPORT ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -779,12 +782,12 @@ ScUndoCut::ScUndoCut( ScDocShell* pNewDocShell,
SetChangeTrack();
}
-__EXPORT ScUndoCut::~ScUndoCut()
+ScUndoCut::~ScUndoCut()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoCut::GetComment() const
+String ScUndoCut::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_CUT ); // "Ausschneiden"
}
@@ -814,7 +817,7 @@ void ScUndoCut::DoChange( const sal_Bool bUndo )
ScRange aCopyRange = aExtendedRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, false, pDoc );
ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -839,30 +842,30 @@ void ScUndoCut::DoChange( const sal_Bool bUndo )
pViewShell->CellContentChanged();
}
-void __EXPORT ScUndoCut::Undo()
+void ScUndoCut::Undo()
{
BeginUndo();
DoChange( sal_True );
EndUndo();
}
-void __EXPORT ScUndoCut::Redo()
+void ScUndoCut::Redo()
{
BeginRedo();
ScDocument* pDoc = pDocShell->GetDocument();
- EnableDrawAdjust( pDoc, sal_False ); //! include in ScBlockUndo?
- DoChange( sal_False );
+ EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
+ DoChange( false );
EnableDrawAdjust( pDoc, sal_True ); //! include in ScBlockUndo?
EndRedo();
}
-void __EXPORT ScUndoCut::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoCut::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->CutToClip( NULL, sal_True );
}
-sal_Bool __EXPORT ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -907,7 +910,7 @@ ScUndoPaste::ScUndoPaste( ScDocShell* pNewDocShell,
SetChangeTrack();
}
-__EXPORT ScUndoPaste::~ScUndoPaste()
+ScUndoPaste::~ScUndoPaste()
{
delete pUndoDoc;
delete pRedoDoc;
@@ -915,7 +918,7 @@ __EXPORT ScUndoPaste::~ScUndoPaste()
delete pRefRedoData;
}
-String __EXPORT ScUndoPaste::GetComment() const
+String ScUndoPaste::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_PASTE ); // "Einfuegen"
}
@@ -952,7 +955,7 @@ void ScUndoPaste::DoChange( const sal_Bool bUndo )
// do not undo/redo objects and note captions, they are handled via drawing undo
(nUndoFlags &= ~IDF_OBJECTS) |= IDF_NOCAPTIONS;
- sal_Bool bPaintAll = sal_False;
+ sal_Bool bPaintAll = false;
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -975,7 +978,7 @@ void ScUndoPaste::DoChange( const sal_Bool bUndo )
ScRange aCopyRange = aBlockRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, nUndoFlags, sal_False, pRedoDoc );
+ pDoc->CopyToDocument( aCopyRange, nUndoFlags, false, pRedoDoc );
bRedoFilled = sal_True;
}
@@ -994,13 +997,13 @@ void ScUndoPaste::DoChange( const sal_Bool bUndo )
{
aTabSelectRange.aStart.SetTab( nFirstSelected );
aTabSelectRange.aEnd.SetTab( nFirstSelected );
- pRedoDoc->UndoToDocument( aTabSelectRange, nUndoFlags, sal_False, pDoc );
+ pRedoDoc->UndoToDocument( aTabSelectRange, nUndoFlags, false, pDoc );
for (nTab=0; nTab<nTabCount; nTab++)
if (nTab != nFirstSelected && aMarkData.GetTableSelect(nTab))
{
aTabSelectRange.aStart.SetTab( nTab );
aTabSelectRange.aEnd.SetTab( nTab );
- pRedoDoc->CopyToDocument( aTabSelectRange, nUndoFlags, sal_False, pDoc );
+ pRedoDoc->CopyToDocument( aTabSelectRange, nUndoFlags, false, pDoc );
}
}
@@ -1018,13 +1021,13 @@ void ScUndoPaste::DoChange( const sal_Bool bUndo )
{
aTabSelectRange.aStart.SetTab( nFirstSelected );
aTabSelectRange.aEnd.SetTab( nFirstSelected );
- pUndoDoc->UndoToDocument( aTabSelectRange, nUndoFlags, sal_False, pDoc );
+ pUndoDoc->UndoToDocument( aTabSelectRange, nUndoFlags, false, pDoc );
for (nTab=0; nTab<nTabCount; nTab++)
if (nTab != nFirstSelected && aMarkData.GetTableSelect(nTab))
{
aTabSelectRange.aStart.SetTab( nTab );
aTabSelectRange.aEnd.SetTab( nTab );
- pUndoDoc->UndoToDocument( aTabSelectRange, nUndoFlags, sal_False, pDoc );
+ pUndoDoc->UndoToDocument( aTabSelectRange, nUndoFlags, false, pDoc );
}
}
@@ -1048,7 +1051,7 @@ void ScUndoPaste::DoChange( const sal_Bool bUndo )
aDrawRange.aEnd.SetRow(MAXROW);
nPaint |= PAINT_TOP | PAINT_LEFT;
/*A*/ if (pViewShell)
- pViewShell->AdjustBlockHeight(sal_False);
+ pViewShell->AdjustBlockHeight(false);
}
else
{
@@ -1062,7 +1065,7 @@ void ScUndoPaste::DoChange( const sal_Bool bUndo )
nPaint |= PAINT_LEFT;
aDrawRange.aEnd.SetRow(MAXROW);
}
-/*A*/ if ((pViewShell) && pViewShell->AdjustBlockHeight(sal_False))
+/*A*/ if ((pViewShell) && pViewShell->AdjustBlockHeight(false))
{
aDrawRange.aStart.SetCol(0);
aDrawRange.aStart.SetRow(0);
@@ -1083,7 +1086,7 @@ void ScUndoPaste::DoChange( const sal_Bool bUndo )
pViewShell->CellContentChanged();
}
-void __EXPORT ScUndoPaste::Undo()
+void ScUndoPaste::Undo()
{
BeginUndo();
DoChange( sal_True );
@@ -1092,18 +1095,18 @@ void __EXPORT ScUndoPaste::Undo()
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
-void __EXPORT ScUndoPaste::Redo()
+void ScUndoPaste::Redo()
{
BeginRedo();
ScDocument* pDoc = pDocShell->GetDocument();
- EnableDrawAdjust( pDoc, sal_False ); //! include in ScBlockUndo?
- DoChange( sal_False );
+ EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
+ DoChange( false );
EnableDrawAdjust( pDoc, sal_True ); //! include in ScBlockUndo?
EndRedo();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
-void __EXPORT ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -1111,7 +1114,7 @@ void __EXPORT ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pViewSh->GetActiveWin() );
if (pOwnClip)
{
- // #129384# keep a reference in case the clipboard is changed during PasteFromClip
+ // keep a reference in case the clipboard is changed during PasteFromClip
com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> aOwnClipRef( pOwnClip );
pViewSh->PasteFromClip( nFlags, pOwnClip->GetDocument(),
aPasteOptions.nFunction, aPasteOptions.bSkipEmpty, aPasteOptions.bTranspose,
@@ -1121,7 +1124,7 @@ void __EXPORT ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1163,11 +1166,11 @@ ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell,
SetChangeTrack();
}
-__EXPORT ScUndoDragDrop::~ScUndoDragDrop()
+ScUndoDragDrop::~ScUndoDragDrop()
{
}
-String __EXPORT ScUndoDragDrop::GetComment() const
+String ScUndoDragDrop::GetComment() const
{ // "Verschieben" : "Kopieren"
return bCut ?
ScGlobal::GetRscString( STR_UNDO_MOVE ) :
@@ -1208,7 +1211,7 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const
aRange.aStart.Tab(), 0, &aVirtDev,
pViewData->GetPPTX(), pViewData->GetPPTY(),
pViewData->GetZoomX(), pViewData->GetZoomY(),
- sal_False ) )
+ false ) )
{
aRange.aStart.SetCol(0);
aRange.aEnd.SetCol(MAXCOL);
@@ -1262,7 +1265,7 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) const
sal_uInt16 nUndoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
pDoc->DeleteAreaTab( aRange, nUndoFlags );
- pRefUndoDoc->CopyToDocument( aRange, nUndoFlags, sal_False, pDoc );
+ pRefUndoDoc->CopyToDocument( aRange, nUndoFlags, false, pDoc );
if ( pDoc->HasAttrib( aRange, HASATTR_MERGED ) )
pDoc->ExtendMerge( aRange, sal_True );
@@ -1273,7 +1276,7 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) const
PaintArea( aPaintRange, nExtFlags );
}
-void __EXPORT ScUndoDragDrop::Undo()
+void ScUndoDragDrop::Undo()
{
BeginUndo();
DoUndo(aDestRange);
@@ -1283,14 +1286,14 @@ void __EXPORT ScUndoDragDrop::Undo()
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
-void __EXPORT ScUndoDragDrop::Redo()
+void ScUndoDragDrop::Redo()
{
BeginRedo();
ScDocument* pDoc = pDocShell->GetDocument();
ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP );
- EnableDrawAdjust( pDoc, sal_False ); //! include in ScBlockUndo?
+ EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
// do not undo/redo objects and note captions, they are handled via drawing undo
sal_uInt16 nRedoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
@@ -1333,7 +1336,7 @@ void __EXPORT ScUndoDragDrop::Redo()
sal_Bool bIncludeFiltered = bCut;
// TODO: restore old note captions instead of cloning new captions...
- pDoc->CopyFromClip( aDestRange, aDestMark, IDF_ALL & ~IDF_OBJECTS, NULL, pClipDoc, sal_True, sal_False, bIncludeFiltered );
+ pDoc->CopyFromClip( aDestRange, aDestMark, IDF_ALL & ~IDF_OBJECTS, NULL, pClipDoc, sal_True, false, bIncludeFiltered );
if (bCut)
for (nTab=aSrcRange.aStart.Tab(); nTab<=aSrcRange.aEnd.Tab(); nTab++)
@@ -1342,7 +1345,7 @@ void __EXPORT ScUndoDragDrop::Redo()
// skipped rows and merged cells don't mix
if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
- pDocShell->GetDocFunc().UnmergeCells( aDestRange, sal_False, sal_True );
+ pDocShell->GetDocFunc().UnmergeCells( aDestRange, false, sal_True );
for (nTab=aDestRange.aStart.Tab(); nTab<=aDestRange.aEnd.Tab(); nTab++)
{
@@ -1366,13 +1369,13 @@ void __EXPORT ScUndoDragDrop::Redo()
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
-void __EXPORT ScUndoDragDrop::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoDragDrop::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoDragDrop::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoDragDrop::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // geht nicht
+ return false; // geht nicht
}
@@ -1390,13 +1393,13 @@ ScUndoListNames::ScUndoListNames( ScDocShell* pNewDocShell, const ScRange& rRang
{
}
-__EXPORT ScUndoListNames::~ScUndoListNames()
+ScUndoListNames::~ScUndoListNames()
{
delete pUndoDoc;
delete pRedoDoc;
}
-String __EXPORT ScUndoListNames::GetComment() const
+String ScUndoListNames::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_LISTNAMES );
}
@@ -1406,7 +1409,7 @@ void ScUndoListNames::DoChange( ScDocument* pSrcDoc ) const
ScDocument* pDoc = pDocShell->GetDocument();
pDoc->DeleteAreaTab( aBlockRange, IDF_ALL );
- pSrcDoc->CopyToDocument( aBlockRange, IDF_ALL, sal_False, pDoc );
+ pSrcDoc->CopyToDocument( aBlockRange, IDF_ALL, false, pDoc );
pDocShell->PostPaint( aBlockRange, PAINT_GRID );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1414,27 +1417,27 @@ void ScUndoListNames::DoChange( ScDocument* pSrcDoc ) const
pViewShell->CellContentChanged();
}
-void __EXPORT ScUndoListNames::Undo()
+void ScUndoListNames::Undo()
{
BeginUndo();
DoChange(pUndoDoc);
EndUndo();
}
-void __EXPORT ScUndoListNames::Redo()
+void ScUndoListNames::Redo()
{
BeginRedo();
DoChange(pRedoDoc);
EndRedo();
}
-void __EXPORT ScUndoListNames::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoListNames::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->InsertNameList();
}
-sal_Bool __EXPORT ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1464,17 +1467,17 @@ ScUndoUseScenario::ScUndoUseScenario( ScDocShell* pNewDocShell,
aRange.aEnd.SetTab(rDestArea.nTab);
}
-__EXPORT ScUndoUseScenario::~ScUndoUseScenario()
+ScUndoUseScenario::~ScUndoUseScenario()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoUseScenario::GetComment() const
+String ScUndoUseScenario::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_USESCENARIO );
}
-void __EXPORT ScUndoUseScenario::Undo()
+void ScUndoUseScenario::Undo()
{
BeginUndo();
@@ -1490,7 +1493,7 @@ void __EXPORT ScUndoUseScenario::Undo()
pUndoDoc->CopyToDocument( aRange, IDF_ALL, sal_True, pDoc, &aMarkData );
// Szenario-Tabellen
- sal_Bool bFrame = sal_False;
+ sal_Bool bFrame = false;
SCTAB nTab = aRange.aStart.Tab();
SCTAB nEndTab = nTab;
while ( pUndoDoc->HasTable(nEndTab+1) && pUndoDoc->IsScenario(nEndTab+1) )
@@ -1509,7 +1512,7 @@ void __EXPORT ScUndoUseScenario::Undo()
if ( nScenFlags & SC_SCENARIO_TWOWAY )
{
pDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, i, IDF_ALL );
- pUndoDoc->CopyToDocument( 0,0,i, MAXCOL,MAXROW,i, IDF_ALL,sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0,0,i, MAXCOL,MAXROW,i, IDF_ALL,false, pDoc );
}
if ( nScenFlags & SC_SCENARIO_SHOWFRAME )
bFrame = sal_True;
@@ -1529,7 +1532,7 @@ void __EXPORT ScUndoUseScenario::Undo()
EndUndo();
}
-void __EXPORT ScUndoUseScenario::Redo()
+void ScUndoUseScenario::Redo()
{
SCTAB nTab = aRange.aStart.Tab();
BeginRedo();
@@ -1542,12 +1545,12 @@ void __EXPORT ScUndoUseScenario::Redo()
pViewShell->InitOwnBlockMode();
}
- pDocShell->UseScenario( nTab, aName, sal_False );
+ pDocShell->UseScenario( nTab, aName, false );
EndRedo();
}
-void __EXPORT ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -1556,14 +1559,14 @@ void __EXPORT ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const
{
if (rTarget.ISA(ScTabViewTarget))
{
ScViewData* pViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
return !pViewData->GetDocument()->IsScenario( pViewData->GetTabNo() );
}
- return sal_False;
+ return false;
}
@@ -1587,12 +1590,12 @@ ScUndoSelectionStyle::ScUndoSelectionStyle( ScDocShell* pNewDocShell,
aMarkData.MarkToMulti();
}
-__EXPORT ScUndoSelectionStyle::~ScUndoSelectionStyle()
+ScUndoSelectionStyle::~ScUndoSelectionStyle()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoSelectionStyle::GetComment() const
+String ScUndoSelectionStyle::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_APPLYCELLSTYLE );
}
@@ -1625,7 +1628,7 @@ void ScUndoSelectionStyle::DoChange( const sal_Bool bUndo )
(ScStyleSheet*) pStlPool->Find( aStyleName, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
{
- DBG_ERROR("StyleSheet not found");
+ OSL_FAIL("StyleSheet not found");
return;
}
pDoc->ApplySelectionStyle( *pStyleSheet, aMarkData );
@@ -1640,21 +1643,21 @@ void ScUndoSelectionStyle::DoChange( const sal_Bool bUndo )
ShowTable( aWorkRange.aStart.Tab() );
}
-void __EXPORT ScUndoSelectionStyle::Undo()
+void ScUndoSelectionStyle::Undo()
{
BeginUndo();
DoChange( sal_True );
EndUndo();
}
-void __EXPORT ScUndoSelectionStyle::Redo()
+void ScUndoSelectionStyle::Redo()
{
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
}
-void __EXPORT ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -1664,7 +1667,7 @@ void __EXPORT ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
Find( aStyleName, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
{
- DBG_ERROR("StyleSheet not found");
+ OSL_FAIL("StyleSheet not found");
return;
}
@@ -1673,12 +1676,12 @@ void __EXPORT ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoSelectionStyle::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoSelectionStyle::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
-sal_uInt16 __EXPORT ScUndoSelectionStyle::GetId() const
+sal_uInt16 ScUndoSelectionStyle::GetId() const
{
return STR_UNDO_APPLYCELLSTYLE;
}
@@ -1698,12 +1701,12 @@ ScUndoEnterMatrix::ScUndoEnterMatrix( ScDocShell* pNewDocShell, const ScRange& r
SetChangeTrack();
}
-__EXPORT ScUndoEnterMatrix::~ScUndoEnterMatrix()
+ScUndoEnterMatrix::~ScUndoEnterMatrix()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoEnterMatrix::GetComment() const
+String ScUndoEnterMatrix::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_ENTERMATRIX );
}
@@ -1719,14 +1722,14 @@ void ScUndoEnterMatrix::SetChangeTrack()
nStartChangeAction = nEndChangeAction = 0;
}
-void __EXPORT ScUndoEnterMatrix::Undo()
+void ScUndoEnterMatrix::Undo()
{
BeginUndo();
ScDocument* pDoc = pDocShell->GetDocument();
pDoc->DeleteAreaTab( aBlockRange, IDF_ALL & ~IDF_NOTE );
- pUndoDoc->CopyToDocument( aBlockRange, IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( aBlockRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
pDocShell->PostPaint( aBlockRange, PAINT_GRID );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1740,7 +1743,7 @@ void __EXPORT ScUndoEnterMatrix::Undo()
EndUndo();
}
-void __EXPORT ScUndoEnterMatrix::Redo()
+void ScUndoEnterMatrix::Redo()
{
BeginRedo();
@@ -1760,7 +1763,7 @@ void __EXPORT ScUndoEnterMatrix::Redo()
EndRedo();
}
-void __EXPORT ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -1769,7 +1772,7 @@ void __EXPORT ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoEnterMatrix::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoEnterMatrix::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1797,18 +1800,18 @@ ScUndoIndent::ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark,
{
}
-__EXPORT ScUndoIndent::~ScUndoIndent()
+ScUndoIndent::~ScUndoIndent()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoIndent::GetComment() const
+String ScUndoIndent::GetComment() const
{
sal_uInt16 nId = bIsIncrement ? STR_UNDO_INC_INDENT : STR_UNDO_DEC_INDENT;
return ScGlobal::GetRscString( nId );
}
-void __EXPORT ScUndoIndent::Undo()
+void ScUndoIndent::Undo()
{
BeginUndo();
@@ -1823,7 +1826,7 @@ void __EXPORT ScUndoIndent::Undo()
EndUndo();
}
-void __EXPORT ScUndoIndent::Redo()
+void ScUndoIndent::Redo()
{
BeginRedo();
@@ -1834,13 +1837,13 @@ void __EXPORT ScUndoIndent::Redo()
EndRedo();
}
-void __EXPORT ScUndoIndent::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoIndent::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->ChangeIndent( bIsIncrement );
}
-sal_Bool __EXPORT ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1859,17 +1862,17 @@ ScUndoTransliterate::ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMark
{
}
-__EXPORT ScUndoTransliterate::~ScUndoTransliterate()
+ScUndoTransliterate::~ScUndoTransliterate()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoTransliterate::GetComment() const
+String ScUndoTransliterate::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_TRANSLITERATE );
}
-void __EXPORT ScUndoTransliterate::Undo()
+void ScUndoTransliterate::Undo()
{
BeginUndo();
@@ -1884,7 +1887,7 @@ void __EXPORT ScUndoTransliterate::Undo()
EndUndo();
}
-void __EXPORT ScUndoTransliterate::Redo()
+void ScUndoTransliterate::Redo()
{
BeginRedo();
@@ -1895,13 +1898,13 @@ void __EXPORT ScUndoTransliterate::Redo()
EndRedo();
}
-void __EXPORT ScUndoTransliterate::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoTransliterate::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->TransliterateText( nTransliterationType );
}
-sal_Bool __EXPORT ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1928,18 +1931,18 @@ ScUndoClearItems::ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData&
pWhich[i] = pW[i];
}
-__EXPORT ScUndoClearItems::~ScUndoClearItems()
+ScUndoClearItems::~ScUndoClearItems()
{
delete pUndoDoc;
delete pWhich;
}
-String __EXPORT ScUndoClearItems::GetComment() const
+String ScUndoClearItems::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
}
-void __EXPORT ScUndoClearItems::Undo()
+void ScUndoClearItems::Undo()
{
BeginUndo();
@@ -1950,7 +1953,7 @@ void __EXPORT ScUndoClearItems::Undo()
EndUndo();
}
-void __EXPORT ScUndoClearItems::Redo()
+void ScUndoClearItems::Redo()
{
BeginRedo();
@@ -1961,17 +1964,17 @@ void __EXPORT ScUndoClearItems::Redo()
EndRedo();
}
-void __EXPORT ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
ScViewData* pViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
ScDocFunc aFunc(*pViewData->GetDocShell());
- aFunc.ClearItems( pViewData->GetMarkData(), pWhich, sal_False );
+ aFunc.ClearItems( pViewData->GetMarkData(), pWhich, false );
}
}
-sal_Bool __EXPORT ScUndoClearItems::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoClearItems::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1989,24 +1992,24 @@ ScUndoRemoveBreaks::ScUndoRemoveBreaks( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoRemoveBreaks::~ScUndoRemoveBreaks()
+ScUndoRemoveBreaks::~ScUndoRemoveBreaks()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoRemoveBreaks::GetComment() const
+String ScUndoRemoveBreaks::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_REMOVEBREAKS );
}
-void __EXPORT ScUndoRemoveBreaks::Undo()
+void ScUndoRemoveBreaks::Undo()
{
BeginUndo();
ScDocument* pDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pDoc );
if (pViewShell)
pViewShell->UpdatePageBreakData( sal_True );
pDocShell->PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID );
@@ -2014,7 +2017,7 @@ void __EXPORT ScUndoRemoveBreaks::Undo()
EndUndo();
}
-void __EXPORT ScUndoRemoveBreaks::Redo()
+void ScUndoRemoveBreaks::Redo()
{
BeginRedo();
@@ -2030,7 +2033,7 @@ void __EXPORT ScUndoRemoveBreaks::Redo()
EndRedo();
}
-void __EXPORT ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -2039,7 +2042,7 @@ void __EXPORT ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -2050,99 +2053,119 @@ sal_Bool __EXPORT ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const
//
ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell,
- const ScRange& rArea, ScDocument* pNewUndoDoc ) :
- ScBlockUndo( pNewDocShell, rArea, SC_UNDO_SIMPLE ),
+ const ScCellMergeOption& rOption, ScDocument* pNewUndoDoc ) :
+ ScBlockUndo( pNewDocShell, rOption.getFirstSingleRange(), SC_UNDO_SIMPLE ),
+ maOption(rOption),
pUndoDoc( pNewUndoDoc )
{
}
-__EXPORT ScUndoRemoveMerge::~ScUndoRemoveMerge()
+ScUndoRemoveMerge::~ScUndoRemoveMerge()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoRemoveMerge::GetComment() const
+String ScUndoRemoveMerge::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_REMERGE ); // "Zusammenfassung aufheben"
}
-void __EXPORT ScUndoRemoveMerge::Undo()
+void ScUndoRemoveMerge::Undo()
{
- BeginUndo();
-
- ScDocument* pDoc = pDocShell->GetDocument();
-
- ScRange aExtended = aBlockRange;
- pUndoDoc->ExtendMerge( aExtended );
+ using ::std::set;
- pDoc->DeleteAreaTab( aExtended, IDF_ATTRIB );
- pUndoDoc->CopyToDocument( aExtended, IDF_ATTRIB, sal_False, pDoc );
+ SetCurTab();
+ BeginUndo();
- sal_Bool bDidPaint = sal_False;
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if ( pViewShell )
+
+ ScDocument* pDoc = pDocShell->GetDocument();
+ for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
+ itr != itrEnd; ++itr)
{
- pViewShell->SetTabNo( aExtended.aStart.Tab() );
- bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() );
+ // There is no need to extend merge area because it's already been extended.
+ ScRange aRange = maOption.getSingleRange(*itr);
+ pDoc->DeleteAreaTab(aRange, IDF_ATTRIB);
+ pUndoDoc->CopyToDocument(aRange, IDF_ATTRIB, false, pDoc);
+
+ bool bDidPaint = false;
+ if ( pViewShell )
+ {
+ pViewShell->SetTabNo(*itr);
+ bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow);
+ }
+ if (!bDidPaint)
+ ScUndoUtil::PaintMore(pDocShell, aRange);
}
- if (!bDidPaint)
- ScUndoUtil::PaintMore( pDocShell, aExtended );
EndUndo();
}
-void __EXPORT ScUndoRemoveMerge::Redo()
+void ScUndoRemoveMerge::Redo()
{
+ using ::std::set;
+
+ SetCurTab();
BeginRedo();
- SCTAB nTab = aBlockRange.aStart.Tab();
ScDocument* pDoc = pDocShell->GetDocument();
- ScRange aExtended = aBlockRange;
- pDoc->ExtendMerge( aExtended );
- ScRange aRefresh = aExtended;
- pDoc->ExtendOverlapped( aRefresh );
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- // ausfuehren
+ for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
+ itr != itrEnd; ++itr)
+ {
+ SCTAB nTab = *itr;
+ // There is no need to extend merge area because it's already been extended.
+ ScRange aRange = maOption.getSingleRange(nTab);
- const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
- ScPatternAttr aPattern( pDoc->GetPool() );
- aPattern.GetItemSet().Put( rDefAttr );
- pDoc->ApplyPatternAreaTab( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
- aBlockRange.aEnd.Col(), aBlockRange.aEnd.Row(), nTab,
- aPattern );
+ // ausfuehren
- pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(),
- aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
- SC_MF_HOR | SC_MF_VER );
+ const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
+ ScPatternAttr aPattern( pDoc->GetPool() );
+ aPattern.GetItemSet().Put( rDefAttr );
+ pDoc->ApplyPatternAreaTab( maOption.mnStartCol, maOption.mnStartRow,
+ maOption.mnEndCol, maOption.mnEndRow, nTab,
+ aPattern );
- pDoc->ExtendMerge( aRefresh, sal_True, sal_False );
+ pDoc->RemoveFlagsTab( maOption.mnStartCol, maOption.mnStartRow,
+ maOption.mnEndCol, maOption.mnEndRow, nTab,
+ SC_MF_HOR | SC_MF_VER );
- // Paint
+ pDoc->ExtendMerge(aRange, true, false);
- sal_Bool bDidPaint = sal_False;
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if ( pViewShell )
- {
- pViewShell->SetTabNo( aExtended.aStart.Tab() );
- bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() );
+ // Paint
+
+ sal_Bool bDidPaint = false;
+ if ( pViewShell )
+ {
+ pViewShell->SetTabNo(nTab);
+ bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow);
+ }
+ if (!bDidPaint)
+ ScUndoUtil::PaintMore(pDocShell, aRange);
}
- if (!bDidPaint)
- ScUndoUtil::PaintMore( pDocShell, aExtended );
EndRedo();
}
-void __EXPORT ScUndoRemoveMerge::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoRemoveMerge::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->RemoveMerge();
}
-sal_Bool __EXPORT ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
+void ScUndoRemoveMerge::SetCurTab()
+{
+ SCTAB nCurTab = pDocShell->GetCurTab();
+ aBlockRange.aStart.SetTab(nCurTab);
+ aBlockRange.aEnd.SetTab(nCurTab);
+}
+
// -----------------------------------------------------------------------
//
// nur Umrandung setzen, per ScRangeList (StarOne)
@@ -2151,26 +2174,18 @@ sal_Bool __EXPORT ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const
ScRange lcl_TotalRange( const ScRangeList& rRanges )
{
ScRange aTotal;
- sal_uLong nCount = rRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ if ( !rRanges.empty() )
{
- ScRange aRange = *rRanges.GetObject(i);
- if (i==0)
- aTotal = aRange;
- else
+ aTotal = *rRanges[ 0 ];
+ for ( size_t i = 1, nCount = rRanges.size(); i < nCount; ++i )
{
- if (aRange.aStart.Col() < aTotal.aStart.Col())
- aTotal.aStart.SetCol(aRange.aStart.Col());
- if (aRange.aStart.Row() < aTotal.aStart.Row())
- aTotal.aStart.SetRow(aRange.aStart.Row());
- if (aRange.aStart.Tab() < aTotal.aStart.Tab())
- aTotal.aStart.SetTab(aRange.aStart.Tab());
- if (aRange.aEnd.Col() > aTotal.aEnd.Col())
- aTotal.aEnd.SetCol(aRange.aEnd.Col());
- if (aRange.aEnd.Row() > aTotal.aEnd.Row())
- aTotal.aEnd.SetRow(aRange.aEnd.Row());
- if (aRange.aEnd.Tab() > aTotal.aEnd.Tab())
- aTotal.aEnd.SetTab(aRange.aEnd.Tab());
+ ScRange aRange = *rRanges[ i ];
+ if (aRange.aStart.Col() < aTotal.aStart.Col()) aTotal.aStart.SetCol(aRange.aStart.Col());
+ if (aRange.aStart.Row() < aTotal.aStart.Row()) aTotal.aStart.SetRow(aRange.aStart.Row());
+ if (aRange.aStart.Tab() < aTotal.aStart.Tab()) aTotal.aStart.SetTab(aRange.aStart.Tab());
+ if (aRange.aEnd.Col() > aTotal.aEnd.Col() ) aTotal.aEnd.SetCol( aRange.aEnd.Col() );
+ if (aRange.aEnd.Row() > aTotal.aEnd.Row() ) aTotal.aEnd.SetRow( aRange.aEnd.Row() );
+ if (aRange.aEnd.Tab() > aTotal.aEnd.Tab() ) aTotal.aEnd.SetTab(aRange.aEnd.Tab() );
}
}
return aTotal;
@@ -2187,7 +2202,7 @@ ScUndoBorder::ScUndoBorder( ScDocShell* pNewDocShell,
pInner = new SvxBoxInfoItem(rNewInner);
}
-__EXPORT ScUndoBorder::~ScUndoBorder()
+ScUndoBorder::~ScUndoBorder()
{
delete pUndoDoc;
delete pRanges;
@@ -2195,34 +2210,33 @@ __EXPORT ScUndoBorder::~ScUndoBorder()
delete pInner;
}
-String __EXPORT ScUndoBorder::GetComment() const
+String ScUndoBorder::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_SELATTRLINES ); //! eigener String?
}
-void __EXPORT ScUndoBorder::Undo()
+void ScUndoBorder::Undo()
{
BeginUndo();
ScDocument* pDoc = pDocShell->GetDocument();
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( *pRanges, sal_False );
+ aMarkData.MarkFromRangeList( *pRanges, false );
pUndoDoc->CopyToDocument( aBlockRange, IDF_ATTRIB, sal_True, pDoc, &aMarkData );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndUndo();
}
-void __EXPORT ScUndoBorder::Redo()
+void ScUndoBorder::Redo()
{
BeginRedo();
ScDocument* pDoc = pDocShell->GetDocument(); //! Funktion an docfunc aufrufen
- sal_uLong nCount = pRanges->Count();
- sal_uLong i;
- for (i=0; i<nCount; i++)
+ size_t nCount = pRanges->size();
+ for (size_t i = 0; i < nCount; ++i )
{
- ScRange aRange = *pRanges->GetObject(i);
+ ScRange aRange = *(*pRanges)[i];
SCTAB nTab = aRange.aStart.Tab();
ScMarkData aMark;
@@ -2231,22 +2245,23 @@ void __EXPORT ScUndoBorder::Redo()
pDoc->ApplySelectionFrame( aMark, pOuter, pInner );
}
- for (i=0; i<nCount; i++)
- pDocShell->PostPaint( *pRanges->GetObject(i), PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
+ for (size_t i = 0; i < nCount; ++i)
+ pDocShell->PostPaint( *(*pRanges)[i], PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndRedo();
}
-void __EXPORT ScUndoBorder::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoBorder::Repeat(SfxRepeatTarget& /* rTarget */)
{
//! spaeter (wenn die Funktion aus cellsuno nach docfunc gewandert ist)
}
-sal_Bool __EXPORT ScUndoBorder::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoBorder::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // s.o.
+ return false; // s.o.
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index dfa2dd25c0d2..208a10d437cc 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@ ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
}
-__EXPORT ScUndoWidthOrHeight::~ScUndoWidthOrHeight()
+ScUndoWidthOrHeight::~ScUndoWidthOrHeight()
{
delete[] pRanges;
delete pUndoDoc;
@@ -94,7 +95,7 @@ __EXPORT ScUndoWidthOrHeight::~ScUndoWidthOrHeight()
DeleteSdrUndoAction( pDrawUndo );
}
-String __EXPORT ScUndoWidthOrHeight::GetComment() const
+String ScUndoWidthOrHeight::GetComment() const
{
// [ "optimale " ] "Spaltenbreite" | "Zeilenhoehe"
return ( bWidth ?
@@ -108,7 +109,7 @@ String __EXPORT ScUndoWidthOrHeight::GetComment() const
) );
}
-void __EXPORT ScUndoWidthOrHeight::Undo()
+void ScUndoWidthOrHeight::Undo()
{
BeginUndo();
@@ -135,14 +136,14 @@ void __EXPORT ScUndoWidthOrHeight::Undo()
{
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE,
- sal_False, pDoc );
+ false, pDoc );
pDoc->UpdatePageBreaks( nTab );
pDocShell->PostPaint( static_cast<SCCOL>(nPaintStart), 0, nTab,
MAXCOL, MAXROW, nTab, PAINT_GRID | PAINT_TOP );
}
else // Height
{
- pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pDoc );
pDoc->UpdatePageBreaks( nTab );
pDocShell->PostPaint( 0, nPaintStart, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID | PAINT_LEFT );
}
@@ -163,11 +164,11 @@ void __EXPORT ScUndoWidthOrHeight::Undo()
EndUndo();
}
-void __EXPORT ScUndoWidthOrHeight::Redo()
+void ScUndoWidthOrHeight::Redo()
{
BeginRedo();
- sal_Bool bPaintAll = sal_False;
+ sal_Bool bPaintAll = false;
if (eMode==SC_SIZE_OPTIMAL)
{
if ( SetViewMarkData( aMarkData ) )
@@ -180,11 +181,10 @@ void __EXPORT ScUndoWidthOrHeight::Redo()
SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
if ( nTab < nStartTab || nTab > nEndTab )
pViewShell->SetTabNo( nStartTab );
- }
- // SetWidthOrHeight aendert aktuelle Tabelle !
- if ( pViewShell )
- pViewShell->SetWidthOrHeight( bWidth, nRangeCnt, pRanges, eMode, nNewSize, sal_False, sal_True, &aMarkData );
+ // SetWidthOrHeight aendert aktuelle Tabelle !
+ pViewShell->SetWidthOrHeight( bWidth, nRangeCnt, pRanges, eMode, nNewSize, false, true, &aMarkData );
+ }
// paint grid if selection was changed directly at the MarkData
if (bPaintAll)
@@ -193,15 +193,16 @@ void __EXPORT ScUndoWidthOrHeight::Redo()
EndRedo();
}
-void __EXPORT ScUndoWidthOrHeight::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoWidthOrHeight::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, nNewSize, sal_True );
}
-sal_Bool __EXPORT ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index d78b48f9b84b..446e3dede1c6 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,9 @@
// INCLUDE -------------------------------------------------------------------
#include "scitems.hxx"
+#include <svx/algitem.hxx>
#include <editeng/boxitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svl/srchitem.hxx>
#include <sfx2/linkmgr.hxx>
#include <sfx2/bindings.hxx>
@@ -116,7 +119,7 @@ ScUndoDeleteContents::ScUndoDeleteContents(
//----------------------------------------------------------------------------
-__EXPORT ScUndoDeleteContents::~ScUndoDeleteContents()
+ScUndoDeleteContents::~ScUndoDeleteContents()
{
delete pUndoDoc;
DeleteSdrUndoAction( pDrawUndo );
@@ -125,7 +128,7 @@ __EXPORT ScUndoDeleteContents::~ScUndoDeleteContents()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoDeleteContents::GetComment() const
+String ScUndoDeleteContents::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS ); // "Loeschen"
}
@@ -208,7 +211,7 @@ void ScUndoDeleteContents::DoChange( const sal_Bool bUndo )
//----------------------------------------------------------------------------
-void __EXPORT ScUndoDeleteContents::Undo()
+void ScUndoDeleteContents::Undo()
{
BeginUndo();
DoChange( sal_True );
@@ -227,10 +230,10 @@ void __EXPORT ScUndoDeleteContents::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoDeleteContents::Redo()
+void ScUndoDeleteContents::Redo()
{
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
// #i97876# Spreadsheet data changes are not notified
@@ -246,7 +249,7 @@ void __EXPORT ScUndoDeleteContents::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->DeleteContents( nFlags, sal_True );
@@ -255,7 +258,7 @@ void __EXPORT ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -294,7 +297,7 @@ ScUndoFillTable::ScUndoFillTable( ScDocShell* pNewDocShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoFillTable::~ScUndoFillTable()
+ScUndoFillTable::~ScUndoFillTable()
{
delete pUndoDoc;
}
@@ -302,7 +305,7 @@ __EXPORT ScUndoFillTable::~ScUndoFillTable()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoFillTable::GetComment() const
+String ScUndoFillTable::GetComment() const
{
return ScGlobal::GetRscString( STR_FILL_TAB );
}
@@ -390,7 +393,7 @@ void ScUndoFillTable::DoChange( const sal_Bool bUndo )
//----------------------------------------------------------------------------
-void __EXPORT ScUndoFillTable::Undo()
+void ScUndoFillTable::Undo()
{
BeginUndo();
DoChange( sal_True );
@@ -400,17 +403,17 @@ void __EXPORT ScUndoFillTable::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoFillTable::Redo()
+void ScUndoFillTable::Redo()
{
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
}
//----------------------------------------------------------------------------
-void __EXPORT ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, bAsLink );
@@ -419,7 +422,7 @@ void __EXPORT ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -456,7 +459,7 @@ ScUndoSelectionAttr::ScUndoSelectionAttr( ScDocShell* pNewDocShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoSelectionAttr::~ScUndoSelectionAttr()
+ScUndoSelectionAttr::~ScUndoSelectionAttr()
{
ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
pPool->Remove(*pApplyPattern);
@@ -471,12 +474,18 @@ __EXPORT ScUndoSelectionAttr::~ScUndoSelectionAttr()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoSelectionAttr::GetComment() const
+String ScUndoSelectionAttr::GetComment() const
{
//"Attribute" "/Linien"
return ScGlobal::GetRscString( pLineOuter ? STR_UNDO_SELATTRLINES : STR_UNDO_SELATTR );
}
+//----------------------------------------------------------------------------
+
+ScEditDataArray* ScUndoSelectionAttr::GetDataArray()
+{
+ return &aDataArray;
+}
//----------------------------------------------------------------------------
@@ -493,6 +502,8 @@ void ScUndoSelectionAttr::DoChange( const sal_Bool bUndo )
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt( nExtFlags, aEffRange );
+ ChangeEditData(bUndo);
+
if (bUndo) // nur bei Undo
{
ScRange aCopyRange = aRange;
@@ -518,10 +529,28 @@ void ScUndoSelectionAttr::DoChange( const sal_Bool bUndo )
ShowTable( aRange );
}
+void ScUndoSelectionAttr::ChangeEditData( const bool bUndo )
+{
+ ScDocument* pDoc = pDocShell->GetDocument();
+ for (const ScEditDataArray::Item* pItem = aDataArray.First(); pItem; pItem = aDataArray.Next())
+ {
+ ScBaseCell* pCell;
+ pDoc->GetCell(pItem->GetCol(), pItem->GetRow(), pItem->GetTab(), pCell);
+ if (!pCell || pCell->GetCellType() != CELLTYPE_EDIT)
+ continue;
+
+ ScEditCell* pEditCell = static_cast<ScEditCell*>(pCell);
+ if (bUndo)
+ pEditCell->SetData(pItem->GetOldData(), NULL);
+ else
+ pEditCell->SetData(pItem->GetNewData(), NULL);
+ }
+}
+
//----------------------------------------------------------------------------
-void __EXPORT ScUndoSelectionAttr::Undo()
+void ScUndoSelectionAttr::Undo()
{
BeginUndo();
DoChange( sal_True );
@@ -531,17 +560,17 @@ void __EXPORT ScUndoSelectionAttr::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoSelectionAttr::Redo()
+void ScUndoSelectionAttr::Redo()
{
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
}
//----------------------------------------------------------------------------
-void __EXPORT ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -556,7 +585,7 @@ void __EXPORT ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoSelectionAttr::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoSelectionAttr::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -595,7 +624,7 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoAutoFill::~ScUndoAutoFill()
+ScUndoAutoFill::~ScUndoAutoFill()
{
pDocShell->GetDocument()->EraseNonUsedSharedNames(nMaxSharedIndex);
delete pUndoDoc;
@@ -604,7 +633,7 @@ __EXPORT ScUndoAutoFill::~ScUndoAutoFill()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoAutoFill::GetComment() const
+String ScUndoAutoFill::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_AUTOFILL ); //"Ausfuellen"
}
@@ -620,10 +649,27 @@ void ScUndoAutoFill::SetChangeTrack()
nStartChangeAction = nEndChangeAction = 0;
}
+namespace {
-//----------------------------------------------------------------------------
+bool eraseNameContaining(ScRangeName& rNames, const rtl::OUString& rCriteria)
+{
+ ScRangeName::iterator itr = rNames.begin(), itrEnd = rNames.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ rtl::OUString aRName = itr->GetName();
+ if (aRName.indexOf(rCriteria) >= 0)
+ {
+ // Criteria found. Erase this.
+ rNames.erase(itr);
+ return true;
+ }
+ }
+ return false;
+}
-void __EXPORT ScUndoAutoFill::Undo()
+}
+
+void ScUndoAutoFill::Undo()
{
BeginUndo();
@@ -641,7 +687,7 @@ void __EXPORT ScUndoAutoFill::Undo()
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt( nExtFlags, aWorkRange );
pDoc->DeleteAreaTab( aWorkRange, IDF_AUTOFILL );
- pUndoDoc->CopyToDocument( aWorkRange, IDF_AUTOFILL, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( aWorkRange, IDF_AUTOFILL, false, pDoc );
pDoc->ExtendMerge( aWorkRange, sal_True );
pDocShell->PostPaint( aWorkRange, PAINT_GRID, nExtFlags );
@@ -661,21 +707,17 @@ void __EXPORT ScUndoAutoFill::Undo()
aName += String::CreateFromInt32(nMaxSharedIndex);
aName += '_';
ScRangeName* pRangeName = pDoc->GetRangeName();
- sal_Bool bHasFound = sal_False;
- for (sal_uInt16 i = 0; i < pRangeName->GetCount(); i++)
+ bool bHasFound = false;
+ // Remove all range names that contain ___SC_...
+ while (true)
{
- ScRangeData* pRangeData = (*pRangeName)[i];
- if (pRangeData)
- {
- String aRName;
- pRangeData->GetName(aRName);
- if (aRName.Search(aName) != STRING_NOTFOUND)
- {
- pRangeName->AtFree(i);
- bHasFound = sal_True;
- }
- }
+ bool bErased = eraseNameContaining(*pRangeName, aName);
+ if (bErased)
+ bHasFound = true;
+ else
+ break;
}
+
if (bHasFound)
pRangeName->SetSharedMaxIndex(pRangeName->GetSharedMaxIndex()-1);
@@ -689,7 +731,7 @@ void __EXPORT ScUndoAutoFill::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoAutoFill::Redo()
+void ScUndoAutoFill::Redo()
{
BeginRedo();
@@ -740,7 +782,7 @@ void __EXPORT ScUndoAutoFill::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -756,7 +798,7 @@ void __EXPORT ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -769,14 +811,12 @@ sal_Bool __EXPORT ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const
//----------------------------------------------------------------------------
-ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell,
- SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
- SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
- bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo )
+ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
+ bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo )
//
: ScSimpleUndo( pNewDocShell ),
//
- maRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ),
+ maOption(rOption),
mbMergeContents( bMergeContents ),
mpUndoDoc( pUndoDoc ),
mpDrawUndo( pDrawUndo )
@@ -805,51 +845,77 @@ String ScUndoMerge::GetComment() const
void ScUndoMerge::DoChange( bool bUndo ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ using ::std::set;
- ScUndoUtil::MarkSimpleBlock( pDocShell, maRange );
+ if (maOption.maTabs.empty())
+ // Nothing to do.
+ return;
- if (bUndo)
- // remove merge (contents are copied back below from undo document)
- pDoc->RemoveMerge( maRange.aStart.Col(), maRange.aStart.Row(), maRange.aStart.Tab() );
- else
- // repeat merge, but do not remove note captions (will be done by drawing redo below)
-/*!*/ pDoc->DoMerge( maRange.aStart.Tab(),
- maRange.aStart.Col(), maRange.aStart.Row(),
- maRange.aEnd.Col(), maRange.aEnd.Row(), false );
+ ScDocument* pDoc = pDocShell->GetDocument();
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- // undo -> copy back deleted contents
- if (bUndo && mpUndoDoc)
- {
- pDoc->DeleteAreaTab( maRange, IDF_CONTENTS|IDF_NOCAPTIONS );
- mpUndoDoc->CopyToDocument( maRange, IDF_ALL|IDF_NOCAPTIONS, sal_False, pDoc );
- }
+ ScRange aCurRange = maOption.getSingleRange(pDocShell->GetCurTab());
+ ScUndoUtil::MarkSimpleBlock(pDocShell, aCurRange);
- // redo -> merge contents again
- else if (!bUndo && mbMergeContents)
+ for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
+ itr != itrEnd; ++itr)
{
-/*!*/ pDoc->DoMergeContents( maRange.aStart.Tab(),
- maRange.aStart.Col(), maRange.aStart.Row(),
- maRange.aEnd.Col(), maRange.aEnd.Row() );
- }
+ SCTAB nTab = *itr;
+ ScRange aRange = maOption.getSingleRange(nTab);
- if (bUndo)
- DoSdrUndoAction( mpDrawUndo, pDoc );
- else
- RedoSdrUndoAction( mpDrawUndo );
+ if (bUndo)
+ // remove merge (contents are copied back below from undo document)
+ pDoc->RemoveMerge( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() );
+ else
+ {
+ // repeat merge, but do not remove note captions (will be done by drawing redo below)
+ pDoc->DoMerge( aRange.aStart.Tab(),
+ aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row(), false );
- sal_Bool bDidPaint = sal_False;
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if ( pViewShell )
- {
- pViewShell->SetTabNo( maRange.aStart.Tab() );
- bDidPaint = pViewShell->AdjustRowHeight( maRange.aStart.Row(), maRange.aEnd.Row() );
- }
+ if (maOption.mbCenter)
+ {
+ pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aStart.Tab(),
+ SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) );
+ pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aStart.Tab(),
+ SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) );
+ }
+ }
+
+ // undo -> copy back deleted contents
+ if (bUndo && mpUndoDoc)
+ {
+ pDoc->DeleteAreaTab( aRange, IDF_CONTENTS|IDF_NOCAPTIONS );
+ mpUndoDoc->CopyToDocument( aRange, IDF_ALL|IDF_NOCAPTIONS, false, pDoc );
+ }
+
+ // redo -> merge contents again
+ else if (!bUndo && mbMergeContents)
+ {
+ pDoc->DoMergeContents( aRange.aStart.Tab(),
+ aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row() );
+ }
+
+ if (bUndo)
+ DoSdrUndoAction( mpDrawUndo, pDoc );
+ else
+ RedoSdrUndoAction( mpDrawUndo );
- if (!bDidPaint)
- ScUndoUtil::PaintMore( pDocShell, maRange );
+ bool bDidPaint = false;
+ if ( pViewShell )
+ {
+ pViewShell->SetTabNo(nTab);
+ bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow);
+ }
+
+ if (!bDidPaint)
+ ScUndoUtil::PaintMore(pDocShell, aRange);
+ }
- ShowTable( maRange );
+ ShowTable(aCurRange);
}
@@ -880,8 +946,8 @@ void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget)
if (rTarget.ISA(ScTabViewTarget))
{
ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
- sal_Bool bCont = sal_False;
- rViewShell.MergeCells( sal_False, bCont, sal_True );
+ sal_Bool bCont = false;
+ rViewShell.MergeCells( false, bCont, sal_True );
}
}
@@ -917,7 +983,7 @@ ScUndoAutoFormat::ScUndoAutoFormat( ScDocShell* pNewDocShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoAutoFormat::~ScUndoAutoFormat()
+ScUndoAutoFormat::~ScUndoAutoFormat()
{
delete pUndoDoc;
}
@@ -925,7 +991,7 @@ __EXPORT ScUndoAutoFormat::~ScUndoAutoFormat()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoAutoFormat::GetComment() const
+String ScUndoAutoFormat::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_AUTOFORMAT ); //"Auto-Format"
}
@@ -933,7 +999,7 @@ String __EXPORT ScUndoAutoFormat::GetComment() const
//----------------------------------------------------------------------------
-void __EXPORT ScUndoAutoFormat::Undo()
+void ScUndoAutoFormat::Undo()
{
BeginUndo();
@@ -950,7 +1016,7 @@ void __EXPORT ScUndoAutoFormat::Undo()
ScRange aCopyRange = aBlockRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, sal_False, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, false, pDoc, &aMarkData );
// Zellhoehen und -breiten (IDF_NONE)
if (bSize)
@@ -963,9 +1029,9 @@ void __EXPORT ScUndoAutoFormat::Undo()
SCTAB nEndZ = aBlockRange.aEnd.Tab();
pUndoDoc->CopyToDocument( nStartX, 0, 0, nEndX, MAXROW, nTabCount-1,
- IDF_NONE, sal_False, pDoc, &aMarkData );
+ IDF_NONE, false, pDoc, &aMarkData );
pUndoDoc->CopyToDocument( 0, nStartY, 0, MAXCOL, nEndY, nTabCount-1,
- IDF_NONE, sal_False, pDoc, &aMarkData );
+ IDF_NONE, false, pDoc, &aMarkData );
pDocShell->PostPaint( 0, 0, nStartZ, MAXCOL, MAXROW, nEndZ,
PAINT_GRID | PAINT_LEFT | PAINT_TOP, SC_PF_LINES );
}
@@ -978,7 +1044,7 @@ void __EXPORT ScUndoAutoFormat::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoAutoFormat::Redo()
+void ScUndoAutoFormat::Redo()
{
BeginRedo();
@@ -1015,7 +1081,7 @@ void __EXPORT ScUndoAutoFormat::Redo()
nPPTY = ScGlobal::nScreenPPTY;
}
- sal_Bool bFormula = sal_False; //! merken
+ sal_Bool bFormula = false; //! merken
for (SCTAB nTab=nStartZ; nTab<=nEndZ; nTab++)
{
@@ -1025,20 +1091,18 @@ void __EXPORT ScUndoAutoFormat::Redo()
aDestMark.MarkToMulti();
// wie SC_SIZE_VISOPT
- SCROW nLastRow = -1;
for (SCROW nRow=nStartY; nRow<=nEndY; nRow++)
{
sal_uInt8 nOld = pDoc->GetRowFlags(nRow,nTab);
- bool bHidden = pDoc->RowHidden(nRow, nTab, nLastRow);
+ bool bHidden = pDoc->RowHidden(nRow, nTab);
if ( !bHidden && ( nOld & CR_MANUALSIZE ) )
pDoc->SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
}
pDoc->SetOptimalHeight( nStartY, nEndY, nTab, 0, &aVirtDev,
- nPPTX, nPPTY, aZoomX, aZoomY, sal_False );
+ nPPTX, nPPTY, aZoomX, aZoomY, false );
- SCCOL nLastCol = -1;
for (SCCOL nCol=nStartX; nCol<=nEndX; nCol++)
- if (!pDoc->ColHidden(nCol, nTab, nLastCol))
+ if (!pDoc->ColHidden(nCol, nTab))
{
sal_uInt16 nThisSize = STD_EXTRA_WIDTH + pDoc->GetOptimalColWidth( nCol, nTab,
&aVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
@@ -1061,7 +1125,7 @@ void __EXPORT ScUndoAutoFormat::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->AutoFormat( nFormatNo, sal_True );
@@ -1070,7 +1134,7 @@ void __EXPORT ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1102,7 +1166,7 @@ ScUndoReplace::ScUndoReplace( ScDocShell* pNewDocShell, const ScMarkData& rMark,
//----------------------------------------------------------------------------
-__EXPORT ScUndoReplace::~ScUndoReplace()
+ScUndoReplace::~ScUndoReplace()
{
delete pUndoDoc;
delete pSearchItem;
@@ -1140,7 +1204,7 @@ void ScUndoReplace::SetChangeTrack()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoReplace::GetComment() const
+String ScUndoReplace::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_REPLACE ); // "Ersetzen"
}
@@ -1148,7 +1212,7 @@ String __EXPORT ScUndoReplace::GetComment() const
//----------------------------------------------------------------------------
-void __EXPORT ScUndoReplace::Undo()
+void ScUndoReplace::Undo()
{
BeginUndo();
@@ -1173,7 +1237,7 @@ void __EXPORT ScUndoReplace::Undo()
sal_uInt16 nUndoFlags = (pSearchItem->GetPattern()) ? IDF_ATTRIB : IDF_CONTENTS;
pUndoDoc->CopyToDocument( 0, 0, 0,
MAXCOL, MAXROW, MAXTAB,
- nUndoFlags, sal_False, pDoc, NULL, sal_False ); // ohne Row-Flags
+ nUndoFlags, false, pDoc, NULL, false ); // ohne Row-Flags
pDocShell->PostPaintGridAll();
}
else if (pSearchItem->GetPattern() &&
@@ -1189,7 +1253,7 @@ void __EXPORT ScUndoReplace::Undo()
pSearchItem->SetSearchString(aTempStr);
if (pViewShell)
pViewShell->MoveCursorAbs( aCursorPos.Col(), aCursorPos.Row(),
- SC_FOLLOW_JUMP, sal_False, sal_False );
+ SC_FOLLOW_JUMP, false, false );
pDocShell->PostPaintGridAll();
}
else if (pSearchItem->GetCellType() == SVX_SEARCHIN_NOTE)
@@ -1200,18 +1264,18 @@ void __EXPORT ScUndoReplace::Undo()
pNote->SetText( aCursorPos, aUndoStr );
if (pViewShell)
pViewShell->MoveCursorAbs( aCursorPos.Col(), aCursorPos.Row(),
- SC_FOLLOW_JUMP, sal_False, sal_False );
+ SC_FOLLOW_JUMP, false, false );
}
else
{
- // #78889# aUndoStr may contain line breaks
+ // aUndoStr may contain line breaks
if ( aUndoStr.Search('\n') != STRING_NOTFOUND )
pDoc->PutCell( aCursorPos, new ScEditCell( aUndoStr, pDoc ) );
else
pDoc->SetString( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aUndoStr );
if (pViewShell)
pViewShell->MoveCursorAbs( aCursorPos.Col(), aCursorPos.Row(),
- SC_FOLLOW_JUMP, sal_False, sal_False );
+ SC_FOLLOW_JUMP, false, false );
pDocShell->PostPaintGridAll();
}
@@ -1225,7 +1289,7 @@ void __EXPORT ScUndoReplace::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoReplace::Redo()
+void ScUndoReplace::Redo()
{
BeginRedo();
@@ -1234,14 +1298,14 @@ void __EXPORT ScUndoReplace::Redo()
if (pViewShell)
pViewShell->MoveCursorAbs( aCursorPos.Col(), aCursorPos.Row(),
- SC_FOLLOW_JUMP, sal_False, sal_False );
+ SC_FOLLOW_JUMP, false, false );
if (pUndoDoc)
{
if (pViewShell)
{
SetViewMarkData( aMarkData );
- pViewShell->SearchAndReplace( pSearchItem, sal_False, sal_True );
+ pViewShell->SearchAndReplace( pSearchItem, false, sal_True );
}
}
else if (pSearchItem->GetPattern() &&
@@ -1254,7 +1318,7 @@ void __EXPORT ScUndoReplace::Redo()
}
else
if (pViewShell)
- pViewShell->SearchAndReplace( pSearchItem, sal_False, sal_True );
+ pViewShell->SearchAndReplace( pSearchItem, false, sal_True );
SetChangeTrack();
@@ -1264,16 +1328,16 @@ void __EXPORT ScUndoReplace::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoReplace::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoReplace::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->SearchAndReplace( pSearchItem, sal_True, sal_False );
+ ((ScTabViewTarget&)rTarget).GetViewShell()->SearchAndReplace( pSearchItem, sal_True, false );
}
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1310,7 +1374,7 @@ ScUndoTabOp::ScUndoTabOp( ScDocShell* pNewDocShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoTabOp::~ScUndoTabOp()
+ScUndoTabOp::~ScUndoTabOp()
{
delete pUndoDoc;
}
@@ -1318,7 +1382,7 @@ __EXPORT ScUndoTabOp::~ScUndoTabOp()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoTabOp::GetComment() const
+String ScUndoTabOp::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_TABOP ); // "Mehrfachoperation"
}
@@ -1326,7 +1390,7 @@ String __EXPORT ScUndoTabOp::GetComment() const
//----------------------------------------------------------------------------
-void __EXPORT ScUndoTabOp::Undo()
+void ScUndoTabOp::Undo()
{
BeginUndo();
@@ -1337,7 +1401,7 @@ void __EXPORT ScUndoTabOp::Undo()
ScDocument* pDoc = pDocShell->GetDocument();
pDoc->DeleteAreaTab( aRange,IDF_ALL & ~IDF_NOTE );
- pUndoDoc->CopyToDocument( aRange, IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( aRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
pDocShell->PostPaint( aRange, PAINT_GRID, nExtFlags );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1350,7 +1414,7 @@ void __EXPORT ScUndoTabOp::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoTabOp::Redo()
+void ScUndoTabOp::Redo()
{
BeginRedo();
@@ -1362,7 +1426,7 @@ void __EXPORT ScUndoTabOp::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
- pViewShell->TabOp( aParam, sal_False);
+ pViewShell->TabOp( aParam, false);
EndRedo();
}
@@ -1370,16 +1434,16 @@ void __EXPORT ScUndoTabOp::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoTabOp::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoTabOp::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoTabOp::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoTabOp::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -1409,7 +1473,7 @@ ScUndoConversion::ScUndoConversion(
//----------------------------------------------------------------------------
-__EXPORT ScUndoConversion::~ScUndoConversion()
+ScUndoConversion::~ScUndoConversion()
{
delete pUndoDoc;
delete pRedoDoc;
@@ -1429,7 +1493,7 @@ void ScUndoConversion::SetChangeTrack()
nStartChangeAction, nEndChangeAction );
else
{
- DBG_ERROR( "ScUndoConversion::SetChangeTrack: kein UndoDoc" );
+ OSL_FAIL( "ScUndoConversion::SetChangeTrack: kein UndoDoc" );
nStartChangeAction = nEndChangeAction = 0;
}
}
@@ -1475,7 +1539,7 @@ void ScUndoConversion::DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPo
}
else
{
- DBG_ERROR("Kein Un-/RedoDoc bei Un-/RedoSpelling");
+ OSL_FAIL("Kein Un-/RedoDoc bei Un-/RedoSpelling");
}
}
@@ -1542,13 +1606,13 @@ nFlags ( nNewFlag )
SetChangeTrack();
}
-__EXPORT ScUndoRefConversion::~ScUndoRefConversion()
+ScUndoRefConversion::~ScUndoRefConversion()
{
delete pUndoDoc;
delete pRedoDoc;
}
-String __EXPORT ScUndoRefConversion::GetComment() const
+String ScUndoRefConversion::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_ENTERDATA ); // "Eingabe"
}
@@ -1582,7 +1646,7 @@ void ScUndoRefConversion::DoChange( ScDocument* pRefDoc)
if (pViewShell)
pViewShell->CellContentChanged();
}
-void __EXPORT ScUndoRefConversion::Undo()
+void ScUndoRefConversion::Undo()
{
BeginUndo();
if (pUndoDoc)
@@ -1593,7 +1657,7 @@ void __EXPORT ScUndoRefConversion::Undo()
EndUndo();
}
-void __EXPORT ScUndoRefConversion::Redo()
+void ScUndoRefConversion::Redo()
{
BeginRedo();
if (pRedoDoc)
@@ -1602,13 +1666,13 @@ void __EXPORT ScUndoRefConversion::Redo()
EndRedo();
}
-void __EXPORT ScUndoRefConversion::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoRefConversion::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->DoRefConversion();
}
-sal_Bool __EXPORT ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -1632,7 +1696,7 @@ ScUndoRefreshLink::ScUndoRefreshLink( ScDocShell* pNewDocShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoRefreshLink::~ScUndoRefreshLink()
+ScUndoRefreshLink::~ScUndoRefreshLink()
{
delete pUndoDoc;
delete pRedoDoc;
@@ -1641,7 +1705,7 @@ __EXPORT ScUndoRefreshLink::~ScUndoRefreshLink()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoRefreshLink::GetComment() const
+String ScUndoRefreshLink::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_UPDATELINK );
}
@@ -1649,7 +1713,7 @@ String __EXPORT ScUndoRefreshLink::GetComment() const
//----------------------------------------------------------------------------
-void __EXPORT ScUndoRefreshLink::Undo()
+void ScUndoRefreshLink::Undo()
{
BeginUndo();
@@ -1669,10 +1733,9 @@ void __EXPORT ScUndoRefreshLink::Undo()
if (bFirst)
pRedoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
else
- pRedoDoc->AddUndoTab( nTab, nTab, sal_True, sal_True );
- bFirst = sal_False;
- pDoc->CopyToDocument(aRange, IDF_ALL, sal_False, pRedoDoc);
-// pRedoDoc->TransferDrawPage( pDoc, nTab, nTab );
+ pRedoDoc->AddUndoTab( nTab, nTab, true, true );
+ bFirst = false;
+ pDoc->CopyToDocument(aRange, IDF_ALL, false, pRedoDoc);
pRedoDoc->SetLink( nTab,
pDoc->GetLinkMode(nTab),
pDoc->GetLinkDoc(nTab),
@@ -1683,8 +1746,7 @@ void __EXPORT ScUndoRefreshLink::Undo()
}
pDoc->DeleteAreaTab( aRange,IDF_ALL );
- pUndoDoc->CopyToDocument( aRange, IDF_ALL, sal_False, pDoc );
-// pDoc->TransferDrawPage( pUndoDoc, nTab, nTab );
+ pUndoDoc->CopyToDocument( aRange, IDF_ALL, false, pDoc );
pDoc->SetLink( nTab, pUndoDoc->GetLinkMode(nTab), pUndoDoc->GetLinkDoc(nTab),
pUndoDoc->GetLinkFlt(nTab), pUndoDoc->GetLinkOpt(nTab),
pUndoDoc->GetLinkTab(nTab),
@@ -1699,7 +1761,7 @@ void __EXPORT ScUndoRefreshLink::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoRefreshLink::Redo()
+void ScUndoRefreshLink::Redo()
{
DBG_ASSERT(pRedoDoc, "Kein RedoDoc bei ScUndoRefreshLink::Redo");
@@ -1713,8 +1775,7 @@ void __EXPORT ScUndoRefreshLink::Redo()
ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab);
pDoc->DeleteAreaTab( aRange, IDF_ALL );
- pRedoDoc->CopyToDocument( aRange, IDF_ALL, sal_False, pDoc );
-// pDoc->TransferDrawPage( pRedoDoc, nTab, nTab );
+ pRedoDoc->CopyToDocument( aRange, IDF_ALL, false, pDoc );
pDoc->SetLink( nTab,
pRedoDoc->GetLinkMode(nTab),
pRedoDoc->GetLinkDoc(nTab),
@@ -1732,7 +1793,7 @@ void __EXPORT ScUndoRefreshLink::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoRefreshLink::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoRefreshLink::Repeat(SfxRepeatTarget& /* rTarget */)
{
// gippsnich
}
@@ -1740,9 +1801,9 @@ void __EXPORT ScUndoRefreshLink::Repeat(SfxRepeatTarget& /* rTarget */)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoRefreshLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoRefreshLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -1762,7 +1823,7 @@ ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const String& rDo
return (ScAreaLink*)pBase;
}
- DBG_ERROR("ScAreaLink nicht gefunden");
+ OSL_FAIL("ScAreaLink nicht gefunden");
return NULL;
}
@@ -1794,14 +1855,14 @@ ScUndoInsertAreaLink::ScUndoInsertAreaLink( ScDocShell* pShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoInsertAreaLink::~ScUndoInsertAreaLink()
+ScUndoInsertAreaLink::~ScUndoInsertAreaLink()
{
}
//----------------------------------------------------------------------------
-String __EXPORT ScUndoInsertAreaLink::GetComment() const
+String ScUndoInsertAreaLink::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_INSERTAREALINK );
}
@@ -1809,7 +1870,7 @@ String __EXPORT ScUndoInsertAreaLink::GetComment() const
//----------------------------------------------------------------------------
-void __EXPORT ScUndoInsertAreaLink::Undo()
+void ScUndoInsertAreaLink::Undo()
{
ScDocument* pDoc = pDocShell->GetDocument();
sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
@@ -1825,7 +1886,7 @@ void __EXPORT ScUndoInsertAreaLink::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoInsertAreaLink::Redo()
+void ScUndoInsertAreaLink::Redo()
{
ScDocument* pDoc = pDocShell->GetDocument();
sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
@@ -1836,7 +1897,7 @@ void __EXPORT ScUndoInsertAreaLink::Redo()
pLink->SetDestArea( aRange );
pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aDocName, &aFltName, &aAreaName );
pLink->Update();
- pLink->SetInCreate( sal_False );
+ pLink->SetInCreate( false );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); // Navigator
}
@@ -1844,7 +1905,7 @@ void __EXPORT ScUndoInsertAreaLink::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoInsertAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoInsertAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
{
//! ....
}
@@ -1852,9 +1913,9 @@ void __EXPORT ScUndoInsertAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoInsertAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoInsertAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -1884,14 +1945,14 @@ ScUndoRemoveAreaLink::ScUndoRemoveAreaLink( ScDocShell* pShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoRemoveAreaLink::~ScUndoRemoveAreaLink()
+ScUndoRemoveAreaLink::~ScUndoRemoveAreaLink()
{
}
//----------------------------------------------------------------------------
-String __EXPORT ScUndoRemoveAreaLink::GetComment() const
+String ScUndoRemoveAreaLink::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_REMOVELINK ); //! eigener Text ??
}
@@ -1899,7 +1960,7 @@ String __EXPORT ScUndoRemoveAreaLink::GetComment() const
//----------------------------------------------------------------------------
-void __EXPORT ScUndoRemoveAreaLink::Undo()
+void ScUndoRemoveAreaLink::Undo()
{
ScDocument* pDoc = pDocShell->GetDocument();
sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
@@ -1910,7 +1971,7 @@ void __EXPORT ScUndoRemoveAreaLink::Undo()
pLink->SetDestArea( aRange );
pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aDocName, &aFltName, &aAreaName );
pLink->Update();
- pLink->SetInCreate( sal_False );
+ pLink->SetInCreate( false );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); // Navigator
}
@@ -1918,7 +1979,7 @@ void __EXPORT ScUndoRemoveAreaLink::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoRemoveAreaLink::Redo()
+void ScUndoRemoveAreaLink::Redo()
{
ScDocument* pDoc = pDocShell->GetDocument();
sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
@@ -1934,7 +1995,7 @@ void __EXPORT ScUndoRemoveAreaLink::Redo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoRemoveAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoRemoveAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
{
// gippsnich
}
@@ -1942,9 +2003,9 @@ void __EXPORT ScUndoRemoveAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoRemoveAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoRemoveAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -1986,7 +2047,7 @@ ScUndoUpdateAreaLink::ScUndoUpdateAreaLink( ScDocShell* pShell,
//----------------------------------------------------------------------------
-__EXPORT ScUndoUpdateAreaLink::~ScUndoUpdateAreaLink()
+ScUndoUpdateAreaLink::~ScUndoUpdateAreaLink()
{
delete pUndoDoc;
delete pRedoDoc;
@@ -1995,7 +2056,7 @@ __EXPORT ScUndoUpdateAreaLink::~ScUndoUpdateAreaLink()
//----------------------------------------------------------------------------
-String __EXPORT ScUndoUpdateAreaLink::GetComment() const
+String ScUndoUpdateAreaLink::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_UPDATELINK ); //! eigener Text ??
}
@@ -2017,13 +2078,13 @@ void ScUndoUpdateAreaLink::DoChange( const sal_Bool bUndo ) const
{
pDoc->FitBlock( aNewRange, aOldRange );
pDoc->DeleteAreaTab( aOldRange, IDF_ALL & ~IDF_NOTE );
- pUndoDoc->UndoToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ pUndoDoc->UndoToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
}
else
{
ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) );
pDoc->DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
}
}
else
@@ -2032,13 +2093,13 @@ void ScUndoUpdateAreaLink::DoChange( const sal_Bool bUndo ) const
{
pDoc->FitBlock( aOldRange, aNewRange );
pDoc->DeleteAreaTab( aNewRange, IDF_ALL & ~IDF_NOTE );
- pRedoDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ pRedoDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
}
else
{
ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) );
pDoc->DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
- pRedoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ pRedoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
}
}
@@ -2064,7 +2125,7 @@ void ScUndoUpdateAreaLink::DoChange( const sal_Bool bUndo ) const
//----------------------------------------------------------------------------
-void __EXPORT ScUndoUpdateAreaLink::Undo()
+void ScUndoUpdateAreaLink::Undo()
{
ScDocument* pDoc = pDocShell->GetDocument();
sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
@@ -2083,7 +2144,7 @@ void __EXPORT ScUndoUpdateAreaLink::Undo()
//----------------------------------------------------------------------------
-void __EXPORT ScUndoUpdateAreaLink::Redo()
+void ScUndoUpdateAreaLink::Redo()
{
ScDocument* pDoc = pDocShell->GetDocument();
sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
@@ -2096,13 +2157,13 @@ void __EXPORT ScUndoUpdateAreaLink::Redo()
pLink->SetRefreshDelay( nNewRefresh );
}
- DoChange(sal_False);
+ DoChange(false);
}
//----------------------------------------------------------------------------
-void __EXPORT ScUndoUpdateAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoUpdateAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
{
// gippsnich
}
@@ -2110,11 +2171,12 @@ void __EXPORT ScUndoUpdateAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
//----------------------------------------------------------------------------
-sal_Bool __EXPORT ScUndoUpdateAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoUpdateAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 737413467b07..9743cf42c193 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,6 +55,8 @@
#include "sc.hrc"
#include "docuno.hxx"
+using ::boost::shared_ptr;
+
// STATIC DATA -----------------------------------------------------------
TYPEINIT1(ScUndoCursorAttr, ScSimpleUndo);
@@ -82,6 +85,8 @@ ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell,
nCol( nNewCol ),
nRow( nNewRow ),
nTab( nNewTab ),
+ pOldEditData( static_cast<EditTextObject*>(NULL) ),
+ pNewEditData( static_cast<EditTextObject*>(NULL) ),
bIsAutomatic( bAutomatic )
{
ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
@@ -90,7 +95,7 @@ ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell,
pApplyPattern = (ScPatternAttr*) &pPool->Put( *pApplyPat );
}
-__EXPORT ScUndoCursorAttr::~ScUndoCursorAttr()
+ScUndoCursorAttr::~ScUndoCursorAttr()
{
ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
pPool->Remove(*pNewPattern);
@@ -98,7 +103,7 @@ __EXPORT ScUndoCursorAttr::~ScUndoCursorAttr()
pPool->Remove(*pApplyPattern);
}
-String __EXPORT ScUndoCursorAttr::GetComment() const
+String ScUndoCursorAttr::GetComment() const
{
//! eigener Text fuer automatische Attributierung
@@ -106,15 +111,27 @@ String __EXPORT ScUndoCursorAttr::GetComment() const
return ScGlobal::GetRscString( nId );
}
-void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern ) const
+void ScUndoCursorAttr::SetEditData( EditTextObject* pOld, EditTextObject* pNew )
+{
+ pOldEditData.reset(pOld);
+ pNewEditData.reset(pNew);
+}
+
+void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern, const shared_ptr<EditTextObject>& pEditData ) const
{
- pDocShell->GetDocument()->SetPattern( nCol, nRow, nTab, *pWhichPattern, sal_True );
+ ScDocument* pDoc = pDocShell->GetDocument();
+ pDoc->SetPattern( nCol, nRow, nTab, *pWhichPattern, true );
+
+ ScBaseCell* pCell;
+ pDoc->GetCell(nCol, nRow, nTab, pCell);
+ if (pCell && pCell->GetCellType() == CELLTYPE_EDIT && pEditData.get())
+ static_cast<ScEditCell*>(pCell)->SetData(pEditData.get(), NULL);
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
pViewShell->SetTabNo( nTab );
- pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, sal_False, sal_False );
+ pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
pViewShell->AdjustBlockHeight();
}
@@ -131,10 +148,10 @@ void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern ) const
pDocShell->PostPaint( nCol,nRow,nTab, nCol,nRow,nTab, PAINT_GRID, nFlags );
}
-void __EXPORT ScUndoCursorAttr::Undo()
+void ScUndoCursorAttr::Undo()
{
BeginUndo();
- DoChange(pOldPattern);
+ DoChange(pOldPattern, pOldEditData);
if ( bIsAutomatic )
{
@@ -149,20 +166,20 @@ void __EXPORT ScUndoCursorAttr::Undo()
EndUndo();
}
-void __EXPORT ScUndoCursorAttr::Redo()
+void ScUndoCursorAttr::Redo()
{
BeginRedo();
- DoChange(pNewPattern);
+ DoChange(pNewPattern, pNewEditData);
EndRedo();
}
-void __EXPORT ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->ApplySelectionPattern( *pApplyPattern );
}
-sal_Bool __EXPORT ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -193,7 +210,7 @@ ScUndoEnterData::ScUndoEnterData( ScDocShell* pNewDocShell,
SetChangeTrack();
}
-__EXPORT ScUndoEnterData::~ScUndoEnterData()
+ScUndoEnterData::~ScUndoEnterData()
{
for (sal_uInt16 i=0; i<nCount; i++)
if (ppOldCells[i])
@@ -207,7 +224,7 @@ __EXPORT ScUndoEnterData::~ScUndoEnterData()
delete pNewEditData;
}
-String __EXPORT ScUndoEnterData::GetComment() const
+String ScUndoEnterData::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_ENTERDATA ); // "Eingabe"
}
@@ -223,7 +240,7 @@ void ScUndoEnterData::DoChange() const
if (pViewShell)
{
pViewShell->SetTabNo( nTab );
- pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, sal_False, sal_False );
+ pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
}
pDocShell->PostDataChanged();
@@ -254,7 +271,7 @@ void ScUndoEnterData::SetChangeTrack()
nEndChangeAction = 0;
}
-void __EXPORT ScUndoEnterData::Undo()
+void ScUndoEnterData::Undo()
{
BeginUndo();
@@ -299,7 +316,7 @@ void __EXPORT ScUndoEnterData::Undo()
}
}
-void __EXPORT ScUndoEnterData::Redo()
+void ScUndoEnterData::Redo()
{
BeginRedo();
@@ -332,7 +349,7 @@ void __EXPORT ScUndoEnterData::Redo()
}
}
-void __EXPORT ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -341,7 +358,7 @@ void __EXPORT ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -363,13 +380,13 @@ ScUndoEnterValue::ScUndoEnterValue( ScDocShell* pNewDocShell, const ScAddress& r
SetChangeTrack();
}
-__EXPORT ScUndoEnterValue::~ScUndoEnterValue()
+ScUndoEnterValue::~ScUndoEnterValue()
{
if (pOldCell)
pOldCell->Delete();
}
-String __EXPORT ScUndoEnterValue::GetComment() const
+String ScUndoEnterValue::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_ENTERDATA ); // "Eingabe"
}
@@ -389,7 +406,7 @@ void ScUndoEnterValue::SetChangeTrack()
nEndChangeAction = 0;
}
-void __EXPORT ScUndoEnterValue::Undo()
+void ScUndoEnterValue::Undo()
{
BeginUndo();
@@ -407,7 +424,7 @@ void __EXPORT ScUndoEnterValue::Undo()
EndUndo();
}
-void __EXPORT ScUndoEnterValue::Redo()
+void ScUndoEnterValue::Redo()
{
BeginRedo();
@@ -420,14 +437,14 @@ void __EXPORT ScUndoEnterValue::Redo()
EndRedo();
}
-void __EXPORT ScUndoEnterValue::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoEnterValue::Repeat(SfxRepeatTarget& /* rTarget */)
{
// gippsnich
}
-sal_Bool __EXPORT ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -447,7 +464,7 @@ ScUndoPutCell::ScUndoPutCell( ScDocShell* pNewDocShell, const ScAddress& rNewPos
SetChangeTrack();
}
-__EXPORT ScUndoPutCell::~ScUndoPutCell()
+ScUndoPutCell::~ScUndoPutCell()
{
if (pOldCell)
pOldCell->Delete();
@@ -455,7 +472,7 @@ __EXPORT ScUndoPutCell::~ScUndoPutCell()
pEnteredCell->Delete();
}
-String __EXPORT ScUndoPutCell::GetComment() const
+String ScUndoPutCell::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_ENTERDATA ); // "Eingabe"
}
@@ -475,7 +492,7 @@ void ScUndoPutCell::SetChangeTrack()
nEndChangeAction = 0;
}
-void __EXPORT ScUndoPutCell::Undo()
+void ScUndoPutCell::Undo()
{
BeginUndo();
@@ -493,7 +510,7 @@ void __EXPORT ScUndoPutCell::Undo()
EndUndo();
}
-void __EXPORT ScUndoPutCell::Redo()
+void ScUndoPutCell::Redo()
{
BeginRedo();
@@ -509,14 +526,14 @@ void __EXPORT ScUndoPutCell::Redo()
EndRedo();
}
-void __EXPORT ScUndoPutCell::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoPutCell::Repeat(SfxRepeatTarget& /* rTarget */)
{
// gippsnich
}
-sal_Bool __EXPORT ScUndoPutCell::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoPutCell::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -537,11 +554,11 @@ ScUndoPageBreak::ScUndoPageBreak( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoPageBreak::~ScUndoPageBreak()
+ScUndoPageBreak::~ScUndoPageBreak()
{
}
-String __EXPORT ScUndoPageBreak::GetComment() const
+String ScUndoPageBreak::GetComment() const
{
//"Spaltenumbruch" | "Zeilenumbruch" "einfuegen" | "loeschen"
return String ( bColumn ?
@@ -562,32 +579,32 @@ void ScUndoPageBreak::DoChange( sal_Bool bInsertP ) const
if (pViewShell)
{
pViewShell->SetTabNo( nTab );
- pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, sal_False, sal_False );
+ pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
if (bInsertP)
- pViewShell->InsertPageBreak(bColumn, sal_False);
+ pViewShell->InsertPageBreak(bColumn, false);
else
- pViewShell->DeletePageBreak(bColumn, sal_False);
+ pViewShell->DeletePageBreak(bColumn, false);
pDocShell->GetDocument()->InvalidatePageBreaks(nTab);
}
}
-void __EXPORT ScUndoPageBreak::Undo()
+void ScUndoPageBreak::Undo()
{
BeginUndo();
DoChange(!bInsert);
EndUndo();
}
-void __EXPORT ScUndoPageBreak::Redo()
+void ScUndoPageBreak::Redo()
{
BeginRedo();
DoChange(bInsert);
EndRedo();
}
-void __EXPORT ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -600,7 +617,7 @@ void __EXPORT ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -621,11 +638,11 @@ ScUndoPrintZoom::ScUndoPrintZoom( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoPrintZoom::~ScUndoPrintZoom()
+ScUndoPrintZoom::~ScUndoPrintZoom()
{
}
-String __EXPORT ScUndoPrintZoom::GetComment() const
+String ScUndoPrintZoom::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_PRINTSCALE );
}
@@ -651,21 +668,21 @@ void ScUndoPrintZoom::DoChange( sal_Bool bUndo )
}
}
-void __EXPORT ScUndoPrintZoom::Undo()
+void ScUndoPrintZoom::Undo()
{
BeginUndo();
DoChange(sal_True);
EndUndo();
}
-void __EXPORT ScUndoPrintZoom::Redo()
+void ScUndoPrintZoom::Redo()
{
BeginRedo();
- DoChange(sal_False);
+ DoChange(false);
EndRedo();
}
-void __EXPORT ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -675,7 +692,7 @@ void __EXPORT ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -709,13 +726,13 @@ ScUndoThesaurus::ScUndoThesaurus( ScDocShell* pNewDocShell,
pOldCell->Delete();
}
-__EXPORT ScUndoThesaurus::~ScUndoThesaurus()
+ScUndoThesaurus::~ScUndoThesaurus()
{
delete pUndoTObject;
delete pRedoTObject;
}
-String __EXPORT ScUndoThesaurus::GetComment() const
+String ScUndoThesaurus::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_THESAURUS ); // "Thesaurus"
}
@@ -734,7 +751,7 @@ void ScUndoThesaurus::SetChangeTrack( ScBaseCell* pOldCell )
nEndChangeAction = 0;
}
-void __EXPORT ScUndoThesaurus::DoChange( sal_Bool bUndo, const String& rStr,
+void ScUndoThesaurus::DoChange( sal_Bool bUndo, const String& rStr,
const EditTextObject* pTObj )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -743,7 +760,7 @@ void __EXPORT ScUndoThesaurus::DoChange( sal_Bool bUndo, const String& rStr,
if (pViewShell)
{
pViewShell->SetTabNo( nTab );
- pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, sal_False, sal_False );
+ pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
}
if (pTObj)
@@ -761,7 +778,7 @@ void __EXPORT ScUndoThesaurus::DoChange( sal_Bool bUndo, const String& rStr,
}
else
{
- DBG_ERROR("Nicht CELLTYPE_EDIT bei Un/RedoThesaurus");
+ OSL_FAIL("Nicht CELLTYPE_EDIT bei Un/RedoThesaurus");
}
}
}
@@ -778,7 +795,7 @@ void __EXPORT ScUndoThesaurus::DoChange( sal_Bool bUndo, const String& rStr,
pDocShell->PostPaintCell( nCol, nRow, nTab );
}
-void __EXPORT ScUndoThesaurus::Undo()
+void ScUndoThesaurus::Undo()
{
BeginUndo();
DoChange( sal_True, aUndoStr, pUndoTObject );
@@ -788,20 +805,20 @@ void __EXPORT ScUndoThesaurus::Undo()
EndUndo();
}
-void __EXPORT ScUndoThesaurus::Redo()
+void ScUndoThesaurus::Redo()
{
BeginRedo();
- DoChange( sal_False, aRedoStr, pRedoTObject );
+ DoChange( false, aRedoStr, pRedoTObject );
EndRedo();
}
-void __EXPORT ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->DoThesaurus( sal_True );
}
-sal_Bool __EXPORT ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -868,7 +885,7 @@ void ScUndoReplaceNote::Repeat( SfxRepeatTarget& /*rTarget*/ )
sal_Bool ScUndoReplaceNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
{
- return sal_False;
+ return false;
}
String ScUndoReplaceNote::GetComment() const
@@ -940,7 +957,7 @@ void ScUndoShowHideNote::Repeat( SfxRepeatTarget& /*rTarget*/ )
sal_Bool ScUndoShowHideNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
{
- return sal_False;
+ return false;
}
String ScUndoShowHideNote::GetComment() const
@@ -971,13 +988,13 @@ ScUndoDetective::ScUndoDetective( ScDocShell* pNewDocShell,
}
}
-__EXPORT ScUndoDetective::~ScUndoDetective()
+ScUndoDetective::~ScUndoDetective()
{
DeleteSdrUndoAction( pDrawUndo );
delete pOldList;
}
-String __EXPORT ScUndoDetective::GetComment() const
+String ScUndoDetective::GetComment() const
{
sal_uInt16 nId = STR_UNDO_DETDELALL;
if ( !bIsDelete )
@@ -994,7 +1011,7 @@ String __EXPORT ScUndoDetective::GetComment() const
}
-void __EXPORT ScUndoDetective::Undo()
+void ScUndoDetective::Undo()
{
BeginUndo();
@@ -1019,7 +1036,7 @@ void __EXPORT ScUndoDetective::Undo()
pList->DeleteAndDestroy( nPos, 1 );
else
{
- DBG_ERROR("Detektiv-Eintrag in der Liste nicht gefunden");
+ OSL_FAIL("Detektiv-Eintrag in der Liste nicht gefunden");
}
}
}
@@ -1031,7 +1048,7 @@ void __EXPORT ScUndoDetective::Undo()
EndUndo();
}
-void __EXPORT ScUndoDetective::Redo()
+void ScUndoDetective::Redo()
{
BeginRedo();
@@ -1051,14 +1068,14 @@ void __EXPORT ScUndoDetective::Redo()
EndRedo();
}
-void __EXPORT ScUndoDetective::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoDetective::Repeat(SfxRepeatTarget& /* rTarget */)
{
// hammanich
}
-sal_Bool __EXPORT ScUndoDetective::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoDetective::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
@@ -1074,13 +1091,13 @@ ScUndoRangeNames::ScUndoRangeNames( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoRangeNames::~ScUndoRangeNames()
+ScUndoRangeNames::~ScUndoRangeNames()
{
delete pOldRanges;
delete pNewRanges;
}
-String __EXPORT ScUndoRangeNames::GetComment() const
+String ScUndoRangeNames::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_RANGENAMES );
}
@@ -1095,35 +1112,36 @@ void ScUndoRangeNames::DoChange( sal_Bool bUndo )
else
pDoc->SetRangeName( new ScRangeName( *pNewRanges ) );
- pDoc->CompileNameFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileNameFormula( false ); // CompileFormulaString
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
}
-void __EXPORT ScUndoRangeNames::Undo()
+void ScUndoRangeNames::Undo()
{
BeginUndo();
DoChange( sal_True );
EndUndo();
}
-void __EXPORT ScUndoRangeNames::Redo()
+void ScUndoRangeNames::Redo()
{
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
}
-void __EXPORT ScUndoRangeNames::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoRangeNames::Repeat(SfxRepeatTarget& /* rTarget */)
{
// hammanich
}
-sal_Bool __EXPORT ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 825034b4a138..dc23ff8f6aeb 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,6 +53,8 @@
#include "attrib.hxx"
#include "hints.hxx"
#include "sc.hrc"
+#include "chgtrack.hxx" // Amelia Wang
+#include "refundo.hxx" // Amelia Wang
// -----------------------------------------------------------------------
@@ -68,10 +71,10 @@ TYPEINIT1(ScUndoAutoFilter, ScDBFuncUndo);
TYPEINIT1(ScUndoDBData, ScSimpleUndo);
TYPEINIT1(ScUndoImportData, ScSimpleUndo);
TYPEINIT1(ScUndoRepeatDB, ScSimpleUndo);
-//UNUSED2008-05 TYPEINIT1(ScUndoPivot, ScSimpleUndo);
TYPEINIT1(ScUndoDataPilot, ScSimpleUndo);
TYPEINIT1(ScUndoConsolidate, ScSimpleUndo);
TYPEINIT1(ScUndoChartData, ScSimpleUndo);
+TYPEINIT1(ScUndoDataForm, SfxUndoAction); // amelia
// -----------------------------------------------------------------------
@@ -96,19 +99,19 @@ ScUndoDoOutline::ScUndoDoOutline( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoDoOutline::~ScUndoDoOutline()
+ScUndoDoOutline::~ScUndoDoOutline()
{
delete pUndoDoc;
}
-String __EXPORT ScUndoDoOutline::GetComment() const
+String ScUndoDoOutline::GetComment() const
{ // Detail einblenden" "Detail ausblenden"
return bShow ?
ScGlobal::GetRscString( STR_UNDO_DOOUTLINE ) :
ScGlobal::GetRscString( STR_UNDO_REDOOUTLINE );
}
-void __EXPORT ScUndoDoOutline::Undo()
+void ScUndoDoOutline::Undo()
{
BeginUndo();
@@ -124,17 +127,17 @@ void __EXPORT ScUndoDoOutline::Undo()
// inverse Funktion ausfuehren
if (bShow)
- pViewShell->HideOutline( bColumns, nLevel, nEntry, sal_False, sal_False );
+ pViewShell->HideOutline( bColumns, nLevel, nEntry, false, false );
else
- pViewShell->ShowOutline( bColumns, nLevel, nEntry, sal_False, sal_False );
+ pViewShell->ShowOutline( bColumns, nLevel, nEntry, false, false );
// Original Spalten-/Zeilenstatus
if (bColumns)
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, sal_False, pDoc);
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pDoc);
else
- pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pDoc );
pViewShell->UpdateScrollBars();
@@ -143,7 +146,7 @@ void __EXPORT ScUndoDoOutline::Undo()
EndUndo();
}
-void __EXPORT ScUndoDoOutline::Redo()
+void ScUndoDoOutline::Redo()
{
BeginRedo();
@@ -156,20 +159,20 @@ void __EXPORT ScUndoDoOutline::Redo()
pViewShell->SetTabNo( nTab );
if (bShow)
- pViewShell->ShowOutline( bColumns, nLevel, nEntry, sal_False );
+ pViewShell->ShowOutline( bColumns, nLevel, nEntry, false );
else
- pViewShell->HideOutline( bColumns, nLevel, nEntry, sal_False );
+ pViewShell->HideOutline( bColumns, nLevel, nEntry, false );
EndRedo();
}
-void __EXPORT ScUndoDoOutline::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoDoOutline::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoDoOutline::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoDoOutline::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // geht nicht
+ return false; // geht nicht
}
//
@@ -189,19 +192,19 @@ ScUndoMakeOutline::ScUndoMakeOutline( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoMakeOutline::~ScUndoMakeOutline()
+ScUndoMakeOutline::~ScUndoMakeOutline()
{
delete pUndoTable;
}
-String __EXPORT ScUndoMakeOutline::GetComment() const
+String ScUndoMakeOutline::GetComment() const
{ // "Gruppierung" "Gruppierung aufheben"
return bMake ?
ScGlobal::GetRscString( STR_UNDO_MAKEOUTLINE ) :
ScGlobal::GetRscString( STR_UNDO_REMAKEOUTLINE );
}
-void __EXPORT ScUndoMakeOutline::Undo()
+void ScUndoMakeOutline::Undo()
{
BeginUndo();
@@ -222,7 +225,7 @@ void __EXPORT ScUndoMakeOutline::Undo()
EndUndo();
}
-void __EXPORT ScUndoMakeOutline::Redo()
+void ScUndoMakeOutline::Redo()
{
BeginRedo();
@@ -231,16 +234,16 @@ void __EXPORT ScUndoMakeOutline::Redo()
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart, aBlockEnd );
if (bMake)
- pViewShell->MakeOutline( bColumns, sal_False );
+ pViewShell->MakeOutline( bColumns, false );
else
- pViewShell->RemoveOutline( bColumns, sal_False );
+ pViewShell->RemoveOutline( bColumns, false );
pDocShell->PostPaint(0,0,aBlockStart.Tab(),MAXCOL,MAXROW,aBlockEnd.Tab(),PAINT_GRID);
EndRedo();
}
-void __EXPORT ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -253,7 +256,7 @@ void __EXPORT ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoMakeOutline::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoMakeOutline::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -277,18 +280,18 @@ ScUndoOutlineLevel::ScUndoOutlineLevel( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoOutlineLevel::~ScUndoOutlineLevel()
+ScUndoOutlineLevel::~ScUndoOutlineLevel()
{
delete pUndoDoc;
delete pUndoTable;
}
-String __EXPORT ScUndoOutlineLevel::GetComment() const
+String ScUndoOutlineLevel::GetComment() const
{ // "Gliederungsebene auswaehlen";
return ScGlobal::GetRscString( STR_UNDO_OUTLINELEVEL );
}
-void __EXPORT ScUndoOutlineLevel::Undo()
+void ScUndoOutlineLevel::Undo()
{
BeginUndo();
@@ -303,9 +306,9 @@ void __EXPORT ScUndoOutlineLevel::Undo()
if (bColumns)
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, sal_False, pDoc);
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pDoc);
else
- pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pDoc );
pDoc->UpdatePageBreaks( nTab );
@@ -320,7 +323,7 @@ void __EXPORT ScUndoOutlineLevel::Undo()
EndUndo();
}
-void __EXPORT ScUndoOutlineLevel::Redo()
+void ScUndoOutlineLevel::Redo()
{
BeginRedo();
@@ -332,18 +335,18 @@ void __EXPORT ScUndoOutlineLevel::Redo()
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
- pViewShell->SelectLevel( bColumns, nLevel, sal_False );
+ pViewShell->SelectLevel( bColumns, nLevel, false );
EndRedo();
}
-void __EXPORT ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->SelectLevel( bColumns, nLevel, sal_True );
}
-sal_Bool __EXPORT ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -365,20 +368,20 @@ ScUndoOutlineBlock::ScUndoOutlineBlock( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoOutlineBlock::~ScUndoOutlineBlock()
+ScUndoOutlineBlock::~ScUndoOutlineBlock()
{
delete pUndoDoc;
delete pUndoTable;
}
-String __EXPORT ScUndoOutlineBlock::GetComment() const
+String ScUndoOutlineBlock::GetComment() const
{ // "Detail einblenden" "Detail ausblenden"
return bShow ?
ScGlobal::GetRscString( STR_UNDO_DOOUTLINEBLK ) :
ScGlobal::GetRscString( STR_UNDO_REDOOUTLINEBLK );
}
-void __EXPORT ScUndoOutlineBlock::Undo()
+void ScUndoOutlineBlock::Undo()
{
BeginUndo();
@@ -407,8 +410,8 @@ void __EXPORT ScUndoOutlineBlock::Undo()
}
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
- static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, sal_False, pDoc );
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, sal_False, pDoc );
+ static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
pDoc->UpdatePageBreaks( nTab );
@@ -423,7 +426,7 @@ void __EXPORT ScUndoOutlineBlock::Undo()
EndUndo();
}
-void __EXPORT ScUndoOutlineBlock::Redo()
+void ScUndoOutlineBlock::Redo()
{
BeginRedo();
@@ -431,14 +434,14 @@ void __EXPORT ScUndoOutlineBlock::Redo()
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart, aBlockEnd );
if (bShow)
- pViewShell->ShowMarkedOutlines( sal_False );
+ pViewShell->ShowMarkedOutlines( false );
else
- pViewShell->HideMarkedOutlines( sal_False );
+ pViewShell->HideMarkedOutlines( false );
EndRedo();
}
-void __EXPORT ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -451,7 +454,7 @@ void __EXPORT ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoOutlineBlock::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoOutlineBlock::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -472,18 +475,18 @@ ScUndoRemoveAllOutlines::ScUndoRemoveAllOutlines( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoRemoveAllOutlines::~ScUndoRemoveAllOutlines()
+ScUndoRemoveAllOutlines::~ScUndoRemoveAllOutlines()
{
delete pUndoDoc;
delete pUndoTable;
}
-String __EXPORT ScUndoRemoveAllOutlines::GetComment() const
+String ScUndoRemoveAllOutlines::GetComment() const
{ // "Gliederung entfernen"
return ScGlobal::GetRscString( STR_UNDO_REMOVEALLOTLNS );
}
-void __EXPORT ScUndoRemoveAllOutlines::Undo()
+void ScUndoRemoveAllOutlines::Undo()
{
BeginUndo();
@@ -502,8 +505,8 @@ void __EXPORT ScUndoRemoveAllOutlines::Undo()
SCROW nStartRow = aBlockStart.Row();
SCROW nEndRow = aBlockEnd.Row();
- pUndoDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, sal_False, pDoc );
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
pDoc->UpdatePageBreaks( nTab );
@@ -518,7 +521,7 @@ void __EXPORT ScUndoRemoveAllOutlines::Undo()
EndUndo();
}
-void __EXPORT ScUndoRemoveAllOutlines::Redo()
+void ScUndoRemoveAllOutlines::Redo()
{
BeginRedo();
@@ -531,18 +534,18 @@ void __EXPORT ScUndoRemoveAllOutlines::Redo()
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
- pViewShell->RemoveAllOutlines( sal_False );
+ pViewShell->RemoveAllOutlines( false );
EndRedo();
}
-void __EXPORT ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->RemoveAllOutlines( sal_True );
}
-sal_Bool __EXPORT ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -563,18 +566,18 @@ ScUndoAutoOutline::ScUndoAutoOutline( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoAutoOutline::~ScUndoAutoOutline()
+ScUndoAutoOutline::~ScUndoAutoOutline()
{
delete pUndoDoc;
delete pUndoTable;
}
-String __EXPORT ScUndoAutoOutline::GetComment() const
+String ScUndoAutoOutline::GetComment() const
{ // "Auto-Gliederung"
return ScGlobal::GetRscString( STR_UNDO_AUTOOUTLINE );
}
-void __EXPORT ScUndoAutoOutline::Undo()
+void ScUndoAutoOutline::Undo()
{
BeginUndo();
@@ -598,9 +601,9 @@ void __EXPORT ScUndoAutoOutline::Undo()
pUndoTable->GetRowArray()->GetRange( nStartRow, nEndRow );
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
- static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, sal_False,
+ static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false,
pDoc);
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
pViewShell->UpdateScrollBars();
}
@@ -614,7 +617,7 @@ void __EXPORT ScUndoAutoOutline::Undo()
EndUndo();
}
-void __EXPORT ScUndoAutoOutline::Redo()
+void ScUndoAutoOutline::Redo()
{
BeginRedo();
@@ -633,7 +636,7 @@ void __EXPORT ScUndoAutoOutline::Redo()
ScRange aRange( aBlockStart.Col(), aBlockStart.Row(), nTab,
aBlockEnd.Col(), aBlockEnd.Row(), nTab );
ScOutlineDocFunc aFunc( *pDocShell );
- aFunc.AutoOutline( aRange, sal_False, sal_False );
+ aFunc.AutoOutline( aRange, false, false );
// auf der View markieren
// Wenn's beim Aufruf eine Mehrfachselektion war, ist es jetzt der
@@ -645,13 +648,13 @@ void __EXPORT ScUndoAutoOutline::Redo()
EndRedo();
}
-void __EXPORT ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->AutoOutline( sal_True );
}
-sal_Bool __EXPORT ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
@@ -676,7 +679,7 @@ ScUndoSubTotals::ScUndoSubTotals( ScDocShell* pNewDocShell, SCTAB nNewTab,
{
}
-__EXPORT ScUndoSubTotals::~ScUndoSubTotals()
+ScUndoSubTotals::~ScUndoSubTotals()
{
delete pUndoDoc;
delete pUndoTable;
@@ -684,23 +687,18 @@ __EXPORT ScUndoSubTotals::~ScUndoSubTotals()
delete pUndoDB;
}
-String __EXPORT ScUndoSubTotals::GetComment() const
+String ScUndoSubTotals::GetComment() const
{ // "Teilergebnisse"
return ScGlobal::GetRscString( STR_UNDO_SUBTOTALS );
}
-void __EXPORT ScUndoSubTotals::Undo()
+void ScUndoSubTotals::Undo()
{
BeginUndo();
ScDocument* pDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- // um einzelnen DB-Bereich anzupassen
-/* ScDBData* pOldDBData = ScUndoUtil::GetOldDBData( pUndoDBData, pDoc, nTab,
- aParam.nCol1, aParam.nRow1, aParam.nCol2, nNewEndRow );
-*/
-
if (nNewEndRow > aParam.nRow2)
{
pDoc->DeleteRow( 0,nTab, MAXCOL,nTab, aParam.nRow2+1, static_cast<SCSIZE>(nNewEndRow-aParam.nRow2) );
@@ -727,9 +725,9 @@ void __EXPORT ScUndoSubTotals::Undo()
pUndoTable->GetRowArray()->GetRange( nStartRow, nEndRow );
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
- static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, sal_False,
+ static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false,
pDoc);
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
pViewShell->UpdateScrollBars();
}
@@ -742,16 +740,13 @@ void __EXPORT ScUndoSubTotals::Undo()
pDoc->DeleteAreaTab( 0,aParam.nRow1+1, MAXCOL,aParam.nRow2, nTab, IDF_ALL );
pUndoDoc->CopyToDocument( 0, aParam.nRow1+1, nTab, MAXCOL, aParam.nRow2, nTab,
- IDF_NONE, sal_False, pDoc ); // Flags
+ IDF_NONE, false, pDoc ); // Flags
pUndoDoc->UndoToDocument( 0, aParam.nRow1+1, nTab, MAXCOL, aParam.nRow2, nTab,
- IDF_ALL, sal_False, pDoc );
+ IDF_ALL, false, pDoc );
ScUndoUtil::MarkSimpleBlock( pDocShell, aParam.nCol1,aParam.nRow1,nTab,
aParam.nCol2,aParam.nRow2,nTab );
-/* if (pUndoDBData)
- *pOldDBData = *pUndoDBData;
-*/
if (pUndoRange)
pDoc->SetRangeName( new ScRangeName( *pUndoRange ) );
if (pUndoDB)
@@ -767,7 +762,7 @@ void __EXPORT ScUndoSubTotals::Undo()
EndUndo();
}
-void __EXPORT ScUndoSubTotals::Redo()
+void ScUndoSubTotals::Redo()
{
BeginRedo();
@@ -779,18 +774,18 @@ void __EXPORT ScUndoSubTotals::Redo()
ScUndoUtil::MarkSimpleBlock( pDocShell, aParam.nCol1,aParam.nRow1,nTab,
aParam.nCol2,aParam.nRow2,nTab );
- pViewShell->DoSubTotals( aParam, sal_False );
+ pViewShell->DoSubTotals( aParam, false );
EndRedo();
}
-void __EXPORT ScUndoSubTotals::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoSubTotals::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoSubTotals::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoSubTotals::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // geht nicht wegen Spaltennummern
+ return false; // geht nicht wegen Spaltennummern
}
//
@@ -808,7 +803,7 @@ ScUndoSort::ScUndoSort( ScDocShell* pNewDocShell,
bRepeatQuery( bQuery ),
pUndoDoc( pNewUndoDoc ),
pUndoDB( pNewUndoDB ),
- bDestArea( sal_False )
+ bDestArea( false )
{
if ( pDest )
{
@@ -817,18 +812,18 @@ ScUndoSort::ScUndoSort( ScDocShell* pNewDocShell,
}
}
-__EXPORT ScUndoSort::~ScUndoSort()
+ScUndoSort::~ScUndoSort()
{
delete pUndoDoc;
delete pUndoDB;
}
-String __EXPORT ScUndoSort::GetComment() const
+String ScUndoSort::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_SORT );
}
-void __EXPORT ScUndoSort::Undo()
+void ScUndoSort::Undo()
{
BeginUndo();
@@ -855,20 +850,20 @@ void __EXPORT ScUndoSort::Undo()
// do not delete/copy note captions, they are handled in drawing undo (ScDBFuncUndo::mpDrawUndo)
pDoc->DeleteAreaTab( nStartCol,nStartRow, nEndCol,nEndRow, nSortTab, IDF_ALL|IDF_NOCAPTIONS );
pUndoDoc->CopyToDocument( nStartCol, nStartRow, nSortTab, nEndCol, nEndRow, nSortTab,
- IDF_ALL|IDF_NOCAPTIONS, sal_False, pDoc );
+ IDF_ALL|IDF_NOCAPTIONS, false, pDoc );
if (bDestArea)
{
// do not delete/copy note captions, they are handled in drawing undo (ScDBFuncUndo::mpDrawUndo)
pDoc->DeleteAreaTab( aDestRange, IDF_ALL|IDF_NOCAPTIONS );
- pUndoDoc->CopyToDocument( aDestRange, IDF_ALL|IDF_NOCAPTIONS, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( aDestRange, IDF_ALL|IDF_NOCAPTIONS, false, pDoc );
}
// Zeilenhoehen immer (wegen automatischer Anpassung)
//! auf ScBlockUndo umstellen
// if (bRepeatQuery)
pUndoDoc->CopyToDocument( 0, nStartRow, nSortTab, MAXCOL, nEndRow, nSortTab,
- IDF_NONE, sal_False, pDoc );
+ IDF_NONE, false, pDoc );
if (pUndoDB)
pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), sal_True );
@@ -883,7 +878,7 @@ void __EXPORT ScUndoSort::Undo()
EndUndo();
}
-void __EXPORT ScUndoSort::Redo()
+void ScUndoSort::Redo()
{
BeginRedo();
@@ -893,14 +888,10 @@ void __EXPORT ScUndoSort::Redo()
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
-// pViewShell->DoneBlockMode();
-// pViewShell->InitOwnBlockMode();
-// pViewShell->GetViewData()->GetMarkData() = aMarkData; // CopyMarksTo
-
pViewShell->MarkRange( ScRange( aSortParam.nCol1, aSortParam.nRow1, nTab,
aSortParam.nCol2, aSortParam.nRow2, nTab ) );
- pViewShell->Sort( aSortParam, sal_False );
+ pViewShell->Sort( aSortParam, false );
// Quellbereich painten wegen Markierung
if ( !aSortParam.bInplace )
@@ -910,13 +901,13 @@ void __EXPORT ScUndoSort::Redo()
EndRedo();
}
-void __EXPORT ScUndoSort::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoSort::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoSort::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoSort::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // geht nicht wegen Spaltennummern
+ return false; // geht nicht wegen Spaltennummern
}
//
@@ -932,10 +923,9 @@ ScUndoQuery::ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab, const ScQuery
nTab( nNewTab ),
aQueryParam( rParam ),
pUndoDoc( pNewUndoDoc ),
-// pUndoDBData( pNewData )
pUndoDB( pNewUndoDB ),
- bIsAdvanced( sal_False ),
- bDestArea( sal_False ),
+ bIsAdvanced( false ),
+ bDestArea( false ),
bDoSize( bSize )
{
if ( pOld )
@@ -952,20 +942,19 @@ ScUndoQuery::ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab, const ScQuery
pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
}
-__EXPORT ScUndoQuery::~ScUndoQuery()
+ScUndoQuery::~ScUndoQuery()
{
delete pUndoDoc;
-// delete pUndoDBData;
delete pUndoDB;
DeleteSdrUndoAction( pDrawUndo );
}
-String __EXPORT ScUndoQuery::GetComment() const
+String ScUndoQuery::GetComment() const
{ // "Filtern";
return ScGlobal::GetRscString( STR_UNDO_QUERY );
}
-void __EXPORT ScUndoQuery::Undo()
+void ScUndoQuery::Undo()
{
BeginUndo();
@@ -1009,19 +998,19 @@ void __EXPORT ScUndoQuery::Undo()
pUndoDoc->CopyToDocument( aQueryParam.nDestCol, aQueryParam.nDestRow, aQueryParam.nDestTab,
nDestEndCol, nDestEndRow, aQueryParam.nDestTab,
- IDF_ALL, sal_False, pDoc );
+ IDF_ALL, false, pDoc );
// Attribute werden immer mitkopiert (#49287#)
// Rest von altem Bereich
if ( bDestArea && !bDoSize )
{
pDoc->DeleteAreaTab( aOldDest, IDF_ALL );
- pUndoDoc->CopyToDocument( aOldDest, IDF_ALL, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( aOldDest, IDF_ALL, false, pDoc );
}
}
else
pUndoDoc->CopyToDocument( 0, aQueryParam.nRow1, nTab, MAXCOL, aQueryParam.nRow2, nTab,
- IDF_NONE, sal_False, pDoc );
+ IDF_NONE, false, pDoc );
if (pUndoDB)
pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), sal_True );
@@ -1068,7 +1057,7 @@ void __EXPORT ScUndoQuery::Undo()
EndUndo();
}
-void __EXPORT ScUndoQuery::Redo()
+void ScUndoQuery::Redo()
{
BeginRedo();
@@ -1079,20 +1068,20 @@ void __EXPORT ScUndoQuery::Redo()
pViewShell->SetTabNo( nTab );
if ( bIsAdvanced )
- pViewShell->Query( aQueryParam, &aAdvSource, sal_False );
+ pViewShell->Query( aQueryParam, &aAdvSource, false );
else
- pViewShell->Query( aQueryParam, NULL, sal_False );
+ pViewShell->Query( aQueryParam, NULL, false );
EndRedo();
}
-void __EXPORT ScUndoQuery::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoQuery::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoQuery::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoQuery::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // geht nicht wegen Spaltennummern
+ return false; // geht nicht wegen Spaltennummern
}
//
@@ -1154,7 +1143,7 @@ void ScUndoAutoFilter::Undo()
void ScUndoAutoFilter::Redo()
{
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
}
@@ -1164,7 +1153,7 @@ void ScUndoAutoFilter::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoAutoFilter::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
//
@@ -1179,28 +1168,28 @@ ScUndoDBData::ScUndoDBData( ScDocShell* pNewDocShell,
{
}
-__EXPORT ScUndoDBData::~ScUndoDBData()
+ScUndoDBData::~ScUndoDBData()
{
delete pUndoColl;
delete pRedoColl;
}
-String __EXPORT ScUndoDBData::GetComment() const
+String ScUndoDBData::GetComment() const
{ // "Datenbankbereiche aendern";
return ScGlobal::GetRscString( STR_UNDO_DBDATA );
}
-void __EXPORT ScUndoDBData::Undo()
+void ScUndoDBData::Undo()
{
BeginUndo();
ScDocument* pDoc = pDocShell->GetDocument();
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( sal_False ); // unnoetige Berechnungen vermeiden
+ pDoc->SetAutoCalc( false ); // unnoetige Berechnungen vermeiden
pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
pDoc->SetDBCollection( new ScDBCollection(*pUndoColl), sal_True );
- pDoc->CompileDBFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
pDoc->SetAutoCalc( bOldAutoCalc );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
@@ -1208,17 +1197,17 @@ void __EXPORT ScUndoDBData::Undo()
EndUndo();
}
-void __EXPORT ScUndoDBData::Redo()
+void ScUndoDBData::Redo()
{
BeginRedo();
ScDocument* pDoc = pDocShell->GetDocument();
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( sal_False ); // unnoetige Berechnungen vermeiden
+ pDoc->SetAutoCalc( false ); // unnoetige Berechnungen vermeiden
pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
pDoc->SetDBCollection( new ScDBCollection(*pRedoColl), sal_True );
- pDoc->CompileDBFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
pDoc->SetAutoCalc( bOldAutoCalc );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
@@ -1226,13 +1215,13 @@ void __EXPORT ScUndoDBData::Redo()
EndRedo();
}
-void __EXPORT ScUndoDBData::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoDBData::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoDBData::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoDBData::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // geht nicht
+ return false; // geht nicht
}
//
@@ -1254,12 +1243,12 @@ ScUndoImportData::ScUndoImportData( ScDocShell* pNewDocShell, SCTAB nNewTab,
pUndoDBData( pNewUndoData ),
pRedoDBData( pNewRedoData ),
nFormulaCols( nNewFormula ),
- bRedoFilled( sal_False )
+ bRedoFilled( false )
{
// redo doc doesn't contain imported data (but everything else)
}
-__EXPORT ScUndoImportData::~ScUndoImportData()
+ScUndoImportData::~ScUndoImportData()
{
delete pUndoDoc;
delete pRedoDoc;
@@ -1267,12 +1256,12 @@ __EXPORT ScUndoImportData::~ScUndoImportData()
delete pRedoDBData;
}
-String __EXPORT ScUndoImportData::GetComment() const
+String ScUndoImportData::GetComment() const
{ // "Importieren";
return ScGlobal::GetRscString( STR_UNDO_IMPORTDATA );
}
-void __EXPORT ScUndoImportData::Undo()
+void ScUndoImportData::Undo()
{
BeginUndo();
@@ -1299,11 +1288,11 @@ void __EXPORT ScUndoImportData::Undo()
// so now delete each column after copying to save memory (#41216#)
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( sal_False ); // outside of the loop
+ pDoc->SetAutoCalc( false ); // outside of the loop
for (SCCOL nCopyCol = nCol1; nCopyCol <= nCol2; nCopyCol++)
{
pDoc->CopyToDocument( nCopyCol,nRow1,nTab, nCopyCol,nRow2,nTab,
- IDF_CONTENTS & ~IDF_NOTE, sal_False, pRedoDoc );
+ IDF_CONTENTS & ~IDF_NOTE, false, pRedoDoc );
pDoc->DeleteAreaTab( nCopyCol,nRow1, nCopyCol,nRow2, nTab, IDF_CONTENTS & ~IDF_NOTE );
pDoc->DoColResize( nTab, nCopyCol, nCopyCol, 0 );
}
@@ -1326,7 +1315,7 @@ void __EXPORT ScUndoImportData::Undo()
aOld.aEnd.SetCol( aOld.aEnd.Col() + nFormulaCols ); // FitBlock auch fuer Formeln
aNew.aEnd.SetCol( aNew.aEnd.Col() + nFormulaCols );
- pDoc->FitBlock( aNew, aOld, sal_False ); // rueckwaerts
+ pDoc->FitBlock( aNew, aOld, false ); // rueckwaerts
}
else
pDoc->DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
@@ -1334,7 +1323,7 @@ void __EXPORT ScUndoImportData::Undo()
pUndoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab,
nEndCol+nFormulaCols,nEndRow,nTab,
- IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ IDF_ALL & ~IDF_NOTE, false, pDoc );
if (pCurrentData)
{
@@ -1361,7 +1350,7 @@ void __EXPORT ScUndoImportData::Undo()
EndUndo();
}
-void __EXPORT ScUndoImportData::Redo()
+void ScUndoImportData::Redo()
{
BeginRedo();
@@ -1398,14 +1387,14 @@ void __EXPORT ScUndoImportData::Redo()
pDoc->DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, IDF_ALL & ~IDF_NOTE );
- pRedoDoc->CopyToDocument( aNew, IDF_ALL & ~IDF_NOTE, sal_False, pDoc ); // incl. Formeln
+ pRedoDoc->CopyToDocument( aNew, IDF_ALL & ~IDF_NOTE, false, pDoc ); // incl. Formeln
}
else
{
pDoc->DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
nEndCol,nEndRow, nTab, IDF_ALL & ~IDF_NOTE );
pRedoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab,
- nEndCol,nEndRow,nTab, IDF_ALL & ~IDF_NOTE, sal_False, pDoc );
+ nEndCol,nEndRow,nTab, IDF_ALL & ~IDF_NOTE, false, pDoc );
}
if (pCurrentData)
@@ -1433,7 +1422,7 @@ void __EXPORT ScUndoImportData::Redo()
EndRedo();
}
-void __EXPORT ScUndoImportData::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoImportData::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
@@ -1448,14 +1437,14 @@ void __EXPORT ScUndoImportData::Repeat(SfxRepeatTarget& rTarget)
}
}
-sal_Bool __EXPORT ScUndoImportData::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoImportData::CanRepeat(SfxRepeatTarget& rTarget) const
{
// Repeat nur fuer Import per DB-Bereich, dann ist pUndoDBData gesetzt
if (pUndoDBData)
return (rTarget.ISA(ScTabViewTarget));
else
- return sal_False; // Adressbuch
+ return false; // Adressbuch
}
//
@@ -1477,7 +1466,7 @@ ScUndoRepeatDB::ScUndoRepeatDB( ScDocShell* pNewDocShell, SCTAB nNewTab,
pUndoTable( pNewUndoTab ),
pUndoRange( pNewUndoRange ),
pUndoDB( pNewUndoDB ),
- bQuerySize( sal_False )
+ bQuerySize( false )
{
if ( pOldQ && pNewQ )
{
@@ -1487,7 +1476,7 @@ ScUndoRepeatDB::ScUndoRepeatDB( ScDocShell* pNewDocShell, SCTAB nNewTab,
}
}
-__EXPORT ScUndoRepeatDB::~ScUndoRepeatDB()
+ScUndoRepeatDB::~ScUndoRepeatDB()
{
delete pUndoDoc;
delete pUndoTable;
@@ -1495,12 +1484,12 @@ __EXPORT ScUndoRepeatDB::~ScUndoRepeatDB()
delete pUndoDB;
}
-String __EXPORT ScUndoRepeatDB::GetComment() const
+String ScUndoRepeatDB::GetComment() const
{ // "Wiederholen"; //! bessere Beschreibung!
return ScGlobal::GetRscString( STR_UNDO_REPEATDB );
}
-void __EXPORT ScUndoRepeatDB::Undo()
+void ScUndoRepeatDB::Undo()
{
BeginUndo();
@@ -1510,7 +1499,7 @@ void __EXPORT ScUndoRepeatDB::Undo()
if (bQuerySize)
{
- pDoc->FitBlock( aNewQuery, aOldQuery, sal_False );
+ pDoc->FitBlock( aNewQuery, aOldQuery, false );
if ( aNewQuery.aEnd.Col() == aOldQuery.aEnd.Col() )
{
@@ -1528,7 +1517,7 @@ void __EXPORT ScUndoRepeatDB::Undo()
aOldForm.aEnd.SetCol( aOldQuery.aEnd.Col() + nFormulaCols );
ScRange aNewForm = aOldForm;
aNewForm.aEnd.SetRow( aNewQuery.aEnd.Row() );
- pDoc->FitBlock( aNewForm, aOldForm, sal_False );
+ pDoc->FitBlock( aNewForm, aOldForm, false );
}
}
}
@@ -1560,9 +1549,9 @@ void __EXPORT ScUndoRepeatDB::Undo()
pUndoTable->GetRowArray()->GetRange( nStartRow, nEndRow );
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
- static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, sal_False,
+ static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false,
pDoc );
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
pViewShell->UpdateScrollBars();
}
@@ -1575,9 +1564,9 @@ void __EXPORT ScUndoRepeatDB::Undo()
MAXCOL, aBlockEnd.Row(), nTab, IDF_ALL );
pUndoDoc->CopyToDocument( 0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab,
- IDF_NONE, sal_False, pDoc ); // Flags
+ IDF_NONE, false, pDoc ); // Flags
pUndoDoc->UndoToDocument( 0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab,
- IDF_ALL, sal_False, pDoc );
+ IDF_ALL, false, pDoc );
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart.Col(),aBlockStart.Row(),nTab,
aBlockEnd.Col(),aBlockEnd.Row(),nTab );
@@ -1600,7 +1589,7 @@ void __EXPORT ScUndoRepeatDB::Undo()
EndUndo();
}
-void __EXPORT ScUndoRepeatDB::Redo()
+void ScUndoRepeatDB::Redo()
{
BeginRedo();
@@ -1615,180 +1604,22 @@ void __EXPORT ScUndoRepeatDB::Redo()
aBlockEnd.Col(),aBlockEnd.Row(),nTab );
pViewShell->SetCursor( aCursorPos.Col(), aCursorPos.Row() );
- pViewShell->RepeatDB( sal_False );
+ pViewShell->RepeatDB( false );
EndRedo();
}
-void __EXPORT ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
((ScTabViewTarget&)rTarget).GetViewShell()->RepeatDB( sal_True );
}
-sal_Bool __EXPORT ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
{
return (rTarget.ISA(ScTabViewTarget));
}
-//UNUSED2008-05 //
-//UNUSED2008-05 // Pivot-Tabellen
-//UNUSED2008-05 //
-//UNUSED2008-05
-//UNUSED2008-05 ScUndoPivot::ScUndoPivot( ScDocShell* pNewDocShell,
-//UNUSED2008-05 const ScArea& rOld, const ScArea& rNew,
-//UNUSED2008-05 ScDocument* pOldDoc, ScDocument* pNewDoc,
-//UNUSED2008-05 const ScPivot* pOldPivot, const ScPivot* pNewPivot ) :
-//UNUSED2008-05 ScSimpleUndo( pNewDocShell ),
-//UNUSED2008-05 aOldArea( rOld ),
-//UNUSED2008-05 aNewArea( rNew ),
-//UNUSED2008-05 pOldUndoDoc( pOldDoc ),
-//UNUSED2008-05 pNewUndoDoc( pNewDoc )
-//UNUSED2008-05 {
-//UNUSED2008-05 if (pNewPivot)
-//UNUSED2008-05 {
-//UNUSED2008-05 pNewPivot->GetParam( aNewParam, aNewQuery, aNewSrc );
-//UNUSED2008-05 aNewName = pNewPivot->GetName();
-//UNUSED2008-05 aNewTag = pNewPivot->GetTag();
-//UNUSED2008-05 }
-//UNUSED2008-05 if (pOldPivot)
-//UNUSED2008-05 {
-//UNUSED2008-05 pOldPivot->GetParam( aOldParam, aOldQuery, aOldSrc );
-//UNUSED2008-05 aOldName = pOldPivot->GetName();
-//UNUSED2008-05 aOldTag = pOldPivot->GetTag();
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 __EXPORT ScUndoPivot::~ScUndoPivot()
-//UNUSED2008-05 {
-//UNUSED2008-05 delete pOldUndoDoc;
-//UNUSED2008-05 delete pNewUndoDoc;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 String __EXPORT ScUndoPivot::GetComment() const
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_uInt16 nIndex;
-//UNUSED2008-05 if ( pOldUndoDoc && pNewUndoDoc )
-//UNUSED2008-05 nIndex = STR_UNDO_PIVOT_MODIFY;
-//UNUSED2008-05 else if ( pNewUndoDoc )
-//UNUSED2008-05 nIndex = STR_UNDO_PIVOT_NEW;
-//UNUSED2008-05 else
-//UNUSED2008-05 nIndex = STR_UNDO_PIVOT_DELETE;
-//UNUSED2008-05
-//UNUSED2008-05 return ScGlobal::GetRscString( nIndex );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void __EXPORT ScUndoPivot::Undo()
-//UNUSED2008-05 {
-//UNUSED2008-05 BeginUndo();
-//UNUSED2008-05
-//UNUSED2008-05 ScDocument* pDoc = pDocShell->GetDocument();
-//UNUSED2008-05
-//UNUSED2008-05 if (pNewUndoDoc)
-//UNUSED2008-05 {
-//UNUSED2008-05 pDoc->DeleteAreaTab( aNewArea.nColStart,aNewArea.nRowStart,
-//UNUSED2008-05 aNewArea.nColEnd,aNewArea.nRowEnd, aNewArea.nTab, IDF_ALL );
-//UNUSED2008-05 pNewUndoDoc->CopyToDocument( aNewArea.nColStart, aNewArea.nRowStart, aNewArea.nTab,
-//UNUSED2008-05 aNewArea.nColEnd, aNewArea.nRowEnd, aNewArea.nTab,
-//UNUSED2008-05 IDF_ALL, sal_False, pDoc );
-//UNUSED2008-05 }
-//UNUSED2008-05 if (pOldUndoDoc)
-//UNUSED2008-05 {
-//UNUSED2008-05 pDoc->DeleteAreaTab( aOldArea.nColStart,aOldArea.nRowStart,
-//UNUSED2008-05 aOldArea.nColEnd,aOldArea.nRowEnd, aOldArea.nTab, IDF_ALL );
-//UNUSED2008-05 pOldUndoDoc->CopyToDocument( aOldArea.nColStart, aOldArea.nRowStart, aOldArea.nTab,
-//UNUSED2008-05 aOldArea.nColEnd, aOldArea.nRowEnd, aOldArea.nTab,
-//UNUSED2008-05 IDF_ALL, sal_False, pDoc );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 ScPivotCollection* pPivotCollection = pDoc->GetPivotCollection();
-//UNUSED2008-05 if ( pNewUndoDoc )
-//UNUSED2008-05 {
-//UNUSED2008-05 ScPivot* pNewPivot = pPivotCollection->GetPivotAtCursor(
-//UNUSED2008-05 aNewParam.nCol, aNewParam.nRow, aNewParam.nTab );
-//UNUSED2008-05 if (pNewPivot)
-//UNUSED2008-05 pPivotCollection->Free( pNewPivot );
-//UNUSED2008-05 }
-//UNUSED2008-05 if ( pOldUndoDoc )
-//UNUSED2008-05 {
-//UNUSED2008-05 ScPivot* pOldPivot = new ScPivot( pDoc );
-//UNUSED2008-05 pOldPivot->SetParam( aOldParam, aOldQuery, aOldSrc );
-//UNUSED2008-05 pOldPivot->SetName( aOldName );
-//UNUSED2008-05 pOldPivot->SetTag( aOldTag );
-//UNUSED2008-05 if (pOldPivot->CreateData()) // Felder berechnen
-//UNUSED2008-05 pOldPivot->ReleaseData();
-//UNUSED2008-05 pPivotCollection->Insert( pOldPivot );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 // erack! it's broadcasted
-//UNUSED2008-05 // pDoc->SetDirty();
-//UNUSED2008-05 if (pNewUndoDoc)
-//UNUSED2008-05 pDocShell->PostPaint( aNewArea.nColStart, aNewArea.nRowStart, aNewArea.nTab,
-//UNUSED2008-05 aNewArea.nColEnd, aNewArea.nRowEnd, aNewArea.nTab,
-//UNUSED2008-05 PAINT_GRID, SC_PF_LINES );
-//UNUSED2008-05 if (pOldUndoDoc)
-//UNUSED2008-05 pDocShell->PostPaint( aOldArea.nColStart, aOldArea.nRowStart, aOldArea.nTab,
-//UNUSED2008-05 aOldArea.nColEnd, aOldArea.nRowEnd, aOldArea.nTab,
-//UNUSED2008-05 PAINT_GRID, SC_PF_LINES );
-//UNUSED2008-05 pDocShell->PostDataChanged();
-//UNUSED2008-05
-//UNUSED2008-05 ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
-//UNUSED2008-05 if (pViewShell)
-//UNUSED2008-05 {
-//UNUSED2008-05 SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
-//UNUSED2008-05 if ( pOldUndoDoc )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( nTab != aOldArea.nTab )
-//UNUSED2008-05 pViewShell->SetTabNo( aOldArea.nTab );
-//UNUSED2008-05 }
-//UNUSED2008-05 else if ( pNewUndoDoc )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( nTab != aNewArea.nTab )
-//UNUSED2008-05 pViewShell->SetTabNo( aNewArea.nTab );
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 EndUndo();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void __EXPORT ScUndoPivot::Redo()
-//UNUSED2008-05 {
-//UNUSED2008-05 BeginRedo();
-//UNUSED2008-05
-//UNUSED2008-05 ScDocument* pDoc = pDocShell->GetDocument();
-//UNUSED2008-05 ScPivotCollection* pPivotCollection = pDoc->GetPivotCollection();
-//UNUSED2008-05 ScPivot* pOldPivot = pPivotCollection->GetPivotAtCursor(
-//UNUSED2008-05 aOldParam.nCol, aOldParam.nRow, aOldParam.nTab );
-//UNUSED2008-05
-//UNUSED2008-05 ScPivot* pNewPivot = NULL;
-//UNUSED2008-05 if (pNewUndoDoc)
-//UNUSED2008-05 {
-//UNUSED2008-05 pNewPivot = new ScPivot( pDoc );
-//UNUSED2008-05 pNewPivot->SetParam( aNewParam, aNewQuery, aNewSrc );
-//UNUSED2008-05 pNewPivot->SetName( aNewName );
-//UNUSED2008-05 pNewPivot->SetTag( aNewTag );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 pDocShell->PivotUpdate( pOldPivot, pNewPivot, sal_False );
-//UNUSED2008-05
-//UNUSED2008-05 EndRedo();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void __EXPORT ScUndoPivot::Repeat(SfxRepeatTarget& rTarget)
-//UNUSED2008-05 {
-//UNUSED2008-05 // Wiederholen: nur loeschen
-//UNUSED2008-05
-//UNUSED2008-05 if ( pOldUndoDoc && !pNewUndoDoc && rTarget.ISA(ScTabViewTarget) )
-//UNUSED2008-05 ((ScTabViewTarget&)rTarget).GetViewShell()->DeletePivotTable();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool __EXPORT ScUndoPivot::CanRepeat(SfxRepeatTarget& rTarget) const
-//UNUSED2008-05 {
-//UNUSED2008-05 // Wiederholen: nur loeschen
-//UNUSED2008-05
-//UNUSED2008-05 return ( pOldUndoDoc && !pNewUndoDoc && rTarget.ISA(ScTabViewTarget) );
-//UNUSED2008-05 }
-
//
// data pilot
//
@@ -1809,7 +1640,7 @@ ScUndoDataPilot::ScUndoDataPilot( ScDocShell* pNewDocShell,
pNewDPObject = new ScDPObject( *pNewObj );
}
-__EXPORT ScUndoDataPilot::~ScUndoDataPilot()
+ScUndoDataPilot::~ScUndoDataPilot()
{
delete pOldDPObject;
delete pNewDPObject;
@@ -1817,7 +1648,7 @@ __EXPORT ScUndoDataPilot::~ScUndoDataPilot()
delete pNewUndoDoc;
}
-String __EXPORT ScUndoDataPilot::GetComment() const
+String ScUndoDataPilot::GetComment() const
{
sal_uInt16 nIndex;
if ( pOldUndoDoc && pNewUndoDoc )
@@ -1830,7 +1661,7 @@ String __EXPORT ScUndoDataPilot::GetComment() const
return ScGlobal::GetRscString( nIndex );
}
-void __EXPORT ScUndoDataPilot::Undo()
+void ScUndoDataPilot::Undo()
{
BeginUndo();
@@ -1843,13 +1674,13 @@ void __EXPORT ScUndoDataPilot::Undo()
{
aNewRange = pNewDPObject->GetOutRange();
pDoc->DeleteAreaTab( aNewRange, IDF_ALL );
- pNewUndoDoc->CopyToDocument( aNewRange, IDF_ALL, sal_False, pDoc );
+ pNewUndoDoc->CopyToDocument( aNewRange, IDF_ALL, false, pDoc );
}
if ( pOldDPObject && pOldUndoDoc )
{
aOldRange = pOldDPObject->GetOutRange();
pDoc->DeleteAreaTab( aOldRange, IDF_ALL );
- pOldUndoDoc->CopyToDocument( aOldRange, IDF_ALL, sal_False, pDoc );
+ pOldUndoDoc->CopyToDocument( aOldRange, IDF_ALL, false, pDoc );
}
// update objects in collection
@@ -1889,7 +1720,7 @@ void __EXPORT ScUndoDataPilot::Undo()
pDestObj->SetAlive(sal_True);
if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) )
{
- DBG_ERROR("cannot insert DPObject");
+ OSL_FAIL("cannot insert DPObject");
DELETEZ( pDestObj );
}
}
@@ -1915,7 +1746,7 @@ void __EXPORT ScUndoDataPilot::Undo()
EndUndo();
}
-void __EXPORT ScUndoDataPilot::Redo()
+void ScUndoDataPilot::Redo()
{
BeginRedo();
@@ -1937,20 +1768,20 @@ void __EXPORT ScUndoDataPilot::Redo()
}
ScDBDocFunc aFunc( *pDocShell );
- aFunc.DataPilotUpdate( pSourceObj, pNewDPObject, sal_False, sal_False, bAllowMove ); // no new undo action
+ aFunc.DataPilotUpdate( pSourceObj, pNewDPObject, false, false, bAllowMove ); // no new undo action
EndRedo();
}
-void __EXPORT ScUndoDataPilot::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoDataPilot::Repeat(SfxRepeatTarget& /* rTarget */)
{
//! allow deletion
}
-sal_Bool __EXPORT ScUndoDataPilot::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoDataPilot::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
//! allow deletion
- return sal_False;
+ return false;
}
@@ -1973,19 +1804,19 @@ ScUndoConsolidate::ScUndoConsolidate( ScDocShell* pNewDocShell, const ScArea& rA
{
}
-__EXPORT ScUndoConsolidate::~ScUndoConsolidate()
+ScUndoConsolidate::~ScUndoConsolidate()
{
delete pUndoDoc;
delete pUndoTab;
delete pUndoData;
}
-String __EXPORT ScUndoConsolidate::GetComment() const
+String ScUndoConsolidate::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_CONSOLIDATE );
}
-void __EXPORT ScUndoConsolidate::Undo()
+void ScUndoConsolidate::Undo()
{
BeginUndo();
@@ -2005,19 +1836,19 @@ void __EXPORT ScUndoConsolidate::Undo()
pDoc->SetOutlineTable( nTab, pUndoTab );
// Zeilenstatus
- pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, sal_False, pDoc );
+ pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pDoc );
// Daten & Referenzen
pDoc->DeleteAreaTab( 0,aDestArea.nRowStart, MAXCOL,aDestArea.nRowEnd, nTab, IDF_ALL );
pUndoDoc->UndoToDocument( 0, aDestArea.nRowStart, nTab,
MAXCOL, aDestArea.nRowEnd, nTab,
- IDF_ALL, sal_False, pDoc );
+ IDF_ALL, false, pDoc );
// Original-Bereich
if (pUndoData)
{
pDoc->DeleteAreaTab(aOldRange, IDF_ALL);
- pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, sal_False, pDoc);
+ pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, false, pDoc);
}
pDocShell->PostPaint( 0,aDestArea.nRowStart,nTab, MAXCOL,MAXROW,nTab,
@@ -2029,13 +1860,13 @@ void __EXPORT ScUndoConsolidate::Undo()
aDestArea.nColEnd,aDestArea.nRowEnd, nTab, IDF_ALL );
pUndoDoc->CopyToDocument( aDestArea.nColStart, aDestArea.nRowStart, nTab,
aDestArea.nColEnd, aDestArea.nRowEnd, nTab,
- IDF_ALL, sal_False, pDoc );
+ IDF_ALL, false, pDoc );
// Original-Bereich
if (pUndoData)
{
pDoc->DeleteAreaTab(aOldRange, IDF_ALL);
- pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, sal_False, pDoc);
+ pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, false, pDoc);
}
SCCOL nEndX = aDestArea.nColEnd;
@@ -2066,7 +1897,7 @@ void __EXPORT ScUndoConsolidate::Undo()
}
else
{
- DBG_ERROR("alte DB-Daten nicht gefunden");
+ OSL_FAIL("alte DB-Daten nicht gefunden");
}
}
}
@@ -2082,11 +1913,11 @@ void __EXPORT ScUndoConsolidate::Undo()
EndUndo();
}
-void __EXPORT ScUndoConsolidate::Redo()
+void ScUndoConsolidate::Redo()
{
BeginRedo();
- pDocShell->DoConsolidate( aParam, sal_False );
+ pDocShell->DoConsolidate( aParam, false );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -2099,13 +1930,13 @@ void __EXPORT ScUndoConsolidate::Redo()
EndRedo();
}
-void __EXPORT ScUndoConsolidate::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoConsolidate::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoConsolidate::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoConsolidate::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -2148,26 +1979,26 @@ ScUndoChartData::ScUndoChartData( ScDocShell* pNewDocShell, const String& rName,
Init();
}
-__EXPORT ScUndoChartData::~ScUndoChartData()
+ScUndoChartData::~ScUndoChartData()
{
}
-String __EXPORT ScUndoChartData::GetComment() const
+String ScUndoChartData::GetComment() const
{
return ScGlobal::GetRscString( STR_UNDO_CHARTDATA );
}
-void __EXPORT ScUndoChartData::Undo()
+void ScUndoChartData::Undo()
{
BeginUndo();
pDocShell->GetDocument()->UpdateChartArea( aChartName, aOldRangeListRef,
- bOldColHeaders, bOldRowHeaders, sal_False );
+ bOldColHeaders, bOldRowHeaders, false );
EndUndo();
}
-void __EXPORT ScUndoChartData::Redo()
+void ScUndoChartData::Redo()
{
BeginRedo();
@@ -2177,17 +2008,215 @@ void __EXPORT ScUndoChartData::Redo()
EndRedo();
}
-void __EXPORT ScUndoChartData::Repeat(SfxRepeatTarget& /* rTarget */)
+void ScUndoChartData::Repeat(SfxRepeatTarget& /* rTarget */)
{
}
-sal_Bool __EXPORT ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+sal_Bool ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
+// Amelia Wang
+ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell,
+ SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
+ SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
+ const ScMarkData& rMark,
+ ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
+ sal_uInt16 nNewFlags,
+ ScRefUndoData* pRefData,
+ void* /*pFill1*/, void* /*pFill2*/, void* /*pFill3*/,
+ sal_Bool bRedoIsFilled ) :
+ ScBlockUndo( pNewDocShell, ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), SC_UNDO_SIMPLE ),
+ aMarkData( rMark ),
+ pUndoDoc( pNewUndoDoc ),
+ pRedoDoc( pNewRedoDoc ),
+ nFlags( nNewFlags ),
+ pRefUndoData( pRefData ),
+ pRefRedoData( NULL ),
+ bRedoFilled( bRedoIsFilled )
+{
+ // pFill1,pFill2,pFill3 are there so the ctor calls for simple paste (without cutting)
+ // don't have to be changed and branched for 641.
+ // They can be removed later.
+
+ if ( !aMarkData.IsMarked() ) // no cell marked:
+ aMarkData.SetMarkArea( aBlockRange ); // mark paste block
+ if ( pRefUndoData )
+ pRefUndoData->DeleteUnchanged( pDocShell->GetDocument() );
+ SetChangeTrack();
+}
+ScUndoDataForm::~ScUndoDataForm()
+{
+ delete pUndoDoc;
+ delete pRedoDoc;
+ delete pRefUndoData;
+ delete pRefRedoData;
+}
+String ScUndoDataForm::GetComment() const
+{
+ return ScGlobal::GetRscString( STR_UNDO_PASTE );
+}
+
+void ScUndoDataForm::SetChangeTrack()
+{
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ if ( pChangeTrack && (nFlags & IDF_CONTENTS) )
+ pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc,
+ nStartChangeAction, nEndChangeAction, SC_CACM_PASTE );
+ else
+ nStartChangeAction = nEndChangeAction = 0;
+}
+
+
+void ScUndoDataForm::Undo()
+{
+ BeginUndo();
+ DoChange( true );
+ ShowTable( aBlockRange );
+ EndUndo();
+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+}
+void ScUndoDataForm::Redo()
+{
+ BeginRedo();
+ ScDocument* pDoc = pDocShell->GetDocument();
+ EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
+ DoChange( false );
+ EnableDrawAdjust( pDoc, true ); //! include in ScBlockUndo?
+ EndRedo();
+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+}
+
+void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/)
+{
+}
+
+sal_Bool ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const
+{
+ return (rTarget.ISA(ScTabViewTarget));
+}
+
+void ScUndoDataForm::DoChange( const sal_Bool bUndo )
+{
+ ScDocument* pDoc = pDocShell->GetDocument();
+
+ // RefUndoData for redo is created before first undo
+ // (with DeleteUnchanged after the DoUndo call)
+ sal_Bool bCreateRedoData = ( bUndo && pRefUndoData && !pRefRedoData );
+ if ( bCreateRedoData )
+ pRefRedoData = new ScRefUndoData( pDoc );
+
+ ScRefUndoData* pWorkRefData = bUndo ? pRefUndoData : pRefRedoData;
+
+ // fuer Undo immer alle oder keine Inhalte sichern
+ sal_uInt16 nUndoFlags = IDF_NONE;
+ if (nFlags & IDF_CONTENTS)
+ nUndoFlags |= IDF_CONTENTS;
+ if (nFlags & IDF_ATTRIB)
+ nUndoFlags |= IDF_ATTRIB;
+
+ sal_Bool bPaintAll = false;
+
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+
+ SCTAB nTabCount = pDoc->GetTableCount();
+ if ( bUndo && !bRedoFilled )
+ {
+ if (!pRedoDoc)
+ {
+ sal_Bool bColInfo = ( aBlockRange.aStart.Row()==0 && aBlockRange.aEnd.Row()==MAXROW );
+ sal_Bool bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==MAXCOL );
+
+ pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
+ pRedoDoc->InitUndoSelected( pDoc, aMarkData, bColInfo, bRowInfo );
+ }
+ // read "redo" data from the document in the first undo
+ // all sheets - CopyToDocument skips those that don't exist in pRedoDoc
+ ScRange aCopyRange = aBlockRange;
+ aCopyRange.aStart.SetTab(0);
+ aCopyRange.aEnd.SetTab(nTabCount-1);
+ pDoc->CopyToDocument( aCopyRange, 1, false, pRedoDoc );
+ bRedoFilled = true;
+ }
+
+ sal_uInt16 nExtFlags = 0;
+ pDocShell->UpdatePaintExt( nExtFlags, aBlockRange );
+
+ for ( sal_uInt16 i=0; i <= ( aBlockRange.aEnd.Col() - aBlockRange.aStart.Col() ); i++ )
+ {
+ String aOldString;
+ pUndoDoc->GetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
+ pDoc->SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
+ }
+
+ if (pWorkRefData)
+ {
+ pWorkRefData->DoUndo( pDoc, true ); // TRUE = bSetChartRangeLists for SetChartListenerCollection
+ if ( pDoc->RefreshAutoFilter( 0,0, MAXCOL,MAXROW, aBlockRange.aStart.Tab() ) )
+ bPaintAll = true;
+ }
+
+ if ( bCreateRedoData && pRefRedoData )
+ pRefRedoData->DeleteUnchanged( pDoc );
+
+ if ( bUndo )
+ {
+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ if ( pChangeTrack )
+ pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
+ }
+ else
+ SetChangeTrack();
+
+ ScRange aDrawRange( aBlockRange );
+ pDoc->ExtendMerge( aDrawRange, true ); // only needed for single sheet (text/rtf etc.)
+ sal_uInt16 nPaint = PAINT_GRID;
+ if (bPaintAll)
+ {
+ aDrawRange.aStart.SetCol(0);
+ aDrawRange.aStart.SetRow(0);
+ aDrawRange.aEnd.SetCol(MAXCOL);
+ aDrawRange.aEnd.SetRow(MAXROW);
+ nPaint |= PAINT_TOP | PAINT_LEFT;
+/*A*/ if (pViewShell)
+ pViewShell->AdjustBlockHeight(false);
+ }
+ else
+ {
+ if ( aBlockRange.aStart.Row() == 0 && aBlockRange.aEnd.Row() == MAXROW ) // ganze Spalte
+ {
+ nPaint |= PAINT_TOP;
+ aDrawRange.aEnd.SetCol(MAXCOL);
+ }
+ if ( aBlockRange.aStart.Col() == 0 && aBlockRange.aEnd.Col() == MAXCOL ) // ganze Zeile
+ {
+ nPaint |= PAINT_LEFT;
+ aDrawRange.aEnd.SetRow(MAXROW);
+ }
+/*A*/ if ((pViewShell) && pViewShell->AdjustBlockHeight(false))
+ {
+ aDrawRange.aStart.SetCol(0);
+ aDrawRange.aStart.SetRow(0);
+ aDrawRange.aEnd.SetCol(MAXCOL);
+ aDrawRange.aEnd.SetRow(MAXROW);
+ nPaint |= PAINT_LEFT;
+ }
+ pDocShell->UpdatePaintExt( nExtFlags, aDrawRange );
+ }
+
+ if ( !bUndo ) // draw redo after updating row heights
+ RedoSdrUndoAction( pDrawUndo ); //! include in ScBlockUndo?
+
+ pDocShell->PostPaint( aDrawRange, nPaint, nExtFlags );
+
+ pDocShell->PostDataChanged();
+ if (pViewShell)
+ pViewShell->CellContentChanged();
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx
index 860796fc9a15..8a263080ae1d 100644
--- a/sc/source/ui/undo/undodraw.cxx
+++ b/sc/source/ui/undo/undodraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,96 +42,25 @@
#define _TREELIST_HXX
#define _CACHESTR_HXX
#define _NEW_HXX
-//#define _SHL_HXX
-//#define _LINK_HXX
-//#define _ERRCODE_HXX
-//#define _GEN_HXX
-//#define _FRACT_HXX
-//#define _STRING_HXX
-//#define _MTF_HXX
-//#define _CONTNR_HXX
-//#define _LIST_HXX
-//#define _TABLE_HXX
#define _DYNARY_HXX
-//#define _UNQIDX_HXX
#define _SVMEMPOOL_HXX
-//#define _UNQID_HXX
-//#define _DEBUG_HXX
-//#define _DATE_HXX
-//#define _TIME_HXX
-//#define _DATETIME_HXX
-//#define _INTN_HXX
-//#define _WLDCRD_HXX
-//#define _FSYS_HXX
-//#define _STREAM_HXX
#define _CACHESTR_HXX
#define _SV_MULTISEL_HXX
//SV
-//#define _CLIP_HXX
#define _CONFIG_HXX
#define _CURSOR_HXX
#define _FONTDLG_HXX
#define _PRVWIN_HXX
-//#define _COLOR_HXX
-//#define _PAL_HXX
-//#define _BITMAP_HXX
-//#define _GDIOBJ_HXX
-//#define _POINTR_HXX
-//#define _ICON_HXX
-//#define _IMAGE_HXX
-//#define _KEYCOD_HXX
-//#define _EVENT_HXX
#define _HELP_HXX
-//#define _APP_HXX
-//#define _MDIAPP_HXX
-//#define _TIMER_HXX
-//#define _METRIC_HXX
-//#define _REGION_HXX
-//#define _OUTDEV_HXX
-//#define _SYSTEM_HXX
-//#define _VIRDEV_HXX
-//#define _JOBSET_HXX
-//#define _PRINT_HXX
-//#define _WINDOW_HXX
-//#define _SYSWIN_HXX
-//#define _WRKWIN_HXX
#define _MDIWIN_HXX
-//#define _FLOATWIN_HXX
-//#define _DOCKWIN_HXX
-//#define _CTRL_HXX
-//#define _SCRBAR_HXX
-//#define _BUTTON_HXX
-//#define _IMAGEBTN_HXX
-//#define _FIXED_HXX
-//#define _GROUP_HXX
-//#define _EDIT_HXX
-//#define _COMBOBOX_HXX
-//#define _LSTBOX_HXX
-//#define _SELENG_HXX
-//#define _SPLIT_HXX
#define _SPIN_HXX
-//#define _FIELD_HXX
-//#define _MOREBTN_HXX
-//#define _TOOLBOX_HXX
-//#define _STATUS_HXX
-//#define _DIALOG_HXX
-//#define _MSGBOX_HXX
-//#define _SYSDLG_HXX
#define _FILDLG_HXX
-//#define _PRNDLG_HXX
#define _COLDLG_HXX
-//#define _TABDLG_HXX
-//#define _MENU_HXX
-//#define _GDIMTF_HXX
-//#define _POLY_HXX
-//#define _ACCEL_HXX
-//#define _GRAPH_HXX
#define _SOUND_HXX
#define SI_NOITEMS
-//#define SI_NODRW
#define _SI_NOSBXCONTROLS
#define _SI_NOOTHERFORMS
#define _SI_NOCONTROL
@@ -140,8 +70,6 @@
// SFX
#define _SFXAPPWIN_HXX
#define _SFX_SAVEOPT_HXX
-//#define _SFX_CHILDWIN_HXX
-//#define _SFXCTRLITEM_HXX
#define _SFXPRNMON_HXX
#define _INTRO_HXX
#define _SFXMSGDESCR_HXX
@@ -177,7 +105,7 @@ ScUndoDraw::ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh ) :
{
}
-__EXPORT ScUndoDraw::~ScUndoDraw()
+ScUndoDraw::~ScUndoDraw()
{
delete pDrawUndo;
}
@@ -187,7 +115,7 @@ void ScUndoDraw::ForgetDrawUndo()
pDrawUndo = NULL; // nicht loeschen (Draw-Undo muss dann von aussen gemerkt werden)
}
-String __EXPORT ScUndoDraw::GetComment() const
+String ScUndoDraw::GetComment() const
{
if (pDrawUndo)
return pDrawUndo->GetComment();
@@ -195,7 +123,7 @@ String __EXPORT ScUndoDraw::GetComment() const
return String();
}
-String __EXPORT ScUndoDraw::GetRepeatComment(SfxRepeatTarget& rTarget) const
+String ScUndoDraw::GetRepeatComment(SfxRepeatTarget& rTarget) const
{
if (pDrawUndo)
return pDrawUndo->GetRepeatComment(rTarget);
@@ -203,7 +131,7 @@ String __EXPORT ScUndoDraw::GetRepeatComment(SfxRepeatTarget& rTarget) const
return String();
}
-sal_uInt16 __EXPORT ScUndoDraw::GetId() const
+sal_uInt16 ScUndoDraw::GetId() const
{
if (pDrawUndo)
return pDrawUndo->GetId();
@@ -211,29 +139,29 @@ sal_uInt16 __EXPORT ScUndoDraw::GetId() const
return 0;
}
-sal_Bool __EXPORT ScUndoDraw::IsLinked()
+sal_Bool ScUndoDraw::IsLinked()
{
if (pDrawUndo)
return pDrawUndo->IsLinked();
else
- return sal_False;
+ return false;
}
-void __EXPORT ScUndoDraw::SetLinked( sal_Bool bIsLinked )
+void ScUndoDraw::SetLinked( sal_Bool bIsLinked )
{
if (pDrawUndo)
pDrawUndo->SetLinked(bIsLinked);
}
-sal_Bool __EXPORT ScUndoDraw::Merge( SfxUndoAction* pNextAction )
+sal_Bool ScUndoDraw::Merge( SfxUndoAction* pNextAction )
{
if (pDrawUndo)
return pDrawUndo->Merge(pNextAction);
else
- return sal_False;
+ return false;
}
-void __EXPORT ScUndoDraw::Undo()
+void ScUndoDraw::Undo()
{
if (pDrawUndo)
{
@@ -242,7 +170,7 @@ void __EXPORT ScUndoDraw::Undo()
}
}
-void __EXPORT ScUndoDraw::Redo()
+void ScUndoDraw::Redo()
{
if (pDrawUndo)
{
@@ -251,19 +179,20 @@ void __EXPORT ScUndoDraw::Redo()
}
}
-void __EXPORT ScUndoDraw::Repeat(SfxRepeatTarget& rTarget)
+void ScUndoDraw::Repeat(SfxRepeatTarget& rTarget)
{
if (pDrawUndo)
pDrawUndo->Repeat(rTarget);
}
-sal_Bool __EXPORT ScUndoDraw::CanRepeat(SfxRepeatTarget& rTarget) const
+sal_Bool ScUndoDraw::CanRepeat(SfxRepeatTarget& rTarget) const
{
if (pDrawUndo)
return pDrawUndo->CanRepeat(rTarget);
else
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoolk.cxx b/sc/source/ui/undo/undoolk.cxx
index 8a78cc7e2eec..843c275ef0cb 100644
--- a/sc/source/ui/undo/undoolk.cxx
+++ b/sc/source/ui/undo/undoolk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@ void DoSdrUndoAction( SdrUndoAction* pUndoAction, ScDocument* pDoc )
pUndoAction->Undo();
else
{
- // #125875# if no drawing layer existed when the action was created,
+ // if no drawing layer existed when the action was created,
// but it was created after that, there is no draw undo action,
// and after undo there might be a drawing layer with a wrong page count.
// The drawing layer must have been empty in that case, so any missing
@@ -80,7 +81,7 @@ void DoSdrUndoAction( SdrUndoAction* pUndoAction, ScDocument* pDoc )
void RedoSdrUndoAction( SdrUndoAction* pUndoAction )
{
- // #125875# DoSdrUndoAction/RedoSdrUndoAction is called even if the pointer is null
+ // DoSdrUndoAction/RedoSdrUndoAction is called even if the pointer is null
if ( pUndoAction )
pUndoAction->Redo();
@@ -100,3 +101,4 @@ void EnableDrawAdjust( ScDocument* pDoc, sal_Bool bEnable )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index e9a5e8cf51d7..f8286ed4b264 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -140,7 +141,6 @@ void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, sal_Bool
pHdl->ForgetLastPattern();
}
-// static
void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const String& rName,
SfxStyleFamily eStyleFamily, const ScStyleSaveData& rData )
{
@@ -196,11 +196,11 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const String& rName,
const SfxItemSet* pNewSet = rData.GetItems();
DBG_ASSERT( pNewSet, "no ItemSet for style" );
if (pNewSet)
- rStyleSet.Set( *pNewSet, sal_False );
+ rStyleSet.Set( *pNewSet, false );
if ( eStyleFamily == SFX_STYLE_FAMILY_PARA )
{
- lcl_DocStyleChanged( pDoc, pStyle, sal_False ); // cell styles: row heights
+ lcl_DocStyleChanged( pDoc, pStyle, false ); // cell styles: row heights
}
else
{
@@ -243,7 +243,7 @@ void ScUndoModifyStyle::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoModifyStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // no repeat possible
+ return false; // no repeat possible
}
// -----------------------------------------------------------------------
@@ -305,7 +305,8 @@ void ScUndoApplyPageStyle::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoApplyPageStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index b045b3586cd8..97f2549711e1 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,11 +57,16 @@
#include "drwlayer.hxx"
#include "scresid.hxx"
+#include <vector>
+
extern sal_Bool bDrawIsInUndo; //! irgendwo als Member !!!
using namespace com::sun::star;
using ::com::sun::star::uno::Sequence;
+using ::rtl::OUString;
using ::std::auto_ptr;
+using ::std::vector;
+using ::boost::shared_ptr;
// STATIC DATA -----------------------------------------------------------
@@ -78,7 +84,6 @@ TYPEINIT1(ScUndoPrintRange, SfxUndoAction);
TYPEINIT1(ScUndoScenarioFlags, SfxUndoAction);
TYPEINIT1(ScUndoRenameObject, SfxUndoAction);
TYPEINIT1(ScUndoLayoutRTL, SfxUndoAction);
-//UNUSED2009-05 TYPEINIT1(ScUndoSetGrammar, SfxUndoAction);
TYPEINIT1(ScUndoTabColor, SfxUndoAction);
@@ -134,9 +139,9 @@ void ScUndoInsertTab::Undo()
pDocShell->SetInUndo( sal_True ); //! BeginUndo
bDrawIsInUndo = sal_True;
- pViewShell->DeleteTable( nTab, sal_False );
- bDrawIsInUndo = sal_False;
- pDocShell->SetInUndo( sal_False ); //! EndUndo
+ pViewShell->DeleteTable( nTab, false );
+ bDrawIsInUndo = false;
+ pDocShell->SetInUndo( false ); //! EndUndo
DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() );
@@ -157,14 +162,14 @@ void ScUndoInsertTab::Redo()
pDocShell->SetInUndo( sal_True ); //! BeginRedo
bDrawIsInUndo = sal_True;
if (bAppend)
- pViewShell->AppendTable( sNewName, sal_False );
+ pViewShell->AppendTable( sNewName, false );
else
{
pViewShell->SetTabNo(nTab);
- pViewShell->InsertTable( sNewName, nTab, sal_False );
+ pViewShell->InsertTable( sNewName, nTab, false );
}
- bDrawIsInUndo = sal_False;
- pDocShell->SetInUndo( sal_False ); //! EndRedo
+ bDrawIsInUndo = false;
+ pDocShell->SetInUndo( false ); //! EndRedo
SetChangeTrack();
}
@@ -249,17 +254,16 @@ void ScUndoInsertTables::Undo()
pDocShell->SetInUndo( sal_True ); //! BeginUndo
bDrawIsInUndo = sal_True;
- SvShorts TheTabs;
- for(int i=0;i<pNameList->Count();i++)
+ vector<SCTAB> TheTabs;
+ for(int i=0; i<pNameList->Count(); ++i)
{
- TheTabs.push_back( sal::static_int_cast<short>(nTab+i) );
+ TheTabs.push_back(nTab+i);
}
-
- pViewShell->DeleteTables( TheTabs, sal_False );
+ pViewShell->DeleteTables( TheTabs, false );
TheTabs.clear();
- bDrawIsInUndo = sal_False;
- pDocShell->SetInUndo( sal_False ); //! EndUndo
+ bDrawIsInUndo = false;
+ pDocShell->SetInUndo( false ); //! EndUndo
DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() );
@@ -280,10 +284,10 @@ void ScUndoInsertTables::Redo()
pDocShell->SetInUndo( sal_True ); //! BeginRedo
bDrawIsInUndo = sal_True;
pViewShell->SetTabNo(nTab);
- pViewShell->InsertTables( pNameList, nTab, static_cast<SCTAB>(pNameList->Count()),sal_False );
+ pViewShell->InsertTables( pNameList, nTab, static_cast<SCTAB>(pNameList->Count()),false );
- bDrawIsInUndo = sal_False;
- pDocShell->SetInUndo( sal_False ); //! EndRedo
+ bDrawIsInUndo = false;
+ pDocShell->SetInUndo( false ); //! EndRedo
SetChangeTrack();
}
@@ -306,13 +310,12 @@ sal_Bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const
// Tabelle loeschen
//
-ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell,const SvShorts &aTab, //SCTAB nNewTab,
+ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const vector<SCTAB> &aTab, //SCTAB nNewTab,
ScDocument* pUndoDocument, ScRefUndoData* pRefData ) :
ScMoveUndo( pNewDocShell, pUndoDocument, pRefData, SC_UNDO_REFLAST )
{
- theTabs=aTab;
-
- SetChangeTrack();
+ theTabs.insert(theTabs.end(), aTab.begin(), aTab.end() );
+ SetChangeTrack();
}
ScUndoDeleteTab::~ScUndoDeleteTab()
@@ -334,10 +337,10 @@ void ScUndoDeleteTab::SetChangeTrack()
nStartChangeAction = pChangeTrack->GetActionMax() + 1;
nEndChangeAction = 0;
ScRange aRange( 0, 0, 0, MAXCOL, MAXROW, 0 );
- for ( size_t i = 0; i < theTabs.size(); i++ )
+ for ( unsigned int i = 0; i < theTabs.size(); ++i )
{
- aRange.aStart.SetTab( theTabs[sal::static_int_cast<sal_uInt16>(i)] );
- aRange.aEnd.SetTab( theTabs[sal::static_int_cast<sal_uInt16>(i)] );
+ aRange.aStart.SetTab( theTabs[i] );
+ aRange.aEnd.SetTab( theTabs[i] );
pChangeTrack->AppendDeleteRange( aRange, pRefUndoDoc,
nTmpChangeAction, nEndChangeAction, (short) i );
}
@@ -357,29 +360,27 @@ SCTAB lcl_GetVisibleTabBefore( ScDocument& rDoc, SCTAB nTab )
void ScUndoDeleteTab::Undo()
{
BeginUndo();
- size_t i=0;
+ unsigned int i=0;
ScDocument* pDoc = pDocShell->GetDocument();
- sal_Bool bLink = sal_False;
+ sal_Bool bLink = false;
String aName;
- for(i=0;i<theTabs.size();i++)
+ for(i=0; i<theTabs.size(); ++i)
{
- SCTAB nTab = theTabs[sal::static_int_cast<sal_uInt16>(i)];
+ SCTAB nTab = theTabs[i];
pRefUndoDoc->GetName( nTab, aName );
bDrawIsInUndo = sal_True;
sal_Bool bOk = pDoc->InsertTab( nTab, aName );
- bDrawIsInUndo = sal_False;
+ bDrawIsInUndo = false;
if (bOk)
{
- // Ref-Undo passiert in EndUndo
- // pUndoDoc->UndoToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,sal_False, pDoc );
- pRefUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,sal_False, pDoc );
+ pRefUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pDoc );
String aOldName;
pRefUndoDoc->GetName( nTab, aOldName );
- pDoc->RenameTab( nTab, aOldName, sal_False );
+ pDoc->RenameTab( nTab, aOldName, false );
if (pRefUndoDoc->IsLinked(nTab))
{
pDoc->SetLink( nTab, pRefUndoDoc->GetLinkMode(nTab), pRefUndoDoc->GetLinkDoc(nTab),
@@ -405,9 +406,6 @@ void ScUndoDeleteTab::Undo()
if ( pRefUndoDoc->IsTabProtected( nTab ) )
pDoc->SetTabProtection(nTab, pRefUndoDoc->GetTabProtection(nTab));
-
- // Drawing-Layer passiert beim MoveUndo::EndUndo
- // pDoc->TransferDrawPage(pRefUndoDoc, nTab,nTab);
}
}
if (bLink)
@@ -421,9 +419,9 @@ void ScUndoDeleteTab::Undo()
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
- for(i=0;i<theTabs.size();i++)
+ for(i=0; i<theTabs.size(); ++i)
{
- pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, theTabs[sal::static_int_cast<sal_uInt16>(i)]) );
+ pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, theTabs[i]) );
}
SfxApplication* pSfxApp = SFX_APP(); // Navigator
pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
@@ -435,9 +433,7 @@ void ScUndoDeleteTab::Undo()
// nicht ShowTable wegen SetTabNo(..., sal_True):
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
- pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDoc, theTabs.front() ), sal_True );
-
-// EndUndo();
+ pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDoc, theTabs[0] ), true );
}
void ScUndoDeleteTab::Redo()
@@ -449,8 +445,8 @@ void ScUndoDeleteTab::Redo()
pDocShell->SetInUndo( sal_True ); //! BeginRedo
bDrawIsInUndo = sal_True;
- pViewShell->DeleteTables( theTabs, sal_False );
- bDrawIsInUndo = sal_False;
+ pViewShell->DeleteTables( theTabs, false );
+ bDrawIsInUndo = false;
pDocShell->SetInUndo( sal_True ); //! EndRedo
SetChangeTrack();
@@ -533,7 +529,7 @@ void ScUndoRenameTab::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoRenameTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -542,19 +538,24 @@ sal_Bool ScUndoRenameTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
// Tabelle verschieben
//
-ScUndoMoveTab::ScUndoMoveTab( ScDocShell* pNewDocShell,
- const SvShorts &aOldTab,
- const SvShorts &aNewTab) :
- ScSimpleUndo( pNewDocShell )
+ScUndoMoveTab::ScUndoMoveTab(
+ ScDocShell* pNewDocShell, vector<SCTAB>* pOldTabs, vector<SCTAB>* pNewTabs,
+ vector<OUString>* pOldNames, vector<OUString>* pNewNames) :
+ ScSimpleUndo( pNewDocShell ),
+ mpOldTabs(pOldTabs), mpNewTabs(pNewTabs),
+ mpOldNames(pOldNames), mpNewNames(pNewNames)
{
- theOldTabs=aOldTab;
- theNewTabs=aNewTab;
+ if (mpOldNames && mpOldTabs->size() != mpOldNames->size())
+ // The sizes differ. Something is wrong.
+ mpOldNames.reset();
+
+ if (mpNewNames && mpNewTabs->size() != mpNewNames->size())
+ // The sizes differ. Something is wrong.
+ mpNewNames.reset();
}
ScUndoMoveTab::~ScUndoMoveTab()
{
- theNewTabs.clear();
- theOldTabs.clear();
}
String ScUndoMoveTab::GetComment() const
@@ -569,31 +570,41 @@ void ScUndoMoveTab::DoChange( sal_Bool bUndo ) const
if (bUndo) // UnDo
{
- for (size_t i = theNewTabs.size(); i > 0; i--)
+ for (size_t i = mpNewTabs->size(); i > 0; --i)
{
- SCTAB nDestTab = theNewTabs[i - 1];
- SCTAB nOldTab = theOldTabs[i - 1];
- if (nDestTab > MAXTAB) // append ?
+ SCTAB nDestTab = (*mpNewTabs)[i-1];
+ SCTAB nOldTab = (*mpOldTabs)[i-1];
+ if (nDestTab > MAXTAB) // angehaengt ?
nDestTab = pDoc->GetTableCount() - 1;
pDoc->MoveTab( nDestTab, nOldTab );
pViewShell->GetViewData()->MoveTab( nDestTab, nOldTab );
- pViewShell->SetTabNo( nOldTab, sal_True );
+ pViewShell->SetTabNo( nOldTab, true );
+ if (mpOldNames)
+ {
+ const OUString& rOldName = (*mpOldNames)[i-1];
+ pDoc->RenameTab(nOldTab, rOldName);
+ }
}
}
else
{
- for(size_t i=0;i<theNewTabs.size();i++)
+ for (size_t i = 0, n = mpNewTabs->size(); i < n; ++i)
{
- SCTAB nDestTab = theNewTabs[i];
- SCTAB nNewTab = theNewTabs[i];
- SCTAB nOldTab = theOldTabs[i];
- if (nDestTab > MAXTAB) // append ?
+ SCTAB nDestTab = (*mpNewTabs)[i];
+ SCTAB nNewTab = nDestTab;
+ SCTAB nOldTab = (*mpOldTabs)[i];
+ if (nDestTab > MAXTAB) // angehaengt ?
nDestTab = pDoc->GetTableCount() - 1;
pDoc->MoveTab( nOldTab, nNewTab );
pViewShell->GetViewData()->MoveTab( nOldTab, nNewTab );
- pViewShell->SetTabNo( nDestTab, sal_True );
+ pViewShell->SetTabNo( nDestTab, true );
+ if (mpNewNames)
+ {
+ const OUString& rNewName = (*mpNewNames)[i];
+ pDoc->RenameTab(nNewTab, rNewName);
+ }
}
}
@@ -611,7 +622,7 @@ void ScUndoMoveTab::Undo()
void ScUndoMoveTab::Redo()
{
- DoChange( sal_False );
+ DoChange( false );
}
void ScUndoMoveTab::Repeat(SfxRepeatTarget& /* rTarget */)
@@ -621,7 +632,7 @@ void ScUndoMoveTab::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -630,16 +641,21 @@ sal_Bool ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
// Copy table
//
-ScUndoCopyTab::ScUndoCopyTab( ScDocShell* pNewDocShell,
- const SvShorts &aOldTab,
- const SvShorts &aNewTab) :
+ScUndoCopyTab::ScUndoCopyTab(
+ ScDocShell* pNewDocShell,
+ vector<SCTAB>* pOldTabs, vector<SCTAB>* pNewTabs,
+ vector<OUString>* pNewNames) :
ScSimpleUndo( pNewDocShell ),
+ mpOldTabs(pOldTabs),
+ mpNewTabs(pNewTabs),
+ mpNewNames(pNewNames),
pDrawUndo( NULL )
{
pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
- theOldTabs=aOldTab;
- theNewTabs=aNewTab;
+ if (mpNewNames && mpNewTabs->size() != mpNewNames->size())
+ // The sizes differ. Something is wrong.
+ mpNewNames.reset();
}
ScUndoCopyTab::~ScUndoCopyTab()
@@ -657,7 +673,7 @@ void ScUndoCopyTab::DoChange() const
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
- pViewShell->SetTabNo(theOldTabs.front(),sal_True);
+ pViewShell->SetTabNo((*mpOldTabs)[0],true);
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); // Navigator
@@ -672,23 +688,24 @@ void ScUndoCopyTab::Undo()
DoSdrUndoAction( pDrawUndo, pDoc ); // before the sheets are deleted
- for (size_t i = theNewTabs.size(); i > 0; i--)
+ vector<SCTAB>::const_reverse_iterator itr, itrEnd = mpNewTabs->rend();
+ for (itr = mpNewTabs->rbegin(); itr != itrEnd; ++itr)
{
- SCTAB nDestTab = theNewTabs[i - 1];
+ SCTAB nDestTab = *itr;
if (nDestTab > MAXTAB) // append?
nDestTab = pDoc->GetTableCount() - 1;
bDrawIsInUndo = sal_True;
pDoc->DeleteTab(nDestTab);
- bDrawIsInUndo = sal_False;
+ bDrawIsInUndo = false;
}
// ScTablesHint broadcasts after all sheets have been deleted,
// so sheets and draw pages are in sync!
- for (size_t i = theNewTabs.size(); i > 0; i--)
+ for (itr = mpNewTabs->rbegin(); itr != itrEnd; ++itr)
{
- SCTAB nDestTab = theNewTabs[i - 1];
+ SCTAB nDestTab = *itr;
if (nDestTab > MAXTAB) // append?
nDestTab = pDoc->GetTableCount() - 1;
@@ -704,17 +721,17 @@ void ScUndoCopyTab::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nDestTab = 0;
- for(size_t i=0;i<theNewTabs.size();i++)
+ for (size_t i = 0, n = mpNewTabs->size(); i < n; ++i)
{
- nDestTab = theNewTabs[i];
- SCTAB nNewTab = theNewTabs[i];
- SCTAB nOldTab = theOldTabs[i];
- if (nDestTab > MAXTAB) // append ?
+ nDestTab = (*mpNewTabs)[i];
+ SCTAB nNewTab = nDestTab;
+ SCTAB nOldTab = (*mpOldTabs)[i];
+ if (nDestTab > MAXTAB) // angehaengt ?
nDestTab = pDoc->GetTableCount() - 1;
bDrawIsInUndo = sal_True;
pDoc->CopyTab( nOldTab, nNewTab );
- bDrawIsInUndo = sal_False;
+ bDrawIsInUndo = false;
pViewShell->GetViewData()->MoveTab( nOldTab, nNewTab );
@@ -738,6 +755,12 @@ void ScUndoCopyTab::Redo()
if ( pDoc->IsTabProtected( nAdjSource ) )
pDoc->CopyTabProtection(nAdjSource, nNewTab);
+
+ if (mpNewNames)
+ {
+ const OUString& rName = (*mpNewNames)[i];
+ pDoc->RenameTab(nNewTab, rName);
+ }
}
RedoSdrUndoAction( pDrawUndo ); // after the sheets are inserted
@@ -755,7 +778,7 @@ void ScUndoCopyTab::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
//---------------------------------------------------------------------------------
@@ -828,7 +851,7 @@ void ScUndoTabColor::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoTabColor::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
@@ -871,8 +894,8 @@ void ScUndoMakeScenario::Undo()
pDocShell->SetInUndo( sal_True );
bDrawIsInUndo = sal_True;
pDoc->DeleteTab( nDestTab );
- bDrawIsInUndo = sal_False;
- pDocShell->SetInUndo( sal_False );
+ bDrawIsInUndo = false;
+ pDocShell->SetInUndo( false );
DoSdrUndoAction( pDrawUndo, pDoc );
@@ -898,10 +921,10 @@ void ScUndoMakeScenario::Redo()
pDocShell->SetInUndo( sal_True );
bDrawIsInUndo = sal_True;
- pDocShell->MakeScenario( nSrcTab, aName, aComment, aColor, nFlags, aMarkData, sal_False );
+ pDocShell->MakeScenario( nSrcTab, aName, aComment, aColor, nFlags, aMarkData, false );
- bDrawIsInUndo = sal_False;
- pDocShell->SetInUndo( sal_False );
+ bDrawIsInUndo = false;
+ pDocShell->SetInUndo( false );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -991,9 +1014,9 @@ void ScUndoImportTab::Undo()
{
SCTAB nTabPos=nTab+i;
- pDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,sal_False, pRedoDoc );
+ pDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,false, pRedoDoc );
pDoc->GetName( nTabPos, aOldName );
- pRedoDoc->RenameTab( nTabPos, aOldName, sal_False );
+ pRedoDoc->RenameTab( nTabPos, aOldName, false );
if ( pDoc->IsScenario(nTabPos) )
{
@@ -1020,7 +1043,7 @@ void ScUndoImportTab::Undo()
bDrawIsInUndo = sal_True;
for (i=0; i<nCount; i++)
pDoc->DeleteTab( nTab );
- bDrawIsInUndo = sal_False;
+ bDrawIsInUndo = false;
DoChange();
}
@@ -1029,7 +1052,7 @@ void ScUndoImportTab::Redo()
{
if (!pRedoDoc)
{
- DBG_ERROR("wo ist mein Redo-Document?");
+ OSL_FAIL("wo ist mein Redo-Document?");
return;
}
@@ -1042,12 +1065,12 @@ void ScUndoImportTab::Redo()
pRedoDoc->GetName(nTabPos,aName);
bDrawIsInUndo = sal_True;
pDoc->InsertTab(nTabPos,aName);
- bDrawIsInUndo = sal_False;
+ bDrawIsInUndo = false;
}
for (i=0; i<nCount; i++) // then copy into inserted sheets
{
SCTAB nTabPos=nTab+i;
- pRedoDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,sal_False, pDoc );
+ pRedoDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,false, pDoc );
if ( pRedoDoc->IsScenario(nTabPos) )
{
@@ -1158,7 +1181,7 @@ void ScUndoRemoveLink::Undo()
void ScUndoRemoveLink::Redo()
{
- DoChange( sal_False );
+ DoChange( false );
}
void ScUndoRemoveLink::Repeat(SfxRepeatTarget& /* rTarget */)
@@ -1168,7 +1191,7 @@ void ScUndoRemoveLink::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoRemoveLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -1290,7 +1313,7 @@ void ScUndoDocProtect::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoDocProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // gippsnich
+ return false; // gippsnich
}
String ScUndoDocProtect::GetComment() const
@@ -1360,7 +1383,7 @@ void ScUndoTabProtect::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoTabProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // gippsnich
+ return false; // gippsnich
}
String ScUndoTabProtect::GetComment() const
@@ -1416,7 +1439,7 @@ void ScUndoPrintRange::Undo()
void ScUndoPrintRange::Redo()
{
BeginRedo();
- DoChange( sal_False );
+ DoChange( false );
EndRedo();
}
@@ -1427,7 +1450,7 @@ void ScUndoPrintRange::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoPrintRange::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False; // gippsnich
+ return false; // gippsnich
}
String ScUndoPrintRange::GetComment() const
@@ -1509,7 +1532,7 @@ void ScUndoScenarioFlags::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoScenarioFlags::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
@@ -1564,7 +1587,7 @@ SdrObject* ScUndoRenameObject::GetObject()
}
}
}
- DBG_ERROR("Object not found");
+ OSL_FAIL("Object not found");
return NULL;
}
@@ -1592,7 +1615,7 @@ void ScUndoRenameObject::Repeat(SfxRepeatTarget& /* rTarget */)
sal_Bool ScUndoRenameObject::CanRepeat(SfxRepeatTarget& /* rTarget */) const
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
@@ -1624,7 +1647,7 @@ void ScUndoLayoutRTL::DoChange( sal_Bool bNew )
pDocShell->SetDocumentModified();
- pDocShell->SetInUndo( sal_False );
+ pDocShell->SetInUndo( false );
}
void ScUndoLayoutRTL::Undo()
@@ -1654,61 +1677,4 @@ String ScUndoLayoutRTL::GetComment() const
return ScGlobal::GetRscString( STR_UNDO_TAB_RTL );
}
-
-
-// -----------------------------------------------------------------------
-//
-// Set the grammar used for the sheet
-//
-
-//UNUSED2009-05 ScUndoSetGrammar::ScUndoSetGrammar( ScDocShell* pShell,
-//UNUSED2009-05 formula::FormulaGrammar::Grammar eGrammar ) :
-//UNUSED2009-05 ScSimpleUndo( pShell ),
-//UNUSED2009-05 meNewGrammar( eGrammar )
-//UNUSED2009-05 {
-//UNUSED2009-05 meOldGrammar = pDocShell->GetDocument()->GetGrammar();
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 __EXPORT ScUndoSetGrammar::~ScUndoSetGrammar()
-//UNUSED2009-05 {
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 void ScUndoSetGrammar::DoChange( formula::FormulaGrammar::Grammar eGrammar )
-//UNUSED2009-05 {
-//UNUSED2009-05 pDocShell->SetInUndo( sal_True );
-//UNUSED2009-05 ScDocument* pDoc = pDocShell->GetDocument();
-//UNUSED2009-05 pDoc->SetGrammar( eGrammar );
-//UNUSED2009-05 pDocShell->SetDocumentModified();
-//UNUSED2009-05 pDocShell->SetInUndo( sal_False );
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 void __EXPORT ScUndoSetGrammar::Undo()
-//UNUSED2009-05 {
-//UNUSED2009-05 DoChange( meOldGrammar );
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 void __EXPORT ScUndoSetGrammar::Redo()
-//UNUSED2009-05 {
-//UNUSED2009-05 DoChange( meNewGrammar );
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 void __EXPORT ScUndoSetGrammar::Repeat(SfxRepeatTarget& /* rTarget */)
-//UNUSED2009-05 {
-//UNUSED2009-05 #if 0
-//UNUSED2009-05 // erAck: 2006-09-07T23:00+0200 commented out in CWS scr1c1
-//UNUSED2009-05 if (rTarget.ISA(ScTabViewTarget))
-//UNUSED2009-05 ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
-//UNUSED2009-05 Execute( FID_TAB_USE_R1C1, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
-//UNUSED2009-05 #endif
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 sal_Bool __EXPORT ScUndoSetGrammar::CanRepeat(SfxRepeatTarget& rTarget) const
-//UNUSED2009-05 {
-//UNUSED2009-05 return (rTarget.ISA(ScTabViewTarget));
-//UNUSED2009-05 }
-//UNUSED2009-05
-//UNUSED2009-05 String __EXPORT ScUndoSetGrammar::GetComment() const
-//UNUSED2009-05 {
-//UNUSED2009-05 return ScGlobal::GetRscString( STR_UNDO_TAB_R1C1 );
-//UNUSED2009-05 }
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx
index 7009d2a6e80c..9668e5b0d4ac 100644
--- a/sc/source/ui/undo/undoutil.cxx
+++ b/sc/source/ui/undo/undoutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,7 +59,7 @@ void ScUndoUtil::MarkSimpleBlock( ScDocShell* pDocShell,
pViewShell->SetTabNo( nStartZ );
pViewShell->DoneBlockMode();
- pViewShell->MoveCursorAbs( nStartX, nStartY, SC_FOLLOW_JUMP, sal_False, sal_False );
+ pViewShell->MoveCursorAbs( nStartX, nStartY, SC_FOLLOW_JUMP, false, false );
pViewShell->InitOwnBlockMode();
pViewShell->GetViewData()->GetMarkData().
SetMarkArea( ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ) );
@@ -92,7 +93,7 @@ ScDBData* ScUndoUtil::GetOldDBData( ScDBData* pUndoData, ScDocument* pDoc, SCTAB
if (!pRet)
{
- sal_Bool bWasTemp = sal_False;
+ sal_Bool bWasTemp = false;
if ( pUndoData )
{
String aName;
@@ -101,6 +102,7 @@ ScDBData* ScUndoUtil::GetOldDBData( ScDBData* pUndoData, ScDocument* pDoc, SCTAB
bWasTemp = sal_True;
}
DBG_ASSERT(bWasTemp, "Undo: didn't find database range");
+ (void)bWasTemp;
sal_uInt16 nIndex;
ScDBCollection* pColl = pDoc->GetDBCollection();
@@ -134,3 +136,5 @@ void ScUndoUtil::PaintMore( ScDocShell* pDocShell,
pDocShell->PostPaint( nCol1,nRow1,rRange.aStart.Tab(),
nCol2,nRow2,rRange.aEnd.Tab(), PAINT_GRID );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
index e8000d71518b..d81e376fdfa7 100644
--- a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
+++ b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,16 +70,6 @@ void SAL_CALL ScChartRangeSelectionListener::selectionChanged( const lang::Event
{
m_pViewShell->DoChartSelection( aRanges );
}
-// SfxViewFrame *pFrame = SfxViewFrame::GetFirst( m_pDocShell );
-// while (pFrame)
-// {
-// SfxViewShell* pSh = pFrame->GetViewShell();
-// if (pSh && pSh->ISA(ScTabViewShell))
-// {
-// ScTabViewShell* pViewSh = (ScTabViewShell*)pSh;
-// }
-// pFrame = SfxViewFrame::GetNext( *pFrame, m_pDocShell );
-// }
}
}
@@ -93,3 +84,5 @@ void SAL_CALL ScChartRangeSelectionListener::disposing()
{
m_pViewShell = 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index e54c47b6bd64..029be6720869 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,10 @@
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <svl/itemprop.hxx>
+#include <vcl/svapp.hxx>
#include "docsh.hxx"
#include "unonames.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "convuno.hxx"
#include "addruno.hxx"
@@ -72,10 +73,10 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv )
{
if (!pDocShell)
- return sal_False;
+ return false;
ScDocument* pDoc = pDocShell->GetDocument();
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
if ( bIsRange )
{
sal_uInt16 nResult = aRange.ParseAny( rUIString, pDoc, eConv );
@@ -108,7 +109,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formu
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( bIsRange )
{
@@ -116,6 +117,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{
{MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellRangeAddress*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
@@ -130,6 +132,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{
{MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellAddress*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
@@ -148,7 +151,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
if ( !pDocShell )
throw uno::RuntimeException();
- sal_Bool bSuccess = sal_False;
+ sal_Bool bSuccess = false;
String aNameStr(aPropertyName);
if ( aNameStr.EqualsAscii( SC_UNONAME_ADDRESS ) )
{
@@ -194,7 +197,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
}
else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) )
{
- ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ?
+ ::formula::FormulaGrammar::AddressConvention aConv = aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ?
::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1;
// parse the file format string
@@ -217,7 +220,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
}
// parse the rest like a UI string
- bSuccess = ParseUIString( aUIString, eConv );
+ bSuccess = ParseUIString( aUIString, aConv );
}
}
else
@@ -272,7 +275,7 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString&
}
else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) )
{
- ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ?
+ ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ?
::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1;
// generate file format string - always include sheet
@@ -286,7 +289,7 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString&
sal_uInt16 nFlags = SCA_VALID;
if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 )
nFlags |= SCA_TAB_3D;
- aRange.aEnd.Format( aSecond, nFlags, pDoc, eConv );
+ aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc, eConv );
aFormatStr.Append( aSecond );
}
aRet <<= rtl::OUString( aFormatStr );
@@ -303,7 +306,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScAddressConversionObj )
rtl::OUString SAL_CALL ScAddressConversionObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScAddressConversionObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScAddressConversionObj" ));
}
sal_Bool SAL_CALL ScAddressConversionObj::supportsService( const rtl::OUString& rServiceName )
@@ -319,8 +322,9 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAddressConversionObj::getSupportedServic
{
uno::Sequence<rtl::OUString> aRet(1);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( bIsRange ? SC_SERVICENAME_RANGEADDRESS
- : SC_SERVICENAME_CELLADDRESS );
+ pArray[0] = bIsRange ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_SERVICENAME_RANGEADDRESS))
+ : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_SERVICENAME_CELLADDRESS));
return aRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index 2fa106a26744..18d3acc0887c 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,11 +36,12 @@
#include <tools/debug.hxx>
#include <tools/shl.hxx>
#include <svl/poolitem.hxx>
+#include <vcl/svapp.hxx>
#include <svx/unomid.hxx>
#include "unowids.hxx"
#include <rtl/uuid.h>
#include <com/sun/star/table/BorderLine.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
#include <com/sun/star/table/ShadowLocation.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
@@ -67,7 +69,6 @@
#include "afmtuno.hxx"
#include "miscuno.hxx"
#include "autoform.hxx"
-#include "unoguard.hxx"
#include "scdll.hxx"
#include "unonames.hxx"
#include "cellsuno.hxx"
@@ -139,6 +140,7 @@ const SfxItemPropertyMapEntry* lcl_GetAutoFieldMap()
{MAP_CHAR_LEN(SC_UNO_CJK_CWEIGHT), ATTR_CJK_FONT_WEIGHT, &::getCppuType((float*)0), 0, MID_WEIGHT },
{MAP_CHAR_LEN(SC_UNO_CTL_CWEIGHT), ATTR_CTL_FONT_WEIGHT, &::getCppuType((float*)0), 0, MID_WEIGHT },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &::getCppuType((const table::CellHoriJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &::getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &::getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLORI), ATTR_STACKED, &::getCppuType((const table::CellOrientation*)0), 0, 0 },
@@ -147,8 +149,9 @@ const SfxItemPropertyMapEntry* lcl_GetAutoFieldMap()
{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN), ATTR_MARGIN, &::getCppuType((const sal_Int32*)0), 0, MID_MARGIN_R_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN), ATTR_MARGIN, &::getCppuType((const sal_Int32*)0), 0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &::getCppuType((const sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &::getCppuType((const table::CellVertJustify*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &::getCppuType((const table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &::getCppuType((const sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &::getCppuType((const sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{0,0,0,0,0,0}
};
return aAutoFieldMap_Impl;
@@ -178,7 +181,7 @@ sal_Bool lcl_FindAutoFormatIndex( const ScAutoFormat& rFormats, const String& rN
return sal_True;
}
}
- return sal_False; // is nich
+ return false; // is nich
}
//------------------------------------------------------------------------
@@ -198,7 +201,7 @@ ScAutoFormatsObj::~ScAutoFormatsObj()
uno::Reference<uno::XInterface> SAL_CALL ScAutoFormatsObj_CreateInstance(
const uno::Reference<lang::XMultiServiceFactory>& )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDLL::Init();
static uno::Reference< uno::XInterface > xInst((::cppu::OWeakObject*) new ScAutoFormatsObj);
return xInst;
@@ -206,14 +209,14 @@ uno::Reference<uno::XInterface> SAL_CALL ScAutoFormatsObj_CreateInstance(
rtl::OUString ScAutoFormatsObj::getImplementationName_Static()
{
- return rtl::OUString::createFromAscii( "stardiv.StarCalc.ScAutoFormatsObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "stardiv.StarCalc.ScAutoFormatsObj" ));
}
uno::Sequence<rtl::OUString> ScAutoFormatsObj::getSupportedServiceNames_Static()
{
uno::Sequence<rtl::OUString> aRet(1);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCAUTOFORMATSOBJ_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCAUTOFORMATSOBJ_SERVICE ));
return aRet;
}
@@ -247,8 +250,8 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::ElementExistException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
// Reflection muss nicht uno::XInterface sein, kann auch irgendein Interface sein...
uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
if ( xInterface.is() )
@@ -280,7 +283,7 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const rtl::OUString& aName, const
else
{
delete pNew;
- DBG_ERROR("AutoFormat konnte nicht eingefuegt werden");
+ OSL_FAIL("AutoFormat konnte nicht eingefuegt werden");
throw uno::RuntimeException();
}
}
@@ -302,7 +305,7 @@ void SAL_CALL ScAutoFormatsObj::replaceByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! zusammenfassen?
removeByName( aName );
insertByName( aName, aElement );
@@ -312,7 +315,7 @@ void SAL_CALL ScAutoFormatsObj::removeByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameStr(aName);
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
@@ -335,7 +338,7 @@ void SAL_CALL ScAutoFormatsObj::removeByName( const rtl::OUString& aName )
uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.TableAutoFormatEnumeration")));
}
@@ -343,7 +346,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatsObj::createEnumera
sal_Int32 SAL_CALL ScAutoFormatsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
if (pFormats)
return pFormats->GetCount();
@@ -355,7 +358,7 @@ uno::Any SAL_CALL ScAutoFormatsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< container::XNamed > xFormat(GetObjectByIndex_Impl((sal_uInt16)nIndex));
if (!xFormat.is())
throw lang::IndexOutOfBoundsException();
@@ -364,13 +367,13 @@ uno::Any SAL_CALL ScAutoFormatsObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScAutoFormatsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ::getCppuType((const uno::Reference< container::XNamed >*)0); // muss zu getByIndex passen
}
sal_Bool SAL_CALL ScAutoFormatsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -380,7 +383,7 @@ uno::Any SAL_CALL ScAutoFormatsObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< container::XNamed > xFormat(GetObjectByName_Impl(aName));
if (!xFormat.is())
throw container::NoSuchElementException();
@@ -390,7 +393,7 @@ uno::Any SAL_CALL ScAutoFormatsObj::getByName( const rtl::OUString& aName )
uno::Sequence<rtl::OUString> SAL_CALL ScAutoFormatsObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
if (pFormats)
{
@@ -411,7 +414,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAutoFormatsObj::getElementNames()
sal_Bool SAL_CALL ScAutoFormatsObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
if (pFormats)
{
@@ -419,7 +422,7 @@ sal_Bool SAL_CALL ScAutoFormatsObj::hasByName( const rtl::OUString& aName )
sal_uInt16 nDummy;
return lcl_FindAutoFormatIndex( *pFormats, aString, nDummy );
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -467,7 +470,6 @@ sal_Int64 SAL_CALL ScAutoFormatObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScAutoFormatObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -484,7 +486,6 @@ const uno::Sequence<sal_Int8>& ScAutoFormatObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScAutoFormatObj* ScAutoFormatObj::getImplementation(
const uno::Reference<uno::XInterface> xObj )
{
@@ -515,7 +516,7 @@ ScAutoFormatFieldObj* ScAutoFormatObj::GetObjectByIndex_Impl(sal_uInt16 nIndex)
uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.TableAutoFormatEnumeration")));
}
@@ -523,7 +524,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatObj::createEnumerat
sal_Int32 SAL_CALL ScAutoFormatObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (IsInserted())
return SC_AF_FIELD_COUNT; // immer 16 Elemente
else
@@ -534,7 +535,7 @@ uno::Any SAL_CALL ScAutoFormatObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( nIndex < 0 || nIndex >= getCount() )
throw lang::IndexOutOfBoundsException();
@@ -546,13 +547,13 @@ uno::Any SAL_CALL ScAutoFormatObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScAutoFormatObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ::getCppuType((const uno::Reference< beans::XPropertySet >*)0); // muss zu getByIndex passen
}
sal_Bool SAL_CALL ScAutoFormatObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -560,7 +561,7 @@ sal_Bool SAL_CALL ScAutoFormatObj::hasElements() throw(uno::RuntimeException)
rtl::OUString SAL_CALL ScAutoFormatObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
if (pFormats && IsInserted() && nFormatIndex < pFormats->GetCount())
{
@@ -574,7 +575,7 @@ rtl::OUString SAL_CALL ScAutoFormatObj::getName() throw(uno::RuntimeException)
void SAL_CALL ScAutoFormatObj::setName( const rtl::OUString& aNewName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNewString(aNewName);
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
@@ -599,7 +600,7 @@ void SAL_CALL ScAutoFormatObj::setName( const rtl::OUString& aNewName )
else
{
delete pNew;
- DBG_ERROR("AutoFormat konnte nicht eingefuegt werden");
+ OSL_FAIL("AutoFormat konnte nicht eingefuegt werden");
nFormatIndex = 0; //! alter Index ist ungueltig
}
}
@@ -615,7 +616,7 @@ void SAL_CALL ScAutoFormatObj::setName( const rtl::OUString& aNewName )
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAutoFormatObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
}
@@ -626,7 +627,7 @@ void SAL_CALL ScAutoFormatObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
if (pFormats && IsInserted() && nFormatIndex < pFormats->GetCount())
{
@@ -659,7 +660,7 @@ uno::Any SAL_CALL ScAutoFormatObj::getPropertyValue( const rtl::OUString& aPrope
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aAny;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
@@ -669,7 +670,7 @@ uno::Any SAL_CALL ScAutoFormatObj::getPropertyValue( const rtl::OUString& aPrope
DBG_ASSERT(pData,"AutoFormat Daten nicht da");
sal_Bool bValue;
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
String aPropString(aPropertyName);
if (aPropString.EqualsAscii( SC_UNONAME_INCBACK ))
@@ -720,7 +721,7 @@ void ScAutoFormatFieldObj::Notify( SfxBroadcaster& /* rBC */, const SfxHint& /*
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAutoFormatFieldObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
}
@@ -731,7 +732,7 @@ void SAL_CALL ScAutoFormatFieldObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
const SfxItemPropertySimpleEntry* pEntry =
aPropSet.getPropertyMap()->getByName( aPropertyName );
@@ -744,7 +745,7 @@ void SAL_CALL ScAutoFormatFieldObj::setPropertyValue(
{
if( const SfxPoolItem* pItem = pData->GetItem( nFieldIndex, pEntry->nWID ) )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
switch( pEntry->nWID )
{
@@ -756,14 +757,14 @@ void SAL_CALL ScAutoFormatFieldObj::setPropertyValue(
switch( eOrient )
{
case table::CellOrientation_STANDARD:
- pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, sal_False ) );
+ pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, false ) );
break;
case table::CellOrientation_TOPBOTTOM:
- pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, sal_False ) );
+ pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, false ) );
pData->PutItem( nFieldIndex, SfxInt32Item( ATTR_ROTATE_VALUE, 27000 ) );
break;
case table::CellOrientation_BOTTOMTOP:
- pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, sal_False ) );
+ pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, false ) );
pData->PutItem( nFieldIndex, SfxInt32Item( ATTR_ROTATE_VALUE, 9000 ) );
break;
case table::CellOrientation_STACKED:
@@ -819,7 +820,7 @@ uno::Any SAL_CALL ScAutoFormatFieldObj::getPropertyValue( const rtl::OUString& a
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aVal;
ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
@@ -880,3 +881,4 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScAutoFormatFieldObj )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index 6a6d473f78c0..bdafcadfb4f3 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,7 +46,6 @@
#include "printopt.hxx"
#include "userlist.hxx"
#include "sc.hrc" // VAR_ARGS
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "funcdesc.hxx"
#include <com/sun/star/sheet/FunctionArgument.hpp>
@@ -184,6 +184,21 @@ SC_SIMPLE_SERVICE_INFO( ScSpreadsheetSettings, "ScSpreadsheetSettings", SCSPREAD
//------------------------------------------------------------------------
+static void lcl_WriteInfo( registry::XRegistryKey* pRegistryKey,
+ const rtl::OUString& rImplementationName,
+ const uno::Sequence< rtl::OUString >& rServices )
+ throw( registry::InvalidRegistryException )
+{
+ rtl::OUString aImpl(RTL_CONSTASCII_USTRINGPARAM( "/" ));
+ aImpl += rImplementationName;
+ aImpl += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ));
+ uno::Reference<registry::XRegistryKey> xNewKey(pRegistryKey->createKey(aImpl));
+
+ const rtl::OUString* pArray = rServices.getConstArray();
+ for( sal_Int32 i = 0; i < rServices.getLength(); i++ )
+ xNewKey->createKey( pArray[i]);
+}
+
extern "C" {
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
@@ -376,7 +391,7 @@ ScSpreadsheetSettings::~ScSpreadsheetSettings()
uno::Reference<uno::XInterface> SAL_CALL ScSpreadsheetSettings_CreateInstance(
const uno::Reference<lang::XMultiServiceFactory>& /* rSMgr */ )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDLL::Init();
static uno::Reference<uno::XInterface> xInst((cppu::OWeakObject*)new ScSpreadsheetSettings());
return xInst;
@@ -384,14 +399,14 @@ uno::Reference<uno::XInterface> SAL_CALL ScSpreadsheetSettings_CreateInstance(
rtl::OUString ScSpreadsheetSettings::getImplementationName_Static()
{
- return rtl::OUString::createFromAscii( "stardiv.StarCalc.ScSpreadsheetSettings" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "stardiv.StarCalc.ScSpreadsheetSettings" ));
}
uno::Sequence<rtl::OUString> ScSpreadsheetSettings::getSupportedServiceNames_Static()
{
uno::Sequence<rtl::OUString> aRet(1);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCSPREADSHEETSETTINGS_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSPREADSHEETSETTINGS_SERVICE ));
return aRet;
}
@@ -400,7 +415,7 @@ uno::Sequence<rtl::OUString> ScSpreadsheetSettings::getSupportedServiceNames_Sta
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScSpreadsheetSettings::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -412,14 +427,14 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
ScModule* pScMod = SC_MOD();
ScAppOptions aAppOpt(pScMod->GetAppOptions());
ScInputOptions aInpOpt(pScMod->GetInputOptions());
- sal_Bool bSaveApp = sal_False;
- sal_Bool bSaveInp = sal_False;
+ sal_Bool bSaveApp = false;
+ sal_Bool bSaveInp = false;
// print options aren't loaded until needed
if (aString.EqualsAscii( SC_UNONAME_DOAUTOCP ))
@@ -559,7 +574,7 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const rtl::OUString&
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString = aPropertyName;
uno::Any aRet;
@@ -639,7 +654,7 @@ ScRecentFunctionsObj::~ScRecentFunctionsObj()
uno::Reference<uno::XInterface> SAL_CALL ScRecentFunctionsObj_CreateInstance(
const uno::Reference<lang::XMultiServiceFactory>& /* rSMgr */ )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDLL::Init();
static uno::Reference<uno::XInterface> xInst((cppu::OWeakObject*)new ScRecentFunctionsObj());
return xInst;
@@ -647,14 +662,14 @@ uno::Reference<uno::XInterface> SAL_CALL ScRecentFunctionsObj_CreateInstance(
rtl::OUString ScRecentFunctionsObj::getImplementationName_Static()
{
- return rtl::OUString::createFromAscii( "stardiv.StarCalc.ScRecentFunctionsObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "stardiv.StarCalc.ScRecentFunctionsObj" ));
}
uno::Sequence<rtl::OUString> ScRecentFunctionsObj::getSupportedServiceNames_Static()
{
uno::Sequence<rtl::OUString> aRet(1);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCRECENTFUNCTIONSOBJ_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCRECENTFUNCTIONSOBJ_SERVICE ));
return aRet;
}
@@ -663,7 +678,7 @@ uno::Sequence<rtl::OUString> ScRecentFunctionsObj::getSupportedServiceNames_Stat
uno::Sequence<sal_Int32> SAL_CALL ScRecentFunctionsObj::getRecentFunctionIds()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScAppOptions& rOpt = SC_MOD()->GetAppOptions();
sal_uInt16 nCount = rOpt.GetLRUFuncListCount();
const sal_uInt16* pFuncs = rOpt.GetLRUFuncList();
@@ -682,9 +697,9 @@ void SAL_CALL ScRecentFunctionsObj::setRecentFunctionIds(
const uno::Sequence<sal_Int32>& aRecentFunctionIds )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_uInt16 nCount = (sal_uInt16) Min( aRecentFunctionIds.getLength(), (sal_Int32) LRU_MAX );
- const sal_Int32* pAry = aRecentFunctionIds.getConstArray();
+ SolarMutexGuard aGuard;
+ sal_uInt16 nCount = (sal_uInt16) Min( aRecentFunctionIds.getLength(), (INT32) LRU_MAX );
+ const INT32* pAry = aRecentFunctionIds.getConstArray();
sal_uInt16* pFuncs = nCount ? new sal_uInt16[nCount] : NULL;
for (sal_uInt16 i=0; i<nCount; i++)
@@ -720,7 +735,7 @@ ScFunctionListObj::~ScFunctionListObj()
uno::Reference<uno::XInterface> SAL_CALL ScFunctionListObj_CreateInstance(
const uno::Reference<lang::XMultiServiceFactory>& /* rSMgr */ )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDLL::Init();
static uno::Reference<uno::XInterface> xInst((cppu::OWeakObject*)new ScFunctionListObj());
return xInst;
@@ -728,14 +743,14 @@ uno::Reference<uno::XInterface> SAL_CALL ScFunctionListObj_CreateInstance(
rtl::OUString ScFunctionListObj::getImplementationName_Static()
{
- return rtl::OUString::createFromAscii( "stardiv.StarCalc.ScFunctionListObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "stardiv.StarCalc.ScFunctionListObj" ));
}
uno::Sequence<rtl::OUString> ScFunctionListObj::getSupportedServiceNames_Static()
{
uno::Sequence<rtl::OUString> aRet(1);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCFUNCTIONLISTOBJ_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCFUNCTIONLISTOBJ_SERVICE ));
return aRet;
}
@@ -748,21 +763,21 @@ static void lcl_FillSequence( uno::Sequence<beans::PropertyValue>& rSequence, co
beans::PropertyValue* pArray = rSequence.getArray();
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_ID );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ID ));
pArray[0].Value <<= (sal_Int32) rDesc.nFIndex;
- pArray[1].Name = rtl::OUString::createFromAscii( SC_UNONAME_CATEGORY );
+ pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CATEGORY ));
pArray[1].Value <<= (sal_Int32) rDesc.nCategory;
- pArray[2].Name = rtl::OUString::createFromAscii( SC_UNONAME_NAME );
+ pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_NAME ));
if (rDesc.pFuncName)
pArray[2].Value <<= rtl::OUString( *rDesc.pFuncName );
- pArray[3].Name = rtl::OUString::createFromAscii( SC_UNONAME_DESCRIPTION );
+ pArray[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_DESCRIPTION ));
if (rDesc.pFuncDesc)
pArray[3].Value <<= rtl::OUString( *rDesc.pFuncDesc );
- pArray[4].Name = rtl::OUString::createFromAscii( SC_UNONAME_ARGUMENTS );
+ pArray[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ARGUMENTS ));
if (rDesc.ppDefArgNames && rDesc.ppDefArgDescs && rDesc.pDefArgFlags )
{
sal_uInt16 nCount = rDesc.nArgCount;
@@ -801,7 +816,7 @@ static void lcl_FillSequence( uno::Sequence<beans::PropertyValue>& rSequence, co
uno::Sequence<beans::PropertyValue> SAL_CALL ScFunctionListObj::getById( sal_Int32 nId )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
@@ -821,8 +836,6 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScFunctionListObj::getById( sal_Int
}
else
throw uno::RuntimeException(); // should not happen
-
-// return uno::Sequence<beans::PropertyValue>(0);
}
// XNameAccess
@@ -831,8 +844,8 @@ uno::Any SAL_CALL ScFunctionListObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- String aNameStr(aName);
+ SolarMutexGuard aGuard;
+ ::rtl::OUString aNameStr(aName);
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
@@ -853,19 +866,17 @@ uno::Any SAL_CALL ScFunctionListObj::getByName( const rtl::OUString& aName )
}
else
throw uno::RuntimeException(); // should not happen
-
-// return uno::Any();
}
// XIndexAccess
sal_Int32 SAL_CALL ScFunctionListObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_uInt16 nCount = 0;
+ SolarMutexGuard aGuard;
+ sal_Int32 nCount = 0;
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
- nCount = (sal_uInt16)pFuncList->GetCount();
+ nCount = static_cast<sal_Int32>(pFuncList->GetCount());
return nCount;
}
@@ -873,7 +884,7 @@ uno::Any SAL_CALL ScFunctionListObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
@@ -892,8 +903,6 @@ uno::Any SAL_CALL ScFunctionListObj::getByIndex( sal_Int32 nIndex )
}
else
throw uno::RuntimeException(); // should not happen
-
-// return uno::Any();
}
// XEnumerationAccess
@@ -901,7 +910,7 @@ uno::Any SAL_CALL ScFunctionListObj::getByIndex( sal_Int32 nIndex )
uno::Reference<container::XEnumeration> SAL_CALL ScFunctionListObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.FunctionDescriptionEnumeration")));
}
@@ -909,26 +918,26 @@ uno::Reference<container::XEnumeration> SAL_CALL ScFunctionListObj::createEnumer
uno::Type SAL_CALL ScFunctionListObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Sequence<beans::PropertyValue>*)0);
}
sal_Bool SAL_CALL ScFunctionListObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() > 0 );
}
uno::Sequence<rtl::OUString> SAL_CALL ScFunctionListObj::getElementNames() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
- sal_uInt16 nCount = (sal_uInt16)pFuncList->GetCount();
+ sal_uInt32 nCount = pFuncList->GetCount();
uno::Sequence<rtl::OUString> aSeq(nCount);
rtl::OUString* pAry = aSeq.getArray();
- for (sal_uInt16 nIndex=0; nIndex<nCount; nIndex++)
+ for (sal_uInt32 nIndex=0; nIndex<nCount; ++nIndex)
{
const ScFuncDesc* pDesc = pFuncList->GetFunction(nIndex);
if ( pDesc && pDesc->pFuncName )
@@ -942,21 +951,20 @@ uno::Sequence<rtl::OUString> SAL_CALL ScFunctionListObj::getElementNames() throw
sal_Bool SAL_CALL ScFunctionListObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- String aNameStr(aName);
+ SolarMutexGuard aGuard;
const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
if ( pFuncList )
{
- sal_uInt16 nCount = (sal_uInt16)pFuncList->GetCount();
- for (sal_uInt16 nIndex=0; nIndex<nCount; nIndex++)
+ sal_uInt32 nCount = pFuncList->GetCount();
+ for (sal_uInt32 nIndex=0; nIndex<nCount; ++nIndex)
{
const ScFuncDesc* pDesc = pFuncList->GetFunction(nIndex);
//! Case-insensitiv ???
- if ( pDesc && pDesc->pFuncName && aNameStr == *pDesc->pFuncName )
+ if ( pDesc && pDesc->pFuncName && aName == *pDesc->pFuncName )
return sal_True;
}
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -964,3 +972,4 @@ sal_Bool SAL_CALL ScFunctionListObj::hasByName( const rtl::OUString& aName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx
index 246555d06f25..ce9586d1c9e2 100644
--- a/sc/source/ui/unoobj/celllistsource.cxx
+++ b/sc/source/ui/unoobj/celllistsource.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,7 +81,7 @@ namespace calc
,OCellListSource_PBase( OCellListSource_Base::rBHelper )
,m_xDocument( _rxDocument )
,m_aListEntryListeners( m_aMutex )
- ,m_bInitialized( sal_False )
+ ,m_bInitialized( false )
{
DBG_CTOR( OCellListSource, checkConsistency_static );
@@ -89,7 +90,7 @@ namespace calc
// register our property at the base class
CellRangeAddress aInitialPropValue;
registerPropertyNoMember(
- ::rtl::OUString::createFromAscii( "CellRange" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CellRange" )),
PROP_HANDLE_RANGE_ADDRESS,
PropertyAttribute::BOUND | PropertyAttribute::READONLY,
::getCppuType( &aInitialPropValue ),
@@ -130,7 +131,6 @@ namespace calc
EventObject aDisposeEvent( *this );
m_aListEntryListeners.disposeAndClear( aDisposeEvent );
-// OCellListSource_Base::disposing();
WeakAggComponentImplHelperBase::disposing();
// TODO: clean up here whatever you need to clean up (e.g. revoking listeners etc.)
@@ -200,7 +200,7 @@ namespace calc
if ( *pLookup++ == _rServiceName )
return sal_True;
- return sal_False;
+ return false;
}
//--------------------------------------------------------------------
@@ -337,7 +337,7 @@ namespace calc
}
catch( const Exception& )
{
- DBG_ERROR( "OCellListSource::notifyModified: caught a (non-runtime) exception!" );
+ OSL_FAIL( "OCellListSource::notifyModified: caught a (non-runtime) exception!" );
}
}
@@ -365,7 +365,7 @@ namespace calc
// get the cell address
CellRangeAddress aRangeAddress;
- sal_Bool bFoundAddress = sal_False;
+ sal_Bool bFoundAddress = false;
const Any* pLoop = _rArguments.getConstArray();
const Any* pLoopEnd = _rArguments.getConstArray() + _rArguments.getLength();
@@ -374,7 +374,7 @@ namespace calc
NamedValue aValue;
if ( *pLoop >>= aValue )
{
- if ( aValue.Name.equalsAscii( "CellRange" ) )
+ if ( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CellRange" ) ) )
{
if ( aValue.Value >>= aRangeAddress )
bFoundAddress = sal_True;
@@ -414,7 +414,7 @@ namespace calc
}
catch( const Exception& )
{
- DBG_ERROR( "OCellListSource::initialize: caught an exception while retrieving the cell object!" );
+ OSL_FAIL( "OCellListSource::initialize: caught an exception while retrieving the cell object!" );
}
@@ -447,3 +447,5 @@ namespace calc
//.........................................................................
} // namespace calc
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/celllistsource.hxx b/sc/source/ui/unoobj/celllistsource.hxx
index f6b52f0b50f8..e13ab33488ab 100644
--- a/sc/source/ui/unoobj/celllistsource.hxx
+++ b/sc/source/ui/unoobj/celllistsource.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -173,3 +174,5 @@ namespace calc
//.........................................................................
#endif // SC_CELLLISTSOURCE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 3737e742b441..4d8d263895ab 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
#include <svx/svdpool.hxx>
@@ -38,6 +38,7 @@
#include <editeng/brshitem.hxx>
#include <editeng/editeng.hxx>
#include <editeng/flditem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/fmdpage.hxx>
#include <editeng/langitem.hxx>
#include <sfx2/linkmgr.hxx>
@@ -56,9 +57,10 @@
#include <com/sun/star/util/CellProtection.hpp>
#include <com/sun/star/table/CellHoriJustify.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/TableBorder.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/sheet/CellFlags.hpp>
#include <com/sun/star/sheet/FormulaResult.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -68,6 +70,7 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include "autoform.hxx"
+#include "cellmergeoption.hxx"
#include "cellsuno.hxx"
#include "cursuno.hxx"
#include "textuno.hxx"
@@ -112,7 +115,6 @@
#include "validat.hxx"
#include "sc.hrc"
#include "brdcst.hxx"
-#include "unoguard.hxx"
#include "cellform.hxx"
#include "globstr.hrc"
#include "unonames.hxx"
@@ -123,6 +125,7 @@
#include "formula/errorcodes.hxx"
#include "unoreflist.hxx"
#include "formula/grammar.hxx"
+#include "editeng/escpitem.hxx"
#include <list>
@@ -130,7 +133,6 @@ using namespace com::sun::star;
//------------------------------------------------------------------------
-
class ScNamedEntry
{
String aName;
@@ -144,7 +146,6 @@ public:
const ScRange& GetRange() const { return aRange; }
};
-
//------------------------------------------------------------------------
// Die Namen in den Maps muessen (nach strcmp) sortiert sein!
@@ -159,7 +160,7 @@ const SfxItemPropertySet* lcl_GetCellsPropertySet()
{
{MAP_CHAR_LEN(SC_UNONAME_ABSNAME), SC_WID_UNO_ABSNAME, &getCppuType((rtl::OUString*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLBACK), ATTR_BACKGROUND, &getCppuType((sal_Int32*)0), 0, MID_BACK_COLOR },
{MAP_CHAR_LEN(SC_UNONAME_CELLPRO), ATTR_PROTECTION, &getCppuType((util::CellProtection*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL), SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0), 0, 0 },
@@ -210,12 +211,13 @@ const SfxItemPropertySet* lcl_GetCellsPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_CONDFMT), SC_WID_UNO_CONDFMT, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDLOC), SC_WID_UNO_CONDLOC, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDXML), SC_WID_UNO_CONDXML, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &getCppuType((table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_NUMFMT), ATTR_VALUE_FORMAT, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NUMRULES), SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLORI), ATTR_STACKED, &getCppuType((table::CellOrientation*)0), 0, 0 },
@@ -230,18 +232,19 @@ const SfxItemPropertySet* lcl_GetCellsPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_PLMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_L_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_R_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &getCppuType((sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHADOW), ATTR_SHADOW, &getCppuType((table::ShadowFormat*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TBLBORD), SC_WID_UNO_TBLBORD, &getCppuType((table::TableBorder*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIDAT), SC_WID_UNO_VALIDAT, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0,0,0}
};
@@ -258,7 +261,7 @@ const SfxItemPropertySet* lcl_GetRangePropertySet()
{
{MAP_CHAR_LEN(SC_UNONAME_ABSNAME), SC_WID_UNO_ABSNAME, &getCppuType((rtl::OUString*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLBACK), ATTR_BACKGROUND, &getCppuType((sal_Int32*)0), 0, MID_BACK_COLOR },
{MAP_CHAR_LEN(SC_UNONAME_CELLPRO), ATTR_PROTECTION, &getCppuType((util::CellProtection*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL), SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0), 0, 0 },
@@ -309,12 +312,13 @@ const SfxItemPropertySet* lcl_GetRangePropertySet()
{MAP_CHAR_LEN(SC_UNONAME_CONDFMT), SC_WID_UNO_CONDFMT, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDLOC), SC_WID_UNO_CONDLOC, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDXML), SC_WID_UNO_CONDXML, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &getCppuType((table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_NUMFMT), ATTR_VALUE_FORMAT, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NUMRULES), SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLORI), ATTR_STACKED, &getCppuType((table::CellOrientation*)0), 0, 0 },
@@ -330,19 +334,20 @@ const SfxItemPropertySet* lcl_GetRangePropertySet()
{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_R_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_POS), SC_WID_UNO_POS, &getCppuType((awt::Point*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &getCppuType((sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHADOW), ATTR_SHADOW, &getCppuType((table::ShadowFormat*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SIZE), SC_WID_UNO_SIZE, &getCppuType((awt::Size*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TBLBORD), SC_WID_UNO_TBLBORD, &getCppuType((table::TableBorder*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIDAT), SC_WID_UNO_VALIDAT, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0,0,0}
};
@@ -359,7 +364,7 @@ const SfxItemPropertySet* lcl_GetCellPropertySet()
{
{MAP_CHAR_LEN(SC_UNONAME_ABSNAME), SC_WID_UNO_ABSNAME, &getCppuType((rtl::OUString*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLBACK), ATTR_BACKGROUND, &getCppuType((sal_Int32*)0), 0, MID_BACK_COLOR },
{MAP_CHAR_LEN(SC_UNONAME_CELLPRO), ATTR_PROTECTION, &getCppuType((util::CellProtection*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL), SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0), 0, 0 },
@@ -410,14 +415,15 @@ const SfxItemPropertySet* lcl_GetCellPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_CONDFMT), SC_WID_UNO_CONDFMT, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDLOC), SC_WID_UNO_CONDLOC, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDXML), SC_WID_UNO_CONDXML, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_FORMLOC), SC_WID_UNO_FORMLOC, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_FORMRT), SC_WID_UNO_FORMRT, &getCppuType((table::CellContentType*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &getCppuType((table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_NUMFMT), ATTR_VALUE_FORMAT, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NUMRULES), SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLORI), ATTR_STACKED, &getCppuType((table::CellOrientation*)0), 0, 0 },
@@ -433,20 +439,22 @@ const SfxItemPropertySet* lcl_GetCellPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_R_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_POS), SC_WID_UNO_POS, &getCppuType((awt::Point*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &getCppuType((sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHADOW), ATTR_SHADOW, &getCppuType((table::ShadowFormat*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SIZE), SC_WID_UNO_SIZE, &getCppuType((awt::Size*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TBLBORD), SC_WID_UNO_TBLBORD, &getCppuType((table::TableBorder*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIDAT), SC_WID_UNO_VALIDAT, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
+ {MAP_CHAR_LEN(UNO_NAME_EDIT_CHAR_ESCAPEMENT), EE_CHAR_ESCAPEMENT, &getCppuType((sal_Int32*)0), 0, 0 },
{0,0,0,0,0,0}
};
static SfxItemPropertySet aCellPropertySet( aCellPropertyMap_Impl );
@@ -462,7 +470,7 @@ const SfxItemPropertySet* lcl_GetColumnPropertySet()
{
{MAP_CHAR_LEN(SC_UNONAME_ABSNAME), SC_WID_UNO_ABSNAME, &getCppuType((rtl::OUString*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLBACK), ATTR_BACKGROUND, &getCppuType((sal_Int32*)0), 0, MID_BACK_COLOR },
{MAP_CHAR_LEN(SC_UNONAME_CELLPRO), ATTR_PROTECTION, &getCppuType((util::CellProtection*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL), SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0), 0, 0 },
@@ -513,16 +521,16 @@ const SfxItemPropertySet* lcl_GetColumnPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_CONDFMT), SC_WID_UNO_CONDFMT, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDLOC), SC_WID_UNO_CONDLOC, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDXML), SC_WID_UNO_CONDXML, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &getCppuType((table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
-// {MAP_CHAR_LEN(SC_UNONAME_CELLFILT), SC_WID_UNO_CELLFILT,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_MANPAGE), SC_WID_UNO_MANPAGE, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NEWPAGE), SC_WID_UNO_NEWPAGE, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVIS), SC_WID_UNO_CELLVIS, &getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_NUMFMT), ATTR_VALUE_FORMAT, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NUMRULES), SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_OWIDTH), SC_WID_UNO_OWIDTH, &getBooleanCppuType(), 0, 0 },
@@ -539,19 +547,20 @@ const SfxItemPropertySet* lcl_GetColumnPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_R_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_POS), SC_WID_UNO_POS, &getCppuType((awt::Point*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &getCppuType((sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHADOW), ATTR_SHADOW, &getCppuType((table::ShadowFormat*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SIZE), SC_WID_UNO_SIZE, &getCppuType((awt::Size*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TBLBORD), SC_WID_UNO_TBLBORD, &getCppuType((table::TableBorder*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIDAT), SC_WID_UNO_VALIDAT, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLWID), SC_WID_UNO_CELLWID, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0,0,0}
@@ -566,7 +575,7 @@ const SfxItemPropertySet* lcl_GetRowPropertySet()
{
{MAP_CHAR_LEN(SC_UNONAME_ABSNAME), SC_WID_UNO_ABSNAME, &getCppuType((rtl::OUString*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLBACK), ATTR_BACKGROUND, &getCppuType((sal_Int32*)0), 0, MID_BACK_COLOR },
{MAP_CHAR_LEN(SC_UNONAME_CELLPRO), ATTR_PROTECTION, &getCppuType((util::CellProtection*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL), SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0), 0, 0 },
@@ -617,17 +626,18 @@ const SfxItemPropertySet* lcl_GetRowPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_CONDFMT), SC_WID_UNO_CONDFMT, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDLOC), SC_WID_UNO_CONDLOC, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CONDXML), SC_WID_UNO_CONDXML, &getCppuType((uno::Reference<sheet::XSheetConditionalEntries>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLHGT), SC_WID_UNO_CELLHGT, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &getCppuType((table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
{MAP_CHAR_LEN(SC_UNONAME_CELLFILT), SC_WID_UNO_CELLFILT,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_MANPAGE), SC_WID_UNO_MANPAGE, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NEWPAGE), SC_WID_UNO_NEWPAGE, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVIS), SC_WID_UNO_CELLVIS, &getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_NUMFMT), ATTR_VALUE_FORMAT, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NUMRULES), SC_WID_UNO_NUMRULES,&getCppuType((const uno::Reference<container::XIndexReplace>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_OHEIGHT), SC_WID_UNO_OHEIGHT, &getBooleanCppuType(), 0, 0 },
@@ -644,19 +654,20 @@ const SfxItemPropertySet* lcl_GetRowPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_PRMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_R_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN), ATTR_MARGIN, &getCppuType((sal_Int32*)0), 0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_POS), SC_WID_UNO_POS, &getCppuType((awt::Point*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &getCppuType((sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHADOW), ATTR_SHADOW, &getCppuType((table::ShadowFormat*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SIZE), SC_WID_UNO_SIZE, &getCppuType((awt::Size*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TBLBORD), SC_WID_UNO_TBLBORD, &getCppuType((table::TableBorder*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIDAT), SC_WID_UNO_VALIDAT, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0,0,0}
};
@@ -672,7 +683,7 @@ const SfxItemPropertySet* lcl_GetSheetPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_ASIANVERT),ATTR_VERTICAL_ASIAN,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_AUTOPRINT),SC_WID_UNO_AUTOPRINT,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_BORDCOL), SC_WID_UNO_BORDCOL, &getCppuType((sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_BOTTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, BOTTOM_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLBACK), ATTR_BACKGROUND, &getCppuType((sal_Int32*)0), 0, MID_BACK_COLOR },
{MAP_CHAR_LEN(SC_UNONAME_CELLPRO), ATTR_PROTECTION, &getCppuType((util::CellProtection*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLSTYL), SC_WID_UNO_CELLSTYL,&getCppuType((rtl::OUString*)0), 0, 0 },
@@ -726,14 +737,15 @@ const SfxItemPropertySet* lcl_GetSheetPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_COPYBACK), SC_WID_UNO_COPYBACK,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_COPYFORM), SC_WID_UNO_COPYFORM,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_COPYSTYL), SC_WID_UNO_COPYSTYL,&getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
- {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_BLTR), ATTR_BORDER_BLTR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine2*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &getCppuType((table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_ISACTIVE), SC_WID_UNO_ISACTIVE,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVIS), SC_WID_UNO_CELLVIS, &getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNO_LINKDISPBIT), SC_WID_UNO_LINKDISPBIT,&getCppuType((uno::Reference<awt::XBitmap>*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNO_LINKDISPNAME), SC_WID_UNO_LINKDISPNAME,&getCppuType((rtl::OUString*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_NUMFMT), ATTR_VALUE_FORMAT, &getCppuType((sal_Int32*)0), 0, 0 },
@@ -754,21 +766,22 @@ const SfxItemPropertySet* lcl_GetSheetPropertySet()
{MAP_CHAR_LEN(SC_UNONAME_POS), SC_WID_UNO_POS, &getCppuType((awt::Point*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_PRINTBORD),SC_WID_UNO_PRINTBORD,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_PROTECT), SC_WID_UNO_PROTECT, &getBooleanCppuType(), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &getCppuType((sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHADOW), ATTR_SHADOW, &getCppuType((table::ShadowFormat*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_SHOWBORD), SC_WID_UNO_SHOWBORD,&getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SIZE), SC_WID_UNO_SIZE, &getCppuType((awt::Size*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TBLBORD), SC_WID_UNO_TBLBORD, &getCppuType((table::TableBorder*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_TABLAYOUT),SC_WID_UNO_TABLAYOUT,&getCppuType((sal_Int16*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine2*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIDAT), SC_WID_UNO_VALIDAT, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TABCOLOR), SC_WID_UNO_TABCOLOR, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_CODENAME), SC_WID_UNO_CODENAME, &getCppuType(static_cast< const rtl::OUString * >(0)), 0, 0},
@@ -798,7 +811,6 @@ const SvxItemPropertySet* lcl_GetEditPropertySet()
return &aEditPropertySet;
}
-
//------------------------------------------------------------------------
//! diese Funktionen in einen allgemeinen Header verschieben
@@ -865,8 +877,8 @@ void lcl_CopyProperties( beans::XPropertySet& rDest, beans::XPropertySet& rSourc
SCTAB lcl_FirstTab( const ScRangeList& rRanges )
{
- DBG_ASSERT(rRanges.Count() >= 1, "was fuer Ranges ?!?!");
- const ScRange* pFirst = rRanges.GetObject(0);
+ DBG_ASSERT(rRanges.size() >= 1, "was fuer Ranges ?!?!");
+ const ScRange* pFirst = rRanges[ 0 ];
if (pFirst)
return pFirst->aStart.Tab();
@@ -875,14 +887,14 @@ SCTAB lcl_FirstTab( const ScRangeList& rRanges )
sal_Bool lcl_WholeSheet( const ScRangeList& rRanges )
{
- if ( rRanges.Count() == 1 )
+ if ( rRanges.size() == 1 )
{
- ScRange* pRange = rRanges.GetObject(0);
+ const ScRange* pRange = rRanges[0];
if ( pRange && pRange->aStart.Col() == 0 && pRange->aEnd.Col() == MAXCOL &&
pRange->aStart.Row() == 0 && pRange->aEnd.Row() == MAXROW )
return sal_True;
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -1018,11 +1030,10 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
ScDocument* pUndoDoc = NULL;
if (bUndo)
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- sal_uLong nCount = rRanges.Count();
- sal_uLong i;
- for (i=0; i<nCount; i++)
+ size_t nCount = rRanges.size();
+ for (size_t i = 0; i < nCount; ++i)
{
- ScRange aRange(*rRanges.GetObject(i));
+ ScRange aRange( *rRanges[ i ] );
SCTAB nTab = aRange.aStart.Tab();
if (bUndo)
@@ -1031,7 +1042,7 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
pUndoDoc->InitUndo( pDoc, nTab, nTab );
else
pUndoDoc->AddUndoTab( nTab, nTab );
- pDoc->CopyToDocument( aRange, IDF_ATTRIB, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ATTRIB, false, pUndoDoc );
}
ScMarkData aMark;
@@ -1048,8 +1059,8 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
new ScUndoBorder( pDocShell, rRanges, pUndoDoc, rOuter, rInner ) );
}
- for (i=0; i<nCount; i++)
- pDocShell->PostPaint( *rRanges.GetObject(i), PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
+ for (size_t i = 0; i < nCount; ++i )
+ pDocShell->PostPaint( *rRanges[ i ], PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
pDocShell->SetDocumentModified();
}
@@ -1060,8 +1071,6 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
const uno::Sequence< uno::Sequence<uno::Any> >& aData )
{
-// sal_Bool bApi = sal_True;
-
ScDocument* pDoc = rDocShell.GetDocument();
SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartCol = rRange.aStart.Col();
@@ -1073,7 +1082,7 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
if ( !pDoc->IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
{
//! error message
- return sal_False;
+ return false;
}
long nCols = 0;
@@ -1085,7 +1094,7 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
if ( nCols != nEndCol-nStartCol+1 || nRows != nEndRow-nStartRow+1 )
{
//! error message?
- return sal_False;
+ return false;
}
ScDocument* pUndoDoc = NULL;
@@ -1093,12 +1102,12 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( rRange, IDF_CONTENTS|IDF_NOCAPTIONS, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_CONTENTS|IDF_NOCAPTIONS, false, pUndoDoc );
}
pDoc->DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
SCROW nDocRow = nStartRow;
for (long nRow=0; nRow<nRows; nRow++)
{
@@ -1124,7 +1133,7 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
eElemClass == uno::TypeClass_FLOAT ||
eElemClass == uno::TypeClass_DOUBLE )
{
- // #87871# accept integer types because Basic passes a floating point
+ // accept integer types because Basic passes a floating point
// variable as byte, short or long if it's an integer number.
double fVal(0.0);
rElement >>= fVal;
@@ -1158,7 +1167,7 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoPaste( &rDocShell,
nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, aDestMark,
- pUndoDoc, NULL, IDF_CONTENTS, NULL,NULL,NULL,NULL, sal_False ) );
+ pUndoDoc, NULL, IDF_CONTENTS, NULL,NULL,NULL,NULL, false ) );
}
if (!bHeight)
@@ -1173,8 +1182,6 @@ sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
const uno::Sequence< uno::Sequence<rtl::OUString> >& aData,
const ::rtl::OUString& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
{
-// sal_Bool bApi = sal_True;
-
ScDocument* pDoc = rDocShell.GetDocument();
SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartCol = rRange.aStart.Col();
@@ -1186,7 +1193,7 @@ sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
if ( !pDoc->IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
{
//! error message
- return sal_False;
+ return false;
}
long nCols = 0;
@@ -1198,7 +1205,7 @@ sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
if ( nCols != nEndCol-nStartCol+1 || nRows != nEndRow-nStartRow+1 )
{
//! error message?
- return sal_False;
+ return false;
}
ScDocument* pUndoDoc = NULL;
@@ -1206,14 +1213,14 @@ sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( rRange, IDF_CONTENTS, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_CONTENTS, false, pUndoDoc );
}
pDoc->DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
ScDocFunc aFunc( rDocShell ); // for InterpretEnglishString
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
SCROW nDocRow = nStartRow;
for (long nRow=0; nRow<nRows; nRow++)
{
@@ -1247,7 +1254,7 @@ sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoPaste( &rDocShell,
nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, aDestMark,
- pUndoDoc, NULL, IDF_CONTENTS, NULL,NULL,NULL,NULL, sal_False ) );
+ pUndoDoc, NULL, IDF_CONTENTS, NULL,NULL,NULL,NULL, false ) );
}
if (!bHeight)
@@ -1281,7 +1288,6 @@ String lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPosition, sal_Boo
// LANGUAGE_ENGLISH_US the "General" format has index key 0,
// we don't have to query.
sal_uInt32 nNumFmt = bEnglish ?
-// pFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US) :
0 :
pDoc->GetNumberFormat( rPosition );
@@ -1323,25 +1329,6 @@ String lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPosition, sal_Boo
//------------------------------------------------------------------------
-// Default-ctor fuer SMART_REFLECTION Krempel
-ScCellRangesBase::ScCellRangesBase() :
- pPropSet(lcl_GetCellsPropertySet()),
- pDocShell( NULL ),
- pValueListener( NULL ),
- pCurrentFlat( NULL ),
- pCurrentDeep( NULL ),
- pCurrentDataSet( NULL ),
- pNoDfltCurrentDataSet( NULL ),
- pMarkData( NULL ),
- nObjectId( 0 ),
- bChartColAsHdr( sal_False ),
- bChartRowAsHdr( sal_False ),
- bCursorOnly( sal_False ),
- bGotDataChangedHint( sal_False ),
- aValueListeners( 0 )
-{
-}
-
ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR) :
pPropSet(lcl_GetCellsPropertySet()),
pDocShell( pDocSh ),
@@ -1352,10 +1339,10 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR) :
pNoDfltCurrentDataSet( NULL ),
pMarkData( NULL ),
nObjectId( 0 ),
- bChartColAsHdr( sal_False ),
- bChartRowAsHdr( sal_False ),
- bCursorOnly( sal_False ),
- bGotDataChangedHint( sal_False ),
+ bChartColAsHdr( false ),
+ bChartRowAsHdr( false ),
+ bCursorOnly( false ),
+ bGotDataChangedHint( false ),
aValueListeners( 0 )
{
ScRange aCellRange(rR);
@@ -1381,10 +1368,10 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR) :
pMarkData( NULL ),
aRanges( rR ),
nObjectId( 0 ),
- bChartColAsHdr( sal_False ),
- bChartRowAsHdr( sal_False ),
- bCursorOnly( sal_False ),
- bGotDataChangedHint( sal_False ),
+ bChartColAsHdr( false ),
+ bChartRowAsHdr( false ),
+ bCursorOnly( false ),
+ bGotDataChangedHint( false ),
aValueListeners( 0 )
{
if (pDocShell) // Null if created with createInstance
@@ -1397,7 +1384,7 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR) :
ScCellRangesBase::~ScCellRangesBase()
{
- // #107294# call RemoveUnoObject first, so no notification can happen
+ // call RemoveUnoObject first, so no notification can happen
// during ForgetCurrentAttrs
if (pDocShell)
@@ -1439,7 +1426,7 @@ const ScPatternAttr* ScCellRangesBase::GetCurrentAttrsFlat()
if ( !pCurrentFlat && pDocShell )
{
ScDocument* pDoc = pDocShell->GetDocument();
- pCurrentFlat = pDoc->CreateSelectionPattern( *GetMarkData(), sal_False );
+ pCurrentFlat = pDoc->CreateSelectionPattern( *GetMarkData(), false );
}
return pCurrentFlat;
}
@@ -1477,7 +1464,7 @@ const ScMarkData* ScCellRangesBase::GetMarkData()
if (!pMarkData)
{
pMarkData = new ScMarkData();
- pMarkData->MarkFromRangeList( aRanges, sal_False );
+ pMarkData->MarkFromRangeList( aRanges, false );
}
return pMarkData;
}
@@ -1496,12 +1483,13 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( aRanges.UpdateReference( rRef.GetMode(), pDoc, rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() ) )
{
- if (rRef.GetMode() == URM_INSDEL &&
- aRanges.Count() == 1 &&
- ScTableSheetObj::getImplementation( (cppu::OWeakObject*)this ))
+ if ( rRef.GetMode() == URM_INSDEL
+ && aRanges.size() == 1
+ && ScTableSheetObj::getImplementation( (cppu::OWeakObject*)this )
+ )
{
// #101755#; the range size of a sheet does not change
- ScRange* pR = aRanges.First();
+ ScRange* pR = aRanges.front();
if (pR)
{
pR->aStart.SetCol(0);
@@ -1512,7 +1500,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
RefChanged();
- // #129050# any change of the range address is broadcast to value (modify) listeners
+ // any change of the range address is broadcast to value (modify) listeners
if ( aValueListeners.Count() )
bGotDataChangedHint = sal_True;
@@ -1569,7 +1557,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
for ( sal_uInt16 n=0; n<aValueListeners.Count(); n++ )
pDoc->AddUnoListenerCall( *aValueListeners[n], aEvent );
- bGotDataChangedHint = sal_False;
+ bGotDataChangedHint = false;
}
}
else if ( nId == SC_HINT_CALCALL )
@@ -1606,9 +1594,8 @@ void ScCellRangesBase::RefChanged()
pValueListener->EndListeningAll();
ScDocument* pDoc = pDocShell->GetDocument();
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
- pDoc->StartListeningArea( *aRanges.GetObject(i), pValueListener );
+ for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
+ pDoc->StartListeningArea( *aRanges[ i ], pValueListener );
}
ForgetCurrentAttrs();
@@ -1746,9 +1733,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScCellRangesBase::getImplementationId()
void ScCellRangesBase::PaintRanges_Impl( sal_uInt16 nPart )
{
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
- pDocShell->PostPaint( *aRanges.GetObject(i), nPart );
+ for (size_t i = 0, nCount = aRanges.size(); i < nCount; ++i)
+ pDocShell->PostPaint( *aRanges[ i ], nPart );
}
// XSheetOperation
@@ -1756,7 +1742,7 @@ void ScCellRangesBase::PaintRanges_Impl( sal_uInt16 nPart )
double SAL_CALL ScCellRangesBase::computeFunction( sheet::GeneralFunction nFunction )
throw(uno::Exception, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScMarkData aMark(*GetMarkData());
aMark.MarkToSimple();
if (!aMark.IsMarked())
@@ -1776,8 +1762,8 @@ double SAL_CALL ScCellRangesBase::computeFunction( sheet::GeneralFunction nFunct
void SAL_CALL ScCellRangesBase::clearContents( sal_Int32 nContentFlags ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( aRanges.Count() )
+ SolarMutexGuard aGuard;
+ if ( !aRanges.empty() )
{
// only for clearContents: EDITATTR is only used if no contents are deleted
sal_uInt16 nDelFlags = static_cast< sal_uInt16 >( nContentFlags & IDF_ALL );
@@ -1839,15 +1825,10 @@ beans::PropertyState ScCellRangesBase::GetOnePropertyState( sal_uInt16 nItemWhic
const ScPatternAttr* pPattern = GetCurrentAttrsFlat();
if ( pPattern )
{
- SfxItemState eState = pPattern->GetItemSet().GetItemState( nItemWhich, sal_False );
-
-// // if no rotate value is set, look at orientation
-// //! also for a fixed value of 0 (in case orientation is ambiguous)?
-// if ( nItemWhich == ATTR_ROTATE_VALUE && eState == SFX_ITEM_DEFAULT )
-// eState = pPattern->GetItemSet().GetItemState( ATTR_ORIENTATION, sal_False );
+ SfxItemState eState = pPattern->GetItemSet().GetItemState( nItemWhich, false );
if ( nItemWhich == ATTR_VALUE_FORMAT && eState == SFX_ITEM_DEFAULT )
- eState = pPattern->GetItemSet().GetItemState( ATTR_LANGUAGE_FORMAT, sal_False );
+ eState = pPattern->GetItemSet().GetItemState( ATTR_LANGUAGE_FORMAT, false );
if ( eState == SFX_ITEM_SET )
eRet = beans::PropertyState_DIRECT_VALUE;
@@ -1857,7 +1838,7 @@ beans::PropertyState ScCellRangesBase::GetOnePropertyState( sal_uInt16 nItemWhic
eRet = beans::PropertyState_AMBIGUOUS_VALUE;
else
{
- DBG_ERROR("unbekannter ItemState");
+ OSL_FAIL("unbekannter ItemState");
}
}
}
@@ -1883,8 +1864,8 @@ beans::PropertyState ScCellRangesBase::GetOnePropertyState( sal_uInt16 nItemWhic
beans::PropertyState SAL_CALL ScCellRangesBase::getPropertyState( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( aRanges.Count() == 0 )
+ SolarMutexGuard aGuard;
+ if ( aRanges.empty() )
throw uno::RuntimeException();
const SfxItemPropertyMap* pMap = GetItemPropertyMap(); // from derived class
@@ -1898,7 +1879,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScCellRangesBase::getPropertyStates
const uno::Sequence<rtl::OUString>& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const SfxItemPropertyMap* pPropertyMap = GetItemPropertyMap(); // from derived class
@@ -1917,7 +1898,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScCellRangesBase::getPropertyStates
void SAL_CALL ScCellRangesBase::setPropertyToDefault( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
const SfxItemPropertyMap* pPropertyMap = GetItemPropertyMap(); // from derived class
@@ -1926,7 +1907,7 @@ void SAL_CALL ScCellRangesBase::setPropertyToDefault( const rtl::OUString& aProp
lcl_GetPropertyWhich( pEntry, nItemWhich );
if ( nItemWhich ) // item wid (from map or special case)
{
- if ( aRanges.Count() ) // leer = nichts zu tun
+ if ( !aRanges.empty() ) // leer = nichts zu tun
{
ScDocFunc aFunc(*pDocShell);
@@ -1939,7 +1920,7 @@ void SAL_CALL ScCellRangesBase::setPropertyToDefault( const rtl::OUString& aProp
aWIDs[0] = nItemWhich;
if ( nItemWhich == ATTR_VALUE_FORMAT )
{
- aWIDs[1] = ATTR_LANGUAGE_FORMAT; // #67847# language for number formats
+ aWIDs[1] = ATTR_LANGUAGE_FORMAT; // language for number formats
aWIDs[2] = 0;
}
else
@@ -1950,9 +1931,9 @@ void SAL_CALL ScCellRangesBase::setPropertyToDefault( const rtl::OUString& aProp
else if ( pEntry )
{
if ( pEntry->nWID == SC_WID_UNO_CHCOLHDR )
- bChartColAsHdr = sal_False;
+ bChartColAsHdr = false;
else if ( pEntry->nWID == SC_WID_UNO_CHROWHDR )
- bChartRowAsHdr = sal_False;
+ bChartRowAsHdr = false;
else if ( pEntry->nWID == SC_WID_UNO_CELLSTYL )
{
ScDocFunc aFunc(*pDocShell);
@@ -1968,7 +1949,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const rtl::OUString& aPr
{
//! mit getPropertyValue zusammenfassen
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aAny;
if ( pDocShell )
@@ -2005,7 +1986,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const rtl::OUString& aPr
{
case SC_WID_UNO_CHCOLHDR:
case SC_WID_UNO_CHROWHDR:
- ScUnoHelpFunctions::SetBoolInAny( aAny, sal_False );
+ ScUnoHelpFunctions::SetBoolInAny( aAny, false );
break;
case SC_WID_UNO_CELLSTYL:
aAny <<= rtl::OUString( ScStyleNameConversion::DisplayToProgrammaticName(
@@ -2069,13 +2050,12 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const rtl::OUString& aPr
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellRangesBase::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( pPropSet->getPropertyMap() ));
return aRef;
}
-
void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rValue,
ScPatternAttr& rPattern, ScDocument* pDoc,
sal_uInt16& rFirstItemId, sal_uInt16& rSecondItemId )
@@ -2088,7 +2068,7 @@ void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::A
{
case ATTR_VALUE_FORMAT:
{
- // #67847# language for number formats
+ // language for number formats
SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
sal_uLong nOldFormat = ((const SfxUInt32Item&)rSet.Get( ATTR_VALUE_FORMAT )).GetValue();
LanguageType eOldLang = ((const SvxLanguageItem&)rSet.Get( ATTR_LANGUAGE_FORMAT )).GetLanguage();
@@ -2107,7 +2087,7 @@ void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::A
{
rSet.Put( SvxLanguageItem( eNewLang, ATTR_LANGUAGE_FORMAT ) );
- // #40606# if only language is changed,
+ // if only language is changed,
// don't touch number format attribute
sal_uLong nNewMod = nNewFormat % SV_COUNTRY_LANGUAGE_OFFSET;
if ( nNewMod == ( nOldFormat % SV_COUNTRY_LANGUAGE_OFFSET ) &&
@@ -2156,15 +2136,15 @@ void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::A
switch( eOrient )
{
case table::CellOrientation_STANDARD:
- rSet.Put( SfxBoolItem( ATTR_STACKED, sal_False ) );
+ rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
break;
case table::CellOrientation_TOPBOTTOM:
- rSet.Put( SfxBoolItem( ATTR_STACKED, sal_False ) );
+ rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
rSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 27000 ) );
rSecondItemId = ATTR_ROTATE_VALUE;
break;
case table::CellOrientation_BOTTOMTOP:
- rSet.Put( SfxBoolItem( ATTR_STACKED, sal_False ) );
+ rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
rSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 9000 ) );
rSecondItemId = ATTR_ROTATE_VALUE;
break;
@@ -2192,9 +2172,9 @@ void SAL_CALL ScCellRangesBase::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- if ( !pDocShell || aRanges.Count() == 0 )
+ if ( !pDocShell || aRanges.empty() )
throw uno::RuntimeException();
const SfxItemPropertyMap* pPropertyMap = GetItemPropertyMap(); // from derived class
@@ -2212,7 +2192,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
{
if ( IsScItemWid( pEntry->nWID ) )
{
- if ( aRanges.Count() ) // leer = nichts zu tun
+ if ( !aRanges.empty() ) // leer = nichts zu tun
{
ScDocument* pDoc = pDocShell->GetDocument();
ScDocFunc aFunc(*pDocShell);
@@ -2241,6 +2221,40 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
else // implemented here
switch ( pEntry->nWID )
{
+ case EE_CHAR_ESCAPEMENT: // Specifically for xlsx import
+ {
+ sal_Int32 nValue(0);
+ aValue >>= nValue;
+ if( nValue )
+ {
+ size_t n = aRanges.size();
+ for( size_t i = 0; i < n; i++ )
+ {
+ ScRange aRange( *aRanges[ i ] );
+ /* TODO: Iterate through the range */
+ ScAddress aAddr = aRange.aStart;
+ ScDocument *pDoc = pDocShell->GetDocument();
+ ScBaseCell *pCell = pDoc->GetCell( aAddr );
+ String aStr( pCell->GetStringData() );
+ EditEngine aEngine( pDoc->GetEnginePool() );
+ /* EE_CHAR_ESCAPEMENT seems to be set on the cell _only_ when
+ * there are no other attribs for the cell.
+ * So, it is safe to overwrite the complete attribute set.
+ * If there is a need - getting CellType and processing
+ * the attributes could be considered.
+ */
+ SfxItemSet aAttr = aEngine.GetEmptyItemSet();
+ aEngine.SetText( aStr );
+ if( nValue < 0 ) // Subscript
+ aAttr.Put( SvxEscapementItem( SVX_ESCAPEMENT_SUBSCRIPT, EE_CHAR_ESCAPEMENT ) );
+ else // Superscript
+ aAttr.Put( SvxEscapementItem( SVX_ESCAPEMENT_SUPERSCRIPT, EE_CHAR_ESCAPEMENT ) );
+ aEngine.QuickSetAttribs( aAttr, ESelection( 0, 0, 0, aStr.Len()));
+ pDoc->PutCell( (aRanges[ 0 ])->aStart, new ScEditCell( aEngine.CreateTextObject(), pDoc, NULL ) );
+ }
+ }
+ }
+ break;
case SC_WID_UNO_CHCOLHDR:
// chart header flags are set for this object, not stored with document
bChartColAsHdr = ScUnoHelpFunctions::GetBoolFromAny( aValue );
@@ -2261,7 +2275,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
case SC_WID_UNO_TBLBORD:
{
table::TableBorder aBorder;
- if ( aRanges.Count() && ( aValue >>= aBorder ) ) // empty = nothing to do
+ if ( !aRanges.empty() && ( aValue >>= aBorder ) ) // empty = nothing to do
{
SvxBoxItem aOuter(ATTR_BORDER);
SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
@@ -2276,7 +2290,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
case SC_WID_UNO_CONDXML:
{
uno::Reference<sheet::XSheetConditionalEntries> xInterface(aValue, uno::UNO_QUERY);
- if ( aRanges.Count() && xInterface.is() ) // leer = nichts zu tun
+ if ( !aRanges.empty() && xInterface.is() ) // leer = nichts zu tun
{
ScTableConditionalFormat* pFormat =
ScTableConditionalFormat::getImplementation( xInterface );
@@ -2291,6 +2305,8 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
ScConditionalFormat aNew( 0, pDoc ); // Index wird beim Einfuegen gesetzt
pFormat->FillFormat( aNew, pDoc, eGrammar );
+ ScRangeListRef pRanges = new ScRangeList( aRanges );
+ aNew.AddRangeInfo( pRanges );
sal_uLong nIndex = pDoc->AddCondFormat( aNew );
ScDocFunc aFunc(*pDocShell);
@@ -2307,7 +2323,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
case SC_WID_UNO_VALIXML:
{
uno::Reference<beans::XPropertySet> xInterface(aValue, uno::UNO_QUERY);
- if ( aRanges.Count() && xInterface.is() ) // leer = nichts zu tun
+ if ( !aRanges.empty() && xInterface.is() ) // leer = nichts zu tun
{
ScTableValidationObj* pValidObj =
ScTableValidationObj::getImplementation( xInterface );
@@ -2343,9 +2359,9 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyValue( const rtl::OUString& aProp
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- if ( !pDocShell || aRanges.Count() == 0 )
+ if ( !pDocShell || aRanges.empty() )
throw uno::RuntimeException();
const SfxItemPropertyMap* pPropertyMap = GetItemPropertyMap(); // from derived class
@@ -2422,9 +2438,9 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
case SC_WID_UNO_TBLBORD:
{
//! loop throgh all ranges
- const ScRange* pFirst = aRanges.GetObject(0);
- if (pFirst)
+ if ( !aRanges.empty() )
{
+ const ScRange* pFirst = aRanges[ 0 ];
SvxBoxItem aOuter(ATTR_BORDER);
SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
@@ -2501,11 +2517,11 @@ void SAL_CALL ScCellRangesBase::addPropertyChangeListener( const rtl::OUString&
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( aRanges.Count() == 0 )
+ SolarMutexGuard aGuard;
+ if ( aRanges.empty() )
throw uno::RuntimeException();
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL ScCellRangesBase::removePropertyChangeListener( const rtl::OUString& /* aPropertyName */,
@@ -2513,11 +2529,11 @@ void SAL_CALL ScCellRangesBase::removePropertyChangeListener( const rtl::OUStrin
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( aRanges.Count() == 0 )
+ SolarMutexGuard aGuard;
+ if ( aRanges.empty() )
throw uno::RuntimeException();
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL ScCellRangesBase::addVetoableChangeListener( const rtl::OUString&,
@@ -2525,7 +2541,7 @@ void SAL_CALL ScCellRangesBase::addVetoableChangeListener( const rtl::OUString&,
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL ScCellRangesBase::removeVetoableChangeListener( const rtl::OUString&,
@@ -2533,7 +2549,7 @@ void SAL_CALL ScCellRangesBase::removeVetoableChangeListener( const rtl::OUStrin
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
// XMultiPropertySet
@@ -2545,7 +2561,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< rtl::OUS
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nCount(aPropertyNames.getLength());
sal_Int32 nValues(aValues.getLength());
@@ -2578,7 +2594,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< rtl::OUS
}
catch ( lang::IllegalArgumentException& )
{
- DBG_ERROR("exception when setting cell style"); // not supposed to happen
+ OSL_FAIL("exception when setting cell style"); // not supposed to happen
}
}
}
@@ -2623,7 +2639,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< rtl::OUS
}
}
- if ( pNewPattern && aRanges.Count() )
+ if ( pNewPattern && !aRanges.empty() )
{
ScDocFunc aFunc(*pDocShell);
aFunc.ApplyAttributes( *GetMarkData(), *pNewPattern, sal_True, sal_True );
@@ -2639,7 +2655,7 @@ uno::Sequence<uno::Any> SAL_CALL ScCellRangesBase::getPropertyValues(
const uno::Sequence< rtl::OUString >& aPropertyNames )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const SfxItemPropertyMap* pPropertyMap = GetItemPropertyMap(); // from derived class
@@ -2657,20 +2673,20 @@ void SAL_CALL ScCellRangesBase::addPropertiesChangeListener( const uno::Sequence
const uno::Reference< beans::XPropertiesChangeListener >& /* xListener */ )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL ScCellRangesBase::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& /* xListener */ )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL ScCellRangesBase::firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& /* aPropertyNames */,
const uno::Reference< beans::XPropertiesChangeListener >& /* xListener */ )
throw (uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint )
@@ -2692,7 +2708,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set
const uno::Sequence< uno::Any >& aValues )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nCount(aPropertyNames.getLength());
sal_Int32 nValues(aValues.getLength());
@@ -2728,7 +2744,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set
}
catch ( lang::IllegalArgumentException& )
{
- DBG_ERROR("exception when setting cell style"); // not supposed to happen
+ OSL_FAIL("exception when setting cell style"); // not supposed to happen
}
}
}
@@ -2798,7 +2814,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set
}
}
- if ( pNewPattern && aRanges.Count() )
+ if ( pNewPattern && !aRanges.empty() )
{
ScDocFunc aFunc(*pDocShell);
aFunc.ApplyAttributes( *GetMarkData(), *pNewPattern, sal_True, sal_True );
@@ -2818,7 +2834,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set
uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL ScCellRangesBase::getPropertyValuesTolerant( const uno::Sequence< ::rtl::OUString >& aPropertyNames )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nCount(aPropertyNames.getLength());
uno::Sequence < beans::GetPropertyTolerantResult > aReturns(nCount);
@@ -2848,7 +2864,7 @@ uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL ScCellRangesBase::get
uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL ScCellRangesBase::getDirectPropertyValuesTolerant( const uno::Sequence< ::rtl::OUString >& aPropertyNames )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nCount(aPropertyNames.getLength());
uno::Sequence < beans::GetDirectPropertyTolerantResult > aReturns(nCount);
@@ -2887,21 +2903,21 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL ScCellRangesBas
void SAL_CALL ScCellRangesBase::decrementIndent() throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( pDocShell && aRanges.Count() ) // leer = nichts zu tun
+ SolarMutexGuard aGuard;
+ if ( pDocShell && !aRanges.empty() ) // leer = nichts zu tun
{
ScDocFunc aFunc(*pDocShell);
//#97041#; put only MultiMarked ScMarkData in ChangeIndent
ScMarkData aMarkData(*GetMarkData());
aMarkData.MarkToMulti();
- aFunc.ChangeIndent( aMarkData, sal_False, sal_True );
+ aFunc.ChangeIndent( aMarkData, false, sal_True );
}
}
void SAL_CALL ScCellRangesBase::incrementIndent() throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( pDocShell && aRanges.Count() ) // leer = nichts zu tun
+ SolarMutexGuard aGuard;
+ if ( pDocShell && !aRanges.empty() ) // leer = nichts zu tun
{
ScDocFunc aFunc(*pDocShell);
//#97041#; put only MultiMarked ScMarkData in ChangeIndent
@@ -2915,16 +2931,16 @@ void SAL_CALL ScCellRangesBase::incrementIndent() throw(::com::sun::star::uno::R
ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const
{
- if ( pDocShell && aRanges.Count() )
+ if ( pDocShell && !aRanges.empty() )
{
ScRangeListRef xChartRanges;
- if ( aRanges.Count() == 1 )
+ if ( aRanges.size() == 1 )
{
// ganze Tabelle sinnvoll begrenzen (auf belegten Datenbereich)
// (nur hier, Listener werden auf den ganzen Bereich angemeldet)
//! direkt testen, ob es ein ScTableSheetObj ist?
- ScRange* pRange = aRanges.GetObject(0);
+ const ScRange* pRange = aRanges[0];
if ( pRange->aStart.Col() == 0 && pRange->aEnd.Col() == MAXCOL &&
pRange->aStart.Row() == 0 && pRange->aEnd.Row() == MAXROW )
{
@@ -2965,7 +2981,7 @@ ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const
uno::Sequence< uno::Sequence<double> > SAL_CALL ScCellRangesBase::getData()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScMemChart* pMemChart = CreateMemChart_Impl();
if ( pMemChart )
{
@@ -2993,9 +3009,9 @@ uno::Sequence< uno::Sequence<double> > SAL_CALL ScCellRangesBase::getData()
ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( long nDataColumns, long nDataRows ) const
{
- if ( aRanges.Count() == 1 )
+ if ( aRanges.size() == 1 )
{
- ScRange* pRange = aRanges.GetObject(0);
+ const ScRange* pRange = aRanges[0];
if ( pRange->aStart.Col() == 0 && pRange->aEnd.Col() == MAXCOL &&
pRange->aStart.Row() == 0 && pRange->aEnd.Row() == MAXROW )
{
@@ -3027,8 +3043,8 @@ ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( long nDataColumns,
void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<double> >& aData )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
long nRowCount = aData.getLength();
long nColCount = nRowCount ? aData[0].getLength() : 0;
ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( nColCount, nRowCount );
@@ -3080,7 +3096,7 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub
uno::Sequence<rtl::OUString> SAL_CALL ScCellRangesBase::getRowDescriptions()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScMemChart* pMemChart = CreateMemChart_Impl();
if ( pMemChart )
{
@@ -3100,8 +3116,8 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions(
const uno::Sequence<rtl::OUString>& aRowDescriptions )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if ( bChartColAsHdr )
{
long nRowCount = aRowDescriptions.getLength();
@@ -3148,7 +3164,7 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions(
uno::Sequence<rtl::OUString> SAL_CALL ScCellRangesBase::getColumnDescriptions()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScMemChart* pMemChart = CreateMemChart_Impl();
if ( pMemChart )
{
@@ -3168,8 +3184,8 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions(
const uno::Sequence<rtl::OUString>& aColumnDescriptions )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if ( bChartRowAsHdr )
{
long nColCount = aColumnDescriptions.getLength();
@@ -3244,7 +3260,7 @@ String lcl_UniqueName( ScStrCollection& rColl, const String& rPrefix )
{
String aName(rPrefix);
aName += String::CreateFromInt32( nNumber );
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
for (sal_uInt16 i=0; i<nCollCount; i++)
if ( rColl[i]->GetString() == aName )
{
@@ -3261,8 +3277,8 @@ void SAL_CALL ScCellRangesBase::addChartDataChangeEventListener( const uno::Refe
chart::XChartDataChangeEventListener >& aListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( pDocShell && aRanges.Count() )
+ SolarMutexGuard aGuard;
+ if ( pDocShell && !aRanges.empty() )
{
//! auf doppelte testen?
@@ -3282,8 +3298,8 @@ void SAL_CALL ScCellRangesBase::removeChartDataChangeEventListener( const uno::R
chart::XChartDataChangeEventListener >& aListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( pDocShell && aRanges.Count() )
+ SolarMutexGuard aGuard;
+ if ( pDocShell && !aRanges.empty() )
{
ScDocument* pDoc = pDocShell->GetDocument();
ScChartListenerCollection* pColl = pDoc->GetChartListenerCollection();
@@ -3308,8 +3324,8 @@ sal_Bool SAL_CALL ScCellRangesBase::isNotANumber( double nNumber ) throw(uno::Ru
void SAL_CALL ScCellRangesBase::addModifyListener( const uno::Reference<util::XModifyListener>& aListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( aRanges.Count() == 0 )
+ SolarMutexGuard aGuard;
+ if ( aRanges.empty() )
throw uno::RuntimeException();
uno::Reference<util::XModifyListener> *pObj =
@@ -3322,9 +3338,8 @@ void SAL_CALL ScCellRangesBase::addModifyListener( const uno::Reference<util::XM
pValueListener = new ScLinkListener( LINK( this, ScCellRangesBase, ValueListenerHdl ) );
ScDocument* pDoc = pDocShell->GetDocument();
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
- pDoc->StartListeningArea( *aRanges.GetObject(i), pValueListener );
+ for ( size_t i = 0, nCount = aRanges.size(); i < nCount; i++)
+ pDoc->StartListeningArea( *aRanges[ i ], pValueListener );
acquire(); // don't lose this object (one ref for all listeners)
}
@@ -3334,8 +3349,8 @@ void SAL_CALL ScCellRangesBase::removeModifyListener( const uno::Reference<util:
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( aRanges.Count() == 0 )
+ SolarMutexGuard aGuard;
+ if ( aRanges.empty() )
throw uno::RuntimeException();
acquire(); // in case the listeners have the last ref - released below
@@ -3368,7 +3383,7 @@ void SAL_CALL ScCellRangesBase::removeModifyListener( const uno::Reference<util:
uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleCells()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
//! fuer alle Tabellen getrennt, wenn Markierungen pro Tabelle getrennt sind!
@@ -3380,7 +3395,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
SCCOL nCol = 0, nLastCol;
while (nCol <= MAXCOL)
{
- if (pDoc->ColHidden(nCol, nTab, nLastCol))
+ if (pDoc->ColHidden(nCol, nTab, NULL, &nLastCol))
// hidden columns. Unselect them.
aMarkData.SetMultiMarkArea(ScRange(nCol, 0, nTab, nLastCol, MAXROW, nTab), false);
@@ -3390,7 +3405,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
SCROW nRow = 0, nLastRow;
while (nRow <= MAXROW)
{
- if (pDoc->RowHidden(nRow, nTab, nLastRow))
+ if (pDoc->RowHidden(nRow, nTab, NULL, &nLastRow))
// These rows are hidden. Unselect them.
aMarkData.SetMultiMarkArea(ScRange(0, nRow, nTab, MAXCOL, nLastRow, nTab), false);
@@ -3398,7 +3413,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
}
ScRangeList aNewRanges;
- aMarkData.FillRangeListWithMarks( &aNewRanges, sal_False );
+ aMarkData.FillRangeListWithMarks( &aNewRanges, false );
return new ScCellRangesObj( pDocShell, aNewRanges );
}
@@ -3408,7 +3423,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCells()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -3416,10 +3431,9 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel
ScMarkData aMarkData(*GetMarkData());
// belegte Zellen wegmarkieren
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for (size_t i = 0, nCount = aRanges.size(); i < nCount; ++i)
{
- ScRange aRange = *aRanges.GetObject(i);
+ ScRange aRange = *aRanges[ i ];
ScCellIterator aIter( pDoc, aRange );
ScBaseCell* pCell = aIter.GetFirst();
@@ -3429,7 +3443,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel
if ( !pCell->IsBlank() )
aMarkData.SetMultiMarkArea(
ScRange( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ),
- sal_False );
+ false );
pCell = aIter.GetNext();
}
@@ -3438,7 +3452,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel
ScRangeList aNewRanges;
// IsMultiMarked reicht hier nicht (wird beim deselektieren nicht zurueckgesetzt)
if (aMarkData.HasAnyMultiMarks())
- aMarkData.FillRangeListWithMarks( &aNewRanges, sal_False );
+ aMarkData.FillRangeListWithMarks( &aNewRanges, false );
return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein
}
@@ -3450,7 +3464,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
sal_Int16 nContentFlags )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -3458,16 +3472,15 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
ScMarkData aMarkData;
// passende Zellen selektieren
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
{
- ScRange aRange = *aRanges.GetObject(i);
+ ScRange aRange = *aRanges[ i ];
ScCellIterator aIter( pDoc, aRange );
ScBaseCell* pCell = aIter.GetFirst();
while (pCell)
{
- sal_Bool bAdd = sal_False;
+ sal_Bool bAdd = false;
if ( pCell->HasNote() && ( nContentFlags & sheet::CellFlags::ANNOTATION ) )
bAdd = sal_True;
else
@@ -3527,7 +3540,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
ScRangeList aNewRanges;
if (aMarkData.IsMultiMarked())
- aMarkData.FillRangeListWithMarks( &aNewRanges, sal_False );
+ aMarkData.FillRangeListWithMarks( &aNewRanges, false );
return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein
}
@@ -3539,7 +3552,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
sal_Int32 nResultFlags )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -3547,10 +3560,9 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
ScMarkData aMarkData;
// passende Zellen selektieren
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
{
- ScRange aRange = *aRanges.GetObject(i);
+ ScRange aRange = *aRanges[ i ];
ScCellIterator aIter( pDoc, aRange );
ScBaseCell* pCell = aIter.GetFirst();
@@ -3559,7 +3571,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
if (pCell->GetCellType() == CELLTYPE_FORMULA)
{
ScFormulaCell* pFCell = (ScFormulaCell*)pCell;
- sal_Bool bAdd = sal_False;
+ sal_Bool bAdd = false;
if (pFCell->GetErrCode())
{
if ( nResultFlags & sheet::FormulaResult::ERROR )
@@ -3588,7 +3600,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
ScRangeList aNewRanges;
if (aMarkData.IsMultiMarked())
- aMarkData.FillRangeListWithMarks( &aNewRanges, sal_False );
+ aMarkData.FillRangeListWithMarks( &aNewRanges, false );
return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein
}
@@ -3601,8 +3613,8 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
{
if (pDocShell)
{
- sal_uLong nRangeCount = aRanges.Count();
- sal_uLong i;
+ size_t nRangeCount = aRanges.size();
+ size_t i;
ScDocument* pDoc = pDocShell->GetDocument();
ScMarkData aMarkData;
@@ -3632,7 +3644,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
for (i=0; i<nRangeCount; i++)
{
- ScRange aRange(*aRanges.GetObject(i));
+ ScRange aRange( *aRanges[ i ] );
if ( aRange.Intersects( aCellRange ) )
{
if (bColumnDiff)
@@ -3658,7 +3670,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
ScAddress aCmpAddr;
for (i=0; i<nRangeCount; i++)
{
- ScRange aRange(*aRanges.GetObject(i));
+ ScRange aRange( *aRanges[ i ] );
ScCellIterator aIter( pDoc, aRange );
ScBaseCell* pCell = aIter.GetFirst();
@@ -3674,7 +3686,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
if ( !ScBaseCell::CellEqual( pCell, pOtherCell ) )
aMarkData.SetMultiMarkArea( aOneRange );
else
- aMarkData.SetMultiMarkArea( aOneRange, sal_False ); // deselect
+ aMarkData.SetMultiMarkArea( aOneRange, false ); // deselect
pCell = aIter.GetNext();
}
@@ -3682,7 +3694,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
ScRangeList aNewRanges;
if (aMarkData.IsMultiMarked())
- aMarkData.FillRangeListWithMarks( &aNewRanges, sal_False );
+ aMarkData.FillRangeListWithMarks( &aNewRanges, false );
return new ScCellRangesObj( pDocShell, aNewRanges ); // aNewRanges kann leer sein
}
@@ -3692,29 +3704,28 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
uno::Reference<sheet::XSheetCellRanges > SAL_CALL ScCellRangesBase::queryColumnDifferences(
const table::CellAddress& aCompare ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- return QueryDifferences_Impl( aCompare, sal_True );
+ SolarMutexGuard aGuard;
+ return QueryDifferences_Impl( aCompare, true );
}
uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryRowDifferences(
const table::CellAddress& aCompare ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- return QueryDifferences_Impl( aCompare, sal_False );
+ SolarMutexGuard aGuard;
+ return QueryDifferences_Impl( aCompare, false );
}
uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryIntersection(
const table::CellRangeAddress& aRange ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRange aMask( (SCCOL)aRange.StartColumn, (SCROW)aRange.StartRow, aRange.Sheet,
(SCCOL)aRange.EndColumn, (SCROW)aRange.EndRow, aRange.Sheet );
ScRangeList aNew;
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
{
- ScRange aTemp(*aRanges.GetObject(i));
+ ScRange aTemp( *aRanges[ i ] );
if ( aTemp.Intersects( aMask ) )
aNew.Join( ScRange( Max( aTemp.aStart.Col(), aMask.aStart.Col() ),
Max( aTemp.aStart.Row(), aMask.aStart.Row() ),
@@ -3732,7 +3743,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryIntersec
uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPrecedents(
sal_Bool bRecursive ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -3741,17 +3752,16 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPreceden
sal_Bool bFound;
do
{
- bFound = sal_False;
+ bFound = false;
- // #97205# aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
+ // aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( aNewRanges, sal_False );
+ aMarkData.MarkFromRangeList( aNewRanges, false );
aMarkData.MarkToMulti(); // needed for IsAllMarked
- sal_uLong nCount = aNewRanges.Count();
- for (sal_uLong nR=0; nR<nCount; nR++)
+ for (size_t nR = 0, nCount = aNewRanges.size(); nR<nCount; ++nR)
{
- ScRange aRange(*aNewRanges.GetObject(nR));
+ ScRange aRange( *aNewRanges[ nR] );
ScCellIterator aIter( pDoc, aRange );
ScBaseCell* pCell = aIter.GetFirst();
while (pCell)
@@ -3786,7 +3796,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPreceden
uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependents(
sal_Bool bRecursive ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -3795,12 +3805,11 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen
sal_Bool bFound;
do
{
- bFound = sal_False;
- sal_uLong nRangesCount = aNewRanges.Count();
+ bFound = false;
- // #97205# aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
+ // aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( aNewRanges, sal_False );
+ aMarkData.MarkFromRangeList( aNewRanges, false );
aMarkData.MarkToMulti(); // needed for IsAllMarked
SCTAB nTab = lcl_FirstTab(aNewRanges); //! alle Tabellen
@@ -3811,14 +3820,15 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen
{
if (pCell->GetCellType() == CELLTYPE_FORMULA)
{
- sal_Bool bMark = sal_False;
+ sal_Bool bMark = false;
ScDetectiveRefIter aIter( (ScFormulaCell*) pCell );
ScRange aRefRange;
while ( aIter.GetNextRef( aRefRange) )
{
- for (sal_uLong nR=0; nR<nRangesCount; nR++)
+ size_t nRangesCount = aNewRanges.size();
+ for (size_t nR = 0; nR < nRangesCount; ++nR)
{
- ScRange aRange(*aNewRanges.GetObject(nR));
+ ScRange aRange( *aNewRanges[ nR ] );
if (aRange.Intersects(aRefRange))
bMark = sal_True; // von Teil des Ranges abhaengig
}
@@ -3851,7 +3861,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen
uno::Reference<util::XSearchDescriptor> SAL_CALL ScCellRangesBase::createSearchDescriptor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScCellSearchObj;
}
@@ -3944,7 +3954,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScCellRangesBase::findFirst(
const uno::Reference<util::XSearchDescriptor>& xDesc )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return Find_Impl( xDesc, NULL );
}
@@ -3953,16 +3963,16 @@ uno::Reference<uno::XInterface> SAL_CALL ScCellRangesBase::findNext(
const uno::Reference<util::XSearchDescriptor >& xDesc )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( xStartAt.is() )
{
ScCellRangesBase* pRangesImp = ScCellRangesBase::getImplementation( xStartAt );
if ( pRangesImp && pRangesImp->GetDocShell() == pDocShell )
{
const ScRangeList& rStartRanges = pRangesImp->GetRangeList();
- if ( rStartRanges.Count() == 1 )
+ if ( rStartRanges.size() == 1 )
{
- ScAddress aStartPos = rStartRanges.GetObject(0)->aStart;
+ ScAddress aStartPos = rStartRanges[ 0 ]->aStart;
return Find_Impl( xDesc, &aStartPos );
}
}
@@ -3975,15 +3985,15 @@ uno::Reference<uno::XInterface> SAL_CALL ScCellRangesBase::findNext(
uno::Reference<util::XReplaceDescriptor> SAL_CALL ScCellRangesBase::createReplaceDescriptor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScCellSearchObj;
}
sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSearchDescriptor>& xDesc )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Int32 nReplaced = 0;
+ SolarMutexGuard aGuard;
+ INT32 nReplaced = 0;
if ( pDocShell && xDesc.is() )
{
ScCellSearchObj* pSearch = ScCellSearchObj::getImplementation( xDesc );
@@ -4029,7 +4039,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea
if (bUndo)
pUndoMark = new ScMarkData(aMark);
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
if (bUndo)
bFound = pDoc->SearchAndReplace( *pSearchItem, nCol, nRow, nTab,
aMark, aUndoStr, pUndoDoc );
@@ -4071,7 +4081,6 @@ sal_Int64 SAL_CALL ScCellRangesBase::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScCellRangesBase::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -4088,7 +4097,6 @@ const uno::Sequence<sal_Int8>& ScCellRangesBase::getUnoTunnelId()
return *pSeq;
}
-// static
ScCellRangesBase* ScCellRangesBase::getImplementation( const uno::Reference<uno::XInterface> xObj )
{
ScCellRangesBase* pRet = NULL;
@@ -4180,9 +4188,9 @@ ScCellRangeObj* ScCellRangesObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const
{
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
- if ( pDocSh && nIndex >= 0 && nIndex < sal::static_int_cast<sal_Int32>(rRanges.Count()) )
+ if ( pDocSh && nIndex >= 0 && nIndex < sal::static_int_cast<sal_Int32>(rRanges.size()) )
{
- ScRange aRange(*rRanges.GetObject(nIndex));
+ ScRange aRange( *rRanges[ nIndex ] );
if ( aRange.aStart == aRange.aEnd )
return new ScCellObj( pDocSh, aRange.aStart );
else
@@ -4195,18 +4203,18 @@ ScCellRangeObj* ScCellRangesObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const
uno::Sequence<table::CellRangeAddress> SAL_CALL ScCellRangesObj::getRangeAddresses()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
- sal_uLong nCount = rRanges.Count();
+ size_t nCount = rRanges.size();
if ( pDocSh && nCount )
{
table::CellRangeAddress aRangeAddress;
uno::Sequence<table::CellRangeAddress> aSeq(nCount);
table::CellRangeAddress* pAry = aSeq.getArray();
- for (sal_uInt32 i=0; i<nCount; i++)
+ for ( size_t i=0; i < nCount; i++)
{
- ScUnoConversion::FillApiRange( aRangeAddress, *rRanges.GetObject(i) );
+ ScUnoConversion::FillApiRange( aRangeAddress, *rRanges[ i ] );
pAry[i] = aRangeAddress;
}
return aSeq;
@@ -4218,7 +4226,7 @@ uno::Sequence<table::CellRangeAddress> SAL_CALL ScCellRangesObj::getRangeAddress
uno::Reference<container::XEnumerationAccess> SAL_CALL ScCellRangesObj::getCells()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// getCells with empty range list is possible (no exception),
// the resulting enumeration just has no elements
@@ -4235,7 +4243,7 @@ uno::Reference<container::XEnumerationAccess> SAL_CALL ScCellRangesObj::getCells
rtl::OUString SAL_CALL ScCellRangesObj::getRangeAddressesAsString()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString;
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
@@ -4250,7 +4258,7 @@ void SAL_CALL ScCellRangesObj::addRangeAddress( const table::CellRangeAddress& r
sal_Bool bMergeRanges )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRange aRange(static_cast<SCCOL>(rRange.StartColumn),
static_cast<SCROW>(rRange.StartRow),
static_cast<SCTAB>(rRange.Sheet),
@@ -4272,24 +4280,24 @@ void SAL_CALL ScCellRangesObj::removeRangeAddress( const table::CellRangeAddress
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
ScRangeList aSheetRanges;
ScRangeList aNotSheetRanges;
- for (sal_uInt32 i = 0; i < rRanges.Count(); ++i)
+ for (size_t i = 0; i < rRanges.size(); ++i)
{
- if (rRanges.GetObject(i)->aStart.Tab() == rRange.Sheet)
+ if (rRanges[ i]->aStart.Tab() == rRange.Sheet)
{
- aSheetRanges.Append(*rRanges.GetObject(i));
+ aSheetRanges.Append( *rRanges[ i ] );
}
else
{
- aNotSheetRanges.Append(*rRanges.GetObject(i));
+ aNotSheetRanges.Append( *rRanges[ i ] );
}
}
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( aSheetRanges, sal_False );
+ aMarkData.MarkFromRangeList( aSheetRanges, false );
ScRange aRange(static_cast<SCCOL>(rRange.StartColumn),
static_cast<SCROW>(rRange.StartRow),
static_cast<SCTAB>(rRange.Sheet),
@@ -4301,7 +4309,7 @@ void SAL_CALL ScCellRangesObj::removeRangeAddress( const table::CellRangeAddress
aMarkData.MarkToMulti();
if (aMarkData.IsAllMarked( aRange ) )
{
- aMarkData.SetMultiMarkArea( aRange, sal_False );
+ aMarkData.SetMultiMarkArea( aRange, false );
lcl_RemoveNamedEntry(aNamedEntries, aRange);
}
else
@@ -4309,10 +4317,10 @@ void SAL_CALL ScCellRangesObj::removeRangeAddress( const table::CellRangeAddress
}
SetNewRanges(aNotSheetRanges);
ScRangeList aNew;
- aMarkData.FillRangeListWithMarks( &aNew, sal_False );
- for (sal_uInt32 j = 0; j < aNew.Count(); ++j)
+ aMarkData.FillRangeListWithMarks( &aNew, false );
+ for ( size_t j = 0; j < aNew.size(); ++j)
{
- AddRange(*aNew.GetObject(j), sal_False);
+ AddRange(*aNew[ j ], false);
}
}
@@ -4320,7 +4328,7 @@ void SAL_CALL ScCellRangesObj::addRangeAddresses( const uno::Sequence<table::Cel
sal_Bool bMergeRanges )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nCount(rRanges.getLength());
if (nCount)
{
@@ -4342,10 +4350,6 @@ void SAL_CALL ScCellRangesObj::removeRangeAddresses( const uno::Sequence<table::
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException)
{
- // with this implementation not needed
-// ScUnoGuard aGuard;
-
-
// use sometimes a better/faster implementation
sal_uInt32 nCount(rRangeSeq.getLength());
if (nCount)
@@ -4372,9 +4376,9 @@ void SAL_CALL ScCellRangesObj::insertByName( const rtl::OUString& aName, const u
throw(lang::IllegalArgumentException, container::ElementExistException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
//! Type of aElement can be some specific interface instead of XInterface
@@ -4397,9 +4401,9 @@ void SAL_CALL ScCellRangesObj::insertByName( const rtl::OUString& aName, const u
ScRangeList aNew(GetRangeList());
const ScRangeList& rAddRanges = pRangesImp->GetRangeList();
- sal_uLong nAddCount = rAddRanges.Count();
- for (sal_uLong i=0; i<nAddCount; i++)
- aNew.Join( *rAddRanges.GetObject(i) );
+ size_t nAddCount = rAddRanges.size();
+ for ( size_t i = 0; i < nAddCount; i++ )
+ aNew.Join( *rAddRanges[ i ] );
SetNewRanges(aNew);
bDone = sal_True;
@@ -4409,7 +4413,7 @@ void SAL_CALL ScCellRangesObj::insertByName( const rtl::OUString& aName, const u
// (only possible for a single range)
// name is not in aNamedEntries (tested above)
- ScNamedEntry* pEntry = new ScNamedEntry( aNamStr, *rAddRanges.GetObject(0) );
+ ScNamedEntry* pEntry = new ScNamedEntry( aNamStr, *rAddRanges[ 0 ] );
aNamedEntries.Insert( pEntry, aNamedEntries.Count() );
}
}
@@ -4423,16 +4427,15 @@ void SAL_CALL ScCellRangesObj::insertByName( const rtl::OUString& aName, const u
}
sal_Bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDocSh,
- const String& rName, sal_uLong& rIndex )
+ const String& rName, size_t& rIndex )
{
if (pDocSh)
{
String aRangeStr;
ScDocument* pDoc = pDocSh->GetDocument();
- sal_uLong nCount = rRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
{
- rRanges.GetObject(i)->Format( aRangeStr, SCA_VALID | SCA_TAB_3D, pDoc );
+ rRanges[ i ]->Format( aRangeStr, SCA_VALID | SCA_TAB_3D, pDoc );
if ( aRangeStr == rName )
{
rIndex = i;
@@ -4440,7 +4443,7 @@ sal_Bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDocSh,
}
}
}
- return sal_False; // nicht gefunden
+ return false; // nicht gefunden
}
sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
@@ -4449,11 +4452,11 @@ sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
{
// exact range in list?
- sal_uLong nIndex = 0;
+ size_t nIndex = 0;
if ( lcl_FindRangeByName( rRanges, pDocSh, rName, nIndex ) )
{
- rFound = *rRanges.GetObject(nIndex);
- return sal_True;
+ rFound = *rRanges[ nIndex ];
+ return true;
}
// range contained in selection? (sheet must be specified)
@@ -4463,7 +4466,7 @@ sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
if ( ( nParse & ( SCA_VALID | SCA_TAB_3D ) ) == ( SCA_VALID | SCA_TAB_3D ) )
{
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( rRanges, sal_False );
+ aMarkData.MarkFromRangeList( rRanges, false );
aMarkData.MarkToMulti(); // needed for IsAllMarked
if ( aMarkData.IsAllMarked( aCellRange ) )
{
@@ -4483,7 +4486,7 @@ sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
const ScRange& rComp = rNamedEntries[n]->GetRange();
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( rRanges, sal_False );
+ aMarkData.MarkFromRangeList( rRanges, false );
aMarkData.MarkToMulti(); // needed for IsAllMarked
if ( aMarkData.IsAllMarked( rComp ) )
{
@@ -4493,27 +4496,26 @@ sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
}
}
- return sal_False; // not found
+ return false; // not found
}
void SAL_CALL ScCellRangesObj::removeByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
String aNameStr(aName);
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
- sal_uLong nIndex = 0;
+ size_t nIndex = 0;
if ( lcl_FindRangeByName( rRanges, pDocSh, aNameStr, nIndex ) )
{
// einzelnen Range weglassen
ScRangeList aNew;
- sal_uLong nCount = rRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
if (i != nIndex)
- aNew.Append( *rRanges.GetObject(i) );
+ aNew.Append( *rRanges[ i ] );
SetNewRanges(aNew);
bDone = sal_True;
}
@@ -4536,18 +4538,17 @@ void SAL_CALL ScCellRangesObj::removeByName( const rtl::OUString& aName )
if ( bValid )
{
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( rRanges, sal_False );
+ aMarkData.MarkFromRangeList( rRanges, false );
- sal_uLong nDiffCount = aDiff.Count();
- for (sal_uLong i=0; i<nDiffCount; i++)
+ for ( size_t i = 0, nDiffCount = aDiff.size(); i < nDiffCount; i++ )
{
- ScRange* pDiffRange = aDiff.GetObject(i);
+ ScRange* pDiffRange = aDiff[ i ];
if (aMarkData.GetTableSelect( pDiffRange->aStart.Tab() ))
- aMarkData.SetMultiMarkArea( *pDiffRange, sal_False );
+ aMarkData.SetMultiMarkArea( *pDiffRange, false );
}
ScRangeList aNew;
- aMarkData.FillRangeListWithMarks( &aNew, sal_False );
+ aMarkData.FillRangeListWithMarks( &aNew, false );
SetNewRanges(aNew);
bDone = sal_True; //! error if range was not selected before?
@@ -4567,7 +4568,7 @@ void SAL_CALL ScCellRangesObj::replaceByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! zusammenfassen?
removeByName( aName );
insertByName( aName, aElement );
@@ -4579,7 +4580,7 @@ uno::Any SAL_CALL ScCellRangesObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aRet;
String aNameStr(aName);
@@ -4610,13 +4611,13 @@ sal_Bool lcl_FindEntryName( const ScNamedEntryArr_Impl& rNamedEntries,
rName = rNamedEntries[i]->GetName();
return sal_True;
}
- return sal_False;
+ return false;
}
uno::Sequence<rtl::OUString> SAL_CALL ScCellRangesObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
@@ -4624,14 +4625,14 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellRangesObj::getElementNames()
{
String aRangeStr;
ScDocument* pDoc = pDocSh->GetDocument();
- sal_uLong nCount = rRanges.Count();
+ size_t nCount = rRanges.size();
uno::Sequence<rtl::OUString> aSeq(nCount);
rtl::OUString* pAry = aSeq.getArray();
- for (sal_uLong i=0; i<nCount; i++)
+ for (size_t i=0; i < nCount; i++)
{
// use given name if for exactly this range, otherwise just format
- ScRange aRange = *rRanges.GetObject(i);
+ ScRange aRange = *rRanges[ i ];
if ( !aNamedEntries.Count() || !lcl_FindEntryName( aNamedEntries, aRange, aRangeStr ) )
aRange.Format( aRangeStr, SCA_VALID | SCA_TAB_3D, pDoc );
pAry[i] = aRangeStr;
@@ -4644,7 +4645,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellRangesObj::getElementNames()
sal_Bool SAL_CALL ScCellRangesObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameStr(aName);
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
@@ -4657,7 +4658,7 @@ sal_Bool SAL_CALL ScCellRangesObj::hasByName( const rtl::OUString& aName )
uno::Reference<container::XEnumeration> SAL_CALL ScCellRangesObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SheetCellRangesEnumeration")));
}
@@ -4665,42 +4666,41 @@ uno::Reference<container::XEnumeration> SAL_CALL ScCellRangesObj::createEnumerat
sal_Int32 SAL_CALL ScCellRangesObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- return rRanges.Count();
+ return rRanges.size();
}
uno::Any SAL_CALL ScCellRangesObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XCellRange> xRange(GetObjectByIndex_Impl(nIndex));
if (xRange.is())
return uno::makeAny(xRange);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScCellRangesObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<table::XCellRange>*)0);
}
sal_Bool SAL_CALL ScCellRangesObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- return rRanges.Count() != 0;
+ return !rRanges.empty();
}
// XServiceInfo
rtl::OUString SAL_CALL ScCellRangesObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScCellRangesObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScCellRangesObj" ));
}
sal_Bool SAL_CALL ScCellRangesObj::supportsService( const rtl::OUString& rServiceName )
@@ -4718,16 +4718,15 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellRangesObj::getSupportedServiceNames(
{
uno::Sequence<rtl::OUString> aRet(4);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCSHEETCELLRANGES_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCCELLPROPERTIES_SERVICE );
- pArray[2] = rtl::OUString::createFromAscii( SCCHARPROPERTIES_SERVICE );
- pArray[3] = rtl::OUString::createFromAscii( SCPARAPROPERTIES_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSHEETCELLRANGES_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLPROPERTIES_SERVICE ));
+ pArray[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCHARPROPERTIES_SERVICE ));
+ pArray[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCPARAPROPERTIES_SERVICE ));
return aRet;
}
//------------------------------------------------------------------------
-// static
uno::Reference<table::XCellRange> ScCellRangeObj::CreateRangeFromDoc( ScDocument* pDoc, const ScRange& rR )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
@@ -4755,11 +4754,11 @@ void ScCellRangeObj::RefChanged()
ScCellRangesBase::RefChanged();
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT(rRanges.Count() == 1, "was fuer Ranges ?!?!");
- const ScRange* pFirst = rRanges.GetObject(0);
- if (pFirst)
+ DBG_ASSERT(rRanges.size() == 1, "was fuer Ranges ?!?!");
+ if ( !rRanges.empty() )
{
- aRange = *pFirst;
+ const ScRange* pFirst = rRanges[0];
+ aRange = ScRange(*pFirst);
aRange.Justify();
}
}
@@ -4873,14 +4872,13 @@ uno::Reference<table::XCell> ScCellRangeObj::GetCellByPosition_Impl(
}
throw lang::IndexOutOfBoundsException();
-// return NULL;
}
uno::Reference<table::XCell> SAL_CALL ScCellRangeObj::getCellByPosition(
sal_Int32 nColumn, sal_Int32 nRow )
throw(lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetCellByPosition_Impl(nColumn, nRow);
}
@@ -4889,7 +4887,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScCellRangeObj::getCellRangeByPositio
sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom )
throw(lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (!pDocSh)
@@ -4912,10 +4910,8 @@ uno::Reference<table::XCellRange> SAL_CALL ScCellRangeObj::getCellRangeByPositio
}
throw lang::IndexOutOfBoundsException();
-// return NULL;
}
-
uno::Reference<table::XCellRange> SAL_CALL ScCellRangeObj::getCellRangeByName(
const rtl::OUString& aName ) throw(uno::RuntimeException)
{
@@ -4928,7 +4924,7 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
// name refers to the whole document (with the range's table as default),
// valid only if the range is within this range
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -4936,7 +4932,7 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
SCTAB nTab = aRange.aStart.Tab();
ScRange aCellRange;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
String aString(aName);
sal_uInt16 nParse = aCellRange.ParseAny( aString, pDoc, rDetails );
if ( nParse & SCA_VALID )
@@ -4959,7 +4955,7 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
if (bFound) // valid only if within this object's range
{
if (!aRange.In(aCellRange))
- bFound = sal_False;
+ bFound = false;
}
if (bFound)
@@ -4972,32 +4968,31 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
}
throw uno::RuntimeException();
-// return NULL;
}
// XColumnRowRange
uno::Reference<table::XTableColumns> SAL_CALL ScCellRangeObj::getColumns() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
return new ScTableColumnsObj( pDocSh, aRange.aStart.Tab(),
aRange.aStart.Col(), aRange.aEnd.Col() );
- DBG_ERROR("Dokument ungueltig");
+ OSL_FAIL("Dokument ungueltig");
return NULL;
}
uno::Reference<table::XTableRows> SAL_CALL ScCellRangeObj::getRows() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
return new ScTableRowsObj( pDocSh, aRange.aStart.Tab(),
aRange.aStart.Row(), aRange.aEnd.Row() );
- DBG_ERROR("Dokument ungueltig");
+ OSL_FAIL("Dokument ungueltig");
return NULL;
}
@@ -5005,7 +5000,7 @@ uno::Reference<table::XTableRows> SAL_CALL ScCellRangeObj::getRows() throw(uno::
table::CellRangeAddress SAL_CALL ScCellRangeObj::getRangeAddress() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aRet;
ScUnoConversion::FillApiRange( aRet, aRange );
return aRet;
@@ -5016,12 +5011,12 @@ table::CellRangeAddress SAL_CALL ScCellRangeObj::getRangeAddress() throw(uno::Ru
uno::Reference<sheet::XSpreadsheet> SAL_CALL ScCellRangeObj::getSpreadsheet()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
return new ScTableSheetObj( pDocSh, aRange.aStart.Tab() );
- DBG_ERROR("Dokument ungueltig");
+ OSL_FAIL("Dokument ungueltig");
return NULL;
}
@@ -5029,7 +5024,7 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScCellRangeObj::getSpreadsheet()
rtl::OUString SAL_CALL ScCellRangeObj::getArrayFormula() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Matrix-Formel, wenn eindeutig Teil einer Matrix,
// also wenn Anfang und Ende des Blocks zur selben Matrix gehoeren.
@@ -5070,7 +5065,7 @@ void ScCellRangeObj::SetArrayFormula_Impl( const rtl::OUString& rFormula,
{
if ( ScTableSheetObj::getImplementation( (cppu::OWeakObject*)this ) )
{
- // #74681# don't set array formula for sheet object
+ // don't set array formula for sheet object
throw uno::RuntimeException();
}
@@ -5090,7 +5085,7 @@ void ScCellRangeObj::SetArrayFormula_Impl( const rtl::OUString& rFormula,
void SAL_CALL ScCellRangeObj::setArrayFormula( const rtl::OUString& aFormula )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// GRAM_PODF_A1 for API compatibility.
SetArrayFormula_Impl( aFormula, ::rtl::OUString(), formula::FormulaGrammar::GRAM_PODF_A1);
}
@@ -5098,7 +5093,7 @@ void SAL_CALL ScCellRangeObj::setArrayFormula( const rtl::OUString& aFormula )
void ScCellRangeObj::SetArrayFormulaWithGrammar( const rtl::OUString& rFormula,
const rtl::OUString& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SetArrayFormula_Impl( rFormula, rFormulaNmsp, eGrammar);
}
@@ -5106,7 +5101,7 @@ void ScCellRangeObj::SetArrayFormulaWithGrammar( const rtl::OUString& rFormula,
uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellRangeObj::getArrayTokens() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// same cell logic as in getArrayFormula
@@ -5140,7 +5135,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellRangeObj::getArrayTokens() thr
void SAL_CALL ScCellRangeObj::setArrayTokens( const uno::Sequence<sheet::FormulaToken>& rTokens ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -5177,7 +5172,7 @@ void SAL_CALL ScCellRangeObj::setArrayTokens( const uno::Sequence<sheet::Formula
uno::Sequence< uno::Sequence<uno::Any> > SAL_CALL ScCellRangeObj::getDataArray()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( ScTableSheetObj::getImplementation( (cppu::OWeakObject*)this ) )
{
@@ -5199,16 +5194,15 @@ uno::Sequence< uno::Sequence<uno::Any> > SAL_CALL ScCellRangeObj::getDataArray()
}
throw uno::RuntimeException(); // no other exceptions specified
-// return uno::Sequence< uno::Sequence<uno::Any> >(0);
}
void SAL_CALL ScCellRangeObj::setDataArray(
const uno::Sequence< uno::Sequence<uno::Any> >& aArray )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
@@ -5225,7 +5219,7 @@ void SAL_CALL ScCellRangeObj::setDataArray(
uno::Sequence< uno::Sequence<rtl::OUString> > SAL_CALL ScCellRangeObj::getFormulaArray()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( ScTableSheetObj::getImplementation( (cppu::OWeakObject*)this ) )
{
@@ -5261,16 +5255,15 @@ uno::Sequence< uno::Sequence<rtl::OUString> > SAL_CALL ScCellRangeObj::getFormul
}
throw uno::RuntimeException(); // no other exceptions specified
-// return uno::Sequence< uno::Sequence<rtl::OUString> >(0);
}
void SAL_CALL ScCellRangeObj::setFormulaArray(
const uno::Sequence< uno::Sequence<rtl::OUString> >& aArray )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
@@ -5292,24 +5285,24 @@ void SAL_CALL ScCellRangeObj::setTableOperation( const table::CellRangeAddress&
const table::CellAddress& aRowCell )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
ScTabOpParam aParam;
aParam.aRefFormulaCell = ScRefAddress( (SCCOL)aFormulaRange.StartColumn,
(SCROW)aFormulaRange.StartRow, aFormulaRange.Sheet,
- sal_False, sal_False, sal_False );
+ false, false, false );
aParam.aRefFormulaEnd = ScRefAddress( (SCCOL)aFormulaRange.EndColumn,
(SCROW)aFormulaRange.EndRow, aFormulaRange.Sheet,
- sal_False, sal_False, sal_False );
+ false, false, false );
aParam.aRefRowCell = ScRefAddress( (SCCOL)aRowCell.Column,
(SCROW)aRowCell.Row, aRowCell.Sheet,
- sal_False, sal_False, sal_False );
+ false, false, false );
aParam.aRefColCell = ScRefAddress( (SCCOL)aColumnCell.Column,
(SCROW)aColumnCell.Row, aColumnCell.Sheet,
- sal_False, sal_False, sal_False );
+ false, false, false );
switch (nMode)
{
case sheet::TableOperationMode_COLUMN:
@@ -5337,15 +5330,19 @@ void SAL_CALL ScCellRangeObj::setTableOperation( const table::CellRangeAddress&
void SAL_CALL ScCellRangeObj::merge( sal_Bool bMerge ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
ScDocFunc aFunc(*pDocSh);
+ ScCellMergeOption aMergeOption(
+ aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row(), false);
+ aMergeOption.maTabs.insert(aRange.aStart.Tab());
if ( bMerge )
- aFunc.MergeCells( aRange, sal_False, sal_True, sal_True );
+ aFunc.MergeCells( aMergeOption, false, true, true );
else
- aFunc.UnmergeCells( aRange, sal_True, sal_True );
+ aFunc.UnmergeCells( aMergeOption, true, true );
//! Fehler abfangen?
}
@@ -5353,7 +5350,7 @@ void SAL_CALL ScCellRangeObj::merge( sal_Bool bMerge ) throw(uno::RuntimeExcepti
sal_Bool SAL_CALL ScCellRangeObj::getIsMerged() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
return pDocSh && pDocSh->GetDocument()->HasAttrib( aRange, HASATTR_MERGED );
}
@@ -5364,11 +5361,11 @@ void SAL_CALL ScCellRangeObj::fillSeries( sheet::FillDirection nFillDirection,
sheet::FillMode nFillMode, sheet::FillDateMode nFillDateMode,
double fStep, double fEndValue ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
FillDir eDir = FILL_TO_BOTTOM;
switch (nFillDirection)
@@ -5442,14 +5439,14 @@ void SAL_CALL ScCellRangeObj::fillSeries( sheet::FillDirection nFillDirection,
void SAL_CALL ScCellRangeObj::fillAuto( sheet::FillDirection nFillDirection,
sal_Int32 nSourceCount ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh && nSourceCount )
{
ScRange aSourceRange(aRange);
SCsCOLROW nCount = 0; // "Dest-Count"
FillDir eDir = FILL_TO_BOTTOM;
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
switch (nFillDirection)
{
case sheet::FillDirection_TO_BOTTOM:
@@ -5491,7 +5488,7 @@ void SAL_CALL ScCellRangeObj::fillAuto( sheet::FillDirection nFillDirection,
void SAL_CALL ScCellRangeObj::autoFormat( const rtl::OUString& aName )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAutoFormat* pAutoFormat = ScGlobal::GetAutoFormat();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh && pAutoFormat )
@@ -5521,7 +5518,7 @@ void SAL_CALL ScCellRangeObj::autoFormat( const rtl::OUString& aName )
uno::Sequence<beans::PropertyValue> SAL_CALL ScCellRangeObj::createSortDescriptor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSortParam aParam;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -5552,7 +5549,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScCellRangeObj::createSortDescripto
void SAL_CALL ScCellRangeObj::sort( const uno::Sequence<beans::PropertyValue>& aDescriptor )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
@@ -5599,7 +5596,7 @@ void SAL_CALL ScCellRangeObj::sort( const uno::Sequence<beans::PropertyValue>& a
uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFilterDescriptor(
sal_Bool bEmpty ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
ScFilterDescriptor* pNew = new ScFilterDescriptor(pDocSh);
if ( !bEmpty && pDocSh )
@@ -5632,7 +5629,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
void SAL_CALL ScCellRangeObj::filter( const uno::Reference<sheet::XSheetFilterDescriptor>& xDescriptor )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// das koennte theoretisch ein fremdes Objekt sein, also nur das
// oeffentliche XSheetFilterDescriptor Interface benutzen, um
@@ -5705,7 +5702,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
const uno::Reference<sheet::XSheetFilterable>& xObject )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// this ist hier nicht der Bereich, der gefiltert wird, sondern der
// Bereich mit der Abfrage...
@@ -5718,7 +5715,6 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
//! Test, ob xObject im selben Dokument ist
ScFilterDescriptor* pNew = new ScFilterDescriptor(pDocSh); //! stattdessen vom Objekt?
- //XSheetFilterDescriptorRef xNew = xObject->createFilterDescriptor(sal_True);
ScQueryParam aParam = pNew->GetParam();
aParam.bHasHeader = sal_True;
@@ -5759,7 +5755,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
}
}
- DBG_ERROR("kein Dokument oder kein Bereich");
+ OSL_FAIL("kein Dokument oder kein Bereich");
return NULL;
}
@@ -5768,7 +5764,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
uno::Reference<sheet::XSubTotalDescriptor> SAL_CALL ScCellRangeObj::createSubTotalDescriptor(
sal_Bool bEmpty ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalDescriptor* pNew = new ScSubTotalDescriptor;
ScDocShell* pDocSh = GetDocShell();
if ( !bEmpty && pDocSh )
@@ -5804,7 +5800,7 @@ void SAL_CALL ScCellRangeObj::applySubTotals(
const uno::Reference<sheet::XSubTotalDescriptor>& xDescriptor,
sal_Bool bReplace ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!xDescriptor.is()) return;
@@ -5846,7 +5842,7 @@ void SAL_CALL ScCellRangeObj::applySubTotals(
void SAL_CALL ScCellRangeObj::removeSubTotals() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
@@ -5874,7 +5870,7 @@ void SAL_CALL ScCellRangeObj::removeSubTotals() throw(uno::RuntimeException)
uno::Sequence<beans::PropertyValue> SAL_CALL ScCellRangeObj::createImportDescriptor( sal_Bool bEmpty )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScImportParam aParam;
ScDocShell* pDocSh = GetDocShell();
if ( !bEmpty && pDocSh )
@@ -5893,7 +5889,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScCellRangeObj::createImportDescrip
void SAL_CALL ScCellRangeObj::doImport( const uno::Sequence<beans::PropertyValue>& aDescriptor )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
@@ -5912,7 +5908,7 @@ void SAL_CALL ScCellRangeObj::doImport( const uno::Sequence<beans::PropertyValue
pDocSh->GetDBData( aRange, SC_DB_MAKE, SC_DBSEL_FORCE_MARK ); // ggf. Bereich anlegen
ScDBDocFunc aFunc(*pDocSh); // Bereich muss angelegt sein
- aFunc.DoImport( nTab, aParam, xResultSet, NULL, sal_True, sal_False ); //! Api-Flag als Parameter
+ aFunc.DoImport( nTab, aParam, xResultSet, NULL, sal_True, false ); //! Api-Flag als Parameter
}
}
@@ -5921,7 +5917,7 @@ void SAL_CALL ScCellRangeObj::doImport( const uno::Sequence<beans::PropertyValue
uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangeObj::getCellFormatRanges()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScCellFormatsObj( pDocSh, aRange );
@@ -5933,7 +5929,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangeObj::getCellFormatRa
uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangeObj::getUniqueCellFormatRanges()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScUniqueCellFormatsObj( pDocSh, aRange );
@@ -5945,7 +5941,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangeObj::getUniqueCellFo
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellRangeObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( pRangePropSet->getPropertyMap() ));
return aRef;
@@ -6008,7 +6004,7 @@ const SfxItemPropertyMap* ScCellRangeObj::GetItemPropertyMap()
rtl::OUString SAL_CALL ScCellRangeObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScCellRangeObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScCellRangeObj" ));
}
sal_Bool SAL_CALL ScCellRangeObj::supportsService( const rtl::OUString& rServiceName )
@@ -6027,17 +6023,17 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellRangeObj::getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(5);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCSHEETCELLRANGE_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCCELLRANGE_SERVICE );
- pArray[2] = rtl::OUString::createFromAscii( SCCELLPROPERTIES_SERVICE );
- pArray[3] = rtl::OUString::createFromAscii( SCCHARPROPERTIES_SERVICE );
- pArray[4] = rtl::OUString::createFromAscii( SCPARAPROPERTIES_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSHEETCELLRANGE_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLRANGE_SERVICE ));
+ pArray[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLPROPERTIES_SERVICE ));
+ pArray[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCHARPROPERTIES_SERVICE ));
+ pArray[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCPARAPROPERTIES_SERVICE ));
return aRet;
}
//------------------------------------------------------------------------
-const SvxItemPropertySet* ScCellObj::GetEditPropertySet() // static
+const SvxItemPropertySet* ScCellObj::GetEditPropertySet()
{
return lcl_GetEditPropertySet();
}
@@ -6068,7 +6064,7 @@ SvxUnoText& ScCellObj::GetUnoText()
ScSharedCellEditSource* pEditSource =
static_cast<ScSharedCellEditSource*> (pUnoText->GetEditSource());
if (pEditSource)
- pEditSource->SetDoUpdateData(sal_False);
+ pEditSource->SetDoUpdateData(false);
}
}
return *pUnoText;
@@ -6085,10 +6081,12 @@ void ScCellObj::RefChanged()
ScCellRangeObj::RefChanged();
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT(rRanges.Count() == 1, "was fuer Ranges ?!?!");
- const ScRange* pFirst = rRanges.GetObject(0);
- if (pFirst)
+ DBG_ASSERT(rRanges.size() == 1, "was fuer Ranges ?!?!");
+ if ( !rRanges.empty() )
+ {
+ const ScRange* pFirst = rRanges[ 0 ];
aCellPos = pFirst->aStart;
+ }
}
uno::Any SAL_CALL ScCellObj::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException)
@@ -6287,7 +6285,7 @@ void ScCellObj::InputEnglishString( const ::rtl::OUString& rText )
sal_uInt32 nOldFormat = pDoc->GetNumberFormat( aCellPos );
if ( pFormatter->GetType( nOldFormat ) == NUMBERFORMAT_TEXT )
{
- SetString_Impl(aString, sal_False, sal_False); // text cell
+ SetString_Impl(aString, false, false); // text cell
}
else
{
@@ -6314,7 +6312,7 @@ void ScCellObj::InputEnglishString( const ::rtl::OUString& rText )
(void)aFunc.PutCell( aCellPos, pNewCell, sal_True );
}
else
- SetString_Impl(aString, sal_False, sal_False); // no cell from InterpretEnglishString, probably empty string
+ SetString_Impl(aString, false, false); // no cell from InterpretEnglishString, probably empty string
}
}
}
@@ -6324,7 +6322,7 @@ void ScCellObj::InputEnglishString( const ::rtl::OUString& rText )
uno::Reference<text::XTextCursor> SAL_CALL ScCellObj::createTextCursor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScCellTextCursor( *this );
}
@@ -6332,7 +6330,7 @@ uno::Reference<text::XTextCursor> SAL_CALL ScCellObj::createTextCursorByRange(
const uno::Reference<text::XTextRange>& aTextPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SvxUnoTextCursor* pCursor = new ScCellTextCursor( *this );
uno::Reference<text::XTextCursor> xCursor(pCursor);
@@ -6353,15 +6351,15 @@ uno::Reference<text::XTextCursor> SAL_CALL ScCellObj::createTextCursorByRange(
rtl::OUString SAL_CALL ScCellObj::getString() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetOutputString_Impl();
}
void SAL_CALL ScCellObj::setString( const rtl::OUString& aText ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aText);
- SetString_Impl(aString, sal_False, sal_False); // immer Text
+ SetString_Impl(aString, false, false); // immer Text
// don't create pUnoText here if not there
if (pUnoText)
@@ -6375,7 +6373,7 @@ void SAL_CALL ScCellObj::insertString( const uno::Reference<text::XTextRange>& x
// special handling for ScCellTextCursor is no longer needed,
// SvxUnoText::insertString checks for SvxUnoTextRangeBase instead of SvxUnoTextRange
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().insertString(xRange, aString, bAbsorb);
}
@@ -6383,7 +6381,7 @@ void SAL_CALL ScCellObj::insertControlCharacter( const uno::Reference<text::XTex
sal_Int16 nControlCharacter, sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().insertControlCharacter(xRange, nControlCharacter, bAbsorb);
}
@@ -6392,20 +6390,13 @@ void SAL_CALL ScCellObj::insertTextContent( const uno::Reference<text::XTextRang
sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh && xContent.is() )
{
ScCellFieldObj* pCellField = ScCellFieldObj::getImplementation( xContent );
SvxUnoTextRangeBase* pTextRange = ScCellTextCursor::getImplementation( xRange );
-#if 0
- if (!pTextRange)
- pTextRange = SvxUnoTextRangeBase::getImplementation( xRange );
-
- //! bei SvxUnoTextRange testen, ob in passendem Objekt !!!
-#endif
-
if ( pCellField && !pCellField->IsInserted() && pTextRange )
{
SvxEditSource* pEditSource = pTextRange->GetEditSource();
@@ -6431,7 +6422,7 @@ void SAL_CALL ScCellObj::insertTextContent( const uno::Reference<text::XTextRang
aSelection.nEndPos = aSelection.nStartPos + 1;
pCellField->InitDoc( pDocSh, aCellPos, aSelection );
- // #91431# for bAbsorb=sal_False, the new selection must be behind the inserted content
+ // for bAbsorb=FALSE, the new selection must be behind the inserted content
// (the xml filter relies on this)
if (!bAbsorb)
aSelection.nStartPos = aSelection.nEndPos;
@@ -6447,7 +6438,7 @@ void SAL_CALL ScCellObj::insertTextContent( const uno::Reference<text::XTextRang
void SAL_CALL ScCellObj::removeTextContent( const uno::Reference<text::XTextContent>& xContent )
throw(container::NoSuchElementException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( xContent.is() )
{
ScCellFieldObj* pCellField = ScCellFieldObj::getImplementation( xContent );
@@ -6463,38 +6454,38 @@ void SAL_CALL ScCellObj::removeTextContent( const uno::Reference<text::XTextCont
uno::Reference<text::XText> SAL_CALL ScCellObj::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return this;
}
uno::Reference<text::XTextRange> SAL_CALL ScCellObj::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getStart();
}
uno::Reference<text::XTextRange> SAL_CALL ScCellObj::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getEnd();
}
uno::Reference<container::XEnumeration> SAL_CALL ScCellObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().createEnumeration();
}
uno::Type SAL_CALL ScCellObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getElementType();
}
sal_Bool SAL_CALL ScCellObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().hasElements();
}
@@ -6502,33 +6493,33 @@ sal_Bool SAL_CALL ScCellObj::hasElements() throw(uno::RuntimeException)
rtl::OUString SAL_CALL ScCellObj::getFormula() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- // sal_True = englisch
- return GetInputString_Impl(sal_True);
+ SolarMutexGuard aGuard;
+ // TRUE = englisch
+ return GetInputString_Impl(true);
}
void SAL_CALL ScCellObj::setFormula( const rtl::OUString& aFormula ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aFormula);
SetString_Impl(aString, sal_True, sal_True); // englisch interpretieren
}
double SAL_CALL ScCellObj::getValue() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetValue_Impl();
}
void SAL_CALL ScCellObj::setValue( double nValue ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SetValue_Impl(nValue);
}
table::CellContentType SAL_CALL ScCellObj::getType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellContentType eRet = table::CellContentType_EMPTY;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
@@ -6552,7 +6543,7 @@ table::CellContentType SAL_CALL ScCellObj::getType() throw(uno::RuntimeException
}
else
{
- DBG_ERROR("keine DocShell"); //! Exception oder so?
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
}
return eRet;
@@ -6575,7 +6566,7 @@ table::CellContentType ScCellObj::GetResultType_Impl()
sal_Int32 SAL_CALL ScCellObj::getError() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nError = 0;
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
@@ -6587,7 +6578,7 @@ sal_Int32 SAL_CALL ScCellObj::getError() throw(uno::RuntimeException)
}
else
{
- DBG_ERROR("keine DocShell"); //! Exception oder so?
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
}
return nError;
@@ -6597,7 +6588,7 @@ sal_Int32 SAL_CALL ScCellObj::getError() throw(uno::RuntimeException)
uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellObj::getTokens() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence<sheet::FormulaToken> aSequence;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -6616,7 +6607,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellObj::getTokens() throw(uno::Ru
void SAL_CALL ScCellObj::setTokens( const uno::Sequence<sheet::FormulaToken>& rTokens ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -6634,7 +6625,7 @@ void SAL_CALL ScCellObj::setTokens( const uno::Sequence<sheet::FormulaToken>& rT
table::CellAddress SAL_CALL ScCellObj::getCellAddress() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellAddress aAdr;
aAdr.Sheet = aCellPos.Tab();
aAdr.Column = aCellPos.Col();
@@ -6647,12 +6638,12 @@ table::CellAddress SAL_CALL ScCellObj::getCellAddress() throw(uno::RuntimeExcept
uno::Reference<sheet::XSheetAnnotation> SAL_CALL ScCellObj::getAnnotation()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScAnnotationObj( pDocSh, aCellPos );
- DBG_ERROR("getAnnotation ohne DocShell");
+ OSL_FAIL("getAnnotation ohne DocShell");
return NULL;
}
@@ -6661,7 +6652,7 @@ uno::Reference<sheet::XSheetAnnotation> SAL_CALL ScCellObj::getAnnotation()
uno::Reference<container::XEnumerationAccess> SAL_CALL ScCellObj::getTextFields()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScCellFieldsObj( pDocSh, aCellPos );
@@ -6681,7 +6672,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScCellObj::getTextFieldMasters()
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( pCellPropSet->getPropertyMap() ));
return aRef;
@@ -6697,7 +6688,7 @@ void ScCellObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, c
rtl::OUString aStrVal;
aValue >>= aStrVal;
String aString(aStrVal);
- SetString_Impl(aString, sal_True, sal_False); // lokal interpretieren
+ SetString_Impl(aString, sal_True, false); // lokal interpretieren
}
else if ( pEntry->nWID == SC_WID_UNO_FORMRT )
{
@@ -6718,7 +6709,7 @@ void ScCellObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry,
if ( pEntry->nWID == SC_WID_UNO_FORMLOC )
{
// sal_False = lokal
- rAny <<= rtl::OUString( GetInputString_Impl(sal_False) );
+ rAny <<= rtl::OUString( GetInputString_Impl(false) );
}
else if ( pEntry->nWID == SC_WID_UNO_FORMRT )
{
@@ -6739,7 +6730,7 @@ const SfxItemPropertyMap* ScCellObj::GetItemPropertyMap()
rtl::OUString SAL_CALL ScCellObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScCellObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScCellObj" ));
}
sal_Bool SAL_CALL ScCellObj::supportsService( const rtl::OUString& rServiceName )
@@ -6764,13 +6755,13 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellObj::getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(7);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCSHEETCELL_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCCELL_SERVICE );
- pArray[2] = rtl::OUString::createFromAscii( SCCELLPROPERTIES_SERVICE );
- pArray[3] = rtl::OUString::createFromAscii( SCCHARPROPERTIES_SERVICE );
- pArray[4] = rtl::OUString::createFromAscii( SCPARAPROPERTIES_SERVICE );
- pArray[5] = rtl::OUString::createFromAscii( SCSHEETCELLRANGE_SERVICE );
- pArray[6] = rtl::OUString::createFromAscii( SCCELLRANGE_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSHEETCELL_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELL_SERVICE ));
+ pArray[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLPROPERTIES_SERVICE ));
+ pArray[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCHARPROPERTIES_SERVICE ));
+ pArray[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCPARAPROPERTIES_SERVICE ));
+ pArray[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSHEETCELLRANGE_SERVICE ));
+ pArray[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLRANGE_SERVICE ));
return aRet;
}
@@ -6778,13 +6769,13 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellObj::getSupportedServiceNames()
sal_Bool SAL_CALL ScCellObj::isActionLocked() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return nActionLockCount != 0;
}
void SAL_CALL ScCellObj::addActionLock() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!nActionLockCount)
{
if (pUnoText)
@@ -6792,7 +6783,7 @@ void SAL_CALL ScCellObj::addActionLock() throw(uno::RuntimeException)
ScSharedCellEditSource* pEditSource =
static_cast<ScSharedCellEditSource*> (pUnoText->GetEditSource());
if (pEditSource)
- pEditSource->SetDoUpdateData(sal_False);
+ pEditSource->SetDoUpdateData(false);
}
}
nActionLockCount++;
@@ -6800,7 +6791,7 @@ void SAL_CALL ScCellObj::addActionLock() throw(uno::RuntimeException)
void SAL_CALL ScCellObj::removeActionLock() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nActionLockCount > 0)
{
nActionLockCount--;
@@ -6823,7 +6814,7 @@ void SAL_CALL ScCellObj::removeActionLock() throw(uno::RuntimeException)
void SAL_CALL ScCellObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pUnoText)
{
ScSharedCellEditSource* pEditSource =
@@ -6840,7 +6831,7 @@ void SAL_CALL ScCellObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeExc
sal_Int16 SAL_CALL ScCellObj::resetActionLocks() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nRet(nActionLockCount);
if (pUnoText)
{
@@ -6960,11 +6951,12 @@ uno::Sequence<sal_Int8> SAL_CALL ScTableSheetObj::getImplementationId() throw(un
SCTAB ScTableSheetObj::GetTab_Impl() const
{
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT(rRanges.Count() == 1, "was fuer Ranges ?!?!");
- const ScRange* pFirst = rRanges.GetObject(0);
- if (pFirst)
+ DBG_ASSERT(rRanges.size() == 1, "was fuer Ranges ?!?!");
+ if ( !rRanges.empty() )
+ {
+ const ScRange* pFirst = rRanges[ 0 ];
return pFirst->aStart.Tab();
-
+ }
return 0; // soll nicht sein
}
@@ -6972,63 +6964,63 @@ SCTAB ScTableSheetObj::GetTab_Impl() const
uno::Reference<table::XTableCharts> SAL_CALL ScTableSheetObj::getCharts() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScChartsObj( pDocSh, GetTab_Impl() );
- DBG_ERROR("kein Dokument");
+ OSL_FAIL("kein Dokument");
return NULL;
}
uno::Reference<sheet::XDataPilotTables> SAL_CALL ScTableSheetObj::getDataPilotTables()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScDataPilotTablesObj( pDocSh, GetTab_Impl() );
- DBG_ERROR("kein Dokument");
+ OSL_FAIL("kein Dokument");
return NULL;
}
uno::Reference<sheet::XScenarios> SAL_CALL ScTableSheetObj::getScenarios() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScScenariosObj( pDocSh, GetTab_Impl() );
- DBG_ERROR("kein Dokument");
+ OSL_FAIL("kein Dokument");
return NULL;
}
uno::Reference<sheet::XSheetAnnotations> SAL_CALL ScTableSheetObj::getAnnotations()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScAnnotationsObj( pDocSh, GetTab_Impl() );
- DBG_ERROR("kein Dokument");
+ OSL_FAIL("kein Dokument");
return NULL;
}
uno::Reference<table::XCellRange> SAL_CALL ScTableSheetObj::getCellRangeByName(
const rtl::OUString& rRange ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScCellRangeObj::getCellRangeByName( rRange );
}
uno::Reference<sheet::XSheetCellCursor> SAL_CALL ScTableSheetObj::createCursor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7043,7 +7035,7 @@ uno::Reference<sheet::XSheetCellCursor> SAL_CALL ScTableSheetObj::createCursorBy
const uno::Reference<sheet::XSheetCellRange>& xCellRange )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh && xCellRange.is() )
{
@@ -7051,8 +7043,8 @@ uno::Reference<sheet::XSheetCellCursor> SAL_CALL ScTableSheetObj::createCursorBy
if (pRangesImp)
{
const ScRangeList& rRanges = pRangesImp->GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- return new ScCellCursorObj( pDocSh, *rRanges.GetObject(0) );
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ return new ScCellCursorObj( pDocSh, *rRanges[ 0 ] );
}
}
return NULL;
@@ -7063,7 +7055,7 @@ uno::Reference<sheet::XSheetCellCursor> SAL_CALL ScTableSheetObj::createCursorBy
uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTableSheetObj::getSpreadsheet()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return this; //!???
}
@@ -7073,7 +7065,7 @@ uno::Reference<table::XCell> SAL_CALL ScTableSheetObj::getCellByPosition(
sal_Int32 nColumn, sal_Int32 nRow )
throw(lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScCellRangeObj::GetCellByPosition_Impl(nColumn, nRow);
}
@@ -7081,14 +7073,14 @@ uno::Reference<table::XCellRange> SAL_CALL ScTableSheetObj::getCellRangeByPositi
sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom )
throw(lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScCellRangeObj::getCellRangeByPosition(nLeft,nTop,nRight,nBottom);
}
uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getColumnPageBreaks()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7134,7 +7126,7 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getColumnPage
uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getRowPageBreaks()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7157,7 +7149,7 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getRowPageBre
void SAL_CALL ScTableSheetObj::removeAllManualPageBreaks() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7171,7 +7163,7 @@ void SAL_CALL ScTableSheetObj::removeAllManualPageBreaks() throw(uno::RuntimeExc
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pUndoDoc );
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoRemoveBreaks( pDocSh, nTab, pUndoDoc ) );
}
@@ -7189,7 +7181,7 @@ void SAL_CALL ScTableSheetObj::removeAllManualPageBreaks() throw(uno::RuntimeExc
rtl::OUString SAL_CALL ScTableSheetObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aName;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -7200,7 +7192,7 @@ rtl::OUString SAL_CALL ScTableSheetObj::getName() throw(uno::RuntimeException)
void SAL_CALL ScTableSheetObj::setName( const rtl::OUString& aNewName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7215,7 +7207,7 @@ void SAL_CALL ScTableSheetObj::setName( const rtl::OUString& aNewName )
uno::Reference<drawing::XDrawPage> SAL_CALL ScTableSheetObj::getDrawPage()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7239,7 +7231,7 @@ uno::Reference<drawing::XDrawPage> SAL_CALL ScTableSheetObj::getDrawPage()
void SAL_CALL ScTableSheetObj::insertCells( const table::CellRangeAddress& rRangeAddress,
sheet::CellInsertMode nMode ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7247,14 +7239,14 @@ void SAL_CALL ScTableSheetObj::insertCells( const table::CellRangeAddress& rRang
InsCellCmd eCmd = INS_NONE;
switch (nMode)
{
- case sheet::CellInsertMode_NONE: bDo = sal_False; break;
+ case sheet::CellInsertMode_NONE: bDo = false; break;
case sheet::CellInsertMode_DOWN: eCmd = INS_CELLSDOWN; break;
case sheet::CellInsertMode_RIGHT: eCmd = INS_CELLSRIGHT; break;
case sheet::CellInsertMode_ROWS: eCmd = INS_INSROWS; break;
case sheet::CellInsertMode_COLUMNS: eCmd = INS_INSCOLS; break;
default:
- DBG_ERROR("insertCells: falscher Mode");
- bDo = sal_False;
+ OSL_FAIL("insertCells: falscher Mode");
+ bDo = false;
}
if (bDo)
@@ -7271,7 +7263,7 @@ void SAL_CALL ScTableSheetObj::insertCells( const table::CellRangeAddress& rRang
void SAL_CALL ScTableSheetObj::removeRange( const table::CellRangeAddress& rRangeAddress,
sheet::CellDeleteMode nMode ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7279,14 +7271,14 @@ void SAL_CALL ScTableSheetObj::removeRange( const table::CellRangeAddress& rRang
DelCellCmd eCmd = DEL_NONE;
switch (nMode)
{
- case sheet::CellDeleteMode_NONE: bDo = sal_False; break;
+ case sheet::CellDeleteMode_NONE: bDo = false; break;
case sheet::CellDeleteMode_UP: eCmd = DEL_CELLSUP; break;
case sheet::CellDeleteMode_LEFT: eCmd = DEL_CELLSLEFT; break;
case sheet::CellDeleteMode_ROWS: eCmd = DEL_DELROWS; break;
case sheet::CellDeleteMode_COLUMNS: eCmd = DEL_DELCOLS; break;
default:
- DBG_ERROR("deleteCells: falscher Mode");
- bDo = sal_False;
+ OSL_FAIL("deleteCells: falscher Mode");
+ bDo = false;
}
if (bDo)
@@ -7304,7 +7296,7 @@ void SAL_CALL ScTableSheetObj::moveRange( const table::CellAddress& aDestination
const table::CellRangeAddress& aSource )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7321,7 +7313,7 @@ void SAL_CALL ScTableSheetObj::copyRange( const table::CellAddress& aDestination
const table::CellRangeAddress& aSource )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7330,7 +7322,7 @@ void SAL_CALL ScTableSheetObj::copyRange( const table::CellAddress& aDestination
ScUnoConversion::FillScRange( aSourceRange, aSource );
ScAddress aDestPos( (SCCOL)aDestination.Column, (SCROW)aDestination.Row, aDestination.Sheet );
ScDocFunc aFunc(*pDocSh);
- aFunc.MoveBlock( aSourceRange, aDestPos, sal_False, sal_True, sal_True, sal_True );
+ aFunc.MoveBlock( aSourceRange, aDestPos, false, sal_True, sal_True, sal_True );
}
}
@@ -7369,7 +7361,7 @@ void ScTableSheetObj::PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges )
uno::Sequence<table::CellRangeAddress> SAL_CALL ScTableSheetObj::getPrintAreas()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7400,7 +7392,7 @@ void SAL_CALL ScTableSheetObj::setPrintAreas(
const uno::Sequence<table::CellRangeAddress>& aPrintAreas )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7428,7 +7420,7 @@ void SAL_CALL ScTableSheetObj::setPrintAreas(
sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleColumns() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7436,13 +7428,13 @@ sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleColumns() throw(uno::RuntimeExce
SCTAB nTab = GetTab_Impl();
return ( pDoc->GetRepeatColRange(nTab) != NULL );
}
- return sal_False;
+ return false;
}
void SAL_CALL ScTableSheetObj::setPrintTitleColumns( sal_Bool bPrintTitleColumns )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7470,7 +7462,7 @@ void SAL_CALL ScTableSheetObj::setPrintTitleColumns( sal_Bool bPrintTitleColumns
table::CellRangeAddress SAL_CALL ScTableSheetObj::getTitleColumns() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aRet;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -7490,7 +7482,7 @@ table::CellRangeAddress SAL_CALL ScTableSheetObj::getTitleColumns() throw(uno::R
void SAL_CALL ScTableSheetObj::setTitleColumns( const table::CellRangeAddress& aTitleColumns )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7509,7 +7501,7 @@ void SAL_CALL ScTableSheetObj::setTitleColumns( const table::CellRangeAddress& a
sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleRows() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7517,13 +7509,13 @@ sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleRows() throw(uno::RuntimeExcepti
SCTAB nTab = GetTab_Impl();
return ( pDoc->GetRepeatRowRange(nTab) != NULL );
}
- return sal_False;
+ return false;
}
void SAL_CALL ScTableSheetObj::setPrintTitleRows( sal_Bool bPrintTitleRows )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7551,7 +7543,7 @@ void SAL_CALL ScTableSheetObj::setPrintTitleRows( sal_Bool bPrintTitleRows )
table::CellRangeAddress SAL_CALL ScTableSheetObj::getTitleRows() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aRet;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -7571,7 +7563,7 @@ table::CellRangeAddress SAL_CALL ScTableSheetObj::getTitleRows() throw(uno::Runt
void SAL_CALL ScTableSheetObj::setTitleRows( const table::CellRangeAddress& aTitleRows )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7592,7 +7584,7 @@ void SAL_CALL ScTableSheetObj::setTitleRows( const table::CellRangeAddress& aTit
sheet::SheetLinkMode SAL_CALL ScTableSheetObj::getLinkMode() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sheet::SheetLinkMode eRet = sheet::SheetLinkMode_NONE;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -7609,7 +7601,7 @@ sheet::SheetLinkMode SAL_CALL ScTableSheetObj::getLinkMode() throw(uno::RuntimeE
void SAL_CALL ScTableSheetObj::setLinkMode( sheet::SheetLinkMode nLinkMode )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Filter und Options aus altem Link suchen
@@ -7622,7 +7614,7 @@ void SAL_CALL ScTableSheetObj::setLinkMode( sheet::SheetLinkMode nLinkMode )
rtl::OUString SAL_CALL ScTableSheetObj::getLinkUrl() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aFile;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -7633,7 +7625,7 @@ rtl::OUString SAL_CALL ScTableSheetObj::getLinkUrl() throw(uno::RuntimeException
void SAL_CALL ScTableSheetObj::setLinkUrl( const rtl::OUString& aLinkUrl )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Filter und Options aus altem Link suchen
@@ -7646,7 +7638,7 @@ void SAL_CALL ScTableSheetObj::setLinkUrl( const rtl::OUString& aLinkUrl )
rtl::OUString SAL_CALL ScTableSheetObj::getLinkSheetName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aSheet;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
@@ -7657,7 +7649,7 @@ rtl::OUString SAL_CALL ScTableSheetObj::getLinkSheetName() throw(uno::RuntimeExc
void SAL_CALL ScTableSheetObj::setLinkSheetName( const rtl::OUString& aLinkSheetName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Filter und Options aus altem Link suchen
@@ -7672,7 +7664,7 @@ void SAL_CALL ScTableSheetObj::link( const rtl::OUString& aUrl, const rtl::OUStr
const rtl::OUString& aFilterName, const rtl::OUString& aFilterOptions,
sheet::SheetLinkMode nMode ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7686,7 +7678,7 @@ void SAL_CALL ScTableSheetObj::link( const rtl::OUString& aUrl, const rtl::OUStr
aFileString = ScGlobal::GetAbsDocName( aFileString, pDocSh );
if ( !aFilterString.Len() )
- ScDocumentLoader::GetFilterName( aFileString, aFilterString, aOptString, sal_True, sal_False );
+ ScDocumentLoader::GetFilterName( aFileString, aFilterString, aOptString, sal_True, false );
// remove application prefix from filter name here, so the filter options
// aren't reset when the filter name is changed in ScTableLink::DataChanged
@@ -7738,7 +7730,7 @@ void SAL_CALL ScTableSheetObj::link( const rtl::OUString& aUrl, const rtl::OUStr
sal_Bool SAL_CALL ScTableSheetObj::hideDependents( const table::CellAddress& aPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7748,13 +7740,13 @@ sal_Bool SAL_CALL ScTableSheetObj::hideDependents( const table::CellAddress& aPo
ScDocFunc aFunc(*pDocSh);
return aFunc.DetectiveDelSucc( aPos );
}
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScTableSheetObj::hidePrecedents( const table::CellAddress& aPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7764,13 +7756,13 @@ sal_Bool SAL_CALL ScTableSheetObj::hidePrecedents( const table::CellAddress& aPo
ScDocFunc aFunc(*pDocSh);
return aFunc.DetectiveDelPred( aPos );
}
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScTableSheetObj::showDependents( const table::CellAddress& aPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7780,13 +7772,13 @@ sal_Bool SAL_CALL ScTableSheetObj::showDependents( const table::CellAddress& aPo
ScDocFunc aFunc(*pDocSh);
return aFunc.DetectiveAddSucc( aPos );
}
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScTableSheetObj::showPrecedents( const table::CellAddress& aPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7796,13 +7788,13 @@ sal_Bool SAL_CALL ScTableSheetObj::showPrecedents( const table::CellAddress& aPo
ScDocFunc aFunc(*pDocSh);
return aFunc.DetectiveAddPred( aPos );
}
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScTableSheetObj::showErrors( const table::CellAddress& aPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7812,24 +7804,24 @@ sal_Bool SAL_CALL ScTableSheetObj::showErrors( const table::CellAddress& aPositi
ScDocFunc aFunc(*pDocSh);
return aFunc.DetectiveAddError( aPos );
}
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScTableSheetObj::showInvalid() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
ScDocFunc aFunc(*pDocSh);
return aFunc.DetectiveMarkInvalid( GetTab_Impl() );
}
- return sal_False;
+ return false;
}
void SAL_CALL ScTableSheetObj::clearArrows() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7844,7 +7836,7 @@ void SAL_CALL ScTableSheetObj::group( const table::CellRangeAddress& rGroupRange
table::TableOrientation nOrientation )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7860,7 +7852,7 @@ void SAL_CALL ScTableSheetObj::ungroup( const table::CellRangeAddress& rGroupRan
table::TableOrientation nOrientation )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7875,7 +7867,7 @@ void SAL_CALL ScTableSheetObj::ungroup( const table::CellRangeAddress& rGroupRan
void SAL_CALL ScTableSheetObj::autoOutline( const table::CellRangeAddress& rCellRange )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7888,7 +7880,7 @@ void SAL_CALL ScTableSheetObj::autoOutline( const table::CellRangeAddress& rCell
void SAL_CALL ScTableSheetObj::clearOutline() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7901,7 +7893,7 @@ void SAL_CALL ScTableSheetObj::clearOutline() throw(uno::RuntimeException)
void SAL_CALL ScTableSheetObj::hideDetail( const table::CellRangeAddress& rCellRange )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7915,7 +7907,7 @@ void SAL_CALL ScTableSheetObj::hideDetail( const table::CellRangeAddress& rCellR
void SAL_CALL ScTableSheetObj::showDetail( const table::CellRangeAddress& rCellRange )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7929,7 +7921,7 @@ void SAL_CALL ScTableSheetObj::showDetail( const table::CellRangeAddress& rCellR
void SAL_CALL ScTableSheetObj::showLevel( sal_Int16 nLevel, table::TableOrientation nOrientation )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7945,7 +7937,7 @@ void SAL_CALL ScTableSheetObj::showLevel( sal_Int16 nLevel, table::TableOrientat
void SAL_CALL ScTableSheetObj::protect( const rtl::OUString& aPassword )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
// #i108245# if already protected, don't change anything
if ( pDocSh && !pDocSh->GetDocument()->IsTabProtected( GetTab_Impl() ) )
@@ -7959,7 +7951,7 @@ void SAL_CALL ScTableSheetObj::protect( const rtl::OUString& aPassword )
void SAL_CALL ScTableSheetObj::unprotect( const rtl::OUString& aPassword )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -7973,30 +7965,30 @@ void SAL_CALL ScTableSheetObj::unprotect( const rtl::OUString& aPassword )
sal_Bool SAL_CALL ScTableSheetObj::isProtected() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return pDocSh->GetDocument()->IsTabProtected( GetTab_Impl() );
- DBG_ERROR("keine DocShell"); //! Exception oder so?
- return sal_False;
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
+ return false;
}
// XScenario
sal_Bool SAL_CALL ScTableSheetObj::getIsScenario() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return pDocSh->GetDocument()->IsScenario( GetTab_Impl() );
- return sal_False;
+ return false;
}
rtl::OUString SAL_CALL ScTableSheetObj::getScenarioComment() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -8012,7 +8004,7 @@ rtl::OUString SAL_CALL ScTableSheetObj::getScenarioComment() throw(uno::RuntimeE
void SAL_CALL ScTableSheetObj::setScenarioComment( const rtl::OUString& aScenarioComment )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -8035,7 +8027,7 @@ void SAL_CALL ScTableSheetObj::setScenarioComment( const rtl::OUString& aScenari
void SAL_CALL ScTableSheetObj::addRanges( const uno::Sequence<table::CellRangeAddress>& rScenRanges )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -8068,55 +8060,12 @@ void SAL_CALL ScTableSheetObj::addRanges( const uno::Sequence<table::CellRangeAd
ScDocFunc aFunc(*pDocSh);
aFunc.ApplyAttributes( aMarkData, aPattern, sal_True, sal_True );
}
-
- // don't use. We should use therefor a private interface, so we can also set the flags.
-/* else if (nTab > 0 && pDoc->IsImportingXML()) // make this sheet as an scenario and only if it is not the first sheet and only if it is ImportingXML,
- // because than no UNDO and repaint is necessary.
- {
- sal_uInt16 nRangeCount = (sal_uInt16)rScenRanges.getLength();
- if (nRangeCount)
- {
- pDoc->SetScenario( nTab, sal_True );
-
- // default flags
- Color aColor( COL_LIGHTGRAY ); // Default
- sal_uInt16 nFlags = SC_SCENARIO_SHOWFRAME | SC_SCENARIO_PRINTFRAME | SC_SCENARIO_TWOWAY;
- String aComment;
-
- pDoc->SetScenarioData( nTab, aComment, aColor, nFlags );
- const table::CellRangeAddress* pAry = rScenRanges.getConstArray();
- for (sal_uInt16 i=0; i<nRangeCount; i++)
- {
- DBG_ASSERT( pAry[i].Sheet == nTab, "addRanges mit falscher Tab" );
- pDoc->ApplyFlagsTab( (sal_uInt16)pAry[i].StartColumn, (sal_uInt16)pAry[i].StartRow,
- (sal_uInt16)pAry[i].EndColumn, (sal_uInt16)pAry[i].EndRow, nTab, SC_MF_SCENARIO );
- }
- pDoc->SetActiveScenario( nTab, sal_True );
-
- // set to next visible tab
- sal_uInt16 j = nTab - 1;
- sal_Bool bFinished = sal_False;
- while (j < nTab && !bFinished)
- {
- if (pDoc->IsVisible(j))
- {
- pDoc->SetVisibleTab(j);
- bFinished = sal_True;
- }
- else
- --j;
- }
-
- ScDocFunc aFunc(*pDocSh);
- aFunc.SetTableVisible( nTab, sal_False, sal_True );
- }
- }*/
}
}
void SAL_CALL ScTableSheetObj::apply() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -8141,7 +8090,7 @@ void SAL_CALL ScTableSheetObj::apply() throw(uno::RuntimeException)
uno::Sequence< table::CellRangeAddress > SAL_CALL ScTableSheetObj::getRanges( )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -8150,12 +8099,12 @@ uno::Sequence< table::CellRangeAddress > SAL_CALL ScTableSheetObj::getRanges( )
const ScRangeList* pRangeList = pDoc->GetScenarioRanges(nTab);
if (pRangeList)
{
- sal_Int32 nCount = pRangeList->Count();
- uno::Sequence< table::CellRangeAddress > aRetRanges(nCount);
+ size_t nCount = pRangeList->size();
+ uno::Sequence< table::CellRangeAddress > aRetRanges( nCount );
table::CellRangeAddress* pAry = aRetRanges.getArray();
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ for( size_t nIndex = 0; nIndex < nCount; nIndex++ )
{
- const ScRange* pRange = pRangeList->GetObject( nIndex );
+ const ScRange* pRange = (*pRangeList)[nIndex];
pAry->StartColumn = pRange->aStart.Col();
pAry->StartRow = pRange->aStart.Row();
pAry->EndColumn = pRange->aEnd.Col();
@@ -8174,7 +8123,7 @@ uno::Sequence< table::CellRangeAddress > SAL_CALL ScTableSheetObj::getRanges( )
void ScTableSheetObj::setExternalName( const ::rtl::OUString& aUrl, const ::rtl::OUString& aSheetName )
throw (container::ElementExistException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -8184,7 +8133,7 @@ void ScTableSheetObj::setExternalName( const ::rtl::OUString& aUrl, const ::rtl:
const SCTAB nTab = GetTab_Impl();
const String aAbsDocName( ScGlobal::GetAbsDocName( aUrl, pDocSh ) );
const String aDocTabName( ScGlobal::GetDocTabName( aAbsDocName, aSheetName ) );
- if ( !pDoc->RenameTab( nTab, aDocTabName, sal_False /*bUpdateRef*/, sal_True /*bExternalDocument*/ ) )
+ if ( !pDoc->RenameTab( nTab, aDocTabName, false /*bUpdateRef*/, sal_True /*bExternalDocument*/ ) )
{
throw container::ElementExistException( ::rtl::OUString(), *this );
}
@@ -8196,7 +8145,7 @@ void ScTableSheetObj::setExternalName( const ::rtl::OUString& aUrl, const ::rtl:
uno::Reference<container::XNameReplace> SAL_CALL ScTableSheetObj::getEvents() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
return new ScSheetEventsObj( pDocSh, GetTab_Impl() );
@@ -8209,7 +8158,7 @@ uno::Reference<container::XNameReplace> SAL_CALL ScTableSheetObj::getEvents() th
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableSheetObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( pSheetPropSet->getPropertyMap() ));
return aRef;
@@ -8305,7 +8254,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
sal_uInt16 nFlags;
pDoc->GetName( nTab, aName );
pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
- sal_Bool bModify(sal_False);
+ sal_Bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
{
@@ -8338,7 +8287,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
sal_uInt16 nFlags;
pDoc->GetName( nTab, aName );
pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
- sal_Bool bModify(sal_False);
+ sal_Bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
{
@@ -8371,7 +8320,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
sal_uInt16 nFlags;
pDoc->GetName( nTab, aName );
pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
- sal_Bool bModify(sal_False);
+ sal_Bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
{
@@ -8404,7 +8353,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
sal_uInt16 nFlags;
pDoc->GetName( nTab, aName );
pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
- sal_Bool bModify(sal_False);
+ sal_Bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
{
@@ -8437,7 +8386,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
sal_uInt16 nFlags;
pDoc->GetName( nTab, aName );
pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
- sal_Bool bModify(sal_False);
+ sal_Bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
{
@@ -8470,7 +8419,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
sal_uInt16 nFlags;
pDoc->GetName( nTab, aName );
pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
- sal_Bool bModify(sal_False);
+ sal_Bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
{
@@ -8501,7 +8450,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
if (nValue == com::sun::star::text::WritingMode2::RL_TB)
aFunc.SetLayoutRTL(nTab, sal_True, sal_True);
else
- aFunc.SetLayoutRTL(nTab, sal_False, sal_True);
+ aFunc.SetLayoutRTL(nTab, false, sal_True);
}
}
else if ( pEntry->nWID == SC_WID_UNO_AUTOPRINT )
@@ -8695,7 +8644,7 @@ const SfxItemPropertyMap* ScTableSheetObj::GetItemPropertyMap()
rtl::OUString SAL_CALL ScTableSheetObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScTableSheetObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScTableSheetObj" ));
}
sal_Bool SAL_CALL ScTableSheetObj::supportsService( const rtl::OUString& rServiceName )
@@ -8716,13 +8665,13 @@ uno::Sequence<rtl::OUString> SAL_CALL ScTableSheetObj::getSupportedServiceNames(
{
uno::Sequence<rtl::OUString> aRet(7);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCSPREADSHEET_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCSHEETCELLRANGE_SERVICE );
- pArray[2] = rtl::OUString::createFromAscii( SCCELLRANGE_SERVICE );
- pArray[3] = rtl::OUString::createFromAscii( SCCELLPROPERTIES_SERVICE );
- pArray[4] = rtl::OUString::createFromAscii( SCCHARPROPERTIES_SERVICE );
- pArray[5] = rtl::OUString::createFromAscii( SCPARAPROPERTIES_SERVICE );
- pArray[6] = rtl::OUString::createFromAscii( SCLINKTARGET_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSPREADSHEET_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSHEETCELLRANGE_SERVICE ));
+ pArray[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLRANGE_SERVICE ));
+ pArray[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLPROPERTIES_SERVICE ));
+ pArray[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCHARPROPERTIES_SERVICE ));
+ pArray[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCPARAPROPERTIES_SERVICE ));
+ pArray[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCLINKTARGET_SERVICE ));
return aRet;
}
@@ -8741,7 +8690,6 @@ sal_Int64 SAL_CALL ScTableSheetObj::getSomething(
return ScCellRangeObj::getSomething( rId );
}
-// static
const uno::Sequence<sal_Int8>& ScTableSheetObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -8758,7 +8706,6 @@ const uno::Sequence<sal_Int8>& ScTableSheetObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScTableSheetObj* ScTableSheetObj::getImplementation( const uno::Reference<uno::XInterface> xObj )
{
ScTableSheetObj* pRet = NULL;
@@ -8831,7 +8778,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScTableColumnObj::getImplementationId() throw(u
rtl::OUString SAL_CALL ScTableColumnObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRange& rRange = GetRange();
DBG_ASSERT(rRange.aStart.Col() == rRange.aEnd.Col(), "too many columns");
@@ -8843,7 +8790,7 @@ rtl::OUString SAL_CALL ScTableColumnObj::getName() throw(uno::RuntimeException)
void SAL_CALL ScTableColumnObj::setName( const rtl::OUString& /* aNewName */ )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
throw uno::RuntimeException(); // read-only
}
@@ -8852,7 +8799,7 @@ void SAL_CALL ScTableColumnObj::setName( const rtl::OUString& /* aNewName */ )
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableColumnObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( pColPropSet->getPropertyMap() ));
return aRef;
@@ -8949,8 +8896,7 @@ void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
}
else if ( pEntry->nWID == SC_WID_UNO_CELLVIS )
{
- SCCOL nDummy;
- bool bHidden = pDoc->ColHidden(nCol, nTab, nDummy);
+ bool bHidden = pDoc->ColHidden(nCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( rAny, !bHidden );
}
else if ( pEntry->nWID == SC_WID_UNO_OWIDTH )
@@ -8996,7 +8942,7 @@ ScTableRowObj::~ScTableRowObj()
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableRowObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( pRowPropSet->getPropertyMap() ));
return aRef;
@@ -9036,7 +8982,7 @@ void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
{
// property is 1/100mm, row height is twips
nNewHeight = HMMToTwips(nNewHeight);
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, SC_SIZE_ORIGINAL,
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, SC_SIZE_ORIGINAL,
(sal_uInt16)nNewHeight, sal_True, sal_True );
}
}
@@ -9044,14 +8990,12 @@ void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
{
sal_Bool bVis = ScUnoHelpFunctions::GetBoolFromAny( aValue );
ScSizeMode eMode = bVis ? SC_SIZE_SHOW : SC_SIZE_DIRECT;
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True );
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True );
// SC_SIZE_DIRECT mit Groesse 0 blendet aus
}
else if ( pEntry->nWID == SC_WID_UNO_CELLFILT )
{
sal_Bool bFil = ScUnoHelpFunctions::GetBoolFromAny( aValue );
-// ScSizeMode eMode = bVis ? SC_SIZE_SHOW : SC_SIZE_DIRECT;
-// aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True );
// SC_SIZE_DIRECT mit Groesse 0 blendet aus
pDoc->SetRowFiltered(nRow, nRow, nTab, bFil);
}
@@ -9059,21 +9003,21 @@ void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
{
sal_Bool bOpt = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if (bOpt)
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, SC_SIZE_OPTIMAL, 0, sal_True, sal_True );
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, SC_SIZE_OPTIMAL, 0, sal_True, sal_True );
else
{
// set current height again manually
sal_uInt16 nHeight = pDoc->GetOriginalHeight( nRow, nTab );
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, SC_SIZE_ORIGINAL, nHeight, sal_True, sal_True );
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, SC_SIZE_ORIGINAL, nHeight, sal_True, sal_True );
}
}
else if ( pEntry->nWID == SC_WID_UNO_NEWPAGE || pEntry->nWID == SC_WID_UNO_MANPAGE )
{
sal_Bool bSet = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if (bSet)
- aFunc.InsertPageBreak( sal_False, rRange.aStart, sal_True, sal_True, sal_True );
+ aFunc.InsertPageBreak( false, rRange.aStart, sal_True, sal_True, sal_True );
else
- aFunc.RemovePageBreak( sal_False, rRange.aStart, sal_True, sal_True, sal_True );
+ aFunc.RemovePageBreak( false, rRange.aStart, sal_True, sal_True, sal_True );
}
else
ScCellRangeObj::SetOnePropertyValue(pEntry, aValue); // base class, no Item WID
@@ -9105,8 +9049,7 @@ void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
}
else if ( pEntry->nWID == SC_WID_UNO_CELLVIS )
{
- SCROW nDummy;
- bool bHidden = pDoc->RowHidden(nRow, nTab, nDummy);
+ bool bHidden = pDoc->RowHidden(nRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( rAny, !bHidden );
}
else if ( pEntry->nWID == SC_WID_UNO_CELLFILT )
@@ -9174,7 +9117,7 @@ void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
uno::Reference<container::XEnumeration> SAL_CALL ScCellsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScCellsEnumeration( pDocShell, aRanges );
return NULL;
@@ -9182,14 +9125,14 @@ uno::Reference<container::XEnumeration> SAL_CALL ScCellsObj::createEnumeration()
uno::Type SAL_CALL ScCellsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<table::XCell>*)0);
}
sal_Bool SAL_CALL ScCellsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bHas = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bHas = false;
if ( pDocShell )
{
//! schneller selber testen?
@@ -9206,17 +9149,17 @@ ScCellsEnumeration::ScCellsEnumeration(ScDocShell* pDocSh, const ScRangeList& rR
pDocShell( pDocSh ),
aRanges( rR ),
pMark( NULL ),
- bAtEnd( sal_False )
+ bAtEnd( false )
{
ScDocument* pDoc = pDocShell->GetDocument();
pDoc->AddUnoObject(*this);
- if ( aRanges.Count() == 0 )
- bAtEnd = sal_True;
+ if ( aRanges.empty() )
+ bAtEnd = true;
else
{
SCTAB nTab = 0;
- const ScRange* pFirst = aRanges.GetObject(0);
+ const ScRange* pFirst = aRanges[ 0 ];
if (pFirst)
nTab = pFirst->aStart.Tab();
aPos = ScAddress(0,0,nTab);
@@ -9228,7 +9171,7 @@ void ScCellsEnumeration::CheckPos_Impl()
{
if (pDocShell)
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
ScDocument* pDoc = pDocShell->GetDocument();
ScBaseCell* pCell = pDoc->GetCell(aPos);
if ( pCell && pCell->GetCellType() != CELLTYPE_NOTE )
@@ -9236,7 +9179,7 @@ void ScCellsEnumeration::CheckPos_Impl()
if (!pMark)
{
pMark = new ScMarkData;
- pMark->MarkFromRangeList( aRanges, sal_False );
+ pMark->MarkFromRangeList( aRanges, false );
pMark->MarkToMulti(); // needed for GetNextMarkedCell
}
bFound = pMark->IsCellMarked( aPos.Col(), aPos.Row() );
@@ -9259,7 +9202,7 @@ void ScCellsEnumeration::Advance_Impl()
if (!pMark)
{
pMark = new ScMarkData;
- pMark->MarkFromRangeList( aRanges, sal_False );
+ pMark->MarkFromRangeList( aRanges, false );
pMark->MarkToMulti(); // needed for GetNextMarkedCell
}
@@ -9292,9 +9235,9 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
aNew.Append(ScRange(aPos));
aNew.UpdateReference( rRef.GetMode(), pDocShell->GetDocument(), rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
- if (aNew.Count()==1)
+ if (aNew.size()==1)
{
- aPos = aNew.GetObject(0)->aStart;
+ aPos = aNew[ 0 ]->aStart;
CheckPos_Impl();
}
}
@@ -9311,14 +9254,14 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
sal_Bool SAL_CALL ScCellsEnumeration::hasMoreElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return !bAtEnd;
}
uno::Any SAL_CALL ScCellsEnumeration::nextElement() throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell && !bAtEnd)
{
// Interface-Typ muss zu ScCellsObj::getElementType passen
@@ -9329,7 +9272,6 @@ uno::Any SAL_CALL ScCellsEnumeration::nextElement() throw(container::NoSuchEleme
}
throw container::NoSuchElementException(); // no more elements
-// return uno::Any();
}
//------------------------------------------------------------------------
@@ -9399,7 +9341,7 @@ ScCellRangeObj* ScCellFormatsObj::GetObjectByIndex_Impl(long nIndex) const
sal_Int32 SAL_CALL ScCellFormatsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! direkt auf die AttrArrays zugreifen !!!!
@@ -9422,25 +9364,24 @@ uno::Any SAL_CALL ScCellFormatsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XCellRange> xRange(GetObjectByIndex_Impl(nIndex));
if (xRange.is())
return uno::makeAny(xRange);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScCellFormatsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<table::XCellRange>*)0);
}
sal_Bool SAL_CALL ScCellFormatsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 ); //! immer groesser 0 ??
}
@@ -9449,7 +9390,7 @@ sal_Bool SAL_CALL ScCellFormatsObj::hasElements() throw(uno::RuntimeException)
uno::Reference<container::XEnumeration> SAL_CALL ScCellFormatsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScCellFormatsEnumeration( pDocShell, aTotalRange );
return NULL;
@@ -9461,8 +9402,8 @@ ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScR
pDocShell( pDocSh ),
nTab( rRange.aStart.Tab() ),
pIter( NULL ),
- bAtEnd( sal_False ),
- bDirty( sal_False )
+ bAtEnd( false ),
+ bDirty( false )
{
ScDocument* pDoc = pDocShell->GetDocument();
pDoc->AddUnoObject(*this);
@@ -9492,7 +9433,7 @@ void ScCellFormatsEnumeration::Advance_Impl()
if ( bDirty )
{
pIter->DataChanged(); // AttrArray-Index neu suchen
- bDirty = sal_False;
+ bDirty = false;
}
SCCOL nCol1, nCol2;
@@ -9546,14 +9487,14 @@ void ScCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
sal_Bool SAL_CALL ScCellFormatsEnumeration::hasMoreElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return !bAtEnd;
}
uno::Any SAL_CALL ScCellFormatsEnumeration::nextElement() throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( bAtEnd || !pDocShell )
throw container::NoSuchElementException(); // no more elements
@@ -9611,7 +9552,7 @@ struct ScPatternHashCode
};
// Hash map to find a range by its start row
-typedef ::std::hash_map< SCROW, ScRange > ScRowRangeHashMap;
+typedef ::boost::unordered_map< SCROW, ScRange > ScRowRangeHashMap;
typedef ::std::vector<ScRange> ScRangeVector;
@@ -9730,7 +9671,7 @@ const ScRangeList& ScUniqueFormatsEntry::GetRanges()
return *aReturnRanges;
}
-typedef ::std::hash_map< const ScPatternAttr*, ScUniqueFormatsEntry, ScPatternHashCode > ScUniqueFormatsHashMap;
+typedef ::boost::unordered_map< const ScPatternAttr*, ScUniqueFormatsEntry, ScPatternHashCode > ScUniqueFormatsHashMap;
// function object to sort the range lists by start of first range
struct ScUniqueFormatsOrder
@@ -9738,10 +9679,10 @@ struct ScUniqueFormatsOrder
bool operator()( const ScRangeList& rList1, const ScRangeList& rList2 ) const
{
// all range lists have at least one entry
- DBG_ASSERT( rList1.Count() > 0 && rList2.Count() > 0, "ScUniqueFormatsOrder: empty list" );
+ DBG_ASSERT( rList1.size() > 0 && rList2.size() > 0, "ScUniqueFormatsOrder: empty list" );
// compare start positions using ScAddress comparison operator
- return ( rList1.GetObject(0)->aStart < rList2.GetObject(0)->aStart );
+ return ( rList1[ 0 ]->aStart < rList2[ 0 ]->aStart );
}
};
@@ -9793,7 +9734,7 @@ void ScUniqueCellFormatsObj::GetObjects_Impl()
sal_Int32 SAL_CALL ScUniqueCellFormatsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aRangeLists.size();
}
@@ -9802,24 +9743,23 @@ uno::Any SAL_CALL ScUniqueCellFormatsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if(static_cast<sal_uInt32>(nIndex) < aRangeLists.size())
return uno::makeAny(uno::Reference<sheet::XSheetCellRangeContainer>(new ScCellRangesObj(pDocShell, aRangeLists[nIndex])));
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScUniqueCellFormatsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XSheetCellRangeContainer>*)0);
}
sal_Bool SAL_CALL ScUniqueCellFormatsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( aRangeLists.size() != 0 );
}
@@ -9828,7 +9768,7 @@ sal_Bool SAL_CALL ScUniqueCellFormatsObj::hasElements() throw(uno::RuntimeExcept
uno::Reference<container::XEnumeration> SAL_CALL ScUniqueCellFormatsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScUniqueCellFormatsEnumeration( pDocShell, aRangeLists );
return NULL;
@@ -9868,14 +9808,14 @@ void ScUniqueCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHi
sal_Bool SAL_CALL ScUniqueCellFormatsEnumeration::hasMoreElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return static_cast<sal_uInt32>(nCurrentPosition) < aRangeLists.size();
}
uno::Any SAL_CALL ScUniqueCellFormatsEnumeration::nextElement() throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !hasMoreElements() || !pDocShell )
throw container::NoSuchElementException(); // no more elements
@@ -9885,4 +9825,4 @@ uno::Any SAL_CALL ScUniqueCellFormatsEnumeration::nextElement() throw(container:
return uno::makeAny(uno::Reference<sheet::XSheetCellRangeContainer>(new ScCellRangesObj(pDocShell, aRangeLists[nCurrentPosition++])));
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx
index 3b806ccf80b7..31d5417bf99e 100644
--- a/sc/source/ui/unoobj/cellvaluebinding.cxx
+++ b/sc/source/ui/unoobj/cellvaluebinding.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,7 +88,7 @@ namespace calc
,OCellValueBinding_PBase( OCellValueBinding_Base::rBHelper )
,m_xDocument( _rxDocument )
,m_aModifyListeners( m_aMutex )
- ,m_bInitialized( sal_False )
+ ,m_bInitialized( false )
,m_bListPos( _bListPos )
{
DBG_CTOR( OCellValueBinding, checkConsistency_static );
@@ -95,7 +96,7 @@ namespace calc
// register our property at the base class
CellAddress aInitialPropValue;
registerPropertyNoMember(
- ::rtl::OUString::createFromAscii( "BoundCell" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "BoundCell" )),
PROP_HANDLE_BOUND_CELL,
PropertyAttribute::BOUND | PropertyAttribute::READONLY,
::getCppuType( &aInitialPropValue ),
@@ -135,7 +136,6 @@ namespace calc
xBroadcaster->removeModifyListener( this );
}
-// OCellValueBinding_Base::disposing();
WeakAggComponentImplHelperBase::disposing();
// TODO: clean up here whatever you need to clean up (e.g. deregister as XEventListener
@@ -224,7 +224,7 @@ namespace calc
if ( aType.equals( *pTypes++ ) )
return sal_True;
- return sal_False;
+ return false;
}
//--------------------------------------------------------------------
@@ -252,7 +252,7 @@ namespace calc
{
// check if the cell has a numeric value (this might go into a helper function):
- sal_Bool bHasValue = sal_False;
+ sal_Bool bHasValue = false;
CellContentType eCellType = m_xCell->getType();
if ( eCellType == CellContentType_VALUE )
bHasValue = sal_True;
@@ -265,7 +265,7 @@ namespace calc
if ( xProp.is() )
{
CellContentType eResultType;
- if ( (xProp->getPropertyValue(::rtl::OUString::createFromAscii( "FormulaResultType" ) ) >>= eResultType) && eResultType == CellContentType_VALUE )
+ if ( (xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FormulaResultType" )) ) >>= eResultType) && eResultType == CellContentType_VALUE )
bHasValue = sal_True;
}
}
@@ -307,7 +307,7 @@ namespace calc
break;
default:
- DBG_ERROR( "OCellValueBinding::getValue: unreachable code!" );
+ OSL_FAIL( "OCellValueBinding::getValue: unreachable code!" );
// a type other than double and string should never have survived the checkValueType
// above
}
@@ -343,7 +343,7 @@ namespace calc
// boolean is stored as values 0 or 1
// TODO: set the number format to boolean if no format is set?
- sal_Bool bValue( sal_False );
+ sal_Bool bValue( false );
aValue >>= bValue;
double nCellValue = bValue ? 1.0 : 0.0;
@@ -393,7 +393,7 @@ namespace calc
break;
default:
- DBG_ERROR( "OCellValueBinding::setValue: unreachable code!" );
+ OSL_FAIL( "OCellValueBinding::setValue: unreachable code!" );
// a type other than double and string should never have survived the checkValueType
// above
}
@@ -403,7 +403,7 @@ namespace calc
{
// set boolean number format if not already set
- ::rtl::OUString sPropName( ::rtl::OUString::createFromAscii( "NumberFormat" ) );
+ ::rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "NumberFormat" ) );
Reference<XPropertySet> xCellProp( m_xCell, UNO_QUERY );
Reference<XNumberFormatsSupplier> xSupplier( m_xDocument, UNO_QUERY );
if ( xSupplier.is() && xCellProp.is() )
@@ -413,7 +413,7 @@ namespace calc
if ( xTypes.is() )
{
Locale aLocale;
- sal_Bool bWasBoolean = sal_False;
+ sal_Bool bWasBoolean = false;
sal_Int32 nOldIndex = ::comphelper::getINT32( xCellProp->getPropertyValue( sPropName ) );
Reference<XPropertySet> xOldFormat;
@@ -428,10 +428,10 @@ namespace calc
if ( xOldFormat.is() )
{
// use the locale of the existing format
- xOldFormat->getPropertyValue( ::rtl::OUString::createFromAscii( "Locale" ) ) >>= aLocale;
+ xOldFormat->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Locale" )) ) >>= aLocale;
sal_Int16 nOldType = ::comphelper::getINT16(
- xOldFormat->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) );
+ xOldFormat->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Type" )) ) );
if ( nOldType & NumberFormat::LOGICAL )
bWasBoolean = sal_True;
}
@@ -497,7 +497,7 @@ namespace calc
if ( *pLookup++ == _rServiceName )
return sal_True;
- return sal_False;
+ return false;
}
//--------------------------------------------------------------------
@@ -546,7 +546,7 @@ namespace calc
}
catch( const Exception& )
{
- DBG_ERROR( "OCellValueBinding::notifyModified: caught a (non-runtime) exception!" );
+ OSL_FAIL( "OCellValueBinding::notifyModified: caught a (non-runtime) exception!" );
}
}
}
@@ -582,7 +582,7 @@ namespace calc
// get the cell address
CellAddress aAddress;
- sal_Bool bFoundAddress = sal_False;
+ sal_Bool bFoundAddress = false;
const Any* pLoop = _rArguments.getConstArray();
const Any* pLoopEnd = _rArguments.getConstArray() + _rArguments.getLength();
@@ -591,7 +591,7 @@ namespace calc
NamedValue aValue;
if ( *pLoop >>= aValue )
{
- if ( aValue.Name.equalsAscii( "BoundCell" ) )
+ if ( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BoundCell" ) ) )
{
if ( aValue.Value >>= aAddress )
bFoundAddress = sal_True;
@@ -629,7 +629,7 @@ namespace calc
}
catch( const Exception& )
{
- DBG_ERROR( "OCellValueBinding::initialize: caught an exception while retrieving the cell object!" );
+ OSL_FAIL( "OCellValueBinding::initialize: caught an exception while retrieving the cell object!" );
}
if ( !m_xCell.is() )
@@ -661,3 +661,5 @@ namespace calc
//.........................................................................
} // namespace calc
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cellvaluebinding.hxx b/sc/source/ui/unoobj/cellvaluebinding.hxx
index c9537d546f7b..85334cd33c3b 100644
--- a/sc/source/ui/unoobj/cellvaluebinding.hxx
+++ b/sc/source/ui/unoobj/cellvaluebinding.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -169,3 +170,5 @@ namespace calc
//.........................................................................
#endif // SC_CELLVALUEBINDING_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 835959e68e3d..bac0a8f76d03 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,6 @@
#include "chart2uno.hxx"
#include "miscuno.hxx"
#include "document.hxx"
-#include "unoguard.hxx"
#include "cell.hxx"
#include "chartpos.hxx"
#include "unonames.hxx"
@@ -46,6 +46,7 @@
#include <sfx2/objsh.hxx>
#include <tools/table.hxx>
+#include <vcl/svapp.hxx>
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
@@ -82,7 +83,6 @@ using ::std::vector;
using ::std::list;
using ::std::distance;
using ::std::unary_function;
-using ::std::hash_set;
using ::boost::shared_ptr;
namespace
@@ -185,7 +185,7 @@ struct TokenTable
}
void clear()
{
- for_each(maTokens.begin(), maTokens.end(), DeleteInstance());
+ ::std::for_each(maTokens.begin(), maTokens.end(), DeleteInstance());
}
void push_back( FormulaToken* pToken )
@@ -203,19 +203,19 @@ struct TokenTable
return nRet;
}
- vector<ScSharedTokenRef>* getColRanges(SCCOL nCol) const;
- vector<ScSharedTokenRef>* getRowRanges(SCROW nRow) const;
- vector<ScSharedTokenRef>* getAllRanges() const;
+ vector<ScTokenRef>* getColRanges(SCCOL nCol) const;
+ vector<ScTokenRef>* getRowRanges(SCROW nRow) const;
+ vector<ScTokenRef>* getAllRanges() const;
};
-vector<ScSharedTokenRef>* TokenTable::getColRanges(SCCOL nCol) const
+vector<ScTokenRef>* TokenTable::getColRanges(SCCOL nCol) const
{
if (nCol >= mnColCount)
return NULL;
if( mnRowCount<=0 )
return NULL;
- auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+ auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>);
sal_uInt32 nLast = getIndex(nCol, mnRowCount-1);
for (sal_uInt32 i = getIndex(nCol, 0); i <= nLast; ++i)
{
@@ -223,20 +223,20 @@ vector<ScSharedTokenRef>* TokenTable::getColRanges(SCCOL nCol) const
if (!p)
continue;
- ScSharedTokenRef pCopy(static_cast<ScToken*>(p->Clone()));
+ ScTokenRef pCopy(static_cast<ScToken*>(p->Clone()));
ScRefTokenHelper::join(*pTokens, pCopy);
}
return pTokens.release();
}
-vector<ScSharedTokenRef>* TokenTable::getRowRanges(SCROW nRow) const
+vector<ScTokenRef>* TokenTable::getRowRanges(SCROW nRow) const
{
if (nRow >= mnRowCount)
return NULL;
if( mnColCount<=0 )
return NULL;
- auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+ auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>);
sal_uInt32 nLast = getIndex(mnColCount-1, nRow);
for (sal_uInt32 i = getIndex(0, nRow); i <= nLast; i += mnRowCount)
{
@@ -244,15 +244,15 @@ vector<ScSharedTokenRef>* TokenTable::getRowRanges(SCROW nRow) const
if (!p)
continue;
- ScSharedTokenRef p2(static_cast<ScToken*>(p->Clone()));
+ ScTokenRef p2(static_cast<ScToken*>(p->Clone()));
ScRefTokenHelper::join(*pTokens, p2);
}
return pTokens.release();
}
-vector<ScSharedTokenRef>* TokenTable::getAllRanges() const
+vector<ScTokenRef>* TokenTable::getAllRanges() const
{
- auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+ auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>);
sal_uInt32 nStop = mnColCount*mnRowCount;
for (sal_uInt32 i = 0; i < nStop; i++)
{
@@ -260,7 +260,7 @@ vector<ScSharedTokenRef>* TokenTable::getAllRanges() const
if (!p)
continue;
- ScSharedTokenRef p2(static_cast<ScToken*>(p->Clone()));
+ ScTokenRef p2(static_cast<ScToken*>(p->Clone()));
ScRefTokenHelper::join(*pTokens, p2);
}
return pTokens.release();
@@ -279,15 +279,15 @@ public:
SCCOL getDataColCount() const { return mnDataColCount; }
SCROW getDataRowCount() const { return mnDataRowCount; }
- vector<ScSharedTokenRef>* getLeftUpperCornerRanges() const;
- vector<ScSharedTokenRef>* getAllColHeaderRanges() const;
- vector<ScSharedTokenRef>* getAllRowHeaderRanges() const;
+ vector<ScTokenRef>* getLeftUpperCornerRanges() const;
+ vector<ScTokenRef>* getAllColHeaderRanges() const;
+ vector<ScTokenRef>* getAllRowHeaderRanges() const;
- vector<ScSharedTokenRef>* getColHeaderRanges(SCCOL nChartCol) const;
- vector<ScSharedTokenRef>* getRowHeaderRanges(SCROW nChartRow) const;
+ vector<ScTokenRef>* getColHeaderRanges(SCCOL nChartCol) const;
+ vector<ScTokenRef>* getRowHeaderRanges(SCROW nChartRow) const;
- vector<ScSharedTokenRef>* getDataColRanges(SCCOL nCol) const;
- vector<ScSharedTokenRef>* getDataRowRanges(SCROW nRow) const;
+ vector<ScTokenRef>* getDataColRanges(SCCOL nCol) const;
+ vector<ScTokenRef>* getDataRowRanges(SCROW nRow) const;
private:
SCCOL mnDataColCount;
@@ -332,7 +332,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount,
StackVar eType = pToken->GetType();
if( eType==svExternal || eType==svExternalSingleRef || eType==svExternalDoubleRef || eType==svExternalName )
bExternal = true;//lllll todo correct?
- ScSharedTokenRef pSharedToken(static_cast<ScToken*>(pToken->Clone()));
+ ScTokenRef pSharedToken(static_cast<ScToken*>(pToken->Clone()));
ScRefTokenHelper::getRangeFromToken(aRange, pSharedToken, bExternal );
SCCOL nCol1=0, nCol2=0;
SCROW nRow1=0, nRow2=0;
@@ -414,33 +414,33 @@ Chart2PositionMap::~Chart2PositionMap()
maData.clear();
}
-vector<ScSharedTokenRef>* Chart2PositionMap::getLeftUpperCornerRanges() const
+vector<ScTokenRef>* Chart2PositionMap::getLeftUpperCornerRanges() const
{
return maLeftUpperCorner.getAllRanges();
}
-vector<ScSharedTokenRef>* Chart2PositionMap::getAllColHeaderRanges() const
+vector<ScTokenRef>* Chart2PositionMap::getAllColHeaderRanges() const
{
return maColHeaders.getAllRanges();
}
-vector<ScSharedTokenRef>* Chart2PositionMap::getAllRowHeaderRanges() const
+vector<ScTokenRef>* Chart2PositionMap::getAllRowHeaderRanges() const
{
return maRowHeaders.getAllRanges();
}
-vector<ScSharedTokenRef>* Chart2PositionMap::getColHeaderRanges(SCCOL nCol) const
+vector<ScTokenRef>* Chart2PositionMap::getColHeaderRanges(SCCOL nCol) const
{
return maColHeaders.getColRanges( nCol);
}
-vector<ScSharedTokenRef>* Chart2PositionMap::getRowHeaderRanges(SCROW nRow) const
+vector<ScTokenRef>* Chart2PositionMap::getRowHeaderRanges(SCROW nRow) const
{
return maRowHeaders.getRowRanges( nRow);
}
-vector<ScSharedTokenRef>* Chart2PositionMap::getDataColRanges(SCCOL nCol) const
+vector<ScTokenRef>* Chart2PositionMap::getDataColRanges(SCCOL nCol) const
{
return maData.getColRanges( nCol);
}
-vector<ScSharedTokenRef>* Chart2PositionMap::getDataRowRanges(SCROW nRow) const
+vector<ScTokenRef>* Chart2PositionMap::getDataRowRanges(SCROW nRow) const
{
return maData.getRowRanges( nRow);
}
@@ -463,8 +463,8 @@ class Chart2Positioner
};
public:
- Chart2Positioner(ScDocument* pDoc, const vector<ScSharedTokenRef>& rRefTokens) :
- mpRefTokens(new vector<ScSharedTokenRef>(rRefTokens)),
+ Chart2Positioner(ScDocument* pDoc, const vector<ScTokenRef>& rRefTokens) :
+ mpRefTokens(new vector<ScTokenRef>(rRefTokens)),
mpPositionMap(NULL),
meGlue(GLUETYPE_NA),
mpDoc(pDoc),
@@ -501,7 +501,7 @@ private:
void createPositionMap();
private:
- shared_ptr< vector<ScSharedTokenRef> > mpRefTokens;
+ shared_ptr< vector<ScTokenRef> > mpRefTokens;
auto_ptr<Chart2PositionMap> mpPositionMap;
GlueType meGlue;
SCCOL mnStartCol;
@@ -526,7 +526,7 @@ void Chart2Positioner::glueState()
mbDummyUpperLeft = false;
if (mpRefTokens->size() <= 1)
{
- const ScSharedTokenRef& p = mpRefTokens->front();
+ const ScTokenRef& p = mpRefTokens->front();
ScComplexRefData aData;
if (ScRefTokenHelper::getDoubleRefDataFromToken(aData, p))
{
@@ -553,7 +553,7 @@ void Chart2Positioner::glueState()
SCCOL nMaxCols = 0, nEndCol = 0;
SCROW nMaxRows = 0, nEndRow = 0;
- for (vector<ScSharedTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end()
+ for (vector<ScTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end()
; itr != itrEnd; ++itr)
{
ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr);
@@ -617,7 +617,7 @@ void Chart2Positioner::glueState()
const sal_uInt8 nGlue = 3;
vector<sal_uInt8> aCellStates(nCR);
- for (vector<ScSharedTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
+ for (vector<ScTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
itr != itrEnd; ++itr)
{
ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr);
@@ -719,10 +719,10 @@ void Chart2Positioner::createPositionMap()
auto_ptr<Table> pNewRowTable(new Table);
Table* pCol = NULL;
SCROW nNoGlueRow = 0;
- for (vector<ScSharedTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
+ for (vector<ScTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
itr != itrEnd; ++itr)
{
- const ScSharedTokenRef& pToken = *itr;
+ const ScTokenRef& pToken = *itr;
bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0;
@@ -836,7 +836,7 @@ void Chart2Positioner::createPositionMap()
/**
* Function object to create a range string from a token list.
*/
-class Tokens2RangeString : public unary_function<ScSharedTokenRef, void>
+class Tokens2RangeString : public unary_function<ScTokenRef, void>
{
public:
Tokens2RangeString(ScDocument* pDoc, FormulaGrammar::Grammar eGram, sal_Unicode cRangeSep) :
@@ -857,7 +857,7 @@ public:
{
}
- void operator() (const ScSharedTokenRef& rToken)
+ void operator() (const ScTokenRef& rToken)
{
ScCompiler aCompiler(mpDoc, ScAddress(0,0,0));
aCompiler.SetGrammar(meGrammar);
@@ -894,7 +894,7 @@ private:
*
* and each address doesn't include any '$' symbols.
*/
-class Tokens2RangeStringXML : public unary_function<ScSharedTokenRef, void>
+class Tokens2RangeStringXML : public unary_function<ScTokenRef, void>
{
public:
Tokens2RangeStringXML(ScDocument* pDoc) :
@@ -915,14 +915,14 @@ public:
{
}
- void operator() (const ScSharedTokenRef& rToken)
+ void operator() (const ScTokenRef& rToken)
{
if (mbFirst)
mbFirst = false;
else
mpRangeStr->append(mcRangeSep);
- ScSharedTokenRef aStart, aEnd;
+ ScTokenRef aStart, aEnd;
splitRangeToken(rToken, aStart, aEnd);
ScCompiler aCompiler(mpDoc, ScAddress(0,0,0));
aCompiler.SetGrammar(FormulaGrammar::GRAM_ENGLISH);
@@ -947,7 +947,7 @@ public:
private:
Tokens2RangeStringXML(); // disabled
- void splitRangeToken(const ScSharedTokenRef& pToken, ScSharedTokenRef& rStart, ScSharedTokenRef& rEnd) const
+ void splitRangeToken(const ScTokenRef& pToken, ScTokenRef& rStart, ScTokenRef& rEnd) const
{
ScComplexRefData aData;
ScRefTokenHelper::getDoubleRefDataFromToken(aData, pToken);
@@ -988,12 +988,12 @@ private:
bool mbFirst;
};
-void lcl_convertTokensToString(OUString& rStr, const vector<ScSharedTokenRef>& rTokens, ScDocument* pDoc)
+void lcl_convertTokensToString(OUString& rStr, const vector<ScTokenRef>& rTokens, ScDocument* pDoc)
{
const sal_Unicode cRangeSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
FormulaGrammar::Grammar eGrammar = pDoc->GetGrammar();
Tokens2RangeString func(pDoc, eGrammar, cRangeSep);
- func = for_each(rTokens.begin(), rTokens.end(), func);
+ func = ::std::for_each(rTokens.begin(), rTokens.end(), func);
func.getString(rStr);
}
@@ -1029,7 +1029,7 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
::sal_Bool SAL_CALL ScChart2DataProvider::createDataSourcePossible( const uno::Sequence< beans::PropertyValue >& aArguments )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( ! m_pDocument )
return false;
@@ -1043,7 +1043,7 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
}
}
- vector<ScSharedTokenRef> aTokens;
+ vector<ScTokenRef> aTokens;
ScRefTokenHelper::compileRangeRepresentation(aTokens, aRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
return !aTokens.empty();
}
@@ -1051,7 +1051,7 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
namespace
{
-ScChart2LabeledDataSequence* lcl_createScChart2DataSequenceFromTokens( auto_ptr< vector<ScSharedTokenRef> > pValueTokens, auto_ptr< vector<ScSharedTokenRef> > pLabelTokens,
+ScChart2LabeledDataSequence* lcl_createScChart2DataSequenceFromTokens( auto_ptr< vector<ScTokenRef> > pValueTokens, auto_ptr< vector<ScTokenRef> > pLabelTokens,
ScDocument* pDoc, const uno::Reference < chart2::data::XDataProvider >& xDP, bool bIncludeHiddenCells )
{
ScChart2LabeledDataSequence* pRet = 0;
@@ -1084,7 +1084,7 @@ ScChart2LabeledDataSequence* lcl_createScChart2DataSequenceFromTokens( auto_ptr<
*
* @return true if the corner was added, false otherwise.
*/
-bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
+bool lcl_addUpperLeftCornerIfMissing(vector<ScTokenRef>& rRefTokens,
SCROW nCornerRowCount=1, SCCOL nCornerColumnCount=1)
{
using ::std::max;
@@ -1103,10 +1103,10 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
String aExtTabName;
bool bExternal = false;
- vector<ScSharedTokenRef>::const_iterator itr = rRefTokens.begin(), itrEnd = rRefTokens.end();
+ vector<ScTokenRef>::const_iterator itr = rRefTokens.begin(), itrEnd = rRefTokens.end();
// Get the first ref token.
- ScSharedTokenRef pToken = *itr;
+ ScTokenRef pToken = *itr;
switch (pToken->GetType())
{
case svSingleRef:
@@ -1309,53 +1309,6 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
// Not all the adjacent cells are included. Bail out.
return false;
-#if 0 // Do we really need to do this ???
- if (rRefTokens.size() == 2)
- {
- // Make a simple rectangular range if possible.
- ScRange aRightPart(ScAddress(nMinCol+1, nMinRow, nTab), ScAddress(nMaxCol, nMaxRow, nTab));
- ScRange aBottomPart(ScAddress(nMinCol, nMinRow+1, nTab), ScAddress(nMaxCol, nMaxRow, nTab));
- vector<ScRange> aRanges;
- aRanges.reserve(2);
- aRanges.push_back(aRightPart);
- aRanges.push_back(aBottomPart);
- if (lcl_isRangeContained(rRefTokens, aRanges))
- {
- // Consolidate them into a single rectangle.
- ScComplexRefData aData;
- aData.InitFlags();
- aData.Ref1.SetFlag3D(true);
- aData.Ref1.SetColRel(false);
- aData.Ref1.SetRowRel(false);
- aData.Ref1.SetTabRel(false);
- aData.Ref2.SetColRel(false);
- aData.Ref2.SetRowRel(false);
- aData.Ref2.SetTabRel(false);
- aData.Ref1.nCol = nMinCol;
- aData.Ref1.nRow = nMinRow;
- aData.Ref1.nTab = nTab;
- aData.Ref2.nCol = nMaxCol;
- aData.Ref2.nRow = nMaxRow;
- aData.Ref2.nTab = nTab;
- vector<ScSharedTokenRef> aNewTokens;
- aNewTokens.reserve(1);
- if (bExternal)
- {
- ScSharedTokenRef p(
- new ScExternalDoubleRefToken(nFileId, aExtTabName, aData));
- aNewTokens.push_back(p);
- }
- else
- {
- ScSharedTokenRef p(new ScDoubleRefToken(aData));
- aNewTokens.push_back(p);
- }
- rRefTokens.swap(aNewTokens);
- return true;
- }
- }
-#endif
-
ScSingleRefData aData;
aData.InitFlags();
aData.SetFlag3D(true);
@@ -1370,13 +1323,13 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
{
if (bExternal)
{
- ScSharedTokenRef pCorner(
+ ScTokenRef pCorner(
new ScExternalSingleRefToken(nFileId, aExtTabName, aData));
ScRefTokenHelper::join(rRefTokens, pCorner);
}
else
{
- ScSharedTokenRef pCorner(new ScSingleRefToken(aData));
+ ScTokenRef pCorner(new ScSingleRefToken(aData));
ScRefTokenHelper::join(rRefTokens, pCorner);
}
}
@@ -1390,13 +1343,13 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
r.Ref2=aDataEnd;
if (bExternal)
{
- ScSharedTokenRef pCorner(
+ ScTokenRef pCorner(
new ScExternalDoubleRefToken(nFileId, aExtTabName, r));
ScRefTokenHelper::join(rRefTokens, pCorner);
}
else
{
- ScSharedTokenRef pCorner(new ScDoubleRefToken(r));
+ ScTokenRef pCorner(new ScDoubleRefToken(r));
ScRefTokenHelper::join(rRefTokens, pCorner);
}
}
@@ -1411,7 +1364,7 @@ ScChart2DataProvider::createDataSource(
const uno::Sequence< beans::PropertyValue >& aArguments )
throw( lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( ! m_pDocument )
throw uno::RuntimeException();
@@ -1453,7 +1406,7 @@ ScChart2DataProvider::createDataSource(
}
}
- vector<ScSharedTokenRef> aRefTokens;
+ vector<ScTokenRef> aRefTokens;
ScRefTokenHelper::compileRangeRepresentation(aRefTokens, aRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
if (aRefTokens.empty())
// Invalid range representation. Bail out.
@@ -1479,13 +1432,13 @@ ScChart2DataProvider::createDataSource(
// Fill Categories
if( bCategories )
{
- auto_ptr< vector<ScSharedTokenRef> > pValueTokens(NULL);
+ auto_ptr< vector<ScTokenRef> > pValueTokens(NULL);
if (bOrientCol)
pValueTokens.reset(pChartMap->getAllRowHeaderRanges());
else
pValueTokens.reset(pChartMap->getAllColHeaderRanges());
- auto_ptr< vector<ScSharedTokenRef> > pLabelTokens(NULL);
+ auto_ptr< vector<ScTokenRef> > pLabelTokens(NULL);
pLabelTokens.reset(pChartMap->getLeftUpperCornerRanges());
ScChart2LabeledDataSequence* pCategories = lcl_createScChart2DataSequenceFromTokens( pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells );//ownership of pointers is transfered!
@@ -1497,8 +1450,8 @@ ScChart2DataProvider::createDataSource(
sal_Int32 nCount = bOrientCol ? pChartMap->getDataColCount() : pChartMap->getDataRowCount();
for (sal_Int32 i = 0; i < nCount; ++i)
{
- auto_ptr< vector<ScSharedTokenRef> > pValueTokens(NULL);
- auto_ptr< vector<ScSharedTokenRef> > pLabelTokens(NULL);
+ auto_ptr< vector<ScTokenRef> > pValueTokens(NULL);
+ auto_ptr< vector<ScTokenRef> > pLabelTokens(NULL);
if (bOrientCol)
{
pValueTokens.reset(pChartMap->getDataColRanges(static_cast<SCCOL>(i)));
@@ -1558,7 +1511,7 @@ namespace
/**
* Function object to create a list of table numbers from a token list.
*/
-class InsertTabNumber : public unary_function<ScSharedTokenRef, void>
+class InsertTabNumber : public unary_function<ScTokenRef, void>
{
public:
InsertTabNumber() :
@@ -1571,7 +1524,7 @@ public:
{
}
- void operator() (const ScSharedTokenRef& pToken) const
+ void operator() (const ScTokenRef& pToken) const
{
if (!ScRefTokenHelper::isRef(pToken))
return;
@@ -1592,7 +1545,7 @@ class RangeAnalyzer
{
public:
RangeAnalyzer();
- void initRangeAnalyzer( const vector<ScSharedTokenRef>& rTokens );
+ void initRangeAnalyzer( const vector<ScTokenRef>& rTokens );
void analyzeRange( sal_Int32& rnDataInRows, sal_Int32& rnDataInCols,
bool& rbRowSourceAmbiguous ) const;
bool inSameSingleRow( RangeAnalyzer& rOther );
@@ -1620,7 +1573,7 @@ RangeAnalyzer::RangeAnalyzer()
{
}
-void RangeAnalyzer::initRangeAnalyzer( const vector<ScSharedTokenRef>& rTokens )
+void RangeAnalyzer::initRangeAnalyzer( const vector<ScTokenRef>& rTokens )
{
mnRowCount=0;
mnColumnCount=0;
@@ -1634,10 +1587,10 @@ void RangeAnalyzer::initRangeAnalyzer( const vector<ScSharedTokenRef>& rTokens )
}
mbEmpty=false;
- vector<ScSharedTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+ vector<ScTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
for (; itr != itrEnd ; ++itr)
{
- ScSharedTokenRef aRefToken = *itr;
+ ScTokenRef aRefToken = *itr;
StackVar eVar = aRefToken->GetType();
if (eVar == svDoubleRef || eVar == svExternalDoubleRef)
{
@@ -1727,16 +1680,16 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
::rtl::OUString sRangeRep;
bool bHasCategoriesLabels = false;
- vector<ScSharedTokenRef> aAllCategoriesValuesTokens;
- vector<ScSharedTokenRef> aAllSeriesLabelTokens;
+ vector<ScTokenRef> aAllCategoriesValuesTokens;
+ vector<ScTokenRef> aAllSeriesLabelTokens;
chart::ChartDataRowSource eRowSource = chart::ChartDataRowSource_COLUMNS;
- vector<ScSharedTokenRef> aAllTokens;
+ vector<ScTokenRef> aAllTokens;
// parse given data source and collect infos
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
DBG_ASSERT( m_pDocument, "No Document -> no detectArguments" );
if(!m_pDocument ||!xDataSource.is())
return lcl_VectorToSequence( aResult );
@@ -1769,10 +1722,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
if( xLabel.is())
{
bFirstCellAsLabel = true;
- vector<ScSharedTokenRef> aTokens;
+ vector<ScTokenRef> aTokens;
ScRefTokenHelper::compileRangeRepresentation( aTokens, xLabel->getSourceRangeRepresentation(), m_pDocument, m_pDocument->GetGrammar() );
aLabel.initRangeAnalyzer(aTokens);
- vector<ScSharedTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
+ vector<ScTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
for (; itr != itrEnd; ++itr)
{
ScRefTokenHelper::join(aAllTokens, *itr);
@@ -1786,10 +1739,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
Reference< chart2::data::XDataSequence > xValues( xLS->getValues());
if( xValues.is())
{
- vector<ScSharedTokenRef> aTokens;
+ vector<ScTokenRef> aTokens;
ScRefTokenHelper::compileRangeRepresentation( aTokens, xValues->getSourceRangeRepresentation(), m_pDocument, m_pDocument->GetGrammar() );
aValues.initRangeAnalyzer(aTokens);
- vector<ScSharedTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
+ vector<ScTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
for (; itr != itrEnd; ++itr)
{
ScRefTokenHelper::join(aAllTokens, *itr);
@@ -1853,10 +1806,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
{
list<SCTAB> aTableNumList;
InsertTabNumber func;
- func = for_each(aAllTokens.begin(), aAllTokens.end(), func);
+ func = ::std::for_each(aAllTokens.begin(), aAllTokens.end(), func);
func.getList(aTableNumList);
aResult.push_back(
- beans::PropertyValue( ::rtl::OUString::createFromAscii("TableNumberList"), -1,
+ beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableNumberList")), -1,
uno::makeAny( lcl_createTableNumberList( aTableNumList ) ),
beans::PropertyState_DIRECT_VALUE ));
}
@@ -1865,7 +1818,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
if( bRowSourceDetected )
{
aResult.push_back(
- beans::PropertyValue( ::rtl::OUString::createFromAscii("DataRowSource"), -1,
+ beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataRowSource")), -1,
uno::makeAny( eRowSource ), beans::PropertyState_DIRECT_VALUE ));
}
@@ -1873,7 +1826,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
if( bRowSourceDetected )
{
aResult.push_back(
- beans::PropertyValue( ::rtl::OUString::createFromAscii("HasCategories"), -1,
+ beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1,
uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE ));
}
@@ -1881,7 +1834,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
if( bRowSourceDetected )
{
aResult.push_back(
- beans::PropertyValue( ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
+ beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstCellAsLabel")), -1,
uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE ));
}
@@ -1907,7 +1860,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
// add cell range property
aResult.push_back(
- beans::PropertyValue( ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
+ beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellRangeRepresentation")), -1,
uno::makeAny( sRangeRep ), beans::PropertyState_DIRECT_VALUE ));
//Sequence Mapping
@@ -1977,7 +1930,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
if( bDifferentIndexes && aSequenceMappingVector.size() )
{
aResult.push_back(
- beans::PropertyValue( ::rtl::OUString::createFromAscii("SequenceMapping"), -1,
+ beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SequenceMapping")), -1,
uno::makeAny( lcl_VectorToSequence(aSequenceMappingVector) )
, beans::PropertyState_DIRECT_VALUE ));
}
@@ -1989,11 +1942,11 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
::sal_Bool SAL_CALL ScChart2DataProvider::createDataSequenceByRangeRepresentationPossible( const ::rtl::OUString& aRangeRepresentation )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( ! m_pDocument )
return false;
- vector<ScSharedTokenRef> aTokens;
+ vector<ScTokenRef> aTokens;
ScRefTokenHelper::compileRangeRepresentation(aTokens, aRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
return !aTokens.empty();
}
@@ -2004,7 +1957,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL
throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< chart2::data::XDataSequence > xResult;
DBG_ASSERT( m_pDocument, "No Document -> no createDataSequenceByRangeRepresentation" );
@@ -2017,13 +1970,13 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL
// method to allow the client code to directly pass tokens representing
// ranges.
- vector<ScSharedTokenRef> aRefTokens;
+ vector<ScTokenRef> aRefTokens;
ScRefTokenHelper::compileRangeRepresentation(aRefTokens, aRangeRepresentation, m_pDocument);
if (aRefTokens.empty())
return xResult;
// ScChart2DataSequence manages the life cycle of pRefTokens.
- vector<ScSharedTokenRef>* pRefTokens = new vector<ScSharedTokenRef>();
+ vector<ScTokenRef>* pRefTokens = new vector<ScTokenRef>();
pRefTokens->swap(aRefTokens);
xResult.set(new ScChart2DataSequence(m_pDocument, this, pRefTokens, m_bIncludeHiddenCells));
@@ -2042,12 +1995,6 @@ uno::Reference< sheet::XRangeSelection > SAL_CALL ScChart2DataProvider::getRange
return xResult;
}
-/*uno::Reference< util::XNumberFormatsSupplier > SAL_CALL ScChart2DataProvider::getNumberFormatsSupplier()
- throw (uno::RuntimeException)
-{
- return uno::Reference< util::XNumberFormatsSupplier >( lcl_GetXModel( m_pDocument ), uno::UNO_QUERY );
-}*/
-
// XRangeXMLConversion ---------------------------------------------------
rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeToXML( const rtl::OUString& sRangeRepresentation )
@@ -2061,13 +2008,13 @@ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeToXML( const rtl::OUStr
// Empty data range is allowed.
return aRet;
- vector<ScSharedTokenRef> aRefTokens;
+ vector<ScTokenRef> aRefTokens;
ScRefTokenHelper::compileRangeRepresentation(aRefTokens, sRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
if (aRefTokens.empty())
throw lang::IllegalArgumentException();
Tokens2RangeStringXML converter(m_pDocument);
- converter = for_each(aRefTokens.begin(), aRefTokens.end(), converter);
+ converter = ::std::for_each(aRefTokens.begin(), aRefTokens.end(), converter);
converter.getString(aRet);
return aRet;
@@ -2123,7 +2070,7 @@ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeFromXML( const rtl::OUS
uno::Reference< beans::XPropertySetInfo> SAL_CALL
ScChart2DataProvider::getPropertySetInfo() throw( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef =
new SfxItemPropertySetInfo( m_aPropSet.getPropertyMap() );
return aRef;
@@ -2230,7 +2177,7 @@ void ScChart2DataSource::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence> > SAL_CALL
ScChart2DataSource::getDataSequences() throw ( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
LabeledList::const_iterator aItr(m_aLabeledSequences.begin());
LabeledList::const_iterator aEndItr(m_aLabeledSequences.end());
@@ -2246,74 +2193,6 @@ ScChart2DataSource::getDataSequences() throw ( uno::RuntimeException)
}
return aRet;
-
-/* typedef ::std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > tVec;
- tVec aVec;
- bool bSeries = false;
- // split into columns - FIXME: different if GlueState() is used
- for ( ScRangePtr p = m_xRanges->First(); p; p = m_xRanges->Next())
- {
- for ( SCCOL nCol = p->aStart.Col(); nCol <= p->aEnd.Col(); ++nCol)
- {
- uno::Reference< chart2::data::XLabeledDataSequence > xLabeledSeq(
- new ScChart2LabeledDataSequence( m_pDocument));
- if( xLabeledSeq.is())
- {
- aVec.push_back( xLabeledSeq );
- if( bSeries )
- {
- ScRangeListRef aColRanges = new ScRangeList;
- // one single sheet selected assumed for now
- aColRanges->Append( ScRange( nCol, p->aStart.Row(),
- p->aStart.Tab(), nCol, p->aStart.Row(),
- p->aStart.Tab()));
- // TEST: add range two times, once as label, once as data
- // TODO: create pure Numerical and Text sequences if possible
- uno::Reference< chart2::data::XDataSequence > xLabel(
- new ScChart2DataSequence( m_pDocument, aColRanges));
-
- // set role
- uno::Reference< beans::XPropertySet > xProp( xLabel, uno::UNO_QUERY );
- if( xProp.is())
- xProp->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Role" )),
- ::uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "label" ))));
-
- xLabeledSeq->setLabel( xLabel );
- }
-
- ScRangeListRef aColRanges = new ScRangeList;
-
- // one single sheet selected assumed for now
- aColRanges->Append( ScRange( nCol, p->aStart.Row() + 1,
- p->aStart.Tab(), nCol, p->aEnd.Row(),
- p->aStart.Tab()));
- uno::Reference< chart2::data::XDataSequence > xData(
- new ScChart2DataSequence( m_pDocument, aColRanges));
-
- // set role
- uno::Reference< beans::XPropertySet > xProp( xData, uno::UNO_QUERY );
- if( xProp.is())
- xProp->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Role" )),
- ::uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "values" ))));
-
- xLabeledSeq->setValues( xData );
-
- bSeries = true;
- }
- }
- }
- uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence> > aSequences(
- aVec.size());
- uno::Reference< chart2::data::XLabeledDataSequence> * pArr = aSequences.getArray();
- sal_Int32 j = 0;
- for ( tVec::const_iterator iSeq = aVec.begin(); iSeq != aVec.end();
- ++iSeq, ++j)
- {
- pArr[j] = *iSeq;
- }
- return aSequences;*/
}
void ScChart2DataSource::AddLabeledSequence(const uno::Reference < chart2::data::XLabeledDataSequence >& xNew)
@@ -2344,7 +2223,7 @@ void ScChart2LabeledDataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint
if ( rHint.ISA( SfxSimpleHint ) &&
((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
m_pDocument = NULL;
}
}
@@ -2354,7 +2233,7 @@ void ScChart2LabeledDataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint
uno::Reference< chart2::data::XDataSequence > SAL_CALL ScChart2LabeledDataSequence::getValues()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return m_aData;
}
@@ -2362,14 +2241,14 @@ void SAL_CALL ScChart2LabeledDataSequence::setValues(
const uno::Reference< chart2::data::XDataSequence >& xSequence )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
m_aData = xSequence;
}
uno::Reference< chart2::data::XDataSequence > SAL_CALL ScChart2LabeledDataSequence::getLabel()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return m_aLabel;
}
@@ -2377,7 +2256,7 @@ void SAL_CALL ScChart2LabeledDataSequence::setLabel(
const uno::Reference< chart2::data::XDataSequence >& xSequence )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
m_aLabel = xSequence;
}
@@ -2386,7 +2265,7 @@ void SAL_CALL ScChart2LabeledDataSequence::setLabel(
uno::Reference< util::XCloneable > SAL_CALL ScChart2LabeledDataSequence::createClone()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< util::XCloneable > xToClone(m_aData, uno::UNO_QUERY);
if (xToClone.is())
{
@@ -2454,7 +2333,7 @@ void ScChart2DataSequence::HiddenRangeListener::notify()
ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
const uno::Reference < chart2::data::XDataProvider >& xDP,
- vector<ScSharedTokenRef>* pTokens,
+ vector<ScTokenRef>* pTokens,
bool bIncludeHiddenCells )
: m_bIncludeHiddenCells( bIncludeHiddenCells)
, m_nObjectId( 0 )
@@ -2484,7 +2363,7 @@ ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
// rRangeList->Format( aStr, SCR_ABS_3D, m_pDocument );
// m_aIdentifier = ::rtl::OUString( aStr );
-// m_aIdentifier = ::rtl::OUString::createFromAscii( "ID_");
+// m_aIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ID_"));
// static sal_Int32 nID = 0;
// m_aIdentifier += ::rtl::OUString::valueOf( ++nID);
}
@@ -2522,7 +2401,7 @@ void ScChart2DataSequence::RefChanged()
pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
}
- vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+ vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
for (; itr != itrEnd; ++itr)
{
ScRange aRange;
@@ -2546,7 +2425,7 @@ void ScChart2DataSequence::BuildDataCache()
if (!m_pTokens.get())
{
- DBG_ERROR("m_pTokens == NULL! Something is wrong.");
+ OSL_FAIL("m_pTokens == NULL! Something is wrong.");
return;
}
@@ -2556,7 +2435,7 @@ void ScChart2DataSequence::BuildDataCache()
sal_Int32 nDataCount = 0;
sal_Int32 nHiddenValueCount = 0;
- for (vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+ for (vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
itr != itrEnd; ++itr)
{
if (ScRefTokenHelper::isExternalRef(*itr))
@@ -2577,8 +2456,8 @@ void ScChart2DataSequence::BuildDataCache()
{
for (SCROW nRow = aRange.aStart.Row(); nRow <= aRange.aEnd.Row(); ++nRow)
{
- bool bColHidden = m_pDocument->ColHidden(nCol, nTab, nLastCol);
- bool bRowHidden = m_pDocument->RowHidden(nRow, nTab, nLastRow);
+ bool bColHidden = m_pDocument->ColHidden(nCol, nTab, NULL, &nLastCol);
+ bool bRowHidden = m_pDocument->RowHidden(nRow, nTab, NULL, &nLastRow);
if (bColHidden || bRowHidden)
{
@@ -2667,7 +2546,7 @@ void ScChart2DataSequence::RebuildDataCache()
}
}
-sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScSharedTokenRef& pToken)
+sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToken)
{
ScExternalRefManager* pRefMgr = m_pDocument->GetExternalRefManager();
ScRange aRange;
@@ -2697,7 +2576,7 @@ sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScSharedTokenRef&
if (p->GetType() != svMatrix)
{
- DBG_ERROR("Cached array is not a matrix token.");
+ OSL_FAIL("Cached array is not a matrix token.");
continue;
}
@@ -2755,11 +2634,10 @@ void ScChart2DataSequence::UpdateTokensFromRanges(const ScRangeList& rRanges)
if (!m_pRangeIndices.get())
return;
- sal_uInt32 nCount = rRanges.Count();
- for (sal_uInt32 i = 0; i < nCount; ++i)
+ for ( size_t i = 0, nCount = rRanges.size(); i < nCount; ++i )
{
- ScSharedTokenRef pToken;
- ScRange* pRange = static_cast<ScRange*>(rRanges.GetObject(i));
+ ScTokenRef pToken;
+ const ScRange* pRange = rRanges[i];
DBG_ASSERT(pRange, "range object is NULL.");
ScRefTokenHelper::getTokenFromRange(pToken, *pRange);
@@ -2787,8 +2665,8 @@ void ScChart2DataSequence::StopListeningToAllExternalRefs()
if (!m_pExtRefListener.get())
return;
- const hash_set<sal_uInt16>& rFileIds = m_pExtRefListener->getAllFileIds();
- hash_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
+ const boost::unordered_set<sal_uInt16>& rFileIds = m_pExtRefListener->getAllFileIds();
+ boost::unordered_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
ScExternalRefManager* pRefMgr = m_pDocument->GetExternalRefManager();
for (; itr != itrEnd; ++itr)
pRefMgr->removeLinkListener(*itr, m_pExtRefListener.get());
@@ -2800,7 +2678,7 @@ void ScChart2DataSequence::CopyData(const ScChart2DataSequence& r)
{
if (!m_pDocument)
{
- DBG_ERROR("document instance is NULL!?");
+ OSL_FAIL("document instance is NULL!?");
return;
}
@@ -2820,8 +2698,8 @@ void ScChart2DataSequence::CopyData(const ScChart2DataSequence& r)
ScExternalRefManager* pRefMgr = m_pDocument->GetExternalRefManager();
m_pExtRefListener.reset(new ExternalRefListener(*this, m_pDocument));
- const hash_set<sal_uInt16>& rFileIds = r.m_pExtRefListener->getAllFileIds();
- hash_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
+ const boost::unordered_set<sal_uInt16>& rFileIds = r.m_pExtRefListener->getAllFileIds();
+ boost::unordered_set<sal_uInt16>::const_iterator itr = rFileIds.begin(), itrEnd = rFileIds.end();
for (; itr != itrEnd; ++itr)
{
pRefMgr->addLinkListener(*itr, m_pExtRefListener.get());
@@ -2874,8 +2752,8 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
ScRangeList aRanges;
m_pRangeIndices.reset(new vector<sal_uInt32>());
- vector<ScSharedTokenRef>::const_iterator itrBeg = m_pTokens->begin(), itrEnd = m_pTokens->end();
- for (vector<ScSharedTokenRef>::const_iterator itr = itrBeg ;itr != itrEnd; ++itr)
+ vector<ScTokenRef>::const_iterator itrBeg = m_pTokens->begin(), itrEnd = m_pTokens->end();
+ for (vector<ScTokenRef>::const_iterator itr = itrBeg ;itr != itrEnd; ++itr)
{
if (!ScRefTokenHelper::isExternalRef(*itr))
{
@@ -2887,7 +2765,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
}
}
- DBG_ASSERT(m_pRangeIndices->size() == static_cast<size_t>(aRanges.Count()),
+ DBG_ASSERT(m_pRangeIndices->size() == static_cast<size_t>(aRanges.size()),
"range list and range index list have different sizes.");
auto_ptr<ScRangeList> pUndoRanges;
@@ -2900,7 +2778,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
if (bChanged)
{
- DBG_ASSERT(m_pRangeIndices->size() == static_cast<size_t>(aRanges.Count()),
+ DBG_ASSERT(m_pRangeIndices->size() == aRanges.size(),
"range list and range index list have different sizes after the reference update.");
// Bring the change back from the range list to the token list.
@@ -2924,16 +2802,16 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
if (!m_pRangeIndices.get() || m_pRangeIndices->empty())
{
- DBG_ERROR(" faulty range indices");
+ OSL_FAIL(" faulty range indices");
break;
}
const ScRangeList& rRanges = rUndoHint.GetRanges();
- sal_uInt32 nCount = rRanges.Count();
+ size_t nCount = rRanges.size();
if (nCount != m_pRangeIndices->size())
{
- DBG_ERROR("range count and range index count differ.");
+ OSL_FAIL("range count and range index count differ.");
break;
}
@@ -3005,7 +2883,7 @@ void ScChart2DataSequence::ExternalRefListener::removeFileId(sal_uInt16 nFileId)
maFileIds.erase(nFileId);
}
-const hash_set<sal_uInt16>& ScChart2DataSequence::ExternalRefListener::getAllFileIds()
+const boost::unordered_set<sal_uInt16>& ScChart2DataSequence::ExternalRefListener::getAllFileIds()
{
return maFileIds;
}
@@ -3015,7 +2893,7 @@ const hash_set<sal_uInt16>& ScChart2DataSequence::ExternalRefListener::getAllFil
uno::Sequence< uno::Any> SAL_CALL ScChart2DataSequence::getData()
throw ( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument)
throw uno::RuntimeException();
@@ -3045,7 +2923,7 @@ uno::Sequence< uno::Any> SAL_CALL ScChart2DataSequence::getData()
uno::Sequence< double > SAL_CALL ScChart2DataSequence::getNumericalData()
throw ( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument)
throw uno::RuntimeException();
@@ -3068,7 +2946,7 @@ uno::Sequence< double > SAL_CALL ScChart2DataSequence::getNumericalData()
uno::Sequence< rtl::OUString > SAL_CALL ScChart2DataSequence::getTextualData( ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument)
throw uno::RuntimeException();
@@ -3087,7 +2965,7 @@ uno::Sequence< rtl::OUString > SAL_CALL ScChart2DataSequence::getTextualData( )
::rtl::OUString SAL_CALL ScChart2DataSequence::getSourceRangeRepresentation()
throw ( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
OUString aStr;
DBG_ASSERT( m_pDocument, "No Document -> no SourceRangeRepresentation" );
if (m_pDocument && m_pTokens.get())
@@ -3102,7 +2980,7 @@ namespace {
* This function object is used to accumulatively count the numbers of
* columns and rows in all reference tokens.
*/
-class AccumulateRangeSize : public unary_function<ScSharedTokenRef, void>
+class AccumulateRangeSize : public unary_function<ScTokenRef, void>
{
public:
AccumulateRangeSize() :
@@ -3111,7 +2989,7 @@ public:
AccumulateRangeSize(const AccumulateRangeSize& r) :
mnCols(r.mnCols), mnRows(r.mnRows) {}
- void operator() (const ScSharedTokenRef& pToken)
+ void operator() (const ScTokenRef& pToken)
{
ScRange r;
bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
@@ -3132,7 +3010,7 @@ private:
* This function object is used to generate label strings from a list of
* reference tokens.
*/
-class GenerateLabelStrings : public unary_function<ScSharedTokenRef, void>
+class GenerateLabelStrings : public unary_function<ScTokenRef, void>
{
public:
GenerateLabelStrings(sal_Int32 nSize, chart2::data::LabelOrigin eOrigin, bool bColumn) :
@@ -3147,7 +3025,7 @@ public:
mnCount(r.mnCount),
mbColumn(r.mbColumn) {}
- void operator() (const ScSharedTokenRef& pToken)
+ void operator() (const ScTokenRef& pToken)
{
bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
ScRange aRange;
@@ -3206,7 +3084,7 @@ private:
uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2DataSequence::generateLabel(chart2::data::LabelOrigin eOrigin)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument)
throw uno::RuntimeException();
@@ -3215,7 +3093,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2DataSequence::generateLabel(ch
// Determine the total size of all ranges.
AccumulateRangeSize func;
- func = for_each(m_pTokens->begin(), m_pTokens->end(), func);
+ func = ::std::for_each(m_pTokens->begin(), m_pTokens->end(), func);
SCCOL nCols = func.getCols();
SCROW nRows = func.getRows();
@@ -3245,7 +3123,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2DataSequence::generateLabel(ch
// Generate label strings based on the info so far.
sal_Int32 nCount = bColumn ? nCols : nRows;
GenerateLabelStrings genLabels(nCount, eOrigin, bColumn);
- genLabels = for_each(m_pTokens->begin(), m_pTokens->end(), genLabels);
+ genLabels = ::std::for_each(m_pTokens->begin(), m_pTokens->end(), genLabels);
Sequence<OUString> aSeq = genLabels.getLabels();
return aSeq;
@@ -3259,13 +3137,13 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2DataSequence::generateLabel(ch
bool bGetSeriesFormat = (nIndex == -1);
sal_Int32 nResult = 0;
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument || !m_pTokens.get())
return nResult;
sal_Int32 nCount = 0;
bool bFound = false;
- ScRangePtr p;
+ ScRange* p;
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( lcl_GetSpreadSheetDocument( m_pDocument ));
if (!xSpreadDoc.is())
@@ -3278,8 +3156,9 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2DataSequence::generateLabel(ch
ScRangeList aRanges;
ScRefTokenHelper::getRangeListFromTokens(aRanges, *m_pTokens);
uno::Reference< table::XCellRange > xSheet;
- for ( p = aRanges.First(); p && !bFound; p = aRanges.Next())
+ for ( size_t rIndex = 0, nRanges = aRanges.size(); (rIndex < nRanges) && !bFound; ++rIndex )
{
+ p = aRanges[ rIndex ];
// TODO: use DocIter?
table::CellAddress aStart, aEnd;
ScUnoConversion::FillApiAddress( aStart, p->aStart );
@@ -3331,18 +3210,18 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2DataSequence::generateLabel(ch
uno::Reference< util::XCloneable > SAL_CALL ScChart2DataSequence::createClone()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- auto_ptr< vector<ScSharedTokenRef> > pTokensNew;
+ auto_ptr< vector<ScTokenRef> > pTokensNew;
if (m_pTokens.get())
{
// Clone tokens.
- pTokensNew.reset(new vector<ScSharedTokenRef>);
+ pTokensNew.reset(new vector<ScTokenRef>);
pTokensNew->reserve(m_pTokens->size());
- vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+ vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
for (; itr != itrEnd; ++itr)
{
- ScSharedTokenRef p(static_cast<ScToken*>((*itr)->Clone()));
+ ScTokenRef p(static_cast<ScToken*>((*itr)->Clone()));
pTokensNew->push_back(p);
}
}
@@ -3360,7 +3239,7 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
throw (uno::RuntimeException)
{
// like ScCellRangesBase::addModifyListener
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!m_pTokens.get() || m_pTokens->empty())
return;
@@ -3381,7 +3260,7 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
if( m_pDocument )
{
ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
- vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+ vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
for (; itr != itrEnd; ++itr)
{
ScRange aRange;
@@ -3403,7 +3282,7 @@ void SAL_CALL ScChart2DataSequence::removeModifyListener( const uno::Reference<
{
// like ScCellRangesBase::removeModifyListener
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!m_pTokens.get() || m_pTokens->empty())
return;
@@ -3444,7 +3323,7 @@ void SAL_CALL ScChart2DataSequence::removeModifyListener( const uno::Reference<
uno::Reference< beans::XPropertySetInfo> SAL_CALL
ScChart2DataSequence::getPropertySetInfo() throw( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef =
new SfxItemPropertySetInfo( m_aPropSet.getPropertyMap() );
return aRef;
@@ -3508,7 +3387,6 @@ void SAL_CALL ScChart2DataSequence::addPropertyChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
@@ -3520,7 +3398,6 @@ void SAL_CALL ScChart2DataSequence::removePropertyChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
@@ -3532,7 +3409,6 @@ void SAL_CALL ScChart2DataSequence::addVetoableChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
@@ -3544,7 +3420,6 @@ void SAL_CALL ScChart2DataSequence::removeVetoableChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
@@ -3553,46 +3428,6 @@ void ScChart2DataSequence::setDataChangedHint(bool b)
m_bGotDataChangedHint = b;
}
-// XUnoTunnel
-
-// sal_Int64 SAL_CALL ScChart2DataSequence::getSomething(
-// const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
-// {
-// if ( rId.getLength() == 16 &&
-// 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
-// rId.getConstArray(), 16 ) )
-// {
-// return (sal_Int64)this;
-// }
-// return 0;
-// }
-
-// // static
-// const uno::Sequence<sal_Int8>& ScChart2DataSequence::getUnoTunnelId()
-// {
-// static uno::Sequence<sal_Int8> * pSeq = 0;
-// if( !pSeq )
-// {
-// osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
-// if( !pSeq )
-// {
-// static uno::Sequence< sal_Int8 > aSeq( 16 );
-// rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-// pSeq = &aSeq;
-// }
-// }
-// return *pSeq;
-// }
-
-// // static
-// ScChart2DataSequence* ScChart2DataSequence::getImplementation( const uno::Reference<uno::XInterface> xObj )
-// {
-// ScChart2DataSequence* pRet = NULL;
-// uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY );
-// if (xUT.is())
-// pRet = (ScChart2DataSequence*) xUT->getSomething( getUnoTunnelId() );
-// return pRet;
-// }
#if USE_CHART2_EMPTYDATASEQUENCE
// DataSequence ==============================================================
@@ -3618,7 +3453,7 @@ ScChart2EmptyDataSequence::ScChart2EmptyDataSequence( ScDocument* pDoc,
// rRangeList->Format( aStr, SCR_ABS_3D, m_pDocument );
// m_aIdentifier = ::rtl::OUString( aStr );
-// m_aIdentifier = ::rtl::OUString::createFromAscii( "ID_");
+// m_aIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ID_"));
// static sal_Int32 nID = 0;
// m_aIdentifier += ::rtl::OUString::valueOf( ++nID);
}
@@ -3644,7 +3479,7 @@ void ScChart2EmptyDataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint&
uno::Sequence< uno::Any> SAL_CALL ScChart2EmptyDataSequence::getData()
throw ( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument)
throw uno::RuntimeException();
return uno::Sequence< uno::Any>();
@@ -3654,12 +3489,12 @@ uno::Sequence< uno::Any> SAL_CALL ScChart2EmptyDataSequence::getData()
uno::Sequence< rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::getTextualData( ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument)
throw uno::RuntimeException();
sal_Int32 nCount = 0;
- ScRangePtr p;
+ ScRange* p;
DBG_ASSERT(m_xRanges->Count() == 1, "not handled count of ranges");
@@ -3690,14 +3525,9 @@ uno::Sequence< rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::getTextualDat
}
else
{
- for (sal_Int32 nRow = p->aStart.Row(); nRow <= p->aEnd.Row(); ++nRow)
- {
- String aString = ScGlobal::GetRscString(STR_ROW);
- aString += ' ';
- aString += String::CreateFromInt32( nRow+1 );
- pArr[nCount] = aString;
- ++nCount;
- }
+ sal_Int32 n = p->aEnd.Row() - p->aStart.Row() + 1;
+ for (sal_Int32 i = 0; i < n; ++i)
+ pArr[nCount++] = String::CreateFromInt32( i+1 );
}
}
return aSeq;
@@ -3706,7 +3536,7 @@ uno::Sequence< rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::getTextualDat
::rtl::OUString SAL_CALL ScChart2EmptyDataSequence::getSourceRangeRepresentation()
throw ( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aStr;
DBG_ASSERT( m_pDocument, "No Document -> no SourceRangeRepresentation" );
if( m_pDocument )
@@ -3717,7 +3547,7 @@ uno::Sequence< rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::getTextualDat
uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::generateLabel(chart2::data::LabelOrigin /*nOrigin*/)
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence< ::rtl::OUString > aRet;
return aRet;
}
@@ -3728,7 +3558,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::generateLab
{
sal_Int32 nResult = 0;
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !m_pDocument)
return nResult;
@@ -3740,7 +3570,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScChart2EmptyDataSequence::generateLab
uno::Reference< util::XCloneable > SAL_CALL ScChart2EmptyDataSequence::createClone()
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (m_xDataProvider.is())
{
// copy properties
@@ -3777,7 +3607,7 @@ void SAL_CALL ScChart2EmptyDataSequence::removeModifyListener( const uno::Refere
uno::Reference< beans::XPropertySetInfo> SAL_CALL
ScChart2EmptyDataSequence::getPropertySetInfo() throw( uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef =
new SfxItemPropertySetInfo( m_aPropSet.getPropertyMap() );
return aRef;
@@ -3831,7 +3661,6 @@ void SAL_CALL ScChart2EmptyDataSequence::addPropertyChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
@@ -3843,7 +3672,6 @@ void SAL_CALL ScChart2EmptyDataSequence::removePropertyChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
@@ -3855,7 +3683,6 @@ void SAL_CALL ScChart2EmptyDataSequence::addVetoableChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
@@ -3867,48 +3694,9 @@ void SAL_CALL ScChart2EmptyDataSequence::removeVetoableChangeListener(
lang::WrappedTargetException, uno::RuntimeException)
{
// FIXME: real implementation
-// throw uno::RuntimeException();
OSL_ENSURE( false, "Not yet implemented" );
}
-// XUnoTunnel
-
-// sal_Int64 SAL_CALL ScChart2EmptyDataSequence::getSomething(
-// const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
-// {
-// if ( rId.getLength() == 16 &&
-// 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
-// rId.getConstArray(), 16 ) )
-// {
-// return (sal_Int64)this;
-// }
-// return 0;
-// }
-
-// // static
-// const uno::Sequence<sal_Int8>& ScChart2EmptyDataSequence::getUnoTunnelId()
-// {
-// static uno::Sequence<sal_Int8> * pSeq = 0;
-// if( !pSeq )
-// {
-// osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
-// if( !pSeq )
-// {
-// static uno::Sequence< sal_Int8 > aSeq( 16 );
-// rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
-// pSeq = &aSeq;
-// }
-// }
-// return *pSeq;
-// }
-
-// // static
-// ScChart2DataSequence* ScChart2EmptyDataSequence::getImplementation( const uno::Reference<uno::XInterface> xObj )
-// {
-// ScChart2DataSequence* pRet = NULL;
-// uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY );
-// if (xUT.is())
-// pRet = (ScChart2EmptyDataSequence*) xUT->getSomething( getUnoTunnelId() );
-// return pRet;
-// }
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index f0d77a8157b2..db07ccda9d38 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,6 @@
#include "undodat.hxx"
#include "chartarr.hxx"
#include "chartlis.hxx"
-#include "unoguard.hxx"
#include "chart2uno.hxx"
#include "convuno.hxx"
@@ -185,7 +185,7 @@ void SAL_CALL ScChartsObj::addNewByName( const rtl::OUString& aName,
sal_Bool bColumnHeaders, sal_Bool bRowHeaders )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
return;
@@ -273,16 +273,16 @@ void SAL_CALL ScChartsObj::addNewByName( const rtl::OUString& aName,
// set arguments
uno::Sequence< beans::PropertyValue > aArgs( 4 );
aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellRangeRepresentation")), -1,
uno::makeAny( ::rtl::OUString( sRangeStr )), beans::PropertyState_DIRECT_VALUE );
aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1,
uno::makeAny( bRowHeaders ), beans::PropertyState_DIRECT_VALUE );
aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstCellAsLabel")), -1,
uno::makeAny( bColumnHeaders ), beans::PropertyState_DIRECT_VALUE );
aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataRowSource")), -1,
uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
xReceiver->setArguments( aArgs );
}
@@ -299,18 +299,14 @@ void SAL_CALL ScChartsObj::addNewByName( const rtl::OUString& aName,
xObj->setVisualAreaSize( nAspect, aSz );
pPage->InsertObject( pObj );
- pModel->AddUndo( new SdrUndoNewObj( *pObj ) );
-
- // Dies veranlaesst Chart zum sofortigen Update
- //SvData aEmpty;
- //aIPObj->SendDataChanged( aEmpty );
+ pModel->AddUndo( new SdrUndoInsertObj( *pObj ) ); //! Undo-Kommentar?
}
}
void SAL_CALL ScChartsObj::removeByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aName);
SdrOle2Obj* pObj = lcl_FindChartObj( pDocShell, nTab, aNameString );
if (pObj)
@@ -331,7 +327,7 @@ void SAL_CALL ScChartsObj::removeByName( const rtl::OUString& aName )
uno::Reference<container::XEnumeration> SAL_CALL ScChartsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.TableChartsEnumeration")));
}
@@ -339,8 +335,8 @@ uno::Reference<container::XEnumeration> SAL_CALL ScChartsObj::createEnumeration(
sal_Int32 SAL_CALL ScChartsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Int32 nCount = 0;
+ SolarMutexGuard aGuard;
+ INT32 nCount = 0;
if ( pDocShell )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -369,24 +365,23 @@ uno::Any SAL_CALL ScChartsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XTableChart> xChart(GetObjectByIndex_Impl(nIndex));
if (xChart.is())
return uno::makeAny(xChart);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScChartsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<table::XTableChart>*)0);
}
sal_Bool SAL_CALL ScChartsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCount() != 0;
}
@@ -394,18 +389,17 @@ uno::Any SAL_CALL ScChartsObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XTableChart> xChart(GetObjectByName_Impl(aName));
if (xChart.is())
return uno::makeAny(xChart);
else
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScChartsObj::getElementNames() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -450,7 +444,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScChartsObj::getElementNames() throw(uno::
sal_Bool SAL_CALL ScChartsObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aName);
return ( lcl_FindChartObj( pDocShell, nTab, aNameString ) != NULL );
}
@@ -467,7 +461,7 @@ ScChartObj::ScChartObj(ScDocShell* pDocSh, SCTAB nT, const String& rN)
pDocShell->GetDocument()->AddUnoObject(*this);
uno::Sequence< table::CellRangeAddress > aInitialPropValue;
- registerPropertyNoMember( ::rtl::OUString::createFromAscii( "RelatedCellRanges" ),
+ registerPropertyNoMember( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RelatedCellRanges" )),
PROP_HANDLE_RELATED_CELLRANGES, beans::PropertyAttribute::MAYBEVOID,
::getCppuType( &aInitialPropValue ), &aInitialPropValue );
}
@@ -559,9 +553,9 @@ void ScChartObj::Update_Impl( const ScRangeListRef& rRanges, bool bColHeaders, b
if (bUndo)
{
pDocShell->GetUndoManager()->AddUndoAction(
- new ScUndoChartData( pDocShell, aChartName, rRanges, bColHeaders, bRowHeaders, sal_False ) );
+ new ScUndoChartData( pDocShell, aChartName, rRanges, bColHeaders, bRowHeaders, false ) );
}
- pDoc->UpdateChartArea( aChartName, rRanges, bColHeaders, bRowHeaders, sal_False );
+ pDoc->UpdateChartArea( aChartName, rRanges, bColHeaders, bRowHeaders, false );
}
}
@@ -601,8 +595,6 @@ void ScChartObj::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno:
}
break;
default:
- {
- }
break;
}
}
@@ -628,12 +620,12 @@ void ScChartObj::getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) con
const ScRangeListRef& rRangeList = pListener->GetRangeList();
if ( rRangeList.Is() )
{
- sal_uLong nCount = rRangeList->Count();
+ size_t nCount = rRangeList->size();
uno::Sequence< table::CellRangeAddress > aCellRanges( nCount );
table::CellRangeAddress* pCellRanges = aCellRanges.getArray();
- for ( sal_uInt16 i = 0; i < nCount; ++i )
+ for ( size_t i = 0; i < nCount; ++i )
{
- ScRange aRange( *rRangeList->GetObject( i ) );
+ ScRange aRange( *(*rRangeList)[i] );
table::CellRangeAddress aCellRange;
ScUnoConversion::FillApiRange( aCellRange, aRange );
pCellRanges[ i ] = aCellRange;
@@ -646,8 +638,6 @@ void ScChartObj::getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) con
}
break;
default:
- {
- }
break;
}
}
@@ -680,7 +670,7 @@ void ScChartObj::disposing()
sal_Bool SAL_CALL ScChartObj::getHasColumnHeaders() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRangeListRef xRanges = new ScRangeList;
bool bColHeaders, bRowHeaders;
GetData_Impl( xRanges, bColHeaders, bRowHeaders );
@@ -690,17 +680,17 @@ sal_Bool SAL_CALL ScChartObj::getHasColumnHeaders() throw(uno::RuntimeException)
void SAL_CALL ScChartObj::setHasColumnHeaders( sal_Bool bHasColumnHeaders )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRangeListRef xRanges = new ScRangeList;
bool bOldColHeaders, bOldRowHeaders;
GetData_Impl( xRanges, bOldColHeaders, bOldRowHeaders );
- if ( bOldColHeaders != (bHasColumnHeaders != sal_False) )
+ if ( bOldColHeaders != (bHasColumnHeaders != false) )
Update_Impl( xRanges, bHasColumnHeaders, bOldRowHeaders );
}
sal_Bool SAL_CALL ScChartObj::getHasRowHeaders() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRangeListRef xRanges = new ScRangeList;
bool bColHeaders, bRowHeaders;
GetData_Impl( xRanges, bColHeaders, bRowHeaders );
@@ -710,30 +700,30 @@ sal_Bool SAL_CALL ScChartObj::getHasRowHeaders() throw(uno::RuntimeException)
void SAL_CALL ScChartObj::setHasRowHeaders( sal_Bool bHasRowHeaders )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRangeListRef xRanges = new ScRangeList;
bool bOldColHeaders, bOldRowHeaders;
GetData_Impl( xRanges, bOldColHeaders, bOldRowHeaders );
- if ( bOldRowHeaders != (bHasRowHeaders != sal_False) )
+ if ( bOldRowHeaders != (bHasRowHeaders != false) )
Update_Impl( xRanges, bOldColHeaders, bHasRowHeaders );
}
uno::Sequence<table::CellRangeAddress> SAL_CALL ScChartObj::getRanges() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRangeListRef xRanges = new ScRangeList;
bool bColHeaders, bRowHeaders;
GetData_Impl( xRanges, bColHeaders, bRowHeaders );
if ( xRanges.Is() )
{
- sal_uLong nCount = xRanges->Count();
+ size_t nCount = xRanges->size();
table::CellRangeAddress aRangeAddress;
uno::Sequence<table::CellRangeAddress> aSeq(nCount);
table::CellRangeAddress* pAry = aSeq.getArray();
- for (sal_uInt16 i=0; i<nCount; i++)
+ for (size_t i = 0; i < nCount; i++)
{
- ScRange aRange(*xRanges->GetObject(i));
+ ScRange aRange( *(*xRanges)[i] );
aRangeAddress.Sheet = aRange.aStart.Tab();
aRangeAddress.StartColumn = aRange.aStart.Col();
@@ -746,14 +736,14 @@ uno::Sequence<table::CellRangeAddress> SAL_CALL ScChartObj::getRanges() throw(un
return aSeq;
}
- DBG_ERROR("ScChartObj::getRanges: keine Ranges");
+ OSL_FAIL("ScChartObj::getRanges: keine Ranges");
return uno::Sequence<table::CellRangeAddress>();
}
void SAL_CALL ScChartObj::setRanges( const uno::Sequence<table::CellRangeAddress>& aRanges )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRangeListRef xOldRanges = new ScRangeList;
bool bColHeaders, bRowHeaders;
GetData_Impl( xOldRanges, bColHeaders, bRowHeaders );
@@ -780,7 +770,7 @@ void SAL_CALL ScChartObj::setRanges( const uno::Sequence<table::CellRangeAddress
uno::Reference<lang::XComponent> SAL_CALL ScChartObj::getEmbeddedObject() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SdrOle2Obj* pObject = lcl_FindChartObj( pDocShell, nTab, aChartName );
if ( pObject && svt::EmbeddedObjectRef::TryRunningState( pObject->GetObjRef() ) )
{
@@ -795,13 +785,13 @@ uno::Reference<lang::XComponent> SAL_CALL ScChartObj::getEmbeddedObject() throw(
rtl::OUString SAL_CALL ScChartObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aChartName;
}
void SAL_CALL ScChartObj::setName( const rtl::OUString& /* aName */ ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
throw uno::RuntimeException(); // name cannot be changed
}
@@ -816,3 +806,4 @@ uno::Reference< beans::XPropertySetInfo > ScChartObj::getPropertySetInfo() throw
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index fb3d5e42e345..fc05a9a4401e 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include "confuno.hxx"
#include "unonames.hxx"
-#include "unoguard.hxx"
#include "scdll.hxx"
#include "docsh.hxx"
#include "miscuno.hxx"
@@ -45,6 +45,7 @@
#include <sfx2/printer.hxx>
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
+#include <vcl/svapp.hxx>
using namespace com::sun::star;
@@ -84,9 +85,7 @@ const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap()
{MAP_CHAR_LEN(SC_UNO_UPDTEMPL), 0, &getBooleanCppuType(), 0, 0},
/*Stampit enable/disable print cancel */
{MAP_CHAR_LEN(SC_UNO_ALLOWPRINTJOBCANCEL), 0, &getBooleanCppuType(), 0, 0},
- // --> PB 2004-08-25 #i33095# Security Options
{MAP_CHAR_LEN(SC_UNO_LOADREADONLY), 0, &getBooleanCppuType(), 0, 0},
- // <--
{MAP_CHAR_LEN(SC_UNO_SHAREDOC), 0, &getBooleanCppuType(), 0, 0},
{MAP_CHAR_LEN(SC_UNO_MODIFYPASSWORDINFO), 0, &getCppuType((uno::Sequence< beans::PropertyValue >*)0), 0, 0},
{0,0,0,0,0,0}
@@ -125,7 +124,7 @@ void ScDocumentConfiguration::Notify( SfxBroadcaster&, const SfxHint& rHint )
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDocumentConfiguration::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -137,14 +136,14 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if(pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
if (pDoc)
{
- sal_Bool bUpdateHeights = sal_False;
+ sal_Bool bUpdateHeights = false;
ScViewOptions aViewOpt(pDoc->GetViewOptions());
@@ -254,7 +253,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
}
else if ( aPropertyName.compareToAscii( SCSAVEVERSION ) == 0)
{
- sal_Bool bTmp=sal_False;
+ sal_Bool bTmp=false;
if ( aValue >>= bTmp )
pDocShell->SetSaveVersionOnClose( bTmp );
}
@@ -266,13 +265,13 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
}
else if ( aPropertyName.compareToAscii( SC_UNO_LOADREADONLY ) == 0 )
{
- sal_Bool bTmp=sal_False;
+ sal_Bool bTmp=false;
if ( aValue >>= bTmp )
pDocShell->SetLoadReadonly( bTmp );
}
else if ( aPropertyName.compareToAscii( SC_UNO_SHAREDOC ) == 0 )
{
- sal_Bool bDocShared = sal_False;
+ sal_Bool bDocShared = false;
if ( aValue >>= bDocShared )
{
pDocShell->SetSharedXMLFlag( bDocShared );
@@ -336,7 +335,7 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const rtl::OUString
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(pDocShell)
@@ -379,7 +378,7 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const rtl::OUString
{
// #i75610# don't create the printer, return empty string if no printer created yet
// (as in SwXDocumentSettings)
- SfxPrinter* pPrinter = pDoc->GetPrinter( sal_False );
+ SfxPrinter* pPrinter = pDoc->GetPrinter( false );
if (pPrinter)
aRet <<= rtl::OUString ( pPrinter->GetName());
else
@@ -389,7 +388,7 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const rtl::OUString
{
// #i75610# don't create the printer, return empty sequence if no printer created yet
// (as in SwXDocumentSettings)
- SfxPrinter* pPrinter = pDoc->GetPrinter( sal_False );
+ SfxPrinter* pPrinter = pDoc->GetPrinter( false );
if (pPrinter)
{
SvMemoryStream aStream;
@@ -420,7 +419,6 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const rtl::OUString
aRet <<= pDocShell->IsQueryLoadTemplate();
else if ( aPropertyName.compareToAscii( SC_UNO_LOADREADONLY ) == 0 )
aRet <<= pDocShell->IsLoadReadonly();
- // <--
else if ( aPropertyName.compareToAscii( SC_UNO_SHAREDOC ) == 0 )
{
ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->HasSharedXMLFlagSet() );
@@ -463,7 +461,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDocumentConfiguration )
rtl::OUString SAL_CALL ScDocumentConfiguration::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScDocumentConfiguration" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScDocumentConfiguration" ));
}
sal_Bool SAL_CALL ScDocumentConfiguration::supportsService( const rtl::OUString& rServiceName )
@@ -479,10 +477,11 @@ uno::Sequence<rtl::OUString> SAL_CALL ScDocumentConfiguration::getSupportedServi
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCCOMPSCPREADSHEETSETTINGS_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCDOCUMENTSETTINGS_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCOMPSCPREADSHEETSETTINGS_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDOCUMENTSETTINGS_SERVICE ));
return aRet;
}
//-------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/convuno.cxx b/sc/source/ui/unoobj/convuno.cxx
index e3b0c09b25c2..7781ecf6ac4a 100644
--- a/sc/source/ui/unoobj/convuno.cxx
+++ b/sc/source/ui/unoobj/convuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,3 +63,4 @@ void ScUnoConversion::FillLocale( lang::Locale& rLocale, LanguageType eLang )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index d163dcee643e..553ba56e6cd4 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include "scitems.hxx"
#include <svl/intitem.hxx>
#include <svl/zforlist.hxx>
+#include <vcl/svapp.hxx>
#include <rtl/uuid.h>
#include "cursuno.hxx"
@@ -41,7 +43,6 @@
#include "hints.hxx"
#include "markdata.hxx"
#include "dociter.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
using namespace com::sun::star;
@@ -117,10 +118,10 @@ uno::Sequence<sal_Int8> SAL_CALL ScCellCursorObj::getImplementationId() throw(un
void SAL_CALL ScCellCursorObj::collapseToCurrentRegion() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aOneRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aOneRange( *rRanges[ 0 ] );
aOneRange.Justify();
ScDocShell* pDocSh = GetDocShell();
@@ -142,10 +143,10 @@ void SAL_CALL ScCellCursorObj::collapseToCurrentRegion() throw(uno::RuntimeExcep
void SAL_CALL ScCellCursorObj::collapseToCurrentArray() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aOneRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aOneRange( *rRanges[ 0 ] );
aOneRange.Justify();
ScAddress aCursor(aOneRange.aStart); // use the start address of the range
@@ -167,20 +168,20 @@ void SAL_CALL ScCellCursorObj::collapseToCurrentArray() throw(uno::RuntimeExcept
// about a exception
/*if (!bFound)
{
- DBG_ERROR("keine Matrix");
+ OSL_FAIL("keine Matrix");
//! Exception, oder was?
}*/
}
void SAL_CALL ScCellCursorObj::collapseToMergedArea() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aNewRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aNewRange( *rRanges[ 0 ] );
ScDocument* pDoc = pDocSh->GetDocument();
pDoc->ExtendOverlapped( aNewRange );
@@ -192,10 +193,10 @@ void SAL_CALL ScCellCursorObj::collapseToMergedArea() throw(uno::RuntimeExceptio
void SAL_CALL ScCellCursorObj::expandToEntireColumns() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aNewRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aNewRange( *rRanges[ 0 ] );
aNewRange.aStart.SetRow( 0 );
aNewRange.aEnd.SetRow( MAXROW );
@@ -205,10 +206,10 @@ void SAL_CALL ScCellCursorObj::expandToEntireColumns() throw(uno::RuntimeExcepti
void SAL_CALL ScCellCursorObj::expandToEntireRows() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aNewRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aNewRange( *rRanges[ 0 ] );
aNewRange.aStart.SetCol( 0 );
aNewRange.aEnd.SetCol( MAXCOL );
@@ -219,17 +220,17 @@ void SAL_CALL ScCellCursorObj::expandToEntireRows() throw(uno::RuntimeException)
void SAL_CALL ScCellCursorObj::collapseToSize( sal_Int32 nColumns, sal_Int32 nRows )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( nColumns <= 0 || nRows <= 0 )
{
- DBG_ERROR("leerer Range geht nicht");
+ OSL_FAIL("leerer Range geht nicht");
//! und dann?
}
else
{
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aNewRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aNewRange( *rRanges[ 0 ] );
aNewRange.Justify(); //! wirklich?
@@ -255,13 +256,13 @@ void SAL_CALL ScCellCursorObj::collapseToSize( sal_Int32 nColumns, sal_Int32 nRo
void SAL_CALL ScCellCursorObj::gotoStartOfUsedArea( sal_Bool bExpand )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aNewRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aNewRange( *rRanges[0] );
SCTAB nTab = aNewRange.aStart.Tab();
SCCOL nUsedX = 0; // Anfang holen
@@ -283,13 +284,13 @@ void SAL_CALL ScCellCursorObj::gotoStartOfUsedArea( sal_Bool bExpand )
void SAL_CALL ScCellCursorObj::gotoEndOfUsedArea( sal_Bool bExpand )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aNewRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aNewRange( *rRanges[ 0 ]);
SCTAB nTab = aNewRange.aStart.Tab();
SCCOL nUsedX = 0; // Ende holen
@@ -315,10 +316,10 @@ void SAL_CALL ScCellCursorObj::gotoStart() throw(uno::RuntimeException)
// this is similar to collapseToCurrentRegion
//! something like gotoEdge with 4 possible directions is needed
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aOneRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aOneRange( *rRanges[ 0 ]);
aOneRange.Justify();
ScDocShell* pDocSh = GetDocShell();
@@ -331,7 +332,7 @@ void SAL_CALL ScCellCursorObj::gotoStart() throw(uno::RuntimeException)
SCTAB nTab = aOneRange.aStart.Tab();
pDocSh->GetDocument()->GetDataArea(
- nTab, nStartCol, nStartRow, nEndCol, nEndRow, sal_False, false );
+ nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, false );
ScRange aNew( nStartCol, nStartRow, nTab );
SetNewRange( aNew );
@@ -343,10 +344,10 @@ void SAL_CALL ScCellCursorObj::gotoEnd() throw(uno::RuntimeException)
// this is similar to collapseToCurrentRegion
//! something like gotoEdge with 4 possible directions is needed
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aOneRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aOneRange( *rRanges[ 0 ] );
aOneRange.Justify();
ScDocShell* pDocSh = GetDocShell();
@@ -359,7 +360,7 @@ void SAL_CALL ScCellCursorObj::gotoEnd() throw(uno::RuntimeException)
SCTAB nTab = aOneRange.aStart.Tab();
pDocSh->GetDocument()->GetDataArea(
- nTab, nStartCol, nStartRow, nEndCol, nEndRow, sal_False, false );
+ nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, false );
ScRange aNew( nEndCol, nEndRow, nTab );
SetNewRange( aNew );
@@ -368,10 +369,10 @@ void SAL_CALL ScCellCursorObj::gotoEnd() throw(uno::RuntimeException)
void SAL_CALL ScCellCursorObj::gotoNext() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aOneRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aOneRange( *rRanges[ 0 ] );
aOneRange.Justify();
ScAddress aCursor(aOneRange.aStart); // bei Block immer den Start nehmen
@@ -382,7 +383,7 @@ void SAL_CALL ScCellCursorObj::gotoNext() throw(uno::RuntimeException)
SCTAB nTab = aCursor.Tab();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- pDocSh->GetDocument()->GetNextPos( nNewX,nNewY, nTab, 1,0, sal_False,sal_True, aMark );
+ pDocSh->GetDocument()->GetNextPos( nNewX,nNewY, nTab, 1,0, false,sal_True, aMark );
//! sonst Exception oder so
SetNewRange( ScRange( nNewX, nNewY, nTab ) );
@@ -390,10 +391,10 @@ void SAL_CALL ScCellCursorObj::gotoNext() throw(uno::RuntimeException)
void SAL_CALL ScCellCursorObj::gotoPrevious() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aOneRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aOneRange( *rRanges[ 0 ] );
aOneRange.Justify();
ScAddress aCursor(aOneRange.aStart); // bei Block immer den Start nehmen
@@ -404,7 +405,7 @@ void SAL_CALL ScCellCursorObj::gotoPrevious() throw(uno::RuntimeException)
SCTAB nTab = aCursor.Tab();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- pDocSh->GetDocument()->GetNextPos( nNewX,nNewY, nTab, -1,0, sal_False,sal_True, aMark );
+ pDocSh->GetDocument()->GetNextPos( nNewX,nNewY, nTab, -1,0, false,sal_True, aMark );
//! sonst Exception oder so
SetNewRange( ScRange( nNewX, nNewY, nTab ) );
@@ -413,10 +414,10 @@ void SAL_CALL ScCellCursorObj::gotoPrevious() throw(uno::RuntimeException)
void SAL_CALL ScCellCursorObj::gotoOffset( sal_Int32 nColumnOffset, sal_Int32 nRowOffset )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScRangeList& rRanges = GetRangeList();
- DBG_ASSERT( rRanges.Count() == 1, "Range? Ranges?" );
- ScRange aOneRange(*rRanges.GetObject(0));
+ DBG_ASSERT( rRanges.size() == 1, "Range? Ranges?" );
+ ScRange aOneRange( *rRanges[ 0 ] );
aOneRange.Justify();
if ( aOneRange.aStart.Col() + nColumnOffset >= 0 &&
@@ -439,7 +440,7 @@ void SAL_CALL ScCellCursorObj::gotoOffset( sal_Int32 nColumnOffset, sal_Int32 nR
uno::Reference<sheet::XSpreadsheet> SAL_CALL ScCellCursorObj::getSpreadsheet()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScCellRangeObj::getSpreadsheet();
}
@@ -449,7 +450,7 @@ uno::Reference<table::XCell> SAL_CALL ScCellCursorObj::getCellByPosition(
sal_Int32 nColumn, sal_Int32 nRow )
throw(lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScCellRangeObj::getCellByPosition(nColumn,nRow);
}
@@ -457,14 +458,14 @@ uno::Reference<table::XCellRange> SAL_CALL ScCellCursorObj::getCellRangeByPositi
sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom )
throw(lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScCellRangeObj::getCellRangeByPosition(nLeft,nTop,nRight,nBottom);
}
uno::Reference<table::XCellRange> SAL_CALL ScCellCursorObj::getCellRangeByName(
const rtl::OUString& rRange ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScCellRangeObj::getCellRangeByName(rRange);
}
@@ -472,7 +473,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScCellCursorObj::getCellRangeByName(
rtl::OUString SAL_CALL ScCellCursorObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScCellCursorObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScCellCursorObj" ));
}
sal_Bool SAL_CALL ScCellCursorObj::supportsService( const rtl::OUString& rServiceName )
@@ -495,8 +496,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellCursorObj::getSupportedServiceNames(
// SheetCellCursor should be first (?)
uno::Sequence<rtl::OUString> aTotalSeq( nParentLen + 2 );
rtl::OUString* pTotalArr = aTotalSeq.getArray();
- pTotalArr[0] = rtl::OUString::createFromAscii( SCSHEETCELLCURSOR_SERVICE );
- pTotalArr[1] = rtl::OUString::createFromAscii( SCCELLCURSOR_SERVICE );
+ pTotalArr[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSHEETCELLCURSOR_SERVICE ));
+ pTotalArr[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCCELLCURSOR_SERVICE ));
// append cell range services
for (long i=0; i<nParentLen; i++)
@@ -508,3 +509,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellCursorObj::getSupportedServiceNames(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index f72141717159..71b5e5359945 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include <algorithm>
#include <svl/smplhint.hxx>
+#include <vcl/svapp.hxx>
#include <rtl/uuid.h>
#include "dapiuno.hxx"
@@ -40,7 +42,6 @@
#include "tabvwsh.hxx"
#include "pivot.hxx"
#include "rangeutl.hxx"
-#include "unoguard.hxx"
#include "dpobject.hxx"
#include "dpshttab.hxx"
#include "dpsdbtab.hxx"
@@ -175,7 +176,7 @@ bool lclCheckMinMaxStep( const DataPilotFieldGroupInfo& rInfo )
lclCheckValidDouble( rInfo.Start, rInfo.HasAutoStart ) &&
lclCheckValidDouble( rInfo.End, rInfo.HasAutoEnd ) &&
(rInfo.HasAutoStart || rInfo.HasAutoEnd || (rInfo.Start <= rInfo.End)) &&
- lclCheckValidDouble( rInfo.Step, sal_False ) &&
+ lclCheckValidDouble( rInfo.Step, false ) &&
(0.0 <= rInfo.Step);
}
@@ -264,8 +265,8 @@ ScDPObject* lcl_GetDPObject( ScDocShell* pDocShell, SCTAB nTab, const String& rN
ScDPCollection* pColl = pDoc->GetDPCollection();
if ( pColl )
{
- sal_uInt16 nCount = pColl->GetCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = pColl->GetCount();
+ for (size_t i=0; i<nCount; ++i)
{
ScDPObject* pDPObj = (*pColl)[i];
if ( pDPObj->GetOutRange().aStart.Tab() == nTab &&
@@ -297,7 +298,7 @@ sal_Int32 lcl_GetObjectIndex( ScDPObject* pDPObj, const ScFieldIdentifier& rFiel
sal_Int32 nCount = pDPObj->GetDimCount();
for ( sal_Int32 nDim = 0; nDim < nCount; ++nDim )
{
- sal_Bool bIsDataLayout = sal_False;
+ sal_Bool bIsDataLayout = false;
OUString aDimName( pDPObj->GetDimName( nDim, bIsDataLayout ) );
if ( rFieldId.mbDataLayout ? bIsDataLayout : (aDimName == rFieldId.maFieldName) )
return nDim;
@@ -346,8 +347,8 @@ ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByIndex_Impl( sal_Int32 nInd
// api only handles sheet data at this time
//! allow all data sources!!!
sal_Int32 nFound = 0;
- sal_uInt16 nCount = pColl->GetCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = pColl->GetCount();
+ for (size_t i=0; i<nCount; ++i)
{
ScDPObject* pDPObj = (*pColl)[i];
if ( pDPObj->GetOutRange().aStart.Tab() == nTab )
@@ -375,7 +376,7 @@ ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByName_Impl(const OUString&
Reference<XDataPilotDescriptor> SAL_CALL ScDataPilotTablesObj::createDataPilotDescriptor()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScDataPilotDescriptor(pDocShell);
return NULL;
@@ -423,14 +424,14 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const OUString& aNewName,
const Reference<XDataPilotDescriptor>& xDescriptor )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!xDescriptor.is()) return;
// inserting with already existing name?
if ( aNewName.getLength() && hasByName( aNewName ) )
throw RuntimeException(); // no other exceptions specified
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDataPilotDescriptorBase* pImp = ScDataPilotDescriptorBase::getImplementation( xDescriptor );
if ( pDocShell && pImp )
{
@@ -462,7 +463,7 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const OUString& aNewName,
void SAL_CALL ScDataPilotTablesObj::removeByName( const OUString& aName )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameStr(aName);
ScDPObject* pDPObj = lcl_GetDPObject( pDocShell, nTab, aNameStr );
if (pDPObj && pDocShell)
@@ -478,7 +479,7 @@ void SAL_CALL ScDataPilotTablesObj::removeByName( const OUString& aName )
Reference< XEnumeration > SAL_CALL ScDataPilotTablesObj::createEnumeration() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.DataPilotTablesEnumeration")));
}
@@ -486,7 +487,7 @@ Reference< XEnumeration > SAL_CALL ScDataPilotTablesObj::createEnumeration() thr
sal_Int32 SAL_CALL ScDataPilotTablesObj::getCount() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -498,8 +499,8 @@ sal_Int32 SAL_CALL ScDataPilotTablesObj::getCount() throw(RuntimeException)
//! allow all data sources!!!
sal_uInt16 nFound = 0;
- sal_uInt16 nCount = pColl->GetCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = pColl->GetCount();
+ for (size_t i=0; i<nCount; ++i)
{
ScDPObject* pDPObj = (*pColl)[i];
if ( pDPObj->GetOutRange().aStart.Tab() == nTab )
@@ -515,7 +516,7 @@ sal_Int32 SAL_CALL ScDataPilotTablesObj::getCount() throw(RuntimeException)
Any SAL_CALL ScDataPilotTablesObj::getByIndex( sal_Int32 nIndex )
throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference<XDataPilotTable2> xTable(GetObjectByIndex_Impl(nIndex));
if (!xTable.is())
throw IndexOutOfBoundsException();
@@ -524,13 +525,13 @@ Any SAL_CALL ScDataPilotTablesObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScDataPilotTablesObj::getElementType() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((Reference<XDataPilotTable2>*)0);
}
sal_Bool SAL_CALL ScDataPilotTablesObj::hasElements() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -539,7 +540,7 @@ sal_Bool SAL_CALL ScDataPilotTablesObj::hasElements() throw(RuntimeException)
Any SAL_CALL ScDataPilotTablesObj::getByName( const OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference<XDataPilotTable2> xTable(GetObjectByName_Impl(aName));
if (!xTable.is())
throw NoSuchElementException();
@@ -549,7 +550,7 @@ Any SAL_CALL ScDataPilotTablesObj::getByName( const OUString& aName )
Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -561,9 +562,9 @@ Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames()
//! allow all data sources!!!
sal_uInt16 nFound = 0;
- sal_uInt16 nCount = pColl->GetCount();
- sal_uInt16 i;
- for (i=0; i<nCount; i++)
+ size_t nCount = pColl->GetCount();
+ size_t i;
+ for (i=0; i<nCount; ++i)
{
ScDPObject* pDPObj = (*pColl)[i];
if ( pDPObj->GetOutRange().aStart.Tab() == nTab )
@@ -573,7 +574,7 @@ Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames()
sal_uInt16 nPos = 0;
Sequence<OUString> aSeq(nFound);
OUString* pAry = aSeq.getArray();
- for (i=0; i<nCount; i++)
+ for (i=0; i<nCount; ++i)
{
ScDPObject* pDPObj = (*pColl)[i];
if ( pDPObj->GetOutRange().aStart.Tab() == nTab )
@@ -589,7 +590,7 @@ Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames()
sal_Bool SAL_CALL ScDataPilotTablesObj::hasByName( const OUString& aName )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -597,8 +598,8 @@ sal_Bool SAL_CALL ScDataPilotTablesObj::hasByName( const OUString& aName )
if ( pColl )
{
String aNamStr(aName);
- sal_uInt16 nCount = pColl->GetCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = pColl->GetCount();
+ for (size_t i=0; i<nCount; ++i)
{
// api only handles sheet data at this time
//! allow all data sources!!!
@@ -610,7 +611,7 @@ sal_Bool SAL_CALL ScDataPilotTablesObj::hasByName( const OUString& aName )
}
}
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -698,7 +699,7 @@ void ScDataPilotDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
CellRangeAddress SAL_CALL ScDataPilotDescriptorBase::getSourceRange()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObject(GetDPObject());
if (!pDPObject)
@@ -706,22 +707,25 @@ CellRangeAddress SAL_CALL ScDataPilotDescriptorBase::getSourceRange()
CellRangeAddress aRet;
if (pDPObject->IsSheetData())
- ScUnoConversion::FillApiRange( aRet, pDPObject->GetSheetDesc()->aSourceRange );
+ ScUnoConversion::FillApiRange( aRet, pDPObject->GetSheetDesc()->GetSourceRange() );
return aRet;
}
void SAL_CALL ScDataPilotDescriptorBase::setSourceRange( const CellRangeAddress& aSourceRange ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObject = GetDPObject();
if (!pDPObject)
throw RuntimeException();
- ScSheetSourceDesc aSheetDesc;
+ ScSheetSourceDesc aSheetDesc(pDocShell->GetDocument());
if (pDPObject->IsSheetData())
aSheetDesc = *pDPObject->GetSheetDesc();
- ScUnoConversion::FillScRange( aSheetDesc.aSourceRange, aSourceRange );
+
+ ScRange aRange;
+ ScUnoConversion::FillScRange(aRange, aSourceRange);
+ aSheetDesc.SetSourceRange(aRange);
pDPObject->SetSheetDesc( aSheetDesc );
SetDPObject( pDPObject );
}
@@ -729,49 +733,49 @@ void SAL_CALL ScDataPilotDescriptorBase::setSourceRange( const CellRangeAddress&
Reference<XSheetFilterDescriptor> SAL_CALL ScDataPilotDescriptorBase::getFilterDescriptor()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScDataPilotFilterDescriptor( pDocShell, this );
}
Reference<XIndexAccess> SAL_CALL ScDataPilotDescriptorBase::getDataPilotFields()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScDataPilotFieldsObj( *this );
}
Reference<XIndexAccess> SAL_CALL ScDataPilotDescriptorBase::getColumnFields()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScDataPilotFieldsObj( *this, DataPilotFieldOrientation_COLUMN );
}
Reference<XIndexAccess> SAL_CALL ScDataPilotDescriptorBase::getRowFields()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScDataPilotFieldsObj( *this, DataPilotFieldOrientation_ROW );
}
Reference<XIndexAccess> SAL_CALL ScDataPilotDescriptorBase::getPageFields()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScDataPilotFieldsObj( *this, DataPilotFieldOrientation_PAGE );
}
Reference<XIndexAccess> SAL_CALL ScDataPilotDescriptorBase::getDataFields()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScDataPilotFieldsObj( *this, DataPilotFieldOrientation_DATA );
}
Reference<XIndexAccess> SAL_CALL ScDataPilotDescriptorBase::getHiddenFields()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScDataPilotFieldsObj( *this, DataPilotFieldOrientation_HIDDEN );
}
@@ -779,7 +783,7 @@ Reference<XIndexAccess> SAL_CALL ScDataPilotDescriptorBase::getHiddenFields()
Reference< XPropertySetInfo > SAL_CALL ScDataPilotDescriptorBase::getPropertySetInfo( )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static Reference<XPropertySetInfo> aRef =
new SfxItemPropertySetInfo( maPropSet.getPropertyMap() );
return aRef;
@@ -789,7 +793,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException,
WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObject = GetDPObject();
if (pDPObject)
{
@@ -829,7 +833,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
uno::Sequence<beans::PropertyValue> aArgSeq;
if ( aValue >>= aArgSeq )
{
- ScImportSourceDesc aImportDesc;
+ ScImportSourceDesc aImportDesc(pDocShell->GetDocument());
const ScImportSourceDesc* pOldDesc = pDPObject->GetImportSourceDesc();
if (pOldDesc)
@@ -930,7 +934,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Any aRet;
ScDPObject* pDPObject(GetDPObject());
@@ -1007,13 +1011,13 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope
{
uno::Sequence<beans::PropertyValue> aSeq( 4 );
beans::PropertyValue* pArray = aSeq.getArray();
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNO_SOURCENAME );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SOURCENAME ));
pArray[0].Value <<= rtl::OUString( pServiceDesc->aParSource );
- pArray[1].Name = rtl::OUString::createFromAscii( SC_UNO_OBJECTNAME );
+ pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNO_OBJECTNAME ));
pArray[1].Value <<= rtl::OUString( pServiceDesc->aParName );
- pArray[2].Name = rtl::OUString::createFromAscii( SC_UNO_USERNAME );
+ pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNO_USERNAME ));
pArray[2].Value <<= rtl::OUString( pServiceDesc->aParUser );
- pArray[3].Name = rtl::OUString::createFromAscii( SC_UNO_PASSWORD );
+ pArray[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNO_PASSWORD ));
pArray[3].Value <<= rtl::OUString( pServiceDesc->aParPass );
aRet <<= aSeq;
}
@@ -1060,12 +1064,12 @@ void SAL_CALL ScDataPilotDescriptorBase::removeVetoableChangeListener(
Reference< XDataPilotField > SAL_CALL ScDataPilotDescriptorBase::getDataLayoutField() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( ScDPObject* pDPObject = GetDPObject() )
{
if( ScDPSaveData* pSaveData = pDPObject->GetSaveData() )
{
- if( /*ScDPSaveDimension* pDataDim =*/ pSaveData->GetDataLayoutDimension() )
+ if( pSaveData->GetDataLayoutDimension() )
{
ScFieldIdentifier aFieldId( OUString( RTL_CONSTASCII_USTRINGPARAM( SC_DATALAYOUT_NAME ) ), 0, true );
return new ScDataPilotFieldObj( *this, aFieldId );
@@ -1089,7 +1093,6 @@ sal_Int64 SAL_CALL ScDataPilotDescriptorBase::getSomething(
return 0;
}
-// static
const Sequence<sal_Int8>& ScDataPilotDescriptorBase::getUnoTunnelId()
{
static Sequence<sal_Int8> * pSeq = 0;
@@ -1106,7 +1109,6 @@ const Sequence<sal_Int8>& ScDataPilotDescriptorBase::getUnoTunnelId()
return *pSeq;
}
-// static
ScDataPilotDescriptorBase* ScDataPilotDescriptorBase::getImplementation(
const Reference<XDataPilotDescriptor> xObj )
{
@@ -1206,7 +1208,7 @@ void ScDataPilotTableObj::SetDPObject( ScDPObject* pDPObject )
OUString SAL_CALL ScDataPilotTableObj::getName() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName);
if (pDPObj)
return pDPObj->GetName();
@@ -1216,7 +1218,7 @@ OUString SAL_CALL ScDataPilotTableObj::getName() throw(RuntimeException)
void SAL_CALL ScDataPilotTableObj::setName( const OUString& aNewName )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName);
if (pDPObj)
{
@@ -1233,7 +1235,7 @@ void SAL_CALL ScDataPilotTableObj::setName( const OUString& aNewName )
OUString SAL_CALL ScDataPilotTableObj::getTag() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName);
if (pDPObj)
return pDPObj->GetTag();
@@ -1243,7 +1245,7 @@ OUString SAL_CALL ScDataPilotTableObj::getTag() throw(RuntimeException)
void SAL_CALL ScDataPilotTableObj::setTag( const OUString& aNewTag )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName);
if (pDPObj)
{
@@ -1259,7 +1261,7 @@ void SAL_CALL ScDataPilotTableObj::setTag( const OUString& aNewTag )
CellRangeAddress SAL_CALL ScDataPilotTableObj::getOutputRange() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
CellRangeAddress aRet;
ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName);
if (pDPObj)
@@ -1274,27 +1276,23 @@ CellRangeAddress SAL_CALL ScDataPilotTableObj::getOutputRange() throw(RuntimeExc
return aRet;
}
-sal_uLong RefreshDPObject( ScDPObject *pDPObj, ScDocument *pDoc, ScDocShell *pDocSh, sal_Bool bRecord, sal_Bool bApi );
-
void SAL_CALL ScDataPilotTableObj::refresh() throw(RuntimeException)
{
- ScUnoGuard aGuard;
- if( ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName) )
- RefreshDPObject( pDPObj, NULL, GetDocShell(), sal_True, sal_True );
- //if (pDPObj)
- //{
- // ScDPObject* pNew = new ScDPObject(*pDPObj);
- // ScDBDocFunc aFunc(*GetDocShell());
- // aFunc.DataPilotUpdate( pDPObj, pNew, sal_True, sal_True );
- // delete pNew; // DataPilotUpdate copies settings from "new" object
- //}
-
+ SolarMutexGuard aGuard;
+ ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName);
+ if (pDPObj)
+ {
+ ScDPObject* pNew = new ScDPObject(*pDPObj);
+ ScDBDocFunc aFunc(*GetDocShell());
+ aFunc.DataPilotUpdate( pDPObj, pNew, true, true );
+ delete pNew; // DataPilotUpdate copies settings from "new" object
+ }
}
Sequence< Sequence<Any> > SAL_CALL ScDataPilotTableObj::getDrillDownData(const CellAddress& aAddr)
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Sequence< Sequence<Any> > aTabData;
ScAddress aAddr2(static_cast<SCCOL>(aAddr.Column), static_cast<SCROW>(aAddr.Row), aAddr.Sheet);
ScDPObject* pObj = GetDPObject();
@@ -1308,7 +1306,7 @@ Sequence< Sequence<Any> > SAL_CALL ScDataPilotTableObj::getDrillDownData(const C
DataPilotTablePositionData SAL_CALL ScDataPilotTableObj::getPositionData(const CellAddress& aAddr)
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
DataPilotTablePositionData aPosData;
ScAddress aAddr2(static_cast<SCCOL>(aAddr.Column), static_cast<SCROW>(aAddr.Row), aAddr.Sheet);
ScDPObject* pObj = GetDPObject();
@@ -1322,7 +1320,7 @@ DataPilotTablePositionData SAL_CALL ScDataPilotTableObj::getPositionData(const C
void SAL_CALL ScDataPilotTableObj::insertDrillDownSheet(const CellAddress& aAddr)
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = GetDPObject();
if (!pDPObj)
throw RuntimeException();
@@ -1336,7 +1334,7 @@ void SAL_CALL ScDataPilotTableObj::insertDrillDownSheet(const CellAddress& aAddr
CellRangeAddress SAL_CALL ScDataPilotTableObj::getOutputRangeByType( sal_Int32 nType )
throw (IllegalArgumentException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nType < 0 || nType > DataPilotOutputRangeType::RESULT)
throw IllegalArgumentException();
@@ -1349,7 +1347,7 @@ CellRangeAddress SAL_CALL ScDataPilotTableObj::getOutputRangeByType( sal_Int32 n
void SAL_CALL ScDataPilotTableObj::addModifyListener( const uno::Reference<util::XModifyListener>& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<util::XModifyListener> *pObj = new uno::Reference<util::XModifyListener>( aListener );
aModifyListeners.Insert( pObj, aModifyListeners.Count() );
@@ -1363,7 +1361,7 @@ void SAL_CALL ScDataPilotTableObj::addModifyListener( const uno::Reference<util:
void SAL_CALL ScDataPilotTableObj::removeModifyListener( const uno::Reference<util::XModifyListener>& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
acquire(); // in case the listeners have the last ref - released below
@@ -1438,10 +1436,10 @@ ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) :
// set defaults like in ScPivotParam constructor
aSaveData.SetColumnGrand( sal_True );
aSaveData.SetRowGrand( sal_True );
- aSaveData.SetIgnoreEmptyRows( sal_False );
- aSaveData.SetRepeatIfEmpty( sal_False );
+ aSaveData.SetIgnoreEmptyRows( false );
+ aSaveData.SetRepeatIfEmpty( false );
mpDPObject->SetSaveData(aSaveData);
- ScSheetSourceDesc aSheetDesc;
+ ScSheetSourceDesc aSheetDesc(pDocSh ? pDocSh->GetDocument() : NULL);
mpDPObject->SetSheetDesc(aSheetDesc);
mpDPObject->GetSource();
}
@@ -1462,7 +1460,7 @@ void ScDataPilotDescriptor::SetDPObject( ScDPObject* pDPObject )
{
delete mpDPObject;
mpDPObject = pDPObject;
- DBG_ERROR("replace DPObject should not happen");
+ OSL_FAIL("replace DPObject should not happen");
}
}
@@ -1470,27 +1468,27 @@ void ScDataPilotDescriptor::SetDPObject( ScDPObject* pDPObject )
OUString SAL_CALL ScDataPilotDescriptor::getName() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return mpDPObject->GetName();
}
void SAL_CALL ScDataPilotDescriptor::setName( const OUString& aNewName )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
mpDPObject->SetName( aNewName );
}
OUString SAL_CALL ScDataPilotDescriptor::getTag() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return mpDPObject->GetTag();
}
void SAL_CALL ScDataPilotDescriptor::setTag( const OUString& aNewTag )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
mpDPObject->SetTag( aNewTag );
}
@@ -1538,17 +1536,16 @@ ScDPSaveDimension* ScDataPilotChildObjBase::GetDPDimension( ScDPObject** ppDPObj
return pSaveData->GetDimensionByName( maFieldId.maFieldName );
// find dimension with specified index (search in duplicated dimensions)
- String aFieldName = maFieldId.maFieldName; // needed for comparison
- const List& rDimensions = pSaveData->GetDimensions();
- sal_uLong nDimCount = rDimensions.Count();
+ const boost::ptr_vector<ScDPSaveDimension>& rDimensions = pSaveData->GetDimensions();
+
sal_Int32 nFoundIdx = 0;
- for( sal_uLong nDim = 0; nDim < nDimCount; ++nDim )
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator it;
+ for(it = rDimensions.begin(); it != rDimensions.end(); ++it)
{
- ScDPSaveDimension* pDim = static_cast< ScDPSaveDimension* >( rDimensions.GetObject( nDim ) );
- if( !pDim->IsDataLayout() && (pDim->GetName() == aFieldName) )
+ if( !it->IsDataLayout() && (it->GetName() == maFieldId.maFieldName) )
{
if( nFoundIdx == maFieldId.mnFieldIdx )
- return pDim;
+ return const_cast<ScDPSaveDimension*>(&(*it));
++nFoundIdx;
}
}
@@ -1631,7 +1628,7 @@ sal_Int32 lcl_GetFieldCount( const Reference<XDimensionsSupplier>& rSource, cons
sal_Bool lcl_GetFieldDataByIndex( const Reference<XDimensionsSupplier>& rSource,
const Any& rOrient, SCSIZE nIndex, ScFieldIdentifier& rFieldId )
{
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
SCSIZE nPos = 0;
sal_Int32 nDimIndex = 0;
@@ -1706,7 +1703,7 @@ sal_Bool lcl_GetFieldDataByIndex( const Reference<XDimensionsSupplier>& rSource,
rFieldId.mnFieldIdx = nRepeat;
}
else
- bOk = sal_False;
+ bOk = false;
}
return bOk;
@@ -1718,7 +1715,7 @@ sal_Bool lcl_GetFieldDataByName( ScDPObject* pDPObj, const OUString& rFieldName,
// The name "Data" always refers to the data layout field.
rFieldId.maFieldName = rFieldName;
rFieldId.mnFieldIdx = 0;
- rFieldId.mbDataLayout = rFieldName.equalsAscii( SC_DATALAYOUT_NAME );
+ rFieldId.mbDataLayout = rFieldName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_DATALAYOUT_NAME ) );
pDPObj->GetSource(); // IsDimNameInUse doesn't update source data
@@ -1756,7 +1753,7 @@ ScDataPilotFieldObj* ScDataPilotFieldsObj::GetObjectByName_Impl(const OUString&
Reference<XEnumeration> SAL_CALL ScDataPilotFieldsObj::createEnumeration()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.DataPilotFieldsEnumeration")));
}
@@ -1764,7 +1761,7 @@ Reference<XEnumeration> SAL_CALL ScDataPilotFieldsObj::createEnumeration()
sal_Int32 SAL_CALL ScDataPilotFieldsObj::getCount() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// TODO
ScDPObject* pDPObj = GetDPObject();
return pDPObj ? lcl_GetFieldCount( pDPObj->GetSource(), maOrient ) : 0;
@@ -1773,7 +1770,7 @@ sal_Int32 SAL_CALL ScDataPilotFieldsObj::getCount() throw(RuntimeException)
Any SAL_CALL ScDataPilotFieldsObj::getByIndex( sal_Int32 nIndex )
throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference< XPropertySet > xField( GetObjectByIndex_Impl( nIndex ) );
if (!xField.is())
throw IndexOutOfBoundsException();
@@ -1782,20 +1779,20 @@ Any SAL_CALL ScDataPilotFieldsObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScDataPilotFieldsObj::getElementType() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((Reference<XPropertySet>*)0);
}
sal_Bool SAL_CALL ScDataPilotFieldsObj::hasElements() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
Any SAL_CALL ScDataPilotFieldsObj::getByName( const OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference<XPropertySet> xField(GetObjectByName_Impl(aName));
if (!xField.is())
throw NoSuchElementException();
@@ -1805,20 +1802,20 @@ Any SAL_CALL ScDataPilotFieldsObj::getByName( const OUString& aName )
Sequence<OUString> SAL_CALL ScDataPilotFieldsObj::getElementNames()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// TODO
if (ScDPObject* pDPObj = GetDPObject())
{
Sequence< OUString > aSeq( lcl_GetFieldCount( pDPObj->GetSource(), maOrient ) );
OUString* pAry = aSeq.getArray();
- const List& rDimensions = pDPObj->GetSaveData()->GetDimensions();
- sal_Int32 nDimCount = rDimensions.Count();
- for (sal_Int32 nDim = 0; nDim < nDimCount; nDim++)
+
+ const boost::ptr_vector<ScDPSaveDimension>& rDimensions = pDPObj->GetSaveData()->GetDimensions();
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator it;
+ for (it = rDimensions.begin(); it != rDimensions.end(); ++it)
{
- ScDPSaveDimension* pDim = (ScDPSaveDimension*)rDimensions.GetObject(nDim);
- if(maOrient.hasValue() && (pDim->GetOrientation() == maOrient.get< DataPilotFieldOrientation >()))
+ if(maOrient.hasValue() && (it->GetOrientation() == maOrient.get< DataPilotFieldOrientation >()))
{
- *pAry = pDim->GetName();
+ *pAry = it->GetName();
++pAry;
}
}
@@ -1830,7 +1827,7 @@ Sequence<OUString> SAL_CALL ScDataPilotFieldsObj::getElementNames()
sal_Bool SAL_CALL ScDataPilotFieldsObj::hasByName( const OUString& aName )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetObjectByName_Impl(aName) != NULL;
}
@@ -1860,7 +1857,7 @@ ScDataPilotFieldObj::~ScDataPilotFieldObj()
OUString SAL_CALL ScDataPilotFieldObj::getName() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
OUString aName;
if( ScDPSaveDimension* pDim = GetDPDimension() )
{
@@ -1879,7 +1876,7 @@ OUString SAL_CALL ScDataPilotFieldObj::getName() throw(RuntimeException)
void SAL_CALL ScDataPilotFieldObj::setName( const OUString& rName ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
ScDPSaveDimension* pDim = GetDPDimension( &pDPObj );
if( pDim && !pDim->IsDataLayout() )
@@ -1895,7 +1892,7 @@ void SAL_CALL ScDataPilotFieldObj::setName( const OUString& rName ) throw(Runtim
Reference<XPropertySetInfo> SAL_CALL ScDataPilotFieldObj::getPropertySetInfo()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static Reference<XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( maPropSet.getPropertyMap() ));
return aRef;
@@ -1904,7 +1901,7 @@ Reference<XPropertySetInfo> SAL_CALL ScDataPilotFieldObj::getPropertySetInfo()
void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyName, const Any& aValue )
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
if ( aNameString.EqualsAscii( SC_UNONAME_FUNCTION ) )
{
@@ -2000,7 +1997,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa
Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
Any aRet;
@@ -2063,7 +2060,7 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam
Reference<XIndexAccess> SAL_CALL ScDataPilotFieldObj::getItems()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!mxItems.is())
mxItems.set( new ScDataPilotItemsObj( mrParent, maFieldId ) );
return mxItems;
@@ -2073,14 +2070,14 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDataPilotFieldObj )
DataPilotFieldOrientation ScDataPilotFieldObj::getOrientation() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
return pDim ? static_cast< DataPilotFieldOrientation >( pDim->GetOrientation() ) : DataPilotFieldOrientation_HIDDEN;
}
void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (maOrient.hasValue() && (eNew == maOrient.get< DataPilotFieldOrientation >()))
return;
@@ -2101,19 +2098,17 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew)
// look for existing duplicate with orientation "hidden"
- String aNameStr( maFieldId.maFieldName );
- const List& rDimensions = pSaveData->GetDimensions();
- sal_Int32 nDimCount = rDimensions.Count();
sal_Int32 nFound = 0;
- for ( sal_Int32 nDim = 0; nDim < nDimCount && !pNewDim; nDim++ )
+ const boost::ptr_vector<ScDPSaveDimension>& rDimensions = pSaveData->GetDimensions();
+ boost::ptr_vector<ScDPSaveDimension>::const_iterator it;
+ for ( it = rDimensions.begin(); it != rDimensions.end() && !pNewDim; ++it )
{
- ScDPSaveDimension* pOneDim = static_cast<ScDPSaveDimension*>(rDimensions.GetObject(nDim));
- if ( !pOneDim->IsDataLayout() && (pOneDim->GetName() == aNameStr) )
+ if ( !it->IsDataLayout() && (it->GetName() == maFieldId.maFieldName) )
{
- if ( pOneDim->GetOrientation() == DataPilotFieldOrientation_HIDDEN )
- pNewDim = pOneDim; // use this one
+ if ( it->GetOrientation() == DataPilotFieldOrientation_HIDDEN )
+ pNewDim = const_cast<ScDPSaveDimension*>(&(*it)); // use this one
else
- ++nFound; // count existing non-hidden occurences
+ ++nFound; // count existing non-hidden occurrences
}
}
@@ -2127,7 +2122,7 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew)
pDim->SetOrientation(sal::static_int_cast<sal_uInt16>(eNew));
// move changed field behind all other fields (make it the last field in dimension)
- pSaveData->SetPosition( pDim, pSaveData->GetDimensions().Count() );
+ pSaveData->SetPosition( pDim, pSaveData->GetDimensions().size() );
SetDPObject( pDPObj );
@@ -2137,7 +2132,7 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew)
GeneralFunction ScDataPilotFieldObj::getFunction() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GeneralFunction eRet = GeneralFunction_NONE;
if( ScDPSaveDimension* pDim = GetDPDimension() )
{
@@ -2157,7 +2152,7 @@ GeneralFunction ScDataPilotFieldObj::getFunction() const
void ScDataPilotFieldObj::setFunction(GeneralFunction eNewFunc)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2180,7 +2175,7 @@ void ScDataPilotFieldObj::setFunction(GeneralFunction eNewFunc)
Sequence< GeneralFunction > ScDataPilotFieldObj::getSubtotals() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Sequence< GeneralFunction > aRet;
if( ScDPSaveDimension* pDim = GetDPDimension() )
{
@@ -2201,7 +2196,7 @@ Sequence< GeneralFunction > ScDataPilotFieldObj::getSubtotals() const
void ScDataPilotFieldObj::setSubtotals( const Sequence< GeneralFunction >& rSubtotals )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2247,7 +2242,7 @@ void ScDataPilotFieldObj::setSubtotals( const Sequence< GeneralFunction >& rSubt
OUString ScDataPilotFieldObj::getCurrentPage() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
if( pDim && pDim->HasCurrentPage() )
return pDim->GetCurrentPage();
@@ -2256,26 +2251,25 @@ OUString ScDataPilotFieldObj::getCurrentPage() const
void ScDataPilotFieldObj::setCurrentPage( const OUString& rPage )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
- String aPage( rPage );
- pDim->SetCurrentPage( &aPage );
+ pDim->SetCurrentPage( &rPage );
SetDPObject( pDPObj );
}
}
sal_Bool ScDataPilotFieldObj::getUseCurrentPage() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
return pDim && pDim->HasCurrentPage();
}
void ScDataPilotFieldObj::setUseCurrentPage( sal_Bool bUse )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2285,7 +2279,7 @@ void ScDataPilotFieldObj::setUseCurrentPage( sal_Bool bUse )
true, because it is still needed to set an explicit page name. */
if( !pDim->HasCurrentPage() )
{
- String aPage;
+ const ::rtl::OUString aPage;
pDim->SetCurrentPage( &aPage );
}
}
@@ -2297,14 +2291,14 @@ void ScDataPilotFieldObj::setUseCurrentPage( sal_Bool bUse )
const DataPilotFieldAutoShowInfo* ScDataPilotFieldObj::getAutoShowInfo()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
return pDim ? pDim->GetAutoShowInfo() : 0;
}
void ScDataPilotFieldObj::setAutoShowInfo( const DataPilotFieldAutoShowInfo* pInfo )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2315,14 +2309,14 @@ void ScDataPilotFieldObj::setAutoShowInfo( const DataPilotFieldAutoShowInfo* pIn
const DataPilotFieldLayoutInfo* ScDataPilotFieldObj::getLayoutInfo()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
return pDim ? pDim->GetLayoutInfo() : 0;
}
void ScDataPilotFieldObj::setLayoutInfo( const DataPilotFieldLayoutInfo* pInfo )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2333,14 +2327,14 @@ void ScDataPilotFieldObj::setLayoutInfo( const DataPilotFieldLayoutInfo* pInfo )
const DataPilotFieldReference* ScDataPilotFieldObj::getReference()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
return pDim ? pDim->GetReferenceValue() : 0;
}
void ScDataPilotFieldObj::setReference( const DataPilotFieldReference* pInfo )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2351,14 +2345,14 @@ void ScDataPilotFieldObj::setReference( const DataPilotFieldReference* pInfo )
const DataPilotFieldSortInfo* ScDataPilotFieldObj::getSortInfo()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
return pDim ? pDim->GetSortInfo() : 0;
}
void ScDataPilotFieldObj::setSortInfo( const DataPilotFieldSortInfo* pInfo )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2369,14 +2363,14 @@ void ScDataPilotFieldObj::setSortInfo( const DataPilotFieldSortInfo* pInfo )
sal_Bool ScDataPilotFieldObj::getShowEmpty() const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPSaveDimension* pDim = GetDPDimension();
return pDim && pDim->GetShowEmpty();
}
void ScDataPilotFieldObj::setShowEmpty( sal_Bool bShow )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -2387,17 +2381,17 @@ void ScDataPilotFieldObj::setShowEmpty( sal_Bool bShow )
sal_Bool ScDataPilotFieldObj::hasGroupInfo()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
if( const ScDPDimensionSaveData* pDimData = pDPObj->GetSaveData()->GetExistingDimensionData() )
return pDimData->GetNamedGroupDim( pDim->GetName() ) || pDimData->GetNumGroupDim( pDim->GetName() );
- return sal_False;
+ return false;
}
DataPilotFieldGroupInfo ScDataPilotFieldObj::getGroupInfo()
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
DataPilotFieldGroupInfo aInfo;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
@@ -2458,7 +2452,7 @@ DataPilotFieldGroupInfo ScDataPilotFieldObj::getGroupInfo()
void ScDataPilotFieldObj::setGroupInfo( const DataPilotFieldGroupInfo* pInfo )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( /*ScDPSaveDimension* pDim =*/ GetDPDimension( &pDPObj ) )
{
@@ -2550,7 +2544,7 @@ void ScDataPilotFieldObj::setGroupInfo( const DataPilotFieldGroupInfo* pInfo )
sal_Bool ScDataPilotFieldObj::HasString(const Sequence< OUString >& rItems, const OUString& aString)
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
sal_Int32 nCount(rItems.getLength());
sal_Int32 nItem(0);
@@ -2567,7 +2561,7 @@ sal_Bool ScDataPilotFieldObj::HasString(const Sequence< OUString >& rItems, cons
Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( const Sequence< OUString >& rItems )
throw (RuntimeException, IllegalArgumentException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference< XDataPilotField > xRet;
OUString sNewDim;
@@ -2731,7 +2725,7 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( const DataPilotFieldGroupInfo& rInfo )
throw (RuntimeException, IllegalArgumentException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
using namespace ::com::sun::star::sheet::DataPilotFieldGroupBy;
// check min/max/step, HasDateValues must be set always
@@ -2900,7 +2894,7 @@ ScDataPilotFieldGroupsObj::~ScDataPilotFieldGroupsObj()
Any SAL_CALL ScDataPilotFieldGroupsObj::getByName( const OUString& rName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( implFindByName( rName ) == maGroups.end() )
throw NoSuchElementException();
return Any( Reference< XNameAccess >( new ScDataPilotFieldGroupObj( *this, rName ) ) );
@@ -2908,7 +2902,7 @@ Any SAL_CALL ScDataPilotFieldGroupsObj::getByName( const OUString& rName )
Sequence< OUString > SAL_CALL ScDataPilotFieldGroupsObj::getElementNames() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Sequence< OUString > aSeq;
if( !maGroups.empty() )
{
@@ -2922,7 +2916,7 @@ Sequence< OUString > SAL_CALL ScDataPilotFieldGroupsObj::getElementNames() throw
sal_Bool SAL_CALL ScDataPilotFieldGroupsObj::hasByName( const OUString& rName ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return implFindByName( rName ) != maGroups.end();
}
@@ -2931,7 +2925,7 @@ sal_Bool SAL_CALL ScDataPilotFieldGroupsObj::hasByName( const OUString& rName )
void SAL_CALL ScDataPilotFieldGroupsObj::replaceByName( const OUString& rName, const Any& rElement )
throw (IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( rName.getLength() == 0 )
throw IllegalArgumentException();
@@ -2954,7 +2948,7 @@ void SAL_CALL ScDataPilotFieldGroupsObj::replaceByName( const OUString& rName, c
void SAL_CALL ScDataPilotFieldGroupsObj::insertByName( const OUString& rName, const Any& rElement )
throw (IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( rName.getLength() == 0 )
throw IllegalArgumentException();
@@ -2968,7 +2962,7 @@ void SAL_CALL ScDataPilotFieldGroupsObj::insertByName( const OUString& rName, co
if( !lclExtractGroupMembers( aMembers, rElement ) )
throw IllegalArgumentException();
- // create the new entry if no error has been occured
+ // create the new entry if no error has been occurred
maGroups.resize( maGroups.size() + 1 );
ScFieldGroup& rGroup = maGroups.back();
rGroup.maName = rName;
@@ -2978,7 +2972,7 @@ void SAL_CALL ScDataPilotFieldGroupsObj::insertByName( const OUString& rName, co
void SAL_CALL ScDataPilotFieldGroupsObj::removeByName( const OUString& rName )
throw (NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( rName.getLength() == 0 )
throw IllegalArgumentException();
@@ -2994,14 +2988,14 @@ void SAL_CALL ScDataPilotFieldGroupsObj::removeByName( const OUString& rName )
sal_Int32 SAL_CALL ScDataPilotFieldGroupsObj::getCount() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return static_cast< sal_Int32 >( maGroups.size() );
}
Any SAL_CALL ScDataPilotFieldGroupsObj::getByIndex( sal_Int32 nIndex )
throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ((nIndex < 0) || (nIndex >= static_cast< sal_Int32 >( maGroups.size() )))
throw IndexOutOfBoundsException();
return Any( Reference< XNameAccess >( new ScDataPilotFieldGroupObj( *this, maGroups[ nIndex ].maName ) ) );
@@ -3011,7 +3005,7 @@ Any SAL_CALL ScDataPilotFieldGroupsObj::getByIndex( sal_Int32 nIndex )
Reference<XEnumeration> SAL_CALL ScDataPilotFieldGroupsObj::createEnumeration() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration( this, OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.DataPilotFieldGroupsEnumeration" ) ) );
}
@@ -3019,13 +3013,13 @@ Reference<XEnumeration> SAL_CALL ScDataPilotFieldGroupsObj::createEnumeration()
uno::Type SAL_CALL ScDataPilotFieldGroupsObj::getElementType() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType( (Reference< XNameAccess >*)0 );
}
sal_Bool SAL_CALL ScDataPilotFieldGroupsObj::hasElements() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return !maGroups.empty();
}
@@ -3033,7 +3027,7 @@ sal_Bool SAL_CALL ScDataPilotFieldGroupsObj::hasElements() throw(RuntimeExceptio
ScFieldGroup& ScDataPilotFieldGroupsObj::getFieldGroup( const OUString& rName ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScFieldGroups::iterator aIt = implFindByName( rName );
if( aIt == maGroups.end() )
throw RuntimeException();
@@ -3042,7 +3036,7 @@ ScFieldGroup& ScDataPilotFieldGroupsObj::getFieldGroup( const OUString& rName )
void ScDataPilotFieldGroupsObj::renameFieldGroup( const OUString& rOldName, const OUString& rNewName ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScFieldGroups::iterator aOldIt = implFindByName( rOldName );
ScFieldGroups::iterator aNewIt = implFindByName( rNewName );
// new name must not exist yet
@@ -3051,8 +3045,6 @@ void ScDataPilotFieldGroupsObj::renameFieldGroup( const OUString& rOldName, cons
aOldIt->maName = rNewName;
}
-// private
-
ScFieldGroups::iterator ScDataPilotFieldGroupsObj::implFindByName( const OUString& rName )
{
for( ScFieldGroups::iterator aIt = maGroups.begin(), aEnd = maGroups.end(); aIt != aEnd; ++aIt )
@@ -3098,7 +3090,7 @@ ScDataPilotFieldGroupObj::~ScDataPilotFieldGroupObj()
Any SAL_CALL ScDataPilotFieldGroupObj::getByName( const OUString& rName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScFieldGroupMembers& rMembers = mrParent.getFieldGroup( maGroupName ).maMembers;
ScFieldGroupMembers::iterator aIt = ::std::find( rMembers.begin(), rMembers.end(), rName );
if( aIt == rMembers.end() )
@@ -3108,13 +3100,13 @@ Any SAL_CALL ScDataPilotFieldGroupObj::getByName( const OUString& rName )
Sequence< OUString > SAL_CALL ScDataPilotFieldGroupObj::getElementNames() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ::comphelper::containerToSequence( mrParent.getFieldGroup( maGroupName ).maMembers );
}
sal_Bool SAL_CALL ScDataPilotFieldGroupObj::hasByName( const OUString& rName ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScFieldGroupMembers& rMembers = mrParent.getFieldGroup( maGroupName ).maMembers;
return ::std::find( rMembers.begin(), rMembers.end(), rName ) != rMembers.end();
}
@@ -3124,7 +3116,7 @@ sal_Bool SAL_CALL ScDataPilotFieldGroupObj::hasByName( const OUString& rName ) t
void SAL_CALL ScDataPilotFieldGroupObj::replaceByName( const OUString& rName, const Any& rElement )
throw (IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// it should be possible to quickly rename an item -> accept string or XNamed
OUString aNewName = lclExtractMember( rElement );
@@ -3150,7 +3142,7 @@ void SAL_CALL ScDataPilotFieldGroupObj::replaceByName( const OUString& rName, co
void SAL_CALL ScDataPilotFieldGroupObj::insertByName( const OUString& rName, const Any& /*rElement*/ )
throw (IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// we will ignore the passed element and just try to insert the name
if( rName.getLength() == 0 )
@@ -3167,7 +3159,7 @@ void SAL_CALL ScDataPilotFieldGroupObj::insertByName( const OUString& rName, con
void SAL_CALL ScDataPilotFieldGroupObj::removeByName( const OUString& rName )
throw (NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( rName.getLength() == 0 )
throw IllegalArgumentException();
@@ -3183,14 +3175,14 @@ void SAL_CALL ScDataPilotFieldGroupObj::removeByName( const OUString& rName )
sal_Int32 SAL_CALL ScDataPilotFieldGroupObj::getCount() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return static_cast< sal_Int32 >( mrParent.getFieldGroup( maGroupName ).maMembers.size() );
}
Any SAL_CALL ScDataPilotFieldGroupObj::getByIndex( sal_Int32 nIndex )
throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScFieldGroupMembers& rMembers = mrParent.getFieldGroup( maGroupName ).maMembers;
if ((nIndex < 0) || (nIndex >= static_cast< sal_Int32 >( rMembers.size() )))
throw IndexOutOfBoundsException();
@@ -3201,7 +3193,7 @@ Any SAL_CALL ScDataPilotFieldGroupObj::getByIndex( sal_Int32 nIndex )
Reference< XEnumeration > SAL_CALL ScDataPilotFieldGroupObj::createEnumeration() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration( this, OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.DataPilotFieldGroupEnumeration" ) ) );
}
@@ -3209,13 +3201,13 @@ Reference< XEnumeration > SAL_CALL ScDataPilotFieldGroupObj::createEnumeration()
uno::Type SAL_CALL ScDataPilotFieldGroupObj::getElementType() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType( (Reference< XNamed >*)0 );
}
sal_Bool SAL_CALL ScDataPilotFieldGroupObj::hasElements() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return !mrParent.getFieldGroup( maGroupName ).maMembers.empty();
}
@@ -3223,13 +3215,13 @@ sal_Bool SAL_CALL ScDataPilotFieldGroupObj::hasElements() throw(RuntimeException
OUString SAL_CALL ScDataPilotFieldGroupObj::getName() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return maGroupName;
}
void SAL_CALL ScDataPilotFieldGroupObj::setName( const OUString& rName ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
mrParent.renameFieldGroup( maGroupName, rName );
// if call to renameFieldGroup() did not throw, remember the new name
maGroupName = rName;
@@ -3253,13 +3245,13 @@ ScDataPilotFieldGroupItemObj::~ScDataPilotFieldGroupItemObj()
OUString SAL_CALL ScDataPilotFieldGroupItemObj::getName() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return maName;
}
void SAL_CALL ScDataPilotFieldGroupItemObj::setName( const OUString& rName ) throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
mrParent.replaceByName( maName, Any( rName ) );
// if call to replaceByName() did not throw, remember the new name
maName = rName;
@@ -3289,13 +3281,13 @@ ScDataPilotItemObj* ScDataPilotItemsObj::GetObjectByIndex_Impl( sal_Int32 nIndex
Any SAL_CALL ScDataPilotItemsObj::getByName( const OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference<XNameAccess> xMembers = GetMembers();
if (xMembers.is())
{
Reference<XIndexAccess> xMembersIndex(new ScNameToIndexAccess( xMembers ));
sal_Int32 nCount = xMembersIndex->getCount();
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
sal_Int32 nItem = 0;
while (nItem < nCount && !bFound )
{
@@ -3313,7 +3305,7 @@ Any SAL_CALL ScDataPilotItemsObj::getByName( const OUString& aName )
Sequence<OUString> SAL_CALL ScDataPilotItemsObj::getElementNames()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Sequence< OUString > aSeq;
if( ScDPObject* pDPObj = GetDPObject() )
pDPObj->GetMemberNames( lcl_GetObjectIndex( pDPObj, maFieldId ), aSeq );
@@ -3323,8 +3315,8 @@ Sequence<OUString> SAL_CALL ScDataPilotItemsObj::getElementNames()
sal_Bool SAL_CALL ScDataPilotItemsObj::hasByName( const OUString& aName )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bFound = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bFound = false;
Reference<XNameAccess> xMembers = GetMembers();
if (xMembers.is())
{
@@ -3348,7 +3340,7 @@ sal_Bool SAL_CALL ScDataPilotItemsObj::hasByName( const OUString& aName )
Reference<XEnumeration> SAL_CALL ScDataPilotItemsObj::createEnumeration()
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.DataPilotItemsEnumeration")));
}
@@ -3356,14 +3348,14 @@ Reference<XEnumeration> SAL_CALL ScDataPilotItemsObj::createEnumeration()
sal_Int32 SAL_CALL ScDataPilotItemsObj::getCount() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetMemberCount();
}
Any SAL_CALL ScDataPilotItemsObj::getByIndex( sal_Int32 nIndex )
throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference< XPropertySet > xItem( GetObjectByIndex_Impl( nIndex ) );
if (!xItem.is())
throw IndexOutOfBoundsException();
@@ -3372,13 +3364,13 @@ Any SAL_CALL ScDataPilotItemsObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScDataPilotItemsObj::getElementType() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((Reference<XPropertySet>*)0);
}
sal_Bool SAL_CALL ScDataPilotItemsObj::hasElements() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -3398,7 +3390,7 @@ ScDataPilotItemObj::~ScDataPilotItemObj()
// XNamed
OUString SAL_CALL ScDataPilotItemObj::getName() throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
OUString sRet;
Reference<XNameAccess> xMembers = GetMembers();
if (xMembers.is())
@@ -3424,7 +3416,7 @@ Reference< XPropertySetInfo >
SAL_CALL ScDataPilotItemObj::getPropertySetInfo( )
throw(RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static Reference<XPropertySetInfo> aRef =
new SfxItemPropertySetInfo( maPropSet.getPropertyMap() );
return aRef;
@@ -3433,7 +3425,7 @@ Reference< XPropertySetInfo >
void SAL_CALL ScDataPilotItemObj::setPropertyValue( const OUString& aPropertyName, const Any& aValue )
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
@@ -3450,11 +3442,11 @@ void SAL_CALL ScDataPilotItemObj::setPropertyValue( const OUString& aPropertyNam
if (pMember)
{
bool bGetNewIndex = false;
- if ( aPropertyName.equalsAscii( SC_UNONAME_SHOWDETAIL ) )
+ if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_SHOWDETAIL ) ) )
pMember->SetShowDetails(cppu::any2bool(aValue));
- else if ( aPropertyName.equalsAscii( SC_UNONAME_ISHIDDEN ) )
+ else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN ) ) )
pMember->SetIsVisible(!cppu::any2bool(aValue));
- else if ( aPropertyName.equalsAscii( SC_UNONAME_POS ) )
+ else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_POS ) ) )
{
sal_Int32 nNewPos = 0;
if ( ( aValue >>= nNewPos ) && nNewPos >= 0 && nNewPos < nCount )
@@ -3486,7 +3478,7 @@ void SAL_CALL ScDataPilotItemObj::setPropertyValue( const OUString& aPropertyNam
Any SAL_CALL ScDataPilotItemObj::getPropertyValue( const OUString& aPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Any aRet;
if( ScDPSaveDimension* pDim = GetDPDimension() )
{
@@ -3500,7 +3492,7 @@ Any SAL_CALL ScDataPilotItemObj::getPropertyValue( const OUString& aPropertyName
Reference< XNamed > xMember( xMembersIndex->getByIndex( mnIndex ), UNO_QUERY );
String sName( xMember->getName() );
ScDPSaveMember* pMember = pDim->GetExistingMemberByName( sName );
- if( aPropertyName.equalsAscii( SC_UNONAME_SHOWDETAIL ) )
+ if( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_SHOWDETAIL ) ) )
{
if (pMember && pMember->HasShowDetails())
{
@@ -3515,7 +3507,7 @@ Any SAL_CALL ScDataPilotItemObj::getPropertyValue( const OUString& aPropertyName
aRet <<= true;
}
}
- else if ( aPropertyName.equalsAscii( SC_UNONAME_ISHIDDEN ) )
+ else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN ) ) )
{
if (pMember && pMember->HasIsVisible())
{
@@ -3530,7 +3522,7 @@ Any SAL_CALL ScDataPilotItemObj::getPropertyValue( const OUString& aPropertyName
aRet <<= false;
}
}
- else if ( aPropertyName.equalsAscii( SC_UNONAME_POS ) )
+ else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_POS ) ) )
{
aRet <<= mnIndex;
}
@@ -3569,3 +3561,4 @@ void SAL_CALL ScDataPilotItemObj::removeVetoableChangeListener(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 31ef83ee91db..d279fff0d020 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <svl/smplhint.hxx>
#include <svl/zforlist.hxx>
#include <rtl/uuid.h>
+#include <vcl/svapp.hxx>
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/util/SortField.hpp>
@@ -54,13 +56,10 @@
#include "dbcolect.hxx"
#include "docsh.hxx"
#include "dbdocfun.hxx"
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "globstr.hrc"
-#ifndef SC_CONVUNO_HXX
#include "convuno.hxx"
#include "hints.hxx"
-#endif
#include "attrib.hxx"
#include "dpshttab.hxx"
#include <comphelper/extract.hxx>
@@ -150,7 +149,6 @@ SC_SIMPLE_SERVICE_INFO( ScSubTotalFieldObj, "ScSubTotalFieldObj", "com.sun.star.
//------------------------------------------------------------------------
-// static
ScSubTotalFunc ScDataUnoConversion::GeneralToSubTotal( sheet::GeneralFunction eSummary )
{
ScSubTotalFunc eSubTotal;
@@ -170,13 +168,12 @@ ScSubTotalFunc ScDataUnoConversion::GeneralToSubTotal( sheet::GeneralFunction eS
case sheet::GeneralFunction_VARP: eSubTotal = SUBTOTAL_FUNC_VARP; break;
case sheet::GeneralFunction_AUTO:
default:
- DBG_ERROR("GeneralToSubTotal: falscher enum");
+ OSL_FAIL("GeneralToSubTotal: falscher enum");
eSubTotal = SUBTOTAL_FUNC_NONE;
}
return eSubTotal;
}
-// static
sheet::GeneralFunction ScDataUnoConversion::SubTotalToGeneral( ScSubTotalFunc eSubTotal )
{
sheet::GeneralFunction eGeneral;
@@ -195,7 +192,7 @@ sheet::GeneralFunction ScDataUnoConversion::SubTotalToGeneral( ScSubTotalFunc e
case SUBTOTAL_FUNC_VAR: eGeneral = sheet::GeneralFunction_VAR; break;
case SUBTOTAL_FUNC_VARP: eGeneral = sheet::GeneralFunction_VARP; break;
default:
- DBG_ERROR("SubTotalToGeneral: falscher enum");
+ OSL_FAIL("SubTotalToGeneral: falscher enum");
eGeneral = sheet::GeneralFunction_NONE;
break;
}
@@ -232,22 +229,22 @@ void ScImportDescriptor::FillProperties( uno::Sequence<beans::PropertyValue>& rS
aDescriptor.setDataSource(rParam.aDBName);
if (aDescriptor.has( svx::daDataSource ))
{
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_DBNAME );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_DBNAME ));
pArray[0].Value <<= rtl::OUString( rParam.aDBName );
}
else if (aDescriptor.has( svx::daConnectionResource ))
{
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_CONRES );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CONRES ));
pArray[0].Value <<= rtl::OUString( rParam.aDBName );
}
- pArray[1].Name = rtl::OUString::createFromAscii( SC_UNONAME_SRCTYPE );
+ pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SRCTYPE ));
pArray[1].Value <<= eMode;
- pArray[2].Name = rtl::OUString::createFromAscii( SC_UNONAME_SRCOBJ );
+ pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SRCOBJ ));
pArray[2].Value <<= rtl::OUString( rParam.aStatement );
- pArray[3].Name = rtl::OUString::createFromAscii( SC_UNONAME_ISNATIVE );
+ pArray[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ISNATIVE ));
ScUnoHelpFunctions::SetBoolInAny( pArray[3].Value, rParam.bNative );
}
@@ -286,7 +283,7 @@ void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequ
switch (eMode)
{
case sheet::DataImportMode_NONE:
- rParam.bImport = sal_False;
+ rParam.bImport = false;
break;
case sheet::DataImportMode_SQL:
rParam.bImport = sal_True;
@@ -294,17 +291,17 @@ void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequ
break;
case sheet::DataImportMode_TABLE:
rParam.bImport = sal_True;
- rParam.bSql = sal_False;
+ rParam.bSql = false;
rParam.nType = ScDbTable;
break;
case sheet::DataImportMode_QUERY:
rParam.bImport = sal_True;
- rParam.bSql = sal_False;
+ rParam.bSql = false;
rParam.nType = ScDbQuery;
break;
default:
- DBG_ERROR("falscher Mode");
- rParam.bImport = sal_False;
+ OSL_FAIL("falscher Mode");
+ rParam.bImport = false;
}
}
}
@@ -355,38 +352,36 @@ void ScSortDescriptor::FillProperties( uno::Sequence<beans::PropertyValue>& rSeq
// Sequence fuellen
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_ISSORTCOLUMNS );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ISSORTCOLUMNS ));
pArray[0].Value = ::cppu::bool2any(!rParam.bByRow);
- pArray[1].Name = rtl::OUString::createFromAscii( SC_UNONAME_CONTHDR );
+ pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CONTHDR ));
ScUnoHelpFunctions::SetBoolInAny( pArray[1].Value, rParam.bHasHeader );
- pArray[2].Name = rtl::OUString::createFromAscii( SC_UNONAME_MAXFLD );
+ pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_MAXFLD ));
pArray[2].Value <<= (sal_Int32) MAXSORT;
- pArray[3].Name = rtl::OUString::createFromAscii( SC_UNONAME_SORTFLD );
+ pArray[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SORTFLD ));
pArray[3].Value <<= aFields;
- pArray[4].Name = rtl::OUString::createFromAscii( SC_UNONAME_BINDFMT );
+ pArray[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_BINDFMT ));
ScUnoHelpFunctions::SetBoolInAny( pArray[4].Value, rParam.bIncludePattern );
- pArray[5].Name = rtl::OUString::createFromAscii( SC_UNONAME_COPYOUT );
+ pArray[5].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_COPYOUT ));
ScUnoHelpFunctions::SetBoolInAny( pArray[5].Value, !rParam.bInplace );
- pArray[6].Name = rtl::OUString::createFromAscii( SC_UNONAME_OUTPOS );
+ pArray[6].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_OUTPOS ));
pArray[6].Value <<= aOutPos;
- pArray[7].Name = rtl::OUString::createFromAscii( SC_UNONAME_ISULIST );
+ pArray[7].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ISULIST ));
ScUnoHelpFunctions::SetBoolInAny( pArray[7].Value, rParam.bUserDef );
- pArray[8].Name = rtl::OUString::createFromAscii( SC_UNONAME_UINDEX );
+ pArray[8].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_UINDEX ));
pArray[8].Value <<= (sal_Int32) rParam.nUserIndex;
}
void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<beans::PropertyValue>& rSeq )
{
- sal_Bool bOldSortDescriptor(sal_False);
- sal_Bool bNewSortDescriptor(sal_False);
const beans::PropertyValue* pPropArray = rSeq.getConstArray();
long nPropCount = rSeq.getLength();
for (long nProp = 0; nProp < nPropCount; nProp++)
@@ -396,7 +391,6 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
if (aPropName.EqualsAscii( SC_UNONAME_ORIENT ))
{
- bOldSortDescriptor = sal_True;
//! test for correct enum type?
table::TableOrientation eOrient = (table::TableOrientation)
ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
@@ -404,7 +398,6 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
}
else if (aPropName.EqualsAscii( SC_UNONAME_ISSORTCOLUMNS ))
{
- bNewSortDescriptor = sal_True;
rParam.bByRow = !::cppu::any2bool(rProp.Value);
}
else if (aPropName.EqualsAscii( SC_UNONAME_CONTHDR ))
@@ -424,12 +417,11 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
uno::Sequence<table::TableSortField> aNewSeq;
if ( rProp.Value >>= aSeq )
{
- bOldSortDescriptor = sal_True;
- sal_Int32 nCount = aSeq.getLength();
- sal_Int32 i;
+ INT32 nCount = aSeq.getLength();
+ INT32 i;
if ( nCount > MAXSORT )
{
- DBG_ERROR("Zu viele Sortierfelder");
+ OSL_FAIL("Zu viele Sortierfelder");
nCount = MAXSORT;
}
const util::SortField* pFieldArray = aSeq.getConstArray();
@@ -442,16 +434,15 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
rParam.bDoSort[i] = sal_True;
}
for (i=nCount; i<MAXSORT; i++)
- rParam.bDoSort[i] = sal_False;
+ rParam.bDoSort[i] = false;
}
else if ( rProp.Value >>= aNewSeq )
{
- bNewSortDescriptor = sal_True;
- sal_Int32 nCount = aNewSeq.getLength();
- sal_Int32 i;
+ INT32 nCount = aNewSeq.getLength();
+ INT32 i;
if ( nCount > MAXSORT )
{
- DBG_ERROR("Zu viele Sortierfelder");
+ OSL_FAIL("Zu viele Sortierfelder");
nCount = MAXSORT;
}
const table::TableSortField* pFieldArray = aNewSeq.getConstArray();
@@ -469,12 +460,11 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
rParam.bDoSort[i] = sal_True;
}
for (i=nCount; i<MAXSORT; i++)
- rParam.bDoSort[i] = sal_False;
+ rParam.bDoSort[i] = false;
}
}
else if (aPropName.EqualsAscii( SC_UNONAME_ISCASE ))
{
- bOldSortDescriptor = sal_True;
rParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
}
else if (aPropName.EqualsAscii( SC_UNONAME_BINDFMT ))
@@ -501,12 +491,10 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
}
else if (aPropName.EqualsAscii( SC_UNONAME_COLLLOC ))
{
- bOldSortDescriptor = sal_True;
rProp.Value >>= rParam.aCollatorLocale;
}
else if (aPropName.EqualsAscii( SC_UNONAME_COLLALG ))
{
- bOldSortDescriptor = sal_True;
rtl::OUString sStr;
if ( rProp.Value >>= sStr )
rParam.aCollatorAlgorithm = sStr;
@@ -532,7 +520,7 @@ ScSubTotalFieldObj::~ScSubTotalFieldObj()
sal_Int32 SAL_CALL ScSubTotalFieldObj::getGroupColumn() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
rParent.GetData(aParam);
@@ -541,7 +529,7 @@ sal_Int32 SAL_CALL ScSubTotalFieldObj::getGroupColumn() throw(uno::RuntimeExcept
void SAL_CALL ScSubTotalFieldObj::setGroupColumn( sal_Int32 nGroupColumn ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
rParent.GetData(aParam);
@@ -553,7 +541,7 @@ void SAL_CALL ScSubTotalFieldObj::setGroupColumn( sal_Int32 nGroupColumn ) throw
uno::Sequence<sheet::SubTotalColumn> SAL_CALL ScSubTotalFieldObj::getSubTotalColumns()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
rParent.GetData(aParam);
@@ -573,7 +561,7 @@ void SAL_CALL ScSubTotalFieldObj::setSubTotalColumns(
const uno::Sequence<sheet::SubTotalColumn>& aSubTotalColumns )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
rParent.GetData(aParam);
@@ -621,12 +609,12 @@ ScSubTotalDescriptorBase::~ScSubTotalDescriptorBase()
void ScSubTotalDescriptorBase::GetData( ScSubTotalParam& /* rParam */ ) const
{
- DBG_ERROR("ScSubTotalDescriptorBase::GetData soll nicht gerufen werden");
+ OSL_FAIL("ScSubTotalDescriptorBase::GetData soll nicht gerufen werden");
}
void ScSubTotalDescriptorBase::PutData( const ScSubTotalParam& /* rParam */ )
{
- DBG_ERROR("ScSubTotalDescriptorBase::PutData soll nicht gerufen werden");
+ OSL_FAIL("ScSubTotalDescriptorBase::PutData soll nicht gerufen werden");
}
// XSubTotalDesctiptor
@@ -640,12 +628,12 @@ ScSubTotalFieldObj* ScSubTotalDescriptorBase::GetObjectByIndex_Impl(sal_uInt16 n
void SAL_CALL ScSubTotalDescriptorBase::clear() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
GetData(aParam);
for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++)
- aParam.bGroupActive[i] = sal_False;
+ aParam.bGroupActive[i] = false;
//! Notify oder so fuer die Field-Objekte???
@@ -656,7 +644,7 @@ void SAL_CALL ScSubTotalDescriptorBase::addNew(
const uno::Sequence<sheet::SubTotalColumn>& aSubTotalColumns,
sal_Int32 nGroupColumn ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
GetData(aParam);
@@ -708,7 +696,7 @@ void SAL_CALL ScSubTotalDescriptorBase::addNew(
uno::Reference<container::XEnumeration> SAL_CALL ScSubTotalDescriptorBase::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SubTotalFieldsEnumeration")));
}
@@ -716,7 +704,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScSubTotalDescriptorBase::creat
sal_Int32 SAL_CALL ScSubTotalDescriptorBase::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
GetData(aParam);
@@ -730,24 +718,23 @@ uno::Any SAL_CALL ScSubTotalDescriptorBase::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XSubTotalField> xField(GetObjectByIndex_Impl((sal_uInt16)nIndex));
if (xField.is())
return uno::makeAny(xField);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScSubTotalDescriptorBase::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XSubTotalField>*)0);
}
sal_Bool SAL_CALL ScSubTotalDescriptorBase::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -756,7 +743,7 @@ sal_Bool SAL_CALL ScSubTotalDescriptorBase::hasElements() throw(uno::RuntimeExce
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScSubTotalDescriptorBase::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -768,7 +755,7 @@ void SAL_CALL ScSubTotalDescriptorBase::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
GetData(aParam);
@@ -810,7 +797,7 @@ uno::Any SAL_CALL ScSubTotalDescriptorBase::getPropertyValue( const rtl::OUStrin
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSubTotalParam aParam;
GetData(aParam);
@@ -855,7 +842,6 @@ sal_Int64 SAL_CALL ScSubTotalDescriptorBase::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScSubTotalDescriptorBase::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -872,7 +858,6 @@ const uno::Sequence<sal_Int8>& ScSubTotalDescriptorBase::getUnoTunnelId()
return *pSeq;
}
-// static
ScSubTotalDescriptorBase* ScSubTotalDescriptorBase::getImplementation(
const uno::Reference<sheet::XSubTotalDescriptor> xObj )
{
@@ -954,21 +939,21 @@ void ScConsolidationDescriptor::SetParam( const ScConsolidateParam& rNew )
sheet::GeneralFunction SAL_CALL ScConsolidationDescriptor::getFunction() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScDataUnoConversion::SubTotalToGeneral(aParam.eFunction);
}
void SAL_CALL ScConsolidationDescriptor::setFunction( sheet::GeneralFunction nFunction )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aParam.eFunction = ScDataUnoConversion::GeneralToSubTotal(nFunction);
}
uno::Sequence<table::CellRangeAddress> SAL_CALL ScConsolidationDescriptor::getSources()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aParam.nDataAreaCount;
if (!aParam.ppDataAreas)
nCount = 0;
@@ -995,7 +980,7 @@ void SAL_CALL ScConsolidationDescriptor::setSources(
const uno::Sequence<table::CellRangeAddress>& aSources )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = (sal_uInt16)aSources.getLength();
if (nCount)
{
@@ -1020,7 +1005,7 @@ void SAL_CALL ScConsolidationDescriptor::setSources(
table::CellAddress SAL_CALL ScConsolidationDescriptor::getStartOutputPosition()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellAddress aPos;
aPos.Column = aParam.nCol;
aPos.Row = aParam.nRow;
@@ -1032,7 +1017,7 @@ void SAL_CALL ScConsolidationDescriptor::setStartOutputPosition(
const table::CellAddress& aStartOutputPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aParam.nCol = (SCCOL)aStartOutputPosition.Column;
aParam.nRow = (SCROW)aStartOutputPosition.Row;
aParam.nTab = aStartOutputPosition.Sheet;
@@ -1040,40 +1025,40 @@ void SAL_CALL ScConsolidationDescriptor::setStartOutputPosition(
sal_Bool SAL_CALL ScConsolidationDescriptor::getUseColumnHeaders() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aParam.bByCol;
}
void SAL_CALL ScConsolidationDescriptor::setUseColumnHeaders( sal_Bool bUseColumnHeaders )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aParam.bByCol = bUseColumnHeaders;
}
sal_Bool SAL_CALL ScConsolidationDescriptor::getUseRowHeaders() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aParam.bByRow;
}
void SAL_CALL ScConsolidationDescriptor::setUseRowHeaders( sal_Bool bUseRowHeaders )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aParam.bByRow = bUseRowHeaders;
}
sal_Bool SAL_CALL ScConsolidationDescriptor::getInsertLinks() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aParam.bReferenceData;
}
void SAL_CALL ScConsolidationDescriptor::setInsertLinks( sal_Bool bInsertLinks )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aParam.bReferenceData = bInsertLinks;
}
@@ -1110,7 +1095,7 @@ void ScFilterDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
uno::Sequence<sheet::TableFilterField> SAL_CALL ScFilterDescriptorBase::getFilterFields()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
@@ -1168,7 +1153,7 @@ uno::Sequence<sheet::TableFilterField> SAL_CALL ScFilterDescriptorBase::getFilte
case SC_TOPPERC: aField.Operator = sheet::FilterOperator_TOP_PERCENT; break;
case SC_BOTPERC: aField.Operator = sheet::FilterOperator_BOTTOM_PERCENT; break;
default:
- DBG_ERROR("Falscher Filter-enum");
+ OSL_FAIL("Falscher Filter-enum");
aField.Operator = sheet::FilterOperator_EMPTY;
}
pAry[i] = aField;
@@ -1179,7 +1164,7 @@ uno::Sequence<sheet::TableFilterField> SAL_CALL ScFilterDescriptorBase::getFilte
uno::Sequence<sheet::TableFilterField2> SAL_CALL ScFilterDescriptorBase::getFilterFields2()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
@@ -1242,7 +1227,7 @@ throw(uno::RuntimeException)
case SC_ENDS_WITH: aField.Operator = sheet::FilterOperator2::ENDS_WITH; break;
case SC_DOES_NOT_END_WITH: aField.Operator = sheet::FilterOperator2::DOES_NOT_END_WITH; break;
default:
- DBG_ERROR("Falscher Filter-enum");
+ OSL_FAIL("Falscher Filter-enum");
aField.Operator = sheet::FilterOperator2::EMPTY;
}
pAry[i] = aField;
@@ -1254,7 +1239,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields(
const uno::Sequence<sheet::TableFilterField>& aFilterFields )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
@@ -1299,7 +1284,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields(
{
rEntry.eOp = SC_EQUAL;
rEntry.nVal = SC_EMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
*rEntry.pStr = EMPTY_STRING;
}
break;
@@ -1307,19 +1292,19 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields(
{
rEntry.eOp = SC_EQUAL;
rEntry.nVal = SC_NONEMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
*rEntry.pStr = EMPTY_STRING;
}
break;
default:
- DBG_ERROR("Falscher Query-enum");
+ OSL_FAIL("Falscher Query-enum");
rEntry.eOp = SC_EQUAL;
}
}
SCSIZE nParamCount = aParam.GetEntryCount(); // Param wird nicht unter 8 resized
for (i=nCount; i<nParamCount; i++)
- aParam.GetEntry(i).bDoQuery = sal_False; // ueberzaehlige Felder zuruecksetzen
+ aParam.GetEntry(i).bDoQuery = false; // ueberzaehlige Felder zuruecksetzen
PutData(aParam);
}
@@ -1328,7 +1313,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields2(
const uno::Sequence<sheet::TableFilterField2>& aFilterFields )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
@@ -1379,7 +1364,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields2(
{
rEntry.eOp = SC_EQUAL;
rEntry.nVal = SC_EMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
*rEntry.pStr = EMPTY_STRING;
}
break;
@@ -1387,19 +1372,19 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields2(
{
rEntry.eOp = SC_EQUAL;
rEntry.nVal = SC_NONEMPTYFIELDS;
- rEntry.bQueryByString = sal_False;
+ rEntry.bQueryByString = false;
*rEntry.pStr = EMPTY_STRING;
}
break;
default:
- DBG_ERROR("Falscher Query-enum");
+ OSL_FAIL("Falscher Query-enum");
rEntry.eOp = SC_EQUAL;
}
}
SCSIZE nParamCount = aParam.GetEntryCount(); // Param wird nicht unter 8 resized
for (i=nCount; i<nParamCount; i++)
- aParam.GetEntry(i).bDoQuery = sal_False; // ueberzaehlige Felder zuruecksetzen
+ aParam.GetEntry(i).bDoQuery = false; // ueberzaehlige Felder zuruecksetzen
PutData(aParam);
}
@@ -1411,7 +1396,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields2(
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScFilterDescriptorBase::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -1423,7 +1408,7 @@ void SAL_CALL ScFilterDescriptorBase::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
@@ -1473,7 +1458,7 @@ uno::Any SAL_CALL ScFilterDescriptorBase::getPropertyValue( const rtl::OUString&
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
@@ -1591,7 +1576,7 @@ void ScDataPilotFilterDescriptor::GetData( ScQueryParam& rParam ) const
{
ScDPObject* pDPObj = pParent->GetDPObject();
if (pDPObj && pDPObj->IsSheetData())
- rParam = pDPObj->GetSheetDesc()->aQueryParam;
+ rParam = pDPObj->GetSheetDesc()->GetQueryParam();
}
}
@@ -1602,10 +1587,10 @@ void ScDataPilotFilterDescriptor::PutData( const ScQueryParam& rParam )
ScDPObject* pDPObj = pParent->GetDPObject();
if (pDPObj)
{
- ScSheetSourceDesc aSheetDesc;
+ ScSheetSourceDesc aSheetDesc(pParent->GetDocShell()->GetDocument());
if (pDPObj->IsSheetData())
aSheetDesc = *pDPObj->GetSheetDesc();
- aSheetDesc.aQueryParam = rParam;
+ aSheetDesc.SetQueryParam(rParam);
pDPObj->SetSheetDesc(aSheetDesc);
pParent->SetDPObject(pDPObj);
}
@@ -1666,14 +1651,14 @@ ScDBData* ScDatabaseRangeObj::GetDBData_Impl() const
rtl::OUString SAL_CALL ScDatabaseRangeObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aName;
}
void SAL_CALL ScDatabaseRangeObj::setName( const rtl::OUString& aNewName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDBDocFunc aFunc(*pDocShell);
@@ -1688,7 +1673,7 @@ void SAL_CALL ScDatabaseRangeObj::setName( const rtl::OUString& aNewName )
table::CellRangeAddress SAL_CALL ScDatabaseRangeObj::getDataArea() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aAddress;
ScDBData* pData = GetDBData_Impl();
if (pData)
@@ -1707,7 +1692,7 @@ table::CellRangeAddress SAL_CALL ScDatabaseRangeObj::getDataArea() throw(uno::Ru
void SAL_CALL ScDatabaseRangeObj::setDataArea( const table::CellRangeAddress& aDataArea )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDBData* pData = GetDBData_Impl();
if ( pDocShell && pData )
{
@@ -1723,7 +1708,7 @@ void SAL_CALL ScDatabaseRangeObj::setDataArea( const table::CellRangeAddress& aD
uno::Sequence<beans::PropertyValue> SAL_CALL ScDatabaseRangeObj::getSortDescriptor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScSortParam aParam;
const ScDBData* pData = GetDBData_Impl();
if (pData)
@@ -1795,7 +1780,7 @@ void ScDatabaseRangeObj::SetQueryParam(const ScQueryParam& rQueryParam)
uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScDatabaseRangeObj::getFilterDescriptor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScRangeFilterDescriptor(pDocShell, this);
}
@@ -1855,14 +1840,14 @@ void ScDatabaseRangeObj::SetSubTotalParam(const ScSubTotalParam& rSubTotalParam)
uno::Reference<sheet::XSubTotalDescriptor> SAL_CALL ScDatabaseRangeObj::getSubTotalDescriptor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScRangeSubTotalDescriptor(this);
}
uno::Sequence<beans::PropertyValue> SAL_CALL ScDatabaseRangeObj::getImportDescriptor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScImportParam aParam;
const ScDBData* pData = GetDBData_Impl();
if (pData)
@@ -1877,7 +1862,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScDatabaseRangeObj::getImportDescri
void SAL_CALL ScDatabaseRangeObj::refresh() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDBData* pData = GetDBData_Impl();
if ( pDocShell && pData )
{
@@ -1894,7 +1879,7 @@ void SAL_CALL ScDatabaseRangeObj::refresh() throw(uno::RuntimeException)
SCROW nDummyRow;
pData->GetArea( nTab, nDummyCol,nDummyRow,nDummyCol,nDummyRow );
uno::Reference< sdbc::XResultSet > xResultSet;
- bContinue = aFunc.DoImport( nTab, aImportParam, xResultSet, NULL, sal_True, sal_False ); //! Api-Flag als Parameter
+ bContinue = aFunc.DoImport( nTab, aImportParam, xResultSet, NULL, sal_True, false ); //! Api-Flag als Parameter
}
// interne Operationen (sort, query, subtotal) nur, wenn kein Fehler
@@ -1907,7 +1892,7 @@ void SAL_CALL ScDatabaseRangeObj::addRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<util::XRefreshListener>* pObj =
new uno::Reference<util::XRefreshListener>( xListener );
aRefreshListeners.Insert( pObj, aRefreshListeners.Count() );
@@ -1921,7 +1906,7 @@ void SAL_CALL ScDatabaseRangeObj::removeRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aRefreshListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -1949,7 +1934,7 @@ void ScDatabaseRangeObj::Refreshed_Impl()
uno::Reference<table::XCellRange> SAL_CALL ScDatabaseRangeObj::getReferredCells()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRange aRange;
ScDBData* pData = GetDBData_Impl();
if ( pData )
@@ -1970,7 +1955,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScDatabaseRangeObj::getReferredCells(
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDatabaseRangeObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -1982,7 +1967,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDBData* pData = GetDBData_Impl();
if ( pDocShell && pData )
{
@@ -2059,7 +2044,7 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
{
}
else
- bDo = sal_False;
+ bDo = false;
if (bDo)
{
@@ -2073,7 +2058,7 @@ uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const rtl::OUString& aPr
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aRet;
ScDBData* pData = GetDBData_Impl();
if ( pData )
@@ -2147,7 +2132,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDatabaseRangeObj )
rtl::OUString SAL_CALL ScDatabaseRangeObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScDatabaseRangeObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScDatabaseRangeObj" ));
}
sal_Bool SAL_CALL ScDatabaseRangeObj::supportsService( const rtl::OUString& rServiceName )
@@ -2163,8 +2148,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScDatabaseRangeObj::getSupportedServiceNam
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCDATABASERANGEOBJ_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCLINKTARGET_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDATABASERANGEOBJ_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCLINKTARGET_SERVICE ));
return aRet;
}
@@ -2221,8 +2206,8 @@ void SAL_CALL ScDatabaseRangesObj::addNewByName( const rtl::OUString& aName,
const table::CellRangeAddress& aRange )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if (pDocShell)
{
ScDBDocFunc aFunc(*pDocShell);
@@ -2239,8 +2224,8 @@ void SAL_CALL ScDatabaseRangesObj::addNewByName( const rtl::OUString& aName,
void SAL_CALL ScDatabaseRangesObj::removeByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if (pDocShell)
{
ScDBDocFunc aFunc(*pDocShell);
@@ -2256,7 +2241,7 @@ void SAL_CALL ScDatabaseRangesObj::removeByName( const rtl::OUString& aName )
uno::Reference<container::XEnumeration> SAL_CALL ScDatabaseRangesObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.DatabaseRangesEnumeration")));
}
@@ -2264,7 +2249,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScDatabaseRangesObj::createEnum
sal_Int32 SAL_CALL ScDatabaseRangesObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! "unbenannt" weglassen ?
@@ -2281,24 +2266,23 @@ uno::Any SAL_CALL ScDatabaseRangesObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XDatabaseRange> xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
if (xRange.is())
return uno::makeAny(xRange);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScDatabaseRangesObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XDatabaseRange>*)0);
}
sal_Bool SAL_CALL ScDatabaseRangesObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -2308,7 +2292,7 @@ uno::Any SAL_CALL ScDatabaseRangesObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XDatabaseRange> xRange(GetObjectByName_Impl(aName));
if (xRange.is())
return uno::makeAny(xRange);
@@ -2320,7 +2304,7 @@ uno::Any SAL_CALL ScDatabaseRangesObj::getByName( const rtl::OUString& aName )
uno::Sequence<rtl::OUString> SAL_CALL ScDatabaseRangesObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! "unbenannt" weglassen ?
@@ -2345,7 +2329,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScDatabaseRangesObj::getElementNames()
sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! "unbenannt" weglassen ?
@@ -2360,7 +2344,7 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const rtl::OUString& aName )
return sal_True;
}
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -2369,3 +2353,4 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const rtl::OUString& aName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index 2ddcb60309af..71193ff7f2fe 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include <svl/smplhint.hxx>
#include <svl/itemprop.hxx>
#include <svx/unomid.hxx>
+#include <vcl/svapp.hxx>
#include <i18npool/mslangid.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -42,7 +44,6 @@
#include "miscuno.hxx"
#include "docsh.hxx"
#include "docpool.hxx"
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "docoptio.hxx"
@@ -128,7 +129,7 @@ void ScDocDefaultsObj::ItemsChanged()
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDocDefaultsObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef = new SfxItemPropertySetInfo(
&aPropertyMap );
return aRef;
@@ -140,7 +141,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !pDocShell )
throw uno::RuntimeException();
@@ -234,7 +235,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyValue( const rtl::OUString& aProp
{
// use pool default if set
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !pDocShell )
throw uno::RuntimeException();
@@ -291,7 +292,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDocDefaultsObj )
beans::PropertyState SAL_CALL ScDocDefaultsObj::getPropertyState( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !pDocShell )
throw uno::RuntimeException();
@@ -328,7 +329,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScDocDefaultsObj::getPropertyStates
{
// the simple way: call getPropertyState
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const rtl::OUString* pNames = aPropertyNames.getConstArray();
uno::Sequence<beans::PropertyState> aRet(aPropertyNames.getLength());
beans::PropertyState* pStates = aRet.getArray();
@@ -340,7 +341,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScDocDefaultsObj::getPropertyStates
void SAL_CALL ScDocDefaultsObj::setPropertyToDefault( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !pDocShell )
throw uno::RuntimeException();
@@ -364,7 +365,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const rtl::OUString& aPr
{
// always use static default
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !pDocShell )
throw uno::RuntimeException();
@@ -385,3 +386,4 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const rtl::OUString& aPr
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/detreg.cxx b/sc/source/ui/unoobj/detreg.cxx
index e1e77e5deac9..388a652e32eb 100644
--- a/sc/source/ui/unoobj/detreg.cxx
+++ b/sc/source/ui/unoobj/detreg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -88,3 +89,4 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImple
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index 272c9e95b9c3..12699b5f0e08 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,13 +35,13 @@
#include <comphelper/uno3.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include <svl/smplhint.hxx>
+#include <vcl/svapp.hxx>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include "dispuno.hxx"
-#include "unoguard.hxx"
#include "tabvwsh.hxx"
#include "dbdocfun.hxx"
#include "dbcolect.hxx"
@@ -119,7 +120,7 @@ uno::Reference<frame::XDispatch> SAL_CALL ScDispatchProviderInterceptor::queryDi
sal_Int32 nSearchFlags )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<frame::XDispatch> xResult;
// create some dispatch ...
@@ -144,7 +145,7 @@ uno::Sequence< uno::Reference<frame::XDispatch> > SAL_CALL
const uno::Sequence<frame::DispatchDescriptor>& aDescripts )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Reference< frame::XDispatch> > aReturn(aDescripts.getLength());
uno::Reference< frame::XDispatch>* pReturn = aReturn.getArray();
@@ -163,7 +164,7 @@ uno::Reference<frame::XDispatchProvider> SAL_CALL
ScDispatchProviderInterceptor::getSlaveDispatchProvider()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return m_xSlaveDispatcher;
}
@@ -171,7 +172,7 @@ void SAL_CALL ScDispatchProviderInterceptor::setSlaveDispatchProvider(
const uno::Reference<frame::XDispatchProvider>& xNewDispatchProvider )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
m_xSlaveDispatcher.set(xNewDispatchProvider);
}
@@ -179,7 +180,7 @@ uno::Reference<frame::XDispatchProvider> SAL_CALL
ScDispatchProviderInterceptor::getMasterDispatchProvider()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return m_xMasterDispatcher;
}
@@ -187,7 +188,7 @@ void SAL_CALL ScDispatchProviderInterceptor::setMasterDispatchProvider(
const uno::Reference<frame::XDispatchProvider>& xNewSupplier )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
m_xMasterDispatcher.set(xNewSupplier);
}
@@ -196,7 +197,7 @@ void SAL_CALL ScDispatchProviderInterceptor::setMasterDispatchProvider(
void SAL_CALL ScDispatchProviderInterceptor::disposing( const lang::EventObject& /* Source */ )
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (m_xIntercepted.is())
{
@@ -215,7 +216,7 @@ void SAL_CALL ScDispatchProviderInterceptor::disposing( const lang::EventObject&
ScDispatch::ScDispatch(ScTabViewShell* pViewSh) :
pViewShell( pViewSh ),
- bListeningToView( sal_False )
+ bListeningToView( false )
{
if (pViewShell)
StartListening(*pViewShell);
@@ -247,9 +248,9 @@ void SAL_CALL ScDispatch::dispatch( const util::URL& aURL,
const uno::Sequence<beans::PropertyValue>& aArgs )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if ( pViewShell && !aURL.Complete.compareToAscii(cURLInsertColumns) )
{
ScViewData* pViewData = pViewShell->GetViewData();
@@ -296,7 +297,7 @@ void SAL_CALL ScDispatch::addStatusListener(
const util::URL& aURL )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pViewShell)
throw uno::RuntimeException();
@@ -321,7 +322,7 @@ void SAL_CALL ScDispatch::addStatusListener(
bListeningToView = sal_True;
}
- ScDBData* pDBData = pViewShell->GetDBData(sal_False,SC_DB_OLD);
+ ScDBData* pDBData = pViewShell->GetDBData(false,SC_DB_OLD);
if ( pDBData )
pDBData->GetImportParam( aLastImport );
lcl_FillDataSource( aEvent, aLastImport ); // modifies State, IsEnabled
@@ -336,7 +337,7 @@ void SAL_CALL ScDispatch::removeStatusListener(
const util::URL& aURL )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( !aURL.Complete.compareToAscii(cURLDocDataSource) )
{
@@ -356,7 +357,7 @@ void SAL_CALL ScDispatch::removeStatusListener(
uno::Reference<view::XSelectionSupplier> xSupplier(lcl_GetSelectionSupplier( pViewShell ));
if ( xSupplier.is() )
xSupplier->removeSelectionChangeListener(this);
- bListeningToView = sal_False;
+ bListeningToView = false;
}
}
}
@@ -371,7 +372,7 @@ void SAL_CALL ScDispatch::selectionChanged( const ::com::sun::star::lang::EventO
if ( pViewShell )
{
ScImportParam aNewImport;
- ScDBData* pDBData = pViewShell->GetDBData(sal_False,SC_DB_OLD);
+ ScDBData* pDBData = pViewShell->GetDBData(false,SC_DB_OLD);
if ( pDBData )
pDBData->GetImportParam( aNewImport );
@@ -403,7 +404,7 @@ void SAL_CALL ScDispatch::disposing( const ::com::sun::star::lang::EventObject&
{
uno::Reference<view::XSelectionSupplier> xSupplier(rSource.Source, uno::UNO_QUERY);
xSupplier->removeSelectionChangeListener(this);
- bListeningToView = sal_False;
+ bListeningToView = false;
lang::EventObject aEvent;
aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
@@ -413,3 +414,4 @@ void SAL_CALL ScDispatch::disposing( const ::com::sun::star::lang::EventObject&
pViewShell = NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 23eb1abd2d82..e84f6756757e 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,7 +88,6 @@
#include "rangeutl.hxx"
#include "markdata.hxx"
#include "docoptio.hxx"
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "shapeuno.hxx"
#include "viewuno.hxx"
@@ -102,6 +102,7 @@
#include "scresid.hxx"
using namespace com::sun::star;
+#define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ?
//------------------------------------------------------------------------
@@ -117,6 +118,7 @@ const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap()
{MAP_CHAR_LEN(SC_UNO_AUTOCONTFOC), 0, &getBooleanCppuType(), 0, 0},
{MAP_CHAR_LEN(SC_UNO_BASICLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0},
{MAP_CHAR_LEN(SC_UNO_DIALOGLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(SC_UNO_VBADOCOBJ), 0, &getCppuType((beans::PropertyValue*)0), beans::PropertyAttribute::READONLY, 0},
{MAP_CHAR_LEN(SC_UNO_CALCASSHOWN), PROP_UNO_CALCASSHOWN, &getBooleanCppuType(), 0, 0},
{MAP_CHAR_LEN(SC_UNONAME_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0},
{MAP_CHAR_LEN(SC_UNO_CJK_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0},
@@ -236,7 +238,7 @@ ScPrintUIOptions::ScPrintUIOptions()
String aAppGroupname( aStrings.GetString( 9 ) );
aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) );
- m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) );
+ m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
// create subgroup for pages
m_aUIProperties[1].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), rtl::OUString() );
@@ -316,17 +318,17 @@ void ScPrintUIOptions::SetDefaults()
for (sal_Int32 nPropPos=0; nPropPos<aUIProp.getLength(); ++nPropPos)
{
rtl::OUString aName = aUIProp[nPropPos].Name;
- if ( aName.equalsAscii("Property") )
+ if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
{
beans::PropertyValue aPropertyValue;
if ( aUIProp[nPropPos].Value >>= aPropertyValue )
{
- if ( aPropertyValue.Name.equalsAscii( "PrintContent" ) )
+ if ( aPropertyValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintContent" ) ) )
{
aPropertyValue.Value <<= nContent;
aUIProp[nPropPos].Value <<= aPropertyValue;
}
- else if ( aPropertyValue.Name.equalsAscii( "IsIncludeEmptyPages" ) )
+ else if ( aPropertyValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsIncludeEmptyPages") ) )
{
ScUnoHelpFunctions::SetBoolInAny( aPropertyValue.Value, ! bSuppress );
aUIProp[nPropPos].Value <<= aPropertyValue;
@@ -339,7 +341,6 @@ void ScPrintUIOptions::SetDefaults()
}
}
-// static
void ScModelObj::CreateAndSet(ScDocShell* pDocSh)
{
if (pDocSh)
@@ -626,7 +627,7 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
uno::Reference<sheet::XSpreadsheets> SAL_CALL ScModelObj::getSheets() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScTableSheetsObj(pDocShell);
return NULL;
@@ -637,7 +638,7 @@ uno::Reference<sheet::XSpreadsheets> SAL_CALL ScModelObj::getSheets() throw(uno:
uno::Reference<container::XNameAccess> SAL_CALL ScModelObj::getStyleFamilies()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScStyleFamiliesObj(pDocShell);
return NULL;
@@ -761,12 +762,12 @@ sal_Bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
DBG_ASSERT( !rMark.IsMarked() && !rMark.IsMultiMarked(), "FillRenderMarkData: MarkData must be empty" );
DBG_ASSERT( pDocShell, "FillRenderMarkData: DocShell must be set" );
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
uno::Reference<frame::XController> xView;
// defaults when no options are passed: all sheets, include empty pages
- sal_Bool bSelectedSheetsOnly = sal_False;
+ sal_Bool bSelectedSheetsOnly = false;
sal_Bool bIncludeEmptyPages = sal_True;
bool bHasPrintContent = false;
@@ -776,28 +777,28 @@ sal_Bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
for( sal_Int32 i = 0, nLen = rOptions.getLength(); i < nLen; i++ )
{
- if( rOptions[i].Name.equalsAscii( "IsOnlySelectedSheets" ) )
+ if( rOptions[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsOnlySelectedSheets" ) ) )
{
rOptions[i].Value >>= bSelectedSheetsOnly;
}
- else if( rOptions[i].Name.equalsAscii( "IsIncludeEmptyPages" ) )
+ else if( rOptions[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsIncludeEmptyPages" ) ) )
{
rOptions[i].Value >>= bIncludeEmptyPages;
}
- else if( rOptions[i].Name.equalsAscii( "PageRange" ) )
+ else if( rOptions[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PageRange" ) ) )
{
rOptions[i].Value >>= aPageRange;
}
- else if( rOptions[i].Name.equalsAscii( "PrintRange" ) )
+ else if( rOptions[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) )
{
rOptions[i].Value >>= nPrintRange;
}
- else if( rOptions[i].Name.equalsAscii( "PrintContent" ) )
+ else if( rOptions[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintContent" ) ) )
{
bHasPrintContent = true;
rOptions[i].Value >>= nPrintContent;
}
- else if( rOptions[i].Name.equalsAscii( "View" ) )
+ else if( rOptions[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "View" ) ) )
{
rOptions[i].Value >>= xView;
}
@@ -818,7 +819,7 @@ sal_Bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
sal_Bool bCursor = pSelObj->IsCursorOnly();
const ScRangeList& rRanges = pSelObj->GetRangeList();
- rMark.MarkFromRangeList( rRanges, sal_False );
+ rMark.MarkFromRangeList( rRanges, false );
rMark.MarkToSimple();
if ( rMark.IsMultiMarked() )
@@ -907,7 +908,7 @@ sal_Bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
for (SCTAB nTab = 0; nTab < nTabCount; nTab++)
if (!rViewMark.GetTableSelect(nTab))
- rMark.SelectTable( nTab, sal_False );
+ rMark.SelectTable( nTab, false );
}
}
}
@@ -931,7 +932,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount( const uno::Any& aSelection,
const uno::Sequence<beans::PropertyValue>& rOptions )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
throw uno::RuntimeException();
@@ -983,7 +984,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
const uno::Any& aSelection, const uno::Sequence<beans::PropertyValue>& rOptions )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
throw uno::RuntimeException();
@@ -1015,7 +1016,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
uno::Sequence<beans::PropertyValue> aSequence(1);
beans::PropertyValue* pArray = aSequence.getArray();
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_PAGESIZE );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_PAGESIZE ));
pArray[0].Value <<= aPageSize;
if( ! pPrinterOptions )
@@ -1052,7 +1053,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
long nTabStart = pPrintFuncCache->GetTabStart( nTab );
- (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, sal_False, NULL, NULL );
+ (void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, NULL, NULL );
ScRange aCellRange;
sal_Bool bWasCellRange = aFunc.GetLastSourceRange( aCellRange );
@@ -1062,23 +1063,20 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
long nPropCount = bWasCellRange ? 3 : 2;
uno::Sequence<beans::PropertyValue> aSequence(nPropCount);
beans::PropertyValue* pArray = aSequence.getArray();
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_PAGESIZE );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_PAGESIZE ));
pArray[0].Value <<= aPageSize;
// #i111158# all positions are relative to the whole page, including non-printable area
- pArray[1].Name = rtl::OUString::createFromAscii( SC_UNONAME_INC_NP_AREA );
+ pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_INC_NP_AREA ));
pArray[1].Value = uno::makeAny( sal_True );
if ( bWasCellRange )
{
table::CellRangeAddress aRangeAddress( nTab,
aCellRange.aStart.Col(), aCellRange.aStart.Row(),
aCellRange.aEnd.Col(), aCellRange.aEnd.Row() );
- pArray[2].Name = rtl::OUString::createFromAscii( SC_UNONAME_SOURCERANGE );
+ pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SOURCERANGE ));
pArray[2].Value <<= aRangeAddress;
}
- #if 0
- const ScPrintOptions& rPrintOpt =
- #endif
// FIXME: is this for side effects ?
SC_MOD()->GetPrintOptions();
if( ! pPrinterOptions )
@@ -1093,7 +1091,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
const uno::Sequence<beans::PropertyValue>& rOptions )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
throw uno::RuntimeException();
@@ -1173,17 +1171,15 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
sal_Int32 nParent = -1; // top-level
pPDFData->CreateOutlineItem( nParent, aTabName, nDestID );
}
- //--->i56629
- // add the named destination stuff
+ // #i56629# add the named destination stuff
if( pPDFData && pPDFData->GetIsExportNamedDestinations() )
{
Rectangle aArea( pDev->PixelToLogic( Rectangle( 0,0,0,0 ) ) );
String aTabName;
pDoc->GetName( nTab, aTabName );
-//need the PDF page number here
+ //need the PDF page number here
pPDFData->CreateNamedDest( aTabName, aArea );
}
- //<---i56629
}
(void)aFunc.DoPrint( aPage, nTabStart, nDisplayStart, sal_True, NULL, NULL );
@@ -1276,7 +1272,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
// external link, use as-is
pPDFData->SetLinkURL( aIter->nLinkId, aBookmark );
}
- aIter++;
+ ++aIter;
}
rBookmarks.clear();
}
@@ -1290,7 +1286,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
uno::Reference<container::XNameAccess> SAL_CALL ScModelObj::getLinks() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScLinkTargetTypesObj(pDocShell);
return NULL;
@@ -1300,8 +1296,8 @@ uno::Reference<container::XNameAccess> SAL_CALL ScModelObj::getLinks() throw(uno
sal_Bool SAL_CALL ScModelObj::isActionLocked() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bLocked = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bLocked = false;
if (pDocShell)
bLocked = ( pDocShell->GetLockCount() != 0 );
return bLocked;
@@ -1309,28 +1305,28 @@ sal_Bool SAL_CALL ScModelObj::isActionLocked() throw(uno::RuntimeException)
void SAL_CALL ScModelObj::addActionLock() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
pDocShell->LockDocument();
}
void SAL_CALL ScModelObj::removeActionLock() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
pDocShell->UnlockDocument();
}
void SAL_CALL ScModelObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
pDocShell->SetLockCount(nLock);
}
sal_Int16 SAL_CALL ScModelObj::resetActionLocks() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nRet = 0;
if (pDocShell)
{
@@ -1342,7 +1338,7 @@ sal_Int16 SAL_CALL ScModelObj::resetActionLocks() throw(uno::RuntimeException)
void SAL_CALL ScModelObj::lockControllers() throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxBaseModel::lockControllers();
if (pDocShell)
pDocShell->LockPaint();
@@ -1350,7 +1346,7 @@ void SAL_CALL ScModelObj::lockControllers() throw (::com::sun::star::uno::Runtim
void SAL_CALL ScModelObj::unlockControllers() throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (hasControllersLocked())
{
SfxBaseModel::unlockControllers();
@@ -1363,40 +1359,40 @@ void SAL_CALL ScModelObj::unlockControllers() throw (::com::sun::star::uno::Runt
void SAL_CALL ScModelObj::calculate() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
pDocShell->DoRecalc(sal_True);
else
{
- DBG_ERROR("keine DocShell"); //! Exception oder so?
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
}
}
void SAL_CALL ScModelObj::calculateAll() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
pDocShell->DoHardRecalc(sal_True);
else
{
- DBG_ERROR("keine DocShell"); //! Exception oder so?
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
}
}
sal_Bool SAL_CALL ScModelObj::isAutomaticCalculationEnabled() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return pDocShell->GetDocument()->GetAutoCalc();
- DBG_ERROR("keine DocShell"); //! Exception oder so?
- return sal_False;
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
+ return false;
}
void SAL_CALL ScModelObj::enableAutomaticCalculation( sal_Bool bEnabled )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -1408,7 +1404,7 @@ void SAL_CALL ScModelObj::enableAutomaticCalculation( sal_Bool bEnabled )
}
else
{
- DBG_ERROR("keine DocShell"); //! Exception oder so?
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
}
}
@@ -1416,7 +1412,7 @@ void SAL_CALL ScModelObj::enableAutomaticCalculation( sal_Bool bEnabled )
void SAL_CALL ScModelObj::protect( const rtl::OUString& aPassword ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// #i108245# if already protected, don't change anything
if ( pDocShell && !pDocShell->GetDocument()->IsDocProtected() )
{
@@ -1430,7 +1426,7 @@ void SAL_CALL ScModelObj::protect( const rtl::OUString& aPassword ) throw(uno::R
void SAL_CALL ScModelObj::unprotect( const rtl::OUString& aPassword )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
String aString(aPassword);
@@ -1444,81 +1440,26 @@ void SAL_CALL ScModelObj::unprotect( const rtl::OUString& aPassword )
sal_Bool SAL_CALL ScModelObj::isProtected() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return pDocShell->GetDocument()->IsDocProtected();
- DBG_ERROR("keine DocShell"); //! Exception oder so?
- return sal_False;
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
+ return false;
}
// XDrawPagesSupplier
uno::Reference<drawing::XDrawPages> SAL_CALL ScModelObj::getDrawPages() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScDrawPagesObj(pDocShell);
- DBG_ERROR("keine DocShell"); //! Exception oder so?
+ OSL_FAIL("keine DocShell"); //! Exception oder so?
return NULL;
}
-#if 0
-// XPrintable
-
-rtl::OUString ScModelObj::getPrinterName(void) const
-{
- ScUnoGuard aGuard;
- if (pDocShell)
- {
- SfxPrinter* pPrinter = pDocShell->GetPrinter();
- if (pPrinter)
- return pPrinter->GetName();
- }
-
- DBG_ERROR("getPrinterName: keine DocShell oder kein Printer");
- return rtl::OUString();
-}
-
-void ScModelObj::setPrinterName(const rtl::OUString& PrinterName)
-{
- ScUnoGuard aGuard;
- // Drucker setzen - wie in SfxViewShell::ExecPrint_Impl
-
- if (pDocShell)
- {
- SfxPrinter* pPrinter = pDocShell->GetPrinter();
- if (pPrinter)
- {
- String aString(PrinterName);
- SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), aString );
- if (pNewPrinter->IsKnown())
- pDocShell->SetPrinter( pNewPrinter, SFX_PRINTER_PRINTER );
- else
- delete pNewPrinter;
- }
- }
-}
-
-XPropertySetRef ScModelObj::createPrintOptions(void)
-{
- ScUnoGuard aGuard;
- return new ScPrintSettingsObj; //! ScPrintSettingsObj implementieren!
-}
-
-void ScModelObj::print(const XPropertySetRef& xOptions)
-{
- ScUnoGuard aGuard;
- if (pDocShell)
- {
- //! xOptions auswerten (wie denn?)
-
- //! muss noch
- }
-}
-#endif
-
// XGoalSeek
sheet::GoalResult SAL_CALL ScModelObj::seekGoal(
@@ -1527,7 +1468,7 @@ sheet::GoalResult SAL_CALL ScModelObj::seekGoal(
const ::rtl::OUString& aGoalValue )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sheet::GoalResult aResult;
aResult.Divergence = DBL_MAX; // nichts gefunden
if (pDocShell)
@@ -1552,7 +1493,7 @@ sheet::GoalResult SAL_CALL ScModelObj::seekGoal(
uno::Reference<sheet::XConsolidationDescriptor> SAL_CALL ScModelObj::createConsolidationDescriptor(
sal_Bool bEmpty ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScConsolidationDescriptor* pNew = new ScConsolidationDescriptor;
if ( pDocShell && !bEmpty )
{
@@ -1568,7 +1509,7 @@ void SAL_CALL ScModelObj::consolidate(
const uno::Reference<sheet::XConsolidationDescriptor>& xDescriptor )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// das koennte theoretisch ein fremdes Objekt sein, also nur das
// oeffentliche XConsolidationDescriptor Interface benutzen, um
// die Daten in ein ScConsolidationDescriptor Objekt zu kopieren:
@@ -1594,7 +1535,7 @@ void SAL_CALL ScModelObj::consolidate(
void SAL_CALL ScModelObj::refreshArrows() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocFunc aFunc(*pDocShell);
@@ -1610,7 +1551,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL ScModelObj::getViewData( )
if( !xRet.is() )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell && pDocShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)
{
xRet.set(uno::Reference < container::XIndexAccess >::query(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.IndexedPropertyValues")))));
@@ -1640,7 +1581,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL ScModelObj::getViewData( )
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScModelObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -1652,7 +1593,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
if (pDocShell)
@@ -1785,7 +1726,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
uno::Any aRet;
@@ -1845,7 +1786,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
}
else if ( aString.EqualsAscii( SC_UNO_ROWLABELRNG ) )
{
- aRet <<= uno::Reference<sheet::XLabelRanges>(new ScLabelRangesObj( pDocShell, sal_False ));
+ aRet <<= uno::Reference<sheet::XLabelRanges>(new ScLabelRangesObj( pDocShell, false ));
}
else if ( aString.EqualsAscii( SC_UNO_AREALINKS ) )
{
@@ -1874,7 +1815,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
{
// default for no model is FALSE
ScDrawLayer* pModel = pDoc->GetDrawLayer();
- sal_Bool bAutoControlFocus = pModel ? pModel->GetAutoControlFocus() : sal_False;
+ sal_Bool bAutoControlFocus = pModel ? pModel->GetAutoControlFocus() : false;
ScUnoHelpFunctions::SetBoolInAny( aRet, bAutoControlFocus );
}
else if ( aString.EqualsAscii( SC_UNO_FORBIDDEN ) )
@@ -1893,6 +1834,18 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
{
aRet <<= pDocShell->GetDialogContainer();
}
+ else if ( aString.EqualsAscii( SC_UNO_VBADOCOBJ ) )
+ {
+ // PropertyValue seems extreme because we store
+ // the model ( as the value member ) of the PropertyValue that is
+ // itself a property of the model ( the intention however is to
+ // store something like a Workbook object... but we don't do that )
+ // yet
+ beans::PropertyValue aProp;
+ aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisExcelDoc") );
+ aProp.Value <<= pDocShell->GetModel();
+ aRet <<= aProp;
+ }
else if ( aString.EqualsAscii( SC_UNO_RUNTIMEUID ) )
{
aRet <<= getRuntimeUID();
@@ -1948,7 +1901,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstance(
const rtl::OUString& aServiceSpecifier )
throw(uno::Exception, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<uno::XInterface> xRet;
String aNameStr(aServiceSpecifier);
sal_uInt16 nType = ScServiceProvider::GetProviderType(aNameStr);
@@ -2009,7 +1962,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstance(
{
}
- // #96117# if the drawing factory created a shape, a ScShapeObj has to be used
+ // if the drawing factory created a shape, a ScShapeObj has to be used
// to support own properties like ImageMap:
uno::Reference<drawing::XShape> xShape( xRet, uno::UNO_QUERY );
@@ -2030,7 +1983,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstanceWithArguments
{
//! unterscheiden zwischen eigenen Services und denen vom Drawing-Layer?
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<uno::XInterface> xInt(createInstance(ServiceSpecifier));
if ( aArgs.getLength() )
@@ -2048,7 +2001,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstanceWithArguments
uno::Sequence<rtl::OUString> SAL_CALL ScModelObj::getAvailableServiceNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! warum sind die Parameter bei concatServiceNames nicht const ???
//! return concatServiceNames( ScServiceProvider::GetAllServiceNames(),
@@ -2064,7 +2017,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScModelObj::getAvailableServiceNames()
rtl::OUString SAL_CALL ScModelObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScModelObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScModelObj" ));
}
sal_Bool SAL_CALL ScModelObj::supportsService( const rtl::OUString& rServiceName )
@@ -2081,8 +2034,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScModelObj::getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCMODELOBJ_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCDOCSETTINGS_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCMODELOBJ_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDOCSETTINGS_SERVICE ));
return aRet;
}
@@ -2127,7 +2080,6 @@ sal_Int64 SAL_CALL ScModelObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScModelObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -2144,7 +2096,6 @@ const uno::Sequence<sal_Int8>& ScModelObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScModelObj* ScModelObj::getImplementation( const uno::Reference<uno::XInterface> xObj )
{
ScModelObj* pRet = NULL;
@@ -2159,14 +2110,14 @@ ScModelObj* ScModelObj::getImplementation( const uno::Reference<uno::XInterface>
void ScModelObj::addChangesListener( const uno::Reference< util::XChangesListener >& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
maChangesListeners.addInterface( aListener );
}
void ScModelObj::removeChangesListener( const uno::Reference< util::XChangesListener >& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
maChangesListeners.removeInterface( aListener );
}
@@ -2188,13 +2139,13 @@ void ScModelObj::NotifyChanges( const ::rtl::OUString& rOperation, const ScRange
aEvent.Source.set( static_cast< cppu::OWeakObject* >( this ) );
aEvent.Base <<= aEvent.Source;
- sal_uLong nRangeCount = rRanges.Count();
+ size_t nRangeCount = rRanges.size();
aEvent.Changes.realloc( static_cast< sal_Int32 >( nRangeCount ) );
- for ( sal_uLong nIndex = 0; nIndex < nRangeCount; ++nIndex )
+ for ( size_t nIndex = 0; nIndex < nRangeCount; ++nIndex )
{
uno::Reference< table::XCellRange > xRangeObj;
- ScRange aRange( *rRanges.GetObject( nIndex ) );
+ ScRange aRange( *rRanges[ nIndex ] );
if ( aRange.aStart == aRange.aEnd )
{
xRangeObj.set( new ScCellObj( pDocShell, aRange.aStart ) );
@@ -2228,7 +2179,7 @@ void ScModelObj::NotifyChanges( const ::rtl::OUString& rOperation, const ScRange
if ( rOperation.compareToAscii("cell-change") == 0 && pDocShell )
{
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( rRanges, sal_False );
+ aMarkData.MarkFromRangeList( rRanges, false );
ScDocument* pDoc = pDocShell->GetDocument();
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab = 0; nTab < nTabCount; nTab++)
@@ -2241,20 +2192,20 @@ void ScModelObj::NotifyChanges( const ::rtl::OUString& rOperation, const ScRange
if (pScript)
{
ScRangeList aTabRanges; // collect ranges on this sheet
- sal_uLong nRangeCount = rRanges.Count();
- for ( sal_uLong nIndex = 0; nIndex < nRangeCount; ++nIndex )
+ size_t nRangeCount = rRanges.size();
+ for ( size_t nIndex = 0; nIndex < nRangeCount; ++nIndex )
{
- ScRange aRange( *rRanges.GetObject( nIndex ) );
+ ScRange aRange( *rRanges[ nIndex ] );
if ( aRange.aStart.Tab() == nTab )
aTabRanges.Append( aRange );
}
- sal_uLong nTabRangeCount = aTabRanges.Count();
+ size_t nTabRangeCount = aTabRanges.size();
if ( nTabRangeCount > 0 )
{
uno::Reference<uno::XInterface> xTarget;
if ( nTabRangeCount == 1 )
{
- ScRange aRange( *aTabRanges.GetObject( 0 ) );
+ ScRange aRange( *aTabRanges[ 0 ] );
if ( aRange.aStart == aRange.aEnd )
xTarget.set( static_cast<cppu::OWeakObject*>( new ScCellObj( pDocShell, aRange.aStart ) ) );
else
@@ -2370,7 +2321,7 @@ uno::Reference<drawing::XDrawPage> ScDrawPagesObj::GetObjectByIndex_Impl(sal_Int
uno::Reference<drawing::XDrawPage> SAL_CALL ScDrawPagesObj::insertNewByIndex( sal_Int32 nPos )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<drawing::XDrawPage> xRet;
if (pDocShell)
{
@@ -2386,7 +2337,7 @@ uno::Reference<drawing::XDrawPage> SAL_CALL ScDrawPagesObj::insertNewByIndex( sa
void SAL_CALL ScDrawPagesObj::remove( const uno::Reference<drawing::XDrawPage>& xPage )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SvxDrawPage* pImp = SvxDrawPage::getImplementation( xPage );
if ( pDocShell && pImp )
{
@@ -2404,7 +2355,7 @@ void SAL_CALL ScDrawPagesObj::remove( const uno::Reference<drawing::XDrawPage>&
sal_Int32 SAL_CALL ScDrawPagesObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return pDocShell->GetDocument()->GetTableCount();
return 0;
@@ -2414,24 +2365,23 @@ uno::Any SAL_CALL ScDrawPagesObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<drawing::XDrawPage> xPage(GetObjectByIndex_Impl(nIndex));
if (xPage.is())
return uno::makeAny(xPage);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScDrawPagesObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<drawing::XDrawPage>*)0);
}
sal_Bool SAL_CALL ScDrawPagesObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -2485,8 +2435,8 @@ ScTableSheetObj* ScTableSheetsObj::GetObjectByName_Impl(const rtl::OUString& aNa
void SAL_CALL ScTableSheetsObj::insertNewByName( const rtl::OUString& aName, sal_Int16 nPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if (pDocShell)
{
String aNamStr(aName);
@@ -2500,14 +2450,14 @@ void SAL_CALL ScTableSheetsObj::insertNewByName( const rtl::OUString& aName, sal
void SAL_CALL ScTableSheetsObj::moveByName( const rtl::OUString& aName, sal_Int16 nDestination )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if (pDocShell)
{
String aNamStr(aName);
SCTAB nSource;
if ( pDocShell->GetDocument()->GetTable( aNamStr, nSource ) )
- bDone = pDocShell->MoveTable( nSource, nDestination, sal_False, sal_True );
+ bDone = pDocShell->MoveTable( nSource, nDestination, false, sal_True );
}
if (!bDone)
throw uno::RuntimeException(); // no other exceptions specified
@@ -2517,8 +2467,8 @@ void SAL_CALL ScTableSheetsObj::copyByName( const rtl::OUString& aName,
const rtl::OUString& aCopy, sal_Int16 nDestination )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if (pDocShell)
{
String aNamStr(aName);
@@ -2548,9 +2498,9 @@ void SAL_CALL ScTableSheetsObj::insertByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::ElementExistException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
- sal_Bool bIllArg = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
+ sal_Bool bIllArg = false;
//! Type of aElement can be some specific interface instead of XInterface
@@ -2600,9 +2550,9 @@ void SAL_CALL ScTableSheetsObj::replaceByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
- sal_Bool bIllArg = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
+ sal_Bool bIllArg = false;
//! Type of aElement can be some specific interface instead of XInterface
@@ -2653,8 +2603,8 @@ void SAL_CALL ScTableSheetsObj::removeByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if (pDocShell)
{
SCTAB nIndex;
@@ -2680,7 +2630,7 @@ void SAL_CALL ScTableSheetsObj::removeByName( const rtl::OUString& aName )
uno::Reference< table::XCell > SAL_CALL ScTableSheetsObj::getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow, sal_Int32 nSheet )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XCellRange> xSheet(static_cast<ScCellRangeObj*>(GetObjectByIndex_Impl((sal_uInt16)nSheet)));
if (! xSheet.is())
throw lang::IndexOutOfBoundsException();
@@ -2691,7 +2641,7 @@ uno::Reference< table::XCell > SAL_CALL ScTableSheetsObj::getCellByPosition( sal
uno::Reference< table::XCellRange > SAL_CALL ScTableSheetsObj::getCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom, sal_Int32 nSheet )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XCellRange> xSheet(static_cast<ScCellRangeObj*>(GetObjectByIndex_Impl((sal_uInt16)nSheet)));
if (! xSheet.is())
throw lang::IndexOutOfBoundsException();
@@ -2702,20 +2652,20 @@ uno::Reference< table::XCellRange > SAL_CALL ScTableSheetsObj::getCellRangeByPos
uno::Sequence < uno::Reference< table::XCellRange > > SAL_CALL ScTableSheetsObj::getCellRangesByName( const rtl::OUString& aRange )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence < uno::Reference < table::XCellRange > > xRet;
ScRangeList aRangeList;
ScDocument* pDoc = pDocShell->GetDocument();
if (ScRangeStringConverter::GetRangeListFromString( aRangeList, aRange, pDoc, ::formula::FormulaGrammar::CONV_OOO, ';' ))
{
- sal_Int32 nCount = aRangeList.Count();
+ size_t nCount = aRangeList.size();
if (nCount)
{
xRet.realloc(nCount);
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ for( size_t nIndex = 0; nIndex < nCount; nIndex++ )
{
- const ScRange* pRange = aRangeList.GetObject( nIndex );
+ const ScRange* pRange = aRangeList[ nIndex ];
if( pRange )
xRet[nIndex] = new ScCellRangeObj(pDocShell, *pRange);
}
@@ -2733,7 +2683,7 @@ uno::Sequence < uno::Reference< table::XCellRange > > SAL_CALL ScTableSheetsObj:
uno::Reference<container::XEnumeration> SAL_CALL ScTableSheetsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetsEnumeration")));
}
@@ -2741,7 +2691,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScTableSheetsObj::createEnumera
sal_Int32 SAL_CALL ScTableSheetsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return pDocShell->GetDocument()->GetTableCount();
return 0;
@@ -2751,7 +2701,7 @@ uno::Any SAL_CALL ScTableSheetsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XSpreadsheet> xSheet(GetObjectByIndex_Impl(nIndex));
if (xSheet.is())
return uno::makeAny(xSheet);
@@ -2762,13 +2712,13 @@ uno::Any SAL_CALL ScTableSheetsObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScTableSheetsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XSpreadsheet>*)0);
}
sal_Bool SAL_CALL ScTableSheetsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -2778,19 +2728,18 @@ uno::Any SAL_CALL ScTableSheetsObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XSpreadsheet> xSheet(GetObjectByName_Impl(aName));
if (xSheet.is())
return uno::makeAny(xSheet);
else
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScTableSheetsObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -2811,14 +2760,14 @@ uno::Sequence<rtl::OUString> SAL_CALL ScTableSheetsObj::getElementNames()
sal_Bool SAL_CALL ScTableSheetsObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
SCTAB nIndex;
if ( pDocShell->GetDocument()->GetTable( String(aName), nIndex ) )
return sal_True;
}
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -2842,8 +2791,6 @@ void ScTableColumnsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.ISA( ScUpdateRefHint ) )
{
-// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
-
//! Referenz-Update fuer Tab und Start/Ende
}
else if ( rHint.ISA( SfxSimpleHint ) &&
@@ -2878,8 +2825,8 @@ ScTableColumnObj* ScTableColumnsObj::GetObjectByName_Impl(const rtl::OUString& a
void SAL_CALL ScTableColumnsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 nCount )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if ( pDocShell && nCount > 0 && nPosition >= 0 && nStartCol+nPosition <= nEndCol &&
nStartCol+nPosition+nCount-1 <= MAXCOL )
{
@@ -2895,8 +2842,8 @@ void SAL_CALL ScTableColumnsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 n
void SAL_CALL ScTableColumnsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCount )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
// Der zu loeschende Bereich muss innerhalb des Objekts liegen
if ( pDocShell && nCount > 0 && nIndex >= 0 && nStartCol+nIndex+nCount-1 <= nEndCol )
{
@@ -2914,7 +2861,7 @@ void SAL_CALL ScTableColumnsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCou
uno::Reference<container::XEnumeration> SAL_CALL ScTableColumnsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.TableColumnsEnumeration")));
}
@@ -2922,7 +2869,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScTableColumnsObj::createEnumer
sal_Int32 SAL_CALL ScTableColumnsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return nEndCol - nStartCol + 1;
}
@@ -2930,24 +2877,23 @@ uno::Any SAL_CALL ScTableColumnsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XCellRange> xColumn(GetObjectByIndex_Impl(nIndex));
if (xColumn.is())
return uno::makeAny(xColumn);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScTableColumnsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<table::XCellRange>*)0);
}
sal_Bool SAL_CALL ScTableColumnsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -2955,19 +2901,18 @@ uno::Any SAL_CALL ScTableColumnsObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XCellRange> xColumn(GetObjectByName_Impl(aName));
if (xColumn.is())
return uno::makeAny(xColumn);
else
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScTableColumnsObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SCCOL nCount = nEndCol - nStartCol + 1;
uno::Sequence<rtl::OUString> aSeq(nCount);
rtl::OUString* pAry = aSeq.getArray();
@@ -2980,14 +2925,14 @@ uno::Sequence<rtl::OUString> SAL_CALL ScTableColumnsObj::getElementNames()
sal_Bool SAL_CALL ScTableColumnsObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SCCOL nCol = 0;
String aString(aName);
if ( ::AlphaToCol( nCol, aString) )
if ( pDocShell && nCol >= nStartCol && nCol <= nEndCol )
return sal_True;
- return sal_False; // nicht gefunden
+ return false; // nicht gefunden
}
// XPropertySet
@@ -2995,7 +2940,7 @@ sal_Bool SAL_CALL ScTableColumnsObj::hasByName( const rtl::OUString& aName )
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableColumnsObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( lcl_GetColumnsPropertyMap() ));
return aRef;
@@ -3007,7 +2952,7 @@ void SAL_CALL ScTableColumnsObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
throw uno::RuntimeException();
@@ -3055,7 +3000,7 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const rtl::OUString& aPro
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
throw uno::RuntimeException();
@@ -3073,8 +3018,7 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const rtl::OUString& aPro
}
else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) )
{
- SCCOL nLastCol;
- bool bVis = !pDoc->ColHidden(nStartCol, nTab, nLastCol);
+ bool bVis = !pDoc->ColHidden(nStartCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
else if ( aNameString.EqualsAscii( SC_UNONAME_OWIDTH ) )
@@ -3119,8 +3063,6 @@ void ScTableRowsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.ISA( ScUpdateRefHint ) )
{
-// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
-
//! Referenz-Update fuer Tab und Start/Ende
}
else if ( rHint.ISA( SfxSimpleHint ) &&
@@ -3144,8 +3086,8 @@ ScTableRowObj* ScTableRowsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const
void SAL_CALL ScTableRowsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 nCount )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if ( pDocShell && nCount > 0 && nPosition >= 0 && nStartRow+nPosition <= nEndRow &&
nStartRow+nPosition+nCount-1 <= MAXROW )
{
@@ -3161,8 +3103,8 @@ void SAL_CALL ScTableRowsObj::insertByIndex( sal_Int32 nPosition, sal_Int32 nCou
void SAL_CALL ScTableRowsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCount )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
// Der zu loeschende Bereich muss innerhalb des Objekts liegen
if ( pDocShell && nCount > 0 && nIndex >= 0 && nStartRow+nIndex+nCount-1 <= nEndRow )
{
@@ -3180,7 +3122,7 @@ void SAL_CALL ScTableRowsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCount
uno::Reference<container::XEnumeration> SAL_CALL ScTableRowsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.TableRowsEnumeration")));
}
@@ -3188,7 +3130,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScTableRowsObj::createEnumerati
sal_Int32 SAL_CALL ScTableRowsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return nEndRow - nStartRow + 1;
}
@@ -3196,24 +3138,23 @@ uno::Any SAL_CALL ScTableRowsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<table::XCellRange> xRow(GetObjectByIndex_Impl(nIndex));
if (xRow.is())
return uno::makeAny(xRow);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScTableRowsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<table::XCellRange>*)0);
}
sal_Bool SAL_CALL ScTableRowsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -3222,7 +3163,7 @@ sal_Bool SAL_CALL ScTableRowsObj::hasElements() throw(uno::RuntimeException)
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableRowsObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( lcl_GetRowsPropertyMap() ));
return aRef;
@@ -3234,7 +3175,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
throw uno::RuntimeException();
@@ -3260,7 +3201,7 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
{
sal_Bool bOpt = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if (bOpt)
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, SC_SIZE_OPTIMAL, 0, sal_True, sal_True );
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, SC_SIZE_OPTIMAL, 0, sal_True, sal_True );
else
{
//! manually set old heights again?
@@ -3271,14 +3212,14 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
{
sal_Int32 nNewHeight = 0;
if ( aValue >>= nNewHeight )
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, SC_SIZE_ORIGINAL,
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, SC_SIZE_ORIGINAL,
(sal_uInt16)HMMToTwips(nNewHeight), sal_True, sal_True );
}
else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) )
{
sal_Bool bVis = ScUnoHelpFunctions::GetBoolFromAny( aValue );
ScSizeMode eMode = bVis ? SC_SIZE_SHOW : SC_SIZE_DIRECT;
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True );
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True );
// SC_SIZE_DIRECT with size 0: hide
}
else if ( aNameString.EqualsAscii( SC_UNONAME_CELLFILT ) )
@@ -3295,9 +3236,9 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
sal_Bool bSet = ScUnoHelpFunctions::GetBoolFromAny( aValue );
for (SCROW nRow=nStartRow; nRow<=nEndRow; nRow++)
if (bSet)
- aFunc.InsertPageBreak( sal_False, ScAddress(0,nRow,nTab), sal_True, sal_True, sal_True );
+ aFunc.InsertPageBreak( false, ScAddress(0,nRow,nTab), sal_True, sal_True, sal_True );
else
- aFunc.RemovePageBreak( sal_False, ScAddress(0,nRow,nTab), sal_True, sal_True, sal_True );
+ aFunc.RemovePageBreak( false, ScAddress(0,nRow,nTab), sal_True, sal_True, sal_True );
}
else if ( aNameString.EqualsAscii( SC_UNONAME_CELLBACK ) || aNameString.EqualsAscii( SC_UNONAME_CELLTRAN ) )
{
@@ -3317,7 +3258,7 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const rtl::OUString& aProper
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pDocShell)
throw uno::RuntimeException();
@@ -3336,7 +3277,7 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const rtl::OUString& aProper
else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) )
{
SCROW nLastRow;
- bool bVis = !pDoc->RowHidden(nStartRow, nTab, nLastRow);
+ bool bVis = !pDoc->RowHidden(nStartRow, nTab, NULL, &nLastRow);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
else if ( aNameString.EqualsAscii( SC_UNONAME_CELLFILT ) )
@@ -3376,12 +3317,6 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScTableRowsObj )
//------------------------------------------------------------------------
-//UNUSED2008-05 ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj(ScDocShell* pDocSh) :
-//UNUSED2008-05 pDocShell( pDocSh )
-//UNUSED2008-05 {
-//UNUSED2008-05 pDocShell->GetDocument()->AddUnoObject(*this);
-//UNUSED2008-05 }
-
ScSpreadsheetSettingsObj::~ScSpreadsheetSettingsObj()
{
if (pDocShell)
@@ -3493,7 +3428,7 @@ void SAL_CALL ScAnnotationsObj::insertNew(
const table::CellAddress& aPosition, const ::rtl::OUString& rText )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
DBG_ASSERT( aPosition.Sheet == nTab, "addAnnotation mit falschem Sheet" );
@@ -3506,7 +3441,7 @@ void SAL_CALL ScAnnotationsObj::insertNew(
void SAL_CALL ScAnnotationsObj::removeByIndex( sal_Int32 nIndex ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScAddress aPos;
@@ -3529,7 +3464,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScAnnotationsObj::createEnumera
{
//! iterate directly (more efficiently)?
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.CellAnnotationsEnumeration")));
}
@@ -3537,7 +3472,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScAnnotationsObj::createEnumera
sal_Int32 SAL_CALL ScAnnotationsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uLong nCount = 0;
if (pDocShell)
{
@@ -3553,24 +3488,23 @@ uno::Any SAL_CALL ScAnnotationsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XSheetAnnotation> xAnnotation(GetObjectByIndex_Impl(nIndex));
if (xAnnotation.is())
return uno::makeAny(xAnnotation);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScAnnotationsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XSheetAnnotation>*)0);
}
sal_Bool SAL_CALL ScAnnotationsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -3593,8 +3527,6 @@ void ScScenariosObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.ISA( ScUpdateRefHint ) )
{
-// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
-
//! Referenz-Update fuer Tab und Start/Ende
}
else if ( rHint.ISA( SfxSimpleHint ) &&
@@ -3626,7 +3558,7 @@ sal_Bool ScScenariosObj::GetScenarioIndex_Impl( const rtl::OUString& rName, SCTA
}
}
- return sal_False;
+ return false;
}
ScTableSheetObj* ScScenariosObj::GetObjectByIndex_Impl(sal_Int32 nIndex)
@@ -3652,7 +3584,7 @@ void SAL_CALL ScScenariosObj::addNewByName( const rtl::OUString& aName,
const rtl::OUString& aComment )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
ScMarkData aMarkData;
@@ -3685,7 +3617,7 @@ void SAL_CALL ScScenariosObj::addNewByName( const rtl::OUString& aName,
void SAL_CALL ScScenariosObj::removeByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SCTAB nIndex;
if ( pDocShell && GetScenarioIndex_Impl( aName, nIndex ) )
{
@@ -3699,7 +3631,7 @@ void SAL_CALL ScScenariosObj::removeByName( const rtl::OUString& aName )
uno::Reference<container::XEnumeration> SAL_CALL ScScenariosObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.ScenariosEnumeration")));
}
@@ -3707,7 +3639,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScScenariosObj::createEnumerati
sal_Int32 SAL_CALL ScScenariosObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SCTAB nCount = 0;
if ( pDocShell )
{
@@ -3730,24 +3662,23 @@ uno::Any SAL_CALL ScScenariosObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XScenario> xScen(GetObjectByIndex_Impl(nIndex));
if (xScen.is())
return uno::makeAny(xScen);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScScenariosObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XScenario>*)0);
}
sal_Bool SAL_CALL ScScenariosObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -3755,19 +3686,18 @@ uno::Any SAL_CALL ScScenariosObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XScenario> xScen(GetObjectByName_Impl(aName));
if (xScen.is())
return uno::makeAny(xScen);
else
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScScenariosObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SCTAB nCount = (SCTAB)getCount();
uno::Sequence<rtl::OUString> aSeq(nCount);
@@ -3787,7 +3717,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScScenariosObj::getElementNames()
sal_Bool SAL_CALL ScScenariosObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SCTAB nIndex;
return GetScenarioIndex_Impl( aName, nIndex );
}
@@ -3796,3 +3726,4 @@ sal_Bool SAL_CALL ScScenariosObj::hasByName( const rtl::OUString& aName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx
index 52fce55dfc58..ee4a89baf76b 100644
--- a/sc/source/ui/unoobj/drdefuno.cxx
+++ b/sc/source/ui/unoobj/drdefuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,3 +82,4 @@ SfxItemPool* ScDrawDefaultsObj::getModelPool( sal_Bool bReadOnly ) throw()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx
index b9548335ac03..c7e241b90f0e 100644
--- a/sc/source/ui/unoobj/editsrc.cxx
+++ b/sc/source/ui/unoobj/editsrc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
#include <editeng/unofored.hxx>
+#include <vcl/svapp.hxx>
#include <svx/svdpage.hxx>
#include <svx/svditer.hxx>
#include <svx/svdocapt.hxx>
@@ -45,7 +47,6 @@
#include "docfunc.hxx"
#include "hints.hxx"
#include "patattr.hxx"
-#include "unoguard.hxx"
#include "drwlayer.hxx"
#include "userdat.hxx"
#include "postit.hxx"
@@ -196,7 +197,7 @@ ScAnnotationEditSource::ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddre
aCellPos( rP ),
pEditEngine( NULL ),
pForwarder( NULL ),
- bDataValid( sal_False )
+ bDataValid( false )
{
if (pDocShell)
pDocShell->GetDocument()->AddUnoObject(*this);
@@ -204,7 +205,7 @@ ScAnnotationEditSource::ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddre
ScAnnotationEditSource::~ScAnnotationEditSource()
{
- ScUnoGuard aGuard; // needed for EditEngine dtor
+ SolarMutexGuard aGuard; // needed for EditEngine dtor
if (pDocShell)
pDocShell->GetDocument()->RemoveUnoObject(*this);
@@ -282,8 +283,6 @@ void ScAnnotationEditSource::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.ISA( ScUpdateRefHint ) )
{
-// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
-
//! Ref-Update
}
else if ( rHint.ISA( SfxSimpleHint ) )
@@ -297,7 +296,7 @@ void ScAnnotationEditSource::Notify( SfxBroadcaster&, const SfxHint& rHint )
DELETEZ( pEditEngine ); // EditEngine uses document's pool
}
else if ( nId == SFX_HINT_DATACHANGED )
- bDataValid = sal_False; // Text muss neu geholt werden
+ bDataValid = false; // Text muss neu geholt werden
}
}
@@ -371,3 +370,4 @@ SfxBroadcaster& ScAccessibilityEditSource::GetBroadcaster() const
return mpAccessibleTextData->GetBroadcaster();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index d7de00f4cc56..fa0f28f30bed 100755..100644
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: tokenuno.cxx,v $
- * $Revision: 1.6.108.8 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -33,10 +31,10 @@
#include "eventuno.hxx"
#include "miscuno.hxx"
-#include "unoguard.hxx"
#include "docsh.hxx"
#include "sheetevents.hxx"
#include "unonames.hxx"
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -84,7 +82,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!mpDocShell)
throw uno::RuntimeException();
@@ -136,7 +134,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const rtl::OUString& aName, const
uno::Any SAL_CALL ScSheetEventsObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nEvent = lcl_GetEventFromName(aName);
if (nEvent < 0)
throw container::NoSuchElementException();
@@ -154,10 +152,10 @@ uno::Any SAL_CALL ScSheetEventsObj::getByName( const rtl::OUString& aName )
{
uno::Sequence<beans::PropertyValue> aPropSeq( 2 );
aPropSeq[0] = beans::PropertyValue(
- rtl::OUString::createFromAscii("EventType"), -1,
- uno::makeAny( rtl::OUString::createFromAscii("Script") ), beans::PropertyState_DIRECT_VALUE );
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EventType")), -1,
+ uno::makeAny( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Script")) ), beans::PropertyState_DIRECT_VALUE );
aPropSeq[1] = beans::PropertyValue(
- rtl::OUString::createFromAscii("Script"), -1,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Script")), -1,
uno::makeAny( *pScript ), beans::PropertyState_DIRECT_VALUE );
aRet <<= aPropSeq;
}
@@ -167,7 +165,7 @@ uno::Any SAL_CALL ScSheetEventsObj::getByName( const rtl::OUString& aName )
uno::Sequence<rtl::OUString> SAL_CALL ScSheetEventsObj::getElementNames() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence<rtl::OUString> aNames(SC_SHEETEVENT_COUNT);
for (sal_Int32 nEvent=0; nEvent<SC_SHEETEVENT_COUNT; ++nEvent)
aNames[nEvent] = ScSheetEvents::GetEventName(nEvent);
@@ -176,7 +174,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScSheetEventsObj::getElementNames() throw(
sal_Bool SAL_CALL ScSheetEventsObj::hasByName( const ::rtl::OUString& aName ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nEvent = lcl_GetEventFromName(aName);
return (nEvent >= 0);
}
@@ -185,17 +183,18 @@ sal_Bool SAL_CALL ScSheetEventsObj::hasByName( const ::rtl::OUString& aName ) th
uno::Type SAL_CALL ScSheetEventsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Sequence<beans::PropertyValue>*)0);
}
sal_Bool SAL_CALL ScSheetEventsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpDocShell)
return sal_True;
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 13fed28a0646..56af26ed5313 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
#include <svl/smplhint.hxx>
+#include <vcl/svapp.hxx>
#include <editeng/eeitem.hxx>
@@ -50,7 +52,6 @@
#include "editsrc.hxx"
#include "cellsuno.hxx"
#include "servuno.hxx" // fuer IDs
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "editutil.hxx"
@@ -276,8 +277,6 @@ void ScCellFieldsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.ISA( ScUpdateRefHint ) )
{
-// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
-
//! Ref-Update
}
else if ( rHint.ISA( SfxSimpleHint ) &&
@@ -309,7 +308,7 @@ ScCellFieldObj* ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
sal_Int32 SAL_CALL ScCellFieldsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Feld-Funktionen muessen an den Forwarder !!!
ScEditEngineDefaulter* pEditEngine = ((ScCellEditSource*)pEditSource)->GetEditEngine();
@@ -322,31 +321,30 @@ uno::Any SAL_CALL ScCellFieldsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextField> xField(GetObjectByIndex_Impl(nIndex));
if (xField.is())
return uno::makeAny(xField);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScCellFieldsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<text::XTextField>*)0);
}
sal_Bool SAL_CALL ScCellFieldsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
uno::Reference<container::XEnumeration> SAL_CALL ScCellFieldsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFieldEnumeration")));
}
@@ -354,14 +352,14 @@ void SAL_CALL ScCellFieldsObj::addContainerListener(
const uno::Reference<container::XContainerListener>& /* xListener */ )
throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL ScCellFieldsObj::removeContainerListener(
const uno::Reference<container::XContainerListener>& /* xListener */ )
throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
// XRefreshable
@@ -394,7 +392,6 @@ void SAL_CALL ScCellFieldsObj::refresh( )
}
catch(uno::RuntimeException&)
{
-// DBG_ERROR("a object is gone without to remove from Broadcaster");
++pInterfaces;
++i;
}
@@ -409,7 +406,7 @@ void SAL_CALL ScCellFieldsObj::addRefreshListener( const uno::Reference< util::X
{
if (xListener.is())
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!mpRefreshListeners)
mpRefreshListeners = new cppu::OInterfaceContainerHelper(aMutex);
mpRefreshListeners->addInterface(xListener);
@@ -421,7 +418,7 @@ void SAL_CALL ScCellFieldsObj::removeRefreshListener( const uno::Reference<util:
{
if (xListener.is())
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpRefreshListeners)
mpRefreshListeners->removeInterface(xListener);
}
@@ -432,14 +429,6 @@ void SAL_CALL ScCellFieldsObj::removeRefreshListener( const uno::Reference<util:
// Default-ctor wird fuer SMART_REFLECTION_IMPLEMENTATION gebraucht
-//UNUSED2008-05 ScCellFieldObj::ScCellFieldObj() :
-//UNUSED2008-05 OComponentHelper( getMutex() ),
-//UNUSED2008-05 aPropSet( lcl_GetURLPropertyMap() ),
-//UNUSED2008-05 pDocShell( NULL )
-//UNUSED2008-05 {
-//UNUSED2008-05 pEditSource = NULL;
-//UNUSED2008-05 }
-
ScCellFieldObj::ScCellFieldObj(ScDocShell* pDocSh, const ScAddress& rPos,
const ESelection& rSel) :
OComponentHelper( getMutex() ),
@@ -549,8 +538,6 @@ void ScCellFieldObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( rHint.ISA( ScUpdateRefHint ) )
{
-// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
-
//! Ref-Update
}
else if ( rHint.ISA( SfxSimpleHint ) &&
@@ -581,7 +568,6 @@ void ScCellFieldObj::DeleteField()
if (pEditSource)
{
SvxTextForwarder* pForwarder = pEditSource->GetTextForwarder();
-// pEditEngine->QuickDelete( aSelection );
pForwarder->QuickInsertText( String(), aSelection );
pEditSource->UpdateData();
@@ -598,7 +584,7 @@ void ScCellFieldObj::DeleteField()
rtl::OUString SAL_CALL ScCellFieldObj::getPresentation( sal_Bool bShowCommand )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aRet;
if (pEditSource)
@@ -628,7 +614,7 @@ rtl::OUString SAL_CALL ScCellFieldObj::getPresentation( sal_Bool bShowCommand )
void SAL_CALL ScCellFieldObj::attach( const uno::Reference<text::XTextRange>& xTextRange )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (xTextRange.is())
{
uno::Reference<text::XText> xText(xTextRange->getText());
@@ -641,7 +627,7 @@ void SAL_CALL ScCellFieldObj::attach( const uno::Reference<text::XTextRange>& xT
uno::Reference<text::XTextRange> SAL_CALL ScCellFieldObj::getAnchor() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
return new ScCellObj( pDocShell, aCellPos );
return NULL;
@@ -673,7 +659,7 @@ void SAL_CALL ScCellFieldObj::removeEventListener(
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellFieldObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef = pPropSet->getPropertySetInfo();
return aRef;
}
@@ -684,7 +670,7 @@ void SAL_CALL ScCellFieldObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
rtl::OUString aStrVal;
if (pEditSource)
@@ -717,7 +703,7 @@ void SAL_CALL ScCellFieldObj::setPropertyValue(
pURL->SetTargetFrame( aStrVal );
}
else
- bOk = sal_False;
+ bOk = false;
if (bOk)
{
@@ -750,7 +736,7 @@ uno::Any SAL_CALL ScCellFieldObj::getPropertyValue( const rtl::OUString& aProper
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aRet;
String aNameString(aPropertyName);
@@ -815,7 +801,6 @@ sal_Int64 SAL_CALL ScCellFieldObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScCellFieldObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -832,7 +817,6 @@ const uno::Sequence<sal_Int8>& ScCellFieldObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScCellFieldObj* ScCellFieldObj::getImplementation(
const uno::Reference<text::XTextContent> xObj )
{
@@ -847,7 +831,7 @@ ScCellFieldObj* ScCellFieldObj::getImplementation(
rtl::OUString SAL_CALL ScCellFieldObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScCellFieldObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScCellFieldObj" ));
}
sal_Bool SAL_CALL ScCellFieldObj::supportsService( const rtl::OUString& rServiceName )
@@ -863,8 +847,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellFieldObj::getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCTEXTFIELD_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCTEXTCONTENT_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCTEXTFIELD_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCTEXTCONTENT_SERVICE ));
return aRet;
}
@@ -955,7 +939,7 @@ ScHeaderFieldObj* ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) cons
sal_Int32 SAL_CALL ScHeaderFieldsObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Feld-Funktionen muessen an den Forwarder !!!
ScEditEngineDefaulter* pEditEngine = ((ScHeaderFooterEditSource*)pEditSource)->GetEditEngine();
@@ -979,31 +963,30 @@ uno::Any SAL_CALL ScHeaderFieldsObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextField> xField(GetObjectByIndex_Impl(nIndex));
if (xField.is())
return uno::makeAny(xField);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScHeaderFieldsObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<text::XTextField>*)0);
}
sal_Bool SAL_CALL ScHeaderFieldsObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
uno::Reference<container::XEnumeration> SAL_CALL ScHeaderFieldsObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFieldEnumeration")));
}
@@ -1011,14 +994,14 @@ void SAL_CALL ScHeaderFieldsObj::addContainerListener(
const uno::Reference<container::XContainerListener>& /* xListener */ )
throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
void SAL_CALL ScHeaderFieldsObj::removeContainerListener(
const uno::Reference<container::XContainerListener>& /* xListener */ )
throw(uno::RuntimeException)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
// XRefreshable
@@ -1051,7 +1034,6 @@ void SAL_CALL ScHeaderFieldsObj::refresh( )
}
catch(uno::RuntimeException&)
{
-// DBG_ERROR("a object is gone without to remove from Broadcaster");
++pInterfaces;
++i;
}
@@ -1066,7 +1048,7 @@ void SAL_CALL ScHeaderFieldsObj::addRefreshListener( const uno::Reference< util:
{
if (xListener.is())
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!mpRefreshListeners)
mpRefreshListeners = new cppu::OInterfaceContainerHelper(aMutex);
mpRefreshListeners->addInterface(xListener);
@@ -1078,7 +1060,7 @@ void SAL_CALL ScHeaderFieldsObj::removeRefreshListener( const uno::Reference<uti
{
if (xListener.is())
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (mpRefreshListeners)
mpRefreshListeners->removeInterface(xListener);
}
@@ -1093,7 +1075,6 @@ SvxFileFormat lcl_UnoToSvxFileFormat( sal_Int16 nUnoValue )
case text::FilenameDisplayFormat::FULL: return SVXFILEFORMAT_FULLPATH;
case text::FilenameDisplayFormat::PATH: return SVXFILEFORMAT_PATH;
case text::FilenameDisplayFormat::NAME: return SVXFILEFORMAT_NAME;
-// case text::FilenameDisplayFormat::NAME_AND_EXT:
default:
return SVXFILEFORMAT_NAME_EXT;
}
@@ -1106,25 +1087,11 @@ sal_Int16 lcl_SvxToUnoFileFormat( SvxFileFormat nSvxValue )
case SVXFILEFORMAT_NAME_EXT: return text::FilenameDisplayFormat::NAME_AND_EXT;
case SVXFILEFORMAT_FULLPATH: return text::FilenameDisplayFormat::FULL;
case SVXFILEFORMAT_PATH: return text::FilenameDisplayFormat::PATH;
-// case SVXFILEFORMAT_NAME:
default:
return text::FilenameDisplayFormat::NAME;
}
}
-
-// Default-ctor wird fuer SMART_REFLECTION_IMPLEMENTATION gebraucht
-//UNUSED2008-05 ScHeaderFieldObj::ScHeaderFieldObj() :
-//UNUSED2008-05 OComponentHelper( getMutex() ),
-//UNUSED2008-05 aPropSet( lcl_GetHeaderFieldPropertyMap() ),
-//UNUSED2008-05 pContentObj( NULL ),
-//UNUSED2008-05 nPart( 0 ),
-//UNUSED2008-05 nType( 0 ),
-//UNUSED2008-05 nFileFormat( SVXFILEFORMAT_NAME_EXT )
-//UNUSED2008-05 {
-//UNUSED2008-05 pEditSource = NULL;
-//UNUSED2008-05 }
-
ScHeaderFieldObj::ScHeaderFieldObj(ScHeaderFooterContentObj* pContent, sal_uInt16 nP,
sal_uInt16 nT, const ESelection& rSel) :
OComponentHelper( getMutex() ),
@@ -1286,7 +1253,6 @@ void ScHeaderFieldObj::DeleteField()
if (pEditSource)
{
SvxTextForwarder* pForwarder = pEditSource->GetTextForwarder();
-// pEditEngine->QuickDelete( aSelection );
pForwarder->QuickInsertText( String(), aSelection );
pEditSource->UpdateData();
@@ -1303,7 +1269,7 @@ void ScHeaderFieldObj::DeleteField()
rtl::OUString SAL_CALL ScHeaderFieldObj::getPresentation( sal_Bool /* bShowCommand */ )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aRet;
if (pEditSource)
@@ -1322,7 +1288,7 @@ rtl::OUString SAL_CALL ScHeaderFieldObj::getPresentation( sal_Bool /* bShowComma
void SAL_CALL ScHeaderFieldObj::attach( const uno::Reference<text::XTextRange>& xTextRange )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (xTextRange.is())
{
uno::Reference<text::XText> xText(xTextRange->getText());
@@ -1335,7 +1301,7 @@ void SAL_CALL ScHeaderFieldObj::attach( const uno::Reference<text::XTextRange>&
uno::Reference<text::XTextRange> SAL_CALL ScHeaderFieldObj::getAnchor() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pContentObj)
{
uno::Reference<text::XText> xText;
@@ -1376,7 +1342,7 @@ void SAL_CALL ScHeaderFieldObj::removeEventListener(
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScHeaderFieldObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nType == SC_SERVICE_FILEFIELD)
{
// file field has different properties
@@ -1396,7 +1362,7 @@ void SAL_CALL ScHeaderFieldObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
if ( nType == SC_SERVICE_FILEFIELD && aNameString.EqualsAscii( SC_UNONAME_FILEFORM ) )
{
@@ -1429,7 +1395,7 @@ uno::Any SAL_CALL ScHeaderFieldObj::getPropertyValue( const rtl::OUString& aProp
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Properties?
uno::Any aRet;
@@ -1489,7 +1455,6 @@ sal_Int64 SAL_CALL ScHeaderFieldObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScHeaderFieldObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -1506,7 +1471,6 @@ const uno::Sequence<sal_Int8>& ScHeaderFieldObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScHeaderFieldObj* ScHeaderFieldObj::getImplementation(
const uno::Reference<text::XTextContent> xObj )
{
@@ -1521,7 +1485,7 @@ ScHeaderFieldObj* ScHeaderFieldObj::getImplementation(
rtl::OUString SAL_CALL ScHeaderFieldObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScHeaderFieldObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScHeaderFieldObj" ));
}
sal_Bool SAL_CALL ScHeaderFieldObj::supportsService( const rtl::OUString& rServiceName )
@@ -1537,8 +1501,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScHeaderFieldObj::getSupportedServiceNames
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCTEXTFIELD_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCTEXTCONTENT_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCTEXTFIELD_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCTEXTCONTENT_SERVICE ));
return aRet;
}
@@ -1547,3 +1511,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScHeaderFieldObj::getSupportedServiceNames
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index efe804784a40..9ca2f29ffccc 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,12 +34,12 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include "editutil.hxx"
#include "filtuno.hxx"
#include "miscuno.hxx"
-#include "unoguard.hxx"
#include "scdll.hxx"
#include "imoptdlg.hxx"
#include "asciiopt.hxx"
@@ -46,8 +47,8 @@
#include "globstr.hrc"
-#include "sc.hrc" //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include "sc.hrc"
+#include "scabstdlg.hxx"
#include "i18npool/lang.h"
#include <memory>
@@ -70,7 +71,7 @@ SC_SIMPLE_SERVICE_INFO( ScFilterOptionsObj, SCFILTEROPTIONSOBJ_IMPLNAME, SCFILTE
//------------------------------------------------------------------------
ScFilterOptionsObj::ScFilterOptionsObj() :
- bExport( sal_False )
+ bExport( false )
{
}
@@ -83,21 +84,21 @@ ScFilterOptionsObj::~ScFilterOptionsObj()
uno::Reference<uno::XInterface> SAL_CALL ScFilterOptionsObj_CreateInstance(
const uno::Reference<lang::XMultiServiceFactory>& )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDLL::Init();
return (::cppu::OWeakObject*) new ScFilterOptionsObj;
}
rtl::OUString ScFilterOptionsObj::getImplementationName_Static()
{
- return rtl::OUString::createFromAscii( SCFILTEROPTIONSOBJ_IMPLNAME );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCFILTEROPTIONSOBJ_IMPLNAME ));
}
uno::Sequence<rtl::OUString> ScFilterOptionsObj::getSupportedServiceNames_Static()
{
uno::Sequence<rtl::OUString> aRet(1);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCFILTEROPTIONSOBJ_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCFILTEROPTIONSOBJ_SERVICE ));
return aRet;
}
@@ -108,7 +109,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScFilterOptionsObj::getPropertyValu
uno::Sequence<beans::PropertyValue> aRet(1);
beans::PropertyValue* pArray = aRet.getArray();
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_FILTEROPTIONS );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_FILTEROPTIONS ));
pArray[0].Value <<= aFilterOptions;
return aRet;
@@ -169,9 +170,8 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
if ( xInputStream.is() )
pInStream = utl::UcbStreamHelper::CreateStream( xInputStream );
- //CHINA001 ScImportAsciiDlg* pDlg = new ScImportAsciiDlg( NULL, aPrivDatName, pInStream, cAsciiDel );
AbstractScImportAsciiDlg* pDlg = pFact->CreateScImportAsciiDlg( NULL, aPrivDatName, pInStream, RID_SCDLG_ASCII, cAsciiDel);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
ScAsciiOptions aOptions;
@@ -209,8 +209,8 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
else
{
sal_Bool bMultiByte = sal_True;
- sal_Bool bDBEnc = sal_False;
- sal_Bool bAscii = sal_False;
+ sal_Bool bDBEnc = false;
+ sal_Bool bAscii = false;
sal_Unicode cStrDel = '"';
sal_Unicode cAsciiDel = ';';
@@ -273,15 +273,11 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
}
ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding);
-//CHINA001 ScImportOptionsDlg* pDlg = new ScImportOptionsDlg( NULL, bAscii,
-//CHINA001 &aOptions, &aTitle, bMultiByte, bDBEnc,
-//CHINA001 !bExport );
-//CHINA001
AbstractScImportOptionsDlg* pDlg = pFact->CreateScImportOptionsDlg( NULL, RID_SCDLG_IMPORTOPT,
bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc,
!bExport);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
pDlg->GetImportOptions( aOptions );
@@ -304,7 +300,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
void SAL_CALL ScFilterOptionsObj::setTargetDocument( const uno::Reference<lang::XComponent>& /* xDoc */ )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- bExport = sal_False;
+ bExport = false;
}
// XExporter
@@ -315,3 +311,4 @@ void SAL_CALL ScFilterOptionsObj::setSourceDocument( const uno::Reference<lang::
bExport = sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 544f433b6564..1fea8e338cca 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
+#include <boost/bind.hpp>
#include <tools/debug.hxx>
#include <rtl/uuid.h>
+#include <vcl/svapp.hxx>
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
@@ -41,7 +43,6 @@
#include "miscuno.hxx"
#include "validat.hxx"
#include "document.hxx"
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "styleuno.hxx" // ScStyleNameConversion
#include "tokenarray.hxx"
@@ -81,20 +82,66 @@ SC_SIMPLE_SERVICE_INFO( ScTableValidationObj, "ScTableValidationObj", "com.sun.s
//------------------------------------------------------------------------
+sal_Int32 lcl_ConditionModeToOperatorNew( ScConditionMode eMode )
+{
+ sal_Int32 eOper = sheet::ConditionOperator2::NONE;
+ switch (eMode)
+ {
+ case SC_COND_EQUAL: eOper = sheet::ConditionOperator2::EQUAL; break;
+ case SC_COND_LESS: eOper = sheet::ConditionOperator2::LESS; break;
+ case SC_COND_GREATER: eOper = sheet::ConditionOperator2::GREATER; break;
+ case SC_COND_EQLESS: eOper = sheet::ConditionOperator2::LESS_EQUAL; break;
+ case SC_COND_EQGREATER: eOper = sheet::ConditionOperator2::GREATER_EQUAL; break;
+ case SC_COND_NOTEQUAL: eOper = sheet::ConditionOperator2::NOT_EQUAL; break;
+ case SC_COND_BETWEEN: eOper = sheet::ConditionOperator2::BETWEEN; break;
+ case SC_COND_NOTBETWEEN: eOper = sheet::ConditionOperator2::NOT_BETWEEN; break;
+ case SC_COND_DIRECT: eOper = sheet::ConditionOperator2::FORMULA; break;
+ case SC_COND_DUPLICATE: eOper = sheet::ConditionOperator2::DUPLICATE; break;
+ default:
+ {
+ // added to avoid warnings
+ }
+ }
+ return eOper;
+}
+
+ScConditionMode lcl_ConditionOperatorToModeNew( sal_Int32 eOper )
+{
+ ScConditionMode eMode = SC_COND_NONE;
+ switch (eOper)
+ {
+ case sheet::ConditionOperator2::EQUAL: eMode = SC_COND_EQUAL; break;
+ case sheet::ConditionOperator2::LESS: eMode = SC_COND_LESS; break;
+ case sheet::ConditionOperator2::GREATER: eMode = SC_COND_GREATER; break;
+ case sheet::ConditionOperator2::LESS_EQUAL: eMode = SC_COND_EQLESS; break;
+ case sheet::ConditionOperator2::GREATER_EQUAL: eMode = SC_COND_EQGREATER; break;
+ case sheet::ConditionOperator2::NOT_EQUAL: eMode = SC_COND_NOTEQUAL; break;
+ case sheet::ConditionOperator2::BETWEEN: eMode = SC_COND_BETWEEN; break;
+ case sheet::ConditionOperator2::NOT_BETWEEN: eMode = SC_COND_NOTBETWEEN; break;
+ case sheet::ConditionOperator2::FORMULA: eMode = SC_COND_DIRECT; break;
+ case sheet::ConditionOperator2::DUPLICATE: eMode = SC_COND_DUPLICATE; break;
+ default:
+ {
+ // added to avoid warnings
+ }
+ }
+ return eMode;
+}
+
sheet::ConditionOperator lcl_ConditionModeToOperator( ScConditionMode eMode )
{
sheet::ConditionOperator eOper = sheet::ConditionOperator_NONE;
switch (eMode)
{
- case SC_COND_EQUAL: eOper = sheet::ConditionOperator_EQUAL; break;
- case SC_COND_LESS: eOper = sheet::ConditionOperator_LESS; break;
- case SC_COND_GREATER: eOper = sheet::ConditionOperator_GREATER; break;
- case SC_COND_EQLESS: eOper = sheet::ConditionOperator_LESS_EQUAL; break;
- case SC_COND_EQGREATER: eOper = sheet::ConditionOperator_GREATER_EQUAL; break;
- case SC_COND_NOTEQUAL: eOper = sheet::ConditionOperator_NOT_EQUAL; break;
- case SC_COND_BETWEEN: eOper = sheet::ConditionOperator_BETWEEN; break;
- case SC_COND_NOTBETWEEN: eOper = sheet::ConditionOperator_NOT_BETWEEN; break;
- case SC_COND_DIRECT: eOper = sheet::ConditionOperator_FORMULA; break;
+ case SC_COND_EQUAL: eOper = sheet::ConditionOperator_EQUAL; break;
+ case SC_COND_LESS: eOper = sheet::ConditionOperator_LESS; break;
+ case SC_COND_GREATER: eOper = sheet::ConditionOperator_GREATER; break;
+ case SC_COND_EQLESS: eOper = sheet::ConditionOperator_LESS_EQUAL; break;
+ case SC_COND_EQGREATER: eOper = sheet::ConditionOperator_GREATER_EQUAL; break;
+ case SC_COND_NOTEQUAL: eOper = sheet::ConditionOperator_NOT_EQUAL; break;
+ case SC_COND_BETWEEN: eOper = sheet::ConditionOperator_BETWEEN; break;
+ case SC_COND_NOTBETWEEN: eOper = sheet::ConditionOperator_NOT_BETWEEN; break;
+ case SC_COND_DIRECT: eOper = sheet::ConditionOperator_FORMULA; break;
default:
{
// added to avoid warnings
@@ -108,15 +155,15 @@ ScConditionMode lcl_ConditionOperatorToMode( sheet::ConditionOperator eOper )
ScConditionMode eMode = SC_COND_NONE;
switch (eOper)
{
- case sheet::ConditionOperator_EQUAL: eMode = SC_COND_EQUAL; break;
- case sheet::ConditionOperator_LESS: eMode = SC_COND_LESS; break;
- case sheet::ConditionOperator_GREATER: eMode = SC_COND_GREATER; break;
- case sheet::ConditionOperator_LESS_EQUAL: eMode = SC_COND_EQLESS; break;
- case sheet::ConditionOperator_GREATER_EQUAL: eMode = SC_COND_EQGREATER; break;
- case sheet::ConditionOperator_NOT_EQUAL: eMode = SC_COND_NOTEQUAL; break;
- case sheet::ConditionOperator_BETWEEN: eMode = SC_COND_BETWEEN; break;
- case sheet::ConditionOperator_NOT_BETWEEN: eMode = SC_COND_NOTBETWEEN; break;
- case sheet::ConditionOperator_FORMULA: eMode = SC_COND_DIRECT; break;
+ case sheet::ConditionOperator_EQUAL: eMode = SC_COND_EQUAL; break;
+ case sheet::ConditionOperator_LESS: eMode = SC_COND_LESS; break;
+ case sheet::ConditionOperator_GREATER: eMode = SC_COND_GREATER; break;
+ case sheet::ConditionOperator_LESS_EQUAL: eMode = SC_COND_EQLESS; break;
+ case sheet::ConditionOperator_GREATER_EQUAL: eMode = SC_COND_EQGREATER; break;
+ case sheet::ConditionOperator_NOT_EQUAL: eMode = SC_COND_NOTEQUAL; break;
+ case sheet::ConditionOperator_BETWEEN: eMode = SC_COND_BETWEEN; break;
+ case sheet::ConditionOperator_NOT_BETWEEN: eMode = SC_COND_NOTBETWEEN; break;
+ case sheet::ConditionOperator_FORMULA: eMode = SC_COND_DIRECT; break;
default:
{
// added to avoid warnings
@@ -190,15 +237,12 @@ void ScTableConditionalFormat::FillFormat( ScConditionalFormat& rFormat,
// ScConditionalFormat = Core-Struktur, muss leer sein
DBG_ASSERT( rFormat.IsEmpty(), "FillFormat: Format nicht leer" );
- sal_uInt16 nCount = (sal_uInt16)aEntries.Count();
- for (sal_uInt16 i=0; i<nCount; i++)
- {
- ScTableConditionalEntry* pEntry = (ScTableConditionalEntry*)aEntries.GetObject(i);
- if ( !pEntry )
- continue;
+ std::vector<ScTableConditionalEntry*>::const_iterator iter;
+ for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
+ {
ScCondFormatEntryItem aData;
- pEntry->GetData(aData);
+ (*iter)->GetData(aData);
FormulaGrammar::Grammar eGrammar1 = lclResolveGrammar( eGrammar, aData.meGrammar1 );
FormulaGrammar::Grammar eGrammar2 = lclResolveGrammar( eGrammar, aData.meGrammar2 );
@@ -228,31 +272,28 @@ void ScTableConditionalFormat::FillFormat( ScConditionalFormat& rFormat,
ScTableConditionalFormat::~ScTableConditionalFormat()
{
- ScTableConditionalEntry* pEntry;
- aEntries.First();
- while ( ( pEntry = (ScTableConditionalEntry*)aEntries.Remove() ) != NULL )
- pEntry->release();
+ std::for_each(aEntries.begin(),aEntries.end(),boost::bind(&ScTableConditionalEntry::release,_1));
}
void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry)
{
ScTableConditionalEntry* pNew = new ScTableConditionalEntry(aEntry);
pNew->acquire();
- aEntries.Insert( pNew, LIST_APPEND );
+ aEntries.push_back(pNew);
}
// XSheetConditionalFormat
ScTableConditionalEntry* ScTableConditionalFormat::GetObjectByIndex_Impl(sal_uInt16 nIndex) const
{
- return (ScTableConditionalEntry*)aEntries.GetObject(nIndex);
+ return aEntries[nIndex];
}
void SAL_CALL ScTableConditionalFormat::addNew(
const uno::Sequence<beans::PropertyValue >& aConditionalEntry )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScCondFormatEntryItem aEntry;
aEntry.meMode = SC_COND_NONE;
@@ -262,13 +303,12 @@ void SAL_CALL ScTableConditionalFormat::addNew(
{
const beans::PropertyValue& rProp = pPropArray[i];
- if ( rProp.Name.equalsAscii( SC_UNONAME_OPERATOR ) )
+ if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_OPERATOR ) ) )
{
- sheet::ConditionOperator eOper = (sheet::ConditionOperator)
- ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
- aEntry.meMode = lcl_ConditionOperatorToMode( eOper );
+ sal_Int32 eOper = ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
+ aEntry.meMode = lcl_ConditionOperatorToModeNew( eOper );
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_FORMULA1 ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_FORMULA1 ) ) )
{
rtl::OUString aStrVal;
uno::Sequence<sheet::FormulaToken> aTokens;
@@ -280,7 +320,7 @@ void SAL_CALL ScTableConditionalFormat::addNew(
aEntry.maTokens1 = aTokens;
}
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_FORMULA2 ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_FORMULA2 ) ) )
{
rtl::OUString aStrVal;
uno::Sequence<sheet::FormulaToken> aTokens;
@@ -292,44 +332,44 @@ void SAL_CALL ScTableConditionalFormat::addNew(
aEntry.maTokens2 = aTokens;
}
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_SOURCEPOS ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_SOURCEPOS ) ) )
{
table::CellAddress aAddress;
if ( rProp.Value >>= aAddress )
aEntry.maPos = ScAddress( (SCCOL)aAddress.Column, (SCROW)aAddress.Row, aAddress.Sheet );
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_SOURCESTR ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_SOURCESTR ) ) )
{
rtl::OUString aStrVal;
if ( rProp.Value >>= aStrVal )
aEntry.maPosStr = String( aStrVal );
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_STYLENAME ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_STYLENAME ) ) )
{
rtl::OUString aStrVal;
if ( rProp.Value >>= aStrVal )
aEntry.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName(
aStrVal, SFX_STYLE_FAMILY_PARA );
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_FORMULANMSP1 ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_FORMULANMSP1 ) ) )
{
rtl::OUString aStrVal;
if ( rProp.Value >>= aStrVal )
aEntry.maExprNmsp1 = aStrVal;
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_FORMULANMSP2 ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_FORMULANMSP2 ) ) )
{
rtl::OUString aStrVal;
if ( rProp.Value >>= aStrVal )
aEntry.maExprNmsp2 = aStrVal;
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_GRAMMAR1 ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_GRAMMAR1 ) ) )
{
sal_Int32 nVal = 0;
if ( rProp.Value >>= nVal )
aEntry.meGrammar1 = static_cast< FormulaGrammar::Grammar >( nVal );
}
- else if ( rProp.Name.equalsAscii( SC_UNONAME_GRAMMAR2 ) )
+ else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_GRAMMAR2 ) ) )
{
sal_Int32 nVal = 0;
if ( rProp.Value >>= nVal )
@@ -337,7 +377,7 @@ void SAL_CALL ScTableConditionalFormat::addNew(
}
else
{
- DBG_ERROR("falsche Property");
+ OSL_FAIL("falsche Property");
//! Exception...
}
}
@@ -348,22 +388,27 @@ void SAL_CALL ScTableConditionalFormat::addNew(
void SAL_CALL ScTableConditionalFormat::removeByIndex( sal_Int32 nIndex )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- ScTableConditionalEntry* pEntry = (ScTableConditionalEntry*)aEntries.GetObject(nIndex);
- if (pEntry)
+ SolarMutexGuard aGuard;
+
+ if (nIndex < static_cast<sal_Int32>(aEntries.size()))
{
- aEntries.Remove(pEntry);
- pEntry->release();
+ std::vector<ScTableConditionalEntry*>::iterator iter = aEntries.begin()+nIndex;
+
+ (*iter)->release();
+ aEntries.erase(iter);
+ DataChanged();
}
}
void SAL_CALL ScTableConditionalFormat::clear() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- ScTableConditionalEntry* pEntry;
- aEntries.First();
- while ( ( pEntry = (ScTableConditionalEntry*)aEntries.Remove() ) != NULL )
- pEntry->release();
+ SolarMutexGuard aGuard;
+ std::for_each(aEntries.begin(),aEntries.end(),
+ boost::bind(&ScTableConditionalEntry::release,_1));
+
+ aEntries.clear();
+
+ DataChanged();
}
// XEnumerationAccess
@@ -371,7 +416,7 @@ void SAL_CALL ScTableConditionalFormat::clear() throw(uno::RuntimeException)
uno::Reference<container::XEnumeration> SAL_CALL ScTableConditionalFormat::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.TableConditionalEntryEnumeration")));
}
@@ -379,32 +424,31 @@ uno::Reference<container::XEnumeration> SAL_CALL ScTableConditionalFormat::creat
sal_Int32 SAL_CALL ScTableConditionalFormat::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- return aEntries.Count();
+ SolarMutexGuard aGuard;
+ return aEntries.size();
}
uno::Any SAL_CALL ScTableConditionalFormat::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XSheetConditionalEntry> xEntry(GetObjectByIndex_Impl((sal_uInt16)nIndex));
if (xEntry.is())
return uno::makeAny(xEntry);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScTableConditionalFormat::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XSheetConditionalEntry>*)0);
}
sal_Bool SAL_CALL ScTableConditionalFormat::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -422,10 +466,10 @@ uno::Any SAL_CALL ScTableConditionalFormat::getByName( const rtl::OUString& aNam
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XSheetConditionalEntry> xEntry;
- long nCount = aEntries.Count();
+ long nCount = aEntries.size();
for (long i=0; i<nCount; i++)
if ( aName == lcl_GetEntryNameFromIndex(i) )
{
@@ -437,15 +481,14 @@ uno::Any SAL_CALL ScTableConditionalFormat::getByName( const rtl::OUString& aNam
return uno::makeAny(xEntry);
else
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScTableConditionalFormat::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- long nCount = aEntries.Count();
+ long nCount = aEntries.size();
uno::Sequence<rtl::OUString> aNames(nCount);
rtl::OUString* pArray = aNames.getArray();
for (long i=0; i<nCount; i++)
@@ -457,14 +500,14 @@ uno::Sequence<rtl::OUString> SAL_CALL ScTableConditionalFormat::getElementNames(
sal_Bool SAL_CALL ScTableConditionalFormat::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
- long nCount = aEntries.Count();
+ long nCount = aEntries.size();
for (long i=0; i<nCount; i++)
if ( aName == lcl_GetEntryNameFromIndex(i) )
return sal_True;
- return sal_False;
+ return false;
}
// XUnoTunnel
@@ -481,7 +524,6 @@ sal_Int64 SAL_CALL ScTableConditionalFormat::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScTableConditionalFormat::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -498,7 +540,6 @@ const uno::Sequence<sal_Int8>& ScTableConditionalFormat::getUnoTunnelId()
return *pSeq;
}
-// static
ScTableConditionalFormat* ScTableConditionalFormat::getImplementation(
const uno::Reference<sheet::XSheetConditionalEntries> xObj )
{
@@ -511,12 +552,9 @@ ScTableConditionalFormat* ScTableConditionalFormat::getImplementation(
//------------------------------------------------------------------------
-//UNUSED2008-05 ScTableConditionalEntry::ScTableConditionalEntry() :
-//UNUSED2008-05 pParent( NULL )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
-ScTableConditionalEntry::ScTableConditionalEntry(const ScCondFormatEntryItem& aItem) :
+ScTableConditionalEntry::ScTableConditionalEntry(ScTableConditionalFormat* pPar,
+ const ScCondFormatEntryItem& aItem) :
+ pParent( pPar ),
aData( aItem )
{
// #i113668# only store the settings, keep no reference to parent object
@@ -536,46 +574,62 @@ void ScTableConditionalEntry::GetData(ScCondFormatEntryItem& rData) const
sheet::ConditionOperator SAL_CALL ScTableConditionalEntry::getOperator()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return lcl_ConditionModeToOperator( aData.meMode );
}
void SAL_CALL ScTableConditionalEntry::setOperator( sheet::ConditionOperator nOperator )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aData.meMode = lcl_ConditionOperatorToMode( nOperator );
}
+sal_Int32 SAL_CALL ScTableConditionalEntry::getConditionOperator()
+ throw(uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ return lcl_ConditionModeToOperatorNew( aData.meMode );
+}
+
+void SAL_CALL ScTableConditionalEntry::setConditionOperator( sal_Int32 nOperator )
+ throw(uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ aData.meMode = lcl_ConditionOperatorToModeNew( nOperator );
+ if (pParent)
+ pParent->DataChanged();
+}
+
rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula1() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aData.maExpr1;
}
void SAL_CALL ScTableConditionalEntry::setFormula1( const rtl::OUString& aFormula1 )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aData.maExpr1 = String( aFormula1 );
}
rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula2() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aData.maExpr2;
}
void SAL_CALL ScTableConditionalEntry::setFormula2( const rtl::OUString& aFormula2 )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aData.maExpr2 = String( aFormula2 );
}
table::CellAddress SAL_CALL ScTableConditionalEntry::getSourcePosition() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellAddress aRet;
aRet.Column = aData.maPos.Col();
aRet.Row = aData.maPos.Row();
@@ -586,7 +640,7 @@ table::CellAddress SAL_CALL ScTableConditionalEntry::getSourcePosition() throw(u
void SAL_CALL ScTableConditionalEntry::setSourcePosition( const table::CellAddress& aSourcePosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aData.maPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet );
}
@@ -594,14 +648,14 @@ void SAL_CALL ScTableConditionalEntry::setSourcePosition( const table::CellAddre
rtl::OUString SAL_CALL ScTableConditionalEntry::getStyleName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ScStyleNameConversion::DisplayToProgrammaticName( aData.maStyle, SFX_STYLE_FAMILY_PARA );
}
void SAL_CALL ScTableConditionalEntry::setStyleName( const rtl::OUString& aStyleName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aData.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName( aStyleName, SFX_STYLE_FAMILY_PARA );
}
@@ -613,14 +667,14 @@ ScTableValidationObj::ScTableValidationObj(ScDocument* pDoc, sal_uLong nKey,
{
// Eintrag aus dem Dokument lesen...
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if ( pDoc && nKey )
{
const ScValidationData* pData = pDoc->GetValidationEntry( nKey );
if (pData)
{
nMode = sal::static_int_cast<sal_uInt16>( pData->GetOperation() );
- aSrcPos = pData->GetValidSrcPos(); // #b4974740# valid pos for expressions
+ aSrcPos = pData->GetValidSrcPos(); // valid pos for expressions
aExpr1 = pData->GetExpression( aSrcPos, 0, 0, eGrammar );
aExpr2 = pData->GetExpression( aSrcPos, 1, 0, eGrammar );
meGrammar1 = meGrammar2 = eGrammar;
@@ -696,8 +750,8 @@ void ScTableValidationObj::ClearData_Impl()
nValMode = SC_VALID_ANY;
bIgnoreBlank = sal_True;
nShowList = sheet::TableValidationVisibility::UNSORTED;
- bShowInput = sal_False;
- bShowError = sal_False;
+ bShowInput = false;
+ bShowError = false;
nErrorStyle = SC_VALERR_STOP;
aSrcPos.Set(0,0,0);
aExpr1.Erase();
@@ -720,46 +774,62 @@ ScTableValidationObj::~ScTableValidationObj()
sheet::ConditionOperator SAL_CALL ScTableValidationObj::getOperator()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return lcl_ConditionModeToOperator( (ScConditionMode)nMode );
}
void SAL_CALL ScTableValidationObj::setOperator( sheet::ConditionOperator nOperator )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
nMode = sal::static_int_cast<sal_uInt16>( lcl_ConditionOperatorToMode( nOperator ) );
+ DataChanged();
+}
+
+sal_Int32 SAL_CALL ScTableValidationObj::getConditionOperator()
+ throw(uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ return lcl_ConditionModeToOperatorNew( (ScConditionMode)nMode );
+}
+
+void SAL_CALL ScTableValidationObj::setConditionOperator( sal_Int32 nOperator )
+ throw(uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ nMode = sal::static_int_cast<sal_uInt16>( lcl_ConditionOperatorToModeNew( nOperator ) );
+ DataChanged();
}
rtl::OUString SAL_CALL ScTableValidationObj::getFormula1() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aExpr1;
}
void SAL_CALL ScTableValidationObj::setFormula1( const rtl::OUString& aFormula1 )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aExpr1 = String( aFormula1 );
}
rtl::OUString SAL_CALL ScTableValidationObj::getFormula2() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aExpr2;
}
void SAL_CALL ScTableValidationObj::setFormula2( const rtl::OUString& aFormula2 )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aExpr2 = String( aFormula2 );
}
table::CellAddress SAL_CALL ScTableValidationObj::getSourcePosition() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellAddress aRet;
aRet.Column = aSrcPos.Col();
aRet.Row = aSrcPos.Row();
@@ -770,14 +840,14 @@ table::CellAddress SAL_CALL ScTableValidationObj::getSourcePosition() throw(uno:
void SAL_CALL ScTableValidationObj::setSourcePosition( const table::CellAddress& aSourcePosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
aSrcPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet );
}
uno::Sequence<sheet::FormulaToken> SAL_CALL ScTableValidationObj::getTokens( sal_Int32 nIndex )
throw(uno::RuntimeException,lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nIndex >= 2 || nIndex < 0)
throw lang::IndexOutOfBoundsException();
@@ -787,7 +857,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScTableValidationObj::getTokens( sal
void SAL_CALL ScTableValidationObj::setTokens( sal_Int32 nIndex, const uno::Sequence<sheet::FormulaToken>& aTokens )
throw(uno::RuntimeException,lang::IndexOutOfBoundsException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nIndex >= 2 || nIndex < 0)
throw lang::IndexOutOfBoundsException();
@@ -811,7 +881,7 @@ sal_Int32 SAL_CALL ScTableValidationObj::getCount() throw(uno::RuntimeException)
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableValidationObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -823,7 +893,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
if ( aString.EqualsAscii( SC_UNONAME_SHOWINP ) ) bShowInput = ScUnoHelpFunctions::GetBoolFromAny( aValue );
@@ -936,7 +1006,7 @@ uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const rtl::OUString& a
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
uno::Any aRet;
@@ -996,7 +1066,6 @@ sal_Int64 SAL_CALL ScTableValidationObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScTableValidationObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -1013,7 +1082,6 @@ const uno::Sequence<sal_Int8>& ScTableValidationObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScTableValidationObj* ScTableValidationObj::getImplementation(
const uno::Reference<beans::XPropertySet> xObj )
{
@@ -1029,3 +1097,4 @@ ScTableValidationObj* ScTableValidationObj::getImplementation(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index 2807a12f7dac..1a03a0d57acb 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,14 +40,14 @@ using namespace ::com::sun::star;
//------------------------------------------------------------------------
-vos::ORef<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* pDocSh )
+rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* pDocSh )
{
- vos::ORef<SvxForbiddenCharactersTable> xRet;
+ rtl::Reference<SvxForbiddenCharactersTable> xRet;
if ( pDocSh )
{
ScDocument* pDoc = pDocSh->GetDocument();
xRet = pDoc->GetForbiddenCharacters();
- if ( !xRet.isValid() )
+ if ( !xRet.is() )
{
// create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable,
// so changes can be stored.
@@ -91,3 +92,4 @@ void ScForbiddenCharsObj::onChange()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 63288e891551..5ebe9942ab37 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,6 @@
#include "funcuno.hxx"
#include "miscuno.hxx"
#include "cellsuno.hxx"
-#include "unoguard.hxx"
#include "scdll.hxx"
#include "document.hxx"
#include "compiler.hxx"
@@ -89,7 +89,6 @@ public:
//------------------------------------------------------------------------
-// static
ScDocument* ScTempDocSource::CreateDocument()
{
ScDocument* pDoc = new ScDocument; // SCDOCMODE_DOCUMENT
@@ -116,7 +115,7 @@ ScTempDocSource::~ScTempDocSource()
if ( pTempDoc )
delete pTempDoc;
else
- rCache.SetInUse( sal_False );
+ rCache.SetInUse( false );
}
ScDocument* ScTempDocSource::GetDocument()
@@ -131,7 +130,7 @@ ScDocument* ScTempDocSource::GetDocument()
ScTempDocCache::ScTempDocCache() :
pDoc( NULL ),
- bInUse( sal_False )
+ bInUse( false )
{
}
@@ -216,7 +215,7 @@ sal_Bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange,
ScMarkData aDestMark;
aDestMark.SelectOneTable( nDestTab );
aDestMark.SetMarkArea( aNewRange );
- pDestDoc->CopyFromClip( aNewRange, aDestMark, IDF_ALL & ~IDF_FORMULA, NULL, pClipDoc, sal_False );
+ pDestDoc->CopyFromClip( aNewRange, aDestMark, IDF_ALL & ~IDF_FORMULA, NULL, pClipDoc, false );
delete pClipDoc;
return sal_True;
@@ -254,7 +253,7 @@ void ScFunctionAccess::Notify( SfxBroadcaster&, const SfxHint& rHint )
uno::Reference<uno::XInterface> SAL_CALL ScFunctionAccess_CreateInstance(
const uno::Reference<lang::XMultiServiceFactory>& )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDLL::Init();
static uno::Reference< uno::XInterface > xInst((::cppu::OWeakObject*) new ScFunctionAccess);
return xInst;
@@ -262,14 +261,14 @@ uno::Reference<uno::XInterface> SAL_CALL ScFunctionAccess_CreateInstance(
rtl::OUString ScFunctionAccess::getImplementationName_Static()
{
- return rtl::OUString::createFromAscii( "stardiv.StarCalc.ScFunctionAccess" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "stardiv.StarCalc.ScFunctionAccess" ));
}
uno::Sequence<rtl::OUString> ScFunctionAccess::getSupportedServiceNames_Static()
{
uno::Sequence<rtl::OUString> aRet(1);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCFUNCTIONACCESS_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCFUNCTIONACCESS_SERVICE ));
return aRet;
}
@@ -277,7 +276,7 @@ uno::Sequence<rtl::OUString> ScFunctionAccess::getSupportedServiceNames_Static()
rtl::OUString SAL_CALL ScFunctionAccess::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScFunctionAccess" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScFunctionAccess") );
}
sal_Bool SAL_CALL ScFunctionAccess::supportsService( const rtl::OUString& rServiceName )
@@ -293,8 +292,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScFunctionAccess::getSupportedServiceNames
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCFUNCTIONACCESS_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCDOCSETTINGS_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCFUNCTIONACCESS_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCDOCSETTINGS_SERVICE ));
return aRet;
}
@@ -303,7 +302,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScFunctionAccess::getSupportedServiceNames
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScFunctionAccess::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( &aPropertyMap ));
return aRef;
@@ -315,7 +314,7 @@ void SAL_CALL ScFunctionAccess::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsArrayFunction" ) ) )
{
@@ -339,7 +338,7 @@ uno::Any SAL_CALL ScFunctionAccess::getPropertyValue( const rtl::OUString& aProp
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsArrayFunction" ) ) )
return uno::Any( mbArray );
@@ -382,14 +381,14 @@ sal_Bool lcl_AddFunctionToken( ScTokenArray& rArray, const rtl::OUString& rName,
// 3. new (uno) add in functions
- String aIntName(ScGlobal::GetAddInCollection()->FindFunction( aUpper, sal_False ));
+ String aIntName(ScGlobal::GetAddInCollection()->FindFunction( aUpper, false ));
if (aIntName.Len())
{
rArray.AddExternal( aIntName.GetBuffer() ); // international name
return sal_True;
}
- return sal_False; // no valid function name
+ return false; // no valid function name
}
void lcl_AddRef( ScTokenArray& rArray, long nStartRow, long nColCount, long nRowCount )
@@ -452,7 +451,7 @@ public:
eElemClass == uno::TypeClass_FLOAT ||
eElemClass == uno::TypeClass_DOUBLE )
{
- // #87871# accept integer types because Basic passes a floating point
+ // accept integer types because Basic passes a floating point
// variable as byte, short or long if it's an integer number.
double fVal(0.0);
rElement >>= fVal;
@@ -467,7 +466,7 @@ public:
else
mbArgError = true;
}
- bool hasArgError() { return mbArgError; }
+ bool hasArgError() const { return mbArgError; }
};
template< class seq >
@@ -535,7 +534,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName,
throw(container::NoSuchElementException, lang::IllegalArgumentException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!mbValid)
throw uno::RuntimeException();
@@ -554,8 +553,6 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName,
ScAddress aAdr;
ScCompiler aCompiler(pDoc,aAdr);
aCompiler.SetGrammar(pDoc->GetGrammar());
- //if (!ScCompiler::IsInitialized())
- // ScCompiler::InitSymbolsEnglish();
//
// find function
@@ -579,8 +576,8 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName,
// add arguments to token array
//
- sal_Bool bArgErr = sal_False;
- sal_Bool bOverflow = sal_False;
+ sal_Bool bArgErr = false;
+ sal_Bool bOverflow = false;
long nDocRow = 0;
long nArgCount = aArguments.getLength();
const uno::Any* pArgArr = aArguments.getConstArray();
@@ -604,7 +601,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName,
eClass == uno::TypeClass_FLOAT ||
eClass == uno::TypeClass_DOUBLE )
{
- // #87871# accept integer types because Basic passes a floating point
+ // accept integer types because Basic passes a floating point
// variable as byte, short or long if it's an integer number.
double fVal = 0;
rArg >>= fVal;
@@ -647,9 +644,9 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName,
{
ScDocument* pSrcDoc = pImpl->GetDocument();
const ScRangeList& rRanges = pImpl->GetRangeList();
- if ( pSrcDoc && rRanges.Count() == 1 )
+ if ( pSrcDoc && rRanges.size() == 1 )
{
- ScRange aSrcRange = *rRanges.GetObject(0);
+ ScRange aSrcRange = *rRanges[ 0 ];
long nStartRow = nDocRow;
long nColCount = aSrcRange.aEnd.Col() - aSrcRange.aStart.Col() + 1;
@@ -743,3 +740,4 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index ee6c3ff1988a..430252b688ae 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include <svl/smplhint.hxx>
#include <sfx2/linkmgr.hxx>
+#include <vcl/svapp.hxx>
#include "linkuno.hxx"
#include "miscuno.hxx"
@@ -41,7 +43,6 @@
#include "collect.hxx"
#include "tablink.hxx"
#include "arealink.hxx"
-#include "unoguard.hxx"
#include "hints.hxx"
#include "unonames.hxx"
#include "rangeseq.hxx"
@@ -148,13 +149,13 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const
rtl::OUString SAL_CALL ScSheetLinkObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getFileName(); // Name ist der Dateiname (URL)
}
void SAL_CALL ScSheetLinkObj::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
setFileName(aName); // Name ist der Dateiname (URL)
}
@@ -162,7 +163,7 @@ void SAL_CALL ScSheetLinkObj::setName( const rtl::OUString& aName ) throw(uno::R
void SAL_CALL ScSheetLinkObj::refresh() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
pLink->Refresh( pLink->GetFileName(), pLink->GetFilterName(), NULL, pLink->GetRefreshDelay() );
@@ -172,7 +173,7 @@ void SAL_CALL ScSheetLinkObj::addRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<util::XRefreshListener>* pObj =
new uno::Reference<util::XRefreshListener>( xListener );
aRefreshListeners.Insert( pObj, aRefreshListeners.Count() );
@@ -186,7 +187,7 @@ void SAL_CALL ScSheetLinkObj::removeRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aRefreshListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -221,7 +222,7 @@ void ScSheetLinkObj::ModifyRefreshDelay_Impl( sal_Int32 nRefresh )
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScSheetLinkObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -233,7 +234,7 @@ void SAL_CALL ScSheetLinkObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
rtl::OUString aValStr;
if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) )
@@ -269,7 +270,7 @@ uno::Any SAL_CALL ScSheetLinkObj::getPropertyValue( const rtl::OUString& aProper
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
uno::Any aRet;
if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) )
@@ -291,13 +292,13 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScSheetLinkObj )
rtl::OUString ScSheetLinkObj::getFileName(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aFileName;
}
void ScSheetLinkObj::setFileName(const rtl::OUString& rNewName)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
{
@@ -334,7 +335,7 @@ void ScSheetLinkObj::setFileName(const rtl::OUString& rNewName)
rtl::OUString ScSheetLinkObj::getFilter(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
@@ -344,7 +345,7 @@ rtl::OUString ScSheetLinkObj::getFilter(void) const
void ScSheetLinkObj::setFilter(const rtl::OUString& Filter)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
{
@@ -355,7 +356,7 @@ void ScSheetLinkObj::setFilter(const rtl::OUString& Filter)
rtl::OUString ScSheetLinkObj::getFilterOptions(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
@@ -365,7 +366,7 @@ rtl::OUString ScSheetLinkObj::getFilterOptions(void) const
void ScSheetLinkObj::setFilterOptions(const rtl::OUString& FilterOptions)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
{
@@ -376,7 +377,7 @@ void ScSheetLinkObj::setFilterOptions(const rtl::OUString& FilterOptions)
sal_Int32 ScSheetLinkObj::getRefreshDelay(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nRet = 0;
ScTableLink* pLink = GetLink_Impl();
if (pLink)
@@ -386,7 +387,7 @@ sal_Int32 ScSheetLinkObj::getRefreshDelay(void) const
void ScSheetLinkObj::setRefreshDelay(sal_Int32 nRefreshDelay)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ModifyRefreshDelay_Impl( nRefreshDelay );
}
@@ -471,7 +472,7 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const rtl::OUString& aName
uno::Reference<container::XEnumeration> SAL_CALL ScSheetLinksObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SheetLinksEnumeration")));
}
@@ -479,8 +480,8 @@ uno::Reference<container::XEnumeration> SAL_CALL ScSheetLinksObj::createEnumerat
sal_Int32 SAL_CALL ScSheetLinksObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Int32 nCount = 0;
+ SolarMutexGuard aGuard;
+ INT32 nCount = 0;
if (pDocShell)
{
ScStrCollection aNames; // um doppelte wegzulassen
@@ -504,24 +505,23 @@ uno::Any SAL_CALL ScSheetLinksObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<beans::XPropertySet> xLink(GetObjectByIndex_Impl(nIndex));
if (xLink.is())
return uno::makeAny(xLink);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScSheetLinksObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<beans::XPropertySet>*)0);
}
sal_Bool SAL_CALL ScSheetLinksObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -529,7 +529,7 @@ uno::Any SAL_CALL ScSheetLinksObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<beans::XPropertySet> xLink(GetObjectByName_Impl(aName));
if (xLink.is())
return uno::makeAny(xLink);
@@ -541,7 +541,7 @@ uno::Any SAL_CALL ScSheetLinksObj::getByName( const rtl::OUString& aName )
sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Name ist der Dateiname
if (pDocShell)
@@ -559,12 +559,12 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const rtl::OUString& aName )
return sal_True;
}
}
- return sal_False;
+ return false;
}
uno::Sequence<rtl::OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Name ist der Dateiname
if (pDocShell)
@@ -694,7 +694,7 @@ void ScAreaLinkObj::Modify_Impl( const rtl::OUString* pNewFile, const rtl::OUStr
if (pNewDest)
{
ScUnoConversion::FillScRange( aDest, *pNewDest );
- bFitBlock = sal_False; // neuer Bereich angegeben -> keine Inhalte verschieben
+ bFitBlock = false; // neuer Bereich angegeben -> keine Inhalte verschieben
}
ScDocFunc aFunc(*pDocShell);
@@ -713,7 +713,7 @@ void ScAreaLinkObj::ModifyRefreshDelay_Impl( sal_Int32 nRefresh )
void SAL_CALL ScAreaLinkObj::refresh() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
if (pLink)
pLink->Refresh( pLink->GetFile(), pLink->GetFilter(), pLink->GetSource(), pLink->GetRefreshDelay() );
@@ -723,7 +723,7 @@ void SAL_CALL ScAreaLinkObj::addRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<util::XRefreshListener>* pObj =
new uno::Reference<util::XRefreshListener>( xListener );
aRefreshListeners.Insert( pObj, aRefreshListeners.Count() );
@@ -737,7 +737,7 @@ void SAL_CALL ScAreaLinkObj::removeRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aRefreshListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -765,7 +765,7 @@ void ScAreaLinkObj::Refreshed_Impl()
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAreaLinkObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -777,7 +777,7 @@ void SAL_CALL ScAreaLinkObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
rtl::OUString aValStr;
if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) )
@@ -813,7 +813,7 @@ uno::Any SAL_CALL ScAreaLinkObj::getPropertyValue( const rtl::OUString& aPropert
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
uno::Any aRet;
if ( aNameString.EqualsAscii( SC_UNONAME_LINKURL ) )
@@ -835,7 +835,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScAreaLinkObj )
rtl::OUString ScAreaLinkObj::getFileName(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
if (pLink)
@@ -845,13 +845,13 @@ rtl::OUString ScAreaLinkObj::getFileName(void) const
void ScAreaLinkObj::setFileName(const rtl::OUString& rNewName)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Modify_Impl( &rNewName, NULL, NULL, NULL, NULL );
}
rtl::OUString ScAreaLinkObj::getFilter(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
if (pLink)
@@ -861,13 +861,13 @@ rtl::OUString ScAreaLinkObj::getFilter(void) const
void ScAreaLinkObj::setFilter(const rtl::OUString& Filter)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Modify_Impl( NULL, &Filter, NULL, NULL, NULL );
}
rtl::OUString ScAreaLinkObj::getFilterOptions(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
if (pLink)
@@ -877,13 +877,13 @@ rtl::OUString ScAreaLinkObj::getFilterOptions(void) const
void ScAreaLinkObj::setFilterOptions(const rtl::OUString& FilterOptions)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Modify_Impl( NULL, NULL, &FilterOptions, NULL, NULL );
}
sal_Int32 ScAreaLinkObj::getRefreshDelay(void) const
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nRet = 0;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
if (pLink)
@@ -893,7 +893,7 @@ sal_Int32 ScAreaLinkObj::getRefreshDelay(void) const
void ScAreaLinkObj::setRefreshDelay(sal_Int32 nRefreshDelay)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ModifyRefreshDelay_Impl( nRefreshDelay );
}
@@ -901,7 +901,7 @@ void ScAreaLinkObj::setRefreshDelay(sal_Int32 nRefreshDelay)
rtl::OUString SAL_CALL ScAreaLinkObj::getSourceArea() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
if (pLink)
@@ -912,13 +912,13 @@ rtl::OUString SAL_CALL ScAreaLinkObj::getSourceArea() throw(uno::RuntimeExceptio
void SAL_CALL ScAreaLinkObj::setSourceArea( const rtl::OUString& aSourceArea )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Modify_Impl( NULL, NULL, NULL, &aSourceArea, NULL );
}
table::CellRangeAddress SAL_CALL ScAreaLinkObj::getDestArea() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aRet;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
if (pLink)
@@ -929,7 +929,7 @@ table::CellRangeAddress SAL_CALL ScAreaLinkObj::getDestArea() throw(uno::Runtime
void SAL_CALL ScAreaLinkObj::setDestArea( const table::CellRangeAddress& aDestArea )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Modify_Impl( NULL, NULL, NULL, NULL, &aDestArea );
}
@@ -975,7 +975,7 @@ void SAL_CALL ScAreaLinksObj::insertAtPosition( const table::CellAddress& aDestP
const rtl::OUString& aFilterOptions )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
String aFileStr (aFileName);
@@ -989,13 +989,13 @@ void SAL_CALL ScAreaLinksObj::insertAtPosition( const table::CellAddress& aDestP
ScDocFunc aFunc(*pDocShell);
aFunc.InsertAreaLink( aFileStr, aFilterStr, aOptionStr,
aSourceStr, ScRange(aDestAddr),
- 0, sal_False, sal_True ); // keine Inhalte verschieben
+ 0, false, sal_True ); // keine Inhalte verschieben
}
}
void SAL_CALL ScAreaLinksObj::removeByIndex( sal_Int32 nIndex ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, (sal_uInt16)nIndex);
if (pLink)
{
@@ -1011,7 +1011,7 @@ void SAL_CALL ScAreaLinksObj::removeByIndex( sal_Int32 nIndex ) throw(uno::Runti
uno::Reference<container::XEnumeration> SAL_CALL ScAreaLinksObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.CellAreaLinksEnumeration")));
}
@@ -1019,8 +1019,8 @@ uno::Reference<container::XEnumeration> SAL_CALL ScAreaLinksObj::createEnumerati
sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Int32 nAreaCount = 0;
+ SolarMutexGuard aGuard;
+ INT32 nAreaCount = 0;
if (pDocShell)
{
sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
@@ -1039,24 +1039,23 @@ uno::Any SAL_CALL ScAreaLinksObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XAreaLink> xLink(GetObjectByIndex_Impl(nIndex));
if (xLink.is())
return uno::makeAny(xLink);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScAreaLinksObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XAreaLink>*)0);
}
sal_Bool SAL_CALL ScAreaLinksObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -1114,7 +1113,7 @@ String lcl_BuildDDEName( const String& rAppl, const String& rTopic, const String
rtl::OUString SAL_CALL ScDDELinkObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return lcl_BuildDDEName( aAppl, aTopic, aItem );
}
@@ -1128,7 +1127,7 @@ void SAL_CALL ScDDELinkObj::setName( const rtl::OUString& /* aName */ ) throw(un
rtl::OUString SAL_CALL ScDDELinkObj::getApplication() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Test, ob Link noch im Dokument enthalten?
return aAppl;
@@ -1136,7 +1135,7 @@ rtl::OUString SAL_CALL ScDDELinkObj::getApplication() throw(uno::RuntimeExceptio
rtl::OUString SAL_CALL ScDDELinkObj::getTopic() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Test, ob Link noch im Dokument enthalten?
return aTopic;
@@ -1144,7 +1143,7 @@ rtl::OUString SAL_CALL ScDDELinkObj::getTopic() throw(uno::RuntimeException)
rtl::OUString SAL_CALL ScDDELinkObj::getItem() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Test, ob Link noch im Dokument enthalten?
return aItem;
@@ -1154,7 +1153,7 @@ rtl::OUString SAL_CALL ScDDELinkObj::getItem() throw(uno::RuntimeException)
void SAL_CALL ScDDELinkObj::refresh() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -1167,7 +1166,7 @@ void SAL_CALL ScDDELinkObj::addRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<util::XRefreshListener>* pObj =
new uno::Reference<util::XRefreshListener>( xListener );
aRefreshListeners.Insert( pObj, aRefreshListeners.Count() );
@@ -1181,7 +1180,7 @@ void SAL_CALL ScDDELinkObj::removeRefreshListener(
const uno::Reference<util::XRefreshListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aRefreshListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -1201,7 +1200,7 @@ void SAL_CALL ScDDELinkObj::removeRefreshListener(
uno::Sequence< uno::Sequence< uno::Any > > ScDDELinkObj::getResults( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Sequence< uno::Any > > aReturn;
bool bSuccess = false;
@@ -1240,7 +1239,7 @@ uno::Sequence< uno::Sequence< uno::Any > > ScDDELinkObj::getResults( )
void ScDDELinkObj::setResults( const uno::Sequence< uno::Sequence< uno::Any > >& aResults )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
bool bSuccess = false;
if ( pDocShell )
@@ -1338,7 +1337,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const rtl::OUString& aName)
uno::Reference<container::XEnumeration> SAL_CALL ScDDELinksObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.DDELinksEnumeration")));
}
@@ -1346,8 +1345,8 @@ uno::Reference<container::XEnumeration> SAL_CALL ScDDELinksObj::createEnumeratio
sal_Int32 SAL_CALL ScDDELinksObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Int32 nAreaCount = 0;
+ SolarMutexGuard aGuard;
+ INT32 nAreaCount = 0;
if (pDocShell)
nAreaCount = pDocShell->GetDocument()->GetDdeLinkCount();
return nAreaCount;
@@ -1357,24 +1356,23 @@ uno::Any SAL_CALL ScDDELinksObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XDDELink> xLink(GetObjectByIndex_Impl(nIndex));
if (xLink.is())
return uno::makeAny(xLink);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScDDELinksObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XDDELink>*)0);
}
sal_Bool SAL_CALL ScDDELinksObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -1382,18 +1380,17 @@ uno::Any SAL_CALL ScDDELinksObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XDDELink> xLink(GetObjectByName_Impl(aName));
if (xLink.is())
return uno::makeAny(xLink);
else
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScDDELinksObj::getElementNames() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
String aAppl, aTopic, aItem;
@@ -1416,7 +1413,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScDDELinksObj::getElementNames() throw(uno
sal_Bool SAL_CALL ScDDELinksObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
String aNamStr(aName);
@@ -1431,7 +1428,7 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const rtl::OUString& aName )
return sal_True;
}
}
- return sal_False;
+ return false;
}
// XDDELinks
@@ -1441,7 +1438,7 @@ uno::Reference< sheet::XDDELink > ScDDELinksObj::addDDELink(
const ::rtl::OUString& aItem, ::com::sun::star::sheet::DDELinkMode nMode )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< sheet::XDDELink > xLink;
if ( pDocShell )
@@ -1473,7 +1470,7 @@ uno::Reference< sheet::XDDELink > ScDDELinksObj::addDDELink(
break;
}
- if ( pDoc->CreateDdeLink( aApplication, aTopic, aItem, nMod ) )
+ if ( pDoc->CreateDdeLink( aApplication, aTopic, aItem, nMod, ScMatrixRef() ) )
{
const ::rtl::OUString aName( lcl_BuildDDEName( aApplication, aTopic, aItem ) );
xLink.set( GetObjectByName_Impl( aName ) );
@@ -1506,7 +1503,7 @@ ScExternalSheetCacheObj::~ScExternalSheetCacheObj()
void SAL_CALL ScExternalSheetCacheObj::setCellValue(sal_Int32 nCol, sal_Int32 nRow, const Any& rValue)
throw (IllegalArgumentException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nRow < 0 || nCol < 0)
throw IllegalArgumentException();
@@ -1527,7 +1524,7 @@ void SAL_CALL ScExternalSheetCacheObj::setCellValue(sal_Int32 nCol, sal_Int32 nR
Any SAL_CALL ScExternalSheetCacheObj::getCellValue(sal_Int32 nCol, sal_Int32 nRow)
throw (IllegalArgumentException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nRow < 0 || nCol < 0)
throw IllegalArgumentException();
@@ -1559,7 +1556,7 @@ Any SAL_CALL ScExternalSheetCacheObj::getCellValue(sal_Int32 nCol, sal_Int32 nRo
Sequence< sal_Int32 > SAL_CALL ScExternalSheetCacheObj::getAllRows()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
vector<SCROW> aRows;
mpTable->getAllRows(aRows);
size_t nSize = aRows.size();
@@ -1573,7 +1570,7 @@ Sequence< sal_Int32 > SAL_CALL ScExternalSheetCacheObj::getAllRows()
Sequence< sal_Int32 > SAL_CALL ScExternalSheetCacheObj::getAllColumns(sal_Int32 nRow)
throw (IllegalArgumentException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nRow < 0)
throw IllegalArgumentException();
@@ -1608,7 +1605,7 @@ Reference< sheet::XExternalSheetCache > SAL_CALL ScExternalDocLinkObj::addSheetC
const OUString& aSheetName, sal_Bool bDynamicCache )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
size_t nIndex = 0;
ScExternalRefCache::TableTypeRef pTable = mpRefMgr->getCacheTable(mnFileId, aSheetName, true, &nIndex);
if (!bDynamicCache)
@@ -1622,7 +1619,7 @@ Reference< sheet::XExternalSheetCache > SAL_CALL ScExternalDocLinkObj::addSheetC
Any SAL_CALL ScExternalDocLinkObj::getByName(const::rtl::OUString &aName)
throw (container::NoSuchElementException, lang::WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
size_t nIndex = 0;
ScExternalRefCache::TableTypeRef pTable = mpRefMgr->getCacheTable(mnFileId, aName, false, &nIndex);
if (!pTable)
@@ -1638,8 +1635,8 @@ Any SAL_CALL ScExternalDocLinkObj::getByName(const::rtl::OUString &aName)
Sequence< OUString > SAL_CALL ScExternalDocLinkObj::getElementNames()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
- vector<String> aTabNames;
+ SolarMutexGuard aGuard;
+ vector<OUString> aTabNames;
mpRefMgr->getAllCachedTableNames(mnFileId, aTabNames);
size_t n = aTabNames.size();
Sequence<OUString> aSeq(n);
@@ -1651,21 +1648,21 @@ Sequence< OUString > SAL_CALL ScExternalDocLinkObj::getElementNames()
sal_Bool SAL_CALL ScExternalDocLinkObj::hasByName(const OUString &aName)
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return static_cast<sal_Bool>(mpRefMgr->hasCacheTable(mnFileId, aName));
}
sal_Int32 SAL_CALL ScExternalDocLinkObj::getCount()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return static_cast<sal_Int32>(mpRefMgr->getCacheTableCount(mnFileId));
}
Any SAL_CALL ScExternalDocLinkObj::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
size_t nTabCount = mpRefMgr->getCacheTableCount(mnFileId);
if (nIndex < 0 || nIndex >= static_cast<sal_Int32>(nTabCount))
throw lang::IndexOutOfBoundsException();
@@ -1684,24 +1681,24 @@ Any SAL_CALL ScExternalDocLinkObj::getByIndex(sal_Int32 nIndex)
Reference< container::XEnumeration > SAL_CALL ScExternalDocLinkObj::createEnumeration()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference< container::XEnumeration > aRef(
- new ScIndexEnumeration(this, OUString::createFromAscii(
- "com.sun.star.sheet.ExternalDocLink")));
+ new ScIndexEnumeration(this, OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.sheet.ExternalDocLink"))));
return aRef;
}
uno::Type SAL_CALL ScExternalDocLinkObj::getElementType()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType(static_cast<Reference<sheet::XExternalDocLink>*>(0));
}
sal_Bool SAL_CALL ScExternalDocLinkObj::hasElements()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return static_cast<sal_Bool>(mpRefMgr->getCacheTableCount(mnFileId) > 0);
}
@@ -1727,7 +1724,7 @@ Reference< sheet::XExternalDocLink > SAL_CALL ScExternalDocLinksObj::addDocLink(
const OUString& aDocName )
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nFileId = mpRefMgr->getExternalFileId(aDocName);
Reference< sheet::XExternalDocLink > aDocLink(new ScExternalDocLinkObj(mpRefMgr, nFileId));
return aDocLink;
@@ -1736,7 +1733,7 @@ Reference< sheet::XExternalDocLink > SAL_CALL ScExternalDocLinksObj::addDocLink(
Any SAL_CALL ScExternalDocLinksObj::getByName(const::rtl::OUString &aName)
throw (container::NoSuchElementException, lang::WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!mpRefMgr->hasExternalFile(aName))
throw container::NoSuchElementException();
@@ -1751,7 +1748,7 @@ Any SAL_CALL ScExternalDocLinksObj::getByName(const::rtl::OUString &aName)
Sequence< OUString > SAL_CALL ScExternalDocLinksObj::getElementNames()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 n = mpRefMgr->getExternalFileCount();
Sequence<OUString> aSeq(n);
for (sal_uInt16 i = 0; i < n; ++i)
@@ -1766,21 +1763,21 @@ Sequence< OUString > SAL_CALL ScExternalDocLinksObj::getElementNames()
sal_Bool SAL_CALL ScExternalDocLinksObj::hasByName(const OUString &aName)
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return mpRefMgr->hasExternalFile(aName);
}
sal_Int32 SAL_CALL ScExternalDocLinksObj::getCount()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return mpRefMgr->getExternalFileCount();
}
Any SAL_CALL ScExternalDocLinksObj::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (nIndex > ::std::numeric_limits<sal_uInt16>::max() || nIndex < ::std::numeric_limits<sal_uInt16>::min())
throw lang::IndexOutOfBoundsException();
@@ -1798,24 +1795,25 @@ Any SAL_CALL ScExternalDocLinksObj::getByIndex(sal_Int32 nIndex)
Reference< container::XEnumeration > SAL_CALL ScExternalDocLinksObj::createEnumeration()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Reference< container::XEnumeration > aRef(
- new ScIndexEnumeration(this, OUString::createFromAscii(
- "com.sun.star.sheet.ExternalDocLinks")));
+ new ScIndexEnumeration(this, OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.sheet.ExternalDocLinks"))));
return aRef;
}
uno::Type SAL_CALL ScExternalDocLinksObj::getElementType()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType(static_cast<Reference<sheet::XExternalDocLinks>*>(0));
}
sal_Bool SAL_CALL ScExternalDocLinksObj::hasElements()
throw (RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return mpRefMgr->getExternalFileCount() > 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/listenercalls.cxx b/sc/source/ui/unoobj/listenercalls.cxx
index 9abc8e0ab826..8160cd470424 100644
--- a/sc/source/ui/unoobj/listenercalls.cxx
+++ b/sc/source/ui/unoobj/listenercalls.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,4 @@ void ScUnoListenerCalls::ExecuteAndClear()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/makefile.mk b/sc/source/ui/unoobj/makefile.mk
index 36c3493ceefc..f80f74f513cb 100644
--- a/sc/source/ui/unoobj/makefile.mk
+++ b/sc/source/ui/unoobj/makefile.mk
@@ -35,9 +35,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -74,7 +72,6 @@ SLO1FILES = \
$(SLO)$/targuno.obj \
$(SLO)$/convuno.obj \
$(SLO)$/editsrc.obj \
- $(SLO)$/unoguard.obj \
$(SLO)$/confuno.obj \
$(SLO)$/filtuno.obj \
$(SLO)$/unodoc.obj \
diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx
index 3e10dfa837be..df961ae45a46 100644
--- a/sc/source/ui/unoobj/miscuno.cxx
+++ b/sc/source/ui/unoobj/miscuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,9 @@
#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
#include "miscuno.hxx"
-#include "unoguard.hxx"
using namespace com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -42,16 +43,10 @@ using ::rtl::OUString;
//------------------------------------------------------------------------
-//UNUSED2008-05 SC_SIMPLE_SERVICE_INFO( ScEmptyEnumeration, "ScEmptyEnumeration", "stardiv.unknown" )
-//UNUSED2008-05 SC_SIMPLE_SERVICE_INFO( ScEmptyEnumerationAccess, "ScEmptyEnumerationAccess", "stardiv.unknown" )
-//UNUSED2008-05 SC_SIMPLE_SERVICE_INFO( ScIndexEnumeration, "ScIndexEnumeration", "stardiv.unknown" )
-//UNUSED2008-05 SC_SIMPLE_SERVICE_INFO( ScPrintSettingsObj, "ScPrintSettingsObj", "stardiv.unknown" )
-
SC_SIMPLE_SERVICE_INFO( ScNameToIndexAccess, "ScNameToIndexAccess", "stardiv.unknown" )
//------------------------------------------------------------------------
-// static
uno::Reference<uno::XInterface> ScUnoHelpFunctions::AnyToInterface( const uno::Any& rAny )
{
if ( rAny.getValueTypeClass() == uno::TypeClass_INTERFACE )
@@ -61,7 +56,6 @@ uno::Reference<uno::XInterface> ScUnoHelpFunctions::AnyToInterface( const uno::A
return uno::Reference<uno::XInterface>(); //! Exception?
}
-// static
sal_Bool ScUnoHelpFunctions::GetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp,
const rtl::OUString& rName, sal_Bool bDefault )
{
@@ -87,7 +81,6 @@ sal_Bool ScUnoHelpFunctions::GetBoolProperty( const uno::Reference<beans::XPrope
return bRet;
}
-// static
sal_Int32 ScUnoHelpFunctions::GetLongProperty( const uno::Reference<beans::XPropertySet>& xProp,
const rtl::OUString& rName, long nDefault )
{
@@ -107,7 +100,6 @@ sal_Int32 ScUnoHelpFunctions::GetLongProperty( const uno::Reference<beans::XProp
return nRet;
}
-// static
sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference<beans::XPropertySet>& xProp,
const rtl::OUString& rName, long nDefault )
{
@@ -137,7 +129,6 @@ sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference<beans::XProp
return nRet;
}
-// static
OUString ScUnoHelpFunctions::GetStringProperty(
const Reference<beans::XPropertySet>& xProp, const OUString& rName, const OUString& rDefault )
{
@@ -157,15 +148,13 @@ OUString ScUnoHelpFunctions::GetStringProperty(
return aRet;
}
-// static
sal_Bool ScUnoHelpFunctions::GetBoolFromAny( const uno::Any& aAny )
{
if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN )
return *(sal_Bool*)aAny.getValue();
- return sal_False;
+ return false;
}
-// static
sal_Int16 ScUnoHelpFunctions::GetInt16FromAny( const uno::Any& aAny )
{
sal_Int16 nRet = 0;
@@ -174,7 +163,6 @@ sal_Int16 ScUnoHelpFunctions::GetInt16FromAny( const uno::Any& aAny )
return 0;
}
-// static
sal_Int32 ScUnoHelpFunctions::GetInt32FromAny( const uno::Any& aAny )
{
sal_Int32 nRet = 0;
@@ -183,7 +171,6 @@ sal_Int32 ScUnoHelpFunctions::GetInt32FromAny( const uno::Any& aAny )
return 0;
}
-// static
sal_Int32 ScUnoHelpFunctions::GetEnumFromAny( const uno::Any& aAny )
{
sal_Int32 nRet = 0;
@@ -194,13 +181,11 @@ sal_Int32 ScUnoHelpFunctions::GetEnumFromAny( const uno::Any& aAny )
return nRet;
}
-// static
void ScUnoHelpFunctions::SetBoolInAny( uno::Any& rAny, sal_Bool bValue )
{
rAny.setValue( &bValue, getBooleanCppuType() );
}
-// static
void ScUnoHelpFunctions::SetOptionalPropertyValue(
Reference<beans::XPropertySet>& rPropSet, const sal_Char* pPropName, const Any& rVal )
{
@@ -232,14 +217,14 @@ ScIndexEnumeration::~ScIndexEnumeration()
sal_Bool SAL_CALL ScIndexEnumeration::hasMoreElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( nPos < xIndex->getCount() );
}
uno::Any SAL_CALL ScIndexEnumeration::nextElement() throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aReturn;
try
{
@@ -255,7 +240,7 @@ uno::Any SAL_CALL ScIndexEnumeration::nextElement() throw(container::NoSuchEleme
::rtl::OUString SAL_CALL ScIndexEnumeration::getImplementationName()
throw(::com::sun::star::uno::RuntimeException)
{
- return ::rtl::OUString::createFromAscii("ScIndexEnumeration");
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScIndexEnumeration"));
}
sal_Bool SAL_CALL ScIndexEnumeration::supportsService( const ::rtl::OUString& ServiceName )
@@ -276,59 +261,6 @@ sal_Bool SAL_CALL ScIndexEnumeration::supportsService( const ::rtl::OUString& Se
//------------------------------------------------------------------------
-//UNUSED2008-05 ScEmptyEnumerationAccess::ScEmptyEnumerationAccess()
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 ScEmptyEnumerationAccess::~ScEmptyEnumerationAccess()
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 // XEnumerationAccess
-//UNUSED2008-05
-//UNUSED2008-05 uno::Reference<container::XEnumeration> SAL_CALL ScEmptyEnumerationAccess::createEnumeration()
-//UNUSED2008-05 throw(uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 ScUnoGuard aGuard;
-//UNUSED2008-05 return new ScEmptyEnumeration;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 uno::Type SAL_CALL ScEmptyEnumerationAccess::getElementType() throw(uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 ScUnoGuard aGuard;
-//UNUSED2008-05 return getCppuType((uno::Reference<uno::XInterface>*)0); // or what?
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool SAL_CALL ScEmptyEnumerationAccess::hasElements() throw(uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 }
-
-//------------------------------------------------------------------------
-
-//UNUSED2008-05 ScEmptyEnumeration::ScEmptyEnumeration()
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 ScEmptyEnumeration::~ScEmptyEnumeration()
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 // XEnumeration
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool SAL_CALL ScEmptyEnumeration::hasMoreElements() throw(uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 ScUnoGuard aGuard;
-//UNUSED2008-05 return sal_False;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 uno::Any SAL_CALL ScEmptyEnumeration::nextElement() throw(container::NoSuchElementException,
-//UNUSED2008-05 lang::WrappedTargetException, uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 ScUnoGuard aGuard;
-//UNUSED2008-05 return uno::Any();
-//UNUSED2008-05 }
-
//------------------------------------------------------------------------
ScNameToIndexAccess::ScNameToIndexAccess( const com::sun::star::uno::Reference<
@@ -361,7 +293,6 @@ sal_Int32 SAL_CALL ScNameToIndexAccess::getCount( ) throw(::com::sun::star::uno
return xNameAccess->getByName( aNames.getConstArray()[nIndex] );
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
// XElementAccess
@@ -382,43 +313,6 @@ sal_Bool SAL_CALL ScNameToIndexAccess::hasElements( ) throw(::com::sun::star::u
//------------------------------------------------------------------------
-//UNUSED2008-05 ScPrintSettingsObj::ScPrintSettingsObj()
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 ScPrintSettingsObj::~ScPrintSettingsObj()
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 // XPropertySet
-//UNUSED2008-05
-//UNUSED2008-05 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScPrintSettingsObj::getPropertySetInfo()
-//UNUSED2008-05 throw(uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 return NULL;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void SAL_CALL ScPrintSettingsObj::setPropertyValue(
-//UNUSED2008-05 const rtl::OUString& /* aPropertyName */, const uno::Any& /* aValue */ )
-//UNUSED2008-05 throw(beans::UnknownPropertyException, beans::PropertyVetoException,
-//UNUSED2008-05 lang::IllegalArgumentException, lang::WrappedTargetException,
-//UNUSED2008-05 uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 //! later...
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 uno::Any SAL_CALL ScPrintSettingsObj::getPropertyValue( const rtl::OUString& /* aPropertyName */ )
-//UNUSED2008-05 throw(beans::UnknownPropertyException, lang::WrappedTargetException,
-//UNUSED2008-05 uno::RuntimeException)
-//UNUSED2008-05 {
-//UNUSED2008-05 //! later...
-//UNUSED2008-05 return uno::Any();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 SC_IMPL_DUMMY_PROPERTY_LISTENER( ScPrintSettingsObj )
-
-
-//------------------------------------------------------------------------
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index efc5b779d8b4..0fd04cd5263f 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,15 @@
#include <svl/smplhint.hxx>
+#include <vcl/svapp.hxx>
#include <com/sun/star/sheet/NamedRangeFlag.hpp>
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
using namespace ::com::sun::star;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
#include "nameuno.hxx"
@@ -49,11 +53,9 @@ using namespace ::com::sun::star;
#include "docsh.hxx"
#include "docfunc.hxx"
#include "rangenam.hxx"
-//CHINA001 #include "namecrea.hxx" // NAME_TOP etc.
-#include "unoguard.hxx"
#include "unonames.hxx"
-#include "scui_def.hxx" //CHINA001
+#include "scui_def.hxx"
//------------------------------------------------------------------------
@@ -70,6 +72,16 @@ const SfxItemPropertyMapEntry* lcl_GetNamedRangeMap()
return aNamedRangeMap_Impl;
}
+const SfxItemPropertyMapEntry* lcl_GetNamedRangesMap()
+{
+ static SfxItemPropertyMapEntry aNamedRangesMap_Impl[] =
+ {
+ {MAP_CHAR_LEN(SC_UNO_MODIFY_BROADCAST), 0, &getBooleanCppuType(), 0, 0 },
+ {0,0,0,0,0,0}
+ };
+ return aNamedRangesMap_Impl;
+}
+
//------------------------------------------------------------------------
#define SCNAMEDRANGEOBJ_SERVICE "com.sun.star.sheet.NamedRange"
@@ -78,18 +90,15 @@ SC_SIMPLE_SERVICE_INFO( ScLabelRangeObj, "ScLabelRangeObj", "com.sun.star.sheet.
SC_SIMPLE_SERVICE_INFO( ScLabelRangesObj, "ScLabelRangesObj", "com.sun.star.sheet.LabelRanges" )
SC_SIMPLE_SERVICE_INFO( ScNamedRangesObj, "ScNamedRangesObj", "com.sun.star.sheet.NamedRanges" )
-//------------------------------------------------------------------------
-
-sal_Bool lcl_UserVisibleName( const ScRangeData* pData )
+bool lcl_UserVisibleName(const ScRangeData& rData)
{
//! als Methode an ScRangeData
- return ( pData && !pData->HasType( RT_DATABASE ) && !pData->HasType( RT_SHARED ) );
+ return !rData.HasType(RT_DATABASE) && !rData.HasType(RT_SHARED);
}
-//------------------------------------------------------------------------
-
-ScNamedRangeObj::ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm) :
+ScNamedRangeObj::ScNamedRangeObj(ScNamedRangesObj* pParent, ScDocShell* pDocSh, const String& rNm) :
+ mpParent(pParent),
pDocShell( pDocSh ),
aName( rNm )
{
@@ -120,12 +129,9 @@ ScRangeData* ScNamedRangeObj::GetRangeData_Impl()
ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
if (pNames)
{
- sal_uInt16 nPos = 0;
- if (pNames->SearchName( aName, nPos ))
- {
- pRet = (*pNames)[nPos];
+ pRet = pNames->findByName(aName);
+ if (pRet)
pRet->ValidateTabRefs(); // adjust relative tab refs to valid tables
- }
}
}
return pRet;
@@ -137,81 +143,84 @@ void ScNamedRangeObj::Modify_Impl( const String* pNewName, const ScTokenArray* p
const ScAddress* pNewPos, const sal_uInt16* pNewType,
const formula::FormulaGrammar::Grammar eGrammar )
{
- if (pDocShell)
- {
- ScDocument* pDoc = pDocShell->GetDocument();
- ScRangeName* pNames = pDoc->GetRangeName();
- if (pNames)
- {
- sal_uInt16 nPos = 0;
- if (pNames->SearchName( aName, nPos ))
- {
- ScRangeName* pNewRanges = new ScRangeName( *pNames );
- ScRangeData* pOld = (*pNames)[nPos];
-
- String aInsName(pOld->GetName());
- if (pNewName)
- aInsName = *pNewName;
- String aContent; // Content string based =>
- pOld->GetSymbol( aContent, eGrammar); // no problems with changed positions and such.
- if (pNewContent)
- aContent = *pNewContent;
- ScAddress aPos(pOld->GetPos());
- if (pNewPos)
- aPos = *pNewPos;
- sal_uInt16 nType = pOld->GetType();
- if (pNewType)
- nType = *pNewType;
-
- ScRangeData* pNew = NULL;
- if ( pNewTokens )
- pNew = new ScRangeData( pDoc, aInsName, *pNewTokens, aPos, nType );
- else
- pNew = new ScRangeData( pDoc, aInsName, aContent, aPos, nType, eGrammar );
- pNew->SetIndex( pOld->GetIndex() );
+ if (!pDocShell)
+ return;
- pNewRanges->AtFree( nPos );
- if ( pNewRanges->Insert(pNew) )
- {
- ScDocFunc aFunc(*pDocShell);
- aFunc.SetNewRangeNames( pNewRanges, sal_True );
+ ScDocument* pDoc = pDocShell->GetDocument();
+ ScRangeName* pNames = pDoc->GetRangeName();
+ if (!pNames)
+ return;
- aName = aInsName; //! broadcast?
- }
- else
- {
- delete pNew; //! uno::Exception/Fehler oder so
- delete pNewRanges;
- }
- }
- }
+ const ScRangeData* pOld = pNames->findByName(aName);
+ if (!pOld)
+ return;
+
+ ScRangeName* pNewRanges = new ScRangeName(*pNames);
+
+ String aInsName = pOld->GetName();
+ if (pNewName)
+ aInsName = *pNewName;
+
+ String aContent; // Content string based =>
+ pOld->GetSymbol( aContent, eGrammar); // no problems with changed positions and such.
+ if (pNewContent)
+ aContent = *pNewContent;
+
+ ScAddress aPos = pOld->GetPos();
+ if (pNewPos)
+ aPos = *pNewPos;
+
+ sal_uInt16 nType = pOld->GetType();
+ if (pNewType)
+ nType = *pNewType;
+
+ ScRangeData* pNew = NULL;
+ if (pNewTokens)
+ pNew = new ScRangeData( pDoc, aInsName, *pNewTokens, aPos, nType );
+ else
+ pNew = new ScRangeData( pDoc, aInsName, aContent, aPos, nType, eGrammar );
+
+ pNew->SetIndex( pOld->GetIndex() );
+
+ pNewRanges->erase(*pOld);
+ if (pNewRanges->insert(pNew))
+ {
+ ScDocFunc aFunc(*pDocShell);
+ aFunc.SetNewRangeNames(pNewRanges, mpParent->IsModifyAndBroadcast());
+
+ aName = aInsName; //! broadcast?
+ }
+ else
+ {
+ delete pNew; //! uno::Exception/Fehler oder so
+ delete pNewRanges;
}
}
rtl::OUString SAL_CALL ScNamedRangeObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return aName;
}
void SAL_CALL ScNamedRangeObj::setName( const rtl::OUString& aNewName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! Formeln anpassen ?????
String aNewStr(aNewName);
// GRAM_PODF_A1 for API compatibility.
Modify_Impl( &aNewStr, NULL, NULL, NULL, NULL,formula::FormulaGrammar::GRAM_PODF_A1 );
- if ( aName != aNewStr ) // some error occured...
+ if ( aName != aNewStr ) // some error occurred...
throw uno::RuntimeException(); // no other exceptions specified
}
rtl::OUString SAL_CALL ScNamedRangeObj::getContent() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aContent;
ScRangeData* pData = GetRangeData_Impl();
if (pData)
@@ -223,7 +232,7 @@ rtl::OUString SAL_CALL ScNamedRangeObj::getContent() throw(uno::RuntimeException
void SAL_CALL ScNamedRangeObj::setContent( const rtl::OUString& aContent )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aContStr(aContent);
// GRAM_PODF_A1 for API compatibility.
Modify_Impl( NULL, NULL, &aContStr, NULL, NULL,formula::FormulaGrammar::GRAM_PODF_A1 );
@@ -240,7 +249,7 @@ void ScNamedRangeObj::SetContentWithGrammar( const ::rtl::OUString& aContent,
table::CellAddress SAL_CALL ScNamedRangeObj::getReferencePosition()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAddress aPos;
ScRangeData* pData = GetRangeData_Impl();
if (pData)
@@ -266,7 +275,7 @@ table::CellAddress SAL_CALL ScNamedRangeObj::getReferencePosition()
void SAL_CALL ScNamedRangeObj::setReferencePosition( const table::CellAddress& aReferencePosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAddress aPos( (SCCOL)aReferencePosition.Column, (SCROW)aReferencePosition.Row, aReferencePosition.Sheet );
// GRAM_PODF_A1 for API compatibility.
Modify_Impl( NULL, NULL, NULL, &aPos, NULL,formula::FormulaGrammar::GRAM_PODF_A1 );
@@ -274,7 +283,7 @@ void SAL_CALL ScNamedRangeObj::setReferencePosition( const table::CellAddress& a
sal_Int32 SAL_CALL ScNamedRangeObj::getType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nType=0;
ScRangeData* pData = GetRangeData_Impl();
if (pData)
@@ -292,7 +301,7 @@ sal_Int32 SAL_CALL ScNamedRangeObj::getType() throw(uno::RuntimeException)
void SAL_CALL ScNamedRangeObj::setType( sal_Int32 nUnoType ) throw(uno::RuntimeException)
{
// see property 'IsSharedFormula' for RT_SHARED
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nNewType = RT_NAME;
if ( nUnoType & sheet::NamedRangeFlag::FILTER_CRITERIA ) nNewType |= RT_CRITERIA;
if ( nUnoType & sheet::NamedRangeFlag::PRINT_AREA ) nNewType |= RT_PRINTAREA;
@@ -307,7 +316,7 @@ void SAL_CALL ScNamedRangeObj::setType( sal_Int32 nUnoType ) throw(uno::RuntimeE
uno::Sequence<sheet::FormulaToken> SAL_CALL ScNamedRangeObj::getTokens() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence<sheet::FormulaToken> aSequence;
ScRangeData* pData = GetRangeData_Impl();
if (pData && pDocShell)
@@ -321,7 +330,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScNamedRangeObj::getTokens() throw(u
void SAL_CALL ScNamedRangeObj::setTokens( const uno::Sequence<sheet::FormulaToken>& rTokens ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if( pDocShell )
{
ScTokenArray aTokenArray;
@@ -337,7 +346,7 @@ void SAL_CALL ScNamedRangeObj::setTokens( const uno::Sequence<sheet::FormulaToke
uno::Reference<table::XCellRange> SAL_CALL ScNamedRangeObj::getReferredCells()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRange aRange;
ScRangeData* pData = GetRangeData_Impl();
if ( pData && pData->IsValidReference( aRange ) )
@@ -357,7 +366,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScNamedRangeObj::getReferredCells()
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScNamedRangeObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( lcl_GetNamedRangeMap() ));
return aRef;
}
@@ -368,8 +377,8 @@ void SAL_CALL ScNamedRangeObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
- if ( rPropertyName.equalsAscii( SC_UNONAME_ISSHAREDFMLA ) )
+ SolarMutexGuard aGuard;
+ if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISSHAREDFMLA ) ) )
{
bool bIsShared = false;
if( aValue >>= bIsShared )
@@ -384,23 +393,23 @@ uno::Any SAL_CALL ScNamedRangeObj::getPropertyValue( const rtl::OUString& rPrope
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aRet;
- if ( rPropertyName.equalsAscii( SC_UNO_LINKDISPBIT ) )
+ if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNO_LINKDISPBIT ) ) )
{
// no target bitmaps for individual entries (would be all equal)
// ScLinkTargetTypeObj::SetLinkTargetBitmap( aRet, SC_LINKTARGETTYPE_RANGENAME );
}
- else if ( rPropertyName.equalsAscii( SC_UNO_LINKDISPNAME ) )
+ else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNO_LINKDISPNAME ) ) )
aRet <<= rtl::OUString( aName );
- else if ( rPropertyName.equalsAscii( SC_UNONAME_TOKENINDEX ) )
+ else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_TOKENINDEX ) ) )
{
// get index for use in formula tokens (read-only)
ScRangeData* pData = GetRangeData_Impl();
if (pData)
aRet <<= static_cast<sal_Int32>(pData->GetIndex());
}
- else if ( rPropertyName.equalsAscii( SC_UNONAME_ISSHAREDFMLA ) )
+ else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISSHAREDFMLA ) ) )
{
if( ScRangeData* pData = GetRangeData_Impl() )
aRet <<= static_cast< bool >( pData->HasType( RT_SHARED ) );
@@ -420,8 +429,8 @@ rtl::OUString SAL_CALL ScNamedRangeObj::getImplementationName() throw(uno::Runti
sal_Bool SAL_CALL ScNamedRangeObj::supportsService( const rtl::OUString& rServiceName )
throw(uno::RuntimeException)
{
- return rServiceName.equalsAscii( SCNAMEDRANGEOBJ_SERVICE ) ||
- rServiceName.equalsAscii( SCLINKTARGET_SERVICE );
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SCNAMEDRANGEOBJ_SERVICE ) ) ||
+ rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SCLINKTARGET_SERVICE ) );
}
uno::Sequence<rtl::OUString> SAL_CALL ScNamedRangeObj::getSupportedServiceNames()
@@ -448,7 +457,6 @@ sal_Int64 SAL_CALL ScNamedRangeObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScNamedRangeObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -465,7 +473,6 @@ const uno::Sequence<sal_Int8>& ScNamedRangeObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScNamedRangeObj* ScNamedRangeObj::getImplementation( const uno::Reference<uno::XInterface> xObj )
{
ScNamedRangeObj* pRet = NULL;
@@ -478,7 +485,8 @@ ScNamedRangeObj* ScNamedRangeObj::getImplementation( const uno::Reference<uno::X
//------------------------------------------------------------------------
ScNamedRangesObj::ScNamedRangesObj(ScDocShell* pDocSh) :
- pDocShell( pDocSh )
+ pDocShell( pDocSh ),
+ mbModifyAndBroadcast(true)
{
pDocShell->GetDocument()->AddUnoObject(*this);
}
@@ -500,28 +508,32 @@ void ScNamedRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
+bool ScNamedRangesObj::IsModifyAndBroadcast() const
+{
+ return mbModifyAndBroadcast;
+}
+
// sheet::XNamedRanges
ScNamedRangeObj* ScNamedRangesObj::GetObjectByIndex_Impl(sal_uInt16 nIndex)
{
- if (pDocShell)
+ if (!pDocShell)
+ return NULL;
+
+ ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
+ if (!pNames)
+ return NULL;
+
+ ScRangeName::const_iterator itr = pNames->begin(), itrEnd = pNames->end();
+ sal_uInt16 nPos = 0;
+ for (; itr != itrEnd; ++itr)
{
- ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
- if (pNames)
+ if (lcl_UserVisibleName(*itr))
{
- sal_uInt16 nCount = pNames->GetCount();
- sal_uInt16 nPos = 0;
- for (sal_uInt16 i=0; i<nCount; i++)
- {
- ScRangeData* pData = (*pNames)[i];
- if (lcl_UserVisibleName(pData)) // interne weglassen
- {
- if ( nPos == nIndex )
- return new ScNamedRangeObj( pDocShell, pData->GetName() );
- ++nPos;
- }
- }
+ if (nPos == nIndex)
+ return new ScNamedRangeObj(this, pDocShell, itr->GetName());
}
+ ++nPos;
}
return NULL;
}
@@ -529,7 +541,7 @@ ScNamedRangeObj* ScNamedRangesObj::GetObjectByIndex_Impl(sal_uInt16 nIndex)
ScNamedRangeObj* ScNamedRangesObj::GetObjectByName_Impl(const rtl::OUString& aName)
{
if ( pDocShell && hasByName(aName) )
- return new ScNamedRangeObj( pDocShell, String(aName) );
+ return new ScNamedRangeObj(this, pDocShell, String(aName));
return NULL;
}
@@ -537,9 +549,7 @@ void SAL_CALL ScNamedRangesObj::addNewByName( const rtl::OUString& aName,
const rtl::OUString& aContent, const table::CellAddress& aPosition,
sal_Int32 nUnoType ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- String aNameStr(aName);
- String aContStr(aContent);
+ SolarMutexGuard aGuard;
ScAddress aPos( (SCCOL)aPosition.Column, (SCROW)aPosition.Row, aPosition.Sheet );
sal_uInt16 nNewType = RT_NAME;
@@ -548,23 +558,22 @@ void SAL_CALL ScNamedRangesObj::addNewByName( const rtl::OUString& aName,
if ( nUnoType & sheet::NamedRangeFlag::COLUMN_HEADER ) nNewType |= RT_COLHEADER;
if ( nUnoType & sheet::NamedRangeFlag::ROW_HEADER ) nNewType |= RT_ROWHEADER;
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
ScRangeName* pNames = pDoc->GetRangeName();
- sal_uInt16 nIndex = 0;
- if (pNames && !pNames->SearchName(aNameStr, nIndex))
+ if (pNames && !pNames->findByName(aName))
{
ScRangeName* pNewRanges = new ScRangeName( *pNames );
// GRAM_PODF_A1 for API compatibility.
- ScRangeData* pNew = new ScRangeData( pDoc, aNameStr, aContStr,
+ ScRangeData* pNew = new ScRangeData( pDoc, aName, aContent,
aPos, nNewType,formula::FormulaGrammar::GRAM_PODF_A1 );
- if ( pNewRanges->Insert(pNew) )
+ if ( pNewRanges->insert(pNew) )
{
ScDocFunc aFunc(*pDocShell);
- aFunc.SetNewRangeNames( pNewRanges, sal_True );
- bDone = sal_True;
+ aFunc.SetNewRangeNames(pNewRanges, mbModifyAndBroadcast);
+ bDone = true;
}
else
{
@@ -581,7 +590,7 @@ void SAL_CALL ScNamedRangesObj::addNewByName( const rtl::OUString& aName,
void SAL_CALL ScNamedRangesObj::addNewFromTitles( const table::CellRangeAddress& aSource,
sheet::Border aBorder ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! das darf kein enum sein, weil mehrere Bits gesetzt sein koennen !!!
sal_Bool bTop = ( aBorder == sheet::Border_TOP );
@@ -608,24 +617,22 @@ void SAL_CALL ScNamedRangesObj::addNewFromTitles( const table::CellRangeAddress&
void SAL_CALL ScNamedRangesObj::removeByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ bool bDone = false;
if (pDocShell)
{
ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
if (pNames)
{
- String aString(aName);
- sal_uInt16 nPos = 0;
- if (pNames->SearchName( aString, nPos ))
- if ( lcl_UserVisibleName((*pNames)[nPos]) )
- {
- ScRangeName* pNewRanges = new ScRangeName(*pNames);
- pNewRanges->AtFree(nPos);
- ScDocFunc aFunc(*pDocShell);
- aFunc.SetNewRangeNames( pNewRanges, sal_True );
- bDone = sal_True;
- }
+ const ScRangeData* pData = pNames->findByName(aName);
+ if (pData && lcl_UserVisibleName(*pData))
+ {
+ ScRangeName* pNewRanges = new ScRangeName(*pNames);
+ pNewRanges->erase(*pData);
+ ScDocFunc aFunc(*pDocShell);
+ aFunc.SetNewRangeNames( pNewRanges, mbModifyAndBroadcast);
+ bDone = true;
+ }
}
}
@@ -636,7 +643,7 @@ void SAL_CALL ScNamedRangesObj::removeByName( const rtl::OUString& aName )
void SAL_CALL ScNamedRangesObj::outputList( const table::CellAddress& aOutputPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScAddress aPos( (SCCOL)aOutputPosition.Column, (SCROW)aOutputPosition.Row, aOutputPosition.Sheet );
if (pDocShell)
{
@@ -650,7 +657,7 @@ void SAL_CALL ScNamedRangesObj::outputList( const table::CellAddress& aOutputPos
uno::Reference<container::XEnumeration> SAL_CALL ScNamedRangesObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.NamedRangesEnumeration")));
}
@@ -658,16 +665,16 @@ uno::Reference<container::XEnumeration> SAL_CALL ScNamedRangesObj::createEnumera
sal_Int32 SAL_CALL ScNamedRangesObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
long nRet = 0;
if (pDocShell)
{
ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
if (pNames)
{
- sal_uInt16 nCount = pNames->GetCount();
- for (sal_uInt16 i=0; i<nCount; i++)
- if (lcl_UserVisibleName( (*pNames)[i] )) // interne weglassen
+ ScRangeName::const_iterator itr = pNames->begin(), itrEnd = pNames->end();
+ for (; itr != itrEnd; ++itr)
+ if (lcl_UserVisibleName(*itr))
++nRet;
}
}
@@ -678,44 +685,77 @@ uno::Any SAL_CALL ScNamedRangesObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< sheet::XNamedRange > xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
if ( xRange.is() )
return uno::makeAny(xRange);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScNamedRangesObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ::getCppuType((const uno::Reference< sheet::XNamedRange >*)0); // muss zu getByIndex passen
}
sal_Bool SAL_CALL ScNamedRangesObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
+Reference<beans::XPropertySetInfo> SAL_CALL ScNamedRangesObj::getPropertySetInfo()
+ throw(uno::RuntimeException)
+{
+ static Reference<beans::XPropertySetInfo> aRef(
+ new SfxItemPropertySetInfo(lcl_GetNamedRangesMap()));
+ return aRef;
+}
+
+void SAL_CALL ScNamedRangesObj::setPropertyValue(
+ const rtl::OUString& rPropertyName, const uno::Any& aValue )
+ throw(beans::UnknownPropertyException, beans::PropertyVetoException,
+ lang::IllegalArgumentException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ if (rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SC_UNO_MODIFY_BROADCAST)))
+ {
+ aValue >>= mbModifyAndBroadcast;
+ }
+}
+
+Any SAL_CALL ScNamedRangesObj::getPropertyValue( const rtl::OUString& rPropertyName )
+ throw(beans::UnknownPropertyException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ Any aRet;
+ if (rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SC_UNO_MODIFY_BROADCAST)))
+ {
+ aRet <<= mbModifyAndBroadcast;
+ }
+
+ return aRet;
+}
+
+SC_IMPL_DUMMY_PROPERTY_LISTENER( ScNamedRangesObj )
+
uno::Any SAL_CALL ScNamedRangesObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< sheet::XNamedRange > xRange(GetObjectByName_Impl(aName));
if ( xRange.is() )
return uno::makeAny(xRange);
else
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScNamedRangesObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
@@ -724,16 +764,13 @@ uno::Sequence<rtl::OUString> SAL_CALL ScNamedRangesObj::getElementNames()
long nVisCount = getCount(); // Namen mit lcl_UserVisibleName
uno::Sequence<rtl::OUString> aSeq(nVisCount);
rtl::OUString* pAry = aSeq.getArray();
-
- sal_uInt16 nCount = pNames->GetCount();
sal_uInt16 nVisPos = 0;
- for (sal_uInt16 i=0; i<nCount; i++)
+ ScRangeName::const_iterator itr = pNames->begin(), itrEnd = pNames->end();
+ for (; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pNames)[i];
- if ( lcl_UserVisibleName(pData) )
- pAry[nVisPos++] = pData->GetName();
+ if (lcl_UserVisibleName(*itr))
+ pAry[nVisPos++] = itr->GetName();
}
-// DBG_ASSERT(nVisPos == nVisCount, "huch, verzaehlt?");
return aSeq;
}
}
@@ -743,19 +780,18 @@ uno::Sequence<rtl::OUString> SAL_CALL ScNamedRangesObj::getElementNames()
sal_Bool SAL_CALL ScNamedRangesObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
if (pNames)
{
- sal_uInt16 nPos = 0;
- if (pNames->SearchName( String(aName), nPos ))
- if ( lcl_UserVisibleName((*pNames)[nPos]) )
- return sal_True;
+ const ScRangeData* pData = pNames->findByName(aName);
+ if (pData && lcl_UserVisibleName(*pData))
+ return sal_True;
}
}
- return sal_False;
+ return false;
}
/** called from the XActionLockable interface methods on initial locking */
@@ -767,20 +803,20 @@ void ScNamedRangesObj::lock()
/** called from the XActionLockable interface methods on final unlock */
void ScNamedRangesObj::unlock()
{
- pDocShell->GetDocument()->CompileNameFormula( sal_False ); // CompileFormulaString
+ pDocShell->GetDocument()->CompileNameFormula( false ); // CompileFormulaString
}
// document::XActionLockable
sal_Bool ScNamedRangesObj::isActionLocked() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return pDocShell->GetDocument()->GetNamedRangesLockCount() != 0;
}
void ScNamedRangesObj::addActionLock() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocument* pDoc = pDocShell->GetDocument();
sal_Int16 nLockCount = pDoc->GetNamedRangesLockCount();
++nLockCount;
@@ -793,7 +829,7 @@ void ScNamedRangesObj::addActionLock() throw(uno::RuntimeException)
void ScNamedRangesObj::removeActionLock() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocument* pDoc = pDocShell->GetDocument();
sal_Int16 nLockCount = pDoc->GetNamedRangesLockCount();
if ( nLockCount > 0 )
@@ -809,7 +845,7 @@ void ScNamedRangesObj::removeActionLock() throw(uno::RuntimeException)
void ScNamedRangesObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( nLock >= 0 )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -828,7 +864,7 @@ void ScNamedRangesObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeExcep
sal_Int16 ScNamedRangesObj::resetActionLocks() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocument* pDoc = pDocShell->GetDocument();
sal_Int16 nLockCount = pDoc->GetNamedRangesLockCount();
if ( nLockCount > 0 )
@@ -923,7 +959,7 @@ void ScLabelRangeObj::Modify_Impl( const ScRange* pLabel, const ScRange* pData )
table::CellRangeAddress SAL_CALL ScLabelRangeObj::getLabelArea()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aRet;
ScRangePair* pData = GetData_Impl();
if (pData)
@@ -934,7 +970,7 @@ table::CellRangeAddress SAL_CALL ScLabelRangeObj::getLabelArea()
void SAL_CALL ScLabelRangeObj::setLabelArea( const table::CellRangeAddress& aLabelArea )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRange aLabelRange;
ScUnoConversion::FillScRange( aLabelRange, aLabelArea );
Modify_Impl( &aLabelRange, NULL );
@@ -943,7 +979,7 @@ void SAL_CALL ScLabelRangeObj::setLabelArea( const table::CellRangeAddress& aLab
table::CellRangeAddress SAL_CALL ScLabelRangeObj::getDataArea()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aRet;
ScRangePair* pData = GetData_Impl();
if (pData)
@@ -954,7 +990,7 @@ table::CellRangeAddress SAL_CALL ScLabelRangeObj::getDataArea()
void SAL_CALL ScLabelRangeObj::setDataArea( const table::CellRangeAddress& aDataArea )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScRange aDataRange;
ScUnoConversion::FillScRange( aDataRange, aDataArea );
Modify_Impl( NULL, &aDataRange );
@@ -988,15 +1024,15 @@ void ScLabelRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
// sheet::XLabelRanges
-ScLabelRangeObj* ScLabelRangesObj::GetObjectByIndex_Impl(sal_uInt16 nIndex)
+ScLabelRangeObj* ScLabelRangesObj::GetObjectByIndex_Impl(size_t nIndex)
{
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
ScRangePairList* pList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
- if ( pList && nIndex < pList->Count() )
+ if ( pList && nIndex < pList->size() )
{
- ScRangePair* pData = pList->GetObject(nIndex);
+ ScRangePair* pData = (*pList)[nIndex];
if (pData)
return new ScLabelRangeObj( pDocShell, bColumn, pData->GetRange(0) );
}
@@ -1008,7 +1044,7 @@ void SAL_CALL ScLabelRangesObj::addNew( const table::CellRangeAddress& aLabelAre
const table::CellRangeAddress& aDataArea )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -1040,18 +1076,18 @@ void SAL_CALL ScLabelRangesObj::addNew( const table::CellRangeAddress& aLabelAre
void SAL_CALL ScLabelRangesObj::removeByIndex( sal_Int32 nIndex )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
ScRangePairList* pOldList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
- if ( pOldList && nIndex >= 0 && nIndex < (sal_Int32)pOldList->Count() )
+ if ( pOldList && nIndex >= 0 && nIndex < (sal_Int32)pOldList->size() )
{
ScRangePairListRef xNewList(pOldList->Clone());
- ScRangePair* pEntry = xNewList->GetObject( nIndex );
+ ScRangePair* pEntry = (*xNewList)[nIndex];
if (pEntry)
{
xNewList->Remove( pEntry );
@@ -1080,7 +1116,7 @@ void SAL_CALL ScLabelRangesObj::removeByIndex( sal_Int32 nIndex )
uno::Reference<container::XEnumeration> SAL_CALL ScLabelRangesObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.LabelRangesEnumeration")));
}
@@ -1088,13 +1124,13 @@ uno::Reference<container::XEnumeration> SAL_CALL ScLabelRangesObj::createEnumera
sal_Int32 SAL_CALL ScLabelRangesObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pDocShell)
{
ScDocument* pDoc = pDocShell->GetDocument();
ScRangePairList* pList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
if (pList)
- return pList->Count();
+ return pList->size();
}
return 0;
}
@@ -1103,25 +1139,24 @@ uno::Any SAL_CALL ScLabelRangesObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< sheet::XLabelRange > xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
if ( xRange.is() )
return uno::makeAny(xRange);
else
throw lang::IndexOutOfBoundsException();
-// return uno::Any();
}
uno::Type SAL_CALL ScLabelRangesObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ::getCppuType((const uno::Reference< sheet::XLabelRange >*)0); // muss zu getByIndex passen
}
sal_Bool SAL_CALL ScLabelRangesObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -1129,3 +1164,4 @@ sal_Bool SAL_CALL ScLabelRangesObj::hasElements() throw(uno::RuntimeException)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index c5dd11977478..7860ba8fbde6 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <editeng/unotext.hxx>
#include <svx/svdpool.hxx>
#include <svx/svdobj.hxx>
+#include <vcl/svapp.hxx>
#include "notesuno.hxx"
#include "textuno.hxx"
#include "cellsuno.hxx" // getParent
@@ -48,7 +50,6 @@
#include "drwlayer.hxx"
#include "detfunc.hxx"
#include "undocell.hxx"
-#include "unoguard.hxx"
#include "userdat.hxx"
#include <editeng/outlobj.hxx>
#include <svx/unoshape.hxx>
@@ -56,16 +57,20 @@
#include <svx/svditer.hxx>
#include <svx/svdpage.hxx>
#include <com/sun/star/drawing/XShapeDescriptor.hpp>
+#include <editeng/unoprnms.hxx>
using namespace com::sun::star;
//------------------------------------------------------------------------
-// keine Properties fuer Text in Notizen
const SvxItemPropertySet* lcl_GetAnnotationPropertySet()
{
static SfxItemPropertyMapEntry aAnnotationPropertyMap_Impl[] =
{
+ SVX_UNOEDIT_CHAR_PROPERTIES,
+ SVX_UNOEDIT_FONT_PROPERTIES,
+ SVX_UNOEDIT_PARA_PROPERTIES,
+ SVX_UNOEDIT_NUMBERING_PROPERTIE, // for completeness of service ParagraphProperties
{0,0,0,0,0,0}
};
static SvxItemPropertySet aAnnotationPropertySet_Impl( aAnnotationPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
@@ -119,7 +124,7 @@ void ScAnnotationObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
uno::Reference<uno::XInterface> SAL_CALL ScAnnotationObj::getParent() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Parent der Notiz ist die zugehoerige Zelle
//! existierendes Objekt finden und zurueckgeben ???
@@ -142,7 +147,7 @@ void SAL_CALL ScAnnotationObj::setParent( const uno::Reference<uno::XInterface>&
uno::Reference<text::XTextCursor> SAL_CALL ScAnnotationObj::createTextCursor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Notizen brauchen keine Extrawurst
return GetUnoText().createTextCursor();
}
@@ -151,20 +156,20 @@ uno::Reference<text::XTextCursor> SAL_CALL ScAnnotationObj::createTextCursorByRa
const uno::Reference<text::XTextRange>& aTextPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Notizen brauchen keine Extrawurst
return GetUnoText().createTextCursorByRange(aTextPosition);
}
rtl::OUString SAL_CALL ScAnnotationObj::getString() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getString();
}
void SAL_CALL ScAnnotationObj::setString( const rtl::OUString& aText ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().setString(aText);
}
@@ -172,7 +177,7 @@ void SAL_CALL ScAnnotationObj::insertString( const uno::Reference<text::XTextRan
const rtl::OUString& aString, sal_Bool bAbsorb )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().insertString( xRange, aString, bAbsorb );
}
@@ -180,25 +185,25 @@ void SAL_CALL ScAnnotationObj::insertControlCharacter( const uno::Reference<text
sal_Int16 nControlCharacter, sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().insertControlCharacter( xRange, nControlCharacter, bAbsorb );
}
uno::Reference<text::XText> SAL_CALL ScAnnotationObj::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getText();
}
uno::Reference<text::XTextRange> SAL_CALL ScAnnotationObj::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getStart();
}
uno::Reference<text::XTextRange> SAL_CALL ScAnnotationObj::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getEnd();
}
@@ -206,7 +211,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScAnnotationObj::getEnd() throw(uno::R
table::CellAddress SAL_CALL ScAnnotationObj::getPosition() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellAddress aAdr;
aAdr.Sheet = aCellPos.Tab();
aAdr.Column = aCellPos.Col();
@@ -216,28 +221,28 @@ table::CellAddress SAL_CALL ScAnnotationObj::getPosition() throw(uno::RuntimeExc
rtl::OUString SAL_CALL ScAnnotationObj::getAuthor() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScPostIt* pNote = ImplGetNote();
return pNote ? pNote->GetAuthor() : rtl::OUString();
}
rtl::OUString SAL_CALL ScAnnotationObj::getDate() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScPostIt* pNote = ImplGetNote();
return pNote ? pNote->GetDate() : rtl::OUString();
}
sal_Bool SAL_CALL ScAnnotationObj::getIsVisible() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const ScPostIt* pNote = ImplGetNote();
return pNote && pNote->IsCaptionShown();
}
void SAL_CALL ScAnnotationObj::setIsVisible( sal_Bool bIsVisible ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// show/hide note with undo action
if( pDocShell )
pDocShell->GetDocFunc().ShowNote( aCellPos, bIsVisible );
@@ -247,7 +252,7 @@ void SAL_CALL ScAnnotationObj::setIsVisible( sal_Bool bIsVisible ) throw(uno::Ru
uno::Reference < drawing::XShape > SAL_CALL ScAnnotationObj::getAnnotationShape()
throw(::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScAnnotationShapeObj(pDocShell, aCellPos);
}
@@ -329,7 +334,7 @@ void ScAnnotationShapeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
uno::Reference<uno::XInterface> SAL_CALL ScAnnotationShapeObj::getParent() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Parent der Notiz ist die zugehoerige Zelle
//! existierendes Objekt finden und zurueckgeben ???
@@ -350,14 +355,14 @@ void SAL_CALL ScAnnotationShapeObj::setParent( const uno::Reference<uno::XInterf
// XElementAccess
uno::Type SAL_CALL ScAnnotationShapeObj::getElementType( ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getElementType();
}
sal_Bool SAL_CALL ScAnnotationShapeObj::hasElements( ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().hasElements();
}
@@ -365,7 +370,7 @@ sal_Bool SAL_CALL ScAnnotationShapeObj::hasElements( ) throw (uno::RuntimeExcep
// XEnumerationAccess
uno::Reference< container::XEnumeration > SAL_CALL ScAnnotationShapeObj::createEnumeration( ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().createEnumeration();
}
@@ -374,7 +379,7 @@ uno::Reference< container::XEnumeration > SAL_CALL ScAnnotationShapeObj::createE
void SAL_CALL ScAnnotationShapeObj::moveTextRange( const uno::Reference< text::XTextRange >& xRange, sal_Int16 nParagraphs )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().moveTextRange( xRange, nParagraphs );
}
@@ -385,7 +390,7 @@ void SAL_CALL ScAnnotationShapeObj::insertTextContent( const uno::Reference< tex
throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().insertTextContent( xRange, xContent, bAbsorb );
}
@@ -394,7 +399,7 @@ void SAL_CALL ScAnnotationShapeObj::removeTextContent( const uno::Reference< tex
throw (container::NoSuchElementException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().removeTextContent( xContent );
}
@@ -404,7 +409,7 @@ void SAL_CALL ScAnnotationShapeObj::removeTextContent( const uno::Reference< tex
uno::Reference<text::XTextCursor> SAL_CALL ScAnnotationShapeObj::createTextCursor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Notizen brauchen keine Extrawurst
return GetUnoText().createTextCursor();
}
@@ -413,20 +418,20 @@ uno::Reference<text::XTextCursor> SAL_CALL ScAnnotationShapeObj::createTextCurso
const uno::Reference<text::XTextRange>& aTextPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// Notizen brauchen keine Extrawurst
return GetUnoText().createTextCursorByRange(aTextPosition);
}
rtl::OUString SAL_CALL ScAnnotationShapeObj::getString() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getString();
}
void SAL_CALL ScAnnotationShapeObj::setString( const rtl::OUString& aText ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().setString(aText);
}
@@ -434,7 +439,7 @@ void SAL_CALL ScAnnotationShapeObj::insertString( const uno::Reference<text::XTe
const rtl::OUString& aString, sal_Bool bAbsorb )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().insertString( xRange, aString, bAbsorb );
}
@@ -442,25 +447,25 @@ void SAL_CALL ScAnnotationShapeObj::insertControlCharacter( const uno::Reference
sal_Int16 nControlCharacter, sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetUnoText().insertControlCharacter( xRange, nControlCharacter, bAbsorb );
}
uno::Reference<text::XText> SAL_CALL ScAnnotationShapeObj::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getText();
}
uno::Reference<text::XTextRange> SAL_CALL ScAnnotationShapeObj::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getStart();
}
uno::Reference<text::XTextRange> SAL_CALL ScAnnotationShapeObj::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return GetUnoText().getEnd();
}
@@ -468,7 +473,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScAnnotationShapeObj::getEnd() throw(u
::rtl::OUString SAL_CALL ScAnnotationShapeObj::getShapeType( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < drawing::XShapeDescriptor > xDesc(GetXShape(), uno::UNO_QUERY);
if (xDesc.is())
return xDesc->getShapeType();
@@ -479,7 +484,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScAnnotationShapeObj::getEnd() throw(u
awt::Point SAL_CALL ScAnnotationShapeObj::getPosition( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetXShape();
return xShape.is() ? xShape->getPosition() : awt::Point();
}
@@ -487,7 +492,7 @@ awt::Point SAL_CALL ScAnnotationShapeObj::getPosition( )
void SAL_CALL ScAnnotationShapeObj::setPosition( const awt::Point& aPosition )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetXShape();
if( xShape.is() )
xShape->setPosition(aPosition);
@@ -496,7 +501,7 @@ void SAL_CALL ScAnnotationShapeObj::setPosition( const awt::Point& aPosition )
awt::Size SAL_CALL ScAnnotationShapeObj::getSize( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetXShape();
return xShape.is() ? xShape->getSize() : awt::Size();
}
@@ -504,7 +509,7 @@ awt::Size SAL_CALL ScAnnotationShapeObj::getSize( )
void SAL_CALL ScAnnotationShapeObj::setSize( const awt::Size& aSize )
throw (beans::PropertyVetoException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetXShape();
if( xShape.is() )
xShape->setSize(aSize);
@@ -515,7 +520,7 @@ beans::PropertyState SAL_CALL ScAnnotationShapeObj::getPropertyState( const rtl:
throw (beans::UnknownPropertyException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertyState > xState (GetXShape(), uno::UNO_QUERY);
if (xState.is())
return xState->getPropertyState( PropertyName );
@@ -527,7 +532,7 @@ uno::Sequence< beans::PropertyState > SAL_CALL ScAnnotationShapeObj::getProperty
throw (beans::UnknownPropertyException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertyState > xState (GetXShape(), uno::UNO_QUERY);
if (xState.is())
return xState->getPropertyStates( aPropertyName );
@@ -538,7 +543,7 @@ void SAL_CALL ScAnnotationShapeObj::setPropertyToDefault( const ::rtl::OUString&
throw (::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertyState > xState (GetXShape(), uno::UNO_QUERY);
if (xState.is())
xState->setPropertyToDefault( PropertyName );
@@ -548,7 +553,7 @@ uno::Any SAL_CALL ScAnnotationShapeObj::getPropertyDefault( const rtl::OUString&
throw (beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertyState > xState (GetXShape(), uno::UNO_QUERY);
if (xState.is())
return xState->getPropertyDefault( aPropertyName );
@@ -559,7 +564,7 @@ uno::Any SAL_CALL ScAnnotationShapeObj::getPropertyDefault( const rtl::OUString&
uno::Reference< beans::XPropertySetInfo > SAL_CALL ScAnnotationShapeObj::getPropertySetInfo( )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
return xProp->getPropertySetInfo();
@@ -573,7 +578,7 @@ void SAL_CALL ScAnnotationShapeObj::setPropertyValue( const rtl::OUString& aProp
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
xProp->setPropertyValue( aPropertyName, aValue );
@@ -584,7 +589,7 @@ uno::Any SAL_CALL ScAnnotationShapeObj::getPropertyValue( const rtl::OUString& P
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
return xProp->getPropertyValue( PropertyName );
@@ -597,7 +602,7 @@ void SAL_CALL ScAnnotationShapeObj::addPropertyChangeListener( const rtl::OUStri
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
return xProp->addPropertyChangeListener( aPropertyName, xListener );
@@ -609,7 +614,7 @@ void SAL_CALL ScAnnotationShapeObj::removePropertyChangeListener( const rtl::OUS
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
return xProp->removePropertyChangeListener( aPropertyName, aListener );
@@ -621,7 +626,7 @@ void SAL_CALL ScAnnotationShapeObj::addVetoableChangeListener( const rtl::OUStri
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
return xProp->addVetoableChangeListener( PropertyName, aListener );
@@ -633,7 +638,7 @@ void SAL_CALL ScAnnotationShapeObj::removeVetoableChangeListener( const rtl::OUS
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
return xProp->removeVetoableChangeListener( PropertyName, aListener );
@@ -647,7 +652,7 @@ void SAL_CALL ScAnnotationShapeObj::setPropertyValues( const uno::Sequence< rtl:
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XMultiPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
xProp->setPropertyValues( aPropertyNames, aValues );
@@ -657,7 +662,7 @@ uno::Sequence< uno::Any > SAL_CALL ScAnnotationShapeObj::getPropertyValues(
const uno::Sequence< rtl::OUString >& aPropertyNames )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XMultiPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
return xProp->getPropertyValues( aPropertyNames );
@@ -668,7 +673,7 @@ void SAL_CALL ScAnnotationShapeObj::addPropertiesChangeListener( const uno::Sequ
const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XMultiPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
xProp->addPropertiesChangeListener( aPropertyNames, xListener );
@@ -677,7 +682,7 @@ void SAL_CALL ScAnnotationShapeObj::addPropertiesChangeListener( const uno::Sequ
void SAL_CALL ScAnnotationShapeObj::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XMultiPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
xProp->removePropertiesChangeListener( xListener );
@@ -687,7 +692,7 @@ void SAL_CALL ScAnnotationShapeObj::firePropertiesChangeEvent( const uno::Sequen
const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < beans::XMultiPropertySet > xProp (GetXShape(), uno::UNO_QUERY);
if (xProp.is())
xProp->firePropertiesChangeEvent( aPropertyNames, xListener );
@@ -696,7 +701,7 @@ void SAL_CALL ScAnnotationShapeObj::firePropertiesChangeEvent( const uno::Sequen
// XComponent
void SAL_CALL ScAnnotationShapeObj::dispose( ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < lang::XComponent > xComp (GetXShape(), uno::UNO_QUERY);
if (xComp.is())
xComp->dispose();
@@ -707,7 +712,7 @@ void SAL_CALL ScAnnotationShapeObj::dispose( ) throw (uno::RuntimeException)
void SAL_CALL ScAnnotationShapeObj::addEventListener( const uno::Reference< lang::XEventListener >& xListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < lang::XComponent > xComp (GetXShape(), uno::UNO_QUERY);
if (xComp.is())
xComp->addEventListener( xListener );
@@ -716,7 +721,7 @@ void SAL_CALL ScAnnotationShapeObj::addEventListener( const uno::Reference< lang
void SAL_CALL ScAnnotationShapeObj::removeEventListener( const uno::Reference< lang::XEventListener >& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference < lang::XComponent > xComp (GetXShape(), uno::UNO_QUERY);
if (xComp.is())
xComp->removeEventListener( aListener );
@@ -727,3 +732,4 @@ void SAL_CALL ScAnnotationShapeObj::removeEventListener( const uno::Reference< l
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx
index a23ad8fe4793..c8ba4ed5bd6f 100644
--- a/sc/source/ui/unoobj/optuno.cxx
+++ b/sc/source/ui/unoobj/optuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,12 +39,10 @@
#include "miscuno.hxx"
#include "unonames.hxx"
#include "docoptio.hxx"
-#include "unoguard.hxx"
using namespace com::sun::star;
//------------------------------------------------------------------------
-// static
const SfxItemPropertyMapEntry* ScDocOptionsHelper::GetPropertyMap()
{
static SfxItemPropertyMapEntry aMap[] =
@@ -65,7 +64,6 @@ const SfxItemPropertyMapEntry* ScDocOptionsHelper::GetPropertyMap()
return aMap;
}
-// static
sal_Bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions,
const SfxItemPropertyMap& rPropMap,
const rtl::OUString& aPropertyName, const uno::Any& aValue )
@@ -74,7 +72,7 @@ sal_Bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions,
const SfxItemPropertySimpleEntry* pEntry = rPropMap.getByName(aPropertyName );
if( !pEntry || !pEntry->nWID )
- return sal_False;
+ return false;
switch( pEntry->nWID )
{
case PROP_UNO_CALCASSHOWN :
@@ -138,7 +136,6 @@ sal_Bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions,
return sal_True;
}
-// static
uno::Any ScDocOptionsHelper::getPropertyValue(
const ScDocOptions& rOptions,
const SfxItemPropertyMap& rPropMap,
@@ -214,7 +211,7 @@ void SAL_CALL ScDocOptionsObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Bool bDone = ScDocOptionsHelper::setPropertyValue( aOptions, *GetPropertySet().getPropertyMap(), aPropertyName, aValue );
@@ -226,7 +223,7 @@ uno::Any SAL_CALL ScDocOptionsObj::getPropertyValue( const rtl::OUString& aPrope
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aRet(ScDocOptionsHelper::getPropertyValue( aOptions, *GetPropertySet().getPropertyMap(), aPropertyName ));
if ( !aRet.hasValue() )
@@ -235,3 +232,4 @@ uno::Any SAL_CALL ScDocOptionsObj::getPropertyValue( const rtl::OUString& aPrope
return aRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/pageuno.cxx b/sc/source/ui/unoobj/pageuno.cxx
index 4687683a8ef4..37b7d83c6886 100644
--- a/sc/source/ui/unoobj/pageuno.cxx
+++ b/sc/source/ui/unoobj/pageuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,5 @@ uno::Sequence<rtl::OUString> SAL_CALL ScPageObj::getSupportedServiceNames()
pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDrawPage"));
return aRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 1407c12e2618..89a358ad1408 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,8 @@
#include "scdetect.hxx"
+#include <sal/macros.h>
+
#include <framework/interaction.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -37,9 +40,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
@@ -53,9 +54,7 @@
#include <framework/interaction.hxx>
-#ifndef _TOOLKIT_UNOHLP_HXX
#include <toolkit/helper/vclunohelper.hxx>
-#endif
#include <ucbhelper/simpleinteractionrequest.hxx>
#include <svtools/parhtml.hxx>
@@ -66,7 +65,7 @@
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <tools/urlobj.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
#include <sot/storinfo.hxx>
@@ -98,31 +97,32 @@ ScFilterDetect::~ScFilterDetect()
{
}
-static const sal_Char __FAR_DATA pFilterSc50[] = "StarCalc 5.0";
-static const sal_Char __FAR_DATA pFilterSc50Temp[] = "StarCalc 5.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterSc40[] = "StarCalc 4.0";
-static const sal_Char __FAR_DATA pFilterSc40Temp[] = "StarCalc 4.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterSc30[] = "StarCalc 3.0";
-static const sal_Char __FAR_DATA pFilterSc30Temp[] = "StarCalc 3.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterSc10[] = "StarCalc 1.0";
-static const sal_Char __FAR_DATA pFilterXML[] = "StarOffice XML (Calc)";
-static const sal_Char __FAR_DATA pFilterAscii[] = "Text - txt - csv (StarCalc)";
-static const sal_Char __FAR_DATA pFilterLotus[] = "Lotus";
-static const sal_Char __FAR_DATA pFilterQPro6[] = "Quattro Pro 6.0";
-static const sal_Char __FAR_DATA pFilterExcel4[] = "MS Excel 4.0";
-static const sal_Char __FAR_DATA pFilterEx4Temp[] = "MS Excel 4.0 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterExcel5[] = "MS Excel 5.0/95";
-static const sal_Char __FAR_DATA pFilterEx5Temp[] = "MS Excel 5.0/95 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterExcel95[] = "MS Excel 95";
-static const sal_Char __FAR_DATA pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterExcel97[] = "MS Excel 97";
-static const sal_Char __FAR_DATA pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template";
-static const sal_Char __FAR_DATA pFilterDBase[] = "dBase";
-static const sal_Char __FAR_DATA pFilterDif[] = "DIF";
-static const sal_Char __FAR_DATA pFilterSylk[] = "SYLK";
-static const sal_Char __FAR_DATA pFilterHtml[] = "HTML (StarCalc)";
-static const sal_Char __FAR_DATA pFilterHtmlWeb[] = "calc_HTML_WebQuery";
-static const sal_Char __FAR_DATA pFilterRtf[] = "Rich Text Format (StarCalc)";
+static const sal_Char pFilterSc50[] = "StarCalc 5.0";
+static const sal_Char pFilterSc50Temp[] = "StarCalc 5.0 Vorlage/Template";
+static const sal_Char pFilterSc40[] = "StarCalc 4.0";
+static const sal_Char pFilterSc40Temp[] = "StarCalc 4.0 Vorlage/Template";
+static const sal_Char pFilterSc30[] = "StarCalc 3.0";
+static const sal_Char pFilterSc30Temp[] = "StarCalc 3.0 Vorlage/Template";
+static const sal_Char pFilterSc10[] = "StarCalc 1.0";
+static const sal_Char pFilterXML[] = "StarOffice XML (Calc)";
+static const sal_Char pFilterAscii[] = "Text - txt - csv (StarCalc)";
+static const sal_Char pFilterLotus[] = "Lotus";
+static const sal_Char pFilterQPro6[] = "Quattro Pro 6.0";
+static const sal_Char pFilterExcel4[] = "MS Excel 4.0";
+static const sal_Char pFilterEx4Temp[] = "MS Excel 4.0 Vorlage/Template";
+static const sal_Char pFilterExcel5[] = "MS Excel 5.0/95";
+static const sal_Char pFilterEx5Temp[] = "MS Excel 5.0/95 Vorlage/Template";
+static const sal_Char pFilterExcel95[] = "MS Excel 95";
+static const sal_Char pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template";
+static const sal_Char pFilterExcel97[] = "MS Excel 97";
+static const sal_Char pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template";
+static const sal_Char pFilter2003XML[] = "MS Excel 2003 XML";
+static const sal_Char pFilterDBase[] = "dBase";
+static const sal_Char pFilterDif[] = "DIF";
+static const sal_Char pFilterSylk[] = "SYLK";
+static const sal_Char pFilterHtml[] = "HTML (StarCalc)";
+static const sal_Char pFilterHtmlWeb[] = "calc_HTML_WebQuery";
+static const sal_Char pFilterRtf[] = "Rich Text Format (StarCalc)";
static sal_Bool lcl_MayBeAscii( SvStream& rStream )
@@ -169,13 +169,13 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
rStream.Seek(STREAM_SEEK_TO_BEGIN);
rStream >> nMark;
bool bValidMark = false;
- for (size_t i=0; i < sizeof(nValidMarks)/sizeof(nValidMarks[0]) && !bValidMark; ++i)
+ for (size_t i=0; i < SAL_N_ELEMENTS(nValidMarks) && !bValidMark; ++i)
{
if (nValidMarks[i] == nMark)
bValidMark = true;
}
if ( !bValidMark )
- return sal_False;
+ return false;
const size_t nHeaderBlockSize = 32;
// Empty dbf is >= 32*2+1 bytes in size.
@@ -184,7 +184,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
rStream.Seek(STREAM_SEEK_TO_END);
sal_uLong nSize = rStream.Tell();
if ( nSize < nEmptyDbf )
- return sal_False;
+ return false;
// length of header starts at 8
rStream.Seek(8);
@@ -192,7 +192,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
rStream >> nHeaderLen;
if ( nHeaderLen < nEmptyDbf || nSize < nHeaderLen )
- return sal_False;
+ return false;
// Last byte of header must be 0x0d, this is how it's specified.
// #i9581#,#i26407# but some applications don't follow the specification
@@ -210,22 +210,6 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
return ( 0x0d == nEndFlag );
}
-#if 0
-static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
-{
- if ( !pFilter )
- return sal_False;
-
- // sal_True for XML file or template
- // (template filter has no internal name -> allow configuration key names)
-
- String aName(pFilter->GetFilterName());
- return aName.EqualsAscii(pFilterXML) ||
- aName.EqualsAscii("calc_StarOffice_XML_Calc") ||
- aName.EqualsAscii("calc_StarOffice_XML_Calc_Template");
-}
-#endif
-
::rtl::OUString SAL_CALL ScFilterDetect::detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lDescriptor ) throw( ::com::sun::star::uno::RuntimeException )
{
REFERENCE< XInputStream > xStream;
@@ -241,11 +225,11 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
// opening as template is done when a parameter tells to do so and a template filter can be detected
// (otherwise no valid filter would be found) or if the detected filter is a template filter and
// there is no parameter that forbids to open as template
- sal_Bool bOpenAsTemplate = sal_False;
- sal_Bool bWasReadOnly = sal_False, bReadOnly = sal_False;
+ sal_Bool bOpenAsTemplate = false;
+ sal_Bool bWasReadOnly = false, bReadOnly = false;
- sal_Bool bRepairPackage = sal_False;
- sal_Bool bRepairAllowed = sal_False;
+ sal_Bool bRepairPackage = false;
+ sal_Bool bRepairAllowed = false;
// now some parameters that can already be in the array, but may be overwritten or new inserted here
// remember their indices in the case new values must be added to the array
@@ -305,12 +289,12 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
}
// can't check the type for external filters, so set the "dont" flag accordingly
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
//SfxFilterFlags nMust = SFX_FILTER_IMPORT, nDont = SFX_FILTER_NOTINSTALLED;
SfxAllItemSet *pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
TransformParameters( SID_OPENDOC, lDescriptor, *pSet );
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY, false );
bWasReadOnly = pItem && pItem->GetValue();
@@ -333,7 +317,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
pFilter = aMatcher.GetFilter4EA( aTypeName );
// ctor of SfxMedium uses owner transition of ItemSet
- SfxMedium aMedium( aURL, bWasReadOnly ? STREAM_STD_READ : STREAM_STD_READWRITE, sal_False, NULL, pSet );
+ SfxMedium aMedium( aURL, bWasReadOnly ? STREAM_STD_READ : STREAM_STD_READWRITE, false, NULL, pSet );
aMedium.UseInteractionHandler( sal_True );
sal_Bool bIsStorage = aMedium.IsStorage();
@@ -348,7 +332,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
// maybe that IsStorage() already created an error!
if ( bIsStorage )
{
- uno::Reference < embed::XStorage > xStorage(aMedium.GetStorage( sal_False ));
+ uno::Reference < embed::XStorage > xStorage(aMedium.GetStorage( false ));
if ( aMedium.GetLastStorageCreationState() != ERRCODE_NONE )
{
// error during storage creation means _here_ that the medium
@@ -380,7 +364,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
String aFilterName;
if ( pFilter )
aFilterName = pFilter->GetName();
- aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pFilter ? pFilter->IsOwnTemplateFormat() : sal_False, &aFilterName );
+ aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pFilter ? pFilter->IsOwnTemplateFormat() : false, &aFilterName );
}
catch( lang::WrappedTargetException& aWrap )
{
@@ -436,20 +420,21 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
bool bIsXLS = false;
SvStream* pStream = aMedium.GetInStream();
const SfxFilter* pPreselectedFilter = pFilter;
- if ( pPreselectedFilter && pPreselectedFilter->GetName().SearchAscii("Excel") != STRING_NOTFOUND )
+ if ( pPreselectedFilter && ( ( pPreselectedFilter->GetName().SearchAscii("Excel") != STRING_NOTFOUND ) ||
+ ( !aPreselectedFilterName.Len() && pPreselectedFilter->GetFilterName().EqualsAscii( pFilterAscii ) ) ) )
bIsXLS = true;
pFilter = 0;
if ( pStream )
{
- SotStorageRef aStorage = new SotStorage ( pStream, sal_False );
+ SotStorageRef aStorage = new SotStorage ( pStream, false );
if ( !aStorage->GetError() )
{
// Excel-5: detect through contained streams
// there are some "excel" formats from 3rd party vendors that need to be distinguished
- String aStreamName(RTL_CONSTASCII_STRINGPARAM("Workbook"));
+ String aStreamName(RTL_CONSTASCII_USTRINGPARAM("Workbook"));
sal_Bool bExcel97Stream = ( aStorage->IsStream( aStreamName ) );
- aStreamName = String(RTL_CONSTASCII_STRINGPARAM("Book"));
+ aStreamName = String(RTL_CONSTASCII_USTRINGPARAM("Book"));
sal_Bool bExcel5Stream = ( aStorage->IsStream( aStreamName ) );
if ( bExcel97Stream || bExcel5Stream )
{
@@ -502,7 +487,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
}
else if ( aOldName.EqualsAscii(pFilterEx97Temp) )
{
- // #101923# auto detection has found template -> return Excel5 template
+ // auto detection has found template -> return Excel5 template
pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterEx5Temp) );
}
else
@@ -631,7 +616,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
pLotus2,
pQPro
};
- const sal_uInt16 nFilterCount = sizeof(ppFilterPatterns) / sizeof(ppFilterPatterns[0]);
+ const UINT16 nFilterCount = SAL_N_ELEMENTS(ppFilterPatterns);
static const sal_Char* const pFilterName[] = // zugehoerige Filter
{
@@ -648,8 +633,6 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
pFilterQPro6
};
- // const sal_uInt16 nByteMask = 0xFF;
-
// suchen Sie jetzt!
// ... realisiert ueber 'Mustererkennung'
@@ -671,7 +654,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
if( nMuster < 0x0100 )
{ // direkter Byte-Vergleich
if( ( sal_uInt8 ) nMuster != nAkt )
- bSync = sal_False;
+ bSync = false;
}
else if( nMuster & M_DC )
{ // don't care
@@ -679,7 +662,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
else if( nMuster & M_ALT(0) )
{ // alternative Bytes
sal_uInt8 nAnzAlt = ( sal_uInt8 ) nMuster;
- bSync = sal_False; // zunaechst unsynchron
+ bSync = false; // zunaechst unsynchron
while( nAnzAlt > 0 )
{
pSearch++;
@@ -700,12 +683,12 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
{ // gefundenen Filter einstellen
pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterName[ nFilter ]) );
}
- bSync = sal_False; // leave inner loop
+ bSync = false; // leave inner loop
nFilter = nFilterCount; // leave outer loop
}
else
{ // Tabellenfehler
- DBG_ERROR( "-ScApplication::DetectFilter(): Fehler in Mustertabelle");
+ OSL_FAIL( "-ScApplication::DetectFilter(): Fehler in Mustertabelle");
}
pSearch++;
@@ -719,52 +702,51 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
// without the preselection other filters (Writer) take precedence
// DBase can't be detected reliably, so it also needs preselection
bool bMaybeText = lcl_MayBeAscii( rStr );
- if ( pPreselectedFilter->GetFilterName().EqualsAscii(pFilterAscii) && bMaybeText )
+
+ // get file header
+ rStr.Seek( 0 );
+ const int nTrySize = 80;
+ ByteString aHeader;
+ for ( int j = 0; j < nTrySize && !rStr.IsEof(); j++ )
{
- // Text filter is accepted if preselected
- pFilter = pPreselectedFilter;
+ sal_Char c;
+ rStr >> c;
+ aHeader += c;
}
- else
+ aHeader += '\0';
+
+ if ( HTMLParser::IsHTMLFormat( aHeader.GetBuffer() ) )
{
- // get file header
- rStr.Seek( 0 );
- const int nTrySize = 80;
- ByteString aHeader;
- for ( int j = 0; j < nTrySize && !rStr.IsEof(); j++ )
+ // test for HTML
+ if ( pPreselectedFilter->GetName().EqualsAscii(pFilterHtml) )
{
- sal_Char c;
- rStr >> c;
- aHeader += c;
+ pFilter = pPreselectedFilter;
}
- aHeader += '\0';
-
- if ( HTMLParser::IsHTMLFormat( aHeader.GetBuffer() ) )
+ else
{
- // test for HTML
- if ( pPreselectedFilter->GetName().EqualsAscii(pFilterHtml) )
- {
- pFilter = pPreselectedFilter;
- }
- else
- {
- pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterHtmlWeb) );
- if ( bIsXLS )
- bFakeXLS = true;
- }
+ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterHtmlWeb) );
+ if ( bIsXLS )
+ bFakeXLS = true;
}
- else if ( bIsXLS && bMaybeText )
- {
+ }
+ else if ( aHeader.CompareTo( "{\\rtf", 5 ) == COMPARE_EQUAL )
+ {
+ // test for RTF
+ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterRtf) );
+ }
+ else if ( bIsXLS && bMaybeText )
+ {
+ aHeader.EraseLeadingChars();
+ if( aHeader.CompareTo( "<?xml", 5 ) == COMPARE_EQUAL )
+ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilter2003XML) );
+ else
pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterAscii) );
- bFakeXLS = true;
- }
- else if ( aHeader.CompareTo( "{\\rtf", 5 ) == COMPARE_EQUAL )
- {
- // test for RTF
- pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterRtf) );
- }
- else if ( pPreselectedFilter->GetName().EqualsAscii(pFilterDBase) && lcl_MayBeDBase( rStr ) )
- pFilter = pPreselectedFilter;
+ bFakeXLS = true;
}
+ else if ( pPreselectedFilter->GetName().EqualsAscii(pFilterDBase) && lcl_MayBeDBase( rStr ) )
+ pFilter = pPreselectedFilter;
+ else if ( pPreselectedFilter->GetFilterName().EqualsAscii(pFilterAscii) && bMaybeText )
+ pFilter = pPreselectedFilter;
}
}
}
@@ -776,7 +758,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
{
// if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("InputStream");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream"));
lDescriptor[nPropertyCount].Value <<= xStream;
nPropertyCount++;
}
@@ -785,7 +767,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
{
// if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("UCBContent");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UCBContent"));
lDescriptor[nPropertyCount].Value <<= xContent;
nPropertyCount++;
}
@@ -795,7 +777,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
if ( nIndexOfReadOnlyFlag == -1 )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("ReadOnly");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
lDescriptor[nPropertyCount].Value <<= bReadOnly;
nPropertyCount++;
}
@@ -806,7 +788,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
if ( !bRepairPackage && bRepairAllowed )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("RepairPackage");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage"));
lDescriptor[nPropertyCount].Value <<= bRepairAllowed;
nPropertyCount++;
@@ -820,7 +802,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
if ( nIndexOfTemplateFlag == -1 )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("AsTemplate");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate"));
lDescriptor[nPropertyCount].Value <<= bOpenAsTemplate;
nPropertyCount++;
}
@@ -834,7 +816,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
if ( nIndexOfDocumentTitle == -1 )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("DocumentTitle");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle"));
lDescriptor[nPropertyCount].Value <<= aDocumentTitle;
nPropertyCount++;
}
@@ -847,7 +829,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
if ( nIndexOfFilterName == -1 )
{
lDescriptor.realloc( nPropertyCount + 1 );
- lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("FilterName");
+ lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
lDescriptor[nPropertyCount].Value <<= rtl::OUString(pFilter->GetName());
nPropertyCount++;
}
@@ -882,7 +864,7 @@ sal_Bool SAL_CALL ScFilterDetect::supportsService( const UNOOUSTRING& sServiceNa
return sal_True ;
}
}
- return sal_False ;
+ return false ;
}
/* XServiceInfo */
@@ -896,14 +878,14 @@ UNOSEQUENCE< UNOOUSTRING > ScFilterDetect::impl_getStaticSupportedServiceNames()
{
UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() );
UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 1 );
- seqServiceNames.getArray() [0] = UNOOUSTRING::createFromAscii( "com.sun.star.frame.ExtendedTypeDetection" );
+ seqServiceNames.getArray() [0] = UNOOUSTRING(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ExtendedTypeDetection" ));
return seqServiceNames ;
}
/* Helper for XServiceInfo */
UNOOUSTRING ScFilterDetect::impl_getStaticImplementationName()
{
- return UNOOUSTRING::createFromAscii( "com.sun.star.comp.calc.FormatDetector" );
+ return UNOOUSTRING(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.calc.FormatDetector" ));
}
/* Helper for registry */
@@ -912,3 +894,4 @@ UNOREFERENCE< UNOXINTERFACE > SAL_CALL ScFilterDetect::impl_createInstance( cons
return UNOREFERENCE< UNOXINTERFACE >( *new ScFilterDetect( xServiceManager ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/scdetect.hxx b/sc/source/ui/unoobj/scdetect.hxx
index a652d11df951..204a139aae12 100644
--- a/sc/source/ui/unoobj/scdetect.hxx
+++ b/sc/source/ui/unoobj/scdetect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index 92a9c3ef43ee..d906b5210ccf 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,14 @@
#include "precompiled_sc.hxx"
#include <tools/debug.hxx>
+#include <sal/macros.h>
#include <svtools/unoimap.hxx>
#include <svx/unofill.hxx>
#include <editeng/unonrule.hxx>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include "servuno.hxx"
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "cellsuno.hxx"
#include "fielduno.hxx"
@@ -53,7 +55,7 @@
#include "chart2uno.hxx"
#include "tokenuno.hxx"
-// #100263# Support creation of GraphicObjectResolver and EmbeddedObjectResolver
+// Support creation of GraphicObjectResolver and EmbeddedObjectResolver
#include <svx/xmleohlp.hxx>
#include <svx/xmlgrhlp.hxx>
#include <sfx2/docfile.hxx>
@@ -70,8 +72,27 @@
#include <basic/basmgr.hxx>
#include <sfx2/app.hxx>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/document/XCodeNameQuery.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/form/XFormsSupplier.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <comphelper/componentcontext.hxx>
+#include <cppuhelper/component_context.hxx>
+#include <vbahelper/vbaaccesshelper.hxx>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
+
using namespace ::com::sun::star;
+bool isInVBAMode( ScDocShell& rDocSh )
+{
+ uno::Reference<script::XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer();
+ uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY );
+ if ( xVBACompat.is() )
+ return xVBACompat->getVBACompatibilityMode();
+ return false;
+}
+
class ScVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper1< container::XNameAccess >
{
uno::Any maWorkbook;
@@ -93,7 +114,7 @@ public:
virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
maCachedObject = uno::Any(); // clear cached object
String sName = aName;
@@ -135,7 +156,7 @@ public:
}
::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
OSL_TRACE("ScVbaObjectForCodeNameProvider::getByName( %s )",
rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr() );
if ( !hasByName( aName ) )
@@ -144,7 +165,7 @@ public:
}
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScDocument* pDoc = mpDocShell->GetDocument();
if ( !pDoc )
throw uno::RuntimeException();
@@ -174,7 +195,7 @@ public:
// XCodeNameQuery
rtl::OUString SAL_CALL getCodeNameForObject( const uno::Reference< uno::XInterface >& xIf ) throw( uno::RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString sCodeName;
if ( mpDocShell )
{
@@ -225,7 +246,7 @@ struct ProvNamesId_Type
sal_uInt16 nType;
};
-static const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
+static const ProvNamesId_Type aProvNamesId[] =
{
{ "com.sun.star.sheet.Spreadsheet", SC_SERVICE_SHEET },
{ "com.sun.star.text.TextField.URL", SC_SERVICE_URLFIELD },
@@ -255,7 +276,7 @@ static const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
{ "com.sun.star.image.ImageMapCircleObject", SC_SERVICE_IMAP_CIRC },
{ "com.sun.star.image.ImageMapPolygonObject", SC_SERVICE_IMAP_POLY },
- // #100263# Support creation of GraphicObjectResolver and EmbeddedObjectResolver
+ // Support creation of GraphicObjectResolver and EmbeddedObjectResolver
{ "com.sun.star.document.ExportGraphicObjectResolver", SC_SERVICE_EXPORT_GOR },
{ "com.sun.star.document.ImportGraphicObjectResolver", SC_SERVICE_IMPORT_GOR },
{ "com.sun.star.document.ExportEmbeddedObjectResolver", SC_SERVICE_EXPORT_EOR },
@@ -284,7 +305,8 @@ static const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
{ "com.sun.star.text.textfield.Time", SC_SERVICE_TIMEFIELD },
{ "com.sun.star.text.textfield.DocumentTitle", SC_SERVICE_TITLEFIELD },
{ "com.sun.star.text.textfield.FileName", SC_SERVICE_FILEFIELD },
- { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD }
+ { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD },
+ { "ooo.vba.VBAGlobals", SC_SERVICE_VBAGLOBALS },
};
//
@@ -292,7 +314,7 @@ static const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
// in case some macro is still using them
//
-static const sal_Char* __FAR_DATA aOldNames[SC_SERVICE_COUNT] =
+static const sal_Char* aOldNames[SC_SERVICE_COUNT] =
{
"", // SC_SERVICE_SHEET
"stardiv.one.text.TextField.URL", // SC_SERVICE_URLFIELD
@@ -322,7 +344,7 @@ static const sal_Char* __FAR_DATA aOldNames[SC_SERVICE_COUNT] =
"", // SC_SERVICE_IMAP_CIRC
"", // SC_SERVICE_IMAP_POLY
- // #100263# Support creation of GraphicObjectResolver and EmbeddedObjectResolver
+ // Support creation of GraphicObjectResolver and EmbeddedObjectResolver
"", // SC_SERVICE_EXPORT_GOR
"", // SC_SERVICE_IMPORT_GOR
"", // SC_SERVICE_EXPORT_EOR
@@ -349,20 +371,13 @@ static const sal_Char* __FAR_DATA aOldNames[SC_SERVICE_COUNT] =
// alles static
-//UNUSED2008-05 String ScServiceProvider::GetProviderName(sal_uInt16 nObjectType)
-//UNUSED2008-05 {
-//UNUSED2008-05 String sRet;
-//UNUSED2008-05 if (nObjectType < SC_SERVICE_COUNT)
-//UNUSED2008-05 sRet = String::CreateFromAscii( aProvNames[nObjectType] );
-//UNUSED2008-05 return sRet;
-//UNUSED2008-05 }
sal_uInt16 ScServiceProvider::GetProviderType(const String& rServiceName)
{
if (rServiceName.Len())
{
- const sal_uInt16 nEntries =
- sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
+ const sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
+
for (sal_uInt16 i = 0; i < nEntries; i++)
{
if (rServiceName.EqualsAscii( aProvNamesId[i].pName ))
@@ -377,7 +392,7 @@ sal_uInt16 ScServiceProvider::GetProviderType(const String& rServiceName)
DBG_ASSERT( aOldNames[i], "ScServiceProvider::GetProviderType: no oldname => crash");
if (rServiceName.EqualsAscii( aOldNames[i] ))
{
- DBG_ERROR("old service name used");
+ OSL_FAIL("old service name used");
return i;
}
}
@@ -481,7 +496,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
xRet.set(SvUnoImageMapPolygonObject_createInstance( ScShapeObj::GetSupportedMacroItems() ));
break;
- // #100263# Support creation of GraphicObjectResolver and EmbeddedObjectResolver
+ // Support creation of GraphicObjectResolver and EmbeddedObjectResolver
case SC_SERVICE_EXPORT_GOR:
xRet.set((::cppu::OWeakObject * )new SvXMLGraphicHelper( GRAPHICHELPER_MODE_WRITE ));
break;
@@ -553,7 +568,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
}
break;
case SC_SERVICE_VBACODENAMEPROVIDER:
- if (pDocShell && pDocShell->GetDocument()->IsInVBAMode())
+ if ( pDocShell && ooo::vba::isAlienExcelDoc( *pDocShell ) && isInVBAMode( *pDocShell ) )
{
OSL_TRACE("**** creating VBA Object provider");
xRet.set(static_cast<document::XCodeNameQuery*>(new ScVbaCodeNameProvider( pDocShell )));
@@ -587,7 +602,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
uno::Sequence<rtl::OUString> ScServiceProvider::GetAllServiceNames()
{
- const sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
+ const sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
uno::Sequence<rtl::OUString> aRet(nEntries);
rtl::OUString* pArray = aRet.getArray();
for (sal_uInt16 i = 0; i < nEntries; i++)
@@ -600,3 +615,4 @@ uno::Sequence<rtl::OUString> ScServiceProvider::GetAllServiceNames()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index fd31c233dc19..ab64c329e5c7 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <svtools/unoevent.hxx>
#include <svtools/unoimap.hxx>
#include <svx/svdobj.hxx>
+#include <vcl/svapp.hxx>
#include <svx/unoshape.hxx>
#include <editeng/unofield.hxx>
#include <svx/shapepropertynotifier.hxx>
@@ -52,7 +54,6 @@
#include "drwlayer.hxx"
#include "userdat.hxx"
#include "unonames.hxx"
-#include "unoguard.hxx"
using namespace ::com::sun::star;
@@ -70,12 +71,16 @@ const SfxItemPropertyMapEntry* lcl_GetShapeMap()
{MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP), 0, &getCppuType((uno::Reference<container::XIndexContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_MOVEPROTECT), 0, &getCppuType((sal_Bool*)0), 0, 0 },
+ // #i66550 HLINK_FOR_SHAPES
+ {MAP_CHAR_LEN(SC_UNONAME_HYPERLINK), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_URL), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+
{0,0,0,0,0,0}
};
return aShapeMap_Impl;
}
-// static
const SvEventDescription* ScShapeObj::GetSupportedMacroItems()
{
static const SvEventDescription aMacroDescriptionsImpl[] =
@@ -84,6 +89,14 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems()
};
return aMacroDescriptionsImpl;
}
+// #i66550 HLINK_FOR_SHAPES
+ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, sal_Bool bCreate = false )
+{
+ if( pShape )
+ if( SdrObject* pObj = pShape->GetSdrObject() )
+ return ScDrawLayer::GetMacroInfo( pObj, bCreate );
+ return 0;
+}
//------------------------------------------------------------------------
@@ -102,7 +115,7 @@ ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& xShape ) :
pShapePropertySet(NULL),
pShapePropertyState(NULL),
pImplementationId(NULL),
- bIsTextShape(sal_False),
+ bIsTextShape(false),
bInitializedNotifier(false)
{
comphelper::increment( m_refCount );
@@ -232,7 +245,7 @@ uno::Reference<text::XTextRange> lcl_GetTextRange( const uno::Reference<uno::XAg
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScShapeObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// #i61527# cache property set info for this object
if ( !mxPropSetInfo.is() )
@@ -259,14 +272,14 @@ sal_Bool lcl_GetPageNum( SdrPage* pPage, SdrModel& rModel, SCTAB& rNum )
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool lcl_GetCaptionPoint( uno::Reference< drawing::XShape >& xShape, awt::Point& rCaptionPoint )
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
rtl::OUString sType(xShape->getShapeType());
- sal_Bool bCaptionShape(sType.equalsAscii("com.sun.star.drawing.CaptionShape"));
+ sal_Bool bCaptionShape(sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CaptionShape")));
if (bCaptionShape)
{
uno::Reference < beans::XPropertySet > xShapeProp (xShape, uno::UNO_QUERY);
@@ -344,7 +357,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
if ( aNameString.EqualsAscii( SC_UNONAME_ANCHOR ) )
@@ -373,20 +386,9 @@ void SAL_CALL ScShapeObj::setPropertyValue(
table::CellRangeAddress aAddress = xRangeAdd->getRangeAddress();
if (nTab == aAddress.Sheet)
{
- if (aAddress.StartRow != aAddress.EndRow) //should be a Spreadsheet
- {
- DBG_ASSERT(aAddress.StartRow == 0 && aAddress.EndRow == MAXROW &&
- aAddress.StartColumn == 0 && aAddress.EndColumn == MAXCOL, "here should be a XSpreadsheet");
- ScDrawLayer::SetAnchor(pObj, SCA_PAGE);
- }
- else
- {
- DBG_ASSERT(aAddress.StartRow == aAddress.EndRow &&
- aAddress.StartColumn == aAddress.EndColumn, "here should be a XCell");
- ScDrawLayer::SetAnchor(pObj, SCA_CELL);
- }
Rectangle aRect(pDoc->GetMMRect( static_cast<SCCOL>(aAddress.StartColumn), static_cast<SCROW>(aAddress.StartRow),
static_cast<SCCOL>(aAddress.EndColumn), static_cast<SCROW>(aAddress.EndRow), aAddress.Sheet ));
+ awt::Point aRelPoint;
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
{
@@ -405,7 +407,8 @@ void SAL_CALL ScShapeObj::setPropertyValue(
awt::Size aUnoSize;
awt::Point aCaptionPoint;
ScRange aRange;
- awt::Point aUnoPoint(lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint ));
+ aRelPoint = lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint );
+ awt::Point aUnoPoint(aRelPoint);
aUnoPoint.X += aPoint.X();
aUnoPoint.Y += aPoint.Y();
@@ -434,6 +437,24 @@ void SAL_CALL ScShapeObj::setPropertyValue(
xShape->setPosition(aUnoPoint);
pDocSh->SetModified();
}
+
+ if (aAddress.StartRow != aAddress.EndRow) //should be a Spreadsheet
+ {
+ DBG_ASSERT(aAddress.StartRow == 0 && aAddress.EndRow == MAXROW &&
+ aAddress.StartColumn == 0 && aAddress.EndColumn == MAXCOL, "here should be a XSpreadsheet");
+ ScDrawLayer::SetPageAnchored(*pObj);
+ }
+ else
+ {
+ DBG_ASSERT(aAddress.StartRow == aAddress.EndRow &&
+ aAddress.StartColumn == aAddress.EndColumn, "here should be a XCell");
+ ScDrawObjData aAnchor;
+ aAnchor.maStart = ScAddress(aAddress.StartColumn, aAddress.StartRow, aAddress.Sheet);
+ aAnchor.maStartOffset = Point(aRelPoint.X, aRelPoint.Y);
+ ScDrawLayer::SetCellAnchored(*pObj, aAnchor);
+ //Currently we've only got a start anchor, not an end-anchor, so generate that now
+ ScDrawLayer::UpdateCellAnchorFromPositionEnd(*pObj, *pDoc, aAddress.Sheet);
+ }
}
}
}
@@ -493,7 +514,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
{
- if (ScDrawLayer::GetAnchor(pObj) == SCA_PAGE)
+ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_PAGE)
{
awt::Point aPoint(xShape->getPosition());
awt::Size aSize(xShape->getSize());
@@ -520,7 +541,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(
xShape->setPosition(aPoint);
pDocSh->SetModified();
}
- else if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+ else if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
{
awt::Size aUnoSize;
awt::Point aCaptionPoint;
@@ -556,7 +577,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(
}
else
{
- DBG_ERROR("unknown anchor type");
+ OSL_FAIL("unknown anchor type");
}
}
}
@@ -591,7 +612,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
{
- if (ScDrawLayer::GetAnchor(pObj) == SCA_PAGE)
+ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_PAGE)
{
awt::Point aPoint = xShape->getPosition();
awt::Point aCaptionPoint;
@@ -604,7 +625,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(
xShape->setPosition(aPoint);
pDocSh->SetModified();
}
- else if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+ else if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
{
awt::Size aUnoSize;
awt::Point aCaptionPoint;
@@ -625,7 +646,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(
}
else
{
- DBG_ERROR("unknown anchor type");
+ OSL_FAIL("unknown anchor type");
}
}
}
@@ -635,6 +656,23 @@ void SAL_CALL ScShapeObj::setPropertyValue(
}
}
}
+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ||
+ aNameString.EqualsAscii( SC_UNONAME_URL) )
+ {
+ rtl::OUString sHlink;
+ ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, true);
+ if ( ( aValue >>= sHlink ) && pInfo )
+ pInfo->SetHlink( sHlink );
+ }
+ else if ( aNameString.EqualsAscii( SC_UNONAME_MOVEPROTECT ) )
+ {
+ if( SdrObject* pObj = this->GetSdrObject() )
+ {
+ sal_Bool aProt = false;
+ if( aValue >>= aProt )
+ pObj->SetMoveProtect( aProt );
+ }
+ }
else
{
GetShapePropertySet();
@@ -647,7 +685,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString = aPropertyName;
uno::Any aAny;
@@ -671,23 +709,10 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
{
ScDocShell* pDocSh = (ScDocShell*)pObjSh;
uno::Reference< uno::XInterface > xAnchor;
- if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
- {
- uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
- if (xShape.is())
- {
- awt::Size aUnoSize;
- awt::Point aCaptionPoint;
- ScRange aRange;
- awt::Point aUnoPoint(lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint ));
-
- xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, aRange.aStart )));
- }
- }
+ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab))
+ xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, pAnchor->maStart)));
else
- {
xAnchor.set(static_cast<cppu::OWeakObject*>(new ScTableSheetObj( pDocSh, nTab )));
- }
aAny <<= xAnchor;
}
}
@@ -730,7 +755,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
{
- if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
{
awt::Size aUnoSize;
awt::Point aCaptionPoint;
@@ -790,7 +815,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
if (xShape.is())
{
uno::Reference< uno::XInterface > xAnchor;
- if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
{
awt::Size aUnoSize;
awt::Point aCaptionPoint;
@@ -816,6 +841,21 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
}
}
}
+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ||
+ aNameString.EqualsAscii( SC_UNONAME_URL ) )
+ {
+ rtl::OUString sHlink;
+ if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) )
+ sHlink = pInfo->GetHlink();
+ aAny <<= sHlink;
+ }
+ else if ( aNameString.EqualsAscii( SC_UNONAME_MOVEPROTECT ) )
+ {
+ sal_Bool aProt = false;
+ if ( SdrObject* pObj = this->GetSdrObject() )
+ aProt = pObj->IsMoveProtect();
+ aAny <<= aProt;
+ }
else
{
GetShapePropertySet();
@@ -831,7 +871,7 @@ void SAL_CALL ScShapeObj::addPropertyChangeListener( const rtl::OUString& aPrope
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetShapePropertySet();
if (pShapePropertySet)
@@ -855,7 +895,7 @@ void SAL_CALL ScShapeObj::removePropertyChangeListener( const rtl::OUString& aPr
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetShapePropertySet();
if (pShapePropertySet)
@@ -867,7 +907,7 @@ void SAL_CALL ScShapeObj::addVetoableChangeListener( const rtl::OUString& aPrope
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetShapePropertySet();
if (pShapePropertySet)
@@ -879,7 +919,7 @@ void SAL_CALL ScShapeObj::removeVetoableChangeListener( const rtl::OUString& aPr
throw(beans::UnknownPropertyException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
GetShapePropertySet();
if (pShapePropertySet)
@@ -891,7 +931,7 @@ void SAL_CALL ScShapeObj::removeVetoableChangeListener( const rtl::OUString& aPr
beans::PropertyState SAL_CALL ScShapeObj::getPropertyState( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
@@ -925,7 +965,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScShapeObj::getPropertyStates(
const uno::Sequence<rtl::OUString>& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// simple loop to get own and aggregated states
@@ -940,7 +980,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScShapeObj::getPropertyStates(
void SAL_CALL ScShapeObj::setPropertyToDefault( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString(aPropertyName);
if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) )
@@ -972,7 +1012,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyDefault( const rtl::OUString& aProperty
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameString = aPropertyName;
uno::Any aAny;
@@ -997,14 +1037,14 @@ uno::Any SAL_CALL ScShapeObj::getPropertyDefault( const rtl::OUString& aProperty
void SAL_CALL ScShapeObj::attach( const uno::Reference<text::XTextRange>& /* xTextRange */ )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
throw lang::IllegalArgumentException(); // anchor cannot be changed
}
uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getAnchor() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextRange> xRet;
@@ -1045,7 +1085,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getAnchor() throw(uno::Run
void SAL_CALL ScShapeObj::dispose() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<lang::XComponent> xAggComp(lcl_GetComponent(mxShapeAgg));
if ( xAggComp.is() )
@@ -1056,7 +1096,7 @@ void SAL_CALL ScShapeObj::addEventListener(
const uno::Reference<lang::XEventListener>& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<lang::XComponent> xAggComp(lcl_GetComponent(mxShapeAgg));
if ( xAggComp.is() )
@@ -1067,7 +1107,7 @@ void SAL_CALL ScShapeObj::removeEventListener(
const uno::Reference<lang::XEventListener>& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<lang::XComponent> xAggComp(lcl_GetComponent(mxShapeAgg));
if ( xAggComp.is() )
@@ -1086,7 +1126,7 @@ void lcl_CopyOneProperty( beans::XPropertySet& rDest, beans::XPropertySet& rSour
}
catch (uno::Exception&)
{
- DBG_ERROR("Exception in text field");
+ OSL_FAIL("Exception in text field");
}
}
@@ -1095,14 +1135,14 @@ void SAL_CALL ScShapeObj::insertTextContent( const uno::Reference<text::XTextRan
sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextContent> xEffContent;
ScCellFieldObj* pCellField = ScCellFieldObj::getImplementation( xContent );
if ( pCellField )
{
- // #105585# createInstance("TextField.URL") from the document creates a ScCellFieldObj.
+ // createInstance("TextField.URL") from the document creates a ScCellFieldObj.
// To insert it into drawing text, a SvxUnoTextField is needed instead.
// The ScCellFieldObj object is left in non-inserted state.
@@ -1123,7 +1163,7 @@ void SAL_CALL ScShapeObj::insertTextContent( const uno::Reference<text::XTextRan
void SAL_CALL ScShapeObj::removeTextContent( const uno::Reference<text::XTextContent>& xContent )
throw(container::NoSuchElementException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// ScCellFieldObj can't be used here.
@@ -1138,7 +1178,7 @@ void SAL_CALL ScShapeObj::removeTextContent( const uno::Reference<text::XTextCon
uno::Reference<text::XTextCursor> SAL_CALL ScShapeObj::createTextCursor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( mxShapeAgg.is() )
{
@@ -1156,7 +1196,7 @@ uno::Reference<text::XTextCursor> SAL_CALL ScShapeObj::createTextCursorByRange(
const uno::Reference<text::XTextRange>& aTextPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( mxShapeAgg.is() && aTextPosition.is() )
{
@@ -1180,7 +1220,7 @@ void SAL_CALL ScShapeObj::insertString( const uno::Reference<text::XTextRange>&
const rtl::OUString& aString, sal_Bool bAbsorb )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XSimpleText> xAggSimpleText(lcl_GetSimpleText(mxShapeAgg));
if ( xAggSimpleText.is() )
@@ -1193,7 +1233,7 @@ void SAL_CALL ScShapeObj::insertControlCharacter( const uno::Reference<text::XTe
sal_Int16 nControlCharacter, sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XSimpleText> xAggSimpleText(lcl_GetSimpleText(mxShapeAgg));
if ( xAggSimpleText.is() )
@@ -1207,13 +1247,13 @@ void SAL_CALL ScShapeObj::insertControlCharacter( const uno::Reference<text::XTe
uno::Reference<text::XText> SAL_CALL ScShapeObj::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return this;
}
uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextRange> xAggTextRange(lcl_GetTextRange(mxShapeAgg));
if ( xAggTextRange.is() )
@@ -1226,7 +1266,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getStart() throw(uno::Runt
uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextRange> xAggTextRange(lcl_GetTextRange(mxShapeAgg));
if ( xAggTextRange.is() )
@@ -1239,7 +1279,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getEnd() throw(uno::Runtim
rtl::OUString SAL_CALL ScShapeObj::getString() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextRange> xAggTextRange(lcl_GetTextRange(mxShapeAgg));
if ( xAggTextRange.is() )
@@ -1252,7 +1292,7 @@ rtl::OUString SAL_CALL ScShapeObj::getString() throw(uno::RuntimeException)
void SAL_CALL ScShapeObj::setString( const rtl::OUString& aText ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<text::XTextRange> xAggTextRange(lcl_GetTextRange(mxShapeAgg));
if ( xAggTextRange.is() )
@@ -1286,7 +1326,7 @@ uno::Sequence<uno::Type> SAL_CALL ScShapeObj::getTypes() throw(uno::RuntimeExcep
uno::Sequence<sal_Int8> SAL_CALL ScShapeObj::getImplementationId()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// do we need to compute the implementation id for this instance?
if( !pImplementationId && mxShapeAgg.is())
{
@@ -1317,7 +1357,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScShapeObj::getImplementationId()
}
if( NULL == pImplementationId )
{
- DBG_ERROR( "Could not create an implementation id for a ScXShape!" );
+ OSL_FAIL( "Could not create an implementation id for a ScXShape!" );
return uno::Sequence< sal_Int8 > ();
}
else
@@ -1339,11 +1379,6 @@ SdrObject* ScShapeObj::GetSdrObject() const throw()
}
#define SC_EVENTACC_ONCLICK ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) )
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
-#define SC_EVENTACC_ONACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) )
-#define SC_EVENTACC_URL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) )
-#define SC_EVENTACC_ACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) )
-#endif
#define SC_EVENTACC_SCRIPT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) )
#define SC_EVENTACC_EVENTTYPE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) )
@@ -1353,12 +1388,9 @@ class ShapeUnoEventAccessImpl : public ShapeUnoEventAcess_BASE
private:
ScShapeObj* mpShape;
- ScMacroInfo* getInfo( sal_Bool bCreate = sal_False )
+ ScMacroInfo* getInfo( sal_Bool bCreate = false )
{
- if( mpShape )
- if( SdrObject* pObj = mpShape->GetSdrObject() )
- return ScDrawLayer::GetMacroInfo( pObj, bCreate );
- return 0;
+ return lcl_getShapeHyperMacroInfo( mpShape, bCreate );
}
public:
@@ -1384,11 +1416,7 @@ public:
isEventType = true;
continue;
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- if ( isEventType && ((pProperties->Name == SC_EVENTACC_SCRIPT) || (pProperties->Name == SC_EVENTACC_URL)) )
-#else
if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) )
-#endif
{
rtl::OUString sValue;
if ( pProperties->Value >>= sValue )
@@ -1399,10 +1427,8 @@ public:
break;
if ( pProperties->Name == SC_EVENTACC_SCRIPT )
pInfo->SetMacro( sValue );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else
pInfo->SetHlink( sValue );
-#endif
}
}
}
@@ -1425,19 +1451,6 @@ public:
aProperties[ 1 ].Value <<= pInfo->GetMacro();
}
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- else if( aName == SC_EVENTACC_ONACTION )
- {
- if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
- {
- aProperties.realloc( 2 );
- aProperties[ 0 ].Name = SC_EVENTACC_EVENTTYPE;
- aProperties[ 0 ].Value <<= SC_EVENTACC_ACTION;
- aProperties[ 1 ].Name = SC_EVENTACC_URL;
- aProperties[ 1 ].Value <<= pInfo->GetHlink();
- }
- }
-#endif
else
{
throw container::NoSuchElementException();
@@ -1448,25 +1461,14 @@ public:
virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException)
{
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- uno::Sequence< rtl::OUString > aSeq( 2 );
-#else
uno::Sequence< rtl::OUString > aSeq( 1 );
-#endif
aSeq[ 0 ] = SC_EVENTACC_ONCLICK;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- aSeq[ 1 ] = SC_EVENTACC_ONACTION;
-#endif
return aSeq;
}
virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- return (aName == SC_EVENTACC_ONCLICK) || (aName == SC_EVENTACC_ONACTION);
-#else
return aName == SC_EVENTACC_ONCLICK;
-#endif
}
// XElementAccess
@@ -1502,7 +1504,7 @@ ScShapeObj::getEvents( ) throw(uno::RuntimeException)
)
if ( _ServiceName == *pSupported )
return sal_True;
- return sal_False;
+ return false;
}
uno::Sequence< ::rtl::OUString > SAL_CALL ScShapeObj::getSupportedServiceNames( ) throw (uno::RuntimeException)
@@ -1519,3 +1521,5 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScShapeObj::getSupportedServiceNames(
aSupported[ aSupported.getLength() - 1 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.Shape" ) );
return aSupported;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx
index 2827b8c9e1dc..6b8a6b71030d 100644
--- a/sc/source/ui/unoobj/srchuno.cxx
+++ b/sc/source/ui/unoobj/srchuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "scitems.hxx"
#include <svl/srchitem.hxx>
+#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <rtl/uuid.h>
@@ -40,7 +42,6 @@
#include "undoblk.hxx"
#include "hints.hxx"
#include "markdata.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "unonames.hxx"
@@ -85,21 +86,21 @@ ScCellSearchObj::ScCellSearchObj() :
{
pSearchItem = new SvxSearchItem( SCITEM_SEARCHDATA );
// Defaults:
- pSearchItem->SetWordOnly(sal_False);
- pSearchItem->SetExact(sal_False);
- pSearchItem->SetMatchFullHalfWidthForms(sal_False);
- pSearchItem->SetUseAsianOptions(sal_False); // or all asian bits would have to be handled
- pSearchItem->SetBackward(sal_False);
- pSearchItem->SetSelection(sal_False);
- pSearchItem->SetRegExp(sal_False);
- pSearchItem->SetPattern(sal_False);
- pSearchItem->SetLevenshtein(sal_False);
- pSearchItem->SetLEVRelaxed(sal_False);
+ pSearchItem->SetWordOnly(false);
+ pSearchItem->SetExact(false);
+ pSearchItem->SetMatchFullHalfWidthForms(false);
+ pSearchItem->SetUseAsianOptions(false); // or all asian bits would have to be handled
+ pSearchItem->SetBackward(false);
+ pSearchItem->SetSelection(false);
+ pSearchItem->SetRegExp(false);
+ pSearchItem->SetPattern(false);
+ pSearchItem->SetLevenshtein(false);
+ pSearchItem->SetLEVRelaxed(false);
pSearchItem->SetLEVOther(2);
pSearchItem->SetLEVShorter(2);
pSearchItem->SetLEVLonger(2);
// Calc-Flags
- pSearchItem->SetRowDirection(sal_False);
+ pSearchItem->SetRowDirection(false);
pSearchItem->SetCellType(SVX_SEARCHIN_FORMULA);
// Selection-Flag wird beim Aufruf gesetzt
@@ -114,14 +115,14 @@ ScCellSearchObj::~ScCellSearchObj()
rtl::OUString SAL_CALL ScCellSearchObj::getSearchString() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return pSearchItem->GetSearchString();
}
void SAL_CALL ScCellSearchObj::setSearchString( const rtl::OUString& aString )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
pSearchItem->SetSearchString( aString );
}
@@ -129,14 +130,14 @@ void SAL_CALL ScCellSearchObj::setSearchString( const rtl::OUString& aString )
rtl::OUString SAL_CALL ScCellSearchObj::getReplaceString() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return pSearchItem->GetReplaceString();
}
void SAL_CALL ScCellSearchObj::setReplaceString( const rtl::OUString& aReplaceString )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
pSearchItem->SetReplaceString( aReplaceString );
}
@@ -145,7 +146,7 @@ void SAL_CALL ScCellSearchObj::setReplaceString( const rtl::OUString& aReplaceSt
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellSearchObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -157,7 +158,7 @@ void SAL_CALL ScCellSearchObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
if (aString.EqualsAscii( SC_UNO_SRCHBACK )) pSearchItem->SetBackward( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
@@ -172,13 +173,14 @@ void SAL_CALL ScCellSearchObj::setPropertyValue(
else if (aString.EqualsAscii( SC_UNO_SRCHSIMEX )) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
else if (aString.EqualsAscii( SC_UNO_SRCHSIMREM )) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
else if (aString.EqualsAscii( SC_UNO_SRCHTYPE )) pSearchItem->SetCellType( ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
+ else if (aString.EqualsAscii( SC_UNO_SRCHFILTERED )) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) );
}
uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
uno::Any aRet;
@@ -194,6 +196,7 @@ uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const rtl::OUString& aPrope
else if (aString.EqualsAscii( SC_UNO_SRCHSIMEX )) aRet <<= (sal_Int16) pSearchItem->GetLEVOther();
else if (aString.EqualsAscii( SC_UNO_SRCHSIMREM )) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter();
else if (aString.EqualsAscii( SC_UNO_SRCHTYPE )) aRet <<= (sal_Int16) pSearchItem->GetCellType();
+ else if (aString.EqualsAscii( SC_UNO_SRCHFILTERED )) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() );
return aRet;
}
@@ -204,7 +207,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScCellSearchObj )
rtl::OUString SAL_CALL ScCellSearchObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScCellSearchObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScCellSearchObj" ));
}
sal_Bool SAL_CALL ScCellSearchObj::supportsService( const rtl::OUString& rServiceName )
@@ -220,8 +223,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellSearchObj::getSupportedServiceNames(
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCSEARCHDESCRIPTOR_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCREPLACEDESCRIPTOR_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSEARCHDESCRIPTOR_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCREPLACEDESCRIPTOR_SERVICE ));
return aRet;
}
@@ -239,7 +242,6 @@ sal_Int64 SAL_CALL ScCellSearchObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScCellSearchObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -256,7 +258,6 @@ const uno::Sequence<sal_Int8>& ScCellSearchObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScCellSearchObj* ScCellSearchObj::getImplementation(
const uno::Reference<util::XSearchDescriptor> xObj )
{
@@ -274,3 +275,4 @@ ScCellSearchObj* ScCellSearchObj::getImplementation(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index f929e6b16985..0a15aa2578ff 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,6 +44,7 @@
#include <sfx2/bindings.hxx>
#include <sfx2/printer.hxx>
#include <vcl/virdev.hxx>
+#include <vcl/svapp.hxx>
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
#include <svl/intitem.hxx>
@@ -50,7 +52,7 @@
#include <rtl/uuid.h>
#include <com/sun/star/table/BorderLine.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/CellHoriJustify.hpp>
@@ -69,7 +71,6 @@
#include "attrib.hxx"
#include "stlpool.hxx"
#include "docpool.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "convuno.hxx"
#include "tablink.hxx"
@@ -136,6 +137,7 @@ const SfxItemPropertySet* lcl_GetCellStyleSet()
{MAP_CHAR_LEN(SC_UNONAME_DIAGONAL_TLBR), ATTR_BORDER_TLBR, &::getCppuType((const table::BorderLine*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_DISPNAME), SC_WID_UNO_DISPNAME,&::getCppuType((rtl::OUString*)0), beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY, &::getCppuType((const table::CellHoriJustify*)0), 0, MID_HORJUST_HORJUST },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND, &::getBooleanCppuType(), 0, MID_GRAPHIC_TRANSPARENT },
{MAP_CHAR_LEN(SC_UNONAME_WRAP), ATTR_LINEBREAK, &::getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_LEFTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, LEFT_BORDER | CONVERT_TWIPS },
@@ -155,13 +157,14 @@ const SfxItemPropertySet* lcl_GetCellStyleSet()
{MAP_CHAR_LEN(SC_UNONAME_PTMARGIN), ATTR_MARGIN, &::getCppuType((const sal_Int32*)0), 0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_RIGHTBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, RIGHT_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_ROTANG), ATTR_ROTATE_VALUE, &::getCppuType((const sal_Int32*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &::getCppuType((const table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_ROTREF), ATTR_ROTATE_MODE, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_SHADOW), ATTR_SHADOW, &::getCppuType((const table::ShadowFormat*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_TBLBORD), SC_WID_UNO_TBLBORD, &::getCppuType((const table::TableBorder*)0), 0, 0 | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
- {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &::getCppuType((const table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &::getCppuType((const sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0,0,0}
};
@@ -422,7 +425,7 @@ const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType )
{
if ( nType == SFX_STYLE_FAMILY_PARA )
{
- static sal_Bool bCellMapFilled = sal_False;
+ static sal_Bool bCellMapFilled = false;
static ScDisplayNameMap aCellMap[6];
if ( !bCellMapFilled )
{
@@ -449,7 +452,7 @@ const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType )
}
else if ( nType == SFX_STYLE_FAMILY_PAGE )
{
- static sal_Bool bPageMapFilled = sal_False;
+ static sal_Bool bPageMapFilled = false;
static ScDisplayNameMap aPageMap[3];
if ( !bPageMapFilled )
{
@@ -465,7 +468,7 @@ const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType )
}
return aPageMap;
}
- DBG_ERROR("invalid family");
+ OSL_FAIL("invalid family");
return NULL;
}
@@ -489,10 +492,9 @@ sal_Bool lcl_EndsWithUser( const String& rString )
pChar[nLen-1] == ')';
}
-// static
-String ScStyleNameConversion::DisplayToProgrammaticName( const String& rDispName, sal_uInt16 nType )
+String ScStyleNameConversion::DisplayToProgrammaticName( const String& rDispName, UINT16 nType )
{
- sal_Bool bDisplayIsProgrammatic = sal_False;
+ sal_Bool bDisplayIsProgrammatic = false;
const ScDisplayNameMap* pNames = lcl_GetStyleNameMap( nType );
if (pNames)
@@ -520,8 +522,7 @@ String ScStyleNameConversion::DisplayToProgrammaticName( const String& rDispName
return rDispName;
}
-// static
-String ScStyleNameConversion::ProgrammaticToDisplayName( const String& rProgName, sal_uInt16 nType )
+String ScStyleNameConversion::ProgrammaticToDisplayName( const String& rProgName, UINT16 nType )
{
if ( lcl_EndsWithUser( rProgName ) )
{
@@ -550,7 +551,7 @@ sal_Bool lcl_AnyTabProtected( ScDocument& rDoc )
for (SCTAB i=0; i<nTabCount; i++)
if (rDoc.IsTabProtected(i))
return sal_True;
- return sal_False;
+ return false;
}
//------------------------------------------------------------------------
@@ -589,7 +590,7 @@ ScStyleFamilyObj*ScStyleFamiliesObj::GetObjectByType_Impl(sal_uInt16 nType) cons
else if ( nType == SFX_STYLE_FAMILY_PAGE )
return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE );
}
- DBG_ERROR("getStyleFamilyByType: keine DocShell oder falscher Typ");
+ OSL_FAIL("getStyleFamilyByType: keine DocShell oder falscher Typ");
return NULL;
}
@@ -626,7 +627,7 @@ uno::Any SAL_CALL ScStyleFamiliesObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< container::XNameContainer > xFamily(GetObjectByIndex_Impl(nIndex));
if (xFamily.is())
return uno::makeAny(xFamily);
@@ -637,13 +638,13 @@ uno::Any SAL_CALL ScStyleFamiliesObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScStyleFamiliesObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ::getCppuType((const uno::Reference< container::XNameContainer >*)0); // muss zu getByIndex passen
}
sal_Bool SAL_CALL ScStyleFamiliesObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -653,7 +654,7 @@ uno::Any SAL_CALL ScStyleFamiliesObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< container::XNameContainer > xFamily(GetObjectByName_Impl(aName));
if (xFamily.is())
return uno::makeAny(xFamily);
@@ -665,18 +666,18 @@ uno::Any SAL_CALL ScStyleFamiliesObj::getByName( const rtl::OUString& aName )
uno::Sequence<rtl::OUString> SAL_CALL ScStyleFamiliesObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence<rtl::OUString> aNames(SC_STYLE_FAMILY_COUNT);
rtl::OUString* pNames = aNames.getArray();
- pNames[0] = rtl::OUString::createFromAscii( SC_FAMILYNAME_CELL );
- pNames[1] = rtl::OUString::createFromAscii( SC_FAMILYNAME_PAGE );
+ pNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_FAMILYNAME_CELL ));
+ pNames[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_FAMILYNAME_PAGE ));
return aNames;
}
sal_Bool SAL_CALL ScStyleFamiliesObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aNameStr( aName );
return ( aNameStr.EqualsAscii( SC_FAMILYNAME_CELL ) || aNameStr.EqualsAscii( SC_FAMILYNAME_PAGE ) );
}
@@ -731,14 +732,14 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScStyleFamiliesObj::getStyleLoaderO
uno::Sequence<beans::PropertyValue> aSequence(3);
beans::PropertyValue* pArray = aSequence.getArray();
- pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_OVERWSTL );
- ScUnoHelpFunctions::SetBoolInAny( pArray[0].Value, sal_True );
+ pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_OVERWSTL ));
+ ScUnoHelpFunctions::SetBoolInAny( pArray[0].Value, true );
- pArray[1].Name = rtl::OUString::createFromAscii( SC_UNONAME_LOADCELL );
- ScUnoHelpFunctions::SetBoolInAny( pArray[1].Value, sal_True );
+ pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_LOADCELL ));
+ ScUnoHelpFunctions::SetBoolInAny( pArray[1].Value, true );
- pArray[2].Name = rtl::OUString::createFromAscii( SC_UNONAME_LOADPAGE );
- ScUnoHelpFunctions::SetBoolInAny( pArray[2].Value, sal_True );
+ pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_LOADPAGE ));
+ ScUnoHelpFunctions::SetBoolInAny( pArray[2].Value, true );
return aSequence;
}
@@ -809,8 +810,8 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::ElementExistException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bDone = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bDone = false;
// Reflection muss nicht uno::XInterface sein, kann auch irgendein Interface sein...
uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
if ( xInterface.is() )
@@ -855,7 +856,7 @@ void SAL_CALL ScStyleFamilyObj::replaceByName( const rtl::OUString& aName, const
throw(lang::IllegalArgumentException, container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! zusammenfassen?
removeByName( aName );
insertByName( aName, aElement );
@@ -865,8 +866,8 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
- sal_Bool bFound = sal_False;
+ SolarMutexGuard aGuard;
+ sal_Bool bFound = false;
if ( pDocShell )
{
String aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
@@ -889,7 +890,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const rtl::OUString& aName )
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, sal_False, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -920,7 +921,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const rtl::OUString& aName )
sal_Int32 SAL_CALL ScStyleFamilyObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -936,7 +937,7 @@ uno::Any SAL_CALL ScStyleFamilyObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< style::XStyle > xObj(GetObjectByIndex_Impl(nIndex));
if (xObj.is())
return uno::makeAny(xObj);
@@ -947,13 +948,13 @@ uno::Any SAL_CALL ScStyleFamilyObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScStyleFamilyObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ::getCppuType((const uno::Reference< style::XStyle >*)0); // muss zu getByIndex passen
}
sal_Bool SAL_CALL ScStyleFamilyObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -963,7 +964,7 @@ uno::Any SAL_CALL ScStyleFamilyObj::getByName( const rtl::OUString& aName )
throw(container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< style::XStyle > xObj(
GetObjectByName_Impl( ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ) ));
if (xObj.is())
@@ -976,7 +977,7 @@ uno::Any SAL_CALL ScStyleFamilyObj::getByName( const rtl::OUString& aName )
uno::Sequence<rtl::OUString> SAL_CALL ScStyleFamilyObj::getElementNames()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
ScDocument* pDoc = pDocShell->GetDocument();
@@ -1006,7 +1007,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScStyleFamilyObj::getElementNames()
sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( pDocShell )
{
String aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
@@ -1016,7 +1017,7 @@ sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const rtl::OUString& aName )
if ( pStylePool->Find( aString, eFamily ) )
return sal_True;
}
- return sal_False;
+ return false;
}
// XPropertySet
@@ -1038,7 +1039,7 @@ uno::Any SAL_CALL ScStyleFamilyObj::getPropertyValue( const ::rtl::OUString& sPr
if ( sPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DisplayName") ) )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt32 nResId = 0;
switch ( eFamily )
{
@@ -1087,13 +1088,6 @@ void SAL_CALL ScStyleFamilyObj::removeVetoableChangeListener( const ::rtl::OUStr
// Default-ctor wird fuer die Reflection gebraucht
-//UNUSED2008-05 ScStyleObj::ScStyleObj() :
-//UNUSED2008-05 aPropSet( lcl_GetCellStyleMap() ),
-//UNUSED2008-05 pDocShell( NULL ),
-//UNUSED2008-05 eFamily( SFX_STYLE_FAMILY_PARA )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const String& rName) :
pPropSet( (eFam == SFX_STYLE_FAMILY_PARA) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() ),
pDocShell( pDocSh ),
@@ -1136,7 +1130,6 @@ sal_Int64 SAL_CALL ScStyleObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScStyleObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -1153,7 +1146,6 @@ const uno::Sequence<sal_Int8>& ScStyleObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScStyleObj* ScStyleObj::getImplementation(
const uno::Reference<uno::XInterface> xObj )
{
@@ -1190,25 +1182,25 @@ SfxStyleSheetBase* ScStyleObj::GetStyle_Impl()
sal_Bool SAL_CALL ScStyleObj::isUserDefined() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if (pStyle)
return pStyle->IsUserDefined();
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScStyleObj::isInUse() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if (pStyle)
return pStyle->IsUsed();
- return sal_False;
+ return false;
}
rtl::OUString SAL_CALL ScStyleObj::getParentStyle() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if (pStyle)
return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetParent(), sal::static_int_cast<sal_uInt16>(eFamily) );
@@ -1218,11 +1210,11 @@ rtl::OUString SAL_CALL ScStyleObj::getParentStyle() throw(uno::RuntimeException)
void SAL_CALL ScStyleObj::setParentStyle( const rtl::OUString& rParentStyle )
throw(container::NoSuchElementException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if (pStyle)
{
- // #70909# cell styles cannot be modified if any sheet is protected
+ // cell styles cannot be modified if any sheet is protected
if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
return; //! exception?
@@ -1245,7 +1237,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const rtl::OUString& rParentStyle )
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, sal_False, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1264,7 +1256,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const rtl::OUString& rParentStyle )
rtl::OUString SAL_CALL ScStyleObj::getName() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if (pStyle)
return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetName(), sal::static_int_cast<sal_uInt16>(eFamily) );
@@ -1274,11 +1266,11 @@ rtl::OUString SAL_CALL ScStyleObj::getName() throw(uno::RuntimeException)
void SAL_CALL ScStyleObj::setName( const rtl::OUString& aNewName )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if (pStyle)
{
- // #71225# cell styles cannot be renamed if any sheet is protected
+ // cell styles cannot be renamed if any sheet is protected
if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
return; //! exception?
@@ -1308,7 +1300,6 @@ void SAL_CALL ScStyleObj::setName( const rtl::OUString& aNewName )
}
}
-// static
uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules()
{
SvxNumRule aRule( 0, 0, sal_True ); // nothing supported
@@ -1356,7 +1347,7 @@ const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const ::rtl::OUString& rProp
beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
const SfxItemPropertySimpleEntry* pResultEntry = NULL;
@@ -1371,7 +1362,7 @@ beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const rtl::OUString&
}
if ( IsScItemWid( nWhich ) )
{
- SfxItemState eState = pItemSet->GetItemState( nWhich, sal_False );
+ SfxItemState eState = pItemSet->GetItemState( nWhich, false );
// // if no rotate value is set, look at orientation
// //! also for a fixed value of 0 (in case orientation is ambiguous)?
@@ -1386,7 +1377,7 @@ beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const rtl::OUString&
eRet = beans::PropertyState_AMBIGUOUS_VALUE; // kann eigentlich nicht sein...
else
{
- DBG_ERROR("unbekannter ItemState");
+ OSL_FAIL("unbekannter ItemState");
}
}
}
@@ -1400,7 +1391,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScStyleObj::getPropertyStates(
// duemmliche Default-Implementierung: alles einzeln per getPropertyState holen
//! sollte optimiert werden!
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const rtl::OUString* pNames = aPropertyNames.getConstArray();
uno::Sequence<beans::PropertyState> aRet(aPropertyNames.getLength());
beans::PropertyState* pStates = aRet.getArray();
@@ -1412,7 +1403,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScStyleObj::getPropertyStates(
void SAL_CALL ScStyleObj::setPropertyToDefault( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const SfxItemPropertyMap* pMap = pPropSet->getPropertyMap();
const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( aPropertyName );
@@ -1426,7 +1417,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const rtl::OUString& aProperty
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aAny;
const SfxItemPropertySimpleEntry* pResultEntry = NULL;
@@ -1441,10 +1432,10 @@ uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const rtl::OUString& aProperty
// Default ist Default vom ItemPool, nicht vom Standard-Style,
// damit es zu setPropertyToDefault passt
SfxItemSet aEmptySet( *pStyleSet->GetPool(), pStyleSet->GetRanges() );
- // #65253# Default-Items mit falscher Slot-ID funktionieren im SfxItemPropertySet3 nicht
+ // Default-Items mit falscher Slot-ID funktionieren im SfxItemPropertySet3 nicht
//! Slot-IDs aendern...
if ( aEmptySet.GetPool()->GetSlotId(nWhich) == nWhich &&
- aEmptySet.GetItemState(nWhich, sal_False) == SFX_ITEM_DEFAULT )
+ aEmptySet.GetItemState(nWhich, false) == SFX_ITEM_DEFAULT )
{
aEmptySet.Put( aEmptySet.Get( nWhich ) );
}
@@ -1500,9 +1491,9 @@ uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const rtl::OUString& aProperty
SvxBoxInfoItem aInner( ATTR_BORDER_INNER );
table::TableBorder aBorder;
ScHelperFunctions::FillTableBorder( aBorder, aOuter, aInner );
- aBorder.IsHorizontalLineValid = sal_False;
- aBorder.IsVerticalLineValid = sal_False;
- aBorder.IsDistanceValid = sal_False;
+ aBorder.IsHorizontalLineValid = false;
+ aBorder.IsVerticalLineValid = false;
+ aBorder.IsDistanceValid = false;
aAny <<= aBorder;
}
}
@@ -1520,7 +1511,7 @@ void SAL_CALL ScStyleObj::setPropertyValues( const uno::Sequence< rtl::OUString
throw (beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nCount = aPropertyNames.getLength();
if ( aValues.getLength() != nCount )
@@ -1544,7 +1535,7 @@ uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyValues(
const uno::Sequence< rtl::OUString >& aPropertyNames )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! optimize
@@ -1585,12 +1576,12 @@ void SAL_CALL ScStyleObj::firePropertiesChangeEvent( const uno::Sequence<rtl::OU
void SAL_CALL ScStyleObj::setAllPropertiesToDefault() throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if ( pStyle )
{
- // #70909# cell styles cannot be modified if any sheet is protected
+ // cell styles cannot be modified if any sheet is protected
if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
throw uno::RuntimeException();
@@ -1609,7 +1600,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() throw (uno::RuntimeExcepti
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, sal_False, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1619,7 +1610,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() throw (uno::RuntimeExcepti
// #i22448# apply the default BoxInfoItem for page styles again
// (same content as in ScStyleSheet::GetItemSet, to control the dialog)
SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
- aBoxInfoItem.SetTable( sal_False );
+ aBoxInfoItem.SetTable( false );
aBoxInfoItem.SetDist( sal_True );
aBoxInfoItem.SetValid( VALID_DISTANCE, sal_True );
rSet.Put( aBoxInfoItem );
@@ -1632,7 +1623,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() throw (uno::RuntimeExcepti
void SAL_CALL ScStyleObj::setPropertiesToDefault( const uno::Sequence<rtl::OUString>& aPropertyNames )
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Int32 nCount = aPropertyNames.getLength();
if ( nCount )
@@ -1653,7 +1644,7 @@ uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyDefaults(
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! optimize
@@ -1673,7 +1664,7 @@ uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyDefaults(
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScStyleObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return pPropSet->getPropertySetInfo();
}
@@ -1683,7 +1674,7 @@ void SAL_CALL ScStyleObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( aPropertyName );
if ( !pEntry )
@@ -1698,12 +1689,12 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
SfxStyleSheetBase* pStyle = GetStyle_Impl();
if ( pStyle && pEntry )
{
- // #70909# cell styles cannot be modified if any sheet is protected
+ // cell styles cannot be modified if any sheet is protected
if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
throw uno::RuntimeException();
SfxItemSet& rSet = pStyle->GetItemSet(); // direkt im lebenden Style aendern...
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if ( eFamily == SFX_STYLE_FAMILY_PAGE )
{
if(pEntry->nWID == SC_WID_UNO_HEADERSET)
@@ -1747,7 +1738,7 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
{
case ATTR_VALUE_FORMAT:
{
- // #67847# language for number formats
+ // language for number formats
SvNumberFormatter* pFormatter =
pDocShell->GetDocument()->GetFormatTable();
sal_uInt32 nOldFormat = ((const SfxUInt32Item&)
@@ -1798,14 +1789,14 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
switch( eOrient )
{
case table::CellOrientation_STANDARD:
- rSet.Put( SfxBoolItem( ATTR_STACKED, sal_False ) );
+ rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
break;
case table::CellOrientation_TOPBOTTOM:
- rSet.Put( SfxBoolItem( ATTR_STACKED, sal_False ) );
+ rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
rSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 27000 ) );
break;
case table::CellOrientation_BOTTOMTOP:
- rSet.Put( SfxBoolItem( ATTR_STACKED, sal_False ) );
+ rSet.Put( SfxBoolItem( ATTR_STACKED, false ) );
rSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 9000 ) );
break;
case table::CellOrientation_STACKED:
@@ -1841,7 +1832,7 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
case ATTR_PAGE_OBJECTS:
case ATTR_PAGE_DRAWINGS:
{
- sal_Bool bBool = sal_False;
+ sal_Bool bBool = false;
*pValue >>= bBool;
//! sal_Bool-MID fuer ScViewObjectModeItem definieren?
rSet.Put( ScViewObjectModeItem( pEntry->nWID,
@@ -1851,7 +1842,7 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
case ATTR_PAGE_PAPERBIN:
{
sal_uInt8 nTray = PAPERBIN_PRINTER_SETTINGS;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
rtl::OUString aName;
if ( *pValue >>= aName )
@@ -1898,11 +1889,11 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
}
break;
default:
- // #65253# Default-Items mit falscher Slot-ID
+ // Default-Items mit falscher Slot-ID
// funktionieren im SfxItemPropertySet3 nicht
//! Slot-IDs aendern...
if ( rSet.GetPool()->GetSlotId(pEntry->nWID) == pEntry->nWID &&
- rSet.GetItemState(pEntry->nWID, sal_False) == SFX_ITEM_DEFAULT )
+ rSet.GetItemState(pEntry->nWID, false) == SFX_ITEM_DEFAULT )
{
rSet.Put( rSet.Get(pEntry->nWID) );
}
@@ -1912,7 +1903,7 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
else
{
rSet.ClearItem( pEntry->nWID );
- // #67847# language for number formats
+ // language for number formats
if ( pEntry->nWID == ATTR_VALUE_FORMAT )
rSet.ClearItem( ATTR_LANGUAGE_FORMAT );
@@ -1960,7 +1951,7 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, sal_False, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1978,10 +1969,10 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const rtl::OUString& aPropertyNa
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aAny;
- if ( aPropertyName.equalsAscii( SC_UNONAME_DISPNAME ) ) // read-only
+ if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_DISPNAME ) ) ) // read-only
{
// core always has the display name
SfxStyleSheetBase* pStyle = GetStyle_Impl();
@@ -2043,7 +2034,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const rtl::OUString& aPropertyNa
sal_uInt8 nValue = ((const SvxPaperBinItem&)pItemSet->Get(nWhich)).GetValue();
rtl::OUString aName;
if ( nValue == PAPERBIN_PRINTER_SETTINGS )
- aName = rtl::OUString::createFromAscii( SC_PAPERBIN_DEFAULTNAME );
+ aName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_PAPERBIN_DEFAULTNAME ));
else
{
Printer* pPrinter = pDocShell->GetPrinter();
@@ -2063,11 +2054,11 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const rtl::OUString& aPropertyNa
}
break;
default:
- // #65253# Default-Items mit falscher Slot-ID
+ // Default-Items mit falscher Slot-ID
// funktionieren im SfxItemPropertySet3 nicht
//! Slot-IDs aendern...
if ( pItemSet->GetPool()->GetSlotId(nWhich) == nWhich &&
- pItemSet->GetItemState(nWhich, sal_False) == SFX_ITEM_DEFAULT )
+ pItemSet->GetItemState(nWhich, false) == SFX_ITEM_DEFAULT )
{
SfxItemSet aNoEmptySet( *pItemSet );
aNoEmptySet.Put( aNoEmptySet.Get( nWhich ) );
@@ -2090,9 +2081,9 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const rtl::OUString& aPropertyNa
SvxBoxInfoItem aInner( ATTR_BORDER_INNER );
table::TableBorder aBorder;
ScHelperFunctions::FillTableBorder( aBorder, aOuter, aInner );
- aBorder.IsHorizontalLineValid = sal_False;
- aBorder.IsVerticalLineValid = sal_False;
- aBorder.IsDistanceValid = sal_False;
+ aBorder.IsHorizontalLineValid = false;
+ aBorder.IsVerticalLineValid = false;
+ aBorder.IsDistanceValid = false;
aAny <<= aBorder;
}
}
@@ -2111,7 +2102,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScStyleObj )
rtl::OUString SAL_CALL ScStyleObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScStyleObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScStyleObj" ));
}
sal_Bool SAL_CALL ScStyleObj::supportsService( const rtl::OUString& rServiceName )
@@ -2129,12 +2120,13 @@ uno::Sequence<rtl::OUString> SAL_CALL ScStyleObj::getSupportedServiceNames()
sal_Bool bPage = ( eFamily == SFX_STYLE_FAMILY_PAGE );
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCSTYLE_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( bPage ? SCPAGESTYLE_SERVICE
- : SCCELLSTYLE_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCSTYLE_SERVICE ));
+ pArray[1] = bPage ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SCPAGESTYLE_SERVICE))
+ : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SCCELLSTYLE_SERVICE));
return aRet;
}
//------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index f089253f794d..972c64013498 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include <vcl/image.hxx>
#include <vcl/virdev.hxx>
-//#include <toolkit/unoiface.hxx>
#include <toolkit/unohlp.hxx>
#include <svl/itemprop.hxx>
#include <svl/smplhint.hxx>
@@ -47,7 +47,6 @@
#include "nameuno.hxx"
#include "docsh.hxx"
#include "content.hxx"
-#include "unoguard.hxx"
#include "scresid.hxx"
#include "sc.hrc"
#include "unonames.hxx"
@@ -120,7 +119,6 @@ uno::Any SAL_CALL ScLinkTargetTypesObj::getByName(const rtl::OUString& aName)
}
throw container::NoSuchElementException();
-// return uno::Any();
}
uno::Sequence<rtl::OUString> SAL_CALL ScLinkTargetTypesObj::getElementNames(void) throw( uno::RuntimeException )
@@ -138,7 +136,7 @@ sal_Bool SAL_CALL ScLinkTargetTypesObj::hasByName(const rtl::OUString& aName) th
for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++)
if ( aNames[i] == aNameStr )
return sal_True;
- return sal_False;
+ return false;
}
// container::XElementAccess
@@ -195,7 +193,7 @@ uno::Reference< container::XNameAccess > SAL_CALL ScLinkTargetTypeObj::getLinks
xCollection.set(new ScDatabaseRangesObj(pDocShell));
break;
default:
- DBG_ERROR("invalid type");
+ OSL_FAIL("invalid type");
}
}
@@ -210,7 +208,7 @@ uno::Reference< container::XNameAccess > SAL_CALL ScLinkTargetTypeObj::getLinks
uno::Reference< beans::XPropertySetInfo > SAL_CALL ScLinkTargetTypeObj::getPropertySetInfo(void) throw( uno::RuntimeException )
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( lcl_GetLinkTargetMap() ));
return aRef;
}
@@ -227,7 +225,6 @@ void SAL_CALL ScLinkTargetTypeObj::setPropertyValue(const rtl::OUString& /* aPro
//! exception?
}
-// static
void ScLinkTargetTypeObj::SetLinkTargetBitmap( uno::Any& rRet, sal_uInt16 nType )
{
sal_uInt16 nImgId = 0;
@@ -245,8 +242,7 @@ void ScLinkTargetTypeObj::SetLinkTargetBitmap( uno::Any& rRet, sal_uInt16 nType
}
if (nImgId)
{
- sal_Bool bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
- ImageList aEntryImages( ScResId( bHighContrast ? RID_IMAGELIST_H_NAVCONT : RID_IMAGELIST_NAVCONT ) );
+ ImageList aEntryImages( ScResId( RID_IMAGELIST_NAVCONT ) );
const Image& rImage = aEntryImages.GetImage( nImgId );
rRet <<= uno::Reference< awt::XBitmap > (VCLUnoHelper::CreateBitmap( rImage.GetBitmapEx() ));
}
@@ -316,3 +312,4 @@ sal_Bool SAL_CALL ScLinkTargetsObj::hasElements(void) throw( uno::RuntimeExcepti
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index ca1a7f978010..4e21b587294d 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,6 +43,7 @@
#include <editeng/unofored.hxx>
#include <rtl/uuid.h>
#include <vcl/virdev.hxx>
+#include <vcl/svapp.hxx>
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -52,7 +54,6 @@
#include "editsrc.hxx"
#include "docsh.hxx"
#include "editutil.hxx"
-#include "unoguard.hxx"
#include "miscuno.hxx"
#include "cellsuno.hxx"
#include "hints.hxx"
@@ -75,7 +76,7 @@ const SvxItemPropertySet * lcl_GetHdFtPropertySet()
SVX_UNOEDIT_NUMBERING_PROPERTIE, // for completeness of service ParagraphProperties
{0,0,0,0,0,0}
};
- static sal_Bool bTwipsSet = sal_False;
+ static sal_Bool bTwipsSet = false;
if (!bTwipsSet)
{
@@ -167,21 +168,21 @@ void ScHeaderFooterContentObj::UpdateText( sal_uInt16 nPart, EditEngine& rSource
uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getLeftText()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScHeaderFooterTextObj( *this, SC_HDFT_LEFT );
}
uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getCenterText()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScHeaderFooterTextObj( *this, SC_HDFT_CENTER );
}
uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getRightText()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScHeaderFooterTextObj( *this, SC_HDFT_RIGHT );
}
@@ -199,7 +200,6 @@ sal_Int64 SAL_CALL ScHeaderFooterContentObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScHeaderFooterContentObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -216,7 +216,6 @@ const uno::Sequence<sal_Int8>& ScHeaderFooterContentObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScHeaderFooterContentObj* ScHeaderFooterContentObj::getImplementation(
const uno::Reference<sheet::XHeaderFooterContent> xObj )
{
@@ -236,8 +235,8 @@ ScHeaderFooterTextData::ScHeaderFooterTextData( ScHeaderFooterContentObj& rConte
nPart( nP ),
pEditEngine( NULL ),
pForwarder( NULL ),
- bDataValid( sal_False ),
- bInUpdate( sal_False )
+ bDataValid( false ),
+ bInUpdate( false )
{
rContentObj.acquire(); // must not go away
rContentObj.AddListener( *this );
@@ -245,7 +244,7 @@ ScHeaderFooterTextData::ScHeaderFooterTextData( ScHeaderFooterContentObj& rConte
ScHeaderFooterTextData::~ScHeaderFooterTextData()
{
- ScUnoGuard aGuard; // needed for EditEngine dtor
+ SolarMutexGuard aGuard; // needed for EditEngine dtor
rContentObj.RemoveListener( *this );
@@ -262,7 +261,7 @@ void ScHeaderFooterTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( ((const ScHeaderFooterChangedHint&)rHint).GetPart() == nPart )
{
if (!bInUpdate) // not for own updates
- bDataValid = sal_False; // text has to be fetched again
+ bDataValid = false; // text has to be fetched again
}
}
}
@@ -275,7 +274,7 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder()
pEnginePool->FreezeIdRanges();
ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool, sal_True );
- pHdrEngine->EnableUndo( sal_False );
+ pHdrEngine->EnableUndo( false );
pHdrEngine->SetRefMapMode( MAP_TWIP );
// default font must be set, independently of document
@@ -325,7 +324,7 @@ void ScHeaderFooterTextData::UpdateData()
rContentObj.UpdateText( nPart, *pEditEngine );
- bInUpdate = sal_False;
+ bInUpdate = false;
}
}
@@ -369,7 +368,7 @@ const SvxUnoText& ScHeaderFooterTextObj::GetUnoText()
uno::Reference<text::XTextCursor> SAL_CALL ScHeaderFooterTextObj::createTextCursor()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScHeaderFooterTextCursor( *this );
}
@@ -377,14 +376,14 @@ uno::Reference<text::XTextCursor> SAL_CALL ScHeaderFooterTextObj::createTextCurs
const uno::Reference<text::XTextRange>& aTextPosition )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
return pUnoText->createTextCursorByRange(aTextPosition);
//! wie ScCellObj::createTextCursorByRange, wenn SvxUnoTextRange_getReflection verfuegbar
}
-void ScHeaderFooterTextObj::FillDummyFieldData( ScHeaderFieldData& rData ) // static
+void ScHeaderFooterTextObj::FillDummyFieldData( ScHeaderFieldData& rData )
{
String aDummy(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "???" )));
rData.aTitle = aDummy;
@@ -397,7 +396,7 @@ void ScHeaderFooterTextObj::FillDummyFieldData( ScHeaderFieldData& rData ) // s
rtl::OUString SAL_CALL ScHeaderFooterTextObj::getString() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
const EditTextObject* pData;
@@ -427,7 +426,7 @@ rtl::OUString SAL_CALL ScHeaderFooterTextObj::getString() throw(uno::RuntimeExce
void SAL_CALL ScHeaderFooterTextObj::setString( const rtl::OUString& aText ) throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aText);
// for pure text, no font info is needed in pool defaults
@@ -441,7 +440,7 @@ void SAL_CALL ScHeaderFooterTextObj::insertString( const uno::Reference<text::XT
const rtl::OUString& aString, sal_Bool bAbsorb )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
pUnoText->insertString( xRange, aString, bAbsorb );
@@ -452,7 +451,7 @@ void SAL_CALL ScHeaderFooterTextObj::insertControlCharacter(
sal_Int16 nControlCharacter, sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
pUnoText->insertControlCharacter( xRange, nControlCharacter, bAbsorb );
@@ -464,7 +463,7 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent(
sal_Bool bAbsorb )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( xContent.is() && xRange.is() )
{
ScHeaderFieldObj* pHeaderField = ScHeaderFieldObj::getImplementation( xContent );
@@ -472,13 +471,6 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent(
SvxUnoTextRangeBase* pTextRange =
ScHeaderFooterTextCursor::getImplementation( xRange );
-#if 0
- if (!pTextRange)
- pTextRange = (SvxUnoTextRange*)xRange->getImplementation(
- SvxUnoTextRange_getReflection() );
- //! bei SvxUnoTextRange testen, ob in passendem Objekt !!!
-#endif
-
if ( pHeaderField && !pHeaderField->IsInserted() && pTextRange )
{
SvxEditSource* pEditSource = pTextRange->GetEditSource();
@@ -504,7 +496,7 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent(
aSelection.nEndPos = aSelection.nStartPos + 1;
pHeaderField->InitDoc( &aTextData.GetContentObj(), aTextData.GetPart(), aSelection );
- // #91431# for bAbsorb=sal_False, the new selection must be behind the inserted content
+ // for bAbsorb=FALSE, the new selection must be behind the inserted content
// (the xml filter relies on this)
if (!bAbsorb)
aSelection.nStartPos = aSelection.nEndPos;
@@ -524,7 +516,7 @@ void SAL_CALL ScHeaderFooterTextObj::removeTextContent(
const uno::Reference<text::XTextContent>& xContent )
throw(container::NoSuchElementException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if ( xContent.is() )
{
ScHeaderFieldObj* pHeaderField = ScHeaderFieldObj::getImplementation( xContent );
@@ -542,7 +534,7 @@ void SAL_CALL ScHeaderFooterTextObj::removeTextContent(
uno::Reference<text::XText> SAL_CALL ScHeaderFooterTextObj::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
return pUnoText->getText();
@@ -550,7 +542,7 @@ uno::Reference<text::XText> SAL_CALL ScHeaderFooterTextObj::getText() throw(uno:
uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextObj::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
return pUnoText->getStart();
@@ -558,7 +550,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextObj::getStart() thro
uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextObj::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
return pUnoText->getEnd();
@@ -569,7 +561,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextObj::getEnd() throw(
uno::Reference<container::XEnumerationAccess> SAL_CALL ScHeaderFooterTextObj::getTextFields()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// all fields
return new ScHeaderFieldsObj( &aTextData.GetContentObj(), aTextData.GetPart(), SC_SERVICE_INVALID );
}
@@ -588,7 +580,7 @@ void SAL_CALL ScHeaderFooterTextObj::moveTextRange(
sal_Int16 nParagraphs )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
pUnoText->moveTextRange( xRange, nParagraphs );
@@ -599,7 +591,7 @@ void SAL_CALL ScHeaderFooterTextObj::moveTextRange(
uno::Reference<container::XEnumeration> SAL_CALL ScHeaderFooterTextObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
return pUnoText->createEnumeration();
@@ -609,7 +601,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScHeaderFooterTextObj::createEn
uno::Type SAL_CALL ScHeaderFooterTextObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
return pUnoText->getElementType();
@@ -617,7 +609,7 @@ uno::Type SAL_CALL ScHeaderFooterTextObj::getElementType() throw(uno::RuntimeExc
sal_Bool SAL_CALL ScHeaderFooterTextObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (!pUnoText)
CreateUnoText_Impl();
return pUnoText->hasElements();
@@ -648,13 +640,13 @@ ScCellTextCursor::~ScCellTextCursor() throw()
uno::Reference<text::XText> SAL_CALL ScCellTextCursor::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return &rTextObj;
}
uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! use other object for range than cursor?
@@ -671,7 +663,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getStart() throw(uno
uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! use other object for range than cursor?
@@ -700,7 +692,6 @@ sal_Int64 SAL_CALL ScCellTextCursor::getSomething(
return SvxUnoTextCursor::getSomething( rId );
}
-// static
const uno::Sequence<sal_Int8>& ScCellTextCursor::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -717,7 +708,6 @@ const uno::Sequence<sal_Int8>& ScCellTextCursor::getUnoTunnelId()
return *pSeq;
}
-// static
ScCellTextCursor* ScCellTextCursor::getImplementation( const uno::Reference<uno::XInterface> xObj )
{
ScCellTextCursor* pRet = NULL;
@@ -752,13 +742,13 @@ ScHeaderFooterTextCursor::~ScHeaderFooterTextCursor() throw()
uno::Reference<text::XText> SAL_CALL ScHeaderFooterTextCursor::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return &rTextObj;
}
uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! use other object for range than cursor?
@@ -775,7 +765,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getStart() t
uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! use other object for range than cursor?
@@ -804,7 +794,6 @@ sal_Int64 SAL_CALL ScHeaderFooterTextCursor::getSomething(
return SvxUnoTextCursor::getSomething( rId );
}
-// static
const uno::Sequence<sal_Int8>& ScHeaderFooterTextCursor::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -821,7 +810,6 @@ const uno::Sequence<sal_Int8>& ScHeaderFooterTextCursor::getUnoTunnelId()
return *pSeq;
}
-// static
ScHeaderFooterTextCursor* ScHeaderFooterTextCursor::getImplementation(
const uno::Reference<uno::XInterface> xObj )
{
@@ -856,13 +844,13 @@ ScDrawTextCursor::~ScDrawTextCursor() throw()
uno::Reference<text::XText> SAL_CALL ScDrawTextCursor::getText() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return xParentText;
}
uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getStart() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! use other object for range than cursor?
@@ -879,7 +867,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getStart() throw(uno
uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getEnd() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
//! use other object for range than cursor?
@@ -908,7 +896,6 @@ sal_Int64 SAL_CALL ScDrawTextCursor::getSomething(
return SvxUnoTextCursor::getSomething( rId );
}
-// static
const uno::Sequence<sal_Int8>& ScDrawTextCursor::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -925,7 +912,6 @@ const uno::Sequence<sal_Int8>& ScDrawTextCursor::getUnoTunnelId()
return *pSeq;
}
-// static
ScDrawTextCursor* ScDrawTextCursor::getImplementation( const uno::Reference<uno::XInterface> xObj )
{
ScDrawTextCursor* pRet = NULL;
@@ -950,7 +936,7 @@ ScSimpleEditSourceHelper::ScSimpleEditSourceHelper()
ScSimpleEditSourceHelper::~ScSimpleEditSourceHelper()
{
- ScUnoGuard aGuard; // needed for EditEngine dtor
+ SolarMutexGuard aGuard; // needed for EditEngine dtor
delete pOriginalSource;
delete pForwarder;
@@ -988,9 +974,9 @@ ScCellTextData::ScCellTextData(ScDocShell* pDocSh, const ScAddress& rP) :
pEditEngine( NULL ),
pForwarder( NULL ),
pOriginalSource( NULL ),
- bDataValid( sal_False ),
- bInUpdate( sal_False ),
- bDirty( sal_False ),
+ bDataValid( false ),
+ bInUpdate( false ),
+ bDirty( false ),
bDoUpdate( sal_True )
{
if (pDocShell)
@@ -999,7 +985,7 @@ ScCellTextData::ScCellTextData(ScDocShell* pDocSh, const ScAddress& rP) :
ScCellTextData::~ScCellTextData()
{
- ScUnoGuard aGuard; // needed for EditEngine dtor
+ SolarMutexGuard aGuard; // needed for EditEngine dtor
if (pDocShell)
{
@@ -1048,7 +1034,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
// currently, GetPortions doesn't work if UpdateMode is sal_False,
// this will be fixed (in EditEngine) by src600
// pEditEngine->SetUpdateMode( sal_False );
- pEditEngine->EnableUndo( sal_False );
+ pEditEngine->EnableUndo( false );
if (pDocShell)
pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
else
@@ -1104,10 +1090,10 @@ void ScCellTextData::UpdateData()
bInUpdate = sal_True; // prevents bDataValid from being reset
ScDocFunc aFunc(*pDocShell);
- aFunc.PutData( aCellPos, *pEditEngine, sal_False, sal_True ); // always as text
+ aFunc.PutData( aCellPos, *pEditEngine, false, sal_True ); // always as text
- bInUpdate = sal_False;
- bDirty = sal_False;
+ bInUpdate = false;
+ bDirty = false;
}
}
else
@@ -1135,7 +1121,7 @@ void ScCellTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
else if ( nId == SFX_HINT_DATACHANGED )
{
if (!bInUpdate) // not for own UpdateData calls
- bDataValid = sal_False; // text has to be read from the cell again
+ bDataValid = false; // text has to be read from the cell again
}
}
}
@@ -1150,3 +1136,4 @@ ScCellTextObj::~ScCellTextObj() throw()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 5e3b3102e14a..aa736ac5ad5b 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,8 @@
#include "tokenuno.hxx"
+#include <sal/macros.h>
+
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/ExternalReference.hpp>
#include <com/sun/star/sheet/ReferenceFlags.hpp>
@@ -37,11 +40,11 @@
#include <com/sun/star/table/CellAddress.hpp>
#include <svl/itemprop.hxx>
+#include <vcl/svapp.hxx>
#include "miscuno.hxx"
#include "convuno.hxx"
#include "unonames.hxx"
-#include "unoguard.hxx"
#include "token.hxx"
#include "compiler.hxx"
#include "tokenarray.hxx"
@@ -105,7 +108,7 @@ void ScFormulaParserObj::SetCompilerFlags( ScCompiler& rCompiler ) const
formula::FormulaGrammar::CONV_XL_OOX, // <- AddressConvention::XL_OOX
formula::FormulaGrammar::CONV_LOTUS_A1 // <- AddressConvention::LOTUS_A1
};
- static const sal_Int16 nConvMapCount = sizeof(aConvMap)/sizeof(aConvMap[0]);
+ static const sal_Int16 nConvMapCount = SAL_N_ELEMENTS(aConvMap);
// If mxOpCodeMap is not empty it overrides mbEnglish, and vice versa. We
// don't need to initialize things twice.
@@ -135,7 +138,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScFormulaParserObj::parseFormula(
const rtl::OUString& aFormula, const table::CellAddress& rReferencePos )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Sequence<sheet::FormulaToken> aRet;
if (mpDocShell)
@@ -161,7 +164,7 @@ rtl::OUString SAL_CALL ScFormulaParserObj::printFormula(
const uno::Sequence<sheet::FormulaToken>& aTokens, const table::CellAddress& rReferencePos )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
rtl::OUString aRet;
if (mpDocShell)
@@ -188,7 +191,7 @@ rtl::OUString SAL_CALL ScFormulaParserObj::printFormula(
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScFormulaParserObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( lcl_GetFormulaParserMap() ));
return aRef;
}
@@ -199,7 +202,7 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
if ( aString.EqualsAscii( SC_UNO_COMPILEFAP ) )
{
@@ -257,7 +260,7 @@ uno::Any SAL_CALL ScFormulaParserObj::getPropertyValue( const rtl::OUString& aPr
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Any aRet;
String aString(aPropertyName);
if ( aString.EqualsAscii( SC_UNO_COMPILEFAP ) )
@@ -333,14 +336,12 @@ void lcl_SingleRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rR
rAPI.Flags = nFlags;
}
-// static
bool ScTokenConversion::ConvertToTokenArray( ScDocument& rDoc,
ScTokenArray& rTokenArray, const uno::Sequence<sheet::FormulaToken>& rSequence )
{
return !rTokenArray.Fill(rSequence,rDoc.GetExternalRefManager());
}
-// static
bool ScTokenConversion::ConvertToTokenSequence( ScDocument& rDoc,
uno::Sequence<sheet::FormulaToken>& rSequence, const ScTokenArray& rTokenArray )
{
@@ -465,3 +466,4 @@ ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::Form
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/unodoc.cxx b/sc/source/ui/unoobj/unodoc.cxx
index d3d755e8b495..0350546cce2a 100644
--- a/sc/source/ui/unoobj/unodoc.cxx
+++ b/sc/source/ui/unoobj/unodoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "scmod.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "docsh.hxx"
@@ -58,10 +59,11 @@ uno::Sequence< rtl::OUString > SAL_CALL ScDocument_getSupportedServiceNames() th
uno::Reference< uno::XInterface > SAL_CALL ScDocument_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & /* rSMgr */, const sal_uInt64 _nCreationFlags ) throw( uno::Exception )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
ScDLL::Init();
SfxObjectShell* pShell = new ScDocShell( _nCreationFlags );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/unoreflist.cxx b/sc/source/ui/unoobj/unoreflist.cxx
index 65f43273f6e7..1a80e1e8b2c7 100644
--- a/sc/source/ui/unoobj/unoreflist.cxx
+++ b/sc/source/ui/unoobj/unoreflist.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,4 @@ ScUnoRefUndoHint::~ScUnoRefUndoHint()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 13dba8f1e423..adeb0e7a3a6d 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@
#include <sfx2/viewfrm.hxx>
#include <rtl/uuid.h>
#include <toolkit/helper/convert.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/svapp.hxx>
#include "drawsh.hxx"
#include "drtxtob.hxx"
@@ -66,7 +67,6 @@
#include "drawview.hxx"
#include "fupoor.hxx"
#include "sc.hrc"
-#include "unoguard.hxx"
#include "unonames.hxx"
#include "scmod.hxx"
#include "appoptio.hxx"
@@ -203,7 +203,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScViewPaneBase::getImplementationId()
sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleColumn() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pViewShell)
{
ScViewData* pViewData = pViewShell->GetViewData();
@@ -214,14 +214,14 @@ sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleColumn() throw(uno::RuntimeExc
return pViewData->GetPosX( eWhichH );
}
- DBG_ERROR("keine View ?!?"); //! Exception?
+ OSL_FAIL("keine View ?!?"); //! Exception?
return 0;
}
void SAL_CALL ScViewPaneBase::setFirstVisibleColumn( sal_Int32 nFirstVisibleColumn )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pViewShell)
{
ScViewData* pViewData = pViewShell->GetViewData();
@@ -237,7 +237,7 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleColumn( sal_Int32 nFirstVisibleColu
sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleRow() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pViewShell)
{
ScViewData* pViewData = pViewShell->GetViewData();
@@ -248,14 +248,14 @@ sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleRow() throw(uno::RuntimeExcept
return pViewData->GetPosY( eWhichV );
}
- DBG_ERROR("keine View ?!?"); //! Exception?
+ OSL_FAIL("keine View ?!?"); //! Exception?
return 0;
}
void SAL_CALL ScViewPaneBase::setFirstVisibleRow( sal_Int32 nFirstVisibleRow )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pViewShell)
{
ScViewData* pViewData = pViewShell->GetViewData();
@@ -271,7 +271,7 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleRow( sal_Int32 nFirstVisibleRow )
table::CellRangeAddress SAL_CALL ScViewPaneBase::getVisibleRange() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
table::CellRangeAddress aAdr;
if (pViewShell)
{
@@ -304,7 +304,7 @@ table::CellRangeAddress SAL_CALL ScViewPaneBase::getVisibleRange() throw(uno::Ru
uno::Reference<table::XCellRange> SAL_CALL ScViewPaneBase::getReferredCells()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (pViewShell)
{
ScDocShell* pDocSh = pViewShell->GetViewData()->GetDocShell();
@@ -342,7 +342,7 @@ namespace
// XFormLayerAccess
uno::Reference< form::runtime::XFormController > SAL_CALL ScViewPaneBase::getFormController( const uno::Reference< form::XForm >& _Form ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference< form::runtime::XFormController > xController;
@@ -357,7 +357,7 @@ uno::Reference< form::runtime::XFormController > SAL_CALL ScViewPaneBase::getFor
::sal_Bool SAL_CALL ScViewPaneBase::isFormDesignMode( ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_Bool bIsFormDesignMode( sal_True );
@@ -370,7 +370,7 @@ uno::Reference< form::runtime::XFormController > SAL_CALL ScViewPaneBase::getFor
void SAL_CALL ScViewPaneBase::setFormDesignMode( ::sal_Bool _DesignMode ) throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
Window* pWindow( NULL );
SdrView* pSdrView( NULL );
@@ -385,7 +385,7 @@ uno::Reference<awt::XControl> SAL_CALL ScViewPaneBase::getControl(
const uno::Reference<awt::XControlModel>& xModel )
throw(container::NoSuchElementException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<awt::XControl> xRet;
@@ -467,21 +467,95 @@ void SAL_CALL ScViewPaneObj::release() throw()
OWeakObject::release();
}
+// To process sheet compatibile event
+typedef ::cppu::WeakImplHelper2< awt::XEnhancedMouseClickHandler, view::XSelectionChangeListener > TabViewEventListener_BASE;
+class ScTabViewEventListener: public TabViewEventListener_BASE
+{
+private:
+ ScTabViewObj* pViewObj;
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEventsHelper;
+ sal_Bool bDelaySelectionEvent;
+ sal_Bool bSelectionChangeOccurred;
+
+ void fireSelectionChangeEvent();
+
+public:
+ ScTabViewEventListener( ScTabViewObj* pObj, uno::Reference< script::vba::XVBAEventProcessor >& rVbaEventsHelper);
+ ~ScTabViewEventListener();
+ // XEnhancedMouseClickHandler
+ virtual sal_Bool SAL_CALL mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
+ virtual sal_Bool SAL_CALL mouseReleased( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
+
+ // XSelectionChangeListener
+ virtual void SAL_CALL selectionChanged( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
+ // XEventListener
+ virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
+};
+
+ScTabViewEventListener::ScTabViewEventListener(ScTabViewObj* pObj, uno::Reference< script::vba::XVBAEventProcessor >& rVbaEventsHelper):
+ pViewObj( pObj ),xVbaEventsHelper( rVbaEventsHelper ), bDelaySelectionEvent( false ), bSelectionChangeOccurred( false )
+{
+}
+
+ScTabViewEventListener::~ScTabViewEventListener()
+{
+}
+
+void SAL_CALL ScTabViewEventListener::disposing( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
+{
+}
+
+void ScTabViewEventListener::fireSelectionChangeEvent()
+{
+ if ( xVbaEventsHelper.is() && pViewObj )
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] = pViewObj->getSelection();
+ try
+ {
+ xVbaEventsHelper->processVbaEvent( script::vba::VBAEventId::WORKSHEET_SELECTIONCHANGE, aArgs );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ bDelaySelectionEvent = false;
+ bSelectionChangeOccurred = false;
+}
+
+sal_Bool SAL_CALL ScTabViewEventListener::mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException)
+{
+ // Delay to fire the selection change event if clicking the left mouse button to do selection.
+ bDelaySelectionEvent = ( e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT ) ? false : sal_True;
+ bSelectionChangeOccurred = false;
+
+ // ScTabViewObj::MousePressed should handle process BeforeDoubleClick and BeforeRightClick events
+ return sal_True;
+}
+
+sal_Bool SAL_CALL ScTabViewEventListener::mouseReleased( const awt::EnhancedMouseEvent&/*e*/) throw (uno::RuntimeException)
+{
+ if ( bSelectionChangeOccurred )
+ fireSelectionChangeEvent();
+ return sal_True;
+}
+
+void SAL_CALL ScTabViewEventListener::selectionChanged( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
+{
+ if ( !bDelaySelectionEvent )
+ {
+ fireSelectionChangeEvent();
+ }
+ else
+ {
+ bSelectionChangeOccurred = sal_True;
+ }
+}
+
//------------------------------------------------------------------------
// Default-ctor wird fuer SMART_REFLECTION_IMPLEMENTATION gebraucht
-//UNUSED2008-05 ScTabViewObj::ScTabViewObj() :
-//UNUSED2008-05 ScViewPaneBase( NULL, SC_VIEWPANE_ACTIVE ),
-//UNUSED2008-05 SfxBaseController( NULL ),
-//UNUSED2008-05 aPropSet( lcl_GetViewOptPropertyMap() ),
-//UNUSED2008-05 aMouseClickHandlers( 0 ),
-//UNUSED2008-05 aActivationListeners( 0 ),
-//UNUSED2008-05 bDrawSelModeSet(sal_False),
-//UNUSED2008-05 bFilteredRangeSelection(sal_True)
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) :
ScViewPaneBase( pViewSh, SC_VIEWPANE_ACTIVE ),
SfxBaseController( pViewSh ),
@@ -489,10 +563,25 @@ ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) :
aMouseClickHandlers( 0 ),
aActivationListeners( 0 ),
nPreviousTab( 0 ),
- bDrawSelModeSet(sal_False)
+ bDrawSelModeSet(false)
{
if (pViewSh)
+ {
nPreviousTab = pViewSh->GetViewData()->GetTabNo();
+ ScViewData* pViewData = pViewSh->GetViewData();
+ if( pViewData )
+ {
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEventsHelper (pViewData->GetDocument()->GetVbaEventProcessor(), uno::UNO_QUERY );
+ if ( xVbaEventsHelper.is() )
+ {
+ ScTabViewEventListener* pEventListener = new ScTabViewEventListener( this, xVbaEventsHelper );
+ uno::Reference< awt::XEnhancedMouseClickHandler > aMouseClickHandler( *pEventListener, uno::UNO_QUERY );
+ addEnhancedMouseClickHandler( aMouseClickHandler );
+ uno::Reference< view::XSelectionChangeListener > aSelectionChangeListener( *pEventListener, uno::UNO_QUERY );
+ addSelectionChangeListener( aSelectionChangeListener );
+ }
+ }
+ }
}
ScTabViewObj::~ScTabViewObj()
@@ -673,19 +762,18 @@ uno::Sequence<sal_Int8> SAL_CALL ScTabViewObj::getImplementationId()
sal_Bool lcl_TabInRanges( SCTAB nTab, const ScRangeList& rRanges )
{
- sal_uLong nCount = rRanges.Count();
- for (sal_uLong i=0; i<nCount; i++)
+ for (size_t i = 0, nCount = rRanges.size(); i < nCount; ++i)
{
- const ScRange* pRange = rRanges.GetObject(i);
+ const ScRange* pRange = rRanges[ i ];
if ( nTab >= pRange->aStart.Tab() && nTab <= pRange->aEnd.Tab() )
return sal_True;
}
- return sal_False;
+ return false;
}
void lcl_ShowObject( ScTabViewShell& rViewSh, ScDrawView& rDrawView, SdrObject* pSelObj )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCTAB nObjectTab = 0;
SdrModel* pModel = rDrawView.GetModel();
@@ -719,15 +807,15 @@ void lcl_ShowObject( ScTabViewShell& rViewSh, ScDrawView& rDrawView, SdrObject*
sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if ( !pViewSh )
- return sal_False;
+ return false;
//! Type of aSelection can be some specific interface instead of XInterface
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
uno::Reference<uno::XInterface> xInterface(aSelection, uno::UNO_QUERY);
if ( !xInterface.is() ) //clear all selections
{
@@ -744,9 +832,9 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
if (bDrawSelModeSet) // remove DrawSelMode if set by API; if necessary it will be set again later
{
- pViewSh->SetDrawSelMode(sal_False);
+ pViewSh->SetDrawSelMode(false);
pViewSh->UpdateLayerLocks();
- bDrawSelModeSet = sal_False;
+ bDrawSelModeSet = false;
}
if (bRet)
@@ -780,23 +868,23 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
if (pDisp)
pDisp->Execute( pFunc->GetSlotID(), SFX_CALLMODE_SYNCHRON );
}
- pViewSh->SetDrawShell(sal_False);
- pViewSh->SetDrawSelMode(sal_False); // nach dem Dispatcher-Execute
+ pViewSh->SetDrawShell(false);
+ pViewSh->SetDrawSelMode(false); // nach dem Dispatcher-Execute
// Ranges selektieren
const ScRangeList& rRanges = pRangesImp->GetRangeList();
- sal_uLong nRangeCount = rRanges.Count();
+ size_t nRangeCount = rRanges.size();
// for empty range list, remove selection (cursor remains where it was)
if ( nRangeCount == 0 )
pViewSh->Unmark();
else if ( nRangeCount == 1 )
- pViewSh->MarkRange( *rRanges.GetObject(0) );
+ pViewSh->MarkRange( *rRanges[ 0 ] );
else
{
// Mehrfachselektion
- const ScRange* pFirst = rRanges.GetObject(0);
+ const ScRange* pFirst = rRanges[ 0 ];
if ( pFirst && !lcl_TabInRanges( pViewData->GetTabNo(), rRanges ) )
pViewSh->SetTabNo( pFirst->aStart.Tab() );
pViewSh->DoneBlockMode();
@@ -876,7 +964,7 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
if (pDrawView->IsObjMarkable( pObj, pPV ))
pDrawView->MarkObj( pObj, pPV );
else
- bAllMarked = sal_False;
+ bAllMarked = false;
}
}
}
@@ -902,7 +990,7 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
ScCellRangesBase* pObj = NULL;
if (pViewSh)
@@ -958,9 +1046,9 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException)
ScMarkData aFilteredMark( rMark );
ScViewUtil::UnmarkFiltered( aFilteredMark, pDocSh->GetDocument());
ScRangeList aRangeList;
- aFilteredMark.FillRangeListWithMarks( &aRangeList, sal_False);
+ aFilteredMark.FillRangeListWithMarks( &aRangeList, false);
// Theoretically a selection may start and end on a filtered row.
- switch (aRangeList.Count())
+ switch ( aRangeList.size() )
{
case 0:
// No unfiltered row, we have to return some object, so
@@ -969,7 +1057,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException)
break;
case 1:
{
- const ScRange& rRange = *(aRangeList.GetObject(0));
+ const ScRange& rRange = *(aRangeList[ 0 ]);
if (rRange.aStart == rRange.aEnd)
pObj = new ScCellObj( pDocSh, rRange.aStart );
else
@@ -1005,72 +1093,12 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException)
return uno::makeAny(uno::Reference<uno::XInterface>(static_cast<cppu::OWeakObject*>(pObj)));
}
-
-#if 0
-// XPrintable
-
-rtl::OUString ScTabViewObj::getPrinterName(void) const
-{
- ScUnoGuard aGuard;
- ScTabViewShell* pViewSh = GetViewShell();
- if (pViewSh)
- {
- SfxPrinter* pPrinter = pViewSh->GetPrinter(sal_True);
- if (pPrinter)
- return pPrinter->GetName();
- }
-
- DBG_ERROR("getPrinterName: keine View oder kein Printer");
- return rtl::OUString();
-}
-
-void ScTabViewObj::setPrinterName(const rtl::OUString& PrinterName)
-{
- ScUnoGuard aGuard;
- // Drucker setzen - wie in SfxViewShell::ExecPrint_Impl
-
- ScTabViewShell* pViewSh = GetViewShell();
- if (pViewSh)
- {
- SfxPrinter* pPrinter = pViewSh->GetPrinter(sal_True);
- if (pPrinter)
- {
- String aString(PrinterName);
- SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), aString );
- if (pNewPrinter->IsKnown())
- pViewSh->SetPrinter( pNewPrinter, SFX_PRINTER_PRINTER );
- else
- delete pNewPrinter;
- }
- }
-}
-
-XPropertySetRef ScTabViewObj::createPrintOptions(void)
-{
- ScUnoGuard aGuard;
- return new ScPrintSettingsObj; //! ScPrintSettingsObj implementieren!
-}
-
-void ScTabViewObj::print(const XPropertySetRef& xOptions)
-{
- ScUnoGuard aGuard;
- ScTabViewShell* pViewSh = GetViewShell();
- if (pViewSh)
- {
- //! xOptions auswerten (wie denn?)
-
- SfxRequest aReq( SID_PRINTDOCDIRECT, SFX_CALLMODE_SYNCHRON, pViewSh->GetPool() );
- pViewSh->ExecuteSlot( aReq );
- }
-}
-#endif
-
// XEnumerationAccess
uno::Reference<container::XEnumeration> SAL_CALL ScTabViewObj::createEnumeration()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetViewPanesEnumeration")));
}
@@ -1078,7 +1106,7 @@ uno::Reference<container::XEnumeration> SAL_CALL ScTabViewObj::createEnumeration
sal_Int32 SAL_CALL ScTabViewObj::getCount() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
sal_uInt16 nPanes = 0;
if (pViewSh)
@@ -1097,7 +1125,7 @@ uno::Any SAL_CALL ScTabViewObj::getByIndex( sal_Int32 nIndex )
throw(lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XViewPane> xPane(GetObjectByIndex_Impl((sal_uInt16)nIndex));
if (xPane.is())
return uno::makeAny(xPane);
@@ -1108,13 +1136,13 @@ uno::Any SAL_CALL ScTabViewObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScTabViewObj::getElementType() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return getCppuType((uno::Reference<sheet::XViewPane>*)0);
}
sal_Bool SAL_CALL ScTabViewObj::hasElements() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
return ( getCount() != 0 );
}
@@ -1129,7 +1157,7 @@ ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) const
if (pViewSh)
{
ScSplitPos eWhich = SC_SPLIT_BOTTOMLEFT; // default Position
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
ScViewData* pViewData = pViewSh->GetViewData();
sal_Bool bHor = ( pViewData->GetHSplitMode() != SC_SPLIT_NONE );
sal_Bool bVer = ( pViewData->GetVSplitMode() != SC_SPLIT_NONE );
@@ -1170,7 +1198,7 @@ ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) const
uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -1181,10 +1209,20 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet()
return NULL;
}
+// support expand (but not replace) the active sheet
void SAL_CALL ScTabViewObj::setActiveSheet( const uno::Reference<sheet::XSpreadsheet>& xActiveSheet )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ selectSheet(xActiveSheet, false);
+}
+
+void SAL_CALL
+ScTabViewObj::selectSheet( const uno::Reference<sheet::XSpreadsheet>& xActiveSheet,
+ sal_Bool bExpand)
+ throw(uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ sal_Bool bNew = bExpand;
ScTabViewShell* pViewSh = GetViewShell();
if ( pViewSh && xActiveSheet.is() )
@@ -1195,11 +1233,11 @@ void SAL_CALL ScTabViewObj::setActiveSheet( const uno::Reference<sheet::XSpreads
if ( pRangesImp && pViewSh->GetViewData()->GetDocShell() == pRangesImp->GetDocShell() )
{
const ScRangeList& rRanges = pRangesImp->GetRangeList();
- if ( rRanges.Count() == 1 )
+ if ( rRanges.size() == 1 )
{
- SCTAB nNewTab = rRanges.GetObject(0)->aStart.Tab();
+ SCTAB nNewTab = rRanges[ 0 ]->aStart.Tab();
if ( pViewSh->GetViewData()->GetDocument()->HasTable(nNewTab) )
- pViewSh->SetTabNo( nNewTab );
+ pViewSh->SetTabNo( nNewTab, bNew, bExpand );
}
}
}
@@ -1241,7 +1279,7 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP
Size(pDrawView->GetHitTolerancePixel(),0)).Width();
sal_uInt32 nCount(pDrawPage->GetObjCount());
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
sal_uInt32 i(0);
while (i < nCount && !bFound)
{
@@ -1276,7 +1314,7 @@ bool ScTabViewObj::IsMouseListening() const
sal_Bool ScTabViewObj::MousePressed( const awt::MouseEvent& e )
throw (::uno::RuntimeException)
{
- sal_Bool bReturn(sal_False);
+ sal_Bool bReturn(false);
uno::Reference< uno::XInterface > xTarget = GetClickedObject(Point(e.X, e.Y));
if (aMouseClickHandlers.Count() && xTarget.is())
@@ -1334,7 +1372,7 @@ sal_Bool ScTabViewObj::MousePressed( const awt::MouseEvent& e )
/*ErrCode eRet =*/ pDocSh->CallXScript( *pScript, aParams, aRet, aOutArgsIndex, aOutArgs );
// look for a boolean return value of true
- sal_Bool bRetValue = sal_False;
+ sal_Bool bRetValue = false;
if (aRet >>= bRetValue)
{
if (bRetValue)
@@ -1367,7 +1405,7 @@ sal_Bool ScTabViewObj::MousePressed( const awt::MouseEvent& e )
sal_Bool ScTabViewObj::MouseReleased( const awt::MouseEvent& e )
throw (uno::RuntimeException)
{
- sal_Bool bReturn(sal_False);
+ sal_Bool bReturn(false);
if (aMouseClickHandlers.Count())
{
@@ -1451,7 +1489,7 @@ void ScTabViewObj::EndActivationListening()
void SAL_CALL ScTabViewObj::addEnhancedMouseClickHandler( const uno::Reference< awt::XEnhancedMouseClickHandler >& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (aListener.is())
{
@@ -1468,7 +1506,7 @@ void SAL_CALL ScTabViewObj::addEnhancedMouseClickHandler( const uno::Reference<
void SAL_CALL ScTabViewObj::removeEnhancedMouseClickHandler( const uno::Reference< awt::XEnhancedMouseClickHandler >& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aMouseClickHandlers.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -1485,7 +1523,7 @@ void SAL_CALL ScTabViewObj::removeEnhancedMouseClickHandler( const uno::Referenc
void SAL_CALL ScTabViewObj::addActivationEventListener( const uno::Reference< sheet::XActivationEventListener >& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
if (aListener.is())
{
@@ -1502,7 +1540,7 @@ void SAL_CALL ScTabViewObj::addActivationEventListener( const uno::Reference< sh
void SAL_CALL ScTabViewObj::removeActivationEventListener( const uno::Reference< sheet::XActivationEventListener >& aListener )
throw (uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aActivationListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -1514,30 +1552,7 @@ void SAL_CALL ScTabViewObj::removeActivationEventListener( const uno::Reference<
EndActivationListening();
}
-// PageBreakMode / Zoom sind Properties
-
-#if 0
-
-sal_Bool ScTabViewObj::getPagebreakMode(void) const
-{
- ScUnoGuard aGuard;
- ScTabViewShell* pViewSh = GetViewShell();
- if (pViewSh)
- return pViewSh->GetViewData()->IsPagebreakMode();
- return sal_False;
-}
-
-void ScTabViewObj::setPagebreakMode(sal_Bool PagebreakMode)
-{
- ScUnoGuard aGuard;
- ScTabViewShell* pViewSh = GetViewShell();
- if (pViewSh)
- pViewSh->SetPagebreakMode(PagebreakMode);
-}
-
-#endif
-
-sal_Int16 ScTabViewObj::GetZoom(void) const
+INT16 ScTabViewObj::GetZoom(void) const
{
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
@@ -1659,7 +1674,7 @@ void ScTabViewObj::SetZoomType(sal_Int16 aZoomType)
sal_Bool SAL_CALL ScTabViewObj::getIsWindowSplit() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// wie Menue-Slot SID_WINDOW_SPLIT
ScTabViewShell* pViewSh = GetViewShell();
@@ -1670,12 +1685,12 @@ sal_Bool SAL_CALL ScTabViewObj::getIsWindowSplit() throw(uno::RuntimeException)
pViewData->GetVSplitMode() == SC_SPLIT_NORMAL );
}
- return sal_False;
+ return false;
}
sal_Bool SAL_CALL ScTabViewObj::hasFrozenPanes() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
// wie Menue-Slot SID_WINDOW_FIX
ScTabViewShell* pViewSh = GetViewShell();
@@ -1686,12 +1701,12 @@ sal_Bool SAL_CALL ScTabViewObj::hasFrozenPanes() throw(uno::RuntimeException)
pViewData->GetVSplitMode() == SC_SPLIT_FIX );
}
- return sal_False;
+ return false;
}
sal_Int32 SAL_CALL ScTabViewObj::getSplitHorizontal() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -1704,7 +1719,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitHorizontal() throw(uno::RuntimeExceptio
sal_Int32 SAL_CALL ScTabViewObj::getSplitVertical() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -1717,7 +1732,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitVertical() throw(uno::RuntimeException)
sal_Int32 SAL_CALL ScTabViewObj::getSplitColumn() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -1732,7 +1747,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitColumn() throw(uno::RuntimeException)
SCsCOL nCol;
SCsROW nRow;
- pViewData->GetPosFromPixel( nSplit, 0, ePos, nCol, nRow, sal_False );
+ pViewData->GetPosFromPixel( nSplit, 0, ePos, nCol, nRow, false );
if ( nCol > 0 )
return nCol;
}
@@ -1742,7 +1757,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitColumn() throw(uno::RuntimeException)
sal_Int32 SAL_CALL ScTabViewObj::getSplitRow() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -1754,7 +1769,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitRow() throw(uno::RuntimeException)
ScSplitPos ePos = SC_SPLIT_TOPLEFT; // es ist vertikal geteilt
SCsCOL nCol;
SCsROW nRow;
- pViewData->GetPosFromPixel( 0, nSplit, ePos, nCol, nRow, sal_False );
+ pViewData->GetPosFromPixel( 0, nSplit, ePos, nCol, nRow, false );
if ( nRow > 0 )
return nRow;
}
@@ -1765,12 +1780,12 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitRow() throw(uno::RuntimeException)
void SAL_CALL ScTabViewObj::splitAtPosition( sal_Int32 nPixelX, sal_Int32 nPixelY )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
pViewSh->SplitAtPixel( Point( nPixelX, nPixelY ), sal_True, sal_True );
- pViewSh->FreezeSplitters( sal_False );
+ pViewSh->FreezeSplitters( false );
pViewSh->InvalidateSplit();
}
}
@@ -1778,7 +1793,7 @@ void SAL_CALL ScTabViewObj::splitAtPosition( sal_Int32 nPixelX, sal_Int32 nPixel
void SAL_CALL ScTabViewObj::freezeAtPosition( sal_Int32 nColumns, sal_Int32 nRows )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -1805,7 +1820,7 @@ void SAL_CALL ScTabViewObj::addSelectionChangeListener(
const uno::Reference<view::XSelectionChangeListener>& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<view::XSelectionChangeListener>* pObj =
new uno::Reference<view::XSelectionChangeListener>( xListener );
aSelectionListeners.Insert( pObj, aSelectionListeners.Count() );
@@ -1815,7 +1830,7 @@ void SAL_CALL ScTabViewObj::removeSelectionChangeListener(
const uno::Reference< view::XSelectionChangeListener >& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aSelectionListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -1856,19 +1871,7 @@ void ScTabViewObj::SelectionChanged()
/*ErrCode eRet =*/ pDocSh->CallXScript( *pScript, aParams, aRet, aOutArgsIndex, aOutArgs );
}
}
-
- // execute VBA event handler
- try
- {
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW );
- // the parameter is the clicked object, as in the mousePressed call above
- uno::Sequence< uno::Any > aArgs( 1 );
- aArgs[ 0 ] <<= getSelection();
- xVbaEvents->processVbaEvent( ScSheetEvents::GetVbaSheetEventId( SC_SHEETEVENT_SELECT ), aArgs );
- }
- catch( uno::Exception& )
- {
- }
+ // Removed Sun/Oracle code intentionally, it doesn't work properly ( selection should be fired after mouse release )
}
@@ -1878,7 +1881,7 @@ void ScTabViewObj::SelectionChanged()
uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTabViewObj::getPropertySetInfo()
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
static uno::Reference<beans::XPropertySetInfo> aRef(
new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
return aRef;
@@ -1890,9 +1893,15 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
+ if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) )
+ {
+ bFilteredRangeSelection = ScUnoHelpFunctions::GetBoolFromAny(aValue);
+ return;
+ }
+
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -2009,10 +2018,16 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const rtl::OUString& aProperty
throw(beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
String aString(aPropertyName);
uno::Any aRet;
+ if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) )
+ {
+ ScUnoHelpFunctions::SetBoolInAny(aRet, bFilteredRangeSelection);
+ return aRet;
+ }
+
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
@@ -2066,7 +2081,7 @@ void SAL_CALL ScTabViewObj::addPropertyChangeListener( const ::rtl::OUString& /*
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<beans::XPropertyChangeListener>* pObj =
new uno::Reference<beans::XPropertyChangeListener>( xListener );
aPropertyChgListeners.Insert( pObj, aPropertyChgListeners.Count() );
@@ -2078,7 +2093,7 @@ void SAL_CALL ScTabViewObj::removePropertyChangeListener( const ::rtl::OUString&
lang::WrappedTargetException,
uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aPropertyChgListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -2121,14 +2136,14 @@ void SAL_CALL ScTabViewObj::startRangeSelection(
const uno::Sequence<beans::PropertyValue>& aArguments )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
String aInitVal, aTitle;
- sal_Bool bCloseOnButtonUp = sal_False;
- sal_Bool bSingleCell = sal_False;
- sal_Bool bMultiSelection = sal_False;
+ sal_Bool bCloseOnButtonUp = false;
+ sal_Bool bSingleCell = false;
+ sal_Bool bMultiSelection = false;
rtl::OUString aStrVal;
const beans::PropertyValue* pPropArray = aArguments.getConstArray();
@@ -2162,7 +2177,7 @@ void SAL_CALL ScTabViewObj::startRangeSelection(
void SAL_CALL ScTabViewObj::abortRangeSelection() throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
pViewSh->StopSimpleRefDialog();
@@ -2172,7 +2187,7 @@ void SAL_CALL ScTabViewObj::addRangeSelectionListener(
const uno::Reference<sheet::XRangeSelectionListener>& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XRangeSelectionListener>* pObj =
new uno::Reference<sheet::XRangeSelectionListener>( xListener );
aRangeSelListeners.Insert( pObj, aRangeSelListeners.Count() );
@@ -2182,7 +2197,7 @@ void SAL_CALL ScTabViewObj::removeRangeSelectionListener(
const uno::Reference<sheet::XRangeSelectionListener>& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aRangeSelListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -2199,7 +2214,7 @@ void SAL_CALL ScTabViewObj::addRangeSelectionChangeListener(
const uno::Reference<sheet::XRangeSelectionChangeListener>& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
uno::Reference<sheet::XRangeSelectionChangeListener>* pObj =
new uno::Reference<sheet::XRangeSelectionChangeListener>( xListener );
aRangeChgListeners.Insert( pObj, aRangeChgListeners.Count() );
@@ -2209,7 +2224,7 @@ void SAL_CALL ScTabViewObj::removeRangeSelectionChangeListener(
const uno::Reference<sheet::XRangeSelectionChangeListener>& xListener )
throw(uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = aRangeChgListeners.Count();
for ( sal_uInt16 n=nCount; n--; )
{
@@ -2256,7 +2271,7 @@ void ScTabViewObj::RangeSelChanged( const String& rText )
rtl::OUString SAL_CALL ScTabViewObj::getImplementationName() throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii( "ScTabViewObj" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ScTabViewObj" ));
}
sal_Bool SAL_CALL ScTabViewObj::supportsService( const rtl::OUString& rServiceName )
@@ -2272,8 +2287,8 @@ uno::Sequence<rtl::OUString> SAL_CALL ScTabViewObj::getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(2);
rtl::OUString* pArray = aRet.getArray();
- pArray[0] = rtl::OUString::createFromAscii( SCTABVIEWOBJ_SERVICE );
- pArray[1] = rtl::OUString::createFromAscii( SCVIEWSETTINGS_SERVICE );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCTABVIEWOBJ_SERVICE ));
+ pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCVIEWSETTINGS_SERVICE ));
return aRet;
}
@@ -2291,7 +2306,6 @@ sal_Int64 SAL_CALL ScTabViewObj::getSomething(
return 0;
}
-// static
const uno::Sequence<sal_Int8>& ScTabViewObj::getUnoTunnelId()
{
static uno::Sequence<sal_Int8> * pSeq = 0;
@@ -2308,7 +2322,6 @@ const uno::Sequence<sal_Int8>& ScTabViewObj::getUnoTunnelId()
return *pSeq;
}
-// static
ScTabViewObj* ScTabViewObj::getImplementation( const uno::Reference<uno::XInterface> xObj )
{
ScTabViewObj* pRet = NULL;
@@ -2320,7 +2333,7 @@ ScTabViewObj* ScTabViewObj::getImplementation( const uno::Reference<uno::XInterf
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL ScTabViewObj::getTransferable( ) throw (::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScEditShell* pShell = PTR_CAST( ScEditShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pShell)
return pShell->GetEditView()->GetTransferable();
@@ -2346,10 +2359,10 @@ ScTabViewObj* ScTabViewObj::getImplementation( const uno::Reference<uno::XInterf
void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans ) throw (::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::uno::RuntimeException)
{
- ScUnoGuard aGuard;
+ SolarMutexGuard aGuard;
ScEditShell* pShell = PTR_CAST( ScEditShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pShell)
- pShell->GetEditView()->InsertText( xTrans, ::rtl::OUString(), sal_False );
+ pShell->GetEditView()->InsertText( xTrans, ::rtl::OUString(), false );
else
{
ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
@@ -2360,7 +2373,7 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if ( pOutView )
{
- pOutView->GetEditView().InsertText( xTrans, ::rtl::OUString(), sal_False );
+ pOutView->GetEditView().InsertText( xTrans, ::rtl::OUString(), false );
return;
}
}
@@ -2374,3 +2387,4 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/warnpassword.cxx b/sc/source/ui/unoobj/warnpassword.cxx
index ce81fd2645c4..c00df0a3eedf 100644
--- a/sc/source/ui/unoobj/warnpassword.cxx
+++ b/sc/source/ui/unoobj/warnpassword.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ bool ScWarnPassword::WarningOnPassword( SfxMedium& rMedium )
return bReturn;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index 04d88935acfc..5ec8fd16c80d 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,16 +35,63 @@
#include "transobj.hxx"
#include "scmod.hxx"
#include "cellsuno.hxx"
-
-namespace ooo {
-namespace vba {
-namespace excel {
+#include "compiler.hxx"
+#include "token.hxx"
+#include "tokenarray.hxx"
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/sheet/XSheetCellRange.hpp>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
// ============================================================================
+uno::Reference< sheet::XDatabaseRanges >
+GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException )
+{
+ uno::Reference< frame::XModel > xModel;
+ if ( pShell )
+ xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XDatabaseRanges > xDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges") ) ), uno::UNO_QUERY_THROW );
+ return xDBRanges;
+}
+
+// returns the XDatabaseRange for the autofilter on sheet (nSheet)
+// also populates sName with the name of range
+uno::Reference< sheet::XDatabaseRange >
+GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XIndexAccess > xIndexAccess( GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XDatabaseRange > xDataBaseRange;
+ table::CellRangeAddress dbAddress;
+ for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index )
+ {
+ uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW );
+ // autofilters work weirdly with openoffice, unnamed is the default
+ // named range which is used to create an autofilter, but
+ // its also possible that another name could be used
+ // this also causes problems when an autofilter is created on
+ // another sheet
+ // ( but.. you can use any named range )
+ dbAddress = xDBRange->getDataArea();
+ if ( dbAddress.Sheet == nSheet )
+ {
+ sal_Bool bHasAuto = false;
+ uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW );
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto;
+ if ( bHasAuto )
+ {
+ sName = xNamed->getName();
+ xDataBaseRange=xDBRange;
+ break;
+ }
+ }
+ }
+ return xDataBaseRange;
+}
+
ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException )
{
ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( xRange );
@@ -54,6 +102,13 @@ ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRang
return pScCellRangesBase->GetDocShell();
}
+ScDocShell* GetDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException )
+{
+ // need the ScCellRangesBase to get docshell
+ uno::Reference< uno::XInterface > xIf( xRanges, uno::UNO_QUERY_THROW );
+ return GetDocShellFromRange( xIf );
+}
+
ScDocument* GetDocumentFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException )
{
ScDocShell* pDocShell = GetDocShellFromRange( xRange );
@@ -64,6 +119,16 @@ ScDocument* GetDocumentFromRange( const uno::Reference< uno::XInterface >& xRang
return pDocShell->GetDocument();
}
+uno::Reference< frame::XModel > GetModelFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException )
+{
+ ScDocShell* pDocShell = GetDocShellFromRange( xRange );
+ if ( !pDocShell )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying model uno range object" ) ), uno::Reference< uno::XInterface >() );
+ }
+ return pDocShell->GetModel();
+}
+
void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs )
{
ScTabViewShell* pViewSh = excel::getBestViewShell( xModel );
@@ -103,7 +168,7 @@ private:
bool getReplaceCellsWarning() throw ( uno::RuntimeException )
{
- sal_Bool res = sal_False;
+ sal_Bool res = false;
getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
return ( res == sal_True );
}
@@ -179,7 +244,7 @@ implnCut( const uno::Reference< frame::XModel>& xModel )
void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
{
PasteCellsWarningReseter resetWarningBox;
- sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
+ sal_Bool bAsLink(false), bOtherDoc(false);
InsCellCmd eMoveMode = INS_NONE;
ScTabViewShell* pTabViewShell = getBestViewShell( xModel );
@@ -196,10 +261,7 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, sal_uInt16
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
ScDocument* pDoc = NULL;
if ( pOwnClip )
- {
pDoc = pOwnClip->GetDocument();
- pOwnClip->SetUseInApi( false ); // don't use in Insert after it was pasted once
- }
pTabViewShell->PasteFromClip( nFlags, pDoc,
nFunction, bSkipEmpty, bTranspose, bAsLink,
eMoveMode, IDF_NONE, sal_True );
@@ -210,6 +272,15 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, sal_uInt16
}
+void implnCopyRange( const uno::Reference< frame::XModel>& xModel, const ScRange& rRange )
+{
+ ScTabViewShell* pViewShell = getBestViewShell( xModel );
+ if ( pViewShell )
+ {
+ pViewShell->CopyToClip( NULL, rRange, false, true, true );
+ }
+}
+
ScDocShell*
getDocShell( const css::uno::Reference< css::frame::XModel>& xModel )
{
@@ -247,8 +318,21 @@ getViewFrame( const uno::Reference< frame::XModel >& xModel )
return NULL;
}
-uno::Reference< vba::XHelperInterface >
-getUnoSheetModuleObj( const uno::Reference< sheet::XSpreadsheet >& xSheet ) throw ( uno::RuntimeException )
+sal_Bool IsR1C1ReferFormat( ScDocument* pDoc, const rtl::OUString& sRangeStr )
+{
+ ScRangeList aCellRanges;
+ String sAddress( sRangeStr );
+ sal_uInt16 nMask = SCA_VALID;
+ sal_uInt16 rResFlags = aCellRanges.Parse( sAddress, pDoc, nMask, formula::FormulaGrammar::CONV_XL_R1C1 );
+ if ( rResFlags & SCA_VALID )
+ {
+ return sal_True;
+ }
+ return false;
+}
+
+uno::Reference< XHelperInterface >
+getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
{
uno::Reference< beans::XPropertySet > xProps( xSheet, uno::UNO_QUERY_THROW );
rtl::OUString sCodeName;
@@ -262,12 +346,82 @@ getUnoSheetModuleObj( const uno::Reference< sheet::XSpreadsheet >& xSheet ) thro
return xParent;
}
-uno::Reference< XHelperInterface >
-getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
+formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAddress& sAddress, const css::uno::Any& aFormula )
{
- uno::Reference< sheet::XSheetCellRange > xSheetRange( xRange, uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XSpreadsheet > xSheet( xSheetRange->getSpreadsheet(), uno::UNO_SET_THROW );
- return getUnoSheetModuleObj( xSheet );
+ formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_NATIVE_XL_A1;
+ if ( pDoc && aFormula.hasValue() && aFormula.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString sFormula;
+ aFormula >>= sFormula;
+
+ ScCompiler aCompiler( pDoc, sAddress );
+ aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 );
+ ScTokenArray* pCode = aCompiler.CompileString( sFormula );
+ if ( pCode )
+ {
+ sal_uInt16 nLen = pCode->GetLen();
+ formula::FormulaToken** pTokens = pCode->GetArray();
+ for ( sal_uInt16 nPos = 0; nPos < nLen; nPos++ )
+ {
+ const formula::FormulaToken& rToken = *pTokens[nPos];
+ switch ( rToken.GetType() )
+ {
+ case formula::svSingleRef:
+ case formula::svDoubleRef:
+ {
+ return formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1;
+ }
+ break;
+ default: break;
+ }
+ }
+ }
+ }
+ return eGrammar;
+}
+
+void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula )
+{
+ if ( !pDoc )
+ {
+ return;
+ }
+ ScCompiler aCompiler( pDoc, ScAddress() );
+ aCompiler.SetGrammar( excel::GetFormulaGrammar( pDoc, ScAddress(), uno::Any( rtl::OUString( rOldFormula ) ) ) );
+ aCompiler.CompileString( rOldFormula );
+ aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_PODF_A1 );
+ aCompiler.CreateStringFromTokenArray( rNewFormula );
+}
+
+void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar )
+{
+ // eGrammar can be formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 and formula::FormulaGrammar::GRAM_NATIVE_XL_A1
+ if ( !pDoc )
+ {
+ return;
+ }
+ ScCompiler aCompiler( pDoc, ScAddress() );
+ aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_PODF_A1 );
+ ScTokenArray* pCode = aCompiler.CompileString( rOldFormula );
+ aCompiler.SetGrammar( eGrammar );
+ if ( !pCode )
+ {
+ return;
+ }
+ sal_uInt16 nLen = pCode->GetLen();
+ formula::FormulaToken** pTokens = pCode->GetArray();
+ for ( sal_uInt16 nPos = 0; nPos < nLen && pTokens[nPos]; nPos++ )
+ {
+ String rFormula;
+ formula::FormulaToken* pToken = pTokens[nPos];
+ aCompiler.CreateStringFromToken( rFormula, pToken, true );
+ if ( pToken->GetOpCode() == ocSep )
+ {
+ // Excel formula separator is ",".
+ rFormula = String::CreateFromAscii(",");
+ }
+ rNewFormula += rFormula;
+ }
}
uno::Reference< XHelperInterface >
@@ -304,6 +458,8 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangesBase* pRangeObj )
// ============================================================================
-} // namespace excel
-} // namespace vba
-} // namespace ooo
+} //excel
+} //vba
+} //ooo
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx
index be04fefa1639..13e7bf985d32 100644
--- a/sc/source/ui/vba/excelvbahelper.hxx
+++ b/sc/source/ui/vba/excelvbahelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,15 @@
#ifndef SC_EXCEL_VBA_HELPER_HXX
#define SC_EXCEL_VBA_HELPER_HXX
-#include <vbahelper/vbahelper.hxx>
-#include "docsh.hxx"
+#include<vbahelper/vbahelper.hxx>
+#include <docsh.hxx>
+#include <com/sun/star/sheet/XDatabaseRanges.hpp>
+#include <com/sun/star/sheet/XDatabaseRange.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <ooo/vba/XHelperInterface.hpp>
+#include <formula/grammar.hxx>
class ScCellRangesBase;
@@ -67,14 +71,43 @@ css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Ref
class ScVbaCellRangeAccess
{
-public:
- static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
-};
+ namespace vba
+ {
+ namespace excel
+ {
+ // nTabs empty means apply zoom to all sheets
+ void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
+ void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
+ void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
+ void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
+ void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
+ void implnCopyRange( const css::uno::Reference< css::frame::XModel>& xModel, const ScRange& rRange );
+ ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
+ ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
+ ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
+ sal_Bool IsR1C1ReferFormat( ScDocument* pDoc, const ::rtl::OUString& sRangeStr );
+ formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAddress& sAddress, const css::uno::Any& aFormula );
+ void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula );
+ void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar );
+ css::uno::Reference< css::sheet::XDatabaseRanges > GetDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException );
-// ============================================================================
-
-} // namespace excel
-} // namespace vba
-} // namespace ooo
+ css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException );
+ ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+ ScDocShell* GetDocShellFromRanges( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
+ ScDocument* GetDocumentFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
+ class ScVbaCellRangeAccess
+ {
+ public:
+ static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
+ };
+ }
+ }
+}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/helperdecl.hxx b/sc/source/ui/vba/helperdecl.hxx
index a9969179d52f..27930279bcf6 100644
--- a/sc/source/ui/vba/helperdecl.hxx
+++ b/sc/source/ui/vba/helperdecl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,4 @@ struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl<Impl
} // namespace service_decl
} // namespace comphelper
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk
index dd489830b1c6..67d600116b0c 100644
--- a/sc/source/ui/vba/makefile.mk
+++ b/sc/source/ui/vba/makefile.mk
@@ -37,6 +37,13 @@ VISIBILITY_HIDDEN=TRUE
.INCLUDE : settings.mk
DLLPRE =
+.IF "$(ENABLE_VBA)"!="YES"
+dummy:
+ @echo "not building vba..."
+.ENDIF
+
+CDEFS+=-DVBA_OOBUILD_HACK
+
.IF "$(L10N_framework)"==""
INCPRE=$(INCCOM)$/$(TARGET)
@@ -55,22 +62,32 @@ SLOFILES= \
$(SLO)$/vbachart.obj \
$(SLO)$/vbachartobject.obj \
$(SLO)$/vbachartobjects.obj \
- $(SLO)$/vbacharts.obj \
$(SLO)$/vbacharttitle.obj \
$(SLO)$/vbacomment.obj \
$(SLO)$/vbacomments.obj \
+ $(SLO)$/vbacommentshape.obj \
$(SLO)$/vbacondition.obj \
$(SLO)$/vbadialog.obj \
$(SLO)$/vbadialogs.obj \
$(SLO)$/vbaeventshelper.obj \
+ $(SLO)$/vbafiledialog.obj \
+ $(SLO)$/vbafiledialogselecteditems.obj \
+ $(SLO)$/vbafilesearch.obj \
$(SLO)$/vbafont.obj \
$(SLO)$/vbaformat.obj \
$(SLO)$/vbaformatcondition.obj \
$(SLO)$/vbaformatconditions.obj \
+ $(SLO)$/vbafoundfiles.obj \
$(SLO)$/vbaglobals.obj \
$(SLO)$/vbahyperlink.obj \
$(SLO)$/vbahyperlinks.obj \
$(SLO)$/vbainterior.obj \
+ $(SLO)$/vbamenubar.obj \
+ $(SLO)$/vbamenubars.obj \
+ $(SLO)$/vbamenu.obj \
+ $(SLO)$/vbamenus.obj \
+ $(SLO)$/vbamenuitem.obj \
+ $(SLO)$/vbamenuitems.obj \
$(SLO)$/vbaname.obj \
$(SLO)$/vbanames.obj \
$(SLO)$/vbaoleobject.obj \
@@ -84,8 +101,8 @@ SLOFILES= \
$(SLO)$/vbapivotcache.obj \
$(SLO)$/vbapivottable.obj \
$(SLO)$/vbapivottables.obj \
+ $(SLO)$/vbaquerytable.obj \
$(SLO)$/vbarange.obj \
- $(SLO)$/vbaseriescollection.obj \
$(SLO)$/vbasheetobject.obj \
$(SLO)$/vbasheetobjects.obj \
$(SLO)$/vbastyle.obj \
diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx
index 7e986338e7d1..05dc4ab91820 100644
--- a/sc/source/ui/vba/service.cxx
+++ b/sc/source/ui/vba/service.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,6 +85,16 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
+ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
+ {
+ OSL_TRACE("In component_writeInfo");
+
+ // Component registration
+ return component_writeInfoHelper( pServiceManager, pRegistryKey,
+ range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl, textframe::serviceDecl );
+ }
+
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
@@ -97,3 +108,5 @@ extern "C"
return pRet;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/testvba/makefile.mk b/sc/source/ui/vba/testvba/makefile.mk
index 534085e326e1..c75f6f63296c 100644
--- a/sc/source/ui/vba/testvba/makefile.mk
+++ b/sc/source/ui/vba/testvba/makefile.mk
@@ -38,6 +38,7 @@ DLLPRE =
INCPRE=$(INCCOM)$/$(TARGET)
CDEFS+=-DVBA_OOBUILD_HACK
+
# ------------------------------------------------------------------
SLOFILES= \
@@ -58,7 +59,4 @@ APP1STDLIBS=\
$(TOOLSLIB) \
$(UNOTOOLSLIB) \
-#APP1OBJS= $(OBJ)$/testclient.obj
.INCLUDE : target.mk
-
-
diff --git a/sc/source/ui/vba/testvba/testvba.cxx b/sc/source/ui/vba/testvba/testvba.cxx
index 686b3e47eaa9..4a318098684e 100644
--- a/sc/source/ui/vba/testvba/testvba.cxx
+++ b/sc/source/ui/vba/testvba/testvba.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "cppuhelper/bootstrap.hxx"
#include <com/sun/star/beans/Property.hpp>
@@ -44,7 +45,7 @@ using ::rtl::OUString;
using ::std::auto_ptr;
-const OUString EXTN = rtl::OUString::createFromAscii(".xls");
+const OUString EXTN(RTL_CONSTASCII_USTRINGPARAM(".xls"));
OUString convertToURL( const OUString& rPath )
{
@@ -58,7 +59,7 @@ OUString convertToURL( const OUString& rPath )
{
osl::FileBase::getFileURLFromSystemPath( rPath, aURL );
if ( aURL.equals( rPath ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "could'nt convert " ).concat( rPath ).concat( rtl::OUString::createFromAscii( " to a URL, is it a fully qualified path name? " ) ), Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "could'nt convert " )).concat( rPath ).concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( " to a URL, is it a fully qualified path name? " )) ), Reference< uno::XInterface >() );
}
return aURL;
}
@@ -97,34 +98,28 @@ public:
const rtl::OUString& _outDirPath ) : mxContext( _xContext ), mxMCF( _xMCF ),
mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
{
- mxSFA.set( mxMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), mxContext), uno::UNO_QUERY_THROW );
+ mxSFA.set( mxMCF->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" )), mxContext), uno::UNO_QUERY_THROW );
}
rtl::OUString getLogLocation() throw ( beans::UnknownPropertyException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::Exception )
{
rtl::OUString sLogLocation;
- Reference< XPropertySet > pathSettings( mxMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.comp.framework.PathSettings" ), mxContext), uno::UNO_QUERY_THROW );
- pathSettings->getPropertyValue( rtl::OUString::createFromAscii( "Work" ) ) >>= sLogLocation;
- sLogLocation = sLogLocation.concat( rtl::OUString::createFromAscii( "/" ) ).concat( rtl::OUString::createFromAscii( "HelperAPI-test.log" ) );
+ Reference< XPropertySet > pathSettings( mxMCF->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.framework.PathSettings" )), mxContext), uno::UNO_QUERY_THROW );
+ pathSettings->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Work" )) ) >>= sLogLocation;
+ sLogLocation = sLogLocation.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/" )) ).concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "HelperAPI-test.log" )) );
return sLogLocation;
}
rtl::OUString getLogLocationWithName( OUString fileName ) throw ( beans::UnknownPropertyException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::Exception )
{
printf("%s\n", getenv("HOME") );
printf("file name %s\n", rtl::OUStringToOString( fileName, RTL_TEXTENCODING_UTF8 ).getStr() );
- //rtl::OUString sLogLocation( rtl::OUString::createFromAscii( getenv("HOME") ) );
rtl::OUString sLogLocation;
- Reference< XPropertySet > pathSettings( mxMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.comp.framework.PathSettings" ), mxContext), uno::UNO_QUERY_THROW );
- pathSettings->getPropertyValue( rtl::OUString::createFromAscii( "Work" ) ) >>= sLogLocation;
- sLogLocation = sLogLocation.concat( rtl::OUString::createFromAscii( "/" ) ).concat( fileName.copy ( 0, fileName.lastIndexOf( EXTN ) ) + rtl::OUString::createFromAscii( ".log" ) );
+ Reference< XPropertySet > pathSettings( mxMCF->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.framework.PathSettings" )), mxContext), uno::UNO_QUERY_THROW );
+ pathSettings->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Work" )) ) >>= sLogLocation;
+ sLogLocation = sLogLocation.concat( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/" )) ).concat( fileName.copy ( 0, fileName.lastIndexOf( EXTN ) ) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ".log" )) );
return sLogLocation;
}
- void init()
- {
- // blow away previous logs?
- }
-
void proccessDocument( const rtl::OUString& sUrl )
{
if ( !mxSFA->isFolder( sUrl ) && sUrl.endsWithIgnoreAsciiCaseAsciiL( ".xls", 4 ) )
@@ -136,13 +131,13 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
printf( "processing %s\n", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
// Loading the wanted document
Sequence< PropertyValue > propertyValues(1);
- propertyValues[0].Name = rtl::OUString::createFromAscii( "Hidden" );
- propertyValues[0].Value <<= sal_False;
+ propertyValues[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" ));
+ propertyValues[0].Value <<= false;
rtl::OUString sfileUrl = convertToURL( sUrl );
printf( "try to get xDoc %s\n", rtl::OUStringToOString( sfileUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
Reference< uno::XInterface > xDoc =
- mxCompLoader->loadComponentFromURL( sfileUrl, rtl::OUString::createFromAscii( "_blank" ), 0, propertyValues);
+ mxCompLoader->loadComponentFromURL( sfileUrl, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0, propertyValues);
printf( "got xDoc\n" );
OUString logFileURL = convertToURL( getLogLocation() );
@@ -159,15 +154,15 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
Reference< script::provider::XScript > xScript;
try
{
- xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.TestMacros.Main?language=Basic&location=document" ));
+ xScript = xProv->getScript( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:VBAProject.TestMacros.Main?language=Basic&location=document") ));
} catch ( uno::Exception& e )
{
try
{
- xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMacro.Main?language=Basic&location=document" ));
+ xScript = xProv->getScript( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:VBAProject.testMacro.Main?language=Basic&location=document" )));
} catch ( uno::Exception& e2 )
{
- xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMain.Main?language=Basic&location=document" ));
+ xScript = xProv->getScript( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:VBAProject.testMain.Main?language=Basic&location=document" )));
}
}
OSL_TRACE("Got script for doc %s", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
@@ -179,7 +174,7 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
xScript->invoke(aArgs, aOutArgsIndex, aOutArgs);
OUString fileName = sUrl.copy ( sUrl.lastIndexOf( '/' ) );
- OUString newLocation = msOutDirPath + fileName.copy ( 0, fileName.lastIndexOf( EXTN ) ) + rtl::OUString::createFromAscii( ".log" );
+ OUString newLocation = msOutDirPath + fileName.copy ( 0, fileName.lastIndexOf( EXTN ) ) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ".log" ));
try
{
printf("move log file\n");
@@ -213,7 +208,7 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
// if only one frame and model, click a button which related will colse.
// will make a crash. It related with window listener.
// so, for run all test cases, it should not close the document at this moment.
- xCloseable->close(sal_False);
+ xCloseable->close(false);
printf("closed\n");
}
else
@@ -239,10 +234,10 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) )
rtl::OUString sFileDirectoryURL = convertToURL( sFileDirectory );
if ( !mxSFA->isFolder( sFileDirectoryURL) )
{
- throw lang::IllegalArgumentException( rtl::OUString::createFromAscii( "not a directory: ").concat( sFileDirectoryURL ), Reference<uno::XInterface>(), 1 );
+ throw lang::IllegalArgumentException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "not a directory: ")).concat( sFileDirectoryURL ), Reference<uno::XInterface>(), 1 );
}
// Getting all files and directories in the current directory
- Sequence<OUString> entries = mxSFA->getFolderContents( sFileDirectoryURL, sal_False );
+ Sequence<OUString> entries = mxSFA->getFolderContents( sFileDirectoryURL, false );
// Iterating for each file and directory
printf( "Entries %d\n", (int)entries.getLength() );
@@ -297,8 +292,6 @@ int main( int argv, char** argc )
dTest->traverse( ascii( argc[ 1 ] ) );
}
delete dTest;
-// tryDispose( xLoader, "desktop" );
-// tryDispose( xCC, "remote context" );
}
catch( uno::Exception& e )
@@ -307,3 +300,5 @@ int main( int argv, char** argc )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 290b34a949ca..59bf41d21cd1 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,11 +28,14 @@
#include <stdio.h>
+#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
+#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
#include <com/sun/star/sheet/XSpreadsheetView.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <ooo/vba/excel/XlCalculation.hpp>
+#include <ooo/vba/excel/XlCutCopyMode.hpp>
#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
#include <com/sun/star/sheet/XCalculatable.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -40,6 +44,17 @@
#include <ooo/vba/excel/XlMousePointer.hpp>
#include <com/sun/star/sheet/XNamedRanges.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include<ooo/vba/XCommandBars.hpp>
+#include <ooo/vba/excel/XlEnableCancelKey.hpp>
+#include <ooo/vba/excel/XlApplicationInternational.hpp>
+#include <unotools/localedatawrapper.hxx>
#include "vbaapplication.hxx"
#include "vbaworkbooks.hxx"
@@ -51,26 +66,38 @@
#include "vbawindow.hxx"
#include "vbawindows.hxx"
#include "vbaglobals.hxx"
+#include "vbamenubars.hxx"
#include "tabvwsh.hxx"
#include "gridwin.hxx"
#include "vbanames.hxx"
#include <vbahelper/vbashape.hxx>
#include "vbatextboxshape.hxx"
#include "vbaassistant.hxx"
+#include "vbafilesearch.hxx" // add the support of VBA Application.FileSearch
#include "sc.hrc"
+#include "macromgr.hxx"
+#include "global.hxx"
+#include "scmod.hxx"
+#include "docoptio.hxx"
+#include "appoptio.hxx"
#include <osl/file.hxx>
#include <rtl/instance.hxx>
+#include <map>
+
#include <sfx2/request.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/app.hxx>
+#include <comphelper/processfactory.hxx>
+
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
+#include <tools/urlobj.hxx>
#include <docuno.hxx>
@@ -79,15 +106,29 @@
#include <basic/sbuno.hxx>
#include <basic/sbmeth.hxx>
+#include "transobj.hxx"
#include "convuno.hxx"
#include "cellsuno.hxx"
+#include "miscuno.hxx"
+#include "unonames.hxx"
#include "docsh.hxx"
#include <vbahelper/helperdecl.hxx>
#include "excelvbahelper.hxx"
+#include <basic/sbmeth.hxx>
+#include <basic/sbmod.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/sbx.hxx>
+#include <basic/sbxobj.hxx>
+#include <basic/sbuno.hxx>
+#include "vbafiledialog.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::rtl::OUString;
// #TODO is this defined somewhere else?
#if ( defined UNX ) || ( defined OS2 ) //unix
@@ -142,11 +183,6 @@ ScVbaApplication::~ScVbaApplication()
{
}
-/*static*/ bool ScVbaApplication::getDocumentEventsEnabled()
-{
- return ScVbaStaticAppSettings::get().mbEnableEvents;
-}
-
SfxObjectShell* ScVbaApplication::GetDocShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
return static_cast< SfxObjectShell* >( excel::getDocShell( xModel ) );
@@ -264,16 +300,48 @@ ScVbaApplication::getAssistant() throw (uno::RuntimeException)
return uno::Reference< XAssistant >( new ScVbaAssistant( this, mxContext ) );
}
+// add support of VBA Application.FileSearch
+uno::Reference< XFileSearch > SAL_CALL
+ScVbaApplication::getFileSearch() throw (uno::RuntimeException)
+{
+ if (! m_xFileSearch.get() )
+ {
+ m_xFileSearch = uno::Reference< XFileSearch >( new ScVbaFileSearch( this, uno::Reference< XHelperInterface >( this ), mxContext ) );
+ }
+
+ return m_xFileSearch;
+}
+
uno::Any SAL_CALL
ScVbaApplication::getSelection() throw (uno::RuntimeException)
{
OSL_TRACE("** ScVbaApplication::getSelection() ** ");
uno::Reference< frame::XModel > xModel( getCurrentDocument() );
- uno::Reference< lang::XServiceInfo > xServiceInfo( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
- rtl::OUString sImpementaionName = xServiceInfo->getImplementationName();
- if( sImpementaionName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") )
+
+ Reference< view::XSelectionSupplier > xSelSupp( xModel->getCurrentController(), UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xPropSet( xSelSupp, UNO_QUERY_THROW );
+ OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_FILTERED_RANGE_SELECTION ) );
+ uno::Any aOldVal = xPropSet->getPropertyValue( aPropName );
+ uno::Any any;
+ any <<= false;
+ xPropSet->setPropertyValue( aPropName, any );
+ uno::Reference< uno::XInterface > aSelection = ScUnoHelpFunctions::AnyToInterface(
+ xSelSupp->getSelection() );
+ xPropSet->setPropertyValue( aPropName, aOldVal );
+
+ if (!aSelection.is())
{
- uno::Reference< drawing::XShapes > xShapes( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("failed to obtain current selection")),
+ uno::Reference< uno::XInterface >() );
+ }
+
+ uno::Reference< lang::XServiceInfo > xServiceInfo( aSelection, uno::UNO_QUERY_THROW );
+ rtl::OUString sImplementationName = xServiceInfo->getImplementationName();
+
+ if( sImplementationName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") )
+ {
+ uno::Reference< drawing::XShapes > xShapes( aSelection, uno::UNO_QUERY_THROW );
uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW );
uno::Reference< drawing::XShape > xShape( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
// if ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape
@@ -289,13 +357,13 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException)
}
return uno::makeAny( uno::Reference< msforms::XShape >(new ScVbaShape( this, mxContext, xShape, xShapes, xModel, ScVbaShape::getType( xShape ) ) ) );
}
- else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRange")) ||
- xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRanges")))
+ else if( xServiceInfo->supportsService( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SheetCellRange")) ) ||
+ xServiceInfo->supportsService( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SheetCellRanges")) ) )
{
- uno::Reference< table::XCellRange > xRange( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY);
+ uno::Reference< table::XCellRange > xRange( aSelection, ::uno::UNO_QUERY);
if ( !xRange.is() )
{
- uno::Reference< sheet::XSheetCellRangeContainer > xRanges( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY);
+ uno::Reference< sheet::XSheetCellRangeContainer > xRanges( aSelection, ::uno::UNO_QUERY);
if ( xRanges.is() )
return uno::makeAny( uno::Reference< excel::XRange >( new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), mxContext, xRanges ) ) );
@@ -304,7 +372,8 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException)
}
else
{
- throw uno::RuntimeException( sImpementaionName + rtl::OUString::createFromAscii(" not suported"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( sImplementationName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ " not supported")), uno::Reference< uno::XInterface >() );
}
}
@@ -315,10 +384,10 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException )
uno::Reference< table::XCellRange > xRange( xView->getActiveSheet(), ::uno::UNO_QUERY_THROW);
ScTabViewShell* pViewShell = excel::getCurrentBestViewShell(mxContext);
if ( !pViewShell )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("No ViewShell available"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No ViewShell available")), uno::Reference< uno::XInterface >() );
ScViewData* pTabView = pViewShell->GetViewData();
if ( !pTabView )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("No ViewData available"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No ViewData available")), uno::Reference< uno::XInterface >() );
sal_Int32 nCursorX = pTabView->GetCurX();
sal_Int32 nCursorY = pTabView->GetCurY();
@@ -350,8 +419,8 @@ ScVbaApplication::Worksheets( const uno::Any& aIndex ) throw (uno::RuntimeExcept
else
// Fixme - check if this is reasonable/desired behavior
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "No ActiveWorkBook available" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No ActiveWorkBook available" )),
+ uno::Reference< uno::XInterface >() );
return result;
}
@@ -394,16 +463,67 @@ ScVbaApplication::getActiveWindow() throw (uno::RuntimeException)
uno::Any SAL_CALL
ScVbaApplication::getCutCopyMode() throw (uno::RuntimeException)
{
- //# FIXME TODO, implementation
uno::Any result;
- result <<= sal_False;
+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( NULL );
+ ScDocument* pDoc = pOwnClip ? pOwnClip->GetDocument() : NULL;
+ if ( pDoc )
+ {
+ if ( pDoc->IsCutMode() )
+ {
+ result <<= excel::XlCutCopyMode::xlCut;
+ }
+ else
+ {
+ result <<= excel::XlCutCopyMode::xlCopy;
+ }
+ }
+ else
+ {
+ result <<= false;
+ }
return result;
}
void SAL_CALL
-ScVbaApplication::setCutCopyMode( const uno::Any& /*_cutcopymode*/ ) throw (uno::RuntimeException)
+ScVbaApplication::setCutCopyMode( const uno::Any& _cutcopymode ) throw (uno::RuntimeException)
{
- //# FIXME TODO, implementation
+ // According to Excel's behavior, no matter what is the value of _cutcopymode, always releases the clip object.
+ sal_Bool bCutCopyMode = false;
+ if ( ( _cutcopymode >>= bCutCopyMode ) )
+ {
+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( NULL );
+ if ( pOwnClip )
+ {
+ pOwnClip->ObjectReleased();
+ ScTabViewShell* pTabViewShell = excel::getBestViewShell( getCurrentDocument() );
+ if ( pTabViewShell )
+ {
+ ScViewData* pView = pTabViewShell->GetViewData();
+ Window* pWindow = pView ? pView->GetActiveWin() : NULL;
+ if ( pWindow )
+ {
+ Reference< datatransfer::clipboard::XClipboard > xClipboard = pWindow->GetClipboard();
+ Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( xClipboard, uno::UNO_QUERY );
+ if ( xClipboard.is() )
+ {
+ xClipboard->setContents( NULL, NULL );
+ if ( xFlushableClipboard.is() )
+ {
+ const sal_uInt32 nRef = Application::ReleaseSolarMutex();
+ try
+ {
+ xFlushableClipboard->flushClipboard();
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ Application::AcquireSolarMutex( nRef );
+ }
+ }
+ }
+ }
+ }
+ }
}
uno::Any SAL_CALL
@@ -416,7 +536,7 @@ void SAL_CALL
ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) throw (uno::RuntimeException)
{
rtl::OUString sText;
- sal_Bool bDefault = sal_False;
+ sal_Bool bDefault = false;
uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
uno::Reference< task::XStatusIndicatorSupplier > xStatusIndicatorSupplier( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
uno::Reference< task::XStatusIndicator > xStatusIndicator( xStatusIndicatorSupplier->getStatusIndicator(), uno::UNO_QUERY_THROW );
@@ -430,14 +550,14 @@ ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) throw (uno::Runtime
}
else if( _statusbar >>= bDefault )
{
- if( bDefault == sal_False )
+ if( bDefault == false )
{
xStatusIndicator->end();
setDisplayStatusBar( sal_True );
}
}
else
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid prarameter. It should be a string or False" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid prarameter. It should be a string or False" )),
uno::Reference< uno::XInterface >() );
}
@@ -460,7 +580,7 @@ ScVbaApplication::setCalculation( ::sal_Int32 _calculation ) throw (uno::Runtime
switch(_calculation)
{
case excel::XlCalculation::xlCalculationManual:
- xCalc->enableAutomaticCalculation(sal_False);
+ xCalc->enableAutomaticCalculation(false);
break;
case excel::XlCalculation::xlCalculationAutomatic:
case excel::XlCalculation::xlCalculationSemiautomatic:
@@ -508,7 +628,9 @@ ScVbaApplication::Names( const css::uno::Any& aIndex ) throw ( uno::RuntimeExcep
{
uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("NamedRanges")) , uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "NamedRanges" )) ), uno::UNO_QUERY_THROW );
+
css::uno::Reference< excel::XNames > xNames ( new ScVbaNames( this , mxContext , xNamedRanges , xModel ) );
if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID )
{
@@ -536,8 +658,8 @@ ScVbaApplication::getActiveSheet() throw (uno::RuntimeException)
if ( !result.is() )
{
// Fixme - check if this is reasonable/desired behavior
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "No activeSheet available" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No activeSheet available" )),
+ uno::Reference< uno::XInterface >() );
}
return result;
@@ -557,18 +679,18 @@ void SAL_CALL
ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) throw (uno::RuntimeException)
{
//test Scroll is a boolean
- sal_Bool bScroll = sal_False;
+ sal_Bool bScroll = false;
//R1C1-style string or a string of procedure name.
if( Scroll.hasValue() )
{
- sal_Bool aScroll = sal_False;
+ sal_Bool aScroll = false;
if( Scroll >>= aScroll )
{
bScroll = aScroll;
}
else
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "sencond parameter should be boolean" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "second parameter should be boolean" )),
uno::Reference< uno::XInterface >() );
}
@@ -610,11 +732,11 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro
{
//maybe this should be a procedure name
//TODO for procedure name
- //browse::XBrowseNodeFactory is a singlton. OUString::createFromAscii( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory")
+ //browse::XBrowseNodeFactory is a singlton. OUString(RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory"))
//and the createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) to get a root browse::XBrowseNode.
//for query XInvocation interface.
//but how to directly get the XInvocation?
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "invalid reference for range name, it should be procedure name" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid reference for range name, it should be procedure name" )),
uno::Reference< uno::XInterface >() );
}
return;
@@ -649,7 +771,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro
}
return;
}
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "invalid reference or name" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid reference or name" )),
uno::Reference< uno::XInterface >() );
}
@@ -684,7 +806,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException)
case excel::XlMousePointer::xlNorthwestArrow:
{
const Pointer& rPointer( POINTER_ARROW );
- setCursorHelper( xModel, rPointer, sal_False );
+ setCursorHelper( xModel, rPointer, false );
break;
}
case excel::XlMousePointer::xlWait:
@@ -698,7 +820,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException)
case excel::XlMousePointer::xlDefault:
{
const Pointer& rPointer( POINTER_NULL );
- setCursorHelper( xModel, rPointer, sal_False );
+ setCursorHelper( xModel, rPointer, false );
break;
}
default:
@@ -753,6 +875,90 @@ ScVbaApplication::getEnableEvents() throw (uno::RuntimeException)
return mrAppSettings.mbEnableEvents;
}
+sal_Bool SAL_CALL
+ScVbaApplication::getVisible() throw (uno::RuntimeException)
+{
+ sal_Bool bVisible = sal_True;
+ return bVisible;
+}
+
+void SAL_CALL
+ScVbaApplication::setVisible(sal_Bool /*bVisible*/) throw (uno::RuntimeException)
+{
+}
+
+//add the support of Excel VBA Application.Iteration
+//The Excel Iteration option is global and unique, but in Symphony there is an Iteration property in ScModule and one in every ScDocument,
+//so the set method will set all the Iteration properties
+sal_Bool SAL_CALL
+ScVbaApplication::getIteration() throw (uno::RuntimeException)
+{
+ ScModule* pScMod = SC_MOD();
+ ScDocOptions aDocOpt = pScMod->GetDocOptions();
+
+ return aDocOpt.IsIter();
+}
+
+void SAL_CALL
+ScVbaApplication::setIteration(sal_Bool bIteration) throw (uno::RuntimeException)
+{
+ ScModule* pScMod = SC_MOD();
+ ScDocOptions& aDocOpt = const_cast< ScDocOptions& > (pScMod->GetDocOptions());
+ aDocOpt.SetIter( bIteration );
+
+ uno::Any aIteration;
+ aIteration <<= bIteration;
+
+ OUString aPropName(RTL_CONSTASCII_USTRINGPARAM( "IsIterationEnabled" ));
+
+ uno::Reference< XCollection > xWorkbooks( new ScVbaWorkbooks( this, mxContext ) );
+ sal_Int32 nCount = xWorkbooks->getCount();
+
+ for (sal_Int32 i = 1; i <= nCount; i++)
+ {
+ uno::Reference< ooo::vba::excel::XWorkbook > xWorkbook;
+ uno::Any aWorkbook = xWorkbooks->Item(uno::makeAny(i), uno::Any());
+ aWorkbook >>= xWorkbook;
+ ScVbaWorkbook* pWorkbook = static_cast< ScVbaWorkbook* > ( xWorkbook.get() );
+
+ uno::Reference< frame::XModel > xModel( pWorkbook->getDocModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
+ xPropertySet->setPropertyValue( aPropName, aIteration );
+ }
+}
+
+//add the support of Excel VBA Application.EnableCancelKey
+sal_Int32 SAL_CALL
+ScVbaApplication::getEnableCancelKey() throw (uno::RuntimeException)
+{
+ return ooo::vba::excel::XlEnableCancelKey::xlDisabled;
+}
+
+void SAL_CALL
+ScVbaApplication::setEnableCancelKey(sal_Int32 /*lEnableCancelKey*/) throw (uno::RuntimeException)
+{
+}
+
+sal_Int32 SAL_CALL ScVbaApplication::getSheetsInNewWorkbook() throw (uno::RuntimeException)
+{
+ const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
+ return rAppOpt.GetTabCountInNewSpreadsheet();
+}
+
+void SAL_CALL ScVbaApplication::setSheetsInNewWorkbook( sal_Int32 SheetsInNewWorkbook ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ if ( SheetsInNewWorkbook < 1 || SheetsInNewWorkbook > MAXTAB )
+ {
+ DebugHelper::exception( OUString(RTL_CONSTASCII_USTRINGPARAM("The number must be between 1 and 255")),
+ uno::Exception(), SbERR_METHOD_FAILED, OUString() );
+ }
+ else
+ {
+ ScAppOptions& rAppOpt = const_cast< ScAppOptions& >(SC_MOD()->GetAppOptions());
+ rAppOpt.SetTabCountInNewSpreadsheet( SheetsInNewWorkbook );
+ }
+}
+
void SAL_CALL
ScVbaApplication::Calculate() throw( script::BasicErrorException , uno::RuntimeException )
{
@@ -767,7 +973,7 @@ uno::Reference< beans::XPropertySet > lcl_getPathSettingsService( const uno::Ref
if ( !xPathSettings.is() )
{
uno::Reference< lang::XMultiComponentFactory > xSMgr( xContext->getServiceManager(), uno::UNO_QUERY_THROW );
- xPathSettings.set( xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.util.PathSettings"), xContext), uno::UNO_QUERY_THROW );
+ xPathSettings.set( xSMgr->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings")), xContext ), uno::UNO_QUERY_THROW );
}
return xPathSettings;
}
@@ -989,12 +1195,12 @@ uno::Reference< excel::XRange > lclCreateVbaRange(
for( ListOfScRange::const_iterator aIt = rList.begin(), aEnd = rList.end(); aIt != aEnd; ++aIt )
aCellRanges.Append( *aIt );
- if( aCellRanges.Count() == 1 )
+ if( aCellRanges.size() == 1 )
{
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.First() ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocShell, *aCellRanges.front() ) );
return new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), rxContext, xRange );
}
- if( aCellRanges.Count() > 1 )
+ if( aCellRanges.size() > 1 )
{
uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pDocShell, aCellRanges ) );
return new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), rxContext, xRanges );
@@ -1118,17 +1324,23 @@ ScVbaApplication::Volatile( const uno::Any& aVolatile ) throw ( uno::RuntimeExc
{
sal_Bool bVolatile = sal_True;
aVolatile >>= bVolatile;
+ SbMethod* pMeth = StarBASIC::GetActiveMethod();
+ if ( pMeth )
+ {
+ OSL_TRACE("ScVbaApplication::Volatile() In method ->%s<-", rtl::OUStringToOString( pMeth->GetName(), RTL_TEXTENCODING_UTF8 ).getStr() );
+ uno::Reference< frame::XModel > xModel( getCurrentDocument() );
+ ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
+ pDoc->GetMacroManager()->SetUserFuncVolatile( pMeth->GetName(), bVolatile);
+ }
+
+// this is bound to break when loading the document
return;
}
-void SAL_CALL
-ScVbaApplication::DoEvents() throw ( uno::RuntimeException )
-{
-}
::sal_Bool SAL_CALL
ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException )
{
- sal_Bool bRes = sal_False;
+ sal_Bool bRes = false;
ScTabViewShell* pViewShell = excel::getCurrentBestViewShell( mxContext );
if ( pViewShell )
{
@@ -1138,7 +1350,7 @@ ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException )
pViewShell->GetState( reqList );
const SfxPoolItem *pItem=0;
- if ( reqList.GetItemState( FID_TOGGLEINPUTLINE, sal_False, &pItem ) == SFX_ITEM_SET )
+ if ( reqList.GetItemState( FID_TOGGLEINPUTLINE, false, &pItem ) == SFX_ITEM_SET )
bRes = ((SfxBoolItem*)pItem)->GetValue();
}
return bRes;
@@ -1174,12 +1386,420 @@ ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeExcep
return aRet;
}
+uno::Any SAL_CALL
+ScVbaApplication::GetOpenFilename(const uno::Any& FileFilter, const uno::Any& FilterIndex, const uno::Any& Title, const uno::Any& ButtonText, const uno::Any& MultiSelect) throw (uno::RuntimeException)
+{
+ uno::Any aRet = uno::makeAny( false );
+ try
+ {
+ const rtl::OUString sServiceName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ));
+ uno::Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
+ // Set the type of File Picker Dialog: TemplateDescription::FILEOPEN_SIMPLE.
+ uno::Sequence< uno::Any > aDialogType( 1 );
+ aDialogType[0] <<= ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
+ uno::Reference< ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY );
+ uno::Reference< ui::dialogs::XFilePicker2 > xFilePicker2( xFilePicker, UNO_QUERY );
+ uno::Reference< ui::dialogs::XFilterManager > xFilterManager( xFilePicker, UNO_QUERY );
+ uno::Reference< ui::dialogs::XExecutableDialog > xExecutableDialog( xFilePicker, UNO_QUERY );
+ uno::Reference< ui::dialogs::XFilePickerControlAccess > xPickerControlAccess( xFilePicker, UNO_QUERY );
+
+ if ( xFilterManager.is() && FileFilter.hasValue() )
+ {
+ sal_Int32 nFilterIndex = 1;
+ if ( FilterIndex.hasValue() )
+ {
+ FilterIndex >>= nFilterIndex;
+ }
+ ::rtl::OUString strFilter;
+ FileFilter >>= strFilter;
+ sal_Int32 nCommaID = 0;
+ sal_Int32 nIndex = 1;
+ do
+ {
+ ::rtl::OUString aFilterTitleToken = strFilter.getToken( 0, ',' , nCommaID );
+ ::rtl::OUString aFilterToken;
+ if ( nCommaID >= 0 )
+ {
+ aFilterToken = strFilter.getToken( 0, ',' , nCommaID );
+ }
+ else if ( nCommaID < 0 && nIndex == 1 )
+ {
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid FileFilter format!" )),
+ uno::Reference< uno::XInterface >() );
+ }
+ xFilterManager->appendFilter( aFilterTitleToken, aFilterToken );
+ if ( nFilterIndex == nIndex )
+ {
+ xFilterManager->setCurrentFilter( aFilterTitleToken );
+ }
+ nIndex++;
+ } while ( nCommaID >= 0 );
+ }
+ if ( xExecutableDialog.is() && Title.hasValue() )
+ {
+ ::rtl::OUString sTitle;
+ Title >>= sTitle;
+ xExecutableDialog->setTitle( sTitle );
+ }
+ if ( xPickerControlAccess.is() && ButtonText.hasValue() )
+ {
+ ::rtl::OUString sButtonText;
+ ButtonText >>= sButtonText;
+ xPickerControlAccess->setLabel( ui::dialogs::CommonFilePickerElementIds::PUSHBUTTON_OK, sButtonText );
+ }
+ sal_Bool bMultiSelect = false;
+ if ( xFilePicker.is() && MultiSelect.hasValue() )
+ {
+ MultiSelect >>= bMultiSelect;
+ xFilePicker->setMultiSelectionMode( bMultiSelect );
+ }
+
+ if ( xFilePicker.is() && xFilePicker->execute() )
+ {
+ sal_Bool bUseXFilePicker2 = false;
+ uno::Reference< lang::XServiceInfo > xServiceInfo( xFilePicker, UNO_QUERY );
+ if ( xServiceInfo.is() )
+ {
+ rtl::OUString sImplName = xServiceInfo->getImplementationName();
+ if ( sImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.comp.fpicker.VistaFileDialog")) ||
+ sImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.ui.dialogs.SalGtkFilePicker")) )
+ {
+ bUseXFilePicker2 = sal_True;
+ }
+ }
+ uno::Sequence< rtl::OUString > aSelectedFiles;
+ if ( bUseXFilePicker2 && xFilePicker2.is() )
+ {
+ // On Linux, XFilePicker->getFiles() always return one selected file although we select more than one file, also on Vista
+ // XFilePicker->getFiles() does not work well too, so we call XFilePicker2->getSelectedFiles() to get selected files.
+ aSelectedFiles = xFilePicker2->getSelectedFiles();
+ }
+ else
+ {
+ // If only one file is selected, the first entry of the sequence contains the complete path/filename in URL format. If multiple files are selected,
+ // the first entry of the sequence contains the path in URL format, and the other entries contains the names of the selected files without path information.
+ uno::Sequence< rtl::OUString > aTmpFiles = xFilePicker->getFiles();
+ aSelectedFiles = aTmpFiles;
+ sal_Int32 iFileCount = aTmpFiles.getLength();
+ if ( iFileCount > 1 )
+ {
+ aSelectedFiles.realloc( iFileCount - 1 );
+ INetURLObject aPath( aTmpFiles[0] );
+ aPath.setFinalSlash();
+ for ( sal_Int32 i = 1; i < iFileCount; i++ )
+ {
+ if ( aTmpFiles[i].indexOf ('/') > 0 || aTmpFiles[i].indexOf ('\\') > 0 )
+ {
+ aSelectedFiles[i - 1] = aTmpFiles[i];
+ }
+ else
+ {
+ if ( i == 1 )
+ aPath.Append( aTmpFiles[i] );
+ else
+ aPath.setName( aTmpFiles[i] );
+ aSelectedFiles[i - 1] = aPath.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ }
+ }
+ }
+
+ sal_Int32 iFileCount = aSelectedFiles.getLength();
+ for ( sal_Int32 i = 0; i < iFileCount; i++ )
+ {
+ INetURLObject aObj( aSelectedFiles[i] );
+ if ( aObj.GetProtocol() == INET_PROT_FILE )
+ {
+ rtl::OUString aTemp = aObj.PathToFileName();
+ aSelectedFiles[i] = aTemp.getLength() > 0 ? aTemp : aSelectedFiles[i];
+ }
+ }
+ if ( bMultiSelect )
+ {
+ aRet = uno::makeAny( aSelectedFiles );
+ }
+ else if ( aSelectedFiles.getLength() > 0 && !bMultiSelect )
+ {
+ aRet = uno::makeAny( aSelectedFiles[0] );
+ }
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
+ }
+
+ return aRet;
+}
+
+::com::sun::star::uno::Reference< ::ooo::vba::XFileDialog > SAL_CALL
+ScVbaApplication::getFileDialog() throw (::com::sun::star::uno::RuntimeException)
+{
+ uno::Reference< XFileDialog > xFileDialogs( new ScVbaFileDialog( uno::Reference< XHelperInterface >( this ), mxContext, getCurrentDocument() ) );
+ return xFileDialogs;
+}
+
+typedef std::map< ::rtl::OUString, ::rtl::OUString > FileFilterMap;
+
+uno::Any SAL_CALL
+ScVbaApplication::GetSaveAsFilename( const ::com::sun::star::uno::Any& InitialFilename, const ::com::sun::star::uno::Any& FileFilter, const ::com::sun::star::uno::Any& FilterIndex, const ::com::sun::star::uno::Any& Title, const ::com::sun::star::uno::Any& ButtonText ) throw (::com::sun::star::uno::RuntimeException)
+{
+ uno::Any strRet;
+ try
+ {
+ const rtl::OUString sServiceName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ));
+ uno::Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
+
+ uno::Sequence< uno::Any > aDialogType( 1 );
+ aDialogType[0] <<= ui::dialogs::TemplateDescription::FILESAVE_SIMPLE;
+ uno::Reference< ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY );
+
+ if (InitialFilename.hasValue())
+ {
+ ::rtl::OUString strInitFileName;
+ InitialFilename >>= strInitFileName;
+ xFilePicker->setDefaultName(strInitFileName);
+ }
+
+ // Begin from 1.
+ sal_Int32 nFilterIndex = 1;
+ if (FilterIndex.hasValue())
+ {
+ FilterIndex >>= nFilterIndex;
+ }
+
+ uno::Reference< ui::dialogs::XFilterManager > xFilter( xFilePicker, UNO_QUERY );
+ FileFilterMap mFilterNameMap;
+ if (FileFilter.hasValue())
+ {
+ ::rtl::OUString strFilter;
+ sal_Int32 nCommaID = 0;
+ FileFilter >>= strFilter;
+
+ sal_Int32 nIndex = 1;
+ do
+ {
+ ::rtl::OUString aFilterTitleToken = strFilter.getToken( 0, ',' , nCommaID );
+ ::rtl::OUString aFilterToken;
+ if ( nCommaID >= 0 )
+ {
+ aFilterToken = strFilter.getToken( 0, ',' , nCommaID );
+ }
+ else if ( nCommaID < 0 && nIndex == 1 )
+ {
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid FileFilter format!" )),
+ uno::Reference< uno::XInterface >() );
+ }
+
+ FileFilterMap::const_iterator aIt = mFilterNameMap.find( aFilterTitleToken );
+ if ( aIt == mFilterNameMap.end() )
+ {
+ xFilter->appendFilter( aFilterTitleToken, aFilterToken );
+ if ( nFilterIndex == nIndex )
+ {
+ xFilter->setCurrentFilter( aFilterTitleToken );
+ }
+ nIndex++;
+ mFilterNameMap[aFilterTitleToken] = aFilterToken;
+ }
+ } while ( nCommaID >= 0 );
+ }
+
+ if (Title.hasValue())
+ {
+ ::rtl::OUString strTitle;
+ Title >>= strTitle;
+ uno::Reference< ::com::sun::star::ui::dialogs::XExecutableDialog> xExcTblDlg(xFilePicker, UNO_QUERY );
+ xExcTblDlg->setTitle(strTitle);
+ }
+
+ if (ButtonText.hasValue())
+ {
+ ::rtl::OUString strBttTxt;
+ ButtonText >>= strBttTxt;
+ }
+
+
+ if ( xFilePicker.is() )
+ {
+ sal_Int16 nRet = xFilePicker->execute();
+ if (nRet == 0)
+ {
+ strRet <<= false;
+ }
+ else
+ {
+ uno::Sequence < rtl::OUString > aPathSeq = xFilePicker->getFiles();
+
+ if ( aPathSeq.getLength() )
+ {
+ ::rtl::OUString sSelectedFilters;
+ if ( xFilter.is() )
+ {
+ ::rtl::OUString sSelectedFilterName = xFilter->getCurrentFilter();
+ FileFilterMap::const_iterator aIt = mFilterNameMap.find( sSelectedFilterName );
+ if ( aIt != mFilterNameMap.end() )
+ {
+ sSelectedFilters = aIt->second;
+ }
+ }
+ INetURLObject aURLObj( aPathSeq[0] );
+ ::rtl::OUString aPathStr = aURLObj.PathToFileName();
+ if ( aURLObj.GetProtocol() == INET_PROT_FILE )
+ {
+ sal_Int32 nSemicolonID = 0;
+ ::rtl::OUString sFirstFilter = sSelectedFilters.getToken( 0, ';' , nSemicolonID );
+ ::rtl::OUString sFileExtension = aURLObj.GetExtension();
+ if ( sFileExtension.getLength() == 0 )
+ {
+ sFileExtension = sFirstFilter.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*.*")) ? sFileExtension : sFirstFilter.copy( sFirstFilter.indexOfAsciiL("*.", 2) + 2 );
+ aPathStr = sFileExtension.getLength() == 0 ? aPathStr : aPathStr + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")) + sFileExtension;
+ }
+ else
+ {
+ sal_Bool bValidFilter = false;
+ FileFilterMap::const_iterator aIt = mFilterNameMap.begin();
+ while ( aIt != mFilterNameMap.end() )
+ {
+ sSelectedFilters = aIt->second;
+ nSemicolonID = 0;
+ do
+ {
+ ::rtl::OUString aFilterToken = sSelectedFilters.getToken( 0, ';' , nSemicolonID );
+ if ( aFilterToken.trim().equalsIgnoreAsciiCase( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*.")) + sFileExtension) )
+ {
+ bValidFilter = sal_True;
+ break;
+ }
+ } while ( nSemicolonID >= 0 );
+ if ( bValidFilter )
+ {
+ break;
+ }
+ aIt++;
+ }
+ if ( !bValidFilter )
+ {
+ sFileExtension = sFirstFilter.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*.*")) ? rtl::OUString()
+ : sFirstFilter.copy( sFirstFilter.indexOfAsciiL("*.", 2) + 2 );
+ aPathStr = sFileExtension.getLength() == 0 ? aPathStr
+ : aPathStr + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")) + sFileExtension;
+ }
+ }
+ }
+ strRet <<= aPathStr;
+ }
+ }
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
+ }
+ return strRet;
+}
+
+//end add
+
uno::Reference< frame::XModel >
ScVbaApplication::getCurrentDocument() throw (css::uno::RuntimeException)
{
return getCurrentExcelDoc(mxContext);
}
+uno::Any SAL_CALL
+ScVbaApplication::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
+{
+ uno::Reference< XCommandBars > xCommandBars( CommandBars( uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< XCollection > xMenuBars( new ScVbaMenuBars( this, mxContext, xCommandBars ) );
+ if ( aIndex.hasValue() )
+ {
+ return uno::Any ( xMenuBars->Item( aIndex, uno::Any() ) );
+ }
+
+ return uno::Any( xMenuBars );
+}
+
+//add the support of Application.International
+sal_Int32 SAL_CALL
+ConvertCountryCode(const OUString& language)
+{
+ sal_Int32 nCode = 0;
+
+ if( language == OUString(RTL_CONSTASCII_USTRINGPARAM("ar")) ) nCode = 966; // Arabic
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("cs")) ) nCode = 42; // Czech
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("da")) ) nCode = 45; // Danish
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("de")) ) nCode = 49; // German
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("en")) ) nCode = 1; // English
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("es")) ) nCode = 34; // Spanish
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("el")) ) nCode = 30; // Greek
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("fa")) ) nCode = 98; // Persian = Farsi
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("fi")) ) nCode = 358; // Finnish
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("fr")) ) nCode = 33; // French
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("he")) ) nCode = 972; // Hebrew
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("hi")) ) nCode = 91; // Indian = Hindi
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("hu")) ) nCode = 36; // Hungarian
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("it")) ) nCode = 39; // Italian
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("ja")) ) nCode = 81; // Japanese
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("ko")) ) nCode = 82; // Korean
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("nl")) ) nCode = 31; // Dutch
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("no")) ) nCode = 47; // Norwegian
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("pl")) ) nCode = 48; // Polish
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("pt")) ) nCode = 351; // Portuguese
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("ru")) ) nCode = 7; // Russian
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("sv")) ) nCode = 46; // Swedish
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("th")) ) nCode = 66; // Thai
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("tk")) ) nCode = 90; // Turkish
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("ur")) ) nCode = 92; // Urdu
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("vi")) ) nCode = 84; // Vietnamese
+ else if ( language == OUString(RTL_CONSTASCII_USTRINGPARAM("zh")) ) nCode = 86; // Simplified Chinese
+
+ return nCode;
+}
+
+uno::Any SAL_CALL
+ScVbaApplication::International( sal_Int32 Index ) throw (uno::RuntimeException)
+{
+ uno::Any aRet;
+ OUString str;
+ const LocaleDataWrapper* pLocaleData = ScGlobal::GetpLocaleData();
+ switch ( Index )
+ {
+ case excel::XlApplicationInternational::xlCountryCode:
+ aRet <<= ConvertCountryCode( pLocaleData->getLanguageCountryInfo().Language );
+ break;
+ case excel::XlApplicationInternational::xlDecimalSeparator:
+ str = pLocaleData->getNumDecimalSep();
+ aRet <<= str;
+ break;
+ case excel::XlApplicationInternational::xlDateSeparator:
+ str = pLocaleData->getDateSep();
+ aRet <<= str;
+ break;
+ default:
+ break;
+ }
+ return aRet;
+}
+
+void SAL_CALL ScVbaApplication::Undo( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ SfxAllItemSet reqList( SFX_APP()->GetPool() );
+ SfxRequest rReq(SID_UNDO, 0, reqList);
+ ScTabViewShell* pViewShell = excel::getCurrentBestViewShell( mxContext );
+
+ if (pViewShell != NULL)
+ {
+ pViewShell->ExecuteUndo(rReq);
+ }
+}
+
+double SAL_CALL ScVbaApplication::InchesToPoints( double Inches ) throw (uno::RuntimeException)
+{
+ // Convert a measurement from Inch to Point (1 inch = 72 points).
+ return MetricField::ConvertDoubleValue( Inches, 0, 0, FUNIT_INCH, FUNIT_POINT );
+}
+
rtl::OUString&
ScVbaApplication::getServiceImplName()
{
@@ -1208,3 +1828,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaApplication",
"ooo.vba.excel.Application" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx
index bb696c967a37..84816902088d 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,6 @@
#include <vbahelper/vbaapplicationbase.hxx>
#include <cppuhelper/implbase1.hxx>
-//typedef InheritedHelperInterfaceImpl1< ov::excel::XApplication > ScVbaApplication_BASE;
typedef cppu::ImplInheritanceHelper1< VbaApplicationBase, ov::excel::XApplication > ScVbaApplication_BASE;
struct ScVbaAppSettings;
@@ -48,6 +48,7 @@ private:
ScVbaAppSettings& mrAppSettings;
rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException );
+ css::uno::Reference< ov::XFileSearch > m_xFileSearch;
protected:
virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException);
@@ -93,6 +94,7 @@ public:
virtual void SAL_CALL setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( css::uno::RuntimeException );
virtual css::uno::Reference< ov::XAssistant > SAL_CALL getAssistant() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::XFileSearch > SAL_CALL getFileSearch() throw (css::uno::RuntimeException); // add the support of Application.FileSearch
virtual css::uno::Reference< ov::excel::XWorkbook > SAL_CALL getThisWorkbook() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Workbooks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
@@ -106,6 +108,17 @@ public:
virtual ::sal_Int32 SAL_CALL getCursor() throw (css::uno::RuntimeException);
virtual void SAL_CALL setCursor( ::sal_Int32 _cursor ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL getIteration() throw (css::uno::RuntimeException); // add the support of Iteration
+ virtual void SAL_CALL setIteration( sal_Bool bIteration ) throw (css::uno::RuntimeException); // add the support of Iteration
+ virtual sal_Int32 SAL_CALL getEnableCancelKey() throw (css::uno::RuntimeException); // add the support of EnableCancelKey
+ virtual void SAL_CALL setEnableCancelKey( sal_Int32 lEnableCancelKey ) throw (css::uno::RuntimeException); // add the support of EnableCancelKey
+
+ virtual sal_Int32 SAL_CALL getSheetsInNewWorkbook() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSheetsInNewWorkbook( sal_Int32 SheetsInNewWorkbook ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
virtual sal_Bool SAL_CALL getEnableEvents() throw (css::uno::RuntimeException);
virtual void SAL_CALL setEnableEvents( sal_Bool bEnable ) throw (css::uno::RuntimeException);
@@ -118,10 +131,19 @@ public:
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Volatile( const css::uno::Any& Volatile ) throw (css::uno::RuntimeException );
- virtual void SAL_CALL DoEvents() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Caller( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL GetOpenFilename( const css::uno::Any& FileFilter, const css::uno::Any& FilterIndex, const css::uno::Any& Title, const css::uno::Any& ButtonText, const css::uno::Any& MultiSelect ) throw (css::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::ooo::vba::XFileDialog > SAL_CALL getFileDialog() throw (::com::sun::star::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL International( sal_Int32 Index ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL GetSaveAsFilename( const ::com::sun::star::uno::Any& InitialFilename, const ::com::sun::star::uno::Any& FileFilter, const ::com::sun::star::uno::Any& FilterIndex, const ::com::sun::star::uno::Any& Title, const ::com::sun::star::uno::Any& ButtonText ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL Undo( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual double SAL_CALL InchesToPoints( double Inches ) throw (css::uno::RuntimeException);
+
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SC_VBA_APPLICATION_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaassistant.cxx b/sc/source/ui/vba/vbaassistant.cxx
index 51105d60b0d4..3c91b9cde00b 100644
--- a/sc/source/ui/vba/vbaassistant.cxx
+++ b/sc/source/ui/vba/vbaassistant.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,12 +38,12 @@ using namespace ooo::vba;
using namespace ooo::vba::office::MsoAnimationType;
-ScVbaAssistant::ScVbaAssistant( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext ): ScVbaAssistantImpl_BASE( xParent, xContext )
+ScVbaAssistant::ScVbaAssistant( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext ): ScVbaAssistantImpl_BASE( xParent, xContext ),
+m_sName( RTL_CONSTASCII_USTRINGPARAM( "Clippit" ) )
{
- m_bIsVisible = sal_False;
+ m_bIsVisible = false;
m_nPointsLeft = 795;
m_nPointsTop = 248;
- m_sName = rtl::OUString::createFromAscii( "Clippit" );
m_nAnimation = msoAnimationIdle;
}
@@ -65,7 +66,7 @@ sal_Bool SAL_CALL ScVbaAssistant::getOn() throw (uno::RuntimeException)
if( SvtHelpOptions().IsHelpAgentAutoStartMode() )
return sal_True;
else
- return sal_False;
+ return false;
}
void SAL_CALL ScVbaAssistant::setOn( sal_Bool bOn ) throw (uno::RuntimeException)
@@ -130,3 +131,5 @@ ScVbaAssistant::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaassistant.hxx b/sc/source/ui/vba/vbaassistant.hxx
index dbb95af4b689..8490927c3240 100644
--- a/sc/source/ui/vba/vbaassistant.hxx
+++ b/sc/source/ui/vba/vbaassistant.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ public:
};
#endif//SC_VBA_ASSISTANT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx
index d563ba105108..ae182c8a795e 100644
--- a/sc/source/ui/vba/vbaaxes.cxx
+++ b/sc/source/ui/vba/vbaaxes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,7 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno:
{
ScVbaChart* pChart = static_cast< ScVbaChart* >( xChart.get() );
if ( !pChart )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Object failure, can't access chart implementation" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Object failure, can't access chart implementation" )), uno::Reference< uno::XInterface >() );
uno::Reference< beans::XPropertySet > xAxisPropertySet;
if (((nType == xlCategory) || (nType == xlSeriesAxis) || (nType == xlValue)))
@@ -167,8 +168,8 @@ ScVbaAxes::Item( const css::uno::Any& _nType, const css::uno::Any& _oAxisGroup)
// bodgy helperapi port bits
sal_Int32 nAxisGroup = xlPrimary;
sal_Int32 nType = -1;
- if ( !_nType.hasValue() || ( ( _nType >>= nType ) == sal_False ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Axes::Item Failed to extract type" ), uno::Reference< uno::XInterface >() );
+ if ( !_nType.hasValue() || ( ( _nType >>= nType ) == false ) )
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Axes::Item Failed to extract type" )), uno::Reference< uno::XInterface >() );
if ( _oAxisGroup.hasValue() )
_oAxisGroup >>= nAxisGroup ;
@@ -201,3 +202,4 @@ ScVbaAxes::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxes.hxx b/sc/source/ui/vba/vbaaxes.hxx
index 5b5f88e2b72f..f135f8e65c71 100644
--- a/sc/source/ui/vba/vbaaxes.hxx
+++ b/sc/source/ui/vba/vbaaxes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ public:
};
#endif //SC_VBA_AXES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx
index a9c91a4cea31..3d599b25a599 100644
--- a/sc/source/ui/vba/vbaaxis.cxx
+++ b/sc/source/ui/vba/vbaaxis.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ ScVbaAxis::getChartPtr() throw( uno::RuntimeException )
{
ScVbaChart* pChart = static_cast< ScVbaChart* >( moChartParent.get() );
if ( !pChart )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Can't access parent chart impl"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't access parent chart impl")), uno::Reference< uno::XInterface >() );
return pChart;
}
@@ -60,7 +61,7 @@ ScVbaAxis::isValueAxis() throw( script::BasicErrorException )
return sal_True;
}
-ScVbaAxis::ScVbaAxis( const uno::Reference< XHelperInterface >& xParent,const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ) : ScVbaAxis_BASE( xParent, xContext ), mxPropertySet( _xPropertySet ), mnType( _nType ), mnGroup( _nGroup ), bCrossesAreCustomized( sal_False )
+ScVbaAxis::ScVbaAxis( const uno::Reference< XHelperInterface >& xParent,const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ) : ScVbaAxis_BASE( xParent, xContext ), mxPropertySet( _xPropertySet ), mnType( _nType ), mnGroup( _nGroup ), bCrossesAreCustomized( false )
{
oShapeHelper.reset( new ShapeHelper( uno::Reference< drawing::XShape >( mxPropertySet, uno::UNO_QUERY ) ) );
moChartParent.set( xParent, uno::UNO_QUERY_THROW );
@@ -131,23 +132,23 @@ ScVbaAxis::setCrosses( ::sal_Int32 _nCrosses ) throw (script::BasicErrorExceptio
{
case xlAxisCrossesAutomatic: //Microsoft Excel sets the axis crossing point.
mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny( sal_True ) );
- bCrossesAreCustomized = sal_False;
+ bCrossesAreCustomized = false;
return;
case xlAxisCrossesMinimum: // The axis crosses at the minimum value.
mxPropertySet->getPropertyValue(VBA_MIN) >>= fNum;
setCrossesAt( fNum );
- bCrossesAreCustomized = sal_False;
+ bCrossesAreCustomized = false;
break;
case xlAxisCrossesMaximum: // The axis crosses at the maximum value.
mxPropertySet->getPropertyValue(VBA_MAX) >>= fNum;
setCrossesAt(fNum);
- bCrossesAreCustomized = sal_False;
+ bCrossesAreCustomized = false;
break;
default: //xlAxisCrossesCustom
bCrossesAreCustomized = sal_True;
break;
}
- mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny(sal_False) );
+ mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny(false) );
}
catch (uno::Exception& )
{
@@ -160,7 +161,7 @@ ScVbaAxis::getCrosses( ) throw (script::BasicErrorException, uno::RuntimeExcept
sal_Int32 nCrosses = xlAxisCrossesCustom;
try
{
- sal_Bool bisAutoOrigin = sal_False;
+ sal_Bool bisAutoOrigin = false;
mxPropertySet->getPropertyValue(AUTOORIGIN) >>= bisAutoOrigin;
if (bisAutoOrigin)
nCrosses = xlAxisCrossesAutomatic;
@@ -172,7 +173,6 @@ ScVbaAxis::getCrosses( ) throw (script::BasicErrorException, uno::RuntimeExcept
{
double forigin = 0.0;
mxPropertySet->getPropertyValue(ORIGIN) >>= forigin;
-//obsolete double fmax = AnyConverter.toDouble(mxPropertySet.getPropertyValue("Max"));
double fmin = 0.0;
mxPropertySet->getPropertyValue(VBA_MIN) >>= fmin;
if (forigin == fmin)
@@ -194,11 +194,9 @@ ScVbaAxis::setCrossesAt( double _fCrossesAt ) throw (script::BasicErrorException
{
try
{
-// if (getCrosses() == xlAxisCrossesCustom){
- setMaximumScaleIsAuto( sal_False );
- setMinimumScaleIsAuto( sal_False );
+ setMaximumScaleIsAuto( false );
+ setMinimumScaleIsAuto( false );
mxPropertySet->setPropertyValue(ORIGIN, uno::makeAny(_fCrossesAt));
-// }
}
catch (uno::Exception& e)
{
@@ -262,7 +260,7 @@ ScVbaAxis::setHasTitle( ::sal_Bool _bHasTitle ) throw (script::BasicErrorExcepti
::sal_Bool SAL_CALL
ScVbaAxis::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- sal_Bool bHasTitle = sal_False;
+ sal_Bool bHasTitle = false;
try
{
ScVbaChart* pChart = getChartPtr();
@@ -333,7 +331,7 @@ ScVbaAxis::setMinorUnitIsAuto( ::sal_Bool _bMinorUnitIsAuto ) throw (script::Bas
::sal_Bool SAL_CALL
ScVbaAxis::getMinorUnitIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- sal_Bool bIsAuto = sal_False;
+ sal_Bool bIsAuto = false;
try
{
if (isValueAxis())
@@ -358,7 +356,7 @@ ScVbaAxis::setReversePlotOrder( ::sal_Bool /*ReversePlotOrder*/ ) throw (script:
ScVbaAxis::getReversePlotOrder( ) throw (script::BasicErrorException, uno::RuntimeException)
{
DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString());
- return sal_False;
+ return false;
}
void SAL_CALL
@@ -412,7 +410,7 @@ ScVbaAxis::setMajorUnitIsAuto( ::sal_Bool _bMajorUnitIsAuto ) throw (script::Bas
::sal_Bool SAL_CALL
ScVbaAxis::getMajorUnitIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- sal_Bool bIsAuto = sal_False;
+ sal_Bool bIsAuto = false;
try
{
if (isValueAxis())
@@ -481,7 +479,7 @@ ScVbaAxis::setMaximumScaleIsAuto( ::sal_Bool _bMaximumScaleIsAuto ) throw (scrip
::sal_Bool SAL_CALL
ScVbaAxis::getMaximumScaleIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- sal_Bool bIsAuto = sal_False;
+ sal_Bool bIsAuto = false;
try
{
if (isValueAxis())
@@ -543,7 +541,7 @@ ScVbaAxis::setMinimumScaleIsAuto( ::sal_Bool _bMinimumScaleIsAuto ) throw (scrip
::sal_Bool SAL_CALL
ScVbaAxis::getMinimumScaleIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- sal_Bool bIsAuto = sal_False;
+ sal_Bool bIsAuto = false;
try
{
if (isValueAxis())
@@ -574,7 +572,7 @@ ScVbaAxis::setScaleType( ::sal_Int32 _nScaleType ) throw (script::BasicErrorExce
switch (_nScaleType)
{
case xlScaleLinear:
- mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Logarithmic" ) ), uno::makeAny( sal_False ) );
+ mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Logarithmic" ) ), uno::makeAny( false ) );
break;
case xlScaleLogarithmic:
mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Logarithmic" ) ), uno::makeAny( sal_True ) );
@@ -599,7 +597,7 @@ ScVbaAxis::getScaleType( ) throw (script::BasicErrorException, uno::RuntimeExce
{
if (isValueAxis())
{
- sal_Bool bisLogarithmic = sal_False;
+ sal_Bool bisLogarithmic = false;
mxPropertySet->getPropertyValue( rtl::OUString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Logarithmic"))) ) >>= bisLogarithmic;
if (bisLogarithmic)
nScaleType = xlScaleLogarithmic;
@@ -668,3 +666,4 @@ ScVbaAxis::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxis.hxx b/sc/source/ui/vba/vbaaxis.hxx
index 13432b231a27..f5b22047d1b3 100644
--- a/sc/source/ui/vba/vbaaxis.hxx
+++ b/sc/source/ui/vba/vbaaxis.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,3 +97,5 @@ public:
};
#endif //SC_VBA_AXIS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxistitle.cxx b/sc/source/ui/vba/vbaaxistitle.cxx
index 89b12b6e2870..cc5b0d791b13 100644
--- a/sc/source/ui/vba/vbaaxistitle.cxx
+++ b/sc/source/ui/vba/vbaaxistitle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,4 @@ ScVbaAxisTitle::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaaxistitle.hxx b/sc/source/ui/vba/vbaaxistitle.hxx
index 59ba71d99a87..0360e40be4aa 100644
--- a/sc/source/ui/vba/vbaaxistitle.hxx
+++ b/sc/source/ui/vba/vbaaxistitle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 5424da041f84..7fbe157e2bdf 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,6 +27,7 @@
************************************************************************/
#include "vbaborders.hxx"
+#include <sal/macros.h>
#include <cppuhelper/implbase3.hxx>
#include <ooo/vba/excel/XlBordersIndex.hpp>
#include <ooo/vba/excel/XlBorderWeight.hpp>
@@ -34,7 +36,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
-
#include "vbapalette.hxx"
using namespace ::com::sun::star;
@@ -332,7 +333,7 @@ public:
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
{
- return sizeof( supportedIndexTable ) / sizeof( supportedIndexTable[0] );
+ return SAL_N_ELEMENTS( supportedIndexTable );
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -572,3 +573,5 @@ ScVbaBorders::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaborders.hxx b/sc/source/ui/vba/vbaborders.hxx
index a385ad2e7a14..0164328a9e83 100644
--- a/sc/source/ui/vba/vbaborders.hxx
+++ b/sc/source/ui/vba/vbaborders.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@ public:
#endif //SC_VBA_BORDERS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacharacters.cxx b/sc/source/ui/vba/vbacharacters.cxx
index 6c0079ac7a82..2b163afc2a74 100644
--- a/sc/source/ui/vba/vbacharacters.cxx
+++ b/sc/source/ui/vba/vbacharacters.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,8 +47,8 @@ ScVbaCharacters::ScVbaCharacters( const uno::Reference< XHelperInterface >& xPar
{
if ( ( nStart + 1 ) > m_xSimpleText->getString().getLength() )
//nStart = m_xSimpleText->getString().getLength();
- xTextCursor->gotoEnd( sal_False );
- xTextCursor->goRight( nStart, sal_False );
+ xTextCursor->gotoEnd( false );
+ xTextCursor->goRight( nStart, false );
}
if ( nLength < 0 ) // expand to end
xTextCursor->gotoEnd( sal_True );
@@ -134,3 +135,4 @@ ScVbaCharacters::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacharacters.hxx b/sc/source/ui/vba/vbacharacters.hxx
index 3400ff159d5e..b9711fcb86df 100644
--- a/sc/source/ui/vba/vbacharacters.hxx
+++ b/sc/source/ui/vba/vbacharacters.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,7 @@ private:
// Add becuase of MSO has diferent behavior.
sal_Bool bReplace;
public:
- ScVbaCharacters( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, const css::uno::Reference< css::text::XSimpleText >& xRange, const css::uno::Any& Start, const css::uno::Any& Length, sal_Bool bReplace = sal_False ) throw ( css::lang::IllegalArgumentException );
+ ScVbaCharacters( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, const css::uno::Reference< css::text::XSimpleText >& xRange, const css::uno::Any& Start, const css::uno::Any& Length, sal_Bool bReplace = false ) throw ( css::lang::IllegalArgumentException );
virtual ~ScVbaCharacters() {}
// Attributes
@@ -73,3 +74,4 @@ public:
#endif /* SC_VBA_CHARACTER_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx
index e2f446f93f2b..16893723a19a 100644
--- a/sc/source/ui/vba/vbachart.cxx
+++ b/sc/source/ui/vba/vbachart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,7 +96,7 @@ ScVbaChart::getName() throw (css::uno::RuntimeException)
{
xProps->getPropertyValue( CHART_NAME ) >>= sName;
}
- catch( uno::Exception e ) // swallow exceptions
+ catch( uno::Exception & ) // swallow exceptions
{
}
return sName;
@@ -165,7 +166,7 @@ ScVbaChart::getChartType() throw ( uno::RuntimeException, script::BasicErrorExce
}
else if (sDiagramType.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart.StockDiagram"))))
{
- sal_Bool bVolume = sal_False;
+ sal_Bool bVolume = false;
mxDiagramPropertySet->getPropertyValue(VOLUME) >>= bVolume;
if (bVolume)
{
@@ -178,7 +179,7 @@ ScVbaChart::getChartType() throw ( uno::RuntimeException, script::BasicErrorExce
}
else if (sDiagramType.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart.XYDiagram"))))
{
- sal_Bool bHasLines = sal_False;
+ sal_Bool bHasLines = false;
mxDiagramPropertySet->getPropertyValue(LINES) >>= bHasLines;
sal_Int32 nSplineType = 0;
mxDiagramPropertySet->getPropertyValue(SPLINETYPE) >>= nSplineType;
@@ -330,7 +331,7 @@ try
case xlXYScatter:
case xlBubble: // not possible
case xlBubble3DEffect: // not possible
- mxDiagramPropertySet->setPropertyValue(LINES, uno::makeAny( sal_False ));
+ mxDiagramPropertySet->setPropertyValue(LINES, uno::makeAny( false ));
break;
case xlXYScatterLines:
case xlXYScatterLinesNoMarkers:
@@ -384,7 +385,7 @@ try
default:
if (mxDiagramPropertySet->getPropertySetInfo()->hasPropertyByName(DEEP))
{
- mxDiagramPropertySet->setPropertyValue(DEEP, uno::makeAny( sal_False));
+ mxDiagramPropertySet->setPropertyValue(DEEP, uno::makeAny( false));
}
break;
}
@@ -454,7 +455,7 @@ try
default:
if (mxDiagramPropertySet->getPropertySetInfo()->hasPropertyByName(VERTICAL))
{
- mxDiagramPropertySet->setPropertyValue(VERTICAL, uno::makeAny(sal_False));
+ mxDiagramPropertySet->setPropertyValue(VERTICAL, uno::makeAny(false));
}
break;
}
@@ -475,7 +476,7 @@ try
case xlConeBarStacked:
case xlPyramidColStacked:
case xlPyramidBarStacked:
- mxDiagramPropertySet->setPropertyValue(PERCENT, uno::makeAny( sal_False ));
+ mxDiagramPropertySet->setPropertyValue(PERCENT, uno::makeAny( false ));
mxDiagramPropertySet->setPropertyValue(STACKED, uno::makeAny( sal_True ));
break;
case xlPyramidColStacked100:
@@ -496,8 +497,8 @@ try
mxDiagramPropertySet->setPropertyValue(PERCENT, uno::makeAny( sal_True ));
break;
default:
- mxDiagramPropertySet->setPropertyValue(PERCENT, uno::makeAny( sal_False));
- mxDiagramPropertySet->setPropertyValue(STACKED, uno::makeAny( sal_False));
+ mxDiagramPropertySet->setPropertyValue(PERCENT, uno::makeAny( false));
+ mxDiagramPropertySet->setPropertyValue(STACKED, uno::makeAny( false));
break;
}
switch (_nChartType)
@@ -541,7 +542,7 @@ try
default:
if (mxDiagramPropertySet->getPropertySetInfo()->hasPropertyByName(DIM3D))
{
- mxDiagramPropertySet->setPropertyValue(DIM3D, uno::makeAny( sal_False));
+ mxDiagramPropertySet->setPropertyValue(DIM3D, uno::makeAny( false));
}
break;
}
@@ -582,8 +583,8 @@ ScVbaChart::setSourceData( const css::uno::Reference< ::ooo::vba::excel::XRange
mxTableChart->setRanges(mRangeAddresses);
- sal_Bool bsetRowHeaders = sal_False;
- sal_Bool bsetColumnHeaders = sal_False;
+ sal_Bool bsetRowHeaders = false;
+ sal_Bool bsetColumnHeaders = false;
ScVbaRange* pRange = static_cast< ScVbaRange* >( _xCalcRange.get() );
if ( pRange )
@@ -821,7 +822,7 @@ ScVbaChart::setLocation( ::sal_Int32 /*where*/, const css::uno::Any& /*Name*/ )
sal_Bool SAL_CALL
ScVbaChart::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- sal_Bool bHasTitle = sal_False;
+ sal_Bool bHasTitle = false;
try
{
mxChartPropertySet->getPropertyValue(HASMAINTITLE) >>= bHasTitle;
@@ -850,7 +851,7 @@ ScVbaChart::setHasTitle( ::sal_Bool bTitle ) throw (script::BasicErrorException,
::sal_Bool SAL_CALL
ScVbaChart::getHasLegend( ) throw (script::BasicErrorException, uno::RuntimeException)
{
- sal_Bool bHasLegend = sal_False;
+ sal_Bool bHasLegend = false;
try
{
mxChartPropertySet->getPropertyValue(HASLEGEND) >>= bHasLegend;
@@ -896,7 +897,7 @@ bool
ScVbaChart::is3D() throw ( uno::RuntimeException )
{
// #TODO perhaps provide limited Debughelper functionality
- sal_Bool is3d = sal_False;
+ sal_Bool is3d = false;
mxDiagramPropertySet->getPropertyValue(DIM3D) >>= is3d;
return is3d;
}
@@ -920,7 +921,7 @@ bool
ScVbaChart::isStacked() throw ( uno::RuntimeException )
{
// #TODO perhaps provide limited Debughelper functionality
- sal_Bool bStacked = sal_False;
+ sal_Bool bStacked = false;
mxDiagramPropertySet->getPropertyValue(STACKED) >>= bStacked;
return bStacked;
}
@@ -929,7 +930,7 @@ bool
ScVbaChart::is100PercentStacked() throw ( uno::RuntimeException )
{
// #TODO perhaps provide limited Debughelper functionality
- sal_Bool b100Percent = sal_False;
+ sal_Bool b100Percent = false;
mxDiagramPropertySet->getPropertyValue(PERCENT) >>= b100Percent;
return b100Percent;
}
@@ -970,7 +971,7 @@ ScVbaChart::getSolidType(sal_Int32 _nDeep, sal_Int32 _nVertiStacked, sal_Int32 _
sal_Int32
ScVbaChart::getStockUpDownValue(sal_Int32 _nUpDown, sal_Int32 _nNotUpDown) throw (script::BasicErrorException)
{
- sal_Bool bUpDown = sal_False;
+ sal_Bool bUpDown = false;
try
{
mxDiagramPropertySet->getPropertyValue(UPDOWN) >>= bUpDown;
@@ -1034,7 +1035,6 @@ ScVbaChart::isSeriesIndexValid(sal_Int32 _seriesindex) throw( script::BasicError
try
{
uno::Reference< chart::XChartDataArray > xChartDataArray( mxChartDocument->getData(), uno::UNO_QUERY_THROW );
- // dblValues = xChartDataArray.getData();
//TODO I guess we have to differentiate between XlRowCol
if ( !xChartDataArray.is() )
{
@@ -1073,126 +1073,6 @@ ScVbaChart::areIndicesValid( sal_Int32 _seriesindex, sal_Int32 _valindex) throw
return false;
}
-sal_Int32
-ScVbaChart::getSeriesIndex(rtl::OUString _sseriesname) throw ( script::BasicErrorException )
-{
- uno::Reference< chart::XChartDataArray > xChartDataArray( mxChartDocument->getData(), uno::UNO_QUERY_THROW );
- if (getPlotBy() == xlRows)
- return ContainerUtilities::FieldInList(xChartDataArray->getRowDescriptions(), _sseriesname);
- return ContainerUtilities::FieldInList(xChartDataArray->getColumnDescriptions(), _sseriesname);
-}
-void
-ScVbaChart::setSeriesName(sal_Int32 _index, rtl::OUString _sname) throw ( script::BasicErrorException )
-{
- uno::Reference< chart::XChartDataArray > xChartDataArray( mxChartDocument->getData(), uno::UNO_QUERY_THROW );
- if (isSeriesIndexValid(_index))
- {
- uno::Sequence< rtl::OUString > sDescriptions = xChartDataArray->getColumnDescriptions();
- sDescriptions[_index] = _sname;
- xChartDataArray->setColumnDescriptions(sDescriptions);
- }
-}
-
-sal_Int32
-ScVbaChart::getSeriesCount() throw ( script::BasicErrorException )
-{
- uno::Reference< chart::XChartDataArray > xChartDataArray( mxChartDocument->getData(), uno::UNO_QUERY_THROW );
-
- if (getPlotBy() == xlRows)
- return xChartDataArray->getRowDescriptions().getLength();
- return xChartDataArray->getColumnDescriptions().getLength();
-
-}
-
-rtl::OUString
-ScVbaChart::getSeriesName(sal_Int32 _index) throw ( script::BasicErrorException )
-{
- uno::Reference< chart::XChartDataArray > xChartDataArray( mxChartDocument->getData(), uno::UNO_QUERY_THROW );
- uno::Sequence< rtl::OUString > sDescriptions;
- rtl::OUString sName;
- if (isSeriesIndexValid(_index))
- {
- if (getPlotBy() == xlRows)
- sDescriptions = xChartDataArray->getRowDescriptions();
- else
- sDescriptions = xChartDataArray->getColumnDescriptions();
- sName = sDescriptions[_index];
- }
- return sName;
-}
-
-double
-ScVbaChart::getValue(sal_Int32 _seriesindex, sal_Int32 _valindex) throw ( script::BasicErrorException )
-{
- double result = -1.0;
- if (areIndicesValid(_seriesindex, _valindex))
- {
- if (getPlotBy() == xlRows)
- result = dblValues[_seriesindex][_valindex];
- else
- result = dblValues[_valindex][_seriesindex];
- }
- return result;
-}
-
-sal_Int32
-ScVbaChart::getValuesCount(sal_Int32 _seriesIndex) throw ( script::BasicErrorException )
-{
- sal_Int32 nCount = 0;
- uno::Reference< chart::XChartDataArray > xChartDataArray( mxChartDocument->getData(), uno::UNO_QUERY_THROW );
- if (isSeriesIndexValid(_seriesIndex))
- {
- dblValues = xChartDataArray->getData();
- if (getPlotBy() == xlRows)
- nCount = dblValues[_seriesIndex].getLength();
- else
- nCount = dblValues.getLength();
- }
- return nCount;
-}
-
-
-uno::Reference< excel::XDataLabels >
-ScVbaChart::DataLabels( const uno::Reference< ov::excel::XSeries > /*_oSeries*/ ) throw ( css::script::BasicErrorException )
-{
- if ( true )
- throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
- // #TODO #FIXE provide implementation
- return uno::Reference< excel::XDataLabels > ();
-}
-
-bool
-ScVbaChart::getHasDataCaption( const uno::Reference< css::beans::XPropertySet >& _xPropertySet )throw ( script::BasicErrorException )
-{
- bool bResult = false;
- try
- {
- sal_Int32 nChartDataCaption = 0;
- _xPropertySet->getPropertyValue(DATACAPTION) >>= nChartDataCaption;
- bResult = (nChartDataCaption != chart::ChartDataCaption::NONE);
- }
- catch (uno::Exception& )
- {
- throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
- }
- return bResult;
-}
-
-void
-ScVbaChart::setHasDataCaption( const uno::Reference< beans::XPropertySet >& _xPropertySet, bool _bHasDataLabels )throw ( script::BasicErrorException )
-{
- try
- {
- if ( _bHasDataLabels )
- _xPropertySet->setPropertyValue(DATACAPTION, uno::makeAny ( chart::ChartDataCaption::VALUE) );
- else
- _xPropertySet->setPropertyValue(DATACAPTION, uno::makeAny ( chart::ChartDataCaption::NONE) );
- }
- catch (uno::Exception& )
- {
- throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
- }
-}
uno::Reference< beans::XPropertySet >
ScVbaChart::getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup) throw ( script::BasicErrorException )
@@ -1212,13 +1092,8 @@ ScVbaChart::getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup) thro
}
break;
case xlSeriesAxis:
-// if (_nAxisGroup == xlPrimary){
xAxisProps = xAxisZSupplier->getZAxis();
break;
-// }
-// else if (_nAxisGroup == xlSecondary){
- // return xTwoAxisXSupplier.getSecondaryZAxis();
- // }
case xlValue:
if (_nAxisGroup == xlPrimary)
xAxisProps = xAxisYSupplier->getYAxis();
@@ -1251,3 +1126,4 @@ ScVbaChart::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachart.hxx b/sc/source/ui/vba/vbachart.hxx
index d0b53c34421f..f87ca4a04b9e 100644
--- a/sc/source/ui/vba/vbachart.hxx
+++ b/sc/source/ui/vba/vbachart.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,23 +69,13 @@ friend class ScVbaAxis;
bool hasMarkers() throw ( css::script::BasicErrorException );
sal_Int32 getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( css::script::BasicErrorException );
void assignDiagramAttributes();
- void setDefaultSeriesDescriptionLabels(){}
public:
ScVbaChart( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::lang::XComponent >& _xChartComponent, const css::uno::Reference< css::table::XTableChart >& _xTableChart );
// Non-interface
- css::uno::Reference< css::beans::XPropertySet > xDiagramPropertySet() { return mxDiagramPropertySet; }
+ css::uno::Reference< css::beans::XPropertySet > xDiagramPropertySet() const { return mxDiagramPropertySet; }
bool isSeriesIndexValid(sal_Int32 _seriesindex) throw( css::script::BasicErrorException );
bool areIndicesValid(sal_Int32 _seriesindex, sal_Int32 _valindex) throw ( css::script::BasicErrorException );
- void setSeriesName(sal_Int32 _index, rtl::OUString _sname) throw ( css::script::BasicErrorException );
- sal_Int32 getSeriesIndex(rtl::OUString _sseriesname) throw ( css::script::BasicErrorException );
- sal_Int32 getSeriesCount() throw ( css::script::BasicErrorException );
- rtl::OUString getSeriesName(sal_Int32 _index) throw ( css::script::BasicErrorException );
- double getValue(sal_Int32 _seriesIndex, sal_Int32 _valindex) throw ( css::script::BasicErrorException );
- sal_Int32 getValuesCount(sal_Int32 _seriesIndex) throw ( css::script::BasicErrorException );
- css::uno::Reference< ov::excel::XDataLabels > DataLabels( const css::uno::Reference< ov::excel::XSeries > _oSeries ) throw ( css::script::BasicErrorException );
- bool getHasDataCaption( const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet )throw ( css::script::BasicErrorException );
- void setHasDataCaption( const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet, bool _bHasDataLabels )throw ( css::script::BasicErrorException );
bool is3D() throw ( css::uno::RuntimeException );
css::uno::Reference< css::beans::XPropertySet > getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup) throw ( css::script::BasicErrorException );
// Methods
@@ -112,3 +103,5 @@ public:
};
#endif //SC_VBA_WINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx
index 617a090b6d7a..f1947608d07d 100644
--- a/sc/source/ui/vba/vbachartobject.cxx
+++ b/sc/source/ui/vba/vbachartobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -155,56 +156,4 @@ ScVbaChartObject::getServiceNames()
return aServiceNames;
}
-double
-ScVbaChartObject::getHeight()
-{
- return oShapeHelper->getHeight();
-}
-
-void
-ScVbaChartObject::setHeight(double _fheight) throw ( script::BasicErrorException )
-{
- oShapeHelper->setHeight(_fheight);
-}
-
-double
-ScVbaChartObject::getWidth()
-{
- return oShapeHelper->getWidth();
-}
-
-void
-ScVbaChartObject::setWidth(double _fWidth) throw ( script::BasicErrorException )
-{
- oShapeHelper->setWidth(_fWidth);
-}
-
-double
-ScVbaChartObject::getLeft()
-{
- return oShapeHelper->getLeft();
-}
-
-void
-ScVbaChartObject::setLeft(double _fLeft)
-{
- oShapeHelper->setLeft(_fLeft);
-}
-
-double
-ScVbaChartObject::getTop()
-{
- return oShapeHelper->getTop();
-}
-
-void
-ScVbaChartObject::setTop(double _fTop)
-{
- oShapeHelper->setTop(_fTop);
-}
-
-uno::Reference< uno::XInterface >
-ScVbaChartObject::getUnoObject() throw (script::BasicErrorException)
-{
- return uno::Reference< uno::XInterface >( xShape, uno::UNO_QUERY );
-}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachartobject.hxx b/sc/source/ui/vba/vbachartobject.hxx
index 3c1e224728ee..cd06a53f33e2 100644
--- a/sc/source/ui/vba/vbachartobject.hxx
+++ b/sc/source/ui/vba/vbachartobject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,18 +64,8 @@ public:
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
- // non interface methods
- double getHeight();
- void setHeight( double _fheight ) throw ( css::script::BasicErrorException );
- double getWidth();
- void setWidth( double _fwidth ) throw ( css::script::BasicErrorException );
- double getLeft();
- void setLeft( double _fleft );
- double getTop();
- void setTop( double _ftop );
- // should make this part of the XHelperInterface with a default
- // implementation returning NULL
- css::uno::Reference< css::uno::XInterface > getUnoObject() throw ( css::script::BasicErrorException );
};
#endif //SC_VBA_WINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx
index 5117cfd75858..0ca3fa9112f2 100644
--- a/sc/source/ui/vba/vbachartobjects.cxx
+++ b/sc/source/ui/vba/vbachartobjects.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,10 +83,10 @@ ScVbaChartObjects::getChartObjectNames() throw( css::script::BasicErrorException
ScCellRangesBase* pUno= dynamic_cast< ScCellRangesBase* >( xIf.get() );
ScDocShell* pDocShell = NULL;
if ( !pUno )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Failed to obtain the impl class from the drawpage"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Failed to obtain the impl class from the drawpage")), uno::Reference< uno::XInterface >() );
pDocShell = pUno->GetDocShell();
if ( !pDocShell )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Failed to obtain the docshell implclass"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Failed to obtain the docshell implclass")), uno::Reference< uno::XInterface >() );
uno::Reference< sheet::XSpreadsheetDocument > xSpreadsheetDocument( pDocShell->GetModel(), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XSpreadsheets > xSpreadsheets = xSpreadsheetDocument->getSheets();
@@ -192,3 +193,4 @@ ScVbaChartObjects::getServiceNames()
return sNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbachartobjects.hxx b/sc/source/ui/vba/vbachartobjects.hxx
index 80ea038bb15d..ee0b7b13f2cd 100644
--- a/sc/source/ui/vba/vbachartobjects.hxx
+++ b/sc/source/ui/vba/vbachartobjects.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,11 +36,11 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <vbahelper/vbacollectionimpl.hxx>
#include "excelvbahelper.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
typedef CollTestImplHelper< ov::excel::XChartObjects > ChartObjects_BASE;
/* #TODO see if this hash table is 'really' necessary
-typedef ::std::hash_map< ::rtl::OUString,
+typedef ::boost::unordered_map< ::rtl::OUString,
css::uno::Reference< ov::excel::XChartObject >,
::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > aHashTable;
@@ -73,3 +74,5 @@ public:
};
#endif //SC_VBA_WINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacharts.cxx b/sc/source/ui/vba/vbacharts.cxx
deleted file mode 100644
index da0c7789134b..000000000000
--- a/sc/source/ui/vba/vbacharts.cxx
+++ /dev/null
@@ -1,120 +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.
- *
- ************************************************************************/
-#include "vbacharts.hxx"
-#include <basic/sberrors.hxx>
-#include <com/sun/star/table/XTableChartsSupplier.hpp>
-
-using namespace ::com::sun::star;
-using namespace ::ooo::vba;
-
-
-ScVbaCharts::ScVbaCharts( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const uno::Reference< frame::XModel >& xModel ) : Charts_BASE(_xParent, _xContext, uno::Reference< container::XIndexAccess >())
-{
- xComponent.set( xModel, uno::UNO_QUERY_THROW );
- xSpreadsheetDocument.set( xComponent, uno::UNO_QUERY_THROW );
-}
-
-uno::Any SAL_CALL
-ScVbaCharts::Add() throw (css::script::BasicErrorException, css::uno::RuntimeException)
-{
- // Not implemented in the helperapi ( see ChartsImpl.java )
- if ( true )
- throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() );
- return aNULL();
-}
-
-uno::Reference< excel::XChart > SAL_CALL
-ScVbaCharts::getActiveChart() throw (script::BasicErrorException, uno::RuntimeException)
-{
- return xActiveChart;
-}
-
-uno::Reference< container::XEnumeration > SAL_CALL
-ScVbaCharts::createEnumeration() throw (uno::RuntimeException)
-{
- // #FIXME not implemented
- if ( true )
- throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() );
- return uno::Reference< container::XEnumeration >();
-}
-
-// #FIXME #TODO this method shouldn't appear in this class directly
-// a XIndexAccess/XNameAccess wrapper should be passed to the base class instead
-::sal_Int32 SAL_CALL
-ScVbaCharts::getCount() throw (uno::RuntimeException)
-{
- sal_Int32 ncount = 0;
- try
- {
- uno::Reference< sheet::XSpreadsheets > xSpreadsheets( xSpreadsheetDocument->getSheets() );
- uno::Sequence< rtl::OUString > SheetNames = xSpreadsheets->getElementNames();
- sal_Int32 nLen = SheetNames.getLength();
- for (sal_Int32 i = 0; i < nLen; i++)
- {
- uno::Reference< table::XTableChartsSupplier > xTableChartsSupplier( xSpreadsheets->getByName(SheetNames[i]), uno::UNO_QUERY);
- if ( xTableChartsSupplier.is() )
- {
- uno::Reference< table::XTableCharts > xTableCharts = xTableChartsSupplier->getCharts();
- ncount =+ xTableCharts->getElementNames().getLength();
- }
- }
- }
- catch (uno::Exception& )
- {
- throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
- }
- return ncount;
-}
-
-uno::Any
-ScVbaCharts::createCollectionObject( const uno::Any& aSource )
-{
- if ( true )
- throw script::BasicErrorException( rtl::OUString(), uno::Reference< uno::XInterface >(), SbERR_BAD_METHOD, rtl::OUString() );
- // #TODO implementation please
- return aSource;
-}
-
-rtl::OUString&
-ScVbaCharts::getServiceImplName()
-{
- static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCharts") );
- return sImplName;
-}
-
-css::uno::Sequence<rtl::OUString>
-ScVbaCharts::getServiceNames()
-{
- static uno::Sequence< rtl::OUString > sNames;
- if ( sNames.getLength() == 0 )
- {
- sNames.realloc( 1 );
- sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Charts") );
- }
- return sNames;
-}
-
diff --git a/sc/source/ui/vba/vbacharts.hxx b/sc/source/ui/vba/vbacharts.hxx
deleted file mode 100644
index b2ecfe23270f..000000000000
--- a/sc/source/ui/vba/vbacharts.hxx
+++ /dev/null
@@ -1,60 +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 SC_VBA_CHARTS_HXX
-#define SC_VBA_CHARTS_HXX
-#include <ooo/vba/excel/XCharts.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <vbahelper/vbacollectionimpl.hxx>
-#include "excelvbahelper.hxx"
-#include <hash_map>
-
-typedef CollTestImplHelper< ov::excel::XCharts > Charts_BASE;
-
-class ScVbaCharts : public Charts_BASE
-{
- css::uno::Reference< ov::excel::XChart > xActiveChart;
- css::uno::Reference< css::sheet::XSpreadsheetDocument > xSpreadsheetDocument;
- css::uno::Reference< css::lang::XComponent > xComponent;
-public:
- ScVbaCharts( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::frame::XModel >& xModel );
- // XCharts
- virtual css::uno::Any SAL_CALL Add() throw (css::script::BasicErrorException, css::uno::RuntimeException);
- virtual css::uno::Reference< ov::excel::XChart > SAL_CALL getActiveChart( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
- // XCollection
- ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
- // XEnumerationAccess
- virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
- // XElementAccess
- virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) { return ov::excel::XChart::static_type(0); }
- // ScVbaCollectionBaseImpl
- virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
- // Charts_BASE or HelperInterface
- virtual rtl::OUString& getServiceImplName();
- virtual css::uno::Sequence<rtl::OUString> getServiceNames();
-};
-
-#endif
diff --git a/sc/source/ui/vba/vbacharttitle.cxx b/sc/source/ui/vba/vbacharttitle.cxx
index e797c4a0269e..09f678704422 100644
--- a/sc/source/ui/vba/vbacharttitle.cxx
+++ b/sc/source/ui/vba/vbacharttitle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,4 @@ ScVbaChartTitle::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacharttitle.hxx b/sc/source/ui/vba/vbacharttitle.hxx
index 4d6ed34a86b6..db0f3e31529f 100644
--- a/sc/source/ui/vba/vbacharttitle.hxx
+++ b/sc/source/ui/vba/vbacharttitle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx
index 9c50a25b8b7c..402d9e9e1667 100644
--- a/sc/source/ui/vba/vbacomment.cxx
+++ b/sc/source/ui/vba/vbacomment.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,14 +34,23 @@
#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
#include <com/sun/star/sheet/XSheetCellRange.hpp>
+#include <com/sun/star/sheet/XCellAddressable.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/text/XText.hpp>
+#include <cellsuno.hxx>
+#include <postit.hxx>
+#include <svx/svdobj.hxx>
+#include <svx/svdocapt.hxx>
+#include <ooo/vba/msforms/XShape.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
#include <vbahelper/vbashape.hxx>
#include "vbaglobals.hxx"
#include "vbacomments.hxx"
-
+#include "vbacommentshape.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -178,7 +188,6 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An
aText >>= sText;
uno::Reference< text::XSimpleText > xAnnoText( getAnnotation(), uno::UNO_QUERY_THROW );
- rtl::OUString sAnnoText = xAnnoText->getString();
if ( aStart.hasValue() )
{
@@ -193,14 +202,14 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An
if ( bOverwrite )
{
xTextCursor->collapseToStart();
- xTextCursor->gotoStart( sal_False );
- xTextCursor->goRight( nStart - 1, sal_False );
+ xTextCursor->gotoStart( false );
+ xTextCursor->goRight( nStart - 1, false );
xTextCursor->gotoEnd( sal_True );
}
else
{
xTextCursor->collapseToStart();
- xTextCursor->gotoStart( sal_False );
+ xTextCursor->gotoStart( false );
xTextCursor->goRight( nStart - 1 , sal_True );
}
@@ -212,10 +221,12 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An
}
else if ( aText.hasValue() )
{
- xAnnoText->setString( sText );
- return sText;
+ uno::Reference< sheet::XCellAddressable > xCellAddr(mxRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW );
+ table::CellAddress aAddress = xCellAddr->getCellAddress();
+ getAnnotations()->insertNew( aAddress, sText );
}
+ rtl::OUString sAnnoText = xAnnoText->getString();
return sAnnoText;
}
@@ -237,3 +248,5 @@ ScVbaComment::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacomment.hxx b/sc/source/ui/vba/vbacomment.hxx
index 4a7d2fab91ef..81670dca678a 100644
--- a/sc/source/ui/vba/vbacomment.hxx
+++ b/sc/source/ui/vba/vbacomment.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,4 @@ public:
#endif /* SC_VBA_COMMENT_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx
index 7a6d3d774937..c4c290da3b2a 100644
--- a/sc/source/ui/vba/vbacomments.cxx
+++ b/sc/source/ui/vba/vbacomments.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,3 +115,5 @@ ScVbaComments::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacomments.hxx b/sc/source/ui/vba/vbacomments.hxx
index 2f98e5b71897..8b65a3cafc8a 100644
--- a/sc/source/ui/vba/vbacomments.hxx
+++ b/sc/source/ui/vba/vbacomments.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,4 @@ private:
#endif /* SC_VBA_COMMENTS_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacommentshape.cxx b/sc/source/ui/vba/vbacommentshape.cxx
new file mode 100644
index 000000000000..768b63636ad2
--- /dev/null
+++ b/sc/source/ui/vba/vbacommentshape.cxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbacommentshape.hxx"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaCommentShape::ScVbaCommentShape( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< excel::XComment >& xComment,
+ const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel, sal_Int32 nType ) : ScVbaShape( xParent, xContext, xShape, xShapes, xModel, nType )
+{
+ m_xComment.set( xComment, uno::UNO_QUERY );
+}
+
+void SAL_CALL ScVbaCommentShape::Delete() throw (uno::RuntimeException)
+{
+ if ( m_xComment.is() )
+ {
+ m_xComment->Delete();
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacommentshape.hxx b/sc/source/ui/vba/vbacommentshape.hxx
new file mode 100644
index 000000000000..6943321cbaef
--- /dev/null
+++ b/sc/source/ui/vba/vbacommentshape.hxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 SC_VBA_COMMENTSHAPE_HXX
+#define SC_VBA_COMMENTSHAPE_HXX
+
+#include <ooo/vba/excel/XComment.hpp>
+#include <vbahelper/vbashape.hxx>
+
+class ScVbaCommentShape : public ScVbaShape
+{
+ css::uno::Reference< ooo::vba::excel::XComment > m_xComment;
+
+public:
+ ScVbaCommentShape( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape,
+ const css::uno::Reference< ooo::vba::excel::XComment >& xComment, const css::uno::Reference< css::drawing::XShapes >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nType );
+
+ // Methods
+ virtual void SAL_CALL Delete() throw (css::uno::RuntimeException);
+};
+#endif //SC_VBA_COMMENTSHAPE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacondition.cxx b/sc/source/ui/vba/vbacondition.cxx
index 590d649ae561..321ca60d810f 100644
--- a/sc/source/ui/vba/vbacondition.cxx
+++ b/sc/source/ui/vba/vbacondition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -173,3 +174,4 @@ ScVbaCondition< Ifc1 >::Operator(sal_Bool _bIncludeFormulaValue) throw ( script:
template class ScVbaCondition< excel::XFormatCondition >;
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbacondition.hxx b/sc/source/ui/vba/vbacondition.hxx
index 36052fe217ee..878e3d9e346f 100644
--- a/sc/source/ui/vba/vbacondition.hxx
+++ b/sc/source/ui/vba/vbacondition.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialog.cxx b/sc/source/ui/vba/vbadialog.cxx
index 3c578a04e5d0..493d6b89db2f 100644
--- a/sc/source/ui/vba/vbadialog.cxx
+++ b/sc/source/ui/vba/vbadialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,45 +27,61 @@
************************************************************************/
#include "vbadialog.hxx"
+#include <sal/macros.h>
+
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-static const rtl::OUString aStringList[]=
+//solve the problem that "Application.Dialogs.Item(***).Show" and "Application.Dialogs.Count" cannot get the correct result
+struct DialogMatch
{
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatCellDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertCell" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Print" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PasteSpecial" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolProtectionDocument" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColumnWidth" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineName" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:HyperlinkDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertGraphic" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertObject" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PageFormatDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataSort" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:RowHeight" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoCorrectDlg" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConditionalFormatDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataConsolidate" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CreateNames" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillSeries" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Validation") ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) )
+ sal_Int32 nVbaDlgIndex;
+ rtl::OUString aOODlgName;
};
-const sal_Int32 nDialogSize = sizeof( aStringList ) / sizeof( aStringList[ 0 ] );
+static const DialogMatch aDialogMatchList[] =
+{
+ { 1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ) }, // xlDialogOpen -> .uno:Open
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatCellDialog" ) ) }, // ??? -> .uno:FormatCellDialog
+ { 55, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertCell" ) ) }, // xlDialogInsert -> .uno:InsertCell
+ { 8, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Print" ) ) }, // xlDialogPrint -> .uno:Print
+ { 9, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrinterSetup" ) ) }, // xlDialogPrinterSetup -> .uno:PrinterSetup
+ { 53, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PasteSpecial" ) ) }, // xlDialogPasteSpecial -> .uno:PasteSpecial
+ { 28, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolProtectionDocument" ) ) }, // xlDialogProtectDocument -> uno:ToolProtectionDocument
+ { 47, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColumnWidth" ) ) }, // xlDialogColumnWidth -> .uno:ColumnWidth
+ { 61, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineName" ) ) }, // xlDialogDefineName -> .uno:DefineName
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ) ) }, // ??? -> .uno:ConfigureDialog
+ { 596, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:HyperlinkDialog" ) ) }, // xlDialogInsertHyperlink -> .uno:HyperlinkDialog
+ { 342, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertGraphic" ) ) }, // xlDialogInsertPicture -> .uno:InsertGraphic
+ { 259, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertObject" ) ) }, // xlDialogInsertObject -> .uno:InsertObject
+ { 7, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PageFormatDialog" ) ) }, // xlDialogPageSetup -> .uno:PageFormatDialog
+ { 39, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataSort" ) ) }, // xlDialogSort -> .uno:DataSort
+ { 127, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:RowHeight" ) ) }, // xlDialogRowHeight -> .uno:RowHeight
+ { 485, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoCorrectDlg" ) ) }, // xlDialogAutoCorrect -> .uno:AutoCorrectDlg
+ { 583, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConditionalFormatDialog" ) ) }, // xlDialogCondiationalFormatting -> .uno:ConditionalFormatDialog
+ { 191, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataConsolidate" ) ) }, // xlDialogConsolidate -> .uno:DataConsolidate
+ { 62, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CreateNames" ) ) }, // xlDialogCreateNames -> .uno:CreateNames
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillSeries" ) ) }, // ??? -> .uno:FillSeries
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Validation" ) ) }, // ??? -> .uno:Validation"
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ) }, // ??? -> .uno:DefineLabelRange
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ) }, // ??? -> .uno:DataFilterAutoFilter
+ { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ) }, // ??? -> .uno:DataFilterSpecialFilter
+ { 269, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) } // xlDialogFormatAuto -> .uno:AutoFormat
+};
+
+const sal_Int32 nDialogSize = SAL_N_ELEMENTS( aDialogMatchList ) ;
rtl::OUString
ScVbaDialog::mapIndexToName( sal_Int32 nIndex )
{
- if( nIndex < nDialogSize )
- return aStringList[ nIndex ];
+ for (int i = 0; i < nDialogSize; i++)
+ {
+ if ( aDialogMatchList[i].nVbaDlgIndex == nIndex )
+ {
+ return aDialogMatchList[i].aOODlgName;
+ }
+ }
+
return rtl::OUString();
}
@@ -86,3 +103,9 @@ ScVbaDialog::getServiceNames()
}
return aServiceNames;
}
+
+sal_Int32 ScVbaDialog::GetSupportedDialogCount()
+{
+ return nDialogSize;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialog.hxx b/sc/source/ui/vba/vbadialog.hxx
index 40f4a4a83a11..9a336937a7c1 100644
--- a/sc/source/ui/vba/vbadialog.hxx
+++ b/sc/source/ui/vba/vbadialog.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,6 +46,10 @@ public:
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+ static sal_Int32 GetSupportedDialogCount();
};
#endif /* SC_VBA_DIALOG_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialogs.cxx b/sc/source/ui/vba/vbadialogs.cxx
index 67070879535b..c64babea9069 100644
--- a/sc/source/ui/vba/vbadialogs.cxx
+++ b/sc/source/ui/vba/vbadialogs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,5 +65,13 @@ ScVbaDialogs::getServiceNames()
return aServiceNames;
}
+::sal_Int32
+ScVbaDialogs::getCount() throw (uno::RuntimeException)
+{
+ return ScVbaDialog::GetSupportedDialogCount();
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialogs.hxx b/sc/source/ui/vba/vbadialogs.hxx
index 9aab5daf11fe..70c818fa0031 100644
--- a/sc/source/ui/vba/vbadialogs.hxx
+++ b/sc/source/ui/vba/vbadialogs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,6 +45,7 @@ public:
// XCollection
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
// XDialogs
virtual void SAL_CALL Dummy() throw (css::uno::RuntimeException);
@@ -53,3 +55,5 @@ public:
};
#endif /* SC_VBA_DIALOGS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx
index 6ea807a16eae..f1c706a7a091 100755..100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -358,7 +359,7 @@ void SAL_CALL ScVbaEventsListener::changesOccurred( const util::ChangesEvent& aE
}
}
- if( (aRangeList.Count() > 0) && mpDocShell )
+ if( ( !aRangeList.empty() ) && mpDocShell )
{
uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( mpDocShell, aRangeList ) );
uno::Sequence< uno::Any > aArgs(1);
@@ -419,6 +420,21 @@ IMPL_LINK( ScVbaEventsListener, fireResizeMacro, void*, EMPTYARG )
return 0;
}
+void ScVbaEventsListener::processWindowResizeMacro()
+{
+ OSL_TRACE( "**** Attempt to FIRE MACRO **** " );
+ if( !mbDisposed )
+ {
+ try
+ {
+ mrVbaEvents.processVbaEvent( WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+}
+
// ============================================================================
ScVbaEventsHelper::ScVbaEventsHelper( const uno::Sequence< uno::Any >& rArgs, const uno::Reference< uno::XComponentContext >& xContext ) :
@@ -692,11 +708,14 @@ bool ScVbaEventsHelper::isSelectionChanged( const uno::Sequence< uno::Any >& rAr
{
uno::Reference< uno::XInterface > xOldSelection( maOldSelection, uno::UNO_QUERY );
uno::Reference< uno::XInterface > xNewSelection = getXSomethingFromArgs< uno::XInterface >( rArgs, nIndex, false );
- ScCellRangesBase* pOldCellRanges = ScCellRangesBase::getImplementation( xOldSelection );
- ScCellRangesBase* pNewCellRanges = ScCellRangesBase::getImplementation( xNewSelection );
- bool bChanged = !pOldCellRanges || !pNewCellRanges || lclSelectionChanged( pOldCellRanges->GetRangeList(), pNewCellRanges->GetRangeList() );
- maOldSelection <<= xNewSelection;
- return bChanged;
+ if( ScCellRangesBase* pNewCellRanges = ScCellRangesBase::getImplementation( xNewSelection ) )
+ {
+ bool bChanged = maOldSelection != pNewCellRanges->GetRangeList();
+ maOldSelection = pNewCellRanges->GetRangeList();
+ return bChanged;
+ }
+ maOldSelection.RemoveAll();
+ return true;
}
uno::Any ScVbaEventsHelper::createWorksheet( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) const
@@ -768,3 +787,5 @@ extern sdecl::ServiceDecl const serviceDecl(
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaeventshelper.hxx b/sc/source/ui/vba/vbaeventshelper.hxx
index f1e8a4fb712d..f299afd7ac6c 100755..100644
--- a/sc/source/ui/vba/vbaeventshelper.hxx
+++ b/sc/source/ui/vba/vbaeventshelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,5 @@ private:
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafiledialog.cxx b/sc/source/ui/vba/vbafiledialog.cxx
new file mode 100644
index 000000000000..1c5e7382c926
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialog.cxx
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafiledialog.hxx"
+#include "comphelper/processfactory.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include "tools/urlobj.hxx"
+
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+
+ScVbaFileDialog::ScVbaFileDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel )
+: ScVbaFileDialog_BASE( xParent, xContext, xModel )
+{
+ m_pFileDialogSelectedItems = new VbaFileDialogSelectedItems(xParent, xContext, (com::sun::star::container::XIndexAccess *)&m_FileDialogSelectedObj);
+}
+
+ScVbaFileDialog::~ScVbaFileDialog()
+{
+ if (m_pFileDialogSelectedItems != NULL)
+ {
+ delete m_pFileDialogSelectedItems;
+ }
+}
+
+rtl::OUString&
+ScVbaFileDialog::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFileDialog") );
+ return sImplName;
+}
+
+css::uno::Sequence<rtl::OUString>
+ScVbaFileDialog::getServiceNames()
+{
+ static Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.FileDialog" ) );
+ }
+ return aServiceNames;
+
+}
+
+css::uno::Reference< ov::XFileDialogSelectedItems > SAL_CALL
+ScVbaFileDialog::getSelectedItems() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< ov::XFileDialogSelectedItems > xFileDlgSlc = (ov::XFileDialogSelectedItems *)m_pFileDialogSelectedItems;
+ return xFileDlgSlc;
+}
+
+::sal_Int32 SAL_CALL
+ScVbaFileDialog::Show( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ // Returns an Integer indicating if user pressed "Open" button(-1) or "Cancel" button(0).
+ sal_Int32 nResult = -1;
+ try
+ {
+ m_sSelectedItems.realloc(0);
+
+ const ::rtl::OUString sServiceName(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ));
+
+ Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
+ // Set the type of File Picker Dialog: TemplateDescription::FILEOPEN_SIMPLE.
+ Sequence< uno::Any > aDialogType( 1 );
+ aDialogType[0] <<= ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
+ Reference < ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY );
+ Reference < ui::dialogs::XFilePicker2 > xFilePicker2( xFilePicker, UNO_QUERY );
+ if ( xFilePicker.is() )
+ {
+ xFilePicker->setMultiSelectionMode(sal_True);
+ if ( xFilePicker->execute() )
+ {
+ sal_Bool bUseXFilePicker2 = false;
+ Reference< lang::XServiceInfo > xServiceInfo( xFilePicker, UNO_QUERY );
+ if (xServiceInfo.is())
+ {
+ rtl::OUString sImplName = xServiceInfo->getImplementationName();
+ if (sImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.comp.fpicker.VistaFileDialog")) ||
+ sImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.ui.dialogs.SalGtkFilePicker")))
+ {
+ bUseXFilePicker2 = sal_True;
+ }
+ }
+ if ( bUseXFilePicker2 && xFilePicker2.is() )
+ {
+ // On Linux, XFilePicker->getFiles() always return one selected file although we select
+ // more than one file, also on Vista XFilePicker->getFiles() does not work well too,
+ // so we call XFilePicker2->getSelectedFiles() to get selected files.
+ m_sSelectedItems = xFilePicker2->getSelectedFiles();
+ }
+ else
+ {
+ // If only one file is selected, the first entry of the sequence contains the complete path/filename in
+ // URL format. If multiple files are selected, the first entry of the sequence contains the path in URL
+ // format, and the other entries contains the names of the selected files without path information.
+ Sequence< rtl::OUString > aSelectedFiles = xFilePicker->getFiles();
+ sal_Int32 iFileCount = aSelectedFiles.getLength();
+ if ( iFileCount > 1 )
+ {
+ m_sSelectedItems.realloc( iFileCount - 1 );
+ INetURLObject aPath( aSelectedFiles[0] );
+ aPath.setFinalSlash();
+ for ( sal_Int32 i = 1; i < iFileCount; i++ )
+ {
+ if ( aSelectedFiles[i].indexOf ('/') > 0 || aSelectedFiles[i].indexOf ('\\') > 0 )
+ {
+ m_sSelectedItems[i - 1] = aSelectedFiles[i];
+ }
+ else
+ {
+ if ( i == 1 )
+ aPath.Append( aSelectedFiles[i] );
+ else
+ aPath.setName( aSelectedFiles[i] );
+ m_sSelectedItems[i - 1] = aPath.GetMainURL(INetURLObject::NO_DECODE);
+ }
+ }
+ }
+ else if ( iFileCount == 1 )
+ {
+ m_sSelectedItems = aSelectedFiles;
+ }
+ }
+
+ sal_Int32 iFileCount = m_sSelectedItems.getLength();
+ rtl::OUString aTemp;
+ for ( sal_Int32 i = 0; i < iFileCount; i++ )
+ {
+ INetURLObject aObj( m_sSelectedItems[i] );
+ if ( aObj.GetProtocol() == INET_PROT_FILE )
+ {
+ aTemp = aObj.PathToFileName();
+ m_sSelectedItems[i] = aTemp.getLength() > 0 ? aTemp : m_sSelectedItems[i];
+ }
+ }
+ }
+ else
+ {
+ nResult = 0;
+ }
+ }
+
+ m_FileDialogSelectedObj.SetSelectedFile(m_sSelectedItems);
+ }
+ catch( const uno::Exception& )
+ {
+ return 0;
+ }
+
+ return nResult;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafiledialog.hxx b/sc/source/ui/vba/vbafiledialog.hxx
new file mode 100644
index 000000000000..ac905f541185
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialog.hxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 _vbafiledialog_hxx_
+#define _vbafiledialog_hxx_
+
+#include <cppuhelper/implbase1.hxx>
+#include <vbahelper/vbadialogsbase.hxx>
+#include <ooo/vba/XFileDialog.hpp>
+#include "vbafiledialogselecteditems.hxx"
+
+
+typedef cppu::ImplInheritanceHelper1< VbaDialogsBase, ov::XFileDialog > ScVbaFileDialog_BASE;
+
+class ScVbaFileDialog : public ScVbaFileDialog_BASE
+{
+public:
+
+ ScVbaFileDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ) ;
+ virtual ~ScVbaFileDialog() ;
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ //XFileDialog
+ virtual css::uno::Reference< ov::XFileDialogSelectedItems > SAL_CALL getSelectedItems() throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL Show( ) throw (::com::sun::star::uno::RuntimeException) ;
+
+private:
+ css::uno::Sequence < rtl::OUString > m_sSelectedItems;
+ VbaFileDialogSelectedItems *m_pFileDialogSelectedItems;
+ VbaFileDialogSelectedObj m_FileDialogSelectedObj;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafiledialogselecteditems.cxx b/sc/source/ui/vba/vbafiledialogselecteditems.cxx
new file mode 100644
index 000000000000..547841a2c987
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialogselecteditems.cxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafiledialogselecteditems.hxx"
+
+using namespace ::com::sun::star;
+
+VbaFileDialogSelectedItems::VbaFileDialogSelectedItems( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess
+ )
+ : FileDialogSelectedItems_BASE( xParent, xContext, xIndexAccess )
+{
+}
+
+
+rtl::OUString& VbaFileDialogSelectedItems::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFileDialogSelectedItems") );
+ return sImplName;
+
+}
+css::uno::Sequence<rtl::OUString> VbaFileDialogSelectedItems::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FileDialogSelectedItems" ) );
+ }
+ return aServiceNames;
+
+}
+
+css::uno::Any VbaFileDialogSelectedItems::createCollectionObject( const css::uno::Any& aSource )
+{
+ css::uno::Any aRet;
+ aRet = aSource;
+ return aRet;
+}
+
+
+css::uno::Type SAL_CALL
+VbaFileDialogSelectedItems::getElementType() throw (css::uno::RuntimeException)
+{
+ return ooo::vba::XFileDialogSelectedItems::static_type(0);
+}
+
+css::uno::Reference< css::container::XEnumeration > SAL_CALL
+VbaFileDialogSelectedItems::createEnumeration() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< css::container::XEnumeration > xEnumRet(m_xIndexAccess, css::uno::UNO_QUERY);
+ return xEnumRet;
+}
+
+
+//VbaFileDialogSelectedObj
+//////////////////////////////////////////////////////////////////////////
+
+VbaFileDialogSelectedObj::VbaFileDialogSelectedObj()
+{
+ m_nIndex = 0;
+}
+
+
+sal_Bool
+VbaFileDialogSelectedObj::SetSelectedFile(css::uno::Sequence<rtl::OUString> &sFList)
+{
+ m_sFileList = sFList;
+ return sal_True;
+}
+
+sal_Int32 SAL_CALL
+VbaFileDialogSelectedObj::getCount() throw(::com::sun::star::uno::RuntimeException)
+{
+ sal_Int32 nListCnt = m_sFileList.getLength();
+ return nListCnt;
+}
+
+::com::sun::star::uno::Any SAL_CALL VbaFileDialogSelectedObj::getByIndex( sal_Int32 nIndex )
+throw(::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException)
+{
+ css::uno::Any aRet;
+
+ if ( nIndex >= getCount() )
+ {
+ throw css::lang::IndexOutOfBoundsException();
+ }
+
+ return uno::makeAny(m_sFileList[nIndex]);
+}
+
+::com::sun::star::uno::Type SAL_CALL
+VbaFileDialogSelectedObj::getElementType()
+throw(::com::sun::star::uno::RuntimeException)
+{
+ return getCppuType((uno::Reference<com::sun::star::container::XIndexAccess>*)0);
+}
+
+sal_Bool SAL_CALL VbaFileDialogSelectedObj::hasElements()
+throw(::com::sun::star::uno::RuntimeException)
+{
+ return ( getCount() != 0 );
+}
+
+::sal_Bool SAL_CALL
+VbaFileDialogSelectedObj::hasMoreElements( )
+throw (uno::RuntimeException)
+{
+ if (getCount() > m_nIndex)
+ {
+ return sal_True;
+ }
+ return false;
+}
+
+uno::Any SAL_CALL
+VbaFileDialogSelectedObj::nextElement( )
+throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ if (!hasMoreElements())
+ {
+ throw container::NoSuchElementException();
+ }
+
+ return uno::makeAny(m_sFileList[m_nIndex++]);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafiledialogselecteditems.hxx b/sc/source/ui/vba/vbafiledialogselecteditems.hxx
new file mode 100644
index 000000000000..b43364dff709
--- /dev/null
+++ b/sc/source/ui/vba/vbafiledialogselecteditems.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 _vbafiledialogselecteditems_hxx_
+#define _vbafiledialogselecteditems_hxx_
+
+#include <ooo/vba/XFileDialogSelectedItems.hpp>
+#include <vbahelper/vbacollectionimpl.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/container/XIndexAccess.hpp>
+
+typedef CollTestImplHelper< ov::XFileDialogSelectedItems > FileDialogSelectedItems_BASE;
+
+
+class VbaFileDialogSelectedItems : public FileDialogSelectedItems_BASE
+{
+public:
+ VbaFileDialogSelectedItems( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess );
+
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+protected:
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+private:
+};
+
+
+class VbaFileDialogSelectedObj : public cppu::WeakImplHelper2<css::container::XIndexAccess, css::container::XEnumeration>
+{
+public:
+ VbaFileDialogSelectedObj();
+ sal_Bool SetSelectedFile(css::uno::Sequence<rtl::OUString> &sFList);
+ //XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex )
+ throw(::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+
+ //XEnumeration
+ virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+protected:
+private:
+ css::uno::Sequence<rtl::OUString> m_sFileList;
+ sal_Int32 m_nIndex;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafilesearch.cxx b/sc/source/ui/vba/vbafilesearch.cxx
new file mode 100644
index 000000000000..91e8c7a07bf6
--- /dev/null
+++ b/sc/source/ui/vba/vbafilesearch.cxx
@@ -0,0 +1,245 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafilesearch.hxx"
+#include "vbaapplication.hxx"
+#include "vbafoundfiles.hxx"
+#include <comphelper/processfactory.hxx>
+#include <tools/urlobj.hxx>
+#include <tools/wldcrd.hxx>
+#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <vector>
+#include "unotools/viewoptions.hxx"
+#include <osl/file.hxx>
+
+using namespace ::ooo::vba;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::lang;
+using namespace comphelper;
+
+static Reference< XSimpleFileAccess3 > getFileAccess( void )
+{
+ static Reference< XSimpleFileAccess3 > xSFI;
+ if( !xSFI.is() )
+ {
+ Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
+ if( xSMgr.is() )
+ {
+ xSFI = Reference< XSimpleFileAccess3 >( xSMgr->createInstance
+ ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" )) ), UNO_QUERY );
+ }
+ }
+ return xSFI;
+}
+
+ScVbaFileSearch::ScVbaFileSearch( ScVbaApplication* pApp, const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext )
+ : ScVbaFileSearchImpl_BASE( xParent, xContext ), m_pApplication( pApp )
+{
+ NewSearch();
+}
+
+ScVbaFileSearch::~ScVbaFileSearch()
+{
+}
+
+::rtl::OUString SAL_CALL ScVbaFileSearch::getFileName() throw (css::uno::RuntimeException)
+{
+ return m_sFileName;
+}
+
+void SAL_CALL ScVbaFileSearch::setFileName(const ::rtl::OUString& _fileName ) throw (css::uno::RuntimeException)
+{
+ m_sFileName = _fileName;
+}
+
+::rtl::OUString SAL_CALL ScVbaFileSearch::getLookIn() throw (css::uno::RuntimeException)
+{
+ return m_sLookIn;
+}
+
+void SAL_CALL ScVbaFileSearch::setLookIn( const ::rtl::OUString& _lookIn ) throw (css::uno::RuntimeException)
+{
+ m_sLookIn = _lookIn;
+}
+
+sal_Bool SAL_CALL ScVbaFileSearch::getSearchSubFolders() throw (css::uno::RuntimeException)
+{
+ return m_bSearchSubFolders;
+}
+
+void SAL_CALL ScVbaFileSearch::setSearchSubFolders( sal_Bool _searchSubFolders ) throw (css::uno::RuntimeException)
+{
+ m_bSearchSubFolders = _searchSubFolders;
+}
+
+sal_Bool SAL_CALL ScVbaFileSearch::getMatchTextExactly() throw (css::uno::RuntimeException)
+{
+ return m_bMatchTextExactly;
+}
+
+void SAL_CALL ScVbaFileSearch::setMatchTextExactly( sal_Bool _matchTextExactly ) throw (css::uno::RuntimeException)
+{
+ m_bMatchTextExactly = _matchTextExactly;
+}
+
+static bool IsWildCard( const ::rtl::OUString& fileName )
+{
+ static sal_Char cWild1 = '*';
+ static sal_Char cWild2 = '?';
+
+ return ( ( fileName.indexOf( cWild1 ) >= 0 )
+ || ( fileName.indexOf( cWild2 ) >= 0 ) );
+}
+
+static void SearchWildCard(const WildCard& wildCard, const ::rtl::OUString& aDir, bool bSearchSubFolders, css::uno::Sequence< rtl::OUString >& aSearchedFiles)
+{
+ Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ Sequence< rtl::OUString > aDirSeq;
+ try
+ {
+ if ( xSFI.is() )
+ {
+ aDirSeq = xSFI->getFolderContents( aDir, bSearchSubFolders );
+ }
+ }
+ catch( css::uno::Exception& )
+ {
+ }
+ sal_Int32 nLength = aDirSeq.getLength();
+ for ( sal_Int32 i = 0; i < nLength; i++ )
+ {
+ rtl::OUString aURLStr = aDirSeq[i];
+ if ( xSFI->isFolder( aURLStr ) )
+ {
+ if ( bSearchSubFolders )
+ {
+ SearchWildCard( wildCard, aURLStr, true, aSearchedFiles );
+ }
+ }
+ else
+ {
+ INetURLObject aFileURL( aURLStr );
+ rtl::OUString aFileName = aFileURL.GetLastName( INetURLObject::DECODE_UNAMBIGUOUS );
+ if ( wildCard.Matches( aFileName.toAsciiLowerCase() ) )
+ {
+ sal_Int32 nFilesLength = aSearchedFiles.getLength();
+ aSearchedFiles.realloc( nFilesLength + 1 );
+ rtl::OUString sSystemPath;
+ ::osl::File::getSystemPathFromFileURL( aURLStr, sSystemPath );
+ aSearchedFiles[nFilesLength] = sSystemPath;
+ }
+ }
+ }
+}
+
+sal_Int32 SAL_CALL ScVbaFileSearch::Execute( ) throw (css::uno::RuntimeException)
+{
+ m_aSearchedFiles.realloc(0);
+ Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
+ if ( !xSFI.is() || !xSFI->isFolder( m_sLookIn ) )
+ {
+ return 0;
+ }
+
+ if ( m_sFileName == ::rtl::OUString() )
+ {
+ return 1;
+ }
+
+ ::rtl::OUString aTempFileName = m_sFileName.toAsciiLowerCase();
+ if ( IsWildCard( aTempFileName ) )
+ {
+ bool bEndWithAsterisk = aTempFileName.endsWithAsciiL("*", 1);
+ bool bStartWithAsterisk = (aTempFileName.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"))) == 0);
+ if ( !bEndWithAsterisk && !bStartWithAsterisk )
+ {
+ aTempFileName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")) + aTempFileName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
+ }
+ }
+ else
+ {
+ aTempFileName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")) + aTempFileName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
+ }
+ WildCard wildCard( aTempFileName );
+ SearchWildCard( wildCard, m_sLookIn, m_bSearchSubFolders, m_aSearchedFiles );
+
+ return m_aSearchedFiles.getLength();
+}
+
+// set ScVbaApplication::getDefaultFilePath( ) as the InitPath for FileSearch
+ ::rtl::OUString ScVbaFileSearch::getInitPath() throw (css::uno::RuntimeException)
+{
+ String aPath;
+
+ if (m_pApplication != NULL)
+ {
+ aPath = m_pApplication->getDefaultFilePath();
+ }
+
+ return aPath;
+}
+
+void SAL_CALL ScVbaFileSearch::NewSearch( ) throw (css::uno::RuntimeException)
+{
+ m_sFileName = ::rtl::OUString();
+ m_sLookIn = getInitPath();
+ m_bSearchSubFolders = false;
+ m_bMatchTextExactly = false;
+ m_aSearchedFiles.realloc(0);
+}
+
+Reference< XFoundFiles > SAL_CALL ScVbaFileSearch::getFoundFiles() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< ov::XFoundFiles > xFoundFiles = new VbaFoundFiles(
+ mxParent, mxContext, (css::container::XIndexAccess *) new VbaFoundFilesEnum(m_aSearchedFiles) );
+ return xFoundFiles;
+}
+
+rtl::OUString& ScVbaFileSearch::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFileSearch") );
+ return sImplName;
+}
+
+css::uno::Sequence< rtl::OUString > ScVbaFileSearch::getServiceNames()
+{
+ static css::uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FileSearch") );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafilesearch.hxx b/sc/source/ui/vba/vbafilesearch.hxx
new file mode 100644
index 000000000000..33e9caa53ca6
--- /dev/null
+++ b/sc/source/ui/vba/vbafilesearch.hxx
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 SC_VBA_FILESEARCH_HXX
+#define SC_VBA_FILESEARCH_HXX
+
+#include <ooo/vba/XFileSearch.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <vbahelper/vbahelperinterface.hxx>
+
+namespace css = ::com::sun::star;
+
+typedef InheritedHelperInterfaceImpl1< ooo::vba::XFileSearch > ScVbaFileSearchImpl_BASE;
+
+class ScVbaApplication;
+
+class ScVbaFileSearch : public ScVbaFileSearchImpl_BASE
+{
+private:
+ rtl::OUString m_sFileName;
+ rtl::OUString m_sLookIn;
+ sal_Bool m_bSearchSubFolders;
+ sal_Bool m_bMatchTextExactly;
+ ScVbaApplication* m_pApplication;
+ css::uno::Sequence< rtl::OUString > m_aSearchedFiles;
+
+ ::rtl::OUString getInitPath() throw (css::uno::RuntimeException);
+
+public:
+ ScVbaFileSearch( ScVbaApplication* pApp, const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~ScVbaFileSearch();
+
+ // Attributes
+ virtual ::rtl::OUString SAL_CALL getFileName() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setFileName(const ::rtl::OUString& _fileName ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLookIn() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLookIn(const ::rtl::OUString& _lookIn ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getSearchSubFolders() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setSearchSubFolders( sal_Bool _searchSubFolders ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getMatchTextExactly() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMatchTextExactly( sal_Bool _matchTextExactly ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ::ooo::vba::XFoundFiles > SAL_CALL getFoundFiles() throw (css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL Execute( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL NewSearch( ) throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence< rtl::OUString > getServiceNames();
+};
+
+#endif /* SC_VBA_FILESEARCH_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx
index 20e9d93fff03..216b0b7232c4 100644
--- a/sc/source/ui/vba/vbafont.cxx
+++ b/sc/source/ui/vba/vbafont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,7 +104,7 @@ ScVbaFont::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeExceptio
xCell.set( xCellRange->getCellByPosition( 0,0 ) );
uno::Reference< beans::XPropertySet > xProps = lcl_TextProperties( xCell );
- sal_Bool bValue = sal_False;
+ sal_Bool bValue = false;
aValue >>= bValue;
sal_Int16 nValue = NORMAL;
sal_Int8 nValue2 = NORMALHEIGHT;
@@ -175,7 +176,7 @@ ScVbaFont::setSubscript( const uno::Any& aValue ) throw ( uno::RuntimeException
xCell.set( xCellRange->getCellByPosition( 0,0 ) );
uno::Reference< beans::XPropertySet > xProps = lcl_TextProperties( xCell );
- sal_Bool bValue = sal_False;
+ sal_Bool bValue = false;
aValue >>= bValue;
sal_Int16 nValue = NORMAL;
sal_Int8 nValue2 = NORMALHEIGHT;
@@ -303,8 +304,8 @@ ScVbaFont::getStandardFont() throw ( uno::RuntimeException )
void SAL_CALL
ScVbaFont::setFontStyle( const uno::Any& aValue ) throw( uno::RuntimeException )
{
- sal_Bool bBold = sal_False;
- sal_Bool bItalic = sal_False;
+ sal_Bool bBold = false;
+ sal_Bool bItalic = false;
rtl::OUString aStyles;
aValue >>= aStyles;
@@ -336,7 +337,7 @@ uno::Any SAL_CALL
ScVbaFont::getFontStyle() throw ( uno::RuntimeException )
{
rtl::OUStringBuffer aStyles;
- sal_Bool bValue = sal_False;
+ sal_Bool bValue = false;
getBold() >>= bValue;
if( bValue )
aStyles.appendAscii("Bold");
@@ -499,3 +500,5 @@ ScVbaFont::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafont.hxx b/sc/source/ui/vba/vbafont.hxx
index 3ef52c6d240f..b87672a1223a 100644
--- a/sc/source/ui/vba/vbafont.hxx
+++ b/sc/source/ui/vba/vbafont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -88,3 +89,4 @@ public:
#endif /* SC_VBA_FONT_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx
index 3b0ba2367c1a..853ddaff2484 100644
--- a/sc/source/ui/vba/vbaformat.cxx
+++ b/sc/source/ui/vba/vbaformat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include <ooo/vba/excel/XlOrientation.hpp>
#include <ooo/vba/excel/Constants.hpp>
#include <ooo/vba/excel/XRange.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
#include <com/sun/star/table/CellHoriJustify.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
#include <com/sun/star/table/XCellRange.hpp>
@@ -58,7 +59,7 @@ using namespace ::com::sun::star;
#define LOCALE "Locale"
template< typename Ifc1 >
-ScVbaFormat< Ifc1 >::ScVbaFormat( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, const uno::Reference< frame::XModel >& xModel, bool bCheckAmbiguoity ) throw ( script::BasicErrorException ) : ScVbaFormat_BASE( xParent, xContext ), m_aDefaultLocale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "US") ), rtl::OUString() ), mxPropertySet( _xPropertySet ), mxModel( xModel ), mbCheckAmbiguoity( bCheckAmbiguoity ), mbAddIndent( sal_False )
+ScVbaFormat< Ifc1 >::ScVbaFormat( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, const uno::Reference< frame::XModel >& xModel, bool bCheckAmbiguoity ) throw ( script::BasicErrorException ) : ScVbaFormat_BASE( xParent, xContext ), m_aDefaultLocale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "US") ), rtl::OUString() ), mxPropertySet( _xPropertySet ), mxModel( xModel ), mbCheckAmbiguoity( bCheckAmbiguoity ), mbAddIndent( false )
{
try
{
@@ -86,21 +87,21 @@ ScVbaFormat<Ifc1>::setVerticalAlignment( const uno::Any& _oAlignment) throw (s
switch (nAlignment)
{
case excel::XlVAlign::xlVAlignBottom :
- aVal = uno::makeAny( table::CellVertJustify_BOTTOM );
+ aVal = uno::makeAny( table::CellVertJustify2::BOTTOM );
break;
case excel::XlVAlign::xlVAlignCenter :
- aVal = uno::makeAny( table::CellVertJustify_CENTER );
+ aVal = uno::makeAny( table::CellVertJustify2::CENTER );
break;
case excel::XlVAlign::xlVAlignDistributed:
case excel::XlVAlign::xlVAlignJustify:
- aVal = uno::makeAny( table::CellVertJustify_STANDARD );
+ aVal = uno::makeAny( table::CellVertJustify2::STANDARD );
break;
case excel::XlVAlign::xlVAlignTop:
- aVal = uno::makeAny( table::CellVertJustify_TOP);
+ aVal = uno::makeAny( table::CellVertJustify2::TOP);
break;
default:
- aVal = uno::makeAny( table::CellVertJustify_STANDARD );
+ aVal = uno::makeAny( table::CellVertJustify2::STANDARD );
break;
}
mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLVJUS ) ), aVal );
@@ -120,20 +121,20 @@ ScVbaFormat<Ifc1>::getVerticalAlignment( ) throw (script::BasicErrorException,
{
if (!isAmbiguous( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLVJUS ) ) ) )
{
- table::CellVertJustify aAPIAlignment;
+ sal_Int32 aAPIAlignment = table::CellVertJustify2::STANDARD;
mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLVJUS ) ) ) >>= aAPIAlignment;
switch( aAPIAlignment )
{
- case table::CellVertJustify_BOTTOM:
+ case table::CellVertJustify2::BOTTOM:
aResult = uno::makeAny( excel::XlVAlign::xlVAlignBottom );
break;
- case table::CellVertJustify_CENTER:
+ case table::CellVertJustify2::CENTER:
aResult = uno::makeAny( excel::XlVAlign::xlVAlignCenter );
break;
- case table::CellVertJustify_STANDARD:
+ case table::CellVertJustify2::STANDARD:
aResult = uno::makeAny( excel::XlVAlign::xlVAlignBottom );
break;
- case table::CellVertJustify_TOP:
+ case table::CellVertJustify2::TOP:
aResult = uno::makeAny( excel::XlVAlign::xlVAlignTop );
break;
default:
@@ -533,7 +534,7 @@ ScVbaFormat<Ifc1>::setLocked( const uno::Any& _aLocked ) throw (script::BasicErr
{
try
{
- sal_Bool bIsLocked = sal_False;
+ sal_Bool bIsLocked = false;
if ( !( _aLocked >>= bIsLocked ) )
throw uno::RuntimeException();
util::CellProtection aCellProtection;
@@ -554,7 +555,7 @@ ScVbaFormat<Ifc1>::setFormulaHidden( const uno::Any& FormulaHidden ) throw (scri
{
try
{
- sal_Bool bIsFormulaHidden = sal_False;
+ sal_Bool bIsFormulaHidden = false;
FormulaHidden >>= bIsFormulaHidden;
util::CellProtection aCellProtection;
rtl::OUString sCellProt( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLPRO ) );
@@ -841,3 +842,4 @@ template class ScVbaFormat< excel::XStyle >;
template class ScVbaFormat< excel::XRange >;
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformat.hxx b/sc/source/ui/vba/vbaformat.hxx
index bfa88d6c7cb8..3646665f5b24 100644
--- a/sc/source/ui/vba/vbaformat.hxx
+++ b/sc/source/ui/vba/vbaformat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,3 +107,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx
index 99d8a579956a..9874a44c2618 100644
--- a/sc/source/ui/vba/vbaformatcondition.cxx
+++ b/sc/source/ui/vba/vbaformatcondition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ ScVbaFormatCondition::Modify( ::sal_Int32 _nType, const uno::Any& _aOperator, co
try
{
ScVbaFormatConditions* pFormatConditions = lcl_getScVbaFormatConditionsPtr( moFormatConditions );
- pFormatConditions->removeFormatCondition(msStyleName, sal_False);
+ pFormatConditions->removeFormatCondition(msStyleName, false);
pFormatConditions->Add(_nType, _aOperator, _aFormula1, _aFormula2, mxStyle);
}
catch (uno::Exception& )
@@ -174,3 +175,5 @@ ScVbaFormatCondition::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformatcondition.hxx b/sc/source/ui/vba/vbaformatcondition.hxx
index 075dbf658203..aa1a3e5bb740 100644
--- a/sc/source/ui/vba/vbaformatcondition.hxx
+++ b/sc/source/ui/vba/vbaformatcondition.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx
index 8dd67843ec00..ddf8ef4247dd 100644
--- a/sc/source/ui/vba/vbaformatconditions.cxx
+++ b/sc/source/ui/vba/vbaformatconditions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,18 +46,6 @@ static rtl::OUString FORMULA2( RTL_CONSTASCII_USTRINGPARAM("Formula2") );
static rtl::OUString STYLENAME( RTL_CONSTASCII_USTRINGPARAM("StyleName") );
static rtl::OUString sStyleNamePrefix( RTL_CONSTASCII_USTRINGPARAM("Excel_CondFormat") );
-ScVbaFormatConditions::ScVbaFormatConditions( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< sheet::XSheetConditionalEntries >& _xSheetConditionalEntries, const uno::Reference< frame::XModel >& /*xModel*/ ) : ScVbaFormatConditions_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( _xSheetConditionalEntries, uno::UNO_QUERY_THROW ) ), mxSheetConditionalEntries( _xSheetConditionalEntries )
-{
- mxRangeParent.set( xParent, uno::UNO_QUERY_THROW );
- uno::Reference< excel::XApplication> xApp( Application(), uno::UNO_QUERY_THROW );
- mxStyles.set( xApp->getThisWorkbook()->Styles( uno::Any() ), uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XCellRangeAddressable > xCellRange( mxRangeParent->getCellRange(), uno::UNO_QUERY_THROW );
- mxParentRangePropertySet.set( xCellRange, uno::UNO_QUERY_THROW );
-
- table::CellRangeAddress rangeAddress = xCellRange->getRangeAddress();
- maCellAddress = table::CellAddress( rangeAddress.Sheet, rangeAddress.StartColumn, rangeAddress.StartRow );
-}
-
void SAL_CALL
ScVbaFormatConditions::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
{
@@ -299,3 +288,4 @@ ScVbaFormatConditions::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaformatconditions.hxx b/sc/source/ui/vba/vbaformatconditions.hxx
index 7dfa065ea8b6..01570c1e8da4 100644
--- a/sc/source/ui/vba/vbaformatconditions.hxx
+++ b/sc/source/ui/vba/vbaformatconditions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,13 +44,12 @@ class ScVbaFormatConditions: public ScVbaFormatConditions_BASE
css::uno::Reference< ov::excel::XRange > mxRangeParent;
css::uno::Reference< css::beans::XPropertySet > mxParentRangePropertySet;
public:
- ScVbaFormatConditions( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::sheet::XSheetConditionalEntries >&, const css::uno::Reference< css::frame::XModel >& );
void notifyRange() throw ( css::script::BasicErrorException );
virtual css::uno::Reference< ov::excel::XFormatCondition > Add( ::sal_Int32 Type, const css::uno::Any& Operator, const css::uno::Any& Formula1, const css::uno::Any& Formula2, const css::uno::Reference< ov::excel::XStyle >& _xCalcStyle ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
rtl::OUString getA1Formula(const css::uno::Any& _aFormula) throw ( css::script::BasicErrorException );
rtl::OUString getStyleName();
void removeFormatCondition( const rtl::OUString& _sStyleName, sal_Bool _bRemoveStyle) throw ( css::script::BasicErrorException );
- css::uno::Reference< css::sheet::XSheetConditionalEntries > getSheetConditionalEntries() { return mxSheetConditionalEntries; }
+ css::uno::Reference< css::sheet::XSheetConditionalEntries > getSheetConditionalEntries() const { return mxSheetConditionalEntries; }
// XFormatConditions
virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XFormatCondition > SAL_CALL Add( ::sal_Int32 Type, const css::uno::Any& Operator, const css::uno::Any& Formula1, const css::uno::Any& Formula2 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
@@ -63,3 +63,5 @@ public:
};
#endif //SC_VBA_AXES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafoundfiles.cxx b/sc/source/ui/vba/vbafoundfiles.cxx
new file mode 100644
index 000000000000..efbddd3451b1
--- /dev/null
+++ b/sc/source/ui/vba/vbafoundfiles.cxx
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbafoundfiles.hxx"
+
+////////////////////////////////VbaFoundFilesEnum//////////////////////////////////////////
+VbaFoundFilesEnum::VbaFoundFilesEnum() : m_nIndex(0)
+{
+
+}
+
+VbaFoundFilesEnum::VbaFoundFilesEnum( css::uno::Sequence<rtl::OUString>& sFileList ) : m_nIndex(0), m_sFileList(sFileList)
+{
+
+}
+
+VbaFoundFilesEnum::~VbaFoundFilesEnum()
+{
+
+}
+
+void VbaFoundFilesEnum::SetFileList( css::uno::Sequence<rtl::OUString>& sFileList )
+{
+ m_nIndex = 0;
+ m_sFileList = sFileList;
+}
+
+sal_Int32 SAL_CALL VbaFoundFilesEnum::getCount() throw (css::uno::RuntimeException)
+{
+ return m_sFileList.getLength();
+}
+
+css::uno::Any SAL_CALL VbaFoundFilesEnum::getByIndex( sal_Int32 nIndex )
+ throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ if ( nIndex >= getCount() )
+ {
+ throw css::lang::IndexOutOfBoundsException();
+ }
+
+ return css::uno::makeAny( m_sFileList[nIndex] );
+}
+
+css::uno::Type SAL_CALL VbaFoundFilesEnum::getElementType() throw (css::uno::RuntimeException)
+{
+ return getCppuType((css::uno::Reference< css::container::XIndexAccess >*)0);
+}
+
+sal_Bool SAL_CALL VbaFoundFilesEnum::hasElements() throw (css::uno::RuntimeException)
+{
+ return ( getCount() != 0 );
+}
+
+sal_Bool SAL_CALL VbaFoundFilesEnum::hasMoreElements() throw (css::uno::RuntimeException)
+{
+ if ( getCount() > m_nIndex )
+ {
+ return sal_True;
+ }
+ return false;
+}
+
+css::uno::Any SAL_CALL VbaFoundFilesEnum::nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ if ( !hasMoreElements() )
+ {
+ throw css::container::NoSuchElementException();
+ }
+
+ return css::uno::makeAny( m_sFileList[m_nIndex++] );
+}
+
+////////////////////////////////VbaFoundFiles//////////////////////////////////////////
+VbaFoundFiles::VbaFoundFiles( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess
+ ) : VbaFoundFilesImpl_BASE( xParent, xContext, xIndexAccess )
+{
+
+}
+
+VbaFoundFiles::~VbaFoundFiles()
+{
+
+}
+
+css::uno::Reference< css::container::XEnumeration > VbaFoundFiles::createEnumeration() throw (css::uno::RuntimeException)
+{
+ css::uno::Reference< css::container::XEnumeration > xEnumRet( m_xIndexAccess, css::uno::UNO_QUERY );
+ return xEnumRet;
+}
+
+css::uno::Any VbaFoundFiles::createCollectionObject( const css::uno::Any& aSource )
+{
+ return aSource;
+}
+
+css::uno::Type VbaFoundFiles::getElementType() throw (css::uno::RuntimeException)
+{
+ return ov::XFoundFiles::static_type(0);
+}
+
+rtl::OUString& VbaFoundFiles::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFoundFiles") );
+ return sImplName;
+}
+
+css::uno::Sequence< rtl::OUString > VbaFoundFiles::getServiceNames()
+{
+ static css::uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FoundFiles") );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbafoundfiles.hxx b/sc/source/ui/vba/vbafoundfiles.hxx
new file mode 100644
index 000000000000..7a0a1e7b2a19
--- /dev/null
+++ b/sc/source/ui/vba/vbafoundfiles.hxx
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 SC_VBA_FOUNDFILES_HXX
+#define SC_VBA_FOUNDFILES_HXX
+
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <ooo/vba/XFoundFiles.hpp>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+namespace css = ::com::sun::star;
+
+typedef CollTestImplHelper< ooo::vba::XFoundFiles > VbaFoundFilesImpl_BASE;
+
+class VbaFoundFilesEnum : public cppu::WeakImplHelper2< css::container::XIndexAccess, css::container::XEnumeration >
+{
+private:
+ sal_Int32 m_nIndex;
+ css::uno::Sequence< rtl::OUString > m_sFileList;
+
+public:
+ VbaFoundFilesEnum();
+ VbaFoundFilesEnum( css::uno::Sequence< rtl::OUString >& sFileList );
+ ~VbaFoundFilesEnum();
+
+ void SetFileList( css::uno::Sequence< rtl::OUString >& sFileList );
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ // XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException);
+
+ // XEnumeration
+ virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException);
+};
+
+class VbaFoundFiles : public VbaFoundFilesImpl_BASE
+{
+private:
+
+public:
+ VbaFoundFiles( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess );
+ virtual ~VbaFoundFiles();
+
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence< rtl::OUString > getServiceNames();
+};
+
+#endif /* SC_VBA_FOUNDFILES_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index c70a7f83726d..59b8108858d5 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,13 @@
#include <vbahelper/helperdecl.hxx>
#include "vbaglobals.hxx"
+#include <sal/macros.h>
+
#include <comphelper/unwrapargs.hxx>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <cppuhelper/component_context.hxx>
-
#include "vbaapplication.hxx"
#include "vbaworksheet.hxx"
#include "vbarange.hxx"
@@ -55,7 +57,7 @@ ScVbaGlobals::ScVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Referen
OSL_TRACE("ScVbaGlobals::ScVbaGlobals()");
uno::Sequence< beans::PropertyValue > aInitArgs( 2 );
- aInitArgs[ 0 ].Name = rtl::OUString::createFromAscii("Application");
+ aInitArgs[ 0 ].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Application"));
aInitArgs[ 0 ].Value = uno::makeAny( getApplication() );
aInitArgs[ 1 ].Name = sDocCtxName;
aInitArgs[ 1 ].Value = uno::makeAny( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ) );
@@ -99,8 +101,8 @@ ScVbaGlobals::getActiveWorkbook() throw (uno::RuntimeException)
return xWorkbook;
}
// FIXME check if this is correct/desired behavior
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "No activeWorkbook available" ), Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "No activeWorkbook available" )), Reference< uno::XInterface >() );
}
@@ -247,6 +249,12 @@ ScVbaGlobals::getDebug() throw (uno::RuntimeException)
return uno::Any();
}
+uno::Any SAL_CALL
+ScVbaGlobals::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
+{
+ return uno::Any( getApplication()->MenuBars(aIndex) );
+}
+
uno::Sequence< ::rtl::OUString > SAL_CALL
ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException)
{
@@ -263,7 +271,7 @@ ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException)
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Hyperlink" ) ),
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.script.vba.VBASpreadsheetEventProcessor" ) )
};
- sal_Int32 nExcelServices = ( sizeof( names )/ sizeof( names[0] ) );
+ sal_Int32 nExcelServices = ( SAL_N_ELEMENTS(names) );
sal_Int32 startIndex = serviceNames.getLength();
serviceNames.realloc( serviceNames.getLength() + nExcelServices );
for ( sal_Int32 index = 0; index < nExcelServices; ++index )
@@ -302,3 +310,4 @@ extern sdecl::ServiceDecl const serviceDecl(
"ooo.vba.excel.Globals" );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx
index f22e5b19faa4..a320ebdf94f6 100644
--- a/sc/source/ui/vba/vbaglobals.hxx
+++ b/sc/source/ui/vba/vbaglobals.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,6 +85,7 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XApplication > SAL_CALL getExcel() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getDebug() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
// XMultiServiceFactory
@@ -93,3 +95,5 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx
index ff6e78249650..adc7b2493b88 100644
--- a/sc/source/ui/vba/vbahelper.cxx
+++ b/sc/source/ui/vba/vbahelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,7 +82,7 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
if( !xIntrospection.is() )
{
uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW );
+ xIntrospection.set( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Introspection") ) ), uno::UNO_QUERY_THROW );
}
return xIntrospection->inspect( aObject );
}
@@ -130,7 +131,7 @@ private:
bool getReplaceCellsWarning() throw ( uno::RuntimeException )
{
- sal_Bool res = sal_False;
+ sal_Bool res = false;
getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
return ( res == sal_True );
}
@@ -208,7 +209,7 @@ implnCut()
void implnPasteSpecial(sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
{
PasteCellsWarningReseter resetWarningBox;
- sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
+ sal_Bool bAsLink(false), bOtherDoc(false);
InsCellCmd eMoveMode = INS_NONE;
ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell();
@@ -270,7 +271,7 @@ getCurrentDocument() throw (uno::RuntimeException)
if ( pCompVar )
{
aModel = sbxToUnoValue( pCompVar );
- if ( sal_False == ( aModel >>= xModel ) ||
+ if ( false == ( aModel >>= xModel ) ||
!xModel.is() )
{
// trying last gasp try the current component
@@ -278,7 +279,7 @@ getCurrentDocument() throw (uno::RuntimeException)
// test if vba service is present
uno::Reference< uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
uno::Reference<lang::XMultiComponentFactory > xSMgr( xCtx->getServiceManager(), uno::UNO_QUERY_THROW );
- uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), xCtx), uno::UNO_QUERY_THROW );
xModel.set( xDesktop->getCurrentComponent(), uno::UNO_QUERY );
if ( !xModel.is() )
{
@@ -393,8 +394,8 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C
sal_Int32 nTo = 0;
sal_Int32 nFrom = 0;
sal_Int16 nCopies = 1;
- sal_Bool bPreview = sal_False;
- sal_Bool bCollate = sal_False;
+ sal_Bool bPreview = false;
+ sal_Bool bCollate = false;
sal_Bool bSelection = bUseSelection;
From >>= nFrom;
To >>= nTo;
@@ -443,7 +444,7 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C
}
SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
aArgs.Put( sfxSelection, sfxSelection.Which() );
- SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False );
+ SfxBoolItem sfxAsync( SID_ASYNCHRON, false );
aArgs.Put( sfxAsync, sfxAsync.Which() );
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
@@ -490,7 +491,7 @@ rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeEx
{
case uno::TypeClass_BOOLEAN:
{
- sal_Bool bBool = sal_False;
+ sal_Bool bBool = false;
pvargItem >>= bBool;
sString = rtl::OUString::valueOf( bBool );
break;
@@ -530,7 +531,7 @@ rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeEx
break;
}
default:
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid type, can't convert" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid type, can't convert" ) ), uno::Reference< uno::XInterface >() );
}
return sString;
}
@@ -756,3 +757,5 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangeObj* pRangeObj )
} // vba
} // ooo
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx
index e37df1e118b4..0a8f8463e390 100644
--- a/sc/source/ui/vba/vbahyperlink.cxx
+++ b/sc/source/ui/vba/vbahyperlink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,7 +100,7 @@ ScVbaHyperlink::ScVbaHyperlink( const uno::Reference< XHelperInterface >& rxAnch
// insert the text field into the document
xText->setString( OUString() );
uno::Reference< text::XTextRange > xRange( xText->createTextCursor(), uno::UNO_QUERY_THROW );
- xText->insertTextContent( xRange, xUrlField, sal_False );
+ xText->insertTextContent( xRange, xUrlField, false );
}
else
{
@@ -244,3 +245,5 @@ extern sdecl::ServiceDecl const serviceDecl(
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbahyperlink.hxx b/sc/source/ui/vba/vbahyperlink.hxx
index e1520b59c15a..36df21cf324c 100644
--- a/sc/source/ui/vba/vbahyperlink.hxx
+++ b/sc/source/ui/vba/vbahyperlink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,3 +87,4 @@ private:
#endif /* SC_VBA_HYPERLINK_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbahyperlinks.cxx b/sc/source/ui/vba/vbahyperlinks.cxx
index 943b51cb7b8c..85c6ae6c218c 100644
--- a/sc/source/ui/vba/vbahyperlinks.cxx
+++ b/sc/source/ui/vba/vbahyperlinks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,11 +46,11 @@ namespace {
bool lclContains( const ScRangeList& rScOuter, const uno::Reference< excel::XRange >& rxInner ) throw (uno::RuntimeException)
{
const ScRangeList& rScInner = ScVbaRange::getScRangeList( rxInner );
- if( (rScInner.Count() == 0) || (rScOuter.Count() == 0) )
+ if( (rScInner.size() == 0) || (rScOuter.size() == 0) )
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Empty range objects" ) ), uno::Reference< uno::XInterface >() );
- for( sal_uLong nIndex = 0, nCount = rScInner.Count(); nIndex < nCount; ++nIndex )
- if( !rScOuter.In( *rScInner.GetObject( nIndex ) ) )
+ for( size_t nIndex = 0, nCount = rScInner.size(); nIndex < nCount; ++nIndex )
+ if( !rScOuter.In( *rScInner[ nIndex ] ) )
return false;
return true;
}
@@ -96,7 +97,7 @@ bool EqualAnchorFunctor::operator()( const uno::Reference< excel::XHyperlink >&
uno::Reference< excel::XRange > xAnchorRange( rxHlink->getRange(), uno::UNO_QUERY_THROW );
const ScRangeList& rScRanges1 = ScVbaRange::getScRangeList( xAnchorRange );
const ScRangeList& rScRanges2 = ScVbaRange::getScRangeList( mxAnchorRange );
- return (rScRanges1.Count() == 1) && (rScRanges2.Count() == 1) && (*rScRanges1.GetObject( 0 ) == *rScRanges2.GetObject( 0 ));
+ return (rScRanges1.size() == 1) && (rScRanges2.size() == 1) && (*rScRanges1[ 0 ] == *rScRanges2[ 0 ]);
}
case office::MsoHyperlinkType::msoHyperlinkShape:
case office::MsoHyperlinkType::msoHyperlinkInlineShape:
@@ -291,3 +292,5 @@ uno::Any ScVbaHyperlinks::createCollectionObject( const uno::Any& rSource )
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaHyperlinks, "ooo.vba.excel.Hyperlinks" )
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbahyperlinks.hxx b/sc/source/ui/vba/vbahyperlinks.hxx
index ca7d990ad6a8..161b236e26fe 100755..100644
--- a/sc/source/ui/vba/vbahyperlinks.hxx
+++ b/sc/source/ui/vba/vbahyperlinks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -148,3 +149,5 @@ private:
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx
index face47767bdc..58675d860a66 100644
--- a/sc/source/ui/vba/vbainterior.cxx
+++ b/sc/source/ui/vba/vbainterior.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,13 +43,13 @@
#include <map>
+#include <sal/macros.h>
#include <svx/xtable.hxx>
#include "vbainterior.hxx"
#include "vbapalette.hxx"
#include "document.hxx"
-#define STATIC_TABLE_SIZE( array ) (sizeof(array)/sizeof(*(array)))
#define COLORMAST 0xFFFFFF
const sal_uInt16 EXC_COLOR_WINDOWBACK = 65;
typedef std::map< sal_Int32, sal_Int32 > PatternMap;
@@ -91,7 +92,6 @@ static PatternMap aPatternMap( lcl_getPatternMap() );
ScVbaInterior::ScVbaInterior( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xProps, ScDocument* pScDoc ) throw ( lang::IllegalArgumentException) : ScVbaInterior_BASE( xParent, xContext ), m_xProps(xProps), m_pScDoc( pScDoc )
{
// auto color
- //m_aPattColor.SetColor( (sal_uInt32)0xFFFFFFFF );
m_aPattColor.SetColor( (sal_uInt32)0x0 );
m_nPattern = 0L;
if ( !m_xProps.is() )
@@ -112,7 +112,6 @@ ScVbaInterior::setColor( const uno::Any& _color ) throw (uno::RuntimeException)
if( _color >>= nColor )
{
SetUserDefinedAttributes( BACKCOLOR, SetAttributeData( XLRGBToOORGB( nColor ) ) );
- //m_xProps->setPropertyValue( BACKCOLOR , XLRGBToOORGB(_color));
SetMixedColor();
}
}
@@ -239,7 +238,7 @@ ScVbaInterior::GetPatternColor( const Color& rPattColor, const Color& rBackColor
0x40, 0x40, 0x20, 0x60, 0x60, 0x60, 0x60, 0x48, // 08 - 15
0x50, 0x70, 0x78 // 16 - 18
};
- return ( nXclPattern < STATIC_TABLE_SIZE( pnRatioTable ) ) ?
+ return ( nXclPattern < SAL_N_ELEMENTS( pnRatioTable ) ) ?
GetMixedColor( rPattColor, rBackColor, pnRatioTable[ nXclPattern ] ) : rPattColor;
}
Color
@@ -252,7 +251,7 @@ ScVbaInterior::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8
GetMixedColorComp( rFore.GetBlue(), rBack.GetBlue(), nTrans ));
}
sal_uInt8
-ScVbaInterior::GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans )
+ScVbaInterior::GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans ) const
{
sal_uInt32 nTemp = ((static_cast< sal_Int32 >( nBack ) - nFore) * nTrans) / 0x80 + nFore;
return static_cast< sal_uInt8 >( nTemp );
@@ -260,7 +259,7 @@ ScVbaInterior::GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 n
uno::Reference< container::XNameContainer >
ScVbaInterior::GetAttributeContainer()
{
- return uno::Reference < container::XNameContainer > ( m_xProps->getPropertyValue( rtl::OUString::createFromAscii( "UserDefinedAttributes" ) ), uno::UNO_QUERY_THROW );
+ return uno::Reference < container::XNameContainer > ( m_xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserDefinedAttributes" )) ), uno::UNO_QUERY_THROW );
}
sal_Int32
ScVbaInterior::GetAttributeData( uno::Any aValue )
@@ -276,8 +275,7 @@ uno::Any
ScVbaInterior::SetAttributeData( sal_Int32 nValue )
{
xml::AttributeData aAttributeData;
- //aAttributeData.Namespace = rtl::OUString::createFromAscii( "ooo.vba.excel.CellPatten");
- aAttributeData.Type = rtl::OUString::createFromAscii( "sal_Int32" );
+ aAttributeData.Type = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "sal_Int32" ));
aAttributeData.Value = rtl::OUString::valueOf( nValue );
return uno::makeAny( aAttributeData );
}
@@ -300,7 +298,7 @@ ScVbaInterior::SetUserDefinedAttributes( const rtl::OUString& sName, const uno::
if( xNameContainer->hasByName( sName ) )
xNameContainer->removeByName( sName );
xNameContainer->insertByName( sName, aValue );
- m_xProps->setPropertyValue( rtl::OUString::createFromAscii( "UserDefinedAttributes" ), uno::makeAny( xNameContainer ) );
+ m_xProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserDefinedAttributes" )), uno::makeAny( xNameContainer ) );
}
}
// OOo do not support below API
@@ -322,7 +320,7 @@ ScVbaInterior::setPattern( const uno::Any& _pattern ) throw (uno::RuntimeExcepti
SetMixedColor();
}
else
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern index" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid Pattern index" )), uno::Reference< uno::XInterface >() );
}
Color
ScVbaInterior::GetBackColor()
@@ -370,7 +368,7 @@ ScVbaInterior::setPatternColor( const uno::Any& _patterncolor ) throw (uno::Runt
SetMixedColor();
}
else
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern Color" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid Pattern Color" )), uno::Reference< uno::XInterface >() );
}
uno::Any SAL_CALL
ScVbaInterior::getPatternColorIndex() throw (uno::RuntimeException)
@@ -393,7 +391,7 @@ ScVbaInterior::setPatternColorIndex( const uno::Any& _patterncolorindex ) throw
setPatternColor( uno::makeAny( OORGBToXLRGB( nPattColor ) ) );
}
else
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Pattern Color" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid Pattern Color" )), uno::Reference< uno::XInterface >() );
}
rtl::OUString&
@@ -415,3 +413,4 @@ ScVbaInterior::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbainterior.hxx b/sc/source/ui/vba/vbainterior.hxx
index 027d06040af9..9dfb14646487 100644
--- a/sc/source/ui/vba/vbainterior.hxx
+++ b/sc/source/ui/vba/vbainterior.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@ class ScVbaInterior : public ScVbaInterior_BASE
protected:
Color GetPatternColor( const Color& rPattColor, const Color& rBackColor, sal_uInt32 nXclPattern );
Color GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans );
- sal_uInt8 GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans );
+ sal_uInt8 GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans ) const;
css::uno::Any GetIndexColor( const sal_Int32& nColorIndex );
sal_Int32 GetColorIndex( const sal_Int32 nColor );
css::uno::Any GetUserDefinedAttributes( const rtl::OUString& sName );
@@ -86,3 +87,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenu.cxx b/sc/source/ui/vba/vbamenu.cxx
new file mode 100644
index 000000000000..ae6d4e4b1223
--- /dev/null
+++ b/sc/source/ui/vba/vbamenu.cxx
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "vbamenu.hxx"
+#include "vbamenuitems.hxx"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : Menu_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl )
+{
+}
+
+::rtl::OUString SAL_CALL
+ScVbaMenu::getCaption() throw ( uno::RuntimeException )
+{
+ return m_xCommandBarControl->getCaption();
+}
+
+void SAL_CALL
+ScVbaMenu::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
+{
+ m_xCommandBarControl->setCaption( _caption );
+}
+
+void SAL_CALL
+ScVbaMenu::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ m_xCommandBarControl->Delete();
+}
+
+uno::Any SAL_CALL
+ScVbaMenu::MenuItems( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) );
+ if( aIndex.hasValue() )
+ {
+ return xMenuItems->Item( aIndex, uno::Any() );
+ }
+ return uno::makeAny( xMenuItems );
+}
+
+rtl::OUString&
+ScVbaMenu::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenu") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenu::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menu" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenu.hxx b/sc/source/ui/vba/vbamenu.hxx
new file mode 100644
index 000000000000..3141b5718447
--- /dev/null
+++ b/sc/source/ui/vba/vbamenu.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SC_VBA_MENU_HXX
+#define SC_VBA_MENU_HXX
+
+#include <ooo/vba/excel/XMenu.hpp>
+#include <ooo/vba/XCommandBarControl.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenu > Menu_BASE;
+
+class ScVbaMenu : public Menu_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl;
+
+public:
+ ScVbaMenu( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL MenuItems( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif//SC_VBA_MENU_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenubar.cxx b/sc/source/ui/vba/vbamenubar.cxx
new file mode 100644
index 000000000000..1ad19a6a3b51
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubar.cxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "vbamenubar.hxx"
+#include "vbamenus.hxx"
+#include <ooo/vba/XCommandBarControls.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaMenuBar::ScVbaMenuBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBar >& xCommandBar ) throw( uno::RuntimeException ) : MenuBar_BASE( xParent, xContext ), m_xCommandBar( xCommandBar )
+{
+}
+
+uno::Any SAL_CALL
+ScVbaMenuBar::Menus( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBar->Controls( uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenus > xMenus( new ScVbaMenus( this, mxContext, xCommandBarControls ) );
+ if( aIndex.hasValue() )
+ {
+ return xMenus->Item( aIndex, uno::Any() );
+ }
+ return uno::makeAny( xMenus );
+}
+
+rtl::OUString&
+ScVbaMenuBar::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBar") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuBar::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBar" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenubar.hxx b/sc/source/ui/vba/vbamenubar.hxx
new file mode 100644
index 000000000000..15253d4e73cb
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubar.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SC_VBA_MENUBAR_HXX
+#define SC_VBA_MENUBAR_HXX
+
+#include <ooo/vba/excel/XMenuBar.hpp>
+#include <ooo/vba/XCommandBar.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuBar > MenuBar_BASE;
+
+class ScVbaMenuBar : public MenuBar_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBar > m_xCommandBar;
+
+public:
+ ScVbaMenuBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBar >& xCommandBar ) throw( css::uno::RuntimeException );
+
+ virtual css::uno::Any SAL_CALL Menus( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif//SC_VBA_MENUBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenubars.cxx b/sc/source/ui/vba/vbamenubars.cxx
new file mode 100644
index 000000000000..1c06e737bdd2
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubars.cxx
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "vbamenubars.hxx"
+#include "vbamenubar.hxx"
+#include <ooo/vba/excel/XlSheetType.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuBarEnumeration_BASE;
+
+class MenuBarEnumeration : public MenuBarEnumeration_BASE
+{
+ uno::Reference< XHelperInterface > m_xParent;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ uno::Reference< container::XEnumeration > m_xEnumeration;
+public:
+ MenuBarEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration )
+ {
+ }
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ return m_xEnumeration->hasMoreElements();
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ // FIXME: should be add menubar
+ if( hasMoreElements() )
+ {
+ uno::Reference< XCommandBar > xCommandBar( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( m_xParent, m_xContext, xCommandBar ) );
+ return uno::makeAny( xMenuBar );
+ }
+ else
+ throw container::NoSuchElementException();
+ return uno::Any();
+ }
+};
+
+ScVbaMenuBars::ScVbaMenuBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBars >& xCommandBars ) throw ( uno::RuntimeException ) : MenuBars_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBars( xCommandBars )
+{
+}
+
+ScVbaMenuBars::~ScVbaMenuBars()
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaMenuBars::getElementType() throw ( uno::RuntimeException )
+{
+ return excel::XMenuBar::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaMenuBars::createEnumeration() throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBars, uno::UNO_QUERY_THROW );
+ return uno::Reference< container::XEnumeration >( new MenuBarEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) );
+}
+
+uno::Any
+ScVbaMenuBars::createCollectionObject( const uno::Any& aSource )
+{
+ // make no sense
+ return aSource;
+}
+
+sal_Int32 SAL_CALL
+ScVbaMenuBars::getCount() throw(css::uno::RuntimeException)
+{
+ return m_xCommandBars->getCount();
+}
+
+// ScVbaCollectionBaseImpl
+uno::Any SAL_CALL
+ScVbaMenuBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
+{
+ sal_Int16 nIndex = 0;
+ aIndex >>= nIndex;
+ if( nIndex == excel::XlSheetType::xlWorksheet )
+ {
+ uno::Any aSource;
+ aSource <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Worksheet Menu Bar" ));
+ uno::Reference< XCommandBar > xCommandBar( m_xCommandBars->Item( aSource, uno::Any() ), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( this, mxContext, xCommandBar ) );
+ return uno::makeAny( xMenuBar );
+ }
+
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
+
+ return uno::Any();
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaMenuBars::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBars") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuBars::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBars" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenubars.hxx b/sc/source/ui/vba/vbamenubars.hxx
new file mode 100644
index 000000000000..2579eb74f8aa
--- /dev/null
+++ b/sc/source/ui/vba/vbamenubars.hxx
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SC_VBA_MENUBARS_HXX
+#define SC_VBA_MENUBARS_HXX
+
+#include <ooo/vba/excel/XMenuBars.hpp>
+#include <ooo/vba/excel/XMenuBar.hpp>
+#include <ooo/vba/XCommandBars.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::excel::XMenuBars > MenuBars_BASE;
+
+class ScVbaMenuBars : public MenuBars_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBars > m_xCommandBars;
+
+public:
+ ScVbaMenuBars( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBars >& xCommandBars ) throw (css::uno::RuntimeException);
+ virtual ~ScVbaMenuBars();
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_MENUBARS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenuitem.cxx b/sc/source/ui/vba/vbamenuitem.cxx
new file mode 100644
index 000000000000..8843544f31f0
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitem.cxx
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "vbamenuitem.hxx"
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+ScVbaMenuItem::ScVbaMenuItem( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : MenuItem_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl )
+{
+}
+
+::rtl::OUString SAL_CALL
+ScVbaMenuItem::getCaption() throw ( uno::RuntimeException )
+{
+ return m_xCommandBarControl->getCaption();
+}
+
+void SAL_CALL
+ScVbaMenuItem::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
+{
+ m_xCommandBarControl->setCaption( _caption );
+}
+
+::rtl::OUString SAL_CALL
+ScVbaMenuItem::getOnAction() throw ( uno::RuntimeException )
+{
+ return m_xCommandBarControl->getOnAction();
+}
+
+void SAL_CALL
+ScVbaMenuItem::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException)
+{
+ m_xCommandBarControl->setOnAction( _onaction );
+}
+
+void SAL_CALL
+ScVbaMenuItem::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ m_xCommandBarControl->Delete();
+}
+
+rtl::OUString&
+ScVbaMenuItem::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItem") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuItem::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItem" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenuitem.hxx b/sc/source/ui/vba/vbamenuitem.hxx
new file mode 100644
index 000000000000..5c22b3409a28
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitem.hxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SC_VBA_MENUITEM_HXX
+#define SC_VBA_MENUITEM_HXX
+
+#include <ooo/vba/excel/XMenuItem.hpp>
+#include <ooo/vba/XCommandBarControl.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+
+typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuItem > MenuItem_BASE;
+
+class ScVbaMenuItem : public MenuItem_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl;
+
+public:
+ ScVbaMenuItem( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException );
+
+ virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+#endif//SC_VBA_MENUITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenuitems.cxx b/sc/source/ui/vba/vbamenuitems.cxx
new file mode 100644
index 000000000000..5722830fce0a
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitems.cxx
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "vbamenuitems.hxx"
+#include "vbamenuitem.hxx"
+#include "vbamenu.hxx"
+#include <ooo/vba/office/MsoControlType.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE;
+
+class MenuEnumeration : public MenuEnumeration_BASE
+{
+ uno::Reference< XHelperInterface > m_xParent;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ uno::Reference< container::XEnumeration > m_xEnumeration;
+public:
+ MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration )
+ {
+ }
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ return m_xEnumeration->hasMoreElements();
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ // FIXME: should be add menu
+ if( hasMoreElements() )
+ {
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup )
+ {
+ uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) );
+ return uno::makeAny( xMenu );
+ }
+ else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton )
+ {
+ uno::Reference< excel::XMenuItem > xMenuItem( new ScVbaMenuItem( m_xParent, m_xContext, xCommandBarControl ) );
+ return uno::makeAny( xMenuItem );
+ }
+ nextElement();
+ }
+ else
+ throw container::NoSuchElementException();
+ return uno::Any();
+ }
+};
+
+ScVbaMenuItems::ScVbaMenuItems( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : MenuItems_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls )
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaMenuItems::getElementType() throw ( uno::RuntimeException )
+{
+ return excel::XMenuItem::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaMenuItems::createEnumeration() throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW );
+ return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) );
+}
+
+uno::Any
+ScVbaMenuItems::createCollectionObject( const uno::Any& aSource )
+{
+ // make no sense
+ return aSource;
+}
+
+sal_Int32 SAL_CALL
+ScVbaMenuItems::getCount() throw(css::uno::RuntimeException)
+{
+ // FIXME: should check if it is a popup menu
+ return m_xCommandBarControls->getCount();
+}
+
+// ScVbaCollectionBaseImpl
+uno::Any SAL_CALL
+ScVbaMenuItems::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
+{
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup )
+ return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) );
+ else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton )
+ return uno::makeAny( uno::Reference< excel::XMenuItem > ( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) ) );
+ throw uno::RuntimeException();
+}
+
+uno::Reference< excel::XMenuItem > SAL_CALL ScVbaMenuItems::Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& /*ShortcutKey*/, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& /*StatusBar*/, const css::uno::Any& /*HelpFile*/, const css::uno::Any& /*HelpContextID*/ ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
+{
+ sal_Int32 nType = office::MsoControlType::msoControlButton;
+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore );
+ xCommandBarControl->setCaption( Caption );
+ if( OnAction.hasValue() )
+ {
+ rtl::OUString sAction;
+ OnAction >>= sAction;
+ xCommandBarControl->setOnAction( sAction );
+ }
+ return uno::Reference< excel::XMenuItem >( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) );
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaMenuItems::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItems") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenuItems::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItems" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenuitems.hxx b/sc/source/ui/vba/vbamenuitems.hxx
new file mode 100644
index 000000000000..8a8dd6021b2d
--- /dev/null
+++ b/sc/source/ui/vba/vbamenuitems.hxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SC_VBA_MENUITEMS_HXX
+#define SC_VBA_MENUITEMS_HXX
+
+#include <ooo/vba/excel/XMenuItems.hpp>
+#include <ooo/vba/excel/XMenuItem.hpp>
+#include <ooo/vba/XCommandBarControls.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::excel::XMenuItems > MenuItems_BASE;
+
+class ScVbaMenuItems : public MenuItems_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls;
+
+public:
+ ScVbaMenuItems( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException );
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ // Methods
+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::excel::XMenuItem > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& ShortcutKey, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& StatusBar, const css::uno::Any& HelpFile, const css::uno::Any& HelpContextID ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_MENUITEMS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenus.cxx b/sc/source/ui/vba/vbamenus.cxx
new file mode 100644
index 000000000000..e604d7b59242
--- /dev/null
+++ b/sc/source/ui/vba/vbamenus.cxx
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "vbamenus.hxx"
+#include "vbamenu.hxx"
+#include <ooo/vba/office/MsoControlType.hpp>
+
+using namespace com::sun::star;
+using namespace ooo::vba;
+
+
+typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE;
+
+class MenuEnumeration : public MenuEnumeration_BASE
+{
+ uno::Reference< XHelperInterface > m_xParent;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ uno::Reference< container::XEnumeration > m_xEnumeration;
+public:
+ MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration )
+ {
+ }
+ virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException )
+ {
+ return m_xEnumeration->hasMoreElements();
+ }
+ virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
+ {
+ // FIXME: should be add menu
+ if( hasMoreElements() )
+ {
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup )
+ {
+ uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) );
+ return uno::makeAny( xMenu );
+ }
+ nextElement();
+ }
+ else
+ throw container::NoSuchElementException();
+ return uno::Any();
+ }
+};
+
+ScVbaMenus::ScVbaMenus( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : Menus_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls )
+{
+}
+
+// XEnumerationAccess
+uno::Type SAL_CALL
+ScVbaMenus::getElementType() throw ( uno::RuntimeException )
+{
+ return excel::XMenu::static_type( 0 );
+}
+
+uno::Reference< container::XEnumeration >
+ScVbaMenus::createEnumeration() throw ( uno::RuntimeException )
+{
+ uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW );
+ return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) );
+}
+
+uno::Any
+ScVbaMenus::createCollectionObject( const uno::Any& aSource )
+{
+ // make no sense
+ return aSource;
+}
+
+sal_Int32 SAL_CALL
+ScVbaMenus::getCount() throw(css::uno::RuntimeException)
+{
+ // FIXME: should check if it is a popup menu
+ return m_xCommandBarControls->getCount();
+}
+
+// ScVbaCollectionBaseImpl
+uno::Any SAL_CALL
+ScVbaMenus::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException )
+{
+ uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW );
+ if( xCommandBarControl->getType() != office::MsoControlType::msoControlPopup )
+ throw uno::RuntimeException();
+ return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) );
+}
+
+uno::Reference< excel::XMenu > SAL_CALL ScVbaMenus::Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
+{
+ sal_Int32 nType = office::MsoControlType::msoControlPopup;
+ uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore );
+ xCommandBarControl->setCaption( Caption );
+ return uno::Reference< excel::XMenu >( new ScVbaMenu( this, mxContext, xCommandBarControl ) );
+}
+
+// XHelperInterface
+rtl::OUString&
+ScVbaMenus::getServiceImplName()
+{
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenus") );
+ return sImplName;
+}
+uno::Sequence<rtl::OUString>
+ScVbaMenus::getServiceNames()
+{
+ static uno::Sequence< rtl::OUString > aServiceNames;
+ if ( aServiceNames.getLength() == 0 )
+ {
+ aServiceNames.realloc( 1 );
+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menus" ) );
+ }
+ return aServiceNames;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbamenus.hxx b/sc/source/ui/vba/vbamenus.hxx
new file mode 100644
index 000000000000..a85e73bdb394
--- /dev/null
+++ b/sc/source/ui/vba/vbamenus.hxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Pei Feng Lin <pflin@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SC_VBA_MENUS_HXX
+#define SC_VBA_MENUS_HXX
+
+#include <ooo/vba/excel/XMenus.hpp>
+#include <ooo/vba/excel/XMenu.hpp>
+#include <ooo/vba/XCommandBarControls.hpp>
+#include <vbahelper/vbahelperinterface.hxx>
+#include <vbahelper/vbacollectionimpl.hxx>
+
+typedef CollTestImplHelper< ov::excel::XMenus > Menus_BASE;
+
+class ScVbaMenus : public Menus_BASE
+{
+private:
+ css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls;
+
+public:
+ ScVbaMenus( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException );
+
+ // XEnumerationAccess
+ virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+ virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+
+ // Methods
+ virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< ov::excel::XMenu > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+};
+
+#endif//SC_VBA_MENUS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index 464b167df250..fab19796ced9 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,8 +70,6 @@ ScVbaName::getWorkSheet() throw (css::uno::RuntimeException)
ScVbaName::getName() throw (css::uno::RuntimeException)
{
String sName;
- sName += UniString( getWorkSheet()->getName());
- sName += String::CreateFromAscii("!");
sName += UniString ( mxNamedRange->getName() );
return ::rtl::OUString( sName );
}
@@ -107,78 +106,41 @@ ScVbaName::setVisible( sal_Bool /*bVisible*/ ) throw (css::uno::RuntimeException
::rtl::OUString
ScVbaName::getValue() throw (css::uno::RuntimeException)
{
- ::rtl::OUString sValue = mxNamedRange->getContent();
- ::rtl::OUString sSheetName = getWorkSheet()->getName();
- ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( ";" );
- ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( "," );
- ::rtl::OUString sResult;
- sal_Int32 nFrom = 0;
- sal_Int32 nTo = 0;
- nTo = sValue.indexOf( sSegmentation, nFrom );
- while ( nTo != -1 )
- {
- ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom );
- if ( sTmpValue.toChar() == '$' )
- {
- ::rtl::OUString sTmp = sTmpValue.copy( 1 );
- sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!"));
- sResult += sTmp;
- sResult += sNewSegmentation;
- }
- nFrom = nTo + 1;
- nTo = sValue.indexOf( sSegmentation, nFrom );
- }
- ::rtl::OUString sTmpValue = sValue.copy( nFrom );
- if ( sTmpValue.toChar() == '$' )
+ return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );
+}
+
+::rtl::OUString
+ScVbaName::getValue(const formula::FormulaGrammar::Grammar eGrammar) throw (css::uno::RuntimeException)
+{
+ rtl::OUString sValue = mxNamedRange->getContent();
+ ScDocShell* pDocShell = excel::getDocShell( mxModel );
+ ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
+ String aContent;
+ excel::CompileODFFormulaToExcel( pDoc, sValue, aContent, eGrammar );
+ if ( aContent.Len() > 0 )
{
- ::rtl::OUString sTmp = sTmpValue.copy(1);
- sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!"));
- sResult += sTmp;
+ sValue = aContent;
}
- if (sResult.indexOf('=') != 0)
+ if ( sValue.indexOf('=') != 0 )
{
- sResult = ::rtl::OUString::createFromAscii("=") + sResult;
+ sValue = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=")) + sValue;
}
- return sResult;
+ return sValue;
}
void
ScVbaName::setValue( const ::rtl::OUString & rValue ) throw (css::uno::RuntimeException)
{
- ::rtl::OUString sSheetName = getWorkSheet()->getName();
::rtl::OUString sValue = rValue;
- ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( "," );
- ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( ";" );
- ::rtl::OUString sResult;
- sal_Int32 nFrom = 0;
- sal_Int32 nTo = 0;
- if (sValue.indexOf('=') == 0)
+ ScDocShell* pDocShell = excel::getDocShell( mxModel );
+ ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
+ String aContent;
+ excel::CompileExcelFormulaToODF( pDoc, sValue, aContent );
+ if ( aContent.Len() > 0 )
{
- ::rtl::OUString sTmp = sValue.copy(1);
- sValue = sTmp;
+ sValue = aContent;
}
- nTo = sValue.indexOf( sSegmentation, nFrom );
- while ( nTo != -1 )
- {
- ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom );
- sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("."));
- if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName))
- {
- sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue;
- }
- sTmpValue += sNewSegmentation;
- sResult += sTmpValue;
- nFrom = nTo + 1;
- nTo = sValue.indexOf( sSegmentation, nFrom );
- }
- ::rtl::OUString sTmpValue = sValue.copy( nFrom );
- sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("."));
- if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName))
- {
- sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue;
- }
- sResult += sTmpValue;
- mxNamedRange->setContent(sResult);
+ mxNamedRange->setContent( sValue );
}
::rtl::OUString
@@ -208,7 +170,7 @@ ScVbaName::setRefersToLocal( const ::rtl::OUString & rRefersTo ) throw (css::uno
::rtl::OUString
ScVbaName::getRefersToR1C1() throw (css::uno::RuntimeException)
{
- return getRefersTo();
+ return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 );
}
void
@@ -220,7 +182,7 @@ ScVbaName::setRefersToR1C1( const ::rtl::OUString & rRefersTo ) throw (css::uno:
::rtl::OUString
ScVbaName::getRefersToR1C1Local() throw (css::uno::RuntimeException)
{
- return getRefersTo();
+ return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 );
}
void
@@ -267,3 +229,4 @@ ScVbaName::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaname.hxx b/sc/source/ui/vba/vbaname.hxx
index 81b2555a4ce1..fc6d210ffa10 100644
--- a/sc/source/ui/vba/vbaname.hxx
+++ b/sc/source/ui/vba/vbaname.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,8 @@
#include <vbahelper/vbahelperinterface.hxx>
+#include <formula/grammar.hxx>
+
class ScDocument;
typedef InheritedHelperInterfaceImpl1< ov::excel::XName > NameImpl_BASE;
@@ -48,6 +51,8 @@ class ScVbaName : public NameImpl_BASE
protected:
virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; }
virtual css::uno::Reference< ov::excel::XWorksheet > getWorkSheet() throw (css::uno::RuntimeException);
+ // Get value by FormulaGrammar, such as FormulaGrammar::GRAM_NATIVE_XL_R1C1
+ virtual ::rtl::OUString SAL_CALL getValue(const formula::FormulaGrammar::Grammar eGrammar) throw (css::uno::RuntimeException);
public:
ScVbaName( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRange >& xName , const css::uno::Reference< css::sheet::XNamedRanges >& xNames , const css::uno::Reference< css::frame::XModel >& xModel );
@@ -82,3 +87,4 @@ public:
};
#endif /* SC_VBA_NAME_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index 1386bec7fa70..1e104e7ff5f4 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,13 +81,40 @@ ScVbaNames::getScDocument()
uno::Reference< frame::XModel > xModel( getModel() , uno::UNO_QUERY_THROW );
ScTabViewShell * pTabViewShell = excel::getBestViewShell( xModel );
if ( !pTabViewShell )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("No ViewShell available"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No ViewShell available")), uno::Reference< uno::XInterface >() );
ScViewData* pViewData = pTabViewShell->GetViewData();
if ( !pViewData )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("No ViewData available"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No ViewData available")), uno::Reference< uno::XInterface >() );
return pViewData->GetDocument();
}
+void GetRangeOrRefersTo( const css::uno::Any& RefersTo, const uno::Reference< uno::XComponentContext >& xContext, css::uno::Reference< excel::XRange >& xRange, rtl::OUString& sRefersTo )
+{
+ if ( RefersTo.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ RefersTo >>= sRefersTo;
+ }
+ else if ( RefersTo.getValueTypeClass() == uno::TypeClass_INTERFACE )
+ {
+ RefersTo >>= xRange;
+ }
+ else if ( RefersTo.hasValue() )
+ {
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
+ try
+ {
+ if ( xConverter.is() )
+ {
+ uno::Any aConverted = xConverter->convertTo( RefersTo, getCppuType((rtl::OUString*)0) );
+ aConverted >>= sRefersTo;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+}
+
css::uno::Any
ScVbaNames::Add( const css::uno::Any& Name ,
const css::uno::Any& RefersTo,
@@ -100,7 +128,9 @@ ScVbaNames::Add( const css::uno::Any& Name ,
const css::uno::Any& RefersToR1C1,
const css::uno::Any& RefersToR1C1Local ) throw (css::uno::RuntimeException)
{
+ rtl::OUString sSheetName;
rtl::OUString sName;
+ rtl::OUString sRefersTo;
uno::Reference< excel::XRange > xRange;
if ( Name.hasValue() )
Name >>= sName;
@@ -108,6 +138,12 @@ ScVbaNames::Add( const css::uno::Any& Name ,
NameLocal >>= sName;
if ( sName.getLength() != 0 )
{
+ sal_Int32 nTokenIndex = sName.indexOf('!');
+ if ( nTokenIndex >= 0 )
+ {
+ sSheetName = sName.copy( 0, nTokenIndex );
+ sName = sName.copy( nTokenIndex + 1 );
+ }
if ( !ScRangeData::IsNameValid( sName , getScDocument() ) )
{
::rtl::OUString sResult ;
@@ -120,19 +156,22 @@ ScVbaNames::Add( const css::uno::Any& Name ,
sResult = sName.copy( nIndex );
sName = sResult ;
if ( !ScRangeData::IsNameValid( sName , getScDocument() ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("This Name is a valid ."), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This Name is a invalid .")), uno::Reference< uno::XInterface >() );
}
}
if ( RefersTo.hasValue() || RefersToR1C1.hasValue() || RefersToR1C1Local.hasValue() )
{
if ( RefersTo.hasValue() )
- RefersTo >>= xRange;
+ GetRangeOrRefersTo( RefersTo, mxContext, xRange, sRefersTo );
if ( RefersToR1C1.hasValue() )
- RefersToR1C1 >>= xRange;
+ GetRangeOrRefersTo( RefersToR1C1, mxContext, xRange, sRefersTo );
if ( RefersToR1C1Local.hasValue() )
- RefersToR1C1Local >>= xRange;
+ GetRangeOrRefersTo( RefersToR1C1Local, mxContext, xRange, sRefersTo );
}
+ String aContent;
+ table::CellAddress aPosition;
+ RangeType nType = RT_NAME;
if ( xRange.is() )
{
ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() );
@@ -145,21 +184,36 @@ ScVbaNames::Add( const css::uno::Any& Name ,
ScAddress aPos( static_cast< SCCOL >( aAddr.StartColumn ) , static_cast< SCROW >( aAddr.StartRow ) , static_cast< SCTAB >(aAddr.Sheet ) );
uno::Any xAny2 ;
String sRangeAdd = xRange->Address( xAny2, xAny2 , xAny2 , xAny2, xAny2 );
- String sTmp;
- sTmp += String::CreateFromAscii("$");
- sTmp += UniString(xRange->getWorksheet()->getName());
- sTmp += String::CreateFromAscii(".");
- sTmp += sRangeAdd;
- if ( mxNames.is() )
+ aContent += String::CreateFromAscii("$");
+ aContent += UniString(xRange->getWorksheet()->getName());
+ aContent += String::CreateFromAscii(".");
+ aContent += sRangeAdd;
+ aPosition = table::CellAddress( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow );
+ }
+ else
+ {
+ ScDocShell* pDocShell = excel::getDocShell( mxModel );
+ ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
+ excel::CompileExcelFormulaToODF( pDoc, sRefersTo, aContent );
+ if ( aContent.Len() == 0 )
+ {
+ aContent = sRefersTo;
+ }
+ }
+
+ uno::Reference< sheet::XNamedRange > xNewNamedRange;
+ if ( mxNames.is() )
+ {
+ if ( mxNames->hasByName( sName ) )
{
- RangeType nType = RT_NAME;
- table::CellAddress aCellAddr( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow );
- if ( mxNames->hasByName( sName ) )
- mxNames->removeByName(sName);
- mxNames->addNewByName( sName , rtl::OUString(sTmp) , aCellAddr , (sal_Int32)nType);
- uno::Reference< sheet::XNamedRange > xName( mxNames->getByName( sName ), uno::UNO_QUERY_THROW );
- return uno::Any( uno::Reference< excel::XName >( new ScVbaName( getParent(), mxContext, xName, mxNames, mxModel ) ) );
+ mxNames->removeByName( sName );
}
+ mxNames->addNewByName( sName, rtl::OUString( aContent ), aPosition, (sal_Int32) nType );
+ xNewNamedRange = uno::Reference< sheet::XNamedRange >( mxNames->getByName( sName ), uno::UNO_QUERY );
+ }
+ if ( xNewNamedRange.is() )
+ {
+ return uno::makeAny( uno::Reference< excel::XName >( new ScVbaName( mxParent, mxContext, xNewNamedRange ,mxNames , mxModel ) ) );
}
return css::uno::Any();
}
@@ -205,3 +259,4 @@ ScVbaNames::getServiceNames()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbanames.hxx b/sc/source/ui/vba/vbanames.hxx
index 1997ac6163d7..a3fddb13286d 100644
--- a/sc/source/ui/vba/vbanames.hxx
+++ b/sc/source/ui/vba/vbanames.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,3 +81,4 @@ public:
};
#endif /* SC_VBA_NAMES_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoleobject.cxx b/sc/source/ui/vba/vbaoleobject.cxx
index a35ce4b3120f..05cc60de33d7 100644
--- a/sc/source/ui/vba/vbaoleobject.cxx
+++ b/sc/source/ui/vba/vbaoleobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,18 +38,6 @@
using namespace com::sun::star;
using namespace ooo::vba;
-
-sal_Int32 pt2mm( double pt ) //1/100mm
-{
- return static_cast<sal_Int32>(pt * 0.352778);
-}
-
-double mm2pt( sal_Int32 mm )
-{
- return mm * 2.8345;
-}
-
-
ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
css::uno::Reference< css::drawing::XControlShape > xControlShape )
: OLEObjectImpl_BASE( xParent, xContext ), m_xControlShape( xControlShape )
@@ -67,7 +56,7 @@ ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParen
uno::Reference< uno::XInterface > SAL_CALL
ScVbaOLEObject::getObject() throw (uno::RuntimeException)
{
- return uno::Reference< uno::XInterface >( m_xControlShape, uno::UNO_QUERY_THROW );
+ return uno::Reference< uno::XInterface >( m_xControl, uno::UNO_QUERY_THROW );
}
sal_Bool SAL_CALL
@@ -162,3 +151,5 @@ ScVbaOLEObject::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoleobject.hxx b/sc/source/ui/vba/vbaoleobject.hxx
index 008564d71e16..e329789cd7a4 100644
--- a/sc/source/ui/vba/vbaoleobject.hxx
+++ b/sc/source/ui/vba/vbaoleobject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,4 @@ public:
};
#endif //SC_VBA_OLEOBJECT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx
index 69ba36cf8279..84cba7b96e92 100644
--- a/sc/source/ui/vba/vbaoleobjects.cxx
+++ b/sc/source/ui/vba/vbaoleobjects.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -183,3 +184,5 @@ ScVbaOLEObjects::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoleobjects.hxx b/sc/source/ui/vba/vbaoleobjects.hxx
index ab4ed29d163d..c949d578422a 100644
--- a/sc/source/ui/vba/vbaoleobjects.hxx
+++ b/sc/source/ui/vba/vbaoleobjects.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@ public:
};
#endif //SC_VBA_OLEOBJECTS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoutline.cxx b/sc/source/ui/vba/vbaoutline.cxx
index ee4c78c73151..caf506cdf73b 100644
--- a/sc/source/ui/vba/vbaoutline.cxx
+++ b/sc/source/ui/vba/vbaoutline.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,9 @@ using namespace ::ooo::vba;
void
ScVbaOutline::ShowLevels( const uno::Any& RowLevels, const uno::Any& ColumnLevels ) throw (uno::RuntimeException)
{
- sal_Int16 nLevel = 0;
if (mxOutline.is())
{
+ sal_Int16 nLevel = 0;
if (RowLevels >>= nLevel)
{
mxOutline->showLevel(nLevel, table::TableOrientation_ROWS);
@@ -63,3 +64,5 @@ ScVbaOutline::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaoutline.hxx b/sc/source/ui/vba/vbaoutline.hxx
index c954842cf7fd..4b297a0a9079 100644
--- a/sc/source/ui/vba/vbaoutline.hxx
+++ b/sc/source/ui/vba/vbaoutline.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ public:
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagebreak.cxx b/sc/source/ui/vba/vbapagebreak.cxx
index 1103c10f54c8..fa75e96f6954 100644
--- a/sc/source/ui/vba/vbapagebreak.cxx
+++ b/sc/source/ui/vba/vbapagebreak.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,7 +46,7 @@ template< typename Ifc1 >
sal_Int32 ScVbaPageBreak<Ifc1>::getType() throw (uno::RuntimeException)
{
uno::Any aValue = mxRowColPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )));
- sal_Bool hasPageBreak = sal_False;
+ sal_Bool hasPageBreak = false;
aValue >>= hasPageBreak;
if( !hasPageBreak )
@@ -69,7 +70,7 @@ void ScVbaPageBreak<Ifc1>::setType(sal_Int32 type) throw (uno::RuntimeException)
if( type == excel::XlPageBreak::xlPageBreakNone )
{
- mxRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(sal_False));
+ mxRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(false));
return;
}
@@ -77,13 +78,13 @@ void ScVbaPageBreak<Ifc1>::setType(sal_Int32 type) throw (uno::RuntimeException)
if( type == excel::XlPageBreak::xlPageBreakManual )
maTablePageBreakData.ManualBreak = sal_True;
else
- maTablePageBreakData.ManualBreak = sal_False;
+ maTablePageBreakData.ManualBreak = false;
}
template< typename Ifc1 >
void ScVbaPageBreak<Ifc1>::Delete() throw ( script::BasicErrorException, uno::RuntimeException)
{
- mxRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(sal_False));
+ mxRowColPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsStartOfNewPage" )), uno::makeAny(false));
}
template< typename Ifc1 >
@@ -170,3 +171,4 @@ ScVbaVPageBreak::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagebreak.hxx b/sc/source/ui/vba/vbapagebreak.hxx
index 4832464c1296..c047a8e3c06a 100644
--- a/sc/source/ui/vba/vbapagebreak.hxx
+++ b/sc/source/ui/vba/vbapagebreak.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,3 +102,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx
index 25ccbb0f4cdc..18d785924c8c 100644
--- a/sc/source/ui/vba/vbapagebreaks.cxx
+++ b/sc/source/ui/vba/vbapagebreaks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,10 +116,13 @@ sal_Int32 SAL_CALL RangePageBreaks::getCount( ) throw (uno::RuntimeException)
for( sal_Int32 i=0; i<nLength; i++ )
{
sal_Int32 nPos = aTablePageBreakData[i].Position;
- if( nPos > nUsedEnd )
- return nCount;
- if( nPos >= nUsedStart )
+
+ // All page breaks before the used range should be counted.
+ // And the page break at the end of the used range also should be counted.
+ if( nPos <= nUsedEnd + 1 )
nCount++;
+ else
+ return nCount;
}
return nCount;
@@ -144,26 +148,15 @@ uno::Any SAL_CALL RangePageBreaks::getByIndex( sal_Int32 Index ) throw (lang::In
sheet::TablePageBreakData RangePageBreaks::getTablePageBreakData( sal_Int32 nAPIItemIndex ) throw ( script::BasicErrorException, uno::RuntimeException)
{
- sal_Int32 index = -1;
sheet::TablePageBreakData aTablePageBreakData;
uno::Reference< excel::XWorksheet > xWorksheet( mxParent, uno::UNO_QUERY_THROW );
uno::Reference< excel::XRange > xRange = xWorksheet->getUsedRange();
- sal_Int32 nUsedStart = getAPIStartofRange( xRange );
- sal_Int32 nUsedEnd = getAPIEndIndexofRange( xRange, nUsedStart );
uno::Sequence<sheet::TablePageBreakData> aTablePageBreakDataList = getAllPageBreaks();
sal_Int32 nLength = aTablePageBreakDataList.getLength();
- for( sal_Int32 i=0; i<nLength; i++ )
- {
- aTablePageBreakData = aTablePageBreakDataList[i];
- sal_Int32 nPos = aTablePageBreakData.Position;
- if( nPos >= nUsedStart )
- index++;
- if( nPos > nUsedEnd )
- DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
- if( index == nAPIItemIndex )
- return aTablePageBreakData;
- }
+ // No need to filter the page break. All page breaks before the used range are counted.
+ if ( nAPIItemIndex < nLength && nAPIItemIndex>=0 )
+ aTablePageBreakData = aTablePageBreakDataList[nAPIItemIndex];
return aTablePageBreakData;
}
@@ -212,7 +205,7 @@ public:
ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< XHelperInterface >& xParent,
const uno::Reference< uno::XComponentContext >& xContext,
uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak) throw (uno::RuntimeException):
- ScVbaHPageBreaks_BASE( xParent,xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_False )),
+ ScVbaHPageBreaks_BASE( xParent,xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, false )),
mxSheetPageBreak( xSheetPageBreak )
{
}
@@ -325,3 +318,4 @@ ScVbaVPageBreaks::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagebreaks.hxx b/sc/source/ui/vba/vbapagebreaks.hxx
index de6174191e95..5b8feb57c221 100644
--- a/sc/source/ui/vba/vbapagebreaks.hxx
+++ b/sc/source/ui/vba/vbapagebreaks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,3 +96,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx
index 3ad50b07fa3e..f01e06a64a50 100644
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,10 @@
#include <ooo/vba/excel/XlPageOrientation.hpp>
#include <ooo/vba/excel/XlOrder.hpp>
#include <ooo/vba/excel/Constants.hpp>
+#include <i18npool/paper.hxx>
+#include <editeng/paperinf.hxx>
+#include <ooo/vba/excel/XlPaperSize.hpp>
+#include <sal/macros.h>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -96,7 +101,7 @@ void SAL_CALL ScVbaPageSetup::setPrintArea( const rtl::OUString& rAreas ) throw
{
uno::Reference< sheet::XPrintAreas > xPrintAreas( mxSheet, uno::UNO_QUERY_THROW );
if( rAreas.getLength() == 0 ||
- rAreas.equalsIgnoreAsciiCase ( rtl::OUString::createFromAscii("FALSE") ) )
+ rAreas.equalsIgnoreAsciiCase ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FALSE")) ) )
{
// print the whole sheet
uno::Sequence< table::CellRangeAddress > aSeq;
@@ -108,10 +113,10 @@ void SAL_CALL ScVbaPageSetup::setPrintArea( const rtl::OUString& rAreas ) throw
ScRange aRange;
if( getScRangeListForAddress( rAreas, excel::getDocShell( mxModel ) , aRange, aCellRanges ) )
{
- uno::Sequence< table::CellRangeAddress > aSeq( aCellRanges.Count() );
- sal_uInt16 i=0;
- for( ScRange* pRange = aCellRanges.First(); pRange; pRange = aCellRanges.Next() )
+ uno::Sequence< table::CellRangeAddress > aSeq( aCellRanges.size() );
+ for ( size_t i = 0, nRanges = aCellRanges.size(); i < nRanges; ++i )
{
+ ScRange* pRange = aCellRanges[ i ];
table::CellRangeAddress aRangeAddress;
ScUnoConversion::FillApiRange( aRangeAddress, *pRange );
aSeq[ i++ ] = aRangeAddress;
@@ -174,7 +179,7 @@ void SAL_CALL ScVbaPageSetup::setFitToPagesWide( const uno::Any& fitToPagesWide)
sal_uInt16 scaleToPageX = 0;
try
{
- sal_Bool aValue = sal_False;
+ sal_Bool aValue = false;
if( fitToPagesWide.getValueTypeClass() != uno::TypeClass_BOOLEAN || (fitToPagesWide >>= aValue))
{
fitToPagesWide >>= scaleToPageX;
@@ -199,7 +204,7 @@ void SAL_CALL ScVbaPageSetup::setZoom( const uno::Any& zoom) throw (css::uno::Ru
{
if( zoom.getValueTypeClass() == uno::TypeClass_BOOLEAN )
{
- sal_Bool aValue = sal_False;
+ sal_Bool aValue = false;
zoom >>= aValue;
if( aValue )
{
@@ -458,7 +463,7 @@ sal_Int32 SAL_CALL ScVbaPageSetup::getOrder() throw (css::uno::RuntimeException)
try
{
uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrintDownFirst")));
- sal_Bool bPrintDownFirst = sal_False;
+ sal_Bool bPrintDownFirst = false;
aValue >>= bPrintDownFirst;
if( !bPrintDownFirst )
order = excel::XlOrder::xlOverThenDown;
@@ -478,7 +483,7 @@ void SAL_CALL ScVbaPageSetup::setOrder( sal_Int32 order) throw (css::uno::Runtim
case excel::XlOrder::xlDownThenOver:
break;
case excel::XlOrder::xlOverThenDown:
- bOrder = sal_False;
+ bOrder = false;
break;
default:
DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
@@ -533,7 +538,7 @@ void SAL_CALL ScVbaPageSetup::setFirstPageNumber( sal_Int32 firstPageNumber) thr
sal_Bool SAL_CALL ScVbaPageSetup::getCenterVertically() throw (css::uno::RuntimeException)
{
- sal_Bool centerVertically = sal_False;
+ sal_Bool centerVertically = false;
try
{
uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CenterVertically")));
@@ -558,7 +563,7 @@ void SAL_CALL ScVbaPageSetup::setCenterVertically( sal_Bool centerVertically) th
sal_Bool SAL_CALL ScVbaPageSetup::getCenterHorizontally() throw (css::uno::RuntimeException)
{
- sal_Bool centerHorizontally = sal_False;
+ sal_Bool centerHorizontally = false;
try
{
uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CenterHorizontally")));
@@ -583,7 +588,7 @@ void SAL_CALL ScVbaPageSetup::setCenterHorizontally( sal_Bool centerHorizontally
sal_Bool SAL_CALL ScVbaPageSetup::getPrintHeadings() throw (css::uno::RuntimeException)
{
- sal_Bool printHeadings = sal_False;
+ sal_Bool printHeadings = false;
try
{
uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrintHeaders")));
@@ -624,3 +629,104 @@ ScVbaPageSetup::getServiceNames()
}
return aServiceNames;
}
+
+struct PaperSizeMap
+{
+ Paper ePaper;
+ sal_Int32 xlPaper;
+};
+
+static PaperSizeMap paperSizeMappings[] =
+{
+ { PAPER_A3, ooo::vba::excel::XlPaperSize::xlPaperA3 },
+ { PAPER_A4, ooo::vba::excel::XlPaperSize::xlPaperA4 },
+ { PAPER_A5, ooo::vba::excel::XlPaperSize::xlPaperA5 },
+ { PAPER_B4_ISO, ooo::vba::excel::XlPaperSize::xlPaperB4 },
+ { PAPER_B5_ISO, ooo::vba::excel::XlPaperSize::xlPaperB5 },
+ { PAPER_LETTER, ooo::vba::excel::XlPaperSize::xlPaperLetter },
+ { PAPER_LEGAL, ooo::vba::excel::XlPaperSize::xlPaperLegal },
+ { PAPER_TABLOID, ooo::vba::excel::XlPaperSize::xlPaperTabloid },
+ { PAPER_USER, ooo::vba::excel::XlPaperSize::xlPaperUser },
+ { PAPER_B6_ISO, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeB6 },
+ { PAPER_ENV_C4, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC4 },
+ { PAPER_ENV_C5, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC5 },
+ { PAPER_ENV_C6, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC6 },
+ { PAPER_ENV_C65, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC65 },
+ { PAPER_ENV_DL, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeDL },
+ { PAPER_C, ooo::vba::excel::XlPaperSize::xlPaperCsheet },
+ { PAPER_D, ooo::vba::excel::XlPaperSize::xlPaperDsheet },
+ { PAPER_E, ooo::vba::excel::XlPaperSize::xlPaperEsheet },
+ { PAPER_ENV_MONARCH, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeMonarch },
+ { PAPER_ENV_PERSONAL, ooo::vba::excel::XlPaperSize::xlPaperEnvelopePersonal },
+ { PAPER_ENV_9, ooo::vba::excel::XlPaperSize::xlPaperEnvelope9 },
+ { PAPER_ENV_10, ooo::vba::excel::XlPaperSize::xlPaperEnvelope10 },
+ { PAPER_ENV_11, ooo::vba::excel::XlPaperSize::xlPaperEnvelope11 },
+ { PAPER_ENV_12, ooo::vba::excel::XlPaperSize::xlPaperEnvelope12 }
+};
+
+static const int nMapSize = SAL_N_ELEMENTS(paperSizeMappings);
+
+sal_Int32 PaperSizeOOoToExcel(Paper ePaper)
+{
+ sal_Int32 nPaperSize = ooo::vba::excel::XlPaperSize::xlPaperUser;
+
+ for (int i = 0; i < nMapSize; i++)
+ {
+ if (ePaper == paperSizeMappings[i].ePaper)
+ {
+ nPaperSize = paperSizeMappings[i].xlPaper;
+ break;
+ }
+ }
+
+ return nPaperSize;
+}
+
+sal_Int32 SAL_CALL ScVbaPageSetup::getPaperSize() throw (css::uno::RuntimeException)
+{
+ com::sun::star::awt::Size size;
+ Paper ePaper = PAPER_USER;
+
+ try
+ {
+ uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Size")));
+ aValue >>= size;
+ ePaper = SvxPaperInfo::GetSvxPaper( Size(size.Width, size.Height), MAP_100TH_MM, true);
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return PaperSizeOOoToExcel(ePaper);
+}
+
+Paper PaperSizeExcelToOOo( sal_Int32 xlPaper)
+{
+ Paper ePaper = PAPER_USER;
+
+ for (int i = 0; i < nMapSize; i++)
+ {
+ if (xlPaper == paperSizeMappings[i].xlPaper)
+ {
+ ePaper = paperSizeMappings[i].ePaper;
+ break;
+ }
+ }
+
+ return ePaper;
+}
+void SAL_CALL ScVbaPageSetup::setPaperSize( sal_Int32 paperSize) throw (css::uno::RuntimeException)
+{
+ Paper ePaper = PaperSizeExcelToOOo( paperSize );
+
+ try
+ {
+ Size size1 = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM );
+ com::sun::star::awt::Size size(size1.Width(), size1.Height());
+ mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Size")), uno::makeAny( size ));
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagesetup.hxx b/sc/source/ui/vba/vbapagesetup.hxx
index d2c001b225cf..86e92d67f748 100644
--- a/sc/source/ui/vba/vbapagesetup.hxx
+++ b/sc/source/ui/vba/vbapagesetup.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,9 +83,13 @@ public:
virtual void SAL_CALL setCenterHorizontally( sal_Bool centerHorizontally ) throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL getPrintHeadings() throw (css::uno::RuntimeException);
virtual void SAL_CALL setPrintHeadings( sal_Bool printHeadings ) throw (css::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getPaperSize() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setPaperSize( sal_Int32 paperSize ) throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx
index c6ae5c488a20..209dd2d8e564 100644
--- a/sc/source/ui/vba/vbapalette.cxx
+++ b/sc/source/ui/vba/vbapalette.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,6 +27,8 @@
************************************************************************/
#include "vbapalette.hxx"
+
+#include <sal/macros.h>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
@@ -62,7 +65,7 @@ public:
// Methods XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException)
{
- return sizeof(spnDefColorTable8) / sizeof(spnDefColorTable8[0]);
+ return SAL_N_ELEMENTS(spnDefColorTable8);
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
@@ -109,3 +112,5 @@ ScVbaPalette::getPalette() const
return new DefaultPalette();
return xIndex;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapalette.hxx b/sc/source/ui/vba/vbapalette.hxx
index b51483772674..2f5c752e3ebd 100644
--- a/sc/source/ui/vba/vbapalette.hxx
+++ b/sc/source/ui/vba/vbapalette.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ public:
#endif //SC_VBAPALETTE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapane.cxx b/sc/source/ui/vba/vbapane.cxx
index 29d7a286b402..8d606f31571b 100644
--- a/sc/source/ui/vba/vbapane.cxx
+++ b/sc/source/ui/vba/vbapane.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,7 +57,7 @@ ScVbaPane::setScrollColumn( sal_Int32 _scrollcolumn ) throw (uno::RuntimeExcepti
{
if( _scrollcolumn < 1 )
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Column number should not less than 1" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Column number should not less than 1" )),
uno::Reference< uno::XInterface >() );
}
m_xViewPane->setFirstVisibleColumn( _scrollcolumn - 1 );
@@ -73,7 +74,7 @@ ScVbaPane::setScrollRow( sal_Int32 _scrollrow ) throw (uno::RuntimeException)
{
if( _scrollrow < 1 )
{
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Row number should not less than 1" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Row number should not less than 1" )),
uno::Reference< uno::XInterface >() );
}
m_xViewPane->setFirstVisibleRow( _scrollrow - 1 );
@@ -107,7 +108,7 @@ ScVbaPane::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( Down >>= down )
downRows += down;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: Down\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: Down\n" ));
}
if( Up.hasValue() )
{
@@ -115,7 +116,7 @@ ScVbaPane::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( Up >>= up )
downRows -= up;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: Up\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: Up\n" ));
}
if( ToRight.hasValue() )
{
@@ -123,7 +124,7 @@ ScVbaPane::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( ToRight >>= right )
rightCols += right;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: ToRight\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: ToRight\n" ));
}
if( ToLeft.hasValue() )
{
@@ -131,7 +132,7 @@ ScVbaPane::SmallScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( ToLeft >>= left )
rightCols -= left;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: ToLeft\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: ToLeft\n" ));
}
if( messageBuffer.getLength() > 0 )
throw(uno::RuntimeException( messageBuffer, uno::Reference< uno::XInterface >() ) );
@@ -162,7 +163,7 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( Down >>= down )
downPages += down;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: Down\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: Down\n" ));
}
if( Up.hasValue() )
{
@@ -170,7 +171,7 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( Up >>= up )
downPages -= up;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: Up\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: Up\n" ));
}
if( ToRight.hasValue() )
{
@@ -178,7 +179,7 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( ToRight >>= right )
acrossPages += right;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: ToRight\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: ToRight\n" ));
}
if( ToLeft.hasValue() )
{
@@ -186,7 +187,7 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
if( ToLeft >>= left )
acrossPages -= left;
else
- messageBuffer += rtl::OUString::createFromAscii( "Error getting parameter: ToLeft\n" );
+ messageBuffer += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Error getting parameter: ToLeft\n" ));
}
if( messageBuffer.getLength() > 0 )
throw(uno::RuntimeException( messageBuffer, uno::Reference< uno::XInterface >() ) );
@@ -204,3 +205,5 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any
// XHelperInterface
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaPane, "ooo.vba.excel.Pane" )
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapane.hxx b/sc/source/ui/vba/vbapane.hxx
index ff87a9966d80..1590ace30b81 100644
--- a/sc/source/ui/vba/vbapane.hxx
+++ b/sc/source/ui/vba/vbapane.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,7 @@ public:
const css::uno::Reference< css::frame::XModel >& xModel,
const css::uno::Reference< css::sheet::XViewPane > xViewPane ) throw (css::uno::RuntimeException);
- css::uno::Reference< css::sheet::XViewPane > getViewPane() { return m_xViewPane; }
+ css::uno::Reference< css::sheet::XViewPane > getViewPane() const { return m_xViewPane; }
// XPane attributes
virtual sal_Int32 SAL_CALL getScrollColumn() throw (css::uno::RuntimeException);
@@ -65,3 +66,5 @@ protected:
};
#endif //SC_VBA_PANE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivotcache.cxx b/sc/source/ui/vba/vbapivotcache.cxx
index 322b42368b48..7b2b4c6ddf61 100644
--- a/sc/source/ui/vba/vbapivotcache.cxx
+++ b/sc/source/ui/vba/vbapivotcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,17 @@ ScVbaPivotCache::ScVbaPivotCache( const uno::Reference< XHelperInterface >& xPar
{
}
+sal_Int32
+ScVbaPivotCache::getMissingItemsLimit() throw (css::uno::RuntimeException)
+{
+ return -1;
+}
+
+void
+ScVbaPivotCache::setMissingItemsLimit( sal_Int32 /*aValue*/ ) throw ( css::uno::RuntimeException)
+{
+}
+
void SAL_CALL
ScVbaPivotCache::Refresh() throw (css::uno::RuntimeException)
{
@@ -58,3 +70,4 @@ ScVbaPivotCache::getServiceNames()
return aServiceNames;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivotcache.hxx b/sc/source/ui/vba/vbapivotcache.hxx
index dea3e35d18bd..da8c7752bd46 100644
--- a/sc/source/ui/vba/vbapivotcache.hxx
+++ b/sc/source/ui/vba/vbapivotcache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,10 @@ class ScVbaPivotCache : public PivotCacheImpl_BASE
css::uno::Reference< css::sheet::XDataPilotTable > m_xTable;
public:
ScVbaPivotCache( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XDataPilotTable >& xTable );
+
+ virtual ::sal_Int32 SAL_CALL getMissingItemsLimit() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setMissingItemsLimit( ::sal_Int32 aValue ) throw ( css::uno::RuntimeException);
+
virtual void SAL_CALL Refresh() throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
@@ -47,3 +52,5 @@ public:
};
#endif //SC_VBA_PIVOTCACHE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivottable.cxx b/sc/source/ui/vba/vbapivottable.cxx
index e5d78602dcdd..cffd07eeb5e1 100644
--- a/sc/source/ui/vba/vbapivottable.cxx
+++ b/sc/source/ui/vba/vbapivottable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ ScVbaPivotTable::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivottable.hxx b/sc/source/ui/vba/vbapivottable.hxx
index e6e341830489..5f244a8ef95e 100644
--- a/sc/source/ui/vba/vbapivottable.hxx
+++ b/sc/source/ui/vba/vbapivottable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,5 @@ public:
};
#endif //SC_VBA_PIVOTTABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx
index fcbf347a3cd4..b7e090d1a841 100644
--- a/sc/source/ui/vba/vbapivottables.cxx
+++ b/sc/source/ui/vba/vbapivottables.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,3 +93,5 @@ ScVbaPivotTables::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapivottables.hxx b/sc/source/ui/vba/vbapivottables.hxx
index 3354d8a82953..4928756e179b 100644
--- a/sc/source/ui/vba/vbapivottables.hxx
+++ b/sc/source/ui/vba/vbapivottables.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@ public:
};
#endif //SC_VBA_PIVOTTABLES
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapropvalue.cxx b/sc/source/ui/vba/vbapropvalue.cxx
index ff821d17f479..2fdbd16195fe 100644
--- a/sc/source/ui/vba/vbapropvalue.cxx
+++ b/sc/source/ui/vba/vbapropvalue.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,5 @@ ScVbaPropValue::setValue( const css::uno::Any& _value ) throw (css::uno::Runtime
{
m_pListener->setValueEvent( _value );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapropvalue.hxx b/sc/source/ui/vba/vbapropvalue.hxx
index af748dae5585..2cbc37ecc981 100644
--- a/sc/source/ui/vba/vbapropvalue.hxx
+++ b/sc/source/ui/vba/vbapropvalue.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,9 @@ public:
virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
- rtl::OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ rtl::OUString SAL_CALL getDefaultPropertyName() throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
};
#endif //SC_VBA_PROPVALULE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaquerytable.cxx b/sc/source/ui/vba/vbaquerytable.cxx
new file mode 100644
index 000000000000..159c7b75adf2
--- /dev/null
+++ b/sc/source/ui/vba/vbaquerytable.cxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009, 2010.
+ * 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 "vbaquerytable.hxx"
+#include "document.hxx"
+#include "docsh.hxx"
+#include "sfx2/lnkbase.hxx"
+#include "sfx2/linkmgr.hxx"
+#include "arealink.hxx"
+#include "vbarange.hxx"
+
+using namespace com::sun::star;
+
+
+ScVbaQueryTable::ScVbaQueryTable(const css::uno::Reference< ov::XHelperInterface >& /*xParent*/,
+ const css::uno::Reference< css::uno::XComponentContext > & /*xContext*/,
+ ScDocument *pDocument ,
+ ScVbaRange *pParent
+ )
+//:QueryTable_Base(xParent, xContext)
+{
+ m_pDocument = pDocument;
+ m_pParent = pParent;
+}
+
+ScVbaQueryTable::~ScVbaQueryTable()
+{
+
+}
+
+::sal_Bool SAL_CALL
+ScVbaQueryTable::Refresh( const ::com::sun::star::uno::Any& /*aBackgroundQuery*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+
+ //Get parent Info
+ sal_Int32 nRow = m_pParent->getRow();
+ sal_Int32 nClm = m_pParent->getColumn();
+ sal_Int16 nTab = m_pParent->getWorksheet()->getIndex() - 1; //The vba index begin from 1.
+ ScAddress crrRngAddr(nClm, nRow, nTab);
+
+ //Get link info
+ sfx2::LinkManager *pLinkMng = m_pDocument->GetLinkManager();
+ const ::sfx2::SvBaseLinks &rLinks = pLinkMng->GetLinks();
+ sal_uInt16 nCount = rLinks.Count();
+
+ for (sal_uInt16 i=0; i<nCount; i++)
+ {
+ ::sfx2::SvBaseLink* pBase = *rLinks[i];
+ if (pBase->ISA(ScAreaLink))
+ {
+
+ ScAreaLink *pAreaLink = (ScAreaLink *)pBase;
+ const ScRange &destRange = pAreaLink->GetDestArea();
+ if (destRange.In(crrRngAddr))
+ {
+ pBase->Update();
+ }
+ }
+ }
+
+ return sal_True;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaseriescollection.hxx b/sc/source/ui/vba/vbaquerytable.hxx
index f61720102919..f7deea7014cb 100644
--- a/sc/source/ui/vba/vbaseriescollection.hxx
+++ b/sc/source/ui/vba/vbaquerytable.hxx
@@ -1,7 +1,9 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
+ * Copyright IBM Corporation 2009, 2010.
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -24,31 +26,37 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef SC_VBA_SERIESCOLLECTION_HXX
-#define SC_VBA_SERIESCOLLECTION_HXX
-#include <ooo/vba/excel/XSeriesCollection.hpp>
-#include <vbahelper/vbahelperinterface.hxx>
-#include <vbahelper/vbacollectionimpl.hxx>
-#include "excelvbahelper.hxx"
+#ifndef SC_VBA_QUERYTABLE_HXX
+#define SC_VBA_QUERYTABLE_HXX
-typedef CollTestImplHelper< ov::excel::XSeriesCollection > SeriesCollection_BASE;
+#include <ooo/vba/excel/XQueryTable.hpp>
+#include "vbahelper/vbahelperinterface.hxx"
-class ScVbaSeriesCollection : public SeriesCollection_BASE
-{
- css::uno::Reference< css::uno::XComponentContext > m_xContext;
+using namespace ::ooo::vba;
+typedef ::cppu::WeakImplHelper1<excel::XQueryTable> QueryTable_Base;
+
+class ScDocument;
+class ScVbaRange;
+class ScVbaQueryTable : public QueryTable_Base
+{
+private:
+ ScDocument *m_pDocument;
+ ScVbaRange *m_pParent;
public:
- ScVbaSeriesCollection( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext );
- // XEnumerationAccess
- virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
- virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
-
- // SeriesCollection_BASE
- virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
- virtual rtl::OUString& getServiceImplName();
- virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+ ScVbaQueryTable(const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext > & xContext,
+ ScDocument *pDocument = NULL,
+ ScVbaRange *pParent = NULL
+ );
+ ~ScVbaQueryTable();
+ virtual ::sal_Bool SAL_CALL Refresh( const ::com::sun::star::uno::Any& aBackgroundQuery )
+ throw (::com::sun::star::uno::RuntimeException);
+
};
-#endif //SC_VBA_WINDOW_HXX
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 5cb6d44fc902..af6336eb39ea 100755..100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,6 @@
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/sheet/XSpreadsheetView.hpp>
#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
#include <com/sun/star/sheet/XSheetCellRange.hpp>
@@ -56,6 +56,7 @@
#include <com/sun/star/sheet/XSheetCellCursor.hpp>
#include <com/sun/star/sheet/XArrayFormulaRange.hpp>
#include <com/sun/star/sheet/XNamedRange.hpp>
+#include <com/sun/star/sheet/XNamedRanges.hpp>
#include <com/sun/star/sheet/XPrintAreas.hpp>
#include <com/sun/star/sheet/XCellRangesQuery.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -91,12 +92,20 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/awt/XDevice.hpp>
-//#include <com/sun/star/sheet/CellDeleteMode.hpp>
#include <com/sun/star/sheet/XCellRangeMovement.hpp>
#include <com/sun/star/sheet/XSubTotalCalculatable.hpp>
#include <com/sun/star/sheet/XSubTotalDescriptor.hpp>
#include <com/sun/star/sheet/GeneralFunction.hdl>
+#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
+#include <com/sun/star/sheet/XSheetAnnotations.hpp>
+
+#include <com/sun/star/sheet/XDataPilotTable.hpp>
+#include <com/sun/star/sheet/XDataPilotTable2.hpp>
+#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
+#include <com/sun/star/sheet/DataPilotTablePositionData.hpp>
+#include <com/sun/star/sheet/DataPilotTablePositionType.hpp>
+
#include <ooo/vba/excel/XlPasteSpecialOperation.hpp>
#include <ooo/vba/excel/XlPasteType.hpp>
#include <ooo/vba/excel/Constants.hpp>
@@ -122,13 +131,15 @@
#include <ooo/vba/excel/XlSpecialCellsValue.hpp>
#include <ooo/vba/excel/XlConsolidationFunction.hpp>
#include <ooo/vba/excel/XlSearchDirection.hpp>
+#include <ooo/vba/excel/XlColumnDataType.hpp>
+#include <ooo/vba/excel/XlFilterAction.hpp>
#include <scitems.hxx>
#include <svl/srchitem.hxx>
#include <cellsuno.hxx>
#include <dbcolect.hxx>
#include "docfunc.hxx"
-#include "transobj.hxx"
+#include <docuno.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
@@ -139,6 +150,7 @@
#include <sc.hrc>
#include <globstr.hrc>
#include <unonames.hxx>
+#include <tools/stream.hxx>
#include "vbaapplication.hxx"
#include "vbafont.hxx"
@@ -150,8 +162,13 @@
#include "vbavalidation.hxx"
#include "vbahyperlinks.hxx"
+#include "vbapivottable.hxx"
+
+#include "asciiopt.hxx"
+#include "impex.hxx"
#include "tabvwsh.hxx"
#include "rangelst.hxx"
+#include "rangenam.hxx"
#include "convuno.hxx"
#include "compiler.hxx"
#include "attrib.hxx"
@@ -165,6 +182,8 @@
#include "vbaglobals.hxx"
#include "vbastyle.hxx"
+#include "vbaname.hxx"
+#include "vbanames.hxx"
#include <vector>
#include <vbahelper/vbacollectionimpl.hxx>
// begin test includes
@@ -232,9 +251,9 @@ uno::Reference< excel::XRange > lcl_makeXRangeFromSheetCellRanges( const uno::Re
aCellRanges.Append( refRange );
}
// Single range
- if ( aCellRanges.First() == aCellRanges.Last() )
+ if ( aCellRanges.size() == 1 )
{
- uno::Reference< table::XCellRange > xTmpRange( new ScCellRangeObj( pDoc, *aCellRanges.First() ) );
+ uno::Reference< table::XCellRange > xTmpRange( new ScCellRangeObj( pDoc, *aCellRanges.front() ) );
xRange = new ScVbaRange( xParent, xContext, xTmpRange );
}
else
@@ -252,7 +271,7 @@ ScCellRangesBase* ScVbaRange::getCellRangesBase() throw ( uno::RuntimeException
return ScCellRangesBase::getImplementation( mxRanges );
if( mxRange.is() )
return ScCellRangesBase::getImplementation( mxRange );
- throw uno::RuntimeException( rtl::OUString::createFromAscii("General Error creating range - Unknown" ), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("General Error creating range - Unknown" )), uno::Reference< uno::XInterface >() );
}
ScCellRangeObj* ScVbaRange::getCellRangeObj() throw ( uno::RuntimeException )
@@ -260,11 +279,6 @@ ScCellRangeObj* ScVbaRange::getCellRangeObj() throw ( uno::RuntimeException )
return dynamic_cast< ScCellRangeObj* >( getCellRangesBase() );
}
-ScCellRangesObj* ScVbaRange::getCellRangesObj() throw ( uno::RuntimeException )
-{
- return dynamic_cast< ScCellRangesObj* >( getCellRangesBase() );
-}
-
SfxItemSet* ScVbaRange::getCurrentDataSet( ) throw ( uno::RuntimeException )
{
SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( getCellRangesBase() );
@@ -392,55 +406,6 @@ ScVbaRangeAreas::createCollectionObject( const uno::Any& aSource )
return lcl_makeRange( mxParent, mxContext, aSource, mbIsRows, mbIsColumns );
}
-// assume that xIf is infact a ScCellRangesBase
-ScDocShell*
-getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException )
-{
- ScCellRangesBase* pUno = ScCellRangesBase::getImplementation( xIf );
- if ( !pUno )
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying uno range object" ) ), uno::Reference< uno::XInterface >() );
- return pUno->GetDocShell();
-}
-
-ScDocShell*
-getDocShellFromRange( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
-{
- // need the ScCellRangesBase to get docshell
- uno::Reference< uno::XInterface > xIf( xRange, uno::UNO_QUERY_THROW );
- return getDocShellFromIf(xIf );
-}
-
-ScDocShell*
-getDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException )
-{
- // need the ScCellRangesBase to get docshell
- uno::Reference< uno::XInterface > xIf( xRanges, uno::UNO_QUERY_THROW );
- return getDocShellFromIf(xIf );
-}
-
-uno::Reference< frame::XModel > getModelFromXIf( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException )
-{
- ScDocShell* pDocShell = getDocShellFromIf(xIf );
- return pDocShell->GetModel();
-}
-
-uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException )
-{
- uno::Reference< uno::XInterface > xIf( xRange, uno::UNO_QUERY_THROW );
- return getModelFromXIf( xIf );
-}
-
-ScDocument*
-getDocumentFromRange( const uno::Reference< table::XCellRange >& xRange )
-{
- ScDocShell* pDocShell = getDocShellFromRange( xRange );
- if ( !pDocShell )
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying docshell from uno range object" ) ), uno::Reference< uno::XInterface >() );
- ScDocument* pDoc = pDocShell->GetDocument();
- return pDoc;
-}
-
-
ScDocument*
ScVbaRange::getScDocument() throw (uno::RuntimeException)
{
@@ -448,9 +413,9 @@ ScVbaRange::getScDocument() throw (uno::RuntimeException)
{
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
- return getDocumentFromRange( xRange );
+ return excel::GetDocumentFromRange( xRange );
}
- return getDocumentFromRange( mxRange );
+ return excel::GetDocumentFromRange( mxRange );
}
ScDocShell*
@@ -460,12 +425,12 @@ ScVbaRange::getScDocShell() throw (uno::RuntimeException)
{
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
- return getDocShellFromRange( xRange );
+ return excel::GetDocShellFromRange( xRange );
}
- return getDocShellFromRange( mxRange );
+ return excel::GetDocShellFromRange( mxRange );
}
-/*static*/ ScVbaRange* ScVbaRange::getImplementation( const uno::Reference< excel::XRange >& rxRange )
+ScVbaRange* ScVbaRange::getImplementation( const uno::Reference< excel::XRange >& rxRange )
{
// FIXME: always save to use dynamic_cast? Or better to (implement and) use XTunnel?
return dynamic_cast< ScVbaRange* >( rxRange.get() );
@@ -478,7 +443,7 @@ uno::Reference< frame::XModel > ScVbaRange::getUnoModel() throw (uno::RuntimeExc
throw uno::RuntimeException();
}
-/*static*/ uno::Reference< frame::XModel > ScVbaRange::getUnoModel( const uno::Reference< excel::XRange >& rxRange ) throw (uno::RuntimeException)
+uno::Reference< frame::XModel > ScVbaRange::getUnoModel( const uno::Reference< excel::XRange >& rxRange ) throw (uno::RuntimeException)
{
if( ScVbaRange* pScVbaRange = getImplementation( rxRange ) )
return pScVbaRange->getUnoModel();
@@ -492,7 +457,7 @@ const ScRangeList& ScVbaRange::getScRangeList() throw (uno::RuntimeException)
throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cannot obtain UNO range implementation object" ) ), uno::Reference< uno::XInterface >() );
}
-/*static*/ const ScRangeList& ScVbaRange::getScRangeList( const uno::Reference< excel::XRange >& rxRange ) throw (uno::RuntimeException)
+const ScRangeList& ScVbaRange::getScRangeList( const uno::Reference< excel::XRange >& rxRange ) throw (uno::RuntimeException)
{
if( ScVbaRange* pScVbaRange = getImplementation( rxRange ) )
return pScVbaRange->getScRangeList();
@@ -508,7 +473,7 @@ class NumFormatHelper
public:
NumFormatHelper( const uno::Reference< table::XCellRange >& xRange )
{
- mxSupplier.set( getModelFromRange( xRange ), uno::UNO_QUERY_THROW );
+ mxSupplier.set( excel::GetModelFromRange( xRange ), uno::UNO_QUERY_THROW );
mxRangeProps.set( xRange, uno::UNO_QUERY_THROW);
mxFormats = mxSupplier->getNumberFormats();
}
@@ -549,7 +514,7 @@ public:
{
SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( pUnoCellRange );
- SfxItemState eState = pDataSet->GetItemState( ATTR_VALUE_FORMAT, sal_True, NULL);
+ SfxItemState eState = pDataSet->GetItemState( ATTR_VALUE_FORMAT, true, NULL);
// one of the cells in the range is not like the other ;-)
// so return a zero length format to indicate that
if ( eState == SFX_ITEM_DONTCARE )
@@ -568,15 +533,17 @@ public:
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
sal_Int16 nType = ::comphelper::getINT16(
- xNumberProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) );
+ xNumberProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Type" )) ) );
return nType;
}
bool setNumberFormat( const rtl::OUString& rFormat )
{
- // #163288# treat "General" as "Standard" format
- sal_Int32 nNewIndex = 0;
- if( !rFormat.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "General" ) ) )
+ lang::Locale aLocale;
+ uno::Reference< beans::XPropertySet > xNumProps = getNumberProps();
+ xNumProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Locale" )) ) >>= aLocale;
+ sal_Int32 nNewIndex = mxFormats->queryKey(rFormat, aLocale, false );
+ if ( nNewIndex == -1 ) // format not defined
{
lang::Locale aLocale;
uno::Reference< beans::XPropertySet > xNumProps = getNumberProps();
@@ -593,7 +560,7 @@ public:
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
lang::Locale aLocale;
- xNumberProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Locale" ) ) ) >>= aLocale;
+ xNumberProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Locale" )) ) >>= aLocale;
uno::Reference<util::XNumberFormatTypes> xTypes( mxFormats, uno::UNO_QUERY );
if ( xTypes.is() )
{
@@ -747,7 +714,7 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab
{
case uno::TypeClass_BOOLEAN:
{
- sal_Bool bState = sal_False;
+ sal_Bool bState = false;
if ( aValue >>= bState )
{
uno::Reference< table::XCellRange > xRange( xCell, uno::UNO_QUERY_THROW );
@@ -794,7 +761,15 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab
{
double nDouble = 0.0;
if ( aValue >>= nDouble )
+ {
xCell->setValue( nDouble );
+ uno::Reference< table::XCellRange > xRange( xCell, uno::UNO_QUERY_THROW );
+ NumFormatHelper cellNumFormat( xRange );
+ if ( cellNumFormat.isBooleanType() )
+ {
+ cellNumFormat.setNumberFormat( util::NumberFormat::NUMBER );
+ }
+ }
else
isExtracted = false;
break;
@@ -836,7 +811,7 @@ void CellValueGetter::visitNode( sal_Int32 x, sal_Int32 y, const uno::Reference<
if ( sFormula.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("=TRUE()") ) ) )
aValue <<= sal_True;
else if ( sFormula.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("=FALSE()") ) ) )
- aValue <<= sal_False;
+ aValue <<= false;
else
{
uno::Reference< beans::XPropertySet > xProp( xCell, uno::UNO_QUERY_THROW );
@@ -888,9 +863,10 @@ protected:
double aDblValue = 0.0;
if ( aValue >>= sFormula )
{
- // convert to CONV_OOO style formula string because XCell::setFormula
- // always compile it in CONV_OOO style. Perhaps css.sheet.FormulaParser
- // should be used in future to directly pass formula tokens.
+ // convert to GRAM_PODF_A1 style grammar because XCell::setFormula
+ // always compile it in that grammar. Perhaps
+ // css.sheet.FormulaParser should be used in future to directly
+ // pass formula tokens when that API stabilizes.
if ( m_eGrammar != formula::FormulaGrammar::GRAM_PODF_A1 && ( sFormula.trim().indexOf('=') == 0 ) )
{
uno::Reference< uno::XInterface > xIf( xCell, uno::UNO_QUERY_THROW );
@@ -898,7 +874,7 @@ protected:
if ( pUnoRangesBase )
{
ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();
- ScCompiler aCompiler( m_pDoc, aCellRanges.First()->aStart );
+ ScCompiler aCompiler( m_pDoc, aCellRanges.front()->aStart );
aCompiler.SetGrammar(m_eGrammar);
// compile the string in the format passed in
aCompiler.CompileString( sFormula );
@@ -942,7 +918,7 @@ public:
pUnoRangesBase )
{
ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();
- ScCompiler aCompiler( m_pDoc, aCellRanges.First()->aStart );
+ ScCompiler aCompiler( m_pDoc, aCellRanges.front()->aStart );
aCompiler.SetGrammar(formula::FormulaGrammar::GRAM_DEFAULT);
aCompiler.CompileString( sVal );
// set desired convention
@@ -989,7 +965,7 @@ public:
};
-const static rtl::OUString sNA = rtl::OUString::createFromAscii("#N/A");
+const static rtl::OUString sNA(RTL_CONSTASCII_USTRINGPARAM("#N/A"));
class Dim1ArrayValueSetter : public ArrayVisitor
{
@@ -1151,7 +1127,7 @@ public:
};
bool
-getCellRangesForAddress( sal_uInt16& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv )
+getCellRangesForAddress( sal_uInt16& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv, char cDelimiter = 0 )
{
ScDocument* pDoc = NULL;
@@ -1160,8 +1136,7 @@ getCellRangesForAddress( sal_uInt16& rResFlags, const rtl::OUString& sAddress, S
pDoc = pDocSh->GetDocument();
String aString(sAddress);
sal_uInt16 nMask = SCA_VALID;
- //sal_uInt16 nParse = rCellRanges.Parse( sAddress, pDoc, nMask, formula::FormulaGrammar::CONV_XL_A1 );
- rResFlags = rCellRanges.Parse( sAddress, pDoc, nMask, eConv, 0 );
+ rResFlags = rCellRanges.Parse( sAddress, pDoc, nMask, eConv, cDelimiter );
if ( rResFlags & SCA_VALID )
{
return true;
@@ -1196,6 +1171,25 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S
formula::FormulaGrammar::AddressConvention eConv = aConv;
// spaces are illegal ( but the user of course can enter them )
rtl::OUString sAddress = (*it).trim();
+ // if a local name ( on the active sheet ) exists this will
+ // take precedence over a global with the same name
+ if ( !xNameAccess->hasByName( sAddress ) && pDocSh )
+ {
+ // try a local name
+ ScDocument* pDoc = pDocSh->GetDocument();
+ SCTAB nCurTab = pDocSh->GetCurTab();
+ if ( pDoc )
+ {
+ NameToNameMap* pMap = pDoc->GetLocalNameMap( nCurTab );
+ if ( pMap )
+ {
+ NameToNameMap::iterator itTmp = pMap->find( sAddress );
+ if ( itTmp != pMap->end() ) // found a mapping
+ sAddress = itTmp->second;
+ }
+ }
+ }
+ char aChar = 0;
if ( xNameAccess->hasByName( sAddress ) )
{
uno::Reference< sheet::XNamedRange > xNamed( xNameAccess->getByName( sAddress ), uno::UNO_QUERY_THROW );
@@ -1203,16 +1197,18 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S
// As the address comes from OOO, the addressing
// style is may not be XL_A1
eConv = pDocSh->GetDocument()->GetAddressConvention();
+ aChar = ';';
}
sal_uInt16 nFlags = 0;
- if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv ) )
+ if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv, aChar ) )
return false;
bool bTabFromReferrer = !( nFlags & SCA_TAB_3D );
- for ( ScRange* pRange = aCellRanges.First() ; pRange; pRange = aCellRanges.Next() )
+ for ( size_t i = 0, nRanges = aCellRanges.size(); i < nRanges; ++i )
{
+ ScRange* pRange = aCellRanges[ i ];
pRange->aStart.SetCol( refRange.aStart.Col() + pRange->aStart.Col() );
pRange->aStart.SetRow( refRange.aStart.Row() + pRange->aStart.Row() );
pRange->aStart.SetTab( bTabFromReferrer ? refRange.aStart.Tab() : pRange->aStart.Tab() );
@@ -1234,9 +1230,9 @@ getRangeForName( const uno::Reference< uno::XComponentContext >& xContext, const
if ( !getScRangeListForAddress ( sName, pDocSh, refRange, aCellRanges, eConv ) )
throw uno::RuntimeException();
// Single range
- if ( aCellRanges.First() == aCellRanges.Last() )
+ if ( aCellRanges.size() == 1 )
{
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocSh, *aCellRanges.First() ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pDocSh, *aCellRanges.front() ) );
uno::Reference< XHelperInterface > xFixThisParent = excel::getUnoSheetModuleObj( xRange );
return new ScVbaRange( xFixThisParent, xContext, xRange );
}
@@ -1300,14 +1296,14 @@ uno::Reference< sheet::XSheetCellRangeContainer > lclExpandToMerged( const uno::
ScUnoConversion::FillScRange( aScRange, aRangeAddr );
aScRanges.Append( aScRange );
}
- return new ScCellRangesObj( getDocShellFromRanges( rxCellRanges ), aScRanges );
+ return new ScCellRangesObj( excel::GetDocShellFromRanges( rxCellRanges ), aScRanges );
}
void lclExpandAndMerge( const uno::Reference< table::XCellRange >& rxCellRange, bool bMerge ) throw (uno::RuntimeException)
{
uno::Reference< util::XMergeable > xMerge( lclExpandToMerged( rxCellRange, true ), uno::UNO_QUERY_THROW );
// Calc cannot merge over merged ranges, always unmerge first
- xMerge->merge( sal_False );
+ xMerge->merge( false );
if( bMerge )
{
// clear all contents of the covered cells (not the top-left cell)
@@ -1346,7 +1342,7 @@ util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxC
of a merged range is part of this range are not covered. */
ScRange aScRange;
ScUnoConversion::FillScRange( aScRange, aRangeAddr );
- bool bHasMerged = getDocumentFromRange( rxCellRange )->HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED );
+ bool bHasMerged = excel::GetDocumentFromRange( rxCellRange )->HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED );
return bHasMerged ? util::TriState_INDETERMINATE : util::TriState_NO;
}
@@ -1363,6 +1359,28 @@ ScVbaRange::getRangeObjectForName(
return getRangeForName( xContext, sRangeName, pDocSh, refAddr, eConv );
}
+table::CellAddress ScVbaRange::getLeftUpperCellAddress()
+{
+ table::CellAddress aCellAddress;
+ uno::Reference< table::XCellRange > xCellRange = mxRange;
+ if ( mxRanges.is() && m_Areas.is() && m_Areas->getCount() > 1 )
+ {
+ uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY );
+ if ( xIndex.is() && xIndex->getCount() > 0 )
+ {
+ xCellRange.set( xIndex->getByIndex( 0 ), uno::UNO_QUERY );
+ }
+ }
+ if ( xCellRange.is() )
+ {
+ uno::Reference< sheet::XCellAddressable > xCellAddr( xCellRange->getCellByPosition( 0, 0 ), uno::UNO_QUERY );
+ if ( xCellAddr.is() )
+ {
+ aCellAddress = xCellAddr->getCellAddress();
+ }
+ }
+ return aCellAddress;
+}
table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, ScDocShell* pDocSh, formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1) throw ( uno::RuntimeException )
{
@@ -1377,10 +1395,10 @@ table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam,
ScRange refRange;
if ( getScRangeListForAddress ( rString, pDocSh, refRange, aCellRanges, aConv ) )
{
- if ( aCellRanges.First() == aCellRanges.Last() )
+ if ( aCellRanges.size() == 1 )
{
table::CellRangeAddress aRangeAddress;
- ScUnoConversion::FillApiRange( aRangeAddress, *aCellRanges.First() );
+ ScUnoConversion::FillApiRange( aRangeAddress, *aCellRanges.front() );
return aRangeAddress;
}
}
@@ -1390,7 +1408,14 @@ table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam,
uno::Reference< excel::XRange > xRange;
aParam >>= xRange;
if ( xRange.is() )
+ {
+ ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() );
+ if ( pRange && pDocSh && pRange->getScDocument() != pDocSh->GetDocument() )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid range" ) ), uno::Reference< uno::XInterface >() );
+ }
xRange->getCellRange() >>= xRangeParam;
+ }
break;
}
default:
@@ -1403,7 +1428,7 @@ uno::Reference< XCollection >
lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno::Reference<uno::XComponentContext>& xContext, const uno::Reference< table::XCellRange >& xRange ) throw( uno::RuntimeException )
{
uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW );
- ScDocument* pDoc = getDocumentFromRange(xRange);
+ ScDocument* pDoc = excel::GetDocumentFromRange(xRange);
if ( !pDoc )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() );
ScVbaPalette aPalette( pDoc->GetDocumentShell() );
@@ -1411,8 +1436,21 @@ lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno
return borders;
}
+void lcl_NotifyRangeChanges( const uno::Reference< frame::XModel >& xModel, ScCellRangesBase* pUnoRangesBase )
+{
+ if ( xModel.is() && pUnoRangesBase )
+ {
+ ScModelObj* pModelObj = ScModelObj::getImplementation( xModel );
+ const ScRangeList& aCellRanges = pUnoRangesBase->GetRangeList();
+ if ( pModelObj && pModelObj->HasChangesListeners() )
+ {
+ pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cell-change" ) ), aCellRanges );
+ }
+ }
+}
+
ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args,
- uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), getModelFromXIf( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False )
+ uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), excel::GetModelFromRange( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( false ), mbIsColumns( false )
{
mxRange.set( mxPropertySet, uno::UNO_QUERY );
mxRanges.set( mxPropertySet, uno::UNO_QUERY );
@@ -1429,7 +1467,7 @@ ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args,
}
ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< table::XCellRange >& xRange, sal_Bool bIsRows, sal_Bool bIsColumns ) throw( lang::IllegalArgumentException )
-: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRange, uno::UNO_QUERY_THROW ), getModelFromRange( xRange), true ), mxRange( xRange ),
+: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRange, uno::UNO_QUERY_THROW ), excel::GetModelFromRange( xRange), true ), mxRange( xRange ),
mbIsRows( bIsRows ),
mbIsColumns( bIsColumns )
{
@@ -1444,7 +1482,7 @@ ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const
}
ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges, sal_Bool bIsRows, sal_Bool bIsColumns ) throw ( lang::IllegalArgumentException )
-: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRanges, uno::UNO_QUERY_THROW ), getModelFromXIf( uno::Reference< uno::XInterface >( xRanges, uno::UNO_QUERY_THROW ) ), true ), mxRanges( xRanges ),mbIsRows( bIsRows ), mbIsColumns( bIsColumns )
+: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRanges, uno::UNO_QUERY_THROW ), excel::GetModelFromRange( uno::Reference< uno::XInterface >( xRanges, uno::UNO_QUERY_THROW ) ), true ), mxRanges( xRanges ),mbIsRows( bIsRows ), mbIsColumns( bIsColumns )
{
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
@@ -1483,7 +1521,53 @@ ScVbaRange::visitArray( ArrayVisitor& visitor )
}
}
+uno::Any SAL_CALL ScVbaRange::getName() throw (uno::RuntimeException)
+{
+ uno::Reference< excel::XName > xName;
+ ScDocShell* pDocShell = getScDocShell();
+ uno::Reference< frame::XModel > xModel = pDocShell ? pDocShell->GetModel() : NULL;
+ if ( !xModel.is() )
+ {
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid document" )), uno::Reference< uno::XInterface >() );
+ }
+ uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NamedRanges"))) , uno::UNO_QUERY_THROW );
+
+ uno::Reference< excel::XNames > xNames( new ScVbaNames( uno::Reference< XHelperInterface >(), mxContext , xNamedRanges , xModel ) );
+ sal_Int32 nCount = xNames->getCount();
+ ScCellRangesBase* pUnoRangesBase = getCellRangesBase();
+ if ( pUnoRangesBase && nCount > 0 )
+ {
+ ScRangeList aRangeList = pUnoRangesBase->GetRangeList();
+ for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ uno::Reference< excel::XName > xTmpName( xNames->Item( uno::makeAny( nIndex + 1 ), uno::Any() ), uno::UNO_QUERY );
+ if ( xTmpName.is() )
+ {
+ try
+ {
+ uno::Reference< excel::XRange > xRange = xTmpName->getRefersToRange();
+ if ( xRange.is() )
+ {
+ ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() );
+ ScCellRangesBase* pCurRangesBase = pRange ? pRange->getCellRangesBase() : NULL;
+ if ( pCurRangesBase && aRangeList == pCurRangesBase->GetRangeList() )
+ {
+ xName = xTmpName;
+ break;
+ }
+ }
+ }
+ catch (const uno::Exception&)
+ {
+ }
+ }
+ }
+ }
+
+ return uno::makeAny( xName );
+}
uno::Any
ScVbaRange::getValue( ValueGetter& valueGetter) throw (uno::RuntimeException)
@@ -1500,7 +1584,7 @@ ScVbaRange::getValue( ValueGetter& valueGetter) throw (uno::RuntimeException)
// multi cell range ( return array )
Dim2ArrayValueGetter arrayGetter( nRowCount, nColCount, valueGetter );
visitArray( arrayGetter );
- return uno::makeAny( script::ArrayWrapper( sal_False, arrayGetter.getValue() ) );
+ return uno::makeAny( script::ArrayWrapper( false, arrayGetter.getValue() ) );
}
uno::Any SAL_CALL
@@ -1523,7 +1607,7 @@ ScVbaRange::getValue() throw (uno::RuntimeException)
void
-ScVbaRange::setValue( const uno::Any& aValue, ValueSetter& valueSetter, bool bFireEvent ) throw (uno::RuntimeException)
+ScVbaRange::setValue( const uno::Any &aValue, ValueSetter& valueSetter ) throw (uno::RuntimeException)
{
uno::TypeClass aClass = aValue.getValueTypeClass();
if ( aClass == uno::TypeClass_SEQUENCE )
@@ -1573,7 +1657,10 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException)
return;
}
CellValueSetter valueSetter( aValue );
- setValue( aValue, valueSetter, true );
+ setValue( aValue, valueSetter );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void SAL_CALL
@@ -1581,7 +1668,10 @@ ScVbaRange::Clear() throw (uno::RuntimeException)
{
using namespace ::com::sun::star::sheet::CellFlags;
sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED;
- ClearContents( nFlags, true );
+ ClearContents( nFlags );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
//helper ClearContent
@@ -1600,7 +1690,7 @@ ScVbaRange::ClearContents( sal_Int32 nFlags, bool bFireEvent ) throw (uno::Runti
uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW );
ScVbaRange* pRange = getImplementation( xRange );
if ( pRange )
- pRange->ClearContents( nFlags, false ); // do not fire for single ranges
+ pRange->ClearContents( nFlags );
}
// fire change event for the entire range list
if( bFireEvent ) fireChangeEvent();
@@ -1622,18 +1712,24 @@ ScVbaRange::ClearComments() throw (uno::RuntimeException)
void SAL_CALL
ScVbaRange::ClearContents() throw (uno::RuntimeException)
{
- using namespace ::com::sun::star::sheet::CellFlags;
- sal_Int32 nFlags = VALUE | STRING | DATETIME | FORMULA;
- ClearContents( nFlags, true );
+ sal_Int32 nClearFlags = ( sheet::CellFlags::VALUE |
+ sheet::CellFlags::STRING | sheet::CellFlags::DATETIME |
+ sheet::CellFlags::FORMULA );
+ ClearContents( nClearFlags );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void SAL_CALL
ScVbaRange::ClearFormats() throw (uno::RuntimeException)
{
- //FIXME: need to check if we need to combine FORMATTED
- using namespace ::com::sun::star::sheet::CellFlags;
- sal_Int32 nFlags = HARDATTR | FORMATTED | EDITATTR;
- ClearContents( nFlags, false );
+ //FIXME: need to check if we need to combine sheet::CellFlags::FORMATTED
+ sal_Int32 nClearFlags = sheet::CellFlags::HARDATTR | sheet::CellFlags::FORMATTED | sheet::CellFlags::EDITATTR;
+ ClearContents( nClearFlags );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void
@@ -1648,7 +1744,10 @@ ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar::
return;
}
CellFormulaValueSetter formulaValueSetter( rFormula, getScDocument(), eGram );
- setValue( rFormula, formulaValueSetter, bFireEvent );
+ setValue( rFormula, formulaValueSetter );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
uno::Any
@@ -1672,7 +1771,7 @@ void
ScVbaRange::setFormula(const uno::Any &rFormula ) throw (uno::RuntimeException)
{
// #FIXME converting "=$a$1" e.g. CONV_XL_A1 -> CONV_OOO // results in "=$a$1:a1", temporalily disable conversion
- setFormulaValue( rFormula,formula::FormulaGrammar::GRAM_NATIVE_XL_A1, true );
+ setFormulaValue( rFormula,formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );;
}
uno::Any
@@ -1777,14 +1876,15 @@ ScVbaRange::HasFormula() throw (uno::RuntimeException)
uno::Reference<uno::XInterface> xRanges( pThisRanges->queryFormulaCells( ( sheet::FormulaResult::ERROR | sheet::FormulaResult::VALUE | sheet::FormulaResult::STRING ) ), uno::UNO_QUERY_THROW );
ScCellRangesBase* pFormulaRanges = dynamic_cast< ScCellRangesBase * > ( xRanges.get() );
// check if there are no formula cell, return false
- if ( pFormulaRanges->GetRangeList().Count() == 0 )
- return uno::makeAny(sal_False);
+ if ( pFormulaRanges->GetRangeList().empty() )
+ return uno::makeAny(false);
// chech if there are holes (where some cells are not formulas)
// or returned range is not equal to this range
- if ( ( pFormulaRanges->GetRangeList().Count() > 1 )
- || ( pFormulaRanges->GetRangeList().GetObject(0)->aStart != pThisRanges->GetRangeList().GetObject(0)->aStart )
- || ( pFormulaRanges->GetRangeList().GetObject(0)->aEnd != pThisRanges->GetRangeList().GetObject(0)->aEnd ) )
+ if ( ( pFormulaRanges->GetRangeList().size() > 1 )
+ || ( pFormulaRanges->GetRangeList().front()->aStart != pThisRanges->GetRangeList().front()->aStart )
+ || ( pFormulaRanges->GetRangeList().front()->aEnd != pThisRanges->GetRangeList().front()->aEnd )
+ )
return aNULL(); // should return aNULL;
}
return uno::makeAny( sal_True );
@@ -1808,6 +1908,9 @@ ScVbaRange::fillSeries( sheet::FillDirection nFillDirection, sheet::FillMode nFi
uno::Reference< sheet::XCellSeries > xCellSeries(mxRange, uno::UNO_QUERY_THROW );
xCellSeries->fillSeries( nFillDirection, nFillMode, nFillDateMode, fStep, fEndValue );
+
+ // Fires the range change event.
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() );
}
void
@@ -1866,8 +1969,9 @@ ScVbaRange::Offset( const ::uno::Any &nRowOff, const uno::Any &nColOff ) throw (
ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();
- for ( ScRange* pRange = aCellRanges.First() ; pRange; pRange = aCellRanges.Next() )
+ for ( size_t i = 0, nRanges = aCellRanges.size(); i < nRanges; ++i )
{
+ ScRange* pRange = aCellRanges[ i ];
if ( bIsColumnOffset )
{
pRange->aStart.SetCol( pRange->aStart.Col() + nColOffset );
@@ -1880,13 +1984,13 @@ ScVbaRange::Offset( const ::uno::Any &nRowOff, const uno::Any &nColOff ) throw (
}
}
- if ( aCellRanges.Count() > 1 ) // Multi-Area
+ if ( aCellRanges.size() > 1 ) // Multi-Area
{
uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pUnoRangesBase->GetDocShell(), aCellRanges ) );
return new ScVbaRange( mxParent, mxContext, xRanges );
}
// normal range
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), *aCellRanges.First() ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), *aCellRanges.front() ) );
return new ScVbaRange( mxParent, mxContext, xRange );
}
@@ -1947,7 +2051,15 @@ ScVbaRange::getFormulaArray() throw (uno::RuntimeException)
uno::Reference< sheet::XCellRangeFormula> xCellRangeFormula( mxRange, uno::UNO_QUERY_THROW );
uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
uno::Any aMatrix;
- aMatrix = xConverter->convertTo( uno::makeAny( xCellRangeFormula->getFormulaArray() ) , getCppuType((uno::Sequence< uno::Sequence< uno::Any > >*)0) ) ;
+
+ uno::Sequence< uno::Sequence<rtl::OUString> > aFmArray = xCellRangeFormula->getFormulaArray();
+ if( aFmArray.getLength() )
+ {
+ if( aFmArray.getLength() == 1 && aFmArray[0].getLength() == 1 )
+ aMatrix <<= aFmArray[0][0];
+ else
+ aMatrix = xConverter->convertTo( uno::makeAny( xCellRangeFormula->getFormulaArray() ) , getCppuType((uno::Sequence< uno::Sequence< uno::Any > >*)0) ) ;
+ }
return aMatrix;
}
@@ -2013,7 +2125,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut
// force external to be false
// only first address should have the
// document and sheet specifications
- aExternalCopy = uno::makeAny(sal_False);
+ aExternalCopy = uno::makeAny(false);
}
sAddress += xRange->Address( RowAbsolute, ColumnAbsolute, ReferenceStyle, aExternalCopy, RelativeTo );
}
@@ -2054,7 +2166,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut
if ( !bVal )
nFlags &= ~COL_ABSOLUTE;
}
- sal_Bool bLocal = sal_False;
+ sal_Bool bLocal = false;
if ( External.hasValue() )
{
External >>= bLocal;
@@ -2130,30 +2242,66 @@ ScVbaRange::CellsHelper( const uno::Reference< ov::XHelperInterface >& xParent,
// set in the Any, we should convert as appropriate
// #FIXME - perhaps worth turning this into some sort of
// convertion routine e.g. bSuccess = getValueFromAny( nRow, nRowIndex, getCppuType((sal_Int32*)0) )
- if ( nRowIndex.hasValue() && !( nRowIndex >>= nRow ) )
+ uno::Any aRowIndexAny = nRowIndex;
+ if ( aRowIndexAny.getValueTypeClass() == uno::TypeClass_INTERFACE )
{
- uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
- uno::Any aConverted;
try
{
- aConverted = xConverter->convertTo( nRowIndex, getCppuType((sal_Int32*)0) );
- bIsIndex = ( aConverted >>= nRow );
+ aRowIndexAny = getDefaultPropByIntrospection( aRowIndexAny );
}
- catch( uno::Exception& ) {} // silence any errors
+ catch( uno::Exception& ) {}
}
- if ( bIsColumnIndex && !( nColumnIndex >>= nColumn ) )
+ else if ( aRowIndexAny.hasValue() && !( aRowIndexAny >>= nRow ) )
{
uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext );
uno::Any aConverted;
try
{
- aConverted = xConverter->convertTo( nColumnIndex, getCppuType((sal_Int32*)0) );
- bIsColumnIndex = ( aConverted >>= nColumn );
+ aConverted = xConverter->convertTo( aRowIndexAny, getCppuType((sal_Int32*)0) );
+ bIsIndex = ( aConverted >>= nRow );
}
catch( uno::Exception& ) {} // silence any errors
}
- RangeHelper thisRange( xRange );
+ uno::Any aColumnAny = nColumnIndex;
+
+ if ( bIsColumnIndex )
+ {
+ // Column index can be a col address e.g Cells( 1, "B" ) etc.
+ rtl::OUString sCol;
+ if ( nColumnIndex >>= sCol )
+ {
+ ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
+ ScRange tmpRange;
+ sal_uInt16 flags = tmpRange.ParseCols( sCol, excel::GetDocumentFromRange( mxRange ), dDetails );
+ if ( ( flags & 0x200 ) != 0x200 )
+ throw uno::RuntimeException();
+ nColumn = tmpRange.aStart.Col() + 1;
+ }
+ else
+ {
+ if ( aColumnAny.getValueTypeClass() == uno::TypeClass_INTERFACE )
+ {
+ try
+ {
+ aColumnAny = getDefaultPropByIntrospection( aColumnAny );
+ }
+ catch( uno::Exception& ) {}
+ }
+ if ( !( aColumnAny >>= nColumn ) )
+ {
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ uno::Any aConverted;
+ try
+ {
+ aConverted = xConverter->convertTo( aColumnAny, getCppuType((sal_Int32*)0) );
+ bIsColumnIndex = ( aConverted >>= nColumn );
+ }
+ catch( uno::Exception& ) {} // silence any errors
+ }
+ }
+ }
+ RangeHelper thisRange( mxRange );
table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
uno::Reference< table::XCellRange > xSheetRange = thisRange.getCellRangeFromSheet();
if( !bIsIndex && !bIsColumnIndex ) // .Cells
@@ -2176,7 +2324,7 @@ ScVbaRange::CellsHelper( const uno::Reference< ov::XHelperInterface >& xParent,
--nColumn;
nRow = nRow + thisRangeAddress.StartRow;
nColumn = nColumn + thisRangeAddress.StartColumn;
- return new ScVbaRange( xParent, xContext, xSheetRange->getCellRangeByPosition( nColumn, nRow, nColumn, nRow ) );
+ return new ScVbaRange( mxParent, mxContext, xSheetRange->getCellRangeByPosition( nColumn, nRow, nColumn, nRow ) );
}
void
@@ -2225,7 +2373,7 @@ void setCursor( const SCCOL& nCol, const SCROW& nRow, const uno::Reference< fra
if ( bInSel )
pShell->SetCursor( nCol, nRow );
else
- pShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_NONE, sal_False, sal_False, sal_True, sal_False );
+ pShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_NONE, false, false, sal_True, false );
}
}
@@ -2292,31 +2440,27 @@ ScVbaRange::Activate() throw (uno::RuntimeException)
uno::Reference< excel::XRange >
ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException)
{
- SCROW nStartRow = 0;
- SCROW nEndRow = 0;
-
- sal_Int32 nValue = 0;
rtl::OUString sAddress;
if ( aIndex.hasValue() )
{
+ sal_Int32 nValue = 0;
ScCellRangesBase* pUnoRangesBase = getCellRangesBase();
ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();
- ScRange aRange = *aCellRanges.First();
+ ScRange aRange = *aCellRanges.front();
if( aIndex >>= nValue )
{
aRange.aStart.SetRow( aRange.aStart.Row() + --nValue );
aRange.aEnd.SetRow( aRange.aStart.Row() );
}
-
else if ( aIndex >>= sAddress )
{
ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRange tmpRange;
- tmpRange.ParseRows( sAddress, getDocumentFromRange( mxRange ), dDetails );
- nStartRow = tmpRange.aStart.Row();
- nEndRow = tmpRange.aEnd.Row();
+ tmpRange.ParseRows( sAddress, excel::GetDocumentFromRange( mxRange ), dDetails );
+ SCROW nStartRow = tmpRange.aStart.Row();
+ SCROW nEndRow = tmpRange.aEnd.Row();
aRange.aStart.SetRow( aRange.aStart.Row() + nStartRow );
aRange.aEnd.SetRow( aRange.aStart.Row() + ( nEndRow - nStartRow ));
@@ -2325,7 +2469,7 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException)
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Illegal param" ) ), uno::Reference< uno::XInterface >() );
if ( aRange.aStart.Row() < 0 || aRange.aEnd.Row() < 0 )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Internal failure, illegal param"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Internal failure, illegal param")), uno::Reference< uno::XInterface >() );
// return a normal range ( even for multi-selection
uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), aRange ) );
return new ScVbaRange( mxParent, mxContext, xRange, true );
@@ -2339,18 +2483,15 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException)
uno::Reference< excel::XRange >
ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException)
{
- SCCOL nStartCol = 0;
- SCCOL nEndCol = 0;
-
- sal_Int32 nValue = 0;
rtl::OUString sAddress;
ScCellRangesBase* pUnoRangesBase = getCellRangesBase();
ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();
- ScRange aRange = *aCellRanges.First();
+ ScRange aRange = *aCellRanges.front();
if ( aIndex.hasValue() )
{
+ sal_Int32 nValue = 0;
if ( aIndex >>= nValue )
{
aRange.aStart.SetCol( aRange.aStart.Col() + static_cast< SCCOL > ( --nValue ) );
@@ -2361,9 +2502,9 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException)
{
ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRange tmpRange;
- tmpRange.ParseCols( sAddress, getDocumentFromRange( mxRange ), dDetails );
- nStartCol = tmpRange.aStart.Col();
- nEndCol = tmpRange.aEnd.Col();
+ tmpRange.ParseCols( sAddress, excel::GetDocumentFromRange( mxRange ), dDetails );
+ SCCOL nStartCol = tmpRange.aStart.Col();
+ SCCOL nEndCol = tmpRange.aEnd.Col();
aRange.aStart.SetCol( aRange.aStart.Col() + nStartCol );
aRange.aEnd.SetCol( aRange.aStart.Col() + ( nEndCol - nStartCol ));
@@ -2372,7 +2513,7 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException)
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Illegal param" ) ), uno::Reference< uno::XInterface >() );
if ( aRange.aStart.Col() < 0 || aRange.aEnd.Col() < 0 )
- throw uno::RuntimeException( rtl::OUString::createFromAscii("Internal failure, illegal param"), uno::Reference< uno::XInterface >() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Internal failure, illegal param")), uno::Reference< uno::XInterface >() );
}
// Columns() - no params
uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), aRange ) );
@@ -2464,9 +2605,11 @@ ScVbaRange::Copy(const ::uno::Any& Destination) throw (uno::RuntimeException)
}
else
{
- uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange );
- Select();
- excel::implnCopy( xModel );
+ ScRange aRange;
+ RangeHelper thisRange( mxRange );
+ ScUnoConversion::FillScRange( aRange, thisRange.getCellRangeAddressable()->getRangeAddress() );
+ uno::Reference< frame::XModel > xModel = excel::GetModelFromRange( mxRange );
+ excel::implnCopyRange( xModel, aRange );
}
}
@@ -2488,8 +2631,8 @@ ScVbaRange::Cut(const ::uno::Any& Destination) throw (uno::RuntimeException)
uno::Reference< sheet::XCellRangeAddressable > xSource( mxRange, uno::UNO_QUERY);
xMover->moveRange( xDestination->getCellAddress(), xSource->getRangeAddress() );
}
- {
- uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange );
+ else {
+ uno::Reference< frame::XModel > xModel = excel::GetModelFromRange( mxRange );
Select();
excel::implnCut( xModel );
}
@@ -2607,7 +2750,7 @@ ScVbaRange::getWrapText() throw (script::BasicErrorException, uno::RuntimeExcept
SfxItemSet* pDataSet = getCurrentDataSet();
- SfxItemState eState = pDataSet->GetItemState( ATTR_LINEBREAK, sal_True, NULL);
+ SfxItemState eState = pDataSet->GetItemState( ATTR_LINEBREAK, true, NULL);
if ( eState == SFX_ITEM_DONTCARE )
return aNULL();
@@ -2740,7 +2883,7 @@ uno::Any SAL_CALL ScVbaRange::getCellRange( ) throw (uno::RuntimeException)
return aAny;
}
-/*static*/ uno::Any ScVbaRange::getCellRange( const uno::Reference< excel::XRange >& rxRange ) throw (uno::RuntimeException)
+uno::Any ScVbaRange::getCellRange( const uno::Reference< excel::XRange >& rxRange ) throw (uno::RuntimeException)
{
if( ScVbaRange* pVbaRange = getImplementation( rxRange ) )
return pVbaRange->getCellRange();
@@ -2809,15 +2952,13 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons
uno::Reference< frame::XModel > xModel( ( pShell ? pShell->GetModel() : NULL ), uno::UNO_QUERY_THROW );
uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
- // save old selection
- uno::Reference< uno::XInterface > xSel( xModel->getCurrentSelection() );
// select this range
xSelection->select( uno::makeAny( mxRange ) );
// set up defaults
sal_Int32 nPaste = excel::XlPasteType::xlPasteAll;
sal_Int32 nOperation = excel::XlPasteSpecialOperation::xlPasteSpecialOperationNone;
- sal_Bool bTranspose = sal_False;
- sal_Bool bSkipBlanks = sal_False;
+ sal_Bool bTranspose = false;
+ sal_Bool bSkipBlanks = false;
if ( Paste.hasValue() )
Paste >>= nPaste;
@@ -2831,8 +2972,6 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons
sal_uInt16 nFlags = getPasteFlags(nPaste);
sal_uInt16 nFormulaBits = getPasteFormulaBits(nOperation);
excel::implnPasteSpecial(pShell->GetModel(), nFlags,nFormulaBits,bSkipBlanks,bTranspose);
- // restore selection
- xSelection->select( uno::makeAny( xSel ) );
}
uno::Reference< excel::XRange >
@@ -2842,8 +2981,9 @@ ScVbaRange::getEntireColumnOrRow( bool bColumn ) throw (uno::RuntimeException)
// copy the range list
ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();
- for ( ScRange* pRange = aCellRanges.First() ; pRange; pRange = aCellRanges.Next() )
+ for ( size_t i = 0, nRanges = aCellRanges.size(); i < nRanges; ++i )
{
+ ScRange* pRange = aCellRanges[ i ];
if ( bColumn )
{
pRange->aStart.SetRow( 0 );
@@ -2855,13 +2995,13 @@ ScVbaRange::getEntireColumnOrRow( bool bColumn ) throw (uno::RuntimeException)
pRange->aEnd.SetCol( MAXCOL );
}
}
- if ( aCellRanges.Count() > 1 ) // Multi-Area
+ if ( aCellRanges.size() > 1 ) // Multi-Area
{
uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( pUnoRangesBase->GetDocShell(), aCellRanges ) );
return new ScVbaRange( mxParent, mxContext, xRanges, !bColumn, bColumn );
}
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), *aCellRanges.First() ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( pUnoRangesBase->GetDocShell(), *aCellRanges.front() ) );
return new ScVbaRange( mxParent, mxContext, xRange, !bColumn, bColumn );
}
@@ -2989,7 +3129,7 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace
}
// sanity check required params
- if ( !What.getLength() /*|| !Replacement.getLength()*/ )
+ if ( !What.getLength() )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, missing params" )) , uno::Reference< uno::XInterface >() );
rtl::OUString sWhat = VBAToRegexp( What);
// #TODO #FIXME SearchFormat & ReplacesFormat are not processed
@@ -3000,7 +3140,7 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace
sal_Int16 nLook = globalSearchOptions.GetWordOnly() ? excel::XlLookAt::xlPart : excel::XlLookAt::xlWhole;
sal_Int16 nSearchOrder = globalSearchOptions.GetRowDirection() ? excel::XlSearchOrder::xlByRows : excel::XlSearchOrder::xlByColumns;
- sal_Bool bMatchCase = sal_False;
+ sal_Bool bMatchCase = false;
uno::Reference< util::XReplaceable > xReplace( mxRange, uno::UNO_QUERY );
if ( xReplace.is() )
{
@@ -3014,9 +3154,9 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace
{
// sets SearchWords ( true is Cell match )
nLook = ::comphelper::getINT16( LookAt );
- sal_Bool bSearchWords = sal_False;
+ sal_Bool bSearchWords = false;
if ( nLook == excel::XlLookAt::xlPart )
- bSearchWords = sal_False;
+ bSearchWords = false;
else if ( nLook == excel::XlLookAt::xlWhole )
bSearchWords = sal_True;
else
@@ -3030,9 +3170,9 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace
if ( SearchOrder.hasValue() )
{
nSearchOrder = ::comphelper::getINT16( SearchOrder );
- sal_Bool bSearchByRow = sal_False;
+ sal_Bool bSearchByRow = false;
if ( nSearchOrder == excel::XlSearchOrder::xlByColumns )
- bSearchByRow = sal_False;
+ bSearchByRow = false;
else if ( nSearchOrder == excel::XlSearchOrder::xlByRows )
bSearchByRow = sal_True;
else
@@ -3053,7 +3193,16 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace
// OOo.org afaik
uno::Reference< util::XSearchDescriptor > xSearch( xDescriptor, uno::UNO_QUERY );
+ // Find all cells that being replaced, used to fire the range changed event.
+ uno::Reference< container::XIndexAccess > xIndexAccess = xReplace->findAll( xSearch );
xReplace->replaceAll( xSearch );
+
+ if ( xIndexAccess.is() && xIndexAccess->getCount() > 0 )
+ {
+ // Fires the range change event.
+ ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( xIndexAccess );
+ lcl_NotifyRangeChanges( getScDocShell()->GetModel(), pScCellRangesBase ); // the original convert method will fail in SUSE
+ }
}
return sal_True; // always
}
@@ -3133,7 +3282,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, illegal value for LookIn." )) , uno::Reference< uno::XInterface >() );
}
newOptions.SetCellType( nSearchType );
- xDescriptor->setPropertyValue( rtl::OUString::createFromAscii( "SearchType" ), uno::makeAny( nSearchType ) );
+ xDescriptor->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "SearchType" )), uno::makeAny( nSearchType ) );
}
}
@@ -3141,9 +3290,9 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
if ( LookAt.hasValue() )
{
nLookAt = ::comphelper::getINT16( LookAt );
- sal_Bool bSearchWords = sal_False;
+ sal_Bool bSearchWords = false;
if ( nLookAt == excel::XlLookAt::xlPart )
- bSearchWords = sal_False;
+ bSearchWords = false;
else if ( nLookAt == excel::XlLookAt::xlWhole )
bSearchWords = sal_True;
else
@@ -3156,9 +3305,9 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
if ( SearchOrder.hasValue() )
{
nSearchOrder = ::comphelper::getINT16( SearchOrder );
- sal_Bool bSearchByRow = sal_False;
+ sal_Bool bSearchByRow = false;
if ( nSearchOrder == excel::XlSearchOrder::xlByColumns )
- bSearchByRow = sal_False;
+ bSearchByRow = false;
else if ( nSearchOrder == excel::XlSearchOrder::xlByRows )
bSearchByRow = sal_True;
else
@@ -3174,20 +3323,20 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
sal_Int32 nSearchDirection = 0;
if( SearchDirection >>= nSearchDirection )
{
- sal_Bool bSearchBackwards = sal_False;
+ sal_Bool bSearchBackwards = false;
if ( nSearchDirection == excel::XlSearchDirection::xlNext )
- bSearchBackwards = sal_False;
+ bSearchBackwards = false;
else if( nSearchDirection == excel::XlSearchDirection::xlPrevious )
bSearchBackwards = sal_True;
else
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, illegal value for SearchDirection" )) , uno::Reference< uno::XInterface >() );
newOptions.SetBackward( bSearchBackwards );
- xDescriptor->setPropertyValue( rtl::OUString::createFromAscii( "SearchBackwards" ), uno::makeAny( bSearchBackwards ) );
+ xDescriptor->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "SearchBackwards" )), uno::makeAny( bSearchBackwards ) );
}
}
// MatchCase
- sal_Bool bMatchCase = sal_False;
+ sal_Bool bMatchCase = false;
if ( MatchCase.hasValue() )
{
// SearchCaseSensitive
@@ -3204,6 +3353,13 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xDescriptor) : xSearch->findFirst( xDescriptor );
uno::Reference< table::XCellRange > xCellRange( xInterface, uno::UNO_QUERY );
+ // if we are searching from a starting cell and failed to find a match
+ // then try from the begining
+ if ( !xCellRange.is() && xStartCell.is() )
+ {
+ xInterface = xSearch->findFirst( xDescriptor );
+ xCellRange.set( xInterface, uno::UNO_QUERY );
+ }
if ( xCellRange.is() )
{
uno::Reference< excel::XRange > xResultRange = new ScVbaRange( mxParent, mxContext, xCellRange );
@@ -3287,7 +3443,7 @@ void updateTableSortField( const uno::Reference< table::XCellRange >& xParentRan
if ( nOrder == excel::XlSortOrder::xlAscending )
aTableField.IsAscending = sal_True;
else
- aTableField.IsAscending = sal_False;
+ aTableField.IsAscending = false;
}
else
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Illegal Key param" ) ), uno::Reference< uno::XInterface >() );
@@ -3327,15 +3483,6 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
// 2) #TODO #FIXME need to refactor this ( below ) into a IsSingleCell() method
uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY_THROW );
- // 'Fraid I don't remember what I was trying to achieve here ???
-/*
- if ( isSingleCellRange() )
- {
- uno::Reference< XRange > xCurrent = CurrentRegion();
- xCurrent->Sort( Key1, Order1, Key2, Type, Order2, Key3, Order3, Header, OrderCustom, MatchCase, Orientation, SortMethod, DataOption1, DataOption2, DataOption3 );
- return;
- }
-*/
// set up defaults
sal_Int16 nOrder1 = aSortParam.bAscending[0] ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
@@ -3357,13 +3504,13 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
nOrientation = ::comphelper::getINT16( Orientation );
// persist new option to be next calls default
if ( nOrientation == excel::XlSortOrientation::xlSortRows )
- aSortParam.bByRow = sal_False;
+ aSortParam.bByRow = false;
else
aSortParam.bByRow = sal_True;
}
- sal_Bool bIsSortColumns=sal_False; // sort by row
+ sal_Bool bIsSortColumns=false; // sort by row
if ( nOrientation == excel::XlSortOrientation::xlSortRows )
bIsSortColumns = sal_True;
@@ -3371,7 +3518,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
#ifdef VBA_OOBUILD_HACK
nHeader = aSortParam.nCompatHeader;
#endif
- sal_Bool bContainsHeader = sal_False;
+ sal_Bool bContainsHeader = false;
if ( Header.hasValue() )
{
@@ -3419,26 +3566,26 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
{
nOrder1 = ::comphelper::getINT16(Order1);
if ( nOrder1 == excel::XlSortOrder::xlAscending )
- aSortParam.bAscending[0] = sal_True;
+ aSortParam.bAscending[0] = true;
else
- aSortParam.bAscending[0] = sal_False;
+ aSortParam.bAscending[0] = false;
}
if ( Order2.hasValue() )
{
nOrder2 = ::comphelper::getINT16(Order2);
if ( nOrder2 == excel::XlSortOrder::xlAscending )
- aSortParam.bAscending[1] = sal_True;
+ aSortParam.bAscending[1] = true;
else
- aSortParam.bAscending[1] = sal_False;
+ aSortParam.bAscending[1] = false;
}
if ( Order3.hasValue() )
{
nOrder3 = ::comphelper::getINT16(Order3);
if ( nOrder3 == excel::XlSortOrder::xlAscending )
- aSortParam.bAscending[2] = sal_True;
+ aSortParam.bAscending[2] = true;
else
- aSortParam.bAscending[2] = sal_False;
+ aSortParam.bAscending[2] = false;
}
uno::Reference< table::XCellRange > xKey1;
@@ -3497,76 +3644,45 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException)
return xRange->End( Direction );
}
+ table::CellAddress aAddress = getLeftUpperCellAddress();
+ SCTAB nTab = aAddress.Sheet;
+ SCCOL nCurX = aAddress.Column;
+ SCROW nCurY = aAddress.Row;
+ SCCOL nNewX = nCurX;
+ SCROW nNewY = nCurY;
- // #FIXME #TODO
- // euch! found my orig implementation sucked, so
- // trying this even suckier one ( really need to use/expose code in
- // around ScTabView::MoveCursorArea(), thats the bit that calcutes
- // where the cursor should go )
- // Main problem with this method is the ultra hacky attempt to preserve
- // the ActiveCell, there should be no need to go to these extreems
-
- // Save ActiveCell pos ( to restore later )
- uno::Any aDft;
- uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
- rtl::OUString sActiveCell = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft );
-
- // position current cell upper left of this range
- Cells( uno::makeAny( (sal_Int32) 1 ), uno::makeAny( (sal_Int32) 1 ) )->Select();
+ ScDocShell* pDocShell = getScDocShell();
+ ScDocument* pDoc = pDocShell->GetDocument();
- uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange );
+ SCsCOL nMoveX = 0;
+ SCsROW nMoveY = 0;
+ switch ( Direction )
+ {
+ case excel::XlDirection::xlDown:
+ nMoveY = 1;
+ break;
+ case excel::XlDirection::xlUp:
+ nMoveY = -1;
+ break;
+ case excel::XlDirection::xlToLeft:
+ nMoveX = -1;
+ break;
+ case excel::XlDirection::xlToRight:
+ nMoveX = 1;
+ break;
+ default:
+ throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid Direction" ) ), uno::Reference< uno::XInterface >() );
+ }
- SfxViewFrame* pViewFrame = excel::getViewFrame( xModel );
- if ( pViewFrame )
+ if ( pDoc )
{
- SfxAllItemSet aArgs( SFX_APP()->GetPool() );
- // Hoping this will make sure this slot is called
- // synchronously
- SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False );
- aArgs.Put( sfxAsync, sfxAsync.Which() );
- SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
-
- sal_uInt16 nSID = 0;
-
- switch( Direction )
- {
- case excel::XlDirection::xlDown:
- nSID = SID_CURSORBLKDOWN;
- break;
- case excel::XlDirection::xlUp:
- nSID = SID_CURSORBLKUP;
- break;
- case excel::XlDirection::xlToLeft:
- nSID = SID_CURSORBLKLEFT;
- break;
- case excel::XlDirection::xlToRight:
- nSID = SID_CURSORBLKRIGHT;
- break;
- default:
- throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": Invalid ColumnIndex" ) ), uno::Reference< uno::XInterface >() );
- }
- if ( pDispatcher )
- {
- pDispatcher->Execute( nSID, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs );
- }
+ pDoc->FindAreaPos( nNewX, nNewY, nTab, nMoveX, nMoveY );
}
- // result is the ActiveCell
- rtl::OUString sMoved = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft );
-
- // restore old ActiveCell
- uno::Any aVoid;
-
- uno::Reference< excel::XRange > xOldActiveCell( xApplication->getActiveSheet()->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_QUERY_THROW );
- xOldActiveCell->Select();
-
- uno::Reference< excel::XRange > resultCell;
-
- resultCell.set( xApplication->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_QUERY_THROW );
-
- // return result
-
- return resultCell;
+ ScRange aNewRange( (SCCOL)nNewX, (SCROW)nNewY, nTab, (SCCOL)nNewX, (SCROW)nNewY, nTab );
+ uno::Reference< table::XCellRange > xCellRange( new ScCellRangeObj( getScDocShell(), aNewRange ) );
+ uno::Reference< excel::XRange > xResultRange = new ScVbaRange( mxParent, mxContext, xCellRange );
+ return xResultRange;
}
bool
@@ -3584,7 +3700,7 @@ ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (u
if ( !isSingleCellRange() )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can't create Characters property for multicell range ") ), uno::Reference< uno::XInterface >() );
uno::Reference< text::XSimpleText > xSimple(mxRange->getCellByPosition(0,0) , uno::UNO_QUERY_THROW );
- ScDocument* pDoc = getDocumentFromRange(mxRange);
+ ScDocument* pDoc = excel::GetDocumentFromRange(mxRange);
if ( !pDoc )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() );
@@ -3648,7 +3764,7 @@ ScVbaRange::hasElements() throw (uno::RuntimeException)
if ( xColumnRowRange->getRows()->getCount() ||
xColumnRowRange->getColumns()->getCount() )
return sal_True;
- return sal_False;
+ return false;
}
// XEnumerationAccess
@@ -3678,6 +3794,15 @@ ScVbaRange::getDefaultMethodName( ) throw (uno::RuntimeException)
}
+uno::Reference< awt::XDevice >
+getDeviceFromDoc( const uno::Reference< frame::XModel >& xModel ) throw( uno::RuntimeException )
+{
+ uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XFrame> xFrame( xController->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XDevice > xDevice( xFrame->getComponentWindow(), uno::UNO_QUERY_THROW );
+ return xDevice;
+}
+
// returns calc internal col. width ( in points )
double
ScVbaRange::getCalcColWidth( const table::CellRangeAddress& rAddress) throw (uno::RuntimeException)
@@ -3692,7 +3817,7 @@ ScVbaRange::getCalcColWidth( const table::CellRangeAddress& rAddress) throw (uno
double
ScVbaRange::getCalcRowHeight( const table::CellRangeAddress& rAddress ) throw (uno::RuntimeException)
{
- ScDocument* pDoc = getDocumentFromRange( mxRange );
+ ScDocument* pDoc = excel::GetDocumentFromRange( mxRange );
sal_uInt16 nWidth = pDoc->GetOriginalHeight( rAddress.StartRow, rAddress.Sheet );
double nPoints = lcl_TwipsToPoints( nWidth );
nPoints = lcl_Round2DecPlaces( nPoints );
@@ -3700,16 +3825,29 @@ ScVbaRange::getCalcRowHeight( const table::CellRangeAddress& rAddress ) throw (u
}
// return Char Width in points
-double getDefaultCharWidth( ScDocShell* pDocShell )
-{
- ScDocument* pDoc = pDocShell->GetDocument();
- OutputDevice* pRefDevice = pDoc->GetRefDevice();
- ScPatternAttr* pAttr = pDoc->GetDefPattern();
- ::Font aDefFont;
- pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice );
- pRefDevice->SetFont( aDefFont );
- long nCharWidth = pRefDevice->GetTextWidth( String( '0' ) ); // 1/100th mm
- return lcl_hmmToPoints( nCharWidth );
+double getDefaultCharWidth( const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException )
+{
+ const static rtl::OUString sDflt( RTL_CONSTASCII_USTRINGPARAM("Default"));
+ const static rtl::OUString sCharFontName( RTL_CONSTASCII_USTRINGPARAM("CharFontName"));
+ const static rtl::OUString sPageStyles( RTL_CONSTASCII_USTRINGPARAM("PageStyles"));
+ // get the font from the default style
+ uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( xModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xNameAccess( xStyleSupplier->getStyleFamilies(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xNameAccess2( xNameAccess->getByName( sPageStyles ), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xNameAccess2->getByName( sDflt ), uno::UNO_QUERY_THROW );
+ rtl::OUString sFontName;
+ xProps->getPropertyValue( sCharFontName ) >>= sFontName;
+
+ uno::Reference< awt::XDevice > xDevice = getDeviceFromDoc( xModel );
+ awt::FontDescriptor aDesc;
+ aDesc.Name = sFontName;
+ uno::Reference< awt::XFont > xFont( xDevice->getFont( aDesc ), uno::UNO_QUERY_THROW );
+ double nCharPixelWidth = xFont->getCharWidth( (sal_Int8)'0' );
+
+ double nPixelsPerMeter = xDevice->getInfo().PixelPerMeterX;
+ double nCharWidth = nCharPixelWidth / nPixelsPerMeter;
+ nCharWidth = nCharWidth * (double)56700;// in twips
+ return lcl_TwipsToPoints( (sal_uInt16)nCharWidth );
}
uno::Any SAL_CALL
@@ -3769,8 +3907,11 @@ ScVbaRange::setColumnWidth( const uno::Any& _columnwidth ) throw (uno::RuntimeEx
ScDocShell* pDocShell = getScDocShell();
if ( pDocShell )
{
- if ( nColWidth != 0.0 )
- nColWidth = ( nColWidth + fExtraWidth ) * getDefaultCharWidth( pDocShell );
+ uno::Reference< frame::XModel > xModel = pDocShell->GetModel();
+ if ( xModel.is() )
+ {
+
+ nColWidth = ( nColWidth * getDefaultCharWidth( xModel ) );
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
sal_uInt16 nTwips = lcl_pointsToTwips( nColWidth );
@@ -3779,9 +3920,8 @@ ScVbaRange::setColumnWidth( const uno::Any& _columnwidth ) throw (uno::RuntimeEx
SCCOLROW nColArr[2];
nColArr[0] = thisAddress.StartColumn;
nColArr[1] = thisAddress.EndColumn;
- // #163561# use mode SC_SIZE_DIRECT: hide for width 0, show for other values
- aFunc.SetWidthOrHeight( sal_True, 1, nColArr, thisAddress.Sheet, SC_SIZE_DIRECT,
- nTwips, sal_True, sal_True );
+ aFunc.SetWidthOrHeight( true, 1, nColArr, thisAddress.Sheet, SC_SIZE_ORIGINAL,
+ nTwips, true, true );
}
}
@@ -3873,7 +4013,7 @@ ScVbaRange::BorderAround( const css::uno::Any& LineStyle, const css::uno::Any& W
case excel::XlBordersIndex::xlDiagonalUp:
break;
default:
- return uno::makeAny( sal_False );
+ return uno::makeAny( false );
}
}
return uno::makeAny( sal_True );
@@ -3938,34 +4078,33 @@ ScVbaRange::setRowHeight( const uno::Any& _rowheight) throw (uno::RuntimeExcepti
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
sal_uInt16 nTwips = lcl_pointsToTwips( nHeight );
- ScDocShell* pDocShell = getDocShellFromRange( mxRange );
+ ScDocShell* pDocShell = excel::GetDocShellFromRange( mxRange );
ScDocFunc aFunc(*pDocShell);
SCCOLROW nRowArr[2];
nRowArr[0] = thisAddress.StartRow;
nRowArr[1] = thisAddress.EndRow;
- // #163561# use mode SC_SIZE_DIRECT: hide for height 0, show for other values
- aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, thisAddress.Sheet, SC_SIZE_DIRECT,
- nTwips, sal_True, sal_True );
+ aFunc.SetWidthOrHeight( false, 1, nRowArr, thisAddress.Sheet, SC_SIZE_ORIGINAL,
+ nTwips, true, true );
}
uno::Any SAL_CALL
ScVbaRange::getPageBreak() throw (uno::RuntimeException)
{
sal_Int32 nPageBreak = excel::XlPageBreak::xlPageBreakNone;
- ScDocShell* pShell = getDocShellFromRange( mxRange );
+ ScDocShell* pShell = excel::GetDocShellFromRange( mxRange );
if ( pShell )
{
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
- sal_Bool bColumn = sal_False;
+ sal_Bool bColumn = false;
if (thisAddress.StartRow==0)
- bColumn = sal_True;
+ bColumn = true;
uno::Reference< frame::XModel > xModel = pShell->GetModel();
if ( xModel.is() )
{
- ScDocument* pDoc = getDocumentFromRange( mxRange );
+ ScDocument* pDoc = excel::GetDocumentFromRange( mxRange );
ScBreakType nBreak = BREAK_NONE;
if ( !bColumn )
@@ -3990,17 +4129,17 @@ ScVbaRange::setPageBreak( const uno::Any& _pagebreak) throw (uno::RuntimeExcepti
sal_Int32 nPageBreak = 0;
_pagebreak >>= nPageBreak;
- ScDocShell* pShell = getDocShellFromRange( mxRange );
+ ScDocShell* pShell = excel::GetDocShellFromRange( mxRange );
if ( pShell )
{
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
if ((thisAddress.StartColumn==0) && (thisAddress.StartRow==0))
return;
- sal_Bool bColumn = sal_False;
+ sal_Bool bColumn = false;
if (thisAddress.StartRow==0)
- bColumn = sal_True;
+ bColumn = true;
ScAddress aAddr( static_cast<SCCOL>(thisAddress.StartColumn), thisAddress.StartRow, thisAddress.Sheet );
uno::Reference< frame::XModel > xModel = pShell->GetModel();
@@ -4084,7 +4223,7 @@ ScVbaRange::getWorksheet() throw (uno::RuntimeException)
uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
xRange.set( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
}
- ScDocShell* pDocShell = getDocShellFromRange(xRange);
+ ScDocShell* pDocShell = excel::GetDocShellFromRange(xRange);
RangeHelper rHelper(xRange);
// parent should be Thisworkbook
xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) );
@@ -4139,63 +4278,44 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
}
}
}
- uno::Reference< sheet::XSpreadsheetView > xView( getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY );
- uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
- ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange );
- uno::Reference< excel::XRange > xVbSheetRange( pRange );
- return pRange->Range( Cell1, Cell2, true );
-}
-uno::Reference< sheet::XDatabaseRanges >
-lcl_GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException )
-{
- uno::Reference< frame::XModel > xModel;
- if ( pShell )
- xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XDatabaseRanges > xDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges") ) ), uno::UNO_QUERY_THROW );
- return xDBRanges;
-}
-// returns the XDatabaseRange for the autofilter on sheet (nSheet)
-// also populates sName with the name of range
-uno::Reference< sheet::XDatabaseRange >
-lcl_GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName )
-{
- uno::Reference< container::XIndexAccess > xIndexAccess( lcl_GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW );
- uno::Reference< sheet::XDatabaseRange > xDataBaseRange;
- table::CellRangeAddress dbAddress;
- for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index )
- {
- uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
- uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW );
- // autofilters work weirdly with openoffice, unnamed is the default
- // named range which is used to create an autofilter, but
- // its also possible that another name could be used
- // this also causes problems when an autofilter is created on
- // another sheet
- // ( but.. you can use any named range )
- dbAddress = xDBRange->getDataArea();
- if ( dbAddress.Sheet == nSheet )
- {
- sal_Bool bHasAuto = sal_False;
- uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW );
- xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto;
- if ( bHasAuto )
- {
- sName = xNamed->getName();
- xDataBaseRange=xDBRange;
- break;
- }
+ // Add these codes for supporting shortcut: Application.Range(Range1, Range2), Range1 or Range2 is not the range of current active sheet.
+ // If Range1 and Range2 are not in current active sheet, we should not use the active sheet, but use the sheet of Range1 and Range2.
+ // If Range1 and Range2 are not in the same sheet, we throw an exception.
+ uno::Reference< sheet::XSpreadsheet > xSpreadsheet;
+ uno::Reference< excel::XRange > xRange1( Cell1, uno::UNO_QUERY ), xRange2( Cell2, uno::UNO_QUERY );
+ if ( xRange1.is() )
+ {
+ RangeHelper thisRange( xRange1->getCellRange() );
+ xSpreadsheet = thisRange.getSpreadSheet();
+ }
+ else if ( xRange2.is() )
+ {
+ RangeHelper thisRange( xRange2->getCellRange() );
+ xSpreadsheet = thisRange.getSpreadSheet();
+ }
+ if ( !xSpreadsheet.is() )
+ {
+ uno::Reference< frame::XModel > xModel = getCurrentExcelDoc( xContext );
+ if ( xModel.is() )
+ {
+ uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+ xSpreadsheet = xView->getActiveSheet();
}
}
- return xDataBaseRange;
+
+ uno::Reference< table::XCellRange > xSheetRange( xSpreadsheet, uno::UNO_QUERY_THROW );
+ ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange );
+
+ uno::Reference< excel::XRange > xVbSheetRange( pRange );
+ return pRange->Range( Cell1, Cell2, true );
}
// Helper functions for AutoFilter
ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet )
{
rtl::OUString sName;
- lcl_GetAutoFiltRange( pDocShell, nSheet, sName );
+ excel::GetAutoFiltRange( pDocShell, nSheet, sName );
OSL_TRACE("lcl_GetDBData_Impl got autofilter range %s for sheet %d",
rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() , nSheet );
ScDBData* pRet = NULL;
@@ -4360,9 +4480,9 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
sal_Int16 nSheet = thisAddress.Sheet;
ScDocShell* pShell = getScDocShell();
- sal_Bool bHasAuto = sal_False;
+ sal_Bool bHasAuto = false;
rtl::OUString sAutofiltRangeName;
- uno::Reference< sheet::XDatabaseRange > xDataBaseRange = lcl_GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName );
+ uno::Reference< sheet::XDatabaseRange > xDataBaseRange = excel::GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName );
if ( xDataBaseRange.is() )
bHasAuto = true;
@@ -4409,7 +4529,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
}
}
- uno::Reference< sheet::XDatabaseRanges > xDBRanges = lcl_GetDataBaseRanges( pShell );
+ uno::Reference< sheet::XDatabaseRanges > xDBRanges = excel::GetDataBaseRanges( pShell );
if ( xDBRanges.is() )
{
rtl::OUString sGenName( RTL_CONSTASCII_USTRINGPARAM("VBA_Autofilter_") );
@@ -4426,9 +4546,13 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
uno::Reference< beans::XPropertySet > xDBRangeProps( xDataBaseRange, uno::UNO_QUERY_THROW );
// set autofilt
xDBRangeProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ), uno::Any(sal_True) );
- // set header (autofilter always need column headers)
+ // set header
uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW );
- xFiltProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ContainsHeader") ), uno::Any( sal_True ) );
+ sal_Bool bHasColHeader = false;
+ ScDocument* pDoc = pShell ? pShell->GetDocument() : NULL;
+
+ bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) ) ? sal_True : false;
+ xFiltProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ContainsHeader") ), uno::Any( bHasColHeader ) );
}
@@ -4437,19 +4561,15 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
sal_Int32 nOperator = excel::XlAutoFilterOperator::xlAnd;
sal_Bool bVisible = sal_True;
- bool bChangeDropDown = false;
VisibleDropDown >>= bVisible;
- if ( bVisible == bHasAuto ) // dropdown is displayed/notdisplayed as
- // required
- bVisible = sal_False;
- else
- bChangeDropDown = true;
+ if ( bVisible == bHasAuto ) // dropdown is displayed/notdisplayed as required
+ bVisible = false;
sheet::FilterConnection nConn = sheet::FilterConnection_AND;
double nCriteria1 = 0;
bool bHasCritValue = Criteria1.hasValue();
- bool bCritHasNumericValue = sal_False; // not sure if a numeric criteria is possible
+ bool bCritHasNumericValue = false; // not sure if a numeric criteria is possible
if ( bHasCritValue )
bCritHasNumericValue = ( Criteria1 >>= nCriteria1 );
@@ -4459,7 +4579,20 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
// we can't use refresh as the uno interface doesn't have a concept of ALL
// in this case we just call the core calc functionality -
bool bAll = false;
- if ( ( Field >>= nField ) )
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ bool bIsValidFieldValue = ( Field >>= nField );
+ if ( !bIsValidFieldValue && xConverter.is() )
+ {
+ try
+ {
+ uno::Any aConverted = xConverter->convertTo( Field, getCppuType( (sal_Int32*)0 ) );
+ bIsValidFieldValue = ( aConverted >>= nField );
+ }
+ catch( const uno::Exception& ex )
+ {
+ }
+ }
+ if ( bIsValidFieldValue )
{
uno::Reference< sheet::XSheetFilterDescriptor2 > xDesc(
xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY );
@@ -4490,7 +4623,19 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
bAll = true;
// not sure what the relationship between Criteria1 and Operator is,
// e.g. can you have a Operator without a Criteria ? in openoffice it
- if ( Operator.hasValue() && ( Operator >>= nOperator ) )
+ bool bIsValidOpValue = ( Operator.hasValue() && ( Operator >>= nOperator ) );
+ if ( Operator.hasValue() && !bIsValidOpValue && xConverter.is() )
+ {
+ try
+ {
+ uno::Any aConverted = xConverter->convertTo( Operator, getCppuType( (sal_Int32*)0 ) );
+ bIsValidOpValue = ( aConverted >>= nOperator );
+ }
+ catch( const uno::Exception& ex )
+ {
+ }
+ }
+ if ( bIsValidOpValue )
{
// if its a bottom/top Ten(Percent/Value) and there
// is no value specified for critera1 set it to 10
@@ -4544,7 +4689,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
{
uno::Reference< beans::XPropertySet > xProps;
lcl_setTableFieldsFromCriteria( sCriteria2, xProps, sTabFilts[1] );
- sTabFilts[1].IsNumeric = sal_False;
+ sTabFilts[1].IsNumeric = false;
}
}
else // numeric
@@ -4571,7 +4716,6 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
// this is just to toggle autofilter on and off ( not to be confused with
// a VisibleDropDown option combined with a field, in that case just the
// button should be disabled ) - currently we don't support that
- bChangeDropDown = true;
uno::Reference< beans::XPropertySet > xDBRangeProps( xDataBaseRange, uno::UNO_QUERY_THROW );
if ( bHasAuto )
{
@@ -4596,7 +4740,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
}
void SAL_CALL
-ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& /* CopyOrigin */ ) throw (uno::RuntimeException)
+ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (uno::RuntimeException)
{
// It appears ( from the web ) that the undocumented CopyOrigin
// param should contain member of enum XlInsertFormatOrigin
@@ -4640,7 +4784,7 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& /* CopyOrigin */ ) th
{
// After the insert ( this range ) actually has moved
ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) );
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getDocShellFromRange( mxRange ) , aRange ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( excel::GetDocShellFromRange( mxRange ) , aRange ) );
uno::Reference< excel::XRange > xVbaRange( new ScVbaRange( mxParent, mxContext, xRange, mbIsRows, mbIsColumns ) );
xVbaRange->PasteSpecial( uno::Any(), uno::Any(), uno::Any(), uno::Any() );
}
@@ -4664,7 +4808,7 @@ ScVbaRange::Autofit() throw (uno::RuntimeException)
if ( !( mbIsColumns || mbIsRows ) )
DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
- ScDocShell* pDocShell = getDocShellFromRange( mxRange );
+ ScDocShell* pDocShell = excel::GetDocShellFromRange( mxRange );
if ( pDocShell )
{
RangeHelper thisRange( mxRange );
@@ -4677,12 +4821,12 @@ ScVbaRange::Autofit() throw (uno::RuntimeException)
sal_Bool bDirection = sal_True;
if ( mbIsRows )
{
- bDirection = sal_False;
+ bDirection = false;
nColArr[0] = thisAddress.StartRow;
nColArr[1] = thisAddress.EndRow;
}
aFunc.SetWidthOrHeight( bDirection, 1, nColArr, thisAddress.Sheet, SC_SIZE_OPTIMAL,
- 0, sal_True, sal_True );
+ 0, true, true );
}
}
@@ -4696,15 +4840,15 @@ ScVbaRange::Autofit() throw (uno::RuntimeException)
***************************************************************************************/
void SAL_CALL
ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any& DataType, const css::uno::Any& TextQualifier,
- const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
- const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& /*FieldInfo*/,
+ const css::uno::Any& ConsecutiveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
+ const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& FieldInfo,
const css::uno::Any& DecimalSeparator, const css::uno::Any& ThousandsSeparator, const css::uno::Any& /*TrailingMinusNumbers*/ ) throw (css::uno::RuntimeException)
{
uno::Reference< excel::XRange > xRange;
if( Destination.hasValue() )
{
if( !( Destination >>= xRange ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Destination parameter should be a range" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Destination parameter should be a range" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set range\n");
}
@@ -4719,7 +4863,7 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any
if ( DataType.hasValue() )
{
if( !( DataType >>= xlTextParsingType ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "DataType parameter should be a short" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DataType parameter should be a short" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set Datatype\n" );
}
@@ -4729,54 +4873,54 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any
if( TextQualifier.hasValue() )
{
if( !( TextQualifier >>= xlTextQualifier ))
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "TextQualifier parameter should be a short" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "TextQualifier parameter should be a short" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set TextQualifier\n");
}
- sal_Bool bConsecutinveDelimiter = sal_False;
- if( ConsecutinveDelimiter.hasValue() )
+ sal_Bool bConsecutiveDelimiter = false;
+ if( ConsecutiveDelimiter.hasValue() )
{
- if( !( ConsecutinveDelimiter >>= bConsecutinveDelimiter ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "ConsecutinveDelimiter parameter should be a boolean" ),
+ if( !( ConsecutiveDelimiter >>= bConsecutiveDelimiter ) )
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ConsecutiveDelimiter parameter should be a boolean" )),
uno::Reference< uno::XInterface >() );
- OSL_TRACE("set ConsecutinveDelimiter\n");
+ OSL_TRACE("set ConsecutiveDelimiter\n");
}
- sal_Bool bTab = sal_False;
+ sal_Bool bTab = false;
if( Tab.hasValue() && bDilimited )
{
if( !( Tab >>= bTab ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Tab parameter should be a boolean" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Tab parameter should be a boolean" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set Tab\n");
}
- sal_Bool bSemicolon = sal_False;
+ sal_Bool bSemicolon = false;
if( Semicolon.hasValue() && bDilimited )
{
if( !( Semicolon >>= bSemicolon ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Semicolon parameter should be a boolean" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Semicolon parameter should be a boolean" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set Semicolon\n");
}
- sal_Bool bComma = sal_False;
+ sal_Bool bComma = false;
if( Comma.hasValue() && bDilimited )
{
if( !( Comma >>= bComma ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Comma parameter should be a boolean" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Comma parameter should be a boolean" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set Comma\n");
}
- sal_Bool bSpace = sal_False;
+ sal_Bool bSpace = false;
if( Space.hasValue() && bDilimited )
{
if( !( Space >>= bSpace ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Space parameter should be a boolean" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Space parameter should be a boolean" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set Space\n");
}
- sal_Bool bOther = sal_False;
+ sal_Bool bOther = false;
rtl::OUString sOtherChar;
if( Other.hasValue() && bDilimited )
{
@@ -4784,21 +4928,27 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any
{
if( OtherChar.hasValue() )
if( !( OtherChar >>= sOtherChar ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "OtherChar parameter should be a String" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OtherChar parameter should be a String" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set OtherChar\n" );
}
else if( bOther )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "Other parameter should be a True" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Other parameter should be a True" )),
uno::Reference< uno::XInterface >() );
}
- //TODO* FieldInfo Optional Variant. An array containing parse information for the individual columns of data. The interpretation depends on the value of DataType. When the data is delimited, this argument is an array of two-element arrays, with each two-element array specifying the conversion options for a particular column. The first element is the column number (1-based), and the second element is one of the xlColumnDataType constants specifying how the column is parsed.
+ // FieldInfo, Optional Variant. An array containing parse information for the individual columns of data.
+ // The interpretation depends on the value of DataType. When the data is delimited, this argument is an array
+ // of two-element arrays, with each two-element array specifying the conversion options for a particular column.
+ // The first element is the column number (1-based), and the second element is one of the xlColumnDataType
+ // constants specifying how the column is parsed.
+ uno::Sequence< uno::Sequence< uno::Any > > sFieldInfo;
+ FieldInfo >>= sFieldInfo;
rtl::OUString sDecimalSeparator;
if( DecimalSeparator.hasValue() )
{
if( !( DecimalSeparator >>= sDecimalSeparator ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "DecimalSeparator parameter should be a String" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DecimalSeparator parameter should be a String" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set DecimalSeparator\n" );
}
@@ -4806,11 +4956,110 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any
if( ThousandsSeparator.hasValue() )
{
if( !( ThousandsSeparator >>= sThousandsSeparator ) )
- throw uno::RuntimeException( rtl::OUString::createFromAscii( "ThousandsSeparator parameter should be a String" ),
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ThousandsSeparator parameter should be a String" )),
uno::Reference< uno::XInterface >() );
OSL_TRACE("set ThousandsSpeparator\n" );
}
- //TODO* TrailingMinusNumbers Optional Variant. Numbers that begin with a minus character.
+ //TODO* TrailingMinusNumbers Optional Variant. Numbers that begin with a minus character.
+
+ // Get the destination range's left-upper cell address.
+ ScVbaRange* pDestVbaRange = dynamic_cast< ScVbaRange* >( xRange.get() );
+ ScAddress aScDestAddress;
+ if ( pDestVbaRange )
+ {
+ ScUnoConversion::FillScAddress( aScDestAddress, pDestVbaRange->getLeftUpperCellAddress() );
+ }
+
+ // Parse the value of parameter FieldInfo.
+ sal_uInt16 nRealCount = 0;
+ xub_StrLen* pColumns = NULL;
+ sal_uInt8* pFormats = NULL;
+ if ( sFieldInfo.getLength() > 0 )
+ {
+ sal_uInt16 nCount = sFieldInfo.getLength();
+ pColumns = new xub_StrLen[nCount];
+ pFormats = new sal_uInt8[nCount];
+ sal_uInt16 nFormat = 1;
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ if ( sFieldInfo[nIndex].getLength() >= 2 )
+ {
+ nFormat = 1;
+ try
+ {
+ uno::Any aConverted = xConverter->convertTo( sFieldInfo[nIndex][0], getCppuType((xub_StrLen*)0) );
+ aConverted >>= pColumns[nRealCount];
+ aConverted = xConverter->convertTo( sFieldInfo[nIndex][1], getCppuType((sal_uInt16*)0) );
+ aConverted >>= nFormat;
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ pFormats[nRealCount++] = nFormat;
+ }
+ }
+ }
+
+ sal_Unicode cTextQualifier = '"';
+ cTextQualifier = xlTextQualifier == excel::XlTextQualifier::xlTextQualifierNone ? '\0' : cTextQualifier;
+ cTextQualifier = xlTextQualifier == excel::XlTextQualifier::xlTextQualifierSingleQuote ? '\'' : cTextQualifier;
+
+ // Get field delimiters.
+ String rFieldDelimiters;
+ if ( bTab ) rFieldDelimiters += '\t';
+ if ( bSemicolon ) rFieldDelimiters += ';';
+ if ( bComma ) rFieldDelimiters += ',';
+ if ( bSpace ) rFieldDelimiters += ' ';
+ if ( bOther ) rFieldDelimiters += *sOtherChar.getStr();
+
+ // Get the text in current range to SvMemoryStream.
+ ScRange aSrcScRange;
+ ScCellRangesBase* pSrcCellRangesBase = getCellRangesBase();
+ if ( pSrcCellRangesBase )
+ {
+ ScRangeList aRangeList = pSrcCellRangesBase->GetRangeList();
+ if ( !aRangeList.empty() )
+ {
+ aSrcScRange = *aRangeList.front();
+ }
+ }
+ ScImportExport aExport( getScDocument(), aSrcScRange );
+ aExport.SetDelimiter( static_cast< sal_Unicode >( 0 ) );
+ SvMemoryStream aStream;
+ aStream.SetStreamCharSet( RTL_TEXTENCODING_UNICODE );
+ ScImportExport::SetNoEndianSwap( aStream );
+ aExport.ExportStream( aStream, String(), FORMAT_STRING );
+ aStream.Seek( 0 );
+
+ // Set ScAsciiOptions according to the input parameters.
+ ScAsciiOptions aOptions;
+ aOptions.SetFixedLen( !bDilimited );
+ aOptions.SetStartRow( 0 );
+ aOptions.SetColInfo( nRealCount, pColumns, pFormats );
+ if ( bDilimited )
+ {
+ aOptions.SetFieldSeps( rFieldDelimiters );
+ aOptions.SetMergeSeps( bConsecutiveDelimiter );
+ aOptions.SetTextSep( cTextQualifier );
+ }
+
+ // Split the String in to columns.
+ if ( pDestVbaRange && pDestVbaRange->getScDocument() )
+ {
+ ScImportExport aImport( pDestVbaRange->getScDocument(), aScDestAddress );
+ aImport.SetExtOptions( aOptions );
+ aImport.SetApi( false );
+ aImport.ImportStream( aStream, String(), FORMAT_STRING );
+ }
+ if ( pColumns )
+ {
+ DELETEZ( pColumns );
+ }
+ if ( pFormats )
+ {
+ DELETEZ( pFormats );
+ }
}
uno::Any SAL_CALL
@@ -4941,7 +5190,7 @@ uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException)
if( m_Areas->getCount() > 1 )
throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can not get Range.ShowDetail attribute ")), uno::Reference< uno::XInterface >() );
- sal_Bool bShowDetail = sal_False;
+ sal_Bool bShowDetail = false;
RangeHelper helper( mxRange );
uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = helper.getSheetCellCursor();
@@ -4954,8 +5203,8 @@ uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException)
if( (thisAddress.StartRow == thisAddress.EndRow && thisAddress.EndRow == aOutlineAddress.EndRow ) ||
(thisAddress.StartColumn == thisAddress.EndColumn && thisAddress.EndColumn == aOutlineAddress.EndColumn ))
{
- sal_Bool bColumn =thisAddress.StartRow == thisAddress.EndRow ? sal_False:sal_True;
- ScDocument* pDoc = getDocumentFromRange( mxRange );
+ sal_Bool bColumn =thisAddress.StartRow == thisAddress.EndRow ? false:sal_True;
+ ScDocument* pDoc = excel::GetDocumentFromRange( mxRange );
ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(static_cast<SCTAB>(thisAddress.Sheet), sal_True);
const ScOutlineArray* pOutlineArray = bColumn ? pOutlineTable->GetColArray(): pOutlineTable->GetRowArray();
if( pOutlineArray )
@@ -5011,6 +5260,17 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru
}
}
+::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL
+ScVbaRange::getQueryTable() throw (::com::sun::star::uno::RuntimeException)
+{
+ if (!m_xQueryTable.is())
+ {
+ m_xQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this);
+ }
+
+ return m_xQueryTable;
+}
+
uno::Reference< excel::XRange > SAL_CALL
ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeException)
{
@@ -5040,6 +5300,116 @@ ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeExceptio
return new ScVbaRange( mxParent, mxContext, mxRange );
}
+//The recordset's member: Recordset.Fields.Item will get a Field obj.
+//Field.value is the column value.
+::sal_Int32 SAL_CALL
+ScVbaRange::CopyFromRecordset( const ::com::sun::star::uno::Any& Data, const ::com::sun::star::uno::Any& MaxRows, const ::com::sun::star::uno::Any& MaxColumns )
+throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException)
+{
+ uno::Sequence< uno::Any > aParams;
+ uno::Sequence< uno::Any > aFieldsParams(1);
+ uno::Sequence< sal_Int16 > aOutParamIndex;
+ uno::Sequence< uno::Any > aOutParam;
+ uno::Reference< uno::XInterface > xIntRes;
+ uno::Reference< uno::XInterface > xIntFields;
+ uno::Reference< uno::XInterface > xIntFld;
+ uno::Any aRet;
+ uno::Any aPar;
+ uno::Any aCrrCol;
+ uno::Any aCrrRow;
+ sal_Int16 nCrrCol = 0;
+ sal_Int32 nCrrRow = 0;
+ sal_Int32 nCol;
+ sal_Int32 nMaxRows = 0;
+ sal_Int32 nMaxColumns = 0;
+ sal_Bool bEof = false;
+ long lColCnt = 0;
+ if (MaxColumns.hasValue())
+ {
+ MaxColumns >>= nMaxColumns;
+ }
+
+ long lMaxCol = nMaxColumns;
+
+ if (MaxRows.hasValue())
+ {
+ MaxRows >>= nMaxRows;
+ }
+
+
+ Data >>= xIntRes;
+ uno::Reference< script::XInvocation > xInvRes(xIntRes, uno::UNO_QUERY_THROW);
+ rtl::OUString oMoveNext(RTL_CONSTASCII_USTRINGPARAM("MoveNext")) ;
+ rtl::OUString oEof(RTL_CONSTASCII_USTRINGPARAM("EOF")) ;
+ rtl::OUString oFields(RTL_CONSTASCII_USTRINGPARAM("Fields")) ;
+
+ if( !xInvRes->hasMethod(oMoveNext))
+ {
+ return -1;
+ }
+
+ //Get columns count
+ aRet = xInvRes->getValue(oFields);
+ aRet >>= xIntFields;
+ uno::Reference< script::XInvocation > xInvFields(xIntFields, uno::UNO_QUERY_THROW);
+ aRet = xInvFields->getValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Count"))) ;
+ aRet >>= lColCnt;
+
+ //Set the assign column number
+ if (lMaxCol != 0)
+ {
+ if (lColCnt > lMaxCol)
+ {
+ lColCnt = lMaxCol;
+ }
+ }
+
+ aCrrRow <<= nCrrRow;
+ aCrrCol <<= nCrrCol;
+
+
+ //Get start position
+ uno::Reference< excel::XRange > xRngStartRow = Rows(uno::Any(sal_Int32(1)) );
+ uno::Reference< excel::XRange > xRngPos = xRngStartRow->Columns( uno::Any(sal_Int32(1)) );
+
+ while(1)
+ {//travel recordset
+ //get every column
+ for (long l = 0; l < lColCnt ; l++)
+ {
+ nCol = l;
+ aPar <<= nCol;
+ //get every field
+ aRet = xInvFields->invoke( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Item")), uno::Sequence< uno::Any >(&aPar,1) , aOutParamIndex,aOutParam);
+ aRet >>= xIntFld;
+ uno::Reference< script::XInvocation > xInvFld(xIntFld, uno::UNO_QUERY_THROW); //Get the Field obj
+
+ //set the field value
+ aRet = xInvFld->getValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")) );
+ uno::Reference< excel::XRange > xRngToFill = xRngPos->Offset(aCrrRow,aCrrCol );
+
+ xRngToFill->setValue(aRet);
+ nCrrCol++;
+ aCrrCol <<= nCrrCol;
+ }
+
+ aRet = xInvRes->invoke(oMoveNext, aParams,aOutParamIndex,aOutParam );
+ aRet = xInvRes->getValue(oEof);
+ aRet >>= bEof;
+ if (bEof || ( nCrrRow >= nMaxRows && nMaxRows != 0) )
+ {//Arrive the end of recordset
+ break;
+ }
+
+ nCrrRow++;
+ aCrrRow <<= nCrrRow;
+ nCrrCol = 0;
+ aCrrCol <<= nCrrCol;
+ }
+
+ return 0;
+}
+
void SAL_CALL
ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& ActivePrinter, const uno::Any& PrintToFile, const uno::Any& Collate, const uno::Any& PrToFileName ) throw (uno::RuntimeException)
{
@@ -5058,7 +5428,7 @@ ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any&
{
ScVbaRange* pRange = getImplementation( xRange );
// initialise the doc shell and the printareas
- pShell = getDocShellFromRange( pRange->mxRange );
+ pShell = excel::GetDocShellFromRange( pRange->mxRange );
xPrintAreas.set( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
}
printAreas[ index - 1 ] = rangeAddress;
@@ -5090,11 +5460,6 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const
ScUnoConversion::FillScRange( destRange, destAddress );
ScUnoConversion::FillScRange( sourceRange, thisAddress );
-
- // source is valid
-// if ( !sourceRange.In( destRange ) )
-// throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "source not in destination" ) ), uno::Reference< uno::XInterface >() );
-
FillDir eDir = FILL_TO_BOTTOM;
double fStep = 1.0;
@@ -5144,7 +5509,7 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const
}
}
}
- ScDocShell* pDocSh= getDocShellFromRange( mxRange );
+ ScDocShell* pDocSh= excel::GetDocShellFromRange( mxRange );
FillCmd eCmd = FILL_AUTO;
FillDateCmd eDateCmd = FILL_DAY;
@@ -5222,10 +5587,10 @@ ScVbaRange::GoalSeek( const uno::Any& Goal, const uno::Reference< excel::XRange
// but... if it detects 0 is the value it requires then it will use that
// e.g. divergence & result both = 0.0 does NOT mean there is an error
if ( ( res.Divergence != 0.0 ) && ( res.Result == 0.0 ) )
- bRes = sal_False;
+ bRes = false;
}
else
- bRes = sal_False;
+ bRes = false;
return bRes;
}
@@ -5267,13 +5632,8 @@ ScVbaRange::AutoOutline( ) throw (script::BasicErrorException, uno::RuntimeExce
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
- if ( isSingleCellRange() || mbIsRows )
- {
- uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
- xSheetOutline->autoOutline( thisAddress );
- }
- else
- DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
+ uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
+ xSheetOutline->autoOutline( thisAddress );
}
void SAL_CALL
@@ -5292,7 +5652,7 @@ ScVbaRange:: ClearOutline( ) throw (script::BasicErrorException, uno::RuntimeEx
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
- xSheetOutline->clearOutline();
+ xSheetOutline->clearOutline();
}
void
@@ -5300,9 +5660,9 @@ ScVbaRange::groupUnGroup( bool bUnGroup ) throw ( script::BasicErrorException, u
{
if ( m_Areas->getCount() > 1 )
DebugHelper::exception(SbERR_METHOD_FAILED, STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY);
- table::TableOrientation nOrient = table::TableOrientation_ROWS;
- if ( mbIsColumns )
- nOrient = table::TableOrientation_COLUMNS;
+ table::TableOrientation nOrient = table::TableOrientation_COLUMNS;
+ if ( mbIsRows )
+ nOrient = table::TableOrientation_ROWS;
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
@@ -5342,7 +5702,7 @@ ScVbaRange::Merge( const uno::Any& Across ) throw (script::BasicErrorException,
return;
}
uno::Reference< table::XCellRange > oCellRange;
- sal_Bool bAcross = sal_False;
+ sal_Bool bAcross = false;
Across >>= bAcross;
if ( !bAcross )
lcl_mergeCellsOfRange( mxRange );
@@ -5352,8 +5712,8 @@ ScVbaRange::Merge( const uno::Any& Across ) throw (script::BasicErrorException,
// #TODO #FIXME this seems incredibly lame, this can't be right
for (sal_Int32 i=1; i <= oRangeRowsImpl->getCount();i++)
{
- oRangeRowsImpl->Cells( uno::makeAny( i ), uno::Any() )->Merge( uno::makeAny( sal_False ) );
- }
+ oRangeRowsImpl->Cells( uno::makeAny( i ), uno::Any() )->Merge( uno::makeAny( false ) );
+ }
}
}
@@ -5370,7 +5730,7 @@ ScVbaRange::UnMerge( ) throw (script::BasicErrorException, uno::RuntimeExceptio
}
return;
}
- lcl_mergeCellsOfRange( mxRange, sal_False);
+ lcl_mergeCellsOfRange( mxRange, false);
}
uno::Any SAL_CALL
@@ -5420,7 +5780,7 @@ ScVbaRange::PreviousNext( bool bIsPrevious )
SCTAB nTab = refRange.aStart.Tab();
ScDocument* pDoc = getScDocument();
- pDoc->GetNextPos( nNewX,nNewY, nTab, nMove,0, sal_True,sal_True, markedRange );
+ pDoc->GetNextPos( nNewX,nNewY, nTab, nMove,0, true,true, markedRange );
refRange.aStart.SetCol( nNewX );
refRange.aStart.SetRow( nNewY );
refRange.aStart.SetTab( nTab );
@@ -5461,6 +5821,7 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw
bool bIsSingleCell = isSingleCellRange();
bool bIsMultiArea = ( m_Areas->getCount() > 1 );
ScVbaRange* pRangeToUse = this;
+ uno::Reference< excel::XRange > xUsedRange( getWorksheet()->getUsedRange() );
sal_Int32 nType = 0;
if ( !( _oType >>= nType ) )
DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() );
@@ -5510,9 +5871,9 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw
aCellRanges.Append( refRange );
}
// Single range
- if ( aCellRanges.First() == aCellRanges.Last() )
+ if ( aCellRanges.size() == 1 )
{
- uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), *aCellRanges.First() ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), *aCellRanges.front() ) );
return new ScVbaRange( mxParent, mxContext, xRange );
}
uno::Reference< sheet::XSheetCellRangeContainer > xRanges( new ScCellRangesObj( getScDocShell(), aCellRanges ) );
@@ -5521,7 +5882,6 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw
}
else if ( bIsSingleCell )
{
- uno::Reference< excel::XRange > xUsedRange = getWorksheet()->getUsedRange();
pRangeToUse = static_cast< ScVbaRange* >( xUsedRange.get() );
}
@@ -5630,9 +5990,9 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno::
{
try
{
- sal_Bool bDoReplace = sal_False;
+ sal_Bool bDoReplace = false;
aReplace >>= bDoReplace;
- sal_Bool bAddPageBreaks = sal_False;
+ sal_Bool bAddPageBreaks = false;
PageBreaks >>= bAddPageBreaks;
uno::Reference< sheet::XSubTotalCalculatable> xSub(mxRange, uno::UNO_QUERY_THROW );
@@ -5696,6 +6056,182 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno::
}
}
+uno::Any SAL_CALL ScVbaRange::AdvancedFilter( sal_Int32 Action, const uno::Any& CriteriaRange,
+ const uno::Any& CopyToRange, const uno::Any& Unique ) throw (script::BasicErrorException, uno::RuntimeException)
+{
+ uno::Any aRet;
+ aRet <<= sal_True;
+
+ uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext );
+ ScDocument* pDoc = getScDocument();
+ if ( !pDoc )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from range" ) ), uno::Reference< uno::XInterface >() );
+ }
+
+ // Action
+ if ( Action != excel::XlFilterAction::xlFilterInPlace && Action != excel::XlFilterAction::xlFilterCopy )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid input parameter" ) ), uno::Reference< uno::XInterface >() );
+ }
+ if ( m_Areas->getCount() > 1 )
+ {
+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid range" ) ), uno::Reference< uno::XInterface >() );
+ }
+
+ sal_Bool bCopyOut = ( Action != excel::XlFilterAction::xlFilterInPlace );
+ uno::Reference< sheet::XSheetFilterDescriptor > xFilterDesc;
+ uno::Reference< sheet::XSheetFilterable > xSheetFilter( mxRange, uno::UNO_QUERY_THROW );
+
+ // CriteriaRange
+ String aBuiltInCriteria; // Excel Built-In Filter Criteria.
+ table::CellRangeAddress refParentAddr;
+ uno::Any aCriteriaRange = CriteriaRange;
+ formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1;
+ if ( aCriteriaRange.hasValue() && aCriteriaRange.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString rRangeString;
+ aCriteriaRange >>= rRangeString;
+ aConv = excel::IsR1C1ReferFormat( pDoc, rRangeString ) ? formula::FormulaGrammar::CONV_XL_R1C1 : aConv;
+ }
+ else
+ {
+ // Get Excel BuiltIn Filter Criteria.
+ ScRangeName* pRangeNames = pDoc->GetRangeName();
+ if (pRangeNames)
+ {
+ ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ for (; itr != itrEnd; ++itr)
+ {
+ if (itr->HasType(RT_CRITERIA))
+ {
+ itr->GetSymbol( aBuiltInCriteria, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 );
+ break;
+ }
+ }
+ }
+ aCriteriaRange = aBuiltInCriteria.Len() > 0 ? uno::makeAny( rtl::OUString( aBuiltInCriteria ) ) : aCriteriaRange;
+ }
+ if ( aCriteriaRange.hasValue() )
+ {
+ table::CellRangeAddress criteriaRangeAddress = getCellRangeAddressForVBARange( aCriteriaRange, getScDocShell(), aConv );
+ ScRange refRange;
+ ScUnoConversion::FillScRange( refRange, criteriaRangeAddress );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), refRange ) );
+ uno::Reference< sheet::XSheetFilterableEx > xCriteria( xRange, uno::UNO_QUERY );
+ if ( xCriteria.is() )
+ {
+ xFilterDesc = xCriteria->createFilterDescriptorByObject( xSheetFilter );
+ }
+ }
+ else if ( mxRange.is() )
+ {
+ uno::Reference< sheet::XSheetFilterableEx > xCriteria( mxRange, uno::UNO_QUERY );
+ if ( xCriteria.is() )
+ {
+ xFilterDesc = xCriteria->createFilterDescriptorByObject( xSheetFilter );
+ }
+ }
+
+ uno::Reference< beans::XPropertySet > xPropertySet( xFilterDesc, uno::UNO_QUERY );
+ if ( xPropertySet.is() )
+ {
+ xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_COPYOUT ) ), uno::makeAny( bCopyOut ) );
+ }
+
+ // CopyToRange
+ if ( bCopyOut && CopyToRange.hasValue() && xPropertySet.is() )
+ {
+ formula::FormulaGrammar::AddressConvention aTmpConv = formula::FormulaGrammar::CONV_XL_A1;
+ if ( CopyToRange.getValueTypeClass() == uno::TypeClass_STRING )
+ {
+ rtl::OUString rRangeString;
+ CopyToRange >>= rRangeString;
+ aTmpConv = excel::IsR1C1ReferFormat( pDoc, rRangeString ) ? formula::FormulaGrammar::CONV_XL_R1C1 : aConv;
+ }
+ ScRange refRange;
+ ScUnoConversion::FillScRange( refRange, getCellRangeAddressForVBARange( CopyToRange, getScDocShell(), aTmpConv ) );
+ uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), refRange ) );
+ uno::Reference< sheet::XCellAddressable > xCellAddr( xRange->getCellByPosition( 0, 0 ), uno::UNO_QUERY_THROW );
+ xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_OUTPOS ) ), uno::makeAny( xCellAddr->getCellAddress() ) );
+ }
+
+ // Unique
+ if ( xPropertySet.is() )
+ {
+ sal_Bool bUnique = false;
+ uno::Any aUnique;
+ try
+ {
+ aUnique <<= bUnique;
+ aUnique = ( xConverter.is() && Unique.hasValue() ) ? xConverter->convertTo( Unique, getCppuType( ( sal_Bool* ) 0 ) ) : aUnique;
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SKIPDUP ) ), aUnique );
+ }
+
+ // Do filter.
+ if ( xFilterDesc.is() )
+ {
+ xSheetFilter->filter( xFilterDesc );
+ }
+
+ return aRet;
+}
+
+//Range.PivotTable.
+//Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range.
+uno::Reference< excel::XPivotTable >
+ScVbaRange::PivotTable() throw (uno::RuntimeException)
+{
+ uno::Reference< excel::XPivotTable > xDestPVTable;
+
+ uno::Reference< sheet::XSpreadsheet > xSheet;
+ if ( mxRange.is() )
+ {
+ RangeHelper thisRange( mxRange );
+ xSheet = thisRange.getSpreadSheet();
+ }
+ else if ( mxRanges.is() )
+ {
+ uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW );
+ uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW );
+ RangeHelper thisRange( xRange );
+ xSheet = thisRange.getSpreadSheet();
+ }
+
+ uno::Reference< sheet::XDataPilotTablesSupplier > xTables(xSheet, uno::UNO_QUERY_THROW ) ;
+ uno::Reference< container::XIndexAccess > xIndexAccess( xTables->getDataPilotTables(), uno::UNO_QUERY_THROW );
+ if ( xIndexAccess.is() )
+ {
+ //get the upper-left cell address
+ table::CellAddress aAddress = getLeftUpperCellAddress();
+
+ sal_Int32 nCount = xIndexAccess->getCount();
+ for (sal_Int32 i=0; i < nCount; i++)
+ {
+ uno::Reference< sheet::XDataPilotTable > xDPTable(xIndexAccess->getByIndex(i), uno::UNO_QUERY);
+ uno::Reference< sheet::XDataPilotTable2 > xDPTable2(xDPTable, uno::UNO_QUERY);
+
+ //check if the cell is in the pivot table
+ sheet::DataPilotTablePositionData posData = xDPTable2->getPositionData(aAddress);
+ table::CellRangeAddress aCellRangeAddress = xDPTable->getOutputRange();
+ ScRange aScRange( aCellRangeAddress.StartColumn, aCellRangeAddress.StartRow, aCellRangeAddress.Sheet,
+ aCellRangeAddress.EndColumn, aCellRangeAddress.EndRow, aCellRangeAddress.Sheet );
+ ScAddress aPos( aAddress.Column, aAddress.Row, aAddress.Sheet );
+ if( !(posData.PositionType == sheet::DataPilotTablePositionType::NOT_IN_TABLE) || aScRange.In( aPos ) )
+ {
+ xDestPVTable = new ScVbaPivotTable( mxContext, xDPTable );
+ break;
+ }
+ }
+ }
+ return xDestPVTable;
+}
+
+
rtl::OUString&
ScVbaRange::getServiceImplName()
{
@@ -5715,6 +6251,25 @@ ScVbaRange::getServiceNames()
return aServiceNames;
}
+sal_Bool SAL_CALL
+ScVbaRange::hasError() throw (uno::RuntimeException)
+{
+ double dResult = false;
+ uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
+ uno::Reference< script::XInvocation > xInvoc( xApplication->WorksheetFunction(), uno::UNO_QUERY_THROW );
+
+ static rtl::OUString FunctionName( RTL_CONSTASCII_USTRINGPARAM("IsError" ) );
+ uno::Sequence< uno::Any > Params(1);
+ uno::Reference< excel::XRange > aRange( this );
+ Params[0] = uno::makeAny( aRange );
+ uno::Sequence< sal_Int16 > OutParamIndex;
+ uno::Sequence< uno::Any > OutParam;
+ xInvoc->invoke( FunctionName, Params, OutParamIndex, OutParam ) >>= dResult;
+ if ( dResult > 0.0 )
+ return sal_True;
+ return false;
+}
+
namespace range
{
namespace sdecl = comphelper::service_decl;
@@ -5724,3 +6279,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"SvVbaRange",
"ooo.vba.excel.Range" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx
index e8079a855544..687128b98757 100644
--- a/sc/source/ui/vba/vbarange.hxx
+++ b/sc/source/ui/vba/vbarange.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include <ooo/vba/excel/XFont.hpp>
#include <ooo/vba/excel/XComment.hpp>
#include <ooo/vba/XCollection.hpp>
+#include <ooo/vba/excel/XPivotTable.hpp>
#include <ooo/vba/excel/XlPasteType.hdl>
#include <ooo/vba/excel/XlPasteSpecialOperation.hdl>
@@ -49,8 +51,9 @@
#include <com/sun/star/sheet/FillDirection.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+#include "vbaquerytable.hxx"
-//#include <vbahelper/vbahelperinterface.hxx>
#include "vbaformat.hxx"
#include <formula/grammar.hxx>
@@ -62,7 +65,6 @@ class ScDocShell;
class ScDocument;
class ScRangeList;
-//typedef InheritedHelperInterfaceImpl1< ov::excel::XRange > ScVbaRange_BASE;
typedef ScVbaFormat< ov::excel::XRange > ScVbaRange_BASE;
class ArrayVisitor
@@ -99,7 +101,7 @@ class ScVbaRange : public ScVbaRange_BASE
sal_Bool mbIsRows;
sal_Bool mbIsColumns;
css::uno::Reference< ov::excel::XValidation > m_xValidation;
-
+ css::uno::Reference<excel::XQueryTable> m_xQueryTable;
double getCalcColWidth( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException);
double getCalcRowHeight( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException);
void visitArray( ArrayVisitor& vistor );
@@ -118,7 +120,6 @@ class ScVbaRange : public ScVbaRange_BASE
css::uno::Reference< ov::excel::XRange > getArea( sal_Int32 nIndex ) throw( css::uno::RuntimeException );
ScCellRangeObj* getCellRangeObj( ) throw ( css::uno::RuntimeException );
- ScCellRangesObj* getCellRangesObj() throw ( css::uno::RuntimeException );
css::uno::Reference< ov::XCollection >& getBorders();
void groupUnGroup( bool bUnGroup = false ) throw ( css::script::BasicErrorException, css::uno::RuntimeException );
css::uno::Reference< ov::excel::XRange > PreviousNext( bool bIsPrevious );
@@ -156,6 +157,7 @@ public:
const css::uno::Reference< css::uno::XComponentContext >& xContext,
const rtl::OUString& sRangeName, ScDocShell* pDocSh,
formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 ) throw ( css::uno::RuntimeException );
+ css::table::CellAddress getLeftUpperCellAddress();
static css::uno::Reference< ov::excel::XRange > CellsHelper(
const css::uno::Reference< ov::XHelperInterface >& xParent,
@@ -164,6 +166,7 @@ public:
const css::uno::Any &nRowIndex, const css::uno::Any &nColumnIndex ) throw(css::uno::RuntimeException);
// Attributes
+ virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
virtual void SAL_CALL setValue( const css::uno::Any& aValue ) throw ( css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getFormula() throw (css::uno::RuntimeException);
@@ -204,9 +207,10 @@ public:
virtual css::uno::Any SAL_CALL getPrefixCharacter() throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getShowDetail() throw (css::uno::RuntimeException);
virtual void SAL_CALL setShowDetail(const css::uno::Any& aShowDetail) throw (css::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL getQueryTable() throw (::com::sun::star::uno::RuntimeException);
// Methods
- sal_Bool IsRows() { return mbIsRows; }
- sal_Bool IsColumns() { return mbIsColumns; }
+ sal_Bool IsRows() const { return mbIsRows; }
+ sal_Bool IsColumns() const { return mbIsColumns; }
virtual css::uno::Reference< ov::excel::XComment > SAL_CALL AddComment( const css::uno::Any& Text ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Clear() throw (css::uno::RuntimeException);
virtual void SAL_CALL ClearComments() throw (css::uno::RuntimeException);
@@ -254,7 +258,7 @@ public:
virtual css::uno::Any SAL_CALL BorderAround( const css::uno::Any& LineStyle,
const css::uno::Any& Weight, const css::uno::Any& ColorIndex, const css::uno::Any& Color ) throw (css::uno::RuntimeException);
virtual void SAL_CALL TextToColumns( const css::uno::Any& Destination, const css::uno::Any& DataType, const css::uno::Any& TextQualifier,
- const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
+ const css::uno::Any& ConsecutiveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma,
const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& FieldInfo,
const css::uno::Any& DecimalSeparator, const css::uno::Any& ThousandsSeparator, const css::uno::Any& TrailingMinusNumbers ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
@@ -279,6 +283,11 @@ public:
virtual void SAL_CALL RemoveSubtotal( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL MergeArea() throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual void SAL_CALL Subtotal( ::sal_Int32 GroupBy, ::sal_Int32 Function, const css::uno::Sequence< ::sal_Int32 >& TotalList, const css::uno::Any& Replace, const css::uno::Any& PageBreaks, const css::uno::Any& SummaryBelowData ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL AdvancedFilter( ::sal_Int32 Action, const css::uno::Any& CriteriaRange, const css::uno::Any& CopyToRange, const css::uno::Any& Unique ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< ov::excel::XPivotTable > SAL_CALL PivotTable( ) throw (css::uno::RuntimeException);
+
+ virtual ::sal_Int32 SAL_CALL CopyFromRecordset( const ::com::sun::star::uno::Any& Data, const ::com::sun::star::uno::Any& MaxRows, const ::com::sun::star::uno::Any& MaxColumns ) throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException);
// XEnumerationAccess
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
// XElementAccess
@@ -291,7 +300,7 @@ public:
// XDefaultMethod
::rtl::OUString SAL_CALL getDefaultMethodName( ) throw (css::uno::RuntimeException);
// XDefaultProperty
- ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+ ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); }
// #TODO completely rewrite ScVbaRange, its become a hackfest
@@ -304,9 +313,12 @@ public:
static css::uno::Reference< ov::excel::XRange > ApplicationRange( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Any &Cell1, const css::uno::Any &Cell2 ) throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL GoalSeek( const css::uno::Any& Goal, const css::uno::Reference< ov::excel::XRange >& ChangingCell ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL SpecialCells( const css::uno::Any& _oType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException );
+ // XErrorQuery
+ virtual ::sal_Bool SAL_CALL hasError( ) throw (css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif /* SC_VBA_RANGE_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaseriescollection.cxx b/sc/source/ui/vba/vbaseriescollection.cxx
deleted file mode 100644
index 8caa746beff0..000000000000
--- a/sc/source/ui/vba/vbaseriescollection.cxx
+++ /dev/null
@@ -1,80 +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.
- *
- ************************************************************************/
-#include "vbaseriescollection.hxx"
-#include <ooo/vba/excel/XSeries.hpp>
-
-#include "vbaglobals.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::ooo::vba;
-
-ScVbaSeriesCollection::ScVbaSeriesCollection( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext ) : SeriesCollection_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() )
-{
-}
-
-// XEnumerationAccess
-
-uno::Reference< container::XEnumeration >
-ScVbaSeriesCollection::createEnumeration() throw (uno::RuntimeException)
-{
- uno::Reference< container::XEnumeration > xEnum;
- return xEnum;
-}
-
-// XElementAccess
-
-uno::Type
-ScVbaSeriesCollection::getElementType() throw (uno::RuntimeException)
-{
- return excel::XSeries::static_type(0);
-}
-
-uno::Any
-ScVbaSeriesCollection::createCollectionObject( const css::uno::Any& rSource )
-{
- return rSource;
-}
-
-rtl::OUString&
-ScVbaSeriesCollection::getServiceImplName()
-{
- static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaSeriesCollection") );
- return sImplName;
-}
-
-css::uno::Sequence<rtl::OUString>
-ScVbaSeriesCollection::getServiceNames()
-{
- static uno::Sequence< rtl::OUString > sNames;
- if ( sNames.getLength() == 0 )
- {
- sNames.realloc( 1 );
- sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.SeriesCollection") );
- }
- return sNames;
-}
-
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index 7c8d80d9fcfa..f7582d9a25a2 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -404,7 +405,7 @@ void SAL_CALL ScVbaControlObjectBase::setPrintObject( sal_Bool bPrintObject ) th
sal_Bool SAL_CALL ScVbaControlObjectBase::getAutoSize() throw (uno::RuntimeException)
{
// not supported
- return sal_False;
+ return false;
}
void SAL_CALL ScVbaControlObjectBase::setAutoSize( sal_Bool /*bAutoSize*/ ) throw (uno::RuntimeException)
@@ -542,3 +543,5 @@ void ScVbaButton::implSetDefaultProperties() throw (uno::RuntimeException)
}
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbasheetobject.hxx b/sc/source/ui/vba/vbasheetobject.hxx
index b2546ca09c93..245320e5be3b 100755..100644
--- a/sc/source/ui/vba/vbasheetobject.hxx
+++ b/sc/source/ui/vba/vbasheetobject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -218,3 +219,5 @@ protected:
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx
index ced94db5ba76..3847209989f9 100755..100644
--- a/sc/source/ui/vba/vbasheetobjects.cxx
+++ b/sc/source/ui/vba/vbasheetobjects.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -532,3 +533,5 @@ ScVbaButtons::ScVbaButtons(
VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtons, "ooo.vba.excel.Buttons" )
// ============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbasheetobjects.hxx b/sc/source/ui/vba/vbasheetobjects.hxx
index fd69d4927a20..2a68d2251ad4 100755..100644
--- a/sc/source/ui/vba/vbasheetobjects.hxx
+++ b/sc/source/ui/vba/vbasheetobjects.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111,3 +112,5 @@ public:
// ============================================================================
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx
index b99b2e783101..c32b0ed7ff09 100644
--- a/sc/source/ui/vba/vbastyle.cxx
+++ b/sc/source/ui/vba/vbastyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -132,7 +133,7 @@ ScVbaStyle::getNameLocal() throw (script::BasicErrorException, uno::RuntimeExcep
{
mxPropertySet->getPropertyValue(DISPLAYNAME) >>= sName;
}
- catch (uno::Exception e)
+ catch (uno::Exception &e)
{
DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() );
}
@@ -184,3 +185,5 @@ ScVbaStyle::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbastyle.hxx b/sc/source/ui/vba/vbastyle.hxx
index d5bb232dabc2..70b23a989287 100644
--- a/sc/source/ui/vba/vbastyle.hxx
+++ b/sc/source/ui/vba/vbastyle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,39 +59,11 @@ public:
// XFormat
virtual void SAL_CALL setMergeCells( const css::uno::Any& MergeCells ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL getMergeCells( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
-/*
- // XFormat
- virtual css::uno::Reference< ::ooo::vba::excel::XBorders > SAL_CALL Borders( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Reference< ::ooo::vba::excel::XFont > SAL_CALL Font( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Reference< ::ooo::vba::excel::XInterior > SAL_CALL Interior( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setNumberFormat( const css::uno::Any& NumberFormat ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getNumberFormat( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setNumberFormatLocal( const css::uno::Any& NumberFormatLocal ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getNumberFormatLocal( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setIndentLevel( const css::uno::Any& IndentLevel ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getIndentLevel( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setHorizontalAlignment( const css::uno::Any& HorizontalAlignment ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getHorizontalAlignment( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setVerticalAlignment( const css::uno::Any& VerticalAlignment ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getVerticalAlignment( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setOrientation( const css::uno::Any& Orientation ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getOrientation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setShrinkToFit( const css::uno::Any& ShrinkToFit ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getShrinkToFit( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setWrapText( const css::uno::Any& WrapText ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getWrapText( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setLocked( const css::uno::Any& Locked ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getLocked( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setFormulaHidden( const css::uno::Any& FormulaHidden ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
-/ virtual css::uno::Any SAL_CALL getFormulaHidden( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual void SAL_CALL setMergeCells( const css::uno::Any& MergeCells ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0;
- virtual css::uno::Any SAL_CALL getMergeCells( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0;
- virtual void SAL_CALL setReadingOrder( const css::uno::Any& ReadingOrder ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
- virtual css::uno::Any SAL_CALL getReadingOrder( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);;
-*/
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_AXIS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx
index c323e2b3f6f6..b07d98e81b80 100644
--- a/sc/source/ui/vba/vbastyles.cxx
+++ b/sc/source/ui/vba/vbastyles.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -180,3 +181,5 @@ ScVbaStyles::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbastyles.hxx b/sc/source/ui/vba/vbastyles.hxx
index 300596d6b3fe..821233f75ea0 100644
--- a/sc/source/ui/vba/vbastyles.hxx
+++ b/sc/source/ui/vba/vbastyles.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbatextboxshape.cxx b/sc/source/ui/vba/vbatextboxshape.cxx
index 0ef9e0f7393b..b5502fac9aa8 100644
--- a/sc/source/ui/vba/vbatextboxshape.cxx
+++ b/sc/source/ui/vba/vbatextboxshape.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@ ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) t
ScVbaPalette aPalette( pDoc->GetDocumentShell() );
return new ScVbaCharacters( this, mxContext, aPalette, xSimple, Start, Length, sal_True );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbatextboxshape.hxx b/sc/source/ui/vba/vbatextboxshape.hxx
index c08a576b7155..02298cd767eb 100644
--- a/sc/source/ui/vba/vbatextboxshape.hxx
+++ b/sc/source/ui/vba/vbatextboxshape.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ public:
virtual css::uno::Reference< ov::excel::XCharacters > SAL_CALL characters( const css::uno::Any& Start, const css::uno::Any& Length ) throw (css::uno::RuntimeException);
};
#endif //SC_VBA_TEXTBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbatextframe.cxx b/sc/source/ui/vba/vbatextframe.cxx
index b06777526c1f..dffbed8b511f 100644
--- a/sc/source/ui/vba/vbatextframe.cxx
+++ b/sc/source/ui/vba/vbatextframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaTextFrame",
"ooo.vba.excel.TextFrame" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbatextframe.hxx b/sc/source/ui/vba/vbatextframe.hxx
index b48cd8752ef9..e45af4e1c2be 100644
--- a/sc/source/ui/vba/vbatextframe.hxx
+++ b/sc/source/ui/vba/vbatextframe.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,5 @@ public:
};
#endif//SC_VBA_TEXTFRAME_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbatitle.hxx b/sc/source/ui/vba/vbatitle.hxx
index fb97f3f20f0c..1d89ea01e6d3 100644
--- a/sc/source/ui/vba/vbatitle.hxx
+++ b/sc/source/ui/vba/vbatitle.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -161,3 +162,5 @@ public:
}
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx
index e2a768549e11..2c52556b23a9 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,6 +26,7 @@
*
************************************************************************/
#include "vbavalidation.hxx"
+#include "vbaformatcondition.hxx"
#include <com/sun/star/sheet/XSheetCondition.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
@@ -70,7 +72,7 @@ lcl_getValidationProps( const uno::Reference< table::XCellRange >& xRange )
ScVbaValidation::getIgnoreBlank() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) );
- sal_Bool bBlank = sal_False;
+ sal_Bool bBlank = false;
xProps->getPropertyValue( IGNOREBLANK ) >>= bBlank;
return bBlank;
}
@@ -89,13 +91,13 @@ ScVbaValidation::getInCellDropdown() throw (uno::RuntimeException)
uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange );
sal_Int32 nShowList = 0;
xProps->getPropertyValue( SHOWLIST ) >>= nShowList;
- return ( nShowList ? sal_True : sal_False );
+ return ( nShowList ? sal_True : false );
}
void SAL_CALL
ScVbaValidation::setInCellDropdown( ::sal_Bool _incelldropdown ) throw (uno::RuntimeException)
{
- sal_Int32 nDropDown = sal_False;
+ sal_Int32 nDropDown = false;
if ( _incelldropdown )
nDropDown = 1;
uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps(m_xRange) );
@@ -107,7 +109,7 @@ ScVbaValidation::setInCellDropdown( ::sal_Bool _incelldropdown ) throw (uno::R
ScVbaValidation::getShowInput() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange );
- sal_Bool bShowInput = sal_False;
+ sal_Bool bShowInput = false;
xProps->getPropertyValue( SHOWINPUT ) >>= bShowInput;
return bShowInput;
}
@@ -124,7 +126,7 @@ ScVbaValidation:: setShowInput( ::sal_Bool _showinput ) throw (uno::RuntimeExcep
ScVbaValidation::getShowError() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps = lcl_getValidationProps( m_xRange );
- sal_Bool bShowError = sal_False;
+ sal_Bool bShowError = false;
xProps->getPropertyValue( SHOWERROR ) >>= bShowError;
return bShowError;
}
@@ -225,8 +227,10 @@ ScVbaValidation::Delete( ) throw (uno::RuntimeException)
lcl_setValidationProps( m_xRange, xProps );
}
+
+// Fix the defect that validatation cannot work when the input should be limited between a lower bound and an upper bound
void SAL_CALL
-ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& /*Operator*/, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException)
+ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& Operator, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) );
uno::Reference< sheet::XSheetCondition > xCond( xProps, uno::UNO_QUERY_THROW );
@@ -291,6 +295,13 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
xProps->setPropertyValue( ALERTSTYLE, uno::makeAny( eStyle ) );
+ // fix the defect that validatation cannot work when the input should be limited between a lower bound and an upper bound
+ if ( Operator.hasValue() )
+ {
+ css::sheet::ConditionOperator conOperator = ScVbaFormatCondition::retrieveAPIOperator( Operator );
+ xCond->setOperator( conOperator );
+ }
+
if ( sFormula1.getLength() )
xCond->setFormula1( sFormula1 );
if ( sFormula2.getLength() )
@@ -331,3 +342,5 @@ ScVbaValidation::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbavalidation.hxx b/sc/source/ui/vba/vbavalidation.hxx
index 563ee1d003b6..1ac0f3e35858 100644
--- a/sc/source/ui/vba/vbavalidation.hxx
+++ b/sc/source/ui/vba/vbavalidation.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index 5964fe98317c..761671727e9c 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@
#include <tabvwsh.hxx>
#include <docuno.hxx>
#include <sc.hrc>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <sfx2/viewfrm.hxx>
#include <vcl/wrkwin.hxx>
#include "unonames.hxx"
@@ -55,7 +56,7 @@ using namespace ::com::sun::star;
using namespace ::ooo::vba;
using namespace ::ooo::vba::excel::XlWindowState;
-typedef std::hash_map< rtl::OUString,
+typedef boost::unordered_map< rtl::OUString,
SCTAB, ::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > NameIndexHash;
@@ -269,19 +270,6 @@ ScVbaWindow::ScrollWorkbookTabs( const uno::Any& /*Sheets*/, const uno::Any& /*P
{
// #TODO #FIXME need some implementation to scroll through the tabs
// but where is this done?
-/*
- sal_Int32 nSheets = 0;
- sal_Int32 nPosition = 0;
- throw uno::RuntimeException( rtl::OUString::createFromAscii("No Implemented" ), uno::Reference< uno::XInterface >() );
- sal_Bool bSheets = ( Sheets >>= nSheets );
- sal_Bool bPosition = ( Position >>= nPosition );
- if ( bSheets || bPosition ) // at least one param specified
- if ( bSheets )
- ;// use sheets
- else if ( bPosition )
- ; //use position
-*/
-
}
uno::Reference< beans::XPropertySet >
getPropsFromModel( const uno::Reference< frame::XModel >& xModel )
@@ -695,14 +683,14 @@ double SAL_CALL
ScVbaWindow::getSplitVertical() throw (uno::RuntimeException)
{
double fSplitVertical = m_xViewSplitable->getSplitVertical();
- double fVertiPoints = PixelsToPoints( m_xDevice, fSplitVertical, sal_False );
+ double fVertiPoints = PixelsToPoints( m_xDevice, fSplitVertical, false );
return fVertiPoints;
}
void SAL_CALL
ScVbaWindow::setSplitVertical(double _splitvertical ) throw (uno::RuntimeException)
{
- double fVertiPixels = PointsToPixels( m_xDevice, _splitvertical, sal_False );
+ double fVertiPixels = PointsToPixels( m_xDevice, _splitvertical, false );
m_xViewSplitable->splitAtPosition( 0, static_cast<sal_Int32>( fVertiPixels ) );
}
@@ -856,3 +844,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaWindow",
"ooo.vba.excel.Window" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawindow.hxx b/sc/source/ui/vba/vbawindow.hxx
index d58d2a07cb4b..b21e5a42b9c1 100644
--- a/sc/source/ui/vba/vbawindow.hxx
+++ b/sc/source/ui/vba/vbawindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,5 @@ public:
};
#endif //SC_VBA_WINDOW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx
index 3ddc5f5b3b45..c3c716e29431 100644
--- a/sc/source/ui/vba/vbawindows.cxx
+++ b/sc/source/ui/vba/vbawindows.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +27,7 @@
************************************************************************/
#include "vbawindows.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
@@ -35,12 +36,11 @@
#include <tools/urlobj.hxx>
#include "vbawindow.hxx"
#include "vbaglobals.hxx"
-//#include "vbaworkbook.hxx"
using namespace ::com::sun::star;
using namespace ::ooo::vba;
-typedef std::hash_map< rtl::OUString,
+typedef boost::unordered_map< rtl::OUString,
sal_Int32, ::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > NameIndexHash;
@@ -78,7 +78,7 @@ public:
m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop
- (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), m_xContext), uno::UNO_QUERY_THROW );
+ (xSMgr->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), m_xContext), uno::UNO_QUERY_THROW );
uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration();
while( mxComponents->hasMoreElements() )
{
@@ -206,11 +206,6 @@ public:
};
-
-ScVbaWindows::ScVbaWindows( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaWindows_BASE( xParent, xContext, xIndexAccess )
-{
-}
-
ScVbaWindows::ScVbaWindows( const uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWindows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess > ( new WindowsAccessImpl( xContext ) ) )
{
}
@@ -258,3 +253,5 @@ ScVbaWindows::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawindows.hxx b/sc/source/ui/vba/vbawindows.hxx
index 3441b6ccbac4..0b3c358eaf77 100644
--- a/sc/source/ui/vba/vbawindows.hxx
+++ b/sc/source/ui/vba/vbawindows.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@ typedef CollTestImplHelper< ov::excel::XWindows > ScVbaWindows_BASE;
class ScVbaWindows : public ScVbaWindows_BASE
{
public:
- ScVbaWindows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess );
+ //]AE] ScVbaWindows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess );
ScVbaWindows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext );
virtual ~ScVbaWindows() {}
@@ -62,3 +63,4 @@ public:
#endif //SC_VBA_WINDOWS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 1e2acd6252b8..bf880e473af3 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <ooo/vba/excel/XlFileFormat.hpp>
+#include <ooo/vba/excel/XApplication.hpp>
#include "scextopt.hxx"
#include "vbaworksheet.hxx"
@@ -47,7 +49,7 @@
#include "vbapalette.hxx"
#include <osl/file.hxx>
#include <stdio.h>
-#include "vbanames.hxx" // Amelia Wang
+#include "vbanames.hxx"
#include "nameuno.hxx"
#include "docoptio.hxx"
#include "unonames.hxx"
@@ -125,7 +127,7 @@ ScVbaWorkbook::Colors( const ::uno::Any& Index ) throw (::script::BasicErrorExce
}
::sal_Int32 SAL_CALL
-ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::RuntimeException)
+ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
{
sal_Int32 aFileFormat = 0;
rtl::OUString aFilterName;
@@ -133,58 +135,76 @@ ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::Runti
// #FIXME - seems suspect should we not walk through the properties
// to find the FilterName
- if (aArgs[0].Name.equalsAscii( "FilterName")) {
+ if (aArgs[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterName"))) {
aArgs[0].Value >>= aFilterName;
} else {
aArgs[1].Value >>= aFilterName;
}
- if (aFilterName.equalsAscii("Text - txt - csv (StarCalc)")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Text - txt - csv (StarCalc)"))) {
aFileFormat = excel::XlFileFormat::xlCSV; //xlFileFormat.
}
- if (aFilterName.equalsAscii("DBF")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DBF"))) {
aFileFormat = excel::XlFileFormat::xlDBF4;
}
- if (aFilterName.equalsAscii("DIF")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DIF"))) {
aFileFormat = excel::XlFileFormat::xlDIF;
}
- if (aFilterName.equalsAscii("Lotus")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Lotus"))) {
aFileFormat = excel::XlFileFormat::xlWK3;
}
- if (aFilterName.equalsAscii("MS Excel 4.0")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MS Excel 4.0"))) {
aFileFormat = excel::XlFileFormat::xlExcel4Workbook;
}
- if (aFilterName.equalsAscii("MS Excel 5.0/95")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MS Excel 5.0/95"))) {
aFileFormat = excel::XlFileFormat::xlExcel5;
}
- if (aFilterName.equalsAscii("MS Excel 97")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MS Excel 97"))) {
aFileFormat = excel::XlFileFormat::xlExcel9795;
}
- if (aFilterName.equalsAscii("HTML (StarCalc)")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HTML (StarCalc)"))) {
aFileFormat = excel::XlFileFormat::xlHtml;
}
- if (aFilterName.equalsAscii("calc_StarOffice_XML_Calc_Template")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("calc_StarOffice_XML_Calc_Template"))) {
aFileFormat = excel::XlFileFormat::xlTemplate;
}
- if (aFilterName.equalsAscii("StarOffice XML (Calc)")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarOffice XML (Calc)"))) {
aFileFormat = excel::XlFileFormat::xlWorkbookNormal;
}
- if (aFilterName.equalsAscii("calc8")) {
+ if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("calc8"))) {
aFileFormat = excel::XlFileFormat::xlWorkbookNormal;
}
return aFileFormat;
}
+// Convert Excel fileformat to OO file filter
+::rtl::OUString ScVbaWorkbook::convertFileFormat(sal_Int32 aFileFormat)
+{
+ rtl::OUString aFilterName;
+
+ switch(aFileFormat)
+ {
+ case excel::XlFileFormat::xlCSV:
+ aFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text - txt - csv (StarCalc)" ) );
+ break;
+ case excel::XlFileFormat::xlExcel9795:
+ aFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MS Excel 97" ) );
+ break;
+ }
+
+ return aFilterName;
+}
+
void
ScVbaWorkbook::init()
{
@@ -219,7 +239,7 @@ ScVbaWorkbook::getActiveSheet() throw (uno::RuntimeException)
uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ), uno::UNO_SET_THROW );
uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xSheetProps( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
- // #162503# return the original document module wrapper object, instead of a new instance
+ // return the original document module wrapper object, instead of a new instance
::rtl::OUString aCodeName;
xSheetProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_CODENAME ) ) ) >>= aCodeName;
ScDocShell* pShell = excel::getDocShell( xModel );
@@ -264,6 +284,12 @@ ScVbaWorkbook::Activate() throw (uno::RuntimeException)
VbaDocumentBase::Activate();
}
+void
+ScVbaWorkbook::Protect( const uno::Any &aPassword ) throw (uno::RuntimeException)
+{
+ VbaDocumentBase::Protect( aPassword );
+}
+
::sal_Bool
ScVbaWorkbook::getProtectStructure() throw (uno::RuntimeException)
{
@@ -299,8 +325,52 @@ ScVbaWorkbook::SaveCopyAs( const rtl::OUString& sFileName ) throw ( uno::Runtime
xStor->storeToURL( aURL, storeProps );
}
+// Add Workbook.SaveAs.
+void
+ScVbaWorkbook::SaveAs( const rtl::OUString& FileName, const uno::Any& FileFormat, const uno::Any& /*CreateBackup*/ ) throw ( uno::RuntimeException)
+{
+ rtl::OUString aURL;
+ osl::FileBase::getFileURLFromSystemPath( FileName, aURL );
+ //if the input parameter "FileName" takes the form as "MyFile", we need to get the current directory and combine the current directory and the file name
+ INetURLObject aFileNameURL( aURL );
+ aURL = aFileNameURL.GetMainURL( INetURLObject::NO_DECODE );
+ if ( aURL.getLength() == 0 )
+ {
+ uno::Reference< excel::XApplication > xApplication ( Application(),uno::UNO_QUERY_THROW );
+ rtl::OUString aPathStr = xApplication->getDefaultFilePath();
+ rtl::OUString aPathURLStr;
+ osl::FileBase::getFileURLFromSystemPath( aPathStr, aPathURLStr );
+ INetURLObject aPathURL( aPathURLStr );
+ aPathURL.Append( FileName );
+ aURL = aPathURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+
+ uno::Reference< frame::XStorable > xStor( getModel(), uno::UNO_QUERY_THROW );
+
+ sal_Int32 aFileFormat = excel::XlFileFormat::xlExcel9795;
+ FileFormat >>= aFileFormat;
+
+ if ( FileName.indexOf('.') == -1 )
+ {
+ if ( aFileFormat == excel::XlFileFormat::xlExcel9795 )
+ {
+ aURL = aURL + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".xls" ) );
+ }
+ else if ( aFileFormat == excel::XlFileFormat::xlCSV )
+ {
+ aURL = aURL + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".csv" ) );
+ }
+ }
+
+ uno::Sequence< beans::PropertyValue > storeProps(1);
+ storeProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
+ storeProps[0].Value <<= convertFileFormat(aFileFormat);
+
+ xStor->storeAsURL( aURL, storeProps );
+}
+
css::uno::Any SAL_CALL
-ScVbaWorkbook::Styles( const uno::Any& Item ) throw (uno::RuntimeException)
+ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException)
{
// quick look and Styles object doesn't seem to have a valid parent
// or a least the object browser just shows an object that has no
@@ -311,7 +381,6 @@ ScVbaWorkbook::Styles( const uno::Any& Item ) throw (uno::RuntimeException)
return uno::makeAny( dStyles );
}
-// Amelia Wang
uno::Any SAL_CALL
ScVbaWorkbook::Names( const uno::Any& aIndex ) throw (uno::RuntimeException)
{
@@ -359,3 +428,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaWorkbook",
"ooo.vba.excel.Workbook" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworkbook.hxx b/sc/source/ui/vba/vbaworkbook.hxx
index 4aff58078403..3f52e2683f3f 100644
--- a/sc/source/ui/vba/vbaworkbook.hxx
+++ b/sc/source/ui/vba/vbaworkbook.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,6 +42,8 @@ class ScVbaWorkbook : public ScVbaWorkbook_BASE
static css::uno::Sequence< sal_Int32 > ColorData;
void initColorData( const css::uno::Sequence< sal_Int32 >& sColors );
void init();
+
+ ::rtl::OUString convertFileFormat(sal_Int32 aFileFormat);
protected:
ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext);
@@ -61,20 +64,27 @@ public:
virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Protect( const css::uno::Any & aPassword ) throw (css::uno::RuntimeException);
// Amelia Wang
virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Styles( const css::uno::Any& Item ) throw (css::uno::RuntimeException);
virtual void SAL_CALL ResetColors( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Colors( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL FileFormat( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFileFormat( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL SaveCopyAs( const rtl::OUString& Filename ) throw ( css::uno::RuntimeException);
+ virtual void SAL_CALL SaveAs( const rtl::OUString& FileName, const css::uno::Any& FileFormat, const css::uno::Any& CreateBackup ) throw (css::uno::RuntimeException);
+
// code name
virtual ::rtl::OUString SAL_CALL getCodeName() throw ( css::uno::RuntimeException);
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+
+ virtual css::uno::Reference< css::frame::XModel > getDocModel() { return mxModel; }
};
#endif /* SC_VBA_WORKBOOK_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index a9f1970be34e..86b24c3dec92 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@
#include "vbaworkbooks.hxx"
#include <vbahelper/vbahelper.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
#include <osl/file.hxx>
using namespace ::ooo::vba;
@@ -293,7 +294,7 @@ ScVbaWorkbooks::isSpreadSheetFile( const rtl::OUString& sType )
rtl::OUString
ScVbaWorkbooks::getFileFilterType( const rtl::OUString& rFileName )
{
- uno::Reference< document::XTypeDetection > xTypeDetect( mxContext->getServiceManager()->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection"), mxContext), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XTypeDetection > xTypeDetect( mxContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")), mxContext), uno::UNO_QUERY_THROW );
uno::Sequence< beans::PropertyValue > aMediaDesc(1);
aMediaDesc[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ("URL" ) );
aMediaDesc[ 0 ].Value <<= rFileName;
@@ -316,12 +317,12 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi
osl::FileBase::getFileURLFromSystemPath( rFileName, aURL );
uno::Sequence< beans::PropertyValue > sProps(0);
- sal_Int32 nIndex = 0;
rtl::OUString sType = getFileFilterType( aURL );
// A text file means it needs to be processed as a csv file
if ( isTextFile( sType ) )
{
+ sal_Int32 nIndex = 0;
// Values for format
// 1 Tabs
// 2 Commas
@@ -407,3 +408,5 @@ ScVbaWorkbooks::getServiceNames()
}
return sNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworkbooks.hxx b/sc/source/ui/vba/vbaworkbooks.hxx
index 3392829f1a05..51273b180cf1 100644
--- a/sc/source/ui/vba/vbaworkbooks.hxx
+++ b/sc/source/ui/vba/vbaworkbooks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,3 +67,5 @@ public:
};
#endif /* SC_VBA_WORKBOOKS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index 6491024071b2..7b889b4603c7 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,6 +66,7 @@
#include <ooo/vba/excel/XlSheetVisibility.hpp>
#include <ooo/vba/excel/XWorkbook.hpp>
#include <ooo/vba/XControlProvider.hpp>
+#include <ooo/vba/excel/XlSheetVisibility.hpp>
#include <comphelper/processfactory.hxx>
#include <vbahelper/vbashapes.hxx>
@@ -82,7 +84,7 @@
#include "cellsuno.hxx"
#include "drwlayer.hxx"
-
+#include "tabprotection.hxx"
#include "scextopt.hxx"
#include "vbaoutline.hxx"
#include "vbarange.hxx"
@@ -96,7 +98,7 @@
#include "vbaworksheets.hxx"
#include "vbahyperlinks.hxx"
#include "vbasheetobjects.hxx"
-#include "vbanames.hxx"
+#include "viewuno.hxx"
#define STANDARDWIDTH 2267
#define STANDARDHEIGHT 427
@@ -188,7 +190,7 @@ ScVbaWorksheet::ScVbaWorksheet( const uno::Reference< XHelperInterface >& xParen
ScVbaWorksheet::ScVbaWorksheet(const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
const uno::Reference< sheet::XSpreadsheet >& xSheet,
- const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : WorksheetImpl_BASE( xParent, xContext ), mxSheet( xSheet ), mxModel(xModel), mbVeryHidden( false )
+ const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : WorksheetImpl_BASE( xParent, xContext ), mxSheet( xSheet ), mxModel(xModel)
{
}
@@ -224,18 +226,26 @@ ScVbaWorksheet::setName(const ::rtl::OUString &rName ) throw (uno::RuntimeExcept
xNamed->setName( rName );
}
-sal_Int32
+::sal_Int32
ScVbaWorksheet::getVisible() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
- bool bVisible = false;
- xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ) ) >>= bVisible;
- using namespace ::ooo::vba::excel::XlSheetVisibility;
- return bVisible ? xlSheetVisible : (mbVeryHidden ? xlSheetVeryHidden : xlSheetHidden);
+ uno::Any aValue = xProps->getPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ) );
+ sal_Bool bRet = false;
+ aValue >>= bRet;
+ if ( bRet )
+ {
+ return excel::XlSheetVisibility::xlSheetVisible;
+ }
+ else
+ {
+ return excel::XlSheetVisibility::xlSheetHidden;
+ }
}
void
-ScVbaWorksheet::setVisible( sal_Int32 nVisible ) throw (uno::RuntimeException)
+ScVbaWorksheet::setVisible( ::sal_Int32 _Visible ) throw (uno::RuntimeException)
{
using namespace ::ooo::vba::excel::XlSheetVisibility;
bool bVisible = true;
@@ -257,7 +267,21 @@ ScVbaWorksheet::setVisible( sal_Int32 nVisible ) throw (uno::RuntimeException)
throw uno::RuntimeException();
}
uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW );
- xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ), uno::Any( bVisible ) );
+
+ sal_Bool bVisible = true;
+ switch( _Visible )
+ {
+ case excel::XlSheetVisibility::xlSheetHidden:
+ case excel::XlSheetVisibility::xlSheetVeryHidden:
+ bVisible = false;
+ break;
+ case excel::XlSheetVisibility::xlSheetVisible:
+ bVisible = true;
+ break;
+ }
+ uno::Any aValue( bVisible );
+ xProps->setPropertyValue
+ (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ), aValue);
}
sal_Int16
@@ -276,8 +300,8 @@ ScVbaWorksheet::getEnableSelection() throw (uno::RuntimeException)
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
- sal_Bool bLockedCells = sal_False;
- sal_Bool bUnlockedCells = sal_False;
+ sal_Bool bLockedCells = false;
+ sal_Bool bUnlockedCells = false;
if( pProtect )
{
bLockedCells = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
@@ -315,8 +339,8 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeEx
ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
// default is xlNoSelection
- sal_Bool bLockedCells = sal_False;
- sal_Bool bUnlockedCells = sal_False;
+ sal_Bool bLockedCells = false;
+ sal_Bool bUnlockedCells = false;
if( nSelection == excel::XlEnableSelection::xlNoRestrictions )
{
bLockedCells = sal_True;
@@ -359,7 +383,7 @@ uno::Reference< beans::XPropertySet > ScVbaWorksheet::getFirstDBRangeProperties(
sal_Bool SAL_CALL ScVbaWorksheet::getAutoFilterMode() throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xDBRangeProps = getFirstDBRangeProperties();
- sal_Bool bAutoFilterMode = sal_False;
+ sal_Bool bAutoFilterMode = false;
return
xDBRangeProps.is() &&
(xDBRangeProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoFilter" ) ) ) >>= bAutoFilterMode) &&
@@ -433,7 +457,7 @@ ScVbaWorksheet::getStandardHeight() throw (uno::RuntimeException)
sal_Bool
ScVbaWorksheet::getProtectionMode() throw (uno::RuntimeException)
{
- return sal_False;
+ return false;
}
sal_Bool
@@ -446,13 +470,25 @@ ScVbaWorksheet::getProtectContents()throw (uno::RuntimeException)
sal_Bool
ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException)
{
- return sal_False;
+ SCTAB nTab = 0;
+ rtl::OUString aSheetName = getName();
+ uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW );
+ bool bSheetExists = ScVbaWorksheets::nameExists (xSpreadDoc, aSheetName, nTab);
+ if ( bSheetExists )
+ {
+ uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
+ ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
+ ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ if ( pProtect )
+ return pProtect->isOptionEnabled( ScTableProtection::OBJECTS );
+ }
+ return false;
}
sal_Bool
ScVbaWorksheet::getProtectScenarios() throw (uno::RuntimeException)
{
- return sal_False;
+ return false;
}
void
@@ -463,10 +499,30 @@ ScVbaWorksheet::Activate() throw (uno::RuntimeException)
xSpreadsheet->setActiveSheet(getSheet());
}
+// support expand (but not replace) the active sheet
void
-ScVbaWorksheet::Select() throw (uno::RuntimeException)
+ScVbaWorksheet::Select(const css::uno::Any& aReplace) throw (uno::RuntimeException)
{
- Activate();
+ sal_Bool bReplace = true;
+ if (aReplace.hasValue() && aReplace.getValueTypeClass() == uno::TypeClass_BOOLEAN)
+ {
+ aReplace >>= bReplace;
+ }
+
+ uno::Reference< sheet::XSpreadsheetView > xSpreadsheet(
+ getModel()->getCurrentController(), uno::UNO_QUERY_THROW );
+ ScTabViewObj* pTabView = static_cast< ScTabViewObj* >( xSpreadsheet.get() );
+
+ if (bReplace)
+ {
+ pTabView->selectSheet(getSheet(), false);
+ }
+ else
+ {
+ uno::Reference< sheet::XSpreadsheet > xOldActiveSheet = pTabView->getActiveSheet();
+ pTabView->selectSheet(getSheet(), true);
+ pTabView->selectSheet(xOldActiveSheet, true);
+ }
}
void
@@ -528,18 +584,42 @@ ScVbaWorksheet::Copy( const uno::Any& Before, const uno::Any& After ) throw (uno
return;
}
- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY );
+ ScVbaWorksheet* pDestSheet = static_cast< ScVbaWorksheet* >(xSheet.get());
+ uno::Reference <sheet::XSpreadsheetDocument> xDestDoc( pDestSheet->getModel(), uno::UNO_QUERY );
+ uno::Reference <sheet::XSpreadsheetDocument> xSrcDoc( getModel(), uno::UNO_QUERY );
+
SCTAB nDest = 0;
+ SCTAB nSrc = 0;
rtl::OUString aSheetName = xSheet->getName();
- if ( ScVbaWorksheets::nameExists (xSpreadDoc, aSheetName, nDest ) )
+ bool bSameDoc = ( pDestSheet->getModel() == getModel() );
+ bool bDestSheetExists = ScVbaWorksheets::nameExists (xDestDoc, aSheetName, nDest );
+ bool bSheetExists = ScVbaWorksheets::nameExists (xSrcDoc, aCurrSheetName, nSrc );
+
+ // set sheet name to be newSheet name
+ aSheetName = aCurrSheetName;
+ if ( bSheetExists && bDestSheetExists )
{
+ SCTAB nDummy=0;
sal_Bool bAfter = After.hasValue();
if(bAfter)
nDest++;
- uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
- getNewSpreadsheetName(aSheetName,aCurrSheetName,xSpreadDoc);
- xSheets->copyByName(aCurrSheetName,aSheetName,nDest);
+ uno::Reference<sheet::XSpreadsheets> xSheets = xDestDoc->getSheets();
+ if ( bSameDoc || ScVbaWorksheets::nameExists( xDestDoc, aCurrSheetName, nDummy ) )
+ getNewSpreadsheetName(aSheetName,aCurrSheetName,xDestDoc);
+ if ( bSameDoc )
+ xSheets->copyByName(aCurrSheetName,aSheetName,nDest);
+ else
+ {
+ ScDocShell* pDestDocShell = excel::getDocShell( pDestSheet->getModel() );
+ ScDocShell* pSrcDocShell = excel::getDocShell( getModel() );
+ if ( pDestDocShell && pSrcDocShell )
+ pDestDocShell->TransferTab( *pSrcDocShell, static_cast<SCTAB>(nSrc), static_cast<SCTAB>(nDest), true, true );
+ }
}
+ // active the new sheet
+ uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
+ uno::Reference< excel::XWorksheet > xNewSheet( xApplication->Worksheets( uno::makeAny( aSheetName ) ), uno::UNO_QUERY_THROW );
+ xNewSheet->Activate();
}
@@ -591,13 +671,25 @@ ScVbaWorksheet::getSheetAtOffset(SCTAB offset) throw (uno::RuntimeException)
uno::Reference< excel::XWorksheet >
ScVbaWorksheet::getNext() throw (uno::RuntimeException)
{
- return getSheetAtOffset(static_cast<SCTAB>(1));
+ // catch the exception for index out of bound
+ try{
+ return getSheetAtOffset(static_cast<SCTAB>(1));
+ }catch( lang::IndexOutOfBoundsException& /*e*/ )
+ {
+ return NULL;
+ }
}
uno::Reference< excel::XWorksheet >
ScVbaWorksheet::getPrevious() throw (uno::RuntimeException)
{
- return getSheetAtOffset(-1);
+ // catch the exception for index out of bound
+ try{
+ return getSheetAtOffset(-1);
+ }catch( lang::IndexOutOfBoundsException& /*e*/ )
+ {
+ return NULL;
+ }
}
@@ -684,7 +776,7 @@ ScVbaWorksheet::ChartObjects( const uno::Any& Index ) throw (uno::RuntimeExcepti
uno::Reference< table::XTableChartsSupplier > xChartSupplier( getSheet(), uno::UNO_QUERY_THROW );
uno::Reference< table::XTableCharts > xTableCharts = xChartSupplier->getCharts();
- uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxSheet, uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getSheet(), uno::UNO_QUERY_THROW );
mxCharts = new ScVbaChartObjects( this, mxContext, xTableCharts, xDrawPageSupplier );
}
if ( Index.hasValue() )
@@ -845,10 +937,10 @@ ScVbaWorksheet::ShowDataForm( ) throw (uno::RuntimeException)
ScTabViewShell* pTabViewShell = excel::getBestViewShell( xModel );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg( pTabViewShell->GetDialogParent(),RID_SCDLG_DATAFORM, pTabViewShell);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
pDlg->Execute();
#else
@@ -901,7 +993,7 @@ ScVbaWorksheet::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::U
::sal_Bool SAL_CALL
ScVbaWorksheet::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException)
{
- return sal_False;
+ return false;
}
uno::Reference< container::XNameAccess >
@@ -917,8 +1009,7 @@ ScVbaWorksheet::getFormControls()
// get the www-standard container ( maybe we should access the
// 'www-standard' by name rather than index, this seems an
// implementation detail
- if( xIndexAccess->hasElements() )
- xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY );
+ xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
}
catch( uno::Exception& )
@@ -933,7 +1024,7 @@ ScVbaWorksheet::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeE
uno::Reference< container::XNameAccess > xFormControls( getFormControls() );
if ( xFormControls.is() )
return xFormControls->hasByName( aName );
- return sal_False;
+ return false;
}
uno::Any
@@ -1011,7 +1102,7 @@ ScVbaWorksheet::getCodeName() throw (css::uno::RuntimeException)
sal_Int16
ScVbaWorksheet::getSheetID() throw (uno::RuntimeException)
{
- uno::Reference< sheet::XCellRangeAddressable > xAddressable( mxSheet, uno::UNO_QUERY_THROW );
+ uno::Reference< sheet::XCellRangeAddressable > xAddressable( getSheet(), uno::UNO_QUERY_THROW ); // if ActiveSheet, mxSheet is null.
return xAddressable->getRangeAddress().Sheet;
}
@@ -1021,9 +1112,9 @@ ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::A
sal_Int32 nTo = 0;
sal_Int32 nFrom = 0;
sal_Int16 nCopies = 1;
- sal_Bool bCollate = sal_False;
- sal_Bool bSelection = sal_False;
- sal_Bool bIgnorePrintAreas = sal_False;
+ sal_Bool bCollate = false;
+ sal_Bool bSelection = false;
+ sal_Bool bIgnorePrintAreas = false;
From >>= nFrom;
To >>= nTo;
Copies >>= nCopies;
@@ -1047,3 +1138,5 @@ extern sdecl::ServiceDecl const serviceDecl(
"ScVbaWorksheet",
"ooo.vba.excel.Worksheet" );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx
index ff5850b7c445..df490655d9ba 100644
--- a/sc/source/ui/vba/vbaworksheet.hxx
+++ b/sc/source/ui/vba/vbaworksheet.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,6 +43,7 @@
#include <ooo/vba/excel/XPageSetup.hpp>
#include <ooo/vba/excel/XHPageBreaks.hpp>
#include <ooo/vba/excel/XVPageBreaks.hpp>
+#include <com/sun/star/container/XNamed.hpp>
#include <vbahelper/vbahelperinterface.hxx>
#include "address.hxx"
@@ -92,8 +94,8 @@ public:
// Attributes
virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setVisible( sal_Int32 nVisible ) throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Int32 _Visible ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getStandardWidth() throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getStandardHeight() throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException);
@@ -116,7 +118,7 @@ public:
// Methods
virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
- virtual void SAL_CALL Select() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Select(const css::uno::Any& aReplace) throw (css::uno::RuntimeException); // add the input parameter to support expand selection
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Move( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException) ;
virtual void SAL_CALL Copy( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException);
@@ -173,3 +175,4 @@ public:
#endif /* SC_VBA_WORKSHEET_HXX */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index bd21cb396c66..680b5ae6b600 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -266,7 +267,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After,
aStringSheet = xBeforeAfterSheet->getName();
else
After >>= aStringSheet;
- bBefore = sal_False;
+ bBefore = false;
}
if (!aStringSheet.getLength())
{
@@ -338,8 +339,8 @@ ScVbaWorksheets::PrintOut( const uno::Any& From, const uno::Any& To, const uno::
sal_Int32 nTo = 0;
sal_Int32 nFrom = 0;
sal_Int16 nCopies = 1;
- sal_Bool bCollate = sal_False;
- sal_Bool bSelection = sal_False;
+ sal_Bool bCollate = false;
+ sal_Bool bSelection = false;
From >>= nFrom;
To >>= nTo;
Copies >>= nCopies;
@@ -361,9 +362,9 @@ ScVbaWorksheets::getVisible() throw (uno::RuntimeException)
while ( xEnum->hasMoreElements() )
{
uno::Reference< excel::XWorksheet > xSheet( xEnum->nextElement(), uno::UNO_QUERY_THROW );
- if ( xSheet->getVisible() == sal_False )
+ if ( xSheet->getVisible() == false )
{
- bVisible = sal_False;
+ bVisible = false;
break;
}
}
@@ -373,7 +374,7 @@ ScVbaWorksheets::getVisible() throw (uno::RuntimeException)
void SAL_CALL
ScVbaWorksheets::setVisible( const uno::Any& _visible ) throw (uno::RuntimeException)
{
- sal_Bool bState = sal_False;
+ sal_Bool bState = false;
if ( _visible >>= bState )
{
uno::Reference< container::XEnumeration > xEnum( createEnumeration(), uno::UNO_QUERY_THROW );
@@ -479,7 +480,7 @@ ScVbaWorksheets::getServiceNames()
return sNames;
}
-/*static*/ bool ScVbaWorksheets::nameExists( uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, const ::rtl::OUString & name, SCTAB& nTab ) throw ( lang::IllegalArgumentException )
+bool ScVbaWorksheets::nameExists( uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, const ::rtl::OUString & name, SCTAB& nTab ) throw ( lang::IllegalArgumentException )
{
if (!xSpreadDoc.is())
throw lang::IllegalArgumentException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nameExists() xSpreadDoc is null" ) ), uno::Reference< uno::XInterface >(), 1 );
@@ -499,3 +500,5 @@ ScVbaWorksheets::getServiceNames()
}
return false;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbaworksheets.hxx b/sc/source/ui/vba/vbaworksheets.hxx
index 2ced68bc9e27..9854c0447c1d 100644
--- a/sc/source/ui/vba/vbaworksheets.hxx
+++ b/sc/source/ui/vba/vbaworksheets.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,3 +82,5 @@ public:
};
#endif /* SC_VBA_WORKSHEETS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx
index 60daa7303f2e..685377da4324 100644
--- a/sc/source/ui/vba/vbawsfunction.cxx
+++ b/sc/source/ui/vba/vbawsfunction.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,6 +61,18 @@ void lclConvertDoubleToBoolean( uno::Any& rAny )
}
}
+void lclConvertBooleanToDouble( uno::Any& rAny )
+{
+ sal_Bool bValue( false );
+ if ( rAny >>= bValue )
+ {
+ if ( bValue )
+ rAny <<= double( 1.0 );
+ else
+ rAny <<= double( 0.0 );
+ }
+}
+
} // namespace
ScVbaWSFunction::ScVbaWSFunction( const uno::Reference< XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) :
@@ -84,9 +97,57 @@ ScVbaWSFunction::invoke(const rtl::OUString& FunctionName, const uno::Sequence<
uno::Any* pArrayEnd = pArray + aParamTemp.getLength();
for( ; pArray < pArrayEnd; ++pArray )
{
- uno::Reference< excel::XRange > myRange( *pArray, uno::UNO_QUERY );
- if( myRange.is() )
- *pArray = myRange->getCellRange();
+ switch( pArray->getValueType().getTypeClass() )
+ {
+ case uno::TypeClass_BOOLEAN:
+ lclConvertBooleanToDouble( *pArray );
+ break;
+ case uno::TypeClass_INTERFACE:
+ {
+ uno::Reference< excel::XRange > myRange( *pArray, uno::UNO_QUERY );
+ if( myRange.is() )
+ *pArray = myRange->getCellRange();
+ }
+ break;
+ case uno::TypeClass_SEQUENCE:
+ {
+ // the sheet.FunctionAccess service doesn't deal with Sequences, only Sequences of Sequence
+ uno::Type aType = pArray->getValueType();
+ if ( aType.equals( getCppuType( (uno::Sequence<sal_Int16>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< sal_Int16 > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<sal_Int32>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< sal_Int32 > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<double>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< double > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<rtl::OUString>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence< rtl::OUString > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ else if ( aType.equals( getCppuType( (uno::Sequence<uno::Any>*)0 ) ) )
+ {
+ uno::Sequence< uno::Sequence<uno::Any > > aTmp(1);
+ (*pArray) >>= aTmp[ 0 ];
+ (*pArray) <<= aTmp;
+ }
+ }
+ break;
+ default:
+ break;
+ }
OSL_TRACE("Param[%d] is %s", (int)(pArray - aParamTemp.getConstArray()), rtl::OUStringToOString( comphelper::anyToString( *pArray ), RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
@@ -207,7 +268,7 @@ ScVbaWSFunction::getValue(const rtl::OUString& /*PropertyName*/) throw(beans::Un
sal_Bool SAL_CALL
ScVbaWSFunction::hasMethod(const rtl::OUString& Name) throw(uno::RuntimeException)
{
- sal_Bool bIsFound = sal_False;
+ sal_Bool bIsFound = false;
try
{
// the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized.
@@ -227,7 +288,7 @@ ScVbaWSFunction::hasMethod(const rtl::OUString& Name) throw(uno::RuntimeExcepti
sal_Bool SAL_CALL
ScVbaWSFunction::hasProperty(const rtl::OUString& /*Name*/) throw(uno::RuntimeException)
{
- return sal_False;
+ return false;
}
::rtl::OUString SAL_CALL
@@ -257,3 +318,5 @@ ScVbaWSFunction::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbawsfunction.hxx b/sc/source/ui/vba/vbawsfunction.hxx
index ffd33849afe5..2e1c768b9588 100644
--- a/sc/source/ui/vba/vbawsfunction.hxx
+++ b/sc/source/ui/vba/vbawsfunction.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@ public:
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 12851346be2e..b35be06c4e5a 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,7 +105,7 @@ void ScAuditingShell::Execute( SfxRequest& rReq )
break;
case SID_CANCEL: // Escape
case SID_FILL_NONE:
- pViewData->GetViewShell()->SetAuditShell( sal_False );
+ pViewData->GetViewShell()->SetAuditShell( false );
break;
case SID_FILL_SELECT:
@@ -122,7 +123,7 @@ void ScAuditingShell::Execute( SfxRequest& rReq )
SCsCOL nCol = static_cast<SCsCOL>(((const SfxInt16Item*) pXItem)->GetValue());
SCsROW nRow = static_cast<SCsROW>(((const SfxInt32Item*) pYItem)->GetValue());
ScViewFunc* pView = pViewData->GetView();
- pView->MoveCursorAbs( nCol, nRow, SC_FOLLOW_LINE, sal_False, sal_False );
+ pView->MoveCursorAbs( nCol, nRow, SC_FOLLOW_LINE, false, false );
switch ( nFunction )
{
case SID_FILL_ADD_PRED:
@@ -153,3 +154,4 @@ void ScAuditingShell::GetState( SfxItemSet& rSet )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellmergeoption.cxx b/sc/source/ui/view/cellmergeoption.cxx
new file mode 100644
index 000000000000..52dfc5d4aea1
--- /dev/null
+++ b/sc/source/ui/view/cellmergeoption.cxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Kohei Yoshida <kyoshida@novell.com> ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+#include "cellmergeoption.hxx"
+#include "address.hxx"
+
+ScCellMergeOption::ScCellMergeOption() :
+ mnStartCol(0),
+ mnStartRow(0),
+ mnEndCol(0),
+ mnEndRow(0),
+ mbCenter(false)
+{
+}
+
+ScCellMergeOption::ScCellMergeOption(const ScRange& rRange) :
+ mnStartCol(rRange.aStart.Col()),
+ mnStartRow(rRange.aStart.Row()),
+ mnEndCol(rRange.aEnd.Col()),
+ mnEndRow(rRange.aEnd.Row()),
+ mbCenter(false)
+{
+ SCTAB nTab1 = rRange.aStart.Tab();
+ SCTAB nTab2 = rRange.aEnd.Tab();
+ for (SCTAB i = nTab1; i <= nTab2; ++i)
+ maTabs.insert(i);
+}
+
+ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) :
+ mnStartCol(nStartCol),
+ mnStartRow(nStartRow),
+ mnEndCol(nEndCol),
+ mnEndRow(nEndRow),
+ mbCenter(bCenter)
+{
+}
+
+ScCellMergeOption::ScCellMergeOption(const ScCellMergeOption& r) :
+ maTabs(r.maTabs),
+ mnStartCol(r.mnStartCol),
+ mnStartRow(r.mnStartRow),
+ mnEndCol(r.mnEndCol),
+ mnEndRow(r.mnEndRow),
+ mbCenter(r.mbCenter)
+{
+}
+
+ScRange ScCellMergeOption::getSingleRange(SCTAB nTab) const
+{
+ return ScRange(mnStartCol, mnStartRow, nTab, mnEndCol, mnEndRow, nTab);
+}
+
+ScRange ScCellMergeOption::getFirstSingleRange() const
+{
+ SCTAB nTab = 0;
+ if (!maTabs.empty())
+ nTab = *maTabs.begin();
+
+ return getSingleRange(nTab);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 20f65bd03e93..209fff0eae38 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,7 +86,7 @@ SFX_IMPL_INTERFACE(ScCellShell, ScFormatShell , ScResId(SCSTR_CELLSHELL) )
ScCellShell::ScCellShell(ScViewData* pData) :
ScFormatShell(pData),
pImpl( new CellShell_Impl() ),
- bPastePossible(sal_False)
+ bPastePossible(false)
{
SetHelpId(HID_SCSHELL_CELLSH);
SetName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Cell")));
@@ -95,9 +96,9 @@ ScCellShell::~ScCellShell()
{
if ( pImpl->m_pClipEvtLstnr )
{
- pImpl->m_pClipEvtLstnr->AddRemoveListener( GetViewData()->GetActiveWin(), sal_False );
+ pImpl->m_pClipEvtLstnr->AddRemoveListener( GetViewData()->GetActiveWin(), false );
- // #103849# The listener may just now be waiting for the SolarMutex and call the link
+ // The listener may just now be waiting for the SolarMutex and call the link
// afterwards, in spite of RemoveListener. So the link has to be reset, too.
pImpl->m_pClipEvtLstnr->ClearCallbackLink();
@@ -133,7 +134,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
- sal_Bool bDisable = sal_False;
+ sal_Bool bDisable = false;
sal_Bool bNeedEdit = sal_True; // muss Selektion editierbar sein?
switch ( nWhich )
{
@@ -206,7 +207,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
//! muss man leben.. wird in Copy-Routine abgefangen, sonst
//! muesste hier nochmal Aufwand getrieben werden
if ( !(!bEditable && bOnlyNotBecauseOfMatrix) )
- bNeedEdit = sal_False; // erlaubt, wenn geschuetzt/ReadOnly
+ bNeedEdit = false; // erlaubt, wenn geschuetzt/ReadOnly
break;
case SID_AUTOFORMAT: // Autoformat, mind. 3x3 selektiert
@@ -218,7 +219,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
{
if ( !bEditable && bOnlyNotBecauseOfMatrix )
{
- bNeedEdit = sal_False;
+ bNeedEdit = false;
}
if ( pDocShell && pDocShell->IsDocShared() )
{
@@ -233,7 +234,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
case SID_ENABLE_HYPHENATION :
// nur wegen Matrix nicht editierbar? Attribute trotzdem ok
if ( !bEditable && bOnlyNotBecauseOfMatrix )
- bNeedEdit = sal_False;
+ bNeedEdit = false;
break;
case FID_VALIDATION:
@@ -260,7 +261,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
else if (nWhich == SID_ENABLE_HYPHENATION)
{
// toggle slots need a bool item
- rSet.Put( SfxBoolItem( nWhich, sal_False ) );
+ rSet.Put( SfxBoolItem( nWhich, false ) );
}
nWhich = aIter.NextWhich();
}
@@ -281,7 +282,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet )
sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
- sal_Bool bDisable = sal_False;
+ sal_Bool bDisable = false;
sal_Bool bNeedEdit = sal_True; // muss Cursorposition editierbar sein?
switch ( nWhich )
{
@@ -310,7 +311,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet )
{
bDisable = sal_True;
}
- bNeedEdit=sal_False;
+ bNeedEdit=false;
}
}
@@ -339,7 +340,7 @@ sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDataHe
{
if ( rDataHelper.HasFormat( nFormatId ) )
{
- // #90675# translated format name strings are no longer inserted here,
+ // translated format name strings are no longer inserted here,
// handled by "paste special" dialog / toolbox controller instead.
// Only the object type name has to be set here:
String aStrVal;
@@ -365,7 +366,7 @@ sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDataHe
return sal_True;
}
- return sal_False;
+ return false;
}
void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats )
@@ -401,7 +402,7 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats )
sal_Bool lcl_IsCellPastePossible( const TransferableDataHelper& rData )
{
- sal_Bool bPossible = sal_False;
+ sal_Bool bPossible = false;
if ( ScTransferObj::GetOwnClipboard( NULL ) || ScDrawTransferObj::GetOwnClipboard( NULL ) )
bPossible = sal_True;
else
@@ -444,7 +445,7 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
}
-void __EXPORT ScCellShell::GetClipState( SfxItemSet& rSet )
+void ScCellShell::GetClipState( SfxItemSet& rSet )
{
// SID_PASTE
// SID_PASTE_SPECIAL
@@ -513,11 +514,7 @@ void ScCellShell::GetHLinkState( SfxItemSet& rSet )
void ScCellShell::GetState(SfxItemSet &rSet)
{
- // removed: SID_BORDER_OBJECT (old Basic)
-
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
-// sal_Bool bOle = pTabViewShell->GetViewFrame()->GetFrame().IsInPlace();
-// sal_Bool bTabProt = GetViewData()->GetDocument()->IsTabProtected(GetViewData()->GetTabNo());
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScViewData* pData = GetViewData();
ScDocument* pDoc = pData->GetDocument();
@@ -557,7 +554,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
case SID_RANGE_NOTETEXT:
{
- // #43343# always take cursor position, do not use top-left cell of selection
+ // always take cursor position, do not use top-left cell of selection
ScAddress aPos( nPosX, nPosY, nTab );
String aNoteText;
if ( const ScPostIt* pNote = pDoc->GetNote( aPos ) )
@@ -738,8 +735,6 @@ void ScCellShell::GetState(SfxItemSet &rSet)
case SID_SELECT_SCENARIO:
{
- // ScDocument* pDoc = GetViewData()->GetDocument();
- // SCTAB nTab = GetViewData()->GetTabNo();
List aList;
Color aDummyCol;
@@ -792,19 +787,6 @@ void ScCellShell::GetState(SfxItemSet &rSet)
rSet.DisableItem( nWhich );
break;
-/* Zellschutz bei selektierten Zellen wird bei anderen Funktionen auch nicht abgefragt...
- case SID_DELETE:
- {
- if ( pDoc->IsTabProtected(nTab) )
- {
- const SfxItemSet& rAttrSet = GetSelectionPattern()->GetItemSet();
- const ScProtectionAttr& rProtAttr = (const ScProtectionAttr&)rAttrSet.Get( ATTR_PROTECTION, sal_True );
- if ( rProtAttr.GetProtection() )
- rSet.DisableItem( nWhich );
- }
- }
- break;
-*/
case SID_OUTLINE_MAKE:
{
if ( GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
@@ -824,7 +806,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
{
//! test for data pilot operation
}
- else if (!pTabViewShell->OutlinePossible(sal_False))
+ else if (!pTabViewShell->OutlinePossible(false))
rSet.DisableItem( nWhich );
break;
@@ -883,7 +865,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
break;
case FID_INPUTLINE_STATUS:
- DBG_ERROR( "Old update method. Use ScTabViewShell::UpdateInputHandler()." );
+ OSL_FAIL( "Old update method. Use ScTabViewShell::UpdateInputHandler()." );
break;
case SID_SCENARIOS: // Szenarios:
@@ -903,18 +885,18 @@ void ScCellShell::GetState(SfxItemSet &rSet)
case SID_DELETE_NOTE:
{
- sal_Bool bEnable = sal_False;
+ sal_Bool bEnable = false;
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
if ( pDoc->IsSelectionEditable( rMark ) )
{
// look for at least one note in selection
ScRangeList aRanges;
- rMark.FillRangeListWithMarks( &aRanges, sal_False );
- sal_uLong nCount = aRanges.Count();
- for (sal_uLong nPos=0; nPos<nCount && !bEnable; nPos++)
+ rMark.FillRangeListWithMarks( &aRanges, false );
+ size_t nCount = aRanges.size();
+ for (size_t nPos = 0; nPos < nCount && !bEnable; ++nPos)
{
- ScCellIterator aCellIter( pDoc, *aRanges.GetObject(nPos) );
+ ScCellIterator aCellIter(pDoc, *aRanges[nPos]);
for( ScBaseCell* pCell = aCellIter.GetFirst(); pCell && !bEnable; pCell = aCellIter.GetNext() )
if ( pCell->HasNote() )
bEnable = sal_True; // note found
@@ -1000,3 +982,4 @@ void ScCellShell::GetState(SfxItemSet &rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 3803a318fb21..c5cb779ee2a4 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,22 +79,13 @@
#include "scmod.hxx"
#include "scresid.hxx"
#include "tabvwsh.hxx"
-//CHINA001 #include "inscldlg.hxx"
-//CHINA001 #include "inscodlg.hxx"
-//CHINA001 #include "delcldlg.hxx"
-//CHINA001 #include "delcodlg.hxx"
-//CHINA001 #include "filldlg.hxx"
-//CHINA001 #include "groupdlg.hxx"
#include "impex.hxx"
#include "reffind.hxx"
-//CHINA001 #include "namecrea.hxx"
#include "uiitems.hxx"
#include "reffact.hxx"
-//CHINA001 #include "namepast.hxx"
#include "inputhdl.hxx"
#include "transobj.hxx"
#include "drwtrans.hxx"
-//CHINA001 #include "linkarea.hxx"
#include "docfunc.hxx"
#include "editable.hxx"
#include "dpobject.hxx"
@@ -102,26 +94,31 @@
#include "spellparam.hxx"
#include "postit.hxx"
#include "clipparam.hxx"
+#include "pivot.hxx"
+#include "dpobject.hxx"
+#include "dpsdbtab.hxx" // ScImportSourceDesc
+#include "dpshttab.hxx" // ScSheetSourceDesc
#include "globstr.hrc"
-#include "scui_def.hxx" //CHINA001
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include "scui_def.hxx"
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
+#include "scabstdlg.hxx"
#define IS_AVAILABLE(WhichId,ppItem) \
(pReqArgs->GetItemState((WhichId), sal_True, ppItem ) == SFX_ITEM_SET)
-#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
-
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <cppuhelper/bootstrap.hxx>
+#include <boost/scoped_ptr.hpp>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
+using ::rtl::OUString;
//------------------------------------------------------------------
void ScCellShell::ExecuteEdit( SfxRequest& rReq )
@@ -223,13 +220,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScDocument* pDoc = GetViewData()->GetDocument();
sal_Bool bTheFlag=(pDoc->GetChangeTrack()!=NULL);
-//CHINA001 ScInsertCellDlg* pDlg = new ScInsertCellDlg( pTabViewShell->GetDialogParent(),
-//CHINA001 bTheFlag);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScInsertCellDlg* pDlg = pFact->CreateScInsertCellDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_INSCELL, bTheFlag);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK)
eCmd = pDlg->GetInsCellCmd();
delete pDlg;
@@ -298,13 +293,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
(GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE_FILTERED) ||
(pDoc->GetChangeTrack() != NULL);
- //CHINA001 ScDeleteCellDlg* pDlg = new ScDeleteCellDlg(
- //CHINA001 pTabViewShell->GetDialogParent(),bTheFlag);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScDeleteCellDlg* pDlg = pFact->CreateScDeleteCellDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_DELCELL, bTheFlag );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK)
eCmd = pDlg->GetDelCellCmd();
@@ -368,7 +361,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
case 'A': // Alle
nFlags |= IDF_ALL;
- bCont = sal_False; // nicht mehr weitermachen!
+ bCont = false; // nicht mehr weitermachen!
break;
case 'S': nFlags |= IDF_STRING; break;
case 'V': nFlags |= IDF_VALUE; break;
@@ -385,12 +378,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScEditableTester aTester( pTabViewShell );
if (aTester.IsEditable())
{
- //CHINA001 ScDeleteContentsDlg* pDlg = new ScDeleteContentsDlg( pTabViewShell->GetDialogParent() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScDeleteContentsDlg* pDlg = pFact->CreateScDeleteContentsDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_DELCONT );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
ScDocument* pDoc = GetViewData()->GetDocument();
SCTAB nTab = GetViewData()->GetTabNo();
if ( pDoc->IsTabProtected(nTab) )
@@ -463,8 +455,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
sal_uInt16 nFlags = IDF_NONE;
sal_uInt16 nFunction = PASTE_NOFUNC;
- sal_Bool bSkipEmpty = sal_False;
- sal_Bool bAsLink = sal_False;
+ sal_Bool bSkipEmpty = false;
+ sal_Bool bAsLink = false;
if ( pReqArgs!=NULL && pTabViewShell->SelectionEditable() )
{
@@ -483,7 +475,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
case 'A': // Alle
nFlags |= IDF_ALL;
- bCont = sal_False; // nicht mehr weitermachen!
+ bCont = false; // nicht mehr weitermachen!
break;
case 'S': nFlags |= IDF_STRING; break;
case 'V': nFlags |= IDF_VALUE; break;
@@ -496,18 +488,14 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
else
{
-//CHINA001 ScInsertContentsDlg* pDlg =
-//CHINA001 new ScInsertContentsDlg(pTabViewShell->GetDialogParent(),
-//CHINA001 0, /* nCheckDefaults */
-//CHINA001 &ScGlobal::GetRscString(STR_FILL_TAB) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScInsertContentsDlg* pDlg = pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(),
RID_SCDLG_INSCONT, 0, /* nCheckDefaults */
&ScGlobal::GetRscString(STR_FILL_TAB));
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
- pDlg->SetFillMode(sal_True);
+ DBG_ASSERT(pDlg, "Dialog create fail!");
+ pDlg->SetFillMode(true);
if (pDlg->Execute() == RET_OK)
{
@@ -564,7 +552,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
double fStartVal = MAXDOUBLE;
double fIncVal = 1;
double fMaxVal = MAXDOUBLE;
- sal_Bool bDoIt = sal_False;
+ sal_Bool bDoIt = false;
GetViewData()->GetSimpleArea( nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab );
@@ -592,7 +580,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
sal_uInt32 nKey;
double fTmpVal;
- bDoIt=sal_False;
+ bDoIt=false;
if( IS_AVAILABLE( FID_FILL_SERIES, &pItem ) )
aFillDir = ((const SfxStringItem*)pItem)->GetValue();
@@ -660,7 +648,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SvNumberformat* pPrivEntry = pFormatter->GetEntry( nPrivFormat );
if (!pPrivEntry)
{
- DBG_ERROR("Zahlformat nicht gefunden !!!");
+ OSL_FAIL("Zahlformat nicht gefunden !!!");
}
else
{
@@ -734,13 +722,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
}
}
-//CHINA001 ScFillSeriesDlg* pDlg = new ScFillSeriesDlg(
-//CHINA001 pTabViewShell->GetDialogParent(), *pDoc,
-//CHINA001 eFillDir, eFillCmd, eFillDateCmd,
-//CHINA001 aStartStr, fIncVal, fMaxVal,
-//CHINA001 nPossDir);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScFillSeriesDlg* pDlg = pFact->CreateScFillSeriesDlg( pTabViewShell->GetDialogParent(),
*pDoc,
@@ -748,11 +731,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
aStartStr, fIncVal, fMaxVal,
nPossDir,
RID_SCDLG_FILLSERIES);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( nStartCol != nEndCol && nStartRow != nEndRow )
{
- pDlg->SetEdStartValEnabled(sal_False);
+ pDlg->SetEdStartValEnabled(false);
}
if ( pDlg->Execute() == RET_OK )
@@ -868,7 +851,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
else // Aufruf per Maus
{
- // #55284# nicht innerhalb einer zusammengefassten Zelle
+ // nicht innerhalb einer zusammengefassten Zelle
if ( nStartCol == nEndCol && nStartRow == nEndRow )
{
@@ -938,7 +921,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
else
{
- DBG_ERROR( "Richtung nicht eindeutig fuer AutoFill" );
+ OSL_FAIL( "Richtung nicht eindeutig fuer AutoFill" );
}
}
}
@@ -952,7 +935,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_OUTLINE_HIDE:
if ( GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
GetViewData()->GetCurY(), GetViewData()->GetTabNo() ) )
- pTabViewShell->SetDataPilotDetails( sal_False );
+ pTabViewShell->SetDataPilotDetails( false );
else
pTabViewShell->HideMarkedOutlines();
rReq.Done();
@@ -969,11 +952,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( pTabViewShell->HasSelectionForDrillDown( nOrientation ) )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScDPShowDetailDlg* pDlg = pFact->CreateScDPShowDetailDlg(
pTabViewShell->GetDialogParent(), RID_SCDLG_DPSHOWDETAIL, *pDPObj, nOrientation );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
String aNewDimName( pDlg->GetDimensionName() );
@@ -996,7 +979,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_OUTLINE_MAKE:
{
- sal_Bool bColumns = sal_False;
+ sal_Bool bColumns = false;
sal_Bool bOk = sal_True;
if ( GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
@@ -1035,12 +1018,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
else
pTabViewShell->GroupDataPilot();
- bOk = sal_False;
+ bOk = false;
}
else if( pReqArgs != NULL )
{
const SfxPoolItem* pItem;
- bOk = sal_False;
+ bOk = false;
if( IS_AVAILABLE( SID_OUTLINE_MAKE, &pItem ) )
{
@@ -1049,7 +1032,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
switch( aCol.GetChar(0) )
{
- case 'R': bColumns=sal_False; bOk = sal_True;break;
+ case 'R': bColumns=false; bOk = sal_True;break;
case 'C': bColumns=sal_True; bOk = sal_True;break;
}
}
@@ -1059,20 +1042,18 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( GetViewData()->SimpleColMarked() && !GetViewData()->SimpleRowMarked() )
bColumns = sal_True;
else if ( !GetViewData()->SimpleColMarked() && GetViewData()->SimpleRowMarked() )
- bColumns = sal_False;
+ bColumns = false;
else
{
-//CHINA001 ScGroupDlg* pDlg = new ScGroupDlg(pTabViewShell->GetDialogParent(),
-//CHINA001 RID_SCDLG_GRP_MAKE, sal_False );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
- AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_GRP_MAKE, RID_SCDLG_GRP_MAKE,sal_False);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_GRP_MAKE, RID_SCDLG_GRP_MAKE,false);
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
bColumns = pDlg->GetColsChecked();
else
- bOk = sal_False;
+ bOk = false;
delete pDlg;
}
}
@@ -1092,19 +1073,19 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_OUTLINE_REMOVE:
{
- sal_Bool bColumns = sal_False;
+ sal_Bool bColumns = false;
sal_Bool bOk = sal_True;
if ( GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
GetViewData()->GetCurY(), GetViewData()->GetTabNo() ) )
{
pTabViewShell->UngroupDataPilot();
- bOk = sal_False;
+ bOk = false;
}
else if( pReqArgs != NULL )
{
const SfxPoolItem* pItem;
- bOk = sal_False;
+ bOk = false;
if( IS_AVAILABLE( SID_OUTLINE_REMOVE, &pItem ) )
{
@@ -1113,7 +1094,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
switch( aCol.GetChar(0) )
{
- case 'R': bColumns=sal_False; bOk = sal_True;break;
+ case 'R': bColumns=false; bOk = sal_True;break;
case 'C': bColumns=sal_True; bOk = sal_True;break;
}
}
@@ -1124,25 +1105,23 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pTabViewShell->TestRemoveOutline( bColPoss, bRowPoss );
if ( bColPoss && bRowPoss )
{
- //CHINA001 ScGroupDlg* pDlg = new ScGroupDlg( pTabViewShell->GetDialogParent(),
- //CHINA001 RID_SCDLG_GRP_KILL, sal_True );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
- AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_GRP_KILL, RID_SCDLG_GRP_KILL,sal_True);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ AbstractScGroupDlg* pDlg = pFact->CreateAbstractScGroupDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_GRP_KILL, RID_SCDLG_GRP_KILL,true);
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
bColumns = pDlg->GetColsChecked();
else
- bOk = sal_False;
+ bOk = false;
delete pDlg;
}
else if ( bColPoss )
bColumns = sal_True;
else if ( bRowPoss )
- bColumns = sal_False;
+ bColumns = false;
else
- bOk = sal_False;
+ bOk = false;
}
if (bOk)
{
@@ -1162,11 +1141,15 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
// Clipboard
//
+
case SID_COPY: // fuer Grafiken in DrawShell
{
WaitObject aWait( GetViewData()->GetDialogParent() );
- pTabViewShell->CopyToClip( NULL, sal_False, sal_False, sal_True );
+ pTabViewShell->CopyToClip( NULL, false, false, sal_True );
rReq.Done();
+ GetViewData()->SetPasteMode( (ScPasteFlags) (SC_PASTE_MODE | SC_PASTE_BORDER) );
+ pTabViewShell->ShowCursor();
+ pTabViewShell->UpdateCopySourceOverlay();
}
break;
@@ -1175,6 +1158,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
WaitObject aWait( GetViewData()->GetDialogParent() );
pTabViewShell->CutToClip( NULL, sal_True );
rReq.Done();
+ GetViewData()->SetPasteMode( SC_PASTE_MODE );
+ pTabViewShell->UpdateCopySourceOverlay();
}
break;
@@ -1224,9 +1209,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
sal_uInt16 nFlags = IDF_NONE;
sal_uInt16 nFunction = PASTE_NOFUNC;
- sal_Bool bSkipEmpty = sal_False;
- sal_Bool bTranspose = sal_False;
- sal_Bool bAsLink = sal_False;
+ sal_Bool bSkipEmpty = false;
+ sal_Bool bTranspose = false;
+ sal_Bool bAsLink = false;
InsCellCmd eMoveMode = INS_NONE;
Window* pWin = GetViewData()->GetActiveWin();
@@ -1235,7 +1220,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
if ( pOwnClip )
{
- // #129384# keep a reference in case the clipboard is changed during dialog or PasteFromClip
+ // keep a reference in case the clipboard is changed during dialog or PasteFromClip
uno::Reference<datatransfer::XTransferable> aOwnClipRef( pOwnClip );
if ( pReqArgs!=NULL && pTabViewShell->SelectionEditable() )
{
@@ -1254,7 +1239,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
case 'A': // Alle
nFlags |= IDF_ALL;
- bCont = sal_False; // nicht mehr weitermachen!
+ bCont = false; // nicht mehr weitermachen!
break;
case 'S': nFlags |= IDF_STRING; break;
case 'V': nFlags |= IDF_VALUE; break;
@@ -1265,11 +1250,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
}
- SFX_REQUEST_ARG( rReq, pFuncItem, SfxUInt16Item, FN_PARAM_1, sal_False );
- SFX_REQUEST_ARG( rReq, pSkipItem, SfxBoolItem, FN_PARAM_2, sal_False );
- SFX_REQUEST_ARG( rReq, pTransposeItem, SfxBoolItem, FN_PARAM_3, sal_False );
- SFX_REQUEST_ARG( rReq, pLinkItem, SfxBoolItem, FN_PARAM_4, sal_False );
- SFX_REQUEST_ARG( rReq, pMoveItem, SfxInt16Item, FN_PARAM_5, sal_False );
+ SFX_REQUEST_ARG( rReq, pFuncItem, SfxUInt16Item, FN_PARAM_1, false );
+ SFX_REQUEST_ARG( rReq, pSkipItem, SfxBoolItem, FN_PARAM_2, false );
+ SFX_REQUEST_ARG( rReq, pTransposeItem, SfxBoolItem, FN_PARAM_3, false );
+ SFX_REQUEST_ARG( rReq, pLinkItem, SfxBoolItem, FN_PARAM_4, false );
+ SFX_REQUEST_ARG( rReq, pMoveItem, SfxInt16Item, FN_PARAM_5, false );
if ( pFuncItem )
nFunction = pFuncItem->GetValue();
if ( pSkipItem )
@@ -1286,17 +1271,16 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScEditableTester aTester( pTabViewShell );
if (aTester.IsEditable())
{
- //CHINA001 ScInsertContentsDlg* pDlg = new ScInsertContentsDlg( pTabViewShell->GetDialogParent() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScInsertContentsDlg* pDlg = pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(),
RID_SCDLG_INSCONT);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
pDlg->SetOtherDoc( bOtherDoc );
- // #53661# bei ChangeTrack MoveMode disablen
+ // bei ChangeTrack MoveMode disablen
pDlg->SetChangeTrack( pDoc->GetChangeTrack() != NULL );
- // #72930# cut/move references may disable shift
+ // cut/move references may disable shift
// directions if source and destination ranges intersect
if ( !bOtherDoc )
{
@@ -1487,7 +1471,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
//
case FID_INS_ROWBRK:
- pTabViewShell->InsertPageBreak( sal_False );
+ pTabViewShell->InsertPageBreak( false );
rReq.Done();
break;
@@ -1497,7 +1481,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
break;
case FID_DEL_ROWBRK:
- pTabViewShell->DeletePageBreak( sal_False );
+ pTabViewShell->DeletePageBreak( false );
rReq.Done();
break;
@@ -1541,8 +1525,22 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
rReq.Done();
break;
+ case SID_DETECTIVE_MARK_PRED:
+ pTabViewShell->DetectiveMarkPred();
+ break;
+ case SID_DETECTIVE_MARK_SUCC:
+ pTabViewShell->DetectiveMarkSucc();
+ break;
+ case SID_INSERT_CURRENT_DATE:
+ pTabViewShell->InsertCurrentTime(
+ NUMBERFORMAT_DATE, ScGlobal::GetRscString(STR_UNDO_INSERT_CURRENT_DATE));
+ break;
+ case SID_INSERT_CURRENT_TIME:
+ pTabViewShell->InsertCurrentTime(
+ NUMBERFORMAT_TIME, ScGlobal::GetRscString(STR_UNDO_INSERT_CURRENT_TIME));
+ break;
+
case SID_SPELL_DIALOG:
-// pTabViewShell->DoSpellingChecker();
{
SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame();
if( rReq.GetArgs() )
@@ -1573,7 +1571,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
Reference< ui::dialogs::XExecutableDialog > xDialog(
xMCF->createInstanceWithContext(
- rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog")
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog"))
, xContext), UNO_QUERY);
Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
if( xInit.is() )
@@ -1583,7 +1581,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
Sequence<Any> aSeq(1);
Any* pArray = aSeq.getArray();
PropertyValue aParam;
- aParam.Name = rtl::OUString::createFromAscii("ParentWindow");
+ aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
aParam.Value <<= makeAny(xDialogParentWindow);
pArray[0] <<= makeAny(aParam);
xInit->initialize( aSeq );
@@ -1601,9 +1599,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
try
{
- xProp->getPropertyValue( C2U("IsDirectionToSimplified") ) >>= bToSimplified;
- xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
- xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
+ xProp->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsDirectionToSimplified")) ) >>= bToSimplified;
+ xProp->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsUseCharacterVariants")) ) >>= bUseVariants;
+ xProp->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsTranslateCommonTerms")) ) >>= bCommonTerms;
}
catch( Exception& )
{
@@ -1642,7 +1640,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
break;
case SID_DEC_INDENT:
- pTabViewShell->ChangeIndent( sal_False );
+ pTabViewShell->ChangeIndent( false );
break;
case SID_INC_INDENT:
pTabViewShell->ChangeIndent( sal_True );
@@ -1652,12 +1650,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
sal_uInt16 nFlags = pTabViewShell->GetCreateNameFlags();
- //CHINA001 ScNameCreateDlg* pDlg = new ScNameCreateDlg( pTabViewShell->GetDialogParent(), nFlags );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScNameCreateDlg* pDlg = pFact->CreateScNameCreateDlg(pTabViewShell->GetDialogParent(), nFlags, RID_SCDLG_NAMES_CREATE );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if( pDlg->Execute() )
{
@@ -1692,8 +1689,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
const SfxBoolItem* pOkItem = (const SfxBoolItem*)&pReqArgs->Get( SID_DLG_RETOK );
-// pScMod->SetFunctionDlg( NULL );
-
if ( pOkItem->GetValue() ) // OK
{
String aFormula;
@@ -1740,7 +1735,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -1751,14 +1746,14 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
case SID_UPDATECHART:
{
- sal_Bool bAll = sal_False;
+ sal_Bool bAll = false;
if( pReqArgs )
{
@@ -1808,12 +1803,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case FID_INSERT_NAME:
{
ScDocument* pDoc = GetViewData()->GetDocument();
- //CHINA001 ScNamePasteDlg* pDlg = new ScNamePasteDlg( pTabViewShell->GetDialogParent(), pDoc->GetRangeName() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScNamePasteDlg* pDlg = pFact->CreateScNamePasteDlg( pTabViewShell->GetDialogParent(), pDoc->GetRangeName(), RID_SCDLG_NAMES_PASTE );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
switch( pDlg->Execute() )
{
case BTN_PASTE_LIST:
@@ -1828,7 +1822,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pScMod->InputKeyEvent( KeyEvent('=',KeyCode()) );
String aName = pDlg->GetSelectedName();
- pHdl->InsertFunction( aName, sal_False ); // ohne "()"
+ pHdl->InsertFunction( aName, false ); // ohne "()"
}
}
break;
@@ -1842,7 +1836,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
const SfxStringItem& rTextItem = (const SfxStringItem&)pReqArgs->Get( SID_RANGE_NOTETEXT );
- // #43343# immer Cursorposition
+ // immer Cursorposition
ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
pTabViewShell->SetNoteText( aPos, rTextItem.GetValue() );
rReq.Done();
@@ -1904,14 +1898,14 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
if ( pArgs )
- pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), sal_False, &pItem);
+ pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem);
if ( pItem )
{
const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, pItem );
if ( pStringItem )
aChars = pStringItem->GetValue();
const SfxPoolItem* pFtItem = NULL;
- pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
+ pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
if ( pFontItem )
aFontName = pFontItem->GetValue();
@@ -1931,7 +1925,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
else
{
- //CHINA001 SvxCharacterMap* pDlg = new SvxCharacterMap( pTabViewShell->GetDialogParent(), sal_False );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
// font color doesn't matter here
@@ -1940,7 +1933,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pTabViewShell->GetSelectionScriptType() );
SfxAllItemSet aSet( GetPool() );
- aSet.Put( SfxBoolItem( FN_PARAM_1, sal_False ) );
+ aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) );
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( pTabViewShell->GetDialogParent(), aSet,
@@ -1948,8 +1941,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( pDlg->Execute() == RET_OK )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, false );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, false );
if ( pItem && pFontItem )
{
@@ -1984,7 +1977,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
else
{
- DBG_ERROR("NULL");
+ OSL_FAIL("NULL");
}
}
}
@@ -2039,33 +2032,32 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
String aSource;
sal_uLong nRefresh=0;
- SFX_REQUEST_ARG( rReq, pFile, SfxStringItem, SID_FILE_NAME, sal_False );
- SFX_REQUEST_ARG( rReq, pSource, SfxStringItem, FN_PARAM_1, sal_False );
+ SFX_REQUEST_ARG( rReq, pFile, SfxStringItem, SID_FILE_NAME, false );
+ SFX_REQUEST_ARG( rReq, pSource, SfxStringItem, FN_PARAM_1, false );
if ( pFile && pSource )
{
aFile = pFile->GetValue();
aSource = pSource->GetValue();
- SFX_REQUEST_ARG( rReq, pFilter, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pFilter, SfxStringItem, SID_FILTER_NAME, false );
if ( pFilter )
aFilter = pFilter->GetValue();
- SFX_REQUEST_ARG( rReq, pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
+ SFX_REQUEST_ARG( rReq, pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, false );
if ( pOptions )
aOptions = pOptions->GetValue();
- SFX_REQUEST_ARG( rReq, pRefresh, SfxUInt32Item, FN_PARAM_2, sal_False );
+ SFX_REQUEST_ARG( rReq, pRefresh, SfxUInt32Item, FN_PARAM_2, false );
if ( pRefresh )
nRefresh = pRefresh->GetValue();
}
else
{
- //CHINA001 ScLinkedAreaDlg* pDlg = new ScLinkedAreaDlg( pTabViewShell->GetDialogParent() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
delete pImpl->m_pLinkedDlg;
pImpl->m_pLinkedDlg =
pFact->CreateScLinkedAreaDlg( pTabViewShell->GetDialogParent(),
RID_SCDLG_LINKAREA);
- DBG_ASSERT(pImpl->m_pLinkedDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pImpl->m_pLinkedDlg, "Dialog create fail!");
delete pImpl->m_pRequest;
pImpl->m_pRequest = new SfxRequest( rReq );
pImpl->m_pLinkedDlg->StartExecuteModal( LINK( this, ScCellShell, DialogClosed ) );
@@ -2081,7 +2073,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
//
default:
- DBG_ERROR("falscher Slot bei ExecuteEdit");
+ OSL_FAIL("falscher Slot bei ExecuteEdit");
break;
}
}
@@ -2103,7 +2095,7 @@ void ScCellShell::ExecuteExternalSource(
if ( _rFile.Len() && _rSource.Len() ) // filter may be empty
{
ScRange aLinkRange;
- sal_Bool bMove = sal_False;
+ sal_Bool bMove = false;
ScViewData* pData = GetViewData();
ScMarkData& rMark = pData->GetMarkData();
@@ -2118,13 +2110,174 @@ void ScCellShell::ExecuteExternalSource(
ScDocFunc aFunc(*pData->GetDocShell());
aFunc.InsertAreaLink( _rFile, _rFilter, _rOptions, _rSource,
- aLinkRange, _nRefresh, bMove, sal_False );
+ aLinkRange, _nRefresh, bMove, false );
_rRequest.Done();
}
else
_rRequest.Ignore();
}
+void ScCellShell::ExecuteDataPilotDialog()
+{
+ ScModule* pScMod = SC_MOD();
+ ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
+ ScViewData* pData = GetViewData();
+ ScDocument* pDoc = pData->GetDocument();
+
+ ::boost::scoped_ptr<ScDPObject> pNewDPObject(NULL);
+
+ // ScPivot is no longer used...
+ ScDPObject* pDPObj = pDoc->GetDPAtCursor(
+ pData->GetCurX(), pData->GetCurY(),
+ pData->GetTabNo() );
+ if ( pDPObj ) // on an existing table?
+ {
+ pNewDPObject.reset(new ScDPObject(*pDPObj));
+ }
+ else // create new table
+ {
+ // select database range or data
+ pTabViewShell->GetDBData( true, SC_DB_OLD );
+ ScMarkData& rMark = GetViewData()->GetMarkData();
+ if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
+ pTabViewShell->MarkDataArea( false );
+
+ // output to cursor position for non-sheet data
+ ScAddress aDestPos( pData->GetCurX(), pData->GetCurY(),
+ pData->GetTabNo() );
+
+ // first select type of source data
+
+ bool bEnableExt = ScDPObject::HasRegisteredSources();
+
+ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
+
+ ::boost::scoped_ptr<AbstractScDataPilotSourceTypeDlg> pTypeDlg(
+ pFact->CreateScDataPilotSourceTypeDlg(
+ pTabViewShell->GetDialogParent(), bEnableExt, RID_SCDLG_DAPITYPE));
+
+ // Populate named ranges (if any).
+ ScRangeName* pRangeName = pDoc->GetRangeName();
+ if (pRangeName)
+ {
+ ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end();
+ for (; itr != itrEnd; ++itr)
+ pTypeDlg->AppendNamedRange(itr->GetName());
+ }
+
+ DBG_ASSERT(pTypeDlg, "Dialog create fail!");
+ if ( pTypeDlg->Execute() == RET_OK )
+ {
+ if ( pTypeDlg->IsExternal() )
+ {
+ uno::Sequence<rtl::OUString> aSources = ScDPObject::GetRegisteredSources();
+ ::boost::scoped_ptr<AbstractScDataPilotServiceDlg> pServDlg(
+ pFact->CreateScDataPilotServiceDlg(
+ pTabViewShell->GetDialogParent(), aSources, RID_SCDLG_DAPISERVICE));
+
+ DBG_ASSERT(pServDlg, "Dialog create fail!");
+ if ( pServDlg->Execute() == RET_OK )
+ {
+ ScDPServiceDesc aServDesc(
+ pServDlg->GetServiceName(),
+ pServDlg->GetParSource(),
+ pServDlg->GetParName(),
+ pServDlg->GetParUser(),
+ pServDlg->GetParPass() );
+ pNewDPObject.reset(new ScDPObject(pDoc));
+ pNewDPObject->SetServiceData( aServDesc );
+ }
+ }
+ else if ( pTypeDlg->IsDatabase() )
+ {
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
+
+ ::boost::scoped_ptr<AbstractScDataPilotDatabaseDlg> pDataDlg(
+ pFact->CreateScDataPilotDatabaseDlg(
+ pTabViewShell->GetDialogParent(), RID_SCDLG_DAPIDATA));
+
+ DBG_ASSERT(pDataDlg, "Dialog create fail!");
+ if ( pDataDlg->Execute() == RET_OK )
+ {
+ ScImportSourceDesc aImpDesc(pDoc);
+ pDataDlg->GetValues( aImpDesc );
+ pNewDPObject.reset(new ScDPObject(pDoc));
+ pNewDPObject->SetImportDesc( aImpDesc );
+ }
+ }
+ else if (pTypeDlg->IsNamedRange())
+ {
+ OUString aName = pTypeDlg->GetSelectedNamedRange();
+ ScSheetSourceDesc aShtDesc(pDoc);
+ aShtDesc.SetRangeName(aName);
+ pNewDPObject.reset(new ScDPObject(pDoc));
+ pNewDPObject->SetSheetDesc(aShtDesc);
+ }
+ else // selection
+ {
+ //! use database ranges (select before type dialog?)
+ ScRange aRange;
+ ScMarkType eType = GetViewData()->GetSimpleArea(aRange);
+ if ( (eType & SC_MARK_SIMPLE) == SC_MARK_SIMPLE )
+ {
+ // Shrink the range to the data area.
+ SCCOL nStartCol = aRange.aStart.Col(), nEndCol = aRange.aEnd.Col();
+ SCROW nStartRow = aRange.aStart.Row(), nEndRow = aRange.aEnd.Row();
+ if (pDoc->ShrinkToDataArea(aRange.aStart.Tab(), nStartCol, nStartRow, nEndCol, nEndRow))
+ {
+ aRange.aStart.SetCol(nStartCol);
+ aRange.aStart.SetRow(nStartRow);
+ aRange.aEnd.SetCol(nEndCol);
+ aRange.aEnd.SetRow(nEndRow);
+ rMark.SetMarkArea(aRange);
+ pTabViewShell->MarkRange(aRange);
+ }
+
+ bool bOK = true;
+ if ( pDoc->HasSubTotalCells( aRange ) )
+ {
+ // confirm selection if it contains SubTotal cells
+
+ QueryBox aBox( pTabViewShell->GetDialogParent(),
+ WinBits(WB_YES_NO | WB_DEF_YES),
+ ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) );
+ if (aBox.Execute() == RET_NO)
+ bOK = false;
+ }
+ if (bOK)
+ {
+ ScSheetSourceDesc aShtDesc(pDoc);
+ aShtDesc.SetSourceRange(aRange);
+ pNewDPObject.reset(new ScDPObject(pDoc));
+ pNewDPObject->SetSheetDesc( aShtDesc );
+
+ // output below source data
+ if ( aRange.aEnd.Row()+2 <= MAXROW - 4 )
+ aDestPos = ScAddress( aRange.aStart.Col(),
+ aRange.aEnd.Row()+2,
+ aRange.aStart.Tab() );
+ }
+ }
+ }
+ }
+
+ if ( pNewDPObject )
+ pNewDPObject->SetOutRange( aDestPos );
+ }
+
+ pTabViewShell->SetDialogDPObject( pNewDPObject.get() ); // is copied
+ if ( pNewDPObject )
+ {
+ // start layout dialog
+
+ sal_uInt16 nId = ScPivotLayoutWrapper::GetChildWindowId();
+ SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
+ SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
+ pScMod->SetRefDialog( nId, pWnd ? false : true );
+ }
+}
+
IMPL_LINK( ScCellShell, DialogClosed, AbstractScLinkedAreaDlg*, EMPTYARG )
{
DBG_ASSERT( pImpl->m_pLinkedDlg, "ScCellShell::DialogClosed(): invalid request" );
@@ -2198,9 +2351,11 @@ void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTa
nFlags &= ~IDF_FORMULA;
pTabViewShell->PasteFromClip( nFlags, pClipDoc,
- PASTE_NOFUNC, sal_False, sal_False, sal_False, INS_NONE, IDF_NONE,
+ PASTE_NOFUNC, false, false, false, INS_NONE, IDF_NONE,
bShowDialog ); // allow warning dialog
}
}
pTabViewShell->CellContentChanged(); // => PasteFromSystem() ???
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index eda6b5cb0efd..4cb71cc45bd4 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,35 +62,20 @@
#include "uiitems.hxx"
#include "dbfunc.hxx"
#include "dbdocfun.hxx"
-//CHINA001 #include "lbseldlg.hxx"
-//CHINA001 #include "sortdlg.hxx"
#include "filtdlg.hxx"
#include "dbnamdlg.hxx"
-//CHINA001 #include "subtdlg.hxx"
#include "reffact.hxx"
#include "pvlaydlg.hxx"
#include "validat.hxx"
#include "scresid.hxx"
-//CHINA001 #include "validate.hxx"
-#include "pivot.hxx"
-#include "dpobject.hxx"
-//CHINA001 #include "dapitype.hxx"
-//CHINA001 #include "dapidata.hxx"
-#include "dpsdbtab.hxx" // ScImportSourceDesc
-#include "dpshttab.hxx" // ScSheetSourceDesc
-
-#include "validate.hrc" //CHINA001 add for ScValidationDlg
-#include "scui_def.hxx" //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+
+#include "validate.hrc" // ScValidationDlg
+#include "scui_def.hxx"
+#include "scabstdlg.hxx"
#include "impex.hxx"
#include "asciiopt.hxx"
using namespace com::sun::star;
-//#include "strindlg.hxx" //! Test !!!!!
-
-//static ScArea aPivotSource; //! wohin? (ueber den Dialog retten)
-
-
#define IS_AVAILABLE(WhichId,ppItem) \
(pReqArgs->GetItemState((WhichId), sal_True, ppItem ) == SFX_ITEM_SET)
@@ -161,7 +147,7 @@ sal_Bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam )
SCCOL nStartCol = aExternalRange.aStart.Col();
SCROW nEndRow = aExternalRange.aEnd.Row();
SCCOL nEndCol = aExternalRange.aEnd.Col();
- pDoc->GetDataArea( aExternalRange.aStart.Tab(), nStartCol, nStartRow, nEndCol, nEndRow, sal_False, false );
+ pDoc->GetDataArea( aExternalRange.aStart.Tab(), nStartCol, nStartRow, nEndCol, nEndRow, false, false );
aExternalRange.aStart.SetRow( nStartRow );
aExternalRange.aStart.SetCol( nStartCol );
aExternalRange.aEnd.SetRow( nEndRow );
@@ -181,22 +167,22 @@ sal_Bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam )
rCurrentRange.Format( aCurrentStr, nFmt, pDoc );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
VclAbstractDialog* pWarningDlg = pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(),aExtendStr,aCurrentStr,RID_SCDLG_SORT_WARNING );
- DBG_ASSERT(pWarningDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pWarningDlg, "Dialog create fail!");
short bResult = pWarningDlg->Execute();
if( bResult == BTN_EXTEND_RANGE || bResult == BTN_CURRENT_SELECTION )
{
if( bResult == BTN_EXTEND_RANGE )
{
- pTabViewShell->MarkRange( aExternalRange, sal_False );
+ pTabViewShell->MarkRange( aExternalRange, false );
pDBData->SetArea( nTab, aExternalRange.aStart.Col(), aExternalRange.aStart.Row(), aExternalRange.aEnd.Col(), aExternalRange.aEnd.Row() );
}
}
else
{
- bSort = sal_False;
+ bSort = false;
pData->GetDocShell()->CancelAutoDBRange();
}
@@ -206,7 +192,6 @@ sal_Bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam )
return bSort;
}
-//<!-- Added by PengYunQuan for Validity Cell Range Picker
//after end execute from !IsModalInputMode, it is safer to delay deleting
namespace
{
@@ -216,7 +201,6 @@ namespace
return 0;
}
}
-//--> Added by PengYunQuan for Validity Cell Range Picker
void ScCellShell::ExecuteDB( SfxRequest& rReq )
{
@@ -240,11 +224,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
// check if database beamer is open
SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame();
- sal_Bool bWasOpen = sal_False;
+ sal_Bool bWasOpen = false;
{
uno::Reference<frame::XFrame> xFrame = pViewFrame->GetFrame().GetFrameInterface();
uno::Reference<frame::XFrame> xBeamerFrame = xFrame->findFrame(
- rtl::OUString::createFromAscii("_beamer"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")),
frame::FrameSearchFlag::CHILDREN);
if ( xBeamerFrame.is() )
bWasOpen = sal_True;
@@ -260,7 +244,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
{
// show database beamer: SfxViewFrame call must be synchronous
- pViewFrame->ExecuteSlot( rReq, (sal_Bool) sal_False ); // sal_False = synchronous
+ pViewFrame->ExecuteSlot( rReq, (sal_Bool) false ); // sal_False = synchronous
// select current database in database beamer
@@ -277,7 +261,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
case SID_REIMPORT_DATA:
{
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
ScDBData* pDBData = pTabViewShell->GetDBData(sal_True,SC_DB_OLD);
if (pDBData)
{
@@ -320,7 +304,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
pTabViewShell->MarkRange(aNewRange);
}
- if ( bContinue ) // #41905# Fehler beim Import -> Abbruch
+ if ( bContinue ) // Fehler beim Import -> Abbruch
{
// interne Operationen, wenn welche gespeichert
@@ -341,7 +325,21 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
case SID_SBA_BRW_INSERT:
{
- DBG_ERROR( "Deprecated Slot" );
+ OSL_FAIL( "Deprecated Slot" );
+ }
+ break;
+
+ case SID_DATA_FORM:
+ {
+ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
+
+ AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg( pTabViewShell->GetDialogParent(),RID_SCDLG_DATAFORM, pTabViewShell);
+ DBG_ASSERT(pDlg, "Dialog create fail!");
+
+ pDlg->Execute();
+
+ rReq.Done();
}
break;
@@ -356,22 +354,20 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
else
{
- //CHINA001 ScSubTotalDlg* pDlg = NULL;
SfxAbstractTabDialog * pDlg = NULL;
ScSubTotalParam aSubTotalParam;
SfxItemSet aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA );
ScDBData* pDBData = pTabViewShell->GetDBData();
pDBData->GetSubTotalParam( aSubTotalParam );
- aSubTotalParam.bRemoveOnly = sal_False;
+ aSubTotalParam.bRemoveOnly = false;
aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, GetViewData(), &aSubTotalParam ) );
- //CHINA001 pDlg = new ScSubTotalDlg( pTabViewShell->GetDialogParent(), &aArgSet );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
pDlg = pFact->CreateScSubTotalDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SUBTOTALS );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
pDlg->SetCurPageId(1);
short bResult = pDlg->Execute();
@@ -436,16 +432,17 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
nCol = aSortParam.nCol2;
aSortParam.bHasHeader = bHasHeader;
- aSortParam.bByRow = sal_True;
- aSortParam.bCaseSens = sal_False;
- aSortParam.bIncludePattern = sal_True;
- aSortParam.bInplace = sal_True;
- aSortParam.bDoSort[0] = sal_True;
+ aSortParam.bByRow = true;
+ aSortParam.bCaseSens = false;
+ aSortParam.bNaturalSort = false;
+ aSortParam.bIncludePattern = true;
+ aSortParam.bInplace = true;
+ aSortParam.bDoSort[0] = true;
aSortParam.nField[0] = nCol;
aSortParam.bAscending[0] = (nSlotId == SID_SORT_ASCENDING);
for ( sal_uInt16 i=1; i<MAXSORT; i++ )
- aSortParam.bDoSort[i] = sal_False;
+ aSortParam.bDoSort[i] = false;
aArgSet.Put( ScSortItem( SCITEM_SORTDATA, GetViewData(), &aSortParam ) );
@@ -489,7 +486,9 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
aSortParam.bHasHeader = ((const SfxBoolItem*)pItem)->GetValue();
if ( pArgs->GetItemState( SID_SORT_CASESENS, sal_True, &pItem ) == SFX_ITEM_SET )
aSortParam.bCaseSens = ((const SfxBoolItem*)pItem)->GetValue();
- if ( pArgs->GetItemState( SID_SORT_ATTRIBS, sal_True, &pItem ) == SFX_ITEM_SET )
+ if ( pArgs->GetItemState( SID_SORT_NATURALSORT, true, &pItem ) == SFX_ITEM_SET )
+ aSortParam.bNaturalSort = ((const SfxBoolItem*)pItem)->GetValue();
+ if ( pArgs->GetItemState( SID_SORT_ATTRIBS, true, &pItem ) == SFX_ITEM_SET )
aSortParam.bIncludePattern = ((const SfxBoolItem*)pItem)->GetValue();
if ( pArgs->GetItemState( SID_SORT_USERDEF, sal_True, &pItem ) == SFX_ITEM_SET )
{
@@ -548,11 +547,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
aArgSet.Put( ScSortItem( SCITEM_SORTDATA, GetViewData(), &aSortParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
pDlg = pFact->CreateScSortDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SORT );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
- pDlg->SetCurPageId(1);
+ DBG_ASSERT(pDlg, "Dialog create fail!");
+ pDlg->SetCurPageId(1); // 1=sort field tab 2=sort options tab
if ( pDlg->Execute() == RET_OK )
{
@@ -571,6 +570,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
rOutParam.bHasHeader ) );
rReq.AppendItem( SfxBoolItem( SID_SORT_CASESENS,
rOutParam.bCaseSens ) );
+ rReq.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT,
+ rOutParam.bNaturalSort ) );
rReq.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS,
rOutParam.bIncludePattern ) );
sal_uInt16 nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0;
@@ -614,7 +615,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
if ( pArgs )
{
- DBG_ERROR("SID_FILTER with arguments?");
+ OSL_FAIL("SID_FILTER with arguments?");
pTabViewShell->Query( ((const ScQueryItem&)
pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), NULL, sal_True );
rReq.Done();
@@ -625,7 +626,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
}
break;
@@ -635,7 +636,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
if ( pArgs )
{
- DBG_ERROR("SID_SPECIAL_FILTER with arguments?");
+ OSL_FAIL("SID_SPECIAL_FILTER with arguments?");
pTabViewShell->Query( ((const ScQueryItem&)
pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), NULL, sal_True );
rReq.Done();
@@ -646,7 +647,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
}
break;
@@ -689,7 +690,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
pDBData->GetQueryParam( aParam );
SCSIZE nEC = aParam.GetEntryCount();
for (SCSIZE i=0; i<nEC; i++)
- aParam.GetEntry(i).bDoQuery = sal_False;
+ aParam.GetEntry(i).bDoQuery = false;
aParam.bDuplicate = sal_True;
pTabViewShell->Query( aParam, NULL, sal_True );
rReq.Done();
@@ -741,177 +742,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
break;
case SID_OPENDLG_PIVOTTABLE:
- {
- ScViewData* pData = GetViewData();
- ScDocument* pDoc = pData->GetDocument();
-
- ScDPObject* pNewDPObject = NULL;
-
- // ScPivot is no longer used...
- ScDPObject* pDPObj = pDoc->GetDPAtCursor(
- pData->GetCurX(), pData->GetCurY(),
- pData->GetTabNo() );
- if ( pDPObj ) // on an existing table?
- {
- pNewDPObject = new ScDPObject( *pDPObj );
- }
- else // create new table
- {
- // select database range or data
- pTabViewShell->GetDBData( sal_True, SC_DB_OLD );
- ScMarkData& rMark = GetViewData()->GetMarkData();
- if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
- pTabViewShell->MarkDataArea( sal_False );
-
- // output to cursor position for non-sheet data
- ScAddress aDestPos( pData->GetCurX(), pData->GetCurY(),
- pData->GetTabNo() );
-
- // first select type of source data
-
- sal_Bool bEnableExt = ScDPObject::HasRegisteredSources();
- //CHINA001 ScDataPilotSourceTypeDlg* pTypeDlg = new ScDataPilotSourceTypeDlg(
- //CHINA001 pTabViewShell->GetDialogParent(), bEnableExt );
-
- ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
-
- AbstractScDataPilotSourceTypeDlg* pTypeDlg = pFact->CreateScDataPilotSourceTypeDlg( pTabViewShell->GetDialogParent(), bEnableExt, RID_SCDLG_DAPITYPE );
- DBG_ASSERT(pTypeDlg, "Dialog create fail!");//CHINA001
- if ( pTypeDlg->Execute() == RET_OK )
- {
- if ( pTypeDlg->IsExternal() )
- {
- uno::Sequence<rtl::OUString> aSources = ScDPObject::GetRegisteredSources();
- //CHINA001 ScDataPilotServiceDlg* pServDlg = new ScDataPilotServiceDlg(
- //CHINA001 pTabViewShell->GetDialogParent(), aSources );
- AbstractScDataPilotServiceDlg* pServDlg = pFact->CreateScDataPilotServiceDlg( pTabViewShell->GetDialogParent(), aSources, RID_SCDLG_DAPISERVICE );
- DBG_ASSERT(pServDlg, "Dialog create fail!");//CHINA001
- if ( pServDlg->Execute() == RET_OK )
- {
- ScDPServiceDesc aServDesc(
- pServDlg->GetServiceName(),
- pServDlg->GetParSource(),
- pServDlg->GetParName(),
- pServDlg->GetParUser(),
- pServDlg->GetParPass() );
- pNewDPObject = new ScDPObject( pDoc );
- pNewDPObject->SetServiceData( aServDesc );
- }
- delete pServDlg;
- }
- else if ( pTypeDlg->IsDatabase() )
- {
- //CHINA001 ScDataPilotDatabaseDlg* pDataDlg = new ScDataPilotDatabaseDlg(
- //CHINA001 pTabViewShell->GetDialogParent() );
- //ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
-
- AbstractScDataPilotDatabaseDlg* pDataDlg = pFact->CreateScDataPilotDatabaseDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_DAPIDATA);
- DBG_ASSERT(pDataDlg, "Dialog create fail!");//CHINA001
- if ( pDataDlg->Execute() == RET_OK )
- {
- ScImportSourceDesc aImpDesc;
- pDataDlg->GetValues( aImpDesc );
- pNewDPObject = new ScDPObject( pDoc );
- pNewDPObject->SetImportDesc( aImpDesc );
- }
- delete pDataDlg;
- }
- else // selection
- {
- //! use database ranges (select before type dialog?)
- ScRange aRange;
- ScMarkType eType = GetViewData()->GetSimpleArea(aRange);
- if ( (eType & SC_MARK_SIMPLE) == SC_MARK_SIMPLE )
- {
- // Shrink the range to the data area.
- SCCOL nStartCol = aRange.aStart.Col(), nEndCol = aRange.aEnd.Col();
- SCROW nStartRow = aRange.aStart.Row(), nEndRow = aRange.aEnd.Row();
- if (pDoc->ShrinkToDataArea(aRange.aStart.Tab(), nStartCol, nStartRow, nEndCol, nEndRow))
- {
- aRange.aStart.SetCol(nStartCol);
- aRange.aStart.SetRow(nStartRow);
- aRange.aEnd.SetCol(nEndCol);
- aRange.aEnd.SetRow(nEndRow);
- rMark.SetMarkArea(aRange);
- pTabViewShell->MarkRange(aRange);
- }
-
- sal_Bool bOK = sal_True;
- if ( pDoc->HasSubTotalCells( aRange ) )
- {
- // confirm selection if it contains SubTotal cells
-
- QueryBox aBox( pTabViewShell->GetDialogParent(),
- WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) );
- if (aBox.Execute() == RET_NO)
- bOK = sal_False;
- }
- if (bOK)
- {
- ScSheetSourceDesc aShtDesc;
- aShtDesc.aSourceRange = aRange;
- pNewDPObject = new ScDPObject( pDoc );
- pNewDPObject->SetSheetDesc( aShtDesc );
-
- // output below source data
- if ( aRange.aEnd.Row()+2 <= MAXROW - 4 )
- aDestPos = ScAddress( aRange.aStart.Col(),
- aRange.aEnd.Row()+2,
- aRange.aStart.Tab() );
- }
- }
- }
- }
- delete pTypeDlg;
-
- if ( pNewDPObject )
- pNewDPObject->SetOutRange( aDestPos );
-
-#if 0
- ScDBData* pDBData = pTabViewShell->GetDBData();
- String aErrMsg;
-
- pDBData->GetArea( nTab, nCol1, nRow1, nCol2, nRow2 );
-
- bAreaOk = sal_True;
- if ( nRow2-nRow1 < 1 )
- {
- // "mindestens eine Datenzeile"
- pTabViewShell->ErrorMessage(STR_PIVOT_INVALID_DBAREA);
- bAreaOk = sal_False;
- }
- else if (!pDBData->HasHeader())
- {
- if ( MessBox( pTabViewShell->GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), // "StarCalc"
- ScGlobal::GetRscString( STR_MSSG_MAKEAUTOFILTER_0 ) // Koepfe aus erster Zeile?
- ).Execute() == RET_YES )
- {
- pDBData->SetHeader( sal_True ); //! Undo ??
- }
- else
- bAreaOk = sal_False;
- }
-#endif
- }
-
- pTabViewShell->SetDialogDPObject( pNewDPObject ); // is copied
- if ( pNewDPObject )
- {
- // start layout dialog
-
- sal_uInt16 nId = ScPivotLayoutWrapper::GetChildWindowId();
- SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
- SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
- }
- delete pNewDPObject;
- }
+ ExecuteDataPilotDialog();
break;
-
case SID_DEFINE_DBNAME:
{
@@ -919,7 +751,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -938,7 +770,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
else
{
- DBG_ERROR("NULL");
+ OSL_FAIL("NULL");
}
}
else
@@ -969,13 +801,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
}
-//CHINA001 ScSelEntryDlg* pDlg =
-//CHINA001 new ScSelEntryDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_SELECTDB,
-//CHINA001 String(ScResId(SCSTR_SELECTDB)),
-//CHINA001 String(ScResId(SCSTR_AREAS)),
-//CHINA001 aList );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScSelEntryDlg* pDlg = pFact->CreateScSelEntryDlg( pTabViewShell->GetDialogParent(),
RID_SCDLG_SELECTDB,
@@ -983,7 +810,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
String(ScResId(SCSTR_AREAS)),
aList,
RID_SCDLG_SELECTDB);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
String aName = pDlg->GetSelectEntry();
@@ -1011,24 +838,23 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
if ( pArgs )
{
- DBG_ERROR("spaeter...");
+ OSL_FAIL("spaeter...");
}
else
{
- //CHINA001 SfxItemSet aArgSet( GetPool(), ScTPValidationValue::GetRanges() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
::GetTabPageRanges ScTPValidationValueGetRanges = pFact->GetTabPageRangesFunc(TP_VALIDATION_VALUES);
- DBG_ASSERT(ScTPValidationValueGetRanges, "TabPage create fail!");//CHINA001
- SfxItemSet aArgSet( GetPool(), (*ScTPValidationValueGetRanges)() );//CHINA001
+ DBG_ASSERT(ScTPValidationValueGetRanges, "TabPage create fail!");
+ SfxItemSet aArgSet( GetPool(), (*ScTPValidationValueGetRanges)() );
ScValidationMode eMode = SC_VALID_ANY;
ScConditionMode eOper = SC_COND_EQUAL;
String aExpr1, aExpr2;
sal_Bool bBlank = sal_True;
sal_Int16 nListType = ValidListType::UNSORTED;
- sal_Bool bShowHelp = sal_False;
+ sal_Bool bShowHelp = false;
String aHelpTitle, aHelpText;
- sal_Bool bShowError = sal_False;
+ sal_Bool bShowError = false;
ScValidErrorStyle eErrStyle = SC_VALERR_STOP;
String aErrTitle, aErrText;
@@ -1078,22 +904,14 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
}
- //CHINA001 ScValidationDlg* pDlg = new ScValidationDlg( NULL, &aArgSet );
- //CHINA001 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- //CHINA001 DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
-
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //SfxAbstractTabDialog* pDlg = pFact->CreateScValidationDlg( NULL, &aArgSet, TAB_DLG_VALIDATION );
+ // cell range picker
SfxAbstractTabDialog* pDlg = pFact->CreateScValidationDlg( NULL, &aArgSet, TAB_DLG_VALIDATION, pTabViewShell );
- //-->Modified by PengYunQuan for Validity Cell Range Picker
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
- //<!--Modified by PengYunQuan for Validity Cell Range Picker
- //if ( pDlg->Execute() == RET_OK )
short nResult = pDlg->Execute();
- pTabViewShell->SetTabNo( nTab );//When picking Cell Range ,other Tab may be switched. Need restore the correct tab
+ //When picking Cell Range, other Tab may be switched. Need restore the correct tab
+ pTabViewShell->SetTabNo( nTab );
if ( nResult == RET_OK )
- //-->Modified by PengYunQuan for Validity Cell Range Picker
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
@@ -1172,11 +990,9 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
pTabViewShell->SetValidation( aData );
rReq.Done( *pOutSet );
}
- //<!-- Modified by PengYunQuan for Validity Cell Range Picker
//after end execute from !IsModalInputMode, it is safer to delay deleting
//delete pDlg;
Application::PostUserEvent( Link( pDlg, &DelayDeleteAbstractDialog ) );
- //--> Modified by PengYunQuan for Validity Cell Range Picker
}
}
break;
@@ -1235,7 +1051,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
}
-void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
+void ScCellShell::GetDBState( SfxItemSet& rSet )
{
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
ScViewData* pData = GetViewData();
@@ -1245,8 +1061,8 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
SCROW nPosY = pData->GetCurY();
SCTAB nTab = pData->GetTabNo();
- sal_Bool bAutoFilter = sal_False;
- sal_Bool bAutoFilterTested = sal_False;
+ sal_Bool bAutoFilter = false;
+ sal_Bool bAutoFilterTested = false;
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich = aIter.FirstWhich();
@@ -1258,8 +1074,8 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
{
// importierte Daten ohne Selektion
// oder Filter,Sortierung,Teilergebis (auch ohne Import)
- sal_Bool bOk = sal_False;
- ScDBData* pDBData = pTabViewShell->GetDBData(sal_False,SC_DB_OLD);
+ sal_Bool bOk = false;
+ ScDBData* pDBData = pTabViewShell->GetDBData(false,SC_DB_OLD);
if (pDBData && pDoc->GetChangeTrack() == NULL)
{
if ( pDBData->HasImportParam() )
@@ -1309,7 +1125,7 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
case SID_REIMPORT_DATA:
{
// nur importierte Daten ohne Selektion
- ScDBData* pDBData = pTabViewShell->GetDBData(sal_False,SC_DB_OLD);
+ ScDBData* pDBData = pTabViewShell->GetDBData(false,SC_DB_OLD);
if (!pDBData || !pDBData->HasImportParam() || pDBData->HasImportSelection() ||
pDoc->GetChangeTrack()!=NULL)
{
@@ -1321,7 +1137,7 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
case SID_VIEW_DATA_SOURCE_BROWSER:
{
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SDATABASE))
- rSet.Put(SfxVisibilityItem(nWhich, sal_False));
+ rSet.Put(SfxVisibilityItem(nWhich, false));
else
// get state (BoolItem) from SfxViewFrame
pTabViewShell->GetViewFrame()->GetSlotState( nWhich, NULL, &rSet );
@@ -1370,7 +1186,7 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
SCCOL nStartCol, nEndCol;
SCROW nStartRow, nEndRow;
SCTAB nStartTab, nEndTab;
- sal_Bool bAnyQuery = sal_False;
+ sal_Bool bAnyQuery = false;
sal_Bool bSelected = (GetViewData()->GetSimpleArea(
nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab )
@@ -1379,7 +1195,7 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
if ( bSelected )
{
if (nStartCol==nEndCol && nStartRow==nEndRow)
- bSelected = sal_False;
+ bSelected = false;
}
else
{
@@ -1430,3 +1246,4 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 7001cd9faff4..06c960a8ac0a 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,8 +50,6 @@
#include "docsh.hxx"
#include "reffact.hxx"
#include "uiitems.hxx"
-//CHINA001 #include "scendlg.hxx"
-//CHINA001 #include "mtrindlg.hxx"
#include "autoform.hxx"
#include "autofmt.hxx"
#include "cellsh.hxx"
@@ -58,7 +57,7 @@
#include "inputhdl.hxx"
#include "editable.hxx"
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
#define IS_EDITMODE() GetViewData()->HasEditView( GetViewData()->GetActivePart() )
@@ -86,7 +85,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
// beim Oeffnen eines Referenz-Dialogs darf die SubShell nicht umgeschaltet werden
// (beim Schliessen des Dialogs wird StopEditShell gerufen)
case SID_OPENDLG_FUNCTION:
- // #53318# inplace macht die EditShell Aerger...
+ // inplace macht die EditShell Aerger...
//! kann nicht immer umgeschaltet werden ????
if (!pTabViewShell->GetViewFrame()->GetFrame().IsInPlace())
pTabViewShell->SetDontSwitch(sal_True); // EditShell nicht abschalten
@@ -102,7 +101,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
pScMod->InputEnterHandler();
pTabViewShell->UpdateInputHandler();
- pTabViewShell->SetDontSwitch(sal_False);
+ pTabViewShell->SetDontSwitch(false);
break;
@@ -198,7 +197,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScInputHandler* pHdl = SC_MOD()->GetInputHdl( pTabViewShell );
if ( !pHdl || !pHdl->IsInEnterHandler() )
{
- // #101061# UpdateInputHandler is needed after the cell content
+ // UpdateInputHandler is needed after the cell content
// has changed, but if called from EnterHandler, UpdateInputHandler
// will be called later when moving the cursor.
@@ -307,7 +306,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
rReq.Ignore();
}
break;
@@ -318,7 +317,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -370,7 +369,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -380,7 +379,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -390,7 +389,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -481,13 +480,11 @@ void ScCellShell::Execute( SfxRequest& rReq )
else
{
sal_Bool bSheetProtected = pDoc->IsTabProtected(nTab);
- //CHINA001 ScNewScenarioDlg* pNewDlg =
- //CHINA001 new ScNewScenarioDlg( pTabViewShell->GetDialogParent(), aName, sal_False, bSheetProtected );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
- AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( pTabViewShell->GetDialogParent(), aName, RID_SCDLG_NEWSCENARIO, sal_False,bSheetProtected);
- DBG_ASSERT(pNewDlg, "Dialog create fail!");//CHINA001
+ AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( pTabViewShell->GetDialogParent(), aName, RID_SCDLG_NEWSCENARIO, false,bSheetProtected);
+ DBG_ASSERT(pNewDlg, "Dialog create fail!");
if ( pNewDlg->Execute() == RET_OK )
{
pNewDlg->GetScenarioData( aName, aComment, aColor, nFlags );
@@ -525,7 +522,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
const SfxUInt16Item& rUInt16Item = (const SfxUInt16Item&)pReqArgs->Get( FID_ROW_HEIGHT );
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
- pTabViewShell->SetMarkedWidthOrHeight( sal_False, SC_SIZE_DIRECT,
+ pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT,
sal::static_int_cast<sal_uInt16>( HMMToTwips(rUInt16Item.GetValue()) ) );
if( ! rReq.IsAPI() )
rReq.Done();
@@ -537,15 +534,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
sal_uInt16 nCurHeight = pData->GetDocument()->
GetRowHeight( pData->GetCurY(),
pData->GetTabNo() );
-//CHINA001 ScMetricInputDlg* pDlg =
-//CHINA001 new ScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_ROW_MAN,
-//CHINA001 nCurHeight,
-//CHINA001 ScGlobal::nStdRowHeight,
-//CHINA001 eMetric,
-//CHINA001 2,
-//CHINA001 MAX_COL_HEIGHT );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScMetricInputDlg* pDlg = pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_ROW_MAN,
nCurHeight,
@@ -554,12 +544,12 @@ void ScCellShell::Execute( SfxRequest& rReq )
eMetric,
2,
MAX_COL_HEIGHT);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
long nVal = pDlg->GetInputValue();
- pTabViewShell->SetMarkedWidthOrHeight( sal_False, SC_SIZE_DIRECT, (sal_uInt16)nVal );
+ pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, (sal_uInt16)nVal );
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
rReq.AppendItem( SfxUInt16Item( FID_ROW_HEIGHT, (sal_uInt16)TwipsToEvenHMM(nVal) ) );
@@ -578,7 +568,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
const SfxUInt16Item& rUInt16Item = (const SfxUInt16Item&)pReqArgs->Get( FID_ROW_OPT_HEIGHT );
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
- pTabViewShell->SetMarkedWidthOrHeight( sal_False, SC_SIZE_OPTIMAL,
+ pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL,
sal::static_int_cast<sal_uInt16>( HMMToTwips(rUInt16Item.GetValue()) ) );
ScGlobal::nLastRowHeightExtra = rUInt16Item.GetValue();
@@ -589,15 +579,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
-//CHINA001 ScMetricInputDlg* pDlg =
-//CHINA001 new ScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_ROW_OPT,
-//CHINA001 ScGlobal::nLastRowHeightExtra,
-//CHINA001 0,
-//CHINA001 eMetric,
-//CHINA001 1,
-//CHINA001 MAX_EXTRA_HEIGHT );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScMetricInputDlg* pDlg = pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_ROW_OPT,
ScGlobal::nLastRowHeightExtra,
@@ -606,12 +589,12 @@ void ScCellShell::Execute( SfxRequest& rReq )
eMetric,
1,
MAX_EXTRA_HEIGHT);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
long nVal = pDlg->GetInputValue();
- pTabViewShell->SetMarkedWidthOrHeight( sal_False, SC_SIZE_OPTIMAL, (sal_uInt16)nVal );
+ pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL, (sal_uInt16)nVal );
ScGlobal::nLastRowHeightExtra = nVal;
// #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
@@ -643,15 +626,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
sal_uInt16 nCurHeight = pData->GetDocument()->
GetColWidth( pData->GetCurX(),
pData->GetTabNo() );
-//CHINA001 ScMetricInputDlg* pDlg =
-//CHINA001 new ScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_COL_MAN,
-//CHINA001 nCurHeight,
-//CHINA001 STD_COL_WIDTH,
-//CHINA001 eMetric,
-//CHINA001 2,
-//CHINA001 MAX_COL_WIDTH );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScMetricInputDlg* pDlg = pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_COL_MAN,
nCurHeight,
@@ -660,7 +636,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
eMetric,
2,
MAX_COL_WIDTH);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
@@ -695,16 +671,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
-//CHINA001 ScMetricInputDlg* pDlg =
-//CHINA001 new ScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_COL_OPT,
-//CHINA001 ScGlobal::nLastColWidthExtra,
-//CHINA001 STD_EXTRA_WIDTH,
-//CHINA001 eMetric,
-//CHINA001 1,
-//CHINA001 MAX_EXTRA_WIDTH );
-
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScMetricInputDlg* pDlg = pFact->CreateScMetricInputDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_COL_OPT,
ScGlobal::nLastColWidthExtra,
@@ -713,7 +681,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
eMetric,
1,
MAX_EXTRA_WIDTH);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
long nVal = pDlg->GetInputValue();
@@ -735,11 +703,11 @@ void ScCellShell::Execute( SfxRequest& rReq )
break;
case FID_ROW_HIDE:
- pTabViewShell->SetMarkedWidthOrHeight( sal_False, SC_SIZE_DIRECT, 0 );
+ pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, 0 );
rReq.Done();
break;
case FID_ROW_SHOW:
- pTabViewShell->SetMarkedWidthOrHeight( sal_False, SC_SIZE_SHOW, 0 );
+ pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_SHOW, 0 );
rReq.Done();
break;
case FID_COL_HIDE:
@@ -769,6 +737,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
// test whether to merge or to split
bool bMerge = false;
+ sal_Bool bCenter = false;
switch( nSlot )
{
case FID_MERGE_ON:
@@ -779,6 +748,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
break;
case FID_MERGE_TOGGLE:
{
+ bCenter = true;
SfxPoolItem* pItem = 0;
if( rBindings.QueryState( nSlot, pItem ) >= SFX_ITEM_DEFAULT )
bMerge = !static_cast< SfxBoolItem* >( pItem )->GetValue();
@@ -789,7 +759,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
if( bMerge )
{
// merge - check if to move contents of covered cells
- sal_Bool bMoveContents = sal_False;
+ sal_Bool bMoveContents = false;
sal_Bool bApi = rReq.IsAPI();
const SfxPoolItem* pItem;
if ( pReqArgs &&
@@ -799,7 +769,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
bMoveContents = ((const SfxBoolItem*)pItem)->GetValue();
}
- if (pTabViewShell->MergeCells( bApi, bMoveContents ))
+ if (pTabViewShell->MergeCells( bApi, bMoveContents, true, bCenter ))
{
if (!bApi && bMoveContents) // "ja" im Dialog geklickt
rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) );
@@ -856,16 +826,11 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
ScGlobal::ClearAutoFormat();
ScAutoFormatData* pNewEntry = pTabViewShell->CreateAutoFormatData();
-//CHINA001 ScAutoFormatDlg* pDlg = new ScAutoFormatDlg(
-//CHINA001 pDlgParent,
-//CHINA001 ScGlobal::GetAutoFormat(),
-//CHINA001 pNewEntry,
-//CHINA001 GetViewData()->GetDocument() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScAutoFormatDlg* pDlg = pFact->CreateScAutoFormatDlg( pDlgParent, ScGlobal::GetAutoFormat(), pNewEntry,GetViewData()->GetDocument(), RID_SCDLG_AUTOFORMAT );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
@@ -906,16 +871,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
// TODO/LATER: when is this code executed?
pTabViewShell->Escape();
- //SfxObjectShell* pObjSh = GetViewData()->GetSfxDocShell();
- //if (pObjSh->GetInPlaceObject() &&
- // pObjSh->GetInPlaceObject()->GetIPClient())
- //{
- // GetViewData()->GetDocShell()->
- // DoInPlaceActivate(sal_False); // OLE beenden
- //}
}
-
-// SetSumAssignMode(); //ScInputWindow
}
break;
@@ -937,14 +893,14 @@ void ScCellShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
// ----------------------------------------------------------------
case FID_INPUTLINE_STATUS:
- DBG_ERROR("Execute von InputLine-Status");
+ OSL_FAIL("Execute von InputLine-Status");
break;
case SID_STATUS_DOCPOS:
@@ -955,12 +911,13 @@ void ScCellShell::Execute( SfxRequest& rReq )
case SID_MARKAREA:
// called from Basic at the hidden view to select a range in the visible view
- DBG_ERROR("old slot SID_MARKAREA");
+ OSL_FAIL("old slot SID_MARKAREA");
break;
default:
- DBG_ERROR("Unbekannter Slot bei ScCellShell::Execute");
+ OSL_FAIL("Unbekannter Slot bei ScCellShell::Execute");
break;
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index 545aba28ff47..d5062793940d 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,6 +50,7 @@
#include "document.hxx"
#include "sc.hrc"
+#include "vcl/svapp.hxx"
//------------------------------------------------------------------
@@ -63,8 +65,8 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq )
const SfxItemSet* pReqArgs = rReq.GetArgs();
sal_uInt16 nSlotId = rReq.GetSlot();
SCsCOLROW nRepeat = 1;
- sal_Bool bSel = sal_False;
- sal_Bool bKeep = sal_False;
+ sal_Bool bSel = false;
+ sal_Bool bKeep = false;
if ( pReqArgs != NULL )
{
@@ -84,11 +86,57 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq )
else if ( nLocked & KEY_MOD1 )
{
// ADD mode: keep the selection, start a new block when marking with shift again
- bKeep = sal_True;
- pTabViewShell->SetNewStartIfMarking();
+ bKeep = true;
}
}
+ if (bSel)
+ {
+ switch (nSlotId)
+ {
+ case SID_CURSORDOWN:
+ rReq.SetSlot(SID_CURSORDOWN_SEL);
+ break;
+ case SID_CURSORUP:
+ rReq.SetSlot(SID_CURSORUP_SEL);
+ break;
+ case SID_CURSORRIGHT:
+ rReq.SetSlot(SID_CURSORRIGHT_SEL);
+ break;
+ case SID_CURSORLEFT:
+ rReq.SetSlot(SID_CURSORLEFT_SEL);
+ break;
+ case SID_CURSORPAGEDOWN:
+ rReq.SetSlot(SID_CURSORPAGEDOWN_SEL);
+ break;
+ case SID_CURSORPAGEUP:
+ rReq.SetSlot(SID_CURSORPAGEUP_SEL);
+ break;
+ case SID_CURSORPAGERIGHT:
+ rReq.SetSlot(SID_CURSORPAGERIGHT_SEL);
+ break;
+ case SID_CURSORPAGELEFT:
+ rReq.SetSlot(SID_CURSORPAGELEFT_SEL);
+ break;
+ case SID_CURSORBLKDOWN:
+ rReq.SetSlot(SID_CURSORBLKDOWN_SEL);
+ break;
+ case SID_CURSORBLKUP:
+ rReq.SetSlot(SID_CURSORBLKUP_SEL);
+ break;
+ case SID_CURSORBLKRIGHT:
+ rReq.SetSlot(SID_CURSORBLKRIGHT_SEL);
+ break;
+ case SID_CURSORBLKLEFT:
+ rReq.SetSlot(SID_CURSORBLKLEFT_SEL);
+ break;
+ default:
+ ;
+ }
+ ExecuteCursorSel(rReq);
+ return;
+ }
+
SCsCOLROW nRTLSign = 1;
if ( pData->GetDocument()->IsLayoutRTL( pData->GetTabNo() ) )
{
@@ -152,7 +200,7 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq )
break;
default:
- DBG_ERROR("Unbekannte Message bei ViewShell (Cursor)");
+ OSL_FAIL("Unbekannte Message bei ViewShell (Cursor)");
return;
}
@@ -169,38 +217,64 @@ void ScCellShell::GetStateCursor( SfxItemSet& /* rSet */ )
void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )
{
- const SfxItemSet* pReqArgs = rReq.GetArgs();
- sal_uInt16 nSlotId = rReq.GetSlot();
- short nRepeat = 1;
-
- if ( pReqArgs != NULL )
+ sal_uInt16 nSlotId = rReq.GetSlot();
+ ScTabViewShell* pViewShell = GetViewData()->GetViewShell();
+ ScInputHandler* pInputHdl = pViewShell->GetInputHandler();
+ pViewShell->HideAllCursors();
+ if (pInputHdl && pInputHdl->IsInputMode())
{
- const SfxPoolItem* pItem;
- if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
- nRepeat = ((const SfxInt16Item*)pItem)->GetValue();
+ // the current cell is in edit mode. Commit the text before moving on.
+ pViewShell->ExecuteInputDirect();
}
- switch ( nSlotId )
+ // Horizontal direction depends on whether or not the UI language is RTL.
+ SCsCOL nMovX = 1;
+ if (GetViewData()->GetDocument()->IsLayoutRTL(GetViewData()->GetTabNo()))
+ // mirror horizontal movement for right-to-left mode.
+ nMovX = -1;
+
+ switch (nSlotId)
{
- case SID_CURSORDOWN_SEL: rReq.SetSlot( SID_CURSORDOWN ); break;
- case SID_CURSORBLKDOWN_SEL: rReq.SetSlot( SID_CURSORBLKDOWN ); break;
- case SID_CURSORUP_SEL: rReq.SetSlot( SID_CURSORUP ); break;
- case SID_CURSORBLKUP_SEL: rReq.SetSlot( SID_CURSORBLKUP ); break;
- case SID_CURSORLEFT_SEL: rReq.SetSlot( SID_CURSORLEFT ); break;
- case SID_CURSORBLKLEFT_SEL: rReq.SetSlot( SID_CURSORBLKLEFT ); break;
- case SID_CURSORRIGHT_SEL: rReq.SetSlot( SID_CURSORRIGHT ); break;
- case SID_CURSORBLKRIGHT_SEL: rReq.SetSlot( SID_CURSORBLKRIGHT ); break;
- case SID_CURSORPAGEDOWN_SEL: rReq.SetSlot( SID_CURSORPAGEDOWN ); break;
- case SID_CURSORPAGEUP_SEL: rReq.SetSlot( SID_CURSORPAGEUP ); break;
- case SID_CURSORPAGERIGHT_SEL: rReq.SetSlot( SID_CURSORPAGERIGHT_ ); break;
- case SID_CURSORPAGELEFT_SEL: rReq.SetSlot( SID_CURSORPAGELEFT_ ); break;
+ case SID_CURSORDOWN_SEL:
+ pViewShell->ExpandBlock(0, 1, SC_FOLLOW_LINE);
+ break;
+ case SID_CURSORUP_SEL:
+ pViewShell->ExpandBlock(0, -1, SC_FOLLOW_LINE);
+ break;
+ case SID_CURSORRIGHT_SEL:
+ pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE);
+ break;
+ case SID_CURSORLEFT_SEL:
+ pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE);
+ break;
+ case SID_CURSORPAGEUP_SEL:
+ pViewShell->ExpandBlockPage(0, -1);
+ break;
+ case SID_CURSORPAGEDOWN_SEL:
+ pViewShell->ExpandBlockPage(0, 1);
+ break;
+ case SID_CURSORPAGERIGHT_SEL:
+ pViewShell->ExpandBlockPage(nMovX, 0);
+ break;
+ case SID_CURSORPAGELEFT_SEL:
+ pViewShell->ExpandBlockPage(-nMovX, 0);
+ break;
+ case SID_CURSORBLKDOWN_SEL:
+ pViewShell->ExpandBlockArea(0, 1);
+ break;
+ case SID_CURSORBLKUP_SEL:
+ pViewShell->ExpandBlockArea(0, -1);
+ break;
+ case SID_CURSORBLKRIGHT_SEL:
+ pViewShell->ExpandBlockArea(nMovX, 0);
+ break;
+ case SID_CURSORBLKLEFT_SEL:
+ pViewShell->ExpandBlockArea(-nMovX, 0);
+ break;
default:
- DBG_ERROR("Unbekannte Message bei ViewShell (CursorSel)");
- return;
+ ;
}
- rReq.AppendItem( SfxInt16Item(FN_PARAM_1, nRepeat ) );
- rReq.AppendItem( SfxBoolItem(FN_PARAM_2, sal_True) );
- ExecuteSlot( rReq, GetInterface() );
+ pViewShell->ShowAllCursors();
}
void ScCellShell::ExecuteMove( SfxRequest& rReq )
@@ -226,7 +300,7 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq )
// weil das ScSbxRange-Objekt bei Eingaben die Markierung veraendert
case SID_NEXT_UNPROTECT:
- pTabViewShell->FindNextUnprot( sal_False, !rReq.IsAPI() );
+ pTabViewShell->FindNextUnprot( false, !rReq.IsAPI() );
break;
case SID_PREV_UNPROTECT:
@@ -235,16 +309,16 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq )
case SID_CURSORENTERUP:
if (rReq.IsAPI())
- pTabViewShell->MoveCursorRel( 0, -1, SC_FOLLOW_LINE, sal_False );
+ pTabViewShell->MoveCursorRel( 0, -1, SC_FOLLOW_LINE, false );
else
pTabViewShell->MoveCursorEnter( sal_True );
break;
case SID_CURSORENTERDOWN:
if (rReq.IsAPI())
- pTabViewShell->MoveCursorRel( 0, 1, SC_FOLLOW_LINE, sal_False );
+ pTabViewShell->MoveCursorRel( 0, 1, SC_FOLLOW_LINE, false );
else
- pTabViewShell->MoveCursorEnter( sal_False );
+ pTabViewShell->MoveCursorEnter( false );
break;
case SID_SELECT_COL:
@@ -288,15 +362,15 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq )
break;
case SID_CURSORTOPOFSCREEN:
- pTabViewShell->MoveCursorScreen( 0, -1, SC_FOLLOW_LINE, sal_False );
+ pTabViewShell->MoveCursorScreen( 0, -1, SC_FOLLOW_LINE, false );
break;
case SID_CURSORENDOFSCREEN:
- pTabViewShell->MoveCursorScreen( 0, 1, SC_FOLLOW_LINE, sal_False );
+ pTabViewShell->MoveCursorScreen( 0, 1, SC_FOLLOW_LINE, false );
break;
default:
- DBG_ERROR("Unbekannte Message bei ViewShell (Cursor)");
+ OSL_FAIL("Unbekannte Message bei ViewShell (Cursor)");
return;
}
@@ -313,7 +387,7 @@ void ScCellShell::ExecutePageSel( SfxRequest& rReq )
case SID_CURSORTOPOFFILE_SEL: rReq.SetSlot( SID_CURSORTOPOFFILE ); break;
case SID_CURSORENDOFFILE_SEL: rReq.SetSlot( SID_CURSORENDOFFILE ); break;
default:
- DBG_ERROR("Unbekannte Message bei ViewShell (ExecutePageSel)");
+ OSL_FAIL("Unbekannte Message bei ViewShell (ExecutePageSel)");
return;
}
rReq.AppendItem( SfxBoolItem(FN_PARAM_2, sal_True) );
@@ -325,8 +399,8 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
const SfxItemSet* pReqArgs = rReq.GetArgs();
sal_uInt16 nSlotId = rReq.GetSlot();
- sal_Bool bSel = sal_False;
- sal_Bool bKeep = sal_False;
+ sal_Bool bSel = false;
+ sal_Bool bKeep = false;
if ( pReqArgs != NULL )
{
@@ -344,8 +418,7 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
else if ( nLocked & KEY_MOD1 )
{
// ADD mode: keep the selection, start a new block when marking with shift again
- bKeep = sal_True;
- pTabViewShell->SetNewStartIfMarking();
+ bKeep = true;
}
}
@@ -369,7 +442,7 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
break;
default:
- DBG_ERROR("Unbekannte Message bei ViewShell (ExecutePage)");
+ OSL_FAIL("Unbekannte Message bei ViewShell (ExecutePage)");
return;
}
@@ -380,3 +453,4 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx
index 13bc1e8eb1f5..0f24a98e2bf4 100644
--- a/sc/source/ui/view/colrowba.cxx
+++ b/sc/source/ui/view/colrowba.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98,8 +99,7 @@ sal_uInt16 ScColBar::GetEntrySize( SCCOLROW nEntryNo )
{
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
- SCCOL nLastCol = -1;
- if (pDoc->ColHidden(static_cast<SCCOL>(nEntryNo), nTab, nLastCol))
+ if (pDoc->ColHidden(static_cast<SCCOL>(nEntryNo), nTab))
return 0;
else
return (sal_uInt16) ScViewData::ToPixel( pDoc->GetColWidth( static_cast<SCCOL>(nEntryNo), nTab ), pViewData->GetPPTX() );
@@ -127,7 +127,6 @@ void ScColBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize )
nSizeTwips = (sal_uInt16) ( nNewSize / pViewData->GetPPTX() );
ScMarkData& rMark = pViewData->GetMarkData();
-// SCTAB nTab = pViewData->GetTabNo();
SCCOLROW* pRanges = new SCCOLROW[MAXCOL+1];
SCCOL nRangeCnt = 0;
@@ -216,8 +215,7 @@ sal_Bool ScColBar::IsDisabled()
sal_Bool ScColBar::ResizeAllowed()
{
- return !pViewData->HasEditView( pViewData->GetActivePart() ) &&
- !pViewData->GetDocShell()->IsReadOnly();
+ return !pViewData->HasEditView( pViewData->GetActivePart() );
}
void ScColBar::DrawInvert( long nDragPosP )
@@ -267,7 +265,7 @@ sal_uInt16 ScRowBar::GetEntrySize( SCCOLROW nEntryNo )
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
SCROW nLastRow = -1;
- if (pDoc->RowHidden(nEntryNo, nTab, nLastRow))
+ if (pDoc->RowHidden(nEntryNo, nTab, NULL, &nLastRow))
return 0;
else
return (sal_uInt16) ScViewData::ToPixel( pDoc->GetOriginalHeight( nEntryNo,
@@ -294,7 +292,6 @@ void ScRowBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize )
nSizeTwips = (sal_uInt16) ( nNewSize / pViewData->GetPPTY() );
ScMarkData& rMark = pViewData->GetMarkData();
-// SCTAB nTab = pViewData->GetTabNo();
SCCOLROW* pRanges = new SCCOLROW[MAXROW+1];
SCROW nRangeCnt = 0;
@@ -328,7 +325,7 @@ void ScRowBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize )
nRangeCnt = 1;
}
- pViewData->GetView()->SetWidthOrHeight( sal_False, nRangeCnt, pRanges, eMode, nSizeTwips );
+ pViewData->GetView()->SetWidthOrHeight( false, nRangeCnt, pRanges, eMode, nSizeTwips );
delete[] pRanges;
}
@@ -337,7 +334,7 @@ void ScRowBar::HideEntries( SCCOLROW nStart, SCCOLROW nEnd )
SCCOLROW nRange[2];
nRange[0] = nStart;
nRange[1] = nEnd;
- pViewData->GetView()->SetWidthOrHeight( sal_False, 1, nRange, SC_SIZE_DIRECT, 0 );
+ pViewData->GetView()->SetWidthOrHeight( false, 1, nRange, SC_SIZE_DIRECT, 0 );
}
void ScRowBar::SetMarking( sal_Bool bSet )
@@ -369,7 +366,7 @@ void ScRowBar::SelectWindow()
}
pViewSh->ActivatePart( eActive );
- pFuncSet->SetColumn( sal_False );
+ pFuncSet->SetColumn( false );
pFuncSet->SetWhich( eActive );
pViewSh->ActiveGrabFocus();
@@ -383,8 +380,7 @@ sal_Bool ScRowBar::IsDisabled()
sal_Bool ScRowBar::ResizeAllowed()
{
- return !pViewData->HasEditView( pViewData->GetActivePart() ) &&
- !pViewData->GetDocShell()->IsReadOnly();
+ return !pViewData->HasEditView( pViewData->GetActivePart() );
}
void ScRowBar::DrawInvert( long nDragPosP )
@@ -417,3 +413,4 @@ sal_Bool ScRowBar::IsMirrored() // overloaded only for rows
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 8db71ad9752f..3607a8dc7a2a 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,11 +58,6 @@ ScDBFunc::ScDBFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewSh
{
}
-//UNUSED2008-05 ScDBFunc::ScDBFunc( Window* pParent, const ScDBFunc& rDBFunc, ScTabViewShell* pViewShell ) :
-//UNUSED2008-05 ScViewFunc( pParent, rDBFunc, pViewShell )
-//UNUSED2008-05 {
-//UNUSED2008-05 }
-
ScDBFunc::~ScDBFunc()
{
}
@@ -93,7 +89,7 @@ void ScDBFunc::GotoDBArea( const String& rDBName )
SetTabNo( nTab );
MoveCursorAbs( nStartCol, nStartRow, ScFollowMode( SC_FOLLOW_JUMP ),
- sal_False, sal_False ); // bShift,bControl
+ false, false ); // bShift,bControl
DoneBlockMode();
InitBlockMode( nStartCol, nStartRow, nTab );
MarkCursor( nEndCol, nEndRow, nTab );
@@ -104,7 +100,7 @@ void ScDBFunc::GotoDBArea( const String& rDBName )
// aktuellen Datenbereich fuer Sortieren / Filtern suchen
-ScDBData* ScDBFunc::GetDBData( sal_Bool bMark, ScGetDBMode eMode, ScGetDBSelection eSel )
+ScDBData* ScDBFunc::GetDBData( sal_Bool bMark, ScGetDBMode eMode, ScGetDBSelection eSel, bool /*bShrinkToData*/, bool bExpandRows )
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScDBData* pData = NULL;
@@ -182,11 +178,20 @@ ScDBData* ScDBFunc::GetDBData( sal_Bool bMark, ScGetDBMode eMode, ScGetDBSelecti
GetViewData()->GetTabNo() ),
eMode, SC_DBSEL_KEEP );
- if ( pData && bMark )
+ if (!pData)
+ return NULL;
+
+ if (bExpandRows)
+ {
+ // Dynamically expand rows to include any new data rows that are
+ // immediately below the original range.
+ GetViewData()->GetDocument()->UpdateDynamicEndRow(*pData);
+ }
+ if (bMark)
{
ScRange aFound;
- pData->GetArea(aFound);
- MarkRange( aFound, sal_False );
+ pData->GetArea(aFound, bExpandRows);
+ MarkRange( aFound, false );
}
return pData;
}
@@ -228,7 +233,7 @@ void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List&
pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
pDoc->SetDBCollection( new ScDBCollection( rNewColl ) );
- pDoc->CompileDBFormula( sal_False ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
pOldColl = NULL;
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID );
aModificator.SetDocumentModified();
@@ -257,7 +262,7 @@ void ScDBFunc::UISort( const ScSortParam& rSortParam, sal_Bool bRecord )
rSortParam.nCol2, rSortParam.nRow2 );
if (!pDBData)
{
- DBG_ERROR( "Sort: keine DBData" );
+ OSL_FAIL( "Sort: keine DBData" );
return;
}
@@ -280,7 +285,7 @@ void ScDBFunc::Sort( const ScSortParam& rSortParam, sal_Bool bRecord, sal_Bool b
ScDocShell* pDocSh = GetViewData()->GetDocShell();
SCTAB nTab = GetViewData()->GetTabNo();
ScDBDocFunc aDBDocFunc( *pDocSh );
- sal_Bool bSuccess = aDBDocFunc.Sort( nTab, rSortParam, bRecord, bPaint, sal_False );
+ sal_Bool bSuccess = aDBDocFunc.Sort( nTab, rSortParam, bRecord, bPaint, false );
if ( bSuccess && !rSortParam.bInplace )
{
// Ziel markieren
@@ -299,7 +304,7 @@ void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource
ScDocShell* pDocSh = GetViewData()->GetDocShell();
SCTAB nTab = GetViewData()->GetTabNo();
ScDBDocFunc aDBDocFunc( *pDocSh );
- sal_Bool bSuccess = aDBDocFunc.Query( nTab, rQueryParam, pAdvSource, bRecord, sal_False );
+ sal_Bool bSuccess = aDBDocFunc.Query( nTab, rQueryParam, pAdvSource, bRecord, false );
if (bSuccess)
{
@@ -338,7 +343,7 @@ void ScDBFunc::ToggleAutoFilter()
ScQueryParam aParam;
ScDocument* pDoc = GetViewData()->GetDocument();
- ScDBData* pDBData = GetDBData( sal_False, SC_DB_MAKE, SC_DBSEL_ROW_DOWN );
+ ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, false, true);
pDBData->SetByRow( sal_True ); //! Undo, vorher abfragen ??
pDBData->GetQueryParam( aParam );
@@ -350,7 +355,7 @@ void ScDBFunc::ToggleAutoFilter()
sal_Int16 nFlag;
sal_Bool bHasAuto = sal_True;
sal_Bool bHeader = pDBData->HasHeader();
- sal_Bool bPaint = sal_False;
+ sal_Bool bPaint = false;
//! stattdessen aus DB-Bereich abfragen?
@@ -360,7 +365,7 @@ void ScDBFunc::ToggleAutoFilter()
GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->GetValue();
if ( (nFlag & SC_MF_AUTO) == 0 )
- bHasAuto = sal_False;
+ bHasAuto = false;
}
if (bHasAuto) // aufheben
@@ -382,15 +387,15 @@ void ScDBFunc::ToggleAutoFilter()
ScRange aRange;
pDBData->GetArea( aRange );
pDocSh->GetUndoManager()->AddUndoAction(
- new ScUndoAutoFilter( pDocSh, aRange, pDBData->GetName(), sal_False ) );
+ new ScUndoAutoFilter( pDocSh, aRange, pDBData->GetName(), false ) );
- pDBData->SetAutoFilter(sal_False);
+ pDBData->SetAutoFilter(false);
// Filter aufheben (incl. Paint / Undo)
SCSIZE nEC = aParam.GetEntryCount();
for (SCSIZE i=0; i<nEC; i++)
- aParam.GetEntry(i).bDoQuery = sal_False;
+ aParam.GetEntry(i).bDoQuery = false;
aParam.bDuplicate = sal_True;
Query( aParam, NULL, sal_True );
@@ -461,7 +466,7 @@ void ScDBFunc::HideAutoFilter()
ScDocument* pDoc = pDocSh->GetDocument();
ScQueryParam aParam;
- ScDBData* pDBData = GetDBData( sal_False );
+ ScDBData* pDBData = GetDBData( false );
SCTAB nTab;
SCCOL nCol1, nCol2;
@@ -478,9 +483,9 @@ void ScDBFunc::HideAutoFilter()
ScRange aRange;
pDBData->GetArea( aRange );
pDocSh->GetUndoManager()->AddUndoAction(
- new ScUndoAutoFilter( pDocSh, aRange, pDBData->GetName(), sal_False ) );
+ new ScUndoAutoFilter( pDocSh, aRange, pDBData->GetName(), false ) );
- pDBData->SetAutoFilter(sal_False);
+ pDBData->SetAutoFilter(false);
pDocSh->PostPaint( nCol1,nRow1,nTab, nCol2,nRow1,nTab, PAINT_GRID );
aModificator.SetDocumentModified();
@@ -500,7 +505,7 @@ sal_Bool ScDBFunc::ImportData( const ScImportParam& rParam, sal_Bool bRecord )
if ( !aTester.IsEditable() )
{
ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
ScDBDocFunc aDBDocFunc( *GetViewData()->GetDocShell() );
@@ -510,3 +515,4 @@ sal_Bool ScDBFunc::ImportData( const ScImportParam& rParam, sal_Bool bRecord )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc2.cxx b/sc/source/ui/view/dbfunc2.cxx
index d3e4229736d3..5753eb1367c2 100644
--- a/sc/source/ui/view/dbfunc2.cxx
+++ b/sc/source/ui/view/dbfunc2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,4 @@ void ScDBFunc::UpdateCharts( sal_Bool bAllCharts )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index bfb3b1de0f82..8e64cc7f7f86 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,8 +79,8 @@
#include "cell.hxx"
#include "userlist.hxx"
-#include <hash_set>
-#include <hash_map>
+#include <boost/unordered_set.hpp>
+#include <boost/unordered_map.hpp>
#include <memory>
#include <list>
#include <vector>
@@ -98,8 +99,6 @@ using ::rtl::OUStringBuffer;
using ::std::auto_ptr;
using ::std::list;
using ::std::vector;
-using ::std::hash_map;
-using ::std::hash_set;
// STATIC DATA -----------------------------------------------------------
@@ -119,7 +118,7 @@ void ScDBFunc::MakeOutline( sal_Bool bColumns, sal_Bool bRecord )
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
- aFunc.MakeOutline( aRange, bColumns, bRecord, sal_False );
+ aFunc.MakeOutline( aRange, bColumns, bRecord, false );
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -134,7 +133,7 @@ void ScDBFunc::RemoveOutline( sal_Bool bColumns, sal_Bool bRecord )
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
- aFunc.RemoveOutline( aRange, bColumns, bRecord, sal_False );
+ aFunc.RemoveOutline( aRange, bColumns, bRecord, false );
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -144,8 +143,8 @@ void ScDBFunc::RemoveOutline( sal_Bool bColumns, sal_Bool bRecord )
void ScDBFunc::TestRemoveOutline( sal_Bool& rCol, sal_Bool& rRow )
{
- sal_Bool bColFound = sal_False;
- sal_Bool bRowFound = sal_False;
+ sal_Bool bColFound = false;
+ sal_Bool bRowFound = false;
SCCOL nStartCol, nEndCol;
SCROW nStartRow, nEndRow;
@@ -207,7 +206,7 @@ void ScDBFunc::RemoveAllOutlines( sal_Bool bRecord )
ScOutlineDocFunc aFunc(*pDocSh);
HideCursor();
- sal_Bool bOk = aFunc.RemoveAllOutlines( nTab, bRecord, sal_False );
+ sal_Bool bOk = aFunc.RemoveAllOutlines( nTab, bRecord, false );
ShowCursor();
if (bOk)
@@ -229,7 +228,7 @@ void ScDBFunc::AutoOutline( sal_Bool bRecord )
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
- aFunc.AutoOutline( aRange, bRecord, sal_False );
+ aFunc.AutoOutline( aRange, bRecord, false );
}
// Outline-Ebene auswaehlen
@@ -241,7 +240,7 @@ void ScDBFunc::SelectLevel( sal_Bool bColumns, sal_uInt16 nLevel, sal_Bool bReco
ScOutlineDocFunc aFunc(*pDocSh);
HideCursor();
- sal_Bool bOk = aFunc.SelectLevel( nTab, bColumns, nLevel, bRecord, bPaint, sal_False );
+ sal_Bool bOk = aFunc.SelectLevel( nTab, bColumns, nLevel, bRecord, bPaint, false );
ShowCursor();
if (bOk)
@@ -257,7 +256,7 @@ void ScDBFunc::ShowOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEn
ScOutlineDocFunc aFunc(*pDocSh);
HideCursor();
- sal_Bool bOk = aFunc.ShowOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint, sal_False );
+ sal_Bool bOk = aFunc.ShowOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint, false );
ShowCursor();
if ( bOk && bPaint )
@@ -273,7 +272,7 @@ void ScDBFunc::HideOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEn
ScOutlineDocFunc aFunc(*pDocSh);
HideCursor();
- sal_Bool bOk = aFunc.HideOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint, sal_False );
+ sal_Bool bOk = aFunc.HideOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint, false );
ShowCursor();
if ( bOk && bPaint )
@@ -284,7 +283,7 @@ void ScDBFunc::HideOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEn
sal_Bool ScDBFunc::OutlinePossible(sal_Bool bHide)
{
- sal_Bool bEnable = sal_False;
+ sal_Bool bEnable = false;
SCCOL nStartCol;
SCROW nStartRow;
@@ -364,7 +363,7 @@ void ScDBFunc::ShowMarkedOutlines( sal_Bool bRecord )
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
HideCursor();
- sal_Bool bDone = aFunc.ShowMarkedOutlines( aRange, bRecord, sal_False );
+ sal_Bool bDone = aFunc.ShowMarkedOutlines( aRange, bRecord, false );
ShowCursor();
if (bDone)
UpdateScrollBars();
@@ -383,7 +382,7 @@ void ScDBFunc::HideMarkedOutlines( sal_Bool bRecord )
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
HideCursor();
- sal_Bool bDone = aFunc.HideMarkedOutlines( aRange, bRecord, sal_False );
+ sal_Bool bDone = aFunc.HideMarkedOutlines( aRange, bRecord, false );
ShowCursor();
if (bDone)
UpdateScrollBars();
@@ -408,13 +407,13 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord,
ScMarkData& rMark = GetViewData()->GetMarkData();
SCTAB nTab = GetViewData()->GetTabNo();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
rParam.nCol2, rParam.nRow2 );
if (!pDBData)
{
- DBG_ERROR( "SubTotals: keine DBData" );
+ OSL_FAIL( "SubTotals: keine DBData" );
return;
}
@@ -433,12 +432,10 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord,
}
WaitObject aWait( GetViewData()->GetDialogParent() );
- sal_Bool bOk = sal_True;
- sal_Bool bDelete = sal_False;
+ sal_Bool bOk = true;
if (rParam.bReplace)
if (pDoc->TestRemoveSubTotals( nTab, rParam ))
{
- bDelete = sal_True;
bOk = ( MessBox( GetViewData()->GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
// "StarCalc" "Daten loeschen?"
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
@@ -455,13 +452,11 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord,
ScOutlineTable* pUndoTab = NULL;
ScRangeName* pUndoRange = NULL;
ScDBCollection* pUndoDB = NULL;
- SCTAB nTabCount = 0; // fuer Referenz-Undo
if (bRecord) // alte Daten sichern
{
sal_Bool bOldFilter = bDo && rParam.bDoSort;
-
- nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = pDoc->GetTableCount();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
@@ -476,30 +471,29 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord,
pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, sal_False, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, bOldFilter );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, bOldFilter );
// Datenbereich sichern - incl. Filter-Ergebnis
pDoc->CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
- IDF_ALL, sal_False, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
- IDF_FORMULA, sal_False, pUndoDoc );
+ IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
ScRangeName* pDocRange = pDoc->GetRangeName();
- if (pDocRange->GetCount())
+ if (!pDocRange->empty())
pUndoRange = new ScRangeName( *pDocRange );
ScDBCollection* pDocDB = pDoc->GetDBCollection();
if (pDocDB->GetCount())
pUndoDB = new ScDBCollection( *pDocDB );
}
-// pDoc->SetOutlineTable( nTab, NULL );
ScOutlineTable* pOut = pDoc->GetOutlineTable( nTab );
if (pOut)
pOut->GetRowArray()->RemoveAll(); // nur Zeilen-Outlines loeschen
@@ -520,7 +514,7 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord,
ScSortParam aOldSort;
pDBData->GetSortParam( aOldSort );
ScSortParam aSortParam( aNewParam, pForceNewSort ? *pForceNewSort : aOldSort );
- Sort( aSortParam, sal_False, sal_False );
+ Sort( aSortParam, false, false );
}
bSuccess = pDoc->DoSubTotals( nTab, aNewParam );
@@ -531,7 +525,6 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord,
if (bRecord)
{
-// ScDBData* pUndoDBData = pDBData ? new ScDBData( *pDBData ) : NULL;
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoSubTotals( pDocSh, nTab,
rParam, aNewParam.nRow2,
@@ -590,7 +583,7 @@ String lcl_MakePivotTabName( const String& rPrefix, SCTAB nNumber )
bool ScDBFunc::MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest, sal_Bool bNewTable,
const ScDPObject& rSource, sal_Bool bApi )
{
- // #70096# error message if no fields are set
+ // error message if no fields are set
// this must be removed when drag&drop of fields from a toolbox is available
if ( rData.IsEmpty() && !bApi )
@@ -657,10 +650,10 @@ bool ScDBFunc::MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest,
else
aObj.SetSaveData( rData );
- sal_Bool bAllowMove = ( pDPObj != NULL ); // allow re-positioning when editing existing table
+ bool bAllowMove = (pDPObj != NULL); // allow re-positioning when editing existing table
ScDBDocFunc aFunc( *pDocSh );
- bool bSuccess = aFunc.DataPilotUpdate( pDPObj, &aObj, sal_True, sal_False, bAllowMove );
+ bool bSuccess = aFunc.DataPilotUpdate( pDPObj, &aObj, sal_True, false, bAllowMove );
CursorPosChanged(); // shells may be switched
@@ -683,50 +676,14 @@ void ScDBFunc::DeletePivotTable()
if ( pDPObj )
{
ScDBDocFunc aFunc( *pDocSh );
- aFunc.DataPilotUpdate( pDPObj, NULL, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, NULL, sal_True, false );
CursorPosChanged(); // shells may be switched
}
else
ErrorMessage(STR_PIVOT_NOTFOUND);
}
-sal_uLong RefreshDPObject( ScDPObject *pDPObj, ScDocument *pDoc, ScDocShell *pDocSh, sal_Bool bRecord, sal_Bool bApi )
-{
- if( !pDPObj )
- return STR_PIVOT_NOTFOUND;
-
- if ( pDocSh && !pDoc )
- pDoc = pDocSh->GetDocument();
-
- if( !pDoc )
- return static_cast<sal_uLong>(-1);
-
- if( !pDocSh && ( pDocSh = PTR_CAST( ScDocShell, pDoc->GetDocumentShell() ) ) == NULL )
- return static_cast<sal_uLong>(-1);
-
- if( sal_uLong nErrId = pDPObj->RefreshCache() )
- return nErrId;
- else if ( nErrId == 0 )
- {
- //Refresh all dpobjects
- ScDPCollection* pDPCollection = pDoc->GetDPCollection();
- sal_uInt16 nCount = pDPCollection->GetCount();
- for (sal_uInt16 i=0; i<nCount; i++)
- {
- if ( (*pDPCollection)[i]->GetCacheId() == pDPObj->GetCacheId() )
- {
- ScDBDocFunc aFunc( * pDocSh );
- if ( !aFunc.DataPilotUpdate( (*pDPCollection)[i], (*pDPCollection)[i], bRecord, bApi ) )
- break;
- }
- }
- return nErrId;
- }
-
- return 0U;
-}
-
-sal_uLong ScDBFunc::RecalcPivotTable()
+void ScDBFunc::RecalcPivotTable()
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScDocument* pDoc = GetViewData()->GetDocument();
@@ -738,26 +695,12 @@ sal_uLong ScDBFunc::RecalcPivotTable()
GetViewData()->GetTabNo() );
if ( pDPObj )
{
- // Wang Xu Ming -- 2009-6-17
- // DataPilot Migration
- //ScDBDocFunc aFunc( *pDocSh );
- //aFunc.DataPilotUpdate( pDPObj, pDPObj, sal_True, sal_False );
- //CursorPosChanged(); // shells may be switched
- sal_uLong nErrId = RefreshDPObject( pDPObj, pDoc, pDocSh, sal_True, sal_False );//pDPObj->RefreshCache();
- if ( nErrId == 0 )
- {
- // There is no undo for the refresh of the cache table, but the undo history for cell changes
- // remains valid and should be preserved, so the history isn't cleared here.
- //GetViewData()->GetDocShell()->GetUndoManager()->Clear();
- }
- else if (nErrId <= USHRT_MAX)
- ErrorMessage(static_cast<sal_uInt16>(nErrId));
- return nErrId;
- // End Comments
+ ScDBDocFunc aFunc( *pDocSh );
+ aFunc.DataPilotUpdate( pDPObj, pDPObj, true, false );
+ CursorPosChanged(); // shells may be switched
}
else
ErrorMessage(STR_PIVOT_NOTFOUND);
- return STR_PIVOT_NOTFOUND;
}
void ScDBFunc::GetSelectedMemberList( ScStrCollection& rEntries, long& rDimension )
@@ -773,12 +716,12 @@ void ScDBFunc::GetSelectedMemberList( ScStrCollection& rEntries, long& rDimensio
ScRangeListRef xRanges;
GetViewData()->GetMultiArea( xRanges ); // incl. cursor if nothing is selected
- sal_uLong nRangeCount = xRanges->Count();
- sal_Bool bContinue = sal_True;
+ size_t nRangeCount = xRanges->size();
+ sal_Bool bContinue = true;
- for (sal_uLong nRangePos=0; nRangePos<nRangeCount && bContinue; nRangePos++)
+ for (size_t nRangePos=0; nRangePos < nRangeCount && bContinue; nRangePos++)
{
- ScRange aRange = *xRanges->GetObject(nRangePos);
+ ScRange aRange = *(*xRanges)[nRangePos];
SCCOL nStartCol = aRange.aStart.Col();
SCROW nStartRow = aRange.aStart.Row();
SCCOL nEndCol = aRange.aEnd.Col();
@@ -791,7 +734,7 @@ void ScDBFunc::GetSelectedMemberList( ScStrCollection& rEntries, long& rDimensio
sheet::DataPilotTableHeaderData aData;
pDPObj->GetHeaderPositionData(ScAddress(nCol, nRow, nTab), aData);
if ( aData.Dimension < 0 )
- bContinue = sal_False; // not part of any dimension
+ bContinue = false; // not part of any dimension
else
{
if ( nStartDimension < 0 ) // first member?
@@ -804,7 +747,7 @@ void ScDBFunc::GetSelectedMemberList( ScStrCollection& rEntries, long& rDimensio
aData.Hierarchy != nStartHierarchy ||
aData.Level != nStartLevel )
{
- bContinue = sal_False; // cannot mix dimensions
+ bContinue = false; // cannot mix dimensions
}
}
if ( bContinue )
@@ -830,7 +773,7 @@ sal_Bool ScDBFunc::HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int
{
// determine if the date group dialog has to be shown for the current selection
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nCurX = GetViewData()->GetCurX();
SCROW nCurY = GetViewData()->GetCurY();
@@ -850,8 +793,8 @@ sal_Bool ScDBFunc::HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int
String aDimName = pDPObj->GetDimName( nSelectDimension, bIsDataLayout );
String aBaseDimName( aDimName );
- sal_Bool bInGroupDim = sal_False;
- sal_Bool bFoundParts = sal_False;
+ sal_Bool bInGroupDim = false;
+ sal_Bool bFoundParts = false;
ScDPDimensionSaveData* pDimData =
const_cast<ScDPDimensionSaveData*>( pDPObj->GetSaveData()->GetExistingDimensionData() );
@@ -943,7 +886,7 @@ sal_Bool ScDBFunc::HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo )
{
// determine if the numeric group dialog has to be shown for the current selection
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
SCCOL nCurX = GetViewData()->GetCurX();
SCROW nCurY = GetViewData()->GetCurY();
@@ -962,7 +905,7 @@ sal_Bool ScDBFunc::HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo )
sal_Bool bIsDataLayout;
String aDimName = pDPObj->GetDimName( nSelectDimension, bIsDataLayout );
- sal_Bool bInGroupDim = sal_False;
+ sal_Bool bInGroupDim = false;
ScDPDimensionSaveData* pDimData =
const_cast<ScDPDimensionSaveData*>( pDPObj->GetSaveData()->GetExistingDimensionData() );
@@ -1061,7 +1004,7 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
if ( pExistingGroup && pExistingGroup->GetGroupDimName() == aGroupDimName )
{
// still get the same group dimension?
- DBG_ERROR("couldn't remove group dimension");
+ OSL_FAIL("couldn't remove group dimension");
pExistingGroup = NULL; // avoid endless loop
}
}
@@ -1128,7 +1071,7 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
ScDPObject* pNewObj = new ScDPObject( *pDPObj );
pNewObj->SetSaveData( aData );
- aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, false );
delete pNewObj;
// unmark cell selection
@@ -1172,7 +1115,7 @@ void ScDBFunc::NumGroupDataPilot( const ScDPNumGroupInfo& rInfo )
ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
ScDPObject* pNewObj = new ScDPObject( *pDPObj );
pNewObj->SetSaveData( aData );
- aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, false );
delete pNewObj;
// unmark cell selection
@@ -1316,7 +1259,7 @@ void ScDBFunc::GroupDataPilot()
ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
ScDPObject* pNewObj = new ScDPObject( *pDPObj );
pNewObj->SetSaveData( aData );
- aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, false );
delete pNewObj;
// unmark cell selection
@@ -1344,7 +1287,7 @@ void ScDBFunc::UngroupDataPilot()
ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); // created if not there
//! test first if DimensionData exists?
- sal_Bool bApply = sal_False;
+ sal_Bool bApply = false;
ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName );
const ScDPSaveNumGroupDimension* pNumGroupDim = pDimData->GetNumGroupDim( aDimName );
@@ -1399,7 +1342,7 @@ void ScDBFunc::UngroupDataPilot()
ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
ScDPObject* pNewObj = new ScDPObject( *pDPObj );
pNewObj->SetSaveData( aData );
- aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, false );
delete pNewObj;
// unmark cell selection
@@ -1478,7 +1421,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString )
pDPObj->BuildAllDimensionMembers();
ScDPSaveData aData( *pDPObj->GetSaveData() );
- sal_Bool bChange = sal_False;
+ sal_Bool bChange = false;
sal_uInt16 nOrient = DataPilotFieldOrientation_HIDDEN;
long nField = pDPObj->GetHeaderDim( rPos, nOrient );
@@ -1543,7 +1486,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString )
{
if (rString.Len())
{
- if (rString.EqualsIgnoreCaseAscii(pDim->GetName()))
+ if (pDim->GetName().equalsIgnoreAsciiCase(rString))
{
pDim->RemoveLayoutName();
bChange = true;
@@ -1689,7 +1632,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString )
// already used.
if (rString.Len())
{
- if (rString.EqualsIgnoreCaseAscii(pMem->GetName()))
+ if (::rtl::OUString(rString).equalsIgnoreAsciiCase(pMem->GetName()))
{
pMem->RemoveLayoutName();
bChange = true;
@@ -1718,7 +1661,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString )
ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
ScDPObject* pNewObj = new ScDPObject( *pDPObj );
pNewObj->SetSaveData( aData );
- aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, false );
delete pNewObj;
}
else
@@ -1788,7 +1731,7 @@ bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16
typedef ScDPSaveDimension::MemberList MemList;
const MemList& rDimMembers = pSaveDim->GetMembers();
list<OUString> aMembers;
- hash_set<OUString, ::rtl::OUStringHash> aMemberSet;
+ boost::unordered_set<OUString, ::rtl::OUStringHash> aMemberSet;
size_t nMemberCount = 0;
for (MemList::const_iterator itr = rDimMembers.begin(), itrEnd = rDimMembers.end();
itr != itrEnd; ++itr)
@@ -1805,7 +1748,7 @@ bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16
// Collect and rank those custom sort strings that also exist in the member name list.
- typedef hash_map<OUString, sal_uInt16, OUStringHash> UserSortMap;
+ typedef boost::unordered_map<OUString, sal_uInt16, OUStringHash> UserSortMap;
UserSortMap aSubStrs;
sal_uInt16 nSubCount = 0;
if (pUserListId)
@@ -1899,7 +1842,7 @@ bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16
sal_Bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScDocument* pDoc = GetViewData()->GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor( rSource.aStart.Col(), rSource.aStart.Row(), rSource.aStart.Tab() );
if ( pDPObj && pDPObj == pDoc->GetDPAtCursor( rDest.Col(), rDest.Row(), rDest.Tab() ) )
@@ -1909,7 +1852,7 @@ sal_Bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest
bool bValid = ( aDestData.Dimension >= 0 ); // dropping onto a field
// look through the source range
- std::hash_set< rtl::OUString, rtl::OUStringHash, std::equal_to<rtl::OUString> > aMembersSet; // for lookup
+ boost::unordered_set< rtl::OUString, rtl::OUStringHash, std::equal_to<rtl::OUString> > aMembersSet; // for lookup
std::vector< rtl::OUString > aMembersVector; // members in original order, for inserting
aMembersVector.reserve( std::max( static_cast<SCSIZE>( rSource.aEnd.Col() - rSource.aStart.Col() + 1 ),
static_cast<SCSIZE>( rSource.aEnd.Row() - rSource.aStart.Row() + 1 ) ) );
@@ -1980,7 +1923,7 @@ sal_Bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest
ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
ScDPObject* pNewObj = new ScDPObject( *pDPObj );
pNewObj->SetSaveData( aData );
- aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, sal_False ); //! bApi for drag&drop?
+ aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, false ); //! bApi for drag&drop?
delete pNewObj;
Unmark(); // entry was moved - no use in leaving the old cell selected
@@ -1995,7 +1938,7 @@ sal_Bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest
sal_Bool ScDBFunc::HasSelectionForDrillDown( sal_uInt16& rOrientation )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
@@ -2094,7 +2037,7 @@ void ScDBFunc::SetDataPilotDetails( sal_Bool bShow, const String* pNewDimensionN
{
String aVisName = aVisibleEntries[nVisPos]->GetString();
ScDPSaveMember* pMember = pDim->GetMemberByName( aVisName );
- pMember->SetShowDetails( sal_False );
+ pMember->SetShowDetails( false );
}
}
@@ -2110,7 +2053,7 @@ void ScDBFunc::SetDataPilotDetails( sal_Bool bShow, const String* pNewDimensionN
ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
ScDPObject* pNewObj = new ScDPObject( *pDPObj );
pNewObj->SetSaveData( aData );
- aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, pNewObj, sal_True, false );
delete pNewObj;
// unmark cell selection
@@ -2172,7 +2115,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
if (!xPropSet.is())
continue;
- Any any = xPropSet->getPropertyValue( rtl::OUString::createFromAscii(SC_UNO_NUMBERFO) );
+ Any any = xPropSet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_NUMBERFO)) );
sal_Int32 nNumFmt = 0;
if (!(any >>= nNumFmt))
continue;
@@ -2211,7 +2154,7 @@ void ScDBFunc::RepeatDB( sal_Bool bRecord )
ScDocument* pDoc = GetViewData()->GetDocument();
ScDBData* pDBData = GetDBData();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = sal_False;
+ bRecord = false;
ScQueryParam aQueryParam;
pDBData->GetQueryParam( aQueryParam );
@@ -2227,7 +2170,7 @@ void ScDBFunc::RepeatDB( sal_Bool bRecord )
if ( bQuery || bSort || bSubTotal )
{
- sal_Bool bQuerySize = sal_False;
+ sal_Bool bQuerySize = false;
ScRange aOldQuery;
ScRange aNewQuery;
if (bQuery && !aQueryParam.bInplace)
@@ -2272,21 +2215,21 @@ void ScDBFunc::RepeatDB( sal_Bool bRecord )
pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, sal_False, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_False, sal_True );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
// Datenbereich sichern - incl. Filter-Ergebnis
- pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
- pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
ScRangeName* pDocRange = pDoc->GetRangeName();
- if (pDocRange->GetCount())
+ if (!pDocRange->empty())
pUndoRange = new ScRangeName( *pDocRange );
ScDBCollection* pDocDB = pDoc->GetDBCollection();
if (pDocDB->GetCount())
@@ -2298,13 +2241,13 @@ void ScDBFunc::RepeatDB( sal_Bool bRecord )
// Sortieren ohne SubTotals
aSubTotalParam.bRemoveOnly = sal_True; // wird unten wieder zurueckgesetzt
- DoSubTotals( aSubTotalParam, sal_False );
+ DoSubTotals( aSubTotalParam, false );
}
if (bSort)
{
pDBData->GetSortParam( aSortParam ); // Bereich kann sich geaendert haben
- Sort( aSortParam, sal_False, sal_False);
+ Sort( aSortParam, false, false);
}
if (bQuery)
{
@@ -2316,10 +2259,10 @@ void ScDBFunc::RepeatDB( sal_Bool bRecord )
aAdvSource.aStart.Col(), aAdvSource.aStart.Row(),
aAdvSource.aEnd.Col(), aAdvSource.aEnd.Row(),
aAdvSource.aStart.Tab(), aQueryParam );
- Query( aQueryParam, &aAdvSource, sal_False );
+ Query( aQueryParam, &aAdvSource, false );
}
else
- Query( aQueryParam, NULL, sal_False );
+ Query( aQueryParam, NULL, false );
// bei nicht-inplace kann die Tabelle umgestellt worden sein
if ( !aQueryParam.bInplace && aQueryParam.nDestTab != nTab )
@@ -2328,8 +2271,8 @@ void ScDBFunc::RepeatDB( sal_Bool bRecord )
if (bSubTotal)
{
pDBData->GetSubTotalParam( aSubTotalParam ); // Bereich kann sich geaendert haben
- aSubTotalParam.bRemoveOnly = sal_False;
- DoSubTotals( aSubTotalParam, sal_False );
+ aSubTotalParam.bRemoveOnly = false;
+ DoSubTotals( aSubTotalParam, false );
}
if (bRecord)
@@ -2370,6 +2313,4 @@ void ScDBFunc::RepeatDB( sal_Bool bRecord )
ErrorMessage(STR_MSSG_REPEATDB_0);
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx
index cb2c049f3200..f395cb741221 100644
--- a/sc/source/ui/view/dbfunc4.cxx
+++ b/sc/source/ui/view/dbfunc4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,6 @@ using namespace com::sun::star;
//==================================================================
-// static
sal_uInt16 ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts )
{
ScDrawLayer* pModel = pDoc->GetDrawLayer();
@@ -78,8 +78,8 @@ sal_uInt16 ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sa
if ( !bAllCharts )
{
ScRangeList aRanges;
- sal_Bool bColHeaders = sal_False;
- sal_Bool bRowHeaders = sal_False;
+ sal_Bool bColHeaders = false;
+ sal_Bool bRowHeaders = false;
pDoc->GetOldChartParameters( aName, aRanges, bColHeaders, bRowHeaders );
bHit = aRanges.In( rPos );
}
@@ -100,3 +100,4 @@ sal_uInt16 ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sa
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawattr.cxx b/sc/source/ui/view/drawattr.cxx
index 4f79673bcc91..7067b0d711eb 100644
--- a/sc/source/ui/view/drawattr.cxx
+++ b/sc/source/ui/view/drawattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,14 +35,14 @@
//------------------------------------------------------------------------
-String __EXPORT SvxDrawToolItem::GetValueText() const
+String SvxDrawToolItem::GetValueText() const
{
return GetValueText(GetValue());
}
//------------------------------------------------------------------------
-String __EXPORT SvxDrawToolItem::GetValueText( sal_uInt16 nVal ) const
+String SvxDrawToolItem::GetValueText( sal_uInt16 nVal ) const
{
const sal_Char* p;
@@ -64,14 +65,14 @@ String __EXPORT SvxDrawToolItem::GetValueText( sal_uInt16 nVal ) const
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT SvxDrawToolItem::Clone( SfxItemPool * ) const
+SfxPoolItem* SvxDrawToolItem::Clone( SfxItemPool * ) const
{
return new SvxDrawToolItem(*this);
}
//------------------------------------------------------------------------
-SfxPoolItem* __EXPORT SvxDrawToolItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
+SfxPoolItem* SvxDrawToolItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
{
sal_uInt16 nVal;
rStream >> nVal;
@@ -80,3 +81,4 @@ SfxPoolItem* __EXPORT SvxDrawToolItem::Create( SvStream& rStream, sal_uInt16 nVe
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index a5a4a7ee1c1d..54b4ef95dd83 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,3 +115,4 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawvie2.cxx b/sc/source/ui/view/drawvie2.cxx
index c760ce86a3d7..c047fcdbd6fe 100644
--- a/sc/source/ui/view/drawvie2.cxx
+++ b/sc/source/ui/view/drawvie2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,4 @@ void ScDrawView::VCRemoveWin( Window* /* pWin */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index 670782f5af9c..400384a38712 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,8 +61,7 @@ ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData ) :
nTab( pData->GetTabNo() ),
pDropMarker( NULL ),
pDropMarkObj( NULL ),
- bInConstruct( sal_True )
- //HMHbDisableHdl( sal_False )
+ bInConstruct( true )
{
// #i73602# Use default from the configuration
SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_Calc());
@@ -74,7 +74,7 @@ ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData ) :
// Verankerung setzen
-void ScDrawView::SetAnchor( ScAnchorType eType )
+void ScDrawView::SetPageAnchored()
{
SdrObject* pObj = NULL;
if( AreObjectsMarked() )
@@ -84,7 +84,7 @@ void ScDrawView::SetAnchor( ScAnchorType eType )
for( sal_uLong i=0; i<nCount; i++ )
{
pObj = pMark->GetMark(i)->GetMarkedSdrObj();
- ScDrawLayer::SetAnchor( pObj, eType );
+ ScDrawLayer::SetPageAnchored( *pObj );
}
if ( pViewData )
@@ -92,10 +92,31 @@ void ScDrawView::SetAnchor( ScAnchorType eType )
}
}
-ScAnchorType ScDrawView::GetAnchor() const
+void ScDrawView::SetCellAnchored()
{
- sal_Bool bPage = sal_False;
- sal_Bool bCell = sal_False;
+ if (!pDoc)
+ return;
+
+ SdrObject* pObj = NULL;
+ if( AreObjectsMarked() )
+ {
+ const SdrMarkList* pMark = &GetMarkedObjectList();
+ sal_uLong nCount = pMark->GetMarkCount();
+ for( sal_uLong i=0; i<nCount; i++ )
+ {
+ pObj = pMark->GetMark(i)->GetMarkedSdrObj();
+ ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, nTab);
+ }
+
+ if ( pViewData )
+ pViewData->GetDocShell()->SetDrawModified();
+ }
+}
+
+ScAnchorType ScDrawView::GetAnchorType() const
+{
+ sal_Bool bPage = false;
+ sal_Bool bCell = false;
const SdrObject* pObj = NULL;
if( AreObjectsMarked() )
{
@@ -105,8 +126,8 @@ ScAnchorType ScDrawView::GetAnchor() const
for( sal_uLong i=0; i<nCount; i++ )
{
pObj = pMark->GetMark(i)->GetMarkedSdrObj();
- if( ScDrawLayer::GetAnchor( pObj ) == SCA_CELL )
- bCell =sal_True;
+ if( ScDrawLayer::GetAnchorType( *pObj ) == SCA_CELL )
+ bCell =true;
else
bPage = sal_True;
}
@@ -118,7 +139,7 @@ ScAnchorType ScDrawView::GetAnchor() const
return SCA_DONTKNOW;
}
-void __EXPORT ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+void ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if (rHint.ISA(ScTabDeletedHint)) // Tabelle geloescht
{
@@ -135,6 +156,20 @@ void __EXPORT ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if ( nTab == ((ScTabSizeChangedHint&)rHint).GetTab() )
UpdateWorkArea();
}
+ else if ( rHint.ISA( SdrHint ) )
+ {
+ if (const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint ))
+ {
+ //Update the anchors of any non note object that is cell anchored which has
+ //been moved since the last anchors for its position was calculated
+ if (pSdrHint->GetKind() == HINT_OBJCHG || pSdrHint->GetKind() == HINT_OBJINSERTED)
+ if (SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject()))
+ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pObj))
+ if (!pAnchor->mbNote && pAnchor->maLastRect != pObj->GetLogicRect())
+ ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, nTab);
+ }
+ FmFormView::Notify( rBC,rHint );
+ }
else
FmFormView::Notify( rBC,rHint );
}
@@ -168,15 +203,12 @@ void ScDrawView::UpdateIMap( SdrObject* pObj )
ScIMapDlgSet( aGraphic, pImageMap, &aTargetList, pObj ); // aus imapwrap
// TargetListe kann von uns wieder geloescht werden
- String* pEntry = aTargetList.First();
- while( pEntry )
- {
- delete pEntry;
- pEntry = aTargetList.Next();
- }
+ for ( size_t i = 0, n = aTargetList.size(); i < n; ++i )
+ delete aTargetList[ i ];
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 1c0d38ee18e5..1e6f330a3fd3 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,7 +74,7 @@ Point aDragStartDiff;
void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle )
{
- rAnyOle = rOneOle = sal_False;
+ rAnyOle = rOneOle = false;
sal_uLong nCount = rMarkList.GetMarkCount();
for (sal_uLong i=0; i<nCount; i++)
{
@@ -104,47 +105,9 @@ void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rO
}
}
-#if 0
-void lcl_RefreshChartData( SdrModel* pModel, ScDocument* pSourceDoc )
-{
- sal_uInt16 nPages = pModel->GetPageCount();
- for (SCTAB nTab=0; nTab<nPages; nTab++)
- {
- SdrPage* pPage = pModel->GetPage(nTab);
- SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
- SdrObject* pObject = aIter.Next();
- while (pObject)
- {
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 )
- {
- SvInPlaceObjectRef aIPObj = ((SdrOle2Obj*)pObject)->GetObjRef();
- if ( aIPObj.Is() && SotExchange::IsChart( aIPObj->GetStorage()->GetClassName() ) )
- {
- SchMemChart* pOldData = SchDLL::GetChartData(aIPObj);
- if ( pOldData )
- {
- // create data from source document
- ScChartArray aArray( pSourceDoc, *pOldData );
- if ( aArray.IsValid() )
- {
- SchMemChart* pNewData = aArray.CreateMemChart();
- SchDLL::Update( aIPObj, pNewData );
- delete pNewData;
- ((SdrOle2Obj*)pObject)->GetNewReplacement();
- }
- }
- }
- }
- pObject = aIter.Next();
- }
- }
-}
-#endif
-
-
sal_Bool ScDrawView::BeginDrag( Window* pWindow, const Point& rStartPos )
{
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
if ( AreObjectsMarked() )
{
@@ -270,7 +233,6 @@ uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable()
void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
{
- Point aLogic = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = ScGlobal::nScreenPPTX;
double nPPTY = ScGlobal::nScreenPPTY;
@@ -301,13 +263,13 @@ void ScDrawView::SetMarkedOriginalSize()
{
SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
sal_uInt16 nIdent = pObj->GetObjIdentifier();
- sal_Bool bDo = sal_False;
+ sal_Bool bDo = false;
Size aOriginalSize;
if (nIdent == OBJ_OLE2)
{
// TODO/LEAN: working with visual area can switch object to running state
uno::Reference < embed::XEmbeddedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
- if ( xObj.is() ) // #121612# NULL for an invalid object that couldn't be loaded
+ if ( xObj.is() ) // NULL for an invalid object that couldn't be loaded
{
sal_Int64 nAspect = ((SdrOle2Obj*)pObj)->GetAspect();
@@ -330,7 +292,7 @@ void ScDrawView::SetMarkedOriginalSize()
bDo = sal_True;
} catch( embed::NoVisualAreaSizeException& )
{
- OSL_ENSURE( sal_False, "Can't get the original size of the object!" );
+ OSL_ENSURE( false, "Can't get the original size of the object!" );
}
}
}
@@ -392,3 +354,4 @@ void ScDrawView::SetMarkedOriginalSize()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index cc63f9b97a62..d9a9169d52be 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,12 +83,11 @@ using namespace com::sun::star;
void ScDrawView::Construct()
{
- EnableExtendedKeyInputDispatcher(sal_False);
- EnableExtendedMouseEventDispatcher(sal_False);
- EnableExtendedCommandEventDispatcher(sal_False);
+ EnableExtendedKeyInputDispatcher(false);
+ EnableExtendedMouseEventDispatcher(false);
+ EnableExtendedCommandEventDispatcher(false);
- SetFrameDragSingles(sal_True);
-// SetSolidMarkHdl(sal_True); // einstellbar -> UpdateUserViewOptions
+ SetFrameDragSingles(true);
SetMinMoveDistancePixel( 2 );
SetHitTolerancePixel( 2 );
@@ -113,7 +113,7 @@ void ScDrawView::Construct()
if (pLayer)
{
SetLayerLocked( pLayer->GetName(), bProt );
- SetActiveLayer( pLayer->GetName() ); // FRONT als aktiven Layer setzen
+ SetActiveLayer( pLayer->GetName() ); // set active layer to FRONT
}
pLayer = rAdmin.GetLayerPerID(SC_LAYER_CONTROLS);
if (pLayer)
@@ -122,7 +122,7 @@ void ScDrawView::Construct()
if (pLayer)
{
SetLayerLocked( pLayer->GetName(), bProt );
- SetLayerVisible( pLayer->GetName(), sal_False);
+ SetLayerVisible( pLayer->GetName(), false);
}
SetSwapAsynchron(sal_True);
@@ -136,7 +136,7 @@ void ScDrawView::Construct()
RecalcScale();
UpdateWorkArea();
- bInConstruct = sal_False;
+ bInConstruct = false;
}
void ScDrawView::ImplClearCalcDropMarker()
@@ -148,53 +148,22 @@ void ScDrawView::ImplClearCalcDropMarker()
}
}
-__EXPORT ScDrawView::~ScDrawView()
+ScDrawView::~ScDrawView()
{
ImplClearCalcDropMarker();
}
void ScDrawView::AddCustomHdl()
{
- sal_Bool bNegativePage = pDoc->IsNegativePage( nTab );
-
const SdrMarkList &rMrkList = GetMarkedObjectList();
sal_uInt32 nCount = rMrkList.GetMarkCount();
for(sal_uInt32 nPos=0; nPos<nCount; nPos++ )
{
- const SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj();
- if(ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+ SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj();
+ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab))
{
- const sal_Int32 nDelta = 1;
-
- Rectangle aBoundRect = pObj->GetCurrentBoundRect();
- Point aPos;
- if (bNegativePage)
- {
- aPos = aBoundRect.TopRight();
- aPos.X() = -aPos.X(); // so the loop below is the same
- }
- else
- aPos = aBoundRect.TopLeft();
- long nPosX = (long) (aPos.X() / HMM_PER_TWIPS) + nDelta;
- long nPosY = (long) (aPos.Y() / HMM_PER_TWIPS) + nDelta;
-
- SCCOL nCol;
- sal_Int32 nWidth = 0;
-
- for(nCol=0; nCol<=MAXCOL && nWidth<=nPosX; nCol++)
- nWidth += pDoc->GetColWidth(nCol,nTab);
-
- if(nCol > 0)
- --nCol;
-
- SCROW nRow = nPosY <= 0 ? 0 : pDoc->GetRowForHeight( nTab,
- (sal_uLong) nPosY);
- if(nRow > 0)
- --nRow;
-
- ScTabView* pView = pViewData->GetView();
- ScAddress aScAddress(nCol, nRow, nTab);
- pView->CreateAnchorHandles(aHdl, aScAddress);
+ if (ScTabView* pView = pViewData->GetView())
+ pView->CreateAnchorHandles(aHdl, pAnchor->maStart);
}
}
}
@@ -204,8 +173,8 @@ void ScDrawView::InvalidateAttribs()
if (!pViewData) return;
SfxBindings& rBindings = pViewData->GetBindings();
- // echte Statuswerte:
- rBindings.InvalidateAll( sal_True );
+ // true status values:
+ rBindings.InvalidateAll( true );
}
void ScDrawView::InvalidateDrawTextAttrs()
@@ -247,20 +216,6 @@ void ScDrawView::InvalidateDrawTextAttrs()
rBindings.Invalidate( SID_ALIGN_ANY_JUSTIFIED );
}
-//void ScDrawView::DrawMarks( OutputDevice* pOut ) const
-//{
-// DBG_ASSERT(pOut, "ScDrawView::DrawMarks: No OutputDevice (!)");
-// SdrPaintWindow* pPaintWindow = FindPaintWindow(*pOut);
-//
-// if(pPaintWindow)
-// {
-// if(pPaintWindow->isXorVisible())
-// {
-// ToggleShownXor(pOut, 0L);
-// }
-// }
-//}
-
void ScDrawView::SetMarkedToLayer( sal_uInt8 nLayerNo )
{
if (AreObjectsMarked())
@@ -287,7 +242,7 @@ void ScDrawView::SetMarkedToLayer( sal_uInt8 nLayerNo )
pViewData->GetDocShell()->SetDrawModified();
- // #84073# check mark list now instead of later in a timer
+ // check mark list now instead of later in a timer
CheckMarked();
MarkListHasChanged();
}
@@ -330,7 +285,7 @@ void ScDrawView::UpdateWorkArea()
}
else
{
- DBG_ERROR("Page nicht gefunden");
+ OSL_FAIL("Page nicht gefunden");
}
}
@@ -402,7 +357,7 @@ void ScDrawView::MarkListHasChanged()
{
pViewSh->Unmark(); // remove cell selection
- // #65379# end cell edit mode if drawing objects are selected
+ // end cell edit mode if drawing objects are selected
SC_MOD()->InputEnterHandler();
}
@@ -414,10 +369,8 @@ void ScDrawView::MarkListHasChanged()
ScClient* pClient = (ScClient*) pViewSh->GetIPClient();
if ( pClient && pClient->IsObjectInPlaceActive() && !bUnoRefDialog )
{
- // #41730# beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen
- //HMHbDisableHdl = sal_True;
+ // beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen
pClient->DeactivateObject();
- //HMHbDisableHdl = sal_False;
// Image-Ole wieder durch Grafik ersetzen passiert jetzt in ScClient::UIActivate
}
@@ -425,7 +378,6 @@ void ScDrawView::MarkListHasChanged()
SdrOle2Obj* pOle2Obj = NULL;
SdrGrafObj* pGrafObj = NULL;
- SdrMediaObj* pMediaObj = NULL;
const SdrMarkList& rMarkList = GetMarkedObjectList();
sal_uLong nMarkCount = rMarkList.GetMarkCount();
@@ -437,7 +389,7 @@ void ScDrawView::MarkListHasChanged()
LockInternalLayer();
}
- sal_Bool bSubShellSet = sal_False;
+ sal_Bool bSubShellSet = false;
if (nMarkCount == 1)
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -458,9 +410,8 @@ void ScDrawView::MarkListHasChanged()
}
else if (pObj->GetObjIdentifier() == OBJ_MEDIA)
{
- pMediaObj = (SdrMediaObj*) pObj;
- pViewSh->SetMediaShell(sal_True);
- bSubShellSet = sal_True;
+ pViewSh->SetMediaShell(true);
+ bSubShellSet = true;
}
else if (pObj->GetObjIdentifier() != OBJ_TEXT // Verhindern, das beim Anlegen
|| !pViewSh->IsDrawTextShell()) // eines TextObjekts auf die
@@ -482,19 +433,19 @@ void ScDrawView::MarkListHasChanged()
sal_uLong nListCount = pLst->GetObjCount();
if ( nListCount == 0 )
{
- // #104156# An empty group (may occur during Undo) is no control or graphics object.
+ // An empty group (may occur during Undo) is no control or graphics object.
// Creating the form shell during undo would lead to problems with the undo manager.
- bOnlyControls = sal_False;
- bOnlyGraf = sal_False;
+ bOnlyControls = false;
+ bOnlyGraf = false;
}
for ( sal_uInt16 j = 0; j < nListCount; ++j )
{
SdrObject *pSubObj = pLst->GetObj( j );
if (!pSubObj->ISA(SdrUnoObj))
- bOnlyControls = sal_False;
+ bOnlyControls = false;
if (pSubObj->GetObjIdentifier() != OBJ_GRAF)
- bOnlyGraf = sal_False;
+ bOnlyGraf = false;
if ( !bOnlyControls && !bOnlyGraf ) break;
}
@@ -502,9 +453,9 @@ void ScDrawView::MarkListHasChanged()
else
{
if (!pObj->ISA(SdrUnoObj))
- bOnlyControls = sal_False;
+ bOnlyControls = false;
if (pObj->GetObjIdentifier() != OBJ_GRAF)
- bOnlyGraf = sal_False;
+ bOnlyGraf = false;
}
if ( !bOnlyControls && !bOnlyGraf ) break;
@@ -536,7 +487,12 @@ void ScDrawView::MarkListHasChanged()
uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef();
DBG_ASSERT( xObj.is(), "SdrOle2Obj ohne ObjRef" );
if (xObj.is())
- aVerbs = xObj->getSupportedVerbs();
+ pViewSh->SetVerbs( xObj->getSupportedVerbs() );
+ else
+ {
+ OSL_FAIL("SdrOle2Obj ohne ObjRef");
+ pViewSh->SetVerbs( 0 );
+ }
}
pViewSh->SetVerbs( aVerbs );
@@ -582,12 +538,12 @@ void ScDrawView::MarkListHasChanged()
}
-void __EXPORT ScDrawView::ModelHasChanged()
+void ScDrawView::ModelHasChanged()
{
SdrObject* pEditObj = GetTextEditObject();
if ( pEditObj && !pEditObj->IsInserted() && pViewData )
{
- // #111700# SdrObjEditView::ModelHasChanged will end text edit in this case,
+ // SdrObjEditView::ModelHasChanged will end text edit in this case,
// so make sure the EditEngine's undo manager is no longer used.
pViewData->GetViewShell()->SetDrawTextUndo(NULL);
SetCreateMode(); // don't leave FuText in a funny state
@@ -596,7 +552,7 @@ void __EXPORT ScDrawView::ModelHasChanged()
FmFormView::ModelHasChanged();
}
-void __EXPORT ScDrawView::UpdateUserViewOptions()
+void ScDrawView::UpdateUserViewOptions()
{
if (pViewData)
{
@@ -613,9 +569,6 @@ void __EXPORT ScDrawView::UpdateUserViewOptions()
SetSnapEnabled( rGrid.GetUseGridSnap() );
SetGridSnap( rGrid.GetUseGridSnap() );
- // Snap from grid options is no longer used
-// SetSnapGrid( Size( rGrid.GetFldSnapX(), rGrid.GetFldSnapY() ) );
-
Fraction aFractX( rGrid.GetFldDrawX(), rGrid.GetFldDivisionX() + 1 );
Fraction aFractY( rGrid.GetFldDrawY(), rGrid.GetFldDivisionY() + 1 );
SetSnapGridWidth( aFractX, aFractY );
@@ -673,7 +626,7 @@ sal_Bool ScDrawView::SelectObject( const String& rName )
pView->ScrollToObject( pFound );
- /* #61585# To select an object on the background layer, the layer has to
+ /* To select an object on the background layer, the layer has to
be unlocked even if exclusive drawing selection mode is not active
(this is reversed in MarkListHasChanged when nothing is selected) */
if ( pFound->GetLayer() == SC_LAYER_BACK &&
@@ -691,24 +644,8 @@ sal_Bool ScDrawView::SelectObject( const String& rName )
return ( pFound != NULL );
}
-//UNUSED2008-05 String ScDrawView::GetSelectedChartName() const
-//UNUSED2008-05 {
-//UNUSED2008-05 // used for modifying a chart's data area - PersistName must always be used
-//UNUSED2008-05 // (as in ScDocument::FindChartData and UpdateChartArea)
-//UNUSED2008-05
-//UNUSED2008-05 const SdrMarkList& rMarkList = GetMarkedObjectList();
-//UNUSED2008-05 if (rMarkList.GetMarkCount() == 1)
-//UNUSED2008-05 {
-//UNUSED2008-05 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-//UNUSED2008-05 if (pObj->GetObjIdentifier() == OBJ_OLE2)
-//UNUSED2008-05 if ( pDoc->IsChart(pObj) )
-//UNUSED2008-05 return static_cast<SdrOle2Obj*>(pObj)->GetPersistName();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 return EMPTY_STRING; // nichts gefunden
-//UNUSED2008-05 }
-
-FASTBOOL ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions)
+
+bool ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions)
{
// Markierung nicht aendern, wenn Ole-Objekt aktiv
// (bei Drop aus Ole-Objekt wuerde sonst mitten im ExecuteDrag deaktiviert!)
@@ -745,7 +682,7 @@ void ScDrawView::LockCalcLayer( SdrLayerID nLayer, bool bLock )
SetLayerLocked( pLockLayer->GetName(), bLock );
}
-void __EXPORT ScDrawView::MakeVisible( const Rectangle& rRect, Window& rWin )
+void ScDrawView::MakeVisible( const Rectangle& rRect, Window& rWin )
{
//! rWin richtig auswerten
//! ggf Zoom aendern
@@ -818,28 +755,4 @@ void ScDrawView::MarkDropObj( SdrObject* pObj )
}
}
-//UNUSED2009-05 void ScDrawView::CaptionTextDirection( sal_uInt16 nSlot )
-//UNUSED2009-05 {
-//UNUSED2009-05 if(nSlot != SID_TEXTDIRECTION_LEFT_TO_RIGHT && nSlot != SID_TEXTDIRECTION_TOP_TO_BOTTOM)
-//UNUSED2009-05 return;
-//UNUSED2009-05
-//UNUSED2009-05 SdrObject* pObject = GetTextEditObject();
-//UNUSED2009-05 if ( ScDrawLayer::IsNoteCaption( pObject ) )
-//UNUSED2009-05 {
-//UNUSED2009-05 if( SdrCaptionObj* pCaption = dynamic_cast< SdrCaptionObj* >( pObject ) )
-//UNUSED2009-05 {
-//UNUSED2009-05 SfxItemSet aAttr(pCaption->GetMergedItemSet());
-//UNUSED2009-05 aAttr.Put( SvxWritingModeItem(
-//UNUSED2009-05 nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
-//UNUSED2009-05 com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
-//UNUSED2009-05 SDRATTR_TEXTDIRECTION ) );
-//UNUSED2009-05 pCaption->SetMergedItemSet(aAttr);
-//UNUSED2009-05 FuPoor* pPoor = pViewData->GetView()->GetDrawFuncPtr();
-//UNUSED2009-05 if ( pPoor )
-//UNUSED2009-05 {
-//UNUSED2009-05 FuText* pText = static_cast<FuText*>(pPoor);
-//UNUSED2009-05 pText->StopEditMode(sal_True);
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 }
-//UNUSED2009-05 }
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index e07e15267198..515b2fc514a9 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,18 +83,16 @@
#include "viewutil.hxx"
#include "viewdata.hxx"
#include "document.hxx"
-//CHINA001 #include "namepast.hxx"
#include "reffind.hxx"
#include "tabvwsh.hxx"
-//CHINA001 #include "textdlgs.hxx"
#include "editutil.hxx"
#include "globstr.hrc"
#define ScEditShell
#include "scslots.hxx"
-#include "scui_def.hxx" //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include "scui_def.hxx"
+#include "scabstdlg.hxx"
using namespace ::com::sun::star;
@@ -111,7 +110,7 @@ ScEditShell::ScEditShell(EditView* pView, ScViewData* pData) :
pEditView (pView),
pViewData (pData),
pClipEvtLstnr (NULL),
- bPastePossible (sal_False),
+ bPastePossible (false),
bIsInsertMode (sal_True)
{
SetPool( pEditView->GetEditEngine()->GetEmptyItemSet().GetPool() );
@@ -123,9 +122,9 @@ ScEditShell::~ScEditShell()
{
if ( pClipEvtLstnr )
{
- pClipEvtLstnr->AddRemoveListener( pViewData->GetActiveWin(), sal_False );
+ pClipEvtLstnr->AddRemoveListener( pViewData->GetActiveWin(), false );
- // #122057# The listener may just now be waiting for the SolarMutex and call the link
+ // The listener may just now be waiting for the SolarMutex and call the link
// afterwards, in spite of RemoveListener. So the link has to be reset, too.
pClipEvtLstnr->ClearCallbackLink();
@@ -151,13 +150,13 @@ void lcl_RemoveAttribs( EditView& rEditView )
ScEditEngineDefaulter* pEngine = static_cast<ScEditEngineDefaulter*>(rEditView.GetEditEngine());
sal_Bool bOld = pEngine->GetUpdateMode();
- pEngine->SetUpdateMode(sal_False);
+ pEngine->SetUpdateMode(false);
String aName = ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
pEngine->GetUndoManager().EnterListAction( aName, aName );
- rEditView.RemoveAttribs(sal_True);
- pEngine->RepeatDefaults(); // #97226# paragraph attributes from cell formats must be preserved
+ rEditView.RemoveAttribs(true);
+ pEngine->RepeatDefaults(); // paragraph attributes from cell formats must be preserved
pEngine->GetUndoManager().LeaveListAction();
@@ -198,7 +197,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
EditEngine* pEngine = pTableView->GetEditEngine();
pHdl->DataChanging();
- sal_Bool bSetSelIsRef = sal_False;
+ sal_Bool bSetSelIsRef = false;
switch ( nSlot )
{
@@ -224,7 +223,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_THES:
{
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES , sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES , false );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -352,13 +351,13 @@ void ScEditShell::Execute( SfxRequest& rReq )
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
if( pArgs )
- pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), sal_False, &pItem);
+ pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem);
if ( pItem )
{
aString = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
- pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
+ pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
if ( pFontItem )
{
@@ -396,7 +395,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
SfxItemSet aSet( pTableView->GetEmptyItemSet() );
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, GetPool() );
aSetItem.PutItemForScriptType( nSetScript, aNewItem );
- aSet.Put( aSetItem.GetItemSet(), sal_False );
+ aSet.Put( aSetItem.GetItemSet(), false );
// SetAttribs an der View selektiert ein Wort, wenn nichts selektiert ist
pTableView->GetEditEngine()->QuickSetAttribs( aSet, pTableView->GetSelection() );
@@ -421,14 +420,11 @@ void ScEditShell::Execute( SfxRequest& rReq )
case FID_INSERT_NAME:
{
ScDocument* pDoc = pViewData->GetDocument();
- //CHINA001 ScNamePasteDlg* pDlg = new ScNamePasteDlg( pViewData->GetDialogParent(),
- //CHINA001 pDoc->GetRangeName(), sal_False );
- // "Liste" disablen
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
- AbstractScNamePasteDlg* pDlg = pFact->CreateScNamePasteDlg( pViewData->GetDialogParent(), pDoc->GetRangeName(), RID_SCDLG_NAMES_PASTE, sal_False );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ AbstractScNamePasteDlg* pDlg = pFact->CreateScNamePasteDlg( pViewData->GetDialogParent(), pDoc->GetRangeName(), RID_SCDLG_NAMES_PASTE, false );
+ DBG_ASSERT(pDlg, "Dialog create fail!");
short nRet = pDlg->Execute();
// pDlg is needed below
@@ -460,13 +456,12 @@ void ScEditShell::Execute( SfxRequest& rReq )
SfxObjectShell* pObjSh = pViewData->GetSfxDocShell();
- //CHINA001 ScCharDlg* pDlg = new ScCharDlg( pViewData->GetDialogParent(), &aAttrs, pObjSh );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( pViewData->GetDialogParent(), &aAttrs,
pObjSh, RID_SCDLG_CHAR );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
short nRet = pDlg->Execute();
// pDlg is needed below
@@ -489,7 +484,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_TOGGLE_REL:
{
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
if (pEngine->GetParagraphCount() == 1)
{
String aText = pEngine->GetText();
@@ -531,7 +526,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
const String& rTarget = pHyper->GetTargetFrame();
SvxLinkInsertMode eMode = pHyper->GetInsertMode();
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if ( eMode == HLINK_DEFAULT || eMode == HLINK_FIELD )
{
const SvxURLField* pURLField = GetURLField();
@@ -553,7 +548,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
pTableView->InsertField( aURLItem );
pTableView->SetSelection( aSel ); // select inserted field
- // #57254# jetzt doch auch Felder in der Top-View
+ // jetzt doch auch Felder in der Top-View
if ( pTopView )
{
@@ -631,9 +626,9 @@ void lcl_DisableAll( SfxItemSet& rSet ) // disable all slots
}
}
-void __EXPORT ScEditShell::GetState( SfxItemSet& rSet )
+void ScEditShell::GetState( SfxItemSet& rSet )
{
- // #125326# When deactivating the view, edit mode is stopped, but the EditShell is left active
+ // When deactivating the view, edit mode is stopped, but the EditShell is left active
// (a shell can't be removed from within Deactivate). In that state, the EditView isn't inserted
// into the EditEngine, so it can have an invalid selection and must not be used.
if ( !pViewData->HasEditView( pViewData->GetActivePart() ) )
@@ -752,7 +747,7 @@ IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
return 0;
}
-void __EXPORT ScEditShell::GetClipState( SfxItemSet& rSet )
+void ScEditShell::GetClipState( SfxItemSet& rSet )
{
if ( !pClipEvtLstnr )
{
@@ -836,7 +831,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
sal_uInt16 nWhich = rPool.GetWhich( nSlot );
aSetItem.PutItemForScriptType( nScript, pArgs->Get( nWhich ) );
- aSet.Put( aSetItem.GetItemSet(), sal_False );
+ aSet.Put( aSetItem.GetItemSet(), false );
}
}
break;
@@ -860,9 +855,9 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
SfxItemPool& rPool = GetPool();
- sal_Bool bOld = sal_False;
+ sal_Bool bOld = false;
SvxScriptSetItem aOldSetItem( nSlot, rPool );
- aOldSetItem.GetItemSet().Put( pEditView->GetAttribs(), sal_False );
+ aOldSetItem.GetItemSet().Put( pEditView->GetAttribs(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
if ( pCore && ((const SvxWeightItem*)pCore)->GetWeight() > WEIGHT_NORMAL )
bOld = sal_True;
@@ -870,7 +865,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
SvxScriptSetItem aSetItem( nSlot, rPool );
aSetItem.PutItemForScriptType( nScript,
SvxWeightItem( bOld ? WEIGHT_NORMAL : WEIGHT_BOLD, EE_CHAR_WEIGHT ) );
- aSet.Put( aSetItem.GetItemSet(), sal_False );
+ aSet.Put( aSetItem.GetItemSet(), false );
rBindings.Invalidate( nSlot );
}
@@ -883,9 +878,9 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
SfxItemPool& rPool = GetPool();
- sal_Bool bOld = sal_False;
+ sal_Bool bOld = false;
SvxScriptSetItem aOldSetItem( nSlot, rPool );
- aOldSetItem.GetItemSet().Put( pEditView->GetAttribs(), sal_False );
+ aOldSetItem.GetItemSet().Put( pEditView->GetAttribs(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
if ( pCore && ((const SvxPostureItem*)pCore)->GetValue() != ITALIC_NONE )
bOld = sal_True;
@@ -893,7 +888,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
SvxScriptSetItem aSetItem( nSlot, rPool );
aSetItem.PutItemForScriptType( nScript,
SvxPostureItem( bOld ? ITALIC_NONE : ITALIC_NORMAL, EE_CHAR_ITALIC ) );
- aSet.Put( aSetItem.GetItemSet(), sal_False );
+ aSet.Put( aSetItem.GetItemSet(), false );
rBindings.Invalidate( nSlot );
}
@@ -997,7 +992,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
EditEngine* pEngine = pEditView->GetEditEngine();
sal_Bool bOld = pEngine->GetUpdateMode();
- pEngine->SetUpdateMode(sal_False);
+ pEngine->SetUpdateMode(false);
pEditView->SetAttribs( aSet );
@@ -1104,7 +1099,7 @@ String ScEditShell::GetSelectionText( sal_Bool bWholeWord )
void ScEditShell::ExecuteUndo(SfxRequest& rReq)
{
- // #81733# Undo must be handled here because it's called for both EditViews
+ // Undo must be handled here because it's called for both EditViews
ScInputHandler* pHdl = GetMyInputHdl();
DBG_ASSERT(pHdl,"no ScInputHandler");
@@ -1146,7 +1141,7 @@ void ScEditShell::ExecuteUndo(SfxRequest& rReq)
}
break;
}
- pViewData->GetBindings().InvalidateAll(sal_False);
+ pViewData->GetBindings().InvalidateAll(false);
pHdl->DataChanged();
}
@@ -1204,3 +1199,4 @@ void ScEditShell::ExecuteTrans( SfxRequest& rReq )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index ecc6f19d43e5..42a8411f24f0 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,6 +56,7 @@
#include <sfx2/app.hxx>
#include <sfx2/viewfrm.hxx>
+#include <sfx2/bindings.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
#include <svl/whiter.hxx>
@@ -82,6 +84,7 @@
#include <editeng/scripttypeitem.hxx>
#include <svtools/colorcfg.hxx>
#include <editeng/shaditem.hxx>
+#include <editeng/justifyitem.hxx>
#include "formatsh.hxx"
#include "sc.hrc"
@@ -89,7 +92,6 @@
#include "docsh.hxx"
#include "patattr.hxx"
#include "scmod.hxx"
-//CHINA001 #include "styledlg.hxx"
#include "attrdlg.hrc"
#include "stlpool.hxx"
#include "stlsheet.hxx"
@@ -105,7 +107,10 @@
#define FormatForSelection
#include "scslots.hxx"
-#include "scabstdlg.hxx" //CHINA001
+#define Interior
+#include <svx/svxslots.hxx>
+
+#include "scabstdlg.hxx"
namespace {
@@ -174,13 +179,13 @@ ScFormatShell::~ScFormatShell()
//------------------------------------------------------------------
-void __EXPORT ScFormatShell::GetStyleState( SfxItemSet& rSet )
+void ScFormatShell::GetStyleState( SfxItemSet& rSet )
{
ScDocument* pDoc = GetViewData()->GetDocument();
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
SfxStyleSheetBasePool* pStylePool = pDoc->GetStyleSheetPool();
- sal_Bool bProtected = sal_False;
+ sal_Bool bProtected = false;
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB i=0; i<nTabCount; i++)
if (pDoc->IsTabProtected(i)) // ueberhaupt eine Tabelle geschuetzt?
@@ -268,7 +273,7 @@ void __EXPORT ScFormatShell::GetStyleState( SfxItemSet& rSet )
//------------------------------------------------------------------
-void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
+void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
// Wenn ToolBar vertikal :
if ( !rReq.GetArgs() )
@@ -302,9 +307,9 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SfxStyleSheetBasePool* pStylePool = pDoc->GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = NULL;
- sal_Bool bStyleToMarked = sal_False;
- sal_Bool bListAction = sal_False;
- sal_Bool bAddUndo = sal_False; // add ScUndoModifyStyle (style modified)
+ sal_Bool bStyleToMarked = false;
+ sal_Bool bListAction = false;
+ sal_Bool bAddUndo = false; // add ScUndoModifyStyle (style modified)
ScStyleSaveData aOldData; // for undo/redo
ScStyleSaveData aNewData;
@@ -325,8 +330,6 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
String aStyleName;
sal_uInt16 nRetMask = 0xffff;
-// #96983# only stylist sends focus to sheet
-// sal_Bool bGrabFocus = ( SID_STYLE_APPLY == nSlotId );
pStylePool->SetSearchMask( eFamily, SFXSTYLEBIT_ALL );
@@ -355,8 +358,8 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
case SID_STYLE_APPLY:
{
- SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE, sal_False );
- SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE, false );
+ SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME, false );
if ( pFamilyItem && pNameItem )
{
com::sun::star::uno::Reference< com::sun::star::style::XStyleFamiliesSupplier > xModel(pDocSh->GetModel(), com::sun::star::uno::UNO_QUERY);
@@ -368,7 +371,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xInfo;
xStyles->getByName( pNameItem->GetValue() ) >>= xInfo;
::rtl::OUString aUIName;
- xInfo->getPropertyValue( ::rtl::OUString::createFromAscii("DisplayName") ) >>= aUIName;
+ xInfo->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayName")) ) >>= aUIName;
if ( aUIName.getLength() )
rReq.AppendItem( SfxStringItem( SID_STYLE_APPLY, aUIName ) );
}
@@ -425,7 +428,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
}
else
{
- pScMod->SetWaterCan( sal_False );
+ pScMod->SetWaterCan( false );
pTabViewShell->SetActivePointer( Pointer(POINTER_ARROW) );
rReq.Done();
}
@@ -458,7 +461,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
rReq.Done();
}
else
- nRetMask = sal_False;
+ nRetMask = false;
}
break;
@@ -512,7 +515,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
bListAction = sal_True;
}
- sal_Bool bConvertBack = sal_False;
+ sal_Bool bConvertBack = false;
SfxStyleSheet* pSheetInUse = (SfxStyleSheet*)
pTabViewShell->GetStyleSheetFromMarked();
@@ -706,13 +709,10 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SvxNumberInfoItem* pNumberInfoItem = NULL;
SfxStyleFamily eFam = pStyleSheet->GetFamily();
- // ScDocument* pDoc = GetViewData()->GetDocument();
- // ScDocShell* pDocSh = GetViewData()->GetDocShell();
- //CHINA001 ScStyleDlg* pDlg = NULL;
- SfxAbstractTabDialog* pDlg = NULL; //CHINA001
+ SfxAbstractTabDialog* pDlg = NULL;
sal_uInt16 nRsc = 0;
- // #37034#/#37245# alte Items aus der Vorlage merken
+ // alte Items aus der Vorlage merken
SfxItemSet aOldSet = pStyleSheet->GetItemSet();
String aOldName = pStyleSheet->GetName();
@@ -729,7 +729,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( rSet.GetItemState( ATTR_VALUE_FORMAT,
- sal_False, &pItem ) == SFX_ITEM_SET )
+ false, &pItem ) == SFX_ITEM_SET )
{
// NumberFormat Value aus Value und Language
// erzeugen und eintueten
@@ -758,12 +758,12 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// (wenn gar kein Item da ist, loescht der Dialog auch das
// BORDER_OUTER SvxBoxItem aus dem Vorlagen-Set)
- if ( rSet.GetItemState( ATTR_BORDER_INNER, sal_False ) != SFX_ITEM_SET )
+ if ( rSet.GetItemState( ATTR_BORDER_INNER, false ) != SFX_ITEM_SET )
{
SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
- aBoxInfoItem.SetTable(sal_False); // keine inneren Linien
+ aBoxInfoItem.SetTable(false); // keine inneren Linien
aBoxInfoItem.SetDist(sal_True);
- aBoxInfoItem.SetMinDist(sal_False);
+ aBoxInfoItem.SetMinDist(false);
rSet.Put( aBoxInfoItem );
}
}
@@ -776,7 +776,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
Window* pParent = Application::GetDefDialogParent();
if ( !pParent || !pParent->IsDialog() )
{
- // #107256# GetDefDialogParent currently doesn't return the window
+ // GetDefDialogParent currently doesn't return the window
// that was set with SetDefDialogParent (but dynamically finds the
// topmost parent of the focus window), so IsDialog above is FALSE
// even if called from the style catalog.
@@ -790,14 +790,13 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
pTabViewShell->SetInFormatDialog(sal_True);
- //CHINA001 pDlg = new ScStyleDlg( pParent, *pStyleSheet, nRsc );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
pDlg = pFact->CreateScStyleDlg( pParent, *pStyleSheet, nRsc, nRsc );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
short nResult = pDlg->Execute();
- pTabViewShell->SetInFormatDialog(sal_False);
+ pTabViewShell->SetInFormatDialog(false);
if ( nResult == RET_OK )
{
@@ -807,13 +806,11 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
nRetMask = pStyleSheet->GetMask();
- // #37034#/#37245# Attribut-Vergleiche (frueher in ModifyStyleSheet)
+ // Attribut-Vergleiche (frueher in ModifyStyleSheet)
// jetzt hier mit den alten Werten (Style ist schon veraendert)
if ( SFX_STYLE_FAMILY_PARA == eFam )
{
-// pDoc->CellStyleChanged( *pStyleSheet, aOldSet );
-
SfxItemSet& rNewSet = pStyleSheet->GetItemSet();
sal_Bool bNumFormatChanged;
if ( ScGlobal::CheckWidthInvalidate(
@@ -823,7 +820,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, sal_False);
+ pDoc->SetStreamValid(nTab, false);
sal_uLong nOldFormat = ((const SfxUInt32Item&)aOldSet.
Get( ATTR_VALUE_FORMAT )).GetValue();
@@ -888,13 +885,8 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
}
}
-// if ( nRetMask != 0xffff )// Irgendein Wert MUSS geliefert werden JN
rReq.SetReturnValue( SfxUInt16Item( nSlotId, nRetMask ) );
-// #96983# only stylist sends focus to sheet
-// if ( bGrabFocus )
-// pTabViewShell->GetActiveWin()->GrabFocus();
-
if ( bAddUndo && bUndo)
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoModifyStyle( pDocSh, eFamily, aOldData, aNewData ) );
@@ -912,7 +904,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
}
else
{
- DBG_ERROR( "Unknown slot (ScViewShell::ExecuteStyle)" );
+ OSL_FAIL( "Unknown slot (ScViewShell::ExecuteStyle)" );
}
}
@@ -922,6 +914,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
const SfxItemSet* pReqArgs = rReq.GetArgs();
sal_uInt16 nSlot = rReq.GetSlot();
+ SfxBindings& rBindings = pTabViewShell->GetViewFrame()->GetBindings();
pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox
@@ -954,6 +947,8 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
}
}
+ short nType = GetCurrentNumberFormatType();
+ SfxItemSet aSet( GetPool(), nSlot, nSlot );
switch ( nSlot )
{
case SID_NUMBER_TWODEC:
@@ -961,23 +956,48 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
rReq.Done();
break;
case SID_NUMBER_SCIENTIFIC:
- pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
+ if ((nType & NUMBERFORMAT_SCIENTIFIC))
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
+ else
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
+ aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_SCIENTIFIC)) );
+ rBindings.Invalidate( nSlot );
rReq.Done();
break;
case SID_NUMBER_DATE:
- pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
+ if ((nType & NUMBERFORMAT_DATE))
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
+ else
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
+ aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_DATE)) );
+ rBindings.Invalidate( nSlot );
rReq.Done();
break;
case SID_NUMBER_TIME:
- pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
+ if ((nType & NUMBERFORMAT_TIME))
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
+ else
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
+ aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_TIME)) );
+ rBindings.Invalidate( nSlot );
rReq.Done();
break;
case SID_NUMBER_CURRENCY:
- pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
+ if ((nType & NUMBERFORMAT_CURRENCY))
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
+ else
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
+ aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_CURRENCY)) );
+ rBindings.Invalidate( nSlot );
rReq.Done();
break;
case SID_NUMBER_PERCENT:
- pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
+ if ((nType & NUMBERFORMAT_PERCENT))
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER );
+ else
+ pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
+ aSet.Put( SfxBoolItem(nSlot, !(nType & NUMBERFORMAT_PERCENT)) );
+ rBindings.Invalidate( nSlot );
rReq.Done();
break;
case SID_NUMBER_STANDARD:
@@ -989,7 +1009,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
rReq.Done();
break;
case SID_NUMBER_DECDEC:
- pTabViewShell->ChangeNumFmtDecimals( sal_False );
+ pTabViewShell->ChangeNumFmtDecimals( false );
rReq.Done();
break;
@@ -1025,7 +1045,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
break;
default:
- DBG_ERROR("falscher Slot bei ExecuteEdit");
+ OSL_FAIL("falscher Slot bei ExecuteEdit");
break;
}
}
@@ -1107,7 +1127,7 @@ void ScFormatShell::ExecuteAlignment( SfxRequest& rReq )
pTabViewShell->ApplyAttr( SvxVerJustifyItem( (SvxCellVerJustify)((const SvxVerJustifyItem*)pItem)->GetValue(), ATTR_VER_JUSTIFY ) );
break;
default:
- DBG_ERROR( "ExecuteAlignment: invalid slot" );
+ OSL_FAIL( "ExecuteAlignment: invalid slot" );
return;
}
}
@@ -1177,7 +1197,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
FontWeight eWeight = WEIGHT_BOLD;
SvxScriptSetItem aOldSetItem( nSlot, rPool );
- aOldSetItem.GetItemSet().Put( pAttrs->GetItemSet(), sal_False );
+ aOldSetItem.GetItemSet().Put( pAttrs->GetItemSet(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
if ( pCore && ((const SvxWeightItem*)pCore)->GetWeight() == WEIGHT_BOLD )
eWeight = WEIGHT_NORMAL;
@@ -1185,7 +1205,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
aSetItem.PutItemForScriptType( nScript, SvxWeightItem( eWeight, ATTR_FONT_WEIGHT ) );
}
pTabViewShell->ApplyUserItemSet( aSetItem.GetItemSet() );
- pNewSet->Put( aSetItem.GetItemSet(), sal_False );
+ pNewSet->Put( aSetItem.GetItemSet(), false );
}
break;
@@ -1204,7 +1224,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
FontItalic eItalic = ITALIC_NORMAL;
SvxScriptSetItem aOldSetItem( nSlot, rPool );
- aOldSetItem.GetItemSet().Put( pAttrs->GetItemSet(), sal_False );
+ aOldSetItem.GetItemSet().Put( pAttrs->GetItemSet(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
if ( pCore && ((const SvxPostureItem*)pCore)->GetPosture() == ITALIC_NORMAL )
eItalic = ITALIC_NONE;
@@ -1212,7 +1232,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
aSetItem.PutItemForScriptType( nScript, SvxPostureItem( eItalic, ATTR_FONT_POSTURE ) );
}
pTabViewShell->ApplyUserItemSet( aSetItem.GetItemSet() );
- pNewSet->Put( aSetItem.GetItemSet(), sal_False );
+ pNewSet->Put( aSetItem.GetItemSet(), false );
}
break;
@@ -1311,7 +1331,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SVX_HOR_JUSTIFY_LEFT : SVX_HOR_JUSTIFY_STANDARD, SID_H_ALIGNCELL ) );
ExecuteSlot( rReq, GetInterface() );
return;
-// APPLY_HOR_JUSTIFY( SVX_HOR_JUSTIFY_LEFT );
//break;
case SID_ALIGNRIGHT:
@@ -1321,7 +1340,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_STANDARD, SID_H_ALIGNCELL ) );
ExecuteSlot( rReq, GetInterface() );
return;
-// APPLY_HOR_JUSTIFY( SVX_HOR_JUSTIFY_RIGHT );
//break;
case SID_ALIGNCENTERHOR:
@@ -1331,7 +1349,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SVX_HOR_JUSTIFY_CENTER : SVX_HOR_JUSTIFY_STANDARD, SID_H_ALIGNCELL ) );
ExecuteSlot( rReq, GetInterface() );
return;
-// APPLY_HOR_JUSTIFY( SVX_HOR_JUSTIFY_CENTER );
//break;
case SID_ALIGNBLOCK:
@@ -1341,7 +1358,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SVX_HOR_JUSTIFY_BLOCK : SVX_HOR_JUSTIFY_STANDARD, SID_H_ALIGNCELL ) );
ExecuteSlot( rReq, GetInterface() );
return;
-// APPLY_HOR_JUSTIFY( SVX_HOR_JUSTIFY_BLOCK );
//break;
case SID_ALIGNTOP:
@@ -1351,7 +1367,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SVX_VER_JUSTIFY_TOP : SVX_VER_JUSTIFY_STANDARD, SID_V_ALIGNCELL ) );
ExecuteSlot( rReq, GetInterface() );
return;
-// APPLY_VER_JUSTIFY( SVX_VER_JUSTIFY_TOP );
//break;
case SID_ALIGNBOTTOM:
@@ -1361,7 +1376,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SVX_VER_JUSTIFY_BOTTOM : SVX_VER_JUSTIFY_STANDARD, SID_V_ALIGNCELL ) );
ExecuteSlot( rReq, GetInterface() );
return;
-// APPLY_VER_JUSTIFY( SVX_VER_JUSTIFY_BOTTOM );
//break;
case SID_ALIGNCENTERVER:
@@ -1371,7 +1385,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SVX_VER_JUSTIFY_CENTER : SVX_VER_JUSTIFY_STANDARD, SID_V_ALIGNCELL ) );
ExecuteSlot( rReq, GetInterface() );
return;
-// APPLY_VER_JUSTIFY( SVX_VER_JUSTIFY_CENTER );
//break;
default:
@@ -1381,7 +1394,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
}
rBindings.Update();
-// rReq.Done();
if( pNewSet )
{
@@ -1505,13 +1517,14 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
pDefLine->SetOutWidth( pLine->GetOutWidth() );
pDefLine->SetInWidth ( pLine->GetInWidth() );
pDefLine->SetDistance( pLine->GetDistance() );
- pTabViewShell->SetSelectionFrameLines( pDefLine, sal_False );
+ pDefLine->SetStyle( pLine->GetStyle( ) );
+ pTabViewShell->SetSelectionFrameLines( pDefLine, false );
}
else
{
pTabViewShell->SetDefaultFrameLine( pLine );
pTabViewShell->GetDefaultFrameLine()->SetColor( COL_BLACK );
- pTabViewShell->SetSelectionFrameLines( pLine, sal_False );
+ pTabViewShell->SetSelectionFrameLines( pLine, false );
}
}
else
@@ -1519,7 +1532,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
Color aColorBlack( COL_BLACK );
SvxBorderLine aDefLine( &aColorBlack, 20, 0, 0 );
pTabViewShell->SetDefaultFrameLine( &aDefLine );
- pTabViewShell->SetSelectionFrameLines( NULL, sal_False );
+ pTabViewShell->SetSelectionFrameLines( NULL, false );
}
}
break;
@@ -1541,7 +1554,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
{
SvxBorderLine aDefLine( &rColor, 20, 0, 0 );
pTabViewShell->SetDefaultFrameLine( &aDefLine );
- pTabViewShell->SetSelectionFrameLines( &aDefLine, sal_False );
+ pTabViewShell->SetSelectionFrameLines( &aDefLine, false );
}
}
break;
@@ -1572,7 +1585,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
if ( pNewAttrs->GetItemState( ATTR_BORDER, sal_True, &pItem )
== SFX_ITEM_SET )
{
- // #100959# The SvxFrameToolBoxControl toolbox controller uses a default
+ // The SvxFrameToolBoxControl toolbox controller uses a default
// SvxBorderLine (all widths 0) to mark the lines that should be set.
// Macro recording uses a SvxBoxItem with the real values (OutWidth > 0)
// or NULL pointers for no lines.
@@ -1673,7 +1686,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
- rSet.Put( rAttrSet, sal_False );
+ rSet.Put( rAttrSet, false );
// choose font info according to selection script type
sal_uInt8 nScript = 0; // GetSelectionScriptType never returns 0
@@ -1707,13 +1720,6 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
rSet.Put( rBrushItem, GetPool().GetWhich(nWhich) );
}
break;
-/* case SID_ATTR_ALIGN_LINEBREAK:
- {
- const SfxBoolItem& rBreakItem = (const SfxBoolItem&)rAttrSet.Get( ATTR_LINEBREAK );
- rSet.Put( rBreakItem, GetPool().GetWhich(nWhich) );
- }
- break;
-*/
}
nWhich = aIter.NextWhich();
}
@@ -1725,7 +1731,7 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet )
{
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet();
- rSet.Put( rAttrSet, sal_False ); // ItemStates mitkopieren
+ rSet.Put( rAttrSet, false ); // ItemStates mitkopieren
// choose font info according to selection script type
sal_uInt8 nScript = 0; // GetSelectionScriptType never returns 0
@@ -1779,10 +1785,9 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet )
const SvxHorJustifyItem* pHorJustify = NULL;
const SvxVerJustifyItem* pVerJustify = NULL;
- SvxCellHorJustify eHorJustify = SVX_HOR_JUSTIFY_STANDARD;
SvxCellVerJustify eVerJustify = SVX_VER_JUSTIFY_STANDARD;
sal_uInt16 nWhich = 0;
- sal_Bool bJustifyStd = sal_False;
+ sal_Bool bJustifyStd = false;
SfxBoolItem aBoolItem ( 0, sal_True );
eState = rAttrSet.GetItemState( ATTR_HOR_JUSTIFY, sal_True,
@@ -1791,8 +1796,6 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet )
{
case SFX_ITEM_SET:
{
- eHorJustify = SvxCellHorJustify( pHorJustify->GetValue() );
-
switch ( SvxCellHorJustify( pHorJustify->GetValue() ) )
{
case SVX_HOR_JUSTIFY_STANDARD:
@@ -1841,12 +1844,12 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet )
}
else if ( bJustifyStd )
{
- aBoolItem.SetValue( sal_False );
+ aBoolItem.SetValue( false );
aBoolItem.SetWhich( SID_ALIGNLEFT ); rSet.Put( aBoolItem );
aBoolItem.SetWhich( SID_ALIGNRIGHT ); rSet.Put( aBoolItem );
aBoolItem.SetWhich( SID_ALIGNCENTERHOR ); rSet.Put( aBoolItem );
aBoolItem.SetWhich( SID_ALIGNBLOCK ); rSet.Put( aBoolItem );
- bJustifyStd = sal_False;
+ bJustifyStd = false;
}
//------------------------
@@ -1905,7 +1908,7 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet )
}
else if ( bJustifyStd )
{
- aBoolItem.SetValue( sal_False );
+ aBoolItem.SetValue( false );
aBoolItem.SetWhich( SID_ALIGNTOP ); rSet.Put( aBoolItem );
aBoolItem.SetWhich( SID_ALIGNBOTTOM ); rSet.Put( aBoolItem );
aBoolItem.SetWhich( SID_ALIGNCENTERVER ); rSet.Put( aBoolItem );
@@ -1983,9 +1986,8 @@ void ScFormatShell::GetAlignState( SfxItemSet& rSet )
void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
{
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
-
- // ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScDocument* pDoc = pViewData->GetDocument();
+ short nType = GetCurrentNumberFormatType();
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich = aIter.FirstWhich();
@@ -2012,7 +2014,21 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
rSet.Put( SfxStringItem( nWhich, aFormatCode ) );
}
break;
-
+ case SID_NUMBER_SCIENTIFIC:
+ rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_SCIENTIFIC)) );
+ break;
+ case SID_NUMBER_DATE:
+ rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_DATE)) );
+ break;
+ case SID_NUMBER_CURRENCY:
+ rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_CURRENCY)) );
+ break;
+ case SID_NUMBER_PERCENT:
+ rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_PERCENT)) );
+ break;
+ case SID_NUMBER_TIME:
+ rSet.Put( SfxBoolItem(nWhich, (nType & NUMBERFORMAT_TIME)) );
+ break;
}
nWhich = aIter.NextWhich();
}
@@ -2139,7 +2155,7 @@ void ScFormatShell::ExecFormatPaintbrush( SfxRequest& rReq )
}
else
{
- sal_Bool bLock = sal_False;
+ sal_Bool bLock = false;
const SfxItemSet *pArgs = rReq.GetArgs();
if( pArgs && pArgs->Count() >= 1 )
bLock = static_cast<const SfxBoolItem&>(pArgs->Get(SID_FORMATPAINTBRUSH)).GetValue();
@@ -2150,7 +2166,7 @@ void ScFormatShell::ExecFormatPaintbrush( SfxRequest& rReq )
pView->Unmark();
ScDocument* pBrushDoc = new ScDocument( SCDOCMODE_CLIP );
- pView->CopyToClip( pBrushDoc, sal_False, sal_True );
+ pView->CopyToClip( pBrushDoc, false, sal_True );
pView->SetBrushDocument( pBrushDoc, bLock );
}
}
@@ -2163,3 +2179,69 @@ void ScFormatShell::StateFormatPaintbrush( SfxItemSet& rSet )
rSet.Put( SfxBoolItem( SID_FORMATPAINTBRUSH, pViewData->GetView()->HasPaintBrush() ) );
}
+short ScFormatShell::GetCurrentNumberFormatType()
+{
+ short nType = NUMBERFORMAT_ALL;
+ ScDocument* pDoc = GetViewData()->GetDocument();
+ ScMarkData aMark(GetViewData()->GetMarkData());
+ const SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ if (!pFormatter)
+ return nType;
+
+ // TODO: Find out how to get a selected table range in case multiple tables
+ // are selected. Currently we only check for the current active table.
+
+ if ( aMark.IsMarked() || aMark.IsMultiMarked() )
+ {
+ aMark.MarkToMulti();
+ ScRange aRange;
+ aMark.GetMultiMarkArea(aRange);
+
+ const ScMarkArray* pArray = aMark.GetArray();
+ if (!pArray)
+ return nType;
+
+ short nComboType = NUMBERFORMAT_ALL;
+ bool bFirstItem = true;
+ for (SCCOL nCol = aRange.aStart.Col(); nCol <= aRange.aEnd.Col(); ++nCol)
+ {
+ const ScMarkArray& rColArray = pArray[nCol];
+ if (!rColArray.HasMarks())
+ continue;
+
+ SCROW nRow1, nRow2;
+ ScMarkArrayIter aMarkIter(&rColArray);
+ while (aMarkIter.Next(nRow1, nRow2))
+ {
+ ScRange aColRange(nCol, nRow1, aRange.aStart.Tab());
+ aColRange.aEnd.SetRow(nRow2);
+ sal_uInt32 nNumFmt = pDoc->GetNumberFormat(aColRange);
+ const SvNumberformat* pEntry = pFormatter->GetEntry(nNumFmt);
+ if (!pEntry)
+ return 0;
+
+ short nThisType = pEntry->GetType();
+ if (bFirstItem)
+ {
+ bFirstItem = false;
+ nComboType = nThisType;
+ }
+ else if (nComboType != nThisType)
+ // mixed number format type.
+ return NUMBERFORMAT_ALL;
+ }
+ }
+ nType = nComboType;
+ }
+ else
+ {
+ sal_uInt32 nNumFmt;
+ pDoc->GetNumberFormat( pViewData->GetCurX(), pViewData->GetCurY(),
+ pViewData->GetTabNo(), nNumFmt );
+ const SvNumberformat* pEntry = pFormatter->GetEntry( nNumFmt );
+ nType = pEntry ? pEntry->GetType() : 0;
+ }
+ return nType;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/galwrap.cxx b/sc/source/ui/view/galwrap.cxx
index 2be622ced2c8..c781841b52dd 100644
--- a/sc/source/ui/view/galwrap.cxx
+++ b/sc/source/ui/view/galwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ String GalleryGetFullPath()
{
GalleryExplorer* pGal = SVX_GALLERY();
DBG_ASSERT( pGal, "Wo ist die Gallery?" );
-// return pGal->GetPath().GetFull();
+
return pGal->GetURL().GetMainURL(INetURLObject::NO_DECODE);
// URL as stored in GraphicLink must be encoded
}
@@ -77,3 +78,4 @@ String GalleryGetFilterName()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridmerg.cxx b/sc/source/ui/view/gridmerg.cxx
index 6bcc4ad42f30..97821e406c96 100644
--- a/sc/source/ui/view/gridmerg.cxx
+++ b/sc/source/ui/view/gridmerg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@ ScGridMerger::ScGridMerger( OutputDevice* pOutDev, long nOnePixelX, long nOnePix
nOneX( nOnePixelX ),
nOneY( nOnePixelY ),
nCount( 0 ),
- bVertical( sal_False )
+ bVertical( false )
{
// optimize (DrawGrid) only for pixel MapMode,
// to avoid rounding errors
@@ -104,7 +105,7 @@ void ScGridMerger::AddHorLine( long nX1, long nX2, long nY )
if ( bVertical )
{
Flush();
- bVertical = sal_False;
+ bVertical = false;
}
AddLine( nX1, nX2, nY );
}
@@ -172,3 +173,4 @@ void ScGridMerger::Flush()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d350da754433..7e06db06676b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,7 @@
#include <editeng/editview.hxx>
#include <editeng/editstat.hxx>
#include <editeng/flditem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/svdetc.hxx>
#include <editeng/editobj.hxx>
#include <sfx2/dispatch.hxx>
@@ -53,6 +55,7 @@
#include <vcl/hatch.hxx>
#include <sot/formats.hxx>
#include <sot/clsids.hxx>
+#include <sal/macros.h>
#include <svx/svdview.hxx> // fuer Command-Handler (COMMAND_INSERTTEXT)
#include <editeng/outliner.hxx> // fuer Command-Handler (COMMAND_INSERTTEXT)
@@ -121,6 +124,9 @@
#include "tabprotection.hxx"
#include "postit.hxx"
#include "dpcontrol.hxx"
+#include "clipparam.hxx"
+#include "cellsh.hxx"
+#include "overlayobject.hxx"
#include "cellsuno.hxx"
#include "drawview.hxx"
@@ -140,6 +146,8 @@ const sal_uInt8 SC_NESTEDBUTTON_UP = 2;
#define SC_AUTOFILTER_ALL 0
#define SC_AUTOFILTER_TOP10 1
#define SC_AUTOFILTER_CUSTOM 2
+#define SC_AUTOFILTER_EMPTY 3
+#define SC_AUTOFILTER_NOTEMPTY 4
// Modi fuer die FilterListBox
enum ScFilterBoxMode
@@ -217,17 +225,17 @@ ScFilterListBox::ScFilterListBox( Window* pParent, ScGridWindow* pGrid,
pGridWin( pGrid ),
nCol( nNewCol ),
nRow( nNewRow ),
- bButtonDown( sal_False ),
+ bButtonDown( false ),
bInit( sal_True ),
- bCancelled( sal_False ),
- bInSelect( sal_False ),
+ bCancelled( false ),
+ bInSelect( false ),
mbListHasDates(false),
nSel( 0 ),
eMode( eNewMode )
{
}
-__EXPORT ScFilterListBox::~ScFilterListBox()
+ScFilterListBox::~ScFilterListBox()
{
if (IsMouseCaptured())
ReleaseMouse();
@@ -241,10 +249,10 @@ void ScFilterListBox::EndInit()
else
nSel = nPos;
- bInit = sal_False;
+ bInit = false;
}
-void __EXPORT ScFilterListBox::LoseFocus()
+void ScFilterListBox::LoseFocus()
{
#ifndef UNX
Hide();
@@ -279,13 +287,13 @@ long ScFilterListBox::PreNotify( NotifyEvent& rNEvt )
return nDone ? nDone : ListBox::PreNotify( rNEvt );
}
-void __EXPORT ScFilterListBox::Select()
+void ScFilterListBox::Select()
{
ListBox::Select();
SelectHdl();
}
-void __EXPORT ScFilterListBox::SelectHdl()
+void ScFilterListBox::SelectHdl()
{
if ( !IsTravelSelect() && !bInit && !bCancelled )
{
@@ -298,7 +306,7 @@ void __EXPORT ScFilterListBox::SelectHdl()
// #i81298# set bInSelect flag, so the box isn't deleted from modifications within FilterSelect
bInSelect = sal_True;
pGridWin->FilterSelect( nSel );
- bInSelect = sal_False;
+ bInSelect = false;
}
}
}
@@ -341,7 +349,7 @@ sal_Bool lcl_IsEditableMatrix( ScDocument* pDoc, const ScRange& rRange )
if ( !pDoc->IsBlockEditable( rRange.aStart.Tab(), rRange.aStart.Col(),rRange.aStart.Row(),
rRange.aEnd.Col(),rRange.aEnd.Row() ) )
- return sal_False;
+ return false;
ScAddress aPos;
const ScBaseCell* pCell = pDoc->GetCell( rRange.aEnd );
@@ -371,14 +379,14 @@ void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, c
sal_Bool lcl_GetHyperlinkCell(ScDocument* pDoc, SCCOL& rPosX, SCROW& rPosY, SCTAB nTab, ScBaseCell*& rpCell )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
do
{
pDoc->GetCell( rPosX, rPosY, nTab, rpCell );
if ( !rpCell || rpCell->GetCellType() == CELLTYPE_NOTE )
{
if ( rPosX <= 0 )
- return sal_False; // alles leer bis links
+ return false; // alles leer bis links
else
--rPosX; // weitersuchen
}
@@ -388,7 +396,7 @@ sal_Bool lcl_GetHyperlinkCell(ScDocument* pDoc, SCCOL& rPosX, SCROW& rPosY, SCTA
static_cast<ScFormulaCell*>(rpCell)->IsHyperLinkCell())
bFound = sal_True;
else
- return sal_False; // andere Zelle
+ return false; // andere Zelle
}
while ( !bFound );
@@ -403,6 +411,7 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic
DragSourceHelper( this ),
mpOOCursors( NULL ),
mpOOSelection( NULL ),
+ mpOOSelectionBorder( NULL ),
mpOOAutoFill( NULL ),
mpOODragRect( NULL ),
mpOOHeader( NULL ),
@@ -416,27 +425,31 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic
mpDPFieldPopup(NULL),
mpFilterButton(NULL),
nCursorHideCount( 0 ),
- bMarking( sal_False ),
+ bMarking( false ),
nButtonDown( 0 ),
- bEEMouse( sal_False ),
+ bEEMouse( false ),
nMouseStatus( SC_GM_NONE ),
nNestedButtonState( SC_NESTEDBUTTON_NONE ),
- bDPMouse( sal_False ),
- bRFMouse( sal_False ),
+ bDPMouse( false ),
+ bRFMouse( false ),
nPagebreakMouse( SC_PD_NONE ),
- bPagebreakDrawn( sal_False ),
+ bPagebreakDrawn( false ),
nPageScript( 0 ),
- bDragRect( sal_False ),
+ bDragRect( false ),
+ nDragStartX( -1 ),
+ nDragStartY( -1 ),
+ nDragEndX( -1 ),
+ nDragEndY( -1 ),
meDragInsertMode( INS_NONE ),
nCurrentPointer( 0 ),
- bIsInScroll( sal_False ),
- bIsInPaint( sal_False ),
+ bIsInScroll( false ),
+ bIsInPaint( false ),
aComboButton( this ),
aCurMousePos( 0,0 ),
nPaintCount( 0 ),
- bNeedsRepaint( sal_False ),
- bAutoMarkVisible( sal_False ),
- bListValButton( sal_False )
+ bNeedsRepaint( false ),
+ bAutoMarkVisible( false ),
+ bListValButton( false )
{
switch(eWhich)
{
@@ -457,13 +470,12 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic
eVWhich = SC_SPLIT_BOTTOM;
break;
default:
- DBG_ERROR("GridWindow: falsche Position");
+ OSL_FAIL("GridWindow: falsche Position");
}
SetBackground();
SetMapMode(pViewData->GetLogicMode(eWhich));
-// EnableDrop();
EnableChildTransparentMode();
SetDialogControlFlags( WINDOW_DLGCTRL_RETURN | WINDOW_DLGCTRL_WANTFOCUS );
@@ -471,10 +483,10 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic
SetUniqueId( HID_SC_WIN_GRIDWIN );
SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
- EnableRTL( sal_False );
+ EnableRTL( false );
}
-__EXPORT ScGridWindow::~ScGridWindow()
+ScGridWindow::~ScGridWindow()
{
// #114409#
ImpDestroyOverlayObjects();
@@ -484,7 +496,7 @@ __EXPORT ScGridWindow::~ScGridWindow()
delete pNoteMarker;
}
-void __EXPORT ScGridWindow::Resize( const Size& )
+void ScGridWindow::Resize( const Size& )
{
// gar nix
}
@@ -551,14 +563,17 @@ void ScGridWindow::ExecPageFieldSelect( SCCOL nCol, SCROW nRow, sal_Bool bHasSel
ScDPSaveDimension* pDim = aSaveData.GetDimensionByName(aDimName);
if ( bHasSelection )
- pDim->SetCurrentPage( &rStr );
+ {
+ const ::rtl::OUString aName = rStr;
+ pDim->SetCurrentPage( &aName );
+ }
else
pDim->SetCurrentPage( NULL );
ScDPObject aNewObj( *pDPObj );
aNewObj.SetSaveData( aSaveData );
ScDBDocFunc aFunc( *pViewData->GetDocShell() );
- aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, false );
pViewData->GetView()->CursorPosChanged(); // shells may be switched
}
}
@@ -614,7 +629,7 @@ void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow )
TypedScStrCollection aStrings( 128, 128 );
// get list box entries and selection
- sal_Bool bHasCurrentPage = sal_False;
+ sal_Bool bHasCurrentPage = false;
String aCurrentPage;
ScDPObject* pDPObj = pDoc->GetDPAtCursor(nCol, nRow, nTab);
if ( pDPObj && nCol > 0 )
@@ -676,7 +691,7 @@ void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow )
pFilterBox->SetSizePixel( aSize );
pFilterBox->Show(); // Show must be called before SetUpdateMode
- pFilterBox->SetUpdateMode(sal_False);
+ pFilterBox->SetUpdateMode(false);
pFilterFloat->SetOutputSizePixel( aSize );
pFilterFloat->StartPopupMode( aCellRect, FLOATWIN_POPUPMODE_DOWN|FLOATWIN_POPUPMODE_GRABFOCUS);
@@ -783,17 +798,12 @@ void ScGridWindow::DoScenarioMenue( const ScRange& rScenRange )
}
// SetSize spaeter
-/*
- pFilterBox->SetSelectionMode( SINGLE_SELECTION );
- pFilterBox->SetTabs( nFilterBoxTabs, MapUnit( MAP_APPFONT ));
- pFilterBox->SetTabJustify( 1, bLayoutRTL ? AdjustRight : AdjustLeft );
-*/
// ParentSize Abfrage fehlt
Size aSize( nSizeX, nHeight );
pFilterBox->SetSizePixel( aSize );
pFilterBox->Show(); // Show muss vor SetUpdateMode kommen !!!
- pFilterBox->SetUpdateMode(sal_False);
+ pFilterBox->SetUpdateMode(false);
// SetOutputSizePixel/StartPopupMode erst unten, wenn die Groesse feststeht
@@ -847,18 +857,14 @@ void ScGridWindow::DoScenarioMenue( const ScRange& rScenRange )
pFilterBox->SetUpdateMode(sal_True);
pFilterBox->GrabFocus();
- // Select erst nach GrabFocus, damit das Focus-Rechteck richtig landet
-//! SvLBoxEntry* pSelect = NULL;
sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
if (aCurrent.Len())
{
nPos = pFilterBox->GetEntryPos( aCurrent );
-//! pSelect = pFilterBox->GetEntry( nPos );
}
- if (/*!pSelect*/ LISTBOX_ENTRY_NOTFOUND == nPos && pFilterBox->GetEntryCount() > 0 )
+ if (LISTBOX_ENTRY_NOTFOUND == nPos && pFilterBox->GetEntryCount() > 0 )
nPos = 0;
-//! pSelect = pFilterBox->GetEntry(0); // einer sollte immer selektiert sein
- if (/*pSelect*/ LISTBOX_ENTRY_NOTFOUND != nPos )
+ if (LISTBOX_ENTRY_NOTFOUND != nPos )
pFilterBox->SelectEntryPos(nPos);
pFilterBox->EndInit();
@@ -914,13 +920,8 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
}
// SetSize spaeter
-/*
- pFilterBox->SetSelectionMode( SINGLE_SELECTION );
- pFilterBox->SetTabs( nFilterBoxTabs, MapUnit( MAP_APPFONT ));
- pFilterBox->SetTabJustify( 1, bLayoutRTL ? AdjustRight : AdjustLeft );
-*/
- sal_Bool bEmpty = sal_False;
+ sal_Bool bEmpty = false;
TypedScStrCollection aStrings( 128, 128 );
if ( bDataSelect ) // Auswahl-Liste
{
@@ -940,8 +941,8 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
long nMaxText = 0;
// default entries
- static const sal_uInt16 nDefIDs[] = { SCSTR_ALLFILTER, SCSTR_TOP10FILTER, SCSTR_STDFILTER };
- const sal_uInt16 nDefCount = sizeof(nDefIDs) / sizeof(sal_uInt16);
+ static const sal_uInt16 nDefIDs[] = { SCSTR_ALLFILTER, SCSTR_TOP10FILTER, SCSTR_STDFILTER, SCSTR_EMPTY, SCSTR_NOTEMPTY };
+ const sal_uInt16 nDefCount = SAL_N_ELEMENTS(nDefIDs);
for (i=0; i<nDefCount; i++)
{
String aEntry( (ScResId) nDefIDs[i] );
@@ -997,7 +998,7 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
pFilterBox->SetSizePixel( aSize );
pFilterBox->Show(); // Show muss vor SetUpdateMode kommen !!!
- pFilterBox->SetUpdateMode(sal_False);
+ pFilterBox->SetUpdateMode(false);
pFilterFloat->SetOutputSizePixel( aSize );
pFilterFloat->StartPopupMode( aCellRect, FLOATWIN_POPUPMODE_DOWN|FLOATWIN_POPUPMODE_GRABFOCUS);
@@ -1018,7 +1019,6 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
pFilterBox->SetUpdateMode(sal_True);
}
-//! SvLBoxEntry* pSelect = NULL;
sal_uInt16 nSelPos = LISTBOX_ENTRY_NOTFOUND;
if (!bDataSelect) // AutoFilter: aktiven Eintrag selektieren
@@ -1038,7 +1038,7 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
ScQueryEntry& rEntry = aParam.GetEntry(j);
if (j>0)
if (rEntry.eConnect != SC_AND)
- bValid = sal_False;
+ bValid = false;
if (rEntry.nField == nCol)
{
if (rEntry.eOp == SC_EQUAL)
@@ -1047,7 +1047,6 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
if (pStr)
{
nSelPos = pFilterBox->GetEntryPos( *pStr );
-//! pSelect = pFilterBox->GetEntry( nPos );
}
}
else if (rEntry.eOp == SC_TOPVAL && rEntry.pStr &&
@@ -1118,7 +1117,6 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
}
else
{
-// pFilterBox->Show(); // schon vorne
pFilterBox->GrabFocus();
// Select erst nach GrabFocus, damit das Focus-Rechteck richtig landet
@@ -1145,17 +1143,7 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSele
void ScGridWindow::FilterSelect( sal_uLong nSel )
{
- String aString;
-/*
- SvLBoxEntry* pEntry = pFilterBox->GetEntry( nSel );
- if (pEntry)
- {
- SvLBoxString* pStringEntry = (SvLBoxString*) pEntry->GetFirstItem( SV_ITEM_ID_LBOXSTRING );
- if ( pStringEntry )
- aString = pStringEntry->GetText();
- }
-*/
- aString = pFilterBox->GetEntry( static_cast< sal_uInt16 >( nSel ) );
+ String aString = pFilterBox->GetEntry( static_cast< sal_uInt16 >( nSel ) );
SCCOL nCol = pFilterBox->GetCol();
SCROW nRow = pFilterBox->GetRow();
@@ -1223,9 +1211,9 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
}
else
{
- sal_Bool bDeleteOld = sal_False;
+ sal_Bool bDeleteOld = false;
SCSIZE nQueryPos = 0;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
if (!aParam.bInplace)
bDeleteOld = sal_True;
if (aParam.bRegExp)
@@ -1258,7 +1246,7 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
aParam.GetEntry(i).Clear();
nQueryPos = 0;
aParam.bInplace = sal_True;
- aParam.bRegExp = sal_False;
+ aParam.bRegExp = false;
}
if ( nQueryPos < MAXQUERY || SC_AUTOFILTER_ALL == nSel ) // loeschen geht immer
@@ -1276,6 +1264,21 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
rNewEntry.eOp = SC_TOPVAL;
*rNewEntry.pStr = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("10"));
}
+ else if (nSel == SC_AUTOFILTER_EMPTY)
+ {
+ rNewEntry.pStr->Erase();
+ rNewEntry.bQueryByString = false;
+ rNewEntry.eOp = SC_EQUAL;
+ rNewEntry.nVal = SC_EMPTYFIELDS;
+
+ }
+ else if (nSel == SC_AUTOFILTER_NOTEMPTY)
+ {
+ rNewEntry.pStr->Erase();
+ rNewEntry.bQueryByString = false;
+ rNewEntry.eOp = SC_EQUAL;
+ rNewEntry.nVal = SC_NONEMPTYFIELDS;
+ }
else
{
rNewEntry.eOp = SC_EQUAL;
@@ -1290,14 +1293,15 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
aParam.DeleteQuery(nQueryPos);
}
- // #100597# end edit mode - like in ScCellShell::ExecuteDB
+ // end edit mode - like in ScCellShell::ExecuteDB
if ( pViewData->HasEditView( pViewData->GetActivePart() ) )
{
SC_MOD()->InputEnterHandler();
pViewData->GetViewShell()->UpdateInputHandler();
}
- pViewData->GetView()->Query( aParam, NULL, sal_True );
+ aParam.bUseDynamicRange = true;
+ pViewData->GetView()->Query( aParam, NULL, true );
pDBData->SetQueryParam( aParam ); // speichern
}
else // "Zuviele Bedingungen"
@@ -1306,7 +1310,7 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
}
else
{
- DBG_ERROR("Wo ist der Datenbankbereich?");
+ OSL_FAIL("Wo ist der Datenbankbereich?");
}
}
@@ -1331,7 +1335,7 @@ void ScGridWindow::MoveMouseStatus( ScGridWindow& rDestWin )
rDestWin.nRFIndex = nRFIndex;
rDestWin.nRFAddX = nRFAddX;
rDestWin.nRFAddY = nRFAddY;
- bRFMouse = sal_False;
+ bRFMouse = false;
}
if (nPagebreakMouse)
@@ -1353,9 +1357,9 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction )
// with bAction==sal_True, SetFillMode / SetDragMode is called
if ( bAction && !rMEvt.IsLeft() )
- return sal_False;
+ return false;
- sal_Bool bNewPointer = sal_False;
+ sal_Bool bNewPointer = false;
SfxInPlaceClient* pClient = pViewData->GetViewShell()->GetIPClient();
sal_Bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
@@ -1389,7 +1393,7 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction )
pViewData->SetFillMode(
aMarkRange.aStart.Col(), aMarkRange.aStart.Row(), nX, nY );
- // #108266# The simple selection must also be recognized when dragging,
+ // The simple selection must also be recognized when dragging,
// where the Marking flag is set and MarkToSimple won't work anymore.
pViewData->GetMarkData().MarkToSimple();
}
@@ -1436,14 +1440,13 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction )
if (!bNewPointer && bAction)
{
-// SetPointer( POINTER_ARROW ); // in Fu...
pViewData->ResetFillMode();
}
return bNewPointer;
}
-void __EXPORT ScGridWindow::MouseButtonDown( const MouseEvent& rMEvt )
+void ScGridWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
nNestedButtonState = SC_NESTEDBUTTON_DOWN;
@@ -1472,7 +1475,6 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
// opened by inplace client and we would deactivate the inplace client,
// the contex menu is closed by VCL asynchronously which in the end
// would work on deleted objects or the context menu has no parent anymore)
- // See #126086# and #128122#
SfxViewShell* pViewSh = pViewData->GetViewShell();
SfxInPlaceClient* pClient = pViewSh->GetIPClient();
if ( pClient &&
@@ -1484,22 +1486,11 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
// Filter-Popup beendet sich mit eigenem Mausklick, nicht erst beim Klick
// in das GridWindow, darum ist die folgende Abfrage nicht mehr noetig:
-#if 0
- // merken, dass FilterBox geloescht wird, damit sichergestellt
- // ist, dass in diesem Handler nicht an gleicher Stelle wieder
- // eine neue geoeffnet wird.
- sal_Bool bWasFilterBox = ( pFilterBox != NULL &&
- ((Window*)pFilterBox)->IsVisible() &&
- !pFilterBox->IsDataSelect() );
- SCCOL nOldColFBox = bWasFilterBox ? pFilterBox->GetCol() : 0;
- SCROW nOldRowFBox = bWasFilterBox ? pFilterBox->GetRow() : 0;
-#endif
-
ClickExtern(); // loescht FilterBox, wenn vorhanden
HideNoteMarker(); // Notiz-Anzeige
- bEEMouse = sal_False;
+ bEEMouse = false;
ScModule* pScMod = SC_MOD();
if (pScMod->IsModalMode(pViewData->GetSfxDocShell()))
@@ -1525,7 +1516,6 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
if ( !nButtonDown || !bDouble ) // single (first) click is always valid
nButtonDown = rMEvt.GetButtons(); // set nButtonDown first, so StopMarking works
-// pViewData->GetViewShell()->GetViewFrame()->GetWindow().GrabFocus();
if ( ( bEditMode && pViewData->GetActivePart() == eWhich ) || !bFormulaMode )
GrabFocus();
@@ -1591,7 +1581,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
if ( nPosX >= (SCsCOL) nEditCol && nPosX <= (SCsCOL) nEndCol &&
nPosY >= (SCsROW) nEditRow && nPosY <= (SCsROW) nEndRow )
{
- // #53966# beim Klick in die Tabellen-EditView immer den Focus umsetzen
+ // beim Klick in die Tabellen-EditView immer den Focus umsetzen
if (bFormulaMode) // sonst ist es oben schon passiert
GrabFocus();
@@ -1622,7 +1612,6 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
if ( pViewData->GetActivePart() != eWhich )
pViewData->GetView()->ActivatePart( eWhich ); //! schon oben immer ???
- // CaptureMouse();
StartTracking();
return;
}
@@ -1642,10 +1631,9 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
&nPagebreakBreak, &nPagebreakPrev );
if (nPagebreakMouse)
{
- bPagebreakDrawn = sal_False;
- // CaptureMouse();
+ bPagebreakDrawn = false;
StartTracking();
- PagebreakMove( rMEvt, sal_False );
+ PagebreakMove( rMEvt, false );
return;
}
}
@@ -1654,12 +1642,10 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
{
if ( !bCrossPointer && DrawMouseButtonDown(rMEvt) )
{
- //if (DrawHasMarkedObj())
- // pViewData->GetViewShell()->SetDrawShellOrSub(); // Draw-Objekt selektiert
return;
}
- pViewData->GetViewShell()->SetDrawShell( sal_False ); // kein Draw-Objekt selektiert
+ pViewData->GetViewShell()->SetDrawShell( false ); // kein Draw-Objekt selektiert
// TestMouse schon oben passiert
}
@@ -1775,7 +1761,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
}
}
-void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
+void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
aCurMousePos = rMEvt.GetPosPixel();
ScDocument* pDoc = pViewData->GetDocument();
@@ -1797,7 +1783,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
nMouseStatus = SC_GM_NONE;
// Selection-Engine: Markieren abbrechen
pViewData->GetView()->GetSelEngine()->Reset();
- rMark.SetMarking(sal_False);
+ rMark.SetMarking(false);
if (pViewData->IsAnyFillMode())
{
pViewData->GetView()->StopRefMode();
@@ -1854,7 +1840,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
pViewData->GetView()->InvalidateAttribs();
rBindings.Invalidate( SID_HYPERLINK_GETLINK );
- bEEMouse = sal_False;
+ bEEMouse = false;
return;
}
@@ -1867,7 +1853,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
if (bRFMouse)
{
RFMouseMove( rMEvt, sal_True ); // Range wieder richtigherum
- bRFMouse = sal_False;
+ bRFMouse = false;
SetPointer( Pointer( POINTER_ARROW ) );
ReleaseMouse();
return;
@@ -1895,7 +1881,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
if (DrawMouseButtonUp(rMEvt)) // includes format paint brush handling for drawing objects
return;
- rMark.SetMarking(sal_False);
+ rMark.SetMarking(false);
SetPointer( Pointer( POINTER_ARROW ) );
@@ -1908,19 +1894,17 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
SCCOL nEndCol;
SCROW nEndRow;
pViewData->GetFillData( nStartCol, nStartRow, nEndCol, nEndRow );
-// DBG_ASSERT( nStartCol==pViewData->GetRefStartX() && nStartRow==pViewData->GetRefStartY(),
-// "Block falsch fuer AutoFill" );
ScRange aDelRange;
sal_Bool bIsDel = pViewData->GetDelMark( aDelRange );
ScViewFunc* pView = pViewData->GetView();
pView->StopRefMode();
pViewData->ResetFillMode();
- pView->GetFunctionSet()->SetAnchorFlag( sal_False ); // #i5819# don't use AutoFill anchor flag for selection
+ pView->GetFunctionSet()->SetAnchorFlag( false ); // #i5819# don't use AutoFill anchor flag for selection
if ( bIsDel )
{
- pView->MarkRange( aDelRange, sal_False );
+ pView->MarkRange( aDelRange, false );
pView->DeleteContents( IDF_CONTENTS );
SCTAB nTab = pViewData->GetTabNo();
ScRange aBlockRange( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab );
@@ -1930,7 +1914,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
aBlockRange.aEnd.SetCol( aDelRange.aStart.Col() - 1 );
else
aBlockRange.aEnd.SetRow( aDelRange.aStart.Row() - 1 );
- pView->MarkRange( aBlockRange, sal_False );
+ pView->MarkRange( aBlockRange, false );
}
}
else
@@ -1952,11 +1936,11 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScTabView* pView = pViewData->GetView();
pView->StopRefMode();
pViewData->ResetFillMode();
- pView->GetFunctionSet()->SetAnchorFlag( sal_False );
+ pView->GetFunctionSet()->SetAnchorFlag( false );
if ( aEndPos != aBlockRange.aEnd )
{
- pViewData->GetDocShell()->GetDocFunc().ResizeMatrix( aBlockRange, aEndPos, sal_False );
+ pViewData->GetDocShell()->GetDocFunc().ResizeMatrix( aBlockRange, aEndPos, false );
pViewData->GetView()->MarkRange( ScRange( aBlockRange.aStart, aEndPos ) );
}
}
@@ -1966,7 +1950,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScTabView* pView = pViewData->GetView();
pView->StopRefMode();
pViewData->ResetFillMode();
- pView->GetFunctionSet()->SetAnchorFlag( sal_False );
+ pView->GetFunctionSet()->SetAnchorFlag( false );
pViewData->GetDocShell()->UpdateOle(pViewData);
}
@@ -2065,7 +2049,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScDPObject aNewObj( *pDPObj );
pDPObj->ToggleDetails( aData, &aNewObj );
ScDBDocFunc aFunc( *pViewData->GetDocShell() );
- aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, false );
pViewData->GetView()->CursorPosChanged(); // shells may be switched
}
}
@@ -2166,8 +2150,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() && pViewData->GetView()->GetSelEngine()->SelMouseButtonUp( rMEvt ) )
{
-// rMark.MarkToSimple();
- pViewData->GetView()->UpdateAutoFillMark();
+ pViewData->GetView()->SelectionChanged();
SfxDispatcher* pDisp = pViewData->GetViewShell()->GetDispatcher();
sal_Bool bFormulaMode = pScMod->IsFormulaMode();
@@ -2183,8 +2166,6 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
String aAddr; // CurrentCell
if( rMark.IsMarked() )
{
-// sal_Bool bKeep = rMark.IsMultiMarked(); //! wohin damit ???
-
ScRange aScRange;
rMark.GetMarkArea( aScRange );
aScRange.Format( aAddr, SCR_ABS );
@@ -2206,8 +2187,12 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
}
SfxStringItem aPosItem( SID_CURRENTCELL, aAddr );
+ // We don't want to align to the cursor position because if the
+ // cell cursor isn't visible after making selection, it would jump
+ // back to the origin of the selection where the cell cursor is.
+ SfxBoolItem aAlignCursorItem( FN_PARAM_2, false );
pDisp->Execute( SID_CURRENTCELL, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
- &aPosItem, (void*)0L );
+ &aPosItem, &aAlignCursorItem, (void*)0L );
pViewData->GetView()->InvalidateAttribs();
}
@@ -2224,7 +2209,7 @@ void ScGridWindow::FakeButtonUp()
}
}
-void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt )
+void ScGridWindow::MouseMove( const MouseEvent& rMEvt )
{
aCurMousePos = rMEvt.GetPosPixel();
@@ -2240,7 +2225,7 @@ void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt )
if (bEEMouse && nButtonDown && !rMEvt.GetButtons())
{
- bEEMouse = sal_False;
+ bEEMouse = false;
nButtonDown = 0;
nMouseStatus = SC_GM_NONE;
return;
@@ -2302,13 +2287,13 @@ void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt )
if (bRFMouse)
{
- RFMouseMove( rMEvt, sal_False );
+ RFMouseMove( rMEvt, false );
return;
}
if (nPagebreakMouse)
{
- PagebreakMove( rMEvt, sal_False );
+ PagebreakMove( rMEvt, false );
return;
}
@@ -2352,7 +2337,7 @@ void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt )
if (!bWater)
{
- sal_Bool bCross = sal_False;
+ sal_Bool bCross = false;
// Range-Finder
@@ -2401,7 +2386,7 @@ void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt )
// Fill-Cursor anzeigen ?
if ( !bFormulaMode && !nButtonDown )
- if (TestMouse( rMEvt, sal_False ))
+ if (TestMouse( rMEvt, false ))
bCross = sal_True;
if ( nButtonDown && pViewData->IsAnyFillMode() )
@@ -2452,7 +2437,7 @@ void lcl_InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent, const MouseE
rEvent.X = rEvt.GetPosPixel().X();
rEvent.Y = rEvt.GetPosPixel().Y();
rEvent.ClickCount = rEvt.GetClicks();
- rEvent.PopupTrigger = sal_False;
+ rEvent.PopupTrigger = false;
}
long ScGridWindow::PreNotify( NotifyEvent& rNEvt )
@@ -2517,24 +2502,24 @@ void ScGridWindow::Tracking( const TrackingEvent& rTEvt )
if (!pViewData->GetView()->IsInActivatePart())
{
if (bDPMouse)
- bDPMouse = sal_False; // gezeichnet wird per bDragRect
+ bDPMouse = false; // gezeichnet wird per bDragRect
if (bDragRect)
{
// pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
}
if (bRFMouse)
{
RFMouseMove( rMEvt, sal_True ); // richtig abbrechen geht dabei nicht...
- bRFMouse = sal_False;
+ bRFMouse = false;
}
if (nPagebreakMouse)
{
// if (bPagebreakDrawn)
// DrawDragRect( aPagebreakDrag.aStart.Col(), aPagebreakDrag.aStart.Row(),
// aPagebreakDrag.aEnd.Col(), aPagebreakDrag.aEnd.Row(), sal_False );
- bPagebreakDrawn = sal_False;
+ bPagebreakDrawn = false;
UpdateDragRectOverlay();
nPagebreakMouse = SC_PD_NONE;
}
@@ -2545,7 +2530,7 @@ void ScGridWindow::Tracking( const TrackingEvent& rTEvt )
sal_Bool bRefMode = pViewData->IsRefMode();
if (bRefMode)
- SC_MOD()->EndReference(); // #63148# Dialog nicht verkleinert lassen
+ SC_MOD()->EndReference(); // Dialog nicht verkleinert lassen
}
}
else if ( rTEvt.IsTrackingEnded() )
@@ -2578,7 +2563,7 @@ void ScGridWindow::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel )
SCROW nEditRow;
pViewData->GetEditView( eWhich, pEditView, nEditCol, nEditRow );
- // #63263# don't remove the edit view while switching views
+ // don't remove the edit view while switching views
ScModule* pScMod = SC_MOD();
pScMod->SetInEditCommand( sal_True );
@@ -2588,7 +2573,7 @@ void ScGridWindow::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel )
if (pHdl)
pHdl->DataChanged();
- pScMod->SetInEditCommand( sal_False );
+ pScMod->SetInEditCommand( false );
if (!pViewData->IsActive()) // dropped to different view?
{
ScInputHandler* pViewHdl = pScMod->GetInputHdl( pViewData->GetViewShell() );
@@ -2614,13 +2599,12 @@ void lcl_SetTextCursorPos( ScViewData* pViewData, ScSplitPos eWhich, Window* pWi
pWin->SetCursorRect( &aEditArea );
}
-void __EXPORT ScGridWindow::Command( const CommandEvent& rCEvt )
+void ScGridWindow::Command( const CommandEvent& rCEvt )
{
// The command event is send to the window after a possible context
// menu from an inplace client is closed. Now we have the chance to
// deactivate the inplace client without any problem regarding parent
// windows and code on the stack.
- // For more information, see #126086# and #128122#
sal_uInt16 nCmd = rCEvt.GetCommand();
ScTabViewShell* pTabViewSh = pViewData->GetViewShell();
SfxInPlaceClient* pClient = pTabViewSh->GetIPClient();
@@ -2658,7 +2642,7 @@ void __EXPORT ScGridWindow::Command( const CommandEvent& rCEvt )
if ( nCmd == COMMAND_CURSORPOS && !bEditView )
{
- // #88458# CURSORPOS may be called without following text input,
+ // CURSORPOS may be called without following text input,
// to set the input method window position
// -> input mode must not be started,
// manually calculate text insert position if not in input mode
@@ -2791,7 +2775,7 @@ void __EXPORT ScGridWindow::Command( const CommandEvent& rCEvt )
SelectForContextMenu( aPosPixel, nCellX, nCellY );
}
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
sal_Bool bEdit = pViewData->HasEditView(eWhich);
if ( !bEdit )
{
@@ -2999,7 +2983,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX,
// look for existing selection
- sal_Bool bHitSelected = sal_False;
+ sal_Bool bHitSelected = false;
if ( pDrawView && pDrawView->IsMarkedObjHit( aLogicPos ) )
{
// clicked on selected object -> don't change anything
@@ -3016,7 +3000,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX,
if ( !bHitSelected )
{
sal_Bool bWasDraw = ( pDrawView && pDrawView->AreObjectsMarked() );
- sal_Bool bHitDraw = sal_False;
+ sal_Bool bHitDraw = false;
if ( pDrawView )
{
pDrawView->UnmarkAllObj();
@@ -3031,17 +3015,35 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX,
pView->Unmark();
pView->SetCursor(nCellX, nCellY);
if ( bWasDraw )
- pViewData->GetViewShell()->SetDrawShell( sal_False ); // switch shells
+ pViewData->GetViewShell()->SetDrawShell( false ); // switch shells
}
}
}
-void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
+static void ClearSingleSelection( ScViewData* pViewData )
{
- // #96965# Cursor control for ref input dialog
+ SCCOL nX;
+ SCROW nY;
+ ScTransferObj* pTransObj = ScTransferObj::GetOwnClipboard(
+ pViewData->GetActiveWin() );
+ if (!pTransObj)
+ return;
+
+ ScDocument* pClipDoc = pTransObj->GetDocument();
+ pClipDoc->GetClipArea( nX, nY, true );
+ if (nX == 0 && nY == 0)
+ {
+ ScTabView* pView = pViewData->GetView();
+ pView->Unmark();
+ }
+}
+
+void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
+{
+ // Cursor control for ref input dialog
+ const KeyCode& rKeyCode = rKEvt.GetKeyCode();
if( SC_MOD()->IsRefDialogOpen() )
{
- const KeyCode& rKeyCode = rKEvt.GetKeyCode();
if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
{
SC_MOD()->EndReference();
@@ -3056,9 +3058,35 @@ void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
return;
}
}
+ else if( rKeyCode.GetCode() == KEY_RETURN && pViewData->IsPasteMode() )
+ {
+ ScTabViewShell* pTabViewShell = pViewData->GetViewShell();
+
+ ScCellShell::PasteFromClipboard( pViewData, pTabViewShell, false );
+ ClearSingleSelection( pViewData );
+
+ uno::Reference<datatransfer::clipboard::XClipboard> xSystemClipboard =
+ TransferableHelper::GetSystemClipboard();
+ if (xSystemClipboard.is())
+ {
+ xSystemClipboard->setContents(
+ uno::Reference<datatransfer::XTransferable>(),
+ uno::Reference<datatransfer::clipboard::XClipboardOwner>());
+ }
+
+ // hide the border around the copy source
+ pViewData->SetPasteMode( SC_PASTE_NONE );
+ UpdateCopySourceOverlay();
+ return;
+ }
// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs:
else if( !pViewData->IsAnyFillMode() )
{
+ if (rKeyCode.GetCode() == KEY_ESCAPE)
+ {
+ pViewData->SetPasteMode( SC_PASTE_NONE );
+ UpdateCopySourceOverlay();
+ }
// query for existing note marker before calling ViewShell's keyboard handling
// which may remove the marker
sal_Bool bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() );
@@ -3099,6 +3127,17 @@ void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
ShowNoteMarker( pViewData->GetCurX(), pViewData->GetCurY(), sal_True );
return;
}
+ if (aCode.GetCode() == KEY_BRACKETLEFT && aCode.GetModifier() == KEY_MOD1)
+ {
+ pViewSh->DetectiveMarkPred();
+ return;
+ }
+ if (aCode.GetCode() == KEY_BRACKETRIGHT && aCode.GetModifier() == KEY_MOD1)
+ {
+ pViewSh->DetectiveMarkSucc();
+ return;
+ }
+
}
Window::KeyInput(rKEvt);
@@ -3110,7 +3149,7 @@ void ScGridWindow::StopMarking()
if (nButtonDown)
{
- pViewData->GetMarkData().SetMarking(sal_False);
+ pViewData->GetMarkData().SetMarking(false);
nMouseStatus = SC_GM_IGNORE;
}
}
@@ -3135,10 +3174,6 @@ void ScGridWindow::UpdateInputContext()
sal_Bool ScGridWindow::DropScroll( const Point& rMousePos )
{
-/* doch auch auf nicht aktiven Views...
- if ( !pViewData->IsActive() )
- return sal_False;
-*/
SCsCOL nDx = 0;
SCsROW nDy = 0;
Size aSize = GetOutputSizePixel();
@@ -3162,19 +3197,13 @@ sal_Bool ScGridWindow::DropScroll( const Point& rMousePos )
if ( nDx != 0 || nDy != 0 )
{
-// if (bDragRect)
-// pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
-
if ( nDx != 0 )
pViewData->GetView()->ScrollX( nDx, WhichH(eWhich) );
if ( nDy != 0 )
pViewData->GetView()->ScrollY( nDy, WhichV(eWhich) );
-
-// if (bDragRect)
-// pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
}
- return sal_False;
+ return false;
}
sal_Bool lcl_TestScenarioRedliningDrop( ScDocument* pDoc, const ScRange& aDragRange)
@@ -3182,7 +3211,7 @@ sal_Bool lcl_TestScenarioRedliningDrop( ScDocument* pDoc, const ScRange& aDragRa
// Testet, ob bei eingeschalteten RedLining,
// bei einem Drop ein Scenario betroffen ist.
- sal_Bool bReturn = sal_False;
+ sal_Bool bReturn = false;
SCTAB nTab = aDragRange.aStart.Tab();
SCTAB nTabCount = pDoc->GetTableCount();
@@ -3238,9 +3267,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
{
if ( rEvt.mbLeaving )
{
- // if (bDragRect)
- // pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
return rEvt.mnAction;
}
@@ -3253,7 +3280,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
{
if (bDragRect)
{
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
}
return DND_ACTION_NONE;
@@ -3269,23 +3296,16 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
{
if (bDragRect) // Rechteck loeschen
{
- // pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
}
//! highlight chart? (selection border?)
sal_Int8 nRet = rEvt.mnAction;
-//! if ( rEvt.GetAction() == DROP_LINK )
-//! bOk = rEvt.SetAction( DROP_COPY ); // can't link onto chart
return nRet;
}
}
-//! else
-//! if ( rEvt.GetAction() == DROP_MOVE )
-//! rEvt.SetAction( DROP_COPY ); // different doc: default=COPY
-
if ( rData.pCellTransfer->GetDragSourceFlags() & SC_DROP_TABLE ) // whole sheet?
{
@@ -3326,8 +3346,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
{
if (bDragRect)
{
- // pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
}
return DND_ACTION_NONE;
@@ -3390,7 +3409,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
// no valid sorting in a DataPilot table -> disallow
if ( bDragRect )
{
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
}
return DND_ACTION_NONE;
@@ -3420,7 +3439,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
{
if ( bDragRect )
{
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
}
return DND_ACTION_NONE;
@@ -3444,9 +3463,6 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
nDragStartX+nSizeX-1 != nDragEndX || nDragStartY+nSizeY-1 != nDragEndY ||
!bDragRect || eDragInsertMode != meDragInsertMode )
{
- // if (bDragRect)
- // pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
-
nDragStartX = nNewDragX;
nDragStartY = nNewDragY;
nDragEndX = nDragStartX+nSizeX-1;
@@ -3454,24 +3470,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
bDragRect = sal_True;
meDragInsertMode = eDragInsertMode;
- // pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
-
UpdateDragRectOverlay();
-
- // show target position as tip help
-#if 0
- if (Help::IsQuickHelpEnabled())
- {
- ScRange aRange( nDragStartX, nDragStartY, nTab, nDragEndX, nDragEndY, nTab );
- String aHelpStr;
- aRange.Format( aHelpStr, SCA_VALID ); // non-3D
-
- Point aPos = Pointer::GetPosPixel();
- sal_uInt16 nAlign = QUICKHELP_BOTTOM|QUICKHELP_RIGHT;
- Rectangle aRect( aPos, aPos );
- Help::ShowQuickHelp(aRect, aHelpStr, nAlign);
- }
-#endif
}
}
@@ -3663,7 +3662,7 @@ sal_uLong lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransferable>
{
// If it's a Writer object, insert RTF instead of OLE
- sal_Bool bDoRtf = sal_False;
+ sal_Bool bDoRtf = false;
SotStorageStreamRef xStm;
TransferableObjectDescriptor aObjDesc;
if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) &&
@@ -3752,9 +3751,7 @@ sal_uLong lcl_GetDropLinkId( const uno::Reference<datatransfer::XTransferable>&
sal_Int8 ScGridWindow::ExecutePrivateDrop( const ExecuteDropEvent& rEvt )
{
// hide drop marker
- // if (bDragRect)
- // pViewData->GetView()->DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, eWhich );
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
ScModule* pScMod = SC_MOD();
@@ -3829,7 +3826,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
bFiltered = ScViewUtil::HasFiltered( aDest, pThisDoc);
}
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if (!bFiltered && pSourceDoc == pThisDoc)
{
@@ -3947,8 +3944,11 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
if ( bDone )
{
- pView->MarkRange( aDest, sal_False, sal_False );
- pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() );
+ pView->MarkRange( aDest, false, false );
+
+ SCCOL nDCol = pViewData->GetCurX() - aSource.aStart.Col();
+ SCROW nDRow = pViewData->GetCurY() - aSource.aStart.Row();
+ pView->SetCursor( aDest.aStart.Col() + nDCol, aDest.aStart.Row() + nDRow );
}
pDocSh->GetUndoManager()->LeaveListAction();
@@ -4055,8 +4055,8 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
pView->EnterMatrix( aFormula );
- pView->MarkRange( aDest, sal_False, sal_False );
- pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() );
+ pView->MarkRange( aDest, false, false );
+ pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() );
}
pDocSh->GetUndoManager()->LeaveListAction();
@@ -4089,8 +4089,8 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
bDone = pView->PasteFromClip( IDF_ALL, pTransObj->GetDocument() ); // clip-doc
if ( bDone )
{
- pView->MarkRange( aDest, sal_False, sal_False );
- pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() );
+ pView->MarkRange( aDest, false, false );
+ pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() );
}
}
@@ -4127,7 +4127,7 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
aThisName = pDocSh->GetMedium()->GetName();
if ( rData.aLinkDoc == aThisName ) // error - no link within a document
- bOk = sal_False;
+ bOk = false;
else
{
ScViewFunc* pView = pViewData->GetView();
@@ -4139,15 +4139,15 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
SCsCOL nPosX;
SCsROW nPosY;
pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
- pView->MoveCursorAbs( nPosX, nPosY, SC_FOLLOW_NONE, sal_False, sal_False );
+ pView->MoveCursorAbs( nPosX, nPosY, SC_FOLLOW_NONE, false, false );
pView->InsertAreaLink( rData.aLinkDoc, EMPTY_STRING, EMPTY_STRING,
rData.aLinkArea, 0 );
}
else
{
- DBG_ERROR("drop with link: no sheet nor area");
- bOk = sal_False;
+ OSL_FAIL("drop with link: no sheet nor area");
+ bOk = false;
}
}
@@ -4169,7 +4169,7 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
if (bPasteIsMove)
rData.pDrawTransfer->SetDragWasInternal();
- bPasteIsMove = sal_False;
+ bPasteIsMove = false;
return rEvt.mnAction;
}
@@ -4204,7 +4204,7 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
return rEvt.mnAction;
}
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
sal_uLong nFormatId = bIsLink ?
lcl_GetDropLinkId( rEvt.maDropEvent.Transferable ) :
@@ -4215,8 +4215,8 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
bPasteIsDrop = sal_True;
bDone = pViewData->GetView()->PasteDataFormat(
nFormatId, rEvt.maDropEvent.Transferable, nPosX, nPosY, &aLogicPos, bIsLink );
- bPasteIsDrop = sal_False;
- pScMod->SetInExecuteDrop( sal_False );
+ bPasteIsDrop = false;
+ pScMod->SetInExecuteDrop( false );
}
sal_Int8 nRet = bDone ? rEvt.mnAction : DND_ACTION_NONE;
@@ -4233,6 +4233,23 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel )
SCsROW nPosY;
pViewData->GetPosFromPixel( rPosPixel.X(), rPosPixel.Y(), eWhich, nPosX, nPosY );
+ // If the mouse down was inside a visible note window, ignore it and
+ // leave it up to the ScPostIt to handle it
+ SdrView* pDrawView = pViewData->GetViewShell()->GetSdrView();
+ if (pDrawView)
+ {
+ sal_uLong nCount = pDrawView->GetMarkedObjectCount();
+ for (sal_uLong i = 0; i < nCount; ++i)
+ {
+ SdrObject* pObj = pDrawView->GetMarkedObjectByIndex(i);
+ if (pObj && pObj->GetLogicRect().IsInside(aLogicPos))
+ {
+ // Inside an active drawing object. Bail out.
+ return;
+ }
+ }
+ }
+
ScSelectionTransferObj* pOwnSelection = SC_MOD()->GetSelectionTransfer();
if ( pOwnSelection )
{
@@ -4253,9 +4270,9 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel )
// keep a reference to the data in case the selection is changed during paste
uno::Reference<datatransfer::XTransferable> xRef( pDrawTransfer );
- // #96821# bSameDocClipboard argument for PasteDraw is needed
+ // bSameDocClipboard argument for PasteDraw is needed
// because only DragData is checked directly inside PasteDraw
- pViewData->GetView()->PasteDraw( aLogicPos, pDrawTransfer->GetModel(), sal_False,
+ pViewData->GetView()->PasteDraw( aLogicPos, pDrawTransfer->GetModel(), false,
pDrawTransfer->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
}
}
@@ -4273,7 +4290,7 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel )
{
bPasteIsDrop = sal_True;
pViewData->GetView()->PasteDataFormat( nFormatId, xTransferable, nPosX, nPosY, &aLogicPos );
- bPasteIsDrop = sal_False;
+ bPasteIsDrop = false;
}
}
}
@@ -4328,8 +4345,7 @@ void ScGridWindow::ScrollPixel( long nDifX, long nDifY )
ClickExtern();
HideNoteMarker();
- bIsInScroll = sal_True;
- //sal_Bool bXor=DrawBeforeScroll();
+ bIsInScroll = true;
SetMapMode(MAP_PIXEL);
Scroll( nDifX, nDifY, SCROLL_CHILDREN );
@@ -4337,8 +4353,8 @@ void ScGridWindow::ScrollPixel( long nDifX, long nDifY )
UpdateEditViewPos();
- DrawAfterScroll(); //bXor);
- bIsInScroll = sal_False;
+ DrawAfterScroll();
+ bIsInScroll = false;
}
// Formeln neu zeichnen -------------------------------------------------
@@ -4381,7 +4397,6 @@ void ScGridWindow::UpdateFormulas()
Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
long nMirrorWidth = GetSizePixel().Width();
sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
- // unused variable long nLayoutSign = bLayoutRTL ? -1 : 1;
if ( bLayoutRTL )
{
long nEndPixel = pViewData->GetScrPos( nX2+1, nPosY, eWhich ).X();
@@ -4396,7 +4411,7 @@ void ScGridWindow::UpdateFormulas()
double nPPTY = pViewData->GetPPTY();
ScTableInfo aTabInfo;
- pDoc->FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab, nPPTX, nPPTY, sal_False, sal_False );
+ pDoc->FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab, nPPTX, nPPTY, false, false );
Fraction aZoomX = pViewData->GetZoomX();
Fraction aZoomY = pViewData->GetZoomY();
@@ -4459,37 +4474,18 @@ void ScGridWindow::UpdateListValPos( sal_Bool bVisible, const ScAddress& rPos )
void ScGridWindow::HideCursor()
{
++nCursorHideCount;
- if (nCursorHideCount==1)
- {
- DrawCursor();
- DrawAutoFillMark();
- }
}
void ScGridWindow::ShowCursor()
{
- if (nCursorHideCount==0)
- {
- DBG_ERROR("zuviel ShowCursor");
- return;
- }
-
- if (nCursorHideCount==1)
- {
- // #i57745# Draw the cursor before setting the variable, in case the
- // GetSizePixel call from drawing causes a repaint (resize handler is called)
- DrawAutoFillMark();
- DrawCursor();
- }
-
--nCursorHideCount;
}
-void __EXPORT ScGridWindow::GetFocus()
+void ScGridWindow::GetFocus()
{
ScTabViewShell* pViewShell = pViewData->GetViewShell();
pViewShell->GotFocus();
- pViewShell->SetFormShellAtTop( sal_False ); // focus in GridWindow -> FormShell no longer on top
+ pViewShell->SetFormShellAtTop( false ); // focus in GridWindow -> FormShell no longer on top
if (pViewShell->HasAccessibilityObjects())
pViewShell->BroadcastAccessibility(ScAccGridWinFocusGotHint(eWhich, GetAccessible()));
@@ -4504,10 +4500,11 @@ void __EXPORT ScGridWindow::GetFocus()
// auf dem Mac
}
+ pViewData->GetDocShell()->CheckConfigOptions();
Window::GetFocus();
}
-void __EXPORT ScGridWindow::LoseFocus()
+void ScGridWindow::LoseFocus()
{
ScTabViewShell* pViewShell = pViewData->GetViewShell();
pViewShell->LostFocus();
@@ -4525,7 +4522,7 @@ Point ScGridWindow::GetMousePosPixel() const { return aCurMousePos; }
sal_Bool ScGridWindow::HitRangeFinder( const Point& rMouse, sal_Bool& rCorner,
sal_uInt16* pIndex, SCsCOL* pAddX, SCsROW* pAddY )
{
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
ScInputHandler* pHdl = SC_MOD()->GetInputHdl( pViewData->GetViewShell() );
if (pHdl)
{
@@ -4544,9 +4541,7 @@ sal_Bool ScGridWindow::HitRangeFinder( const Point& rMouse, sal_Bool& rCorner,
// zusammengefasste (einzeln/Bereich) ???
ScAddress aAddr( nPosX, nPosY, nTab );
-// Point aNext = pViewData->GetScrPos( nPosX+1, nPosY+1, eWhich );
-
- Point aNext = pViewData->GetScrPos( nPosX, nPosY, eWhich, sal_True );
+ Point aNext = pViewData->GetScrPos( nPosX, nPosY, eWhich, true );
long nSizeXPix;
long nSizeYPix;
pViewData->GetMergeSizePixel( nPosX, nPosY, nSizeXPix, nSizeYPix );
@@ -4600,7 +4595,7 @@ void lcl_PaintOneRange( ScDocShell* pDocSh, const ScRange& rRange, sal_uInt16 nE
SCCOL nCol2 = rRange.aEnd.Col();
SCROW nRow2 = rRange.aEnd.Row();
SCTAB nTab2 = rRange.aEnd.Tab();
- sal_Bool bHiddenEdge = sal_False;
+ sal_Bool bHiddenEdge = false;
SCROW nTmp;
ScDocument* pDoc = pDocSh->GetDocument();
@@ -4745,7 +4740,7 @@ void ScGridWindow::RFMouseMove( const MouseEvent& rMEvt, sal_Bool bUp )
// Scrolling
- sal_Bool bTimer = sal_False;
+ sal_Bool bTimer = false;
Point aPos = rMEvt.GetPosPixel();
SCsCOL nDx = 0;
SCsROW nDy = 0;
@@ -4855,7 +4850,7 @@ void ScGridWindow::RFMouseMove( const MouseEvent& rMEvt, sal_Bool bUp )
sal_Bool ScGridWindow::GetEditUrl( const Point& rPos,
String* pName, String* pUrl, String* pTarget )
{
- return GetEditUrlOrError( sal_False, rPos, pName, pUrl, pTarget );
+ return GetEditUrlOrError( false, rPos, pName, pUrl, pTarget );
}
sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos,
@@ -4873,20 +4868,20 @@ sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos,
sal_Bool bFound = lcl_GetHyperlinkCell( pDoc, nPosX, nPosY, nTab, pCell );
if( !bFound )
- return sal_False;
+ return false;
ScHideTextCursor aHideCursor( pViewData, eWhich ); // before GetEditArea (MapMode is changed)
const ScPatternAttr* pPattern = pDoc->GetPattern( nPosX, nPosY, nTab );
// bForceToTop = sal_False, use the cell's real position
- Rectangle aEditRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, sal_False );
+ Rectangle aEditRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, false );
if (rPos.Y() < aEditRect.Top())
- return sal_False;
+ return false;
// vertikal kann (noch) nicht angeklickt werden:
if (pPattern->GetCellOrientation() != SVX_ORIENTATION_STANDARD)
- return sal_False;
+ return false;
sal_Bool bBreak = ((SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK)).GetValue() ||
((SvxCellHorJustify)((const SvxHorJustifyItem&)pPattern->
@@ -4989,11 +4984,10 @@ sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos,
Point aLogicClick = PixelToLogic(rPos,aEditMode);
if ( aLogicEdit.IsInside(aLogicClick) )
{
-// aEngine.SetUpdateMode(sal_False);
EditView aTempView( &aEngine, this );
aTempView.SetOutputArea( aLogicEdit );
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
MapMode aOld = GetMapMode();
SetMapMode(aEditMode); // kein return mehr
@@ -5033,7 +5027,7 @@ sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos,
return bRet;
}
- return sal_False;
+ return false;
}
sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange )
@@ -5048,7 +5042,7 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen
Size aButSize = pViewData->GetScenButSize();
long nBWidth = aButSize.Width();
if (!nBWidth)
- return sal_False; // noch kein Button gezeichnet -> da ist auch keiner
+ return false; // noch kein Button gezeichnet -> da ist auch keiner
long nBHeight = aButSize.Height();
long nHSpace = (long)( SC_SCENARIO_HSPACE * pViewData->GetPPTX() );
@@ -5056,15 +5050,15 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen
ScMarkData aMarks;
for (SCTAB i=nTab+1; i<nTabCount && pDoc->IsScenario(i); i++)
- pDoc->MarkScenario( i, nTab, aMarks, sal_False, SC_SCENARIO_SHOWFRAME );
+ pDoc->MarkScenario( i, nTab, aMarks, false, SC_SCENARIO_SHOWFRAME );
ScRangeList aRanges;
- aMarks.FillRangeListWithMarks( &aRanges, sal_False );
+ aMarks.FillRangeListWithMarks( &aRanges, false );
- sal_uLong nRangeCount = aRanges.Count();
- for (sal_uLong j=0; j<nRangeCount; j++)
+ size_t nRangeCount = aRanges.size();
+ for (size_t j=0; j< nRangeCount; ++j)
{
- ScRange aRange = *aRanges.GetObject(j);
+ ScRange aRange = *aRanges[j];
// Szenario-Rahmen immer dann auf zusammengefasste Zellen erweitern, wenn
// dadurch keine neuen nicht-ueberdeckten Zellen mit umrandet werden
pDoc->ExtendTotalMerge( aRange );
@@ -5097,7 +5091,7 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen
}
}
- return sal_False;
+ return false;
}
// #114409#
@@ -5122,6 +5116,7 @@ void ScGridWindow::CursorChanged()
void ScGridWindow::ImpCreateOverlayObjects()
{
UpdateCursorOverlay();
+ UpdateCopySourceOverlay();
UpdateSelectionOverlay();
UpdateAutoFillOverlay();
UpdateDragRectOverlay();
@@ -5133,6 +5128,7 @@ void ScGridWindow::ImpCreateOverlayObjects()
void ScGridWindow::ImpDestroyOverlayObjects()
{
DeleteCursorOverlay();
+ DeleteCopySourceOverlay();
DeleteSelectionOverlay();
DeleteAutoFillOverlay();
DeleteDragRectOverlay();
@@ -5153,6 +5149,69 @@ void ScGridWindow::DeleteCursorOverlay()
DELETEZ( mpOOCursors );
}
+void ScGridWindow::DeleteCopySourceOverlay()
+{
+ DELETEZ( mpOOSelectionBorder );
+}
+
+void ScGridWindow::UpdateCopySourceOverlay()
+{
+ MapMode aDrawMode = GetDrawMapMode();
+ MapMode aOldMode = GetMapMode();
+ if ( aOldMode != aDrawMode )
+ SetMapMode( aDrawMode );
+
+ DeleteCopySourceOverlay();
+
+ if (!pViewData->ShowPasteSource())
+ return;
+ ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ if (!pOverlayManager)
+ return;
+ ScTransferObj* pTransObj = ScTransferObj::GetOwnClipboard( pViewData->GetActiveWin() );
+ if (!pTransObj)
+ return;
+ ScDocument* pClipDoc = pTransObj->GetDocument();
+ if (!pClipDoc)
+ return;
+
+ SCTAB nCurTab = pViewData->GetCurPos().Tab();
+
+ ScClipParam& rClipParam = pClipDoc->GetClipParam();
+ mpOOSelectionBorder = new ::sdr::overlay::OverlayObjectList;
+ for ( size_t i = 0; i < rClipParam.maRanges.size(); ++i )
+ {
+ ScRange* p = rClipParam.maRanges[i];
+ if (p->aStart.Tab() != nCurTab)
+ continue;
+
+ SCCOL nClipStartX = p->aStart.Col();
+ SCROW nClipStartY = p->aStart.Row();
+ SCCOL nClipEndX = p->aEnd.Col();
+ SCROW nClipEndY = p->aEnd.Row();
+
+ Point aClipStartScrPos = pViewData->GetScrPos( nClipStartX, nClipStartY, eWhich );
+ Point aClipEndScrPos = pViewData->GetScrPos( nClipEndX + 1, nClipEndY + 1, eWhich );
+ aClipStartScrPos -= Point(1, 1);
+ long nSizeXPix = aClipEndScrPos.X() - aClipStartScrPos.X();
+ long nSizeYPix = aClipEndScrPos.Y() - aClipStartScrPos.Y();
+
+ Rectangle aRect( aClipStartScrPos, Size(nSizeXPix, nSizeYPix) );
+
+
+ Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
+
+ Rectangle aLogic = PixelToLogic(aRect, aDrawMode);
+ ::basegfx::B2DRange aRange(aLogic.Left(), aLogic.Top(), aLogic.Right(), aLogic.Bottom());
+ ScOverlayDashedBorder* pDashedBorder = new ScOverlayDashedBorder(aRange, aHighlight, this);
+ pOverlayManager->add(*pDashedBorder);
+ mpOOSelectionBorder->append(*pDashedBorder);
+ }
+
+ if ( aOldMode != aDrawMode )
+ SetMapMode( aOldMode );
+}
+
void ScGridWindow::UpdateCursorOverlay()
{
MapMode aDrawMode = GetDrawMapMode();
@@ -5224,24 +5283,16 @@ void ScGridWindow::UpdateCursorOverlay()
if ( bLayoutRTL )
aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring
- sal_Bool bFix = ( pViewData->GetHSplitMode() == SC_SPLIT_FIX ||
- pViewData->GetVSplitMode() == SC_SPLIT_FIX );
- if ( pViewData->GetActivePart()==eWhich || bFix )
- {
- aScrPos.X() -= 2;
- aScrPos.Y() -= 2;
- Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) );
-
- aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ));
- aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ));
- aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ));
- aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ));
- }
- else
- {
- Rectangle aRect( aScrPos, Size( nSizeXPix - 1, nSizeYPix - 1 ) );
- aPixelRects.push_back( aRect );
- }
+ // Now, draw the cursor.
+
+ aScrPos.X() -= 2;
+ aScrPos.Y() -= 2;
+ Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) );
+
+ aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ));
+ aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ));
+ aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ));
+ aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ));
}
}
@@ -5252,7 +5303,10 @@ void ScGridWindow::UpdateCursorOverlay()
if(pOverlayManager)
{
- const Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
+ Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
+ if (pViewData->GetActivePart() != eWhich)
+ // non-active pane uses a different color.
+ aCursorColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
@@ -5366,7 +5420,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
DeleteAutoFillOverlay();
//
- // get the AutoFill handle rectangle in pixels (moved from ScGridWindow::DrawAutoFillMark)
+ // get the AutoFill handle rectangle in pixels
//
if ( bAutoMarkVisible && aAutoMarkPos.Tab() == pViewData->GetTabNo() &&
@@ -5401,7 +5455,10 @@ void ScGridWindow::UpdateAutoFillOverlay()
if(pOverlayManager)
{
- const Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
+ Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
+ if (pViewData->GetActivePart() != eWhich)
+ // non-active pane uses a different color.
+ aHandleColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1);
@@ -5493,7 +5550,6 @@ void ScGridWindow::UpdateDragRectOverlay()
aScrPos.X() -= 2 * nLayoutSign;
aScrPos.Y() -= 2;
-// Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) );
Rectangle aRect( aScrPos.X(), aScrPos.Y(),
aScrPos.X() + ( nSizeXPix + 2 ) * nLayoutSign, aScrPos.Y() + nSizeYPix + 2 );
if ( bLayoutRTL )
@@ -5529,7 +5585,6 @@ void ScGridWindow::UpdateDragRectOverlay()
if(pOverlayManager)
{
- // Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
@@ -5649,7 +5704,6 @@ void ScGridWindow::UpdateShrinkOverlay()
if(pOverlayManager)
{
- // Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
basegfx::B2DRange aRB(aPixRect.Left(), aPixRect.Top(), aPixRect.Right() + 1, aPixRect.Bottom() + 1);
@@ -5704,3 +5758,5 @@ void ScGridWindow::flushOverlayManager()
// ---------------------------------------------------------------------------
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 67cc1d318fdb..df6df29c9c00 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,6 @@
#include "docsh.hxx"
#include "viewdata.hxx"
#include "pivot.hxx"
-//CHINA001 #include "pfiltdlg.hxx"
#include "uiitems.hxx"
#include "scresid.hxx"
#include "sc.hrc"
@@ -58,16 +58,16 @@
#include "userlist.hxx"
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
#include <vector>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
using namespace com::sun::star;
using ::com::sun::star::sheet::DataPilotFieldOrientation;
using ::std::vector;
using ::std::auto_ptr;
-using ::std::hash_map;
+using ::boost::unordered_map;
using ::rtl::OUString;
using ::rtl::OUStringHash;
@@ -94,7 +94,7 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW
long nField = pDPObj->GetHeaderDim( ScAddress( nCol-1, nRow, nTab ), nOrient );
if ( nField >= 0 && nOrient == DataPilotFieldOrientation_PAGE )
{
- sal_Bool bIsDataLayout = sal_False;
+ sal_Bool bIsDataLayout = false;
String aFieldName = pDPObj->GetDimName( nField, bIsDataLayout );
if ( aFieldName.Len() && !bIsDataLayout )
return DataPilotFieldOrientation_PAGE;
@@ -107,7 +107,7 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW
long nField = pDPObj->GetHeaderDim(ScAddress(nCol, nRow, nTab), nOrient);
if (nField >= 0 && (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW) )
{
- sal_Bool bIsDataLayout = sal_False;
+ sal_Bool bIsDataLayout = false;
String aFieldName = pDPObj->GetDimName(nField, bIsDataLayout);
if (aFieldName.Len() && !bIsDataLayout)
return static_cast<DataPilotFieldOrientation>(nOrient);
@@ -124,7 +124,7 @@ sal_Bool ScGridWindow::DoPageFieldSelection( SCCOL nCol, SCROW nRow )
LaunchPageFieldMenu( nCol, nRow );
return sal_True;
}
- return sal_False;
+ return false;
}
bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt )
@@ -210,37 +210,34 @@ void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt
DBG_ASSERT(pDesc, "no sheet source for filter button");
if (pDesc)
{
- aQueryParam = pDesc->aQueryParam;
- nSrcTab = pDesc->aSourceRange.aStart.Tab();
+ aQueryParam = pDesc->GetQueryParam();
+ nSrcTab = pDesc->GetSourceRange().aStart.Tab();
}
SfxItemSet aArgSet( pViewData->GetViewShell()->GetPool(),
SCITEM_QUERYDATA, SCITEM_QUERYDATA );
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, pViewData, &aQueryParam ) );
-//CHINA001 ScPivotFilterDlg* pDlg = new ScPivotFilterDlg(
-//CHINA001 pViewData->GetViewShell()->GetDialogParent(),
-//CHINA001 aArgSet, nSrcTab );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScPivotFilterDlg* pDlg = pFact->CreateScPivotFilterDlg( pViewData->GetViewShell()->GetDialogParent(),
aArgSet, nSrcTab,
RID_SCDLG_PIVOTFILTER);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
- ScSheetSourceDesc aNewDesc;
+ ScSheetSourceDesc aNewDesc(pDoc);
if (pDesc)
aNewDesc = *pDesc;
const ScQueryItem& rQueryItem = pDlg->GetOutputItem();
- aNewDesc.aQueryParam = rQueryItem.GetQueryData();
+ aNewDesc.SetQueryParam(rQueryItem.GetQueryData());
ScDPObject aNewObj( *pDPObj );
aNewObj.SetSheetDesc( aNewDesc );
ScDBDocFunc aFunc( *pViewData->GetDocShell() );
- aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, false );
pViewData->GetView()->CursorPosChanged(); // shells may be switched
}
delete pDlg;
@@ -250,7 +247,7 @@ void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt
}
else
{
- DBG_ERROR("Da is ja garnix");
+ OSL_FAIL("Da is ja garnix");
}
}
@@ -266,7 +263,7 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, sal_Bool bMove )
// scroll window if at edges
//! move this to separate method
- sal_Bool bTimer = sal_False;
+ sal_Bool bTimer = false;
Point aPixel = rMEvt.GetPosPixel();
SCsCOL nDx = 0;
@@ -282,7 +279,7 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, sal_Bool bMove )
nDy = 1;
if ( nDx != 0 || nDy != 0 )
{
- UpdateDragRect( sal_False, Rectangle() );
+ UpdateDragRect( false, Rectangle() );
if ( nDx != 0)
pViewData->GetView()->ScrollX( nDx, WhichH(eWhich) );
@@ -359,7 +356,7 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, sal_Bool bMove )
aNewObj.SetSaveData( aSaveData );
ScDBDocFunc aFunc( *pViewData->GetDocShell() );
// when dragging fields, allow re-positioning (bAllowMove)
- aFunc.DataPilotUpdate( pDragDPObj, &aNewObj, sal_True, sal_False, sal_True );
+ aFunc.DataPilotUpdate( pDragDPObj, &aNewObj, sal_True, false, sal_True );
pViewData->GetView()->CursorPosChanged(); // shells may be switched
}
}
@@ -474,7 +471,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
const ScDPLabelData& rLabelData = pDPData->maDPParam.maLabelArray[pDPData->mnDim];
mpDPFieldPopup.reset(new ScDPFieldPopupWindow(this, pViewData->GetDocument()));
- mpDPFieldPopup->setName(OUString::createFromAscii("Pivot table field member popup"));
+ mpDPFieldPopup->setName(OUString(RTL_CONSTASCII_USTRINGPARAM("DataPilot field member popup")));
mpDPFieldPopup->setExtendedData(pDPData.release());
mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this));
{
@@ -546,8 +543,8 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
void ScGridWindow::UpdateDPFromFieldPopupMenu()
{
- typedef hash_map<OUString, OUString, OUStringHash> MemNameMapType;
- typedef hash_map<OUString, bool, OUStringHash> MemVisibilityType;
+ typedef boost::unordered_map<OUString, OUString, OUStringHash> MemNameMapType;
+ typedef boost::unordered_map<OUString, bool, OUStringHash> MemVisibilityType;
if (!mpDPFieldPopup.get())
return;
@@ -597,6 +594,22 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
aFunc.DataPilotUpdate(pDPObj, &aNewDPObj, true, false);
}
+void ScGridWindow::UpdateVisibleRange()
+{
+ SCCOL nPosX = pViewData->GetPosX(eHWhich);
+ SCROW nPosY = pViewData->GetPosY(eVWhich);
+ SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich);
+ if (nXRight > MAXCOL) nXRight = MAXCOL;
+ SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich);
+ if (nYBottom > MAXROW) nYBottom = MAXROW;
+
+ // Store the current visible range.
+ maVisibleRange.mnCol1 = nPosX;
+ maVisibleRange.mnCol2 = nXRight;
+ maVisibleRange.mnRow1 = nPosY;
+ maVisibleRange.mnRow2 = nYBottom;
+}
+
void ScGridWindow::DPMouseMove( const MouseEvent& rMEvt )
{
DPTestMouse( rMEvt, sal_True );
@@ -604,10 +617,10 @@ void ScGridWindow::DPMouseMove( const MouseEvent& rMEvt )
void ScGridWindow::DPMouseButtonUp( const MouseEvent& rMEvt )
{
- bDPMouse = sal_False;
+ bDPMouse = false;
ReleaseMouse();
- DPTestMouse( rMEvt, sal_False );
+ DPTestMouse( rMEvt, false );
SetPointer( Pointer( POINTER_ARROW ) );
}
@@ -626,19 +639,16 @@ void ScGridWindow::UpdateDragRect( sal_Bool bShowRange, const Rectangle& rPosRec
return; // everything unchanged
}
- // if ( bDragRect )
- // DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, sal_False );
if ( bShowRange )
{
nDragStartX = nStartX;
nDragStartY = nStartY;
nDragEndX = nEndX;
nDragEndY = nEndY;
- bDragRect = sal_True;
- // DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, sal_False );
+ bDragRect = true;
}
else
- bDragRect = sal_False;
+ bDragRect = false;
UpdateDragRectOverlay();
}
@@ -658,8 +668,8 @@ sal_uInt16 ScGridWindow::HitPageBreak( const Point& rMouse, ScRange* pSource,
ScPageBreakData* pPageData = pViewData->GetView()->GetPageBreakData();
if ( pPageData )
{
- sal_Bool bHori = sal_False;
- sal_Bool bVert = sal_False;
+ sal_Bool bHori = false;
+ sal_Bool bVert = false;
SCCOL nHitX = 0;
SCROW nHitY = 0;
@@ -786,7 +796,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
// Scrolling
- sal_Bool bTimer = sal_False;
+ sal_Bool bTimer = false;
Point aPos = rMEvt.GetPosPixel();
SCsCOL nDx = 0;
SCsROW nDy = 0;
@@ -801,9 +811,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
{
if ( bPagebreakDrawn ) // weginvertieren
{
- // DrawDragRect( aPagebreakDrag.aStart.Col(), aPagebreakDrag.aStart.Row(),
- // aPagebreakDrag.aEnd.Col(), aPagebreakDrag.aEnd.Row(), sal_False );
- bPagebreakDrawn = sal_False;
+ bPagebreakDrawn = false;
UpdateDragRectOverlay();
}
@@ -847,8 +855,8 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
if ( !bTop ) ++nPosY;
sal_Bool bBreak = ( nPagebreakMouse == SC_PD_BREAK_H || nPagebreakMouse == SC_PD_BREAK_V );
- sal_Bool bHide = sal_False;
- sal_Bool bToEnd = sal_False;
+ sal_Bool bHide = false;
+ sal_Bool bToEnd = false;
ScRange aDrawRange = aPagebreakSource;
if ( bBreak )
{
@@ -909,17 +917,13 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
if ( bPagebreakDrawn )
{
// weginvertieren
- // DrawDragRect( aPagebreakDrag.aStart.Col(), aPagebreakDrag.aStart.Row(),
- // aPagebreakDrag.aEnd.Col(), aPagebreakDrag.aEnd.Row(), sal_False );
- bPagebreakDrawn = sal_False;
+ bPagebreakDrawn = false;
}
aPagebreakDrag = aDrawRange;
if ( !bUp && !bHide )
{
// hininvertieren
- // DrawDragRect( aPagebreakDrag.aStart.Col(), aPagebreakDrag.aStart.Row(),
- // aPagebreakDrag.aEnd.Col(), aPagebreakDrag.aEnd.Row(), sal_False );
- bPagebreakDrawn = sal_True;
+ bPagebreakDrawn = true;
}
UpdateDragRectOverlay();
}
@@ -952,12 +956,12 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
if (pDoc->HasColBreak(static_cast<SCCOL>(nPagebreakBreak), nTab) & BREAK_MANUAL)
{
ScAddress aOldAddr( static_cast<SCCOL>(nPagebreakBreak), nPosY, nTab );
- pViewFunc->DeletePageBreak( sal_True, sal_True, &aOldAddr, sal_False );
+ pViewFunc->DeletePageBreak( sal_True, sal_True, &aOldAddr, false );
}
if ( !bHide && !bToEnd ) // am Ende nicht
{
ScAddress aNewAddr( static_cast<SCCOL>(nNew), nPosY, nTab );
- pViewFunc->InsertPageBreak( sal_True, sal_True, &aNewAddr, sal_False );
+ pViewFunc->InsertPageBreak( sal_True, sal_True, &aNewAddr, false );
}
if ( bGrow )
{
@@ -966,12 +970,12 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
if ( static_cast<SCCOL>(nPagebreakPrev) > aPagebreakSource.aStart.Col() && !bManualBreak )
{
ScAddress aPrev( static_cast<SCCOL>(nPagebreakPrev), nPosY, nTab );
- pViewFunc->InsertPageBreak( sal_True, sal_True, &aPrev, sal_False );
+ pViewFunc->InsertPageBreak( sal_True, sal_True, &aPrev, false );
}
if (!pDocSh->AdjustPrintZoom( ScRange(
static_cast<SCCOL>(nPagebreakPrev),0,nTab, static_cast<SCCOL>(nNew-1),0,nTab ) ))
- bGrow = sal_False;
+ bGrow = false;
}
}
else
@@ -979,12 +983,12 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
if (pDoc->HasRowBreak(nPagebreakBreak, nTab) & BREAK_MANUAL)
{
ScAddress aOldAddr( nPosX, nPagebreakBreak, nTab );
- pViewFunc->DeletePageBreak( sal_False, sal_True, &aOldAddr, sal_False );
+ pViewFunc->DeletePageBreak( false, sal_True, &aOldAddr, false );
}
if ( !bHide && !bToEnd ) // am Ende nicht
{
ScAddress aNewAddr( nPosX, nNew, nTab );
- pViewFunc->InsertPageBreak( sal_False, sal_True, &aNewAddr, sal_False );
+ pViewFunc->InsertPageBreak( false, sal_True, &aNewAddr, false );
}
if ( bGrow )
{
@@ -993,12 +997,12 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
if ( nPagebreakPrev > aPagebreakSource.aStart.Row() && !bManualBreak )
{
ScAddress aPrev( nPosX, nPagebreakPrev, nTab );
- pViewFunc->InsertPageBreak( sal_False, sal_True, &aPrev, sal_False );
+ pViewFunc->InsertPageBreak( false, sal_True, &aPrev, false );
}
if (!pDocSh->AdjustPrintZoom( ScRange(
0,nPagebreakPrev,nTab, 0,nNew-1,nTab ) ))
- bGrow = sal_False;
+ bGrow = false;
}
}
@@ -1044,7 +1048,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
else if (!bHide)
aPagebreakDrag.Format( aNewRanges, SCA_VALID );
- pViewFunc->SetPrintRanges( pDoc->IsPrintEntireSheet( nTab ), &aNewRanges, NULL, NULL, sal_False );
+ pViewFunc->SetPrintRanges( pDoc->IsPrintEntireSheet( nTab ), &aNewRanges, NULL, NULL, false );
}
}
@@ -1059,3 +1063,4 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index 295caae639af..7a0c4d215546 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,7 @@
sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr();
if (pDraw && !pViewData->IsRefMode())
{
@@ -88,7 +89,7 @@ sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt)
sal_Bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt)
{
ScViewFunc* pView = pViewData->GetView();
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
FuPoor* pDraw = pView->GetDrawFuncPtr();
if (pDraw && !pViewData->IsRefMode())
{
@@ -128,7 +129,7 @@ sal_Bool ScGridWindow::DrawMouseMove(const MouseEvent& rMEvt)
else
{
SetPointer( Pointer( POINTER_ARROW ) );
- return sal_False;
+ return false;
}
}
@@ -159,7 +160,7 @@ sal_Bool ScGridWindow::DrawCommand(const CommandEvent& rCEvt)
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt)
@@ -172,25 +173,25 @@ sal_Bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt)
sal_Bool bOldMarked = pDrView->AreObjectsMarked();
if (pDraw->KeyInput( rKEvt ))
{
- sal_Bool bLeaveDraw = sal_False;
+ sal_Bool bLeaveDraw = false;
sal_Bool bUsed = sal_True;
sal_Bool bNewMarked = pDrView->AreObjectsMarked();
if ( !pViewData->GetView()->IsDrawSelMode() )
if ( !bNewMarked )
{
- pViewData->GetViewShell()->SetDrawShell( sal_False );
+ pViewData->GetViewShell()->SetDrawShell( false );
bLeaveDraw = sal_True;
if ( !bOldMarked &&
rKEvt.GetKeyCode().GetCode() == KEY_DELETE )
- bUsed = sal_False; // nichts geloescht
+ bUsed = false; // nichts geloescht
}
if (!bLeaveDraw)
- UpdateStatusPosSize(); // #108137# for moving/resizing etc. by keyboard
+ UpdateStatusPosSize(); // for moving/resizing etc. by keyboard
return bUsed;
}
}
- return sal_False;
+ return false;
}
void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sal_uLong nLayer )
@@ -286,48 +287,19 @@ MapMode ScGridWindow::GetDrawMapMode( sal_Bool bForce )
return aDrawMode;
}
-//sal_Bool ScGridWindow::DrawBeforeScroll()
-//{
-// ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
-//
-// sal_Bool bXor = sal_False;
-// if (pDrView)
-// {
-// bXor=pDrView->IsShownXorVisible(this);
-// if (bXor) pDrView->HideShownXor(this);
-// }
-// return bXor;
-//}
-
-void ScGridWindow::DrawAfterScroll(/*sal_Bool bVal*/)
+void ScGridWindow::DrawAfterScroll(/*BOOL bVal*/)
{
Update(); // immer, damit das Verhalten mit/ohne DrawingLayer gleich ist
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
if (pDrView)
{
- //if (bVal)
- // pDrView->ShowShownXor(this);
-
OutlinerView* pOlView = pDrView->GetTextEditOutlinerView();
if (pOlView && pOlView->GetWindow() == this)
- pOlView->ShowCursor(sal_False); // ist beim Scrollen weggekommen
+ pOlView->ShowCursor(false); // ist beim Scrollen weggekommen
}
}
-//void ScGridWindow::DrawMarks()
-//{
-// ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
-// if (pDrView)
-// pDrView->DrawMarks(this);
-//}
-
-//sal_Bool ScGridWindow::NeedDrawMarks()
-//{
-// ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
-// return pDrView && pDrView->IsMarkHdlShown() && pDrView->AreObjectsMarked();
-//}
-
void ScGridWindow::CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress)
{
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
@@ -370,11 +342,11 @@ void ScGridWindow::UpdateStatusPosSize()
SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), SID_ATTR_POSITION, SID_ATTR_SIZE);
// Fill items for position and size:
- // #108137# show action rectangle during action,
+ // show action rectangle during action,
// position and size of selected object(s) if something is selected,
// mouse position otherwise
- sal_Bool bActionItem = sal_False;
+ sal_Bool bActionItem = false;
if ( pDrView->IsAction() ) // action rectangle
{
Rectangle aRect;
@@ -413,25 +385,9 @@ void ScGridWindow::UpdateStatusPosSize()
sal_Bool ScGridWindow::DrawHasMarkedObj()
{
ScDrawView* p = pViewData->GetScDrawView();
- return p ? p->AreObjectsMarked() : sal_False;
+ return p ? p->AreObjectsMarked() : false;
}
-//void ScGridWindow::DrawStartTimer()
-//{
- //ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
- //if (pDrView)
- //{
- /* jetzt in DrawMarks
- sal_uInt16 nWinNum = pDrView->FindWin(this);
- if (nWinNum!=SDRVIEWWIN_NOTFOUND)
- pDrView->AfterInitRedraw(nWinNum);
- */
-
- // pDrView->PostPaint();
- // pDrView->RestartAfterPaintTimer();
- //}
-//}
-
void ScGridWindow::DrawMarkDropObj( SdrObject* pObj )
{
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
@@ -441,3 +397,4 @@ void ScGridWindow::DrawMarkDropObj( SdrObject* pObj )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 8e0e964de821..57dc1dd9c22f 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,14 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
-
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
-
#include <svtools/colorcfg.hxx>
#include <editeng/colritem.hxx>
#include <editeng/editview.hxx>
@@ -78,18 +75,14 @@
// #i74769#
#include <svx/sdrpaintwindow.hxx>
-//#include "tabvwsh.hxx" //! Test !!!!
-
//------------------------------------------------------------------------
void lcl_LimitRect( Rectangle& rRect, const Rectangle& rVisible )
{
if ( rRect.Top() < rVisible.Top()-1 ) rRect.Top() = rVisible.Top()-1;
-// if ( rRect.Left() < rVisible.Left()-1 ) rRect.Left() = rVisible.Left()-1;
if ( rRect.Bottom() > rVisible.Bottom()+1 ) rRect.Bottom() = rVisible.Bottom()+1;
-// if ( rRect.Right() > rVisible.Right()+1 ) rRect.Right() = rVisible.Right()+1;
- // #51122# auch wenn das inner-Rectangle nicht sichtbar ist, muss evtl.
+ // auch wenn das inner-Rectangle nicht sichtbar ist, muss evtl.
// die Titelzeile gezeichnet werden, darum kein Rueckgabewert mehr.
// Wenn's weit daneben liegt, wird lcl_DrawOneFrame erst gar nicht gerufen.
}
@@ -156,13 +149,13 @@ void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel,
long nBHeight = nVer + aTextSize.Height() + 1;
Size aButSize( nBWidth, nBHeight );
long nButtonPos = bLayoutRTL ? aOuter.Left() : aOuter.Right()-nBWidth+1;
- aComboButton.Draw( Point(nButtonPos, nButtonY), aButSize, sal_False );
+ aComboButton.Draw( Point(nButtonPos, nButtonY), aButSize, false );
if (pButtonViewData)
pButtonViewData->SetScenButSize( aButSize );
long nTextStart = bLayoutRTL ? aInner.Right() - aTextSize.Width() + 1 : aInner.Left();
- sal_Bool bWasClip = sal_False;
+ sal_Bool bWasClip = false;
Region aOldClip;
sal_Bool bClip = ( aTextSize.Width() > aOuter.Right() - nBWidth - aInner.Left() );
if ( bClip )
@@ -214,17 +207,16 @@ void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, ScSplitP
ScMarkData aMarks;
for (SCTAB i=nTab+1; i<nTabCount && pDoc->IsScenario(i); i++)
- pDoc->MarkScenario( i, nTab, aMarks, sal_False, SC_SCENARIO_SHOWFRAME );
+ pDoc->MarkScenario( i, nTab, aMarks, false, SC_SCENARIO_SHOWFRAME );
ScRangeListRef xRanges = new ScRangeList;
- aMarks.FillRangeListWithMarks( xRanges, sal_False );
+ aMarks.FillRangeListWithMarks( xRanges, false );
sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
long nLayoutSign = bLayoutRTL ? -1 : 1;
- sal_uInt16 nRangeCount = (sal_uInt16)xRanges->Count();
- for (sal_uInt16 j=0; j<nRangeCount; j++)
+ for (size_t j = 0, n = xRanges->size(); j < n; ++j)
{
- ScRange aRange = *xRanges->GetObject(j);
+ ScRange aRange = *(*xRanges)[j];
// Szenario-Rahmen immer dann auf zusammengefasste Zellen erweitern, wenn
// dadurch keine neuen nicht-ueberdeckten Zellen mit umrandet werden
pDoc->ExtendTotalMerge( aRange );
@@ -288,7 +280,7 @@ void lcl_DrawHighlight( ScOutputData& rOutputData, ScViewData* pViewData,
rOutputData.DrawRefMark(
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(),
- pEntry->aColor, sal_False );
+ pEntry->aColor, false );
}
}
}
@@ -298,8 +290,6 @@ void lcl_DrawHighlight( ScOutputData& rOutputData, ScViewData* pViewData,
void ScGridWindow::DoInvertRect( const Rectangle& rPixel )
{
-// Invert( PixelToLogic(rPixel) );
-
if ( rPixel == aInvertRect )
aInvertRect = Rectangle(); // aufheben
else
@@ -314,7 +304,7 @@ void ScGridWindow::DoInvertRect( const Rectangle& rPixel )
//------------------------------------------------------------------------
-void __EXPORT ScGridWindow::PrePaint()
+void ScGridWindow::PrePaint()
{
// forward PrePaint to DrawingLayer
ScTabViewShell* pTabViewShell = pViewData->GetViewShell();
@@ -332,18 +322,8 @@ void __EXPORT ScGridWindow::PrePaint()
//------------------------------------------------------------------------
-void __EXPORT ScGridWindow::Paint( const Rectangle& rRect )
+void ScGridWindow::Paint( const Rectangle& rRect )
{
- //TODO/LATER: how to get environment? Do we need that?!
- /*
- ScDocShell* pDocSh = pViewData->GetDocShell();
- SvInPlaceEnvironment* pEnv = pDocSh->GetIPEnv();
- if (pEnv && pEnv->GetRectsChangedLockCount())
- {
- Invalidate(rRect);
- return;
- }*/
-
ScDocument* pDoc = pViewData->GetDocument();
if ( pDoc->IsInInterpreter() )
{
@@ -412,7 +392,7 @@ void __EXPORT ScGridWindow::Paint( const Rectangle& rRect )
Draw( nX1,nY1,nX2,nY2, SC_UPDATE_MARKS ); // nicht weiterzeichnen
- bIsInPaint = sal_False;
+ bIsInPaint = false;
}
//
@@ -423,7 +403,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
{
ScModule* pScMod = SC_MOD();
sal_Bool bTextWysiwyg = pScMod->GetInputOptions().GetTextWysiwyg();
- sal_Bool bGridFirst = sal_True; //! entscheiden!!!
+ sal_Bool bGridFirst = true; //! entscheiden!!!
if (pViewData->IsMinimized())
return;
@@ -433,32 +413,26 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
DBG_ASSERT( ValidCol(nX2) && ValidRow(nY2), "GridWin Draw Bereich zu gross" );
- SCCOL nPosX = pViewData->GetPosX( eHWhich );
- SCROW nPosY = pViewData->GetPosY( eVWhich );
- if (nX2 < nPosX || nY2 < nPosY)
- return; // unsichtbar
- if (nX1 < nPosX) nX1 = nPosX;
- if (nY1 < nPosY) nY1 = nPosY;
+ UpdateVisibleRange();
- SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich);
- if (nXRight > MAXCOL) nXRight = MAXCOL;
- SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich);
- if (nYBottom > MAXROW) nYBottom = MAXROW;
+ if (nX2 < maVisibleRange.mnCol1 || nY2 < maVisibleRange.mnRow1)
+ return;
+ // unsichtbar
+ if (nX1 < maVisibleRange.mnCol1)
+ nX1 = maVisibleRange.mnCol1;
+ if (nY1 < maVisibleRange.mnRow1)
+ nY1 = maVisibleRange.mnRow1;
- // Store the current visible range.
- maVisibleRange.mnCol1 = nPosX;
- maVisibleRange.mnCol2 = nXRight;
- maVisibleRange.mnRow1 = nPosY;
- maVisibleRange.mnRow2 = nYBottom;
+ if (nX1 > maVisibleRange.mnCol2 || nY1 > maVisibleRange.mnRow2)
+ return;
- if (nX1 > nXRight || nY1 > nYBottom)
- return; // unsichtbar
- if (nX2 > nXRight) nX2 = nXRight;
- if (nY2 > nYBottom) nY2 = nYBottom;
+ if (nX2 > maVisibleRange.mnCol2)
+ nX2 = maVisibleRange.mnCol2;
+ if (nY2 > maVisibleRange.mnRow2)
+ nY2 = maVisibleRange.mnRow2;
- if ( eMode != SC_UPDATE_MARKS )
- if (nX2 < nXRight)
- nX2 = nXRight; // zum Weiterzeichnen
+ if ( eMode != SC_UPDATE_MARKS && nX2 < maVisibleRange.mnCol2)
+ nX2 = maVisibleRange.mnCol2; // zum Weiterzeichnen
// ab hier kein return mehr
@@ -476,7 +450,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
long nLayoutSign = bLayoutRTL ? -1 : 1;
if ( bLayoutRTL )
{
- long nEndPixel = pViewData->GetScrPos( nX2+1, nPosY, eWhich ).X();
+ long nEndPixel = pViewData->GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X();
nMirrorWidth = aScrPos.X() - nEndPixel;
aScrPos.X() = nEndPixel + 1;
}
@@ -516,7 +490,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
ScTableInfo aTabInfo;
pDoc->FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab,
- nPPTX, nPPTY, sal_False, bFormulaMode,
+ nPPTX, nPPTY, false, bFormulaMode,
&pViewData->GetMarkData() );
//--------------------------------------------------------------------
@@ -553,7 +527,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
const svtools::ColorConfig& rColorCfg = pScMod->GetColorConfig();
- Color aGridColor( rColorCfg.GetColorValue( svtools::CALCGRID, sal_False ).nColor );
+ Color aGridColor( rColorCfg.GetColorValue( svtools::CALCGRID, false ).nColor );
if ( aGridColor.GetColor() == COL_TRANSPARENT )
{
// use view options' grid color only if color config has "automatic" color
@@ -567,12 +541,13 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.SetShowSpellErrors ( pDoc->GetDocOptions().IsAutoSpell() );
aOutputData.SetMarkClipped ( bMarkClipped );
- aOutputData.SetUseStyleColor( sal_True ); // always set in table view
+ aOutputData.SetUseStyleColor( true ); // always set in table view
aOutputData.SetEditObject( GetEditObject() );
aOutputData.SetViewShell( pViewData->GetViewShell() );
- sal_Bool bGrid = rOpts.GetOption( VOPT_GRID );
+ sal_Bool bGrid = rOpts.GetOption( VOPT_GRID ) && pViewData->GetShowGrid();
+
sal_Bool bPage = rOpts.GetOption( VOPT_PAGEBREAKS );
if ( eMode == SC_UPDATE_CHANGED )
@@ -601,13 +576,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
if ( nEditEndCol >= nX1 && nEditCol <= nX2 && nEditEndRow >= nY1 && nEditRow <= nY2 )
aOutputData.SetEditCell( nEditCol, nEditRow );
else
- bEditMode = sal_False;
-
- // nur Edit-Area zu zeichnen?
- //! dann muss trotzdem noch der Rand / das Gitter gemalt werden!
-
-// if ( nEditCol <= nX1 && nEditEndCol >= nX2 && nEditRow <= nY1 && nEditEndRow >= nY2 )
-// bOnlyEdit = sal_True;
+ bEditMode = false;
}
// define drawing layer map mode and paint rectangle
@@ -641,10 +610,6 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aDrawingRectLogic = PixelToLogic(aDrawingRectPixel, aDrawMode);
}
-// not necessary with overlay
-// if (bCurVis)
-// HideCursor();
-
OutputDevice* pContentDev = this; // device for document content, used by overlay manager
SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly
@@ -729,12 +694,13 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.SetSolidBackground(sal_True);
pContentDev->SetMapMode(MAP_PIXEL);
- aOutputData.DrawBackground();
+ aOutputData.DrawDocumentBackground();
if ( bGridFirst && ( bGrid || bPage ) )
aOutputData.DrawGrid( bGrid, bPage );
+ aOutputData.DrawBackground();
if ( bPageMode )
{
- // #87655# DrawPagePreview draws complete lines/page numbers, must always be clipped
+ // DrawPagePreview draws complete lines/page numbers, must always be clipped
if ( aOutputData.SetChangedClip() )
{
DrawPagePreview(nX1,nY1,nX2,nY2, pContentDev);
@@ -744,7 +710,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.DrawShadow();
aOutputData.DrawFrame();
if ( !bLogicText )
- aOutputData.DrawStrings(sal_False); // in pixel MapMode
+ aOutputData.DrawStrings(false); // in pixel MapMode
// edit cells and printer-metrics text must be before the buttons
// (DataPilot buttons contain labels in UI font)
@@ -818,63 +784,16 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
{
pContentDev->SetClipRegion();
}
-
- //sal_Bool bDraw = sal_True;
- //if (eMode == SC_UPDATE_CHANGED)
- // bDraw = NeedDrawMarks() && aOutputData.SetChangedClip();
- //if (bDraw)
- //{
- // DrawMarks();
- // if (eMode == SC_UPDATE_CHANGED)
- // pContentDev->SetClipRegion();
- //}
}
pContentDev->SetMapMode(MAP_PIXEL);
-#ifdef OLD_SELECTION_PAINT
- if (pViewData->IsActive())
- aOutputData.DrawMark( this );
-#endif
-
if ( pViewData->IsRefMode() && nTab >= pViewData->GetRefStartZ() && nTab <= pViewData->GetRefEndZ() )
{
- // The AutoFill shrink area has an own overlay now
-#if 0
- // Schraffur beim Loeschen per AutoFill
- if ( pViewData->GetRefType() == SC_REFTYPE_FILL )
- {
- ScRange aRange;
- if ( pViewData->GetDelMark( aRange ) )
- {
- if ( aRange.aStart.Col() < nX1 ) aRange.aStart.SetCol(nX1);
- if ( aRange.aEnd.Col() > nX2 ) aRange.aEnd.SetCol(nX2);
- if ( aRange.aStart.Row() < nY1 ) aRange.aStart.SetRow(nY1);
- if ( aRange.aEnd.Row() > nY2 ) aRange.aEnd.SetRow(nY2);
- if ( aRange.aStart.Col() <= aRange.aEnd.Col() &&
- aRange.aStart.Row() <= aRange.aEnd.Row() )
- {
- Point aStart = pViewData->GetScrPos( aRange.aStart.Col(),
- aRange.aStart.Row(), eWhich );
- Point aEnd = pViewData->GetScrPos( aRange.aEnd.Col()+1,
- aRange.aEnd.Row()+1, eWhich );
- aEnd.X() -= 1;
- aEnd.Y() -= 1;
-
- // Markierung aufheben - roter Rahmen bleibt stehen
- Rectangle aRect( aStart,aEnd );
- Invert( aRect, INVERT_HIGHLIGHT );
-
- //! Delete-Bereich extra kennzeichnen?!?!?
- }
- }
- }
-#endif
-
Color aRefColor( rColorCfg.GetColorValue(svtools::CALCREFERENCE).nColor );
aOutputData.DrawRefMark( pViewData->GetRefStartX(), pViewData->GetRefStartY(),
pViewData->GetRefEndX(), pViewData->GetRefEndY(),
- aRefColor, sal_False );
+ aRefColor, false );
}
// Range-Finder
@@ -963,8 +882,6 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
if ( pNoteMarker )
pNoteMarker->Draw(); // ueber den Cursor, im Drawing-MapMode
- //DrawStartTimer(); // fuer bunte Handles ohne System-Clipping
-
//
// Wenn waehrend des Paint etwas invertiert wurde (Selektion geaendert aus Basic-Macro),
// ist das jetzt durcheinandergekommen und es muss neu gemalt werden
@@ -982,7 +899,7 @@ void ScGridWindow::CheckNeedsRepaint()
if (bNeedsRepaint)
{
- bNeedsRepaint = sal_False;
+ bNeedsRepaint = false;
if (aRepaintPixel.IsEmpty())
Invalidate();
else
@@ -1009,15 +926,14 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
Color aManual( rColorCfg.GetColorValue(svtools::CALCPAGEBREAKMANUAL).nColor );
Color aAutomatic( rColorCfg.GetColorValue(svtools::CALCPAGEBREAK).nColor );
- String aPageText = ScGlobal::GetRscString( STR_PAGE );
+ String aPageStr = ScGlobal::GetRscString( STR_PGNUM );
if ( nPageScript == 0 )
{
// get script type of translated "Page" string only once
- nPageScript = pDoc->GetStringScriptType( aPageText );
+ nPageScript = pDoc->GetStringScriptType( aPageStr );
if (nPageScript == 0)
nPageScript = ScGlobal::GetDefaultScriptType();
}
- aPageText += ' ';
Font aFont;
ScEditEngineDefaulter* pEditEng = NULL;
@@ -1142,8 +1058,9 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
nPageNo += ((long)nColPos)*nRowBreaks+nRowPos;
else
nPageNo += ((long)nRowPos)*nColBreaks+nColPos;
- String aPageStr = aPageText;
- aPageStr += String::CreateFromInt32(nPageNo);
+
+ String aThisPageStr = aPageStr; // Don't modify the original string.
+ aThisPageStr.SearchAndReplaceAscii("%1", String::CreateFromInt32(nPageNo));
if ( pEditEng )
{
@@ -1152,7 +1069,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
- pEditEng->SetText( aPageStr );
+ pEditEng->SetText( aThisPageStr );
Size aSize100( pEditEng->CalcTextWidth(), pEditEng->GetTextHeight() );
// 40% of width or 60% of height
@@ -1174,7 +1091,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
// find right font size for DrawText
aFont.SetSize( Size( 0,100 ) );
pContentDev->SetFont( aFont );
- Size aSize100( pContentDev->GetTextWidth( aPageStr ), pContentDev->GetTextHeight() );
+ Size aSize100( pContentDev->GetTextWidth( aThisPageStr ), pContentDev->GetTextHeight() );
// 40% of width or 60% of height
long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width();
@@ -1183,10 +1100,10 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
pContentDev->SetFont( aFont );
// centered output with DrawText
- Size aTextSize( pContentDev->GetTextWidth( aPageStr ), pContentDev->GetTextHeight() );
+ Size aTextSize( pContentDev->GetTextWidth( aThisPageStr ), pContentDev->GetTextHeight() );
Point aPos( (aPageStart.X()+aPageEnd.X()-aTextSize.Width())/2,
(aPageStart.Y()+aPageEnd.Y()-aTextSize.Height())/2 );
- pContentDev->DrawText( aPos, aPageStr );
+ pContentDev->DrawText( aPos, aThisPageStr );
}
}
nPrStartX = nPrEndX + 1;
@@ -1252,7 +1169,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
pDBData->GetArea( nAreaTab, nStartCol, nStartRow, nEndCol, nEndRow );
if ( nCol >= nStartCol && nCol <= nEndCol &&
nRow >= nStartRow && nRow <= nEndRow )
- bNewData = sal_False;
+ bNewData = false;
}
if (bNewData)
{
@@ -1262,16 +1179,16 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
else
{
// can also be part of DataPilot table
- // DBG_ERROR("Auto-Filter-Button ohne DBData");
+ // OSL_FAIL("Auto-Filter-Button ohne DBData");
}
}
// pQueryParam kann nur MAXQUERY Eintraege enthalten
sal_Bool bSimpleQuery = sal_True;
- sal_Bool bColumnFound = sal_False;
+ sal_Bool bColumnFound = false;
if (!pQueryParam->bInplace)
- bSimpleQuery = sal_False;
+ bSimpleQuery = false;
for (nQuery=0; nQuery<MAXQUERY && bSimpleQuery; nQuery++)
if (pQueryParam->GetEntry(nQuery).bDoQuery)
{
@@ -1282,7 +1199,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
bColumnFound = sal_True;
if (nQuery > 0)
if (pQueryParam->GetEntry(nQuery).eConnect != SC_AND)
- bSimpleQuery = sal_False;
+ bSimpleQuery = false;
}
bool bArrowState = bSimpleQuery && bColumnFound;
@@ -1337,7 +1254,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
aComboButton.SetPosPixel( aRect.TopLeft() );
aComboButton.SetSizePixel( aRect.GetSize() );
pContentDev->SetClipRegion( aRect );
- aComboButton.Draw( sal_False, sal_False );
+ aComboButton.Draw( false, false );
pContentDev->SetClipRegion(); // always called from Draw() without clip region
aComboButton.SetPosPixel( aOldPos ); // restore old state
aComboButton.SetSizePixel( aOldSize ); // for MouseUp/Down (AutoFilter)
@@ -1408,15 +1325,15 @@ sal_Bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab )
pDBData->GetQueryParam( aQueryParam );
else
{
- DBG_ERROR("Auto-Filter-Button ohne DBData");
+ OSL_FAIL("Auto-Filter-Button ohne DBData");
}
sal_Bool bSimpleQuery = sal_True;
- sal_Bool bColumnFound = sal_False;
+ sal_Bool bColumnFound = false;
SCSIZE nQuery;
if ( !aQueryParam.bInplace )
- bSimpleQuery = sal_False;
+ bSimpleQuery = false;
// aQueryParam kann nur MAXQUERY Eintraege enthalten
@@ -1428,47 +1345,12 @@ sal_Bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab )
if (nQuery > 0)
if (aQueryParam.GetEntry(nQuery).eConnect != SC_AND)
- bSimpleQuery = sal_False;
+ bSimpleQuery = false;
}
return ( bSimpleQuery && bColumnFound );
}
-void ScGridWindow::DrawComboButton( const Point& rCellPos,
- long nCellSizeX,
- long nCellSizeY,
- sal_Bool bArrowState,
- sal_Bool bBtnIn )
-{
- Point aScrPos = rCellPos;
- Size aBtnSize = aComboButton.GetSizePixel();
-
- if ( nCellSizeX < aBtnSize.Width() || nCellSizeY < aBtnSize.Height() )
- {
- if ( nCellSizeX < aBtnSize.Width() )
- aBtnSize.Width() = nCellSizeX;
-
- if ( nCellSizeY < aBtnSize.Height() )
- aBtnSize.Height() = nCellSizeY;
-
- aComboButton.SetSizePixel( aBtnSize );
- }
-
- sal_Bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
-
- if ( bLayoutRTL )
- aScrPos.X() -= nCellSizeX - 1;
- else
- aScrPos.X() += nCellSizeX - aBtnSize.Width();
- aScrPos.Y() += nCellSizeY - aBtnSize.Height();
-
- aComboButton.SetPosPixel( aScrPos );
-
- HideCursor();
- aComboButton.Draw( bArrowState, bBtnIn );
- ShowCursor();
-}
-
void ScGridWindow::InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
sal_Bool bTestMerge, sal_Bool bRepeat )
{
@@ -1520,11 +1402,11 @@ void ScGridWindow::InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
long nScrY = aScrPos.Y();
- sal_Bool bWasHidden = sal_False;
+ sal_Bool bWasHidden = false;
for (SCROW nY=nY1; nY<=nY2; nY++)
{
sal_Bool bFirstRow = ( nY == nPosY ); // first visible row?
- sal_Bool bDoHidden = sal_False; // versteckte nachholen ?
+ sal_Bool bDoHidden = false; // versteckte nachholen ?
sal_uInt16 nHeightTwips = pDoc->GetRowHeight( nY,nTab );
sal_Bool bDoRow = ( nHeightTwips != 0 );
if (bDoRow)
@@ -1532,12 +1414,11 @@ void ScGridWindow::InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
if (bTestMerge)
if (bWasHidden) // auf versteckte zusammengefasste testen
{
-// --nY; // nY geaendert -> vorherige zeichnen
- bDoHidden = sal_True;
- bDoRow = sal_True;
+ bDoHidden = true;
+ bDoRow = true;
}
- bWasHidden = sal_False;
+ bWasHidden = false;
}
else
{
@@ -1645,11 +1526,8 @@ void ScGridWindow::InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
{
- // transformed from ScGridWindow::InvertSimple
-
-// ScMarkData& rMark = pViewData->GetMarkData();
ScMarkData aMultiMark( pViewData->GetMarkData() );
- aMultiMark.SetMarking( sal_False );
+ aMultiMark.SetMarking( false );
aMultiMark.MarkToMulti();
ScDocument* pDoc = pViewData->GetDocument();
@@ -1699,8 +1577,6 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
if (nX2 > nXRight) nX2 = nXRight;
if (nY2 > nYBottom) nY2 = nYBottom;
-// MapMode aOld = GetMapMode(); SetMapMode(MAP_PIXEL); // erst nach den return's !!!
-
double nPPTX = pViewData->GetPPTX();
double nPPTY = pViewData->GetPPTY();
@@ -1708,11 +1584,11 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
long nScrY = aScrPos.Y();
- sal_Bool bWasHidden = sal_False;
+ sal_Bool bWasHidden = false;
for (SCROW nY=nY1; nY<=nY2; nY++)
{
sal_Bool bFirstRow = ( nY == nPosY ); // first visible row?
- sal_Bool bDoHidden = sal_False; // versteckte nachholen ?
+ sal_Bool bDoHidden = false; // versteckte nachholen ?
sal_uInt16 nHeightTwips = pDoc->GetRowHeight( nY,nTab );
sal_Bool bDoRow = ( nHeightTwips != 0 );
if (bDoRow)
@@ -1724,7 +1600,7 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
bDoRow = sal_True;
}
- bWasHidden = sal_False;
+ bWasHidden = false;
}
else
{
@@ -1822,200 +1698,6 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
nScrY = nEndY + 1;
}
}
-
-// aInvert.Flush(); // before restoring MapMode
-}
-
-// -------------------------------------------------------------------------
-
-//UNUSED2008-05 void ScGridWindow::DrawDragRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( nX2 < pViewData->GetPosX(eHWhich) || nY2 < pViewData->GetPosY(eVWhich) )
-//UNUSED2008-05 return;
-//UNUSED2008-05
-//UNUSED2008-05 Update(); // wegen XOR
-//UNUSED2008-05
-//UNUSED2008-05 MapMode aOld = GetMapMode(); SetMapMode(MAP_PIXEL);
-//UNUSED2008-05
-//UNUSED2008-05 SCTAB nTab = pViewData->GetTabNo();
-//UNUSED2008-05
-//UNUSED2008-05 SCCOL nPosX = pViewData->GetPosX(WhichH(eWhich));
-//UNUSED2008-05 SCROW nPosY = pViewData->GetPosY(WhichV(eWhich));
-//UNUSED2008-05 if (nX1 < nPosX) nX1 = nPosX;
-//UNUSED2008-05 if (nX2 < nPosX) nX2 = nPosX;
-//UNUSED2008-05 if (nY1 < nPosY) nY1 = nPosY;
-//UNUSED2008-05 if (nY2 < nPosY) nY2 = nPosY;
-//UNUSED2008-05
-//UNUSED2008-05 Point aScrPos( pViewData->GetScrPos( nX1, nY1, eWhich ) );
-//UNUSED2008-05
-//UNUSED2008-05 long nSizeXPix=0;
-//UNUSED2008-05 long nSizeYPix=0;
-//UNUSED2008-05 ScDocument* pDoc = pViewData->GetDocument();
-//UNUSED2008-05 double nPPTX = pViewData->GetPPTX();
-//UNUSED2008-05 double nPPTY = pViewData->GetPPTY();
-//UNUSED2008-05 SCCOLROW i;
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
-//UNUSED2008-05 long nLayoutSign = bLayoutRTL ? -1 : 1;
-//UNUSED2008-05
-//UNUSED2008-05 if (ValidCol(nX2) && nX2>=nX1)
-//UNUSED2008-05 for (i=nX1; i<=nX2; i++)
-//UNUSED2008-05 nSizeXPix += ScViewData::ToPixel( pDoc->GetColWidth( static_cast<SCCOL>(i), nTab ), nPPTX );
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 aScrPos.X() -= nLayoutSign;
-//UNUSED2008-05 nSizeXPix += 2;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 if (ValidRow(nY2) && nY2>=nY1)
-//UNUSED2008-05 for (i=nY1; i<=nY2; i++)
-//UNUSED2008-05 nSizeYPix += ScViewData::ToPixel( pDoc->GetRowHeight( i, nTab ), nPPTY );
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 aScrPos.Y() -= 1;
-//UNUSED2008-05 nSizeYPix += 2;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 aScrPos.X() -= 2 * nLayoutSign;
-//UNUSED2008-05 aScrPos.Y() -= 2;
-//UNUSED2008-05 // Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) );
-//UNUSED2008-05 Rectangle aRect( aScrPos.X(), aScrPos.Y(),
-//UNUSED2008-05 aScrPos.X() + ( nSizeXPix + 2 ) * nLayoutSign, aScrPos.Y() + nSizeYPix + 2 );
-//UNUSED2008-05 if ( bLayoutRTL )
-//UNUSED2008-05 {
-//UNUSED2008-05 aRect.Left() = aRect.Right(); // end position is left
-//UNUSED2008-05 aRect.Right() = aScrPos.X();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 Invert(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ));
-//UNUSED2008-05 Invert(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ));
-//UNUSED2008-05 Invert(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ));
-//UNUSED2008-05 Invert(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ));
-//UNUSED2008-05
-//UNUSED2008-05 SetMapMode(aOld);
-//UNUSED2008-05 }
-
-// -------------------------------------------------------------------------
-
-void ScGridWindow::DrawCursor()
-{
-// #114409#
-// SCTAB nTab = pViewData->GetTabNo();
-// SCCOL nX = pViewData->GetCurX();
-// SCROW nY = pViewData->GetCurY();
-//
-// // in verdeckten Zellen nicht zeichnen
-//
-// ScDocument* pDoc = pViewData->GetDocument();
-// const ScPatternAttr* pPattern = pDoc->GetPattern(nX,nY,nTab);
-// const ScMergeFlagAttr& rMerge = (const ScMergeFlagAttr&) pPattern->GetItem(ATTR_MERGE_FLAG);
-// if (rMerge.IsOverlapped())
-// return;
-//
-// // links/oben ausserhalb des Bildschirms ?
-//
-// sal_Bool bVis = ( nX>=pViewData->GetPosX(eHWhich) && nY>=pViewData->GetPosY(eVWhich) );
-// if (!bVis)
-// {
-// SCCOL nEndX = nX;
-// SCROW nEndY = nY;
-// ScDocument* pDoc = pViewData->GetDocument();
-// const ScMergeAttr& rMerge = (const ScMergeAttr&) pPattern->GetItem(ATTR_MERGE);
-// if (rMerge.GetColMerge() > 1)
-// nEndX += rMerge.GetColMerge()-1;
-// if (rMerge.GetRowMerge() > 1)
-// nEndY += rMerge.GetRowMerge()-1;
-// bVis = ( nEndX>=pViewData->GetPosX(eHWhich) && nEndY>=pViewData->GetPosY(eVWhich) );
-// }
-//
-// if ( bVis )
-// {
-// // hier kein Update, da aus Paint gerufen und laut Zaehler Cursor schon da
-// // wenn Update noetig, dann bei Hide/Showcursor vor dem Hoch-/Runterzaehlen
-//
-// MapMode aOld = GetMapMode(); SetMapMode(MAP_PIXEL);
-//
-// Point aScrPos = pViewData->GetScrPos( nX, nY, eWhich, sal_True );
-// sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
-//
-// // completely right of/below the screen?
-// // (test with logical start position in aScrPos)
-// sal_Bool bMaybeVisible;
-// if ( bLayoutRTL )
-// bMaybeVisible = ( aScrPos.X() >= -2 && aScrPos.Y() >= -2 );
-// else
-// {
-// Size aOutSize = GetOutputSizePixel();
-// bMaybeVisible = ( aScrPos.X() <= aOutSize.Width() + 2 && aScrPos.Y() <= aOutSize.Height() + 2 );
-// }
-// if ( bMaybeVisible )
-// {
-// long nSizeXPix;
-// long nSizeYPix;
-// pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
-//
-// if ( bLayoutRTL )
-// aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring
-//
-// sal_Bool bFix = ( pViewData->GetHSplitMode() == SC_SPLIT_FIX ||
-// pViewData->GetVSplitMode() == SC_SPLIT_FIX );
-// if ( pViewData->GetActivePart()==eWhich || bFix )
-// {
-// // old UNX version with two Invert calls causes flicker.
-// // if optimization is needed, a new flag should be added
-// // to InvertTracking
-//
-// aScrPos.X() -= 2;
-// aScrPos.Y() -= 2;
-// Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) );
-//
-// Invert(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ));
-// Invert(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ));
-// Invert(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ));
-// Invert(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ));
-// }
-// else
-// {
-// Rectangle aRect( aScrPos, Size( nSizeXPix - 1, nSizeYPix - 1 ) );
-// Invert( aRect );
-// }
-// }
-//
-// SetMapMode(aOld);
-// }
-}
-
- // AutoFill-Anfasser:
-
-void ScGridWindow::DrawAutoFillMark()
-{
-// #114409#
-// if ( bAutoMarkVisible && aAutoMarkPos.Tab() == pViewData->GetTabNo() )
-// {
-// SCCOL nX = aAutoMarkPos.Col();
-// SCROW nY = aAutoMarkPos.Row();
-// SCTAB nTab = pViewData->GetTabNo();
-// ScDocument* pDoc = pViewData->GetDocument();
-// sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
-//
-// Point aFillPos = pViewData->GetScrPos( nX, nY, eWhich, sal_True );
-// long nSizeXPix;
-// long nSizeYPix;
-// pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
-// if ( bLayoutRTL )
-// aFillPos.X() -= nSizeXPix + 3;
-// else
-// aFillPos.X() += nSizeXPix - 2;
-//
-// aFillPos.Y() += nSizeYPix;
-// aFillPos.Y() -= 2;
-// Rectangle aFillRect( aFillPos, Size(6,6) );
-// // Anfasser von Zeichenobjekten sind 7*7
-//
-// MapMode aOld = GetMapMode(); SetMapMode(MAP_PIXEL);
-// Invert( aFillRect );
-// SetMapMode(aOld);
-// }
}
// -------------------------------------------------------------------------
@@ -2064,6 +1746,4 @@ void ScGridWindow::DataChanged( const DataChangedEvent& rDCEvt )
}
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 06e0e7f02f0e..e5cfd3c8eb05 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,7 +86,7 @@ ScHideTextCursor::~ScHideTextCursor()
{
// restore text cursor
if ( pViewData->HasEditView(eWhich) && pWin->HasFocus() )
- pViewData->GetEditView(eWhich)->ShowCursor( sal_False, sal_True );
+ pViewData->GetEditView(eWhich)->ShowCursor( false, sal_True );
}
}
@@ -93,14 +94,14 @@ ScHideTextCursor::~ScHideTextCursor()
sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKeyboard )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
ScAddress aCellPos( nPosX, nPosY, nTab );
String aTrackText;
- sal_Bool bLeftEdge = sal_False;
+ sal_Bool bLeftEdge = false;
// Change-Tracking
@@ -202,17 +203,17 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey
if ( (aTrackText.Len() > 0) || (pNote && !pNote->IsCaptionShown()) )
{
sal_Bool bNew = sal_True;
- sal_Bool bFast = sal_False;
+ sal_Bool bFast = false;
if ( pNoteMarker ) // schon eine Notiz angezeigt
{
if ( pNoteMarker->GetDocPos() == aCellPos ) // dieselbe
- bNew = sal_False; // dann stehenlassen
+ bNew = false; // dann stehenlassen
else
bFast = sal_True; // sonst sofort
// marker which was shown for ctrl-F1 isn't removed by mouse events
if ( pNoteMarker->IsByKeyboard() && !bKeyboard )
- bNew = sal_False;
+ bNew = false;
}
if ( bNew )
{
@@ -256,11 +257,11 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey
void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
sal_Bool bHelpEnabled = ( rHEvt.GetMode() & ( HELPMODE_BALLOON | HELPMODE_QUICK ) ) != 0;
SdrView* pDrView = pViewData->GetScDrawView();
- sal_Bool bDrawTextEdit = sal_False;
+ sal_Bool bDrawTextEdit = false;
if (pDrView)
bDrawTextEdit = pDrView->IsTextEdit();
@@ -273,7 +274,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
SCsROW nPosY;
pViewData->GetPosFromPixel( aPosPixel.X(), aPosPixel.Y(), eWhich, nPosX, nPosY );
- if ( ShowNoteMarker( nPosX, nPosY, sal_False ) )
+ if ( ShowNoteMarker( nPosX, nPosY, false ) )
{
Window::RequestHelp( rHEvt ); // alte Tip/Balloon ausschalten
bDone = sal_True;
@@ -315,7 +316,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
if ( pIMapObj )
{
- // #44990# Bei ImageMaps die Description anzeigen, wenn vorhanden
+ // Bei ImageMaps die Description anzeigen, wenn vorhanden
aHelpText = pIMapObj->GetAltText();
if (!aHelpText.Len())
aHelpText = pIMapObj->GetURL();
@@ -343,14 +344,12 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
pObj = pHit;
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
{
aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
aHelpText = pInfo->GetHlink();
}
-#endif
}
}
}
@@ -375,7 +374,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
ScHideTextCursor aHideCursor( pViewData, eWhich ); // MapMode is changed in GetEditArea
// bForceToTop = sal_False, use the cell's real position
- aPixRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, sal_False );
+ aPixRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, false );
}
}
@@ -437,3 +436,5 @@ com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
return xAccessible;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index a3f30ba7ba59..c8f6a4577158 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,16 +75,16 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn
nSize ( nNewSize ),
nMarkStart ( 0 ),
nMarkEnd ( 0 ),
- bMarkRange ( sal_False ),
- bDragging ( sal_False ),
- bIgnoreMove ( sal_False )
+ bMarkRange ( false ),
+ bDragging ( false ),
+ bIgnoreMove ( false )
{
// --- RTL --- no default mirroring for this window, the spreadsheet itself
// is also not mirrored
- // #107811# mirror the vertical window for correct border drawing
- // #106948# table layout depends on sheet format, not UI setting, so the
+ // mirror the vertical window for correct border drawing
+ // table layout depends on sheet format, not UI setting, so the
// borders of the vertical window have to be handled manually, too.
- EnableRTL( sal_False );
+ EnableRTL( false );
aNormFont = GetFont();
aNormFont.SetTransparent( sal_True ); //! WEIGHT_NORMAL hart setzen ???
@@ -148,7 +149,7 @@ void ScHeaderControl::SetMark( sal_Bool bNewSet, SCCOLROW nNewStart, SCCOLROW nN
{
sal_Bool bEnabled = SC_MOD()->GetInputOptions().GetMarkHeader(); //! cachen?
if (!bEnabled)
- bNewSet = sal_False;
+ bNewSet = false;
// Variablen setzen
@@ -290,12 +291,10 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
long nLayoutSign = bLayoutRTL ? -1 : 1;
sal_Bool bMirrored = IsMirrored();
-// const FunctionSet* pFuncSet = pSelEngine->GetFunctionSet();
String aString;
sal_uInt16 nBarSize;
Point aScrPos;
Size aTextSize;
-// Size aSize = GetOutputSizePixel();
if (bVertical)
nBarSize = (sal_uInt16) GetSizePixel().Width();
@@ -328,7 +327,6 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
// aeussere Linien komplett durchzeichnen
// Zuerst Ende der letzten Zelle finden
-// long nLineEnd = -1;
long nLineEnd = nInitScrPos - nLayoutSign;
for (SCCOLROW i=nPos; i<nSize; i++)
@@ -421,15 +419,6 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
}
}
-#if 0
- // 3D border is no longer used
- SetLineColor( rStyleSettings.GetLightColor() );
- if (bVertical)
- DrawLine( Point( 0, nPStart ), Point( 0, nLineEnd ) );
- else
- DrawLine( Point( nPStart, 0 ), Point( nLineEnd, 0 ) );
-#endif
-
SetLineColor( rStyleSettings.GetDarkShadowColor() );
if (bVertical)
{
@@ -481,7 +470,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign && bHighContrast && !bDark )
{
// Transparent selection background is drawn after lines, before text.
- // #109814# Use DrawSelectionBackground to make sure there is a visible
+ // Use DrawSelectionBackground to make sure there is a visible
// difference. The case of a dark face color, where DrawSelectionBackground
// would just paint over the lines, is handled separately (bDark).
// Otherwise, GetHighlightColor is used with 80% transparency.
@@ -494,7 +483,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
else
aTransRect = Rectangle( nTransStart, 0, nTransEnd, nBarSize-1 );
SetBackground( Color( rStyleSettings.GetFaceColor() ) );
- DrawSelectionBackground( aTransRect, 0, sal_True, sal_False, sal_False );
+ DrawSelectionBackground( aTransRect, 0, sal_True, false, false );
SetBackground();
}
break;
@@ -611,7 +600,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorder )
{
- sal_Bool bFound=sal_False;
+ sal_Bool bFound=false;
SCCOLROW nCount = 1;
SCCOLROW nPos = GetPos();
SCCOLROW nHitNo = nPos;
@@ -630,8 +619,6 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorde
{
SCCOLROW nEntryNo = nCount + nPos;
-// nScrPos = GetScrPos( nEntryNo ) - 1;
-
if (nEntryNo > nSize)
nScrPos = nEndPos + nLayoutSign;
else
@@ -697,7 +684,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
if (IsDisabled())
return;
- bIgnoreMove = sal_False;
+ bIgnoreMove = false;
SelectWindow();
sal_Bool bFound;
@@ -724,10 +711,9 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
ShowDragHelp();
DrawInvert( nDragPos );
- // CaptureMouse();
StartTracking();
bDragging = sal_True;
- bDragMoved = sal_False;
+ bDragMoved = false;
}
}
else if (rMEvt.IsLeft())
@@ -744,7 +730,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
SetMarking( sal_True ); // muss vor SelMouseButtonDown sein
pSelEngine->SelMouseButtonDown( rMEvt );
- // #74215# In column/row headers a simple click already is a selection.
+ // In column/row headers a simple click already is a selection.
// -> Call SelMouseMove to ensure CreateAnchor is called (and DestroyAnchor
// if the next click is somewhere else with Control key).
pSelEngine->SelMouseMove( rMEvt );
@@ -764,16 +750,14 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& rMEvt )
if ( IsDisabled() )
return;
- SetMarking( sal_False );
- bIgnoreMove = sal_False;
-// sal_Bool bFound;
-// SCCOLROW nHitNo = GetMousePos( rMEvt, bFound );
+ SetMarking( false );
+ bIgnoreMove = false;
if ( bDragging )
{
DrawInvert( nDragPos );
ReleaseMouse();
- bDragging = sal_False;
+ bDragging = false;
long nScrPos = GetScrPos( nDragNo );
long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
@@ -901,13 +885,9 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
sal::static_int_cast<SCCOL>(nPos), MAXROW, nTab );
// see if any part of the range is already selected
- sal_Bool bSelected = sal_False;
ScRangeList aRanges;
- pViewData->GetMarkData().FillRangeListWithMarks( &aRanges, sal_False );
- sal_uLong nRangeCount = aRanges.Count();
- for (sal_uLong i=0; i<nRangeCount && !bSelected; i++)
- if ( aRanges.GetObject(i)->Intersects( aNewRange ) )
- bSelected = sal_True;
+ pViewData->GetMarkData().FillRangeListWithMarks( &aRanges, false );
+ bool bSelected = aRanges.Intersects(aNewRange);
// select the range if no part of it was selected
if ( !bSelected )
@@ -929,13 +909,13 @@ void ScHeaderControl::StopMarking()
if ( bDragging )
{
DrawInvert( nDragPos );
- bDragging = sal_False;
+ bDragging = false;
}
- SetMarking( sal_False );
+ SetMarking( false );
bIgnoreMove = sal_True;
- // #86260# don't call pSelEngine->Reset, so selection across the parts of
+ // don't call pSelEngine->Reset, so selection across the parts of
// a split/frozen view is possible
ReleaseMouse();
@@ -1007,17 +987,17 @@ SCCOLROW ScHeaderControl::GetHiddenCount( SCCOLROW nEntryNo )
sal_Bool ScHeaderControl::IsLayoutRTL()
{
- return sal_False;
+ return false;
}
sal_Bool ScHeaderControl::IsMirrored()
{
- return sal_False;
+ return false;
}
sal_Bool ScHeaderControl::IsDisabled()
{
- return sal_False;
+ return false;
}
sal_Bool ScHeaderControl::ResizeAllowed()
@@ -1044,3 +1024,4 @@ void ScHeaderControl::SetMarking( sal_Bool /* bSet */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 1828cbd83e55..595531ac8655 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,7 +92,7 @@ ScHintWindow::~ScHintWindow()
}
-void __EXPORT ScHintWindow::Paint( const Rectangle& /* rRect */ )
+void ScHintWindow::Paint( const Rectangle& /* rRect */ )
{
SetFont( aHeadFont );
DrawText( Point(HINT_MARGIN,HINT_MARGIN), aTitle );
@@ -106,3 +107,5 @@ void __EXPORT ScHintWindow::Paint( const Rectangle& /* rRect */ )
aLineStart.Y() += nTextHeight;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/imapwrap.cxx b/sc/source/ui/view/imapwrap.cxx
index 0d1321e61709..3be7c801049d 100644
--- a/sc/source/ui/view/imapwrap.cxx
+++ b/sc/source/ui/view/imapwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@ const ImageMap& ScIMapDlgGetMap( SvxIMapDlg* pDlg )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/invmerge.cxx b/sc/source/ui/view/invmerge.cxx
index 587462d59267..c65b29ba1a6e 100644
--- a/sc/source/ui/view/invmerge.cxx
+++ b/sc/source/ui/view/invmerge.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -163,7 +164,7 @@ void ScInvertMerger::AddRect( const Rectangle& rRect )
}
else
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if ( aJustified.Top() == aLineRect.Top() &&
aJustified.Bottom() == aLineRect.Bottom() )
{
@@ -190,3 +191,4 @@ void ScInvertMerger::AddRect( const Rectangle& rRect )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/makefile.mk b/sc/source/ui/view/makefile.mk
index 1b2fef913fc2..f00db352cebe 100644
--- a/sc/source/ui/view/makefile.mk
+++ b/sc/source/ui/view/makefile.mk
@@ -31,9 +31,7 @@ TARGET=view
# --- Settings -----------------------------------------------------
-.INCLUDE : scpre.mk
.INCLUDE : settings.mk
-.INCLUDE : sc.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
@@ -41,22 +39,67 @@ TARGET=view
SLOFILES = \
+ $(EXCEPTIONSFILES) \
+ $(SLO)$/cellmergeoption.obj
+
+EXCEPTIONSFILES= \
+ $(SLO)$/auditsh.obj \
+ $(SLO)$/cellsh.obj \
+ $(SLO)$/cellsh1.obj \
+ $(SLO)$/cellsh2.obj \
+ $(SLO)$/cellsh3.obj \
+ $(SLO)$/cellsh4.obj \
+ $(SLO)$/colrowba.obj \
+ $(SLO)$/dbfunc.obj \
+ $(SLO)$/dbfunc2.obj \
+ $(SLO)$/dbfunc3.obj \
+ $(SLO)$/dbfunc4.obj \
+ $(SLO)$/drawutil.obj \
+ $(SLO)$/drawvie2.obj \
+ $(SLO)$/drawvie3.obj \
+ $(SLO)$/drawvie4.obj \
+ $(SLO)$/drawview.obj \
+ $(SLO)$/editsh.obj \
+ $(SLO)$/formatsh.obj \
+ $(SLO)$/galwrap.obj \
+ $(SLO)$/gridmerg.obj \
+ $(SLO)$/gridwin.obj \
+ $(SLO)$/gridwin2.obj \
+ $(SLO)$/gridwin3.obj \
+ $(SLO)$/gridwin4.obj \
+ $(SLO)$/gridwin5.obj \
+ $(SLO)$/hdrcont.obj \
+ $(SLO)$/hintwin.obj \
+ $(SLO)$/imapwrap.obj \
+ $(SLO)$/invmerge.obj \
+ $(SLO)$/notemark.obj \
+ $(SLO)$/olinewin.obj \
+ $(SLO)$/olkact.obj \
+ $(SLO)$/output.obj \
+ $(SLO)$/output2.obj \
+ $(SLO)$/output3.obj \
+ $(SLO)$/overlayobject.obj \
+ $(SLO)$/pfuncache.obj \
+ $(SLO)$/pgbrksh.obj \
+ $(SLO)$/pivotsh.obj \
+ $(SLO)$/preview.obj \
+ $(SLO)$/prevloc.obj \
+ $(SLO)$/prevwsh.obj \
+ $(SLO)$/prevwsh2.obj \
+ $(SLO)$/printfun.obj \
+ $(SLO)$/reffact.obj \
+ $(SLO)$/scextopt.obj \
+ $(SLO)$/select.obj \
+ $(SLO)$/selectionstate.obj \
+ $(SLO)$/spelldialog.obj \
+ $(SLO)$/spelleng.obj \
+ $(SLO)$/tabcont.obj \
+ $(SLO)$/tabsplit.obj \
$(SLO)$/tabview.obj \
$(SLO)$/tabview2.obj \
$(SLO)$/tabview3.obj \
$(SLO)$/tabview4.obj \
$(SLO)$/tabview5.obj \
- $(SLO)$/viewfunc.obj \
- $(SLO)$/viewfun2.obj \
- $(SLO)$/viewfun3.obj \
- $(SLO)$/viewfun4.obj \
- $(SLO)$/viewfun5.obj \
- $(SLO)$/viewfun6.obj \
- $(SLO)$/viewfun7.obj \
- $(SLO)$/dbfunc.obj \
- $(SLO)$/dbfunc2.obj \
- $(SLO)$/dbfunc3.obj \
- $(SLO)$/dbfunc4.obj \
$(SLO)$/tabvwsh.obj \
$(SLO)$/tabvwsh2.obj \
$(SLO)$/tabvwsh3.obj \
@@ -72,56 +115,16 @@ SLOFILES = \
$(SLO)$/tabvwshf.obj \
$(SLO)$/tabvwshg.obj \
$(SLO)$/tabvwshh.obj \
- $(SLO)$/printfun.obj \
- $(SLO)$/pfuncache.obj \
- $(SLO)$/preview.obj \
- $(SLO)$/prevwsh.obj \
- $(SLO)$/prevwsh2.obj \
- $(SLO)$/prevloc.obj \
- $(SLO)$/editsh.obj \
- $(SLO)$/pivotsh.obj \
- $(SLO)$/auditsh.obj \
- $(SLO)$/gridwin.obj \
- $(SLO)$/gridwin2.obj \
- $(SLO)$/gridwin3.obj \
- $(SLO)$/gridwin4.obj \
- $(SLO)$/gridwin5.obj \
- $(SLO)$/drawview.obj \
- $(SLO)$/drawvie2.obj \
- $(SLO)$/drawvie3.obj \
- $(SLO)$/drawvie4.obj \
- $(SLO)$/drawutil.obj \
- $(SLO)$/output.obj \
- $(SLO)$/output2.obj \
- $(SLO)$/output3.obj \
- $(SLO)$/gridmerg.obj \
- $(SLO)$/invmerge.obj \
- $(SLO)$/select.obj \
- $(SLO)$/olinewin.obj \
- $(SLO)$/hintwin.obj \
- $(SLO)$/notemark.obj \
- $(SLO)$/tabcont.obj \
- $(SLO)$/tabsplit.obj \
+ $(SLO)$/viewdata.obj \
+ $(SLO)$/viewfun2.obj \
+ $(SLO)$/viewfun3.obj \
+ $(SLO)$/viewfun4.obj \
+ $(SLO)$/viewfun5.obj \
+ $(SLO)$/viewfun6.obj \
+ $(SLO)$/viewfun7.obj \
+ $(SLO)$/viewfunc.obj \
$(SLO)$/viewutil.obj \
- $(SLO)$/hdrcont.obj \
- $(SLO)$/colrowba.obj \
- $(SLO)$/olkact.obj \
- $(SLO)$/galwrap.obj \
- $(SLO)$/imapwrap.obj \
- $(SLO)$/reffact.obj \
- $(SLO)$/selectionstate.obj \
- $(SLO)$/spelleng.obj \
- $(SLO)$/spelldialog.obj \
- $(SLO)$/waitoff.obj \
- $(SLO)$/cellsh.obj \
- $(SLO)$/cellsh1.obj\
- $(SLO)$/cellsh2.obj\
- $(SLO)$/cellsh3.obj\
- $(SLO)$/cellsh4.obj\
- $(SLO)$/formatsh.obj\
- $(SLO)$/pgbrksh.obj\
- $(SLO)$/viewdata.obj\
- $(SLO)$/scextopt.obj
+ $(SLO)$/waitoff.obj
.IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCSPARC"
NOOPTFILES= \
@@ -142,28 +145,6 @@ SLOFILES = \
$(SLO)$/tabvwsh2.obj
.ENDIF
-EXCEPTIONSFILES= \
- $(SLO)$/dbfunc3.obj \
- $(SLO)$/gridwin.obj \
- $(SLO)$/invmerge.obj \
- $(SLO)$/output2.obj \
- $(SLO)$/pfuncache.obj \
- $(SLO)$/spelldialog.obj \
- $(SLO)$/cellsh1.obj \
- $(SLO)$/drawvie4.obj \
- $(SLO)$/formatsh.obj \
- $(SLO)$/gridwin2.obj \
- $(SLO)$/scextopt.obj \
- $(SLO)$/tabvwshb.obj \
- $(SLO)$/tabvwshf.obj \
- $(SLO)$/viewdata.obj \
- $(SLO)$/viewfunc.obj \
- $(SLO)$/viewfun2.obj \
- $(SLO)$/viewfun3.obj \
- $(SLO)$/viewfun5.obj \
- $(SLO)$/viewfun7.obj \
- $(SLO)$/reffact.obj
-
# goal seek -O2
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index 2bcbf481069e..f43b8e2985ab 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@ ScNoteMarker::ScNoteMarker( Window* pWin, Window* pRight, Window* pBottom, Windo
bByKeyboard( bKeyboard ),
pModel( NULL ),
pObject( NULL ),
- bVisible( sal_False )
+ bVisible( false )
{
Size aSizePixel = pWindow->GetOutputSizePixel();
if( pRightWin )
@@ -104,13 +105,13 @@ IMPL_LINK( ScNoteMarker, TimeHdl, Timer*, EMPTYARG )
rOutliner.SetRefDevice(pPrinter);
}
- if( SdrPage* pPage = pModel->AllocPage( sal_False ) )
+ if( SdrPage* pPage = pModel->AllocPage( false ) )
{
pObject = ScNoteUtil::CreateTempCaption( *pDoc, aDocPos, *pPage, aUserText, aVisRect, bLeft );
if( pObject )
aRect = pObject->GetCurrentBoundRect();
- // #39351# Page einfuegen damit das Model sie kennt und auch deleted
+ // Page einfuegen damit das Model sie kennt und auch deleted
pModel->InsertPage( pPage );
}
@@ -198,3 +199,4 @@ void ScNoteMarker::InvalidateWin()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index d3a750845154..7f1eeaa3ba80 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,7 @@ ScOutlineWindow::ScOutlineWindow( Window* pParent, ScOutlineMode eMode, ScViewDa
mnFocusEntry( SC_OL_HEADERENTRY ),
mbDontDrawFocus( false )
{
- EnableRTL( sal_False ); // mirroring is done manually
+ EnableRTL( false ); // mirroring is done manually
InitSettings();
maFocusRect.SetEmpty();
@@ -164,7 +165,7 @@ void ScOutlineWindow::InitSettings()
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
SetBackground( rStyleSettings.GetFaceColor() );
maLineColor = rStyleSettings.GetButtonTextColor();
- mpSymbols = ScGlobal::GetOutlineSymbols( rStyleSettings.GetHighContrastMode() );
+ mpSymbols = ScGlobal::GetOutlineSymbols();
Invalidate();
}
@@ -393,7 +394,6 @@ bool ScOutlineWindow::ItemHit( const Point& rPos, size_t& rnLevel, size_t& rnEnt
if ( nLevel == SC_OL_NOLEVEL )
return false;
-// long nLevelPos = GetLevelPos( nLevel );
long nEntryMousePos = mbHoriz ? rPos.X() : rPos.Y();
// --- level buttons ---
@@ -696,7 +696,6 @@ void ScOutlineWindow::Paint( const Rectangle& /* rRect */ )
const ScOutlineEntry* pEntry = pArray->GetEntry( sal::static_int_cast<sal_uInt16>(nLevel),
sal::static_int_cast<sal_uInt16>(nEntry) );
SCCOLROW nStart = pEntry->GetStart();
-// SCCOLROW nEnd = pEntry->GetEnd();
// visible range?
bool bDraw = (nStartIndex <= nStart) && (nStart <= nEndIndex + 1);
@@ -1043,3 +1042,4 @@ void ScOutlineWindow::KeyInput( const KeyEvent& rKEvt )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/olkact.cxx b/sc/source/ui/view/olkact.cxx
index 248777f4e473..8ca1fafa2f8d 100644
--- a/sc/source/ui/view/olkact.cxx
+++ b/sc/source/ui/view/olkact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,19 +53,15 @@
#define _OUTLINER_HXX
#define _PASSWD_HXX
#define _PRNDLG_HXX
-//#define _POLY_HXX
#define _PVRWIN_HXX
#define _QUEUE_HXX
#define _RULER_HXX
#define _SCRWIN_HXX
#define _SETBRW_HXX
#define _STACK_HXX
-//#define _STATUS_HXX ***
#define _STDMENU_HXX
#define _TABBAR_HXX
-//#define _VCBRW_HXX
#define _VCTRLS_HXX
-//#define _VCSBX_HXX
#define _VCONT_HXX
#define _VDRWOBJ_HXX
@@ -82,29 +79,16 @@
//sfxcore.hxx
-//#define _SFXINIMGR_HXX ***
-//#define _SFXCFGITEM_HXX
-//#define _SFX_PRINTER_HXX
#define _SFXGENLINK_HXX
#define _SFXHINTPOST_HXX
#define _SFXDOCINF_HXX
#define _SFXLINKHDL_HXX
-//#define _SFX_PROGRESS_HXX
//sfxsh.hxx
-//#define _SFX_SHELL_HXX
-//#define _SFXAPP_HXX
-//#define _SFXDISPATCH_HXX
-//#define _SFXMSG_HXX ***
-//#define _SFXOBJFACE_HXX ***
-//#define _SFXREQUEST_HXX
#define _SFXMACRO_HXX
// SFX
-//#define _SFXAPPWIN_HXX ***
#define _SFX_SAVEOPT_HXX
-//#define _SFX_CHILDWIN_HXX
-//#define _SFXCTRLITEM_HXX
#define _SFXPRNMON_HXX
#define _INTRO_HXX
#define _SFXMSGDESCR_HXX
@@ -121,72 +105,32 @@
#define _SFXEVENT_HXX
//sfxdoc.hxx
-//#define _SFX_OBJSH_HXX
-//#define _SFX_CLIENTSH_HXX
-//#define _SFXDOCINF_HXX
-//#define _SFX_OBJFAC_HXX
#define _SFX_DOCFILT_HXX
-//#define _SFXDOCFILE_HXX ***
-//define _VIEWFAC_HXX
-//#define _SFXVIEWFRM_HXX
-//#define _SFXVIEWSH_HXX
-//#define _MDIFRM_HXX ***
#define _SFX_IPFRM_HXX
-//#define _SFX_INTERNO_HXX
//sfxdlg.hxx
-//#define _SFXTABDLG_HXX
-//#define _BASEDLGS_HXX ***
#define _SFX_DINFDLG_HXX
#define _SFXDINFEDT_HXX
#define _SFX_MGETEMPL_HXX
#define _SFX_TPLPITEM_HXX
-//#define _SFX_STYLEDLG_HXX
#define _NEWSTYLE_HXX
-//#define _SFXDOCTEMPL_HXX ***
-//#define _SFXDOCTDLG_HXX ***
-//#define _SFX_TEMPLDLG_HXX ***
-//#define _SFXNEW_HXX ***
#define _SFXDOCMAN_HXX
-//#define _SFXDOCKWIN_HXX
//sfxitems.hxx
#define _SFX_WHMAP_HXX
#define _ARGS_HXX
-//#define _SFXPOOLITEM_HXX
-//#define _SFXINTITEM_HXX
-//#define _SFXENUMITEM_HXX
#define _SFXFLAGITEM_HXX
-//#define _SFXSTRITEM_HXX
#define _SFXPTITEM_HXX
#define _SFXRECTITEM_HXX
-//#define _SFXITEMPOOL_HXX
-//#define _SFXITEMSET_HXX
#define _SFXITEMITER_HXX
#define _SFX_WHITER_HXX
#define _SFXPOOLCACH_HXX
-//#define _AEITEM_HXX
#define _SFXRNGITEM_HXX
-//#define _SFXSLSTITM_HXX
-//#define _SFXSTYLE_HXX
-
-//xout.hxx
-//#define _XENUM_HXX
-//#define _XPOLY_HXX
-//#define _XATTR_HXX
-//#define _XOUTX_HXX
-//#define _XPOOL_HXX
-//#define _XTABLE_HXX
//svdraw.hxx
#define _SDR_NOITEMS
#define _SDR_NOTOUCH
#define _SDR_NOTRANSFORM
-//#define _SDR_NOOBJECTS
-//#define _SDR_NOVIEWS
-
-
-
#define _SFXBASIC_HXX
#define _SFX_DOCFILE_HXX
@@ -212,21 +156,11 @@
//si
#define _SI_NOSBXCONTROLS
#define _SI_NOCONTROL
-//#define SI_NOITEMS
-//#define SI_NODRW
-//#define SI_NOOTHERFORMS
#define _SIDLL_HXX
-//#define _VCSBX_HXX
-//#define _VCBRW_HXX
-//#define _SVDATTR_HXX <--- der wars
#define _SVDXOUT_HXX
#define _SVDEC_HXX
-//#define _SVDIO_HXX
-//#define _SVDLAYER_HXX
-//#define _SVDRAG_HXX
#define _SVINCVW_HXX
-//#define _SV_MULTISEL_HXX
#define _SVRTV_HXX
#define _SVTABBX_HXX
@@ -280,3 +214,4 @@ void DeActivateOlk( ScViewData* /* pViewData */ )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 885a1ae2a778..421038b24a46 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -182,25 +183,25 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
pEditObj( NULL ),
pViewShell( NULL ),
pDrawView( NULL ), // #114135#
- bEditMode( sal_False ),
- bMetaFile( sal_False ),
- bSingleGrid( sal_False ),
- bPagebreakMode( sal_False ),
- bSolidBackground( sal_False ),
- bUseStyleColor( sal_False ),
+ bEditMode( false ),
+ bMetaFile( false ),
+ bSingleGrid( false ),
+ bPagebreakMode( false ),
+ bSolidBackground( false ),
+ bUseStyleColor( false ),
bForceAutoColor( SC_MOD()->GetAccessOptions().GetIsAutomaticFontColor() ),
- bSyntaxMode( sal_False ),
+ bSyntaxMode( false ),
pValueColor( NULL ),
pTextColor( NULL ),
pFormulaColor( NULL ),
aGridColor( COL_BLACK ),
bShowNullValues( sal_True ),
- bShowFormulas( sal_False ),
- bShowSpellErrors( sal_False ),
- bMarkClipped( sal_False ), // sal_False fuer Drucker/Metafile etc.
- bSnapPixel( sal_False ),
- bAnyRotated( sal_False ),
- bAnyClipped( sal_False ),
+ bShowFormulas( false ),
+ bShowSpellErrors( false ),
+ bMarkClipped( false ), // sal_False fuer Drucker/Metafile etc.
+ bSnapPixel( false ),
+ bAnyRotated( false ),
+ bAnyClipped( false ),
mpTargetPaintWindow(0) // #i74769# use SdrPaintWindow direct
{
if (pZoomX)
@@ -330,7 +331,7 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
Color aManualColor;
if (bPagebreakMode)
- bPage = sal_False; // keine "normalen" Umbrueche ueber volle Breite/Hoehe
+ bPage = false; // keine "normalen" Umbrueche ueber volle Breite/Hoehe
//! um den einen Pixel sieht das Metafile (oder die Druck-Ausgabe) anders aus
//! als die Bildschirmdarstellung, aber wenigstens passen Druck und Metafile zusammen
@@ -401,20 +402,6 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
sal_Bool bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt
- //! Mit dieser Abfrage wird zuviel weggelassen, wenn ein automatischer
- //! Umbruch mitten in den Wiederholungsspalten liegt.
- //! Dann lieber den aeusseren Rahmen zweimal ausgeben...
-#if 0
- // auf dem Drucker die Aussen-Linien weglassen (werden getrennt ausgegeben)
- if ( eType == OUTTYPE_PRINTER && !bMetaFile )
- {
- if ( nX == MAXCOL )
- bDraw = sal_False;
- else if (pDoc->HasColBreak(nXplus1, nTab))
- bDraw = sal_False;
- }
-#endif
-
sal_uInt16 nWidthXplus2 = pRowInfo[0].pCellInfo[nXplus2].nWidth;
bSingle = bSingleGrid; //! in Fillinfo holen !!!!!
if ( nX<MAXCOL && !bSingle )
@@ -466,9 +453,6 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
if (pThisRowInfo->bChanged && !bHOver)
{
- //Point aStart( nPosX-nSignedOneX, nPosY );
- //Point aEnd( nPosX-nSignedOneX, nNextY-nOneY );
- //pDev->DrawLine( aStart, aEnd );
aGrid.AddVerLine( nPosX-nSignedOneX, nPosY, nNextY-nOneY );
}
nPosY = nNextY;
@@ -476,9 +460,6 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
}
else
{
- //Point aStart( nPosX-nSignedOneX, nScrY );
- //Point aEnd( nPosX-nSignedOneX, nScrY+nScrH-nOneY );
- //pDev->DrawLine( aStart, aEnd );
aGrid.AddVerLine( nPosX-nSignedOneX, nScrY, nScrY+nScrH-nOneY );
}
}
@@ -506,7 +487,7 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
for (SCROW i = nYplus1; i <= MAXROW; ++i)
{
if (i > nHiddenEndRow)
- bHiddenRow = pDoc->RowHidden(i, nTab, nHiddenEndRow);
+ bHiddenRow = pDoc->RowHidden(i, nTab, NULL, &nHiddenEndRow);
/* TODO: optimize the row break thing for large hidden
* segments where HasRowBreak() has to be called
* nevertheless for each row, as a row break is drawn also
@@ -530,20 +511,6 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
sal_Bool bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt
- //! Mit dieser Abfrage wird zuviel weggelassen, wenn ein automatischer
- //! Umbruch mitten in den Wiederholungszeilen liegt.
- //! Dann lieber den aeusseren Rahmen zweimal ausgeben...
-#if 0
- // auf dem Drucker die Aussen-Linien weglassen (werden getrennt ausgegeben)
- if ( eType == OUTTYPE_PRINTER && !bMetaFile )
- {
- if ( nY == MAXROW )
- bDraw = sal_False;
- else if (pDoc->HasRowBreak(nYplus1, nTab))
- bDraw = sal_False;
- }
-#endif
-
sal_Bool bNextYisNextRow = (pRowInfo[nArrYplus1].nRowNo == nYplus1);
bSingle = !bNextYisNextRow; // Hidden
for (SCCOL i=nX1; i<=nX2 && !bSingle; i++)
@@ -583,9 +550,6 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
}
if (!bVOver)
{
- //Point aStart( nPosX, nPosY-nOneY );
- //Point aEnd( nNextX-nSignedOneX, nPosY-nOneY );
- //pDev->DrawLine( aStart, aEnd );
aGrid.AddHorLine( nPosX, nNextX-nSignedOneX, nPosY-nOneY );
}
}
@@ -594,9 +558,6 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
}
else
{
- //Point aStart( nScrX, nPosY-nOneY );
- //Point aEnd( nScrX+nScrW-nOneX, nPosY-nOneY );
- //pDev->DrawLine( aStart, aEnd );
aGrid.AddHorLine( nScrX, nScrX+nScrW-nOneX, nPosY-nOneY );
}
}
@@ -761,7 +722,7 @@ sal_Bool lcl_EqualBack( const RowInfo& rFirst, const RowInfo& rOther,
{
if ( rFirst.bChanged != rOther.bChanged ||
rFirst.bEmptyBack != rOther.bEmptyBack )
- return sal_False;
+ return false;
SCCOL nX;
if ( bShowProt )
@@ -772,37 +733,46 @@ sal_Bool lcl_EqualBack( const RowInfo& rFirst, const RowInfo& rOther,
const ScPatternAttr* pPat2 = rOther.pCellInfo[nX+1].pPatternAttr;
if ( !pPat1 || !pPat2 ||
&pPat1->GetItem(ATTR_PROTECTION) != &pPat2->GetItem(ATTR_PROTECTION) )
- return sal_False;
+ return false;
}
}
else
{
for ( nX=nX1; nX<=nX2; nX++ )
if ( rFirst.pCellInfo[nX+1].pBackground != rOther.pCellInfo[nX+1].pBackground )
- return sal_False;
+ return false;
}
if ( rFirst.nRotMaxCol != SC_ROTMAX_NONE || rOther.nRotMaxCol != SC_ROTMAX_NONE )
for ( nX=nX1; nX<=nX2; nX++ )
if ( rFirst.pCellInfo[nX+1].nRotateDir != rOther.pCellInfo[nX+1].nRotateDir )
- return sal_False;
+ return false;
if ( bPagebreakMode )
for ( nX=nX1; nX<=nX2; nX++ )
if ( rFirst.pCellInfo[nX+1].bPrinted != rOther.pCellInfo[nX+1].bPrinted )
- return sal_False;
+ return false;
return sal_True;
}
-void ScOutputData::DrawBackground()
+void ScOutputData::DrawDocumentBackground()
{
- FindRotated(); //! von aussen ?
+ if ( !bSolidBackground )
+ return;
- ScModule* pScMod = SC_MOD();
+ Size aOnePixel = pDev->PixelToLogic(Size(1,1));
+ long nOneX = aOnePixel.Width();
+ long nOneY = aOnePixel.Height();
+ Rectangle aRect(nScrX - nOneX, nScrY - nOneY, nScrX + nScrW, nScrY + nScrH);
+ Color aBgColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
+ pDev->SetFillColor(aBgColor);
+ pDev->DrawRect(aRect);
+}
- // used only if bSolidBackground is set (only for ScGridWindow):
- Color aBgColor( pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
+void ScOutputData::DrawBackground()
+{
+ FindRotated(); //! von aussen ?
Rectangle aRect;
Size aOnePixel = pDev->PixelToLogic(Size(1,1));
@@ -820,7 +790,7 @@ void ScOutputData::DrawBackground()
sal_Bool bShowProt = bSyntaxMode && pDoc->IsTabProtected(nTab);
sal_Bool bDoAll = bShowProt || bPagebreakMode || bSolidBackground;
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
sal_Bool bCellContrast = bUseStyleColor &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
@@ -851,7 +821,7 @@ void ScOutputData::DrawBackground()
long nPosX = nScrX;
if ( bLayoutRTL )
nPosX += nMirrorW - nOneX;
- aRect = Rectangle( nPosX,nPosY, nPosX,nPosY+nRowHeight-nOneY );
+ aRect = Rectangle( nPosX, nPosY-nOneY, nPosX, nPosY+nRowHeight-nOneY );
const SvxBrushItem* pOldBackground = NULL;
const SvxBrushItem* pBackground;
@@ -899,15 +869,13 @@ void ScOutputData::DrawBackground()
if (pOldBackground) // ==0 if hidden
{
Color aBackCol = pOldBackground->GetColor();
- if ( bSolidBackground && aBackCol.GetTransparency() )
- aBackCol = aBgColor;
if ( !aBackCol.GetTransparency() ) //! partial transparency?
{
pDev->SetFillColor( aBackCol );
pDev->DrawRect( aRect );
}
}
- aRect.Left() = nPosX;
+ aRect.Left() = nPosX - nSignedOneX;
pOldBackground = pBackground;
}
nPosX += pRowInfo[0].pCellInfo[nX+1].nWidth * nLayoutSign;
@@ -916,8 +884,6 @@ void ScOutputData::DrawBackground()
if (pOldBackground)
{
Color aBackCol = pOldBackground->GetColor();
- if ( bSolidBackground && aBackCol.GetTransparency() )
- aBackCol = aBgColor;
if ( !aBackCol.GetTransparency() ) //! partial transparency?
{
pDev->SetFillColor( aBackCol );
@@ -934,7 +900,7 @@ void ScOutputData::DrawBackground()
void ScOutputData::DrawShadow()
{
- DrawExtraShadow( sal_False, sal_False, sal_False, sal_False );
+ DrawExtraShadow( false, false, false, false );
}
void ScOutputData::DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRight, sal_Bool bBottom)
@@ -942,7 +908,7 @@ void ScOutputData::DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRigh
pDev->SetLineColor();
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
sal_Bool bCellContrast = bUseStyleColor && rStyleSettings.GetHighContrastMode();
Color aAutoTextColor;
if ( bCellContrast )
@@ -988,7 +954,7 @@ void ScOutputData::DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRigh
sal_Bool bDo = sal_True;
if ( (nPass==0 && bCornerX) || (nPass==1 && bCornerY) )
if ( ePart != SC_SHADOW_CORNER )
- bDo = sal_False;
+ bDo = false;
if (bDo)
{
@@ -1003,10 +969,6 @@ void ScOutputData::DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRigh
nMaxWidth = pRowInfo[0].pCellInfo[nWx+1].nWidth;
}
-// Rectangle aRect( Point(nPosX,nPosY),
-// Size( pRowInfo[0].pCellInfo[nArrX].nWidth,
-// pRowInfo[nArrY].nHeight ) );
-
// rectangle is in logical orientation
Rectangle aRect( nPosX, nPosY,
nPosX + ( nThisWidth - 1 ) * nLayoutSign,
@@ -1155,12 +1117,12 @@ void ScOutputData::DrawFrame()
sal_uLong nOldDrawMode = pDev->GetDrawMode();
Color aSingleColor;
- sal_Bool bUseSingleColor = sal_False;
+ sal_Bool bUseSingleColor = false;
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
sal_Bool bCellContrast = bUseStyleColor && rStyleSettings.GetHighContrastMode();
- // #107519# if a Calc OLE object is embedded in Draw/Impress, the VCL DrawMode is used
+ // if a Calc OLE object is embedded in Draw/Impress, the VCL DrawMode is used
// for display mode / B&W printing. The VCL DrawMode handling doesn't work for lines
// that are drawn with DrawRect, so if the line/background bits are set, the DrawMode
// must be reset and the border colors handled here.
@@ -1279,7 +1241,7 @@ const SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc,
if ( nRotDir != SC_ROTDIR_LEFT && nRotDir != SC_ROTDIR_RIGHT )
return NULL;
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
while (!bFound)
{
if ( nRotDir == SC_ROTDIR_LEFT )
@@ -1421,7 +1383,7 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
const SfxItemSet* pCondSet;
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
sal_Bool bCellContrast = bUseStyleColor && rStyleSettings.GetHighContrastMode();
// color (pForceColor) is determined externally, including DrawMode changes
@@ -1565,7 +1527,7 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
const Color& rColor = pBackground->GetColor();
if ( rColor.GetTransparency() != 255 )
{
- // #95879# draw background only for the changed row itself
+ // draw background only for the changed row itself
// (background doesn't extend into other cells).
// For the borders (rotated and normal), clipping should be
// set if the row isn't changed, but at least the borders
@@ -1652,7 +1614,7 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
}
if ( rArray.GetCellStyleBottom( nCol, nRow ).Prim() && eRotMode != SVX_ROTATE_MODE_BOTTOM )
{
- svx::frame::Style aStyle( lcl_FindHorLine( pDoc, nX, nY, nTab, nDir, sal_False ), nPPTY );
+ svx::frame::Style aStyle( lcl_FindHorLine( pDoc, nX, nY, nTab, nDir, false ), nPPTY );
rArray.SetCellStyleBottom( nCol, nRow, aStyle );
if( nRow + 1 < rArray.GetRowCount() )
rArray.SetCellStyleTop( nCol, nRow + 1, aStyle );
@@ -1697,7 +1659,7 @@ PolyPolygon ScOutputData::GetChangedArea()
aDrawingRect.Left() = nScrX;
aDrawingRect.Right() = nScrX+nScrW-1;
- sal_Bool bHad = sal_False;
+ sal_Bool bHad = false;
long nPosY = nScrY;
SCSIZE nArrY;
for (nArrY=1; nArrY+1<nArrCount; nArrY++)
@@ -1716,7 +1678,7 @@ PolyPolygon ScOutputData::GetChangedArea()
else if (bHad)
{
aPoly.Insert( Polygon( pDev->PixelToLogic(aDrawingRect) ) );
- bHad = sal_False;
+ bHad = false;
}
nPosY += pRowInfo[nArrY].nHeight;
}
@@ -1735,7 +1697,7 @@ sal_Bool ScOutputData::SetChangedClip()
aDrawingRect.Left() = nScrX;
aDrawingRect.Right() = nScrX+nScrW-1;
- sal_Bool bHad = sal_False;
+ sal_Bool bHad = false;
long nPosY = nScrY;
SCSIZE nArrY;
for (nArrY=1; nArrY+1<nArrCount; nArrY++)
@@ -1754,7 +1716,7 @@ sal_Bool ScOutputData::SetChangedClip()
else if (bHad)
{
aPoly.Insert( Polygon( pDev->PixelToLogic(aDrawingRect) ) );
- bHad = sal_False;
+ bHad = false;
}
nPosY += pRowInfo[nArrY].nHeight;
}
@@ -1776,9 +1738,9 @@ void ScOutputData::FindChanged()
sal_Bool bWasIdleDisabled = pDoc->IsIdleDisabled();
pDoc->DisableIdle( sal_True );
for (nArrY=0; nArrY<nArrCount; nArrY++)
- pRowInfo[nArrY].bChanged = sal_False;
+ pRowInfo[nArrY].bChanged = false;
- sal_Bool bProgress = sal_False;
+ sal_Bool bProgress = false;
for (nArrY=0; nArrY<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
@@ -1820,64 +1782,6 @@ void ScOutputData::FindChanged()
pDoc->DisableIdle( bWasIdleDisabled );
}
-#ifdef OLD_SELECTION_PAINT
-void ScOutputData::DrawMark( Window* pWin )
-{
- Rectangle aRect;
- ScInvertMerger aInvert( pWin );
- //! additional method AddLineRect for ScInvertMerger?
-
- long nPosY = nScrY;
- for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
- {
- RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- if (pThisRowInfo->bChanged)
- {
- long nPosX = nScrX;
- if (bLayoutRTL)
- nPosX += nMirrorW - 1; // always in pixels
-
- aRect = Rectangle( Point( nPosX,nPosY ), Size(1, pThisRowInfo->nHeight) );
- if (bLayoutRTL)
- aRect.Left() = aRect.Right() + 1;
- else
- aRect.Right() = aRect.Left() - 1;
-
- sal_Bool bOldMarked = sal_False;
- for (SCCOL nX=nX1; nX<=nX2; nX++)
- {
- if (pThisRowInfo->pCellInfo[nX+1].bMarked != bOldMarked)
- {
- if (bOldMarked && aRect.Right() >= aRect.Left())
- aInvert.AddRect( aRect );
-
- if (bLayoutRTL)
- aRect.Right() = nPosX;
- else
- aRect.Left() = nPosX;
-
- bOldMarked = pThisRowInfo->pCellInfo[nX+1].bMarked;
- }
-
- if (bLayoutRTL)
- {
- nPosX -= pRowInfo[0].pCellInfo[nX+1].nWidth;
- aRect.Left() = nPosX+1;
- }
- else
- {
- nPosX += pRowInfo[0].pCellInfo[nX+1].nWidth;
- aRect.Right() = nPosX-1;
- }
- }
- if (bOldMarked && aRect.Right() >= aRect.Left())
- aInvert.AddRect( aRect );
- }
- nPosY += pThisRowInfo->nHeight;
- }
-}
-#endif
-
void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
SCCOL nRefEndX, SCROW nRefEndY,
const Color& rColor, sal_Bool bHandle )
@@ -1903,14 +1807,14 @@ void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
}
long nLayoutSign = bLayoutRTL ? -1 : 1;
- sal_Bool bTop = sal_False;
- sal_Bool bBottom = sal_False;
- sal_Bool bLeft = sal_False;
- sal_Bool bRight = sal_False;
+ sal_Bool bTop = false;
+ sal_Bool bBottom = false;
+ sal_Bool bLeft = false;
+ sal_Bool bRight = false;
long nPosY = nScrY;
sal_Bool bNoStartY = ( nY1 < nRefStartY );
- sal_Bool bNoEndY = sal_False;
+ sal_Bool bNoEndY = false;
for (SCSIZE nArrY=1; nArrY<nArrCount; nArrY++) // loop to end for bNoEndY check
{
SCROW nY = pRowInfo[nArrY].nRowNo;
@@ -2009,14 +1913,14 @@ void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
}
long nLayoutSign = bLayoutRTL ? -1 : 1;
- sal_Bool bTop = sal_False;
- sal_Bool bBottom = sal_False;
- sal_Bool bLeft = sal_False;
- sal_Bool bRight = sal_False;
+ sal_Bool bTop = false;
+ sal_Bool bBottom = false;
+ sal_Bool bLeft = false;
+ sal_Bool bRight = false;
long nPosY = nScrY;
sal_Bool bNoStartY = ( nY1 < nRefStartY );
- sal_Bool bNoEndY = sal_False;
+ sal_Bool bNoEndY = false;
for (SCSIZE nArrY=1; nArrY<nArrCount; nArrY++) // loop to end for bNoEndY check
{
SCROW nY = pRowInfo[nArrY].nRowNo;
@@ -2064,9 +1968,9 @@ void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
nMaxY >= nMinY )
{
if ( nType == SC_CAT_DELETE_ROWS )
- bLeft = bRight = bBottom = sal_False; //! dicke Linie ???
+ bLeft = bRight = bBottom = false; //! dicke Linie ???
else if ( nType == SC_CAT_DELETE_COLS )
- bTop = bBottom = bRight = sal_False; //! dicke Linie ???
+ bTop = bBottom = bRight = false; //! dicke Linie ???
pDev->SetLineColor( rColor );
if (bTop && bBottom && bLeft && bRight)
@@ -2188,7 +2092,7 @@ void ScOutputData::DrawNoteMarks()
{
CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1];
ScBaseCell* pCell = pInfo->pCell;
- sal_Bool bIsMerged = sal_False;
+ sal_Bool bIsMerged = false;
if ( nX==nX1 && pInfo->bHOverlapped && !pInfo->bVOverlapped )
{
@@ -2215,7 +2119,7 @@ void ScOutputData::DrawNoteMarks()
else
pDev->SetFillColor(COL_LIGHTRED);
- bFirst = sal_False;
+ bFirst = false;
}
long nMarkX = nPosX + ( pRowInfo[0].pCellInfo[nX+1].nWidth - 4 ) * nLayoutSign;
@@ -2266,7 +2170,7 @@ void ScOutputData::AddPDFNotes()
{
CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1];
ScBaseCell* pCell = pInfo->pCell;
- sal_Bool bIsMerged = sal_False;
+ sal_Bool bIsMerged = false;
SCROW nY = pRowInfo[nArrY].nRowNo;
SCCOL nMergeX = nX;
SCROW nMergeY = nY;
@@ -2441,26 +2345,14 @@ void ScOutputData::DrawClipMarks()
// visually left
Rectangle aMarkRect = aCellRect;
aMarkRect.Right() = aCellRect.Left()+nMarkPixel-1;
-#if 0
- //! Test
- pDev->SetLineColor(); pDev->SetFillColor(COL_YELLOW);
- pDev->DrawRect(aMarkRect);
- //! Test
-#endif
- SvxFont::DrawArrow( *pDev, aMarkRect, aMarkSize, aArrowFillCol, sal_True );
+ SvxFont::DrawArrow( *pDev, aMarkRect, aMarkSize, aArrowFillCol, true );
}
if ( pInfo->nClipMark & ( bLayoutRTL ? SC_CLIPMARK_LEFT : SC_CLIPMARK_RIGHT ) )
{
// visually right
Rectangle aMarkRect = aCellRect;
aMarkRect.Left() = aCellRect.Right()-nMarkPixel+1;
-#if 0
- //! Test
- pDev->SetLineColor(); pDev->SetFillColor(COL_LIGHTGREEN);
- pDev->DrawRect(aMarkRect);
- //! Test
-#endif
- SvxFont::DrawArrow( *pDev, aMarkRect, aMarkSize, aArrowFillCol, sal_False );
+ SvxFont::DrawArrow( *pDev, aMarkRect, aMarkSize, aArrowFillCol, false );
}
}
nPosX += pRowInfo[0].pCellInfo[nX+1].nWidth * nLayoutSign;
@@ -2474,3 +2366,4 @@ void ScOutputData::DrawClipMarks()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index b1d6787d3ce6..35e6d78b0191 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,6 +49,7 @@
#include <editeng/forbiddencharacterstable.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/langitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svx/rotmodit.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/udlnitem.hxx>
@@ -104,6 +106,8 @@ class ScDrawStringsVars
SvxCellOrientation eAttrOrient;
SvxCellHorJustify eAttrHorJust;
SvxCellVerJustify eAttrVerJust;
+ SvxCellJustifyMethod eAttrHorJustMethod;
+ SvxCellJustifyMethod eAttrVerJustMethod;
const SvxMarginItem* pMargin;
sal_uInt16 nIndent;
sal_Bool bRotated;
@@ -138,7 +142,8 @@ public:
void SetPattern( const ScPatternAttr* pNew, const SfxItemSet* pSet, ScBaseCell* pCell, sal_uInt8 nScript );
void SetPatternSimple( const ScPatternAttr* pNew, const SfxItemSet* pSet );
- sal_Bool SetText( ScBaseCell* pCell ); // sal_True -> pOldPattern vergessen
+ sal_Bool SetText( ScBaseCell* pCell ); // TRUE -> pOldPattern vergessen
+ void SetHashText();
void SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth );
void SetAutoText( const String& rAutoText );
@@ -146,6 +151,8 @@ public:
SvxCellOrientation GetOrient() const { return eAttrOrient; }
SvxCellHorJustify GetHorJust() const { return eAttrHorJust; }
SvxCellVerJustify GetVerJust() const { return eAttrVerJust; }
+ SvxCellJustifyMethod GetHorJustMethod() const { return eAttrHorJustMethod; }
+ SvxCellJustifyMethod GetVerJustMethod() const { return eAttrVerJustMethod; }
const SvxMarginItem* GetMargin() const { return pMargin; }
sal_uInt16 GetLeftTotal() const { return pMargin->GetLeftMargin() + nIndent; }
@@ -170,7 +177,6 @@ public:
sal_Bool HasEditCharacters() const;
private:
- void SetHashText();
long GetMaxDigitWidth(); // in logic units
long GetSignWidth();
long GetDotWidth();
@@ -184,12 +190,15 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, sal_Bool bPTL) :
pOutput ( pData ),
pPattern ( NULL ),
pCondSet ( NULL ),
+ nAscentPixel(0),
eAttrOrient ( SVX_ORIENTATION_STANDARD ),
eAttrHorJust( SVX_HOR_JUSTIFY_STANDARD ),
eAttrVerJust( SVX_VER_JUSTIFY_BOTTOM ),
+ eAttrHorJustMethod( SVX_JUSTIFY_METHOD_AUTO ),
+ eAttrVerJustMethod( SVX_JUSTIFY_METHOD_AUTO ),
pMargin ( NULL ),
nIndent ( 0 ),
- bRotated ( sal_False ),
+ bRotated ( false ),
nOriginalWidth( 0 ),
nMaxDigitWidth( 0 ),
nSignWidth( 0 ),
@@ -197,13 +206,13 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, sal_Bool bPTL) :
nExpWidth( 0 ),
pLastCell ( NULL ),
nValueFormat( 0 ),
- bLineBreak ( sal_False ),
- bRepeat ( sal_False ),
- bShrink ( sal_False ),
+ bLineBreak ( false ),
+ bRepeat ( false ),
+ bShrink ( false ),
bPixelToLogic( bPTL )
{
ScModule* pScMod = SC_MOD();
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
bCellContrast = pOutput->bUseStyleColor &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
@@ -258,6 +267,22 @@ void ScDrawStringsVars::SetShrinkScale( long nScale, sal_uInt8 nScript )
SetAutoText( aString ); // same text again, to get text size
}
+namespace {
+
+template<typename _ItemType, typename _EnumType>
+_EnumType lcl_GetValue(const ScPatternAttr& rPattern, sal_uInt16 nWhich, const SfxItemSet* pCondSet)
+{
+ const _ItemType& rItem = static_cast<const _ItemType&>(rPattern.GetItem(nWhich, pCondSet));
+ return static_cast<_EnumType>(rItem.GetValue());
+}
+
+bool lcl_GetBoolValue(const ScPatternAttr& rPattern, sal_uInt16 nWhich, const SfxItemSet* pCondSet)
+{
+ return lcl_GetValue<SfxBoolItem, bool>(rPattern, nWhich, pCondSet);
+}
+
+}
+
void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet* pSet,
ScBaseCell* pCell, sal_uInt8 nScript )
{
@@ -308,6 +333,11 @@ void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet*
if ( eAttrVerJust == SVX_VER_JUSTIFY_STANDARD )
eAttrVerJust = SVX_VER_JUSTIFY_BOTTOM;
+ // justification method
+
+ eAttrHorJustMethod = lcl_GetValue<SvxJustifyMethodItem, SvxCellJustifyMethod>(*pPattern, ATTR_HOR_JUSTIFY_METHOD, pCondSet);
+ eAttrVerJustMethod = lcl_GetValue<SvxJustifyMethodItem, SvxCellJustifyMethod>(*pPattern, ATTR_VER_JUSTIFY_METHOD, pCondSet);
+
// line break
bLineBreak = ((const SfxBoolItem&)pPattern->GetItem( ATTR_LINEBREAK, pCondSet )).GetValue();
@@ -335,20 +365,20 @@ void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet*
break;
case SVX_ORIENTATION_STACKED:
nRot = 0;
- bRotated = sal_False;
+ bRotated = false;
break;
case SVX_ORIENTATION_TOPBOTTOM:
nRot = 2700;
- bRotated = sal_False;
+ bRotated = false;
break;
case SVX_ORIENTATION_BOTTOMTOP:
nRot = 900;
- bRotated = sal_False;
+ bRotated = false;
break;
default:
- DBG_ERROR("Falscher SvxCellOrientation Wert");
+ OSL_FAIL("Falscher SvxCellOrientation Wert");
nRot = 0;
- bRotated = sal_False;
+ bRotated = false;
break;
}
aFont.SetOrientation( nRot );
@@ -390,13 +420,8 @@ void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet*
// Zahlenformat
-// sal_uLong nOld = nValueFormat;
nValueFormat = pPattern->GetNumberFormat( pOutput->pDoc->GetFormatTable(), pCondSet );
-/* s.u.
- if (nValueFormat != nOld)
- pLastCell = NULL; // immer neu formatieren
-*/
// Raender
pMargin = (const SvxMarginItem*)&pPattern->GetItem( ATTR_MARGIN, pCondSet );
@@ -429,7 +454,6 @@ void ScDrawStringsVars::SetPatternSimple( const ScPatternAttr* pNew, const SfxIt
// Zahlenformat
sal_uLong nOld = nValueFormat;
-// nValueFormat = pPattern->GetNumberFormat( pFormatter );
const SfxPoolItem* pFormItem;
if ( !pCondSet || pCondSet->GetItemState(ATTR_VALUE_FORMAT,sal_True,&pFormItem) != SFX_ITEM_SET )
pFormItem = &pPattern->GetItem(ATTR_VALUE_FORMAT);
@@ -466,7 +490,7 @@ inline sal_Bool SameValue( ScBaseCell* pCell, ScBaseCell* pOldCell ) // pCell
sal_Bool ScDrawStringsVars::SetText( ScBaseCell* pCell )
{
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
if (pCell)
{
@@ -725,7 +749,7 @@ double ScOutputData::GetStretch()
{
if ( pRefDevice->IsMapMode() )
{
- // #95920# If a non-trivial MapMode is set, its scale is now already
+ // If a non-trivial MapMode is set, its scale is now already
// taken into account in the OutputDevice's font handling
// (OutputDevice::ImplNewFont, see #95414#).
// The old handling below is only needed for pixel output.
@@ -837,7 +861,7 @@ sal_Bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
SCCOL& rOverX, SCROW& rOverY,
sal_Bool bVisRowChanged )
{
- sal_Bool bDoMerge = sal_False;
+ sal_Bool bDoMerge = false;
sal_Bool bIsLeft = ( nX == nVisX1 );
sal_Bool bIsTop = ( nY == nVisY1 ) || bVisRowChanged;
@@ -849,11 +873,6 @@ sal_Bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
else if ( pInfo->bVOverlapped )
bDoMerge = bIsTop;
- // weiter solange versteckt
-/* if (!bDoMerge)
- return sal_False;
-*/
-
rOverX = nX;
rOverY = nY;
sal_Bool bHOver = pInfo->bHOverlapped;
@@ -865,18 +884,15 @@ sal_Bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
--rOverX;
bHidden = pDoc->ColHidden(rOverX, nTab);
if ( !bDoMerge && !bHidden )
- return sal_False;
+ return false;
if (rOverX >= nX1 && !bHidden)
{
-// rVirtPosX -= pRowInfo[0].pCellInfo[rOverX+1].nWidth;
bHOver = pRowInfo[nArrY].pCellInfo[rOverX+1].bHOverlapped;
bVOver = pRowInfo[nArrY].pCellInfo[rOverX+1].bVOverlapped;
}
else
{
-// if (!bClipVirt)
-// rVirtPosX -= (long) (pDoc->GetColWidth( rOverX, nTab ) * nPPTX);
sal_uInt16 nOverlap = ((ScMergeFlagAttr*)pDoc->GetAttr(
rOverX, rOverY, nTab, ATTR_MERGE_FLAG ))->GetValue();
bHOver = ((nOverlap & SC_MF_HOR) != 0);
@@ -889,7 +905,7 @@ sal_Bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
--rOverY;
bHidden = pDoc->RowHidden(rOverY, nTab);
if ( !bDoMerge && !bHidden )
- return sal_False;
+ return false;
if (nArrY>0)
--nArrY; // lokale Kopie !
@@ -899,14 +915,11 @@ sal_Bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
!pDoc->RowHidden(rOverY, nTab) &&
pRowInfo[nArrY].nRowNo == rOverY)
{
-// rVirtPosY -= pRowInfo[nArrY].nHeight;
bHOver = pRowInfo[nArrY].pCellInfo[rOverX+1].bHOverlapped;
bVOver = pRowInfo[nArrY].pCellInfo[rOverX+1].bVOverlapped;
}
else
{
-// if (!bClipVirt)
-// rVirtPosY -= (long) (pDoc->GetRowHeight( rOverY, nTab ) * nPPTY);
sal_uInt16 nOverlap = ((ScMergeFlagAttr*)pDoc->GetAttr(
rOverX, rOverY, nTab, ATTR_MERGE_FLAG ))->GetValue();
bHOver = ((nOverlap & SC_MF_HOR) != 0);
@@ -922,7 +935,7 @@ inline sal_Bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatter
DBG_ASSERT( rpNewPattern, "pNewPattern" );
if ( rpNewPattern == rpOldPattern )
- return sal_False;
+ return false;
else if ( !rpOldPattern )
return sal_True;
else if ( &rpNewPattern->GetItem( ATTR_FONT ) != &rpOldPattern->GetItem( ATTR_FONT ) )
@@ -964,9 +977,13 @@ inline sal_Bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatter
else if ( &rpNewPattern->GetItem( ATTR_FONT_COLOR ) != &rpOldPattern->GetItem( ATTR_FONT_COLOR ) )
return sal_True;
else if ( &rpNewPattern->GetItem( ATTR_HOR_JUSTIFY ) != &rpOldPattern->GetItem( ATTR_HOR_JUSTIFY ) )
- return sal_True;
+ return true;
+ else if ( &rpNewPattern->GetItem( ATTR_HOR_JUSTIFY_METHOD ) != &rpOldPattern->GetItem( ATTR_HOR_JUSTIFY_METHOD ) )
+ return true;
else if ( &rpNewPattern->GetItem( ATTR_VER_JUSTIFY ) != &rpOldPattern->GetItem( ATTR_VER_JUSTIFY ) )
- return sal_True;
+ return true;
+ else if ( &rpNewPattern->GetItem( ATTR_VER_JUSTIFY_METHOD ) != &rpOldPattern->GetItem( ATTR_VER_JUSTIFY_METHOD ) )
+ return true;
else if ( &rpNewPattern->GetItem( ATTR_STACKED ) != &rpOldPattern->GetItem( ATTR_STACKED ) )
return sal_True;
else if ( &rpNewPattern->GetItem( ATTR_LINEBREAK ) != &rpOldPattern->GetItem( ATTR_LINEBREAK ) )
@@ -986,7 +1003,7 @@ inline sal_Bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatter
else
{
rpOldPattern = rpNewPattern;
- return sal_False;
+ return false;
}
}
@@ -1069,14 +1086,14 @@ sal_Bool ScOutputData::IsAvailable( SCCOL nX, SCROW nY )
const ScBaseCell* pCell = pDoc->GetCell( ScAddress( nX, nY, nTab ) );
if ( pCell && pCell->GetCellType() != CELLTYPE_NOTE && !IsEmptyCellText( NULL, nX, nY ) )
{
- return sal_False;
+ return false;
}
const ScPatternAttr* pPattern = pDoc->GetPattern( nX, nY, nTab );
if ( ((const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE)).IsMerged() ||
((const ScMergeFlagAttr&)pPattern->GetItem(ATTR_MERGE_FLAG)).IsOverlapped() )
{
- return sal_False;
+ return false;
}
return sal_True;
@@ -1274,7 +1291,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
}
else
{
- rParam.mbLeftClip = rParam.mbRightClip = sal_False;
+ rParam.mbLeftClip = rParam.mbRightClip = false;
// leave space for AutoFilter on screen
// (for automatic line break: only if not formatting for printer, as in ScColumn::GetNeededSize)
@@ -1307,17 +1324,6 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
rParam.maAlignRect.Justify();
rParam.maClipRect.Justify();
-
-#if 0
- //! Test !!!
- pDev->Push();
- pDev->SetLineColor();
- pDev->SetFillColor( COL_LIGHTGREEN );
- pDev->DrawRect( pDev->PixelToLogic(rParam.maClipRect) );
- pDev->DrawRect( rParam.maClipRect ); // print preview
- pDev->Pop();
- //! Test !!!
-#endif
}
void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
@@ -1329,13 +1335,11 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
sal_Bool bWasIdleDisabled = pDoc->IsIdleDisabled();
- pDoc->DisableIdle( sal_True );
- Size aMinSize = pRefDevice->PixelToLogic(Size(0,100)); // erst darueber wird ausgegeben
-// sal_uInt32 nMinHeight = aMinSize.Height() / 200; // 1/2 Pixel
+ pDoc->DisableIdle( true );
ScDrawStringsVars aVars( this, bPixelToLogic );
- sal_Bool bProgress = sal_False;
+ sal_Bool bProgress = false;
long nInitPosX = nScrX;
if ( bLayoutRTL )
@@ -1352,7 +1356,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
// variables for GetOutputArea
OutputAreaParam aAreaParam;
- sal_Bool bCellIsValue = sal_False;
+ sal_Bool bCellIsValue = false;
long nNeededWidth = 0;
SvxCellHorJustify eOutHorJust = SVX_HOR_JUSTIFY_STANDARD;
const ScPatternAttr* pPattern = NULL;
@@ -1372,20 +1376,19 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
if ( pThisRowInfo->bChanged )
{
SCROW nY = pThisRowInfo->nRowNo;
-// long nCellHeight = (long) pThisRowInfo->nHeight;
long nPosX = nInitPosX;
if ( nLoopStartX < nX1 )
nPosX -= pRowInfo[0].pCellInfo[nLoopStartX+1].nWidth * nLayoutSign;
for (SCCOL nX=nLoopStartX; nX<=nX2; nX++)
{
- sal_Bool bMergeEmpty = sal_False;
+ sal_Bool bMergeEmpty = false;
CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1];
sal_Bool bEmpty = nX < nX1 || pInfo->bEmptyCellText;
SCCOL nCellX = nX; // position where the cell really starts
SCROW nCellY = nY;
- sal_Bool bDoCell = sal_False;
- sal_Bool bNeedEdit = sal_False;
+ sal_Bool bDoCell = false;
+ sal_Bool bNeedEdit = false;
//
// Part of a merged cell?
@@ -1461,7 +1464,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
//
if ( bDoCell && bEditMode && nCellX == nEditCol && nCellY == nEditRow )
- bDoCell = sal_False;
+ bDoCell = false;
//
// output the cell text
@@ -1475,7 +1478,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
else
GetVisibleCell( nCellX, nCellY, nTab, pCell ); // get from document
if ( !pCell )
- bDoCell = sal_False;
+ bDoCell = false;
else if ( pCell->GetCellType() == CELLTYPE_EDIT )
bNeedEdit = sal_True;
}
@@ -1574,7 +1577,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
// GetOutputArea gives justfied rectangles
GetOutputArea( nX, nArrY, nPosX, nPosY, nCellX, nCellY, nNeededWidth,
*pPattern, sal::static_int_cast<sal_uInt16>(eOutHorJust),
- bCellIsValue || bRepeat || bShrink, bBreak, sal_False,
+ bCellIsValue || bRepeat || bShrink, bBreak, false,
aAreaParam );
if ( bShrink )
@@ -1611,7 +1614,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
// If even at half the size the font still isn't rendered smaller,
// fall back to normal clipping (showing ### for numbers).
if ( nNewSize <= nAvailable )
- aAreaParam.mbLeftClip = aAreaParam.mbRightClip = sal_False;
+ aAreaParam.mbLeftClip = aAreaParam.mbRightClip = false;
pOldPattern = NULL;
}
@@ -1653,6 +1656,12 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
bNeedEdit = ( nHeight > aAreaParam.maClipRect.GetHeight() );
}
}
+ if (!bNeedEdit)
+ {
+ bNeedEdit =
+ aVars.GetHorJust() == SVX_HOR_JUSTIFY_BLOCK &&
+ aVars.GetHorJustMethod() == SVX_JUSTIFY_METHOD_DISTRIBUTE;
+ }
}
if (bNeedEdit)
{
@@ -1662,19 +1671,23 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
SCCOL nMarkX = ( nCellX <= nX2 ) ? nCellX : nX2;
RowInfo* pMarkRowInfo = ( nCellY == nY ) ? pThisRowInfo : &pRowInfo[0];
pMarkRowInfo->pCellInfo[nMarkX+1].bEditEngine = sal_True;
- bDoCell = sal_False; // don't draw here
+ bDoCell = false; // don't draw here
}
if ( bDoCell )
{
if ( bCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
{
- // Adjust the decimals to fit the available column width.
- aVars.SetTextToWidthOrHash(pCell, aAreaParam.mnColWidth - nTotalMargin);
+ if (bShowFormulas)
+ aVars.SetHashText();
+ else
+ // Adjust the decimals to fit the available column width.
+ aVars.SetTextToWidthOrHash(pCell, aAreaParam.mnColWidth - nTotalMargin);
+
nNeededWidth = aVars.GetTextSize().Width() +
(long) ( aVars.GetLeftTotal() * nPPTX ) +
(long) ( aVars.GetMargin()->GetRightMargin() * nPPTX );
if ( nNeededWidth <= aAreaParam.maClipRect.GetWidth() )
- aAreaParam.mbLeftClip = aAreaParam.mbRightClip = sal_False;
+ aAreaParam.mbLeftClip = aAreaParam.mbRightClip = false;
// If the "###" replacement doesn't fit into the cells, no clip marks
// are shown, as the "###" already denotes too little space.
@@ -1699,7 +1712,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
}
sal_Bool bHClip = aAreaParam.mbLeftClip || aAreaParam.mbRightClip;
- sal_Bool bVClip = sal_False;
+ sal_Bool bVClip = false;
if ( aAreaParam.maClipRect.Top() < nScrY )
{
@@ -1716,8 +1729,8 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
// horizontalen Platz testen
//
- sal_Bool bRightAdjusted = sal_False; // to correct text width calculation later
- sal_Bool bNeedEditEngine = sal_False;
+ sal_Bool bRightAdjusted = false; // to correct text width calculation later
+ sal_Bool bNeedEditEngine = false;
if ( !bNeedEditEngine && !bOutside )
{
switch (eOutHorJust)
@@ -1745,6 +1758,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
switch (aVars.GetVerJust())
{
case SVX_VER_JUSTIFY_TOP:
+ case SVX_VER_JUSTIFY_BLOCK:
{
long nTop = (long)( aVars.GetMargin()->GetTopMargin() * nPPTY );
nJustPosY += nTop;
@@ -1907,7 +1921,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
void lcl_ClearEdit( EditEngine& rEngine ) // Text und Attribute
{
- rEngine.SetUpdateMode( sal_False );
+ rEngine.SetUpdateMode( false );
rEngine.SetText(EMPTY_STRING);
// keine Para-Attribute uebrigbehalten...
@@ -1920,9 +1934,9 @@ void lcl_ClearEdit( EditEngine& rEngine ) // Text und Attribute
sal_Bool lcl_SafeIsValue( ScBaseCell* pCell )
{
if (!pCell)
- return sal_False;
+ return false;
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
switch ( pCell->GetCellType() )
{
case CELLTYPE_VALUE:
@@ -1947,7 +1961,7 @@ void lcl_ScaleFonts( EditEngine& rEngine, long nPercent )
{
sal_Bool bUpdateMode = rEngine.GetUpdateMode();
if ( bUpdateMode )
- rEngine.SetUpdateMode( sal_False );
+ rEngine.SetUpdateMode( false );
sal_uInt16 nParCount = rEngine.GetParagraphCount();
for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
@@ -2034,7 +2048,7 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlig
long nScale = ( nAvailable * 100 ) / nScaleSize;
lcl_ScaleFonts( rEngine, nScale );
- rEngineHeight = lcl_GetEditSize( rEngine, sal_False, bSwap, nAttrRotate );
+ rEngineHeight = lcl_GetEditSize( rEngine, false, bSwap, nAttrRotate );
long nNewSize = bPixelToLogic ?
pRefDevice->LogicToPixel(Size(0,rEngineHeight)).Height() : rEngineHeight;
@@ -2043,7 +2057,7 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlig
{
// further reduce, like in DrawStrings
lcl_ScaleFonts( rEngine, 90 ); // reduce by 10%
- rEngineHeight = lcl_GetEditSize( rEngine, sal_False, bSwap, nAttrRotate );
+ rEngineHeight = lcl_GetEditSize( rEngine, false, bSwap, nAttrRotate );
nNewSize = bPixelToLogic ?
pRefDevice->LogicToPixel(Size(0,rEngineHeight)).Height() : rEngineHeight;
++nShrinkAgain;
@@ -2068,7 +2082,7 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlig
long nScale = ( nAvailable * 100 ) / nScaleSize;
lcl_ScaleFonts( rEngine, nScale );
- rEngineWidth = lcl_GetEditSize( rEngine, sal_True, sal_False, nAttrRotate );
+ rEngineWidth = lcl_GetEditSize( rEngine, sal_True, false, nAttrRotate );
long nNewSize = bPixelToLogic ?
pRefDevice->LogicToPixel(Size(rEngineWidth,0)).Width() : rEngineWidth;
@@ -2077,35 +2091,290 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlig
{
// further reduce, like in DrawStrings
lcl_ScaleFonts( rEngine, 90 ); // reduce by 10%
- rEngineWidth = lcl_GetEditSize( rEngine, sal_True, sal_False, nAttrRotate );
+ rEngineWidth = lcl_GetEditSize( rEngine, sal_True, false, nAttrRotate );
nNewSize = bPixelToLogic ?
pRefDevice->LogicToPixel(Size(rEngineWidth,0)).Width() : rEngineWidth;
++nShrinkAgain;
}
if ( nNewSize <= nAvailable )
- rLeftClip = rRightClip = sal_False;
+ rLeftClip = rRightClip = false;
// sizes for further processing (alignment etc):
rNeededPixel = nNewSize + nLeftM + nRightM;
- rEngineHeight = lcl_GetEditSize( rEngine, sal_False, sal_False, nAttrRotate );
+ rEngineHeight = lcl_GetEditSize( rEngine, false, false, nAttrRotate );
+ }
+}
+
+namespace {
+
+class EditAlignmentParam
+{
+public:
+ SvxCellHorJustify meHorJust;
+ SvxCellVerJustify meVerJust;
+ SvxCellJustifyMethod meHorJustMethod;
+ SvxCellJustifyMethod meVerJustMethod;
+ SvxCellOrientation meOrient;
+ bool mbBreak;
+ bool mbCellIsValue;
+ bool mbAsianVertical;
+
+ explicit EditAlignmentParam(const ScPatternAttr* pPattern, const SfxItemSet* pCondSet, bool bCellIsValue);
+
+ void calcMargins(long& rTop, long& rLeft, long& rBottom, long& rRight, double nPPTX, double nPPTY) const;
+ void calcPaperSize(Size& rPaperSize, const Rectangle& rAlignRect, double nPPTX, double nPPTY) const;
+ void getEngineSize(ScFieldEditEngine* pEngine, long& rWidth, long& rHeight) const;
+ long getEngineWidth(ScFieldEditEngine* pEngine) const;
+ bool hasLineBreak() const;
+
+ /**
+ * When the text is vertically oriented, the text is either rotated 90
+ * degrees to the right or 90 degrees to the left. Note that this is
+ * different from being vertically stacked.
+ */
+ bool isVerticallyOriented() const;
+
+ void setAlignmentItems(ScFieldEditEngine* pEngine, ScBaseCell* pCell);
+ bool adjustHorAlignment(ScFieldEditEngine* pEngine);
+
+private:
+ const ScPatternAttr* mpPattern;
+ const SfxItemSet* mpCondSet;
+};
+
+EditAlignmentParam::EditAlignmentParam(const ScPatternAttr* pPattern, const SfxItemSet* pCondSet, bool bCellIsValue) :
+ meHorJust( lcl_GetValue<SvxHorJustifyItem, SvxCellHorJustify>(*pPattern, ATTR_HOR_JUSTIFY, pCondSet) ),
+ meVerJust( lcl_GetValue<SvxVerJustifyItem, SvxCellVerJustify>(*pPattern, ATTR_VER_JUSTIFY, pCondSet) ),
+ meHorJustMethod( lcl_GetValue<SvxJustifyMethodItem, SvxCellJustifyMethod>(*pPattern, ATTR_HOR_JUSTIFY_METHOD, pCondSet) ),
+ meVerJustMethod( lcl_GetValue<SvxJustifyMethodItem, SvxCellJustifyMethod>(*pPattern, ATTR_VER_JUSTIFY_METHOD, pCondSet) ),
+ meOrient( pPattern->GetCellOrientation(pCondSet) ),
+ mbBreak( (meHorJust == SVX_HOR_JUSTIFY_BLOCK) || lcl_GetBoolValue(*pPattern, ATTR_LINEBREAK, pCondSet) ),
+ mbCellIsValue(bCellIsValue),
+ mpPattern(pPattern),
+ mpCondSet(pCondSet)
+{}
+
+void EditAlignmentParam::calcMargins(long& rTopM, long& rLeftM, long& rBottomM, long& rRightM, double nPPTX, double nPPTY) const
+{
+ const SvxMarginItem& rMargin =
+ static_cast<const SvxMarginItem&>(mpPattern->GetItem(ATTR_MARGIN, mpCondSet));
+
+ sal_uInt16 nIndent = 0;
+ if (meHorJust == SVX_HOR_JUSTIFY_LEFT)
+ nIndent = lcl_GetValue<SfxUInt16Item, sal_uInt16>(*mpPattern, ATTR_INDENT, mpCondSet);
+
+ rLeftM = static_cast<long>(((rMargin.GetLeftMargin() + nIndent) * nPPTX));
+ rTopM = static_cast<long>((rMargin.GetTopMargin() * nPPTY));
+ rRightM = static_cast<long>((rMargin.GetRightMargin() * nPPTX));
+ rBottomM = static_cast<long>((rMargin.GetBottomMargin() * nPPTY));
+}
+
+void EditAlignmentParam::calcPaperSize(
+ Size& rPaperSize, const Rectangle& rAlignRect, double nPPTX, double nPPTY) const
+{
+ long nTopM, nLeftM, nBottomM, nRightM;
+ calcMargins(nTopM, nLeftM, nBottomM, nRightM, nPPTX, nPPTY);
+
+ if (isVerticallyOriented())
+ {
+ rPaperSize.Width() = rAlignRect.GetHeight() - nTopM - nBottomM;
+ rPaperSize.Height() = rAlignRect.GetWidth() - nLeftM - nRightM;
+ }
+ else
+ {
+ rPaperSize.Width() = rAlignRect.GetWidth() - nLeftM - nRightM;
+ rPaperSize.Height() = rAlignRect.GetHeight() - nTopM - nBottomM;
+ }
+
+ if (mbAsianVertical)
+ {
+ rPaperSize.Height() = rAlignRect.GetHeight() - nTopM - nBottomM;
+ // Subtract some extra value from the height or else the text would go
+ // outside the cell area. The value of 5 is arbitrary, and is based
+ // entirely on heuristics.
+ rPaperSize.Height() -= 5;
}
}
+void EditAlignmentParam::getEngineSize(ScFieldEditEngine* pEngine, long& rWidth, long& rHeight) const
+{
+ long nEngineWidth = 0;
+ if (!mbBreak || meOrient == SVX_ORIENTATION_STACKED || mbAsianVertical)
+ nEngineWidth = static_cast<long>(pEngine->CalcTextWidth());
+
+ long nEngineHeight = pEngine->GetTextHeight();
+
+ if (isVerticallyOriented())
+ {
+ long nTemp = nEngineWidth;
+ nEngineWidth = nEngineHeight;
+ nEngineHeight = nTemp;
+ }
+
+ if (meOrient == SVX_ORIENTATION_STACKED)
+ nEngineWidth = nEngineWidth * 11 / 10;
+
+ rWidth = nEngineWidth;
+ rHeight = nEngineHeight;
+}
+
+long EditAlignmentParam::getEngineWidth(ScFieldEditEngine* pEngine) const
+{
+ if (mbBreak && meOrient != SVX_ORIENTATION_STACKED && !mbAsianVertical)
+ return 0;
+ else
+ return static_cast<long>(pEngine->CalcTextWidth());
+}
+
+bool EditAlignmentParam::hasLineBreak() const
+{
+ return (mbBreak || (meOrient == SVX_ORIENTATION_STACKED) || mbAsianVertical);
+}
+
+bool EditAlignmentParam::isVerticallyOriented() const
+{
+ return (meOrient == SVX_ORIENTATION_TOPBOTTOM || meOrient == SVX_ORIENTATION_BOTTOMTOP);
+}
+
+void EditAlignmentParam::setAlignmentItems(ScFieldEditEngine* pEngine, ScBaseCell* pCell)
+{
+ if (isVerticallyOriented() || mbAsianVertical)
+ {
+ SvxAdjust eSvxAdjust = SVX_ADJUST_LEFT;
+ switch (meVerJust)
+ {
+ case SVX_VER_JUSTIFY_TOP:
+ eSvxAdjust = (meOrient == SVX_ORIENTATION_TOPBOTTOM || mbAsianVertical) ?
+ SVX_ADJUST_LEFT : SVX_ADJUST_RIGHT;
+ break;
+ case SVX_VER_JUSTIFY_CENTER:
+ eSvxAdjust = SVX_ADJUST_CENTER;
+ break;
+ case SVX_VER_JUSTIFY_BOTTOM:
+ case SVX_VER_JUSTIFY_STANDARD:
+ eSvxAdjust = (meOrient == SVX_ORIENTATION_TOPBOTTOM || mbAsianVertical) ?
+ SVX_ADJUST_RIGHT : SVX_ADJUST_LEFT;
+ break;
+ case SVX_VER_JUSTIFY_BLOCK:
+ eSvxAdjust = SVX_ADJUST_BLOCK;
+ break;
+ }
+
+ pEngine->SetDefaultItem( SvxAdjustItem(eSvxAdjust, EE_PARA_JUST) );
+ pEngine->SetDefaultItem( SvxJustifyMethodItem(meVerJustMethod, EE_PARA_JUST_METHOD) );
+
+ if (meHorJust == SVX_HOR_JUSTIFY_BLOCK)
+ pEngine->SetDefaultItem( SvxVerJustifyItem(SVX_VER_JUSTIFY_BLOCK, EE_PARA_VER_JUST) );
+ }
+ else
+ {
+ // horizontal alignment now may depend on cell content
+ // (for values with number formats with mixed script types)
+ // -> always set adjustment
+
+ SvxAdjust eSvxAdjust = SVX_ADJUST_LEFT;
+ if (meOrient == SVX_ORIENTATION_STACKED)
+ eSvxAdjust = SVX_ADJUST_CENTER;
+ else if (mbBreak)
+ {
+ if (meOrient == SVX_ORIENTATION_STANDARD)
+ switch (meHorJust)
+ {
+ case SVX_HOR_JUSTIFY_STANDARD:
+ eSvxAdjust = mbCellIsValue ? SVX_ADJUST_RIGHT : SVX_ADJUST_LEFT;
+ break;
+ case SVX_HOR_JUSTIFY_LEFT:
+ case SVX_HOR_JUSTIFY_REPEAT: // nicht implementiert
+ eSvxAdjust = SVX_ADJUST_LEFT;
+ break;
+ case SVX_HOR_JUSTIFY_RIGHT:
+ eSvxAdjust = SVX_ADJUST_RIGHT;
+ break;
+ case SVX_HOR_JUSTIFY_CENTER:
+ eSvxAdjust = SVX_ADJUST_CENTER;
+ break;
+ case SVX_HOR_JUSTIFY_BLOCK:
+ eSvxAdjust = SVX_ADJUST_BLOCK;
+ break;
+ }
+ else
+ switch (meVerJust)
+ {
+ case SVX_VER_JUSTIFY_TOP:
+ eSvxAdjust = SVX_ADJUST_RIGHT;
+ break;
+ case SVX_VER_JUSTIFY_CENTER:
+ eSvxAdjust = SVX_ADJUST_CENTER;
+ break;
+ case SVX_VER_JUSTIFY_BOTTOM:
+ case SVX_VER_JUSTIFY_STANDARD:
+ eSvxAdjust = SVX_ADJUST_LEFT;
+ break;
+ case SVX_VER_JUSTIFY_BLOCK:
+ eSvxAdjust = SVX_ADJUST_BLOCK;
+ break;
+ }
+ }
+
+ pEngine->SetDefaultItem( SvxAdjustItem(eSvxAdjust, EE_PARA_JUST) );
+
+ if (mbAsianVertical)
+ {
+ pEngine->SetDefaultItem( SvxJustifyMethodItem(meVerJustMethod, EE_PARA_JUST_METHOD) );
+ if (meHorJust == SVX_HOR_JUSTIFY_BLOCK)
+ pEngine->SetDefaultItem( SvxVerJustifyItem(SVX_VER_JUSTIFY_BLOCK, EE_PARA_VER_JUST) );
+ }
+ else
+ {
+ pEngine->SetDefaultItem( SvxJustifyMethodItem(meHorJustMethod, EE_PARA_JUST_METHOD) );
+ if (meVerJust == SVX_VER_JUSTIFY_BLOCK)
+ pEngine->SetDefaultItem( SvxVerJustifyItem(SVX_VER_JUSTIFY_BLOCK, EE_PARA_VER_JUST) );
+ }
+ }
+
+ pEngine->SetVertical(mbAsianVertical);
+ if (pCell && pCell->GetCellType() == CELLTYPE_EDIT)
+ {
+ // We need to synchronize the vertical mode in the EditTextObject
+ // instance too. No idea why we keep this state in two separate
+ // instances.
+ ScEditCell* pEditCell = static_cast<ScEditCell*>(pCell);
+ const EditTextObject* pData = pEditCell->GetData();
+ if (pData)
+ const_cast<EditTextObject*>(pData)->SetVertical(mbAsianVertical);
+ }
+}
+
+bool EditAlignmentParam::adjustHorAlignment(ScFieldEditEngine* pEngine)
+{
+ if (meHorJust == SVX_HOR_JUSTIFY_RIGHT || meHorJust == SVX_HOR_JUSTIFY_CENTER ||
+ (meHorJust == SVX_HOR_JUSTIFY_STANDARD && mbCellIsValue))
+ {
+ SvxAdjust eEditAdjust = (meHorJust == SVX_HOR_JUSTIFY_CENTER) ?
+ SVX_ADJUST_CENTER : SVX_ADJUST_RIGHT;
+
+ pEngine->SetUpdateMode(false);
+ pEngine->SetDefaultItem( SvxAdjustItem(eEditAdjust, EE_PARA_JUST) );
+ pEngine->SetUpdateMode(true);
+ return true;
+ }
+ return false;
+}
+
+}
+
void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
{
vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
- Size aMinSize = pRefDevice->PixelToLogic(Size(0,100)); // erst darueber wird ausgegeben
-// sal_uInt32 nMinHeight = aMinSize.Height() / 200; // 1/2 Pixel
-
ScModule* pScMod = SC_MOD();
sal_Int32 nConfBackColor = pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
sal_Bool bCellContrast = bUseStyleColor &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
ScFieldEditEngine* pEngine = NULL;
- sal_Bool bHyphenatorSet = sal_False;
+ sal_Bool bHyphenatorSet = false;
const ScPatternAttr* pOldPattern = NULL;
const SfxItemSet* pOldCondSet = NULL;
ScBaseCell* pCell = NULL;
@@ -2115,11 +2384,6 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
long nInitPosX = nScrX;
if ( bLayoutRTL )
{
-#if 0
- Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- nInitPosX += nMirrorW - nOneX;
-#endif
nInitPosX += nMirrorW - 1;
}
long nLayoutSign = bLayoutRTL ? -1 : 1;
@@ -2134,7 +2398,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
for (SCSIZE nArrY=0; nArrY+1<nArrCount; nArrY++) // 0 fuer Reste von zusammengefassten
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
-// long nCellHeight = (long) pThisRowInfo->nHeight;
+
if (nArrY==1) nRowPosY = nScrY; // vorher wird einzeln berechnet
if ( pThisRowInfo->bChanged || nArrY==0 )
@@ -2151,7 +2415,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
SCCOL nCellX = nX; // position where the cell really starts
SCROW nCellY = nY;
- sal_Bool bDoCell = sal_False;
+ sal_Bool bDoCell = false;
long nPosY = nRowPosY;
if ( nArrY == 0 )
@@ -2189,7 +2453,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
}
if ( bDoCell && bEditMode && nCellX == nEditCol && nCellY == nEditRow )
- bDoCell = sal_False;
+ bDoCell = false;
const ScPatternAttr* pPattern = NULL;
const SfxItemSet* pCondSet = NULL;
@@ -2210,11 +2474,11 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
GetVisibleCell( nCellX, nCellY, nTab, pCell );
}
if ( !pCell )
- bDoCell = sal_False;
+ bDoCell = false;
}
if (bDoCell)
{
- sal_Bool bHidden = sal_False;
+ sal_Bool bHidden = false;
//
// Create EditEngine
@@ -2225,7 +2489,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
// Ein RefDevice muss auf jeden Fall gesetzt werden,
// sonst legt sich die EditEngine ein VirtualDevice an!
pEngine = new ScFieldEditEngine( pDoc->GetEnginePool() );
- pEngine->SetUpdateMode( sal_False );
+ pEngine->SetUpdateMode( false );
pEngine->SetRefDevice( pFmtDevice ); // always set
sal_uLong nCtrl = pEngine->GetControlWord();
if ( bShowSpellErrors )
@@ -2243,86 +2507,55 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
else
lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(sal_False)
+ EditAlignmentParam aAlignParam(pPattern, pCondSet, lcl_SafeIsValue(pCell));
- sal_Bool bCellIsValue = lcl_SafeIsValue(pCell);
+ bool bRepeat = (aAlignParam.meHorJust == SVX_HOR_JUSTIFY_REPEAT && !aAlignParam.mbBreak);
+ bool bShrink = !aAlignParam.mbBreak && !bRepeat && lcl_GetBoolValue(*pPattern, ATTR_SHRINKTOFIT, pCondSet);
+ long nAttrRotate = lcl_GetValue<SfxInt32Item, long>(*pPattern, ATTR_ROTATE_VALUE, pCondSet);
- SvxCellHorJustify eHorJust = (SvxCellHorJustify)((const SvxHorJustifyItem&)
- pPattern->GetItem(ATTR_HOR_JUSTIFY, pCondSet)).GetValue();
- sal_Bool bBreak = ( eHorJust == SVX_HOR_JUSTIFY_BLOCK ) ||
- ((const SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK, pCondSet)).GetValue();
- sal_Bool bRepeat = ( eHorJust == SVX_HOR_JUSTIFY_REPEAT && !bBreak );
- sal_Bool bShrink = !bBreak && !bRepeat && static_cast<const SfxBoolItem&>
- (pPattern->GetItem( ATTR_SHRINKTOFIT, pCondSet )).GetValue();
- SvxCellOrientation eOrient = pPattern->GetCellOrientation( pCondSet );
- long nAttrRotate = ((const SfxInt32Item&)pPattern->
- GetItem(ATTR_ROTATE_VALUE, pCondSet)).GetValue();
- if ( eHorJust == SVX_HOR_JUSTIFY_REPEAT )
+ if ( aAlignParam.meHorJust == SVX_HOR_JUSTIFY_REPEAT )
{
// ignore orientation/rotation if "repeat" is active
- eOrient = SVX_ORIENTATION_STANDARD;
+ aAlignParam.meOrient = SVX_ORIENTATION_STANDARD;
nAttrRotate = 0;
// #i31843# "repeat" with "line breaks" is treated as default alignment
// (but rotation is still disabled)
- if ( bBreak )
- eHorJust = SVX_HOR_JUSTIFY_STANDARD;
+ if ( aAlignParam.mbBreak )
+ aAlignParam.meHorJust = SVX_HOR_JUSTIFY_STANDARD;
}
- if ( eOrient==SVX_ORIENTATION_STANDARD && nAttrRotate )
+ if ( aAlignParam.meOrient==SVX_ORIENTATION_STANDARD && nAttrRotate )
{
//! Flag setzen, um die Zelle in DrawRotated wiederzufinden ?
//! (oder Flag schon bei DrawBackground, dann hier keine Abfrage)
bHidden = sal_True; // gedreht wird getrennt ausgegeben
}
- sal_Bool bAsianVertical = ( eOrient == SVX_ORIENTATION_STACKED &&
- ((const SfxBoolItem&)pPattern->GetItem( ATTR_VERTICAL_ASIAN, pCondSet )).GetValue() );
- if ( bAsianVertical )
+ aAlignParam.mbAsianVertical = (aAlignParam.meOrient == SVX_ORIENTATION_STACKED) &&
+ lcl_GetBoolValue(*pPattern, ATTR_VERTICAL_ASIAN, pCondSet);
+
+ if ( aAlignParam.mbAsianVertical )
{
// in asian mode, use EditEngine::SetVertical instead of EE_CNTRL_ONECHARPERLINE
- eOrient = SVX_ORIENTATION_STANDARD;
+ aAlignParam.meOrient = SVX_ORIENTATION_STANDARD;
// default alignment for asian vertical mode is top-right
- if ( eHorJust == SVX_HOR_JUSTIFY_STANDARD )
- eHorJust = SVX_HOR_JUSTIFY_RIGHT;
+ if ( aAlignParam.meHorJust == SVX_HOR_JUSTIFY_STANDARD )
+ aAlignParam.meHorJust = SVX_HOR_JUSTIFY_RIGHT;
}
-
-
SvxCellHorJustify eOutHorJust =
- ( eHorJust != SVX_HOR_JUSTIFY_STANDARD ) ? eHorJust :
- ( bCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_LEFT );
+ ( aAlignParam.meHorJust != SVX_HOR_JUSTIFY_STANDARD ) ? aAlignParam.meHorJust :
+ ( aAlignParam.mbCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_LEFT );
if ( eOutHorJust == SVX_HOR_JUSTIFY_BLOCK || eOutHorJust == SVX_HOR_JUSTIFY_REPEAT )
eOutHorJust = SVX_HOR_JUSTIFY_LEFT; // repeat is not yet implemented
-
-//! if ( !bHidden && eType == OUTTYPE_PRINTER &&
-//! pDev->GetOutDevType() == OUTDEV_WINDOW &&
-//! ((const SvxFontHeightItem&)pPattern->
-//! GetItem(ATTR_FONT_HEIGHT)).GetHeight() <= nMinHeight )
-//! {
-//! Point aPos( nStartX, nStartY );
-//! pDev->DrawPixel( aPos,
-//! ((const SvxColorItem&)pPattern->
-//! GetItem( ATTR_FONT_COLOR )).GetValue() );
-//! bHidden = sal_True;
-//! }
-
if (!bHidden)
{
//! mirror margin values for RTL?
//! move margin down to after final GetOutputArea call
-
- const SvxMarginItem* pMargin = (const SvxMarginItem*)
- &pPattern->GetItem(ATTR_MARGIN, pCondSet);
- sal_uInt16 nIndent = 0;
- if ( eHorJust == SVX_HOR_JUSTIFY_LEFT )
- nIndent = ((const SfxUInt16Item&)pPattern->
- GetItem(ATTR_INDENT, pCondSet)).GetValue();
-
- long nLeftM = (long) ( (pMargin->GetLeftMargin() + nIndent) * nPPTX );
- long nTopM = (long) ( pMargin->GetTopMargin() * nPPTY );
- long nRightM = (long) ( pMargin->GetRightMargin() * nPPTX );
- long nBottomM = (long) ( pMargin->GetBottomMargin() * nPPTY );
+ long nTopM, nLeftM, nBottomM, nRightM;
+ aAlignParam.calcMargins(nTopM, nLeftM, nBottomM, nRightM, nPPTX, nPPTY);
SCCOL nXForPos = nX;
if ( nXForPos < nX1 )
@@ -2344,43 +2577,29 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
//
Size aPaperSize = Size( 1000000, 1000000 );
- if ( bBreak || eOrient == SVX_ORIENTATION_STACKED || bAsianVertical )
+ if (aAlignParam.hasLineBreak())
{
- //! also stacked, AsianVertical
-
// call GetOutputArea with nNeeded=0, to get only the cell width
//! handle nArrY == 0
GetOutputArea( nXForPos, nArrYForPos, nPosX, nPosY, nCellX, nCellY, 0,
*pPattern, sal::static_int_cast<sal_uInt16>(eOutHorJust),
- bCellIsValue, true, false, aAreaParam );
+ aAlignParam.mbCellIsValue, true, false, aAreaParam );
//! special ScEditUtil handling if formatting for printer
-
- if ( eOrient == SVX_ORIENTATION_TOPBOTTOM || eOrient == SVX_ORIENTATION_BOTTOMTOP )
- aPaperSize.Width() = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
- else
- aPaperSize.Width() = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
-
- if (bAsianVertical && bBreak)
- {
- // add some extra height (default margin value) for safety
- // as long as GetEditArea isn't used below
- long nExtraHeight = (long)( 20 * nPPTY );
- aPaperSize.Height() = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM + nExtraHeight;
- }
+ aAlignParam.calcPaperSize(aPaperSize, aAreaParam.maAlignRect, nPPTX, nPPTY);
}
if (bPixelToLogic)
{
Size aLogicSize = pRefDevice->PixelToLogic(aPaperSize);
- if ( bBreak && !bAsianVertical && pRefDevice != pFmtDevice )
+ if ( aAlignParam.mbBreak && !aAlignParam.mbAsianVertical && pRefDevice != pFmtDevice )
{
// #i85342# screen display and formatting for printer,
// use same GetEditArea call as in ScViewData::SetEditEngine
Fraction aFract(1,1);
Rectangle aUtilRect = ScEditUtil( pDoc, nCellX, nCellY, nTab, Point(0,0), pFmtDevice,
- HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( pPattern, sal_False );
+ HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( pPattern, false );
aLogicSize.Width() = aUtilRect.GetWidth();
}
pEngine->SetPaperSize(aLogicSize);
@@ -2392,12 +2611,9 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
// Fill the EditEngine (cell attributes and text)
//
- SvxCellVerJustify eVerJust = (SvxCellVerJustify)((const SvxVerJustifyItem&)
- pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet)).GetValue();
-
// default alignment for asian vertical mode is top-right
- if ( bAsianVertical && eVerJust == SVX_VER_JUSTIFY_STANDARD )
- eVerJust = SVX_VER_JUSTIFY_TOP;
+ if ( aAlignParam.mbAsianVertical && aAlignParam.meVerJust == SVX_VER_JUSTIFY_STANDARD )
+ aAlignParam.meVerJust = SVX_VER_JUSTIFY_TOP;
// syntax highlighting mode is ignored here
// StringDiffer doesn't look at hyphenate, language items
@@ -2411,7 +2627,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
pOldCondSet = pCondSet;
sal_uLong nControl = pEngine->GetControlWord();
- if (eOrient==SVX_ORIENTATION_STACKED)
+ if (aAlignParam.meOrient==SVX_ORIENTATION_STACKED)
nControl |= EE_CNTRL_ONECHARPERLINE;
else
nControl &= ~EE_CNTRL_ONECHARPERLINE;
@@ -2432,57 +2648,11 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
pEngine->SetBackgroundColor( aBackCol );
}
- // horizontal alignment now may depend on cell content
- // (for values with number formats with mixed script types)
- // -> always set adjustment
-
- SvxAdjust eSvxAdjust = SVX_ADJUST_LEFT;
- if (eOrient==SVX_ORIENTATION_STACKED)
- eSvxAdjust = SVX_ADJUST_CENTER;
- else if (bBreak)
- {
- if (eOrient==SVX_ORIENTATION_STANDARD && !bAsianVertical)
- switch (eHorJust)
- {
- case SVX_HOR_JUSTIFY_STANDARD:
- eSvxAdjust = bCellIsValue ? SVX_ADJUST_RIGHT : SVX_ADJUST_LEFT;
- break;
- case SVX_HOR_JUSTIFY_LEFT:
- case SVX_HOR_JUSTIFY_REPEAT: // nicht implementiert
- eSvxAdjust = SVX_ADJUST_LEFT;
- break;
- case SVX_HOR_JUSTIFY_RIGHT:
- eSvxAdjust = SVX_ADJUST_RIGHT;
- break;
- case SVX_HOR_JUSTIFY_CENTER:
- eSvxAdjust = SVX_ADJUST_CENTER;
- break;
- case SVX_HOR_JUSTIFY_BLOCK:
- eSvxAdjust = SVX_ADJUST_BLOCK;
- break;
- }
- else
- switch (eVerJust)
- {
- case SVX_VER_JUSTIFY_TOP:
- eSvxAdjust = (eOrient==SVX_ORIENTATION_TOPBOTTOM || bAsianVertical) ?
- SVX_ADJUST_LEFT : SVX_ADJUST_RIGHT;
- break;
- case SVX_VER_JUSTIFY_CENTER:
- eSvxAdjust = SVX_ADJUST_CENTER;
- break;
- case SVX_VER_JUSTIFY_BOTTOM:
- case SVX_HOR_JUSTIFY_STANDARD:
- eSvxAdjust = (eOrient==SVX_ORIENTATION_TOPBOTTOM || bAsianVertical) ?
- SVX_ADJUST_RIGHT : SVX_ADJUST_LEFT;
- break;
- }
- }
- pEngine->SetDefaultItem( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) );
+ aAlignParam.setAlignmentItems(pEngine, pCell);
// Read content from cell
- sal_Bool bWrapFields = sal_False;
+ sal_Bool bWrapFields = false;
if (pCell)
{
if (pCell->GetCellType() == CELLTYPE_EDIT)
@@ -2494,7 +2664,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
{
pEngine->SetText(*pData);
- if ( bBreak && !bAsianVertical && pData->HasField() )
+ if ( aAlignParam.mbBreak && !aAlignParam.mbAsianVertical && pData->HasField() )
{
// Fields aren't wrapped, so clipping is enabled to prevent
// a field from being drawn beyond the cell size
@@ -2504,7 +2674,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
}
else
{
- DBG_ERROR("pData == 0");
+ OSL_FAIL("pData == 0");
}
}
else
@@ -2532,56 +2702,39 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
}
else
{
- DBG_ERROR("pCell == NULL");
+ OSL_FAIL("pCell == NULL");
}
- pEngine->SetVertical( bAsianVertical );
- pEngine->SetUpdateMode( sal_True ); // after SetText, before CalcTextWidth/GetTextHeight
+ pEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight
//
// Get final output area using the calculated width
//
- long nEngineWidth;
- if ( bBreak && eOrient != SVX_ORIENTATION_STACKED && !bAsianVertical )
- nEngineWidth = 0;
- else
- nEngineWidth = (long) pEngine->CalcTextWidth();
- long nEngineHeight = pEngine->GetTextHeight();
-
- if (eOrient != SVX_ORIENTATION_STANDARD &&
- eOrient != SVX_ORIENTATION_STACKED)
- {
- long nTemp = nEngineWidth;
- nEngineWidth = nEngineHeight;
- nEngineHeight = nTemp;
- }
-
- if (eOrient == SVX_ORIENTATION_STACKED)
- nEngineWidth = nEngineWidth * 11 / 10;
+ long nEngineWidth, nEngineHeight;
+ aAlignParam.getEngineSize(pEngine, nEngineWidth, nEngineHeight);
long nNeededPixel = nEngineWidth;
if (bPixelToLogic)
nNeededPixel = pRefDevice->LogicToPixel(Size(nNeededPixel,0)).Width();
nNeededPixel += nLeftM + nRightM;
- if ( ( !bBreak && eOrient != SVX_ORIENTATION_STACKED ) || bAsianVertical || bShrink )
+ if ( ( !aAlignParam.mbBreak && aAlignParam.meOrient != SVX_ORIENTATION_STACKED ) || aAlignParam.mbAsianVertical || bShrink )
{
// for break, the first GetOutputArea call is sufficient
GetOutputArea( nXForPos, nArrYForPos, nPosX, nPosY, nCellX, nCellY, nNeededPixel,
*pPattern, sal::static_int_cast<sal_uInt16>(eOutHorJust),
- bCellIsValue || bRepeat || bShrink, false, false, aAreaParam );
+ aAlignParam.mbCellIsValue || bRepeat || bShrink, false, false, aAreaParam );
if ( bShrink )
{
- sal_Bool bWidth = ( eOrient == SVX_ORIENTATION_STANDARD && !bAsianVertical );
+ sal_Bool bWidth = ( aAlignParam.meOrient == SVX_ORIENTATION_STANDARD && !aAlignParam.mbAsianVertical );
ShrinkEditEngine( *pEngine, aAreaParam.maAlignRect,
nLeftM, nTopM, nRightM, nBottomM, bWidth,
- sal::static_int_cast<sal_uInt16>(eOrient), 0, bPixelToLogic,
+ sal::static_int_cast<sal_uInt16>(aAlignParam.meOrient), 0, bPixelToLogic,
nEngineWidth, nEngineHeight, nNeededPixel,
aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
}
-
if ( bRepeat && !aAreaParam.mbLeftClip && !aAreaParam.mbRightClip && pEngine->GetParagraphCount() == 1 )
{
// First check if twice the space for the formatted text is available
@@ -2622,7 +2775,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
}
}
- if ( bCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
+ if ( aAlignParam.mbCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
{
pEngine->SetText( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("###")) );
nEngineWidth = (long) pEngine->CalcTextWidth();
@@ -2635,7 +2788,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
// No clip marks if "###" doesn't fit (same as in DrawStrings)
}
- if ( eOutHorJust != SVX_HOR_JUSTIFY_LEFT && eOrient == SVX_ORIENTATION_STANDARD )
+ if ( eOutHorJust != SVX_HOR_JUSTIFY_LEFT && aAlignParam.meOrient == SVX_ORIENTATION_STANDARD )
{
aPaperSize.Width() = nNeededPixel + 1;
if (bPixelToLogic)
@@ -2651,13 +2804,15 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
long nOutWidth = nCellWidth - 1 - nLeftM - nRightM;
long nOutHeight = aAreaParam.maAlignRect.GetHeight() - nTopM - nBottomM;
- if ( bBreak || eOrient != SVX_ORIENTATION_STANDARD || bAsianVertical )
+ if ( aAlignParam.mbBreak || aAlignParam.meOrient != SVX_ORIENTATION_STANDARD || aAlignParam.mbAsianVertical )
{
// text with automatic breaks is aligned only within the
// edit engine's paper size, the output of the whole area
// is always left-aligned
nStartX += nLeftM;
+ if (aAlignParam.meOrient == SVX_ORIENTATION_TOPBOTTOM && aAlignParam.meHorJust == SVX_HOR_JUSTIFY_BLOCK)
+ nStartX += aPaperSize.Height();
}
else
{
@@ -2684,7 +2839,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
if ( !bHidden && !bOutside )
{
bool bClip = aAreaParam.mbLeftClip || aAreaParam.mbRightClip;
- sal_Bool bSimClip = sal_False;
+ sal_Bool bSimClip = false;
if ( bWrapFields )
{
@@ -2733,8 +2888,8 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
// Only with automatic line breaks, to avoid having to find
// the cells with the horizontal end of the text again.
if ( nEngineHeight - aCellSize.Height() > 100 &&
- ( bBreak || eOrient == SVX_ORIENTATION_STACKED ) &&
- !bAsianVertical && bMarkClipped &&
+ ( aAlignParam.mbBreak || aAlignParam.meOrient == SVX_ORIENTATION_STACKED ) &&
+ !aAlignParam.mbAsianVertical && bMarkClipped &&
( pEngine->GetParagraphCount() > 1 || pEngine->GetLineCount(0) > 1 ) )
{
CellInfo* pClipMarkCell = NULL;
@@ -2756,20 +2911,6 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
}
}
-#if 0
- long nClipStartY = nStartY;
- if (nArrY==0 || bVisChanged)
- {
- if ( nClipStartY < nRowPosY )
- {
- long nDif = nRowPosY - nClipStartY;
- bClip = sal_True;
- nClipStartY = nRowPosY;
- aClipSize.Height() -= nDif;
- }
- }
-#endif
-
Rectangle aLogicClip;
if (bClip || bSimClip)
{
@@ -2797,50 +2938,35 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
aLogicStart = pRefDevice->PixelToLogic( Point(nStartX,nStartY) );
else
aLogicStart = Point(nStartX, nStartY);
- if ( eOrient!=SVX_ORIENTATION_STANDARD || bAsianVertical || !bBreak )
+ if ( aAlignParam.meOrient!=SVX_ORIENTATION_STANDARD || aAlignParam.mbAsianVertical || !aAlignParam.mbBreak )
{
long nAvailWidth = aCellSize.Width();
// space for AutoFilter is already handled in GetOutputArea
// horizontal alignment
- if (eOrient==SVX_ORIENTATION_STANDARD && !bAsianVertical)
+ if (aAlignParam.meOrient==SVX_ORIENTATION_STANDARD && !aAlignParam.mbAsianVertical)
{
- if (eHorJust==SVX_HOR_JUSTIFY_RIGHT ||
- eHorJust==SVX_HOR_JUSTIFY_CENTER ||
- (eHorJust==SVX_HOR_JUSTIFY_STANDARD && bCellIsValue) )
- {
- pEngine->SetUpdateMode( sal_False );
-
- SvxAdjust eEditAdjust =
- (eHorJust==SVX_HOR_JUSTIFY_CENTER) ?
- SVX_ADJUST_CENTER : SVX_ADJUST_RIGHT;
- pEngine->SetDefaultItem(
- SvxAdjustItem( eEditAdjust, EE_PARA_JUST ) );
-
- // #55142# reset adjustment for the next cell
+ if (aAlignParam.adjustHorAlignment(pEngine))
+ // reset adjustment for the next cell
pOldPattern = NULL;
-
- pEngine->SetUpdateMode( sal_True );
- }
}
else
{
- if (eHorJust==SVX_HOR_JUSTIFY_RIGHT)
+ if (aAlignParam.meHorJust==SVX_HOR_JUSTIFY_RIGHT)
aLogicStart.X() += nAvailWidth - nEngineWidth;
- else if (eHorJust==SVX_HOR_JUSTIFY_CENTER)
+ else if (aAlignParam.meHorJust==SVX_HOR_JUSTIFY_CENTER)
aLogicStart.X() += (nAvailWidth - nEngineWidth) / 2;
}
}
- if ( bAsianVertical )
+ if ( aAlignParam.mbAsianVertical )
{
// paper size is subtracted below
aLogicStart.X() += nEngineWidth;
}
- if ( ( bAsianVertical || eOrient == SVX_ORIENTATION_TOPBOTTOM ||
- eOrient == SVX_ORIENTATION_BOTTOMTOP ) && bBreak )
+ if ( (aAlignParam.mbAsianVertical || aAlignParam.isVerticallyOriented()) && aAlignParam.mbBreak )
{
// vertical adjustment is within the EditEngine
if (bPixelToLogic)
@@ -2849,11 +2975,11 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
aLogicStart.Y() += nTopM;
}
- if ( ( eOrient==SVX_ORIENTATION_STANDARD && !bAsianVertical ) ||
- eOrient==SVX_ORIENTATION_STACKED || !bBreak )
+ if (!aAlignParam.mbAsianVertical && !aAlignParam.isVerticallyOriented() &&
+ (aAlignParam.meOrient == SVX_ORIENTATION_STANDARD || aAlignParam.meOrient == SVX_ORIENTATION_STACKED || !aAlignParam.mbBreak))
{
- if (eVerJust==SVX_VER_JUSTIFY_BOTTOM ||
- eVerJust==SVX_VER_JUSTIFY_STANDARD)
+ if (aAlignParam.meVerJust==SVX_VER_JUSTIFY_BOTTOM ||
+ aAlignParam.meVerJust==SVX_VER_JUSTIFY_STANDARD)
{
//! if pRefDevice != pFmtDevice, keep heights in logic units,
//! only converting margin?
@@ -2866,7 +2992,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
else
aLogicStart.Y() += nTopM + aCellSize.Height() - nEngineHeight;
}
- else if (eVerJust==SVX_VER_JUSTIFY_CENTER)
+ else if (aAlignParam.meVerJust==SVX_VER_JUSTIFY_CENTER)
{
if (bPixelToLogic)
aLogicStart.Y() += pRefDevice->PixelToLogic( Size(0, nTopM + (
@@ -2888,19 +3014,61 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
Point aURLStart = aLogicStart; // copy before modifying for orientation
short nOriVal = 0;
- if (eOrient==SVX_ORIENTATION_TOPBOTTOM)
+ if (aAlignParam.meOrient == SVX_ORIENTATION_TOPBOTTOM)
{
- // nOriVal = -900;
nOriVal = 2700;
- aLogicStart.X() += nEngineWidth;
+ if (aAlignParam.meHorJust != SVX_HOR_JUSTIFY_BLOCK)
+ {
+ aLogicStart.X() += nEngineWidth;
+ if (!aAlignParam.mbBreak)
+ {
+ // Set the paper width to text size.
+ Size aPSize = pEngine->GetPaperSize();
+ aPSize.Width() = pEngine->CalcTextWidth();
+ pEngine->SetPaperSize(aPSize);
+
+ long nGap = 0;
+ long nTopOffset = 0; // offset by top margin
+ if (bPixelToLogic)
+ {
+ nGap = pRefDevice->LogicToPixel(aPSize).Width() - pRefDevice->LogicToPixel(aCellSize).Height();
+ nGap = pRefDevice->PixelToLogic(Size(0, nGap)).Height();
+ nTopOffset = pRefDevice->PixelToLogic(Size(0,nTopM)).Height();
+ }
+ else
+ {
+ nGap = aPSize.Width() - aCellSize.Height();
+ nTopOffset = nTopM;
+ }
+ aLogicStart.Y() += nTopOffset;
+
+ switch (aAlignParam.meVerJust)
+ {
+ case SVX_VER_JUSTIFY_STANDARD:
+ case SVX_VER_JUSTIFY_BOTTOM:
+ // align to bottom
+ aLogicStart.Y() -= nGap;
+ break;
+ case SVX_VER_JUSTIFY_CENTER:
+ // center it.
+ aLogicStart.Y() -= nGap / 2;
+ break;
+ case SVX_VER_JUSTIFY_BLOCK:
+ case SVX_VER_JUSTIFY_TOP:
+ // align to top (do nothing)
+ default:
+ ;
+ }
+ }
+ }
}
- else if (eOrient==SVX_ORIENTATION_BOTTOMTOP)
+ else if (aAlignParam.meOrient == SVX_ORIENTATION_BOTTOMTOP)
{
nOriVal = 900;
- aLogicStart.Y() += bBreak ? pEngine->GetPaperSize().Width() :
- nEngineHeight;
+ aLogicStart.Y() +=
+ aAlignParam.mbBreak ? pEngine->GetPaperSize().Width() : nEngineHeight;
}
- else if (eOrient==SVX_ORIENTATION_STACKED)
+ else if (aAlignParam.meOrient == SVX_ORIENTATION_STACKED)
{
Size aPaperLogic = pEngine->GetPaperSize();
aPaperLogic.Width() = nEngineWidth;
@@ -2923,18 +3091,18 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
// bMoveClipped handling has been replaced by complete alignment
// handling (also extending to the left).
- if ( bSimClip && !nOriVal && !bAsianVertical )
+ if ( bSimClip && !nOriVal && !aAlignParam.mbAsianVertical )
{
// kein hartes Clipping, aber nur die betroffenen
// Zeilen ausgeben
Point aDocStart = aLogicClip.TopLeft();
aDocStart -= aLogicStart;
- pEngine->Draw( pDev, aLogicClip, aDocStart, sal_False );
+ pEngine->Draw( pDev, aLogicClip, aDocStart, false );
}
else
{
- if (bAsianVertical)
+ if (aAlignParam.mbAsianVertical)
{
// with SetVertical, the start position is top left of
// the whole output area, not the text itself
@@ -2958,17 +3126,17 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
{
long nURLWidth = (long) pEngine->CalcTextWidth();
long nURLHeight = pEngine->GetTextHeight();
- if ( bBreak )
+ if ( aAlignParam.mbBreak )
{
Size aPaper = pEngine->GetPaperSize();
- if ( bAsianVertical )
+ if ( aAlignParam.mbAsianVertical )
nURLHeight = aPaper.Height();
else
nURLWidth = aPaper.Width();
}
- if ( eOrient == SVX_ORIENTATION_TOPBOTTOM || eOrient == SVX_ORIENTATION_BOTTOMTOP )
+ if ( aAlignParam.isVerticallyOriented() )
std::swap( nURLWidth, nURLHeight );
- else if ( bAsianVertical )
+ else if ( aAlignParam.mbAsianVertical )
aURLStart.X() -= nURLWidth;
Rectangle aURLRect( aURLStart, Size( nURLWidth, nURLHeight ) );
@@ -3003,12 +3171,12 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
ScModule* pScMod = SC_MOD();
sal_Int32 nConfBackColor = pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
sal_Bool bCellContrast = bUseStyleColor &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
ScFieldEditEngine* pEngine = NULL;
- sal_Bool bHyphenatorSet = sal_False;
+ sal_Bool bHyphenatorSet = false;
const ScPatternAttr* pPattern;
const SfxItemSet* pCondSet;
const ScPatternAttr* pOldPattern = NULL;
@@ -3018,11 +3186,6 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
long nInitPosX = nScrX;
if ( bLayoutRTL )
{
-#if 0
- Size aOnePixel = pDev->PixelToLogic(Size(1,1));
- long nOneX = aOnePixel.Width();
- nInitPosX += nMirrorW - nOneX;
-#endif
nInitPosX += nMirrorW - 1;
}
long nLayoutSign = bLayoutRTL ? -1 : 1;
@@ -3046,7 +3209,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
{
SCROW nY = pThisRowInfo->nRowNo;
- sal_Bool bHidden = sal_False;
+ sal_Bool bHidden = false;
if (bEditMode)
if ( nX == nEditCol && nY == nEditRow )
bHidden = sal_True;
@@ -3058,7 +3221,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
// Ein RefDevice muss auf jeden Fall gesetzt werden,
// sonst legt sich die EditEngine ein VirtualDevice an!
pEngine = new ScFieldEditEngine( pDoc->GetEnginePool() );
- pEngine->SetUpdateMode( sal_False );
+ pEngine->SetUpdateMode( false );
pEngine->SetRefDevice( pFmtDevice ); // always set
sal_uLong nCtrl = pEngine->GetControlWord();
if ( bShowSpellErrors )
@@ -3077,11 +3240,11 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(sal_False)
long nPosY = nRowPosY;
- sal_Bool bVisChanged = sal_False;
+ sal_Bool bVisChanged = false;
//! Rest von zusammengefasster Zelle weiter oben funktioniert nicht!
- sal_Bool bFromDoc = sal_False;
+ sal_Bool bFromDoc = false;
pPattern = pInfo->pPatternAttr;
pCondSet = pInfo->pConditionSet;
if (!pPattern)
@@ -3138,11 +3301,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
if (!bHidden)
{
long nOutWidth = nCellWidth - 1;
- long nOutHeight;
- if (pInfo)
- nOutHeight = nCellHeight;
- else
- nOutHeight = (long) ( pDoc->GetRowHeight(nY,nTab) * nPPTY );
+ long nOutHeight = nCellHeight;
if ( bMerged ) // Zusammengefasst
{
@@ -3283,7 +3442,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
pEngine->SetText(*pData);
else
{
- DBG_ERROR("pData == 0");
+ OSL_FAIL("pData == 0");
}
}
else
@@ -3311,7 +3470,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
}
else
{
- DBG_ERROR("pCell == NULL");
+ OSL_FAIL("pCell == NULL");
}
pEngine->SetUpdateMode( sal_True ); // after SetText, before CalcTextWidth/GetTextHeight
@@ -3324,7 +3483,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
double nAbsCos = fabs( nCos );
double nAbsSin = fabs( nSin );
- // #47740# adjust witdh of papersize for height of text
+ // adjust witdh of papersize for height of text
int nSteps = 5;
while (nSteps > 0)
{
@@ -3388,7 +3547,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
if (!bHidden)
{
- sal_Bool bClip = sal_False;
+ sal_Bool bClip = false;
Size aClipSize = Size( nScrX+nScrW-nStartX, nScrY+nScrH-nStartY );
// weiterschreiben
@@ -3400,7 +3559,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
aCellSize = Size( nOutWidth, nOutHeight ); // Scale ist 1
long nGridWidth = nEngineWidth;
- sal_Bool bNegative = sal_False;
+ sal_Bool bNegative = false;
if ( eRotMode != SVX_ROTATE_MODE_STANDARD )
{
nGridWidth = aCellSize.Width() +
@@ -3425,7 +3584,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
GetOutputArea( nX, nArrY, nCellStartX, nPosY, nCellX, nCellY, nNeededWidth,
*pPattern, sal::static_int_cast<sal_uInt16>(eOutHorJust),
- sal_False, sal_False, sal_True, aAreaParam );
+ false, false, sal_True, aAreaParam );
if ( bShrink )
{
@@ -3437,7 +3596,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
// always do height
ShrinkEditEngine( *pEngine, aAreaParam.maAlignRect, nLeftM, nTopM, nRightM, nBottomM,
- sal_False, sal::static_int_cast<sal_uInt16>(eOrient), nAttrRotate, bPixelToLogic,
+ false, sal::static_int_cast<sal_uInt16>(eOrient), nAttrRotate, bPixelToLogic,
nEngineWidth, nEngineHeight, nNeededPixel, aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
if ( eRotMode == SVX_ROTATE_MODE_STANDARD )
@@ -3457,8 +3616,6 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
nEngineWidth = (long) ( nRealHeight / fabs( nSin ) );
}
- // sal_Bool bVClip = ( nEngineHeight > aCellSize.Height() );
-
long nClipStartX = nStartX;
if (nX<nX1)
{
@@ -3542,7 +3699,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
if (eHorJust==SVX_HOR_JUSTIFY_RIGHT ||
eHorJust==SVX_HOR_JUSTIFY_CENTER)
{
- pEngine->SetUpdateMode( sal_False );
+ pEngine->SetUpdateMode( false );
SvxAdjust eSvxAdjust =
(eHorJust==SVX_HOR_JUSTIFY_RIGHT) ?
@@ -3703,3 +3860,4 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index 9265f6192b3c..fc8fb3e16444 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,10 +69,8 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
aOffset.Y() -= pDoc->GetRowHeight( 0, nY1-1, nTab );
long nDataWidth = 0;
- long nDataHeight = 0;
for (nCol=nX1; nCol<=nX2; nCol++)
nDataWidth += pDoc->GetColWidth( nCol, nTab );
- nDataHeight += pDoc->GetRowHeight( nY1, nY2, nTab );
if ( bLayoutRTL )
aOffset.X() += nDataWidth;
@@ -245,8 +244,7 @@ void ScOutputData::DrawSelectiveObjects(const sal_uInt16 nLayer)
// #109985#
void ScOutputData::DrawingSingle(const sal_uInt16 nLayer)
{
- sal_Bool bHad = sal_False;
- long nPosY = nScrY;
+ sal_Bool bHad = false;
SCSIZE nArrY;
for (nArrY=1; nArrY+1<nArrCount; nArrY++)
{
@@ -262,9 +260,8 @@ void ScOutputData::DrawingSingle(const sal_uInt16 nLayer)
else if (bHad)
{
DrawSelectiveObjects( nLayer );
- bHad = sal_False;
+ bHad = false;
}
- nPosY += pRowInfo[nArrY].nHeight;
}
if (bHad)
@@ -274,3 +271,4 @@ void ScOutputData::DrawingSingle(const sal_uInt16 nLayer)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/overlayobject.cxx b/sc/source/ui/view/overlayobject.cxx
new file mode 100644
index 000000000000..9d8b20083e23
--- /dev/null
+++ b/sc/source/ui/view/overlayobject.cxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * 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_sc.hxx"
+
+#include "overlayobject.hxx"
+#include "vcl/outdev.hxx"
+#include "vcl/lineinfo.hxx"
+#include "vcl/salbtype.hxx"
+#include "vcl/window.hxx"
+#include "tools/fract.hxx"
+#include "basegfx/range/b2drange.hxx"
+#include "basegfx/polygon/b2dpolygon.hxx"
+#include "basegfx/polygon/b2dpolygontools.hxx"
+#include "svx/sdr/overlay/overlaymanager.hxx"
+#include "drawinglayer/primitive2d/baseprimitive2d.hxx"
+#include "drawinglayer/primitive2d/polypolygonprimitive2d.hxx"
+
+using ::sdr::overlay::OverlayObject;
+using ::sdr::overlay::OverlayManager;
+using ::drawinglayer::primitive2d::Primitive2DSequence;
+
+#define DASH_UPDATE_INTERVAL 180 // in msec
+
+ScOverlayDashedBorder::ScOverlayDashedBorder(const ::basegfx::B2DRange& rRange, const Color& rColor, Window* pWin) :
+ OverlayObject(rColor),
+ mpParent(pWin),
+ mbToggle(true)
+{
+ mbAllowsAnimation = true;
+ maRange = rRange;
+}
+
+ScOverlayDashedBorder::~ScOverlayDashedBorder()
+{
+}
+
+void ScOverlayDashedBorder::Trigger(sal_uInt32 nTime)
+{
+ OverlayManager* pMgr = getOverlayManager();
+ if (pMgr)
+ {
+ SetTime(nTime + DASH_UPDATE_INTERVAL);
+ mbToggle = !mbToggle;
+ pMgr->InsertEvent(this);
+ objectChange();
+ }
+}
+
+void ScOverlayDashedBorder::stripeDefinitionHasChanged()
+{
+ objectChange();
+}
+
+Primitive2DSequence ScOverlayDashedBorder::createOverlayObjectPrimitive2DSequence()
+{
+ using ::basegfx::B2DPolygon;
+ using ::basegfx::B2DPolyPolygon;
+
+ OverlayManager* pMgr = getOverlayManager();
+ if (!pMgr)
+ return Primitive2DSequence();
+
+ basegfx::BColor aColorA = pMgr->getStripeColorA().getBColor();
+ basegfx::BColor aColorB = pMgr->getStripeColorB().getBColor();
+ if (!mbToggle)
+ ::std::swap(aColorA, aColorB);
+
+ const basegfx::B2DPolygon aPoly = basegfx::tools::createPolygonFromRect(maRange);
+ B2DPolyPolygon aPolygon(aPoly);
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
+ aPolygon, aColorA, aColorB, pMgr->getStripeLengthPixel()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index 6bb14163b227..9359c5425cf9 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,7 +126,7 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
aPage.Select( aPageRange );
ScPreviewLocationData aLocData( pDoc, pDev );
- aFunc.DoPrint( aPage, nTabStart, nDisplayStart, sal_False, NULL, &aLocData );
+ aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, NULL, &aLocData );
ScRange aCellRange;
Rectangle aPixRect;
@@ -196,3 +197,4 @@ long ScPrintFuncCache::GetDisplayStart( SCTAB nTab ) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx
index d5e3450f3e5a..1422b8a34bda 100644
--- a/sc/source/ui/view/pgbrksh.cxx
+++ b/sc/source/ui/view/pgbrksh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,4 @@ ScPageBreakShell::~ScPageBreakShell()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index 028307400a2c..ac6aaeb53575 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,8 +52,7 @@
#include "dpshttab.hxx"
#include "dbdocfun.hxx"
#include "uiitems.hxx"
-//CHINA001 #include "pfiltdlg.hxx"
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
//------------------------------------------------------------------------
#define ScPivotShell
@@ -115,8 +115,8 @@ void ScPivotShell::Execute( SfxRequest& rReq )
DBG_ASSERT( pDesc, "no sheet source for DP filter dialog" );
if( pDesc )
{
- aQueryParam = pDesc->aQueryParam;
- nSrcTab = pDesc->aSourceRange.aStart.Tab();
+ aQueryParam = pDesc->GetQueryParam();
+ nSrcTab = pDesc->GetSourceRange().aStart.Tab();
}
ScViewData* pViewData = pViewShell->GetViewData();
@@ -124,30 +124,27 @@ void ScPivotShell::Execute( SfxRequest& rReq )
SCITEM_QUERYDATA, SCITEM_QUERYDATA );
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, pViewData, &aQueryParam ) );
- //CHINA001 ScPivotFilterDlg* pDlg = new ScPivotFilterDlg(
- //CHINA001 pViewShell->GetDialogParent(), aArgSet, nSrcTab );
-
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScPivotFilterDlg* pDlg = pFact->CreateScPivotFilterDlg( pViewShell->GetDialogParent(),
aArgSet, nSrcTab,
RID_SCDLG_PIVOTFILTER);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if( pDlg->Execute() == RET_OK )
{
- ScSheetSourceDesc aNewDesc;
+ ScSheetSourceDesc aNewDesc(pViewData->GetDocument());
if( pDesc )
aNewDesc = *pDesc;
const ScQueryItem& rQueryItem = pDlg->GetOutputItem();
- aNewDesc.aQueryParam = rQueryItem.GetQueryData();
+ aNewDesc.SetQueryParam(rQueryItem.GetQueryData());
ScDPObject aNewObj( *pDPObj );
aNewObj.SetSheetDesc( aNewDesc );
ScDBDocFunc aFunc( *pViewData->GetDocShell() );
- aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, sal_False );
+ aFunc.DataPilotUpdate( pDPObj, &aNewObj, sal_True, false );
pViewData->GetView()->CursorPosChanged(); // shells may be switched
}
delete pDlg;
@@ -158,7 +155,7 @@ void ScPivotShell::Execute( SfxRequest& rReq )
}
//------------------------------------------------------------------------
-void __EXPORT ScPivotShell::GetState( SfxItemSet& rSet )
+void ScPivotShell::GetState( SfxItemSet& rSet )
{
ScDocShell* pDocSh = pViewShell->GetViewData()->GetDocShell();
ScDocument* pDoc = pDocSh->GetDocument();
@@ -202,3 +199,4 @@ ScDPObject* ScPivotShell::GetCurrDPObject()
rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 4f3f1d753f32..a58eef8e2335 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,34 +100,35 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView
Window( pParent ),
nPageNo( 0 ),
nZoom( 100 ),
- bValid( sal_False ),
+ bValid( false ),
nTabsTested( 0 ),
nTab( 0 ),
nTabStart( 0 ),
nDisplayStart( 0 ),
nTotalPages( 0 ),
- bStateValid( sal_False ),
- bLocationValid( sal_False ),
+ bStateValid( false ),
+ bLocationValid( false ),
pLocationData( NULL ),
pDrawView( NULL ),
- bInPaint( sal_False ),
- bInGetState( sal_False ),
+ nCurTab ( ScDocShell::GetCurTab() ),
+ bInPaint( false ),
+ bInGetState( false ),
pDocShell( pDocSh ),
pViewShell( pViewSh ),
- bLeftRulerMove( sal_False ),
- bRightRulerMove( sal_False ),
- bTopRulerMove( sal_False ),
- bBottomRulerMove( sal_False ),
- bHeaderRulerMove( sal_False ),
- bFooterRulerMove( sal_False ),
- bLeftRulerChange( sal_False ),
- bRightRulerChange( sal_False ),
- bTopRulerChange( sal_False ),
- bBottomRulerChange( sal_False ),
- bHeaderRulerChange( sal_False ),
- bFooterRulerChange( sal_False ),
- bPageMargin ( sal_False ),
- bColRulerMove( sal_False ),
+ bLeftRulerMove( false ),
+ bRightRulerMove( false ),
+ bTopRulerMove( false ),
+ bBottomRulerMove( false ),
+ bHeaderRulerMove( false ),
+ bFooterRulerMove( false ),
+ bLeftRulerChange( false ),
+ bRightRulerChange( false ),
+ bTopRulerChange( false ),
+ bBottomRulerChange( false ),
+ bHeaderRulerChange( false ),
+ bFooterRulerChange( false ),
+ bPageMargin ( false ),
+ bColRulerMove( false ),
mnScale( 0 ),
nColNumberButttonDown( 0 ),
nHeaderHeight ( 0 ),
@@ -142,7 +144,7 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView
}
-__EXPORT ScPreview::~ScPreview()
+ScPreview::~ScPreview()
{
delete pDrawView;
delete pLocationData;
@@ -167,19 +169,12 @@ void ScPreview::UpdateDrawView() // nTab muss richtig sein
if ( !pDrawView ) // neu anlegen?
{
pDrawView = new FmFormView( pModel, this );
- // #55259# die DrawView uebernimmt den Design-Modus vom Model
+ // die DrawView uebernimmt den Design-Modus vom Model
// (Einstellung "Im Entwurfsmodus oeffnen"), darum hier zuruecksetzen
pDrawView->SetDesignMode( sal_True );
pDrawView->SetPrintPreview( sal_True );
pDrawView->ShowSdrPage(pPage);
}
-#if 0
- else if ( !pDrawView->GetSdrPageView()) // angezeigte Page umstellen
- {
- pDrawView->HideSdrPage();
- pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
- }
-#endif
}
else if ( pDrawView )
{
@@ -231,7 +226,6 @@ void ScPreview::CalcPages( SCTAB /*nToWhichTab*/ )
ScDocument* pDoc = pDocShell->GetDocument();
nTabCount = pDoc->GetTableCount();
- //SCTAB nAnz = Min( nTabCount, SCTAB(nToWhichTab+1) );
SCTAB nAnz = nTabCount;
SCTAB nStart = nTabsTested;
if (!bValid)
@@ -249,8 +243,17 @@ void ScPreview::CalcPages( SCTAB /*nToWhichTab*/ )
// but always all sheets are used (there is no selected sheet)
ScPrintOptions aOptions = SC_MOD()->GetPrintOptions();
+ ScMarkData aMarkData;
+ aMarkData.SelectTable( nCurTab, true );
+
for (SCTAB i=nStart; i<nAnz; i++)
{
+ if (!aOptions.GetAllSheets() && !aMarkData.GetTableSelect( i )) {
+ nPages[i] = 0;
+ nFirstAttr[i] = 0;
+ continue;
+ }
+
long nAttrPage = i > 0 ? nFirstAttr[i-1] : 1;
long nThisStart = nTotalPages;
@@ -296,7 +299,7 @@ void ScPreview::RecalcPages() // nur nPageNo geaendert
SCTAB nOldTab = nTab;
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
while (nPageNo >= nTotalPages && nTabsTested < nTabCount)
{
CalcPages( nTabsTested );
@@ -316,8 +319,6 @@ void ScPreview::RecalcPages() // nur nPageNo geaendert
nTab = i;
nTabPage = nPageNo - nThisStart;
nTabStart = nThisStart;
-
-// aPageSize = aPrintFunc.GetPageSize();
}
}
@@ -328,7 +329,7 @@ void ScPreview::RecalcPages() // nur nPageNo geaendert
TestLastPage(); // testen, ob hinter letzter Seite
if ( nTab != nOldTab )
- bStateValid = sal_False;
+ bStateValid = false;
DoInvalidate();
}
@@ -396,7 +397,6 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
DBG_ASSERT(nPrinted<=1, "was'n nu los?");
SetMapMode(aMMMode);
-// sal_uInt16 nPrintZoom = pPrintFunc->GetZoom();
if (nPrinted) // wenn nichts, alles grau zeichnen
{
@@ -480,7 +480,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
}
//Issue51656 Add resizeable margin on page preview from maoyg
-void __EXPORT ScPreview::Paint( const Rectangle& /* rRect */ )
+void ScPreview::Paint( const Rectangle& /* rRect */ )
{
if (!bValid)
{
@@ -514,8 +514,8 @@ void __EXPORT ScPreview::Paint( const Rectangle& /* rRect */ )
long nRightMargin = 0;
long nTopMargin = 0;
long nBottomMargin = 0;
- sal_Bool bHeaderOn = sal_False;
- sal_Bool bFooterOn = sal_False;
+ sal_Bool bHeaderOn = false;
+ sal_Bool bFooterOn = false;
ScDocument* pDoc = pDocShell->GetDocument();
sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
@@ -668,7 +668,7 @@ void __EXPORT ScPreview::Paint( const Rectangle& /* rRect */ )
}
//Issue51656 Add resizeable margin on page preview from maoyg
-void __EXPORT ScPreview::Command( const CommandEvent& rCEvt )
+void ScPreview::Command( const CommandEvent& rCEvt )
{
sal_uInt16 nCmd = rCEvt.GetCommand();
if ( nCmd == COMMAND_WHEEL || nCmd == COMMAND_STARTAUTOSCROLL || nCmd == COMMAND_AUTOSCROLL )
@@ -684,14 +684,14 @@ void __EXPORT ScPreview::Command( const CommandEvent& rCEvt )
}
-void __EXPORT ScPreview::KeyInput( const KeyEvent& rKEvt )
+void ScPreview::KeyInput( const KeyEvent& rKEvt )
{
// The + and - keys can't be configured as accelerator entries, so they must be handled directly
// (in ScPreview, not ScPreviewShell -> only if the preview window has the focus)
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
sal_uInt16 nKey = rKeyCode.GetCode();
- sal_Bool bHandled = sal_False;
+ sal_Bool bHandled = false;
if(!rKeyCode.GetModifier())
{
sal_uInt16 nSlot = 0;
@@ -718,7 +718,7 @@ const ScPreviewLocationData& ScPreview::GetLocationData()
if ( !pLocationData )
{
pLocationData = new ScPreviewLocationData( pDocShell->GetDocument(), this );
- bLocationValid = sal_False;
+ bLocationValid = false;
}
if ( !bLocationValid )
{
@@ -738,7 +738,7 @@ void ScPreview::DataChanged(sal_Bool bNewTime)
aTime = Time();
}
- bValid = sal_False;
+ bValid = false;
InvalidateLocationData( SC_HINT_DATACHANGED );
Invalidate();
}
@@ -785,9 +785,9 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom)
bInPaint = sal_True; // don't scroll during SetYOffset in UpdateScrollBars
pViewShell->UpdateScrollBars();
- bInPaint = sal_False;
+ bInPaint = false;
- bStateValid = sal_False;
+ bStateValid = false;
InvalidateLocationData( SC_HINT_ACC_VISAREACHANGED );
DoInvalidate();
Invalidate();
@@ -842,7 +842,7 @@ Size lcl_GetDocPageSize( ScDocument* pDoc, SCTAB nTab )
}
else
{
- DBG_ERROR( "PageStyle not found" );
+ OSL_FAIL( "PageStyle not found" );
return Size();
}
}
@@ -1006,7 +1006,7 @@ void ScPreview::DataChanged( const DataChangedEvent& rDCEvt )
}
//Issue51656 Add resizeable margin on page preview from maoyg
-void __EXPORT ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
+void ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
@@ -1024,12 +1024,12 @@ void __EXPORT ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
{
DrawInvert( aButtonDownChangePoint.X(), POINTER_HSIZEBAR );
bLeftRulerMove = sal_True;
- bRightRulerMove = sal_False;
+ bRightRulerMove = false;
}
else if( bRightRulerChange )
{
DrawInvert( aButtonDownChangePoint.X(), POINTER_HSIZEBAR );
- bLeftRulerMove = sal_False;
+ bLeftRulerMove = false;
bRightRulerMove = sal_True;
}
}
@@ -1041,24 +1041,24 @@ void __EXPORT ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
{
DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR );
bTopRulerMove = sal_True;
- bBottomRulerMove = sal_False;
+ bBottomRulerMove = false;
}
else if( bBottomRulerChange )
{
DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR );
- bTopRulerMove = sal_False;
+ bTopRulerMove = false;
bBottomRulerMove = sal_True;
}
else if( bHeaderRulerChange )
{
DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR );
bHeaderRulerMove = sal_True;
- bFooterRulerMove = sal_False;
+ bFooterRulerMove = false;
}
else if( bFooterRulerChange )
{
DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR );
- bHeaderRulerMove = sal_False;
+ bHeaderRulerMove = false;
bFooterRulerMove = sal_True;
}
}
@@ -1089,7 +1089,7 @@ void __EXPORT ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
}
}
-void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
+void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
@@ -1124,22 +1124,22 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
if(( bLeftRulerChange || bRightRulerChange ) && ( aButtonUpPt.X() <= ( 0 - aOffset.X() ) || aButtonUpPt.X() > nWidth * HMM_PER_TWIPS - aOffset.X() ) )
{
- bMoveRulerAction = sal_False;
+ bMoveRulerAction = false;
Paint(Rectangle(0,0,10000,10000));
}
else if( bLeftRulerChange && ( aButtonUpPt.X() / HMM_PER_TWIPS > nWidth - aLRItem.GetRight() - aOffset.X() / HMM_PER_TWIPS ) )
{
- bMoveRulerAction = sal_False;
+ bMoveRulerAction = false;
Paint(Rectangle(0,0,10000,10000));
}
else if( bRightRulerChange && ( aButtonUpPt.X() / HMM_PER_TWIPS < aLRItem.GetLeft() - aOffset.X() / HMM_PER_TWIPS ) )
{
- bMoveRulerAction = sal_False;
+ bMoveRulerAction = false;
Paint(Rectangle(0,0,10000,10000));
}
else if( aButtonDownPt.X() == aButtonUpPt.X() )
{
- bMoveRulerAction = sal_False;
+ bMoveRulerAction = false;
DrawInvert( aButtonUpPt.X(), POINTER_HSIZEBAR );
}
if( bMoveRulerAction )
@@ -1148,11 +1148,13 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
{
aLRItem.SetLeft( (long)( aButtonUpPt.X() / HMM_PER_TWIPS + aOffset.X() / HMM_PER_TWIPS ));
rStyleSet.Put( aLRItem );
+ pDocShell->SetModified(true);
}
else if( bRightRulerChange && bRightRulerMove )
{
aLRItem.SetRight( (long)( nWidth - aButtonUpPt.X() / HMM_PER_TWIPS - aOffset.X() / HMM_PER_TWIPS ));
rStyleSet.Put( aLRItem );
+ pDocShell->SetModified(true);
}
ScStyleSaveData aNewData;
@@ -1172,12 +1174,12 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
Rectangle aRect(0,0,10000,10000);
Paint( aRect );
- bLeftRulerChange = sal_False;
- bRightRulerChange = sal_False;
+ bLeftRulerChange = false;
+ bRightRulerChange = false;
}
}
- bLeftRulerMove = sal_False;
- bRightRulerMove = sal_False;
+ bLeftRulerMove = false;
+ bRightRulerMove = false;
}
if( rMEvt.IsLeft() && GetPointer() == POINTER_VSIZEBAR )
@@ -1187,12 +1189,12 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
sal_Bool bMoveRulerAction = sal_True;
if( ( bTopRulerChange || bBottomRulerChange || bHeaderRulerChange || bFooterRulerChange ) && ( aButtonUpPt.Y() <= ( 0 - aOffset.Y() ) || aButtonUpPt.Y() > nHeight * HMM_PER_TWIPS -aOffset.Y() ) )
{
- bMoveRulerAction = sal_False;
+ bMoveRulerAction = false;
Paint( Rectangle(0,0,10000,10000) );
}
else if( aButtonDownPt.Y() == aButtonUpPt.Y() )
{
- bMoveRulerAction = sal_False;
+ bMoveRulerAction = false;
DrawInvert( aButtonUpPt.Y(), POINTER_VSIZEBAR );
}
if( bMoveRulerAction )
@@ -1216,16 +1218,18 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
{
aULItem.SetUpperValue( (sal_uInt16)( aButtonUpPt.Y() / HMM_PER_TWIPS + aOffset.Y() / HMM_PER_TWIPS ) );
rStyleSet.Put( aULItem );
+ pDocShell->SetModified(true);
}
else if( bBottomRulerMove && bBottomRulerChange )
{
aULItem.SetLowerValue( (sal_uInt16)( nHeight - aButtonUpPt.Y() / HMM_PER_TWIPS - aOffset.Y() / HMM_PER_TWIPS ) );
rStyleSet.Put( aULItem );
+ pDocShell->SetModified(true);
}
else if( bHeaderRulerMove && bHeaderRulerChange )
{
const SfxPoolItem* pItem = NULL;
- if ( rStyleSet.GetItemState( ATTR_PAGE_HEADERSET, sal_False, &pItem ) == SFX_ITEM_SET )
+ if ( rStyleSet.GetItemState( ATTR_PAGE_HEADERSET, false, &pItem ) == SFX_ITEM_SET )
{
SfxItemSet& pHeaderSet = ((SvxSetItem*)pItem)->GetItemSet();
Size aHeaderSize = ((const SvxSizeItem&)pHeaderSet.Get(ATTR_PAGE_SIZE)).GetSize();
@@ -1234,12 +1238,13 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
SvxSetItem aNewHeader( (const SvxSetItem&)rStyleSet.Get(ATTR_PAGE_HEADERSET) );
aNewHeader.GetItemSet().Put( SvxSizeItem( ATTR_PAGE_SIZE, aHeaderSize ) );
rStyleSet.Put( aNewHeader );
+ pDocShell->SetModified(true);
}
}
else if( bFooterRulerMove && bFooterRulerChange )
{
const SfxPoolItem* pItem = NULL;
- if( rStyleSet.GetItemState( ATTR_PAGE_FOOTERSET, sal_False, &pItem ) == SFX_ITEM_SET )
+ if( rStyleSet.GetItemState( ATTR_PAGE_FOOTERSET, false, &pItem ) == SFX_ITEM_SET )
{
SfxItemSet& pFooterSet = ((SvxSetItem*)pItem)->GetItemSet();
Size aFooterSize = ((const SvxSizeItem&)pFooterSet.Get(ATTR_PAGE_SIZE)).GetSize();
@@ -1248,6 +1253,7 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
SvxSetItem aNewFooter( (const SvxSetItem&)rStyleSet.Get(ATTR_PAGE_FOOTERSET) );
aNewFooter.GetItemSet().Put( SvxSizeItem( ATTR_PAGE_SIZE, aFooterSize ) );
rStyleSet.Put( aNewFooter );
+ pDocShell->SetModified(true);
}
}
@@ -1268,16 +1274,16 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
Rectangle aRect(0,0,10000,10000);
Paint( aRect );
- bTopRulerChange = sal_False;
- bBottomRulerChange = sal_False;
- bHeaderRulerChange = sal_False;
- bFooterRulerChange = sal_False;
+ bTopRulerChange = false;
+ bBottomRulerChange = false;
+ bHeaderRulerChange = false;
+ bFooterRulerChange = false;
}
}
- bTopRulerMove = sal_False;
- bBottomRulerMove = sal_False;
- bHeaderRulerMove = sal_False;
- bFooterRulerMove = sal_False;
+ bTopRulerMove = false;
+ bBottomRulerMove = false;
+ bHeaderRulerMove = false;
+ bFooterRulerMove = false;
}
if( rMEvt.IsLeft() && GetPointer() == POINTER_HSPLIT )
{
@@ -1287,7 +1293,7 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
sal_Bool bMoveRulerAction = sal_True;
if( aButtonDownPt.X() == aButtonUpPt.X() )
{
- bMoveRulerAction = sal_False;
+ bMoveRulerAction = false;
if( nColNumberButttonDown == aPageArea.aStart.Col() )
DrawInvert( PixelToLogic( Point( nLeftPosition, 0 ),aMMMode ).X() ,POINTER_HSPLIT );
else
@@ -1314,7 +1320,8 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
if( nNewColWidth >= 0 )
{
- aFunc.SetWidthOrHeight( sal_True, 1,nCols, nTab, SC_SIZE_DIRECT, (sal_uInt16)nNewColWidth, sal_True, sal_True);
+ aFunc.SetWidthOrHeight( true, 1,nCols, nTab, SC_SIZE_DIRECT, (sal_uInt16)nNewColWidth, true, true);
+ pDocShell->SetModified(true);
}
if ( ValidTab( nTab ) )
{
@@ -1324,12 +1331,12 @@ void __EXPORT ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
Rectangle nRect(0,0,10000,10000);
Paint( nRect );
}
- bColRulerMove = sal_False;
+ bColRulerMove = false;
}
ReleaseMouse();
}
-void __EXPORT ScPreview::MouseMove( const MouseEvent& rMEvt )
+void ScPreview::MouseMove( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
@@ -1385,7 +1392,7 @@ void __EXPORT ScPreview::MouseMove( const MouseEvent& rMEvt )
Point aHeaderLeft = LogicToPixel( Point( -aOffset.X(), nHeaderHeight ), aMMMode );
Point aFooderLeft = LogicToPixel( Point( -aOffset.X(), nFooterHeight ), aMMMode );
- sal_Bool bOnColRulerChange = sal_False;
+ sal_Bool bOnColRulerChange = false;
for( SCCOL i=aPageArea.aStart.Col(); i<= aPageArea.aEnd.Col(); i++ )
{
@@ -1405,39 +1412,39 @@ void __EXPORT ScPreview::MouseMove( const MouseEvent& rMEvt )
if( aPixPt.X() < ( aLeftTop.X() + 2 ) && aPixPt.X() > ( aLeftTop.X() - 2 ) && !bRightRulerMove )
{
bLeftRulerChange = sal_True;
- bRightRulerChange = sal_False;
+ bRightRulerChange = false;
}
else if( aPixPt.X() < ( aRightTop.X() + 2 ) && aPixPt.X() > ( aRightTop.X() - 2 ) && !bLeftRulerMove )
{
- bLeftRulerChange = sal_False;
+ bLeftRulerChange = false;
bRightRulerChange = sal_True;
}
else if( aPixPt.Y() < ( aTopLeft.Y() + 2 ) && aPixPt.Y() > ( aTopLeft.Y() - 2 ) && !bBottomRulerMove && !bHeaderRulerMove && !bFooterRulerMove )
{
bTopRulerChange = sal_True;
- bBottomRulerChange = sal_False;
- bHeaderRulerChange = sal_False;
- bFooterRulerChange = sal_False;
+ bBottomRulerChange = false;
+ bHeaderRulerChange = false;
+ bFooterRulerChange = false;
}
else if( aPixPt.Y() < ( aBottomLeft.Y() + 2 ) && aPixPt.Y() > ( aBottomLeft.Y() - 2 ) && !bTopRulerMove && !bHeaderRulerMove && !bFooterRulerMove )
{
- bTopRulerChange = sal_False;
+ bTopRulerChange = false;
bBottomRulerChange = sal_True;
- bHeaderRulerChange = sal_False;
- bFooterRulerChange = sal_False;
+ bHeaderRulerChange = false;
+ bFooterRulerChange = false;
}
else if( aPixPt.Y() < ( aHeaderLeft.Y() + 2 ) && aPixPt.Y() > ( aHeaderLeft.Y() - 2 ) && !bTopRulerMove && !bBottomRulerMove && !bFooterRulerMove )
{
- bTopRulerChange = sal_False;
- bBottomRulerChange = sal_False;
+ bTopRulerChange = false;
+ bBottomRulerChange = false;
bHeaderRulerChange = sal_True;
- bFooterRulerChange = sal_False;
+ bFooterRulerChange = false;
}
else if( aPixPt.Y() < ( aFooderLeft.Y() + 2 ) && aPixPt.Y() > ( aFooderLeft.Y() - 2 ) && !bTopRulerMove && !bBottomRulerMove && !bHeaderRulerMove )
{
- bTopRulerChange = sal_False;
- bBottomRulerChange = sal_False;
- bHeaderRulerChange = sal_False;
+ bTopRulerChange = false;
+ bBottomRulerChange = false;
+ bHeaderRulerChange = false;
bFooterRulerChange = sal_True;
}
@@ -1531,7 +1538,7 @@ void __EXPORT ScPreview::MouseMove( const MouseEvent& rMEvt )
//Issue51656 Add resizeable margin on page preview from maoyg
void ScPreview::InvalidateLocationData(sal_uLong nId)
{
- bLocationValid = sal_False;
+ bLocationValid = false;
if (pViewShell->HasAccessibilityObjects())
pViewShell->BroadcastAccessibility( SfxSimpleHint( nId ) );
}
@@ -1601,3 +1608,5 @@ void ScPreview::DrawInvert( long nDragPos, sal_uInt16 nFlags )
}
}
//Issue51656 Add resizeable margin on page preview from maoyg
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx
index fb72bedd0999..39560477fe30 100644
--- a/sc/source/ui/view/prevloc.cxx
+++ b/sc/source/ui/view/prevloc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
-// INCLUDE ---------------------------------------------------------------
-
-#include <vcl/outdev.hxx>
#include <tools/debug.hxx>
+#include <vcl/outdev.hxx>
#include "prevloc.hxx"
#include "document.hxx"
-//==================================================================
-
enum ScPreviewLocationType
{
SC_PLOC_CELLRANGE,
@@ -72,8 +67,6 @@ struct ScPreviewLocationEntry
}
};
-//==================================================================
-
ScPreviewTableInfo::ScPreviewTableInfo() :
nTab(0),
nCols(0),
@@ -165,8 +158,6 @@ void ScPreviewTableInfo::LimitToArea( const Rectangle& rPixelArea )
}
}
-//------------------------------------------------------------------
-
ScPreviewLocationData::ScPreviewLocationData( ScDocument* pDocument, OutputDevice* pWin ) :
pWindow( pWin ),
pDoc( pDocument ),
@@ -192,13 +183,7 @@ void ScPreviewLocationData::SetPrintTab( SCTAB nNew )
void ScPreviewLocationData::Clear()
{
- void* pEntry = aEntries.First();
- while ( pEntry )
- {
- delete (ScPreviewLocationEntry*) pEntry;
- pEntry = aEntries.Next();
- }
- aEntries.Clear();
+ aEntries.clear();
nDrawRanges = 0;
}
@@ -207,23 +192,30 @@ void ScPreviewLocationData::AddCellRange( const Rectangle& rRect, const ScRange&
const MapMode& rDrawMap )
{
Rectangle aPixelRect( pWindow->LogicToPixel( rRect ) );
- aEntries.Insert( new ScPreviewLocationEntry( SC_PLOC_CELLRANGE, aPixelRect, rRange, bRepCol, bRepRow ) );
+ aEntries.push_front( new ScPreviewLocationEntry( SC_PLOC_CELLRANGE, aPixelRect, rRange, bRepCol, bRepRow ) );
DBG_ASSERT( nDrawRanges < SC_PREVIEW_MAXRANGES, "too many ranges" );
+
if ( nDrawRanges < SC_PREVIEW_MAXRANGES )
{
aDrawRectangle[nDrawRanges] = aPixelRect;
aDrawMapMode[nDrawRanges] = rDrawMap;
- if (bRepCol)
- if (bRepRow)
- aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_EDGE;
- else
- aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_REPCOL;
+
+ if (bRepCol)
+ {
+ if (bRepRow)
+ aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_EDGE;
else
- if (bRepRow)
- aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_REPROW;
- else
- aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_TAB;
+ aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_REPCOL;
+ }
+ else
+ {
+ if (bRepRow)
+ aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_REPROW;
+ else
+ aDrawRangeId[nDrawRanges] = SC_PREVIEW_RANGE_TAB;
+ }
+
++nDrawRanges;
}
}
@@ -233,7 +225,8 @@ void ScPreviewLocationData::AddColHeaders( const Rectangle& rRect, SCCOL nStartC
SCTAB nTab = 0; //! ?
ScRange aRange( nStartCol, 0, nTab, nEndCol, 0, nTab );
Rectangle aPixelRect( pWindow->LogicToPixel( rRect ) );
- aEntries.Insert( new ScPreviewLocationEntry( SC_PLOC_COLHEADER, aPixelRect, aRange, bRepCol, sal_False ) );
+
+ aEntries.push_front( new ScPreviewLocationEntry( SC_PLOC_COLHEADER, aPixelRect, aRange, bRepCol, false ) );
}
void ScPreviewLocationData::AddRowHeaders( const Rectangle& rRect, SCROW nStartRow, SCROW nEndRow, sal_Bool bRepRow )
@@ -241,7 +234,8 @@ void ScPreviewLocationData::AddRowHeaders( const Rectangle& rRect, SCROW nStartR
SCTAB nTab = 0; //! ?
ScRange aRange( 0, nStartRow, nTab, 0, nEndRow, nTab );
Rectangle aPixelRect( pWindow->LogicToPixel( rRect ) );
- aEntries.Insert( new ScPreviewLocationEntry( SC_PLOC_ROWHEADER, aPixelRect, aRange, sal_False, bRepRow ) );
+
+ aEntries.push_front( new ScPreviewLocationEntry( SC_PLOC_ROWHEADER, aPixelRect, aRange, false, bRepRow ) );
}
void ScPreviewLocationData::AddHeaderFooter( const Rectangle& rRect, sal_Bool bHeader, sal_Bool bLeft )
@@ -252,24 +246,25 @@ void ScPreviewLocationData::AddHeaderFooter( const Rectangle& rRect, sal_Bool bH
ScPreviewLocationType eType = bHeader ?
( bLeft ? SC_PLOC_LEFTHEADER : SC_PLOC_RIGHTHEADER ) :
( bLeft ? SC_PLOC_LEFTFOOTER : SC_PLOC_RIGHTFOOTER );
- aEntries.Insert( new ScPreviewLocationEntry( eType, aPixelRect, aRange, sal_False, sal_False ) );
+
+ aEntries.push_front( new ScPreviewLocationEntry( eType, aPixelRect, aRange, false, false ) );
}
void ScPreviewLocationData::AddNoteMark( const Rectangle& rRect, const ScAddress& rPos )
{
ScRange aRange( rPos );
Rectangle aPixelRect( pWindow->LogicToPixel( rRect ) );
- aEntries.Insert( new ScPreviewLocationEntry( SC_PLOC_NOTEMARK, aPixelRect, aRange, sal_False, sal_False ) );
+
+ aEntries.push_front( new ScPreviewLocationEntry( SC_PLOC_NOTEMARK, aPixelRect, aRange, false, false ) );
}
void ScPreviewLocationData::AddNoteText( const Rectangle& rRect, const ScAddress& rPos )
{
ScRange aRange( rPos );
Rectangle aPixelRect( pWindow->LogicToPixel( rRect ) );
- aEntries.Insert( new ScPreviewLocationEntry( SC_PLOC_NOTETEXT, aPixelRect, aRange, sal_False, sal_False ) );
-}
-//------------------------------------------------------------------
+ aEntries.push_front( new ScPreviewLocationEntry( SC_PLOC_NOTETEXT, aPixelRect, aRange, false, false ) );
+}
void ScPreviewLocationData::GetDrawRange( sal_uInt16 nPos, Rectangle& rPixelRect, MapMode& rMapMode, sal_uInt8& rRangeId ) const
{
@@ -282,56 +277,19 @@ void ScPreviewLocationData::GetDrawRange( sal_uInt16 nPos, Rectangle& rPixelRect
}
}
-ScPreviewLocationEntry* lcl_GetEntryByAddress( const List& rEntries, const ScAddress& rPos, ScPreviewLocationType eType )
+ScPreviewLocationEntry* lcl_GetEntryByAddress( const boost::ptr_list<ScPreviewLocationEntry> &rEntries,
+ const ScAddress& rPos, ScPreviewLocationType eType )
{
- sal_uLong nCount = rEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = rEntries.begin(); it != rEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)rEntries.GetObject(nListPos);
- if ( pEntry->eType == eType && pEntry->aCellRange.In( rPos ) )
- return pEntry;
+ if ( it->eType == eType && it->aCellRange.In( rPos ) )
+ return const_cast<ScPreviewLocationEntry*>(&(*it));
}
+
return NULL;
}
-//UNUSED2008-05 ScAddress ScPreviewLocationData::GetCellFromRange( const Size& rOffsetPixel, const ScRange& rRange ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 const double nScaleX = HMM_PER_TWIPS;
-//UNUSED2008-05 const double nScaleY = HMM_PER_TWIPS;
-//UNUSED2008-05
-//UNUSED2008-05 Size aOffsetLogic = pWindow->PixelToLogic( rOffsetPixel, aCellMapMode );
-//UNUSED2008-05 SCTAB nTab = rRange.aStart.Tab();
-//UNUSED2008-05
-//UNUSED2008-05 long nPosX = 0;
-//UNUSED2008-05 SCCOL nCol = rRange.aStart.Col();
-//UNUSED2008-05 SCCOL nEndCol = rRange.aEnd.Col();
-//UNUSED2008-05 while ( nCol <= nEndCol && nPosX < aOffsetLogic.Width() )
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_uInt16 nDocW = pDoc->GetColWidth( nCol, nTab );
-//UNUSED2008-05 if (nDocW)
-//UNUSED2008-05 nPosX += (long) (nDocW * nScaleX);
-//UNUSED2008-05 ++nCol;
-//UNUSED2008-05 }
-//UNUSED2008-05 if ( nCol > rRange.aStart.Col() )
-//UNUSED2008-05 --nCol;
-//UNUSED2008-05
-//UNUSED2008-05 long nPosY = 0;
-//UNUSED2008-05 ScCoupledCompressedArrayIterator< SCROW, sal_uInt8, sal_uInt16> aIter(
-//UNUSED2008-05 pDoc->GetRowFlagsArray( nTab), rRange.aStart.Row(),
-//UNUSED2008-05 rRange.aEnd.Row(), CR_HIDDEN, 0, pDoc->GetRowHeightArray( nTab));
-//UNUSED2008-05 while ( aIter && nPosY < aOffsetLogic.Height() )
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_uInt16 nDocH = *aIter;
-//UNUSED2008-05 if (nDocH)
-//UNUSED2008-05 nPosY += (long) (nDocH * nScaleY);
-//UNUSED2008-05 ++aIter;
-//UNUSED2008-05 }
-//UNUSED2008-05 SCROW nRow = aIter.GetPos();
-//UNUSED2008-05 if ( nRow > rRange.aStart.Row() )
-//UNUSED2008-05 --nRow;
-//UNUSED2008-05
-//UNUSED2008-05 return ScAddress( nCol, nRow, nTab );
-//UNUSED2008-05 }
Rectangle ScPreviewLocationData::GetOffsetPixel( const ScAddress& rCellPos, const ScRange& rRange ) const
{
@@ -374,79 +332,80 @@ sal_Bool ScPreviewLocationData::GetCellPosition( const ScAddress& rCellPos, Rect
aOffsetRect.Bottom() + pEntry->aPixelRect.Top() );
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScPreviewLocationData::HasCellsInRange( const Rectangle& rVisiblePixel ) const
{
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- ScPreviewLocationType eType = pEntry->eType;
- if ( eType == SC_PLOC_CELLRANGE || eType == SC_PLOC_COLHEADER || eType == SC_PLOC_ROWHEADER )
- if ( pEntry->aPixelRect.IsOver( rVisiblePixel ) )
- return sal_True;
+ if ( it->eType == SC_PLOC_CELLRANGE || it->eType == SC_PLOC_COLHEADER || it->eType == SC_PLOC_ROWHEADER )
+ if ( it->aPixelRect.IsOver( rVisiblePixel ) )
+ return true;
}
- return sal_False;
+
+ return false;
}
sal_Bool ScPreviewLocationData::GetHeaderPosition( Rectangle& rRect ) const
{
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == SC_PLOC_LEFTHEADER || pEntry->eType == SC_PLOC_RIGHTHEADER )
+ if ( it->eType == SC_PLOC_LEFTHEADER || it->eType == SC_PLOC_RIGHTHEADER )
{
- rRect = pEntry->aPixelRect;
- return sal_True;
+ rRect = it->aPixelRect;
+ return true;
}
}
- return sal_False;
+
+ return false;
}
sal_Bool ScPreviewLocationData::GetFooterPosition( Rectangle& rRect ) const
{
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == SC_PLOC_LEFTFOOTER || pEntry->eType == SC_PLOC_RIGHTFOOTER )
+ if ( it->eType == SC_PLOC_LEFTFOOTER || it->eType == SC_PLOC_RIGHTFOOTER )
{
- rRect = pEntry->aPixelRect;
- return sal_True;
+ rRect = it->aPixelRect;
+ return true;
}
}
- return sal_False;
+
+ return false;
}
sal_Bool ScPreviewLocationData::IsHeaderLeft() const
{
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == SC_PLOC_LEFTHEADER )
- return sal_True;
- if ( pEntry->eType == SC_PLOC_RIGHTHEADER )
- return sal_False;
+ if ( it->eType == SC_PLOC_LEFTHEADER )
+ return true;
+
+ if ( it->eType == SC_PLOC_RIGHTHEADER )
+ return false;
}
- return sal_False;
+
+ return false;
}
sal_Bool ScPreviewLocationData::IsFooterLeft() const
{
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == SC_PLOC_LEFTFOOTER )
- return sal_True;
- if ( pEntry->eType == SC_PLOC_RIGHTFOOTER )
- return sal_False;
+ if ( it->eType == SC_PLOC_LEFTFOOTER )
+ return true;
+
+ if ( it->eType == SC_PLOC_RIGHTFOOTER )
+ return false;
}
- return sal_False;
+
+ return false;
}
long ScPreviewLocationData::GetNoteCountInRange( const Rectangle& rVisiblePixel, sal_Bool bNoteMarks ) const
@@ -454,13 +413,13 @@ long ScPreviewLocationData::GetNoteCountInRange( const Rectangle& rVisiblePixel,
ScPreviewLocationType eType = bNoteMarks ? SC_PLOC_NOTEMARK : SC_PLOC_NOTETEXT;
sal_uLong nRet = 0;
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == eType && pEntry->aPixelRect.IsOver( rVisiblePixel ) )
+ if ( it->eType == eType && it->aPixelRect.IsOver( rVisiblePixel ) )
++nRet;
}
+
return nRet;
}
@@ -470,22 +429,22 @@ sal_Bool ScPreviewLocationData::GetNoteInRange( const Rectangle& rVisiblePixel,
ScPreviewLocationType eType = bNoteMarks ? SC_PLOC_NOTEMARK : SC_PLOC_NOTETEXT;
sal_uLong nPos = 0;
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == eType && pEntry->aPixelRect.IsOver( rVisiblePixel ) )
+ if ( it->eType == eType && it->aPixelRect.IsOver( rVisiblePixel ) )
{
if ( nPos == sal::static_int_cast<sal_uLong>(nIndex) )
{
- rCellPos = pEntry->aCellRange.aStart;
- rNoteRect = pEntry->aPixelRect;
- return sal_True;
+ rCellPos = it->aCellRange.aStart;
+ rNoteRect = it->aPixelRect;
+ return true;
}
++nPos;
}
}
- return sal_False;
+
+ return false;
}
Rectangle ScPreviewLocationData::GetNoteInRangeOutputRect(const Rectangle& rVisiblePixel, sal_Bool bNoteMarks, const ScAddress& aCellPos) const
@@ -493,17 +452,17 @@ Rectangle ScPreviewLocationData::GetNoteInRangeOutputRect(const Rectangle& rVisi
ScPreviewLocationType eType = bNoteMarks ? SC_PLOC_NOTEMARK : SC_PLOC_NOTETEXT;
sal_uLong nPos = 0;
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == eType && pEntry->aPixelRect.IsOver( rVisiblePixel ) )
+ if ( it->eType == eType && it->aPixelRect.IsOver( rVisiblePixel ) )
{
- if ( aCellPos == pEntry->aCellRange.aStart )
- return pEntry->aPixelRect;
+ if ( aCellPos == it->aCellRange.aStart )
+ return it->aPixelRect;
++nPos;
}
}
+
return Rectangle();
}
@@ -513,18 +472,18 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
const double nScaleY = HMM_PER_TWIPS;
// from left to right:
- sal_Bool bHasHeaderCol = sal_False;
- sal_Bool bHasRepCols = sal_False;
- sal_Bool bHasMainCols = sal_False;
+ sal_Bool bHasHeaderCol = false;
+ sal_Bool bHasRepCols = false;
+ sal_Bool bHasMainCols = false;
SCCOL nRepeatColStart = 0;
SCCOL nRepeatColEnd = 0;
SCCOL nMainColStart = 0;
SCCOL nMainColEnd = 0;
// from top to bottom:
- sal_Bool bHasHeaderRow = sal_False;
- sal_Bool bHasRepRows = sal_False;
- sal_Bool bHasMainRows = sal_False;
+ sal_Bool bHasHeaderRow = false;
+ sal_Bool bHasRepRows = false;
+ sal_Bool bHasMainRows = false;
SCROW nRepeatRowStart = 0;
SCROW nRepeatRowEnd = 0;
SCROW nMainRowStart = 0;
@@ -533,59 +492,58 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
Rectangle aHeaderRect, aRepeatRect, aMainRect;
SCTAB nTab = 0;
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == SC_PLOC_CELLRANGE )
+ if ( it->eType == SC_PLOC_CELLRANGE )
{
- if ( pEntry->bRepeatCol )
+ if ( it->bRepeatCol )
{
- bHasRepCols = sal_True;
- nRepeatColStart = pEntry->aCellRange.aStart.Col();
- nRepeatColEnd = pEntry->aCellRange.aEnd.Col();
- aRepeatRect.Left() = pEntry->aPixelRect.Left();
- aRepeatRect.Right() = pEntry->aPixelRect.Right();
+ bHasRepCols = true;
+ nRepeatColStart = it->aCellRange.aStart.Col();
+ nRepeatColEnd = it->aCellRange.aEnd.Col();
+ aRepeatRect.Left() = it->aPixelRect.Left();
+ aRepeatRect.Right() = it->aPixelRect.Right();
}
else
{
- bHasMainCols = sal_True;
- nMainColStart = pEntry->aCellRange.aStart.Col();
- nMainColEnd = pEntry->aCellRange.aEnd.Col();
- aMainRect.Left() = pEntry->aPixelRect.Left();
- aMainRect.Right() = pEntry->aPixelRect.Right();
+ bHasMainCols = true;
+ nMainColStart = it->aCellRange.aStart.Col();
+ nMainColEnd = it->aCellRange.aEnd.Col();
+ aMainRect.Left() = it->aPixelRect.Left();
+ aMainRect.Right() = it->aPixelRect.Right();
}
- if ( pEntry->bRepeatRow )
+ if ( it->bRepeatRow )
{
- bHasRepRows = sal_True;
- nRepeatRowStart = pEntry->aCellRange.aStart.Row();
- nRepeatRowEnd = pEntry->aCellRange.aEnd.Row();
- aRepeatRect.Top() = pEntry->aPixelRect.Top();
- aRepeatRect.Bottom() = pEntry->aPixelRect.Bottom();
+ bHasRepRows = true;
+ nRepeatRowStart = it->aCellRange.aStart.Row();
+ nRepeatRowEnd = it->aCellRange.aEnd.Row();
+ aRepeatRect.Top() = it->aPixelRect.Top();
+ aRepeatRect.Bottom() = it->aPixelRect.Bottom();
}
else
{
- bHasMainRows = sal_True;
- nMainRowStart = pEntry->aCellRange.aStart.Row();
- nMainRowEnd = pEntry->aCellRange.aEnd.Row();
- aMainRect.Top() = pEntry->aPixelRect.Top();
- aMainRect.Bottom() = pEntry->aPixelRect.Bottom();
+ bHasMainRows = true;
+ nMainRowStart = it->aCellRange.aStart.Row();
+ nMainRowEnd = it->aCellRange.aEnd.Row();
+ aMainRect.Top() = it->aPixelRect.Top();
+ aMainRect.Bottom() = it->aPixelRect.Bottom();
}
- nTab = pEntry->aCellRange.aStart.Tab(); //! store separately?
+ nTab = it->aCellRange.aStart.Tab(); //! store separately?
}
- else if ( pEntry->eType == SC_PLOC_ROWHEADER )
+ else if ( it->eType == SC_PLOC_ROWHEADER )
{
// row headers result in an additional column
- bHasHeaderCol = sal_True;
- aHeaderRect.Left() = pEntry->aPixelRect.Left();
- aHeaderRect.Right() = pEntry->aPixelRect.Right();
+ bHasHeaderCol = true;
+ aHeaderRect.Left() = it->aPixelRect.Left();
+ aHeaderRect.Right() = it->aPixelRect.Right();
}
- else if ( pEntry->eType == SC_PLOC_COLHEADER )
+ else if ( it->eType == SC_PLOC_COLHEADER )
{
// column headers result in an additional row
- bHasHeaderRow = sal_True;
- aHeaderRect.Top() = pEntry->aPixelRect.Top();
- aHeaderRect.Bottom() = pEntry->aPixelRect.Bottom();
+ bHasHeaderRow = true;
+ aHeaderRect.Top() = it->aPixelRect.Top();
+ aHeaderRect.Bottom() = it->aPixelRect.Bottom();
}
}
@@ -627,7 +585,7 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
long nPixelStart = pWindow->LogicToPixel( Size( nPosX, 0 ), aCellMapMode ).Width();
long nPixelEnd = pWindow->LogicToPixel( Size( nNextX, 0 ), aCellMapMode ).Width() - 1;
- pColInfo[nColPos].Set( sal_False, nCol,
+ pColInfo[nColPos].Set( false, nCol,
aRepeatRect.Left() + nPixelStart,
aRepeatRect.Left() + nPixelEnd );
@@ -646,7 +604,7 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
long nPixelStart = pWindow->LogicToPixel( Size( nPosX, 0 ), aCellMapMode ).Width();
long nPixelEnd = pWindow->LogicToPixel( Size( nNextX, 0 ), aCellMapMode ).Width() - 1;
- pColInfo[nColPos].Set( sal_False, nCol,
+ pColInfo[nColPos].Set( false, nCol,
aMainRect.Left() + nPixelStart,
aMainRect.Left() + nPixelEnd );
@@ -694,7 +652,7 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
- pRowInfo[nRowPos].Set( sal_False, nRow,
+ pRowInfo[nRowPos].Set( false, nRow,
aRepeatRect.Top() + nPixelStart,
aRepeatRect.Top() + nPixelEnd );
@@ -715,7 +673,7 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
- pRowInfo[nRowPos].Set( sal_False, nRow,
+ pRowInfo[nRowPos].Set( false, nRow,
aMainRect.Top() + nPixelStart,
aMainRect.Top() + nPixelEnd );
@@ -776,17 +734,18 @@ Rectangle ScPreviewLocationData::GetCellOutputRect(const ScAddress& rCellPos) co
sal_Bool ScPreviewLocationData::GetMainCellRange( ScRange& rRange, Rectangle& rPixRect ) const
{
- sal_uLong nCount = aEntries.Count();
- for (sal_uLong nListPos=0; nListPos<nCount; nListPos++)
+ boost::ptr_list<ScPreviewLocationEntry>::const_iterator it;
+ for (it = aEntries.begin(); it != aEntries.end(); ++it)
{
- ScPreviewLocationEntry* pEntry = (ScPreviewLocationEntry*)aEntries.GetObject(nListPos);
- if ( pEntry->eType == SC_PLOC_CELLRANGE && !pEntry->bRepeatCol && !pEntry->bRepeatRow )
+ if ( it->eType == SC_PLOC_CELLRANGE && !it->bRepeatCol && !it->bRepeatRow )
{
- rRange = pEntry->aCellRange;
- rPixRect = pEntry->aPixelRect;
- return sal_True;
+ rRange = it->aCellRange;
+ rPixRect = it->aPixelRect;
+ return true;
}
}
- return sal_False; // not found
+
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index da4d4dfa28d7..c6770ba27729 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,6 @@
#include <svl/srchitem.hxx>
#include <svx/zoomslideritem.hxx>
#include <svx/svdview.hxx>
-//CHINA001 #include <svx/zoom.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
@@ -52,9 +52,7 @@
#include <sfx2/docfile.hxx>
#include <sfx2/printer.hxx>
-#ifndef _SVX_ZOOMSLIDERITEM_HXX
#include <svx/zoomslideritem.hxx>
-#endif
#include "prevwsh.hxx"
#include "preview.hxx"
#include "printfun.hxx"
@@ -74,15 +72,13 @@
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
-#ifndef _SVX_ZOOM_HXX
#include <svx/zoom_def.hxx>
-#endif
-#include "sc.hrc" //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include "sc.hrc"
+#include "scabstdlg.hxx"
// fuer Rad-Maus
#define SC_DELTA_ZOOM 10
#define MINZOOM_SLIDER 10
@@ -124,7 +120,7 @@ void ScPreviewShell::Construct( Window* pParent )
pVerScroll = new ScrollBar(pParent, WB_VSCROLL);
// SSA: --- RTL --- no mirroring for horizontal scrollbars
- pHorScroll->EnableRTL( sal_False );
+ pHorScroll->EnableRTL( false );
pHorScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) );
pVerScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) );
@@ -166,7 +162,7 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
pData->WriteUserDataSequence( aSourceData );
InitStartTable( pData->GetTabNo() );
- // #106334# also have to store the TabView's DesignMode state
+ // also have to store the TabView's DesignMode state
// (only if draw view exists)
SdrView* pDrawView = pTabViewShell->GetSdrView();
if ( pDrawView )
@@ -174,7 +170,7 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
}
}
-__EXPORT ScPreviewShell::~ScPreviewShell()
+ScPreviewShell::~ScPreviewShell()
{
// #108333#; notify Accessibility that Shell is dying and before destroy all
BroadcastAccessibility( SfxSimpleHint( SFX_HINT_DYING ) );
@@ -192,7 +188,7 @@ __EXPORT ScPreviewShell::~ScPreviewShell()
delete pVerScroll;
delete pCorner;
- // #97612# normal mode of operation is switching back to default view in the same frame,
+ // normal mode of operation is switching back to default view in the same frame,
// so there's no need to activate any other window here anymore
}
@@ -203,12 +199,12 @@ void ScPreviewShell::InitStartTable(SCTAB nTab)
//------------------------------------------------------------------
-String __EXPORT ScPreviewShell::GetDescription() const
+String ScPreviewShell::GetDescription() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(" ** Test ** "));
}
-Size __EXPORT ScPreviewShell::GetOptimalSizePixel() const
+Size ScPreviewShell::GetOptimalSizePixel() const
{
Size aOptSize(100,100);
@@ -238,18 +234,16 @@ Size __EXPORT ScPreviewShell::GetOptimalSizePixel() const
}
else
{
- DBG_ERROR( "TabViewShell not found :-/" );
+ OSL_FAIL( "TabViewShell not found :-/" );
}
return aOptSize;
}
-void __EXPORT ScPreviewShell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
+void ScPreviewShell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
{
long nBarW = GetViewFrame()->GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize();
long nBarH = nBarW;
-// long nBarW = pVerScroll->GetSizePixel().Width();
-// long nBarH = pHorScroll->GetSizePixel().Height();
Size aOutSize( rSize.Width()-nBarW, rSize.Height()-nBarH );
pPreview->SetPosSizePixel( rPos, aOutSize );
@@ -261,19 +255,19 @@ void __EXPORT ScPreviewShell::AdjustPosSizePixel( const Point &rPos, const Size
Size( nBarW, nBarH ) );
if ( SVX_ZOOM_WHOLEPAGE == eZoom )
- pPreview->SetZoom( pPreview->GetOptimalZoom(sal_False) );
+ pPreview->SetZoom( pPreview->GetOptimalZoom(false) );
else if ( SVX_ZOOM_PAGEWIDTH == eZoom )
pPreview->SetZoom( pPreview->GetOptimalZoom(sal_True) );
UpdateScrollBars();
}
-void __EXPORT ScPreviewShell::InnerResizePixel( const Point &rOfs, const Size &rSize )
+void ScPreviewShell::InnerResizePixel( const Point &rOfs, const Size &rSize )
{
AdjustPosSizePixel( rOfs,rSize );
}
-void __EXPORT ScPreviewShell::OuterResizePixel( const Point &rOfs, const Size &rSize )
+void ScPreviewShell::OuterResizePixel( const Point &rOfs, const Size &rSize )
{
AdjustPosSizePixel( rOfs,rSize );
}
@@ -299,7 +293,6 @@ void ScPreviewShell::UpdateScrollBars()
Size aWindowSize = pPreview->GetOutputSize();
Point aOfs = pPreview->GetOffset();
- long nMaxPos;
if( pHorScroll )
{
@@ -307,7 +300,7 @@ void ScPreviewShell::UpdateScrollBars()
pHorScroll->SetLineSize( aWindowSize.Width() / 16 );
pHorScroll->SetPageSize( aWindowSize.Width() );
pHorScroll->SetVisibleSize( aWindowSize.Width() );
- nMaxPos = aPageSize.Width() - aWindowSize.Width();
+ long nMaxPos = aPageSize.Width() - aWindowSize.Width();
if ( nMaxPos<0 )
{
// page smaller than window -> center (but put scrollbar to 0)
@@ -383,7 +376,7 @@ IMPL_LINK (ScPreviewShell,ScrollHandler, ScrollBar* ,pScroll )
nPageNo = nPos / nPerPageLength;
if( nPos % nPerPageLength )
{
- bIsDivide = sal_False;
+ bIsDivide = false;
nPageNo ++;
}
}
@@ -446,7 +439,7 @@ IMPL_LINK (ScPreviewShell,ScrollHandler, ScrollBar* ,pScroll )
sal_Bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
const CommandWheelData* pData = rCEvt.GetWheelData();
if ( pData && pData->GetMode() == COMMAND_WHEEL_ZOOM )
{
@@ -473,30 +466,123 @@ sal_Bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt )
return bDone;
}
-SfxPrinter* __EXPORT ScPreviewShell::GetPrinter( sal_Bool bCreate )
+SfxPrinter* ScPreviewShell::GetPrinter( sal_Bool bCreate )
{
return pDocShell->GetPrinter(bCreate);
}
-sal_uInt16 __EXPORT ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
{
return pDocShell->SetPrinter( pNewPrinter, nDiffFlags );
}
+PrintDialog* ScPreviewShell::CreatePrintDialog( Window* pParent )
+{
+ pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen
+ (void)GetPrinter();
+
+ const long nCurPage = pPreview->GetPageNo()+1;
+ const long nDocPageMax = pPreview->GetTotalPages();
+ PrintDialog* pDlg = new PrintDialog( pParent, true );
+// wenn zu langsam wieder einbauen
+// if ( pPreview->AllTested() )
+// nPageMax = pPreview->GetTotalPages();
+
+ pDlg->EnableSheetRange( true, PRINTSHEETS_ALL );
+ pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS );
+ pDlg->EnableSheetRange( false, PRINTSHEETS_SELECTED_CELLS );
+ bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets();
+ pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS );
+
+ if ( nDocPageMax > 0 )
+ pDlg->SetRangeText( String::CreateFromInt32( nCurPage ) );
+
+ pDlg->EnableRange ( PRINTDIALOG_ALL );
+ pDlg->EnableRange ( PRINTDIALOG_RANGE );
+ pDlg->SetFirstPage ( 1 );
+ pDlg->SetMinPage ( 1 );
+ pDlg->SetLastPage ( (sal_uInt16)nDocPageMax );
+ pDlg->SetMaxPage ( (sal_uInt16)nDocPageMax );
+ pDlg->EnableCollate ();
+
+ // Selektion hier nicht
+
+ return pDlg;
+}
+
SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
- //CHINA001 return ScTpPrintOptions::Create( pParent, rOptions );
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT );
if ( ScTpPrintOptionsCreate )
return (*ScTpPrintOptionsCreate)( pParent, rOptions);
return 0;
}
+void ScPreviewShell::PreparePrint( PrintDialog* pPrintDialog )
+{
+ SfxViewShell::PreparePrint( pPrintDialog );
+
+ ScMarkData aMarkData;
+ aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), true );
+ pDocShell->PreparePrint( pPrintDialog, &aMarkData );
+}
+
+ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter,
+ PrintDialog *pPrintDialog, sal_Bool bSilent, sal_Bool bIsAPI )
+{
+ ErrCode nRet = ERRCODE_IO_ABORT;
+
+ ScMarkData aMarkData;
+ aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), true );
+
+ if ( pDocShell->CheckPrint( pPrintDialog, &aMarkData, false, bIsAPI ) )
+ {
+ // SfxViewShell::DoPrint calls Print (after StartJob etc.)
+ nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI );
+ }
+
+ return nRet;
+}
+
+sal_uInt16 ScPreviewShell::Print( SfxProgress& rProgress, sal_Bool bIsAPI, PrintDialog* pPrintDialog )
+{
+ pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen
+
+ // get the list of affected sheets before SfxViewShell::Print
+ bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
+
+ ScMarkData aMarkData;
+ aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), true );
+
+ uno::Sequence< sal_Int32 > aSheets;
+ SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
+ sal_Int32 nPrinted = 0;
+ for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab )
+ {
+ if ( bAllTabs || aMarkData.GetTableSelect( nTab ) )
+ {
+ aSheets.realloc( nPrinted + 1 );
+ aSheets[nPrinted] = nTab;
+ ++nPrinted;
+ }
+ }
+
+ uno::Sequence < beans::PropertyValue > aProps(1);
+ aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PrintSheets" ));
+ aProps[0].Value <<= aSheets;
+ SetAdditionalPrintOptions( aProps );
+
+ SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog );
+ pDocShell->Print( rProgress, pPrintDialog, &aMarkData, pPreview, false, bIsAPI );
+
+ return 0;
+}
+
//------------------------------------------------------------------------
-void __EXPORT ScPreviewShell::Activate(sal_Bool bMDI)
+void ScPreviewShell::Activate(sal_Bool bMDI)
{
SfxViewShell::Activate(bMDI);
@@ -511,7 +597,7 @@ void __EXPORT ScPreviewShell::Activate(sal_Bool bMDI)
}
}
-void __EXPORT ScPreviewShell::Deactivate(sal_Bool bMDI)
+void ScPreviewShell::Deactivate(sal_Bool bMDI)
{
SfxViewShell::Deactivate(bMDI);
@@ -522,7 +608,7 @@ void __EXPORT ScPreviewShell::Deactivate(sal_Bool bMDI)
//------------------------------------------------------------------------
-void __EXPORT ScPreviewShell::Execute( SfxRequest& rReq )
+void ScPreviewShell::Execute( SfxRequest& rReq )
{
sal_uInt16 nSlot = rReq.GetSlot();
const SfxItemSet* pReqArgs = rReq.GetArgs();
@@ -582,7 +668,7 @@ void __EXPORT ScPreviewShell::Execute( SfxRequest& rReq )
case FID_SCALE:
{
sal_uInt16 nZoom = 100;
- sal_Bool bCancel = sal_False;
+ sal_Bool bCancel = false;
eZoom = SVX_ZOOM_PERCENT;
@@ -601,12 +687,11 @@ void __EXPORT ScPreviewShell::Execute( SfxRequest& rReq )
SvxZoomItem aZoomItem( SVX_ZOOM_PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM );
aSet.Put( aZoomItem );
- //CHINA001 SvxZoomDialog* pDlg = pDlg = new SvxZoomDialog( NULL, aSet );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
AbstractSvxZoomDialog* pDlg = pFact->CreateSvxZoomDialog(NULL, aSet);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialogdiet fail!");
pDlg->SetLimits( 20, 400 );
pDlg->HideButton( ZOOMBTN_OPTIMAL );
bCancel = ( RET_CANCEL == pDlg->Execute() );
@@ -631,7 +716,7 @@ void __EXPORT ScPreviewShell::Execute( SfxRequest& rReq )
{
case SVX_ZOOM_OPTIMAL:
case SVX_ZOOM_WHOLEPAGE:
- nZoom = pPreview->GetOptimalZoom(sal_False);
+ nZoom = pPreview->GetOptimalZoom(false);
break;
case SVX_ZOOM_PAGEWIDTH:
nZoom = pPreview->GetOptimalZoom(sal_True);
@@ -737,7 +822,7 @@ void __EXPORT ScPreviewShell::Execute( SfxRequest& rReq )
}
}
-void __EXPORT ScPreviewShell::GetState( SfxItemSet& rSet )
+void ScPreviewShell::GetState( SfxItemSet& rSet )
{
pPreview->SetInGetState(sal_True);
@@ -838,7 +923,7 @@ void __EXPORT ScPreviewShell::GetState( SfxItemSet& rSet )
nWhich = aIter.NextWhich();
}
- pPreview->SetInGetState(sal_False);
+ pPreview->SetInGetState(false);
}
void ScPreviewShell::FillFieldData( ScHeaderFieldData& rData )
@@ -865,7 +950,7 @@ void ScPreviewShell::FillFieldData( ScHeaderFieldData& rData )
// eNumType kennt der Dialog selber
}
-void __EXPORT ScPreviewShell::WriteUserData(String& rData, sal_Bool /* bBrowse */)
+void ScPreviewShell::WriteUserData(String& rData, sal_Bool /* bBrowse */)
{
// nZoom
// nPageNo
@@ -875,7 +960,7 @@ void __EXPORT ScPreviewShell::WriteUserData(String& rData, sal_Bool /* bBrowse *
rData += String::CreateFromInt32(pPreview->GetPageNo());
}
-void __EXPORT ScPreviewShell::ReadUserData(const String& rData, sal_Bool /* bBrowse */)
+void ScPreviewShell::ReadUserData(const String& rData, sal_Bool /* bBrowse */)
{
xub_StrLen nCount = rData.GetTokenCount();
if (nCount)
@@ -887,7 +972,7 @@ void __EXPORT ScPreviewShell::ReadUserData(const String& rData, sal_Bool /* bBro
}
}
-void __EXPORT ScPreviewShell::WriteUserDataSequence(uno::Sequence < beans::PropertyValue >& rSeq, sal_Bool /* bBrowse */)
+void ScPreviewShell::WriteUserDataSequence(uno::Sequence < beans::PropertyValue >& rSeq, sal_Bool /* bBrowse */)
{
rSeq.realloc(3);
beans::PropertyValue* pSeq = rSeq.getArray();
@@ -905,12 +990,11 @@ void __EXPORT ScPreviewShell::WriteUserDataSequence(uno::Sequence < beans::Prope
}
}
-void __EXPORT ScPreviewShell::ReadUserDataSequence(const uno::Sequence < beans::PropertyValue >& rSeq, sal_Bool /* bBrowse */)
+void ScPreviewShell::ReadUserDataSequence(const uno::Sequence < beans::PropertyValue >& rSeq, sal_Bool /* bBrowse */)
{
sal_Int32 nCount(rSeq.getLength());
if (nCount)
{
- sal_Int32 nTemp = 0;
const beans::PropertyValue* pSeq = rSeq.getConstArray();
if(pSeq)
{
@@ -919,11 +1003,13 @@ void __EXPORT ScPreviewShell::ReadUserDataSequence(const uno::Sequence < beans::
rtl::OUString sName(pSeq->Name);
if(sName.compareToAscii(SC_ZOOMVALUE) == 0)
{
+ sal_Int32 nTemp = 0;
if (pSeq->Value >>= nTemp)
pPreview->SetZoom(sal_uInt16(nTemp));
}
else if (sName.compareToAscii("PageNumber") == 0)
{
+ sal_Int32 nTemp = 0;
if (pSeq->Value >>= nTemp)
pPreview->SetPageNo(nTemp);
}
@@ -1117,7 +1203,7 @@ void ScPreviewShell::RemoveAccessibilityObject( SfxListener& rObject )
rObject.EndListening( *pAccessibilityBroadcaster );
else
{
- DBG_ERROR("kein Accessibility-Broadcaster?");
+ OSL_FAIL("kein Accessibility-Broadcaster?");
}
}
@@ -1143,3 +1229,4 @@ ScDocument* ScPreviewShell::GetDocument()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/prevwsh2.cxx b/sc/source/ui/view/prevwsh2.cxx
index 22d511e762f9..65d923481064 100644
--- a/sc/source/ui/view/prevwsh2.cxx
+++ b/sc/source/ui/view/prevwsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,136 +42,46 @@
#define _TREELIST_HXX
#define _CACHESTR_HXX
#define _NEW_HXX
-//#define _SHL_HXX
-//#define _LINK_HXX
-//#define _ERRCODE_HXX
-//#define _GEN_HXX
-//#define _FRACT_HXX
-//#define _STRING_HXX
-//#define _MTF_HXX
-//#define _CONTNR_HXX
-//#define _LIST_HXX
-//#define _TABLE_HXX
#define _DYNARY_HXX
-//#define _UNQIDX_HXX
#define _SVMEMPOOL_HXX
-//#define _UNQID_HXX
-//#define _DEBUG_HXX
-//#define _DATE_HXX
-//#define _TIME_HXX
-//#define _DATETIME_HXX
-//#define _INTN_HXX
-//#define _WLDCRD_HXX
-//#define _FSYS_HXX
-//#define _STREAM_HXX
#define _CACHESTR_HXX
-//#define _SV_MULTISEL_HXX
//SV
-//#define _CLIP_HXX ***
#define _CONFIG_HXX
#define _CURSOR_HXX
#define _FONTDLG_HXX
#define _PRVWIN_HXX
-//#define _COLOR_HXX
-//#define _PAL_HXX
-//#define _BITMAP_HXX
-//#define _GDIOBJ_HXX
-//#define _POINTR_HXX
-//#define _ICON_HXX
-//#define _IMAGE_HXX
-//#define _KEYCOD_HXX
-//#define _EVENT_HXX
#define _HELP_HXX
-//#define _APP_HXX
-//#define _MDIAPP_HXX
-//#define _TIMER_HXX
-//#define _METRIC_HXX
-//#define _REGION_HXX
-//#define _OUTDEV_HXX
-//#define _SYSTEM_HXX
-//#define _VIRDEV_HXX
-//#define _JOBSET_HXX
-//#define _PRINT_HXX
-//#define _WINDOW_HXX
-//#define _SYSWIN_HXX
-//#define _WRKWIN_HXX
#define _MDIWIN_HXX
-//#define _FLOATWIN_HXX
-//#define _DOCKWIN_HXX
-//#define _CTRL_HXX
-//#define _SCRBAR_HXX
-//#define _BUTTON_HXX
-//#define _IMAGEBTN_HXX
-//#define _FIXED_HXX
-//#define _GROUP_HXX
-//#define _EDIT_HXX
-//#define _COMBOBOX_HXX
-//#define _LSTBOX_HXX
-//#define _SELENG_HXX ***
-//#define _SPLIT_HXX
#define _SPIN_HXX
-//#define _FIELD_HXX
-//#define _MOREBTN_HXX ***
-//#define _TOOLBOX_HXX
-//#define _STATUS_HXX ***
-//#define _DIALOG_HXX
-//#define _MSGBOX_HXX
-//#define _SYSDLG_HXX
-//#define _PRNDLG_HXX
#define _COLDLG_HXX
-//#define _TABDLG_HXX
-//#define _GDIMTF_HXX
-//#define _POLY_HXX
-//#define _ACCEL_HXX
-//#define _GRAPH_HXX
#define _SOUND_HXX
//svtools
#define _SCRWIN_HXX
#define _RULER_HXX
-//#define _TABBAR_HXX
-//#define _VALUESET_HXX
#define _STDMENU_HXX
-//#define _STDCTRL_HXX
-//#define _CTRLBOX_HXX
#define _CTRLTOOL_HXX
#define _EXTATTR_HXX
#define _FRM3D_HXX
#define _EXTATTR_HXX
//SVTOOLS
-//#define _SVTREELIST_HXX ***
#define _FILTER_HXX
-//#define _SVLBOXITM_HXX ***
-//#define _SVTREEBOX_HXX ***
#define _SVICNVW_HXX
#define _SVTABBX_HXX
//sfxcore.hxx
-//#define _SFXINIMGR_HXX ***
-//#define _SFXCFGITEM_HXX
-//#define _SFX_PRINTER_HXX
#define _SFXGENLINK_HXX
#define _SFXHINTPOST_HXX
#define _SFXDOCINF_HXX
#define _SFXLINKHDL_HXX
-//#define _SFX_PROGRESS_HXX
//sfxsh.hxx
-//#define _SFX_SHELL_HXX
-//#define _SFXAPP_HXX
-//#define _SFXDISPATCH_HXX
-//#define _SFXMSG_HXX ***
-//#define _SFXOBJFACE_HXX ***
-//#define _SFXREQUEST_HXX
#define _SFXMACRO_HXX
// SFX
-//#define _SFXAPPWIN_HXX ***
#define _SFX_SAVEOPT_HXX
-//#define _SFX_CHILDWIN_HXX
-//#define _SFXCTRLITEM_HXX
#define _SFXPRNMON_HXX
#define _INTRO_HXX
#define _SFXMSGDESCR_HXX
@@ -187,69 +98,32 @@
#define _SFXEVENT_HXX
//sfxdoc.hxx
-//#define _SFX_OBJSH_HXX
-//#define _SFX_CLIENTSH_HXX
-//#define _SFXDOCINF_HXX
-//#define _SFX_OBJFAC_HXX
#define _SFX_DOCFILT_HXX
-//#define _SFXDOCFILE_HXX ***
-//define _VIEWFAC_HXX
-//#define _SFXVIEWFRM_HXX
-//#define _SFXVIEWSH_HXX
-//#define _MDIFRM_HXX ***
#define _SFX_IPFRM_HXX
-//#define _SFX_INTERNO_HXX
//sfxdlg.hxx
-//#define _SFXTABDLG_HXX
-//#define _BASEDLGS_HXX ***
#define _SFX_DINFDLG_HXX
#define _SFXDINFEDT_HXX
#define _SFX_MGETEMPL_HXX
#define _SFX_TPLPITEM_HXX
-//#define _SFX_STYLEDLG_HXX
#define _NEWSTYLE_HXX
-//#define _SFXDOCTEMPL_HXX ***
-//#define _SFXDOCTDLG_HXX ***
-//#define _SFX_TEMPLDLG_HXX ***
-//#define _SFXNEW_HXX ***
#define _SFXDOCMAN_HXX
#define _SFXDOCKWIN_HXX
//sfxitems.hxx
#define _SFX_WHMAP_HXX
-//#define _ARGS_HXX ***
-//#define _SFXPOOLITEM_HXX
-//#define _SFXINTITEM_HXX
-//#define _SFXENUMITEM_HXX
#define _SFXFLAGITEM_HXX
-//#define _SFXSTRITEM_HXX
#define _SFXPTITEM_HXX
#define _SFXRECTITEM_HXX
-//#define _SFXITEMPOOL_HXX
-//#define _SFXITEMSET_HXX
#define _SFXITEMITER_HXX
#define _SFX_WHITER_HXX
#define _SFXPOOLCACH_HXX
-//#define _AEITEM_HXX
#define _SFXRNGITEM_HXX
-//#define _SFXSLSTITM_HXX
-//#define _SFXSTYLE_HXX
-
-//xout.hxx
-//#define _XENUM_HXX
-//#define _XPOLY_HXX
-//#define _XATTR_HXX
-//#define _XOUTX_HXX
-//#define _XPOOL_HXX
-//#define _XTABLE_HXX
//svdraw.hxx
#define _SDR_NOITEMS
#define _SDR_NOTOUCH
#define _SDR_NOTRANSFORM
-//#define _SDR_NOOBJECTS
-//#define _SDR_NOVIEWS
#define _SDR_NOTRANSFORM
#define _SDR_NOVIEWMARKER
#define _SDR_NODRAGMETHODS
@@ -257,20 +131,14 @@
#define _SDR_NOXOUTDEV
-//#define SI_NOITEMS
-//#define SI_NODRW
#define _SI_NOSBXCONTROLS
-//#define _VCATTR_HXX
#define _VCONT_HXX
-//#define _VCSBX_HXX
#define _SI_NOOTHERFORMS
#define _VCTRLS_HXX
-//#define _VCDRWOBJ_HXX
#define _SI_NOCONTROL
#define _SETBRW_HXX
#define _VCBRW_HXX
#define _SI_NOSBXCONTROLS
-//#define _SIDLL_HXX ***
#define _SVX_DAILDLL_HXX
#define _SVX_HYPHEN_HXX
@@ -305,9 +173,9 @@
// -----------------------------------------------------------------------
-void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
+void ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- sal_Bool bDataChanged = sal_False;
+ sal_Bool bDataChanged = false;
if (rHint.ISA(SfxSimpleHint))
{
@@ -351,3 +219,4 @@ void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index c7cc92246536..0e07dc573772 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,7 +132,7 @@ void ScPageRowEntry::SetPagesX(size_t nNew)
{
if (pHidden)
{
- DBG_ERROR("SetPagesX nicht nach SetHidden");
+ OSL_FAIL("SetPagesX nicht nach SetHidden");
delete[] pHidden;
pHidden = NULL;
}
@@ -149,7 +150,7 @@ void ScPageRowEntry::SetHidden(size_t nX)
if (!pHidden)
{
pHidden = new sal_Bool[nPagesX];
- memset( pHidden, sal_False, nPagesX * sizeof(sal_Bool) );
+ memset( pHidden, false, nPagesX * sizeof(sal_Bool) );
}
pHidden[nX] = sal_True;
}
@@ -213,16 +214,16 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions )
pParamSet = &pStyleSheet->GetItemSet();
else
{
- DBG_ERROR("Seitenvorlage nicht gefunden" );
+ OSL_FAIL("Seitenvorlage nicht gefunden" );
pParamSet = NULL;
}
if (!bState)
nZoom = 100;
nManualZoom = 100;
- bClearWin = sal_False;
- bUseStyleColor = sal_False;
- bIsRender = sal_False;
+ bClearWin = false;
+ bUseStyleColor = false;
+ bIsRender = false;
InitParam(pOptions);
@@ -240,10 +241,10 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTa
nPageStart ( nPage ),
nDocPages ( nDocP ),
pUserArea ( pArea ),
- bState ( sal_False ),
- bSourceRangeValid ( sal_False ),
- bPrintCurrentTable ( sal_False ),
- bMultiArea ( sal_False ),
+ bState ( false ),
+ bSourceRangeValid ( false ),
+ bPrintCurrentTable ( false ),
+ bMultiArea ( false ),
nTabPages ( 0 ),
nTotalPages ( 0 ),
pPageData ( pData )
@@ -263,10 +264,10 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab,
nPageStart ( nPage ),
nDocPages ( nDocP ),
pUserArea ( pArea ),
- bState ( sal_False ),
- bSourceRangeValid ( sal_False ),
- bPrintCurrentTable ( sal_False ),
- bMultiArea ( sal_False ),
+ bState ( false ),
+ bSourceRangeValid ( false ),
+ bPrintCurrentTable ( false ),
+ bMultiArea ( false ),
nTabPages ( 0 ),
nTotalPages ( 0 ),
pPageData ( NULL )
@@ -281,9 +282,9 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell,
pPrinter ( NULL ),
pDrawView ( NULL ),
pUserArea ( NULL ),
- bSourceRangeValid ( sal_False ),
- bPrintCurrentTable ( sal_False ),
- bMultiArea ( sal_False ),
+ bSourceRangeValid ( false ),
+ bPrintCurrentTable ( false ),
+ bMultiArea ( false ),
pPageData ( NULL )
{
pDev = pOutDev;
@@ -314,9 +315,9 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, Window* pWindow, SCTAB nTab,
nPageStart ( nPage ),
nDocPages ( nDocP ),
pUserArea ( pArea ),
- bState ( sal_False ),
- bPrintCurrentTable ( sal_False ),
- bMultiArea ( sal_False ),
+ bState ( false ),
+ bPrintCurrentTable ( false ),
+ bMultiArea ( false ),
nTabPages ( 0 ),
nTotalPages ( 0 ),
pPageData ( NULL )
@@ -330,8 +331,8 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, Window* pWindow,
pPrinter ( NULL ),
pDrawView ( NULL ),
pUserArea ( NULL ),
- bPrintCurrentTable ( sal_False ),
- bMultiArea ( sal_False ),
+ bPrintCurrentTable ( false ),
+ bMultiArea ( false ),
pPageData ( NULL )
{
pDev = pWindow;
@@ -411,7 +412,7 @@ ScPrintFunc::~ScPrintFunc()
// Druckereinstellungen werden jetzt von aussen wiederhergestellt
- // #64294# Fuer DrawingLayer/Charts muss der MapMode am Drucker (RefDevice) immer stimmen
+ // Fuer DrawingLayer/Charts muss der MapMode am Drucker (RefDevice) immer stimmen
SfxPrinter* pDocPrinter = pDoc->GetPrinter(); // auch fuer Preview den Drucker nehmen
if (pDocPrinter)
pDocPrinter->SetMapMode(aOldPrinterMode);
@@ -518,7 +519,6 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
Rectangle aLines;
ScRange aRange( nX1,nY1,nTab, nX2,nY2,nTab );
-// sal_Bool bAddLines = pDoc->HasLines( aRange, aLines );
long nTwipsSizeX = 0;
for (SCCOL i=nX1; i<=nX2; i++)
@@ -546,15 +546,12 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
ScTableInfo aTabInfo;
pDoc->FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab,
- nScaleX, nScaleY, sal_False, bFormula );
+ nScaleX, nScaleY, false, bFormula );
lcl_HidePrint( aTabInfo, nX1, nX2 );
if (bEmbed)
pDoc->SetEmbedded(aERange);
-/* if (!bMetaFile)
- pDev->SetMapMode(MAP_PIXEL);
-*/
long nScrX = aRect.Left();
long nScrY = aRect.Top();
@@ -632,7 +629,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
if (!bMetaFile && pViewData)
pDev->SetMapMode(aMode);
- aOutputData.DrawGrid( sal_True, sal_False ); // keine Seitenumbrueche
+ aOutputData.DrawGrid( sal_True, false ); // keine Seitenumbrueche
pDev->SetLineColor( COL_BLACK );
@@ -672,7 +669,7 @@ void lcl_FillHFParam( ScPrintHFParam& rParam, const SfxItemSet* pHFSet )
if ( pHFSet == NULL )
{
- rParam.bEnable = sal_False;
+ rParam.bEnable = false;
rParam.pBorder = NULL;
rParam.pBack = NULL;
rParam.pShadow = NULL;
@@ -723,14 +720,14 @@ sal_Bool ScPrintFunc::AdjustPrintArea( sal_Bool bNew )
nStartCol = 0;
nStartRow = 0;
if (!pDoc->GetPrintArea( nPrintTab, nEndCol, nEndRow, bNotes ))
- return sal_False; // nix
+ return false; // nix
}
else
{
sal_Bool bFound = sal_True;
bChangeCol = ( nStartCol == 0 && nEndCol == MAXCOL );
bChangeRow = ( nStartRow == 0 && nEndRow == MAXROW );
- sal_Bool bForcedChangeRow = sal_False;
+ sal_Bool bForcedChangeRow = false;
// #i53558# Crop entire column of old row limit to real print area with
// some fuzzyness.
@@ -760,14 +757,14 @@ sal_Bool ScPrintFunc::AdjustPrintArea( sal_Bool bNew )
bFound = pDoc->GetPrintAreaVer( nPrintTab, nStartCol, nEndCol, nEndRow, bNotes );
if (!bFound)
- return sal_False; // leer
+ return false; // leer
if (bForcedChangeRow)
bChangeRow = sal_True;
}
pDoc->ExtendMerge( nStartCol,nStartRow, nEndCol,nEndRow, nPrintTab,
- sal_False, sal_True ); // kein Refresh, incl. Attrs
+ false, sal_True ); // kein Refresh, incl. Attrs
if ( bChangeCol )
{
@@ -797,8 +794,7 @@ long ScPrintFunc::TextHeight( const EditTextObject* pObject )
if (!pObject)
return 0;
-// pEditEngine->SetPageNo( nTotalPages );
- pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, sal_False );
+ pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
return (long) pEditEngine->GetTextHeight();
}
@@ -885,7 +881,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
aPageSize = ((const SvxSizeItem&) pParamSet->Get(ATTR_PAGE_SIZE)).GetSize();
if ( !aPageSize.Width() || !aPageSize.Height() )
{
- DBG_ERROR("PageSize Null ?!?!?");
+ OSL_FAIL("PageSize Null ?!?!?");
aPageSize = SvxPaperInfo::GetPaperSize( PAPER_A4 );
}
@@ -900,7 +896,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
const SvxSetItem* pHeaderSetItem;
const SfxItemSet* pHeaderSet = NULL;
- if ( pParamSet->GetItemState( ATTR_PAGE_HEADERSET, sal_False,
+ if ( pParamSet->GetItemState( ATTR_PAGE_HEADERSET, false,
(const SfxPoolItem**)&pHeaderSetItem ) == SFX_ITEM_SET )
{
pHeaderSet = &pHeaderSetItem->GetItemSet();
@@ -916,7 +912,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
const SvxSetItem* pFooterSetItem;
const SfxItemSet* pFooterSet = NULL;
- if ( pParamSet->GetItemState( ATTR_PAGE_FOOTERSET, sal_False,
+ if ( pParamSet->GetItemState( ATTR_PAGE_FOOTERSET, false,
(const SfxPoolItem**)&pFooterSetItem ) == SFX_ITEM_SET )
{
pFooterSet = &pFooterSetItem->GetItemSet();
@@ -935,19 +931,19 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
const SfxUInt16Item* pScaleToPagesItem = NULL;
SfxItemState eState;
- eState = pParamSet->GetItemState( ATTR_PAGE_SCALE, sal_False,
+ eState = pParamSet->GetItemState( ATTR_PAGE_SCALE, false,
(const SfxPoolItem**)&pScaleItem );
if ( SFX_ITEM_DEFAULT == eState )
pScaleItem = (const SfxUInt16Item*)
&pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALE );
- eState = pParamSet->GetItemState( ATTR_PAGE_SCALETO, sal_False,
+ eState = pParamSet->GetItemState( ATTR_PAGE_SCALETO, false,
(const SfxPoolItem**)&pScaleToItem );
if ( SFX_ITEM_DEFAULT == eState )
pScaleToItem = (const ScPageScaleToItem*)
&pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALETO );
- eState = pParamSet->GetItemState( ATTR_PAGE_SCALETOPAGES, sal_False,
+ eState = pParamSet->GetItemState( ATTR_PAGE_SCALETOPAGES, false,
(const SfxPoolItem**)&pScaleToPagesItem );
if ( SFX_ITEM_DEFAULT == eState )
pScaleToPagesItem = (const SfxUInt16Item*)
@@ -987,9 +983,9 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
else
{
aTableParam.bScaleNone = sal_True;
- aTableParam.bScaleAll = sal_False;
- aTableParam.bScaleTo = sal_False;
- aTableParam.bScalePageNum = sal_False;
+ aTableParam.bScaleAll = false;
+ aTableParam.bScaleTo = false;
+ aTableParam.bScalePageNum = false;
aTableParam.nScaleAll = 0;
aTableParam.nScaleWidth = 0;
aTableParam.nScaleHeight = 0;
@@ -999,7 +995,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
// skip empty pages only if options with that flag are passed
aTableParam.bSkipEmpty = pOptions && pOptions->GetSkipEmpty();
if ( pPageData )
- aTableParam.bSkipEmpty = sal_False;
+ aTableParam.bSkipEmpty = false;
// Wenn pPageData gesetzt ist, interessieren fuer die Umbruch-Vorschau
// nur die Umbrueche, leere Seiten werden nicht speziell behandelt
@@ -1023,8 +1019,6 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
// Die Tabellen-Abfrage ist schon in DocShell::Print, hier immer
aAreaParam.aPrintArea.aStart.SetTab(nPrintTab);
aAreaParam.aPrintArea.aEnd.SetTab(nPrintTab);
-
-// lcl_LimitRange( aAreaParam.aPrintArea, nPrintTab ); // ganze Zeilen/Spalten...
}
else if ( pDoc->HasPrintRange() )
{
@@ -1045,16 +1039,16 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
}
else
{
- // #74834# don't print hidden tables if there's no print range defined there
+ // don't print hidden tables if there's no print range defined there
if ( pDoc->IsVisible( nPrintTab ) )
{
- aAreaParam.bPrintArea = sal_False;
+ aAreaParam.bPrintArea = false;
bPrintCurrentTable = sal_True;
}
else
{
aAreaParam.bPrintArea = sal_True; // otherwise the table is always counted
- bPrintCurrentTable = sal_False;
+ bPrintCurrentTable = false;
}
}
@@ -1067,7 +1061,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
}
else
{
- aAreaParam.bRepeatCol = sal_False;
+ aAreaParam.bRepeatCol = false;
nRepeatStartCol = nRepeatEndCol = SCCOL_REPEAT_NONE;
}
@@ -1080,7 +1074,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
}
else
{
- aAreaParam.bRepeatRow = sal_False;
+ aAreaParam.bRepeatRow = false;
nRepeatStartRow = nRepeatEndRow = SCROW_REPEAT_NONE;
}
@@ -1146,7 +1140,7 @@ void ScPrintFunc::SetDateTime( const Date& rDate, const Time& rTime )
void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut,
const Rectangle &rGrf, const Rectangle &rOut )
{
- const FASTBOOL bNotInside = !rOut.IsInside( rGrf );
+ const bool bNotInside = !rOut.IsInside( rGrf );
if ( bNotInside )
{
pOut->Push();
@@ -1181,8 +1175,7 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
Point aPos;
Size aDrawSize = aGrfSize;
- FASTBOOL bDraw = sal_True;
-// FASTBOOL bRetouche = sal_True;
+ bool bDraw = true;
switch ( ePos )
{
case GPOS_LT: aPos = rOrg.TopLeft();
@@ -1217,11 +1210,10 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
case GPOS_AREA:
aPos = rOrg.TopLeft();
aDrawSize = rOrg.GetSize();
-// bRetouche = sal_False;
break;
case GPOS_TILED:
{
- // #104004# use GraphicObject::DrawTiled instead of an own loop
+ // use GraphicObject::DrawTiled instead of an own loop
// (pixel rounding is handled correctly, and a very small bitmap
// is duplicated into a bigger one for better performance)
@@ -1230,7 +1222,7 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
if( pOut->GetPDFWriter() &&
(aObject.GetType() == GRAPHIC_BITMAP || aObject.GetType() == GRAPHIC_DEFAULT) )
{
- // #104004# For PDF export, every draw
+ // For PDF export, every draw
// operation for bitmaps takes a noticeable
// amount of place (~50 characters). Thus,
// optimize between tile bitmap size and
@@ -1266,13 +1258,12 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0) );
}
- bDraw = sal_False;
-// bRetouche = sal_False;
+ bDraw = false;
}
break;
case GPOS_NONE:
- bDraw = sal_False;
+ bDraw = false;
break;
default: DBG_ASSERT( !pOut, "new Graphic position?" );
@@ -1329,13 +1320,11 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
if (nEffHeight<=0 || nEffWidth<=0)
return; // leer
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
- sal_Bool bCellContrast = bUseStyleColor &&
- Application::GetSettings().GetStyleSettings().GetHighContrastMode();
+ // SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
+ sal_Bool bCellContrast = bUseStyleColor;
if ( pBackground && !bCellContrast )
{
-// Rectangle aBackRect( Point(nScrX+nLeft, nScrY+nTop), Size(nEffWidth,nEffHeight) );
if (pBackground->GetGraphicPos() != GPOS_NONE)
{
OutputDevice* pRefDev;
@@ -1413,7 +1402,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
ScTableInfo aTabInfo;
pBorderDoc->FillInfo( aTabInfo, 0,0, 0,0, 0,
- nScaleX, nScaleY, sal_False, sal_False );
+ nScaleX, nScaleY, false, false );
DBG_ASSERT(aTabInfo.mnArrCount,"nArrCount == 0");
aTabInfo.mpRowInfo[1].nHeight = (sal_uInt16) nEffHeight;
@@ -1424,8 +1413,6 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
nScrX+nLeft, nScrY+nTop, 0,0, 0,0, nScaleX, nScaleY );
aOutputData.SetUseStyleColor( bUseStyleColor );
-// pDev->SetMapMode(aTwipMode);
-
if (pBorderData)
aOutputData.DrawFrame();
@@ -1683,42 +1670,25 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
aOutputData.SetRefDevice( pRefDev );
}
-// aOutputData.SetMetaFileMode(sal_True);
if( aTableParam.bCellContent )
aOutputData.DrawBackground();
pDev->SetClipRegion( Rectangle( aPos, Size( aOutputData.GetScrW(), aOutputData.GetScrH() ) ) );
pDev->SetClipRegion();
-// aOutputData.SetMetaFileMode(sal_False);
if( aTableParam.bCellContent )
{
aOutputData.DrawExtraShadow( bShLeft, bShTop, bShRight, bShBottom );
aOutputData.DrawFrame();
aOutputData.DrawStrings();
-
- // pDev->SetMapMode(aLogicMode);
- aOutputData.DrawEdit(sal_False);
+ aOutputData.DrawEdit(false);
}
-// pDev->SetMapMode(aOffsetMode);
if (aTableParam.bGrid)
- aOutputData.DrawGrid( sal_True, sal_False ); // keine Seitenumbrueche
-
-/*!!!!!!!!!!! Notizen in Tabelle markieren ??????????????????????????
-
- if (aTableParam.bNotes)
- {
- pDev->SetMapMode(aOffsetMode);
- aOutputData.PrintNoteMarks(aNotePosList);
- pDev->SetMapMode(aLogicMode);
- }
-*/
+ aOutputData.DrawGrid( sal_True, false ); // keine Seitenumbrueche
aOutputData.AddPDFNotes(); // has no effect if not rendering PDF with notes enabled
-// pDev->SetMapMode(aDrawMode);
-
// test if all paint parts are hidden, then a paint is not necessary at all
if(!bHideAllDrawingLayer)
{
@@ -1744,7 +1714,7 @@ sal_Bool ScPrintFunc::IsLeft( long nPageNo ) // linke Fussnoten ?
if (eUsage == SVX_PAGE_LEFT)
bLeft = sal_True;
else if (eUsage == SVX_PAGE_RIGHT)
- bLeft = sal_False;
+ bLeft = false;
else
bLeft = (nPageNo & 1) != 0;
return bLeft;
@@ -1763,7 +1733,7 @@ void ScPrintFunc::MakeEditEngine()
// because pool must have twips as default metric
pEditEngine = new ScHeaderEditEngine( EditEngine::CreatePool(), sal_True );
- pEditEngine->EnableUndo(sal_False);
+ pEditEngine->EnableUndo(false);
pEditEngine->SetRefDevice( pDev );
pEditEngine->SetWordDelimiters(
ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
@@ -1780,7 +1750,7 @@ void ScPrintFunc::MakeEditEngine()
pEditDefaults->Put( rPattern.GetItem(ATTR_FONT_HEIGHT), EE_CHAR_FONTHEIGHT );
pEditDefaults->Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CJK );
pEditDefaults->Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CTL );
- // #69193# dont use font color, because background color is not used
+ // dont use font color, because background color is not used
//! there's no way to set the background for note pages
pEditDefaults->ClearItem( EE_CHAR_COLOR );
if (ScGlobal::IsSystemRTL())
@@ -1883,7 +1853,7 @@ void ScPrintFunc::PrintHF( long nPageNo, sal_Bool bHeader, long nStartY,
if (pObject)
{
pEditDefaults->Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
- pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, sal_False );
+ pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
Point aDraw = aStart;
long nDif = aPaperSize.Height() - (long) pEditEngine->GetTextHeight();
if (nDif > 0)
@@ -1897,7 +1867,7 @@ void ScPrintFunc::PrintHF( long nPageNo, sal_Bool bHeader, long nStartY,
if (pObject)
{
pEditDefaults->Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
- pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, sal_False );
+ pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
Point aDraw = aStart;
long nDif = aPaperSize.Height() - (long) pEditEngine->GetTextHeight();
if (nDif > 0)
@@ -1911,7 +1881,7 @@ void ScPrintFunc::PrintHF( long nPageNo, sal_Bool bHeader, long nStartY,
if (pObject)
{
pEditDefaults->Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
- pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, sal_False );
+ pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
Point aDraw = aStart;
long nDif = aPaperSize.Height() - (long) pEditEngine->GetTextHeight();
if (nDif > 0)
@@ -1941,7 +1911,6 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation
Font aMarkFont;
ScAutoFontColorMode eColorMode = bUseStyleColor ? SC_AUTOCOL_DISPLAY : SC_AUTOCOL_PRINT;
((const ScPatternAttr&)pDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)).GetFont( aMarkFont, eColorMode );
-//? aMarkFont.SetWeight( WEIGHT_BOLD );
pDev->SetFont( aMarkFont );
long nMarkLen = pDev->GetTextWidth(
String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("GW99999:")));
@@ -1960,7 +1929,7 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation
sal_Bool bOk;
do
{
- bOk = sal_False;
+ bOk = false;
ScAddress* pPos = (ScAddress*) aNotePosList.GetObject( nNoteStart+nCount );
if (pPos)
{
@@ -2044,8 +2013,7 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, sal_Bool bDoPrint,
if ( pPrinter && bDoPrint )
{
- DBG_ERROR( "StartPage does not exist anymore" );
- // pPrinter->StartPage();
+ OSL_FAIL( "StartPage does not exist anymore" );
}
if ( bDoPrint || pLocationData )
@@ -2060,7 +2028,7 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, sal_Bool bDoPrint,
if (aFtr.bEnable)
{
long nFooterY = aPageRect.Bottom()+aFtr.nDistance;
- PrintHF( nPageNo, sal_False, nFooterY, bDoPrint, pLocationData );
+ PrintHF( nPageNo, false, nFooterY, bDoPrint, pLocationData );
}
}
@@ -2068,8 +2036,7 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, sal_Bool bDoPrint,
if ( pPrinter && bDoPrint )
{
- DBG_ERROR( "EndPage does not exist anymore" );
- // pPrinter->EndPage();
+ OSL_FAIL( "EndPage does not exist anymore" );
}
return nCount;
@@ -2134,8 +2101,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( pPrinter && bDoPrint )
{
- DBG_ERROR( "StartPage does not exist anymore" );
- // pPrinter->StartPage();
+ OSL_FAIL( "StartPage does not exist anymore" );
}
// Kopf- und Fusszeilen (ohne Zentrierung)
@@ -2148,7 +2114,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if (aFtr.bEnable)
{
long nFooterY = aPageRect.Bottom()+aFtr.nDistance;
- PrintHF( nPageNo, sal_False, nFooterY, bDoPrint, pLocationData );
+ PrintHF( nPageNo, false, nFooterY, bDoPrint, pLocationData );
}
// Position ( Raender / zentrieren )
@@ -2229,9 +2195,6 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
long nStartX = ((long) ( nLeftSpace * nScaleX ));
long nStartY = ((long) ( nTopSpace * nScaleY ));
-// nStartX -= aOffset.X(); // schon im MapMode
-// nStartY -= aOffset.Y();
-
long nInnerStartX = nStartX;
long nInnerStartY = nStartY;
if (pBorderItem)
@@ -2318,7 +2281,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
{
if ( bDoPrint )
PrintArea( nRepeatStartCol,nRepeatStartRow, nRepeatEndCol,nRepeatEndRow,
- nRepStartX,nRepStartY, sal_True,sal_True,sal_False,sal_False );
+ nRepStartX,nRepStartY, sal_True,sal_True,false,false );
if ( pLocationData )
LocateArea( nRepeatStartCol,nRepeatStartRow, nRepeatEndCol,nRepeatEndRow,
nRepStartX,nRepStartY, sal_True,sal_True, *pLocationData );
@@ -2327,17 +2290,17 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
{
if ( bDoPrint )
PrintArea( nRepeatStartCol,nY1, nRepeatEndCol,nY2, nRepStartX,nDataY,
- sal_True,!bDoRepRow,sal_False,sal_True );
+ sal_True,!bDoRepRow,false,sal_True );
if ( pLocationData )
- LocateArea( nRepeatStartCol,nY1, nRepeatEndCol,nY2, nRepStartX,nDataY, sal_True,sal_False, *pLocationData );
+ LocateArea( nRepeatStartCol,nY1, nRepeatEndCol,nY2, nRepStartX,nDataY, sal_True,false, *pLocationData );
}
if (bDoRepRow)
{
if ( bDoPrint )
PrintArea( nX1,nRepeatStartRow, nX2,nRepeatEndRow, nDataX,nRepStartY,
- !bDoRepCol,sal_True,sal_True,sal_False );
+ !bDoRepCol,sal_True,sal_True,false );
if ( pLocationData )
- LocateArea( nX1,nRepeatStartRow, nX2,nRepeatEndRow, nDataX,nRepStartY, sal_False,sal_True, *pLocationData );
+ LocateArea( nX1,nRepeatStartRow, nX2,nRepeatEndRow, nDataX,nRepStartY, false,sal_True, *pLocationData );
}
// Daten ausgeben
@@ -2345,7 +2308,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( bDoPrint )
PrintArea( nX1,nY1, nX2,nY2, nDataX,nDataY, !bDoRepCol,!bDoRepRow,sal_True,sal_True );
if ( pLocationData )
- LocateArea( nX1,nY1, nX2,nY2, nDataX,nDataY, sal_False,sal_False, *pLocationData );
+ LocateArea( nX1,nY1, nX2,nY2, nDataX,nDataY, false,false, *pLocationData );
// Spalten-/Zeilenkoepfe ausgeben
// nach den Daten (ueber evtl. weitergezeichneten Schatten)
@@ -2379,7 +2342,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( bDoPrint )
PrintColHdr( nX1,nX2, nDataX,nInnerStartY );
if ( pLocationData )
- LocateColHdr( nX1,nX2, nDataX,nInnerStartY, sal_False, *pLocationData );
+ LocateColHdr( nX1,nX2, nDataX,nInnerStartY, false, *pLocationData );
if (bDoRepRow)
{
if ( bDoPrint )
@@ -2390,7 +2353,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( bDoPrint )
PrintRowHdr( nY1,nY2, nInnerStartX,nDataY );
if ( pLocationData )
- LocateRowHdr( nY1,nY2, nInnerStartX,nDataY, sal_False, *pLocationData );
+ LocateRowHdr( nY1,nY2, nInnerStartX,nDataY, false, *pLocationData );
}
// einfacher Rahmen
@@ -2419,8 +2382,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if ( pPrinter && bDoPrint )
{
- DBG_ERROR( "EndPage does not exist anymore" );
- // pPrinter->EndPage();
+ OSL_FAIL( "EndPage does not exist anymore" );
}
aLastSourceRange = ScRange( nX1, nY1, nPrintTab, nX2, nY2, nPrintTab );
@@ -2473,7 +2435,7 @@ void ScPrintFunc::SetExclusivelyDrawOleAndDrawObjects()
sal_Bool ScPrintFunc::UpdatePages()
{
if (!pParamSet)
- return sal_False;
+ return false;
// Zoom
@@ -2505,7 +2467,7 @@ sal_Bool ScPrintFunc::UpdatePages()
long ScPrintFunc::CountPages() // setzt auch nPagesX, nPagesY
{
- sal_Bool bAreaOk = sal_False;
+ sal_Bool bAreaOk = false;
if (pDoc->HasTable( nPrintTab ))
{
@@ -2523,10 +2485,10 @@ long ScPrintFunc::CountPages() // setzt auch nPagesX, n
nStartRow = rRange.aStart.Row();
nEndCol = rRange.aEnd .Col();
nEndRow = rRange.aEnd .Row();
- bAreaOk = AdjustPrintArea(sal_False); // begrenzen
+ bAreaOk = AdjustPrintArea(false); // begrenzen
}
else
- bAreaOk = sal_False;
+ bAreaOk = false;
}
else // aus Dokument suchen
bAreaOk = AdjustPrintArea(sal_True);
@@ -2566,7 +2528,6 @@ long ScPrintFunc::CountPages() // setzt auch nPagesX, n
}
else
{
-// nZoom = 100; // nZoom auf letztem Wert stehenlassen !!!
nPagesX = nPagesY = nTotalY = 0;
return 0;
}
@@ -2581,7 +2542,7 @@ long ScPrintFunc::CountNotePages()
SCCOL nCol;
SCROW nRow;
- sal_Bool bError = sal_False;
+ sal_Bool bError = false;
if (!aAreaParam.bPrintArea)
bError = !AdjustPrintArea(sal_True); // komplett aus Dok suchen
@@ -2603,7 +2564,7 @@ long ScPrintFunc::CountNotePages()
nStartRow = pThisRange->aStart.Row();
nEndCol = pThisRange->aEnd .Col();
nEndRow = pThisRange->aEnd .Row();
- bDoThis = AdjustPrintArea(sal_False);
+ bDoThis = AdjustPrintArea(false);
}
}
@@ -2629,7 +2590,7 @@ long ScPrintFunc::CountNotePages()
long nNoteAdd;
do
{
- nNoteAdd = PrintNotes( nPages, nNoteNr, sal_False, NULL );
+ nNoteAdd = PrintNotes( nPages, nNoteNr, false, NULL );
if (nNoteAdd)
{
nNoteNr += nNoteAdd;
@@ -2646,8 +2607,6 @@ void ScPrintFunc::InitModes() // aus nZoom etc. die MapModes setze
aOffset = Point( aSrcOffset.X()*100/nZoom, aSrcOffset.Y()*100/nZoom );
long nEffZoom = nZoom * (long) nManualZoom;
-
-// nScaleX = nScaleY = 1.0; // Ausgabe in Twips
nScaleX = nScaleY = HMM_PER_TWIPS; // Ausgabe in 1/100 mm
Fraction aZoomFract( nEffZoom,10000 );
@@ -2846,7 +2805,7 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
if (bPageSelected)
{
++nPrinted;
- bSourceRangeValid = sal_False; // last page was no cell range
+ bSourceRangeValid = false; // last page was no cell range
}
++nPageNo;
}
@@ -2876,7 +2835,7 @@ void ScPrintFunc::CalcZoom( sal_uInt16 nRangeNo ) // Zoom
nEndRow = pThisRange->aEnd .Row();
}
- if (!AdjustPrintArea(sal_False)) // leer
+ if (!AdjustPrintArea(false)) // leer
{
nZoom = 100;
nPagesX = nPagesY = nTotalY = 0;
@@ -3041,7 +3000,7 @@ void lcl_SetHidden( ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEntry& rPageRowE
SCROW nStartRow = rPageRowEntry.GetStartRow();
SCROW nEndRow = rPageRowEntry.GetEndRow();
- sal_Bool bLeftIsEmpty = sal_False;
+ sal_Bool bLeftIsEmpty = false;
ScRange aTempRange;
Rectangle aTempRect = pDoc->GetMMRect( 0,0, 0,0, 0 );
@@ -3055,7 +3014,7 @@ void lcl_SetHidden( ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEntry& rPageRowE
bLeftIsEmpty = sal_True;
}
else
- bLeftIsEmpty = sal_False;
+ bLeftIsEmpty = false;
nStartCol = nEndCol+1;
}
@@ -3086,10 +3045,9 @@ void ScPrintFunc::CalcPages() // berechnet aPageRect und Seiten au
nTotalY = 0;
bool bVisCol = false;
- SCCOL nLastCol = -1;
for (SCCOL i=nStartCol; i<=nEndCol; i++)
{
- bool bHidden = pDoc->ColHidden(i, nPrintTab, nLastCol);
+ bool bHidden = pDoc->ColHidden(i, nPrintTab);
bool bPageBreak = (pDoc->HasColBreak(i, nPrintTab) & BREAK_PAGE);
if ( i>nStartCol && bVisCol && bPageBreak )
{
@@ -3200,3 +3158,4 @@ ScJobSetup::ScJobSetup( SfxPrinter* pPrinter )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 0d35aacb04bb..683cd3a52848 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,9 +45,7 @@
#include "acredlin.hxx"
#include "simpref.hxx"
#include "scmod.hxx"
-//<!--Added by PengYunQuan for Validity Cell Range Picker
#include "validate.hxx"
-//<!--Added by PengYunQuan for Validity Cell Range Picker
// -----------------------------------------------------------------------
@@ -71,10 +70,8 @@ SFX_IMPL_CHILDWINDOW(ScFunctionDlgWrapper, SID_OPENDLG_FUNCTION )
SFX_IMPL_CHILDWINDOW(ScEditFunctionDlgWrapper, SID_OPENDLG_EDITFUNCTION )
SFX_IMPL_CHILDWINDOW(ScArgumentDlgWrapper, SID_OPENDLG_ARGUMENT )
*/
-//<!--Added by PengYunQuan for Validity Cell Range Picker
-//SFX_IMPL_MODELESSDIALOG(ScValidityRefChildWin, SID_VALIDITY_REFERENCE )
SFX_IMPL_CHILDWINDOW(ScValidityRefChildWin, SID_VALIDITY_REFERENCE)
-SfxChildWinInfo __EXPORT ScValidityRefChildWin::GetInfo() const
+SfxChildWinInfo ScValidityRefChildWin::GetInfo() const
{
SfxChildWinInfo anInfo = SfxChildWindow::GetInfo();
@@ -91,7 +88,6 @@ SfxChildWinInfo __EXPORT ScValidityRefChildWin::GetInfo() const
}
namespace { ScTabViewShell * lcl_GetTabViewShell( SfxBindings *pBindings ); }
-//<!--Added by PengYunQuan for Validity Cell Range Picker
#define IMPL_CHILD_CTOR(Class,sid) \
Class::Class( Window* pParentP, \
@@ -100,7 +96,6 @@ namespace { ScTabViewShell * lcl_GetTabViewShell( SfxBindings *pBindings ); }
SfxChildWinInfo* pInfo ) \
: SfxChildWindow(pParentP, nId) \
{ \
- /*//<!--Added by PengYunQuan for Validity Cell Range Picker*/\
/************************************************************************************/\
/* When a new document is creating, the SfxViewFrame may be ready, */\
/* But the ScTabViewShell may have not been activated yet. In this */\
@@ -108,14 +103,13 @@ namespace { ScTabViewShell * lcl_GetTabViewShell( SfxBindings *pBindings ); }
/* and we should lcl_GetTabViewShell( p ) instead of SfxViewShell::Current() */\
/************************************************************************************/\
ScTabViewShell* pViewShell = lcl_GetTabViewShell( p ); \
- /*//-->Added by PengYunQuan for Validity Cell Range Picker*/\
if (!pViewShell) \
pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() ); \
DBG_ASSERT( pViewShell, "missing view shell :-(" ); \
pWindow = pViewShell ? \
pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : NULL; \
if (pViewShell && !pWindow) \
- pViewShell->GetViewFrame()->SetChildWindow( nId, sal_False ); \
+ pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \
}
@@ -217,8 +211,6 @@ ScSimpleRefDlgWrapper::ScSimpleRefDlgWrapper( Window* pParentP,
SfxChildWinInfo* pInfo )
: SfxChildWindow(pParentP, nId)
{
-// ScTabViewShell* pViewShell =
-// PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
ScTabViewShell* pViewShell = NULL;
SfxDispatcher* pDisp = p->GetDispatcher();
@@ -245,7 +237,7 @@ ScSimpleRefDlgWrapper::ScSimpleRefDlgWrapper( Window* pParentP,
if (!pWindow)
{
- SC_MOD()->SetRefDialog( nId, sal_False );
+ SC_MOD()->SetRefDialog( nId, false );
}
}
@@ -341,7 +333,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( Window* pParentP,
((ScAcceptChgDlg*)pWindow)->Initialize( pInfo );
}
if (pViewShell && !pWindow)
- pViewShell->GetViewFrame()->SetChildWindow( nId, sal_False );
+ pViewShell->GetViewFrame()->SetChildWindow( nId, false );
}
void ScAcceptChgDlgWrapper::ReInitDlg()
@@ -362,30 +354,7 @@ void ScAcceptChgDlgWrapper::ReInitDlg()
IMPL_CHILD_CTOR( ScHighlightChgDlgWrapper, FID_CHG_SHOW )
-/*------------------------------------------------------------------------*/
-/*@@@
- //-------------------------------------------------------------------------
- // ScFunctionDlgWrapper
- //-------------------------------------------------------------------------
- IMPL_CHILD_CTOR( ScFunctionDlgWrapper, SID_OPENDLG_FUNCTION )
-
- //-------------------------------------------------------------------------
- // ScEditFunctionDlgWrapper
- //-------------------------------------------------------------------------
-
- IMPL_CHILD_CTOR( ScEditFunctionDlgWrapper, SID_OPENDLG_EDITFUNCTION )
-
- //-------------------------------------------------------------------------
- // ScArgumentDlgWrapper
- //-------------------------------------------------------------------------
-
- IMPL_CHILD_CTOR( ScArgumentDlgWrapper, SID_OPENDLG_ARGUMENT )
-@@@*/
-/*------------------------------------------------------------------------*/
-
-
-//<!--Added by PengYunQuan for Validity Cell Range Picker
namespace
{
ScTabViewShell * lcl_GetTabViewShell( SfxBindings *pBindings )
@@ -409,7 +378,7 @@ ScValidityRefChildWin::ScValidityRefChildWin( Window* pParentP,
m_bFreeWindowLock( false ),
m_pSavedWndParent( NULL )
{
- SetWantsFocus( sal_False );\
+ SetWantsFocus( false );\
ScTabViewShell* pViewShell = \
NULL != ( pWindow = ScValidationDlg::Find1AliveObject( pParentP ) ) ? static_cast<ScValidationDlg*>(pWindow)->GetTabViewShell() :
lcl_GetTabViewShell( p );
@@ -417,9 +386,7 @@ ScValidityRefChildWin::ScValidityRefChildWin( Window* pParentP,
pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
DBG_ASSERT( pViewShell, "missing view shell :-(" ); \
if (pViewShell && !pWindow) \
- pViewShell->GetViewFrame()->SetChildWindow( nId, sal_False ); \
- else if( pWindow /*&& pWindow->ISA(ScValidationDlg)*/ )
- {}//pWindow = new Window( pParentP, WB_HIDE );
+ pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \
if( pWindow ) m_pSavedWndParent = pWindow->GetParent();
}
@@ -431,4 +398,5 @@ ScValidityRefChildWin::~ScValidityRefChildWin()
if( m_bFreeWindowLock )
pWindow = NULL;
}
-//-->Added by PengYunQuan for Validity Cell Range Picker
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/scextopt.cxx b/sc/source/ui/view/scextopt.cxx
index d5816ecdd289..c9af56f00d33 100644
--- a/sc/source/ui/view/scextopt.cxx
+++ b/sc/source/ui/view/scextopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,8 @@ ScExtTabSettings::ScExtTabSettings() :
mnPageZoom( 0 ),
mbSelected( false ),
mbFrozenPanes( false ),
- mbPageMode( false )
+ mbPageMode( false ),
+ mbShowGrid( true )
{
}
@@ -222,3 +224,4 @@ void ScExtDocOptions::SetCodeName( SCTAB nTab, const String& rCodeName )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index ab0cb8248813..e73e58ef032e 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <tools/urlobj.hxx>
#include <vcl/sound.hxx>
+#include <vcl/svapp.hxx>
#include <sfx2/docfile.hxx>
#include "select.hxx"
@@ -41,11 +43,12 @@
#include "tabvwsh.hxx"
#include "scmod.hxx"
#include "document.hxx"
-//#include "dataobj.hxx"
#include "transobj.hxx"
#include "docsh.hxx"
#include "tabprotection.hxx"
+#define SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN 65
+
extern sal_uInt16 nScFillModeMouseModifier; // global.cxx
using namespace com::sun::star;
@@ -53,7 +56,7 @@ using namespace com::sun::star;
// STATIC DATA -----------------------------------------------------------
static Point aSwitchPos; //! Member
-static sal_Bool bDidSwitch = sal_False;
+static sal_Bool bDidSwitch = false;
// -----------------------------------------------------------------------
@@ -64,8 +67,8 @@ static sal_Bool bDidSwitch = sal_False;
ScViewFunctionSet::ScViewFunctionSet( ScViewData* pNewViewData ) :
pViewData( pNewViewData ),
pEngine( NULL ),
- bAnchor( sal_False ),
- bStarted( sal_False )
+ bAnchor( false ),
+ bStarted( false )
{
DBG_ASSERT(pViewData, "ViewData==0 bei FunctionSet");
}
@@ -78,6 +81,83 @@ ScSplitPos ScViewFunctionSet::GetWhich()
return pViewData->GetActivePart();
}
+sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos,
+ bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll )
+{
+ sal_uLong nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX;
+ Window* pWin = pEngine->GetWindow();
+ Rectangle aScrRect = pWin->GetDesktopRectPixel();
+ Point aRootPos = pWin->OutputToAbsoluteScreenPixel(Point(0,0));
+ if (bRightScroll)
+ {
+ double nWinRight = rWinSize.getWidth() + aRootPos.getX();
+ double nMarginRight = aScrRect.GetWidth() - nWinRight;
+ double nHOffset = rEffPos.X() - rWinSize.Width();
+ double nHAccelRate = nHOffset / nMarginRight;
+
+ if (nHAccelRate > 1.0)
+ nHAccelRate = 1.0;
+
+ nUpdateInterval = static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate));
+ }
+
+ if (bLeftScroll)
+ {
+ double nMarginLeft = aRootPos.getX();
+ double nHOffset = -rEffPos.X();
+ double nHAccelRate = nHOffset / nMarginLeft;
+
+ if (nHAccelRate > 1.0)
+ nHAccelRate = 1.0;
+
+ sal_uLong nTmp = static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nHAccelRate));
+ if (nUpdateInterval > nTmp)
+ nUpdateInterval = nTmp;
+ }
+
+ if (bBottomScroll)
+ {
+ double nWinBottom = rWinSize.getHeight() + aRootPos.getY();
+ double nMarginBottom = aScrRect.GetHeight() - nWinBottom;
+ double nVOffset = rEffPos.Y() - rWinSize.Height();
+ double nVAccelRate = nVOffset / nMarginBottom;
+
+ if (nVAccelRate > 1.0)
+ nVAccelRate = 1.0;
+
+ sal_uLong nTmp = static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
+ if (nUpdateInterval > nTmp)
+ nUpdateInterval = nTmp;
+ }
+
+ if (bTopScroll)
+ {
+ double nMarginTop = aRootPos.getY();
+ double nVOffset = -rEffPos.Y();
+ double nVAccelRate = nVOffset / nMarginTop;
+
+ if (nVAccelRate > 1.0)
+ nVAccelRate = 1.0;
+
+ sal_uLong nTmp = static_cast<sal_uLong>(SELENG_AUTOREPEAT_INTERVAL_MAX*(1.0 - nVAccelRate));
+ if (nUpdateInterval > nTmp)
+ nUpdateInterval = nTmp;
+ }
+
+#ifdef WNT
+ ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ bool bRefMode = pViewShell && pViewShell->IsRefInputMode();
+ if (bRefMode && nUpdateInterval < SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN)
+ // Lower the update interval during ref mode, because re-draw can be
+ // expensive on Windows. Making this interval too small would queue up
+ // the scroll/paint requests which would cause semi-infinite
+ // scrolls even after the mouse cursor is released. We don't have
+ // this problem on Linux.
+ nUpdateInterval = SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN;
+#endif
+ return nUpdateInterval;
+}
+
void ScViewFunctionSet::SetSelectionEngine( ScViewSelectionEngine* pSelEngine )
{
pEngine = pSelEngine;
@@ -85,7 +165,7 @@ void ScViewFunctionSet::SetSelectionEngine( ScViewSelectionEngine* pSelEngine )
// Drag & Drop
-void __EXPORT ScViewFunctionSet::BeginDrag()
+void ScViewFunctionSet::BeginDrag()
{
SCTAB nTab = pViewData->GetTabNo();
@@ -106,16 +186,15 @@ void __EXPORT ScViewFunctionSet::BeginDrag()
sal_Bool bRefMode = pScMod->IsFormulaMode();
if (!bRefMode)
{
- pViewData->GetView()->FakeButtonUp( GetWhich() ); // ButtonUp wird verschluckt
+ pViewData->GetView()->FakeButtonUp( GetWhich() ); // ButtonUp is swallowed
ScMarkData& rMark = pViewData->GetMarkData();
-// rMark.SetMarking(sal_False); // es fehlt ein ButtonUp
rMark.MarkToSimple();
if ( rMark.IsMarked() && !rMark.IsMultiMarked() )
{
ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP );
- // bApi = sal_True -> no error mesages
- sal_Bool bCopied = pViewData->GetView()->CopyToClip( pClipDoc, sal_False, sal_True );
+ // bApi = TRUE -> no error messages
+ sal_Bool bCopied = pViewData->GetView()->CopyToClip( pClipDoc, false, true );
if ( bCopied )
{
sal_Int8 nDragActions = pViewData->GetView()->SelectionEditable() ?
@@ -159,9 +238,9 @@ void __EXPORT ScViewFunctionSet::BeginDrag()
Sound::Beep(); // can't drag
}
-// Selektion
+// Selection
-void __EXPORT ScViewFunctionSet::CreateAnchor()
+void ScViewFunctionSet::CreateAnchor()
{
if (bAnchor) return;
@@ -180,7 +259,7 @@ void ScViewFunctionSet::SetAnchor( SCCOL nPosX, SCROW nPosY )
if (bRefMode)
{
- pView->DoneRefMode( sal_False );
+ pView->DoneRefMode( false );
aAnchorPos.Set( nPosX, nPosY, nTab );
pView->InitRefMode( aAnchorPos.Col(), aAnchorPos.Row(), aAnchorPos.Tab(),
SC_REFTYPE_REF );
@@ -210,13 +289,13 @@ void ScViewFunctionSet::SetAnchor( SCCOL nPosX, SCROW nPosY )
bStarted = sal_True;
}
else
- bStarted = sal_False;
+ bStarted = false;
}
}
bAnchor = sal_True;
}
-void __EXPORT ScViewFunctionSet::DestroyAnchor()
+void ScViewFunctionSet::DestroyAnchor()
{
sal_Bool bRefMode = SC_MOD()->IsFormulaMode();
if (bRefMode)
@@ -224,7 +303,7 @@ void __EXPORT ScViewFunctionSet::DestroyAnchor()
else
pViewData->GetView()->DoneBlockMode( sal_True );
- bAnchor = sal_False;
+ bAnchor = false;
}
void ScViewFunctionSet::SetAnchorFlag( sal_Bool bSet )
@@ -232,14 +311,14 @@ void ScViewFunctionSet::SetAnchorFlag( sal_Bool bSet )
bAnchor = bSet;
}
-sal_Bool __EXPORT ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool /* bDontSelectAtCursor */ )
+sal_Bool ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool /* bDontSelectAtCursor */ )
{
if ( bDidSwitch )
{
if ( rPointPixel == aSwitchPos )
- return sal_False; // nicht auf falschem Fenster scrollen
+ return false; // nicht auf falschem Fenster scrollen
else
- bDidSwitch = sal_False;
+ bDidSwitch = false;
}
aSwitchPos = rPointPixel; // nur wichtig, wenn bDidSwitch
@@ -256,10 +335,11 @@ sal_Bool __EXPORT ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel,
// Scrolling
Size aWinSize = pEngine->GetWindow()->GetOutputSizePixel();
- sal_Bool bRightScroll = ( aEffPos.X() >= aWinSize.Width() );
- sal_Bool bBottomScroll = ( aEffPos.Y() >= aWinSize.Height() );
- sal_Bool bNegScroll = ( aEffPos.X() < 0 || aEffPos.Y() < 0 );
- sal_Bool bScroll = bRightScroll || bBottomScroll || bNegScroll;
+ bool bRightScroll = ( aEffPos.X() >= aWinSize.Width() );
+ bool bLeftScroll = ( aEffPos.X() < 0 );
+ bool bBottomScroll = ( aEffPos.Y() >= aWinSize.Height() );
+ bool bTopScroll = ( aEffPos.Y() < 0 );
+ bool bScroll = bRightScroll || bBottomScroll || bLeftScroll || bTopScroll;
SCsCOL nPosX;
SCsROW nPosY;
@@ -297,21 +377,34 @@ sal_Bool __EXPORT ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel,
if ( aEffPos.X() >= aWinSize.Width() )
{
if ( eWhich == SC_SPLIT_TOPLEFT )
- pViewData->GetView()->ActivatePart( SC_SPLIT_TOPRIGHT ), bScroll = sal_False, bDidSwitch = sal_True;
+ pViewData->GetView()->ActivatePart( SC_SPLIT_TOPRIGHT ), bScroll = false, bDidSwitch = sal_True;
else if ( eWhich == SC_SPLIT_BOTTOMLEFT )
- pViewData->GetView()->ActivatePart( SC_SPLIT_BOTTOMRIGHT ), bScroll = sal_False, bDidSwitch = sal_True;
+ pViewData->GetView()->ActivatePart( SC_SPLIT_BOTTOMRIGHT ), bScroll = false, bDidSwitch = sal_True;
}
if ( pViewData->GetVSplitMode() == SC_SPLIT_FIX )
if ( aEffPos.Y() >= aWinSize.Height() )
{
if ( eWhich == SC_SPLIT_TOPLEFT )
- pViewData->GetView()->ActivatePart( SC_SPLIT_BOTTOMLEFT ), bScroll = sal_False, bDidSwitch = sal_True;
+ pViewData->GetView()->ActivatePart( SC_SPLIT_BOTTOMLEFT ), bScroll = false, bDidSwitch = sal_True;
else if ( eWhich == SC_SPLIT_TOPRIGHT )
- pViewData->GetView()->ActivatePart( SC_SPLIT_BOTTOMRIGHT ), bScroll = sal_False, bDidSwitch = sal_True;
+ pViewData->GetView()->ActivatePart( SC_SPLIT_BOTTOMRIGHT ), bScroll = false, bDidSwitch = sal_True;
}
}
+ if (bScroll)
+ {
+ // Adjust update interval based on how far the mouse pointer is from the edge.
+ sal_uLong nUpdateInterval = CalcUpdateInterval(
+ aWinSize, aEffPos, bLeftScroll, bTopScroll, bRightScroll, bBottomScroll);
+ pEngine->SetUpdateInterval(nUpdateInterval);
+ }
+ else
+ {
+ // Don't forget to reset the interval when not scrolling!
+ pEngine->SetUpdateInterval(SELENG_AUTOREPEAT_INTERVAL);
+ }
+
pViewData->ResetOldCursor();
return SetCursorAtCell( nPosX, nPosY, bScroll );
}
@@ -332,12 +425,12 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
bool bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
if ( bSkipProtected && bSkipUnprotected )
- return sal_False;
+ return false;
bool bCellProtected = pDoc->HasAttrib(nPosX, nPosY, nTab, nPosX, nPosY, nTab, HASATTR_PROTECTED);
if ( (bCellProtected && bSkipProtected) || (!bCellProtected && bSkipUnprotected) )
// Don't select this cell!
- return sal_False;
+ return false;
}
ScModule* pScMod = SC_MOD();
@@ -363,7 +456,7 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
if (bRefMode)
{
- // #90910# if no input is possible from this doc, don't move the reference cursor around
+ // if no input is possible from this doc, don't move the reference cursor around
if ( !pScMod->IsModalMode(pViewData->GetSfxDocShell()) )
{
if (!bAnchor)
@@ -424,25 +517,8 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
nEndX,nEndY,nTab ) );
pViewData->GetView()->UpdateShrinkOverlay();
-#if 0
- if ( bOldDelMark )
- {
- ScUpdateRect aRect( aDelRange.aStart.Col(), aDelRange.aStart.Row(),
- aDelRange.aEnd.Col(), aDelRange.aEnd.Row() );
- aRect.SetNew( nDelStartX,nDelStartY, nEndX,nEndY );
- SCCOL nPaintStartX;
- SCROW nPaintStartY;
- SCCOL nPaintEndX;
- SCROW nPaintEndY;
- if (aRect.GetDiff( nPaintStartX, nPaintStartY, nPaintEndX, nPaintEndY ))
- pViewData->GetView()->
- PaintArea( nPaintStartX, nPaintStartY,
- nPaintEndX, nPaintEndY, SC_UPDATE_MARKS );
- }
- else
-#endif
- pViewData->GetView()->
- PaintArea( nStartX,nDelStartY, nEndX,nEndY, SC_UPDATE_MARKS );
+ pViewData->GetView()->
+ PaintArea( nStartX,nDelStartY, nEndX,nEndY, SC_UPDATE_MARKS );
nPosX = nEndX; // roten Rahmen um ganzen Bereich lassen
nPosY = nEndY;
@@ -460,12 +536,6 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
{
pViewData->ResetDelMark();
pViewData->GetView()->UpdateShrinkOverlay();
-
-#if 0
- pViewData->GetView()->
- PaintArea( aDelRange.aStart.Col(), aDelRange.aStart.Row(),
- aDelRange.aEnd.Col(), aDelRange.aEnd.Row(), SC_UPDATE_MARKS );
-#endif
}
sal_Bool bNegX = ( nPosX < (SCsCOL) nStartX );
@@ -474,7 +544,7 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
long nSizeX = 0;
if ( bNegX )
{
- // #94321# in SetCursorAtPoint hidden columns are skipped.
+ // in SetCursorAtPoint hidden columns are skipped.
// They must be skipped here too, or the result will always be the first hidden column.
do ++nPosX; while ( nPosX<nStartX && pDoc->ColHidden(nPosX, nTab) );
for (SCCOL i=nPosX; i<nStartX; i++)
@@ -487,7 +557,7 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
long nSizeY = 0;
if ( bNegY )
{
- // #94321# in SetCursorAtPoint hidden rows are skipped.
+ // in SetCursorAtPoint hidden rows are skipped.
// They must be skipped here too, or the result will always be the first hidden row.
if (++nPosY < nStartY)
{
@@ -503,12 +573,12 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
if ( nSizeX > nSizeY ) // Fill immer nur in einer Richtung
{
nPosY = nEndY;
- bNegY = sal_False;
+ bNegY = false;
}
else
{
nPosX = nEndX;
- bNegX = sal_False;
+ bNegX = false;
}
SCCOL nRefStX = bNegX ? nEndX : nStartX;
@@ -583,7 +653,10 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
}
}
if (bStarted)
- pView->MarkCursor( (SCCOL) nPosX, (SCROW) nPosY, nTab, sal_False, sal_False, sal_True );
+ // If the selection is already started, don't set the cursor.
+ pView->MarkCursor( (SCCOL) nPosX, (SCROW) nPosY, nTab, false, false, true );
+ else
+ pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY );
}
else
{
@@ -619,9 +692,9 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
bStarted = sal_True;
}
+ pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY );
}
- pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY );
pViewData->SetRefStart( nPosX, nPosY, nTab );
if (bHideCur)
pView->ShowAllCursors();
@@ -633,14 +706,14 @@ sal_Bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Boo
return sal_True;
}
-sal_Bool __EXPORT ScViewFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
+sal_Bool ScViewFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
{
sal_Bool bRefMode = SC_MOD()->IsFormulaMode();
if (bRefMode)
- return sal_False;
+ return false;
if (pViewData->IsAnyFillMode())
- return sal_False;
+ return false;
ScMarkData& rMark = pViewData->GetMarkData();
if (bAnchor || !rMark.IsMultiMarked())
@@ -651,15 +724,15 @@ sal_Bool __EXPORT ScViewFunctionSet::IsSelectionAtPoint( const Point& rPointPixe
return pViewData->GetMarkData().IsCellMarked( (SCCOL) nPosX, (SCROW) nPosY );
}
- return sal_False;
+ return false;
}
-void __EXPORT ScViewFunctionSet::DeselectAtPoint( const Point& /* rPointPixel */ )
+void ScViewFunctionSet::DeselectAtPoint( const Point& /* rPointPixel */ )
{
// gibt's nicht
}
-void __EXPORT ScViewFunctionSet::DeselectAll()
+void ScViewFunctionSet::DeselectAll()
{
if (pViewData->IsAnyFillMode())
return;
@@ -667,15 +740,15 @@ void __EXPORT ScViewFunctionSet::DeselectAll()
sal_Bool bRefMode = SC_MOD()->IsFormulaMode();
if (bRefMode)
{
- pViewData->GetView()->DoneRefMode( sal_False );
+ pViewData->GetView()->DoneRefMode( false );
}
else
{
- pViewData->GetView()->DoneBlockMode( sal_False );
+ pViewData->GetView()->DoneBlockMode( false );
pViewData->GetViewShell()->UpdateInputHandler();
}
- bAnchor = sal_False;
+ bAnchor = false;
}
//------------------------------------------------------------------------
@@ -699,9 +772,9 @@ ScViewSelectionEngine::ScViewSelectionEngine( Window* pWindow, ScTabView* pView,
ScHeaderFunctionSet::ScHeaderFunctionSet( ScViewData* pNewViewData ) :
pViewData( pNewViewData ),
- bColumn( sal_False ),
+ bColumn( false ),
eWhich( SC_SPLIT_TOPLEFT ),
- bAnchor( sal_False ),
+ bAnchor( false ),
nCursorPos( 0 )
{
DBG_ASSERT(pViewData, "ViewData==0 bei FunctionSet");
@@ -717,12 +790,12 @@ void ScHeaderFunctionSet::SetWhich( ScSplitPos eNew )
eWhich = eNew;
}
-void __EXPORT ScHeaderFunctionSet::BeginDrag()
+void ScHeaderFunctionSet::BeginDrag()
{
// gippsnich
}
-void __EXPORT ScHeaderFunctionSet::CreateAnchor()
+void ScHeaderFunctionSet::CreateAnchor()
{
if (bAnchor)
return;
@@ -731,32 +804,32 @@ void __EXPORT ScHeaderFunctionSet::CreateAnchor()
pView->DoneBlockMode( sal_True );
if (bColumn)
{
- pView->InitBlockMode( static_cast<SCCOL>(nCursorPos), 0, pViewData->GetTabNo(), sal_True, sal_True, sal_False );
+ pView->InitBlockMode( static_cast<SCCOL>(nCursorPos), 0, pViewData->GetTabNo(), sal_True, sal_True, false );
pView->MarkCursor( static_cast<SCCOL>(nCursorPos), MAXROW, pViewData->GetTabNo() );
}
else
{
- pView->InitBlockMode( 0, nCursorPos, pViewData->GetTabNo(), sal_True, sal_False, sal_True );
+ pView->InitBlockMode( 0, nCursorPos, pViewData->GetTabNo(), sal_True, false, sal_True );
pView->MarkCursor( MAXCOL, nCursorPos, pViewData->GetTabNo() );
}
bAnchor = sal_True;
}
-void __EXPORT ScHeaderFunctionSet::DestroyAnchor()
+void ScHeaderFunctionSet::DestroyAnchor()
{
pViewData->GetView()->DoneBlockMode( sal_True );
- bAnchor = sal_False;
+ bAnchor = false;
}
-sal_Bool __EXPORT ScHeaderFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool /* bDontSelectAtCursor */ )
+sal_Bool ScHeaderFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool /* bDontSelectAtCursor */ )
{
if ( bDidSwitch )
{
// die naechste gueltige Position muss vom anderen Fenster kommen
if ( rPointPixel == aSwitchPos )
- return sal_False; // nicht auf falschem Fenster scrollen
+ return false; // nicht auf falschem Fenster scrollen
else
- bDidSwitch = sal_False;
+ bDidSwitch = false;
}
// Scrolling
@@ -770,7 +843,7 @@ sal_Bool __EXPORT ScHeaderFunctionSet::SetCursorAtPoint( const Point& rPointPixe
// ueber Fixier-Grenze bewegt?
- sal_Bool bSwitched = sal_False;
+ sal_Bool bSwitched = false;
if ( bColumn )
{
if ( pViewData->GetHSplitMode() == SC_SPLIT_FIX )
@@ -801,7 +874,7 @@ sal_Bool __EXPORT ScHeaderFunctionSet::SetCursorAtPoint( const Point& rPointPixe
{
aSwitchPos = rPointPixel;
bDidSwitch = sal_True;
- return sal_False; // nicht mit falschen Positionen rechnen
+ return false; // nicht mit falschen Positionen rechnen
}
//
@@ -809,7 +882,7 @@ sal_Bool __EXPORT ScHeaderFunctionSet::SetCursorAtPoint( const Point& rPointPixe
SCsCOL nPosX;
SCsROW nPosY;
pViewData->GetPosFromPixel( rPointPixel.X(), rPointPixel.Y(), pViewData->GetActivePart(),
- nPosX, nPosY, sal_False );
+ nPosX, nPosY, false );
if (bColumn)
{
nCursorPos = static_cast<SCCOLROW>(nPosX);
@@ -851,12 +924,12 @@ sal_Bool __EXPORT ScHeaderFunctionSet::SetCursorAtPoint( const Point& rPointPixe
return sal_True;
}
-sal_Bool __EXPORT ScHeaderFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
+sal_Bool ScHeaderFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
{
SCsCOL nPosX;
SCsROW nPosY;
pViewData->GetPosFromPixel( rPointPixel.X(), rPointPixel.Y(), pViewData->GetActivePart(),
- nPosX, nPosY, sal_False );
+ nPosX, nPosY, false );
ScMarkData& rMark = pViewData->GetMarkData();
if (bColumn)
@@ -865,14 +938,14 @@ sal_Bool __EXPORT ScHeaderFunctionSet::IsSelectionAtPoint( const Point& rPointPi
return rMark.IsRowMarked( nPosY );
}
-void __EXPORT ScHeaderFunctionSet::DeselectAtPoint( const Point& /* rPointPixel */ )
+void ScHeaderFunctionSet::DeselectAtPoint( const Point& /* rPointPixel */ )
{
}
-void __EXPORT ScHeaderFunctionSet::DeselectAll()
+void ScHeaderFunctionSet::DeselectAll()
{
- pViewData->GetView()->DoneBlockMode( sal_False );
- bAnchor = sal_False;
+ pViewData->GetView()->DoneBlockMode( false );
+ bAnchor = false;
}
//------------------------------------------------------------------------
@@ -882,10 +955,11 @@ ScHeaderSelectionEngine::ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunct
{
// Parameter einstellen
SetSelectionMode( MULTIPLE_SELECTION );
- EnableDrag( sal_False );
+ EnableDrag( false );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/selectionstate.cxx b/sc/source/ui/view/selectionstate.cxx
index d5101e68a2b7..93bcb4c68082 100644
--- a/sc/source/ui/view/selectionstate.cxx
+++ b/sc/source/ui/view/selectionstate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@ ScSelectionState::ScSelectionState( ScViewData& rViewData ) :
if( rMarkData.IsMultiMarked() )
{
meType = SC_SELECTTYPE_SHEET;
- rMarkData.FillRangeListWithMarks( &maSheetSel, sal_False );
+ rMarkData.FillRangeListWithMarks( &maSheetSel, false );
}
// else type is SC_SELECTTYPE_NONE - already initialized
}
@@ -69,7 +70,7 @@ bool operator==( const ScSelectionState& rL, const ScSelectionState& rR )
if( bEqual ) switch( rL.GetSelectionType() )
{
case SC_SELECTTYPE_EDITCELL:
- bEqual &= ( rL.GetEditSelection().IsEqual( rR.GetEditSelection() ) != sal_False );
+ bEqual &= ( rL.GetEditSelection().IsEqual( rR.GetEditSelection() ) != false );
// run through!
case SC_SELECTTYPE_SHEET:
bEqual &= (rL.GetSheetSelection() == rR.GetSheetSelection()) == sal_True;
@@ -87,3 +88,4 @@ bool operator==( const ScSelectionState& rL, const ScSelectionState& rR )
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx
index bdce01457094..a852f8e5f68b 100644
--- a/sc/source/ui/view/spelldialog.cxx
+++ b/sc/source/ui/view/spelldialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -220,7 +221,7 @@ void ScSpellDialogChildWindow::Init()
}
mbOldIdleDisabled = mpDoc->IsIdleDisabled();
- mpDoc->DisableIdle( sal_True ); // #42726# stop online spelling
+ mpDoc->DisableIdle( true ); // stop online spelling
// *** create Undo/Redo documents *** -------------------------------------
@@ -254,7 +255,7 @@ void ScSpellDialogChildWindow::Init()
Rectangle aRect( Point( 0, 0 ), Point( 0, 0 ) );
pEditView->SetOutputArea( aRect );
mxEngine->SetControlWord( EE_CNTRL_USECHARATTRIBS );
- mxEngine->EnableUndo( sal_False );
+ mxEngine->EnableUndo( false );
mxEngine->SetPaperSize( aRect.GetSize() );
mxEngine->SetText( EMPTY_STRING );
mxEngine->ClearModifyFlag();
@@ -277,3 +278,4 @@ bool ScSpellDialogChildWindow::IsSelectionChanged()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index ab7b876d6417..e5e1b38da726 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -122,7 +123,7 @@ bool ScConversionEngineBase::FindNextConversionCell()
for( SCTAB nTab = 0, nTabCount = mrDoc.GetTableCount(); nTab < nTabCount; ++nTab )
{
- // #69965# always change the cell on the visible tab,
+ // always change the cell on the visible tab,
// on the other selected tabs only if they contain the same text
if( (nTab == mnStartTab) ||
@@ -456,3 +457,4 @@ bool ScTextConversionEngine::NeedsConversion()
// ============================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 6e41548dc31f..1f1aca34902a 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,14 +55,15 @@
//==================================================================
ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
- TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL |
- WB_RANGESELECT | WB_MULTISELECT | WB_DRAG | WB_SIZEABLE ) ),
+ TabBar( pParent,
+ WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT |
+ WB_MULTISELECT | WB_DRAG | WB_SIZEABLE) ),
DropTargetHelper( this ),
DragSourceHelper( this ),
pViewData( pData ),
nMouseClickPageId( TabBar::PAGE_NOT_FOUND ),
nSelPageIdByMouse( TabBar::PAGE_NOT_FOUND ),
- bErrorShown( sal_False )
+ bErrorShown( false )
{
ScDocument* pDoc = pViewData->GetDocument();
@@ -94,6 +96,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
SetSplitHdl( LINK( pViewData->GetView(), ScTabView, TabBarResize ) );
EnableEditMode();
+ UpdateInputContext();
}
ScTabControl::~ScTabControl()
@@ -157,11 +160,11 @@ void ScTabControl::MouseButtonDown( const MouseEvent& rMEvt )
pViewData->GetView()->ActiveGrabFocus();
}
- /* #47745# Click into free area -> insert new sheet (like in Draw).
+ /* Click into free area -> insert new sheet (like in Draw).
Needing clean left click without modifiers (may be context menu).
- #106948# Remember clicks to all pages, to be able to move mouse pointer later. */
+ Remember clicks to all pages, to be able to move mouse pointer later. */
if( rMEvt.IsLeft() && (rMEvt.GetModifier() == 0) )
- nMouseClickPageId = GetPageId( rMEvt.GetPosPixel() );
+ nMouseClickPageId = GetPageId( rMEvt.GetPosPixel(), true );
else
nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
@@ -173,13 +176,25 @@ void ScTabControl::MouseButtonUp( const MouseEvent& rMEvt )
Point aPos = PixelToLogic( rMEvt.GetPosPixel() );
// mouse button down and up on same page?
- if( nMouseClickPageId != GetPageId( aPos ) )
+ if( nMouseClickPageId != GetPageId( aPos, true ) )
nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
+ if (nMouseClickPageId == TabBar::INSERT_TAB_POS)
+ {
+ // Insert a new sheet at the right end, with default name.
+ ScDocument* pDoc = pViewData->GetDocument();
+ String aName;
+ pDoc->CreateValidTabName(aName);
+ SCTAB nTabCount = pDoc->GetTableCount();
+ pViewData->GetViewShell()->InsertTable(aName, nTabCount);
+ return;
+ }
+
if ( rMEvt.GetClicks() == 2 && rMEvt.IsLeft() && nMouseClickPageId != 0 && nMouseClickPageId != TAB_PAGE_NOTFOUND )
{
SfxDispatcher* pDispatcher = pViewData->GetViewShell()->GetViewFrame()->GetDispatcher();
pDispatcher->Execute( FID_TAB_MENU_RENAME, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD );
+ return;
}
if( nMouseClickPageId == 0 )
@@ -240,12 +255,6 @@ void ScTabControl::Select()
for (i=0; i<nCount; i++)
rMark.SelectTable( i, IsPageSelected(static_cast<sal_uInt16>(i)+1) );
-/* Markierungen werden per Default nicht pro Tabelle gehalten
- sal_uInt16 nSelCnt = GetSelectPageCount();
- if (nSelCnt>1)
- pDoc->ExtendMarksFromTable( nPage );
-*/
-
SfxDispatcher& rDisp = pViewData->GetDispatcher();
if (rDisp.IsLocked())
pViewData->GetView()->SetTabNo( static_cast<SCTAB>(nPage) );
@@ -285,6 +294,17 @@ void ScTabControl::Select()
}
}
+void ScTabControl::UpdateInputContext()
+{
+ ScDocument* pDoc = pViewData->GetDocument();
+ WinBits nStyle = GetStyle();
+ if (pDoc->GetDocumentShell()->IsReadOnly())
+ // no insert sheet tab for readonly doc.
+ SetStyle((nStyle & ~WB_INSERTTAB));
+ else
+ SetStyle((nStyle | WB_INSERTTAB));
+}
+
void ScTabControl::UpdateStatus()
{
ScDocument* pDoc = pViewData->GetDocument();
@@ -297,7 +317,7 @@ void ScTabControl::UpdateStatus()
SCTAB nMaxCnt = Max( nCount, static_cast<SCTAB>(GetMaxId()) );
Color aTabBgColor;
- sal_Bool bModified = sal_False; // Tabellen-Namen
+ sal_Bool bModified = false; // Tabellen-Namen
for (i=0; i<nMaxCnt && !bModified; i++)
{
if (pDoc->IsVisible(i))
@@ -340,7 +360,7 @@ void ScTabControl::UpdateStatus()
if (bActive)
{
- bModified = sal_False; // Selektion
+ bModified = false; // Selektion
for (i=0; i<nMaxCnt && !bModified; i++)
if ( rMark.GetTableSelect(i) != IsPageSelected(static_cast<sal_uInt16>(i)+1) )
bModified = sal_True;
@@ -358,26 +378,12 @@ void ScTabControl::UpdateStatus()
void ScTabControl::ActivateView(sal_Bool bActivate)
{
-// ScDocument* pDoc = pViewData->GetDocument();
ScMarkData& rMark = pViewData->GetMarkData();
-// ResetMark direkt in TabView
-// pDoc->ResetMark();
-
sal_uInt16 nCurId = GetCurPageId();
if (!nCurId) return; // kann vorkommen, wenn bei Excel-Import alles versteckt ist
sal_uInt16 nPage = nCurId - 1;
-// sal_uInt16 nCount = GetMaxId();
- /*
- sal_uInt16 i;
- for (i=0; i<nCount; i++)
- {
- SelectPage( i+1, sal_False );
- if (bActivate)
- rMark.SelectTable( i, sal_False );
- }
- */
if (bActivate)
{
SelectPage( nPage+1, sal_True );
@@ -499,7 +505,7 @@ sal_uInt16 lcl_DocShellNr( ScDocument* pDoc )
pShell = SfxObjectShell::GetNext( *pShell );
}
- DBG_ERROR("Dokument nicht gefunden");
+ OSL_FAIL("Dokument nicht gefunden");
return 0;
}
@@ -596,12 +602,12 @@ long ScTabControl::AllowRenaming()
// if the error message from this TabControl is currently visible,
// don't end edit mode now, to avoid problems when returning to
// the other call (showing the error) - this should not happen
- DBG_ERROR("ScTabControl::AllowRenaming: nested calls");
+ OSL_FAIL("ScTabControl::AllowRenaming: nested calls");
nRet = TABBAR_RENAMING_NO;
}
else if ( Application::IsInModalMode() )
{
- // #73472# don't show error message above any modal dialog
+ // don't show error message above any modal dialog
// instead cancel renaming without error message
nRet = TABBAR_RENAMING_CANCEL;
}
@@ -609,7 +615,7 @@ long ScTabControl::AllowRenaming()
{
bErrorShown = sal_True;
pViewSh->ErrorMessage( STR_INVALIDTABNAME );
- bErrorShown = sal_False;
+ bErrorShown = false;
nRet = TABBAR_RENAMING_NO;
}
}
@@ -636,3 +642,4 @@ void ScTabControl::Mirror()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabpopsh.cxx b/sc/source/ui/view/tabpopsh.cxx
index f5033d5d0df5..bb610ada84c0 100644
--- a/sc/source/ui/view/tabpopsh.cxx
+++ b/sc/source/ui/view/tabpopsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,5 @@ void ScTabPopShell::DummyExec( SfxRequest& rReq )
void ScTabPopShell::DummyState( SfxItemSet& rSet )
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabsplit.cxx b/sc/source/ui/view/tabsplit.cxx
index 9007d627cda5..e60809da9d51 100644
--- a/sc/source/ui/view/tabsplit.cxx
+++ b/sc/source/ui/view/tabsplit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,8 +45,8 @@ ScTabSplitter::ScTabSplitter( Window* pParent, WinBits nWinStyle, ScViewData* pD
Splitter( pParent, nWinStyle ),
pViewData(pData)
{
- SetFixed(sal_False);
- EnableRTL( sal_False );
+ SetFixed(false);
+ EnableRTL( false );
}
@@ -53,7 +54,7 @@ ScTabSplitter::~ScTabSplitter()
{
}
-void __EXPORT ScTabSplitter::MouseMove( const MouseEvent& rMEvt )
+void ScTabSplitter::MouseMove( const MouseEvent& rMEvt )
{
if (bFixed)
Window::MouseMove( rMEvt );
@@ -61,7 +62,7 @@ void __EXPORT ScTabSplitter::MouseMove( const MouseEvent& rMEvt )
Splitter::MouseMove( rMEvt );
}
-void __EXPORT ScTabSplitter::MouseButtonUp( const MouseEvent& rMEvt )
+void ScTabSplitter::MouseButtonUp( const MouseEvent& rMEvt )
{
if (bFixed)
Window::MouseButtonUp( rMEvt );
@@ -69,7 +70,7 @@ void __EXPORT ScTabSplitter::MouseButtonUp( const MouseEvent& rMEvt )
Splitter::MouseButtonUp( rMEvt );
}
-void __EXPORT ScTabSplitter::MouseButtonDown( const MouseEvent& rMEvt )
+void ScTabSplitter::MouseButtonDown( const MouseEvent& rMEvt )
{
if (bFixed)
Window::MouseButtonDown( rMEvt );
@@ -77,7 +78,7 @@ void __EXPORT ScTabSplitter::MouseButtonDown( const MouseEvent& rMEvt )
Splitter::MouseButtonDown( rMEvt );
}
-void __EXPORT ScTabSplitter::Splitting( Point& rSplitPos )
+void ScTabSplitter::Splitting( Point& rSplitPos )
{
Window* pParent = GetParent();
Point aScreenPos = pParent->OutputToNormalizedScreenPixel( rSplitPos );
@@ -103,3 +104,4 @@ void ScTabSplitter::SetFixed(sal_Bool bSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 83bf1a4c9c12..a00c71b95918 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,36 +31,6 @@
//------------------------------------------------------------------
-
-#if 0
-#define _MACRODLG_HXX
-#define _BIGINT_HXX
-#define _SVCONTNR_HXX
-#define BASIC_NODIALOGS
-#define _SFXMNUITEM_HXX
-#define _SVDXOUT_HXX
-#define _SVDATTR_HXX
-#define _SFXMNUITEM_HXX
-#define _DLGCFG_HXX
-#define _SFXMNUMGR_HXX
-#define _SFXBASIC_HXX
-#define _MODALDLG_HXX
-#define _SFX_TEMPLDLG_HXX
-#define _SFXSTBMGR_HXX
-#define _SFXTBXMGR_HXX
-#define _BASE_DLGS_HXX
-#define _SFXIMGMGR_HXX
-#define _SFXMNUMGR_HXX
-#define _SFXSTBITEM_HXX
-#define _SFXTBXCTRL_HXX
-#define _PASSWD_HXX
-//#define _SFXFILEDLG_HXX
-//#define _SFXREQUEST_HXX
-#define _SFXOBJFACE_HXX
-
-#define _SDR_NOTRANSFORM
-#define _SVDXOUT_HXX
-#endif
#include <vcl/svapp.hxx>
///////////////////////////////////////////////////////////////////////////
@@ -68,31 +39,12 @@
// Die u.a. Aenderungen nehmen vorgeschlagene Konstante vorweg
///////////////////////////////////////////////////////////////////////////
-#if 0
-#define _SDR_NOTRANSFORM // Transformationen, selten verwendet
-#define _SDR_NOTOUCH // Hit-Tests, selten verwendet
-
-#define _SDR_NOUNDO // Undo-Objekte
-#define _SDR_NOPAGEOBJ // SdrPageObj
-#define _SDR_NOVIRTOBJ // SdrVirtObj
-#define _SDR_NOGROUPOBJ // SdrGroupObj
-#define _SDR_NOTEXTOBJ // SdrTextObj
-#define _SDR_NOPATHOBJ // SdrPathObj
-#define _SDR_NOEDGEOBJ // SdrEdgeObj
-#define _SDR_NORECTOBJ // SdrRectObj
-#define _SDR_NOCAPTIONOBJ // SdrCaptionObj
-#define _SDR_NOCIRCLEOBJ // SdrCircleObj
-#define _SDR_NOGRAFOBJ // SdrGrafObj
-#define _SDR_NOOLE2OBJ // SdrOle2Obj
-#endif
-
// Dieses define entfernt die VCControls aus SI.HXX
#define _SI_HXX // VCControls
////////////////////// Umsetzen der Standard-Defines //////////////////////
-//#define _SVDDRAG_HXX // SdrDragStat
#define _SVDPAGE_HXX // SdrPage
#ifdef _SDR_NOSURROGATEOBJ
@@ -163,13 +115,8 @@
#undef _SVDORECT_HXX
#endif
-//#ifdef _SDR_NOVIEWS
-// #define _SVDDRAG_HXX
-//#endif
-
////////////////////// Ende der SVDRAW-Modifikationen /////////////////////
-
// INCLUDE ---------------------------------------------------------------
#include "scitems.hxx"
@@ -196,6 +143,7 @@
#include "viewuno.hxx"
#include "AccessibilityHints.hxx"
#include "appoptio.hxx"
+#include "attrib.hxx"
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
@@ -227,14 +175,14 @@ ScCornerButton::ScCornerButton( Window* pParent, ScViewData* pData, sal_Bool bAd
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
SetBackground( rStyleSettings.GetFaceColor() );
- EnableRTL( sal_False );
+ EnableRTL( false );
}
-__EXPORT ScCornerButton::~ScCornerButton()
+ScCornerButton::~ScCornerButton()
{
}
-void __EXPORT ScCornerButton::Paint( const Rectangle& rRect )
+void ScCornerButton::Paint( const Rectangle& rRect )
{
Size aSize = GetOutputSizePixel();
long nPosX = aSize.Width()-1;
@@ -247,7 +195,7 @@ void __EXPORT ScCornerButton::Paint( const Rectangle& rRect )
sal_Bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
long nDarkX = bLayoutRTL ? 0 : nPosX;
- if ( !bAdd && !rStyleSettings.GetHighContrastMode() )
+ if ( !bAdd )
{
// match the shaded look of column/row headers
@@ -300,12 +248,12 @@ void ScCornerButton::DataChanged( const DataChangedEvent& rDCEvt )
}
-void __EXPORT ScCornerButton::Resize()
+void ScCornerButton::Resize()
{
Invalidate();
}
-void __EXPORT ScCornerButton::MouseButtonDown( const MouseEvent& rMEvt )
+void ScCornerButton::MouseButtonDown( const MouseEvent& rMEvt )
{
ScModule* pScMod = SC_MOD();
sal_Bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
@@ -331,7 +279,7 @@ sal_Bool lcl_HasColOutline( const ScViewData& rViewData )
if ( pArray->GetDepth() > 0 )
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool lcl_HasRowOutline( const ScViewData& rViewData )
@@ -343,7 +291,7 @@ sal_Bool lcl_HasRowOutline( const ScViewData& rViewData )
if ( pArray->GetDepth() > 0 )
return sal_True;
}
- return sal_False;
+ return false;
}
//==================================================================
@@ -358,12 +306,12 @@ sal_Bool lcl_HasRowOutline( const ScViewData& rViewData )
pHdrSelEng( NULL ), \
aHdrFunc( &aViewData ), \
pDrawView( NULL ), \
- bDrawSelMode( sal_False ), \
+ bDrawSelMode( false ), \
aVScrollTop( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ), \
aVScrollBottom( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ), \
aHScrollLeft( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ), \
aHScrollRight( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ), \
- aCornerButton( pFrameWin, &aViewData, sal_False ), \
+ aCornerButton( pFrameWin, &aViewData, false ), \
aTopButton( pFrameWin, &aViewData, sal_True ), \
aScrollBarBox( pFrameWin, WB_SIZEABLE ), \
pInputHintWindow( NULL ), \
@@ -371,21 +319,20 @@ sal_Bool lcl_HasRowOutline( const ScViewData& rViewData )
pHighlightRanges( NULL ), \
pBrushDocument( NULL ), \
pDrawBrushSet( NULL ), \
- bLockPaintBrush( sal_False ), \
+ bLockPaintBrush( false ), \
pTimerWindow( NULL ), \
nTipVisible( 0 ), \
- bDragging( sal_False ), \
- bIsBlockMode( sal_False ), \
- bBlockNeg( sal_False ), \
- bBlockCols( sal_False ), \
- bBlockRows( sal_False ), \
+ bDragging( false ), \
+ bIsBlockMode( false ), \
+ bBlockNeg( false ), \
+ bBlockCols( false ), \
+ bBlockRows( false ), \
mfPendingTabBarWidth( -1.0 ), \
- bMinimized( sal_False ), \
- bInUpdateHeader( sal_False ), \
- bInActivatePart( sal_False ), \
- bInZoomUpdate( sal_False ), \
- bMoveIsShift( sal_False ), \
- bNewStartIfMarking( sal_False )
+ bMinimized( false ), \
+ bInUpdateHeader( false ), \
+ bInActivatePart( false ), \
+ bInZoomUpdate( false ), \
+ bMoveIsShift( false )
ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) :
@@ -398,22 +345,6 @@ ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pView
Init();
}
-//UNUSED2009-05 ScTabView::ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell ) :
-//UNUSED2009-05 pFrameWin( pParent ),
-//UNUSED2009-05 aViewData( rScTabView.aViewData ),
-//UNUSED2009-05 TABVIEW_INIT
-//UNUSED2009-05 {
-//UNUSED2009-05 RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScTabView::ScTabView" );
-//UNUSED2009-05
-//UNUSED2009-05 aViewData.SetViewShell( pViewShell );
-//UNUSED2009-05 Init();
-//UNUSED2009-05
-//UNUSED2009-05 UpdateShow();
-//UNUSED2009-05 if ( aViewData.GetActivePart() != SC_SPLIT_BOTTOMLEFT )
-//UNUSED2009-05 pGridWin[SC_SPLIT_BOTTOMLEFT]->Show();
-//UNUSED2009-05
-//UNUSED2009-05 InvalidateSplit();
-//UNUSED2009-05 }
void ScTabView::InitScrollBar( ScrollBar& rScrollBar, long nMaxVal )
{
@@ -443,7 +374,6 @@ void ScTabView::ResetTimer()
IMPL_LINK( ScTabView, TimerHdl, Timer*, EMPTYARG )
{
-// aScrollTimer.Stop();
if (pTimerWindow)
pTimerWindow->MouseMove( aTimerMEvt );
@@ -493,12 +423,12 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn
// Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden:
SfxScrollingMode eMode = aViewData.GetViewShell()->GetScrollingMode();
if ( eMode == SCROLLING_NO )
- bHScroll = bVScroll = sal_False;
+ bHScroll = bVScroll = false;
else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO ) //! Auto ???
bHScroll = bVScroll = sal_True;
if ( aViewData.GetDocShell()->IsPreview() )
- bHScroll = bVScroll = bTabControl = bHeaders = bOutlMode = bHOutline = bVOutline = sal_False;
+ bHScroll = bVScroll = bTabControl = bHeaders = bOutlMode = bHOutline = bVOutline = false;
long nBarX = 0;
long nBarY = 0;
@@ -511,7 +441,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn
long nPosY = rOffset.Y();
long nSizeX = rSize.Width();
long nSizeY = rSize.Height();
- long nSize1;
bMinimized = ( nSizeX<=SC_ICONSIZE || nSizeY<=SC_ICONSIZE );
if ( bMinimized )
@@ -536,7 +465,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn
if ( WhichH( aViewData.GetActivePart() ) == SC_SPLIT_RIGHT )
ActivatePart( SC_SPLIT_BOTTOMLEFT );
InvalidateSplit();
-// UpdateShow();
}
if ( aViewData.GetVSplitMode() != SC_SPLIT_NONE )
if ( aViewData.GetVSplitPos() > nSizeY - SPLIT_MARGIN )
@@ -545,7 +473,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn
if ( WhichV( aViewData.GetActivePart() ) == SC_SPLIT_TOP )
ActivatePart( SC_SPLIT_BOTTOMLEFT );
InvalidateSplit();
-// UpdateShow();
}
UpdateShow();
@@ -555,13 +482,11 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn
long nScrollBarSize = pFrameWin->GetSettings().GetStyleSettings().GetScrollBarSize();
if (bVScroll)
{
-// nBarX = aVScrollBottom.GetSizePixel().Width();
nBarX = nScrollBarSize;
nSizeX -= nBarX - nOverlap;
}
if (bHScroll)
{
-// nBarY = aHScrollLeft.GetSizePixel().Height();
nBarY = nScrollBarSize;
nSizeY -= nBarY - nOverlap;
}
@@ -682,7 +607,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn
nBarY = aHScrollLeft.GetSizePixel().Height();
nBarX = aVScrollBottom.GetSizePixel().Width();
- nSize1 = nSizeX + nOverlap;
+ long nSize1 = nSizeX + nOverlap;
long nTabSize = nSize1;
if (nTabSize < 0) nTabSize = 0;
@@ -876,7 +801,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn
UpdateScrollBars(); // Scrollbars nicht beim Scrollen neu setzen
UpdateHeaderWidth();
- InterpretVisible(); // #69343# have everything calculated before painting
+ InterpretVisible(); // have everything calculated before painting
}
if (bHasHint)
@@ -904,20 +829,20 @@ void ScTabView::UpdateVarZoom()
if ( aNew != rOldX || aNew != rOldY )
{
- SetZoom( aNew, aNew, sal_False ); // always separately per sheet
+ SetZoom( aNew, aNew, false ); // always separately per sheet
PaintGrid();
PaintTop();
PaintLeft();
aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
}
- bInZoomUpdate = sal_False;
+ bInZoomUpdate = false;
}
}
void ScTabView::UpdateFixPos()
{
- sal_Bool bResize = sal_False;
+ sal_Bool bResize = false;
if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX )
if (aViewData.UpdateFixX())
bResize = sal_True;
@@ -925,7 +850,7 @@ void ScTabView::UpdateFixPos()
if (aViewData.UpdateFixY())
bResize = sal_True;
if (bResize)
- RepeatResize(sal_False);
+ RepeatResize(false);
}
void ScTabView::RepeatResize( sal_Bool bUpdateFix )
@@ -992,7 +917,7 @@ IMPL_LINK( ScTabView, TabBarResize, void*, EMPTYARG )
// Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden:
SfxScrollingMode eMode = aViewData.GetViewShell()->GetScrollingMode();
if ( eMode == SCROLLING_NO )
- bHScrollMode = sal_False;
+ bHScrollMode = false;
else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO ) //! Auto ???
bHScrollMode = sal_True;
@@ -1079,17 +1004,8 @@ void ScTabView::SetActivePointer( const Pointer& rPointer )
for (sal_uInt16 i=0; i<4; i++)
if (pGridWin[i])
pGridWin[i]->SetPointer( rPointer );
-
-/* ScSplitPos ePos = aViewData.GetActivePart();
- if (pGridWin[ePos])
- pGridWin[ePos]->SetPointer( rPointer );
-*/
}
-//UNUSED2008-05 void ScTabView::SetActivePointer( const ResId& )
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ERRORFILE( "keine Pointer mit ResId!" );
-//UNUSED2008-05 }
void ScTabView::ActiveGrabFocus()
{
@@ -1098,28 +1014,6 @@ void ScTabView::ActiveGrabFocus()
pGridWin[ePos]->GrabFocus();
}
-//UNUSED2008-05 void ScTabView::ActiveCaptureMouse()
-//UNUSED2008-05 {
-//UNUSED2008-05 ScSplitPos ePos = aViewData.GetActivePart();
-//UNUSED2008-05 if (pGridWin[ePos])
-//UNUSED2008-05 pGridWin[ePos]->CaptureMouse();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void ScTabView::ActiveReleaseMouse()
-//UNUSED2008-05 {
-//UNUSED2008-05 ScSplitPos ePos = aViewData.GetActivePart();
-//UNUSED2008-05 if (pGridWin[ePos])
-//UNUSED2008-05 pGridWin[ePos]->ReleaseMouse();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 Point ScTabView::ActivePixelToLogic( const Point& rDevicePoint )
-//UNUSED2008-05 {
-//UNUSED2008-05 ScSplitPos ePos = aViewData.GetActivePart();
-//UNUSED2008-05 if (pGridWin[ePos])
-//UNUSED2008-05 return pGridWin[ePos]->PixelToLogic(rDevicePoint);
-//UNUSED2008-05 else
-//UNUSED2008-05 return Point();
-//UNUSED2008-05 }
ScSplitPos ScTabView::FindWindow( Window* pWindow ) const
{
@@ -1165,7 +1059,7 @@ sal_Bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
{
HideNoteMarker();
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
const CommandWheelData* pData = rCEvt.GetWheelData();
if ( pData && pData->GetMode() == COMMAND_WHEEL_ZOOM )
{
@@ -1238,11 +1132,11 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
else // VScroll...
{
ScVSplitPos eWhich = (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
- long nDelta = GetScrollBarPos( *pScroll, sal_False ) + nScrollMin - aViewData.GetPosY(eWhich);
+ long nDelta = GetScrollBarPos( *pScroll, false ) + nScrollMin - aViewData.GetPosY(eWhich);
if (nDelta) ScrollY( nDelta, eWhich );
}
}
- bDragging = sal_False;
+ bDragging = false;
}
return 0;
}
@@ -1677,7 +1571,7 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY
// auf VCL gibt's Update ohne Ende (jedes Update gilt fuer alle Fenster)
//aCornerButton.Update(); // der bekommt sonst nie ein Update
- bInUpdateHeader = sal_False;
+ bInUpdateHeader = false;
}
}
@@ -1704,12 +1598,12 @@ void ScTabView::UpdateShow()
// Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden:
SfxScrollingMode eMode = aViewData.GetViewShell()->GetScrollingMode();
if ( eMode == SCROLLING_NO )
- bHScrollMode = bVScrollMode = sal_False;
+ bHScrollMode = bVScrollMode = false;
else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO ) //! Auto ???
bHScrollMode = bVScrollMode = sal_True;
if ( aViewData.GetDocShell()->IsPreview() )
- bHScrollMode = bVScrollMode = bTabMode = bHeader = bOutlMode = bHOutline = bVOutline = sal_False;
+ bHScrollMode = bVScrollMode = bTabMode = bHeader = bOutlMode = bHOutline = bVOutline = false;
//
// Windows anlegen
@@ -1781,6 +1675,17 @@ void ScTabView::UpdateShow()
//! neue Gridwindows eintragen
}
+void ScTabView::UpdateVisibleRange()
+{
+ for (int i = 0; i < 4; ++i)
+ {
+ if (!pGridWin[i] || !pGridWin[i]->IsVisible())
+ continue;
+
+ pGridWin[i]->UpdateVisibleRange();
+ }
+}
+
// --- Splitter --------------------------------------------------------
IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter )
@@ -1840,7 +1745,6 @@ void ScTabView::DoHSplit(long nSplitPos)
else
{
nOldDelta = aViewData.GetPosX( SC_SPLIT_LEFT );
-// aViewData.SetPosX( SC_SPLIT_LEFT, nOldDelta );
long nLeftWidth = nSplitPos - pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width();
if ( nLeftWidth < 0 ) nLeftWidth = 0;
nNewDelta = nOldDelta + aViewData.CellsAtX( nOldDelta, 1, SC_SPLIT_LEFT,
@@ -1856,7 +1760,7 @@ void ScTabView::DoHSplit(long nSplitPos)
SC_SPLIT_BOTTOMRIGHT : SC_SPLIT_TOPRIGHT );
}
- // #61410# Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen
+ // Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen
// dafuer muss hier schon der MapMode stimmen
for (sal_uInt16 i=0; i<4; i++)
if (pGridWin[i])
@@ -1928,7 +1832,7 @@ void ScTabView::DoVSplit(long nSplitPos)
SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT );
}
- // #61410# Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen
+ // Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen
// dafuer muss hier schon der MapMode stimmen
for (sal_uInt16 i=0; i<4; i++)
if (pGridWin[i])
@@ -2198,12 +2102,12 @@ sal_Bool lcl_MouseIsOverWin( const Point& rScreenPosPixel, Window* pWin )
aRel.Y() >= 0 && aRel.Y() < aWinSize.Height() + SPLIT_HANDLE_SIZE )
return sal_True;
}
- return sal_False;
+ return false;
}
void ScTabView::SnapSplitPos( Point& rScreenPosPixel )
{
- sal_Bool bOverWin = sal_False;
+ sal_Bool bOverWin = false;
sal_uInt16 i;
for (i=0; i<4; i++)
if (lcl_MouseIsOverWin(rScreenPosPixel,pGridWin[i]))
@@ -2212,7 +2116,7 @@ void ScTabView::SnapSplitPos( Point& rScreenPosPixel )
if (!bOverWin)
return;
- // #74761# don't snap to cells if the scale will be modified afterwards
+ // don't snap to cells if the scale will be modified afterwards
if ( GetZoomType() != SVX_ZOOM_PERCENT )
return;
@@ -2223,15 +2127,15 @@ void ScTabView::SnapSplitPos( Point& rScreenPosPixel )
Window* pWin = pGridWin[ePos];
if (!pWin)
{
- DBG_ERROR("Window NULL");
+ OSL_FAIL("Window NULL");
return;
}
Point aMouse = pWin->NormalizedScreenToOutputPixel( rScreenPosPixel );
SCsCOL nPosX;
SCsROW nPosY;
- // #52949# bNextIfLarge=FALSE: nicht auf naechste Zelle, wenn ausserhalb des Fensters
- aViewData.GetPosFromPixel( aMouse.X(), aMouse.Y(), ePos, nPosX, nPosY, sal_True, sal_False, sal_False );
+ // bNextIfLarge=FALSE: nicht auf naechste Zelle, wenn ausserhalb des Fensters
+ aViewData.GetPosFromPixel( aMouse.X(), aMouse.Y(), ePos, nPosX, nPosY, true, false, false );
sal_Bool bLeft;
sal_Bool bTop;
aViewData.GetMouseQuadrant( aMouse, ePos, nPosX, nPosY, bLeft, bTop );
@@ -2339,14 +2243,14 @@ void ScTabView::FreezeSplitters( sal_Bool bFreeze )
aViewData.SetVSplitMode( SC_SPLIT_NORMAL );
}
- // #61410# Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen
+ // Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen
// dafuer muss hier schon der MapMode stimmen
for (sal_uInt16 i=0; i<4; i++)
if (pGridWin[i])
pGridWin[i]->SetMapMode( pGridWin[i]->GetDrawMapMode() );
SetNewVisArea();
- RepeatResize(sal_False);
+ RepeatResize(false);
UpdateShow();
PaintLeft();
@@ -2422,7 +2326,7 @@ void ScTabView::InvalidateSplit()
void ScTabView::SetNewVisArea()
{
- // #63854# fuer die Controls muss bei VisAreaChanged der Draw-MapMode eingestellt sein
+ // fuer die Controls muss bei VisAreaChanged der Draw-MapMode eingestellt sein
// (auch wenn ansonsten der Edit-MapMode gesetzt ist)
MapMode aOldMode[4];
MapMode aDrawMode[4];
@@ -2476,7 +2380,7 @@ sal_Bool ScTabView::HasPageFieldDataAtCursor() const
if (pWin)
return pWin->GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE;
- return sal_False;
+ return false;
}
void ScTabView::StartDataSelect()
@@ -2495,14 +2399,22 @@ void ScTabView::StartDataSelect()
// no meaningful input is possible anyway, so this function
// can be used to select a page field entry.
pWin->LaunchPageFieldMenu( nCol, nRow );
- break;
+ return;
case sheet::DataPilotFieldOrientation_COLUMN:
case sheet::DataPilotFieldOrientation_ROW:
pWin->LaunchDPFieldMenu( nCol, nRow );
- break;
+ return;
default:
- pWin->DoAutoFilterMenue( nCol, nRow, sal_True );
+ ;
}
+
+ // Do autofilter if the current cell has autofilter button. Otherwise do
+ // a normal data select popup.
+ const ScMergeFlagAttr* pAttr = static_cast<const ScMergeFlagAttr*>(
+ aViewData.GetDocument()->GetAttr(
+ nCol, nRow, aViewData.GetTabNo(), ATTR_MERGE_FLAG));
+
+ pWin->DoAutoFilterMenue(nCol, nRow, !pAttr->HasAutoFilter());
}
void ScTabView::EnableRefInput(sal_Bool bFlag)
@@ -2518,18 +2430,18 @@ void ScTabView::EnableRefInput(sal_Bool bFlag)
if(pTabControl!=NULL) pTabControl->EnableInput(bFlag,sal_True);
if(pGridWin[SC_SPLIT_BOTTOMLEFT]!=NULL)
- pGridWin[SC_SPLIT_BOTTOMLEFT]->EnableInput(bFlag,sal_False);
+ pGridWin[SC_SPLIT_BOTTOMLEFT]->EnableInput(bFlag,false);
if(pGridWin[SC_SPLIT_BOTTOMRIGHT]!=NULL)
- pGridWin[SC_SPLIT_BOTTOMRIGHT]->EnableInput(bFlag,sal_False);
+ pGridWin[SC_SPLIT_BOTTOMRIGHT]->EnableInput(bFlag,false);
if(pGridWin[SC_SPLIT_TOPLEFT]!=NULL)
- pGridWin[SC_SPLIT_TOPLEFT]->EnableInput(bFlag,sal_False);
+ pGridWin[SC_SPLIT_TOPLEFT]->EnableInput(bFlag,false);
if(pGridWin[SC_SPLIT_TOPRIGHT]!=NULL)
- pGridWin[SC_SPLIT_TOPRIGHT]->EnableInput(bFlag,sal_False);
+ pGridWin[SC_SPLIT_TOPRIGHT]->EnableInput(bFlag,false);
if(pColBar[SC_SPLIT_RIGHT]!=NULL)
- pColBar[SC_SPLIT_RIGHT]->EnableInput(bFlag,sal_False);
+ pColBar[SC_SPLIT_RIGHT]->EnableInput(bFlag,false);
if(pRowBar[SC_SPLIT_TOP]!=NULL)
- pRowBar[SC_SPLIT_TOP]->EnableInput(bFlag,sal_False);
+ pRowBar[SC_SPLIT_TOP]->EnableInput(bFlag,false);
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 4fc575942feb..160945c72864 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,14 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
-// INCLUDE ---------------------------------------------------------------
-
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
-
-
#include <vcl/timer.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/app.hxx>
@@ -59,6 +54,7 @@
#include "waitoff.hxx"
#include "globstr.hrc"
#include "scmod.hxx"
+#include "tabprotection.hxx"
#define SC_BLOCKMODE_NONE 0
#define SC_BLOCKMODE_NORMAL 1
@@ -106,9 +102,8 @@ void ScTabView::InitOwnBlockMode()
ScMarkData& rMark = aViewData.GetMarkData();
if (!rMark.IsMarked() && !rMark.IsMultiMarked())
- GetSelEngine()->CursorPosChanging( sal_False, sal_False );
+ GetSelEngine()->CursorPosChanging( false, false );
-// bIsBlockMode = sal_True;
bIsBlockMode = SC_BLOCKMODE_OWN; //! Variable umbenennen!
nBlockStartX = 0;
nBlockStartY = 0;
@@ -143,10 +138,9 @@ void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
bBlockNeg = rMark.IsCellMarked( nCurX, nCurY );
}
else
- bBlockNeg = sal_False;
+ bBlockNeg = false;
rMark.SetMarkNegative(bBlockNeg);
-// bIsBlockMode = sal_True;
bIsBlockMode = SC_BLOCKMODE_NORMAL; //! Variable umbenennen!
bBlockCols = bCols;
bBlockRows = bRows;
@@ -171,20 +165,10 @@ void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
rMark.SetMarkArea( ScRange( nBlockStartX,nBlockStartY, nTab, nBlockEndX,nBlockEndY, nTab ) );
-#ifdef OLD_SELECTION_PAINT
- InvertBlockMark( nBlockStartX,nBlockStartY,nBlockEndX,nBlockEndY );
-#endif
UpdateSelectionOverlay();
-
- bNewStartIfMarking = sal_False; // use only once
}
}
-void ScTabView::SetNewStartIfMarking()
-{
- bNewStartIfMarking = sal_True;
-}
-
void ScTabView::DoneBlockMode( sal_Bool bContinue ) // Default FALSE
{
// Wenn zwischen Tabellen- und Header SelectionEngine gewechselt wird,
@@ -195,7 +179,7 @@ void ScTabView::DoneBlockMode( sal_Bool bContinue ) // Default FALSE
{
ScMarkData& rMark = aViewData.GetMarkData();
sal_Bool bFlag = rMark.GetMarkingFlag();
- rMark.SetMarking(sal_False);
+ rMark.SetMarking(false);
if (bBlockNeg && !bContinue)
rMark.MarkToMulti();
@@ -215,11 +199,10 @@ void ScTabView::DoneBlockMode( sal_Bool bContinue ) // Default FALSE
else
rMark.ResetMark();
}
-// bIsBlockMode = sal_False;
bIsBlockMode = SC_BLOCKMODE_NONE; //! Variable umbenennen!
rMark.SetMarking(bFlag);
- rMark.SetMarkNegative(sal_False);
+ rMark.SetMarkNegative(false);
}
}
@@ -231,8 +214,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
if (!bIsBlockMode)
{
- DBG_ERROR( "MarkCursor nicht im BlockMode" );
- InitBlockMode( nCurX, nCurY, nCurZ, sal_False, bCols, bRows );
+ OSL_FAIL( "MarkCursor nicht im BlockMode" );
+ InitBlockMode( nCurX, nCurY, nCurZ, false, bCols, bRows );
}
if (bCols)
@@ -253,8 +236,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
// oder nach InitOwnBlockMode wird mit Shift-Klick weitermarkiert...
sal_Bool bOldShift = bMoveIsShift;
- bMoveIsShift = sal_False; // wirklich umsetzen
- DoneBlockMode(sal_False); //! direkt Variablen setzen? (-> kein Geflacker)
+ bMoveIsShift = false; // wirklich umsetzen
+ DoneBlockMode(false); //! direkt Variablen setzen? (-> kein Geflacker)
bMoveIsShift = bOldShift;
InitBlockMode( aMarkRange.aStart.Col(), aMarkRange.aStart.Row(),
@@ -270,13 +253,6 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
SCTAB nTab = nCurZ;
-#ifdef OLD_SELECTION_PAINT
- SCCOL nDrawStartCol;
- SCROW nDrawStartRow;
- SCCOL nDrawEndCol;
- SCROW nDrawEndRow;
-#endif
-
// Set old selection area
ScUpdateRect aRect( nBlockStartX, nBlockStartY, nOldBlockEndX, nOldBlockEndY );
@@ -288,7 +264,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
SCsCOL nBlockStartXOffset = 0;
SCsROW nCurYOffset = 0;
SCsROW nBlockStartYOffset = 0;
- sal_Bool bBlockStartMerged = sal_False;
+ sal_Bool bBlockStartMerged = false;
const ScMergeAttr* pMergeAttr = NULL;
ScDocument* pDocument = aViewData.GetDocument();
@@ -379,36 +355,460 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
aRect.SetNew( nBlockStartX, nBlockStartY, nBlockEndX, nBlockEndY );
rMark.SetMarkArea( ScRange( nBlockStartX, nBlockStartY, nTab, nBlockEndX, nBlockEndY, nTab ) );
-#ifdef OLD_SELECTION_PAINT
- sal_Bool bCont;
- sal_Bool bDraw = aRect.GetXorDiff( nDrawStartCol, nDrawStartRow,
- nDrawEndCol, nDrawEndRow, bCont );
- if ( bDraw )
- {
-//? PutInOrder( nDrawStartCol, nDrawEndCol );
-//? PutInOrder( nDrawStartRow, nDrawEndRow );
-
- HideAllCursors();
- InvertBlockMark( nDrawStartCol, nDrawStartRow, nDrawEndCol, nDrawEndRow );
- if (bCont)
- {
- aRect.GetContDiff( nDrawStartCol, nDrawStartRow, nDrawEndCol, nDrawEndRow );
- InvertBlockMark( nDrawStartCol, nDrawStartRow, nDrawEndCol, nDrawEndRow );
- }
- ShowAllCursors();
- }
-#endif
UpdateSelectionOverlay();
+ SelectionChanged();
nOldCurX = nCurX;
nOldCurY = nCurY;
aViewData.GetViewShell()->UpdateInputHandler();
-// InvalidateAttribs();
}
if ( !bCols && !bRows )
- aHdrFunc.SetAnchorFlag( sal_False );
+ aHdrFunc.SetAnchorFlag( false );
+}
+
+void ScTabView::GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY)
+{
+ SCCOL nCurX;
+ SCROW nCurY;
+ if (aViewData.IsRefMode())
+ {
+ nCurX = aViewData.GetRefEndX();
+ nCurY = aViewData.GetRefEndY();
+ }
+ else if (IsBlockMode())
+ {
+ // block end position.
+ nCurX = nBlockEndX;
+ nCurY = nBlockEndY;
+ }
+ else
+ {
+ // cursor position
+ nCurX = aViewData.GetCurX();
+ nCurY = aViewData.GetCurY();
+ }
+
+ ScSplitPos eWhich = aViewData.GetActivePart();
+ ScHSplitPos eWhichX = WhichH( eWhich );
+ ScVSplitPos eWhichY = WhichV( eWhich );
+
+ SCsCOL nPageX;
+ SCsROW nPageY;
+ if (nMovX >= 0)
+ nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, 1, eWhichX )) * nMovX;
+ else
+ nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, -1, eWhichX )) * nMovX;
+
+ if (nMovY >= 0)
+ nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY )) * nMovY;
+ else
+ nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY )) * nMovY;
+
+ if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1;
+ if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1;
+
+ rPageX = nPageX;
+ rPageY = nPageY;
+}
+
+void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
+ SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode)
+{
+ SCCOL nNewX = -1;
+ SCROW nNewY = -1;
+ // current cursor position.
+ SCCOL nCurX = aViewData.GetCurX();
+ SCROW nCurY = aViewData.GetCurY();
+
+ if (aViewData.IsRefMode())
+ {
+ nNewX = aViewData.GetRefEndX();
+ nNewY = aViewData.GetRefEndY();
+ }
+ else if (IsBlockMode())
+ {
+ // block end position.
+ nNewX = nBlockEndX;
+ nNewY = nBlockEndY;
+ }
+ else
+ {
+ nNewX = nCurX;
+ nNewY = nCurY;
+ }
+
+ ScDocument* pDoc = aViewData.GetDocument();
+ SCTAB nTab = aViewData.GetTabNo();
+
+ // FindAreaPos kennt nur -1 oder 1 als Richtung
+
+ SCsCOLROW i;
+ if ( nMovX > 0 )
+ for ( i=0; i<nMovX; i++ )
+ pDoc->FindAreaPos( nNewX, nCurY, nTab, 1, 0 );
+ if ( nMovX < 0 )
+ for ( i=0; i<-nMovX; i++ )
+ pDoc->FindAreaPos( nNewX, nCurY, nTab, -1, 0 );
+ if ( nMovY > 0 )
+ for ( i=0; i<nMovY; i++ )
+ pDoc->FindAreaPos( nCurX, nNewY, nTab, 0, 1 );
+ if ( nMovY < 0 )
+ for ( i=0; i<-nMovY; i++ )
+ pDoc->FindAreaPos( nCurX, nNewY, nTab, 0, -1 );
+
+ if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen
+ {
+ if (nMovX != 0 && nNewX == MAXCOL)
+ eMode = SC_FOLLOW_LINE;
+ if (nMovY != 0 && nNewY == MAXROW)
+ eMode = SC_FOLLOW_LINE;
+ }
+
+ if (aViewData.IsRefMode())
+ {
+ rAreaX = nNewX - aViewData.GetRefEndX();
+ rAreaY = nNewY - aViewData.GetRefEndY();
+ }
+ else if (IsBlockMode())
+ {
+ rAreaX = nNewX - nBlockEndX;
+ rAreaY = nNewY - nBlockEndY;
+ }
+ else
+ {
+ rAreaX = nNewX - nCurX;
+ rAreaY = nNewY - nCurY;
+ }
+ rMode = eMode;
+}
+
+void ScTabView::SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nMovX)
+{
+ ScDocument* pDoc = aViewData.GetDocument();
+ SCTAB nTab = aViewData.GetTabNo();
+
+ bool bSkipProtected = false, bSkipUnprotected = false;
+ ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ if (pProtect && pProtect->isProtected())
+ {
+ bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+ bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+ }
+
+ bool bSkipCell = false;
+ bool bHFlip = false;
+ do
+ {
+ bSkipCell = pDoc->ColHidden(rCurX, nTab) || pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
+ if (bSkipProtected && !bSkipCell)
+ bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+ if (bSkipUnprotected && !bSkipCell)
+ bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+
+ if (bSkipCell)
+ {
+ if (rCurX <= 0 || rCurX >= MAXCOL)
+ {
+ if (bHFlip)
+ {
+ rCurX = nOldX;
+ bSkipCell = false;
+ }
+ else
+ {
+ nMovX = -nMovX;
+ if (nMovX > 0)
+ ++rCurX;
+ else
+ --rCurX;
+ bHFlip = true;
+ }
+ }
+ else
+ if (nMovX > 0)
+ ++rCurX;
+ else
+ --rCurX;
+ }
+ }
+ while (bSkipCell);
+
+ if (pDoc->IsVerOverlapped(rCurX, rCurY, nTab))
+ {
+ aViewData.SetOldCursor(rCurX, rCurY);
+ while (pDoc->IsVerOverlapped(rCurX, rCurY, nTab))
+ --rCurY;
+ }
+}
+
+void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, SCsROW nMovY)
+{
+ ScDocument* pDoc = aViewData.GetDocument();
+ SCTAB nTab = aViewData.GetTabNo();
+
+ bool bSkipProtected = false, bSkipUnprotected = false;
+ ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ if (pProtect && pProtect->isProtected())
+ {
+ bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+ bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+ }
+
+ bool bSkipCell = false;
+ bool bVFlip = false;
+ do
+ {
+ SCROW nLastRow = -1;
+ bSkipCell = pDoc->RowHidden(rCurY, nTab, NULL, &nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab );
+ if (bSkipProtected && !bSkipCell)
+ bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+ if (bSkipUnprotected && !bSkipCell)
+ bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+
+ if (bSkipCell)
+ {
+ if (rCurY <= 0 || rCurY >= MAXROW)
+ {
+ if (bVFlip)
+ {
+ rCurY = nOldY;
+ bSkipCell = false;
+ }
+ else
+ {
+ nMovY = -nMovY;
+ if (nMovY > 0)
+ ++rCurY;
+ else
+ --rCurY;
+ bVFlip = true;
+ }
+ }
+ else
+ if (nMovY > 0)
+ ++rCurY;
+ else
+ --rCurY;
+ }
+ }
+ while (bSkipCell);
+
+ if (pDoc->IsHorOverlapped(rCurX, rCurY, nTab))
+ {
+ aViewData.SetOldCursor(rCurX, rCurY);
+ while (pDoc->IsHorOverlapped(rCurX, rCurY, nTab))
+ --rCurX;
+ }
+}
+
+namespace {
+
+bool isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked)
+{
+ bool bCellProtected = pDoc->HasAttrib(
+ nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_PROTECTED);
+
+ if (bCellProtected && !bSelectLocked)
+ return false;
+
+ if (!bCellProtected && !bSelectUnlocked)
+ return false;
+
+ return true;
+}
+
+void moveCursorByProtRule(
+ SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCTAB nTab, ScDocument* pDoc)
+{
+ bool bSelectLocked = true;
+ bool bSelectUnlocked = true;
+ ScTableProtection* pTabProtection = pDoc->GetTabProtection(nTab);
+ if (pTabProtection && pTabProtection->isProtected())
+ {
+ bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+ bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+ }
+
+ if (nMovX > 0)
+ {
+ if (rCol < MAXCOL)
+ {
+ for (SCCOL i = 0; i < nMovX; ++i)
+ {
+ if (!isCellQualified(pDoc, rCol+1, rRow, nTab, bSelectLocked, bSelectUnlocked))
+ break;
+ ++rCol;
+ }
+ }
+ }
+ else if (nMovX < 0)
+ {
+ if (rCol > 0)
+ {
+ nMovX = -nMovX;
+ for (SCCOL i = 0; i < nMovX; ++i)
+ {
+ if (!isCellQualified(pDoc, rCol-1, rRow, nTab, bSelectLocked, bSelectUnlocked))
+ break;
+ --rCol;
+ }
+ }
+ }
+
+ if (nMovY > 0)
+ {
+ if (rRow < MAXROW)
+ {
+ for (SCROW i = 0; i < nMovY; ++i)
+ {
+ if (!isCellQualified(pDoc, rCol, rRow+1, nTab, bSelectLocked, bSelectUnlocked))
+ break;
+ ++rRow;
+ }
+ }
+ }
+ else if (nMovY < 0)
+ {
+ if (rRow > 0)
+ {
+ nMovY = -nMovY;
+ for (SCROW i = 0; i < nMovY; ++i)
+ {
+ if (!isCellQualified(pDoc, rCol, rRow-1, nTab, bSelectLocked, bSelectUnlocked))
+ break;
+ --rRow;
+ }
+ }
+ }
+}
+
+}
+
+void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode)
+{
+ if (!nMovX && !nMovY)
+ // Nothing to do. Bail out.
+ return;
+
+ ScTabViewShell* pViewShell = aViewData.GetViewShell();
+ bool bRefInputMode = pViewShell && pViewShell->IsRefInputMode();
+ if (bRefInputMode && !aViewData.IsRefMode())
+ // initialize formula reference mode if it hasn't already.
+ InitRefMode(aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo(), SC_REFTYPE_REF);
+
+ ScDocument* pDoc = aViewData.GetDocument();
+
+ if (aViewData.IsRefMode())
+ {
+ // formula reference mode
+
+ SCCOL nNewX = aViewData.GetRefEndX();
+ SCROW nNewY = aViewData.GetRefEndY();
+ SCTAB nRefTab = aViewData.GetRefEndZ();
+
+ bool bSelectLocked = true;
+ bool bSelectUnlocked = true;
+ ScTableProtection* pTabProtection = pDoc->GetTabProtection(nRefTab);
+ if (pTabProtection && pTabProtection->isProtected())
+ {
+ bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+ bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+ }
+
+ moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, pDoc);
+
+ if (nMovX)
+ {
+ SCCOL nTempX = nNewX;
+ while (pDoc->IsHorOverlapped(nTempX, nNewY, nRefTab))
+ {
+ if (nMovX > 0)
+ ++nTempX;
+ else
+ --nTempX;
+ }
+ if (isCellQualified(pDoc, nTempX, nNewY, nRefTab, bSelectLocked, bSelectUnlocked))
+ nNewX = nTempX;
+ }
+
+ if (nMovY)
+ {
+ SCROW nTempY = nNewY;
+ while (pDoc->IsVerOverlapped(nNewX, nTempY, nRefTab))
+ {
+ if (nMovY > 0)
+ ++nTempY;
+ else
+ --nTempY;
+ }
+ if (isCellQualified(pDoc, nNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked))
+ nNewY = nTempY;
+ }
+
+ pDoc->SkipOverlapped(nNewX, nNewY, nRefTab);
+ UpdateRef(nNewX, nNewY, nRefTab);
+ AlignToCursor(nNewX, nNewY, eMode);
+ }
+ else
+ {
+ // normal selection mode
+
+ SCTAB nTab = aViewData.GetTabNo();
+
+ if (!IsBlockMode())
+ InitBlockMode(aViewData.GetCurX(), aViewData.GetCurY(), nTab, true);
+
+ moveCursorByProtRule(nBlockEndX, nBlockEndY, nMovX, nMovY, nTab, pDoc);
+
+ if (nBlockEndX < 0)
+ nBlockEndX = 0;
+ else if (nBlockEndX > MAXCOL)
+ nBlockEndX = MAXCOL;
+
+ if (nBlockEndY < 0)
+ nBlockEndY = 0;
+ else if (nBlockEndY > MAXROW)
+ nBlockEndY = MAXROW;
+
+ pDoc->SkipOverlapped(nBlockEndX, nBlockEndY, nTab);
+ MarkCursor(nBlockEndX, nBlockEndY, nTab, false, false, true);
+
+ // Check if the entire row(s) or column(s) are selected.
+ ScSplitPos eActive = aViewData.GetActivePart();
+ bool bRowSelected = (nBlockStartX == 0 && nBlockEndX == MAXCOL);
+ bool bColSelected = (nBlockStartY == 0 && nBlockEndY == MAXROW);
+ SCsCOL nAlignX = bRowSelected ? aViewData.GetPosX(WhichH(eActive)) : nBlockEndX;
+ SCsROW nAlignY = bColSelected ? aViewData.GetPosY(WhichV(eActive)) : nBlockEndY;
+ AlignToCursor(nAlignX, nAlignY, eMode);
+
+ SelectionChanged();
+ }
+}
+
+void ScTabView::ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY)
+{
+ SCsCOL nPageX;
+ SCsROW nPageY;
+ GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY);
+ ExpandBlock(nPageX, nPageY, SC_FOLLOW_FIX);
+}
+
+void ScTabView::ExpandBlockArea(SCsCOL nMovX, SCsROW nMovY)
+{
+ SCsCOL nAreaX;
+ SCsROW nAreaY;
+ ScFollowMode eMode;
+ GetAreaMoveEndPosition(nMovX, nMovY, SC_FOLLOW_JUMP, nAreaX, nAreaY, eMode);
+ ExpandBlock(nAreaX, nAreaY, eMode);
+}
+
+void ScTabView::UpdateCopySourceOverlay()
+{
+ for (sal_uInt8 i = 0; i < 4; ++i)
+ if (pGridWin[i] && pGridWin[i]->IsVisible())
+ pGridWin[i]->UpdateCopySourceOverlay();
}
void ScTabView::UpdateSelectionOverlay()
@@ -438,7 +838,6 @@ void ScTabView::UpdateAllOverlays()
void ScTabView::PaintBlock( sal_Bool bReset )
{
- ScDocument* pDoc = aViewData.GetDocument();
ScMarkData& rMark = aViewData.GetMarkData();
SCTAB nTab = aViewData.GetTabNo();
sal_Bool bMark = rMark.IsMarked();
@@ -450,14 +849,13 @@ void ScTabView::PaintBlock( sal_Bool bReset )
if (bMulti)
{
sal_Bool bFlag = rMark.GetMarkingFlag();
- rMark.SetMarking(sal_False);
+ rMark.SetMarking(false);
rMark.MarkToMulti();
rMark.GetMultiMarkArea(aMarkRange);
rMark.MarkToSimple();
rMark.SetMarking(bFlag);
bMark = rMark.IsMarked();
- bMulti = rMark.IsMultiMarked();
}
else
rMark.GetMarkArea(aMarkRange);
@@ -469,7 +867,7 @@ void ScTabView::PaintBlock( sal_Bool bReset )
nBlockEndY = aMarkRange.aEnd.Row();
nBlockEndZ = aMarkRange.aEnd.Tab();
- sal_Bool bDidReset = sal_False;
+ sal_Bool bDidReset = false;
if ( nTab>=nBlockStartZ && nTab<=nBlockEndZ )
{
@@ -478,63 +876,9 @@ void ScTabView::PaintBlock( sal_Bool bReset )
// Invertieren beim Loeschen nur auf aktiver View
if ( aViewData.IsActive() )
{
- sal_uInt16 i;
- if ( bMulti )
- {
-#ifdef OLD_SELECTION_PAINT
- for (i=0; i<4; i++)
- if (pGridWin[i] && pGridWin[i]->IsVisible())
- pGridWin[i]->InvertSimple( nBlockStartX, nBlockStartY,
- nBlockEndX, nBlockEndY,
- sal_True, sal_True );
-#endif
- rMark.ResetMark();
- UpdateSelectionOverlay();
- bDidReset = sal_True;
- }
- else
- {
-#ifdef OLD_SELECTION_PAINT
- // (mis)use InvertBlockMark to remove all of the selection
- // -> set bBlockNeg (like when removing parts of a selection)
- // and convert everything to Multi
-
- rMark.MarkToMulti();
- sal_Bool bOld = bBlockNeg;
- bBlockNeg = sal_True;
- // #73130# (negative) MarkArea must be set in case of repaint
- rMark.SetMarkArea( ScRange( nBlockStartX,nBlockStartY, nTab,
- nBlockEndX,nBlockEndY, nTab ) );
-
- InvertBlockMark( nBlockStartX, nBlockStartY, nBlockEndX, nBlockEndY );
-
- bBlockNeg = bOld;
-#endif
- rMark.ResetMark();
- UpdateSelectionOverlay();
- bDidReset = sal_True;
- }
-
- // repaint if controls are touched (#69680# in both cases)
- // #i74768# Forms are rendered by DrawingLayer's EndDrawLayers()
- static bool bSuppressControlExtraStuff(true);
-
- if(!bSuppressControlExtraStuff)
- {
- Rectangle aMMRect = pDoc->GetMMRect(nBlockStartX,nBlockStartY,nBlockEndX,nBlockEndY, nTab);
- if (pDoc->HasControl( nTab, aMMRect ))
- {
- for (i=0; i<4; i++)
- {
- if (pGridWin[i] && pGridWin[i]->IsVisible())
- {
- // MapMode muss logischer (1/100mm) sein !!!
- pDoc->InvalidateControls( pGridWin[i], nTab, aMMRect );
- pGridWin[i]->Update();
- }
- }
- }
- }
+ rMark.ResetMark();
+ UpdateSelectionOverlay();
+ bDidReset = true;
}
}
else
@@ -572,7 +916,6 @@ void ScTabView::SelectAllTables()
{
ScDocument* pDoc = aViewData.GetDocument();
ScMarkData& rMark = aViewData.GetMarkData();
-// SCTAB nTab = aViewData.GetTabNo();
SCTAB nCount = pDoc->GetTableCount();
if (nCount>1)
@@ -580,9 +923,6 @@ void ScTabView::SelectAllTables()
for (SCTAB i=0; i<nCount; i++)
rMark.SelectTable( i, sal_True );
- // Markierungen werden per Default nicht pro Tabelle gehalten
-// pDoc->ExtendMarksFromTable( nTab );
-
aViewData.GetDocShell()->PostPaintExtras();
SfxBindings& rBind = aViewData.GetBindings();
rBind.Invalidate( FID_FILL_TAB );
@@ -625,7 +965,7 @@ sal_Bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
{
nBlockX += (long)(nColTwips * fScaleX);
if (nBlockX > nWindowX)
- return sal_False;
+ return false;
}
}
for (nCol=nStartCol; nCol<=nEndCol; nCol++)
@@ -635,7 +975,7 @@ sal_Bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
{
nBlockX += (long)(nColTwips * fScaleX);
if (nBlockX > nWindowX)
- return sal_False;
+ return false;
}
}
@@ -651,7 +991,7 @@ sal_Bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
{
nBlockY += (long)(nRowTwips * fScaleY);
if (nBlockY > nWindowY)
- return sal_False;
+ return false;
}
}
for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
@@ -661,7 +1001,7 @@ sal_Bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
{
nBlockY += (long)(nRowTwips * fScaleY);
if (nBlockY > nWindowY)
- return sal_False;
+ return false;
}
}
@@ -849,7 +1189,7 @@ sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
break;
default:
- DBG_ERROR("Unknown Zoom-Revision");
+ OSL_FAIL("Unknown Zoom-Revision");
nZoom = 0;
}
@@ -980,3 +1320,4 @@ void ScTabView::UpdatePageBreakData( sal_Bool bForcePaint )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 19289e4cf703..28dab73660f6 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,6 +78,7 @@
#include "rangeutl.hxx"
#include "client.hxx"
#include "tabprotection.hxx"
+#include "formula/FormulaCompiler.hxx"
#include <com/sun/star/chart2/data/HighlightedRange.hpp>
@@ -118,16 +120,13 @@ void ScTabView::ClickCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bControl )
{
ScDocument* pDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
- while (pDoc->IsHorOverlapped( nPosX, nPosY, nTab )) //! ViewData !!!
- --nPosX;
- while (pDoc->IsVerOverlapped( nPosX, nPosY, nTab ))
- --nPosY;
+ pDoc->SkipOverlapped(nPosX, nPosY, nTab);
sal_Bool bRefMode = SC_MOD()->IsFormulaMode();
if ( bRefMode )
{
- DoneRefMode( sal_False );
+ DoneRefMode( false );
if (bControl)
SC_MOD()->AddRefEntry();
@@ -264,8 +263,12 @@ void ScTabView::InvalidateAttribs()
rBindings.Invalidate( SID_ALIGN_ANY_VCENTER );
rBindings.Invalidate( SID_ALIGN_ANY_BOTTOM );
-// rBindings.Invalidate( SID_RANGE_VALUE );
-// rBindings.Invalidate( SID_RANGE_FORMULA );
+ rBindings.Invalidate( SID_NUMBER_CURRENCY );
+ rBindings.Invalidate( SID_NUMBER_SCIENTIFIC );
+ rBindings.Invalidate( SID_NUMBER_DATE );
+ rBindings.Invalidate( SID_NUMBER_CURRENCY );
+ rBindings.Invalidate( SID_NUMBER_PERCENT );
+ rBindings.Invalidate( SID_NUMBER_TIME );
}
// SetCursor - Cursor setzen, zeichnen, InputWin updaten
@@ -396,7 +399,6 @@ void ScTabView::SelectionChanged()
rBindings.Invalidate( FID_MERGE_TOGGLE );
rBindings.Invalidate( SID_AUTOFILTER_HIDE );
rBindings.Invalidate( SID_UNFILTER );
-// rBindings.Invalidate( SID_IMPORT_DATA ); // jetzt wieder immer moeglich
rBindings.Invalidate( SID_REIMPORT_DATA );
rBindings.Invalidate( SID_REFRESH_DBAREA );
rBindings.Invalidate( SID_OUTLINE_SHOW );
@@ -436,7 +438,6 @@ void ScTabView::SelectionChanged()
rBindings.Invalidate( SID_INSERT_POSTIT );
rBindings.Invalidate( SID_CHARMAP );
rBindings.Invalidate( SID_OPENDLG_FUNCTION );
-// rBindings.Invalidate( FID_CONDITIONAL_FORMAT );
rBindings.Invalidate( SID_OPENDLG_CONDFRMT );
rBindings.Invalidate( FID_VALIDATION );
rBindings.Invalidate( SID_EXTERNAL_SOURCE );
@@ -474,7 +475,7 @@ void ScTabView::TestHintWindow()
{
// show input help window and list drop-down button for validity
- sal_Bool bListValButton = sal_False;
+ sal_Bool bListValButton = false;
ScAddress aListValPos;
ScDocument* pDoc = aViewData.GetDocument();
@@ -664,7 +665,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / 2;
// nSpaceY: desired start position of cell for FOLLOW_JUMP, modified if dialog interferes
- sal_Bool bForceNew = sal_False; // force new calculation of JUMP position (vertical only)
+ sal_Bool bForceNew = false; // force new calculation of JUMP position (vertical only)
// VisibleCellsY == CellsAtY( GetPosY( eWhichY ), 1, eWhichY )
@@ -679,7 +680,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
Window* pCare = lcl_GetCareWin( aViewData.GetViewShell()->GetViewFrame() );
if (pCare)
{
- sal_Bool bLimit = sal_False;
+ sal_Bool bLimit = false;
Rectangle aDlgPixel;
Size aWinSize;
Window* pWin = GetActiveWin();
@@ -708,7 +709,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if (bLimit)
{
- sal_Bool bBottom = sal_False;
+ sal_Bool bBottom = false;
long nTopSpace = aDlgPixel.Top();
long nBotSpace = aWinSize.Height() - aDlgPixel.Bottom();
if ( nBotSpace > 0 && nBotSpace > nTopSpace )
@@ -739,7 +740,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
SCsCOL nNewDeltaX = nDeltaX;
SCsROW nNewDeltaY = nDeltaY;
- sal_Bool bDoLine = sal_False;
+ sal_Bool bDoLine = false;
switch (eMode)
{
@@ -798,7 +799,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
case SC_FOLLOW_NONE:
break;
default:
- DBG_ERROR("Falscher Cursormodus");
+ OSL_FAIL("Falscher Cursormodus");
break;
}
@@ -860,20 +861,20 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
sal_Bool ScTabView::SelMouseButtonDown( const MouseEvent& rMEvt )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
// #i3875# *Hack*
- sal_Bool bMod1Locked = aViewData.GetViewShell()->GetLockedModifiers() & KEY_MOD1 ? sal_True : sal_False;
+ sal_Bool bMod1Locked = aViewData.GetViewShell()->GetLockedModifiers() & KEY_MOD1 ? sal_True : false;
aViewData.SetSelCtrlMouseClick( rMEvt.IsMod1() || bMod1Locked );
if ( pSelEngine )
{
bMoveIsShift = rMEvt.IsShift();
bRet = pSelEngine->SelMouseButtonDown( rMEvt );
- bMoveIsShift = sal_False;
+ bMoveIsShift = false;
}
- aViewData.SetSelCtrlMouseClick( sal_False ); // #i3875# *Hack*
+ aViewData.SetSelCtrlMouseClick( false ); // #i3875# *Hack*
return bRet;
}
@@ -895,27 +896,41 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
HideAllCursors();
- if ( bShift && bNewStartIfMarking && IsBlockMode() )
- {
- // used for ADD selection mode: start a new block from the cursor position
- DoneBlockMode( sal_True );
- InitBlockMode( aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo(), sal_True );
- }
-
// aktiven Teil umschalten jetzt in AlignToCursor
AlignToCursor( nCurX, nCurY, eMode );
//! auf OS/2: SC_FOLLOW_JUMP statt SC_FOLLOW_LINE, um Nachlaufen zu verhindern ???
if (bKeepSel)
+ {
SetCursor( nCurX, nCurY ); // Markierung stehenlassen
+
+ // If the cursor is in existing selection, it's a cursor movement by
+ // ENTER or TAB. If not, then it's a new selection during ADD
+ // selection mode.
+
+ const ScMarkData& rMark = aViewData.GetMarkData();
+ ScRangeList aSelList;
+ rMark.FillRangeListWithMarks(&aSelList, false);
+ if (!aSelList.In(ScRange(nCurX, nCurY, aViewData.GetTabNo())))
+ // Cursor not in existing selection. Start a new selection.
+ DoneBlockMode(true);
+ }
else
{
+ if (!bShift)
+ {
+ // Remove all marked data on cursor movement unless the Shift is locked.
+ ScMarkData aData(aViewData.GetMarkData());
+ aData.ResetMark();
+ SetMarkData(aData);
+ }
+
sal_Bool bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() );
bMoveIsShift = bShift;
pSelEngine->CursorPosChanging( bShift, bControl );
- bMoveIsShift = sal_False;
- aFunctionSet.SetCursorAtCell( nCurX, nCurY, sal_False );
+ bMoveIsShift = false;
+ aFunctionSet.SetCursorAtCell( nCurX, nCurY, false );
// Wenn der Cursor nicht bewegt wurde, muss das SelectionChanged fuer das
// Aufheben der Selektion hier einzeln passieren:
@@ -962,160 +977,31 @@ void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
nCurY = (nMovY != 0) ? nOldY+nMovY : (SCsROW) aViewData.GetOldCurY();
}
- sal_Bool bSkipCell = sal_False;
aViewData.ResetOldCursor();
if (nMovX != 0 && VALIDCOLROW(nCurX,nCurY))
- {
- sal_Bool bHFlip = sal_False;
- do
- {
- SCCOL nLastCol = -1;
- bSkipCell = pDoc->ColHidden(nCurX, nTab, nLastCol) || pDoc->IsHorOverlapped( nCurX, nCurY, nTab );
- if (bSkipProtected && !bSkipCell)
- bSkipCell = pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
- if (bSkipUnprotected && !bSkipCell)
- bSkipCell = !pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
-
- if (bSkipCell)
- {
- if ( nCurX<=0 || nCurX>=MAXCOL )
- {
- if (bHFlip)
- {
- nCurX = nOldX;
- bSkipCell = sal_False;
- }
- else
- {
- nMovX = -nMovX;
- if (nMovX > 0) ++nCurX; else --nCurX; // zuruecknehmen
- bHFlip = sal_True;
- }
- }
- else
- if (nMovX > 0) ++nCurX; else --nCurX;
- }
- }
- while (bSkipCell);
-
- if (pDoc->IsVerOverlapped( nCurX, nCurY, nTab ))
- {
- aViewData.SetOldCursor( nCurX,nCurY );
- while (pDoc->IsVerOverlapped( nCurX, nCurY, nTab ))
- --nCurY;
- }
- }
+ SkipCursorHorizontal(nCurX, nCurY, nOldX, nMovX);
if (nMovY != 0 && VALIDCOLROW(nCurX,nCurY))
- {
- sal_Bool bVFlip = sal_False;
- do
- {
- SCROW nLastRow = -1;
- bSkipCell = pDoc->RowHidden(nCurY, nTab, nLastRow) || pDoc->IsVerOverlapped( nCurX, nCurY, nTab );
- if (bSkipProtected && !bSkipCell)
- bSkipCell = pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
- if (bSkipUnprotected && !bSkipCell)
- bSkipCell = !pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
-
- if (bSkipCell)
- {
- if ( nCurY<=0 || nCurY>=MAXROW )
- {
- if (bVFlip)
- {
- nCurY = nOldY;
- bSkipCell = sal_False;
- }
- else
- {
- nMovY = -nMovY;
- if (nMovY > 0) ++nCurY; else --nCurY; // zuruecknehmen
- bVFlip = sal_True;
- }
- }
- else
- if (nMovY > 0) ++nCurY; else --nCurY;
- }
- }
- while (bSkipCell);
+ SkipCursorVertical(nCurX, nCurY, nOldY, nMovY);
- if (pDoc->IsHorOverlapped( nCurX, nCurY, nTab ))
- {
- aViewData.SetOldCursor( nCurX,nCurY );
- while (pDoc->IsHorOverlapped( nCurX, nCurY, nTab ))
- --nCurX;
- }
- }
-
- MoveCursorAbs( nCurX, nCurY, eMode, bShift, sal_False, sal_True, bKeepSel );
+ MoveCursorAbs( nCurX, nCurY, eMode, bShift, false, sal_True, bKeepSel );
}
void ScTabView::MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift, sal_Bool bKeepSel )
{
- SCCOL nCurX;
- SCROW nCurY;
- aViewData.GetMoveCursor( nCurX,nCurY );
-
- ScSplitPos eWhich = aViewData.GetActivePart();
- ScHSplitPos eWhichX = WhichH( eWhich );
- ScVSplitPos eWhichY = WhichV( eWhich );
-
SCsCOL nPageX;
SCsROW nPageY;
- if (nMovX >= 0)
- nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, 1, eWhichX )) * nMovX;
- else
- nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, -1, eWhichX )) * nMovX;
-
- if (nMovY >= 0)
- nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY )) * nMovY;
- else
- nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY )) * nMovY;
-
- if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1;
- if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1;
-
+ GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY);
MoveCursorRel( nPageX, nPageY, eMode, bShift, bKeepSel );
}
void ScTabView::MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift, sal_Bool bKeepSel )
{
- SCCOL nCurX;
- SCROW nCurY;
- aViewData.GetMoveCursor( nCurX,nCurY );
- SCCOL nNewX = nCurX;
- SCROW nNewY = nCurY;
-
- ScDocument* pDoc = aViewData.GetDocument();
- SCTAB nTab = aViewData.GetTabNo();
-
- // FindAreaPos kennt nur -1 oder 1 als Richtung
-
- SCsCOLROW i;
- if ( nMovX > 0 )
- for ( i=0; i<nMovX; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, 1, 0 );
- if ( nMovX < 0 )
- for ( i=0; i<-nMovX; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, -1, 0 );
- if ( nMovY > 0 )
- for ( i=0; i<nMovY; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, 1 );
- if ( nMovY < 0 )
- for ( i=0; i<-nMovY; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, -1 );
-
- if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen
- {
- if (nMovX != 0 && nNewX == MAXCOL)
- eMode = SC_FOLLOW_LINE;
- if (nMovY != 0 && nNewY == MAXROW)
- eMode = SC_FOLLOW_LINE;
- }
-
- MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY, eMode, bShift, bKeepSel );
+ SCsCOL nNewX;
+ SCsROW nNewY;
+ GetAreaMoveEndPosition(nMovX, nMovY, eMode, nNewX, nNewY, eMode);
+ MoveCursorRel(nNewX, nNewY, eMode, bShift, bKeepSel);
}
void ScTabView::MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift, sal_Bool bKeepSel )
@@ -1180,15 +1066,9 @@ void ScTabView::MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode
else if (nMovY>0)
nNewY=nPosY+nAddY;
-// aViewData.ResetOldCursor();
aViewData.SetOldCursor( nNewX,nNewY );
-
- while (pDoc->IsHorOverlapped( nNewX, nNewY, nTab ))
- --nNewX;
- while (pDoc->IsVerOverlapped( nNewX, nNewY, nTab ))
- --nNewY;
-
- MoveCursorAbs( nNewX, nNewY, eMode, bShift, sal_False, sal_True );
+ pDoc->SkipOverlapped(nNewX, nNewY, nTab);
+ MoveCursorAbs( nNewX, nNewY, eMode, bShift, false, true );
}
void ScTabView::MoveCursorEnter( sal_Bool bShift ) // bShift -> hoch/runter
@@ -1229,10 +1109,10 @@ void ScTabView::MoveCursorEnter( sal_Bool bShift ) // bShift -> hoch/ru
SCTAB nTab = aViewData.GetTabNo();
ScDocument* pDoc = aViewData.GetDocument();
- pDoc->GetNextPos( nNewX,nNewY, nTab, nMoveX,nMoveY, sal_True,sal_False, rMark );
+ pDoc->GetNextPos( nNewX,nNewY, nTab, nMoveX,nMoveY, sal_True,false, rMark );
MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY,
- SC_FOLLOW_LINE, sal_False, sal_True );
+ SC_FOLLOW_LINE, false, sal_True );
// update input line even if cursor was not moved
if ( nNewX == nCurX && nNewY == nCurY )
@@ -1253,7 +1133,7 @@ void ScTabView::MoveCursorEnter( sal_Bool bShift ) // bShift -> hoch/ru
}
}
- MoveCursorRel( nMoveX,nMoveY, SC_FOLLOW_LINE, sal_False );
+ MoveCursorRel( nMoveX,nMoveY, SC_FOLLOW_LINE, false );
}
}
@@ -1329,7 +1209,7 @@ sal_Bool ScTabView::MoveCursorKeyInput( const KeyEvent& rKeyEvent )
return sal_True;
}
- return sal_False;
+ return false;
}
@@ -1356,7 +1236,7 @@ void ScTabView::FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection )
nTabCol = nCurX; // auf diese Spalte zurueck bei Enter
MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY,
- SC_FOLLOW_LINE, sal_False, sal_True );
+ SC_FOLLOW_LINE, false, sal_True );
// in MoveCursorRel wird die TabCol zurueckgesetzt...
aViewData.SetTabStartCol( nTabCol );
@@ -1443,7 +1323,7 @@ void ScTabView::MarkMatrixFormula()
ScRange aMatrix;
if ( pDoc->GetMatrixFormulaRange( aCursor, aMatrix ) )
{
- MarkRange( aMatrix, sal_False ); // cursor is already within the range
+ MarkRange( aMatrix, false ); // cursor is already within the range
}
}
@@ -1458,9 +1338,11 @@ void ScTabView::MarkRange( const ScRange& rRange, sal_Bool bSetCursor, sal_Bool
{
SCCOL nAlignX = rRange.aStart.Col();
SCROW nAlignY = rRange.aStart.Row();
- if ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL )
+ bool bCol = ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL ) && !aViewData.GetDocument()->IsInVBAMode();
+ bool bRow = ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW );
+ if ( bCol )
nAlignX = aViewData.GetPosX(WhichH(aViewData.GetActivePart()));
- if ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW )
+ if ( bRow )
nAlignY = aViewData.GetPosY(WhichV(aViewData.GetActivePart()));
AlignToCursor( nAlignX, nAlignY, SC_FOLLOW_JUMP );
}
@@ -1471,11 +1353,7 @@ void ScTabView::MarkRange( const ScRange& rRange, sal_Bool bSetCursor, sal_Bool
SCCOL nPosX = rRange.aStart.Col();
SCROW nPosY = rRange.aStart.Row();
ScDocument* pDoc = aViewData.GetDocument();
-
- while (pDoc->IsHorOverlapped( nPosX, nPosY, nTab )) //! ViewData !!!
- --nPosX;
- while (pDoc->IsVerOverlapped( nPosX, nPosY, nTab ))
- --nPosY;
+ pDoc->SkipOverlapped(nPosX, nPosY, nTab);
aViewData.ResetOldCursor();
SetCursor( nPosX, nPosY );
@@ -1493,7 +1371,7 @@ void ScTabView::Unmark()
SCCOL nCurX;
SCROW nCurY;
aViewData.GetMoveCursor( nCurX,nCurY );
- MoveCursorAbs( nCurX, nCurY, SC_FOLLOW_NONE, sal_False, sal_False );
+ MoveCursorAbs( nCurX, nCurY, SC_FOLLOW_NONE, false, false );
SelectionChanged();
}
@@ -1544,7 +1422,7 @@ void ScTabView::SelectNextTab( short nDir, sal_Bool bExtendSelection )
}
}
- SetTabNo( nTab, sal_False, bExtendSelection );
+ SetTabNo( nTab, false, bExtendSelection );
PaintExtras();
}
@@ -1555,13 +1433,13 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
{
if ( !ValidTab(nTab) )
{
- DBG_ERROR("SetTabNo: falsche Tabelle");
+ OSL_FAIL("SetTabNo: falsche Tabelle");
return;
}
if ( nTab != aViewData.GetTabNo() || bNew )
{
- // #57724# Die FormShell moechte vor dem Umschalten benachrichtigt werden
+ // Die FormShell moechte vor dem Umschalten benachrichtigt werden
FmFormShell* pFormSh = aViewData.GetViewShell()->GetFormShell();
if (pFormSh)
{
@@ -1578,6 +1456,7 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
// nicht InputEnterHandler wegen Referenzeingabe !
ScDocument* pDoc = aViewData.GetDocument();
+
pDoc->MakeTable( nTab );
// Update pending row heights before switching the sheet, so Reschedule from the progress bar
@@ -1595,7 +1474,7 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
if (nTab>=nTabCount)
{
nTab = nOldPos;
- bUp = sal_False;
+ bUp = false;
}
}
@@ -1605,8 +1484,8 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
--nTab;
else
{
- DBG_ERROR("keine sichtbare Tabelle");
- pDoc->SetVisible( 0, sal_True );
+ OSL_FAIL("keine sichtbare Tabelle");
+ pDoc->SetVisible( 0, true );
}
}
}
@@ -1677,13 +1556,13 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
if ( bRefMode ) // hide EditView if necessary (after aViewData.SetTabNo !)
{
- for ( sal_uInt16 i=0; i<4; i++ )
- if ( pGridWin[i] )
- if ( pGridWin[i]->IsVisible() )
- pGridWin[i]->UpdateEditViewPos();
+ for (sal_uInt16 i = 0; i < 4; ++i)
+ if (pGridWin[i] && pGridWin[i]->IsVisible())
+ pGridWin[i]->UpdateEditViewPos();
}
- TabChanged( bSameTabButMoved ); // DrawView
+ TabChanged(); // DrawView
+ UpdateVisibleRange();
aViewData.GetViewShell()->WindowChanged(); // falls das aktive Fenster anders ist
if ( !bUnoRefDialog )
@@ -1725,7 +1604,7 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
// Fixierungen
- sal_Bool bResize = sal_False;
+ sal_Bool bResize = false;
if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX )
if (aViewData.UpdateFixX())
bResize = sal_True;
@@ -1739,7 +1618,7 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
if ( aViewData.IsPagebreakMode() )
UpdatePageBreakData(); //! asynchron ??
- // #53551# Form-Layer muss den sichtbaren Ausschnitt der neuen Tabelle kennen
+ // Form-Layer muss den sichtbaren Ausschnitt der neuen Tabelle kennen
// dafuer muss hier schon der MapMode stimmen
for (sal_uInt16 i=0; i<4; i++)
if (pGridWin[i])
@@ -1785,7 +1664,7 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW
DrawDeselectAll();
if (pDrawView)
- DrawEnableAnim( sal_False );
+ DrawEnableAnim( false );
EditView* pSpellingView = aViewData.GetSpellingView();
@@ -1802,7 +1681,7 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW
( nCol >= nScrX && nCol <= nScrX + aViewData.VisibleCellsX(eHWhich) + 1 &&
nRow >= nScrY && nRow <= nScrY + aViewData.VisibleCellsY(eVWhich) + 1 );
- // #102421# for the active part, create edit view even if outside the visible area,
+ // for the active part, create edit view even if outside the visible area,
// so input isn't lost (and the edit view may be scrolled into the visible area)
// #i26433# during spelling, the spelling view must be active
@@ -1813,6 +1692,7 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW
pGridWin[i]->DeleteCursorOverlay();
pGridWin[i]->DeleteAutoFillOverlay();
+ pGridWin[i]->DeleteCopySourceOverlay();
// flush OverlayManager before changing MapMode to text edit
pGridWin[i]->flushOverlayManager();
@@ -1846,7 +1726,7 @@ void ScTabView::UpdateEditView()
static_cast<ScEditEngineDefaulter*>(pEditView->GetEditEngine()),
pGridWin[i], GetViewData()->GetCurX(), GetViewData()->GetCurY() );
if ( (ScSplitPos)i == eActive )
- pEditView->ShowCursor( sal_False );
+ pEditView->ShowCursor( false );
}
}
@@ -1898,7 +1778,7 @@ void ScTabView::KillEditView( sal_Bool bNoPaint )
// GrabFocus immer dann, wenn diese View aktiv ist und
// die Eingabezeile den Focus hat
- sal_Bool bGrabFocus = sal_False;
+ sal_Bool bGrabFocus = false;
if (aViewData.IsActive())
{
ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
@@ -1931,7 +1811,6 @@ void ScTabView::KillEditView( sal_Bool bNoPaint )
{
pGridWin[i]->UpdateCursorOverlay();
pGridWin[i]->UpdateAutoFillOverlay();
- // pGridWin[i]->UpdateAllOverlays();
}
}
}
@@ -1977,7 +1856,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
{
ScHSplitPos eHWhich = WhichH( (ScSplitPos) i );
ScVSplitPos eVWhich = WhichV( (ScSplitPos) i );
- sal_Bool bOut = sal_False;
+ sal_Bool bOut = false;
nCol1 = nStartCol;
nRow1 = nStartRow;
@@ -1989,7 +1868,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
if (nCol1 < nScrX) nCol1 = nScrX;
if (nCol2 < nScrX)
{
- if ( eMode == SC_UPDATE_ALL ) // #91240# for UPDATE_ALL, paint anyway
+ if ( eMode == SC_UPDATE_ALL ) // for UPDATE_ALL, paint anyway
nCol2 = nScrX; // (because of extending strings to the right)
else
bOut = sal_True; // completely outside the window
@@ -2093,16 +1972,15 @@ void ScTabView::PaintRangeFinder( long nNumber )
// wegnehmen -> Repaint
// SC_UPDATE_MARKS: Invalidate, nicht bis zum Zeilenende
- sal_Bool bHiddenEdge = sal_False;
+ sal_Bool bHiddenEdge = false;
SCROW nTmp;
ScDocument* pDoc = aViewData.GetDocument();
- SCCOL nLastCol = -1;
- while ( nCol1 > 0 && pDoc->ColHidden(nCol1, nTab, nLastCol) )
+ while ( nCol1 > 0 && pDoc->ColHidden(nCol1, nTab) )
{
--nCol1;
bHiddenEdge = sal_True;
}
- while ( nCol2 < MAXCOL && pDoc->ColHidden(nCol2, nTab, nLastCol) )
+ while ( nCol2 < MAXCOL && pDoc->ColHidden(nCol2, nTab) )
{
++nCol2;
bHiddenEdge = sal_True;
@@ -2183,6 +2061,7 @@ void ScTabView::DoChartSelection(
const uno::Sequence< chart2::data::HighlightedRange > & rHilightRanges )
{
ClearHighlightRanges();
+ const sal_Unicode sep = ::formula::FormulaCompiler::GetNativeSymbol(ocSep).GetChar(0);
for( sal_Int32 i=0; i<rHilightRanges.getLength(); ++i )
{
@@ -2190,10 +2069,12 @@ void ScTabView::DoChartSelection(
ScRangeList aRangeList;
ScDocument* pDoc = aViewData.GetDocShell()->GetDocument();
if( ScRangeStringConverter::GetRangeListFromString(
- aRangeList, rHilightRanges[i].RangeRepresentation, pDoc, pDoc->GetAddressConvention(), ';' ))
+ aRangeList, rHilightRanges[i].RangeRepresentation, pDoc, pDoc->GetAddressConvention(), sep ))
{
- for ( ScRangePtr p = aRangeList.First(); p; p = aRangeList.Next())
+ size_t nListSize = aRangeList.size();
+ for ( size_t j = 0; j < nListSize; ++j )
{
+ ScRange* p = aRangeList[j];
if( rHilightRanges[i].Index == - 1 )
AddHighlightRange( *p, aSelColor );
else
@@ -2203,46 +2084,6 @@ void ScTabView::DoChartSelection(
}
}
-// DrawDragRect - Drag&Drop-Rechteck zeichnen (XOR)
-
-//UNUSED2008-05 void ScTabView::DrawDragRect( SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY,
-//UNUSED2008-05 ScSplitPos ePos )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX || aViewData.GetVSplitMode() == SC_SPLIT_FIX )
-//UNUSED2008-05 {
-//UNUSED2008-05 for (sal_uInt16 i=0; i<4; i++)
-//UNUSED2008-05 if (pGridWin[i])
-//UNUSED2008-05 if (pGridWin[i]->IsVisible())
-//UNUSED2008-05 pGridWin[i]->DrawDragRect( nStartX, nStartY, nEndX, nEndY );
-//UNUSED2008-05 }
-//UNUSED2008-05 else
-//UNUSED2008-05 pGridWin[ePos]->DrawDragRect( nStartX, nStartY, nEndX, nEndY );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 // PaintCell - einzelne Zelle neu zeichnen
-//UNUSED2008-05
-//UNUSED2008-05 void ScTabView::PaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( aViewData.GetTabNo() == nTab )
-//UNUSED2008-05 {
-//UNUSED2008-05 sal_uInt16 i;
-//UNUSED2008-05 for (i=0; i<4; i++)
-//UNUSED2008-05 if (pGridWin[i])
-//UNUSED2008-05 if (pGridWin[i]->IsVisible())
-//UNUSED2008-05 pGridWin[i]->Draw( nCol, nRow, nCol, nRow );
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void ScTabView::PaintLeftRow( SCROW nRow )
-//UNUSED2008-05 {
-//UNUSED2008-05 PaintLeftArea( nRow, nRow );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void ScTabView::PaintTopCol( SCCOL nCol )
-//UNUSED2008-05 {
-//UNUSED2008-05 PaintTopArea( nCol, nCol );
-//UNUSED2008-05 }
-
// PaintGrid - Datenbereiche neu zeichnen
void ScTabView::PaintGrid()
@@ -2380,92 +2221,9 @@ void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW nEndRow )
}
}
-// InvertBlockMark - Block invertieren
-
-void ScTabView::InvertBlockMark(SCCOL nStartX, SCROW nStartY,
- SCCOL nEndX, SCROW nEndY)
-{
- if ( !aViewData.IsActive() )
- return; // invertiert wird nur auf aktiver View
-
- PutInOrder( nStartX, nEndX );
- PutInOrder( nStartY, nEndY );
-
- ScMarkData& rMark = aViewData.GetMarkData();
- ScDocShell* pDocSh = aViewData.GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = aViewData.GetTabNo();
-
- if ( pDocSh->GetLockCount() )
- {
- // if paint is locked, avoid repeated inverting
- // add repaint areas to paint lock data instead
- pDocSh->PostPaint( nStartX,nStartY,nTab, nEndX,nEndY,nTab, PAINT_GRID );
- return;
- }
-
- sal_Bool bSingle = rMark.IsMultiMarked();
- sal_Bool bMerge = pDoc->HasAttrib( nStartX, nStartY, nTab, nEndX, nEndY, nTab,
- HASATTR_MERGED | HASATTR_OVERLAPPED );
-
- sal_uInt16 i;
- if ( bMerge || bSingle )
- {
- for (i=0; i<4; i++)
- if (pGridWin[i])
- if (pGridWin[i]->IsVisible())
- pGridWin[i]->InvertSimple( nStartX, nStartY, nEndX, nEndY,
- bMerge, bBlockNeg );
- }
- else
- {
- for (i=0; i<4; i++)
- if (pGridWin[i])
- if (pGridWin[i]->IsVisible())
- {
- ScSplitPos ePos = (ScSplitPos) i;
- Point aStartPoint = aViewData.GetScrPos( nStartX, nStartY, ePos );
- Point aEndPoint = aViewData.GetScrPos( nEndX+1, nEndY+1, ePos );
- if ( pDoc->IsLayoutRTL( nTab ) )
- {
- long nTemp = aStartPoint.X();
- aStartPoint.X() = aEndPoint.X() + 1; // +1 - excluding start of nEndX+1
- aEndPoint.X() = nTemp;
- }
- else
- aEndPoint.X() -= 1;
- aEndPoint.Y() -= 1;
- if ( aEndPoint.X() >= aStartPoint.X() && aEndPoint.Y() >= aStartPoint.Y() )
- {
- MapMode aOld = pGridWin[ePos]->GetMapMode();
- pGridWin[ePos]->SetMapMode(MAP_PIXEL);
- pGridWin[ePos]->Invert( Rectangle(aStartPoint,aEndPoint), INVERT_HIGHLIGHT );
- pGridWin[ePos]->SetMapMode(aOld);
- pGridWin[ePos]->CheckInverted();
- }
- }
- }
-
- //
- // wenn Controls betroffen, neu malen
- //
-
- sal_Bool bHide = sal_True; // wird Teil der Markierung aufgehoben ?
- if (rMark.IsMarked())
- {
- ScRange aMarkRange;
- rMark.GetMarkArea( aMarkRange );
- if ( aMarkRange.aStart.Col() <= nStartX && aMarkRange.aEnd.Col() >= nEndX &&
- aMarkRange.aStart.Row() <= nStartY && aMarkRange.aEnd.Row() >= nEndY )
- {
- bHide = sal_False; // der ganze Bereich ist markiert
- }
- }
-}
-
sal_Bool ScTabView::PaintExtras()
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
ScDocument* pDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
if (!pDoc->HasTable(nTab)) // Tabelle geloescht ?
@@ -2497,7 +2255,7 @@ void ScTabView::RecalcPPT()
Fraction aZoomX = aViewData.GetZoomX();
Fraction aZoomY = aViewData.GetZoomY();
- SetZoom( aZoomX, aZoomY, sal_False );
+ SetZoom( aZoomX, aZoomY, false );
PaintGrid();
if (bChangedX)
@@ -2531,9 +2289,7 @@ void ScTabView::ActivateView( sal_Bool bActivate, sal_Bool bFirst )
if (!bRefMode)
{
- //pScMod->InputEnterHandler();
-
- // #80843# pass view to GetInputHdl, this view may not be current anymore
+ // pass view to GetInputHdl, this view may not be current anymore
ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
if (pHdl)
pHdl->EnterHandler();
@@ -2544,16 +2300,13 @@ void ScTabView::ActivateView( sal_Bool bActivate, sal_Bool bFirst )
aViewData.Activate(bActivate);
- PaintBlock(sal_False); // Repaint, Markierung je nach Active-Status
+ PaintBlock(false); // Repaint, Markierung je nach Active-Status
if (!bActivate)
HideAllCursors(); // Cursor
else if (!bFirst)
ShowAllCursors();
- //HMHif (pDrawView)
- //HMH DrawShowMarkHdl(bActivate); // Drawing-Markierung
-
if (bActivate)
{
if ( bFirst )
@@ -2598,7 +2351,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
sal_Bool bRefMode = SC_MOD()->IsFormulaMode();
- // #40565# the HasEditView call during SetCursor would fail otherwise
+ // the HasEditView call during SetCursor would fail otherwise
if ( aViewData.HasEditView(eOld) && !bRefMode )
UpdateInputLine();
@@ -2639,7 +2392,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
if ( bTopCap && pColBar[eNewH] )
{
pColBar[eOldH]->SetIgnoreMove(sal_True);
- pColBar[eNewH]->SetIgnoreMove(sal_False);
+ pColBar[eNewH]->SetIgnoreMove(false);
pHdrSelEng->SetWindow( pColBar[eNewH] );
long nWidth = pColBar[eNewH]->GetOutputSizePixel().Width();
pHdrSelEng->SetVisibleArea( Rectangle( 0, LONG_MIN, nWidth-1, LONG_MAX ) );
@@ -2648,7 +2401,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
if ( bLeftCap && pRowBar[eNewV] )
{
pRowBar[eOldV]->SetIgnoreMove(sal_True);
- pRowBar[eNewV]->SetIgnoreMove(sal_False);
+ pRowBar[eNewV]->SetIgnoreMove(false);
pHdrSelEng->SetWindow( pRowBar[eNewV] );
long nHeight = pRowBar[eNewV]->GetOutputSizePixel().Height();
pHdrSelEng->SetVisibleArea( Rectangle( LONG_MIN, 0, LONG_MAX, nHeight-1 ) );
@@ -2662,7 +2415,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
SfxInPlaceClient* pClient = aViewData.GetViewShell()->GetIPClient();
sal_Bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
- // #103823# don't switch ViewShell's active window during RefInput, because the focus
+ // don't switch ViewShell's active window during RefInput, because the focus
// might change, and subsequent SetReference calls wouldn't find the right EditView
if ( !bRefMode && !bOleActive )
aViewData.GetViewShell()->SetWindow( pGridWin[eWhich] );
@@ -2671,11 +2424,10 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
{
// GrabFocus nur, wenn vorher das andere GridWindow den Focus hatte
// (z.B. wegen Suchen & Ersetzen)
-//! aViewData.GetViewShell()->GetViewFrame()->GetWindow().GrabFocus();
pGridWin[eWhich]->GrabFocus();
}
- bInActivatePart = sal_False;
+ bInActivatePart = false;
}
}
@@ -2691,6 +2443,9 @@ void ScTabView::UpdateInputContext()
ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()];
if (pWin)
pWin->UpdateInputContext();
+
+ if (pTabControl)
+ pTabControl->UpdateInputContext();
}
// GetGridWidth - Breite eines Ausgabebereichs (fuer ViewData)
@@ -2747,15 +2502,7 @@ void ScTabView::ZoomChanged()
SetNewVisArea();
- /* the old code
- ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()];
- if (pWin)
- {
- pWin->SetMapMode( pWin->GetDrawMapMode() ); // mit neuem Zoom
- SetNewVisArea(); // benutzt den gesetzten MapMode
- } */
-
- InterpretVisible(); // #69343# have everything calculated before painting
+ InterpretVisible(); // have everything calculated before painting
SfxBindings& rBindings = aViewData.GetBindings();
rBindings.Invalidate( SID_ATTR_ZOOM );
@@ -2771,7 +2518,7 @@ void ScTabView::ZoomChanged()
// flush OverlayManager before changing the MapMode
pWin->flushOverlayManager();
- // #93650# make sure the EditView's position and size are updated
+ // make sure the EditView's position and size are updated
// with the right (logic, not drawing) MapMode
pWin->SetMapMode( aViewData.GetLogicMode() );
UpdateEditView();
@@ -2790,3 +2537,4 @@ void ScTabView::CheckNeedsRepaint()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index b7fb4d717200..8f1fc44c6f85 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,7 +68,7 @@ void ScTabView::HideTip()
void ScTabView::ShowRefTip()
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
if ( aViewData.GetRefType() == SC_REFTYPE_REF && Help::IsQuickHelpEnabled() )
{
SCCOL nStartX = aViewData.GetRefStartX();
@@ -129,7 +130,7 @@ void ScTabView::StopRefMode()
{
if (aViewData.IsRefMode())
{
- aViewData.SetRefMode( sal_False, SC_REFTYPE_NONE );
+ aViewData.SetRefMode( false, SC_REFTYPE_NONE );
HideTip();
UpdateShrinkOverlay();
@@ -149,7 +150,7 @@ void ScTabView::StopRefMode()
}
pSelEngine->Reset();
- pSelEngine->SetAddMode( sal_False ); //! sollte das nicht bei Reset passieren?
+ pSelEngine->SetAddMode( false ); //! sollte das nicht bei Reset passieren?
ScSplitPos eOld = pSelEngine->GetWhich();
ScSplitPos eNew = aViewData.GetActivePart();
@@ -178,7 +179,7 @@ void ScTabView::DoneRefMode( sal_Bool bContinue )
SC_MOD()->AddRefEntry();
sal_Bool bWasRef = aViewData.IsRefMode();
- aViewData.SetRefMode( sal_False, SC_REFTYPE_NONE );
+ aViewData.SetRefMode( false, SC_REFTYPE_NONE );
HideTip();
UpdateShrinkOverlay();
@@ -333,15 +334,6 @@ void ScTabView::InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eT
}
}
-//UNUSED2008-05 void ScTabView::EndSelection()
-//UNUSED2008-05 {
-//UNUSED2008-05 ScModule* pScMod = SC_MOD();
-//UNUSED2008-05 sal_Bool bRefMode = pScMod->IsFormulaMode();
-//UNUSED2008-05 if ( bRefMode )
-//UNUSED2008-05 pScMod->EndReference();
-//UNUSED2008-05 }
-
-// static
void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, sal_Bool bLayoutRTL )
{
if ( nVisible == 0 )
@@ -365,7 +357,6 @@ void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible,
}
}
-// static
long ScTabView::GetScrollBarPos( ScrollBar& rScroll, sal_Bool bLayoutRTL )
{
if ( bLayoutRTL )
@@ -434,7 +425,7 @@ void ScTabView::UpdateScrollBars()
nVisYB = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
long nMaxYB = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_BOTTOM), nVisYB, MAXROW, nStartY );
- SetScrollBar( aVScrollBottom, nMaxYB, nVisYB, aViewData.GetPosY( SC_SPLIT_BOTTOM ) - nStartY, sal_False );
+ SetScrollBar( aVScrollBottom, nMaxYB, nVisYB, aViewData.GetPosY( SC_SPLIT_BOTTOM ) - nStartY, false );
if (bRight)
{
@@ -447,7 +438,7 @@ void ScTabView::UpdateScrollBars()
{
nVisYT = aViewData.VisibleCellsY( SC_SPLIT_TOP );
long nMaxYT = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_TOP), nVisYT, MAXROW, 0 );
- SetScrollBar( aVScrollTop, nMaxYT, nVisYT, aViewData.GetPosY( SC_SPLIT_TOP ), sal_False );
+ SetScrollBar( aVScrollTop, nMaxYT, nVisYT, aViewData.GetPosY( SC_SPLIT_TOP ), false );
}
// Bereich testen
@@ -571,3 +562,4 @@ void ScTabView::InterpretVisible()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index a20c73d04adf..ef2c621358b4 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,13 +73,13 @@ using namespace com::sun::star;
// STATIC DATA -----------------------------------------------------------
-void __EXPORT ScTabView::Init()
+void ScTabView::Init()
{
/* RTL layout of the view windows is done manually, because it depends on
the sheet orientation, not the UI setting. Note: controls that are
already constructed (e.g. scroll bars) have the RTL setting of the GUI.
Eventually this has to be disabled manually (see below). */
- pFrameWin->EnableRTL( sal_False );
+ pFrameWin->EnableRTL( false );
sal_uInt16 i;
@@ -147,7 +148,7 @@ void __EXPORT ScTabView::Init()
TestHintWindow();
}
-__EXPORT ScTabView::~ScTabView()
+ScTabView::~ScTabView()
{
sal_uInt16 i;
@@ -237,7 +238,7 @@ void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode )
SetDrawFuncPtr(new FuSelection( aViewData.GetViewShell(), GetActiveWin(), pDrawView,
pLayer,aSfxRequest));
- // #106334# used when switching back from page preview: restore saved design mode state
+ // used when switching back from page preview: restore saved design mode state
// (otherwise, keep the default from the draw view ctor)
if ( nForceDesignMode != SC_FORCEMODE_NONE )
pDrawView->SetDesignMode( (sal_Bool)nForceDesignMode );
@@ -285,7 +286,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
UpdateLayerLocks();
pDrawView->RecalcScale();
- pDrawView->UpdateWorkArea(); // #54782# PageSize ist pro Page unterschiedlich
+ pDrawView->UpdateWorkArea(); // PageSize ist pro Page unterschiedlich
for (i=0; i<4; i++)
if (pGridWin[i])
@@ -296,33 +297,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
// Es gibt keine einfache Moeglichkeit, alle Slots der FormShell zu invalidieren
// (fuer disablete Slots auf geschuetzten Tabellen), darum hier einfach alles...
- rBindings.InvalidateAll(sal_False);
-
-#if 0
- rBindings.Invalidate( SID_SELECT_SCENARIO );
- rBindings.Invalidate( FID_PROTECT_TABLE );
- rBindings.Invalidate( FID_DELETE_TABLE );
- rBindings.Invalidate( FID_TABLE_SHOW );
- rBindings.Invalidate( FID_TABLE_HIDE );
-
- // Auswirkungen von geschuetzten Tabellen.
- rBindings.Invalidate( FID_TAB_RENAME );
- rBindings.Invalidate( FID_TAB_MOVE );
- rBindings.Invalidate( SID_DEL_ROWS );
- rBindings.Invalidate( SID_DEL_COLS );
- rBindings.Invalidate( FID_INS_ROW );
- rBindings.Invalidate( FID_INS_COLUMN );
- rBindings.Invalidate( FID_INS_CELL );
- rBindings.Invalidate( FID_INS_CELLSDOWN );
- rBindings.Invalidate( FID_INS_CELLSRIGHT );
- rBindings.Invalidate( FID_DELETE_CELL );
-
- rBindings.Invalidate( SID_OPENDLG_CHART );
- rBindings.Invalidate( SID_INSERT_OBJECT );
- rBindings.Invalidate( SID_INSERT_DIAGRAM );
- rBindings.Invalidate( SID_INSERT_SMATH );
- rBindings.Invalidate( SID_INSERT_GRAPHIC );
-#endif
+ rBindings.InvalidateAll(false);
if (aViewData.GetViewShell()->HasAccessibilityObjects())
{
@@ -372,7 +347,7 @@ void ScTabView::UpdateLayerLocks()
if (pLayer)
{
pDrawView->SetLayerLocked( pLayer->GetName(), bProt || bShared );
- pDrawView->SetLayerVisible( pLayer->GetName(), sal_False);
+ pDrawView->SetLayerVisible( pLayer->GetName(), false);
}
}
}
@@ -394,7 +369,7 @@ void ScTabView::DrawDeselectAll()
pDrawView->UnmarkAll();
if (!pViewSh->IsDrawSelMode())
- pViewSh->SetDrawShell( sal_False );
+ pViewSh->SetDrawShell( false );
}
}
@@ -403,17 +378,9 @@ sal_Bool ScTabView::IsDrawTextEdit() const
if (pDrawView)
return pDrawView->IsTextEdit();
else
- return sal_False;
+ return false;
}
-//UNUSED2008-05 String ScTabView::GetSelectedChartName() const
-//UNUSED2008-05 {
-//UNUSED2008-05 if (pDrawView)
-//UNUSED2008-05 return pDrawView->GetSelectedChartName();
-//UNUSED2008-05 else
-//UNUSED2008-05 return EMPTY_STRING;
-//UNUSED2008-05 }
-
SvxZoomType ScTabView::GetZoomType() const
{
return aViewData.GetZoomType();
@@ -544,7 +511,7 @@ void ScTabView::DrawEnableAnim(sal_Bool bSet)
sal_uInt16 i;
if ( pDrawView )
{
- // #71040# dont start animations if display of graphics is disabled
+ // dont start animations if display of graphics is disabled
// graphics are controlled by VOBJ_TYPE_OLE
if ( bSet && aViewData.GetOptions().GetObjMode(VOBJ_TYPE_OLE) == VOBJ_MODE_SHOW )
{
@@ -561,25 +528,11 @@ void ScTabView::DrawEnableAnim(sal_Bool bSet)
}
else
{
- pDrawView->SetAnimationEnabled(sal_False);
+ pDrawView->SetAnimationEnabled(false);
}
}
}
-//HMHvoid ScTabView::DrawShowMarkHdl(sal_Bool bShow)
-//HMH{
- //HMHif (!pDrawView)
- //HMH return;
-
- //HMHif (bShow)
- //HMH{
- //HMH if (!pDrawView->IsDisableHdl())
- //HMH pDrawView->ShowMarkHdl();
- //HMH}
- //HMHelse
- //HMH pDrawView->HideMarkHdl();
-//HMH}
-
void ScTabView::UpdateDrawTextOutliner()
{
if ( pDrawView )
@@ -714,9 +667,10 @@ void ScTabView::ResetBrushDocument()
{
if ( HasPaintBrush() )
{
- SetBrushDocument( NULL, sal_False );
+ SetBrushDocument( NULL, false );
SetActivePointer( Pointer( POINTER_ARROW ) ); // switch pointers also when ended with escape key
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index bdeb74a2d101..2c26815a01dc 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,6 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/app.hxx>
-#include <avmedia/mediaplayer.hxx>
#include "tabvwsh.hxx"
#include "docsh.hxx"
@@ -92,7 +92,6 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL))
SFX_CHILDWINDOW_REGISTRATION(SID_HYPERLINK_DIALOG);
SFX_CHILDWINDOW_REGISTRATION(GalleryChildWindow::GetChildWindowId());
SFX_CHILDWINDOW_REGISTRATION(ScSpellDialogChildWindow::GetChildWindowId());
- SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
SFX_CHILDWINDOW_REGISTRATION(ScValidityRefChildWin::GetChildWindowId());
}
@@ -109,3 +108,5 @@ IMPL_LINK( ScTabViewShell, HtmlOptionsHdl, void*, EMPTYARG )
GetViewFrame()->GetBindings().Invalidate(SID_DRAW_TEXT_MARQUEE);
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index 64b60caf6f4e..ba6c97ac7fba 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@
#include "scmod.hxx"
#include "appoptio.hxx"
-// #98185# Create default drawing objects via keyboard
+// Create default drawing objects via keyboard
#include <svx/svdpagv.hxx>
#include <svl/stritem.hxx>
#include <svx/svdpage.hxx>
@@ -70,7 +71,7 @@
// -----------------------------------------------------------------------
-SdrView* __EXPORT ScTabViewShell::GetDrawView() const
+SdrView* ScTabViewShell::GetDrawView() const
{
return ((ScTabViewShell*)this)->GetScDrawView(); // GetScDrawView ist nicht-const
}
@@ -178,7 +179,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if (nNewId == SID_INSERT_FRAME) // vom Tbx-Button
nNewId = SID_DRAW_TEXT;
- // #97016# CTRL-SID_OBJECT_SELECT is used to select the first object,
+ // CTRL-SID_OBJECT_SELECT is used to select the first object,
// but not if SID_OBJECT_SELECT is the result of clicking a create function again,
// so this must be tested before changing nNewId below.
sal_Bool bSelectFirst = ( nNewId == SID_OBJECT_SELECT && (rReq.GetModifier() & KEY_MOD1) );
@@ -186,8 +187,8 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
sal_Bool bEx = IsDrawSelMode();
if ( rReq.GetModifier() & KEY_MOD1 )
{
- // #97016# always allow keyboard selection also on background layer
- // #98185# also allow creation of default objects if the same object type
+ // always allow keyboard selection also on background layer
+ // also allow creation of default objects if the same object type
// was already active
bEx = sal_True;
}
@@ -199,11 +200,11 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
// SID_FM_CREATE_CONTROL mit nNewFormId==0 (ohne Parameter) kommt beim Deaktivieren
// aus FuConstruct::SimpleMouseButtonUp
- // #59280# Execute fuer die Form-Shell, um im Controller zu deselektieren
+ // Execute fuer die Form-Shell, um im Controller zu deselektieren
if ( nNewId == SID_FM_CREATE_CONTROL )
{
GetViewData()->GetDispatcher().Execute(SID_FM_LEAVE_CREATE);
- GetViewFrame()->GetBindings().InvalidateAll(sal_False);
+ GetViewFrame()->GetBindings().InvalidateAll(false);
//! was fuer einen Slot braucht der komische Controller wirklich, um das anzuzeigen????
}
@@ -217,7 +218,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
{
// Wechsel von Control- zu Zeichenfunktion -> im Control-Controller deselektieren
GetViewData()->GetDispatcher().Execute(SID_FM_LEAVE_CREATE);
- GetViewFrame()->GetBindings().InvalidateAll(sal_False);
+ GetViewFrame()->GetBindings().InvalidateAll(false);
//! was fuer einen Slot braucht der komische Controller wirklich, um das anzuzeigen????
}
@@ -227,7 +228,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if ( bSelectFirst )
{
- // #97016# select first draw object if none is selected yet
+ // select first draw object if none is selected yet
if(!pView->AreObjectsMarked())
{
// select first object
@@ -253,7 +254,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if ( bEx || pView->GetMarkedObjectList().GetMarkCount() != 0 )
SetDrawShellOrSub();
else
- SetDrawShell( sal_False );
+ SetDrawShell( false );
}
}
@@ -273,7 +274,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
switch (nNewId)
{
case SID_OBJECT_SELECT:
- //@#70206# Nicht immer zurueckschalten
+ // Nicht immer zurueckschalten
if(pView->GetMarkedObjectList().GetMarkCount() == 0) SetDrawShell(bEx);
pTabView->SetDrawFuncPtr(new FuSelection(this, pWin, pView, pDoc, aNewReq));
break;
@@ -287,7 +288,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, aNewReq));
- pView->SetFrameDragSingles( sal_False );
+ pView->SetFrameDragSingles( false );
rBindings.Invalidate( SID_BEZIER_EDIT );
break;
@@ -318,7 +319,6 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
break;
case SID_DRAW_CHART:
-//UNUSED2008-05 bChartDlgIsEdit = sal_False;
pTabView->SetDrawFuncPtr(new FuMarkRect(this, pWin, pView, pDoc, aNewReq));
break;
@@ -333,7 +333,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
pTabView->SetDrawFuncPtr( new FuConstCustomShape( this, pWin, pView, pDoc, aNewReq ));
if ( nNewId != SID_DRAW_CS_ID )
{
- SFX_REQUEST_ARG( rReq, pEnumCommand, SfxStringItem, nNewId, sal_False );
+ SFX_REQUEST_ARG( rReq, pEnumCommand, SfxStringItem, nNewId, false );
if ( pEnumCommand )
{
aCurrShapeEnumCommand[ nNewId - SID_DRAWTBX_CS_BASIC ] = pEnumCommand->GetValue();
@@ -359,13 +359,13 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
rBindings.Invalidate( SID_INSERT_DRAW );
rBindings.Update( SID_INSERT_DRAW );
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
// with qualifier construct directly
FuPoor* pFuActual = GetDrawFuncPtr();
if(pFuActual && (rReq.GetModifier() & KEY_MOD1))
{
- // #98185# Create default drawing objects via keyboard
+ // Create default drawing objects via keyboard
const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
sal_uInt32 nDefaultObjectSizeWidth = rAppOpt.GetDefaultObjectSizeWidth();
sal_uInt32 nDefaultObjectSizeHeight = rAppOpt.GetDefaultObjectSizeHeight();
@@ -395,7 +395,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if ( nNewId == SID_DRAW_CAPTION || nNewId == SID_DRAW_CAPTION_VERTICAL )
{
- // #105815# use KeyInput to start edit mode (FuText is created).
+ // use KeyInput to start edit mode (FuText is created).
// For FuText objects, edit mode is handled within CreateDefaultObject.
// KEY_F2 is handled in FuDraw::KeyInput.
@@ -469,7 +469,7 @@ sal_Bool ScTabViewShell::SelectObject( const String& rName )
{
ScDrawView* pView = GetViewData()->GetScDrawView();
if (!pView)
- return sal_False;
+ return false;
sal_Bool bFound = pView->SelectObject( rName );
// DrawShell etc. is handled in MarkListHasChanged
@@ -479,3 +479,4 @@ sal_Bool ScTabViewShell::SelectObject( const String& rName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 79f63f873916..f6e7dccb45a1 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,6 @@
#include <editeng/eeitem.hxx>
#include <sfx2/app.hxx>
-//CHINA001 #include <svx/zoom.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/passwd.hxx>
@@ -65,8 +65,6 @@
#include "uiitems.hxx"
#include "cell.hxx"
#include "inputhdl.hxx"
-//CHINA001 #include "scendlg.hxx"
-//CHINA001 #include "mtrindlg.hxx"
#include "autoform.hxx"
#include "autofmt.hxx"
#include "dwfunctr.hxx"
@@ -79,9 +77,9 @@
#include <svl/svstdarr.hxx>
#include <svx/zoomslideritem.hxx>
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
+#include "scabstdlg.hxx"
#include <memory>
@@ -150,7 +148,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
// als Link?
- sal_Bool bAsLink = sal_False;
+ sal_Bool bAsLink = false;
if ( pReqArgs->GetItemState(FN_PARAM_2,sal_True,&pItem) == SFX_ITEM_SET )
bAsLink = ((const SfxBoolItem*)pItem)->GetValue();
@@ -166,7 +164,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
sal_uInt16 nId = ScPrintAreasDlgWrapper::GetChildWindowId();
SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -177,7 +175,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
String aPrintStr;
String aRowStr;
String aColStr;
- sal_Bool bEntire = sal_False;
+ sal_Bool bEntire = false;
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( SID_CHANGE_PRINTAREA, sal_True, &pItem ) == SFX_ITEM_SET )
aPrintStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
@@ -188,7 +186,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if ( pReqArgs->GetItemState( FN_PARAM_4, sal_True, &pItem ) == SFX_ITEM_SET )
bEntire = static_cast<const SfxBoolItem*>(pItem)->GetValue();
- SetPrintRanges( bEntire, &aPrintStr, &aColStr, &aRowStr, sal_False );
+ SetPrintRanges( bEntire, &aPrintStr, &aColStr, &aRowStr, false );
rReq.Done();
}
@@ -205,11 +203,11 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( SID_DEFINE_PRINTAREA, sal_True, &pItem ) == SFX_ITEM_SET )
aPrintStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
- SetPrintRanges( sal_False, &aPrintStr, NULL, NULL, bAdd );
+ SetPrintRanges( false, &aPrintStr, NULL, NULL, bAdd );
}
else
{
- SetPrintRanges( sal_False, NULL, NULL, NULL, bAdd ); // aus Selektion
+ SetPrintRanges( false, NULL, NULL, NULL, bAdd ); // aus Selektion
rReq.Done();
}
}
@@ -218,7 +216,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case SID_DELETE_PRINTAREA:
{
String aEmpty;
- SetPrintRanges( sal_False, &aEmpty, NULL, NULL, sal_False ); // Druckbereich loeschen
+ SetPrintRanges( false, &aEmpty, NULL, NULL, false ); // Druckbereich loeschen
rReq.Done();
}
break;
@@ -265,15 +263,19 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if ( pReqArgs->GetItemState( FN_PARAM_1, sal_True, &pItem ) == SFX_ITEM_SET )
bUnmark = ((const SfxBoolItem*)pItem)->GetValue();
+ bool bAlignToCursor = true;
+ if (pReqArgs->GetItemState(FN_PARAM_2, true, &pItem) == SFX_ITEM_SET)
+ bAlignToCursor = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+
if ( nSlot == SID_JUMPTOMARK )
{
- // #106586# URL has to be decoded for escaped characters (%20)
+ // URL has to be decoded for escaped characters (%20)
aAddress = INetURLObject::decode( aAddress, INET_HEX_ESCAPE,
INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 );
}
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
ScViewData* pViewData = GetViewData();
ScDocument* pDoc = pViewData->GetDocument();
ScMarkData& rMark = pViewData->GetMarkData();
@@ -310,7 +312,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
aScRange = ScRange( aScAddress, aScAddress );
// Zellen sollen nicht markiert werden
- bMark = sal_False;
+ bMark = false;
}
// Ist es benahmster Bereich (erst Namen dann DBBereiche) ?
else
@@ -338,7 +340,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
aScAddress.SetCol( pViewData->GetCurX() );
aScAddress.SetTab( nTab );
aScRange = ScRange( aScAddress, aScAddress );
- bMark = sal_False;
+ bMark = false;
nResult = SCA_VALID;
}
}
@@ -367,10 +369,10 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
bNothing = ( aCurrent == aOldMark );
}
else
- bNothing = sal_False;
+ bNothing = false;
if (!bNothing)
- MarkRange( aScRange, sal_False ); // Cursor kommt hinterher...
+ MarkRange( aScRange, false ); // Cursor kommt hinterher...
}
else
{
@@ -378,17 +380,14 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if( bUnmark )
{
MoveCursorAbs( nCol, nRow,
- SC_FOLLOW_NONE, sal_False, sal_False );
+ SC_FOLLOW_NONE, false, false );
}
}
// und Cursor setzen
// zusammengefasste Zellen beruecksichtigen:
- while ( pDoc->IsHorOverlapped( nCol, nRow, nTab ) ) //! ViewData !!!
- --nCol;
- while ( pDoc->IsVerOverlapped( nCol, nRow, nTab ) )
- --nRow;
+ pDoc->SkipOverlapped(nCol, nRow, nTab);
// Navigator-Aufrufe sind nicht API!!!
@@ -403,7 +402,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
pViewData->ResetOldCursor();
SetCursor( nCol, nRow );
- AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP );
rBindings.Invalidate( SID_CURRENTCELL );
rBindings.Update( nSlot );
@@ -411,6 +409,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
rReq.Done();
}
+ if (bAlignToCursor)
+ {
+ // align to cursor even if the cursor position hasn't changed,
+ // because the cursor may be set outside the visible area.
+ AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP );
+ }
+
rReq.SetReturnValue( SfxStringItem( SID_CURRENTCELL, aAddress ) );
}
@@ -473,7 +478,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrame = NULL;
ScDocShell* pDocSh = (ScDocShell*)SfxObjectShell::GetFirst();
- sal_Bool bFound = sal_False;
+ sal_Bool bFound = false;
// zu aktivierenden ViewFrame suchen
@@ -524,7 +529,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
// View aufgerufen, um auf der sichtbaren View zu markieren/umzuschalten:
case SID_TABLE_ACTIVATE:
- DBG_ERROR("old slot SID_TABLE_ACTIVATE");
+ OSL_FAIL("old slot SID_TABLE_ACTIVATE");
break;
case SID_REPAINT:
@@ -654,7 +659,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
sal_uInt16 nOldZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 )
/ rOldY.GetDenominator());
sal_uInt16 nZoom = nOldZoom;
- sal_Bool bCancel = sal_False;
+ sal_Bool bCancel = false;
if ( pReqArgs )
{
@@ -668,7 +673,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
- //CHINA001 SvxZoomDialog* pDlg = NULL;
AbstractSvxZoomDialog* pDlg = NULL;
ScMarkData& rMark = GetViewData()->GetMarkData();
sal_uInt16 nBtnFlags = SVX_ZOOM_ENABLE_50
@@ -684,17 +688,20 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
aZoomItem.SetValueSet( nBtnFlags );
aSet.Put( aZoomItem );
- //CHINA001 pDlg = new SvxZoomDialog( GetDialogParent(), aSet );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
pDlg = pFact->CreateSvxZoomDialog(GetDialogParent(), aSet );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialogdiet fail!");
}
- pDlg->SetLimits( MINZOOM, MAXZOOM );
-
- bCancel = ( RET_CANCEL == pDlg->Execute() );
+ if (pDlg)
+ {
+ pDlg->SetLimits( MINZOOM, MAXZOOM );
+ bCancel = ( RET_CANCEL == pDlg->Execute() );
+ }
+ // bCancel is True only if we were in the previous if block,
+ // so no need to check again pDlg
if ( !bCancel )
{
const SvxZoomItem& rZoomItem = (const SvxZoomItem&)
@@ -804,17 +811,16 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SCTAB nTab;
SvULongs aIndexList( 4, 4 );
- SFX_REQUEST_ARG( rReq, pItem, SfxIntegerListItem, SID_SELECT_TABLES, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxIntegerListItem, SID_SELECT_TABLES, false );
if ( pItem )
pItem->GetList( aIndexList );
else
{
- //CHINA001 ScShowTabDlg* pDlg = new ScShowTabDlg( GetDialogParent() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScShowTabDlg* pDlg = pFact->CreateScShowTabDlg( GetDialogParent(), RID_SCDLG_SHOW_TAB);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
pDlg->SetDescription(
String( ScResId( STR_DLG_SELECTTABLES_TITLE ) ),
String( ScResId( STR_DLG_SELECTTABLES_LBNAME ) ),
@@ -848,7 +854,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SCTAB nFirstVisTab = 0;
// special case: only hidden tables selected -> do nothing
- sal_Bool bVisSelected = sal_False;
+ sal_Bool bVisSelected = false;
for( nSelIx = 0; !bVisSelected && (nSelIx < nSelCount); ++nSelIx )
bVisSelected = rDoc.IsVisible( nFirstVisTab = static_cast<SCTAB>(aIndexList[nSelIx]) );
if( !bVisSelected )
@@ -858,7 +864,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if( nSelCount )
{
for( nTab = 0; nTab < nTabCount; ++nTab )
- rMark.SelectTable( nTab, sal_False );
+ rMark.SelectTable( nTab, false );
for( nSelIx = 0; nSelIx < nSelCount; ++nSelIx )
rMark.SelectTable( static_cast<SCTAB>(aIndexList[nSelIx]), sal_True );
@@ -900,7 +906,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if ( eHSplit == SC_SPLIT_NORMAL || eVSplit == SC_SPLIT_NORMAL ) // aufheben
RemoveSplit();
else if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // normal
- FreezeSplitters( sal_False );
+ FreezeSplitters( false );
else // erzeugen
SplitAtCursor();
rReq.Done();
@@ -930,7 +936,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
sal_uInt16 nId = ScHighlightChgDlgWrapper::GetChildWindowId();
SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId );
- pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
+ pScMod->SetRefDialog( nId, pWnd ? false : sal_True );
}
break;
@@ -982,7 +988,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if (!GetScDrawView())
{
GetViewData()->GetDocShell()->MakeDrawLayer();
- rBindings.InvalidateAll(sal_False);
+ rBindings.InvalidateAll(false);
}
break;
@@ -1005,7 +1011,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
ScDocProtection* pProtect = pDoc->GetDocProtection();
if (pProtect && pProtect->isProtected())
{
- sal_Bool bCancel = sal_False;
+ sal_Bool bCancel = false;
String aPassword;
if (pProtect->isProtectedWithPass())
@@ -1027,7 +1033,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if (!bCancel)
{
Unprotect( TABLEID_DOC, aPassword );
- rReq.AppendItem( SfxBoolItem( FID_PROTECT_DOC, sal_False ) );
+ rReq.AppendItem( SfxBoolItem( FID_PROTECT_DOC, false ) );
rReq.Done();
}
}
@@ -1063,8 +1069,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SCTAB nTab = GetViewData()->GetTabNo();
bool bOldProtection = pDoc->IsTabProtected(nTab);
-#if ENABLE_SHEET_PROTECTION
-
if( pReqArgs )
{
const SfxPoolItem* pItem;
@@ -1132,85 +1136,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
}
}
}
-#else
- auto_ptr<SfxPasswordDialog> pDlg;
- String aPassword;
- sal_Bool bCancel = sal_False;
- bool bNewProtection = ! bOldProtection;
-
- if( pReqArgs )
- {
- const SfxPoolItem* pItem;
- if( IS_AVAILABLE( FID_PROTECT_TABLE, &pItem ) )
- bNewProtection = ((const SfxBoolItem*)pItem)->GetValue();
- if( bNewProtection == bOldProtection )
- {
- rReq.Ignore();
- break;
- }
- }
-
- if ( bOldProtection)
- {
- // Unprotect a protected sheet.
-
- ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
- if (pProtect && pProtect->isProtectedWithPass())
- {
- String aText( ScResId(SCSTR_PASSWORDOPT) );
- pDlg.reset(new SfxPasswordDialog(GetDialogParent(), &aText));
- pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) );
- pDlg->SetMinLen( 0 );
- pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() );
- pDlg->SetEditHelpId( HID_PASSWD_TABLE );
-
- if (pDlg->Execute() == RET_OK)
- aPassword = pDlg->GetPassword();
- else
- bCancel = sal_True;
- }
-
- if (!pReqArgs)
- {
- rReq.AppendItem( SfxBoolItem(FID_PROTECT_TABLE, false) );
- rReq.Done();
- }
- }
- else
- {
- String aText( ScResId(SCSTR_PASSWORDOPT) );
-
- pDlg.reset(new SfxPasswordDialog(GetDialogParent(), &aText));
- pDlg->SetText( ScResId(SCSTR_PROTECTTAB) );
- pDlg->SetMinLen( 0 );
- pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() );
- pDlg->SetEditHelpId( HID_PASSWD_TABLE );
- pDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
-
- if (pDlg->Execute() == RET_OK)
- aPassword = pDlg->GetPassword();
- else
- bCancel = sal_True;
- }
-
- if( !bCancel )
- {
- if ( bOldProtection )
- Unprotect( nTab, aPassword );
- else
- {
- pScMod->InputEnterHandler();
-
- Protect( nTab, aPassword );
- }
-
- if( !pReqArgs )
- {
- rReq.AppendItem( SfxBoolItem( FID_PROTECT_TABLE, bNewProtection ) );
- rReq.Done();
- }
- }
-#endif
TabChanged();
UpdateInputHandler(true); // damit sofort wieder eingegeben werden kann
SelectionChanged();
@@ -1225,10 +1150,11 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
break;
default:
- DBG_ERROR("Unbekannter Slot bei ScTabViewShell::Execute");
+ OSL_FAIL("Unbekannter Slot bei ScTabViewShell::Execute");
break;
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 3710fca85e33..6df3e1b84ebf 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,8 +94,8 @@
#include "drawview.hxx"
#include "fupoor.hxx"
#include "navsett.hxx"
-#include "sc.hrc" //CHINA001
-#include "scabstdlg.hxx" //CHINA001
+#include "sc.hrc"
+#include "scabstdlg.hxx"
#include "externalrefmgr.hxx"
void ActivateOlk( ScViewData* pViewData );
@@ -112,7 +113,7 @@ sal_uInt16 ScTabViewShell::nInsObjCtrlState = SID_INSERT_DIAGRAM;
// -----------------------------------------------------------------------
-void __EXPORT ScTabViewShell::Activate(sal_Bool bMDI)
+void ScTabViewShell::Activate(sal_Bool bMDI)
{
SfxViewShell::Activate(bMDI);
@@ -127,7 +128,7 @@ void __EXPORT ScTabViewShell::Activate(sal_Bool bMDI)
ActivateView( sal_True, bFirstActivate );
ActivateOlk( GetViewData() );
- // #56870# AutoCorrect umsetzen, falls der Writer seins neu angelegt hat
+ // AutoCorrect umsetzen, falls der Writer seins neu angelegt hat
UpdateDrawTextOutliner();
// RegisterNewTargetNames gibts nicht mehr
@@ -170,11 +171,11 @@ void __EXPORT ScTabViewShell::Activate(sal_Bool bMDI)
if ( bFirstActivate )
{
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_NAVIGATOR_UPDATEALL ) );
- bFirstActivate = sal_False;
+ bFirstActivate = false;
- // #116278# ReadExtOptions (view settings from Excel import) must also be done
+ // ReadExtOptions (view settings from Excel import) must also be done
// after the ctor, because of the potential calls to Window::Show.
- // Even after the fix for #104887# (Window::Show no longer notifies the access
+ // Even after a bugfix (Window::Show no longer notifies the access
// bridge, it's done in ImplSetReallyVisible), there are problems if Window::Show
// is called during the ViewShell ctor and reschedules asynchronous calls
// (for example from the FmFormShell ctor).
@@ -226,7 +227,7 @@ void __EXPORT ScTabViewShell::Activate(sal_Bool bMDI)
// beim Umschalten zwischen Dokumenten)
}
-void __EXPORT ScTabViewShell::Deactivate(sal_Bool bMDI)
+void ScTabViewShell::Deactivate(sal_Bool bMDI)
{
HideTip();
@@ -246,13 +247,13 @@ void __EXPORT ScTabViewShell::Deactivate(sal_Bool bMDI)
if( bMDI )
{
- // #85421# during shell deactivation, shells must not be switched, or the loop
+ // during shell deactivation, shells must not be switched, or the loop
// through the shell stack (in SfxDispatcher::DoDeactivate_Impl) will not work
sal_Bool bOldDontSwitch = bDontSwitch;
bDontSwitch = sal_True;
DeActivateOlk( GetViewData() );
- ActivateView( sal_False, sal_False );
+ ActivateView( false, false );
if ( GetViewFrame()->GetFrame().IsInPlace() ) // inplace
GetViewData()->GetDocShell()->UpdateOle(GetViewData(),sal_True);
@@ -279,16 +280,9 @@ void ScTabViewShell::SetActive()
// Die Sfx-View moechte sich gerne selbst aktivieren, weil dabei noch
// magische Dinge geschehen (z.B. stuerzt sonst evtl. der Gestalter ab)
ActiveGrabFocus();
-
-#if 0
- SfxViewFrame* pFrame = GetViewFrame();
- pFrame->GetFrame().Appear();
-
- SFX_APP()->SetViewFrame( pFrame ); // immer erst Appear, dann SetViewFrame (#29290#)
-#endif
}
-sal_uInt16 __EXPORT ScTabViewShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing)
+sal_uInt16 ScTabViewShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing)
{
// Call EnterHandler even in formula mode here,
// so a formula change in an embedded object isn't lost
@@ -297,7 +291,7 @@ sal_uInt16 __EXPORT ScTabViewShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrow
if ( pHdl && pHdl->IsInputMode() )
pHdl->EnterHandler();
- // #110797# draw text edit mode must be closed
+ // draw text edit mode must be closed
FuPoor* pPoor = GetDrawFuncPtr();
if ( pPoor && ( IsDrawTextShell() || pPoor->GetSlotID() == SID_DRAW_NOTEEDIT ) )
{
@@ -309,7 +303,7 @@ sal_uInt16 __EXPORT ScTabViewShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrow
if ( pDrView )
{
// force end of text edit, to be safe
- // #128314# ScEndTextEdit must always be used, to ensure correct UndoManager
+ // ScEndTextEdit must always be used, to ensure correct UndoManager
pDrView->ScEndTextEdit();
}
@@ -324,7 +318,7 @@ sal_uInt16 __EXPORT ScTabViewShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrow
//------------------------------------------------------------------
-Size __EXPORT ScTabViewShell::GetOptimalSizePixel() const
+Size ScTabViewShell::GetOptimalSizePixel() const
{
Size aOptSize;
@@ -372,12 +366,12 @@ void ScTabViewShell::UpdateOleZoom()
}
}
-void __EXPORT ScTabViewShell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
+void ScTabViewShell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
{
OuterResizePixel( rPos, rSize );
}
-void __EXPORT ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize )
+void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize )
{
Size aNewSize( rSize );
if ( GetViewFrame()->GetFrame().IsInPlace() )
@@ -417,11 +411,10 @@ void __EXPORT ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &r
UpdateOleZoom(); // Zoom fuer In-Place berechnen
-// GetViewData()->GetDocShell()->UpdateOle( GetViewData() );
GetViewData()->GetDocShell()->SetDocumentModified();
}
-void __EXPORT ScTabViewShell::OuterResizePixel( const Point &rOfs, const Size &rSize )
+void ScTabViewShell::OuterResizePixel( const Point &rOfs, const Size &rSize )
{
SvBorder aBorder;
GetBorderSize( aBorder, rSize );
@@ -435,7 +428,7 @@ void __EXPORT ScTabViewShell::OuterResizePixel( const Point &rOfs, const Size &r
ForceMove();
}
-void __EXPORT ScTabViewShell::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY )
+void ScTabViewShell::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY )
{
// fuer OLE...
@@ -463,7 +456,7 @@ void __EXPORT ScTabViewShell::SetZoomFactor( const Fraction &rZoomX, const Fract
SfxViewShell::SetZoomFactor( rZoomX, rZoomY );
}
-void __EXPORT ScTabViewShell::QueryObjAreaPixel( Rectangle& rRect ) const
+void ScTabViewShell::QueryObjAreaPixel( Rectangle& rRect ) const
{
// auf ganze Zellen anpassen (in 1/100 mm)
@@ -490,36 +483,11 @@ void __EXPORT ScTabViewShell::QueryObjAreaPixel( Rectangle& rRect ) const
pDoc->SnapVisArea( aLogicRect );
rRect.SetSize( pWin->LogicToPixel( aLogicRect.GetSize() ) );
-
-#if 0
- // auf ganze Zellen anpassen (in Pixeln)
-
- ScViewData* pViewData = ((ScTabViewShell*)this)->GetViewData();
- Size aSize = rRect.GetSize();
-
- ScSplitPos ePos = pViewData->GetActivePart();
- Window* pWin = ((ScTabViewShell*)this)->GetActiveWin();
-
- Point aTest( aSize.Width(), aSize.Height() );
- SCsCOL nPosX;
- SCsROW nPosY;
- pViewData->GetPosFromPixel( aTest.X(), aTest.Y(), ePos, nPosX, nPosY );
- sal_Bool bLeft;
- sal_Bool bTop;
- pViewData->GetMouseQuadrant( aTest, ePos, nPosX, nPosY, bLeft, bTop );
- if (!bLeft)
- ++nPosX;
- if (!bTop)
- ++nPosY;
- aTest = pViewData->GetScrPos( (SCCOL)nPosX, (SCROW)nPosY, ePos, sal_True );
-
- rRect.SetSize(Size(aTest.X(),aTest.Y()));
-#endif
}
//------------------------------------------------------------------
-void __EXPORT ScTabViewShell::Move()
+void ScTabViewShell::Move()
{
Point aNewPos = GetViewFrame()->GetWindow().OutputToScreenPixel(Point());
@@ -532,7 +500,7 @@ void __EXPORT ScTabViewShell::Move()
//------------------------------------------------------------------
-void __EXPORT ScTabViewShell::ShowCursor(FASTBOOL /* bOn */)
+void ScTabViewShell::ShowCursor(bool /* bOn */)
{
/*!!! ShowCursor wird nicht paarweise wie im gridwin gerufen.
Der CursorLockCount am Gridwin muss hier direkt auf 0 gesetzt werden
@@ -546,7 +514,7 @@ void __EXPORT ScTabViewShell::ShowCursor(FASTBOOL /* bOn */)
//------------------------------------------------------------------
-void __EXPORT ScTabViewShell::WriteUserData(String& rData, sal_Bool /* bBrowse */)
+void ScTabViewShell::WriteUserData(String& rData, sal_Bool /* bBrowse */)
{
GetViewData()->WriteUserData(rData);
}
@@ -556,7 +524,7 @@ void ScTabViewShell::WriteUserDataSequence (uno::Sequence < beans::PropertyValue
GetViewData()->WriteUserDataSequence (rSettings);
}
-void __EXPORT ScTabViewShell::ReadUserData(const String& rData, sal_Bool /* bBrowse */)
+void ScTabViewShell::ReadUserData(const String& rData, sal_Bool /* bBrowse */)
{
if ( !GetViewData()->GetDocShell()->IsPreview() )
DoReadUserData( rData );
@@ -638,24 +606,6 @@ void ScTabViewShell::DoReadUserData( const String& rData )
//------------------------------------------------------------------
-//UNUSED2008-05 void ScTabViewShell::ExecuteShowNIY( SfxRequest& /* rReq */ )
-//UNUSED2008-05 {
-//UNUSED2008-05 ErrorMessage(STR_BOX_YNI);
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 //------------------------------------------------------------------
-//UNUSED2008-05
-//UNUSED2008-05 void ScTabViewShell::StateDisabled( SfxItemSet& rSet )
-//UNUSED2008-05 {
-//UNUSED2008-05 SfxWhichIter aIter( rSet );
-//UNUSED2008-05 sal_uInt16 nWhich = aIter.FirstWhich();
-//UNUSED2008-05
-//UNUSED2008-05 while ( nWhich )
-//UNUSED2008-05 {
-//UNUSED2008-05 rSet.DisableItem( nWhich );
-//UNUSED2008-05 nWhich = aIter.NextWhich();
-//UNUSED2008-05 }
-//UNUSED2008-05 }
void ScTabViewShell::SetDrawShellOrSub()
{
@@ -705,17 +655,17 @@ void ScTabViewShell::SetDrawShell( sal_Bool bActive )
{
SetCurSubShell(OST_Cell);
}
- bActiveDrawFormSh=sal_False;
- bActiveGraphicSh=sal_False;
- bActiveMediaSh=sal_False;
- bActiveOleObjectSh=sal_False;
- bActiveChartSh=sal_False;
+ bActiveDrawFormSh=false;
+ bActiveGraphicSh=false;
+ bActiveMediaSh=false;
+ bActiveOleObjectSh=false;
+ bActiveChartSh=false;
}
sal_Bool bWasDraw = bActiveDrawSh || bActiveDrawTextSh;
bActiveDrawSh = bActive;
- bActiveDrawTextSh = sal_False;
+ bActiveDrawTextSh = false;
if ( !bActive )
{
@@ -726,7 +676,7 @@ void ScTabViewShell::SetDrawShell( sal_Bool bActive )
{
// Aktiven Teil an Cursor anpassen, etc.
MoveCursorAbs( GetViewData()->GetCurX(), GetViewData()->GetCurY(),
- SC_FOLLOW_NONE, sal_False, sal_False, sal_True );
+ SC_FOLLOW_NONE, false, false, sal_True );
}
}
}
@@ -736,12 +686,12 @@ void ScTabViewShell::SetDrawTextShell( sal_Bool bActive )
bActiveDrawTextSh = bActive;
if ( bActive )
{
- bActiveDrawFormSh=sal_False;
- bActiveGraphicSh=sal_False;
- bActiveMediaSh=sal_False;
- bActiveOleObjectSh=sal_False;
- bActiveChartSh=sal_False;
- bActiveDrawSh = sal_False;
+ bActiveDrawFormSh=false;
+ bActiveGraphicSh=false;
+ bActiveMediaSh=false;
+ bActiveOleObjectSh=false;
+ bActiveChartSh=false;
+ bActiveDrawSh = false;
SetCurSubShell(OST_DrawText);
}
else
@@ -753,19 +703,19 @@ void ScTabViewShell::SetPivotShell( sal_Bool bActive )
{
bActivePivotSh = bActive;
- // #68771# #76198# SetPivotShell is called from CursorPosChanged every time
+ // SetPivotShell is called from CursorPosChanged every time
// -> don't change anything except switching between cell and pivot shell
if ( eCurOST == OST_Pivot || eCurOST == OST_Cell )
{
if ( bActive )
{
- bActiveDrawTextSh = bActiveDrawSh = sal_False;
- bActiveDrawFormSh=sal_False;
- bActiveGraphicSh=sal_False;
- bActiveMediaSh=sal_False;
- bActiveOleObjectSh=sal_False;
- bActiveChartSh=sal_False;
+ bActiveDrawTextSh = bActiveDrawSh = false;
+ bActiveDrawFormSh=false;
+ bActiveGraphicSh=false;
+ bActiveMediaSh=false;
+ bActiveOleObjectSh=false;
+ bActiveChartSh=false;
SetCurSubShell(OST_Pivot);
}
else
@@ -778,12 +728,12 @@ void ScTabViewShell::SetAuditShell( sal_Bool bActive )
bActiveAuditingSh = bActive;
if ( bActive )
{
- bActiveDrawTextSh = bActiveDrawSh = sal_False;
- bActiveDrawFormSh=sal_False;
- bActiveGraphicSh=sal_False;
- bActiveMediaSh=sal_False;
- bActiveOleObjectSh=sal_False;
- bActiveChartSh=sal_False;
+ bActiveDrawTextSh = bActiveDrawSh = false;
+ bActiveDrawFormSh=false;
+ bActiveGraphicSh=false;
+ bActiveMediaSh=false;
+ bActiveOleObjectSh=false;
+ bActiveChartSh=false;
SetCurSubShell(OST_Auditing);
}
else
@@ -873,8 +823,8 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, sal_Bool bForce)
if ( eOST!=eCurOST || bForce )
{
- sal_Bool bCellBrush = sal_False; // "format paint brush" allowed for cells
- sal_Bool bDrawBrush = sal_False; // "format paint brush" allowed for drawing objects
+ sal_Bool bCellBrush = false; // "format paint brush" allowed for cells
+ sal_Bool bDrawBrush = false; // "format paint brush" allowed for drawing objects
if(eCurOST!=OST_NONE) RemoveSubShell();
@@ -1033,7 +983,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, sal_Bool bForce)
}
break;
default:
- DBG_ERROR("Falsche Shell angefordert");
+ OSL_FAIL("Falsche Shell angefordert");
break;
}
@@ -1094,17 +1044,6 @@ SfxShell* ScTabViewShell::GetMySubShell() const
return NULL; // keine von meinen dabei
}
-//UNUSED2008-05 void ScTabViewShell::SetMySubShell( SfxShell* pShell )
-//UNUSED2008-05 {
-//UNUSED2008-05 SfxShell* pOld = GetMySubShell();
-//UNUSED2008-05 if ( pOld != pShell )
-//UNUSED2008-05 {
-//UNUSED2008-05 if (pOld)
-//UNUSED2008-05 RemoveSubShell(pOld); // alte SubShell entfernen
-//UNUSED2008-05 if (pShell)
-//UNUSED2008-05 AddSubShell(*pShell); // neue setzen
-//UNUSED2008-05 }
-//UNUSED2008-05 }
sal_Bool ScTabViewShell::IsDrawTextShell() const
{
@@ -1134,7 +1073,7 @@ void ScTabViewShell::SetDrawTextUndo( ::svl::IUndoManager* pNewUndoMgr )
}
else
{
- DBG_ERROR("SetDrawTextUndo ohne DrawTextShell");
+ OSL_FAIL("SetDrawTextUndo ohne DrawTextShell");
}
}
@@ -1147,32 +1086,159 @@ ScTabViewShell* ScTabViewShell::GetActiveViewShell()
//------------------------------------------------------------------
-SfxPrinter* __EXPORT ScTabViewShell::GetPrinter( sal_Bool bCreate )
+SfxPrinter* ScTabViewShell::GetPrinter( sal_Bool bCreate )
{
// Drucker ist immer da (wird fuer die FontListe schon beim Starten angelegt)
return GetViewData()->GetDocShell()->GetPrinter(bCreate);
}
-sal_uInt16 __EXPORT ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
{
return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
}
+PrintDialog* ScTabViewShell::CreatePrintDialog( Window *pParent )
+{
+ ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ ScDocument* pDoc = pDocShell->GetDocument();
+
+ pDoc->SetPrintOptions(); // Optionen aus OFA am Printer setzen
+ SfxPrinter* pPrinter = GetPrinter();
+
+ String aStrRange;
+ PrintDialog* pDlg = new PrintDialog( pParent, true );
+ SCTAB nTabCount = pDoc->GetTableCount();
+ long nDocPageMax = 0;
+
+ pDlg->EnableSheetRange( true, PRINTSHEETS_ALL );
+ pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS );
+ pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_CELLS );
+ bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets();
+ pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS );
+
+ // update all pending row heights with a single progress bar,
+ // instead of a separate progress for each sheet from ScPrintFunc
+ pDocShell->UpdatePendingRowHeights( MAXTAB, true );
+
+ ScMarkData aMarkData;
+ aMarkData.SelectTable( GetViewData()->GetTabNo(), true );
+
+ for ( SCTAB i=0; i<nTabCount; i++ )
+ {
+ if ( !bAllTabs && !aMarkData.GetTableSelect( i ) )
+ continue;
+ ScPrintFunc aPrintFunc( pDocShell, pPrinter, i );
+ nDocPageMax += aPrintFunc.GetTotalPages();
+ }
+
+ if ( nDocPageMax > 0 )
+ {
+ aStrRange = '1';
+ if ( nDocPageMax > 1 )
+ {
+ aStrRange += '-';
+ aStrRange += String::CreateFromInt32( nDocPageMax );
+ }
+ }
+
+ pDlg->SetRangeText ( aStrRange );
+ pDlg->EnableRange ( PRINTDIALOG_ALL );
+ pDlg->EnableRange ( PRINTDIALOG_RANGE );
+ pDlg->SetFirstPage ( 1 );
+ pDlg->SetMinPage ( 1 );
+ pDlg->SetLastPage ( (sal_uInt16)nDocPageMax );
+ pDlg->SetMaxPage ( (sal_uInt16)nDocPageMax );
+ pDlg->EnableCollate ();
+
+ return pDlg;
+}
+
SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
- //CHINA001 return ScTpPrintOptions::Create( pParent, rOptions );
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT );
if ( ScTpPrintOptionsCreate )
return (*ScTpPrintOptionsCreate)( pParent, rOptions);
return 0;
}
+void ScTabViewShell::PreparePrint( PrintDialog* pPrintDialog )
+{
+ ScDocShell* pDocShell = GetViewData()->GetDocShell();
+
+ SfxViewShell::PreparePrint( pPrintDialog );
+ pDocShell->PreparePrint( pPrintDialog, &GetViewData()->GetMarkData() );
+}
+
+ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter,
+ PrintDialog *pPrintDialog, sal_Bool bSilent, sal_Bool bIsAPI )
+{
+ // if SID_PRINTDOCDIRECT is executed and there's a selection,
+ // ask if only the selection should be printed
+
+ const ScMarkData& rMarkData = GetViewData()->GetMarkData();
+ if ( !pPrintDialog && !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) )
+ {
+ SvxPrtQryBox aQuery( GetDialogParent() );
+ short nBtn = aQuery.Execute();
+
+ if ( nBtn == RET_CANCEL )
+ return ERRCODE_IO_ABORT;
+
+ if ( nBtn == RET_OK )
+ bPrintSelected = true;
+ }
+
+ ErrCode nRet = ERRCODE_IO_ABORT;
+
+ ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ if ( pDocShell->CheckPrint( pPrintDialog, &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) )
+ {
+ // get the list of affected sheets before SfxViewShell::Print
+ bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
+
+ uno::Sequence<sal_Int32> aSheets;
+ SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
+ sal_uInt16 nPrinted = 0;
+ for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
+ if ( bAllTabs || rMarkData.GetTableSelect(nTab) )
+ {
+ aSheets.realloc( nPrinted + 1 );
+ aSheets[nPrinted] = nTab;
+ ++nPrinted;
+ }
+
+ uno::Sequence < beans::PropertyValue > aProps(1);
+ aProps[0].Name=::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintSheets"));
+ aProps[0].Value <<= aSheets;
+ SetAdditionalPrintOptions( aProps );
+
+ // SfxViewShell::DoPrint calls Print (after StartJob etc.)
+ nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI );
+ }
+
+ bPrintSelected = false;
+
+ return nRet;
+}
+
+sal_uInt16 ScTabViewShell::Print( SfxProgress& rProgress, sal_Bool bIsAPI,
+ PrintDialog* pPrintDialog )
+{
+ ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen
+
+ SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog );
+ pDocShell->Print( rProgress, pPrintDialog, &GetViewData()->GetMarkData(),
+ GetDialogParent(), bPrintSelected, bIsAPI );
+ return 0;
+}
+
void ScTabViewShell::StopEditShell()
{
if ( pEditShell != NULL && !bDontSwitch )
- SetEditShell(NULL, sal_False );
+ SetEditShell(NULL, false );
}
//------------------------------------------------------------------
@@ -1262,7 +1328,7 @@ void ScTabViewShell::StartSimpleRefDialog(
LINK( this, ScTabViewShell, SimpleRefChange ) );
pWnd->SetRefString( rInitVal );
pWnd->SetFlags( bCloseOnButtonUp, bSingleCell, bMultiSelection );
- pWnd->SetAutoReOpen( sal_False );
+ pWnd->SetAutoReOpen( false );
Window* pWin = pWnd->GetWindow();
pWin->SetText( rTitle );
pWnd->StartRefInput();
@@ -1291,14 +1357,14 @@ sal_Bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
SfxViewFrame* pThisFrame = GetViewFrame();
if ( pThisFrame->GetChildWindow( SID_OPENDLG_FUNCTION ) )
- return sal_False;
+ return false;
KeyCode aCode = rKEvt.GetKeyCode();
sal_Bool bShift = aCode.IsShift();
sal_Bool bControl = aCode.IsMod1();
sal_Bool bAlt = aCode.IsMod2();
sal_uInt16 nCode = aCode.GetCode();
- sal_Bool bUsed = sal_False;
+ sal_Bool bUsed = false;
sal_Bool bInPlace = pScMod->IsEditMode(); // Editengine bekommt alles
sal_Bool bAnyEdit = pScMod->IsInputMode(); // nur Zeichen & Backspace
sal_Bool bDraw = IsDrawTextEdit();
@@ -1324,7 +1390,7 @@ sal_Bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
}
else if( bAnyEdit )
{
- sal_Bool bIsType = sal_False;
+ sal_Bool bIsType = false;
sal_uInt16 nModi = aCode.GetModifier();
sal_uInt16 nGroup = aCode.GetGroup();
@@ -1349,7 +1415,6 @@ sal_Bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
bIsType = !bControl && !bAlt; // ohne Modifier oder Shift-Space
break;
case KEY_ESCAPE:
- case KEY_BACKSPACE:
bIsType = (nModi == 0); // nur ohne Modifier
break;
default:
@@ -1367,7 +1432,7 @@ sal_Bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
}
else
{
- // #51889# Spezialfall: Copy/Cut bei Mehrfachselektion -> Fehlermeldung
+ // Spezialfall: Copy/Cut bei Mehrfachselektion -> Fehlermeldung
// (Slot ist disabled, SfxViewShell::KeyInput wuerde also kommentarlos verschluckt)
KeyFuncType eFunc = aCode.GetFunction();
if ( eFunc == KEYFUNC_CUT )
@@ -1384,7 +1449,7 @@ sal_Bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
if (!bUsed)
bUsed = sal::static_int_cast<sal_Bool>(SfxViewShell::KeyInput( rKEvt )); // accelerators
- // #74696# during inplace editing, some slots are handled by the
+ // during inplace editing, some slots are handled by the
// container app and are executed during Window::KeyInput.
// -> don't pass keys to input handler that would be used there
// but should call slots instead.
@@ -1500,9 +1565,8 @@ sal_Bool ScTabViewShell::SfxKeyInput(const KeyEvent& rKeyEvent)
return sal::static_int_cast<sal_Bool>(SfxViewShell::KeyInput( rKeyEvent ));
}
-FASTBOOL __EXPORT ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
+bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
{
-// return SfxViewShell::KeyInput( rKeyEvent );
return TabKeyInput( rKeyEvent );
}
@@ -1533,24 +1597,23 @@ FASTBOOL __EXPORT ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
aTarget( this ), \
pDialogDPObject(NULL), \
pNavSettings(NULL), \
- bActiveDrawSh(sal_False), \
- bActiveDrawTextSh(sal_False), \
- bActivePivotSh(sal_False), \
- bActiveAuditingSh(sal_False), \
- bActiveDrawFormSh(sal_False), \
- bActiveOleObjectSh(sal_False), \
- bActiveChartSh(sal_False), \
- bActiveGraphicSh(sal_False), \
- bActiveMediaSh(sal_False), \
- bActiveEditSh(sal_False), \
- bFormShellAtTop(sal_False), \
- bDontSwitch(sal_False), \
- bInFormatDialog(sal_False), \
- bPrintSelected(sal_False), \
- bReadOnly(sal_False), \
+ bActiveDrawSh(false), \
+ bActiveDrawTextSh(false), \
+ bActivePivotSh(false), \
+ bActiveAuditingSh(false), \
+ bActiveDrawFormSh(false), \
+ bActiveOleObjectSh(false), \
+ bActiveChartSh(false), \
+ bActiveGraphicSh(false), \
+ bActiveMediaSh(false), \
+ bActiveEditSh(false), \
+ bFormShellAtTop(false), \
+ bDontSwitch(false), \
+ bInFormatDialog(false), \
+ bPrintSelected(false), \
+ bReadOnly(false), \
pScSbxObject(NULL), \
- /*bChartDlgIsEdit(sal_False),*/ \
- bChartAreaValid(sal_False), \
+ bChartAreaValid(false), \
nCurRefDlgId(0), \
pAccessibilityBroadcaster(NULL)
@@ -1567,7 +1630,6 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
SetName( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("View")) ); // fuer SBX
Color aColBlack( COL_BLACK );
-// SetPool( &pSfxApp->GetPool() );
SetPool( &SC_MOD()->GetPool() );
SetWindow( GetActiveWin() );
@@ -1605,7 +1667,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
}
else if ( bFirstView )
{
- pDocSh->SetInplace( sal_False );
+ pDocSh->SetInplace( false );
GetViewData()->RefreshZoom(); // recalculate PPT
if (!pDoc->IsEmbedded())
pDoc->SetEmbedded( aVisArea ); // VisArea markieren
@@ -1613,7 +1675,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
}
// ViewInputHandler
- // #48721# jeder Task hat neuerdings sein eigenes InputWindow,
+ // jeder Task hat neuerdings sein eigenes InputWindow,
// darum muesste eigentlich entweder jeder Task seinen InputHandler bekommen,
// oder das InputWindow muesste sich beim App-InputHandler anmelden, wenn der
// Task aktiv wird, oder das InputWindow muesste sich den InputHandler selbst
@@ -1638,7 +1700,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
// wenn die ViewShell noch nicht kostruiert ist...
if (pDoc->GetDrawLayer())
MakeDrawView( nForceDesignMode );
- ViewOptionsHasChanged(sal_False); // legt auch evtl. DrawView an
+ ViewOptionsHasChanged(false); // legt auch evtl. DrawView an
::svl::IUndoManager* pMgr = pDocSh->GetUndoManager();
SetUndoManager( pMgr );
@@ -1663,11 +1725,18 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
if ( pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
SCTAB nInitTabCount = 3; //! konfigurierbar !!!
+ // Get the customized initial tab count, we only can set the count by VBA API currently.
+ const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
+ SCTAB nNewTabCount = rAppOpt.GetTabCountInNewSpreadsheet();
+ if ( nNewTabCount >= 1 && nNewTabCount <= MAXTAB )
+ {
+ nInitTabCount = nNewTabCount;
+ }
for (SCTAB i=1; i<nInitTabCount; i++)
pDoc->MakeTable(i,false);
}
- pDocSh->SetEmpty( sal_False ); // #i6232# make sure this is done only once
+ pDocSh->SetEmpty( false ); // #i6232# make sure this is done only once
}
// ReadExtOptions is now in Activate
@@ -1701,7 +1770,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
}
}
- sal_Bool bReImport = sal_False; // importierte Daten aktualisieren
+ sal_Bool bReImport = false; // importierte Daten aktualisieren
ScDBCollection* pDBColl = pDoc->GetDBCollection();
if ( pDBColl )
{
@@ -1735,7 +1804,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
bFirstActivate = sal_True; // NavigatorUpdate aufschieben bis Activate()
// #105575#; update only in the first creation of the ViewShell
- pDocSh->SetUpdateEnabled(sal_False);
+ pDocSh->SetUpdateEnabled(false);
if ( GetViewFrame()->GetFrame().IsInPlace() )
UpdateHeaderWidth(); // The implace activation requires headers to be calculated
@@ -1747,29 +1816,6 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
//------------------------------------------------------------------
-//UNUSED2008-05 ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
-//UNUSED2008-05 const ScTabViewShell& rWin ) :
-//UNUSED2008-05 SfxViewShell( pViewFrame, SFX_VIEW_MAXIMIZE_FIRST | SFX_VIEW_CAN_PRINT | SFX_VIEW_HAS_PRINTOPTIONS ),
-//UNUSED2008-05 ScDBFunc( &pViewFrame->GetWindow(), rWin, this ),
-//UNUSED2008-05 __INIT_ScTabViewShell
-//UNUSED2008-05 {
-//UNUSED2008-05 RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScTabViewShell::ScTabViewShell" );
-//UNUSED2008-05
-//UNUSED2008-05 Construct();
-//UNUSED2008-05
-//UNUSED2008-05 UpdatePageBreakData();
-//UNUSED2008-05
-//UNUSED2008-05 /*uno::Reference<frame::XFrame> xFrame = pViewFrame->GetFrame().GetFrameInterface();
-//UNUSED2008-05 if (xFrame.is())
-//UNUSED2008-05 xFrame->setComponent( uno::Reference<awt::XWindow>(), new ScTabViewObj( this ) );*/
-//UNUSED2008-05 // make Controller known to SFX
-//UNUSED2008-05 new ScTabViewObj( this );
-//UNUSED2008-05
-//UNUSED2008-05 SetCurSubShell(OST_Cell);
-//UNUSED2008-05 SvBorder aBorder;
-//UNUSED2008-05 GetBorderSize( aBorder, Size() );
-//UNUSED2008-05 SetBorderPixel( aBorder );
-//UNUSED2008-05 }
//------------------------------------------------------------------
@@ -1785,9 +1831,9 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
// if switching back from print preview,
// restore the view settings that were active when creating the preview
- // #89897# ReadUserData must not happen from ctor, because the view's edit window
+ // ReadUserData must not happen from ctor, because the view's edit window
// has to be shown by the sfx. ReadUserData is deferred until the first Activate call.
- // #106334# old DesignMode state from form layer must be restored, too
+ // old DesignMode state from form layer must be restored, too
sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE;
if ( pOldSh && pOldSh->ISA( ScPreviewShell ) )
@@ -1810,9 +1856,6 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
SetZoomType( rAppOpt.GetZoomType(), sal_True );
}
- /*uno::Reference<frame::XFrame> xFrame = pViewFrame->GetFrame().GetFrameInterface();
- if (xFrame.is())
- xFrame->setComponent( uno::Reference<awt::XWindow>(), new ScTabViewObj( this ) );*/
// make Controller known to SFX
new ScTabViewObj( this );
@@ -1829,7 +1872,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
//------------------------------------------------------------------
-__EXPORT ScTabViewShell::~ScTabViewShell()
+ScTabViewShell::~ScTabViewShell()
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
EndListening(*pDocSh);
@@ -1841,7 +1884,7 @@ __EXPORT ScTabViewShell::~ScTabViewShell()
RemoveSubShell(); // alle
SetWindow(0);
- // #54104# alles auf NULL, falls aus dem TabView-dtor noch darauf zugegriffen wird
+ // alles auf NULL, falls aus dem TabView-dtor noch darauf zugegriffen wird
//! (soll eigentlich nicht !??!?!)
DELETEZ(pFontworkBarShell);
@@ -1911,11 +1954,6 @@ void ScTabViewShell::SetChartArea( const ScRangeListRef& rSource, const Rectangl
nChartDestTab = GetViewData()->GetTabNo();
}
-//UNUSED2008-05 void ScTabViewShell::ResetChartArea()
-//UNUSED2008-05 {
-//UNUSED2008-05 bChartAreaValid = sal_False;
-//UNUSED2008-05 }
-
sal_Bool ScTabViewShell::GetChartArea( ScRangeListRef& rSource, Rectangle& rDest, SCTAB& rTab ) const
{
rSource = aChartSource;
@@ -1924,16 +1962,6 @@ sal_Bool ScTabViewShell::GetChartArea( ScRangeListRef& rSource, Rectangle& rDest
return bChartAreaValid;
}
-//UNUSED2008-05 sal_Bool ScTabViewShell::IsChartDlgEdit() const
-//UNUSED2008-05 {
-//UNUSED2008-05 return bChartDlgIsEdit;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 const String& ScTabViewShell::GetEditChartName() const
-//UNUSED2008-05 {
-//UNUSED2008-05 return aEditChartName;
-//UNUSED2008-05 }
-
ScNavigatorSettings* ScTabViewShell::GetNavigatorSettings()
{
if( !pNavSettings )
@@ -1967,7 +1995,7 @@ void ScTabViewShell::ExecTbx( SfxRequest& rReq )
nInsObjCtrlState = ((const SfxUInt16Item*)pItem)->GetValue();
break;
default:
- DBG_ERROR("Slot im Wald");
+ OSL_FAIL("Slot im Wald");
}
GetViewFrame()->GetBindings().Invalidate( nSlot );
}
@@ -1988,3 +2016,4 @@ void ScTabViewShell::GetTbxState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 406e608cff9b..030c26f3ef71 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,7 +57,7 @@
//==================================================================
-void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if (rHint.ISA(SfxSimpleHint)) // ohne Parameter
{
@@ -106,20 +107,20 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
// beim "Save as" kann ein vorher schreibgeschuetztes Dokument
// bearbeitbar werden, deshalb die Layer-Locks neu (#39884#)
// (Invalidate etc. passiert schon vom Sfx her)
- // #42091# bei SID_EDITDOC kommt kein SFX_HINT_TITLECHANGED, darum
+ // bei SID_EDITDOC kommt kein SFX_HINT_TITLECHANGED, darum
// der eigene Hint aus DoSaveCompleted
//! was ist mit SFX_HINT_SAVECOMPLETED ?
UpdateLayerLocks();
- // #54891# Design-Modus bei jedem Speichern anzupassen, waere zuviel
+ // Design-Modus bei jedem Speichern anzupassen, waere zuviel
// (beim Speichern unter gleichem Namen soll er unveraendert bleiben)
// Darum nur bei SFX_HINT_MODECHANGED (vom ViewFrame)
}
break;
case SFX_HINT_MODECHANGED:
- // #54891#/#58510# Da man sich nicht mehr darauf verlassen kann, woher
+ // Da man sich nicht mehr darauf verlassen kann, woher
// dieser Hint kommt, den Design-Modus immer dann umschalten, wenn der
// ReadOnly-Status sich wirklich geaendert hat:
@@ -174,9 +175,6 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
PaintLeftArea( pHint->GetStartRow(), pHint->GetEndRow() );
if (nParts & PAINT_TOP)
PaintTopArea( pHint->GetStartCol(), pHint->GetEndCol() );
- if (nParts & PAINT_INVERT)
- InvertBlockMark( pHint->GetStartCol(), pHint->GetStartRow(),
- pHint->GetEndCol(), pHint->GetEndRow() );
// #i84689# call UpdateAllOverlays here instead of in ScTabView::PaintArea
if (nParts & ( PAINT_LEFT | PAINT_TOP )) // only if widths or heights changed
@@ -242,7 +240,7 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
case SC_TAB_HIDDEN:
break;
default:
- DBG_ERROR("unbekannter ScTablesHint");
+ OSL_FAIL("unbekannter ScTablesHint");
}
// hier keine Abfrage auf IsActive() mehr, weil die Aktion von Basic ausgehen
@@ -291,7 +289,7 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
nNewTab = pDoc->GetTableCount() - 1;
sal_Bool bForce = !bStayOnActiveTab;
- SetTabNo( nNewTab, bForce, sal_False, bStayOnActiveTab );
+ SetTabNo( nNewTab, bForce, false, bStayOnActiveTab );
}
else if (rHint.ISA(ScIndexHint))
{
@@ -427,3 +425,4 @@ void ScTabViewShell::UpdateNumberFormatter(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh8.cxx b/sc/source/ui/view/tabvwsh8.cxx
index 298dbe787f0e..75ce2b1d6832 100644
--- a/sc/source/ui/view/tabvwsh8.cxx
+++ b/sc/source/ui/view/tabvwsh8.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,9 +61,9 @@ void ScTabViewShell::SetDefaultFrameLine( const SvxBorderLine* pLine )
//------------------------------------------------------------------
-sal_Bool __EXPORT ScTabViewShell::HasSelection( sal_Bool bText ) const
+sal_Bool ScTabViewShell::HasSelection( sal_Bool bText ) const
{
- sal_Bool bHas = sal_False;
+ sal_Bool bHas = false;
ScViewData* pData = (ScViewData*)GetViewData(); // const weggecasted
if ( bText )
{
@@ -102,3 +103,4 @@ void ScTabViewShell::UIDeactivated( SfxInPlaceClient* pClient )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx
index 8ba9174a6b7a..e3d038fd4bb1 100644
--- a/sc/source/ui/view/tabvwsh9.cxx
+++ b/sc/source/ui/view/tabvwsh9.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,6 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/whiter.hxx>
-#include <avmedia/mediaplayer.hxx>
#include "tabvwsh.hxx"
#include "viewdata.hxx"
@@ -83,15 +83,6 @@ void ScTabViewShell::ExecChildWin(SfxRequest& rReq)
rReq.Ignore();
}
break;
-
- case SID_AVMEDIA_PLAYER:
- {
- SfxViewFrame* pThisFrame = GetViewFrame();
- pThisFrame->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() );
- pThisFrame->GetBindings().Invalidate( SID_AVMEDIA_PLAYER );
- rReq.Ignore();
- }
- break;
}
}
@@ -102,11 +93,6 @@ void ScTabViewShell::GetChildWinState( SfxItemSet& rSet )
sal_uInt16 nId = GalleryChildWindow::GetChildWindowId();
rSet.Put( SfxBoolItem( SID_GALLERY, GetViewFrame()->HasChildWindow( nId ) ) );
}
- else if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_AVMEDIA_PLAYER ) )
- {
- sal_uInt16 nId = ::avmedia::MediaPlayer::GetChildWindowId();
- rSet.Put( SfxBoolItem( SID_AVMEDIA_PLAYER, GetViewFrame()->HasChildWindow( nId ) ) );
- }
}
//------------------------------------------------------------------
@@ -144,7 +130,7 @@ void ScTabViewShell::ExecGallery( SfxRequest& rReq )
}
else if ( nFormats & SGA_FORMAT_SOUND )
{
- // #98115# for sounds (linked or not), insert a hyperlink button,
+ // for sounds (linked or not), insert a hyperlink button,
// like in Impress and Writer
GalleryExplorer* pGal = SVX_GALLERY();
@@ -171,7 +157,7 @@ ScInputHandler* ScTabViewShell::GetInputHandler() const
//------------------------------------------------------------------
-String __EXPORT ScTabViewShell::GetDescription() const
+String ScTabViewShell::GetDescription() const
{
return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(" ** Test ** "));
}
@@ -247,7 +233,7 @@ void ScTabViewShell::GetImageMapState( SfxItemSet& rSet )
{
// Disabled wird nicht mehr...
- sal_Bool bThere = sal_False;
+ sal_Bool bThere = false;
SfxViewFrame* pThisFrame = GetViewFrame();
sal_uInt16 nId = ScIMapChildWindowId();
if ( pThisFrame->KnowsChildWindow(nId) )
@@ -278,7 +264,7 @@ void ScTabViewShell::GetImageMapState( SfxItemSet& rSet )
if ( rMarkList.GetMarkCount() == 1 )
if ( ScIMapDlgGetObj(ScGetIMapDlg()) ==
(void*) rMarkList.GetMark(0)->GetMarkedSdrObj() )
- bDisable = sal_False;
+ bDisable = false;
}
rSet.Put( SfxBoolItem( SID_IMAP_EXEC, bDisable ) );
@@ -293,3 +279,4 @@ void ScTabViewShell::GetImageMapState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index f8199100fc6d..e245db772527 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,13 +59,12 @@
#include "inputwin.hxx"
#include "docsh.hxx"
#include "viewdata.hxx"
-//CHINA001 #include "attrdlg.hxx"
#include "appoptio.hxx"
#include "sc.hrc"
#include "stlpool.hxx"
#include "tabvwsh.hxx"
#include "dwfunctr.hxx"
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
#include "compiler.hxx"
@@ -148,7 +148,7 @@ sal_Bool ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode )
return sal_True;
}
- return sal_False;
+ return false;
}
@@ -161,7 +161,7 @@ sal_Bool ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode )
// FID_VALIDATION
-void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet )
+void ScTabViewShell::GetState( SfxItemSet& rSet )
{
ScViewData* pViewData = GetViewData();
ScDocument* pDoc = pViewData->GetDocument();
@@ -209,7 +209,7 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet )
if ( nTabSelCount > 1 )
{
// #i22589# also take "Print Entire Sheet" into account here
- sal_Bool bHas = sal_False;
+ sal_Bool bHas = false;
for (SCTAB i=0; !bHas && i<nTabCount; i++)
bHas = rMark.GetTableSelect(i) && (pDoc->GetPrintRangeCount(i) || pDoc->IsPrintEntireSheet(i));
if (!bHas)
@@ -229,8 +229,13 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet )
break;
case SID_SEARCH_ITEM:
- rSet.Put( ScGlobal::GetSearchItem() );
+ {
+ SvxSearchItem aItem(ScGlobal::GetSearchItem()); // make a copy.
+ // Search on current selection if a range is marked.
+ aItem.SetSelection(rMark.IsMarked());
+ rSet.Put(aItem);
break;
+ }
case SID_SEARCH_OPTIONS:
{
@@ -269,7 +274,7 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet )
if ( pThisFrame->KnowsChildWindow( nId ) )
{
SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId );
- rSet.Put( SfxBoolItem( nWhich, pWnd ? sal_True : sal_False ) );
+ rSet.Put( SfxBoolItem( nWhich, pWnd ? sal_True : false ) );
}
else
rSet.DisableItem( nWhich );
@@ -458,8 +463,8 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet )
break;
case SID_PRINTPREVIEW:
- // #58924# Toggle-Slot braucht einen State
- rSet.Put( SfxBoolItem( nWhich, sal_False ) );
+ // Toggle-Slot braucht einen State
+ rSet.Put( SfxBoolItem( nWhich, false ) );
break;
case SID_READONLY_MODE:
@@ -479,8 +484,7 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet )
//------------------------------------------------------------------
void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
{
- //CHINA001 ScAttrDlg* pDlg = NULL;
- SfxAbstractTabDialog * pDlg = NULL; //CHINA001
+ SfxAbstractTabDialog * pDlg = NULL;
ScDocument* pDoc = GetViewData()->GetDocument();
SvxBoxItem aLineOuter( ATTR_BORDER );
@@ -506,17 +510,16 @@ void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, sal_uInt16 nTabPage
pOldSet->MergeRange( SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO );
pOldSet->Put(*pNumberInfoItem );
- bInFormatDialog = sal_True;
- //CHINA001 pDlg = new ScAttrDlg( GetViewFrame(), GetDialogParent(), pOldSet );
+ bInFormatDialog = true;
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
pDlg = pFact->CreateScAttrDlg( GetViewFrame(), GetDialogParent(), pOldSet, RID_SCDLG_ATTR);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( nTabPage != 0xffff )
pDlg->SetCurPageId( nTabPage );
short nResult = pDlg->Execute();
- bInFormatDialog = sal_False;
+ bInFormatDialog = false;
if ( nResult == RET_OK )
{
@@ -629,8 +632,8 @@ void ScTabViewShell::UpdateInputHandler( sal_Bool bForce /* = sal_False */, sal_
PutInOrder( nStartRow, nEndRow );
PutInOrder( nStartTab, nEndTab );
- sal_Bool bHideFormula = sal_False;
- sal_Bool bHideAll = sal_False;
+ sal_Bool bHideFormula = false;
+ sal_Bool bHideAll = false;
if (pDoc->IsTabProtected(nTab))
{
@@ -702,7 +705,7 @@ void ScTabViewShell::UpdateInputHandlerCellAdjust( SvxCellHorJustify eJust )
//------------------------------------------------------------------
-void __EXPORT ScTabViewShell::ExecuteSave( SfxRequest& rReq )
+void ScTabViewShell::ExecuteSave( SfxRequest& rReq )
{
// nur SID_SAVEDOC / SID_SAVEASDOC
@@ -718,7 +721,7 @@ void __EXPORT ScTabViewShell::ExecuteSave( SfxRequest& rReq )
GetViewData()->GetDocShell()->ExecuteSlot( rReq );
}
-void __EXPORT ScTabViewShell::GetSaveState( SfxItemSet& rSet )
+void ScTabViewShell::GetSaveState( SfxItemSet& rSet )
{
SfxShell* pDocSh = GetViewData()->GetDocShell();
@@ -737,6 +740,90 @@ void __EXPORT ScTabViewShell::GetSaveState( SfxItemSet& rSet )
//------------------------------------------------------------------
+void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
+{
+ SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ SfxUndoManager* pUndoManager = pSh->GetUndoManager();
+
+ const SfxItemSet* pReqArgs = rReq.GetArgs();
+ ScDocShell* pDocSh = GetViewData()->GetDocShell();
+
+ sal_uInt16 nSlot = rReq.GetSlot();
+ switch ( nSlot )
+ {
+ case SID_UNDO:
+ case SID_REDO:
+ if ( pUndoManager )
+ {
+ sal_Bool bIsUndo = ( nSlot == SID_UNDO );
+
+ sal_uInt16 nCount = 1;
+ const SfxPoolItem* pItem;
+ if ( pReqArgs && pReqArgs->GetItemState( nSlot, true, &pItem ) == SFX_ITEM_SET )
+ nCount = ((const SfxUInt16Item*)pItem)->GetValue();
+
+ // lock paint for more than one cell undo action (not for editing within a cell)
+ sal_Bool bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() );
+ if ( bLockPaint )
+ pDocSh->LockPaint();
+
+ for (sal_uInt16 i=0; i<nCount; i++)
+ {
+ if ( bIsUndo )
+ pUndoManager->Undo(0);
+ else
+ pUndoManager->Redo(0);
+ }
+
+ if ( bLockPaint )
+ pDocSh->UnlockPaint();
+
+ GetViewFrame()->GetBindings().InvalidateAll(false);
+ }
+ break;
+ }
+}
+
+void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
+{
+ SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ SfxUndoManager* pUndoManager = pSh->GetUndoManager();
+
+ SfxWhichIter aIter(rSet);
+ sal_uInt16 nWhich = aIter.FirstWhich();
+ while ( nWhich )
+ {
+ switch (nWhich)
+ {
+ case SID_GETUNDOSTRINGS:
+ case SID_GETREDOSTRINGS:
+ {
+ SfxStringListItem aStrLst( nWhich );
+ if ( pUndoManager )
+ {
+ List* pList = aStrLst.GetList();
+ sal_Bool bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
+ sal_uInt16 nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
+ for (sal_uInt16 i=0; i<nCount; i++)
+ pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
+ pUndoManager->GetRedoActionComment(i) ),
+ LIST_APPEND );
+ }
+ rSet.Put( aStrLst );
+ }
+ break;
+ default:
+ // get state from sfx view frame
+ GetViewFrame()->GetSlotState( nWhich, NULL, &rSet );
+ }
+
+ nWhich = aIter.NextWhich();
+ }
+}
+
+
+//------------------------------------------------------------------
+
void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq )
{
ScViewOptions aViewOptions = GetViewData()->GetOptions();
@@ -801,3 +888,4 @@ void ScTabViewShell::GetDrawOptState( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 2001ba165531..b744053a5c84 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,7 +91,7 @@ void ScTabViewShell::ConnectObject( SdrOle2Obj* pObj )
uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef();
Window* pWin = GetActiveWin();
- // #41412# wenn schon connected ist, nicht nochmal SetObjArea/SetSizeScale
+ // wenn schon connected ist, nicht nochmal SetObjArea/SetSizeScale
SfxInPlaceClient* pClient = FindIPClient( xObj, pWin );
if ( !pClient )
@@ -118,18 +119,14 @@ void ScTabViewShell::ConnectObject( SdrOle2Obj* pObj )
sal_Bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
{
- // #41081# Gueltigkeits-Hinweisfenster nicht ueber dem Objekt stehenlassen
+ // Gueltigkeits-Hinweisfenster nicht ueber dem Objekt stehenlassen
RemoveHintWindow();
uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef();
Window* pWin = GetActiveWin();
ErrCode nErr = ERRCODE_NONE;
- sal_Bool bErrorShown = sal_False;
+ sal_Bool bErrorShown = false;
- // linked objects aren't supported
-// if ( xIPObj->IsLink() )
-// nErr = xIPObj->DoVerb(nVerb); // gelinkt -> ohne Client etc.
-// else
{
SfxInPlaceClient* pClient = FindIPClient( xObj, pWin );
if ( !pClient )
@@ -205,7 +202,7 @@ sal_Bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
}
catch( const uno::Exception & )
{
- DBG_ERROR( "Exception caught while querying chart" );
+ OSL_FAIL( "Exception caught while querying chart" );
}
}
}
@@ -221,14 +218,13 @@ sal_Bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
return ( !(nErr & ERRCODE_ERROR_MASK) );
}
-ErrCode __EXPORT ScTabViewShell::DoVerb(long nVerb)
+ErrCode ScTabViewShell::DoVerb(long nVerb)
{
SdrView* pView = GetSdrView();
if (!pView)
return ERRCODE_SO_NOTIMPL; // soll nicht sein
SdrOle2Obj* pOle2Obj = NULL;
- SdrGrafObj* pGrafObj = NULL;
SdrObject* pObj = NULL;
ErrCode nErr = ERRCODE_NONE;
@@ -238,10 +234,6 @@ ErrCode __EXPORT ScTabViewShell::DoVerb(long nVerb)
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
if (pObj->GetObjIdentifier() == OBJ_OLE2)
pOle2Obj = (SdrOle2Obj*) pObj;
- else if (pObj->GetObjIdentifier() == OBJ_GRAF)
- {
- pGrafObj = (SdrGrafObj*) pObj;
- }
}
if (pOle2Obj)
@@ -250,7 +242,7 @@ ErrCode __EXPORT ScTabViewShell::DoVerb(long nVerb)
}
else
{
- DBG_ERROR("kein Objekt fuer Verb gefunden");
+ OSL_FAIL("kein Objekt fuer Verb gefunden");
}
return nErr;
@@ -290,7 +282,6 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
ScDrawView* pView = pTabView->GetScDrawView();
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScDocument* pDoc = pDocSh->GetDocument();
-// SdrModel* pDrModel = pDocSh->MakeDrawLayer();
SdrModel* pDrModel = pView->GetModel();
switch ( nSlot )
@@ -307,7 +298,6 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
case SID_INSERT_DIAGRAM:
FuInsertChart(this, pWin, pView, pDrModel, rReq);
-//? SC_MOD()->SetFunctionDlg( NULL );//XXX
break;
case SID_INSERT_OBJECT:
@@ -372,7 +362,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
// #98721#
case SID_FM_CREATE_FIELDCONTROL:
{
- SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
+ SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, false );
DBG_ASSERT( pDescriptorItem, "SID_FM_CREATE_FIELDCONTROL: invalid request args!" );
if(pDescriptorItem)
@@ -537,7 +527,7 @@ void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
if ( bLockPaint )
pDocSh->UnlockPaint();
- GetViewFrame()->GetBindings().InvalidateAll(sal_False);
+ GetViewFrame()->GetBindings().InvalidateAll(false);
}
break;
// default:
@@ -584,3 +574,4 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 972503656132..8e3bf1c4d24f 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,6 @@
#include "autoform.hxx" // Core
#include "autofmt.hxx" // Dialog
#include "consdlg.hxx"
-//CHINA001 #include "sortdlg.hxx"
#include "filtdlg.hxx"
#include "dbnamdlg.hxx"
#include "pvlaydlg.hxx"
@@ -162,7 +162,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
GetDBData( sal_True, SC_DB_OLD );
const ScMarkData& rMark = GetViewData()->GetMarkData();
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
- MarkDataArea( sal_False );
+ MarkDataArea( false );
pResult = new ScDbNameDlg( pB, pCW, pParent, GetViewData() );
}
@@ -175,8 +175,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
SCITEM_QUERYDATA,
SCITEM_QUERYDATA );
- ScDBData* pDBData = GetDBData( sal_True, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true, true);
pDBData->GetQueryParam( aQueryParam );
+ aQueryParam.bUseDynamicRange = true;
ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
ScRange aAdvSource;
@@ -200,8 +201,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
SCITEM_QUERYDATA,
SCITEM_QUERYDATA );
- ScDBData* pDBData = GetDBData( sal_True, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, true, true);
pDBData->GetQueryParam( aQueryParam );
+ aQueryParam.bUseDynamicRange = true;
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,
GetViewData(),
@@ -220,7 +222,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
ScRefAddress aCurPos ( pViewData->GetCurX(),
pViewData->GetCurY(),
pViewData->GetTabNo(),
- sal_False, sal_False, sal_False );
+ false, false, false );
pResult = new ScTabOpDlg( pB, pCW, pParent, pViewData->GetDocument(), aCurPos );
}
@@ -250,8 +252,13 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
if( pDialogDPObject )
{
+ // Check for an existing datapilot output.
+ ScViewData* pViewData = GetViewData();
+ ScDPObject* pObj = GetViewData()->GetDocument()->GetDPAtCursor(
+ pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
+
GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() );
- pResult = new ScPivotLayoutDlg( pB, pCW, pParent, *pDialogDPObject );
+ pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject, pObj == NULL);
}
}
break;
@@ -305,7 +312,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
default:
- DBG_ERROR( "ScTabViewShell::CreateRefDialog: unbekannte ID" );
+ OSL_FAIL( "ScTabViewShell::CreateRefDialog: unbekannte ID" );
break;
}
@@ -325,3 +332,4 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshd.cxx b/sc/source/ui/view/tabvwshd.cxx
index d0eeee22fbf7..e2bcd34e87d2 100644
--- a/sc/source/ui/view/tabvwshd.cxx
+++ b/sc/source/ui/view/tabvwshd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@
Window* ScTabViewShell::GetDialogParent()
{
- // #95513# if a ref-input dialog is open, use it as parent
+ // if a ref-input dialog is open, use it as parent
// (necessary when a slot is executed from the dialog's OK handler)
if ( nCurRefDlgId && nCurRefDlgId == SC_MOD()->GetCurRefDlgId() )
{
@@ -98,3 +99,4 @@ Window* ScTabViewShell::GetDialogParent()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index 0784d3143202..23cab155b3ec 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,7 +57,7 @@
//==================================================================
-String __EXPORT ScTabViewShell::GetSelectionText( sal_Bool bWholeWord )
+String ScTabViewShell::GetSelectionText( sal_Bool bWholeWord )
{
String aStrSelection;
@@ -74,7 +75,7 @@ String __EXPORT ScTabViewShell::GetSelectionText( sal_Bool bWholeWord )
if ( bInFormatDialog && aRange.aStart.Row() != aRange.aEnd.Row() )
{
// Range auf eine Datenzeile begrenzen
- // (#48613# nur wenn der Aufruf aus einem Format-Dialog kommt)
+ // (nur wenn der Aufruf aus einem Format-Dialog kommt)
ScHorizontalCellIterator aIter( pDoc, aRange.aStart.Tab(),
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row() );
@@ -156,7 +157,7 @@ void ScTabViewShell::InsertURL( const String& rName, const String& rURL, const S
}
else
{
- // #91216# if the view is not active, InsertURLField doesn't work
+ // if the view is not active, InsertURLField doesn't work
// -> use InsertBookmark to directly manipulate cell content
// bTryReplace=sal_True -> if cell contains only one URL, replace it
@@ -198,7 +199,7 @@ void ScTabViewShell::InsertURLField( const String& rName, const String& rURL, co
ScModule* pScMod = SC_MOD();
ScInputHandler* pHdl = pScMod->GetInputHdl( pViewData->GetViewShell() );
- sal_Bool bSelectFirst = sal_False;
+ sal_Bool bSelectFirst = false;
if ( !pScMod->IsEditMode() )
{
if ( !SelectionEditable() )
@@ -252,7 +253,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
case FID_SEARCH_NOW:
{
if ( pReqArgs &&
- SFX_ITEM_SET == pReqArgs->GetItemState(SID_SEARCH_ITEM, sal_False, &pItem) )
+ SFX_ITEM_SET == pReqArgs->GetItemState(SID_SEARCH_ITEM, false, &pItem) )
{
DBG_ASSERT( pItem->ISA(SvxSearchItem), "falsches Item" );
const SvxSearchItem* pSearchItem = (const SvxSearchItem*) pItem;
@@ -266,7 +267,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
case SID_SEARCH_ITEM:
if (pReqArgs && SFX_ITEM_SET ==
- pReqArgs->GetItemState(SID_SEARCH_ITEM, sal_False, &pItem))
+ pReqArgs->GetItemState(SID_SEARCH_ITEM, false, &pItem))
{
// Search-Item merken
DBG_ASSERT( pItem->ISA(SvxSearchItem), "falsches Item" );
@@ -274,7 +275,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
}
else
{
- DBG_ERROR("SID_SEARCH_ITEM ohne Parameter");
+ OSL_FAIL("SID_SEARCH_ITEM ohne Parameter");
}
break;
case FID_SEARCH:
@@ -282,7 +283,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
case FID_REPLACE_ALL:
case FID_SEARCH_ALL:
{
- if (pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState(nSlot, sal_False, &pItem))
+ if (pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState(nSlot, false, &pItem))
{
// SearchItem holen
@@ -291,7 +292,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
// SearchItem fuellen
aSearchItem.SetSearchString(((SfxStringItem*)pItem)->GetValue());
- if(SFX_ITEM_SET == pReqArgs->GetItemState(FN_PARAM_1, sal_False, &pItem))
+ if(SFX_ITEM_SET == pReqArgs->GetItemState(FN_PARAM_1, false, &pItem))
aSearchItem.SetReplaceString(((SfxStringItem*)pItem)->GetValue());
if (nSlot == FID_SEARCH)
@@ -341,3 +342,4 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 10aea8a81dae..9975230c47c4 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,6 +33,7 @@
#include "scitems.hxx"
#include <sfx2/request.hxx>
+#include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx>
#include <basic/sbstar.hxx>
#include <layout/layout.hxx>
@@ -49,19 +51,18 @@
#include "document.hxx"
#include "shtabdlg.hxx"
#include "scresid.hxx"
-//CHINA001 #include "instbdlg.hxx"
#include "globstr.hrc"
-//CHINA001 #include "strindlg.hxx"
-//CHINA001 #include "mvtabdlg.hxx"
#include "docfunc.hxx"
#include "eventuno.hxx"
-#include "scabstdlg.hxx" //CHINA001
+#include "scabstdlg.hxx"
#include "tabbgcolor.hxx"
#include "tabbgcolordlg.hxx"
#include "sccommands.h"
+#include <vector>
+
using ::boost::scoped_ptr;
using namespace com::sun::star;
@@ -172,12 +173,11 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
else
{
- //CHINA001 ScShowTabDlg* pDlg = new ScShowTabDlg( GetDialogParent() );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScShowTabDlg* pDlg = pFact->CreateScShowTabDlg( GetDialogParent(), RID_SCDLG_SHOW_TAB);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
String aTabName;
sal_Bool bFirst = sal_True;
@@ -187,7 +187,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
pDoc->GetName( i, aTabName );
pDlg->Insert( aTabName, bFirst );
- bFirst = sal_False;
+ bFirst = false;
}
}
@@ -219,7 +219,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if ( pReqArgs != NULL ) // von Basic
{
- sal_Bool bOk = sal_False;
+ sal_Bool bOk = false;
const SfxPoolItem* pTabItem;
const SfxPoolItem* pNameItem;
String aName;
@@ -241,16 +241,13 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
else // Dialog
{
-//CHINA001 ScInsertTableDlg* pDlg = new ScInsertTableDlg(
-//CHINA001 GetDialogParent(),
-//CHINA001 *pViewData,nTabSelCount);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScInsertTableDlg* pDlg = pFact->CreateScInsertTableDlg( GetDialogParent(), *pViewData,
nTabSelCount, nSlot == FID_INS_TABLE_EXT,
RID_SCDLG_INSERT_TABLE);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ DBG_ASSERT(pDlg, "Dialog create fail!");
if ( RET_OK == pDlg->Execute() )
{
if (pDlg->GetTablesFromFile())
@@ -373,23 +370,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
( pDoc->IsTabProtected( nTabNr ) || nTabSelCount > 1 ) )
break; // kein Rename
-#if 0
- // ScSbxObject wird nicht mehr benutzt, stattdessen aus dem
- // ScSbxTable::Notify die richtige Tabelle an der Basic-View eingestellt
- if( rReq.IsAPI() )
- {
- SbxObject* pObj = GetScSbxObject();
- ScSbxTable* pSbxTab = PTR_CAST( ScSbxTable, pObj );
- DBG_ASSERT( pSbxTab, "pSbxTab???" );
-
- if( pSbxTab )
- nTabNr = pSbxTab->GetTableNr();
- }
-#endif
-
if( pReqArgs != NULL )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
const SfxPoolItem* pItem;
String aName;
@@ -417,7 +400,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
else
{
sal_uInt16 nRet = RET_OK;
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
String aErrMsg ( ScGlobal::GetRscString( STR_INVALIDTABNAME ) );
String aName;
String aDlgTitle;
@@ -439,14 +422,14 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
AbstractScStringInputDlg* pDlg = pFact->CreateScStringInputDlg( GetDialogParent(),
aDlgTitle,
String(ScResId(SCSTR_NAME)),
aName,
- GetStaticInterface()->GetSlot(nSlot)->GetCommand(), pHelpId, RID_SCDLG_STRINPUT);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ nSlot,RID_SCDLG_STRINPUT);
+ DBG_ASSERT(pDlg, "Dialog create fail!");
while ( !bDone && nRet == RET_OK )
{
@@ -498,11 +481,12 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if ( pDoc->GetChangeTrack() != NULL )
break; // bei aktiviertem ChangeTracking kein TabMove
- sal_Bool bDoIt = sal_False;
+ sal_Bool bDoIt = false;
sal_uInt16 nDoc = 0;
SCTAB nTab = pViewData->GetTabNo();
- sal_Bool bCpy = sal_False;
+ sal_Bool bCpy = false;
String aDocName;
+ String aTabName;
if( pReqArgs != NULL )
{
@@ -560,12 +544,16 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
else
{
- //CHINA001 ScMoveTableDlg* pDlg = new ScMoveTableDlg( GetDialogParent() );
+ String aDefaultName;
+ pDoc->GetName( pViewData->GetTabNo(), aDefaultName );
+
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
- AbstractScMoveTableDlg* pDlg = pFact->CreateScMoveTableDlg( GetDialogParent(), RID_SCDLG_MOVETAB );
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
+ AbstractScMoveTableDlg* pDlg = pFact->CreateScMoveTableDlg( GetDialogParent(),
+ aDefaultName,
+ RID_SCDLG_MOVETAB );
+ DBG_ASSERT(pDlg, "Dialog create fail!");
SCTAB nTableCount = pDoc->GetTableCount();
ScMarkData& rMark = GetViewData()->GetMarkData();
@@ -574,15 +562,25 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if(nTableCount==nTabSelCount)
{
- pDlg->SetCopyTable();
- pDlg->EnableCopyTable(sal_False);
+ pDlg->SetForceCopyTable();
}
+
+ // We support direct renaming of sheet only when one sheet
+ // is selected.
+ pDlg->EnableRenameTable(nTabSelCount == 1);
+
if ( pDlg->Execute() == RET_OK )
{
nDoc = pDlg->GetSelectedDocument();
nTab = pDlg->GetSelectedTable();
bCpy = pDlg->GetCopyTable();
- bDoIt = sal_True;
+ bool bRna = pDlg->GetRenameTable();
+ // Leave aTabName string empty, when Rename is FALSE.
+ if( bRna )
+ {
+ pDlg->GetTabNameString( aTabName );
+ }
+ bDoIt = true;
String aFoundDocName;
if ( nDoc != SC_DOC_NEW )
@@ -594,7 +592,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if ( !pSh->GetDocument()->IsDocEditable() )
{
ErrorMessage(STR_READONLYERR);
- bDoIt = sal_False;
+ bDoIt = false;
}
}
}
@@ -611,7 +609,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
rReq.Done(); // aufzeichnen, solange das Dokument noch aktiv ist
- MoveTable( nDoc, nTab, bCpy );
+ MoveTable( nDoc, nTab, bCpy, &aTabName );
}
}
break;
@@ -641,15 +639,15 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
SCTAB nNewTab = nCurrentTab;
SCTAB nFirstTab=0;
- sal_Bool bTabFlag=sal_False;
+ sal_Bool bTabFlag=false;
ScMarkData& rMark = pViewData->GetMarkData();
- SvShorts TheTabs;
+ std::vector<SCTAB> TheTabs;
for(SCTAB i=0;i<nTabCount;i++)
{
if(rMark.GetTableSelect(i) &&!pDoc->IsTabProtected(i))
{
TheTabs.push_back(i);
- bTabFlag=sal_True;
+ bTabFlag=true;
if(nNewTab==i) nNewTab++;
}
if(!bTabFlag) nFirstTab=i;
@@ -681,12 +679,23 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if ( rMark.GetTableSelect(nTab) )
- aFunc.SetLayoutRTL( nTab, bSet, sal_False );
+ aFunc.SetLayoutRTL( nTab, bSet, false );
pUndoManager->LeaveListAction();
}
else
- aFunc.SetLayoutRTL( nCurrentTab, bSet, sal_False );
+ aFunc.SetLayoutRTL( nCurrentTab, bSet, false );
+ }
+ break;
+
+ case FID_TAB_TOGGLE_GRID:
+ {
+ bool bShowGrid = pViewData->GetShowGrid();
+ pViewData->SetShowGrid(!bShowGrid);
+ SfxBindings& rBindings = GetViewFrame()->GetBindings();
+ rBindings.Invalidate( FID_TAB_TOGGLE_GRID );
+ PaintGrid();
+ rReq.Done();
}
break;
@@ -706,7 +715,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if( pReqArgs != NULL )
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
const SfxPoolItem* pItem;
Color aColor;
if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
@@ -742,7 +751,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
else
{
sal_uInt16 nRet = RET_OK; /// temp
- sal_Bool bDone = sal_False; /// temp
+ sal_Bool bDone = false; /// temp
Color aTabBgColor;
Color aNewTabBgColor;
@@ -820,7 +829,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
break;
default:
- DBG_ERROR("Unbekannte Message bei ViewShell");
+ OSL_FAIL("Unbekannte Message bei ViewShell");
break;
}
}
@@ -864,7 +873,7 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
case FID_TABLE_SHOW:
{
- sal_Bool bHasHidden = sal_False;
+ sal_Bool bHasHidden = false;
for ( SCTAB i=0; i < nTabCount && !bHasHidden; i++ )
if (!pDoc->IsVisible(i))
bHasHidden = sal_True;
@@ -954,6 +963,10 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
rSet.Put( SvxColorItem( aColor, nWhich ) );
}
break;
+
+ case FID_TAB_TOGGLE_GRID:
+ rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) );
+ break;
}
nWhich = aIter.NextWhich();
}
@@ -962,3 +975,4 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx
index b30b07c43cb9..19b50fe153f6 100644
--- a/sc/source/ui/view/tabvwshg.cxx
+++ b/sc/source/ui/view/tabvwshg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,8 +33,6 @@
// INCLUDE ---------------------------------------------------------------
-//#define SI_VCDRAWOBJ
-
#include <tools/urlobj.hxx>
#include <svx/fmglob.hxx>
#include <svx/svdouno.hxx>
@@ -73,7 +72,6 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
MakeDrawLayer();
ScTabView* pView = pViewData->GetView();
-// SdrView* pDrView = pView->GetSdrView();
ScDrawView* pDrView = pView->GetScDrawView();
SdrModel* pModel = pDrView->GetModel();
@@ -90,25 +88,24 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
uno::Any aAny;
aAny <<= rtl::OUString(rName);
- xPropSet->setPropertyValue( rtl::OUString::createFromAscii( "Label" ), aAny );
+ xPropSet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Label" )), aAny );
::rtl::OUString aTmp = INetURLObject::GetAbsURL( pDoc->GetDocumentShell()->GetMedium()->GetBaseURL(), rURL );
aAny <<= aTmp;
- xPropSet->setPropertyValue( rtl::OUString::createFromAscii( "TargetURL" ), aAny );
+ xPropSet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), aAny );
if( rTarget.Len() )
{
aAny <<= rtl::OUString(rTarget);
- xPropSet->setPropertyValue( rtl::OUString::createFromAscii( "TargetFrame" ), aAny );
+ xPropSet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), aAny );
}
form::FormButtonType eButtonType = form::FormButtonType_URL;
aAny <<= eButtonType;
- xPropSet->setPropertyValue( rtl::OUString::createFromAscii( "ButtonType" ), aAny );
+ xPropSet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), aAny );
if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
{
- // #105638# OJ
aAny <<= sal_True;
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), aAny );
}
@@ -126,7 +123,6 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
aPos.X() -= aSize.Width();
pObj->SetLogicRect(Rectangle(aPos, aSize));
-// pObj->Resize(Point(), Fraction(1, 1), Fraction(1, 1));
// am alten VC-Button musste die Position/Groesse nochmal explizit
// gesetzt werden - das scheint mit UnoControls nicht noetig zu sein
@@ -138,3 +134,4 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 7622832f9094..b77352846ca8 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,7 +81,7 @@ void ScTabViewShell::ExecuteObject( SfxRequest& rReq )
ScTabViewShell* pVisibleSh = this;
if ( nSlotId == SID_OLE_SELECT || nSlotId == SID_OLE_ACTIVATE || nSlotId == SID_OLE_DEACTIVATE )
{
- DBG_ERROR("old slot SID_OLE...");
+ OSL_FAIL("old slot SID_OLE...");
}
switch (nSlotId)
@@ -115,7 +116,7 @@ void ScTabViewShell::ExecuteObject( SfxRequest& rReq )
case SID_OBJECT_WIDTH:
case SID_OBJECT_HEIGHT:
{
- sal_Bool bDone = sal_False;
+ sal_Bool bDone = false;
const SfxPoolItem* pItem;
if ( pReqArgs && pReqArgs->GetItemState( nSlotId, sal_True, &pItem ) == SFX_ITEM_SET )
{
@@ -257,7 +258,7 @@ void ScTabViewShell::RemoveAccessibilityObject( SfxListener& rObject )
}
else
{
- DBG_ERROR("kein Accessibility-Broadcaster?");
+ OSL_FAIL("kein Accessibility-Broadcaster?");
}
}
@@ -291,3 +292,4 @@ bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 088d3580bd67..b7c2e3c14a05 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
-// INCLUDE ---------------------------------------------------------------
-
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
@@ -45,6 +42,7 @@
#include <editeng/editstat.hxx>
#include <editeng/outliner.hxx>
#include <editeng/unolingu.hxx>
+#include <editeng/justifyitem.hxx>
#include <vcl/svapp.hxx>
#include <rtl/math.hxx>
@@ -74,18 +72,14 @@
using namespace com::sun::star;
-// STATIC DATA -----------------------------------------------------------
-
#define SC_GROWY_SMALL_EXTRA 100
#define SC_GROWY_BIG_EXTRA 200
#define TAG_TABBARWIDTH "tw:"
-static sal_Bool bMoveArea = sal_False; //! Member?
+static sal_Bool bMoveArea = false; //! Member?
sal_uInt16 nEditAdjust = SVX_ADJUST_LEFT; //! Member !!!
-//==================================================================
-
ScViewDataTable::ScViewDataTable() :
eZoomType( SVX_ZOOM_PERCENT ),
aZoomX( 1,1 ),
@@ -101,7 +95,8 @@ ScViewDataTable::ScViewDataTable() :
nFixPosY( 0 ),
nCurX( 0 ),
nCurY( 0 ),
- bOldCurValid( sal_False )
+ bShowGrid( true ),
+ bOldCurValid( false )
{
nPosX[0]=nPosX[1]=0;
nPosY[0]=nPosY[1]=0;
@@ -160,6 +155,9 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
pSettings[SC_TABLE_ZOOM_VALUE].Value <<= nZoomValue;
pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_PAGEVIEWZOOMVALUE));
pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue;
+
+ pSettings[SC_TABLE_SHOWGRID].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_SHOWGRID));
+ pSettings[SC_TABLE_SHOWGRID].Value <<= static_cast<sal_Bool>(bShowGrid);
}
}
@@ -264,6 +262,10 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
aPageZoomX = aPageZoomY = aZoom;
rHasZoom = true;
}
+ else if (sName.compareToAscii(SC_UNO_SHOWGRID) == 0)
+ {
+ aSettings[i].Value >>= bShowGrid;
+ }
else if (sName.compareToAscii(SC_TABLESELECTED) == 0)
{
bool bSelected = false;
@@ -293,8 +295,6 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
nVSplitPos = bHasVSplitInTwips ? static_cast< long >( nTempPosVTw * rViewData.GetPPTY() ) : nTempPosV;
}
-//==================================================================
-
ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh )
: pDocShell ( pDocSh ),
pDoc ( NULL ),
@@ -311,17 +311,18 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh )
eRefType ( SC_REFTYPE_NONE ),
nTabNo ( 0 ),
nRefTabNo ( 0 ),
+ nPasteFlags ( SC_PASTE_NONE ),
eEditActivePart( SC_SPLIT_BOTTOMLEFT ),
bActive ( sal_True ), //! wie initialisieren?
- bIsRefMode ( sal_False ),
- bDelMarkValid( sal_False ),
+ bIsRefMode ( false ),
+ bDelMarkValid( false ),
nFillMode ( SC_FILL_NONE ),
- bPagebreak ( sal_False ),
- bSelCtrlMouseClick( sal_False )
+ bPagebreak ( false ),
+ bSelCtrlMouseClick( false )
{
SetGridMode ( sal_True );
- SetSyntaxMode ( sal_False );
+ SetSyntaxMode ( false );
SetHeaderMode ( sal_True );
SetTabMode ( sal_True );
SetVScrollMode ( sal_True );
@@ -337,7 +338,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh )
for (sal_uInt16 j=0; j<4; j++)
{
pEditView[j] = NULL;
- bEditActive[j] = sal_False;
+ bEditActive[j] = false;
}
nEditEndCol = nEditStartCol = nEditCol = 0;
@@ -381,8 +382,8 @@ ScViewData::ScViewData( const ScViewData& rViewData )
nRefTabNo ( rViewData.nTabNo ), // kein RefMode
eEditActivePart( rViewData.eEditActivePart ),
bActive ( sal_True ), //! wie initialisieren?
- bIsRefMode ( sal_False ),
- bDelMarkValid( sal_False ),
+ bIsRefMode ( false ),
+ bDelMarkValid( false ),
nFillMode ( SC_FILL_NONE ),
bPagebreak ( rViewData.bPagebreak ),
bSelCtrlMouseClick( rViewData.bSelCtrlMouseClick )
@@ -406,7 +407,7 @@ ScViewData::ScViewData( const ScViewData& rViewData )
for (sal_uInt16 j=0; j<4; j++)
{
pEditView[j] = NULL;
- bEditActive[j] = sal_False;
+ bEditActive[j] = false;
}
nEditEndCol = nEditStartCol = nEditCol = 0;
@@ -421,51 +422,6 @@ void ScViewData::InitData( ScDocument* pDocument )
*pOptions = pDoc->GetViewOptions();
}
-//UNUSED2008-05 void ScViewData::InitFrom( const ScViewData* pRef )
-//UNUSED2008-05 {
-//UNUSED2008-05 if (pRef==NULL)
-//UNUSED2008-05 {
-//UNUSED2008-05 DBG_ERROR("ScViewData::InitFrom mit NULL");
-//UNUSED2008-05 return;
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 aScrSize = pRef->aScrSize;
-//UNUSED2008-05 nTabNo = pRef->nTabNo;
-//UNUSED2008-05 eDefZoomType = pRef->eDefZoomType;
-//UNUSED2008-05 aDefZoomX = pRef->aDefZoomX;
-//UNUSED2008-05 aDefZoomY = pRef->aDefZoomY;
-//UNUSED2008-05 aDefPageZoomX = pRef->aDefPageZoomX;
-//UNUSED2008-05 aDefPageZoomY = pRef->aDefPageZoomY;
-//UNUSED2008-05 bPagebreak = pRef->bPagebreak;
-//UNUSED2008-05 aLogicMode = pRef->aLogicMode;
-//UNUSED2008-05
-//UNUSED2008-05 SetGridMode ( pRef->IsGridMode() );
-//UNUSED2008-05 SetSyntaxMode ( pRef->IsSyntaxMode() );
-//UNUSED2008-05 SetHeaderMode ( pRef->IsHeaderMode() );
-//UNUSED2008-05 SetTabMode ( pRef->IsTabMode() );
-//UNUSED2008-05 SetVScrollMode ( pRef->IsVScrollMode() );
-//UNUSED2008-05 SetHScrollMode ( pRef->IsHScrollMode() );
-//UNUSED2008-05 SetOutlineMode ( pRef->IsOutlineMode() );
-//UNUSED2008-05
-//UNUSED2008-05 for (SCTAB i=0; i<=MAXTAB; i++)
-//UNUSED2008-05 {
-//UNUSED2008-05 delete pTabData[i];
-//UNUSED2008-05 if (pRef->pTabData[i])
-//UNUSED2008-05 pTabData[i] = new ScViewDataTable( *pRef->pTabData[i] );
-//UNUSED2008-05 else
-//UNUSED2008-05 pTabData[i] = NULL;
-//UNUSED2008-05 }
-//UNUSED2008-05 pThisTab = pTabData[nTabNo];
-//UNUSED2008-05 CalcPPT();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 void ScViewData::SetDocShell( ScDocShell* pShell )
-//UNUSED2008-05 {
-//UNUSED2008-05 pDocShell = pShell;
-//UNUSED2008-05 pDoc = pDocShell->GetDocument();
-//UNUSED2008-05 *pOptions = pDoc->GetViewOptions();
-//UNUSED2008-05 CalcPPT();
-//UNUSED2008-05 }
ScDocument* ScViewData::GetDocument() const
{
@@ -474,7 +430,7 @@ ScDocument* ScViewData::GetDocument() const
else if (pDocShell)
return pDocShell->GetDocument();
- DBG_ERROR("kein Document an ViewData");
+ OSL_FAIL("kein Document an ViewData");
return NULL;
}
@@ -540,7 +496,7 @@ void ScViewData::CopyTab( SCTAB nSrcTab, SCTAB nDestTab )
if (nDestTab > MAXTAB)
{
- DBG_ERROR("Zuviele Tabellen");
+ OSL_FAIL("Zuviele Tabellen");
return;
}
@@ -584,24 +540,6 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab )
aMarkData.InsertTab( nInsTab ); // ggf. angepasst
}
-//UNUSED2008-05 void ScViewData::UpdateOle( ScSplitPos /* eWhich */ )
-//UNUSED2008-05 {
-//UNUSED2008-05 GetDocShell()->UpdateOle(this);
-//UNUSED2008-05 }
-
-void ScViewData::SetViewShell( ScTabViewShell* pViewSh )
-{
- if (pViewSh)
- {
- pViewShell = pViewSh;
- pView = pViewSh;
- }
- else
- {
- pViewShell = NULL;
- pView = NULL;
- }
-}
void ScViewData::CreateTabData( std::vector< SCTAB >& rvTabs )
{
std::vector< SCTAB >::iterator it_end = rvTabs.end();
@@ -743,6 +681,12 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool
SetZoom( rNewX, rNewY, vTabs );
}
+void ScViewData::SetShowGrid( bool bShow )
+{
+ CreateSelectedTabData();
+ pTabData[nTabNo]->bShowGrid = bShow;
+}
+
void ScViewData::RefreshZoom()
{
// recalculate zoom-dependent values (only for current sheet)
@@ -797,7 +741,7 @@ ScMarkType ScViewData::GetSimpleArea( SCCOL& rStartCol, SCROW& rStartRow, SCTAB&
{
// parameter bMergeMark is no longer needed: The view's selection is never modified
// (a local copy is used), and a multi selection that adds to a single range can always
- // be treated like a single selection (#108266# - GetSimpleArea isn't used in selection
+ // be treated like a single selection (GetSimpleArea isn't used in selection
// handling itself)
ScRange aRange;
@@ -830,7 +774,7 @@ void ScViewData::GetMultiArea( ScRangeListRef& rRange ) const
if (bMulti)
{
rRange = new ScRangeList;
- aNewMark.FillRangeListWithMarks( rRange, sal_False );
+ aNewMark.FillRangeListWithMarks( rRange, false );
}
else
{
@@ -853,7 +797,7 @@ sal_Bool ScViewData::SimpleColMarked()
if (nStartRow==0 && nEndRow==MAXROW)
return sal_True;
- return sal_False;
+ return false;
}
sal_Bool ScViewData::SimpleRowMarked()
@@ -868,7 +812,7 @@ sal_Bool ScViewData::SimpleRowMarked()
if (nStartCol==0 && nEndCol==MAXCOL)
return sal_True;
- return sal_False;
+ return false;
}
sal_Bool ScViewData::IsMultiMarked()
@@ -939,7 +883,7 @@ void ScViewData::SetOldCursor( SCCOL nNewX, SCROW nNewY )
void ScViewData::ResetOldCursor()
{
- pThisTab->bOldCurValid = sal_False;
+ pThisTab->bOldCurValid = false;
}
Rectangle ScViewData::GetEditArea( ScSplitPos eWhich, SCCOL nPosX, SCROW nPosY,
@@ -958,7 +902,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTabNo );
ScHSplitPos eHWhich = WhichH(eWhich);
- sal_Bool bWasThere = sal_False;
+ sal_Bool bWasThere = false;
if (pEditView[eWhich])
{
// Wenn die View schon da ist, nichts aufrufen, was die Cursorposition aendert
@@ -971,7 +915,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
if (pEditView[eWhich]->GetWindow() != pWin)
{
pEditView[eWhich]->SetWindow(pWin);
- DBG_ERROR("EditView Window geaendert");
+ OSL_FAIL("EditView Window geaendert");
}
}
else
@@ -1036,7 +980,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
if ( bLayoutRTL )
bGrowBackwards = !bGrowBackwards; // invert on RTL sheet
if ( bAsianVertical )
- bGrowCentered = bGrowToLeft = bGrowBackwards = sal_False; // keep old behavior for asian mode
+ bGrowCentered = bGrowToLeft = bGrowBackwards = false; // keep old behavior for asian mode
long nSizeXPix;
if (bBreak && !bAsianVertical)
@@ -1069,12 +1013,12 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
Size aPaperSize = pView->GetActiveWin()->PixelToLogic( Size( nSizeXPix, nSizeYPix ), GetLogicMode() );
if ( bBreak && !bAsianVertical && SC_MOD()->GetInputOptions().GetTextWysiwyg() )
{
- // #95593# if text is formatted for printer, use the exact same paper width
+ // if text is formatted for printer, use the exact same paper width
// (and same line breaks) as for output.
Fraction aFract(1,1);
Rectangle aUtilRect = ScEditUtil( pDoc,nNewX,nNewY,nTabNo, Point(0,0), pWin,
- HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( pPattern, sal_False );
+ HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( pPattern, false );
aPaperSize.Width() = aUtilRect.GetWidth();
}
pNewEngine->SetPaperSize( aPaperSize );
@@ -1099,17 +1043,13 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
bMoveArea = bLayoutRTL;
}
aVis.Left() = aVis.Right() - nDiff;
- // --> OD 2005-12-22 #i49561#
- // Important note:
+ // #i49561# Important note:
// The set offset of the visible area of the EditView for centered and
// right alignment in horizontal layout is consider by instances of
// class <ScEditObjectViewForwarder> in its methods <LogicToPixel(..)>
// and <PixelToLogic(..)>. This is needed for the correct visibility
// of paragraphs in edit mode at the accessibility API.
- // <--
pEditView[eWhich]->SetVisArea(aVis);
- //
-
// UpdateMode has been disabled in ScInputHandler::StartTable
// must be enabled before EditGrowY (GetTextHeight)
pNewEngine->SetUpdateMode( sal_True );
@@ -1122,8 +1062,6 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
Point aDocPos = pEditView[eWhich]->GetWindowPosTopLeft(0);
if (aDocPos.Y() < aOutputArea.Top())
pEditView[eWhich]->Scroll( 0, aOutputArea.Top() - aDocPos.Y() );
-
- //! Status (Event) zuruecksetzen
}
// hier muss bEditActive schon gesetzt sein
@@ -1131,20 +1069,18 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
if (!bWasThere)
pNewEngine->InsertView(pEditView[eWhich]);
- // Hintergrundfarbe der Zelle
+ // background color of the cell
Color aBackCol = ((const SvxBrushItem&)pPattern->GetItem(ATTR_BACKGROUND)).GetColor();
ScModule* pScMod = SC_MOD();
- // #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed sal_True)
- if ( aBackCol.GetTransparency() > 0 ||
- Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ if ( aBackCol.GetTransparency() > 0 )
{
aBackCol.SetColor( pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
}
pEditView[eWhich]->SetBackgroundColor( aBackCol );
- pEditView[eWhich]->Invalidate(); // noetig ??
- // noetig, wenn Position geaendert
+ pEditView[eWhich]->Invalidate(); // needed ??
+ // needed, wenn position changed
}
IMPL_LINK_INLINE_START( ScViewData, EmptyEditHdl, EditStatus *, EMPTYARG )
@@ -1165,7 +1101,7 @@ IMPL_LINK( ScViewData, EditEngineHdl, EditStatus *, pStatus )
{
ScSplitPos eWhich = GetActivePart();
if (pEditView[eWhich])
- pEditView[eWhich]->ShowCursor(sal_False);
+ pEditView[eWhich]->ShowCursor(false);
}
}
return 0;
@@ -1198,7 +1134,7 @@ void ScViewData::EditGrowX()
// Margin ist schon bei der urspruenglichen Breite beruecksichtigt
long nTextWidth = pEngine->CalcTextWidth();
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
sal_Bool bAsianVertical = pEngine->IsVertical();
// get bGrow... variables the same way as in SetEditEngine
@@ -1211,9 +1147,9 @@ void ScViewData::EditGrowX()
if ( bLayoutRTL )
bGrowBackwards = !bGrowBackwards; // invert on RTL sheet
if ( bAsianVertical )
- bGrowCentered = bGrowToLeft = bGrowBackwards = sal_False; // keep old behavior for asian mode
+ bGrowCentered = bGrowToLeft = bGrowBackwards = false; // keep old behavior for asian mode
- sal_Bool bUnevenGrow = sal_False;
+ sal_Bool bUnevenGrow = false;
if ( bGrowCentered )
{
while (aArea.GetWidth() + 0 < nTextWidth && ( nEditStartCol > nLeft || nEditEndCol < nRight ) )
@@ -1333,7 +1269,7 @@ void ScViewData::EditGrowX()
aVis.Right() -= nMove;
}
pCurView->SetVisArea( aVis );
- bMoveArea = sal_False;
+ bMoveArea = false;
}
pCurView->SetOutputArea(aArea);
@@ -1382,7 +1318,7 @@ void ScViewData::EditGrowY( sal_Bool bInitial )
long nOldBottom = aArea.Bottom();
long nTextHeight = pEngine->GetTextHeight();
- // #106635# When editing a formula in a cell with optimal height, allow a larger portion
+ // When editing a formula in a cell with optimal height, allow a larger portion
// to be clipped before extending to following rows, to avoid obscuring cells for
// reference input (next row is likely to be useful in formulas).
long nAllowedExtra = SC_GROWY_SMALL_EXTRA;
@@ -1399,8 +1335,8 @@ void ScViewData::EditGrowY( sal_Bool bInitial )
nAllowedExtra = SC_GROWY_BIG_EXTRA;
}
- sal_Bool bChanged = sal_False;
- sal_Bool bMaxReached = sal_False;
+ sal_Bool bChanged = false;
+ sal_Bool bMaxReached = false;
while (aArea.GetHeight() + nAllowedExtra < nTextHeight && nEditEndRow < nBottom && !bMaxReached)
{
++nEditEndRow;
@@ -1445,7 +1381,7 @@ void ScViewData::ResetEditView()
pEngine->RemoveView(pEditView[i]);
pEditView[i]->SetOutputArea( Rectangle() );
}
- bEditActive[i] = sal_False;
+ bEditActive[i] = false;
}
if (pEngine)
@@ -1497,7 +1433,7 @@ void ScViewData::SetTabNo( SCTAB nNewTab )
{
if (!ValidTab(nNewTab))
{
- DBG_ERROR("falsche Tabellennummer");
+ OSL_FAIL("falsche Tabellennummer");
return;
}
@@ -1644,7 +1580,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
}
//
-// Anzahl Zellen auf einem Bildschirm
+// Number of cells on a screen
//
SCCOL ScViewData::CellsAtX( SCsCOL nPosX, SCsCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeX ) const
@@ -1663,7 +1599,7 @@ SCCOL ScViewData::CellsAtX( SCsCOL nPosX, SCsCOL nDir, ScHSplitPos eWhichX, sal_
else
nX = nPosX-1; // rueckwaerts
- sal_Bool bOut = sal_False;
+ sal_Bool bOut = false;
for ( ; nScrPosX<=nScrSizeX && !bOut; nX = sal::static_int_cast<SCsCOL>(nX + nDir) )
{
SCsCOL nColNo = nX;
@@ -1747,15 +1683,6 @@ SCROW ScViewData::PrevCellsY( ScVSplitPos eWhichY ) const
return CellsAtY( GetPosY( eWhichY ), -1, eWhichY, SC_SIZE_NONE );
}
-//UNUSED2008-05 SCCOL ScViewData::LastCellsX( ScHSplitPos eWhichX ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 return CellsAtX( MAXCOL+1, -1, eWhichX, SC_SIZE_NONE );
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 SCROW ScViewData::LastCellsY( ScVSplitPos eWhichY ) const
-//UNUSED2008-05 {
-//UNUSED2008-05 return CellsAtY( MAXROW+1, -1, eWhichY, SC_SIZE_NONE );
-//UNUSED2008-05 }
sal_Bool ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix )
{
@@ -1790,7 +1717,7 @@ sal_Bool ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, lon
{
rSizeXPix = ToPixel( pDoc->GetColWidth( nX, nTabNo ), nPPTX );
rSizeYPix = ToPixel( pDoc->GetRowHeight( nY, nTabNo ), nPPTY );
- return sal_False;
+ return false;
}
}
@@ -1875,12 +1802,11 @@ sal_Bool ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWh
{
//! public Methode um Position anzupassen
- sal_Bool bHOver = sal_False;
- while (pDoc->IsHorOverlapped( rPosX, rPosY, nTabNo ))
- { --rPosX; bHOver=sal_True; }
- sal_Bool bVOver = sal_False;
- while (pDoc->IsVerOverlapped( rPosX, rPosY, nTabNo ))
- { --rPosY; bVOver=sal_True; }
+ SCCOL nOrigX = rPosX;
+ SCROW nOrigY = rPosY;
+ pDoc->SkipOverlapped(rPosX, rPosY, nTabNo);
+ bool bHOver = (nOrigX != rPosX);
+ bool bVOver = (nOrigY != rPosY);
if ( bRepair && ( bHOver || bVOver ) )
{
@@ -1889,19 +1815,19 @@ sal_Bool ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWh
if ( ( bHOver && pMerge->GetColMerge() <= 1 ) ||
( bVOver && pMerge->GetRowMerge() <= 1 ) )
{
- DBG_ERROR("Merge-Fehler gefunden");
+ OSL_FAIL("Merge-Fehler gefunden");
pDoc->RemoveFlagsTab( 0,0, MAXCOL,MAXROW, nTabNo, SC_MF_HOR | SC_MF_VER );
SCCOL nEndCol = MAXCOL;
SCROW nEndRow = MAXROW;
- pDoc->ExtendMerge( 0,0, nEndCol,nEndRow, nTabNo, sal_True, sal_False );
+ pDoc->ExtendMerge( 0,0, nEndCol,nEndRow, nTabNo, sal_True, false );
if (pDocShell)
pDocShell->PostPaint( ScRange(0,0,nTabNo,MAXCOL,MAXROW,nTabNo), PAINT_GRID );
}
}
}
- return sal_False;
+ return false;
}
void ScViewData::GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich,
@@ -2071,7 +1997,7 @@ void ScViewData::SetScreenPos( const Point& rVisAreaStart )
if ( pDoc->IsLayoutRTL( nTabNo ) )
nTwips = -nTwips;
SCCOL nX1 = 0;
- bEnd = sal_False;
+ bEnd = false;
while (!bEnd)
{
nAdd = (long) pDoc->GetColWidth(nX1,nTabNo);
@@ -2087,7 +2013,7 @@ void ScViewData::SetScreenPos( const Point& rVisAreaStart )
nSize = 0;
nTwips = (long) (rVisAreaStart.Y() / HMM_PER_TWIPS);
SCROW nY1 = 0;
- bEnd = sal_False;
+ bEnd = false;
while (!bEnd)
{
nAdd = (long) pDoc->GetRowHeight(nY1,nTabNo);
@@ -2167,7 +2093,7 @@ void ScViewData::UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY
Fraction aOldX = GetZoomX();
Fraction aOldY = GetZoomY();
- SetZoom( rNewX, rNewY, sal_False );
+ SetZoom( rNewX, rNewY, false );
Fraction aWidth = GetZoomX();
aWidth *= Fraction( aScrSize.Width(),1 );
@@ -2188,7 +2114,7 @@ void ScViewData::CalcPPT()
nPPTX = nPPTX / pDocShell->GetOutputFactor(); // Faktor ist Drucker zu Bildschirm
nPPTY = ScGlobal::nScreenPPTY * (double) GetZoomY();
- // #83616# if detective objects are present,
+ // if detective objects are present,
// try to adjust horizontal scale so the most common column width has minimal rounding errors,
// to avoid differences between cell and drawing layer output
@@ -2221,8 +2147,6 @@ void ScViewData::CalcPPT()
}
}
-//------------------------------------------------------------------
-
#define SC_OLD_TABSEP '/'
#define SC_NEW_TABSEP '+'
@@ -2308,18 +2232,16 @@ void ScViewData::ReadUserData(const String& rData)
xub_StrLen nCount = rData.GetTokenCount(';');
if ( nCount <= 2 )
{
- // #45208# beim Reload in der Seitenansicht sind evtl. die Preview-UserData
+ // beim Reload in der Seitenansicht sind evtl. die Preview-UserData
// stehengelassen worden. Den Zoom von der Preview will man hier nicht...
- DBG_ERROR("ReadUserData: das sind nicht meine Daten");
+ OSL_FAIL("ReadUserData: das sind nicht meine Daten");
return;
}
String aTabOpt;
xub_StrLen nTagLen = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(TAG_TABBARWIDTH)).Len();
- //-------------------
// nicht pro Tabelle:
- //-------------------
SCTAB nTabStart = 2;
Fraction aZoomX, aZoomY, aPageZoomX, aPageZoomY; //! evaluate (all sheets?)
@@ -2353,9 +2275,7 @@ void ScViewData::ReadUserData(const String& rData)
nTabStart = 3;
}
- //-------------
// pro Tabelle:
- //-------------
SCTAB nPos = 0;
while ( nCount > nPos+nTabStart )
{
@@ -2411,7 +2331,7 @@ void ScViewData::ReadUserData(const String& rData)
{
// dann wieder auf Default (unten links)
pTabData[nPos]->eWhichActive = SC_SPLIT_BOTTOMLEFT;
- DBG_ERROR("SplitPos musste korrigiert werden");
+ OSL_FAIL("SplitPos musste korrigiert werden");
}
}
++nPos;
@@ -2510,6 +2430,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
if( rGridColor.GetColor() != SC_STD_GRIDCOLOR )
rTabSett.maGridColor = rGridColor;
}
+ rTabSett.mbShowGrid = pViewTab->bShowGrid;
// view mode and zoom
rTabSett.mbPageMode = bPagebreak;
@@ -2582,7 +2503,7 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
{
Point aPixel = Application::GetDefaultDevice()->LogicToPixel(
rTabSett.maSplitPos, MapMode( MAP_TWIP ) ); //! Zoom?
- // #109648# - the test for use of printer metrics for text formatting here
+ // the test for use of printer metrics for text formatting here
// effectively results in the nFactor = 1.0 regardless of the Option setting.
if( pDocShell && SC_MOD()->GetInputOptions().GetTextWysiwyg())
{
@@ -2642,15 +2563,11 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
if( rTabSett.mnPageZoom )
rViewTab.aPageZoomX = rViewTab.aPageZoomY = Fraction( rTabSett.mnPageZoom, 100L );
+ rViewTab.bShowGrid = rTabSett.mbShowGrid;
+
// get some settings from displayed Excel sheet, set at Calc document
if( nTab == GetTabNo() )
{
- // selection only for displayed sheet, do not select single cell
-// Disabled, does not work correctly. Anyway, our own XML filters do not import a selection at all.
-// const ScRangeList& rSel = rTabSett.maSelection;
-// if( (rSel.Count() >= 2) || ((rSel.Count() == 1) && (*rSel.GetObject( 0 ) != ScRange( rCursor ))) )
-// rMarkData.MarkFromRangeList( rTabSett.maSelection, sal_False );
-
// grid color -- #i47435# set automatic grid color explicitly
if( pOptions )
{
@@ -2796,7 +2713,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue>
sal_Int32 nCount(rSettings.getLength());
sal_Int32 nTemp32(0);
sal_Int16 nTemp16(0);
- sal_Bool bPageMode(sal_False);
+ sal_Bool bPageMode(false);
for (sal_Int32 i = 0; i < nCount; i++)
{
// SC_VIEWID has to parse and use by mba
@@ -2997,11 +2914,11 @@ sal_Bool ScViewData::UpdateFixX( SCTAB nTab ) // sal_True = Wert g
nTab=nTabNo; // akuelle Tabelle
if (!pView || pTabData[nTab]->eHSplitMode != SC_SPLIT_FIX)
- return sal_False;
+ return false;
ScDocument* pLocalDoc = GetDocument();
- if (!pLocalDoc->HasTable(nTab)) // #114007# if called from reload, the sheet may not exist
- return sal_False;
+ if (!pLocalDoc->HasTable(nTab)) // if called from reload, the sheet may not exist
+ return false;
SCCOL nFix = pTabData[nTab]->nFixPosX;
long nNewPos = 0;
@@ -3023,7 +2940,7 @@ sal_Bool ScViewData::UpdateFixX( SCTAB nTab ) // sal_True = Wert g
return sal_True;
}
- return sal_False;
+ return false;
}
sal_Bool ScViewData::UpdateFixY( SCTAB nTab ) // sal_True = Wert geaendert
@@ -3032,11 +2949,11 @@ sal_Bool ScViewData::UpdateFixY( SCTAB nTab ) // sal_True = Wert g
nTab=nTabNo; // akuelle Tabelle
if (!pView || pTabData[nTab]->eVSplitMode != SC_SPLIT_FIX)
- return sal_False;
+ return false;
ScDocument* pLocalDoc = GetDocument();
- if (!pLocalDoc->HasTable(nTab)) // #114007# if called from reload, the sheet may not exist
- return sal_False;
+ if (!pLocalDoc->HasTable(nTab)) // if called from reload, the sheet may not exist
+ return false;
SCROW nFix = pTabData[nTab]->nFixPosY;
long nNewPos = 0;
@@ -3058,7 +2975,7 @@ sal_Bool ScViewData::UpdateFixY( SCTAB nTab ) // sal_True = Wert g
return sal_True;
}
- return sal_False;
+ return false;
}
void ScViewData::UpdateOutlinerFlags( Outliner& rOutl ) const
@@ -3078,7 +2995,7 @@ void ScViewData::UpdateOutlinerFlags( Outliner& rOutl ) const
rOutl.SetCalcFieldValueHdl( LINK( SC_MOD(), ScModule, CalcFieldValueHdl ) );
- // #97417# don't call GetSpellChecker if online spelling isn't enabled.
+ // don't call GetSpellChecker if online spelling isn't enabled.
// The language for AutoCorrect etc. is taken from the pool defaults
// (set in ScDocument::UpdateDrawLanguages)
@@ -3098,7 +3015,6 @@ ScAddress ScViewData::GetCurPos() const
}
-// static
void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY,
SCROW nEndRow, double nPPTY, const ScDocument * pDoc, SCTAB nTabNo )
{
@@ -3138,7 +3054,6 @@ void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY,
}
-// static
void ScViewData::AddPixelsWhileBackward( long & rScrY, long nEndPixels,
SCROW & rPosY, SCROW nStartRow, double nPPTY, const ScDocument * pDoc,
SCTAB nTabNo )
@@ -3177,3 +3092,5 @@ void ScViewData::AddPixelsWhileBackward( long & rScrY, long nEndPixels,
++nRow;
rPosY = nRow;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index c8a02aa1ea2e..8b3f7657ef99 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,6 +53,10 @@
#include <vcl/sound.hxx>
#include <vcl/waitobj.hxx>
+#include <basic/sbstar.hxx>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/script/XLibraryContainer.hpp>
+
#include "viewfunc.hxx"
#include "sc.hrc"
@@ -60,6 +65,7 @@
#include "attrib.hxx"
#include "autoform.hxx"
#include "cell.hxx" // EnterAutoSum
+#include "cellmergeoption.hxx"
#include "compiler.hxx"
#include "docfunc.hxx"
#include "docpool.hxx"
@@ -89,7 +95,17 @@
#include <basic/sbstar.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
+
+#include <boost/scoped_ptr.hpp>
+#include <vector>
+#include <memory>
+
using namespace com::sun::star;
+using ::rtl::OUStringBuffer;
+using ::rtl::OUString;
+
+using ::std::vector;
+using ::std::auto_ptr;
// helper func defined in docfunc.cxx
void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName );
@@ -127,21 +143,21 @@ sal_Bool ScViewFunc::AdjustBlockHeight( sal_Bool bPaint, ScMarkData* pMarkData )
aZoomX = aZoomY = Fraction( 1, 1 );
}
- sal_Bool bAnyChanged = sal_False;
+ sal_Bool bAnyChanged = false;
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
{
if (pMarkData->GetTableSelect(nTab))
{
SCCOLROW* pOneRange = pRanges;
- sal_Bool bChanged = sal_False;
+ sal_Bool bChanged = false;
SCROW nPaintY = 0;
for (SCROW nRangeNo=0; nRangeNo<nRangeCnt; nRangeNo++)
{
SCROW nStartNo = *(pOneRange++);
SCROW nEndNo = *(pOneRange++);
if (pDoc->SetOptimalHeight( nStartNo, nEndNo, nTab, 0, aProv.GetDevice(),
- nPPTX, nPPTY, aZoomX, aZoomY, sal_False ))
+ nPPTX, nPPTY, aZoomX, aZoomY, false ))
{
if (!bChanged)
nPaintY = nStartNo;
@@ -185,13 +201,13 @@ sal_Bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, sal_Bool b
aZoomX = aZoomY = Fraction( 1, 1 );
}
sal_Bool bChanged = pDoc->SetOptimalHeight( nStartRow, nEndRow, nTab, 0, aProv.GetDevice(),
- nPPTX, nPPTY, aZoomX, aZoomY, sal_False );
+ nPPTX, nPPTY, aZoomX, aZoomY, false );
if (bChanged && ( nStartRow == nEndRow ))
{
sal_uInt16 nNewPixel = (sal_uInt16) (pDoc->GetRowHeight(nStartRow,nTab) * nPPTY);
if ( nNewPixel == nOldPixel )
- bChanged = sal_False;
+ bChanged = false;
}
if ( bPaint && bChanged )
@@ -412,10 +428,10 @@ sal_Bool ScViewFunc::GetAutoSumArea( ScRangeList& rRangeList )
SCROW nEndRow = nRow;
SCCOL nSeekCol = nCol;
SCROW nSeekRow = nRow;
- SCCOLROW nExtend; // wird per Reference gueltig bei ScAutoSumSum
+ SCCOLROW nExtend; // will become valid via reference for ScAutoSumSum
- sal_Bool bCol = sal_False;
- sal_Bool bRow = sal_False;
+ sal_Bool bCol = false;
+ sal_Bool bRow = false;
ScAutoSum eSum;
if ( nRow != 0
@@ -443,21 +459,21 @@ sal_Bool ScViewFunc::GetAutoSumArea( ScRangeList& rRangeList )
{
if ( bRow )
{
- nStartRow = nSeekRow; // nSeekRow evtl. per Reference angepasst
+ nStartRow = nSeekRow; // nSeekRow might be adjusted via reference
if ( eSum == ScAutoSumSum )
- nEndRow = nStartRow; // nur Summen summieren
+ nEndRow = nStartRow; // only sum sums
else
- nEndRow = nRow - 1; // Datenbereich evtl. nach unten erweitern
+ nEndRow = nRow - 1; // maybe extend data area at bottom
}
else
{
- nStartCol = nSeekCol; // nSeekCol evtl. per Reference angepasst
+ nStartCol = nSeekCol; // nSeekCol might be adjusted vie reference
if ( eSum == ScAutoSumSum )
- nEndCol = nStartCol; // nur Summen summieren
+ nEndCol = nStartCol; // only sum sums
else
- nEndCol = nCol - 1; // Datenbereich evtl. nach rechts erweitern
+ nEndCol = nCol - 1; // maybe extend data area to the right
}
- sal_Bool bContinue = sal_False;
+ sal_Bool bContinue = false;
do
{
if ( eSum == ScAutoSumData )
@@ -499,14 +515,14 @@ sal_Bool ScViewFunc::GetAutoSumArea( ScRangeList& rRangeList )
} while ( bContinue );
return sal_True;
}
- return sal_False;
+ return false;
}
//----------------------------------------------------------------------------
-void ScViewFunc::EnterAutoSum(const ScRangeList& rRangeList, sal_Bool bSubTotal) // Block mit Summen fuellen
+void ScViewFunc::EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr)
{
- String aFormula = GetAutoSumFormula( rRangeList, bSubTotal );
+ String aFormula = GetAutoSumFormula( rRangeList, bSubTotal, rAddr );
EnterBlock( aFormula, NULL );
}
@@ -659,7 +675,8 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
const ScRange aRange( nCol, nStartRow, nTab, nCol, nSumEndRow, nTab );
if ( lcl_GetAutoSumForColumnRange( pDoc, aRangeList, aRange ) )
{
- const String aFormula = GetAutoSumFormula( aRangeList, bSubTotal );
+ const String aFormula = GetAutoSumFormula(
+ aRangeList, bSubTotal, ScAddress(nCol, nInsRow, nTab));
EnterData( nCol, nInsRow, nTab, aFormula );
}
}
@@ -692,7 +709,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
const ScRange aRange( nStartCol, nRow, nTab, nSumEndCol, nRow, nTab );
if ( lcl_GetAutoSumForRowRange( pDoc, aRangeList, aRange ) )
{
- const String aFormula = GetAutoSumFormula( aRangeList, bSubTotal );
+ const String aFormula = GetAutoSumFormula( aRangeList, bSubTotal, ScAddress(nInsCol, nRow, nTab) );
EnterData( nInsCol, nRow, nTab, aFormula );
}
}
@@ -701,7 +718,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
// set new mark range and cursor position
const ScRange aMarkRange( nStartCol, nStartRow, nTab, nMarkEndCol, nMarkEndRow, nTab );
- MarkRange( aMarkRange, sal_False, bContinue );
+ MarkRange( aMarkRange, false, bContinue );
if ( bSetCursor )
{
SetCursor( nMarkEndCol, nMarkEndRow );
@@ -712,44 +729,54 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
//----------------------------------------------------------------------------
-String ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal )
+String ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr )
{
- String aFormula = '=';
- ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
- const ScFuncDesc* pDesc = NULL;
- if ( bSubTotal )
- {
- pDesc = pFuncMgr->Get( SC_OPCODE_SUB_TOTAL );
- }
- else
+ ScViewData* pViewData = GetViewData();
+ ScDocument* pDoc = pViewData->GetDocument();
+ ::boost::scoped_ptr<ScTokenArray> pArray(new ScTokenArray);
+
+ pArray->AddOpCode(bSubTotal ? ocSubTotal : ocSum);
+ pArray->AddOpCode(ocOpen);
+
+ if (bSubTotal)
{
- pDesc = pFuncMgr->Get( SC_OPCODE_SUM );
+ pArray->AddDouble(9);
+ pArray->AddOpCode(ocSep);
}
- if ( pDesc && pDesc->pFuncName )
+
+ if(!rRangeList.empty())
{
- aFormula += *pDesc->pFuncName;
- if ( bSubTotal )
+ ScRangeList aRangeList = rRangeList;
+ const ScRange* pFirst = aRangeList.front();
+ size_t ListSize = aRangeList.size();
+ for ( size_t i = 0; i < ListSize; ++i )
{
- aFormula.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "(9;" ) );
+ const ScRange* p = aRangeList[i];
+ if (p != pFirst)
+ pArray->AddOpCode(ocSep);
+ ScComplexRefData aRef;
+ aRef.InitRangeRel(*p, rAddr);
+ pArray->AddDoubleReference(aRef);
}
- else
- {
- aFormula += '(';
- }
- ScDocument* pDoc = GetViewData()->GetDocument();
- String aRef;
- rRangeList.Format( aRef, SCA_VALID, pDoc );
- aFormula += aRef;
- aFormula += ')';
}
- return aFormula;
+
+ pArray->AddOpCode(ocClose);
+
+ ScCompiler aComp(pDoc, rAddr, *pArray);
+ aComp.SetGrammar(pDoc->GetGrammar());
+ OUStringBuffer aBuf;
+ aComp.CreateStringFromTokenArray(aBuf);
+ OUString aFormula = aBuf.makeStringAndClear();
+ aBuf.append(sal_Unicode('='));
+ aBuf.append(aFormula);
+ return aBuf.makeStringAndClear();
}
//----------------------------------------------------------------------------
void ScViewFunc::EnterBlock( const String& rString, const EditTextObject* pData )
{
- // Mehrfachselektion vorher abfragen...
+ // test for multi selection
SCCOL nCol = GetViewData()->GetCurX();
SCROW nRow = GetViewData()->GetCurY();
@@ -759,7 +786,7 @@ void ScViewFunc::EnterBlock( const String& rString, const EditTextObject* pData
{
rMark.MarkToSimple();
if ( rMark.IsMultiMarked() )
- { // "Einfuegen auf Mehrfachselektion nicht moeglich"
+ { // "Insert into multi selection not possible"
ErrorMessage(STR_MSSG_PASTEFROMCLIP_0);
// insert into single cell
@@ -787,7 +814,7 @@ void ScViewFunc::EnterBlock( const String& rString, const EditTextObject* pData
}
}
- // Einfuegen per PasteFromClip
+ // Insert via PasteFromClip
WaitObject aWait( GetFrameWin() );
@@ -796,9 +823,9 @@ void ScViewFunc::EnterBlock( const String& rString, const EditTextObject* pData
ScDocument* pInsDoc = new ScDocument( SCDOCMODE_CLIP );
pInsDoc->ResetClip( pDoc, nTab );
- if (aNewStr.GetChar(0) == '=') // Formel ?
+ if (aNewStr.GetChar(0) == '=') // Formula ?
{
- // SetString geht nicht, weil in Clipboard-Dokumenten nicht kompiliert wird!
+ // SetString not possible, because in Clipboard-Documents nothing will be compiled!
ScFormulaCell* pFCell = new ScFormulaCell( pDoc, aPos, aNewStr );
pInsDoc->PutCell( nCol, nRow, nTab, pFCell );
}
@@ -808,15 +835,15 @@ void ScViewFunc::EnterBlock( const String& rString, const EditTextObject* pData
pInsDoc->SetString( nCol, nRow, nTab, aNewStr );
pInsDoc->SetClipArea( ScRange(aPos) );
- // auf Block einfuegen, mit Undo etc.
- if ( PasteFromClip( IDF_CONTENTS, pInsDoc, PASTE_NOFUNC, sal_False, sal_False,
- sal_False, INS_NONE, IDF_ATTRIB ) )
+ // insert Block, with Undo etc.
+ if ( PasteFromClip( IDF_CONTENTS, pInsDoc, PASTE_NOFUNC, false, false,
+ false, INS_NONE, IDF_ATTRIB ) )
{
const SfxUInt32Item* pItem = (SfxUInt32Item*) pInsDoc->GetAttr(
nCol, nRow, nTab, ATTR_VALUE_FORMAT );
if ( pItem )
- { // Numberformat setzen wenn inkompatibel
- // MarkData wurde bereits in PasteFromClip MarkToSimple'ed
+ { // set number format if incompatible
+ // MarkData was already MarkToSimple'ed in PasteFromClip
ScRange aRange;
rMark.GetMarkArea( aRange );
ScPatternAttr* pPattern = new ScPatternAttr( pDoc->GetPool() );
@@ -833,41 +860,7 @@ void ScViewFunc::EnterBlock( const String& rString, const EditTextObject* pData
//----------------------------------------------------------------------------
-
-//UNUSED2008-05 void ScViewFunc::PaintWidthHeight( sal_Bool bColumns, SCCOLROW nStart, SCCOLROW nEnd )
-//UNUSED2008-05 {
-//UNUSED2008-05 SCTAB nTab = GetViewData()->GetTabNo();
-//UNUSED2008-05 ScDocument* pDoc = GetViewData()->GetDocument();
-//UNUSED2008-05
-//UNUSED2008-05 sal_uInt16 nParts = PAINT_GRID;
-//UNUSED2008-05 SCCOL nStartCol = 0;
-//UNUSED2008-05 SCROW nStartRow = 0;
-//UNUSED2008-05 SCCOL nEndCol = MAXCOL; // fuer Test auf Merge
-//UNUSED2008-05 SCROW nEndRow = MAXROW;
-//UNUSED2008-05 if ( bColumns )
-//UNUSED2008-05 {
-//UNUSED2008-05 nParts |= PAINT_TOP;
-//UNUSED2008-05 nStartCol = static_cast<SCCOL>(nStart);
-//UNUSED2008-05 nEndCol = static_cast<SCCOL>(nEnd);
-//UNUSED2008-05 }
-//UNUSED2008-05 else
-//UNUSED2008-05 {
-//UNUSED2008-05 nParts |= PAINT_LEFT;
-//UNUSED2008-05 nStartRow = nStart;
-//UNUSED2008-05 nEndRow = nEnd;
-//UNUSED2008-05 }
-//UNUSED2008-05 if (pDoc->HasAttrib( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
-//UNUSED2008-05 HASATTR_MERGED | HASATTR_OVERLAPPED ))
-//UNUSED2008-05 {
-//UNUSED2008-05 nStartCol = 0;
-//UNUSED2008-05 nStartRow = 0;
-//UNUSED2008-05 }
-//UNUSED2008-05 GetViewData()->GetDocShell()->PostPaint( nStartCol,nStartRow,nTab, MAXCOL,MAXROW,nTab, nParts );
-//UNUSED2008-05 }
-
-
-//----------------------------------------------------------------------------
-// manueller Seitenumbruch
+// manual page break
void ScViewFunc::InsertPageBreak( sal_Bool bColumn, sal_Bool bRecord, const ScAddress* pPos,
sal_Bool bSetModified )
@@ -880,10 +873,10 @@ void ScViewFunc::InsertPageBreak( sal_Bool bColumn, sal_Bool bRecord, const ScAd
aCursor = ScAddress( GetViewData()->GetCurX(), GetViewData()->GetCurY(), nTab );
sal_Bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().
- InsertPageBreak( bColumn, aCursor, bRecord, bSetModified, sal_False );
+ InsertPageBreak( bColumn, aCursor, bRecord, bSetModified, false );
if ( bSuccess && bSetModified )
- UpdatePageBreakData( sal_True ); // fuer PageBreak-Modus
+ UpdatePageBreakData( true ); // for PageBreak-Mode
}
@@ -900,10 +893,10 @@ void ScViewFunc::DeletePageBreak( sal_Bool bColumn, sal_Bool bRecord, const ScAd
aCursor = ScAddress( GetViewData()->GetCurX(), GetViewData()->GetCurY(), nTab );
sal_Bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().
- RemovePageBreak( bColumn, aCursor, bRecord, bSetModified, sal_False );
+ RemovePageBreak( bColumn, aCursor, bRecord, bSetModified, false );
if ( bSuccess && bSetModified )
- UpdatePageBreakData( sal_True ); // fuer PageBreak-Modus
+ UpdatePageBreakData( true ); // for PageBreak-Mode
}
//----------------------------------------------------------------------------
@@ -919,7 +912,7 @@ void ScViewFunc::RemoveManualBreaks()
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
- pDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, sal_False, pUndoDoc );
+ pDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pUndoDoc );
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoRemoveBreaks( pDocSh, nTab, pUndoDoc ) );
}
@@ -1005,18 +998,12 @@ void ScViewFunc::SetPrintRanges( sal_Bool bEntireSheet, const String* pPrint,
else if ( rMark.IsMultiMarked() )
{
rMark.MarkToMulti();
- ScRangeListRef aList( new ScRangeList );
- rMark.FillRangeListWithMarks( aList, sal_False );
- sal_uInt16 nCnt = (sal_uInt16) aList->Count();
- if ( nCnt )
+ ScRangeListRef pList( new ScRangeList );
+ rMark.FillRangeListWithMarks( pList, false );
+ for (size_t i = 0, n = pList->size(); i < n; ++i)
{
- ScRangePtr pR;
- sal_uInt16 i;
- for ( pR = aList->First(), i=0; i < nCnt;
- pR = aList->Next(), i++ )
- {
- pDoc->AddPrintRange( nTab, *pR );
- }
+ ScRange* pR = (*pList)[i];
+ pDoc->AddPrintRange(nTab, *pR);
}
}
}
@@ -1066,9 +1053,9 @@ void ScViewFunc::SetPrintRanges( sal_Bool bEntireSheet, const String* pPrint,
}
//----------------------------------------------------------------------------
-// Zellen zusammenfassen
+// Merge cells
-sal_Bool ScViewFunc::TestMergeCells() // Vorab-Test (fuer Menue)
+sal_Bool ScViewFunc::TestMergeCells() // pre-test (for menu)
{
// simple test: sal_True if there's a selection but no multi selection and not filtered
@@ -1079,21 +1066,21 @@ sal_Bool ScViewFunc::TestMergeCells() // Vorab-Test (fuer Menue)
return GetViewData()->GetSimpleArea( aDummy) == SC_MARK_SIMPLE;
}
else
- return sal_False;
+ return false;
}
//----------------------------------------------------------------------------
-sal_Bool ScViewFunc::MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool bRecord )
+sal_Bool ScViewFunc::MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool bRecord, sal_Bool bCenter )
{
- // Editable- und Verschachtelungs-Abfrage muss vorneweg sein (auch in DocFunc),
- // damit dann nicht die Inhalte-QueryBox kommt
+ // Editable- and Being-Nested- test must be at the beginning (in DocFunc too),
+ // so that the Contents-QueryBox won't appear
ScEditableTester aTester( this );
if (!aTester.IsEditable())
{
ErrorMessage(aTester.GetMessageId());
- return sal_False;
+ return false;
}
ScMarkData& rMark = GetViewData()->GetMarkData();
@@ -1101,7 +1088,7 @@ sal_Bool ScViewFunc::MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool
if (!rMark.IsMarked())
{
ErrorMessage(STR_NOMULTISELECT);
- return sal_False;
+ return false;
}
ScDocShell* pDocSh = GetViewData()->GetDocShell();
@@ -1117,21 +1104,37 @@ sal_Bool ScViewFunc::MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool
SCTAB nEndTab = aMarkRange.aEnd.Tab();
if ( nStartCol == nEndCol && nStartRow == nEndRow )
{
- // nichts zu tun
- return sal_True;
+ // nothing to do
+ return true;
}
if ( pDoc->HasAttrib( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ) )
- { // "Zusammenfassen nicht verschachteln !"
+ { // "Don't nest merging !"
ErrorMessage(STR_MSSG_MERGECELLS_0);
- return sal_False;
+ return false;
+ }
+
+ // Check for the contents of all selected tables.
+ bool bAskDialog = false;
+ SCTAB nTabCount = pDoc->GetTableCount();
+ ScCellMergeOption aMergeOption(nStartCol, nStartRow, nEndCol, nEndRow, bCenter);
+ for (SCTAB i = 0; i < nTabCount; ++i)
+ {
+ if (!rMark.GetTableSelect(i))
+ // this table is not selected.
+ continue;
+
+ aMergeOption.maTabs.insert(i);
+
+ if (!pDoc->IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, nEndRow) ||
+ !pDoc->IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, nEndRow))
+ bAskDialog = true;
}
- sal_Bool bOk = sal_True;
+ sal_Bool bOk = true;
- if ( !pDoc->IsBlockEmpty( nStartTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
- !pDoc->IsBlockEmpty( nStartTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) )
+ if (bAskDialog)
{
if (!bApi)
{
@@ -1144,14 +1147,14 @@ sal_Bool ScViewFunc::MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool
if ( nRetVal == RET_YES )
rDoContents = sal_True;
else if ( nRetVal == RET_CANCEL )
- bOk = sal_False;
+ bOk = false;
}
}
if (bOk)
{
HideCursor();
- bOk = pDocSh->GetDocFunc().MergeCells( aMarkRange, rDoContents, bRecord, bApi );
+ bOk = pDocSh->GetDocFunc().MergeCells( aMergeOption, rDoContents, bRecord, bApi );
ShowCursor();
if (bOk)
@@ -1173,7 +1176,7 @@ sal_Bool ScViewFunc::MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool
sal_Bool ScViewFunc::TestRemoveMerge()
{
- sal_Bool bMerged = sal_False;
+ sal_Bool bMerged = false;
ScRange aRange;
if (GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE)
{
@@ -1187,6 +1190,32 @@ sal_Bool ScViewFunc::TestRemoveMerge()
//----------------------------------------------------------------------------
+static bool lcl_extendMergeRange(ScCellMergeOption& rOption, const ScRange& rRange)
+{
+ bool bExtended = false;
+ if (rOption.mnStartCol > rRange.aStart.Col())